Upload
ashley-young
View
219
Download
2
Embed Size (px)
Citation preview
Desired Bode plot shape
0
-90
-180
0dB
gc
High low freq gain for steady state trackingLow high freq gain for noise attenuationSufficient PM near gc for stability
Low freqess, type
High freqNoise immu
Want high gain
Want low gain
Mid freqSpeed, BW
Want sufficientPhase margin
Use low pass filters
Use PI or lag control
Use lead or PD control
PM+Mp=70
Mr, Mp
Overall Loop shaping strategy• Determine mid freq requirements
– Speed/bandwidth gc
– Overshoot/resonance PMd
• Use PD or lead to achieve PMd@ gc
• Use overall gain K to enforce gc
• PI or lag to improve steady state tracking– Use PI if type increase neede – Use lag if ess needs to be reduced
• Use low pass filter to reduce high freq gain
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 = (0.65~0.8)*n and KP = 1/|G(jgcd)|
2
1
( ) (1 )
( ) (1 )
Gain: 20 log(| ( ) |) 20 log( )
20 log( 1
Phase: ( ) (1 ) tan ( )
DP D P
P
DP D P
P
P
D
P
D D
P P
KC s K K s K s
K
KC j K K j K j
K
C j K
K
K
K KC j j
K K
PD Controller
gcd
gcd
gcd
gcd
gcd
gcd
From specs, find and
( )
a few degrees
tan( ) /
1/ (1 ) ( )
; ( )
( ) ( ) ( ) / 1 ( ) ( )
Perform c.l. step response, tune C
d
D
P D s j
D D P P D
cl
PM
PM angle G j
PM PMd PM
T PM
K T s G s
K T K C s K K s
G s C s G s C s G s
(s) as needed
PD control design
PD control design 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
lead
lead
ps
zsKsC
)(
Lead Controller Design
00 Kzp leadlead
lead
lead
pj
zjKjC
)(
0)(tan)(tan
)()()(
11
leadlead
leadlead
pz
pjzjjC
101520253035404550
Mag
nit
ud
e (d
B)
10-2
10-1
100
101
102
103
0
30
60
90
Ph
ase
(deg
)Bode Diagram
Frequency (rad/sec)
zlead
plead
leadlead zp
20log(Kzlead/plead)lead
leadz
p
)(tan)(tan 11max lea d
lea d
lea d
lea d
pz
zp
Goal: select z and p so that max phase lead is at desired wgc and max phase lead = PM defficiency!
max
max
1 sinLet
1 sin
gcd gcd/ , *lead leadz p
Lead Design • From specs => PMd and gcd
• From plant, draw Bode plot
• Find PMhave = 180 + angle(G(jgcd)
• PM = PMd - PMhave + a few degrees
• Choose =plead/zlead so that max =PM and it happens at gcd
1
gcdgcdgcd
gcdgcd
max
max
)/()()(
*,/
sin1
sin1
leadlead
leadlead
pjjGzjK
pz
Lead design example• Plant transfer function is given by:
• n=[50000]; d=[1 60 500 0];
• Desired design specifications are:– Step response overshoot <= 16%– Closed-loop system BW>=20;
n=[50000]; d=[1 60 500 0]; G=tf(n,d);figure(1); margin(G); Mp_d = 16/100; PMd = 70 – Mp_d ;BW_d=20;w_gcd = BW_d*0.7; Gwgc=evalfr(G, j*w_gcd);PM = pi+angle(Gwgc);phimax= PMd*pi/180-PM;alpha=(1+sin(phimax))/(1-sin(phimax));zlead= w_gcd/sqrt(alpha);plead=w_gcd*sqrt(alpha);K=sqrt(alpha)/abs(Gwgc);ngc = conv(n, K*[1 zlead]);dgc = conv(d, [1 plead]);figure(1); hold on; margin(ngc,dgc); hold off;[ncl,dcl]=feedback(ngc,dgc,1,1);figure(2); step(ncl,dcl);
-100
-50
0
50M
agn
itu
de
(dB
)
10-1
100
101
102
103
-270
-225
-180
-135
-90
Ph
ase
(deg
)
Bode DiagramGm = 13.8 dB (at 38.3 rad/sec) , Pm = 53 deg (at 14 rad/sec)
Frequency (rad/sec)
Before designAfter design
-150
-100
-50
0
50M
agn
itu
de
(dB
)
10-1
100
101
102
103
104
-270
-180
-90
0
Ph
ase
(deg
)
Bode DiagramGm = 8.8 dB (at 38.3 rad/sec) , Pm = 40.6 deg (at 25.2 rad/sec)
Frequency (rad/sec)
Closed-loop Bode plot by:
Magnitude plot shifted up 3dBSo, gc is BW
margin(ncl*1.414,dcl);
Alternative use of lead• Use Lead and Proportional together
– To fix overshoot and ess– No speed requirement
1.Select K so that KG(s) meet ess req.
2.Find wgc and PM, also find PMd
3.Determine phi_max, and alpha
4.Place phi_max a little higher than wgc
maxgc gc
max
1 sin/ , *
1 sin
( )
lead lead
lead lead lead
lead lead lead
z p
p s z s zC s K K
z s p s p
Alternative lead design example• Plant transfer function is given by:
• n=[50]; d=[1/50 1 0];
• Desired design specifications are:– Step response overshoot <= 20%– Steady state tracking error for ramp input <=
1/200;
– No speed requirements– No settling concern– No bandwidth requirement
n=[50]; d=[1/5 1 0];figure(1); clf; margin(n,d); grid; hold on;Mp = 20;PMd = 70 – Mp + 7;ess2ramp= 1/200; Kvd=1/ess2ramp;Kva = n(end)/d(end-1); Kzp = Kvd/Kva;figure(2); margin(Kzp*n,d); grid;[GM,PM,wpc,wgc]=margin(Kzp*n,d);w_gcd=wgc; phimax = (PMd-PM)*pi/180;alpha=(1+sin(phimax))/(1-sin(phimax));z=w_gcd/alpha^.25; %sqrt(alpha); %phimax located higherp=w_gcd*alpha^.75; %sqrt(alpha); %than wgcngc = conv(n, alpha*Kzp*[1 z]); dgc = conv(d, [1 p]);figure(3); margin(tf(ngc,dgc)); grid;[ncl,dcl]=feedback(ngc,dgc,1,1);figure(4); step(ncl,dcl); grid;figure(5); margin(ncl*1.414,dcl); grid;
-40
-20
0
20
40
60M
agn
itu
de
(dB
)
10-1
100
101
102
-180
-135
-90
Ph
ase
(deg
)
Bode DiagramGm = Inf dB (at Inf rad/sec) , Pm = 18 deg (at 15.4 rad/sec)
Frequency (rad/sec)
-20
0
20
40
60M
agn
itu
de
(dB
)
10-1
100
101
102
-180
-150
-120
-90
Ph
ase
(deg
)
Bode DiagramGm = Inf dB (at Inf rad/sec) , Pm = 9.04 deg (at 31.4 rad/sec)
Frequency (rad/sec)
-50
0
50
Mag
nit
ud
e (d
B)
10-1
100
101
102
103
104
-180
-150
-120
-90
Ph
ase
(deg
)
Bode DiagramGm = Inf dB (at Inf rad/sec) , Pm = 52.3 deg (at 50.1 rad/sec)
Frequency (rad/sec)
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.160
0.2
0.4
0.6
0.8
1
1.2
1.4Step Response
Time (sec)
Am
plit
ud
e
-80
-60
-40
-20
0
20M
agn
itu
de
(dB
)
100
101
102
103
104
-180
-135
-90
-45
0
Ph
ase
(deg
)
Bode DiagramGm = Inf dB (at Inf rad/sec) , Pm = 77.5 deg (at 82.2 rad/sec)
Frequency (rad/sec)
-100
-50
0
50
Mag
nit
ud
e (d
B)
10-1
100
101
102
103
104
-180
-135
-90
Ph
ase
(deg
)
Bode DiagramGm = Inf dB (at Inf rad/sec) , Pm = 52.3 deg (at 50.1 rad/sec)
Frequency (rad/sec)
Lead design tuning example
C(s) G(s)
2
1( )
( 5)G s
s s
Design specifications: rise time <=2 secovershoot <16%
4. Go back and take wgcd = 0.6*wn so that tr is not too small
Desired tr < 2 secWe had tr = 1.14 in the previous 4 designs
n=[1]; d=[1 5 0 0]; G=tf(n,d);Mp_d = 16; %in percentagePMd = 70 - Mp_d + 4; %use Mp + PM =70tr_d = 2; wnd = 1.8/tr_d; w_gcd = 0.6*wnd;Gwgc=evalfr(G, j*w_gcd);PM = pi+angle(Gwgc);phimax= PMd*pi/180-PM;alpha=(1+sin(phimax))/(1-sin(phimax));zlead= w_gcd/sqrt(alpha);plead=w_gcd*sqrt(alpha);K=sqrt(alpha)/abs(Gwgc);ngc = conv(n, K*[1 zlead]);dgc = conv(d, [1 plead]);[ncl,dcl]=feedback(ngc,dgc,1,1);stepchar(ncl,dcl); gridfigure(2); margin(G); hold on; margin(ngc,dgc); hold off; grid
-200
-100
0
100
200M
ag
nit
ud
e (
dB
)
10-3
10-2
10-1
100
101
102
103
-270
-225
-180
-135
-90
Ph
ase (
deg
)Bode Diagram
Gm = 22.3 dB (at 3.45 rad/sec) , Pm = 60 deg (at 0.54 rad/sec)
Frequency (rad/sec)