Conceitos Basicos
Eduardo M. A. M. Mendes
DELT - UFMG
Curso de Engenharia de Controle e Automacao
Universidade Federal de Minas Gerais
emmendes@cpdee.ufmg.br
Avaliacao
2 Provas - 40 e 40 pontos
1 Trabalho Final - 20 pontos - tema envolvendo a materia.
Avaliacao
2 Provas - 40 e 40 pontos
1 Trabalho Final - 20 pontos - tema envolvendo a materia.
Bibliografia
Livro Texto - The Essentials of Linear State-Space Systems, J.
Dwight Aplevich, John Wiley & Sons, 2000.
Outras referencias :
Control Systems Design: An Introduction to State-Space Methods,
Bernard Friedland, Dover Publications, 1986.
A Linear Systems Primer, Panos J. Antsaklis e Anthony N. Michel,
Birkhauser Boston, 2007.
Linear System Theory and Design, Chi-Tsong Chen, 3a. edicao, Oxford
University Press, 1999.
Modern Control Theory, William L. Brogan, Prentice Hall, 1991.
Software
Matlab - www.mathworks.com (O PPGEE possui varias licencas)
Entradas
| {zexternas} + |variaveis{zinternas} = funcao instantanea
ui xi
y1 (t) = g1 (x1 (t), . . . , xn (t), u1 (t), . . . , un (t))
..
.
yp (t) = gp (x1 (t), . . . , xn (t), u1 (t), . . . , un (t))
Note que:
U(t) = Rm m entradas
X (t) = Rn ou Cn n estados
Y (t) = Rp p sadas
U(t) = Zm
2
X (t) = Zn2 {0, 1} modulo 2
Y (t) = Zp2
Figura 2: Tanque
Temos:
fluxo de entrada - u(t)
fluxo de sada - y (t)
x - volume acumulado, logo y = g (x) - fluxo de sada em funcao de x e
das caractersticas do lquido e do recipiente.
dx
A variacao do volume e dt = u g (x)
d 2x f
Sabemos que dt 2
= M - Lei de Newton. Mas
f = f1 + f2
|{z} |{z}
dx Kx
dt
Logo:
d 2x dx
dt + Kx
=
dt 2 M
a
Objetivo: Equacoes diferenciais de 1 ordem. Para isso, consideraremos a
velocidade e a posicao como variaveis de estado:
dx
=v e x
dt
Eduardo Mendes (DELT - UFMG Curso de Engenharia de Controle
MACSINe Automacao Universidade Federal de Minas Gerais emmendes@cpd
12 / 65
Exemplo (cont.)
Logo
dv v + Kx
=
dt M
a
Juntando as duas equacoes de 1 ordem, temos
dx
dt = v
dv
dt = = v M
+Kx
K1
pm = pe = pm
K2
K2 = K1 = K
e
|{z} |{z}
v = R
|{z} i
Tensao de entrada f.e.m Resistencia de armadura
d
=J
dt
Portanto
d K1 (e v )
J = K1 i =
dt R
K1 e K1 K2
=
R R
Finalmente
d K1 K2 K1
= + e
dt JR JR
Este modelo e adequado para controle de velocidade. Caso se deseje
controlar a posicao, devemos considerar o angulo
d
=
dt
Assim
0 1 0
= K1 K2 + K1 e
0 JR
JR
O diagrama de blocos toma a seguinte forma
dv1 1 1 1 1
C1 + + v1 v2 eo = 0
dt R1 R3 R3 R1
dv2 1 1 1 1
C2 + + v2 v1 eo = 0
dt R2 R3 R3 R2
C11 1 1
R1 + R3
1 1
T1 C1 R3 T1 C1 R1
= + 1 To
T2 1
C12 R12 + R13 T2 C2 R2
C2 R3
onde:
u - entrada de controle para o servo.
- velocidade angular da torre
p - aceleracao angular
q - posicao da servo-valvula hidraulica
Km - ganho do servomotor
J - momento de inercia da torre
Eduardo Mendes (DELT - UFMG Curso de Engenharia de Controle
MACSINe Automacao Universidade Federal de Minas Gerais emmendes@cpd
24 / 65
Exemplo (cont.)
1
dvc
dt
0 C vc 0
= + 1 vi
di
dt L1 R1 +R
L
2
i L
v
vo = [1 R1 ] c + [1]vi
i
x1 (t) = a11 x1 (t) + . . . + a1n xn (t) + b11 u1 (t) + . . . + b1m um (t)
.. ..
. .
xn (t) = an1 x1 (t) + . . . + ann xn (t) + bn1 u1 (t) + . . . + bnm um (t)
y1 (t) = c11 x1 (t) + . . . + c1n xn (t) + d11 u1 (t) + . . . + d1m um (t)
.. ..
. .
yp (t) = cp1 x1 (t) + . . . + cpn xn (t) + dp1 u1 (t) + . . . + dpm um (t)
{x = 2tx
onde f (X , U, t) = f (x, t) = 2tx.
Se aplicarmos o teste de invariancia temporal, temos
fi (X , U, T )
= 2x so e zero em x = 0
t
Entretanto se escolhermos um novo par de estados tal como
x1 = x
x2 = t
teremos
x1 2x1 x2
=
x2 1
que e invariante no tempo.
Eduardo Mendes (DELT - UFMG Curso de Engenharia de Controle
MACSINe Automacao Universidade Federal de Minas Gerais emmendes@cpd
30 / 65
Modelos Lineares
Considerando
X (t) = F (X (t), U(t), t)
Y (t) = G (X (t), U(t), t)
supondo que U o (t) X o (t) Y o (t) (Por exemplo, regime permanente)
e que
dxi (t)
= fi (x1 , . . . , xn , u1 , . . . , um , t)
dt
a equacao pode ser expandida como
d(xio + xi )
fi fi
= fi (x1o , . . . , xno , u1o , . . . , um
o
, t) + x1 + . . . + xn +
dt x1 o xn o
fi fi fi
u1 + . . . + un + termos em + ordem superior
u1 o un o t o
f1 f1
...
x1 o x1
x1 o
dX o
+ dX
= F (X o , U o , t) +
.. .. .. .. +
dt dt . . . .
fn fn
. . . xn xn
x1 o o
f1 f1
...
um o u1
u1 o
.. .. .. .. + . . .
. . .
.
fn
... fn um
u1 o um o
f1 (x1 , x2 , x3 ) = 10(x1 + x2 )
f2 (x1 , x2 , x3 ) = 28x1 x2 x1 x2
8
f3 (x1 , x2 , x3 ) = x3 + x1 x2
3
f
Repare que t = 0 invariante no tempo
10 10 0
J = 28 x3 1 x1
x2 x1 83
Os pontos de equilbrio sao:
Fazendo as equacoes do campo vetorial iguais a zero
f1 (x1 , x2 , x3 ) = 10 (x1 + x2 ) = 0
| {z }
x1 =x2
f2 (x1 , x2 , x3 ) = 28x1 x2 x1 x2 = 0
8
f3 (x1 , x2 , x3 ) = x3 + x1 x2 = 0
3
28x1 x2 x1 x2 = 0
x1 = 0
(27 x3 )x1 = 0
x3 = 27
38 x3 + x1 x2 = 0
x1 = 0 x3 = 0
38 x3 + x12 = 0
x3 = 27 x1 = 72
Logo
0 72
Xo1 = 0 , Xo2,3 = 72
0 27
Parte Eletrica
1 Qg
I = Vin = Q
R A
Q2
+ mg + bg + k(g go ) = 0
2A
Podemos definir as seguintes variaveis de estado
x1 = Q
x2 = g
x3 = g
As equacoes de estado sao
= R1 Vin xA
1 x2
x1
x2 = x3
x12
x3 = m1 2A + k(x2 go ) + bx3
dydt=zeros(size(y));
% Parameters
R=0.001; % Resistor
epsilon=1; % Permittivity
A=100.0; % Area
m=1.0; % Mass
k=1; % Spring Constant
b=0.5; % Damping Constant
g0=1; % Initial gap
gmin=0.01; % Minimum gap
% Input
% States
dydt(1) = (1/R)*(Vin-(y(1)*y(2))/(epsilon*A));
dydt(2) = y(3);
dydt(3) = -(1/m)*((y(1)*y(1))/(2*epsilon*A)+k*(y(2)-g0)+b*y(3));
function u = external_input(t,SP1,SP2,t0)
% function u = external_input(t,SP1,SP2,t0) returns the value of a
% step input starting at t0
%
if (t<=t0)
u=SP1;
else
u=SP2;
end;
clc;close all;clear;
dt=0.01;
oldOpts=odeset;
newOpts=odeset(oldOpts,InitialStep,dt,MaxStep,dt);
% External values
t=(0:dt:tff);
[ans,y]=ode45(@eleactuator,t,y0,newOpts,0,Vin,0);
% Linearization
%% Parameters
R=0.001; % Resistor
epsilon=1; % Permittivity
A=100.0; % Area
m=1.0; % Mass
% States
f=sym(f);
X1=sym(X1);
X2=sym(X2);
X3=sym(X3);
V=sym(V);
f=[
(1/R)*(V-(X1*X2)/(epsilon*A))
X3
-(1/m)*((X1*X1)/(2*epsilon*A)+k*(X2-g0)+b*X3)];
A=jacobian(f,[X1 X2 X3]);
% Fixed Point
x3=0;
aux=subs(solve(f(1),X1),V,Vin);
aux=subs(subs(f(3),X1,aux),X3,x3);
x2=solve(aux,X2);
disp( );
disp(Check whether the fixed points for X2 are complex or not);
eval(x2)
disp(I am assuming that they are not and therefore taking the
absolute value of them.);
x2=abs(eval(x2));
x1=zeros(3,1);
for i=1:3
x1(i)=eval(solve(subs(subs(f(1),X2,x2(i)),V,Vin),X1));
end;
a=subs(subs(subs(subs(A,X1,x1(1)),X2,x2(1)),X3,x3),V,Vin);
b=subs(subs(subs(subs(B,X1,x1(1)),X2,x2(1)),X3,x3),V,Vin);
c=eye(3);
d=0;
sys=ss(a,b,c,d);
for j=1:length(Ku)
[ans,y1]=ode45(@eleactuator,t,yss,newOpts,Vin,Vin+Ku(j),t0);
i=find(t>=t0);
u=zeros(size(t));
u(i)=Ku(j)*ones(size(i));
yl=lsim(sys,u,t);
figure(1+j);
subplot(3,1,1);
plot(t,y1(:,1),t,yl(:,1)+yss(1));
title(sprintf(Nonlinear versus Linear - operating point - a step of %
applied,Ku(j)));
xlabel(Time);ylabel(Output);grid;legend(Nonlinear,Linear);
subplot(3,1,2);
plot(t,y1(:,2),t,yl(:,2)+yss(2));
xlabel(Time);ylabel(Output);grid;legend(Nonlinear,Linear);
subplot(3,1,3);
plot(t,y1(:,3),t,yl(:,3)+yss(3));
xlabel(Time);ylabel(Output);grid;legend(Nonlinear,Linear);
end;
disp( );
disp(We can clearly see that the linearization only works for small);
disp(values of perturbations around the operating point);
A solucao e
para X
para Y
Em forma matricial
U(to )
U(to + 1)
..
Y (l) = CAlto X (to )+ CAlto 1 B AC lto 2 B .
... CAB CB D
U(l 2)
U(l 1)
U(l)
A resposta livre e
Ylivre (l) = CAltO X (1) (to ) + X (2) (to )
(1) (2)
= Y (t ) + Y (t ) linear
livre o livre o
A matriz Alto e chamada Matriz de Transicao de Estados
Observacoes
A matriz de transicao de estados existe para l to
A resposta forcada e
U(to )
U(to + 1)
..
lt 1
Yf (l) = CA o B AC lto 2
B . . . CAB CB D
.
U(l 2)
U(l 1)
U(l)
Resposta ao Impulso
Definicao
{H(k)}
0 = {H(0), H(1), H(2), . . . , H(k), . . .}
Exemplo 1
Dada a seguinte representacao em espaco de estados
1 1 1
A= ,B = ,C = 1 0 ,D = 1
0 1 0
Obter {H( )}k0
Solucao
H(0) = D = 1
H(1) = CB = 1
..
.
H(k) = CAk1 B = 1
A0 = 1, B 0 = 1, C 0 = 1, D 0 = 1
Solucao
H 0 (0) = D 0 = 1
H 0 (1) = C 0 B 0 = 1
..
.
H 0 (k) = C 0 A0k1 B 0 = 1
Yf = Yf
sistema 1 sistema 2
Considere
{U (1) (k)} = {e1 , 0, 0, . . .}
ei - vetor de dimensao m de zeros exceto na posicao i.
Logo
{H(k)}
0 Resposta ao Impulso