Escolar Documentos
Profissional Documentos
Cultura Documentos
PROJETO DE CONTROLE
Recife, 2019
PROJETO DE CONTROLE
Recife, 2019
SUMÁRIO
Introdução .......................................................................................................... 4
Verificação.......................................................................................................... 9
Controlador PID................................................................................................ 17
Conclusão ........................................................................................................ 25
0 1 0 0
𝑥1̇ −𝐾1 × 𝑀22 −𝐶1 × 𝑀22 𝐾2 × 𝑀12 𝐶2 × 𝑀12 𝑥1
𝑥̇ 𝑀 𝑀 − 𝑀12 𝑀21 𝑀11 𝑀22 − 𝑀12 𝑀21 𝑀11 𝑀22 − 𝑀12 𝑀21 𝑀11 𝑀22 − 𝑀12 𝑀21 𝑥2
[ 2 ] = 11 22 × [𝑥 ]
𝑥3̇ 0 0 0 1 3
𝑥4̇ 𝐾1 × 𝑀21 𝐶1 × 𝑀21 −𝐾2 × 𝑀11 −𝐶1 × 𝑀11 𝑥4
[𝑀11 𝑀22 − 𝑀12 𝑀21 𝑀11 𝑀22 − 𝑀12 𝑀21 𝑀11 𝑀22 − 𝑀12 𝑀21 𝑀11 𝑀22 − 𝑀12 𝑀21 ]
0 0
𝑀22 −𝑀12
𝑀 𝑀 − 𝑀12 𝑀21 𝑀11 𝑀22 − 𝑀12 𝑀21 𝑇
+ 11 22 × [ 1]
0 0 𝑇2
−𝑀21 𝑀11
[𝑀11 𝑀22 − 𝑀12 𝑀21 𝑀11 𝑀22 − 𝑀12 𝑀21 ]
𝑥1
𝑌 1 0 0 0 𝑥
[ 1] = [ ] × [𝑥2 ]
𝑌2 0 0 1 0 3
𝑥4
Através dessas informações podemos também calcular a equação da F.T,
utilizando a relação entre F.T e E.E que é dada por:
𝐺(𝑠) = 𝐶(𝑠𝐼 − 𝐴)−1 𝐵 (3),
Mas como sugerido na descrição do projeto, poderemos escrever as Eqs (1,2)
na forma matricial dada por :
Sendo nossa G(s) definido, podemos com isso calcular as F.Ts G11, G12, G21,
G22 utilizando da função ode45 do Matlab para resolução dessa F.T, com isso
temos:
𝑴𝑄(𝑠)𝑠 2 + 𝑪𝑄(𝑠)𝑠 + 𝑲𝑄(𝑠) = 𝑈(𝑠)
𝑄(𝑠)(𝑴𝑠 2 + 𝑪𝑠 + 𝑲) = 𝑈(𝑠)
𝑄(𝑠)
𝐺(𝑠) = = (𝑴𝑠 2 + 𝑪𝑠 + 𝑲)−1
𝑈(𝑠)
𝐺11 𝐺12
𝐺(𝑠) = [ ]
𝐺21 𝐺22
Sendo:
𝐺11 (𝑠)
M22 s2 + C2 s + k2
=
k1 k2 + (C1 k2 + C2 k1)s + (M11 k2 + M22 k1 + C1 C2)s2 + (C2 M11 + C1 M22)s3 + (M11 M22 − M12 M21)s4
𝐺12 (𝑠)
−M12 s2
=
k1 k2 + (C1 k2 + C2 k1)s + (M11 k2 + M22 k1 + C1 C2)s2 + (C2 M11 + C1 M22)s3 + (M11 M22 − M12 M21)s4
𝐺21 (𝑠)
−M21 s2
=
k1 k2 + (C1 k2 + C2 k1)s + (M11 k2 + M22 k1 + C1 C2)s2 + (C2 M11 + C1 M22)s3 + (M11 M22 − M12 M21)s4
𝐺22 (𝑠)
M11 s2 + C1 s + k1
=
k1 k2 + (C1 k2 + C2 k1)s + (M11 k2 + M22 k1 + C1 C2)s2 + (C2 M11 + C1 M22)s3 + (M11 M22 − M12 M21)s4
Definição dos parâmetros
𝐺(𝑠)=𝑄(𝑠)𝑈(𝑠)=(𝑴𝑠2+𝑪𝑠+𝑲)−1,𝑜𝑛𝑑𝑒
G11 =
3
------------------
6*s^2 + s + 6
Continuous-time transfer function.
G22 =
3
--------------------
1.5*s^2 + s + 6
Continuous-time transfer function.
Routh
Figura1 -Root locus (G11 e G22)
systf =
From input 1 to output...
s^4 + 2.727 s^3 + 18.36 s^2 + 5.455 s + 19.64
1: ---------------------------------------------
s^4 + 2.727 s^3 + 16.73 s^2 + 4.364 s + 13.09
Verificação
Para esta etapa foi implantada ao sistema duas entradas senoidais, 𝑇1(𝑡)=sin
(𝜔1𝑡) e 𝑇2(𝑡)=sin (𝜔2𝑡+𝜑) .Sendo os valores de já declarados no código acima.
A solução foi encontrada utilizando a função ODE45 do Matlab, que tem como
objetivo resolver equações diferenciais. Foi necessária a criação de uma
função paralela para guardar as informações da equação estudada.
De forma a obter os gráficos requisitados no problema 3, primeiro foram
definidas as seguintes constantes:
• 𝜔1=2 rad/s
• 𝜔2=3 rad/s
• 𝜑 =0
O Matlab, possui uma função na qual ele tenta encontrar funções aproximadas
através de um ruído, sendo este ruído qualquer função de desejo. Para o nosso
caso foi implantado um ruído caracterizado por uma função senoidal. 𝑇1(𝑡)=sin
(𝜔1𝑡) e 𝑇2(𝑡)=cos(𝜔2𝑡) .
O ruído foi adicionado segundo o código abaixo:
r1 = awgn(alfa1,50);
figure
plot(t,r1) %plotar de saída 1 com
ruidos
grid on
xlabel('t');
ylabel('saída 1 com ruido');
r2 = awgn(alfa2,60);
figure
plot(t,r2) %plotar de saída 2 com
ruidos
grid on
xlabel('t');
ylabel('saída 2 com ruido');
u1 = sin(2*t);
u2 = cos(3*t);
Figura 7- Plot (t, Saida1 com ruído)
FT encontradas:
tf1 =
Name: tf1
Continuous-time identified transfer function.
Parameterization:
Number of poles: 5 Number of zeros: 3
Number of free coefficients: 9
Use "tfdata", "getpvec", "getcov" for parameters and their uncertainties.
Status:
Estimated using TFEST on time domain data "g11".
Fit to estimation data: 92.02% (simulation focus)
FPE: 0.0003769, MSE: 0.0003594
tf2 =
Name: tf2
Continuous-time identified transfer function.
Parameterization:
Number of poles: 5 Number of zeros: 3
Number of free coefficients: 9
Use "tfdata", "getpvec", "getcov" for parameters and their uncertainties.
Status:
Estimated using TFEST on time domain data "g11".
Fit to estimation data: 92.02% (simulation focus)
FPE: 0.0003769, MSE: 0.0003594
tf3 =
Name: tf3
Continuous-time identified transfer function.
Parameterization:
Number of poles: 5 Number of zeros: 3
Number of free coefficients: 9
Use "tfdata", "getpvec", "getcov" for parameters and their uncertainties.
Status:
Estimated using TFEST on time domain data "g11".
Fit to estimation data: 92.02% (simulation focus)
FPE: 0.0003769, MSE: 0.0003594
tf4 =
Parameterization:
Number of poles: 5 Number of zeros: 2
Number of free coefficients: 8
Use "tfdata", "getpvec", "getcov" for parameters and their uncertainties.
Status:
Estimated using TFEST on time domain data "g11".
Fit to estimation data: 89.41% (simulation focus)
FPE: 0.0006618, MSE: 0.0006333
function dx=edo_seno1(t,x)
y = x(1);
w = x(2);
u = x(3);
v = x(4);
dx1 = w;
dx2 = -3.2727*y - 0.5455*w + 5.4545*u + 0.9091*v + 1.6364*sin(2*t) -
2.7273*cos(3*t);
dx3 = v;
dx4 = 5.4545*y + 0.9091*w -13.0909*u -2.1818*v - 2.7273*sin(2*t)+
6.5455*cos(3*t);
dx=[dx1;dx2;dx3;dx4];
end
-------------------------------------------------------------------
J1=1;
J2=1/2;
m2=1;
l1=1;
l2=2/3;
K1=2;
K2=K1;
C1=1/3;
C2=C1;
M11=J1+m2*(l1)^2
M12=J2+(1/2)*(m2)*(l1)*(l2)
M21=M12;
M22=J2
I=eye(4);
Q=(M12*M21-M11*M22)
A=(1/Q)*[0 Q 0 0; K1*M22 C1*M22 -K2*M12 -C2*M12; 0 0 0 Q; -K1*M21 -C1*M21
K2*M11 C2*M11]
B=(1/Q)*[0 0; -M22 M12; 0 0; M21 -M11]
s=tf([1 0],[0 1]);
-------------------------------------------------------------------------
Codigo Geral
%---------item 1------------------%
a = [0 1 0 0;-3.2727 -0.5455 5.4545 0.9091; 0 0 0 1;5.4545 0.9091 -
13.0909 -2.1818];
b = [0 0;1.6364 -2.7273; 0 0;-2.7273 6.5455];
c = [1 0 0 0; 0 0 1 0];
d = eye(2);
%-----------item 2------------%
% k1 = 2 % k2 = k1 M11 = 2
% c1 = 1/3 % c2 = c1 M12 = 0.83
% j1 = 1 kg/m^2 % j2 = 0,5 kg/m^2 M22 = 0,5
% L1 = 1 m % L2 = 2/3 m
% --------item 2 -------------%
alfa1 =x(:,1);
alfa1ponto = x(:,2);
alfa2 =x(:,3);
alfa2ponto = x(:,4);
figure
plot(t,alfa1) %plotar resposta alfa1
grid on
xlabel('t');
ylabel('alfa1');
figure
plot(alfa1,alfa1ponto) %plotar alfa1 x alfa1ponto
grid on
xlabel('alfa1');
ylabel('alfa1ponto');
figure
plot(t,alfa2) %plotar resposta alfa2
grid on
xlabel('t');
ylabel('alfa2');
figure
plot(alfa2,alfa2ponto) %plotar alfa2 x alfa2ponto
grid on
xlabel('alfa2');
ylabel('alfa2ponto');
figure
plot(alfa1,alfa2) %plotar alfa1 x alfa2
grid on
xlabel('alfa1');
ylabel('alfa2');
%----------------item 3 -------------%
r1 = awgn(alfa1,50);
figure
plot(t,r1) %plotar de sa�da 1 com
ruidos
grid on
xlabel('t');
ylabel('sa�da 1 com ruido');
r2 = awgn(alfa2,60);
figure
plot(t,r2) %plotar de sa�da 2 com
ruidos
grid on
xlabel('t');
ylabel('sa�da 2 com ruido');
u1 = sin(2*t);
u2 = cos(3*t);
pause
ident;
% --------------item 5---------------%
pidTuner
Conclusão
Todos os quesitos solicitados no projeto foram cumpridos e seus resultados
estão apresentados no decorrer deste relatório.
Pudemos perceber, através do dado projeto, que é possível projetar
controladores com o objetivo de atender requisitos necessários de um sistema
qualquer solicitado, através de ferramentas computacionais a exemplo do
software MATLAB que foi o software utilizado neste projeto.
Referências bibliográficas