Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

José Yugo Yamaguchi Pellegrini EM707A – Controle de sistemas mecânicos

RA 146692 Prof. Dr. Janito Vaqueiro Ferreira

Anexos – Lista de exercícios 25

Exercício 1
%% Lista 25 - Exercício 1 %%
clear all; close all; clc
A = [0 0 1; 2 0 0; 0 -5 -3];
B = [0; 0; 1];
C = [1 0 0];
D = [0];

%% Item (a) %%
[NP,DP] = ss2tf(A,B,C,D);
P = tf(NP,DP)

%% Item (b) %%
verif = det(ctrb(A,B)) % Controlável
K = acker(A,B,[-6 -2+2*sqrt(3)*j -2-2*sqrt(3)*j]);
[nHn dHn] = ss2tf(A,B,K,D);
[nHd dHd] = ss2tf(A,B,C,D);
H = tf(conv(nHn,dHd),conv(dHn,nHd))

%% Item (c) %%
L = minreal(P*H)

%% Item (d) %%
rlocus(L)

%% Item (e) %%
margin(L)

%% Item (f) %%
At = A-B*K;
Bt = B;
Ct = C;
Dt = D;
Tss = ss(At,Bt,Ct,Dt);
T = tf(Tss)

%% Item (g) %%
pzmap(H)
eig(H) % Pólos
eig(1/H) % Zeros

%% Item (h) %%
pzmap(L)
eig(L) % Pólos
eig(1/L) % Zeros

%% Item (i) %%
pzmap(T)
eig(T) % Pólos
eig(1/T) % Zeros
Código 1

1/4
Item (d)

Root Locus
4

2
Imaginary Axis (seconds-1)

-1

-2

-3

-4
-7 -6 -5 -4 -3 -2 -1 0 1
-1
Real Axis (seconds )

Figura 1: Gráfico lugar das raízes referente ao exercício 1.

Exercício 2
%% Lista 25 - Exercício 2 %%
clear all; close all; clc
A = [0 1; 0 -0.05];
B = [0; 0.001];
C = [0 1];
D = [0];

%% Item (c) %%
PSS = 12;
csi = log(100/PSS)/sqrt(pi^2+log(100/PSS)^2);
test2 = 2;
wn = 4/(test2*csi);
p1 = -csi*wn+j*wn*sqrt(1-csi^2);
p2 = -csi*wn-j*wn*sqrt(1-csi^2);

verif = det(ctrb(A,B)) % Controlável


K = acker(A,B,[p1 p2]);

[nHn dHn] = ss2tf(A,B,K,D);


[nHd dHd] = ss2tf(A,B,C,D);
H = tf(conv(nHn,dHd),conv(dHn,nHd))

%% Item (d) %%
L = ss(A,B,K,D);
margin(L)

2/4
%% Item (e) %%
At = A-B*K;
Bt = B;
Ct = C;
Dt = D;

Tss = ss(At,Bt,Ct,Dt);
T = tf(Tss);

% Cteste = eye(2);
% Tssteste = ss(At,Bt,Cteste,Dt);
% rampa = tf(1,[1 0]);
% step(Tssteste*rampa) % Posição está sendo controlada

S = tf(1,[1 0]);
ST = minreal(S*T);

NST = ST.num{1};
DST = ST.den{1};
c = fliplr(NST);
b = fliplr(DST);

w0 = b(1)/c(1);
w1 = (b(2)-c(2)*w0)/c(1);
w2 = (b(3)-c(3)*w0- c(2)*w1)/c(1);
W = tf([w2 w1 w0],1);
WST = W*S*Tssteste;
step(WST*tf(1,[1 0 0])) % Ok
Código 2

Exercício 3
%% Lista 25 - Exercício 3 %%
clear all; close all; clc
A = [0 1; 0 0];
B = [0; 0.01];
C = [0 1];
D = [0];

%% Item (c) %%
verif = det(ctrb(A,B)) % Controlável
K = acker(A,B,[-1+j -1-j]);

[nHn dHn] = ss2tf(A,B,K,D);


[nHd dHd] = ss2tf(A,B,C,D);
H = tf(conv(nHn,dHd),conv(dHn,nHd))

%% Item (d) %%
L = ss(A,B,K,D);
margin(L)

%% Item (e) %%
At = A-B*K;
Bt = B;
Ct = C;
Dt = D;

Tss = ss(At,Bt,Ct,Dt);
T = tf(Tss);

3/4
% Cteste = eye(2);
% Tssteste = ss(At,Bt,Cteste,Dt);
% rampa = tf(1,[1 0]);
% step(Tssteste*rampa) % Posição está sendo controlada

S = tf(1,[1 0]);
ST = minreal(S*T);

NST = ST.num{1};
DST = ST.den{1};
c = fliplr(NST);
b = fliplr(DST);

w0 = b(1)/c(1);
w1 = (b(2)-c(2)*w0)/c(1);
w2 = (b(3)-c(3)*w0- c(2)*w1)/c(1);
W = tf([w2 w1 w0],1);
WST = W*S*Tssteste;
step(WST*tf(1,[1 0 0])) % Ok
Código 3

4/4

You might also like