44
(4- 1)
(4-2)
(4- 3)
(4- 4)
(4- 5)
(4- 6)
occurs at frequency
m = 1 . a2
(4- 7)
(4- 8)
Heikki Koivo
45
Bode Diagrams
From: U(1) 15
10 5 0 50 40 To: Y(1) 30 20 10 0 -2 10 10
-1
10
10
Frequency (rad/sec)
1 + 5s . 1+ s
a 1 51 Computing max = sin 1 ( 2 ) = sin 1 ( ) = 418 . 0 at a2 + 1 5+1 1 1 m = = = 0.45 rad / s holds with the values read from Figure 4.1. a2 5
The name of phase-lead controller follows from the property that the phase of the output of WLead(s) is leading ahead the phase of the input signal. As can be seen from Figure 4.1 the gain increases at higher frequencies. The gain at higher frequencies is a 2. Since a 2 > 1, this means that W Lead ( ) = (a 2 ) dB is positive, which is clear from Figure 4.1. Let us study more
dB
carefully how much phase margin can be added for various values of a 2 .
Heikki Koivo
46
a2 (a2 ) (dB) phimax () 1.00 0 0 2.00 3.01 19.47 3.00 4.77 30.00 4.00 6.02 36.86 5.00 6.98 41.81 6.00 7.78 45.58 7.00 8.45 48.59 8.00 9.03 51.05 9.00 9.54 53.13 10.00 10.00 54.90 Figures 4.2 and 4.3 display graphically the same dependencies.
1
0.8
5 a2
10
Fig.4. 2. The maximum phase max in phase lead circuit as a function of a2. The change in gain at the same frequency is (a2) dB.
Heikki Koivo
47
0.8
Fig.4. 3. The maximum phase max in phase lead circuit as a function of (a2)dB. Phase-lead compensator behaves like a PD controller at small frequencies. Let us draw a PD controller, which roughly corresponds to the phase-lead compensator in Figure 4.1:
W PD ( s) = 1 + 5 s
(4- 9)
Heikki Koivo
48
10 5 0 80 60 To: Y(1) 40 20 0 -2 10
-1 0
10
10
Frequency (rad/sec)
Fig.4. 4. Bode diagram of PD controller WPD ( s) = 1 + 5s . For > 4 rad/s the PI controller behaves like the phase-lead compensator of Figure 4.1.
o system has phase (-180 +PM), where PM = desired phase margin by choosing a few values of a 2 starting with a 2 =2 and going up to 10-20. Construct a table showing how much this 1 choice will add to phase margin and also to magnitude. In this way a 2 and m = can a2 be determined. This procedure also reveals if one phase lead circuit is enough. Remember also that the bigger a 2 is, the more susceptible it is for noise.
Heikki Koivo
49
This completes the design of the phase-lead compensator. STEP 5. Check the design by simulating step response. Draw also the open-loop Bode diagram of the compensated system for comparison purposes. STEP 6. If requirements are met, stop. Otherwise go back to STEP 1.
EXAMPLE
Open-loop transfer function of a unity feedback system of Fig.4.5 is given by
G (s ) = 1 . s(1 + 0.2 s)
(3- 1)
Controller
R(s) + WLEAD (s) -
System
G( s ) = 1 s(1 + 0.2 s)
Y(s)
Fig.4. 5. The block diagram of the overall system. Here WLead (s) represents the phase-lag controller or compensator and G(s) the open-loop system transfer function. The system has unity feedback, H(s) = 1. Specifications for the system are: Accuracy for a unit ramp input < 2%, i.e. steady-state error < 0.02. Maximum percent overshoot = PO < 20%. Design a phase-lead compensator that satisfies the requirements. SOLUTION: STEP 1. (is the same as in phase lag) Compute the steady-state for unit ramp input ess
ess = lim sE (s) = lim s(
s 0
1 ) R( s) s 0 1 + G ( s)
(4- 10)
Heikki Koivo
50
1 K s(1 + 0.2s)
)]
1 =K s2
(4- 11)
This implies that K > 1/0.02 = 50, choose K = 50. (4- 12)
Gain is now sufficient. The controller is at this point a P (proportional) controller. STEP 2. (As in phase lag) From Fig.2.5 percent overshoot PO <20% corresponds to > 48 phase margin, PM. This holds for second order systems and therefore we will make the dominant pole assumption. Draw the Bode dia gram of the transfer function KG(s) = 50 / s(1 + 0.2s) as before. It is redrawn in Fig.4.6. kg=zpk([],[0 -5],250) Zero/pole/gain: 250 ------s (s+5)
Bode Diagrams
From: U(1) 60 40 20
0 -20 -40 -80 -100 To: Y(1) -120 -140 -160 -180
0 1 2
10
10
10
Frequency (rad/sec)
Fig.4.6. Fig.3.4 redrawn. The Bode diagram of the open-loop transfer function KG(s). The steady-state requirement is now satisfied. Plotting is done with bode(kg) command.
Heikki Koivo
51
REMARK: If you want grids on Bode diagram as shown, activate in e.g. magnitude in Bode diagram figure. Then choose Tools from menu and under this Axis properties . Finally, choose Grid On for both X and Y.
1 and that a2
W ( m ) = a 2 = ( a 2 )dB or phase-lead circuit adds ( a 2 )dB in dB:s at the same time as max is added to the original phase margin. Construct the following table using Bode diagram by going through values of a2 between 2-10. num=[50];den=[0.2 1 0]; kg=tf(num,den); w=logspace(-1,2);[mag phase] =bode(kg,w); a2=1:0.2:10.8; halfa2db=0.5*20*log10(a2); phimax=asin((a2-1)./(a2+1)); phi=180.+phase; magdb = 20*log10(mag); phim=phi'+phimaxdeg; [a2' halfa2db' magdb phi phimaxdeg' phim' w'] Table 4.2. Effect of phase-lead circuit on phase margin of KG(s)
Heikki Koivo
52
The first three columns, a 2 , (a2)dB, and phimax(), come from the phase-lead compensator. The third, fourth and fifth, magdb, w, phi (current phase margin, if gain would become zero), are the original magnitude and phase. The final column, phim= phimax + phi , gives the phase margin of the compensated system. a2 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 (a2 )dB phimax() magdb 3.0103 19.4712 -3.0 4.7712 30.0000 -4.5 6.0206 36.8699 -6.1 6.9897 41.8103 -6.9 7.7815 45.5847 -7.7 8.4510 48.5904 -8.5 9.0309 51.0576 -9.0 9.5424 53.1301 -9.7 10.0000 54.9032 -10.1 w 18.4 20.2 22.2 23.3 24.4 25.6 26.3 27.9 28.1 phi() 15.2 13.9 12.7 12.1 11.6 11.1 10.7 10.4 10.1 phim() 34.65 43.9 49.6 53.9 57.2 59.7 61.8 63.5 65.0
How is the above table constructed? Start with the phase-lead compensator. Consider the third row. Give a value for a2, a 2 = 4 , which in dB:s is ( a2 ) dB = (4 )dB = 12 dB . Half of that is ( a 2 ) dB = 6 dB , which is the value in the second column. On the third column we see the additional phase max = 37 (= 36.8699 0) of the phase-lead compensator when a 2 = 4. Next determine the frequency at which the gain has approximately the value ( a 2 )dB = 6dB , because the effect of phase-lead will add this much to the gain. The corresponding frequency is = 22.2 rad / s and the gain -6.1 dB. These are seen in columns five and four respectively. It is further seen that the original phase margin at this frequency is phi = m = 12.7 o . This is displayed in the sixth column. Adding this to phimax = max of the third column gives the new phase margin phim = 'm = m + max = 12.7 0 + 369 . 0 = 49.6 0 , which is shown in the last column. The phase margin is now enough. STEP 4 Since m =
1 4
Heikki Koivo
53
numw=[0.088 1]; denw=[0.022 1]; w=tf(numw,denw); The open loop, compensated transfer function W(s)G(s) is calculated by wg=w*g; Plotting the Bode diagram of W(s)G(s) bode(wg) The result is given in Figure 4.7.
Bode Diagrams
From: U(1) 100 50
0 -50 -100 -80 -100 To: Y(1) -120 -140 -160 -180 10
0 1 2
10
10
Frequency (rad/sec)
Fig.4. 7. The Bode diagram of the open-loop, phase-lead compensated transfer function W(s)G(s). Let us compare the Bode diagrams of the uncompensated and compensated systems by drawing them in the same figure, Figures 4.8. bode(kg,wg)
Heikki Koivo
54
Bode Diagrams
From: U(1) 100 50
0 -50 -100 -80 -100 To: Y(1) -120 -140 -160 -180 10
0 1 2
10
10
Frequency (rad/sec)
Fig.4. 8. Bode diagrams of open-loop uncompensated and compensated magnitudes (above) and phases (below). Observe how the phase-lead compensator adds gain and at higher frequencies and phase in the middle frequencies. The closed-loop uncompensated (K=50) transfer function is calculated by: gcl=feedback(kg,1) Zero/pole/gain: 250 ---------------(s^2 + 5s + 250) The unit step response is obtained by t=linspace(0,3); y1=step(gcl,t) The closed-loop transfer function of the compensated system is computed similarly: gcl1=feedback(wg,1) Zero/pole/gain: 1000 (s+11.36) -------------------------------(s+17.44) (s^2 + 33.01s + 651.4) The step responses are plotted in the same figure, Fig.4.10: step(gcl,gcl1)
Heikki Koivo
55
Step Response
From: U(1) 1.8 1.6 1.4 1.2
Amplitude
To: Y(1)
Time (sec.)
Fig. 4.9. The step responses of the closed-loop systems, P-compensated (K=50) and the phase-lead compensated (--). The overshoot for the compensated system is slightly more than is required. This is due to the dominant pole approximation. Note how the phase-lead compensation makes the response faster. The system also becomes more susceptible to noise. The overshoot is 23% or almost what was required. Note the fast response that the phaselead compensated system produces. Recall that the phase-lag compensation slows the response compared with the original one.
Test the dominant pole assumption by computing the closed-loop roots. First transfer from zpk mode to tf -mode. tf(gcl1) Transfer function: 1000 s + 1.136e004 -----------------------------------s^3 + 50.45 s^2 + 1227 s + 1.136e004 Roots of the denominator are roots([1 50.45 1227 11360]) ans = -16.5034 +19.4652i -16.5034 -19.4652i -17.4432
Heikki Koivo
56
There are two complex poles, but the third pole clearly has a strong effect on the response. Checking also the zeros: roots([1000 11360]) ans = -11.3600 The zero is not very close to the pole p = -17.4439 but seems to cancel most of its effect, but not quite enough. This is probably the reason why the PO requirement was not satisfied right away. Let us finally draw the Bode diagram of the phase-lead compensator. numw=[0.088 1]; denw=[0.022 1]; w=tf(numw,denw); bode(w)
Bode Diagrams
From: U(1) 15
10
0 40 30 To: Y(1) 20 10 0 0 10
10
10
Frequency (rad/sec)