420 likes | 631 Views
Desired Bode plot shape. High low freq gain for steady state tracking Low high freq gain for noise attenuation Sufficient PM near w gc for stability. Want high gain. Use PI or lag control. w gc. High freq Noise immu. w. Mid freq Speed, BW. 0dB. Low freq ess , type.
E N D
Desired Bode plot shape High low freq gain for steady state tracking Low high freq gain for noise attenuation Sufficient PM near wgc for stability Want high gain Use PI or lag control wgc High freq Noise immu w Mid freq Speed, BW 0dB Low freq ess, type Use low pass filters Use lead or PD control Want low gain w 0 Want sufficient Phase margin -90 Mr, Mp -180 PM+Mp=70
Overall Loop shaping strategy • Determine mid freq requirements • Speed/bandwidth wgc • Overshoot/resonance PMd • Use PD or lead to achieve PMd@ wgc • Use overall gain K to enforce wgc • 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 wgcd to be the freq at which PM is sufficient, and KP = 1/|G(jwgcd)| • For fixing speed: from td, tr, tp, or ts requirement, find out wn, let wgcd= (0.65~0.8)*wn and KP = 1/|G(jwgcd)|
PD control design Variation • Restricted to using KP = 1 • Meet Mp requirement • Find wgc and PM • Find PMd • Let f = PMd – PM + (a few degrees) • Compute TD = tan(f)/wgcd • KP = 1; KD=KPTD
plead zlead 20log(Kzlead/plead) Goal: select z and p so that max phase lead is at desired wgc and max phase lead = PM defficiency!
Lead Design • From specs => PMd and wgcd • From plant, draw Bode plot • Find PMhave = 180 + angle(G(jwgcd) • DPM = PMd - PMhave + a few degrees • Choose a=plead/zlead so that fmax = DPM and it happens at wgcd
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);
After design Before design
Closed-loop Bode plot by: margin(ncl*1.414,dcl); Magnitude plot shifted up 3dB So, gc is BW
Alternative use of lead • Use Lead and Proportional together • To fix overshoot and ess • No speed requirement • Select K so that KG(s) meet ess req. • Find wgc and PM, also find PMd • Determine phi_max, and alpha • Place phi_max a little higher than wgc
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 higher p=w_gcd*alpha^.75; %sqrt(alpha); %than wgc ngc = 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;
Lead design tuning example C(s) G(s) Design specifications: rise time <=2 sec overshoot <16%
Desired tr < 2 sec We had tr = 1.14 in the previous 4 designs 4. Go back and take wgcd = 0.6*wn so that tr is not too small
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