Universidad de Guanajuato / DICIS / Control Industrial: 1 Objective

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Universidad de Guanajuato / DICIS / Control

Industrial
Converter

–Longoria Vázquez, Omar Alejandro–


Number List: 18
omarlongoria94@gmail.com
oa.longoriavazquez@ugto.mx
February 4, 2018

1 Objective
To write a program that allows a user to input the percentage of current that
he wants to get from the converter. The range of the converter is from 4 to 20
mA. The zero percent represents 4 mA and the full percent is equal to 20 mA.

2 Methodology
The program was written using the software MatLab. To accomplish the objec-
tive, an interpolation was used, setting the lowest value (4 mA) to zero percent
and the highest value (20 mA) to one hundred percent, resulting in the next
equation:
16(100 − P )
i = 20 − (1)
100
Where:

i= is the resultant current from the converter (output current).


P= is the percentage of current that the user wants to get.

A dialog box were used to allow the user to input the percentage and another
one to show the output current from the converter.

Figure 1: Input dialog box

1
Universidad de Guanajuato Control Industrial

Figure 2: Output dialog box

Matlab Code
1 %U n i v e r s i d a d de Guanajuato
2 %DICIS
3 %C o n t r o l I n d u s t r i a l
4 %L o n g o r i a Vázquez , Omar A l e j a n d r o
5 %NUA: 311309
6 %Número de l i s t a : 18
7 %Correo : o m a r l o n g o r i a 9 4 @ g m a i l . com
8 %Tarea 0 1 : C o n v e r t e r program
9

10 clc
11 clearvars
12 prompt={ ’ Enter t h e p e r c e n t a g e o f c u r r e n t you want t o g e t
i n mA (0% t o 100%) ’ } ;
13 name = ’ Current C o n v e r t e r ’ ;
14 answer = i n p u t d l g ( prompt , name , [ 1 6 0 ] ) ;
15 p e r c e n t a g e=s t r 2 d o u b l e ( answer { 1 } ) ;
16 c u r r e n t =20 −((16∗(100 − p e r c e n t a g e ) ) / ( 1 0 0 ) ) ;
17 answer1=msgbox ( s p r i n t f ( ’ The c u r r e n t i s %f mA’ , c u r r e n t ) ) ;

You might also like