Академический Документы
Профессиональный Документы
Культура Документы
INGENIERA DE CONTROL
Figura 1: Motor DC
() = (1)
+(+)++ 2
>> J=.01;
>> b=.1;
>> K=.01;
>> R=1;
>> L=.5;
>> num=[ 0 0 K ]
num =
0 0 0.0100
>> step(num,den,0:.1:5)
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V. PAG.43
U.N.F.V. INGENIERA DE CONTROL
Step Response
0.1
0.09
0.08
0.07
0.06
Amplitude
0.05
0.04
0.03
0.02
0.01
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time (sec)
>> [A,B,C,D]=tf2ss(num,den)
A=
-12.0000 -20.0200
1.0000 0
B=
1
0
C=
0 2
D=
0
>> step(A,B,C,D)
Step Response
0.1
0.09
0.08
0.07
0.06
Amplitude
0.05
0.04
0.03
0.02
0.01
0
0 0.5 1 1.5 2 2.5 3
Time (sec)
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V. PAG.44
U.N.F.V. INGENIERA DE CONTROL
>> impulse(num,den,0:.1:5)
Impulse Response
0.14
0.12
0.1
0.08
Amplitude
0.06
0.04
0.02
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time (sec)
x m
0 x
u M
x
''
M m m cos 2 (2)
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V. PAG.45
U.N.F.V. INGENIERA DE CONTROL
''
Ml ml ml cos 2 (3)
3. Espacio de Estado
x1 x2 '
'
(4)
x2 ''
'
Ml ml ml cos 2
(5)
x3 x4 x '
'
(6)
x4 x ''
'
M m m cos x1
2
(7)
x1
y1 1 0 0 0 x 2
y 2 0 0 1 0 x3 (8)
x
4
4. Linealizacin
x '1 f1 / x1 f1 / x 2 f1 / x3 f1 / x 4 x1 f1 / u
'
x 2 f 2 / x1 f 2 / x 2 f 2 / x3 f 2 / x 4 x2 f 2 / u
x ' f / x f 3 / x 2 f 3 / x3 f 3 / x 4 x f 3 / u
u
3 3 1
3
x ' 4 f / x
4 1 f 4 / x 2 f 4 / x3 f 4 / x 4 xi Pto.Operacin x 4
f 4 / u u Pto.Operacin
(9)
5. Linealizando en MatLab
5.1. Programa
% Programa : LinPenInv.m
% Descripcin :
clc
% Variables simbolicas
syms f1 f2 f3 f4 x1 x2 x3 x4 u m M l g
f1=x2
f2=((M+m)*g*sin(x1)-u*cos(x1)-m*l*x2^2*sin(x1)*cos(x1))/(M*l+m*l-m*l*(cos(x1))^2)
f3=x4
f4=(u+m*l*x2^2*sin(x1)-m*g*sin(x1)*cos(x1))/(M+m-m*(cos(x1))^2)
f=[f1;f2;f3;f4];
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V. PAG.46
U.N.F.V. INGENIERA DE CONTROL
f1 = x2
f2 = ((M+m)*g*sin(x1)-u*cos(x1)-m*l*x2^2*sin(x1)*cos(x1))/(M*l+m*l-m*l*cos(x1)^2)
f3 = x4
f4 = (u+m*l*x2^2*sin(x1)-m*g*sin(x1)*cos(x1))/(M+m-m*cos(x1)^2)
As = 0 1 0 0 Bs = 0
(M+m)*g/M/l 0 0 0 -1/M/l
0 0 0 1 0
-m*g/M 0 0 0 1/M
A= 0 1 0 0 B= 0
20.601 0 0 0 -1
0 0 0 1 0
-0.4905 0 0 0 0.5
C= 1 0 0 0 D= 0
0 0 1 0
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V. PAG.47
U.N.F.V. INGENIERA DE CONTROL
Step Response
0
-0.1
To: Out(1)
-0.2
-0.3
Amplitude
-0.4
0.1
0.08
To: Out(2)
0.06
0.04
0.02
0
0 0.1 0.2 0.3 0.4 0.5 0.6
Time (sec)
6. Simulink
(M+m)*g = 20.601
m*l = 0.05
M*l =1
m*g = 0.981
M+m = 2.1
f1 u(3)
f2 (20.601*sin(u(2))-u(1)*cos(u(2))-0.05* sin(u(2))*cos(u(2))*(u(3))^2)/(1.05-0.05*(cos(u(2)))^2)
f3 u(5)
f4 (u(1)+0.05*sin(u(2))*(u(3))^2-0.981*sin(u(2))*cos(u(2)))/(2.1-0.1*(cos(u(2)))^2)
A= 0 1 0 0 B= 0
20.601 0 0 0 -1
0 0 0 1 0
-.4905 0 0 0 0.5
C= 1 0 0 0 D= 0
0 0 1 0
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V. PAG.48
U.N.F.V. INGENIERA DE CONTROL
PENDULO INVERTIDO
MODELO NO LINEAL
Sistema:
f = [ u f1 f2 f3 f4 ] ' ynl: x1
x1nl: x1l
u x' x y ynl: x3
MATLAB
1/s C
Function
Step
Integrator Matriz C
Pendulo ynl: x1, x3
yl: x1
Entrada:u Sistema: [u, xi] Sistema ' : [u, xi] Sistema: [xi]
MODELO LINEALIZADO
yl: x3
x' x y
B
1/s C
Matrix Sum Integrator1 Matrix yl: x1, x3
Gain3 Gain1
A
Matrix
Gain2
%-------------------------------------------------------------------------------------------------------
% Programa : EulerPenInv.m
% Descripcion : dy/dx=2xy; yi(0)=.. xi(0)=..
% yi(f) con h=0.01
% y'=y(n+1)-y(n)/h => y(n+1)=y(n)+hy'
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V. PAG.49
U.N.F.V. INGENIERA DE CONTROL
% f=[ x2;
% ((M+m)*g*sin(x1)-u*cos(x1)-m*l*x2^2*sin(x1)*cos(x1))/(M*l+m*l-m*l*(cos(x1))^2);
% x4;
% (u+m*l*x2^2*sin(x1)-m*g*sin(x1)*cos(x1))/(M+m-m*(cos(x1))^2) ];
%
% x1 = x2 =' x3 =x x4 =x'
% x1'=' x2'='' x3'=x' x4'=x''
%-------------------------------------------------------------------------------------------------------
% f= f + h* [ f(2);
% ((M+m)*g*sin(f(1))-u*cos(f(1))-m*l*f(2)^2*sin(f(1))*cos(f(1)))/(M*l+m*l-m*l*(cos(f(1)))^2);
% f(4);
% (u+m*l*f(2)^2*sin(f(1))-m*g*sin(f(1))*cos(f(1)))/(M+m-m*(cos(f(1)))^2)];
%-------------------------------------------------------------------------------------------------------
clc; clear all;
m=0.1;M=2;l=0.5;g=9.81;
t=0; h=0.01; f=[0; 0; 0; 0];
tacu=t; facu=f; u=1;
for i=1:400
f=f+h*[ f(2);
((M+m)*g*sin(f(1))-u*cos(f(1))-m*l*f(2)^2*sin(f(1))*cos(f(1)))/(M*l+m*l-m*l*(cos(f(1)))^2);
f(4);
(u+m*l*f(2)^2*sin(f(1))-m*g*sin(f(1))*cos(f(1)))/(M+m-m*(cos(f(1)))^2) ];
t=t+h;
tacu=[tacu t];
facu=[facu f];
end
%plot(tacu',yacu(1,:)','r'); grid on;
plot(tacu,facu(1,:),'r'); grid on;
axis([min(tacu) max(tacu) min(facu(1,:)) max(facu(1,:))]);
title('Sistema de Pendulo Invertido');
xlabel('tiempo[seg]'); ylabel('Posicion D[rad/seg]');
%-------------------------------------------------------------------------------------------------------
11
10
8
Posicion Teta[rad]
Figura 9: Grfica de .
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V. PAG.50
U.N.F.V. INGENIERA DE CONTROL
-2
-4
-6
Posicion D?[rad/seg]
-8
-10
-12
-14
-16
-18
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V. PAG.51
U.N.F.V. INGENIERA DE CONTROL
= + (10)
= + (11)
2
N
d2 M
i 1
mi
dt 2
r i
j 1
m F
i j (12)
2 2 2
+ +
2
= (13)
2 2
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V. PAG.52
U.N.F.V. INGENIERA DE CONTROL
2 2 2
2
+ 2
( + ) + ( + ) = (14)
2 2
( + + ) ( + ) () + 2 ( + ) () = (15)
2 2
d2
N
i=1 Ji i =
=1 (16)
dt2
Y ordenando:
( + 2 ) () ( + 2) () = ( + ) (18)
Donde:
2 2
= ; = (19)
3
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V. PAG.53
U.N.F.V. INGENIERA DE CONTROL
+ = = (20)
= (21)
= + + (22)
Donde:
= + 2 (0 + ) (23)
= + 2 0 (24)
= (25)
= + + (26)
= ( + ) (27)
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V. PAG.54
U.N.F.V. INGENIERA DE CONTROL
= ( + ) (29)
2 2 2 2 2 2
Las ecuaciones (15), (18) y (29) representan el modelo matemtico del proceso
pndulo invertido controlado por la corriente de armadura. Tales ecuaciones
pueden ser escritas en forma compacta:
1 2 () 2 + 2 () = 0 (30)
2 () 2 () 1 = 0 (31)
= 2 (32)
Donde:
1 = + + ; 2 = + (33)
2
1 = + ; 2 = (34)
2 2
= ; = + (35)
2 2 2 2
1 = (36)
2 = (37)
3 = (38)
4 = (39)
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V. PAG.55
U.N.F.V. INGENIERA DE CONTROL
2
1 2 (1 )(cos 1 )2 2 (1 )4 (1 +2 )(1 )+ (1 )
(2( 2 1 )(1 +2 )1 )/2
[ 2] = 4
3
4 2 2 (1 )(1 )1 2 (1 )22 +1 4 1
[ 22 ( 2 1 )(1 +2 )1 ]
(40)
= (41)
Donde:
1 0 0 0
=[ ] (42)
0 0 1 0
= f(, ) (43)
= [ 1 2 3 4 ]
= [1 2 3 4 ] = [ 1 2 3 4 ]
)
f(x,u )
f(x,u
= f(x, u) +[ (x x) + (u u)]+
x u
1 2 f(x,u
) 2 f(x,u
) 2 f(x,u
)
[ (x x)2 + 2 (x x)(u u) + (u u)2 ] +
2! x2 x u u2
(44)
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V. PAG.56
U.N.F.V. INGENIERA DE CONTROL
f(0,0) f(0,0)
= f(0,0) + x+ u (45)
x u
Dado que f(, ) es una funcin de variable vectorial, su derivada parcial con
respecto a x y u viene a representar la operacin jacobiana. Entonces, la
ecuacin (44) se convierte en:
= + (47)
Donde:
0 0
(M1 +J2 )M2 g 1 0 Bx M2
(M1 +J2 )J1 M22 0 0 (M1 +J2 )J1 M22
= 0 (48)
0 0 1
M22 0 0 J1 Bx
[(M1+J2 )J1 M22 (M1 +J2 )J1 M22 ]
0
2
(M1 +J2 )J1 M22
= (49)
0
1
[(M1+J2)J1M22 ]
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V. PAG.57
U.N.F.V. INGENIERA DE CONTROL
Las ecuaciones de estado en tiempo continuo del proceso estn dadas por:
= ( ) + () (50)
( ) = ( ) + () (51)
(0 )
(t t 0 ) = (tt0 ) = =0 (53)
!
( + ) = () + () (54)
G = (T) (55)
= [0 ( ])() (56)
() = () + () (57)
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V. PAG.58
U.N.F.V. INGENIERA DE CONTROL
SISTEMA DE SEGUIMIENTO
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V. PAG.59