proportional controller design
DESCRIPTION
Proportional controller design. Obtain open loop Bode plot Convert design specs into Bode plot req. Select K P based on requirements: For improving ess: K P = K p,v,a,des / K p,v,a,act For fixing Mp: select w gcd to be the freq at which PM is sufficient, and K P = 1/|G(j w gcd )| - PowerPoint PPT PresentationTRANSCRIPT
Proportional controller design
• Obtain open loop Bode plot• Convert design specs into Bode plot req.
• Select KP based on requirements:
– For improving ess: KP = Kp,v,a,des / Kp,v,a,act
– For fixing Mp: select gcd to be the freq at which PM is sufficient, and KP = 1/|G(jgcd)|
– For fixing speed: from td, tr, tp, or ts requirement, find out n, let gcd = n and choose KP as above
Bode Diagram
Frequency (rad/sec)
Ph
ase
(deg
)M
agn
itu
de
(dB
)
-10
0
10
20
30
40
50Gm = Inf, Pm = 17.964 deg (at 6.1685 rad/sec)
10-1
100
101
-180
-135
-90
G(s)=40/s(s+2)
Mp=10%
0 1 2 3 4 5 60
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
Time (sec)
Am
plit
ud
e
Unit Step Response
ts=3.65 tp=0.508
Mp=60.4%
ess tolerance band: +-2%
td=0.159
tr=0.19
yss=1
ess=0
clear all;n=[0 0 40]; d=[1 2 0];figure(1); clf; margin(n,d);%proportional control design:figure(1); hold on; grid; V=axis;Mp = 10/100;zeta = sqrt((log(Mp))^2/(pi^2+(log(Mp))^2));PMd = zeta * 100 + 3;semilogx(V(1:2), [PMd-180 PMd-180],':r');%get desired w_gcx=ginput(1); w_gcd = x(1);KP = 1/abs(polyval(n,j*w_gcd)/polyval(d,j*w_gcd));figure(2); margin(KP*n,d);figure(3); stepchar(KP*n, d+KP*n);
Bode Diagram
Frequency (rad/sec)
Ph
ase
(deg
)M
agn
itu
de
(dB
)
-40
-20
0
20
40Gm = Inf, Pm = 63.31 deg (at 1.0055 rad/sec)
10-1
100
101
-180
-135
-90
1 2 3 4 5 60
0.2
0.4
0.6
0.8
1
1.2
Time (sec)
Am
plit
ud
e
Unit Step Response
ts=3.98 tp=2.82
Mp=6.03%ess tolerance band: +-2%
td=0.883
tr=1.33
yss=1
ess=0
n=[1]; d=[1/5/50 1/5+1/50 1 0];figure(1); clf; margin(n,d);%proportional control design:figure(1); hold on; grid; V=axis;Mp = 10/100;zeta = sqrt((log(Mp))^2/(pi^2+(log(Mp))^2));PMd = zeta * 100 + 3;semilogx(V(1:2), [PMd-180 PMd-180],':r');%get desired w_gcx=ginput(1); w_gcd = x(1);Kp = 1/abs(polyval(n,j*w_gcd)/polyval(d,j*w_gcd));Kv = Kp*n(1)/d(3); ess=0.01; Kvd=1/ess;z = w_gcd/5; p = z/(Kvd/Kv);ngc = conv(n, Kp*[1 z]); dgc = conv(d, [1 p]);figure(1); hold on; margin(ngc,dgc);[ncl,dcl]=feedback(ngc,dgc,1,1);figure(2); step(ncl,dcl); grid;figure(3); margin(ncl*1.414,dcl); grid;
-100
-50
0
Mag
nit
ud
e (d
B)
10-1
100
101
102
103
-270
-225
-180
-135
-90
Ph
ase
(deg
)
Bode DiagramGm = 34.8 dB (at 15.8 rad/sec) , Pm = 77.8 deg (at 0.981 rad/sec)
Frequency (rad/sec)
-100
-50
0
50M
agn
itu
de
(dB
)
100
101
102
103
-270
-225
-180
-135
-90
Ph
ase
(deg
)
Bode DiagramGm = 13.9 dB (at 36.8 rad/sec) , Pm = 53 deg (at 13.3 rad/sec)
Frequency (rad/sec)
-200
-100
0
100
200M
agn
itu
de
(dB
)
10-4
10-2
100
102
-270
-180
-90
Ph
ase
(deg
)
Bode DiagramGm = 26 dB (at 15 rad/sec) , Pm = 51.7 deg (at 2.31 rad/sec)
Frequency (rad/sec)
0 2 4 6 8 10 120
0.2
0.4
0.6
0.8
1
1.2
1.4Step Response
Time (sec)
Am
plit
ud
e
20
30
40
50
60
70
Mag
nit
ud
e (d
B)
10-2
10-1
100
101
102
0
45
90
Ph
ase
(deg
)
Bode Diagram
Frequency (rad/sec)
20*log(KP)
KP/KD
Place gcd here
PD Control• C(s)=KP + KDs = KP(1+TDs)
• For fixing wgcd and PMd
– Compute wgcd from tr, td, etc
– Compute PMd from Mp
– Compute = PMd – PM@wgcd
– Compute TD = tan()/wgcd
– KP = 1/sqrt(1+Td2wgcd
2)/abs(G(jwgcd))
– KD=KPTD
C(s) G(s)
ssssG
23 3.002.0
1)(
Example
Want: maximum overshoot <= 10% rise time <= 0.3 sec
Bode Diagram
Frequency (rad/sec)
Ph
ase
(deg
)M
agn
itu
de
(dB
)
-100
-80
-60
-40
-20
0
20Gm = 23.522 dB (at 7.0711 rad/sec), Pm = 73.367 deg (at 0.9768 rad/sec)
10-1
100
101
102
-270
-225
-180
-135
-90
0.5 1 1.5 2 2.5 3 3.5 4 4.5 50
0.2
0.4
0.6
0.8
1
1.2
Time (sec)
Am
plit
ud
e
Unit Step Response
ts=2.68 tp=3
Mp=-1.06%
ess tolerance band: +-2%
td=0.841
tr=1.52
yss=1
ess=0
n=[0 0 1]; d=[0.02 0.3 1 0];
figure(1); clf; margin(n,d);
Mp = 10/100;
zeta = sqrt((log(Mp))^2/(pi^2+(log(Mp))^2));
PMd = zeta * 100 + 3;
tr = 0.3; w_n=1.8/tr; w_gcd = w_n;
PM = angle(polyval(n,j*w_gcd)/polyval(d,j*w_gcd));
phi = PMd*pi/180-PM; Td = tan(phi)/w_gcd;
KP = 1/abs(polyval(n,j*w_gcd)/polyval(d,j*w_gcd));
KP = KP/sqrt(1+Td^2*w_gcd^2); KD=KP*Td;
ngc = conv(n, [KD KP]);
figure(2); margin(ngc,d);
figure(3); stepchar(ngc, d+ngc);
Could be a little less
Bode Diagram
Frequency (rad/sec)
Ph
ase
(deg
)M
agn
itu
de
(dB
)
-60
-40
-20
0
20Gm = Inf, Pm = 62.116 deg (at 6 rad/sec)
100
101
102
-180
-135
-90
0.2 0.4 0.6 0.8 1 1.2 1.40
0.2
0.4
0.6
0.8
1
1.2
Time (sec)
Am
plit
ud
e
Unit Step Response
ts=0.655 tp=0.461
Mp=6.67%ess tolerance band: +-2%
td=0.154
tr=0.225
yss=1
ess=0
Less than spec
Variation
• Restricted to using KP = 1
• Meet Mp requirement
• Find gc and PM
• Find PMd
• Let = PMd – PM + (a few degrees)
• Compute TD = tan()/wgcd
• KP = 1; KD=KPTD
Bode Diagram
Frequency (rad/sec)
Ph
ase
(deg
)M
agn
itu
de
(dB
)
-80
-60
-40
-20
0
20Gm = 9.5424 dB (at 7.0711 rad/sec), Pm = 32.613 deg (at 3.7468 rad/sec)
100
101
102
-270
-225
-180
-135
-90
0.5 1 1.5 2 2.5 3 3.5 4 4.5
0.2
0.4
0.6
0.8
1
1.2
1.4
Time (sec)
Am
plit
ud
e
Unit Step Response
ts=3.17 tp=0.814
Mp=38.9%
ess tolerance band: +-2%
td=0.317
tr=0.317
yss=1
ess=0
n=[0 0 5]; d=[0.02 0.3 1 0];
figure(1); clf; margin(n,d);
Mp = 10/100;
zeta = sqrt((log(Mp))^2/(pi^2+(log(Mp))^2));
PMd = zeta * 100 + 10;
[GM,PM,wgc,wpc]=margin(n,d);
phi = (PMd-PM)*pi/180; Td = tan(phi)/wgc;
KP=1; KD=KP*Td;
ngc = conv(n, [KD KP]);
figure(2); margin(ngc,d);
figure(3); stepchar(ngc, d+ngc);
Bode Diagram
Frequency (rad/sec)
Ph
ase
(deg
)M
agn
itu
de
(dB
)
-60
-40
-20
0
20Gm = Inf, Pm = 52.605 deg (at 3.9488 rad/sec)
100
101
102
-180
-150
-120
-90
0.5 1 1.5 2 2.50
0.2
0.4
0.6
0.8
1
1.2
Time (sec)
Am
plit
ud
e
Unit Step Response
ts=1.56 tp=0.728
Mp=15.6%ess tolerance band: +-2%
td=0.236
tr=0.321
yss=1
ess=0
n=[0 0 5]; d=[0.02 0.3 1 0];
figure(1); clf; margin(n,d);
Mp = 10/100;
zeta = sqrt((log(Mp))^2/(pi^2+(log(Mp))^2));
PMd = zeta * 100 + 18;
[GM,PM,wgc,wpc]=margin(n,d);
phi = (PMd-PM)*pi/180; Td = tan(phi)/wgc;
Kp=1; Kd=Kp*Td;
ngc = conv(n, [Kd Kp]);
figure(2); margin(ngc,d);
figure(3); stepchar(ngc, d+ngc);
Bode Diagram
Frequency (rad/sec)
Ph
ase
(deg
)M
agn
itu
de
(dB
)
-60
-40
-20
0
20Gm = Inf, Pm = 57.956 deg (at 4.1131 rad/sec)
100
101
102
-180
-135
-90
0 0.5 1 1.5 20
0.2
0.4
0.6
0.8
1
1.2
1.4
Time (sec)
Am
plit
ud
e
Unit Step Response
ts=1.07 tp=0.695
Mp=10.7%ess tolerance band: +-2%
td=0.22
tr=0.305
yss=1
ess=0