Professional Documents
Culture Documents
close all
clear all
% -----------------------------------------
% Lag-Lead Ball and bema
% -----------------------------------------
os=20;
%---------------------- Matriz Linealizada A -------------
A=[0, 1, 0, 0 ;...
0, 0, (-9.7504), 0 ;...
0, 0, 0, 1;...
(-917.1669), 0, 0, 0]
A =
1.0e+02 *
0 0.010000000000000 0 0
0 0 -0.097504000000000 0
0 0 0 0.010000000000000
-9.171669000000001 0 0 0
B =
1.0e+02 *
0
0
0
2.449960000000000
C =
1 0 0 0
% Aoz=[0 1 0 0;...
% 0 0 1 0;...
% 0 0 0 1;...
% 9.7245789 -9.72458 (9.7245*i) (-9.7245*i)];
[num,dem]=ss2tf(A,B,C,0);
Tf=zpk(tf(num,dem))
Tf =
-2388.8
---------------------------------
1
(s+9.725) (s-9.725) (s^2 + 94.57)
p1=9.725;
p2=-9.725;
p3=0;
p4=0;
% os=exp(-pi*zita/(sqrt(1-zita^2)))*100;
zita=-log(os/100)/sqrt(pi^2+log(os/100)^2)
zita =
0.455949810769126
theta=acos(zita)*180/pi
theta =
62.873936608351372
[wnx,kx]=CondMagAng([],[p1 p2 p3 p4],zita)
G0 =
-2388.8
-----------------------
s^2 (s+9.725) (s-9.725)
figure
rlocus(G0)
2
% Raices en lazo cerrado
k0=kx;
s=sym('s');
PC0=(s+p1)*(s+p2)*(s+p3)*(s+p4)+k0;
U=double(solve(PC0==0,s))
U =
7.880129839579492 + 3.849739153399457i
7.881344644062088 - 3.849145767297011i
-7.880129839579492 - 3.849739153399457i
-7.881344644062088 + 3.849145767297011i
% Punto de diseno
sigma0=-wnx*zita
sigma0 =
1.930407523431476e+247
wd0=-wnx*sqrt(1-zita^2)
wd0 =
3.768119321157789e+247
ts0=4/sigma0;
3
tsN=ts0/2;
sigmaN=4/tsN
sigmaN =
3.860815046862952e+247
wdN=sigmaN*tan(theta*pi/180)
wdN =
7.536238642315580e+247
thetaLead=-180-angGsN
thetaLead =
1.713781901749459e+02
plead=(wdN+sigmaN*tan(-thetaLead*pi/180))/tan(-thetaLead*pi/180)
plead =
5.356390186817099e+248
[wnx,kx]=CondMagAng([zlead],[p1 p2 p3 p4 plead],zita)
kx =
GLead =
-2388.8 (s+9.725)
-------------------------------------
s^2 (s+9.725) (s-9.725) (s+5.356e248)
figure
rlocus(GLead)
Warning: Accuracy may be poor in parts of the frequency range. Use the "prescale" command to maximize
accuracy in the range of interest.
4
% Punto de diseno
sigmaN_lead=-wnx*zita
sigmaN_lead =
wdN_lead=-wnx*sqrt(1-zita^2)
wdN_lead =
klead =
PCLead=(s+p1)*(s+p2)*(s+p3)*(s+p4)*(s+plead)+klead*(s+zlead);
% U=double(solve(PCLead==0,s))
% Respuesta del sistema
figure
impulse(feedback(series(double(k0),G0),1))
5
% hold on
% impulse(feedback(series(double(klead),GLead),1))
kv0 =
-62.567247113163383 - 0.015214165148629i
kvlead =
% el errorss ha mejorado en
factorss_0lead=kvlead/kv0
6
factorss_0lead =
factorss_0leadlag=10;
factorss_leadlag=factorss_0leadlag/factorss_0lead
factorss_leadlag =
plag=0.01;
zlag=plag*factorss_leadlag;
kx =
GLeadLag =
-2388.8 (s+9.725)
----------------------------------------------
s^2 (s+9.725) (s-9.725) (s+0.01) (s+5.356e248)
figure
rlocus(GLeadLag)
Warning: Accuracy may be poor in parts of the frequency range. Use the "prescale" command to maximize
accuracy in the range of interest.
7
% Punto de diseno
sigmaN_leadlag=-wnx*zita
sigmaN_leadlag =
wdN_leadlag=-wnx*sqrt(1-zita^2)
wdN_leadlag =
kvleadlag =
8
figure
step(feedback(series(double(k0),G0),1),100)
% hold on
% step(feedback(series(double(kleadlag),GLeadLag),1),100)
% step(feedback(series(double(klead),GLead),1),100)
GI=zpk([],[0],[1]);
figure
step(series(GI,feedback(series(double(k0),G0),1)),100)
9
% hold on
% step(series(GI,feedback(series(double(kleadlag),GLeadLag),1)),100)
% step(series(GI,feedback(series(double(klead),GLead),1)),100)
10