Escolar Documentos
Profissional Documentos
Cultura Documentos
INGENIERA DE CONTROL
Figura 1: Motor DC
( )
(1)
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.43
INGENIERA DE CONTROL
Step Response
0.1
0.09
0.08
0.07
Amplitude
0.06
0.05
0.04
0.03
0.02
0.01
0
0.5
1.5
2.5
3.5
4.5
Time (sec)
Amplitude
0.06
0.05
0.04
0.03
0.02
0.01
0
0.5
1.5
2.5
Time (sec)
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.44
INGENIERA DE CONTROL
>> impulse(num,den,0:.1:5)
Impulse Response
0.14
0.12
Amplitude
0.1
0.08
0.06
0.04
0.02
0.5
1.5
2.5
3.5
4.5
Time (sec)
m
l
0
u
''
(2)
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.45
INGENIERA DE CONTROL
''
(3)
3. Espacio de Estado
x1 x2 '
'
(4)
'
x3 x4 x '
(5)
'
(6)
'
x1
y1 1 0 0 0 x 2
y 2 0 0 1 0 x3
x
4
4. Linealizacin
x '1 f1 / x1
'
x 2 f 2 / x1
' f / x
1
x 3 3
x ' 4 f / x
1
4
f1 / x 2
f1 / x3
f 2 / x 2
f 2 / x3
f 3 / x 2
f 3 / x3
f 4 / x 2
f 4 / x3
(7)
(8)
f1 / x 4
x1 f1 / u
f 2 / x 4
x 2 f 2 / u
u
x f / u
f 3 / x 4
3
3
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
INGENIERA DE CONTROL
f3 = x4
f4 = (u+m*l*x2^2*sin(x1)-m*g*sin(x1)*cos(x1))/(M+m-m*cos(x1)^2)
As =
0
(M+m)*g/M/l
0
-m*g/M
1
0
0
0
0
0
0
0
0
0
1
0
Bs =
0
-1/M/l
0
1/M
A=
0
20.601
0
-0.4905
1
0
0
0
0
0
0
0
0
0
1
0
B=
0
-1
0
0.5
C=
1
0
0
0
0
1
0
0
D=
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.47
INGENIERA DE CONTROL
Step Response
0
To: Out(1)
-0.1
-0.2
Amplitude
-0.3
-0.4
0.1
To: Out(2)
0.08
0.06
0.04
0.02
0
0.1
0.2
0.3
0.4
0.5
0.6
Time (sec)
= 20.601
= 0.05
=1
= 0.981
= 2.1
u(3)
(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)
u(5)
(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
20.601
0
-.4905
1
0
0
0
0
0
0
0
0
0
1
0
B=
0
-1
0
0.5
C=
1
0
0
0
0
1
0
0
D=
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.48
INGENIERA DE CONTROL
PENDULO INVERTIDO
MODELO NO LINEAL
Sistema:
f = [ u f1 f2 f3 f4 ] '
ynl: x1
x1nl: x1l
u
MATLAB
Function
Step
x'
Pendulo
ynl: x3
1/s
Integrator
Matriz C
ynl: x1, x3
yl: x1
Entrada:u
MODELO LINEALIZADO
yl: x3
x'
B
Matrix
Gain3
Sum
1/s
Integrator1
Matrix
Gain1
yl: x1, x3
Matrix
Gain2
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]');
%------------------------------------------------------------------------------------------------------Sistema de Pendulo Invertido
11
10
9
Posicion Teta[rad]
8
7
6
5
4
3
2
1
0
0.5
1.5
2
2.5
Tiempo[seg]
3.5
Figura 9: Grfica de .
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.50
INGENIERA DE CONTROL
Posicion D?[rad/seg]
-4
-6
-8
-10
-12
-14
-16
-18
0
0.5
1.5
2
2.5
tiempo[seg]
3.5
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.51
INGENIERA DE CONTROL
(10)
(11)
M
d2
m
r
i
m
F
i
i j
2
dt
i 1
j 1
N
(12)
Luego, sustituyendo
obtenemos:
(ecuacin (10)) y
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.52
INGENIERA DE CONTROL
(14)
)(
)(
(15)
(16)
(17)
Y ordenando:
) (
) (
(18)
Donde:
(19)
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.53
INGENIERA DE CONTROL
(20)
(21)
(22)
Donde:
(23)
(24)
se obtiene:
(26)
(27)
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.54
INGENIERA DE CONTROL
(29)
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:
(
(
(30)
(31)
(32)
Donde:
(33)
(34)
(35)
(37)
(38)
(39)
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.55
INGENIERA DE CONTROL
[ ]
)(
(
(
)(
) (
) (
)
) )
) (
(40)
Y puesto que en nuestro sistema tenemos como salidas disponibles el
desplazamiento angular de la varilla y el desplazamiento del carro, la ecuacin
de salida toma la forma siguiente:
(41)
Donde:
(42)
(43)
( )
( )
[
)
( )
)
( )
( )
)(
)]+
)
( )
) ]
(44)
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.56
INGENIERA DE CONTROL
(45)
)
[
(46)
(47)
Donde:
(
[(
[(
(48)
(49)
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.57
INGENIERA DE CONTROL
( )
( )
( )
( )
(50)
( )
(51)
( )
Donde
) ( )
( )
(52)
es el tiempo inicial, y:
(53)
(
Donde
(54)
( )
[
se obtienen de:
(55)
(]) ()
(56)
(57)
En donde
y
son matrices constantes que no dependen del periodo de
muestreo ; por consiguiente, son las mismas que para el caso continuo.
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.58
INGENIERA DE CONTROL
SISTEMA DE SEGUIMIENTO
____________________________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.59