desired bode plot shape - iowa state university
TRANSCRIPT
Desired Bode plot shape
Ess requirement
Noise requirement
0
-90
-180
0dB
ωgcd
High low-freq-gain for steady state tracking Low high-freq-gain for noise attenuation Sufficient PM near ωgc for stability
ω
ω
PMd
Mid frequency
Desired Bode plot shape
0
-90
-180
0dB
ωgc
High low freq gain for steady state tracking Low high freq gain for noise attenuation Sufficient PM near ωgc for stability
ω
ω
Low freq
High freq
Want high gain
Want low gain
Mid freq
Want sufficient Phase margin
Use low pass filters
Use PI or lag control
Use lead or PD control
PM+Mp=70
C(s) Gp(s)
( )( )( )( )!
!
21
21)(pspszszsKsC
−−
−−=
Controller design with Bode
From specs: => desired Bode shape of Gol(s) Make Bode plot of Gp(s) Add C(s) to change Bode shape Get closed loop system Run step response, or sinusoidal response
Mr and BW are widely used
Closed-loop phase resp. rarely used
Important relationships • Closed-loop BW are very close to ωn • Open-loop gain cross over ωgc ≈
(0.65~0.8)* ωn, • When ζ <= 0.6, ωr and ωn are close • When ζ >= 0.7, no resonance • ζ determines phase margin and Mp:
ζ 0.4 0.5 0.6 0.7 PM 44 53 61 67 deg ≈100ζ Mp 25 16 10 5 %
PM+Mp ≈70
Mid frequency requirements • ωgc is critically important
– It is approximately equal to closed-loop BW – It is approximately equal to ωn
• Hence it determines tr, td directly
• PM at ωgc controls ζ– Mp ≈ 70 – PM
• PM and ωgc together controls σ and ωd – Determines ts, tp
• Need ωgc at the right frequency, and need sufficient PM at ωgc
Low frequency requirements • Low freq gain slope and/or phase
determines system type • Height of at low frequency determine error
constants Kp, Kv, Ka • Which in turn determine ess
• Need low frequency gain plot to have sufficient slope and sufficient height
High frequency requirements • Noise is always present in any system • Noise is rich in high frequency contents • To have better noise immunity, high
frequency gain of system must be low
• Need loop gain plot to have sufficient slope and sufficiently small value at high frequency
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(jωgcd)| – For fixing speed: from td, tr, tp, or ts
requirement, find out ωn, let ωgcd = (0.65~0.8)*ωn and KP = 1/|G(jωgcd)|
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; %overshoot in percentage PMd = 70-Mp + 3; semilogx(V(1:2), [PMd-180 PMd-180],':r'); %get desired w_gc x=ginput(1); w_gcd = x(1); KP = 1/abs(evalfr(tf(n,d),j*w_gcd)); figure(2); margin(KP*n,d); figure(3); mystep(KP*n, d+KP*n);
Bode Diagram
Frequency (rad/sec)
Phas
e (d
eg)
Mag
nitu
de (d
B)
-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
plitu
de
Unit Step Response
ts=3.65 tp=0.508
Mp=60.4%
ess tolerance band: +-2%
td=0.159
tr=0.19
yss=1ess=0
Bode Diagram
Frequency (rad/sec)
Phas
e (d
eg)
Mag
nitu
de (d
B)
-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
plitu
de
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
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 sK
KC j K K j K jK
C j K
KK
K KC j jK K
ω ω ω
ω
ω ω ω−
= + = +
= + = +
=
⎛ ⎞+ + ⎜ ⎟
⎝ ⎠
∠ =∠ + =
PD Controller
20
30
40
50
60
70
Mag
nitu
de (d
B)
10-2 10-1 100 101 1020
45
90
Phas
e (d
eg)
Bode Diagram
Frequency (rad/sec)
20*log(KP)
KP/KD
Place ωgcd here
Bad for noise
( )
( )
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 sG s C s G s C s G s
ω
ω
ω
ω
π ω
ω
=
= +
Δ = − +
= Δ
= +
= ⇒ = +
= +
i
(s) as needed
PD control design
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); mystep(ngc, d+ngc);
Could be a little less
C(s) G(s)
ssssG
++= 23 3.002.0
1)(
Example
Want: maximum overshoot <= 10% rise time <= 0.3 sec Can use Lead or PD
Bode Diagram
Frequency (rad/sec)
Phas
e (d
eg)
Mag
nitu
de (d
B)
-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
plitu
de
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; %overshoot in percentage PMd = 70 – Mp + 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); mystep(ngc, d+ngc);
Could be a little less
Bode Diagram
Frequency (rad/sec)
Phas
e (d
eg)
Mag
nitu
de (d
B)
-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
plitu
de
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
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
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);
2
200Example: ( )4 4
When ( ) 1, 16 , 64%Want: 16%
o
G ss s
C s PM MpMp
=+ +
= = =
≤
lead
lead
pszsKsC
+
+=)(
Lead Controller Design
00 >>> Kzp leadlead
lead
lead
pjzjKjC
+
+=
ωω
ω )(
0)(tan)(tan
)()()(
11 >−=
+∠−+∠=∠
−−
leadlead
leadlead
pz
pjzjjCωω
ωωω
101520253035404550
Mag
nitu
de (d
B)
10-2 10-1 100 101 102 1030
30
60
90
Phas
e (d
eg)
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 dpz
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(jωgcd) • ΔPM = PMd - PMhave + a few degrees • Choose α=plead/zlead so that φmax = ΔPM
and it happens at ωgcd
( ) 1gcdgcdgcd
gcdgcd
max
max
)/()()(
*,/
sin1sin1
−++=
==
−
+=
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; zeta_d =0.5; % or calculate from Mp_d PMd = 100*zeta_d + 3; 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
agni
tude
(dB
)
10-1 100 101 102 103-270
-225
-180
-135
-90
Phas
e (d
eg)
Bode DiagramGm = 13.8 dB (at 38.3 rad/sec) , Pm = 53 deg (at 14 rad/sec)
Frequency (rad/sec)
Before design After design
-150
-100
-50
0
50M
agni
tude
(dB
)
10-1 100 101 102 103 104-270
-180
-90
0
Phas
e (d
eg)
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 3dB So, gc is BW
margin(ncl*1.414,dcl);
0 0.1 0.2 0.3 0.4 0.5 0.6 0.70
0.2
0.4
0.6
0.8
1
1.2
1.4 Step Response
Time (sec)
Am
plitu
de
Lead design tuning example C(s) G(s)
2
1( )( 5)
G ss s
=+
Design specifications: rise time <=2 sec overshoot <16%
4. Go back and take wgcd = 0.6*wn so that tr is not too small
Desired tr < 2 sec We had tr = 1.14 in the previous 4 designs
n=[1]; d=[1 5 0 0]; G=tf(n,d); Mp_d = 16; %in percentage PMd = 70 - Mp_d + 4; %use Mp + PM =70 tr_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); grid figure(2); margin(G); hold on; margin(ngc,dgc); hold off; grid
-200
-100
0
100
200M
agni
tude
(dB)
10-3 10-2 10-1 100 101 102 103-270
-225
-180
-135
-90
Phas
e (d
eg)
Bode DiagramGm = 22.3 dB (at 3.45 rad/sec) , Pm = 60 deg (at 0.54 rad/sec)
Frequency (rad/sec)
0 5 10 15 20 25 30 350
0.2
0.4
0.6
0.8
1
1.2
1.4
Time (sec)
Ampl
itude
Unit Step Response
ts=20.9 tp=5.85
Mp=16.5%ess tolerance band: +-2%
td=1.56
tr=1.95
yss=1
ess=0