Presentation is loading. Please wait.

Presentation is loading. Please wait.

Desired Bode plot shape

Similar presentations


Presentation on theme: "Desired Bode plot shape"— Presentation transcript:

1 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, ts, tr, td, … 0dB Low freq ess, type Use low pass filters Use lead or PD control Want low gain w Want sufficient Phase margin -90 Mr, Mp -180 PM+Mp=70

2 Overall Loop shaping strategy
Determine mid freq requirements Speed/bandwidth  wgc Overshoot/resonance  PMd Use PD or lead to achieve 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

3 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)|

4 PD control design

5 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

6 Lead Design From specs => PMd and wgcd From plant, draw Bode plot
Find PMhave = angle(G(jwgcd) DPM = PMd - PMhave + a few degrees Choose a=plead/zlead so that fmax = DPM and it happens at wgcd

7 Alternative use of lead
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

8 Lag and lead-lag Design Steps
From plant, draw Bode plot From specs => PMd and wgcd If there is speed or BW req,  wgcd, In this case, if PM not enough, design PD or lead Otherwise, choose wgcd to have PM>PMd Find K to enforce wgcd: Find Kp,v,a-have with K and C above Find Kp,v,a-des from ess specs zlag/plag = Kp,v,a-des/Kp,v,a-have Let zlag= wgcd/5~20, depending on PM room Compute plag

9 PI Controller Let wgc/z big Gain/Kp In dB Type ↑ w=z LF gain ↑ ess ↓
Big phase ↓ Detabilizing w/z

10 PI controller design Choice 1: first multiply G by 1/s, then do PD
Choice 2: KP+KI/s=KP (s+z)/s Do proportional controller design for wgc, PM  Kp Place zero of PI controller at 10 to 20 times smaller than wgc  z=wgc/(10~20) KIK=KP z

11 KI/KP=wgcd/2 KI/KP=wgcd/5 KI/KP=wgcd/10 Want these: DC gain boosting KI/KP=wgcd/20 wgcd KI/KP=wgcd/40 -5.7 -1.4 -2.8 -11.3 -26. 6 Don’t want these: PM reduction! Kill PM significantly

12 Basic PI Design Steps From plant, draw Bode plot
From specs => PMd and wgcd If there is speed or BW req,  wgcd, In this case, if PM not enough, design PD or lead Otherwise, choose wgcd to have PM>PMd Find K to enforce wgcd: Let KP = K And KI = Kwgcd/5~20, depending on extra PM room to spare Need to increase type to make a nonzero ess to be zero. But no requirement on ess after type increase.

13 Example Want Mp <= 16% Steady state error = 0 when input is constant. Analysis: steady state error = 0 when input is constant means that ess to step must be 0; or the system type must be 1 or higher. Original system is type 0, so need PI control to increase the system type to 1.

14 %PI control example n=[500]; d=[1 6 5]; figure(1); clf; margin(n,d); hold on; grid; V=axis; Mp = 16; PMd = 70 - Mp +10; %put in a large extra PM, because PI kills PM semilogx(V(1:2),[PMd-180 PMd-180],':r'); %draw PMd line x=ginput(1); w_gcd = x(1); %get desired w_gc KP = 1/abs(polyval(n,j*w_gcd)/polyval(d,j*w_gcd)); z = w_gcd/10; KI = z*KP; ngc = conv(n, [KP KI]); dgc = conv(d, [1 0]); figure(1); margin(ngc,dgc); grid; [ncl,dcl]=feedback(ngc,dgc,1,1); figure(2);step(ncl,dcl); grid; figure(3); margin(ncl*1.414,dcl); grid;

15

16

17 Ess is 0 Can afford more overshoot!

18 Sluggish settling is typical of PI or lag controlled systems.
Can reduce it by moving the p and z of lag or PI controller to higher frequency.

19

20 %PI control example n=[500]; d=[1 6 5]; figure(1); clf; margin(n,d); hold on; grid; V=axis; Mp = 16; PMd = 70 - Mp +10; %put in a large extra PM, because PI kills PM semilogx(V(1:2),[PMd-180 PMd-180],':r'); %draw PMd line x=ginput(1); w_gcd = x(1); %get desired w_gc KP = 1/abs(polyval(n,j*w_gcd)/polyval(d,j*w_gcd)); z = w_gcd/5; KI = z*KP; ngc = conv(n, [KP KI]); dgc = conv(d, [1 0]); figure(1); margin(ngc,dgc); grid; [ncl,dcl]=feedback(ngc,dgc,1,1); figure(2);step(ncl,dcl); grid; figure(3); margin(ncl*1.414,dcl); grid;

21

22

23 PI Design with ess specs
From plant, draw Bode plot From specs => Kv,a-des, PMd and wgcd For required ess, Kv,a-des =1/ess With C(s)=1/s, compute Kv,a-have If there is speed or BW req,  wgcd, In this case, if PM not enough, design PD or lead Otherwise, choose wgcd to have PM>PMd Find K to enforce wgcd: Let KP = K, KIdes= Kv,a-des/Kv,a-have If KIdes <= Kwgcd/5~20, done, let KI = KIdes Else, increase wgcd and go back to previous step Need to increase type by 1 to make a nonzero ess to be zero, and after type increase, there is further requirement on ess.

24 Example Want Mp <= 16% Steady state error <= 0.1 for ramp input.
Analysis: steady state error <= 0.1 for ramp implies that the system type must be 1 or higher. Original system is type 0, so need PI control. Ess to ramp <= 0.1 requires Kvd >= 10. Previous design leaves Kv = KI*500/5 = 100KI = 4.44 KI=0.0444

25 This is actually the ramp response, generated with the step command but the closed-loop TF is multiplied by 1/s.

26 ess>0.1

27 In the previous design, KI=0
In the previous design, KI= is already at the maximum of the range Kwgcd/5~20, But KIdes = 0.1, which is a factor of 10/4.44 larger. So need to increase KP. Hence, try letting KI = KIdes = 0.1, and make KP larger by 10/4.44.

28 ngc = conv(n, [KP KI]); dgc = conv(d, [1 0]);
Old KI, new KI KP = KP*0.1/KI; KI =0.1; ngc = conv(n, [KP KI]); dgc = conv(d, [1 0]); figure(1); margin(ngc,dgc); grid; [ncl,dcl]=feedback(ngc,dgc,1,1); figure(2);step(ncl,dcl); grid; figure(3); step(ncl,[dcl 0]); grid; Ramp response

29

30 ess = 0.1

31 Can play with KP, but difficult to achieve the best KP

32 PI Design with PD Design Steps
From required ess, Kv,a-des =1/ess With C(s)=1/s, compute Kv,a-have Let KI = Kv,a-des/Kv,a-have Multiply G(s) by KI/s Do a PD design for KIG(s)/s, with DC gain=1: Find wgc and PM Find PMd Let f = PMd – PM + (a few degrees) Compute TD = tan(f)/wgcd KP = KI*TD

33 %Alternative PI control by PD design
clear all; n=[ ]; d=[1 6 5]; ess2ramp = 0.1; Kvd = 1/ess2ramp; Kva = n(end)/d(end); %after introducing 1/s KI = Kvd/Kva; %multiplying G(s) by KI/s and get new Bode ni=KI*n; di=[d 0]; figure(1); clf; margin(ni,di); hold on; grid; [GM,PM,wpc,wgc]=margin(ni,di); PMd=54+6; phi = (PMd-PM)*pi/180; Td = tan(phi)/wgc; KP=KI*Td; ngc = conv(n, [KP KI]); dgc=di; figure(1); margin(n,d); margin(ngc,dgc); [ncl,dcl]=feedback(ngc,dgc,1,1); figure(3);step(ncl,dcl); grid;

34

35

36 clear all; n=[ ]; d=[1 6 5]; ess2ramp = 0.1; Kvd = 1/ess2ramp; Kva = n(end)/d(end); %after introducing 1/s KI = Kvd/Kva; %multiplying G(s) by KI/s and get new Bode ni=KI*n; di=[d 0]; figure(1); clf; margin(ni,di); hold on; grid; [GM,PM,wpc,wgc]=margin(ni,di); PMd=50+3; phi = (PMd-PM)*pi/180; Td = tan(phi)/wgc; KP=KI*Td; ngc = conv(n, [KP KI]); dgc=di; figure(1); margin(n,d); margin(ngc,dgc); [ncl,dcl]=feedback(ngc,dgc,1,1); figure(3);step(ncl,dcl); grid;

37

38

39 Alternative PI Design Steps
For required ess, Kv,a-des =1/ess With C(s)=1/s, compute Kv,a-have Let KI = Kv,a-des/Kv,a-have Rewrite char eq: (KP + KI/s)G(s) + 1=0 KP*n/d + KI*n/d/s +1 = 0 KP *n*s + KI*n+d*s =0, KP*n*s/(KI*n+d*s) + 1 =0 So do a KP design for n*s/(KI*n+d*s), with KI above Draw Bode plot for n*s/(KI*n+d*s) Select max PM frequency Compute KP to make that frequency wgc

40 %Alternative PI control example
clear all; n=[ ]; d=[1 6 5]; %note same length ess2ramp = 0.1; Kvd = 1/ess2ramp; Kva = n(end)/d(end); %after introducing 1/s KI = Kvd/Kva; %get TF after closing the G(s) and KI/s loop ni=[n 0]; di=[d 0]+KI*[0 n]; figure(1); clf; margin(ni,di); grid; x=ginput(1); w_gcd = x(1); %get desired w_gc KP = 1/abs(polyval(ni,j*w_gcd)/polyval(di,j*w_gcd)); ngc = conv(n, [KP KI]); dgc = conv(d, [1 0]); figure(2); margin(n,d); hold on; margin(ngc,dgc); [ncl,dcl]=feedback(ngc,dgc,1,1); figure(3);step(ncl,dcl); grid;

41 Pick wgc here

42

43

44 Pick wgc here

45

46

47 Pick wgc here

48

49 Numerical sweep of KP indicates that ~30% Mp is about the best one can achieve.
We conclude that it is impossible to meet the specifications with a PI controller. Both of our design procedures came very close to the best achievable. Of course, we can fix the excessive overshoot with an additional lead design.

50 Want Mp <= 16% Steady state error <= 0.1 for ramp input. Overall design: Ess2ramp <=0.1,  PI with KI=1/0.1*5/500=0.1 Close the I-loop and select KP for best PM shape,  KP = 0.084 Use a lead controller with DC gain = 1 to reduce Mp from 30% to <= 16%

51 clear all; n=[ ]; d=[1 6 5]; ess2ramp = 0.1; Kvd = 1/ess2ramp; Kva = n(end)/d(end); %after introducing 1/s KI = Kvd/Kva; %get TF after closing the G(s) and KI/s loop ni=[n 0]; di=[d 0]+KI*[0 n]; figure(1); clf; margin(ni,di); grid; x=ginput(1); w_gcd = x(1); %get desired w_gc KP = 1/abs(polyval(ni,j*w_gcd)/polyval(di,j*w_gcd)); ngc = conv(n, [KP KI]); dgc = conv(d, [1 0]); figure(2); margin(n,d); hold on; margin(ngc,dgc); [ncl,dcl]=feedback(ngc,dgc,1,1); figure(3);step(ncl,dcl); grid;

52 %follow with a lead controller with DC gain =1
%to make Mp=30% ==> Mp<=16% [GM,PM,wpc,wgc]=margin(ngc,dgc); w_gcd=wgc; PMd=54+6; phimax = (PMd-PM)*pi/180; alpha=(1+sin(phimax))/(1-sin(phimax)); zlead=w_gcd/alpha^.25; plead=w_gcd*alpha^.75; ngcc = conv(ngc, alpha*[1 zlead]); dgcc = conv(dgc, [1 plead]); figure(2); margin(ngcc,dgcc); grid; [ncl,dcl]=feedback(ngcc,dgcc,1,1); figure(5);step(ncl,dcl); grid; figure(6);step(ncl,[dcl 0]); grid; %ramp response

53 Original system After PI alone With PI and lead

54 Mp <= 16% is met.

55

56 y=t Ess=0.1

57 Two d.o.f. Control design C(s) Gp(s) C1(s) Gp(s) C2(s)
+ r + e C1(s) Gp(s) y + _ _ C2(s) C1(s) = C(s) – C2(s)

58 Loop transfer function is still C(s)Gp(s)
TF from d to y: Gp(s)/(1+C(s)Gp(s)) TF from r to y: C1(s)Gp(s)/(1+C1(s)Gp(s) +C2(s)Gp(s))=C1(s)Gp(s)/(1+C(s)Gp(s)) Design C(s) to achieve desired loop shape Split C(s) into C1 and C2 Dual loop implementation to individually control disturbance TF and reference TF

59 Dual loop control to increase type
Recall: type with respect to r = #integrators in TF from e to where r enters This = #integrator in C1 + #integrator in inner loop Therefore, choose C2 so that #integrators in inner loop is more than #integrators in Gp(s) Overall loop TF not affected Input/output TF Poles not affected Input/output TF Zeros affected Steady state tracking improved

60 Inner loop TF Not easy to see in this general form But simply pick C2 to cancel one or two lowest order terms in Gp See example

61 y _ C2(s) C2 = -2s Implement as: y _ -2

62 Example Design problem from text book
But our solution is much more meaningful and much easier Plant TF Gp(s) = 10/s(s+1) Specs: Mp <19%, but >2% Ts <1 sec Ess to step, ramp, acc all = 0

63 s=tf('s'); Gp=10/s/(s+1); figure; margin(Gp); grid; ts = 1; %specification t=linspace(0,3*ts,301); Gcl=Gp/(1+Gp); figure; step(Gcl,t); grid; %specification for Mp is 2% to 19% %can use the mid point as initial target Mp=10; zeta=0.6; %for Mp=10% sigma=4/ts; %no tolerance band is given, so use 2% wn=sigma/zeta; wgcd=0.7*wn; Gwgc = evalfr(Gp, j*wgcd); PM=angle(Gwgc)/pi* ;

64 PMd = 70 - Mp + 10; %add 10 deg because we need PI later
DPM = PMd - PM; %phase margin deficiency z_PD = wgcd /tan(DPM*pi/180); %PD control K = 1/abs(evalfr((s+z_PD)*Gp,j*wgcd)); C=K*(s+z_PD); figure; margin(C*Gp); grid; %Bode with PD figure; step(C*Gp/(1+C*Gp),t); grid; %now add PI, place zero of PI at wgcd/10 %Mp target of 10% together with 10 deg extra PMd %can tolerate a little more phase delay from PI. z_PI = wgcd/10; C=C*(s+z_PI)/s; %multiply PI and PD figure; margin(C*Gp); grid;

65 Plant Bode plot

66 Original step response

67 Bode plot after PD

68 Step response with initial PD

69 Step response after PD Ts is two large, need to increase wgc by 1.5X

70

71 wgc=0.7*wn*1.6; z_PI = wgc/20;

72 Wgc increased from 4.47 to 7.47 After PD

73 Ts is now about right After PD

74 After PID

75 After PID Ts is OK Mp is OK

76 PD +0.1s y PI _ _ -0.1 C2(s) = -0.1s

77 PI*PD +0.1s y _ _ -0.1

78 The 2 DOF implementation caused 5% additional overshoot.
 Increase PMd by 7 to target 15% Mp

79 … … Mp=10; zeta=0.6; %for Mp=10% sigma=4/ts; %no tolerance band is given, so use 2% wn=sigma/zeta; wgcd=0.7*wn*1.6; Gwgc = evalfr(Gp, j*wgcd); PM=angle(Gwgc)/pi* ; PMd = 70 - Mp + 17; %add 10 deg because we need PI later DPM = PMd - PM; %phase margin deficiency z_PD = wgcd /tan(DPM*pi/180); %PD control K = 1/abs(evalfr((s+z_PD)*Gp,j*wgcd)); C=K*(s+z_PD); … …. z_PI = wgcd/20; C=C*(s+z_PI)/s; %multiply PI and PD figure; margin(C*Gp); grid; figure; step(C*Gp/(1+C*Gp),t); grid; figure; step((C+0.1*s)*Gp/(1+C*Gp),t); grid;

80


Download ppt "Desired Bode plot shape"

Similar presentations


Ads by Google