Está en la página 1de 17

INGENIERÍA ELECTROMECÁNICA

SEXTO NIVEL

ASIGNATURA: SISTEMAS DE CONTROL

FECHA: 27 de julio de 2014


PRUEBA DE LUGARES GEOMÉTRICOS CON MATLAB

INTEGRANTES: LEONARDO CHILIQUINGA


UNIVERSIDAD DE LAS FUERZAS ARMADAS
ESPE-EL

Contenido

1. TEMA: .......................................................................................................................................... 3
2. OBJETIVO GENERAL ..................................................................................................................... 3
3. RESUMEN .................................................................................................................................... 3
4. ABSTRACT .................................................................................................................................... 3
5. DESARROLLO ............................................................................................................................... 4
6. RECOMENDACIONES ................................................................................................................. 16
7. Bibliografía ................................................................................................................................ 16

2
UNIVERSIDAD DE LAS FUERZAS ARMADAS
ESPE-EL

1. TEMA:

Corrección de la prueba de MATLAB de los lugares geométricos

2. OBJETIVO GENERAL

 Emplear los comandos, ejercicios resueltos en el apéndice B para resolver los lugares
geométricos mediante el uso del software de MATLAB

3. RESUMEN

Se dará a conocer el tipo de respuesta que presenta un sistema mediante los


lugares geométricos a través de una gráfica, la misma que esta desarrollada con
la ayuda de Matlab, emplearemos la herramienta sisotool que nos permite el
entendimiento mediante la visualización de las gráficas de tipo respuesta en un
sistema en la que podremos cambiar el sobre impulso y su tiempo de
restablecimiento y agregar polos y ceros para compensar el sistema.

4. ABSTRACT

They will release the kind of response that has a system by loci through a graph,
the same that is developed with the help of Matlab, it will use the sisotool tool
that allows us the understanding by viewing the graphs of type response in a
system in which we can change the overshoot and settling time and adding poles
and zeros to make up the system.

3
UNIVERSIDAD DE LAS FUERZAS ARMADAS
ESPE-EL

5. DESARROLLO

Ingresar la función 𝒇(𝒕) = 𝟏/(𝒔 + 𝟏)(𝒔 + 𝟒).para poder realizar las respectivas gráficas del lugar
de trasferencia.
𝑘
𝐺(𝑠) =
(𝑠 + 1)(𝑠 + 4)

𝑘 =? ; 𝑇𝑠 =? ; %𝑂𝑆 = 20%

1 𝑇𝑠
𝒄𝒐𝒎𝒑𝒆𝒏𝒔𝒆 ∶ %𝑂𝑆 = 20% , 𝑇𝑆1 =
2

𝑘 =? ; 𝐺𝑠 =? ; 𝑒(𝛼) = 0

Para el desarrollo de los siguientes ejercicios se utilizó un programa realizado en matlab, lo cual
su código fuente se muestra a continuación

clc
clf % Clear graph on screen.
'Uncompensated System' % Display label.
numg=poly([]); % Generate numerator of G(s).
deng=poly([-2 -8]); % Generate denominator of G(s).
'G(s)' % Display label.
G=tf(numg,deng) % Create and display G(s).
pos=input('Ingrese el porcentaje de sobrepaso: ');
% Input desired percent overshoot.
z=-log(pos/100)/sqrt(pi^2+[log(pos/100)]^2);
% Calculate damping ratio.
rlocus(G,0:0.05:100) % Plot uncompensated root
locus.

sgrid(z,0) % Overlay desired percent overshoot


% line.
title(['Uncompensated Root Locus with ' , num2str(pos),...
'% Overshoot Line']) % Title uncompensated root locus.
[K,p]=rlocfind(G); % Generate gain, K, and closed-loop
% poles, p, for point selected
% interactively on the root locus.
'Closed-loop poles = ' % Display label.
p % Display closed-loop poles.
f=input('Escoja el polo dominante: ');

4
UNIVERSIDAD DE LAS FUERZAS ARMADAS
ESPE-EL

% Choose uncompensated system


% dominant pole.
'Summary of estimated specifications for selected point on'
'uncompensated root locus' % Display label.
operatingpoint=p(f) % Display uncompensated dominant
% pole.
Ganancia=K % Display uncompensated gain.
Ts=4/abs(real(p(f)))
% Display uncompensated settling
% time.
Tp=pi/abs(imag(p(f)))
% Display uncompensated peak time.
Sobrepaso=pos % Display uncompensated percent
% overshoot.
Valor_de_z=z % Display uncompensated damping
% ratio.
Wn=sqrt(real(p(f))^2+imag(p(f))^2)
% Display uncompensated natural
% frequency.
numkv=conv([1 0],numg); % Set up numerator to evaluate Kv.
denkv=deng; % Set up denominator to evaluate Kv.
sG=tf(numkv,denkv); % Create sG(s).
sG=minreal(sG); % Cancel common poles and zeros.
Kv=dcgain(K*sG) % Display uncompensated Kv.
ess=1/Kv % Display uncompensated steady-state
% error for unit ramp input.
'T(s)' % Display label.
T=feedback(K*G,1) % Find uncompensated T(s).
step(T) % Plot step response of uncompensated
% system.
title(['Uncompensated System Step Response with ',num2str(pos),...
'% Overshoot']) % Add title to uncompensated step
% response.
'Press any key to go to PD compensation'
% Display label.
pause
'Compensated system' % Display label.
Ts=input('Ingrese el nuevo tiempo de establecimiento: ');
% Input desired settling time from
% the keyboard.
wn=4/(Ts*z); % Calculate natural frequency.
desired_pole=(-z*wn)+(wn*sqrt(1-z^2)*i);
% Calculate desired dominant pole
% location.
angle_at_desired_pole=(180/pi)*...
angle(polyval(numg,desired_pole)/polyval(deng,desired_pole));
% Calculate angular contribution to
% desired pole without PD
% compensator.
PD_angle=180-angle_at_desired_pole; % Calculate required angular
% contribution from PD compensator.
zc=((imag(desired_pole)/tan(PD_angle*pi/180))-real(desired_pole));

5
UNIVERSIDAD DE LAS FUERZAS ARMADAS
ESPE-EL

% Calculate PD zero location.


'PD Compensator' % Display label.
numc=[1 zc]; % Calculate numerator of Gc(s).
denc=[0 1]; % Calculate denominator of Gc(s).
'Gc(s)' % Display label.
Gc=tf(numc,denc) % Create and display Gc(s).
'G(s)Gc(s)' % Display label.
Ge=G*Gc % Cascade G(s) and Gc(s).
rlocus(Ge,0:0.5:100) % Plot root locus of PD compensated
% system.
sgrid(z,0) % Overlay desired percent overshoot
% line.
title(['PD Compensated Root Locus with ' , num2str(pos),...
'% Overshoot Line']) % Add title to PD compensated root
% locus.
[K,p]=rlocfind(Ge); % Generate gain, K, and closed-loop
% poles, p, for point selected
% interactively on the root locus.
'Closed-loop poles = ' % Display label.
p % Display PD compensated system's
% closed-loop poles.
f=input('Give pole number that is operating point ');
% Choose PD compensated system
% dominant pole.
'Summary of estimated specifications for selected point on PD'
'compensated root locus' % Display label.
operatingpoint=p(f) % Display PD compensated dominant
% pole.
Ganancia=K % Display PD compensated gain.
Ts=4/abs(real(p(f)))
% Display PD compensated settling
% time.
Tp=pi/abs(imag(p(f)))
% Display PD compensated peak time.
Sobrepaso=pos % Display PD compensated percent
% overshoot.
Valor_de_z=z % Display PD compensated damping
% ratio.
estimated_natural_frequency=sqrt(real(p(f))^2+imag(p(f))^2)
% Display PD compensated natural
% frequency.
s=tf([1 0],1); % Create transfer function, 's'.
sGe=s*Ge; % Create sGe(s).
sGe=minreal(sGe); % Cancel common poles and zeros.
Kv=dcgain(K*sGe) % Display compensated Kv.
ess=1/Kv % Display compensated steady-state
% error for unit ramp input.
'T(s)' % Display label.
T=feedback(K*Ge,1) % Create and display PD compensated
% T(s).
'Press any key to continue and obtain the PD compensated step response'
% Display label.

6
UNIVERSIDAD DE LAS FUERZAS ARMADAS
ESPE-EL

pause
step(T) % Plot step response for PD
% compensated system.
title(['PD Compensated System Step Response with ' ,num2str(pos),...
'% Overshoot']) % Add title to step response of PD
% compensated system.

 Captura del proceso de obtención de la función de transferencia y lo cálculos requeridos

7
UNIVERSIDAD DE LAS FUERZAS ARMADAS
ESPE-EL

8
UNIVERSIDAD DE LAS FUERZAS ARMADAS
ESPE-EL

 Datos obtenidos de Matlab

selected_point =

-2.4917 + 4.8913i 0.6423

ans = Sobrepaso =

Closed-loop poles = 20

p= Valor_de_z =

-2.5000 + 4.8913i 0.4559

-2.5000 - 4.8913i Wn =

Escoja el polo dominante: a 1 5.4932

Escoja el polo dominante: 1 Kv =

ans = 0

Summary of estimated specifications for ess =


selected point on
Inf
ans =
ans =
uncompensated root locus
T(s)
operatingpoint =

-2.5000 + 4.8913i
Transfer function:
Ganancia =
26.17
26.1749
-----------------
Ts =
s^2 + 5 s + 30.17
1.6000
ans =

Tp =
Press any key to go to PD compensation

9
 Nuevo tiempo de asentamiento

:
UNIVERSIDAD DE LAS FUERZAS ARMADAS
ESPE-EL

11
UNIVERSIDAD DE LAS FUERZAS ARMADAS
ESPE-EL

12
UNIVERSIDAD DE LAS FUERZAS ARMADAS
ESPE-EL

 Para calcular Error =0

Utilizamos el siguiente código fuente

clc

clear % Clear variables from workspace.


clf % clear graph on screen.
numg=poly([-23.25 -0.5]); % Define numerator of
G(s).
deng=poly([0 -1 -4 ]); % Define denominator of G(s).
'G(s)' % Display label.
G=tf(numg,deng) % Create and display G(s).
rlocus(G) % Draw root locus (H(s)=1).
title('Original Root Locus') % Add title.
pause
K=0:.5:50; % Specify range of gain to smooth
% root locus.
rlocus(G,K) % Draw smoothed root locus (H(s)=1).
title('Smoothed Root Locus') % Add title.
pos=input('Type %OS '); % Input desired percent overshoot
% from the keyboard.
z=-log(pos/100)/sqrt(pi^2+[log(pos/100)]^2)
% Calculate damping ratio.
sgrid(z,0) % Overlay desired damping ratio line
% on root locus.
title(['Root Locus with ',num2str(pos),'% overshoot line'])
% Define title for root locus
% showing percent overshoot used.
[K,p]=rlocfind(G) % Generate gain, K, and closed-loop
% poles, p, for point selected
% interactively on the root locus.
pause
'T(s)' % Display label.
T=feedback(K*G,1) % Find closed-loop transfer function
% with selected K and display.
step(T) % Generate closed-loop step response
% for point selected on root locus.
title(['Step Response for K=',num2str(K)])
% Give step response a title which
% includes the value of K.

13
UNIVERSIDAD DE LAS FUERZAS ARMADAS
ESPE-EL

14
UNIVERSIDAD DE LAS FUERZAS ARMADAS
ESPE-EL

15
UNIVERSIDAD DE LAS FUERZAS ARMADAS
ESPE-EL

COCLUSIONES

 Para iniciar a programar en Matlab debemos tener de antemano el conocimiento


acerca de la función de transferencia.
 Una vez obtenida la función de trasferencia pasamos el caso a pasamos a un
diagrama esquemático
 Con el diagrama esquemático podemos hallar el modelo correspondiente.
 El software Matlab es un software de carácter interdisciplinario el cual se
convierte en una buena herramienta.

6. RECOMENDACIONES

 Es recomendable ir ejecutando cada instrucción del programa y verificar que se


vaya cumpliendo como se requiere.
 Se recomienda a la vez ir guardando periódicamente el programa.
 En la ejecución del programa se debe tener cuidado de no asignar como variables
a nombres de comandos, puesto que de esta manera no se ejecutara el programa.
 A la vez se debe tener cuidado de ocupar varias variables, no ocupar la misma
variable en mayúscula como en minúscula.

7. Bibliografía

(2000). En M. Khoo, Physiological Control Systems:Analysis, Simulation, and Estimation (págs. 101-
130). Wiley.

Aires, F. d. (s.f.). Materias . Obtenido de Sistemas de Control:


http://materias.fi.uba.ar/6722/matlabclase1.pdf

Hellerstein, J. (2004). PID Controllers . En J. Hellerstein, PID Controllers (págs. 293-335). Wiley.

Krause, P., & Wasynczuk, O. (2002). En Analysis of Electric Machinery and Drive Systems (págs.
605-613). Wiley.

Nise, N. S. (2006). Sistemas de Control para Ingenieria. Mexico: Continental .

16
UNIVERSIDAD DE LAS FUERZAS ARMADAS
ESPE-EL

Wikipedia. (s.f.). Wikipedia. Obtenido de http://es.wikipedia.org/wiki/MATLAB

17

También podría gustarte