Prof. Dr. E. Frazzoli 5-59- Control Systems I (Autumn 27) Solution Exercise Set 2 Loop Shaping clruch@ethz.ch, 8th December 27 Exercise (A Non-minimum Phase System) To decrease the rise time of the system, we need to increase the bandwidth of the system and thus design a system with a crossover frequency ω c as high as possible. However, we are constrained by the presence of a RHP zero at z = 2, which limits the crossover frequency. The common rule of thumb used for control design is to assume that ω c <.5z. Thus, for our problem: ω c < rad/sec. So we will add gain along with a lead compensator to try to achieve a crossover frequency of rad/sec while increasing the phase margin. We use a lead compensator of form: At ω =, the phase of P (s) is: C lead = K + s a + s. b ( ) P (jω) ω= = arctan arctan 2 = 78.69 87.7 26.57 = 92.97 ( 4 ) ( ) arctan 2 We need a phase margin of around 45, so we need the compensator to provide: 45 + ( 8 ( 92.97 )) = 57.97. To get a condition for a and b we calculate the phase shift at the maximal phase shift frequency ab. C lead (j ab ab ab) = arctan( a ) arctan( b ) b = arctan( a ) arctan( ) b ( ) = 2 arctan b/a π/2, ( b/a ) Now, 57.97 = 2 arctan 9. Therefore, we want b/a = 3.48. Since, ω c = = ab, we get: a 29 b = 348 a (arctan( ) = π/2 arctan(x)) x Now, we need to find K: At the crossover frequency ω c, L(s) ωc= =. Therefore, we want:
+ (/2) 2 + (/29) = 5 + (/4) 2 + (/2) 2 K 2 + (/348) 2 That is, we want K 6.56. Therefore, our lead compensator is: C lead (s) = 6.56 + s/29 + s/348. But now we need a lag element to compensate for the increased gain of the system at high frequencies due to the lead compensator and to minimize the steady state error. A good rule of thumb so that the lag compensator does not interfere with the phase margin and crossover frequency determined by the lead compensator is to choose its zero to be a decade below the crossover: C lag = s + s + b. The low frequency gain of the system is around 6.56 5 = 32.8. To have low frequency gain of 2, we choose a lag ratio of 2/32.8 = 6.: b =.6 Therefore, our final compensator is: ( + s/29) (s + ) C(s) = C lead (s)c lag (s) = 6.56 ( + s/348) (s +.6) The Bode plot of the resulting Loop transfer function is: 6 Gm = 6.5 db (at 25 rad/s), Pm = 4. deg (at 99.7 rad/s) 4 2-2 -4 36 27 8 9-2 - 2 3 4 The step response of the resulting closed-loop system is given below. Notice the undershoot caused by the RHP zero. 2
Imaginary Axis (seconds - ) Amplitude.4.2.8.6.4.2 -.2 -.4.2.4.6.8..2.4.6 Exercise 2 (A Dynamic Compensator) The root locus and Bode plot of the system P (s) are given below: 5 Gm = Inf db (at Inf rad/s), Pm = 84.3 deg (at.995 rad/s) 6 Root Locus 4-5 2 - -9-2 -35-4 -8-2 3-6 -2 - -8-6 -4-2 2 Real Axis (seconds - ) The root locus plot shows that the closed-loop system is stable for all positive gains, i.e., it is stable for C(s) = K, for K >. We take K = for our baseline stabilizing controller, so that the Bode plot above shows us the performance of the system with K =.. The steady-state error following ramp inputs must not exceed 2%. For this requirement to hold, the system must be of Type, i.e., L(s) = C(s)P (s) must have one pole at the origin (i.e., an integrator). Furthermore, the Bode-plot gain of L(s) must be such that e ss.2 for a ramp input. Since P (s) already contains a pole at the origin, there is no need yet to change the structure of the compensator C(s) = K. However, choosing C(s) = would not satisfy the max error requirement because we need the compensator gain to be greater than than /.2, i.e., K 5. From our previous experience we know that a ramp is a input of order m = and that our system is of order γ = since it has a pole in the origin. We can find the steady-error as follows (also using table ): ess = lim s + L(s) e st s m = lim s sl(s) = lim s Ks s(.s+) = K The Bode plot for K = 5 is shown in the figure below. It is obtained by translating the magnitude plot of the previous Bode plot up by log 5. The phase plot remains unchanged: 3
m = m = m = 2 m = 3 γ = +L() γ = L() γ = 2 L() γ = 3 L() Table : Steady-state tracking error depending on the Type γ and the order m of the m-th order unit ramp given as reference. Gm = Inf db (at Inf rad/s), Pm = 25.2 deg (at 2.3 rad/s) 5-5 - -9-35 -8-2 3 2. The error in response to sinusoidal inputs up to 5 rad/sec should not exceed about 5%. The error in response to sinusoidal inputs can be evaluated using the frequency response. The transfer function from the reference input to the error is given by the sensitivity S(s) = + L(s). In particular, the magnitude of the error in response to a unit-amplitude sinusoid of frequency ω is given by S(jω) = / + L(jω). Hence, the specification can be written as + L(jω) /.5 = 2, for all ω 5 rad/s. In order to satisfy this equation, L(jω) should be large with respect to, hence we approximate this condition as L(jω) 2, for all ω 5 rad/s. From the magnitude Bode plot of L(s) above, we can see that the system with C(s) = 5 does indeed hit the obstacle imposed by this magnitude condition: at 5 rad/s, the magnitude of L(s) is only about 9. Thus, we need to further increase the gain by at least a factor of 2/9, so let us take C(s) = 5, giving us this new Bode plot: 4
5 Gm = Inf db (at Inf rad/s), Pm = 6.8 deg (at 33.2 rad/s) System: untitled : 5.35 : 25.6-5 - -9-35 -8-2 3 3. The crossover frequency should be at about 5 rad/sec to meet bandwidth requirements while limiting the response to high-frequency noise. With the current design C(s) = 5, the crossover frequency occurs at approximately ω c = 33.2 rad/s, and at 5 rad/sec the magnitude of the frequency response is about.4. Hence, in order to make sure that the crossover frequency is exactly at 5 rad/s, we need to multiply K by a factor of /.4 = 2.5. We thus even further increase K to K = 288, satisfying the first three requirements. 4. The phase margin should be about 5, and the ratio of the break frequencies of C should not exceed 5 to limit noise effects. While the choice of C(s) = 288 satisfies requirements -3, increasing the gain makes the phase margin very small. We now have a phase margin of only 2. We can use a lead compensator to increase the phase at crossover frequency, i.e., consider a compensator of the form C(s) = K s a + s b +. The maximum phase lead we can get is limited by the constraint on the ratio α = b/a of the break frequencies of the compensator imposed by our requirement. Using the straightline approximation, we know that the phase lead will be degrees one decade below the zero break frequency, and will increase linearly with log ω at a rate of 45 degrees/decade until one decade below the pole break frequency, at which point it will remain flat and eventually decrease. In other words, an estimate of the maximum phase lead is φ max = 45 log (5) = 3.45. (More accurate calculations, yield a max phase lead of about 4.) In other words, a lead compensator, if used correctly, could increase the phase margin to the 45-5 degrees range, as desired. How do we get the maximum phase lead contribution to the phase margin? We can achieve this by placing the midpoint (on a log scale, i.e., the geometric mean) of the compensator zero/pole break frequencies exactly at the desired crossover frequency. Doing the math, we get a b = a α = 5rad/s, i.e., a = 5/ 5 = 22.36 rad/s, and b = 5a = 5 5 =.8 rad/s. The resulting Bode plot is shown below. The phase at 5 rad/s is as desired. However, the crossover frequency has moved to the right as an effect of the increased gain at high frequencies due to the lead compensator. 5
Amplitude In order to recover the correct crossover frequency, and the desired phase margin, we can lower the gain (i.e., shift the magnitude Bode plot downwards). Fortunately, we have some room to reduce the gain and still meet requirements () and (2), since we artificially increased the gain in step (3). For C(s) = 288(s/22.36 + )/(s/.8 + ), the magnitude of the L(s) at 5 rad/s is about 2.5, so let s reduce the gain by a factor of 2.5: C(s) = 5 s/22.36 + s/.8 + = 575 s + 22.36 s +.8 Note that this compensator satisfies the error specifications () and (2), since K is still greater than the minimum values we obtained from those requirements. If this had not been the case, we could have added a lag compensator at low frequencies. The corresponding Bodeplot is: Gm = Inf db (at Inf rad/s), Pm = 53 deg (at 5.3 rad/s) 5-5 - -9-35 -8-2 3 4 The step response of the resulting closed-loop system with designed C(s) is:.2.8.6.4.2.5..5 Exercise 3 (Time Delays) a) We analyatically derive the magnitude and phase of :e jt dω = cos(t d ω) j sin(t d ω). 6
Magnitude: e jtdω = cos(t d ω) j sin(t d ω) = (cos(t d ω)) 2 + ( sin(t d ω)) 2 = cos 2 (T d ω) + sin 2 (T d ω) = Phase: ( ) e jtdω sin(td ω) = arctan cos(t d ω) ( ) sin(td ω) = arctan cos(t d ω) = arctan (tan(t d ω)) = T d ω Below are linear plots of both the magnitude and phase for T d = :.5 -.5 - -8-36 -54-72 2 3 4 5 6 7 8 9 On a logarithmic scale, it looks like this:.5 -.5 - -8-36 -54-72 7
Amplitude b). The first, second, and third order Padé approximations for T d = are: st order: e s 2 s 2 + s 2nd order: e s s2 6s + 2 s 2 + 6s + 2 3rd order: e s s3 + 2s 2 6s + 2 s 3 + 2s 2 + 6s + 2 2. The corresponding Bode plots of e s and its first through third order Padé approximations are:.5 -.5-44 -44-288 -432-576 Exact First order Second order Third order 2 3 4 5 6 7 8 9 3. The corresponding step responses are:.5 Exact First order Second order Third order.5 -.5 -.5.5 2 2.5 3 3.5 4 c). The Bode plots are as follows: 8
Amplitude Amplitude 5 5-5 -5-44 - 2.34 # 4-44 -288 No delay -432 Exact delay of. sec First order approx of. sec delay -576-2 3 4-2.34-4.68 No delay Exact delay of. sec First order approx of. sec delay -6.92-2 3 4 2. The step responses are as follows:.8 2.5 # 33.6 No delay Exact delay of. sec.4 2.2.5.8.6.4.5.2 No delay Exact delay of. sec First order approx of. sec delay -.2.5..5.2.25.3.35.4.45 -.5 2 3 4 5 6 7 d) As we saw from the plots above, while the designed compensator can handle small delays, the system becomes destabilized for larger time delays. The first order Padé approximation for G d (s) = e T ds is D(s) = 2/T d s 2/T d + s. This is an all-pass filter with a RHP zero equal to 2/T d. As the time-delay T d increases, this RHP zero approaches the origin and further and further limits the crossover frequency of the system, thus decreasing the phase without changing the gain crossover. Thus, a large enough time delay can destabilize the system. Remember our rule of thumb that the crossover frequency w c <.5z, where z is a RHP zero. Thus, for T d =., w c < rad/sec, while in the previous exercise we assumed we could reach a crossover frequency of w c = 5 rad/sec. As time delay is an important consideration for many control applications, it can thus also be useful to consider the time delay margin along with the gain and phase margins. You can use Matlab s allmargin to calculate all these margins for a given loop function. For the plant P (s) and C(s) designed in this solution set for exercise 2, the time delay margin claculated by Matlab is.84 seconds. Therefore, it is no surprise that the system was unable to handle a delay of. seconds. 9