answers for #7 - Wescott Design Services

advertisement
Answers to Homework #7 for CST­407­02P
Assigned May 17,
Due May 24
Sensitivity
The sensitivity of a system is the degree to which it will respond in closed loop compared to its response in open loop (see the discussion on pp 112 and 113). This measure is of only minor and obscure importance in analyzing the intended behavior of the loop, but it gains quite a bit of importance when you start looking at a loop's disturbance behavior.
If you have a system with an open­loop gain of HOL, it's sensitivity is just S z=
1
1HOL  z 
(1)
(this just restates equation 5.24 in the book).
If you have a transfer function defined as H in Scilab, you can make a Bode plot of it's sensitivity in at least two ways. The more obvious way is to use
­­>clf; bode(H / (1 + H), fmin, fmax, fstep)
where fmin, fmax, and fstep are what you would normally use to select the range and resolution. Scilab also gives you an operator to directly add feedback; it is of the form (forward gain) /. (feedback gain). Note that the operator is a forward slash followed by a '.'. So you can make a Bode plot using
­­>clf; bode(1 /. H, fmin, fmax, fstep)
This works because the forward 'gain' in the sensitivity plot is 1, and the feedback is the whole open loop gain.
1. Consider the system from problem 2c in last week's homework, which had the transfer function
H ol z =
z 2−1.53∗z 0.6
2
 z −1   z −0.95
(2)
a. Assume a sampling rate of 100Hz. Plot the system sensitivity.
­­>H_ol = (%z^2 – 1.53 * %z + 0.6) / ..
((%z – 1)^2 * (%z – 0.95));
­­>H_ol.dt = 1/100;
­­>clf; bode(1 /. H_ol, 0.01, 50, 0.01);
The result is shown in Figure 1. Note that the sensitivity goes above one at higher frequencies, but is very low (as a consequence of the high loop gains from the integrators) at low frequencies.
Figure 1: Bode Plot of the System Sensitivity.
b. Assume that HOL is composed of a controller with transfer function G and a plant with transfer function H:
2
, G z =
z −1.53∗z 0.6
z  z−1 
(3)
. H  z=
z
 z−1  z−0.95 
(4)
Refer to the block diagram in Figure 5.12 on page 112. Verify, either by computing the new transfer function in Scilab or by plotting Bode plots that the open­loop transfer function matches (2).
­­>G = (%z^2 – 1.53 * %z + 0.6) / (%z * (%z – 1));
­­>H = %z / ((%z – 1) * (%z – 0.95));
­­>G * H – H_ol
ans =
0
­
1
Of course, one could also do this by hand; it is simple enough to cancel the z in the numerator of H with the z in the denominator of G, collect the z – 1 terms, and save the rest.
c. Plot the plant's response to a disturbance input (ud in Figure 5.12) with no feedback, and overlay this with the entire system's response to a disturbance torque. Has the situation been improved at 0.1Hz? 1Hz? 10 through 50Hz?
­­>H.dt = 1/100; G.dt = 1/100;
­­>clf; bode(H, 0.01, 50, 0.01);
­­>bode(H /. G, 0.01, 50, 0.01);
Figure 2 shows the bode plots superimposed on one another. The system disturbance rejection is about 20dB at 0.1Hz, where the plant alone has a response of nearly 75dB. This indicates that the response to disturbances at 0.1Hz is 95dB down – or about 56000 times smaller – in closed loop as opposed to open loop.
You pay for this disturbance rejection at low frequencies, because from 10Hz to 50Hz the plant's response to disturbances is enhanced by some 4dB, or about 67%.
Figure 2: Plant Bode plot vs. Closed­loop Bode plot.
Nyquist Plots
Scilab makes it easy to generate a Nyquist plot. The syntax is much like that for a Bode plot, with 'nyquist' substituted for 'bode'. For instance, to get a Nyquist plot of the system above, you can use:
­­>clf; nyquist(H * G)
By itself Scilab gives you a Nyquist plot that is huge, isn't isometric, and that extends from negative frequencies to positive ones. You can improve this by commanding:
­­>clf; nyquist(H * G, 5, 50, 0.05);
// see some detail
­­>g = gca(); g.isoview = 'on';
// make it isometric
­­>xarc(­2, 1, 2, 2, 0, 64 * 360);
// show the sensitivity < 1
// boundary
When you're done, it should look like Figure 3, below.
Figure 3: Nyquist plot with unitary sensitivity circle.
2. Use the above commands to make a close­in Nyquist plot of the system from question 1. On a separate graphic, make a larger Nyquist plot for reference. To get the separate graphic use the 'scf' command:
­­>scf(1); clf; nyquist(H * G, 1, 50, 0.05);
(you may want to print this with several starting frequencies, or play with zooming the plot to various degrees). Note that if you want to send plots to the first graphic you can call 'scf(0)' to do so.
Figure 4 shows the results of plotting this from 0.1Hz (not 1Hz as above) to 50Hz. Note that I did not turn isometric viewing on – had I done so the plot would have been very flat, which is consistent with the 180 degrees of phase shift you can expect from the two poles at z = 1.
Figure 4: A Long­view Nyquist plot showing ultimate behavior.
a. Using the close­in Nyquist plot, determine the gain and phase margins of the system.
Figure 5 shows the graphical method of extracting gain and phase margins. The red lines are at the intersection of the system open loop gain and the negative real number line (i.e. the line where phase = 180 degrees). The leftmost line has a gain of 4.77, or about 14dB. The rightmost line has a gain of 0.4, or about ­8dB. Thus, the gain margins are 14dB and 8dB.
The dotted blue circle has a radius of 1. The point where the open loop gain plot intersects this circle is along a line that runs from (0, 0) to (­1.5, ­1.13); this line has an angle of ­143 degrees. The phase margin is –143° + 180° = 37°.
Figure 5: Extracting Gain and phase margins.
b. Using the close­in Nyquist plot, determine the worst­case sensitivity of the system. Does it appear as if the worst­case sensitivity has to be coincident with the gain or phase margin points?
Figure 6 shows the Nyquist plot of the system from Figure 3 with a circle of radius 0.6 (­4.4dB), which stays with the open­loop gain locus for a considerable span of frequencies. This is consistent with the sensitivity plot in Figure 1.
Figure 6: Nyquist Plot showing sensitivity.
3. I can't resist. The ever­practical inverted pendulum can be built with a transfer function that approaches z
H  z =
(5)
 z−0.99  z− 1
0.99


(assume a sampling rate of 250Hz)
a. Is this plant stable by itself? Where does the math show it's stability/instability?
No, it is not. Reality says it isn't stable because when you balance a broomstick all by itself it falls down. The math tells us that H has a pole at z = 1/0.99, which is greater than 1 and therefore renders H unstable.
b. This plant can be stabilized with a controller whose transfer function is
350z −335
. H  z =
(6)
z −0.7
Generate a Nyquist plot of this system with open­loop gain of G(z)H(z). Use fmin = ­125, fmax = 125, and fstep = 0.05 (it is also highly informative to generate a root locus plot for a maximum gain of 5 or so, but that's not part of this homework).
Figure 7 shows the Evans root locus plot for the system, but with gain ranging up to 0.01. This is bad news, and shows that your faithful instructor has erred. The system looks pretty good if the plant has a transfer function of 0.0001 z
H  z =
;
 z −0.99  z − 1
0.99
I assume that my mistake came in omitting the factor of 10–4.


Figure 7: Evans Root locus plot with the WRONG GAIN!
Figure 8 shows the Nyquist plot for the system. Note the huge gains...
Figure 8: Nyquist plot. Equally wrong gain (&%$#!).
c. How many times does the open­loop plot circle ­1, and in which direction?
The plot doesn't circle ­1 at all; the closest it comes to the imaginary number line is at a frequency of ½ the sampling rate, where it has a value of –100 or so.
d. How many unstable poles are there in the open­loop transfer function?
The open loop transfer function has poles at z = 0.7, 0.99 and 1/0.99. Only the last­mentioned one of these is unstable.
e. Given the answers to c and d, is the closed­loop system stable?
No. To be stable, the system Nyquist plot would have to circle ­1, going counter­clockwise, exactly once for the one unstable pole in the open­loop transfer function. Note, however, that had I gotten my gains correct in the problem formation the plot would, indeed, circle ­1 going counter­clockwise, indicating a stable system.
4. Using the Nyquist plot, determine the maximum sensitivity of the system.
For the unstable system the sensitivity means nothing, and this is a trick question – but the trick is on me, not you. For the correct gain, the Nyquist plot would be the one shown in Figure 9. The sensitivity circle here has a radius of 0.76, indicating a maximum sensitivity of 1.3, or about 2.4dB.
Figure 9: Nyquist plot of corrected system showing sensitivity.
a. repeat this using a Bode plot.
Once again, for an unstable system the sensitivity means nothing. For the corrected system I get the Bode plot using
­­>scf(0); clf; bode(1 /. (0.0001 * H * G), 0.001, 0.5, 0.05);
Figure 10 shows the resulting plot, which shows the expected 2.4dB or so of sensitivity, occurring at around 0.03 times the sampling rate.
Figure 10: Bode plot of sensitivity with gain corrected.
Download