This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
) 1. P(s) = 8{s) s2 + 25 35. A room's temperature can be controlled by varying the radiator power. In a specific room, the transfer Assume the rider can be represented by a gain K, function from indoor radiator power, Q, to room and that the closed-loop system is shown in Figure temperature, Tin °C is (Thomas, 2005) 10.20 with G(s) = KP(s) and H = 1. Use the Nyquist stability criterion to find the range of K for closed-loop stability. -13> 2 -9> \-6\<.2 + (1.314 x 1 ( T > + (2.66 x 10k 39. The control of the radial pickup position of a digital (1 x 10-°)s versatile disk (DVD) was discussed in Problem 48, •»—11> 3 2 s + 0.00163 s + (5.272 x 10~> + (3.538 x 10 Chapter 9. There, the open-loop transfer function from coil input voltage to radial pickup position was The system is controlled in the closed-loop configuragiven as (Bittanti, 2002) tion shown in Figure 10.20 with G(s) = KP{s), H = 1. 0.63 a. Draw the corresponding Nyquist diagram for K = l. , 0.04 0.36 1 +7rr77izs + b. Obtain the gain and phase margins. 248.2 248.2' 305.4 305.4' c. Find the range of K for the closed-loop stability. Assume the plant is in cascade with a controller, Compare your result with that of Problem 61, Chapter 6. 0.5(^ + 1.63) X (s) P(s) = T FT (S)
MM^M
(b)
*» t
Output
FIGURE 10.2 Sinusoidal frequency response: a. system; b. transfer function; c. input and output waveforms
Chapter 10
Frequency Response Techniques
of the sinusoids as shown in Figure 10.2(c). Assume that the system is represented by the complex number, M(w)Z0(a>). The output steady-state sinusoid is found by multiplying the complex number representation of the input by the complex number representation of the system. Thus, the steady-state output sinusoid is M0(co)Zfa{co) = Mi(co)M(a>)Z[Pi{a>) + #(<*>)]
(10.1)
From Eq. (10.1) we see that the system function is given by
and ¢(0)) = ^(0))-^(0))
(10.3)
Equations (10.2) and (10.3) form our definition of frequency response. We call M(o)) the magnitude frequency response and ¢(0)) the phase frequency response. The combination of the magnitude and phase frequency responses is called the frequency response and is M(a>)Z0(a>). In other words, we define the magnitude frequency response to be the ratio of the output sinusoid's magnitude to the input sinusoid's magnitude. We define the phase response to be the difference in phase angle between the output and the input sinusoids. Both responses are a function of frequency and apply only to the steadystate sinusoidal response of the system.
Analytical Expressions for Frequency Response Now that we have defined frequency response, let us obtain the analytical expression for it (Nilsson, 1990). Later in the chapter, we will use this analytical expression to determine stability, transient response, and steady-state error. Figure 10.3 shows a system, G(s), with the Laplace transform of a general sinusoid, r(t) = A cos o)t 4B sin cot = V A2 + B2 cos [o)t - tan - ] (B/A)] as the input. We can represent the input as a phasor in three ways: (1) in polar form, MjZfa, where M,- = y A2 + B2 and 0, = -tan~ 1 (B/A); (2) in rectangular form, A — jB; and (3) using Euler's formula, M/e^'. We now solve for the forced response portion of C(s), from which we evaluate the frequency response. From Figure 10.3, _.
As + Be* -,. .
c
<*> = ( ? w j G ( s )
Mn
.,
(10 4)
'
We separate the forced solution from the transient solution by performing a partialfraction expansion on Eq. (10.4). Thus, AS B<0
C(,)=,
l
.,G(s)
<*+**-/«) =
K
—I
S + JO)
K
— + Partial fraction terms from G(s)
S — ]0)
(105)
10.1
Introduction
where As + Ba,
= -(A +jB)G(-ja>) = -Mie-faMce-if*
S-jCO
2
*-*-&
2
_MJMG
" K2=A±
+ Ba> s+yw
(10.6a)
iiMa)
2
= i (A - jB)G(jco) = -Miet&Mae^*3 (10.6b)
S—>+j(t)
For Eqs. (10.6), 2£| is the complex conjugate of j&j,, M G = |G(/w)|
(10.7)
0 G = angle of G(/W)
(10.8)
The steady-state response is that portion of the partial-fraction expansion that comes from the input waveform's poles, or just the first two terms of Eq. (10.5). Hence, the sinusoidal steady-state output, Css(s), is s + jco s — jco
(10.9)
Substituting Eqs. (10.6) into Eq. (10.9), we obtain MiMG __
CWW =
MjMG^^n)
f(Mn)
2 S + JCO
+
(10.10) S — JO)
Taking the inverse Laplace transformation, we obtain 'p-i{ut+4>i+4>G) 4- pJ(a)l+'i>i+
c(t)=MiMG'
(10.11)
= M-MG COS (cot + ¢1 +
(10.12)
Plotting Frequency Response G(jco) = MG{W) < 0G( W ) c a n De plotted in several ways; two of them are (1) as a function of frequency, with separate magnitude and phase plots; and (2) as a polar plot, where the phasor length is the magnitude and the phasor angle is the phase. When plotting separate magnitude and phase plots, the magnitude curve can be plotted in
537
538
C h a p t e r 10
Frequency R e s p o n s e Techniques
decibels (dB) vs. logw, where dB = 20 log M.1 The phase curve is plotted as phase angle vs. log co. The motivation for these plots is shown in Section 10.2. Using the concepts covered in Section 8.1, data for the plots also can be obtained using vectors on the s-plane drawn from the poles and zeros of G{s) to the imaginary axis. Here the magnitude response at a particular frequency is the product of the vector lengths from the zeros of G(s) divided by the product of the vector lengths from the poles of G(s) drawn to points on the imaginary axis. The phase response is the sum of the angles from the zeros of G(s) minus the sum of the angles from the poles of G(s) drawn to points on the imaginary axis. Performing this operation for successive points along the imaginary axis yields the data for the frequency response. Remember, each point is equivalent to substituting that point, s = jcoi, into G(s) and evaluating its value. The plots also can be made from a computer program that calculates the frequency response. For example, the root locus program discussed in Appendix H at www.wiley. com/college/nise can be used with test points that are on the imaginary axis. The calculated K value at each frequency is the reciprocal of the scaled magnitude response, and the calculated angle is, directly, the phase angle response at that frequency. The following example demonstrates how to obtain an analytical expression for frequency response and make a plot of the result.
Frequency Response from The Transfer Function PROBLEM: Find the analytical expression for the magnitude frequency response and the phase frequency response for a system G(s) = l/(s + 2). Also, plot both the separate magnitude and phase diagrams and the polar plot. -6 -12
1° ~24 o N
-30
-36 -42 0.1
1
10
100
10
100
Frequency (rad/s) 0 -10 ~ -20
-"vv
1 -30
\
$? -40 f -50
ss
| -60 * -70 -80 -90 0.1
1 Frequency (rad/s)
FIGURE 10.4 Frequency response plots for G(s) = l/(s + 2): separate magnitude and phase diagrams. 'Throughout this book, "log" is used to mean logio, or logarithm to the base 10.
10.1 Introduction
SOLUTION: First substitute s = jco in the system function and obtain G(jeo) = I/(jco + 2) = (2 — jco)/(o)2 + 4). The magnitude of this complex number, \G(ja>)\ — M(co) = 1/yj(a)2 +4), is the magnitude frequency response. The phase angle of G(jco), ¢(0)) = —tan" 1(co/2), is the phase frequency response. G(jco) can be plotted in two ways: (1) in separate magnitude and phase plots and (2) in a polar plot. Figure 10.4 shows separate magnitude and phase diagrams, where the magnitude diagram is 20 log M(co) = 20 log (1/Vco2 + 4) vs. logco, and the phase diagram is ¢(0)) = —tan -: (co/2) vs. log co. The polar plot, shown in Figure 10.5, is a plot of M(a>) < 0(o>) = \fy/a?- + 4 < -\ssrx{mJ2) for different co. 1
(0=
Re G 1
0 oor/s 0.05
1
0.1
1
1
1
1
'
0.15
0.2
0.25
0.3
0.35
1-
0.4
\
0.45
03 = 0r/s
ft
0.5
Note: r/s = rad/s
FIGURE 10.5 Frequency response plot for G(s) = l/(s + 2): polar plot In the previous example, we plotted the separate magnitude and phase responses, as well as the polar plot, using the mathematical expression for the frequency response. Either of these frequency response presentations can also be obtained from the other. You should practice this conversion by looking at Figure 10.4 and obtaining Figure 10.5 using successive points. For example, at a frequency of 1 rad/s in Figure 10.4, the magnitude is approximately - 7 dB, or 10_7/,2° = 0.447. The phase plot at 1 rad/s tells us that the phase is about —26°. Thus, on the polar plot a point of radius 0.447 at an angle of —26° is plotted and identified as 1 rad/s. Continuing in like manner for other frequencies in Figure 10.4, you can obtain Figure 10.5. Similarly, Figure 10.4 can be obtained from Figure 10.5 by selecting a sequence of points in Figure 10.5 and translating them to separate magnitude and phase values. For example, drawing a vector from the origin to the point at 2 rad/s in Figure 10.5, we see that the magnitude is 20 log 0.35 = —9.12dB and the phase angle is about -45°. The magnitude and phase angle are then plotted at 2 rad/s in Figure 10.4 on the separate magnitude and phase curves.
PROBLEM:
a. Find analytical expressions for the magnitude and phase responses of G{S)
=
(s + 2)(s + 4)
540
Chapter 10
Frequency Response Techniques
b. Make plots of the log-magnitude and the phase, using log-frequency in rad/s as the ordinate. c. Make a polar plot of the frequency response. ANSWERS:
a. M(co) = 2 , (8 fa -_™a\2 4-(6,^ (6a>) co2y +
for co < VS : $(co) = -arctanf ~), for \$-co2J ( 6co CO > V8 : 0(eo) = - % + arctan -
b. See the answer at www.wiley.com/college/nise. c. See the answer at www.wiley.com/college/nise. The complete solution is at www.wiley.com/college/nise. In this section, we defined frequency response and saw how to obtain an analytical expression for the frequency response of a system simply by substituting s =jco into G(s). We also saw how to make a plot of G(Jco). The next section shows how to approximate the magnitude and phase plots in order to sketch them rapidly.
£ 10.2 Asymptotic Approximations: Bode Plots The log-magnitude and phase frequency response curves as functions of log co are called Bode plots or Bode diagrams. Sketching Bode plots can be simplified because they can be approximated as a sequence of straight lines. Straight-line approximations simplify the evaluation of the magnitude and phase frequency response. Consider the following transfer function: G(s) = g ( ' + *i)(' + *2)"-(* + gfc) sm(s + pl)(s+p2)---(s+ptt)
(1(n3)
The magnitude frequency response is the product of the magnitude frequency responses of each term, or \G(jco)\= *K , + *i)ll(J + * 2 ) l - - ^ + ^)1 l*1l(* + Pl)ll(* +P2)\"'\(3+Pn)\
(10.14) S—*)(J)
Thus, if we know the magnitude response of each pole and zero term, we can find the total magnitude response. The process can be simplified by working with the logarithm of the magnitude since the zero terms' magnitude responses would be added and the pole terms' magnitude responses subtracted, rather than, respectively, multiplied or divided, to yield the logarithm of the total magnitude response. Converting the magnitude response into dB, we obtain 201og|G0^)|=201og# + 201og|(s + Zi)|+201og|(s + Z 2 )|
+ ----20^1^1-20^1(5+^)1----1,^
10.2 Asymptotic Approximations: Bode Plots Thus, if we knew the response of each term, the algebraic sum would yield the total response in dB. Further, if we could make an approximation of each term that would consist only of straight lines, graphical addition of terms would be greatly simplified. Before proceeding, let us look at the phase response. From Eq. (10.13), the phase frequency response is the sum of the phase frequency response curves of the zero terms minus the sum of the phase frequency response curves of the pole terms. Again, since the phase response is the sum of individual terms, straight-line approximations to these individual responses simplify graphical addition. Let us now show how to approximate the frequency response of simple pole and zero terms by straight-line approximations. Later we show how to combine these responses to sketch the frequency response of more complicated functions. In subsequent sections, after a discussion of the Nyquist stability criterion, we learn how to use the Bode plots for the analysis and design of stability and transient response.
Bode Plots for G(s) = (s + a) Consider a function, G(s) = (s + a), for which we want to sketch separate logarithmic magnitude and phase response plots. Letting s = jco, we have G{j(o) = {jeo + a) = a(j-
+ l)
(10.16)
At low frequencies when co approaches zero, G(ja>) » a
(10.17)
20 log M = 20 log a
(10.18)
The magnitude response in dB is
where M = \G(Jco)\ and is a constant. Eq. (10.18) is shown plotted in Figure 10.6(a) from co = 0.01a to a. At high frequencies where co > a, Eq. (10.16) becomes G(jco) « aO— j = a ( - ) Z 90° = coZ90°
(10.19)
The magnitude response in dB is 20 log M = 20 log a + 20 log - = 20 log co
(10.20)
where a < co < oo. Notice from the middle term that the high-frequency approximation is equal to the low-frequency approximation when co = a, and increases for co > a. If we plot dB, 20 log M, against logco, Eq. (10.20) becomes a straight line: y = 20x
(10.21)
where y = 20 log M, and x = log co. The line has a slope of 20 when plotted as dB vs. logco. Since each doubling of frequency causes 20 log co to increase by 6 dB, the line rises at an equivalent slope of 6 dB/octave, where an octave is a doubling of frequency. This rise begins at co = a, where the low-frequency approximation equals the high-frequency approximation.
542
C h a p t e r 10
Frequency R e s p o n s e Techniques
42+ 20 log a
y'
36+ 20 log a
/
30+ 20 log a * 24 + 20 log a o 18 + 201oga
ye
12 + 201oga
Slope = 6 dB/octave —20 dB/decade
6 + 201oga
/
20 log a 0.01«
IK
0.1a
10a
100a
I0a
100a
Frequency (rad/s)
90 75
1 60 3 45
'
Slope - 45°/decade
1 30 0-.
15 0 0.01a
0.1a
a Frequency (rad/s) (b)
FIGURE 10.6 Bode plots of (s + a): a. magnitude plot; b. phase plot We call the straight-line approximations asymptotes. The low-frequency approximation is called the low-frequency asymptote, and the high-frequency approximation is called the high-frequency asymptote. The frequency, «, is called the break frequency because it is the break between the low- and the high-frequency asymptotes. Many times it is convenient to draw the line over a decade rather than an octave, where a decade is 10 times the initial frequency. Over one decade, 20 log a> increases by 20 dB. Thus, a slope of 6 dB/octave is equivalent to a slope of 20 dB/ decade. The plot is shown in Figure 10.6(A) from co = 0.01« to 100«. Let us now turn to the phase response, which can be drawn as follows. At the break frequency, a, Eq. (10.16) shows the phase to be 45°. At low frequencies, Eq. (10.17) shows that the phase is 0°. At high frequencies, Eq. (10.19) shows that the phase is 90°. To draw the curve, start one decade (1/10) below the break frequency, 0.1«, with 0° phase, and draw a line of slope +45° /decade passing through 45° at the break frequency and continuing to 90° one decade above the break frequency, 10«. The resulting phase diagram is shown in Figure 10.6(6). It is often convenient to normalize the magnitude and scale the frequency so that the log-magnitude plot will be 0 dB at a break frequency of unity. Normalizing and scaling helps in the following applications: 1. When comparing different first- or second-order frequency response plots, each plot will have the same low-frequency asymptote after normalization and the same break frequency after scaling.
10.2 Asymptotic Approximations: Bode Plots 2. When sketching the frequency response of a function such as Eq. (10.13), each factor in the numerator and denominator will have the same low-frequency asymptote after normalization. This common low-frequency asymptote makes it easier to add components to obtain the Bode plot. To normalize (s + a), we factor out the quantity a and form a[(s/a) + \]. The frequency is scaled by defining a new frequency variable, s\ = s/a. Then the magnitude is divided by the quantity a to yield 0 dB at the break frequency. Hence, the normalized and scaled function is (si -f 1). To obtain the original frequency response, the magnitude and frequency are multiplied by the quantity a. We now use the concepts of normalization and scaling to compare the asymptotic approximation to the actual magnitude and phase plot for (s + a). Table 10.1 shows the comparison for the normalized and scaled frequency response of (s + a). Notice that the actual magnitude curve is never greater than 3.01 dB from the asymptotes. This maximum difference occurs at the break frequency. The maximum difference for the phase curve is 5.71°, which occurs at the decades above and below the break frequency. For convenience, the data in Table 10.1 is plotted in Figures 10.7 and 10.8. We now find the Bode plots for other common transfer functions.
TABLE 10.1 Asymptotic and actual normalized and scaled frequency response data for (s + a) ^Hf™y a (rad/s)
20 log ^ ( d B ) a Asymptotic
Phase (degrees) Actual
Asymptotic
Actual
0.01
0
0.00
0.00
0.57
0.02
0
0.00
0.00
1.15
0.04
0
0.01
0.00
2.29
0.06
0
0.02
0.00
3.43
0.08
0
0.03
0.00
0.1
0.04
0.00
4.57 5.71
0.2
0 0
0.17
13.55
11.31
0.4
0
0.64
27.09
21.80
0.6
0
1.34
35.02
30.96
0.8
0
2.15
40.64
38.66
1 2
0
3.01
45.00
45.00
6
6.99
58.55
63.43
4
12
12.30
72.09
75.96
6
15.56
15.68
80.02
80.54
8 10
18 20
18.13
85.64
82.87
20.04
90.00
84.29
20
26.02
26.03
90.00
87.14
40
32.04
32.04
90.00
88.57
60
35.56
35.56
90.00
89.05
80
38.06
38.06
90.00
89.28
40
40.00
90.00
89.43
100
544
Chapter 10
Frequency Response Techniques
20
18
/
14 12
"a io o
/ /
g
Actual
y' /
x \
/
/
x
/ N
Asymptotic approximation
0.1
10
Frequency a
FIGURE 10.7 Asymptotic and actual normalized and scaled magnitude response of (s + a)
90
<
^-
J
70 60
/
*
/
r
&50
\ \
Asymptotic approximation
40
A '/
30
/ " • Actual
20
10
A
/y
/
10
0.01 Frequency
100
frad/s)
FIGURE 10.8 Asymptotic and actual normalized and scaled phase response of (5 + a)
Bode Plots for G(s) - 1 / ( 5 + 0 ) Let us find the Bode plots for the transfer function G(s) =
1
s+a
1 S
a( -+l
(10.22)
10.2 Asymptotic Approximations: Bode Plots
545
This function has a low-frequency asymptote of 20 log (1 /a), which is found by letting the frequency, s, approach zero. The Bode plot is constant until the break frequency, a rad/s, is reached. The plot is then approximated by the high-frequency asymptote found by letting s approach oo. Thus, at high frequencies 1 1 (10.23) G(jco) = = §Z - 90° = - Z - 90c _ co ->]0) « a or, in dB, 1
(10.24)
201ogM = 20log - - 20log - = -201ogw a a
Notice from the middle term that the high-frequency approximation equals the lowfrequency approximation when co = a, and decreases for co > a. This result is similar to Eq. (10.20), except the slope is negative rather than positive. The Bode logmagnitude diagram will decrease at a rate of 20 dB/decade rather than increase at a rate of 20 dB/decade after the break frequency. The phase plot is the negative of the previous example since the function is the inverse. The phase begins at 0° and reaches -90° at high frequencies, going through -45° at the break frequency. Both the Bode normalized and scaled log-magnitude and phase plot are shown in Figure 10.9(d).
Bode Plots for G(s)=s Our next function, G(s) = s, has only a high-frequency asymptote. Letting s = jco, the magnitude is 20 logo), which is the same as Eq. (10.20). Hence, the Bode magnitude plot is a straight line drawn with a +20 dB/decade slope passing through zero dB when co — \. The phase plot, which is a constant +90°, is shown with the magnitude plot in Figure 10.9(A).
Bode Plots for G(s) = 1/5 The frequency response of the inverse of the preceding function, G(s) = 1/s, is shown in Figure 10.9(b) and is a straight line with a - 2 0 dB/decade slope passing through zero dB at co = 1. The Bode phase plot is equal to a constant —90°. We have covered four functions that have first-order polynomials in s in the numerator or denominator. Before proceeding to second-order polynomials, let us 40 ^ 20 g> 0 5 -20 « -40
1 1 1 III •\
4—
••
J +1
0.1
§ 90 | 45 3 0 | -45 .G(s) 5 -90
IIII
1 10 Frequency (rad/s)
|v
1 ; | :, l i
|i'
\ i i mi 0.1
s
M S
8 1 III
0.01
0.01
'
,—-1
—--'
•—
IN
m lii i
Hi
I'll10
|!'i
||;i
1 Frequency (rad/s) (a)
100
i: .
100
1 lllllll 40 -6 db/octave = 20 —j~--.. ~- •-» - -20 dB/decade 0 20 -G(s)=: —"-40 — i [j| 100 0.01 0.1 1 10 Frequency (rad/s)
•H
Tffi
| 90 g» 45 3 0 5¾ - 4 5 | -90
am-
0.01
11
!|
0.1
III •j]1)1
'III
1
llll
1
III 1r
10 1 Frequency (rad/s)
m
llll :II l|l
llll 100
FIGURE 10.9 Normalized and scaled Bode plots for a. C(s) = s; b. G{s) = 1/s; (figure continues)
546
I
Chapter 10
1 MM!
40 20 0 -20 -40 0.01
1
1 I TTJj
nil ~rfj
• — - •
rr
III0.1
III1 Frequency a
90 45 0 -45 -90
i 11 nun
.
G(s) = (s + alii
r 0.01
-1 •I
Frequency Response Techniques
-
-
_I_LUIJ1 1 LI II 10 100
G ( J ) = T ^
(s+a>
T|j |j| 0.01
in0.1
(rad/s)
|i _ - — •
ijjl ill
-- -'
mm +45°/aecad B ||| [1
0.1
]i 10
Frequency a
40 20 0 -20 -40
(rad/s)
iil llll 100
90 45 0 -45 -90
llllllll
III |||
•« -
II
m
- -H4I
1
1 Frequency a
10
100
rraH/^
i
n ; jj
G(s) = T-^(s+a)
i [i
llll
--- -JJ 0.01
1 II
- 6 dB/octave =
•
|
1
fimi 111 ill 10
0.1
Frequency
100
(rnAk)
id)
FIGURE 10.9
(Continued)
c. G(s) = (s + a); d.G(s) = !/(* +a)
look at an example of drawing the Bode plots for a function that consists of the product of first-order polynomials in the numerator and denominator. The plots will be made by adding together the individual frequency response curves.
Example 10.2 Bode Plots for Ratio of First-Order Factors C(s) PROBLEM: Draw the Bode plots for the system shown in Figure 10.10, where G{s) = K(s + 3)/[s{s + l){s + 2)]. FIGURE 10.10 Closed-loop unity feedback system
SOLUTION: We will make a Bode plot for the open-loop function G{s) = K(s + 3)/[s{s + l)(s + 2)]. The Bode plot is the sum of the Bode plots for each first-order term. Thus, it is convenient to use the normalized plot for each of these terms so that the low-frequency asymptote of each term, except the pole at the origin, is at 0 dB, making it easier to add the components of the Bode plot. We rewrite G(s) showing each term normalized to a low-frequency gain of unity. Hence,
G(s) =
,(,+1)(1+1)
(10.25)
Now determine that the break frequencies are at 1, 2, and 3. The magnitude plot should begin a decade below the lowest break frequency and extend a decade above the highest break frequency. Hence, we choose 0.1 radian to 100 radians, or three decades, as the extent of our plot. At co = 0.1 the low-frequency value of the function is found from Eq. (10.25) using the low-frequency values for all of the {(s/a) + 1] terms, (that is, s = 0) and the actual value for the s term in the denominator. Thus, G(/0.1) « \ K/0.1 = 15 K. The effect of K is to move the magnitude curve up (increasing K) or down (decreasing K) by the amount of 20 log K. K has no effect upon the phase curve. If we choose K = 1, the magnitude plot can be denormalized later for any value of K that is calculated or known.
10.2 Asymptotic Approximations: Bode Plots 40
(H
3 2s
20
§ ° J? -20 S
20d B/dec (6 dB/oct)
1 {5+1)
o
-2C dB/dec (-6 dB/oc o3
-40
547
H
___
-60
0.1
100
10 Frequency (rad/s) (a)
40
-20 dB/dec (-6 dB/o =t)
20
* °
M, ^ ^ ^
S-2D
. _ _ - 40 dB/dec (- 12dB/oct)_
_
o N
-40
N|
FIGURE 1 0 . 1 1
-60
10
0.1
100
Frequency (rad/s) (b)
Figure 10.11(a) shows each component of the Bode log-magnitude frequency response. Summing the components yields the composite plot shown in Figure 10.11(6). The results are summarized in Table 10.2, which can be used to obtain the slopes. Each pole and zero is itemized in the first column. Reading across the table shows its contribution at each frequency. The last row is the sum of the slopes and correlates with Figure 10.11(6). The Bode magnitude plot for K = 1 starts at co = 0.1 with a value of 20 log 15 = 23.52 dB, and decreases immediately at a rate of -20 dB/decade, due to the 5 term in the denominator. At co = 1, the (^-(-1) term in the denominator begins its 20 dB/decade downward slope and causes an additional 20 dB/decade negative slope, or a total of —40 dB/decade. At co — 2, the term \{s/2) + 1] begins its -20 dB/decade slope, adding yet another -20 dB/decade to the resultant plot, or a total of -60 dB/decade slope that continues until co = 3. At this frequency, the [{s/3) +1] term in the numerator begins its positive TABLE 10.2 Bode magnitude plot: slope contribution from each pole and zero in Example 10.2 Frequency (rad/s) Description Pole at 0
0.1 (Start: Pole at 0)
1 (Start: Pole at - 1 )
2 (Start: Pole at - 2 )
3 (StartZero at - 3 )
-20
-20
-20
-20
Pole a t - 1
0
-20
-20
-20
Pole at - 2
(J
0
-20
-20
Zero at - 3
0
0
0
20
-20
-40
-60
-40
Total slope (dB/dec)
Bode log-magnitude plot for Example 10.2: a. components; b. composite
Chapter 10
548
Frequency Response Techniques
20 dB/decade slope. The resultant magnitude plot, therefore, changes from a slope of -60 dB/decade to -40 dB/decade at co = 3, and continues at that slope since there are no other break frequencies. The slopes are easily drawn by sketching straight-line segments decreasing by 20 dB over a decade. For example, the initial -20 dB/decade slope is drawn from 23.52dBata; = 0.1, to 3.52 dB (a 20 dB decrease) at m = 1. The-40 dB/decade slope starting at m = 1 is drawn by sketching a line segment from 3.52 dB at co = 1, to -36.48 dB (a 40 dB decrease) at co — 10, and using only the portion from co = 1 to 0) = 2. The next slope of —60 dB/decade is drawn by first sketching a line segment from <w = 2toa> = 20(l decade) that drops down by 60 dB, and using only that portion of the line from o) = 2 to co = 3. The final slope is drawn by sketching a line segment from w = 3 to o) = 30 (1 decade) that drops by 40 dB. This slope continues to the end of the plot. Phase is handled similarly. However, the existence of breaks a decade below and a decade above the break frequency requires a little more bookkeeping. Table 10.3 shows the starting and stopping frequencies of the 45°/decade slope for TABLE 10.3 Bode phase plot: slope contribution from each pole and zero in Example 10.2
Frequency (rad/s) Description
0.1 (Start: Pole at -1)
0.2 (Start: Pole at -2)
0.3 (Start: Pole at -3)
0 (End: Pole at -1)
20 (End: Pole at -2)
30 (End: Zero at —3)
-45
-45 -45
-45 -45 45 -45
0 -45 45 0
0 45 45
0 0
Pole at - 1 Pole at - 2 Zero at —3 Total slope (deg/dec)
-45
-90 90
(H
45 0
""""n
(H
1
-45
(5+1)
45°/
-457dec
-90 3 2.?
-135 -180
10
0.1
100
Frequency (rad/s)
(«) -90
\~7
-135
-457dec -180
r-7 *=
457de<^ ~—i
V
V
_c 07de c
-225
A57de -270 -315
FIGURE 10.12 Bode phase plot for Example 10.2: a. components; b. composite
-360
10
0.1 Frequency (rad/s) if>)
100
10.2 Asymptotic Approximations: Bode Plots each of the poles and zeros. For example, reading across for the pole at —2, we see that the -45° slope starts at a frequency of 0.2 and ends at 20. Filling in the rows for each pole and then summing the columns yields the slope portrait of the resulting phase plot. Looking at the row marked Total slope, we see that the phase plot will have a slope of —45°/decade from a frequency of 0.1 to 0.2. The slope will then increase to -90°/decade from 0.2 to 0.3. The slope will return to —45°/decade from 0.3 to 10 rad/s. A slope of 0 ensues from 10 to 20 rad/s, followed by a slope of +45°/decade from 20 to 30 rad/s. Finally, from 30 rad/s to infinity, the slope is 0°/decade. The resulting component and composite phase plots are shown in Figure 10.12. Since the pole at the origin yields a constant -90° phase shift, the plot begins at —90° and follows the slope portrait just described.
Bode Plots for G(s) = s2 + 2$a)ns + co2n Now that we have covered Bode plots for first-order systems, we turn to the Bode log-magnitude and phase plots for second-order polynomials in s. The second-order polynomial is of the form G(s) = s2 + 2l;a>ns + co2n = to2n(^ + 2 £ — + 1 ]
(10.26)
Unlike the first-order frequency response approximation, the difference between the asymptotic approximation and the actual frequency response can be great for some values of £. A correction to the Bode diagrams can be made to improve the accuracy. We first derive the asymptotic approximation and then show the difference between the asymptotic approximation and the actual frequency response curves. At low frequencies, Eq. (10.26) becomes G(s) w col = ulZ0°
(10.27)
The magnitude, M, in dB at low frequencies therefore is 20 log M = 20 log | G O ) | = 20 log co2n
(10.28)
G{s) « s2
(10.29)
G(jto) » -co2 = co2Z\80°
(10.30)
At high frequencies,
or
The log-magnitude is 20logM = 20log \G(ja>)\ = 20log co2 = 40logco
(10.31)
Equation (10.31) is a straight line with twice the slope of a first-order term (Eq. (10.20)). Its slope is 12 dB/octave, or 40 dB/decade.
550
Chapter 10
Frequency Response Techniques
120 Slope = 12 dB/octave = 40 dB/decade
80 40 0 -40
-120 0.01
0.1
1
10
100
10
100
0)/0),,
(a) 180 135 90 45 Slope = 90°/decade
0 FIGURE 10.13
-45
Bode asymptotes for normalized and scaled G(s) =s2+ 2t(ons + o?n: a. magnitude; b. phase
-90 0.01
0.1
1 0)/0)n
(b)
The low-frequency asymptote (Eq. (10.27)) and the high-frequency asymptote (Eq. (10.31)) are equal when co = con. Thus, con is the break frequency for the secondorder polynomial. For convenience in representing systems with different con, we normalize and scale our findings before drawing the asymptotes. Using the normalized and scaled term of Eq. (10.26), we normalize the magnitude, dividing by to2, and scale the frequency, dividing by to„. Thus, we plot G(s{)/co2n=s\+2t;si+\, where S] — s/a)n. G(s\) has a low-frequency asymptote at 0 dB and a break frequency of 1 rad/s. Figure 10.13(a) shows the asymptotes for the normalized and scaled magnitude plot. We now draw the phase plot. It is 0° at low frequencies (Eq. (10.27)) and 180° at high frequencies (Eq. (10.30)). To find the phase at the natural frequency, first evaluate G(Jco): 2 2 G{jco) = s2 + 2^tons +COn \$—>ja> = {co , - co ) + j2;conco
(10.32)
Then find the function value at the natural frequency by substituting co = con. Since the result is |2|to|, the phase at the natural frequency is +90°. Figure 10.13(5) shows the phase plotted with frequency scaled by con. The phase plot increases at a rate of 90°/decade from 0.1 to 10 and passes through 90° at 1.
Corrections to Second-Order Bode Plots Let us now examine the error between the actual response and the asymptotic approximation of the second-order polynomial. Whereas the first-order polynomial has a disparity of no more than 3.01 dB magnitude and 5.71° phase, the second-order function may have a greater disparity, which depends upon the value of f.
10.2 Asymptotic Approximations: Bode Plots
551
From Eq. (10.32), the actual magnitude and phase for G(s) = s2 + 2t;a>ns + a?n are, respectively, M^sjicol-CDlf
+
(10.33)
WcOnCof
Phase = tan ' ~4——T» coln - col
(10.34)
These relationships are tabulated in Table 10.4 for a range of values of £ and plotted in Figures 10.14 and 10.15 along with the asymptotic approximations for normalized
TABLE 10.4 Data for normalized and scaled log-magnitude and phase plots for (s2 + 2£cons + to2). Mag = 20 Iog(M/ft>2,] Freq.
Phase (deg) ¢ = 0.1
Mag (dB) ¢ = 0.2
Phase (deg) ¢ = 0.2
Mag (dB) ¢ = 0.3
Phase (deg) ¢ = 0.3
co„
Mag (dB) ¢ = 0.1
0.10
-0.09
1.16
-0.08
2.31
-0.07
0.20
-0.35
2.39
-0.29
7.13
-0.80
3.77
-0.32 -0.74
4.76
0.30
7.51
-0.65
11.19
0.40
-1.48
5.44
-1.36
10.78
-1.17
15.95
0.50
-2.42
7.59
-2.20
14.93
-1.85
21.80
0.60
-3.73
10.62
-3.30
20.56
-2.68
29.36
0.70
-5.53
15.35
-4.70
28.77
-3.60
39.47
0.80
-8.09
23.96
-6.35
41.63
-4.44
53.13
0.90
-11.64
43.45
-7.81
62.18
-4.85
70.62
CO
3.47
1.00
-13.98
90.00
-7.96
90.00
-4.44
90.00
1.10
-10.34
133.67
-6.24
115.51
-3.19
107.65
1.20
-6.00
151.39
-3.73
132.51
-1.48
121.43
1.30
-2.65
159.35
-1.27
143.00
0.35
131.50
1.40
0.00
163.74
0.92
149.74
2.11
138.81
1.50
2.18
166.50
2.84
154.36
3.75
144.25
1.60
4.04
168.41
4.54
157.69
5.26
148.39
1.70
5.67
169.80
6.06
160.21
6.64
151.65
1.80
7.12
170.87
7.43
162.18
154.26
1.90
8.42
171.72
8.69
163.77
7.91 9.09
156.41
2.00
9.62
172.41
9.84
165.07
10.19
158.20
3.00
18.09
175.71
18.16
171.47
18.28
167.32
4.00
23.53
176.95
23.57
173.91
23.63
170.91
5.00
27.61
177.61
27.63
175.24
27.67
172.87
6.00
30.89
178.04
30.90
176.08
30.93
174.13
7.00
33.63
178.33
33.64
176.66
33.66
175.00
8.00
35.99
178.55
36.00
177.09
175.64
9.00
38.06
178.71
38.07
177.42
36.01 38.08
10.00
39.91
178.84
39.92
177.69
39.93
176.14 176.53 (table continues)
552
Chapter 10
Frequency Response Techniques
TABLE 10.4 Data for normalized and scaled log-magnitude and phase plots for (s2 + 2t;cons + afy. Mag = 20 log(M/a>l) (Continued) Freq. CO
Mag (dB) ¢ = 0.5
Phase (deg) ¢ = 0.5
Mag (dB) ¢ = 0.7
Phase (deg) ¢ = 0.7
Mag (dB) ¢ = 0.1
Phase (deg) ¢ = 01
0.10
-0.04
5.77
0.00
8.05
0.09
11.42
0.20
-0.17
11.77
0.00
16.26
0.34
22.62
0.30
-0.37
18.25
0.02
24.78
0.75
33.40
0.40
-0.63
25.46
0.08
33.69
1.29
43.60
0.50
-0.90
33.69
0.22
43.03
1.94
53.13
0.60
-1.14
43.15
0.47
52.70
2.67
61.93
0.70
-1.25
53.92
0.87
62.51
3.46
69.98
0.80
-1.14
65.77
1.41
72.18
4.30
77.32
0.90
-0.73
78.08
2.11
81.42
5.15
83.97
1.00
0.00
90.00
2.92
90.00
6.02
90.00
1.10
0.98
100.81
3.83
97.77
6.89
95.45
1.20
2.13
110.14
4.79
104.68
7.75
100.39
1.30
3.36
117.96
5.78
110.76
8.60
104.86
1.40
4.60
124.44
6.78
116.10
9.43
108.92
1.50
5.81
129.81
7.76
120.76
10.24
112.62
1.60
6.98
134.27
8.72
124.85
11.03
115.99
1.70
8.10
138.03
9.66
128.45
11.80
119.07
1.80
9.17
141.22
10.56
131.63
12.55
121.89
1.90
10.18
143.95
11.43
134.46
13.27
124.48
2.00
11.14
146.31
12.26
136.97
13.98
126.87
3.00
18.63
159.44
19.12
152.30
20.00
143.13
4.00
23.82
165.07
24.09
159.53
24.61
151.93
5.00
27.79
168.23
27.96
163.74
28.30
157.38
6.00
31.01
170.27
31.12
166.50
31.36
161.08
7.00
33.72
171.70
33.80
168.46
33.98
163.74
8.00
36.06
172.76
36.12
169.92
36.26
165.75
9.00
38.12
173.58
38.17
171.05
38.28
167.32
10.00
39.96
174.23
40.00
171.95
40.09
168.58
magnitude and scaled frequency. In Figure 10.14, which is normalized to the square of the naturai frequency, the normalized log-magnitude at the scaled natural frequency is +20 log 2£. The student should verify that the actual magnitude at the unsealed natural frequency is +20 log 2^co2n. Table 10.4 and Figures 10.14 and 10.15 can be used to improve accuracy when drawing Bode plots. For example, a magnitude correction of +20 log 2¢ can be made at the natural, or break, frequency on the Bode asymptotic plot.
Bode Plots for G(s) = 1/(s 2 + 2^con5 + o>2n) Bode plots for G(s) = l/(s2 + 2$tons+ to2n) can be derived similarly to those for G(s) = s2 + 2;a)ns -\-co2n. We find that the magnitude curve breaks at the natural frequency and decreases at a rate of -40 dB/decade. The phase plot is 0° at low
10.2 Asymptotic Approximations: Bode Plots
FIGURE 10.14
Normalized and scaled log-magnitude response for (s2 + 2£a)ns + co2)
g> 100
FIGURE 10.15
Scaled phase response for (s2 + 2t;tons + orn
frequencies. At Q.lco,, it begins a decrease of —90°/decade and continues until co = lOoto, where it levels off at -180°. The exact frequency response also follows the same derivation as that of G(s) = s2 + 2i;cons + co\. The results are summarized in Table 10.5, as well as Figures 10.16 and 10.17. The exact magnitude is the reciprocal of Eq. (10.33), and the exact phase is the negative of Eq. (10.34). The normalized magnitude at the scaled natural frequency is -20 log 2^, which can be used as a correction at the break frequency on the Bode asymptotic plot.
553
554
Chapter 10
Frequency Response Techniques
TABLE 10.5 Data for normalized and scaled log-magnitude and phase plots for 1/(52 + 2t;cons + a>2n). Mag = 20 \og(M/a>l)
Freq. CO
co„
Mag (dB) £ = 0.1
Phase (deg) £ = 0.1
Mag (dB) £ = 0.2
Phase (deg) £ = 0.2
Mag (dB) £ = 0.3
Phase (deg) £ = 0.3
0.10
0.09
-1.16
0.08
-2.31
0.07
0.20
0.35
-2.39
0.32
-4.76
0.29
-7.13
0.30
0.80
-3.77
0.74
-7.51
0.65
-11.19
0.40
1.48
-5.44
1.36
-10.78
1.17
-15.95
0.50
2.42
-7.59
2.20
-14.93
1.85
-21.80
0.60
3.73
-10.62
3.30
-20.56
2.68
-29.36
0.70
5.53
-15.35
4.70
-28.77
3.60
-39.47
-3.47
0.80
8.09
-23.96
6.35
-41.63
4.44
-53.13
0.90
11.64
-43.45
7.81
-62.18
4.85
-70.62
1.00
13.98
-90.00
7.96
-90.00
4.44
-90.00
1.10
10.34
-133.67
6.24
-115.51
3.19
-107.65
1.20
6.00
-151.39
3.73
-132.51
1.48
-121.43
1.30
2.65
-159.35
1.27
-143.00
-0.35
-131.50
0.00
-163.74
-0.92
-149.74
-2.11
-138.81
1.50
-2.18
-166.50
-2.84
-154.36
-3.75
-144.25
1.60
-4.04
-168.41
-4.54
-157.69
-5.26
-148.39
1.70
-5.67
-169.80
-6.06
-160.21
-6.64
-151.65
1.80
-7.12
-170.87
-7.43
-162.18
-7.91
-154.26
1.90
-8.42
-171.72
-8.69
-163.77
-9.09
-156.41
2.00
-9.62
-172.41
-9.84
-165.07
-10.19
-158.20
3.00
-18.09
-175.71
-18.16
-171.47
-18.28
-167.32
-173.91
-23.63
-170.91
1.40
4.00
-23.53
-176.95
-23.57
5.00
-27.61
-177.61
-27.63
-175.24
-27.67
-172.87
-176.08
-30.93
-174.13
6.00
-30.89
-178.04
-30.90
7.00
-33.63
-178.33
-33.64
-176.66
-33.66
-175.00
8.00
-35.99
-178.55
-36.00
-177.09
-36.01
-175.64
9.00
-38.06
-178.71
-38.07
-177.42
-38.08
-176.14
10.00
-39.91
-178.84
-39.92
-177.69
-39.93
-176.53 (table continues)
10.2 Asymptotic Approximations: Bode Plots
555
TABLE 10.5 Data for normalized and scaled log-magnitude and phase plots for l/(s2 + 2$co„s + es?). Mag = 20 \og(M/a)2n) {Continued) Freq. 0)„
Mag (dB) £ = 0.5
Phase (deg) £ = 0.5
Mag (dB) £ = 0.7
Phase (deg) £ = 0.7
Mag (dB) £ = 0.1
Phase (dej £ = 0.1
0.10
0.04
-5.77
0.00
-8.05
-0.09
-11.42
0.20
0.17
-11.77
0.00
-16.26
-0.34
-22.62
0.30
0.37
-18.25
-0.02
-24.78
-0.75
-33.40
0.40
0.63
-25.46
-0.08
-33.69
-1.29
-43.60
0.50
0.90
-33.69
-0.22
-43.03
-1.94
-53.13
0.60
1.14
-43.15
-0.47
-52.70
-61.93
0.70
1.25
-53.92
-0.87
-62.51
-2.67 -3.46
0.80
1.14
-65.77
-1.41
-72.18
-4.30
-77.32
0.90
0.73
-78.08
-2.11
-81.42
-5.15
-83.97
1.00
0.00
-90.00
-2.92
-90.00
-6.02
-90.00
1.10
-0.98
-100.81
-3.93
-97.77
-6.89
-95.45
1.20
-69.98
-2.13
-110.14
-4.79
-104.68
-7.75
-100.39
1.30
-3.36
-117.96
-5.78
-110.76
-8.60
-104.86
1.40
-4.60
-124.44
-6.78
-116.10
-9.43
-108.92
1.50
-5.81
-129.81
-7.76
-120.76
-10.24
-112.62
1.60
-6.98
-134.27
-8.72
-124.85
-11.03
-115.99
1.70
-8.10
-138.03
-9.66
-128.45
-11.80
-119.07
1.80
-9.17
-141.22
-10.56
-131.63
-12.55
-121.89
1.90
-10.18
-143.95
-11.43
-134.46
-13.27
-124.48
2.00
-11.14
-146.31
-12.26
-136.97
-13.98
-126.87
3.00
-18.63
-159.44
-19.12
-152.30
-20.00
-143.13
4.00
-23.82
-165.07
-24.09
-159.53
-24.61
-151.93
5.00
-27.79
-168.23
-27.96
-163.74
-28.30
-157.38
6.00
-31.01
-170.27
-31.12
-166.50
-31.36
-161.08
7.00
-33.72
-171.70
-33.80
-168.46
-33.98
-163.74
8.00
-36.06
-172.76
-36.12
-169.92
-36.26
-165.75
9.00
-38.12
-173.58
-38.17
-171.05
-38.28
-167.32
10.00
-39.96
-174.23
-40.00
-171.95
-40.09
-168.58
556
Chapter 10
Frequency Response Techniques
20
1
1
Low-frequency asymptote
1
10
/
^T^-0.3
/ -10
^ \
s
\ \
8 - 20
\
-30 -40
H gh-frequency asymptote
\
v\^°j Wo.7 \\i
k^
\1
-50 0.1
1 cola,,
10
FIGURE 10.16 Normalized and scaled log-magnitude response for l/{s2 + 2$co„s + a%)
-20
I _ -100 -120 -140
FIGURE 10.17 Scaled phase response for 1/(52 + 2%®n$ + aft Let us now look at an example of drawing Bode plots for transfer functions that contain second-order factors.
Example 10.3 Bode Plots for Ratio of First- and Second-Order Factors PROBLEM: Draw the Bode log-magnitude and phase plots of G(s) for the unity feedback system shown in Figure 10.10, where G(s) = (s + 3)/[(s + 2)(52 + Is + 25)].
10.2 Asymptotic Approximations: Bode Plots 10
20 dB/dec 1 M
557
'»•0
IS- i\ ^-40 dB/deci i ^
-10
(f*l) \
-20
% \ 1
-30
50
-40 -50 0.01
25
25
10
0.1
V «
\
^-
100
Frequency (rad/s) (a) -10 -20 -30
0 dB/dec /
: >
Correctior s
-40
^v \
-50 —i
10 dB/dec
FIGURE 10.18
-60 -70 0.01
0.1
100
1 Frequency (rad/s)
(*) SOLUTION: We first convert G(s) to show the normalized components that have unity low-frequency gain. The second-order term is normalized by factoring out GJ|, forming 2
K
cot
Thus,
,
H
h>
<m= (2)(25)
(10.35)
0)„
(10.36) 50/^ ,fs 2 (2 + 1 ) 25 + 2T + 1 The Bode log-magnitude diagram is shown in Figure 10.18(£>) and is the sum of the individual first- and second-order terms of G(s) shown in Figure 10.18(A). We solve this problem by adding the slopes of these component parts, beginning and ending at the appropriate frequencies. The results are summarized in Table 10.6, which can be used to obtain the slopes. The low-frequency value for G(s), found by 2
(1+
1
s
2
2
,
TABLE 10.6 Magnitude diagram slopes for Example 10.3 Frequency (rad/s)
Description
0.01 (Start: Plot)
2 (Start: Pole at - 2 )
3 (Start: Zero at - 3 )
(on = 5)
Pole at - 2
0
-20
-20
-20
5 (Start:
Zero at —3
0
0
20
20
con = 5
0
0
0
-40
Total slope (dB/dec)
0
-20
0
-40
Bode magnitude plot for G(s) = (s + 3)/ [{s + 2)(52 +25 + 25)]: a. components; b. composite
558
Chapter 10
Frequency Response Techniques
letting 5 = 0, is 3/50, or -24.44 dB. The Bode magnitude plot starts out at this value and continues until the first break frequency at 2 rad/s. Here the pole at - 2 yields a - 2 0 dB/decade slope downward until the next break at 3 rad/s. The zero at - 3 causes an upward slope of +20 dB/decade, which, when added to the previous —20 dB/decade curve, gives a net slope of 0. At a frequency of 5 rad/s, the second-order term initiates a - 4 0 dB/decade downward slope, which continues to infinity. The correction to the log-magnitude curve due to the underdamped secondorder term can be found by plotting a point - 2 0 log 2£ above the asymptotes at the natural frequency. Since £ = 0.2 for the second-order term in the denominator of G(s), the correction is 7.96 dB. Points close to the natural frequency can be corrected by taking the values from the curves of Figure 10.16. TABLE 10.7 Phase diagram slopes for Example 10.3 Frequency (rad/s)
Description
0.2 (Start: Pole at - 2)
0.3 (Start: Zero at - 3)
0.5 (Start: (o„ at —5)
Pole at - 2
-45
-45
-45
0
45
45
45
0
-90
-90
-90
0
-90
-45
-90
0
Zero at - 3 co„ = 5
Total slope (dB/dec)
-45
0 90
30 (End: Zero at - 3 )
20 (End: Pole at - 2)
(H
45
457dec
50 1
0 45°/
-45 Xi
•(* *. ?
.SLI'J
-90°/dec
-90
i
J -135
fi
-180 -225 0 01
50 (End: (o„ = 5 )
2;
23
|| 10
0.1
100
Frequency (rad/s) («) 0
-45° dec
-45
f
-90
-90' /de c
1
1y~
|-135
I -180
-90°/dec S
ll
-457d ec
-225
FIGURE 10.19 Bode phase plot for G(s) = (5 + 3)/ [(i + 2)(s 2 + 25+ 25)]: a. components; b. composite
-270
-315 0.01
0.1
1 Frequency (rad/s) (b)
10
100
10.3
Introduction to the Nyquist Criterion
559
We now turn to the phase plot. Table 10.7 is formed to determine the progression of slopes on the phase diagram. The first-order pole at - 2 yields a phase angle that starts at 0° and ends at -90° via a -45°/decade slope starting a decade below its break frequency and ending a decade above its break frequency. The first-order zero yields a phase angle that starts at 0° and ends at +90° via a +45°/decade slope starting a decade below its break frequency and ending a decade above its break frequency. The second-order poles yield a phase angle that starts at 0° and ends at -180° via a —90°/decade slope starting a decade below their natural frequency (con = 5) and ending a decade above their natural frequency. The slopes, shown in Figure 10.19(a), are summed over each frequency range, and the final Bode phase plot is shown in Figure 10.19(6). Students who are using MATLAB should now run chlOpl in Appendix B. You will learn how to use MATLAB to make Bode plots and list the pointsontheplots.ThisexercisesolvesExamplelO.3usingMATLAB.
MATLAB
Skill-Assessment Exercise 10.2 PROBLEM: Draw the Bode log-magnitude and phase plots for the system shown in Figure 10.10, where WileyPLUS
G(S) U
{s+20) (, + 1)(, + 7)(, + 50)
cm coZSons
ANSWER: The complete solution is at www.wiley.com/college/nise.
Trylt 10.1 Use MATLAB, the Control System Toolbox, and the following statements to obtain the Bode plots for the system of Skill-Assessment Exercise 10.2 G=zpk ( [ - 2 0 ] , [ - 1 , - 7 , . . . - 5 0 ] , 1) b o d e ( G ) ; g r i d on After the Bode plots appear, click on the curve and drag to read the coordinates.
In this section, we learned how to construct Bode log-magnitude and Bode phase plots. The Bode plots are separate magnitude and phase frequency response curves for a system, G(s). In the next section, we develop the Nyquist criterion for stability, which makes use of the frequency response of a system. The Bode plots can then be used to determine the stability of a system.
I
10.3 Introduction to the Nyquist Criterion
The Nyquist criterion relates the stability of a closed-loop system to the open-loop frequency response and open-loop pole location. Thus, knowledge of the openloop system's frequency response yields information about the stability of the closed-loop system. This concept is similar to the root locus, where we began with information about the open-loop system, its poles and zeros, and developed transient and stability information about the closed-loop system.
Chapter 10
Frequency Response Techniques
Although the Nyquist criterion will yield stability information at first, we will extend the concept to transient response and steady-state errors. Thus, frequency response techniques are an alternate approach to the root locus.
Derivation of the Nyquist Criterion Consider the system of Figure 10.20. The Nyquist criterion can tell us how many closedloop poles are in the right half-plane. Before deriving the criterion, let us establish four important concepts that will be used during the derivation: (1) the relationship between the poles of 1 + G{s)H(s) and the poles of G(s)H(s); (2) the relationship between the zeros of 1 + G(s)H(s) and the poles of the closed-loop transfer function, T(s); (3) the concept of mapping points; and (4) the concept of mapping contours. Letting „
G{s) = 7^
(10.37a)
H(s) =
(10.37b) DH
w e find G(s)H(s) = 1 + G{s)H{s) = 1 + T{s) =
NGNH DGD H
NGNH DGDH
G(s) l + G{s)H(s)
(10.38a)
DGDH
+ N G NH DGDH
NG D H DGDH + NGNH
(10.38b) (10.38c)
From Eqs. (10.38), we conclude that (1) the poles of I + G(s)H(s) are the same as the poles of G(s)H{s), the open-loop system, and (2) the zeros ofl + G(s)H{s)are the same as the poles of T{s), the closed-loop system. Next, let us define the term mapping. If we take a complex number on the s-plane and substitute it into a function, F(s), another complex number results. This process is called mapping. For example, substituting s — 4 +j3 into the function (s2 + 2s +1) yieldsl6 +;30. We say that 4 + /3 maps into 16 + /30 through thefunction (s2 + 2s + 1). Finally, we discuss the concept of mapping contours. Consider the collection of points, called a contour, shown in Figure 10.21 as contour A. Also, assume that F(s) =
(s - Z]){s - Z2) • • • (s -Pi)(s
-p2)
(10.39)
•• •
Contour A can be mapped through F(s) into contour B by substituting each point of contour A into the function F(s) and plotting the resulting complex numbers. For example, point Q in Figure 10.21 maps into point Q through the function F(s). jco 5-plane A
0
Contour A
F(s)
FIGURE 10.21
Mapping contour A through function F(s) to contour B
10.3
Introduction to the Nyquist Criterion
Contour A
561
Contour B
i-plane a —+~F(s) = (s-z{)
*-Re
R=V
-Re
R=~
Contour A f-plane
.s-plane a -+• F{s) =
]
o
is-px)
Contour A
F-plane
i-plane <J —*~ F(s) = (s - z\)
Contour A
v
\R
Contour B
Contour B •-Re
R=V
Contour B
s-plane F(s) =
Contour A s-plane
F(s) =
FIGURE 10.22 Examples of contour mapping The vector approach to performing the calculation, covered in Section 8.1, can be used as an alternative. Some examples of contour mapping are shown in Figure 10.22 for some simple F(s). The mapping of each point is defined by complex arithmetic, where the resulting complex number, R, is evaluated from the complex numbers represented by V, as shown in the last column of Figure 10.22. You should verify that if we assume a clockwise direction for mapping the points on contour A, then contour B maps in a clockwise direction if F(s) in Figure 10.22 has just zeros or has just poles that are not encircled by the contour. The contour B maps in a counterclockwise direction if F(s) has just poles that are encircled by the contour. Also, you should verify that if the pole or zero of F(s) is enclosed by contour A, the
Chapter 10
562
5-plane
Frequency Response Techniques
I + G//-plane
F(s) = l + G(s)H(s) FIGURE 10.23 Vector representation of mapping
FIGURE 10.24
Contour
enclosing right half-plane to determine stability
Contour A
Contour B
mapping encircles the origin. In the last case of Figure 10.22, the pole and zero rotation cancel, and the mapping does not encircle the origin. Let us now begin the derivation of the Nyquist criterion for stability. We show that a unique relationship exists between the number of poles of F(s) contained inside contour A, the number of zeros of F(s) contained inside contour A, and the number of counterclockwise encirclements of the origin for the mapping of contour B. We then show how this interrelationship can be used to determine the stability of closed-loop systems. This method of determining stability is called the Nyquist criterion. Let us first assume that F(s) = 1 + G(s)H(s), with the picture of the poles and zeros of 1 + G(s)H(s) as shown in Figure 10.23 near contour A. Hence, R = ^ 1 ^ 2 ) / ( ^ 3 ^ 4 ^ 5 ) . As each point Q of the contour A is substituted into 1 + G(s)H(s), a mapped point results on contour B. Assuming that F{s) = 1 + G(s)H(s) has two zeros and three poles, each parenthetical term of Eq. (10.39) is a vector in Figure 10.23. As we move around contour A in a clockwise direction, each vector of Eq. (10.39) that lies inside contour A will appear to undergo a complete rotation, or a change in angle of 360°. On the other hand, each vector drawn from the poles and zeros of 1 + G(s)H(s) that exist outside contour A will appear to oscillate and return to its previous position, undergoing a net angular change of 0°. Each pole or zero factor of 1 + G(s)H(s) whose vector undergoes a complete rotation around contour A must yield a change of 360° in the resultant, R, or a complete rotation of the mapping of contour B. If we move in a clockwise direction along contour A, each zero inside contour A yields a rotation in the clockwise direction, while each pole inside contour A yields a rotation in the counterclockwise direction since poles are in the denominator of Eq. (10.39). Thus, N = P - Z, where N equals the number of counterclockwise rotations of contour B about the origin; P equals the number of poles of 1 + G(s)H(s) inside contour A, and Z equals the number of zeros of 1 + G(s)H(s) inside contour A. Since the poles shown in Figure 10.23 are poles of 1 + G(s)H(s), we know from Eqs. (10.38) that they are also the poles of G(s)H(s) and are known. But since the zeros shown in Figure 10.23 are the zeros of 1 + G(s)H(s), we know from Eqs. (10.38) that they are also the poles of the closed-loop system and are not known. Thus, P equals the number of enclosed open-loop poles, and Z equals the number of enclosed closedloop poles. Hence, N = P - Z,or alternately, Z = P - N, tells us that the number of closed-loop poles inside the contour (which is the same as the zeros inside the contour) equals the number of open-loop poles of G(s)H(s) inside the contour minus the number of counterclockwise rotations of the mapping about the origin. If we extend the contour to include the entire right half-plane, as shown in Figure 10.24, we can count the number of right-half-plane, closed-loop poles inside contour A and determine a system's stability. Since we can count the number of openloop poles, P, inside the contour, which are the same as the right-half-plane poles of G(s)H(s), the only problem remaining is how to obtain the mapping and find N.
10.3
Introduction to the Nyquist Criterion
563
Since all of the poles and zeros of G(s)H(s) are known, what if we map through G(s)H(s) instead of 1 + G(s)H(s)? The resulting contour is the same as a mapping through 1 + G(s)H(s), except that it is translated one unit to the left; thus, we count rotations about - 1 instead of rotations about the origin. Hence, the final statement of the Nyquist stability criterion is as follows: If a contour, A, that encircles the entire right half-plane is mapped through G(s)H(s), then the number of closed-loop poles, Z, in the right half-plane equals the number of open-loop poles, P, that are in the right half-plane minus the number of counterclockwise revolutions, N, around - 1 of the mapping; that is, Z = P — N. The mapping is called the Nyquist diagram, or Nyquist plot, of G(s)H(s). We can now see why this method is classified as a frequency response technique. Around contour A in Figure 10.24, the mapping of the points on they'w-axis through the function G(s)H(s) is the same as substituting 5 = jco into G(s)H(s) to form the frequency response function G(Jco)H(jco). We are thus finding the frequency response of G(s)H(s) over that part of contour A on the positive/w-axis. In other words, part of the Nyquist diagram is the polar plot of the frequency response of G(s)H(s).
Applying the Nyquist Criterion to Determine Stability Before describing how to sketch a Nyquist diagram, let us look at some typical examples that use the Nyquist criterion to determine the stability of a system. These examples give us a perspective prior to engaging in the details of mapping. Figure 10.25(a) shows a contour A that does not enclose closed-loop poles, that is, the zeros of 1 + G(s)H(s). The contour thus maps through G(s)H(s) into a Nyquist diagram that does not encircle - 1 . Hence, P = 0, N = 0, and Z = P - N = 0. Since Z is the number of closed-loop poles inside contour A, which encircles the right half-plane, this system has no right-half-plane poles and is stable. On the other hand, Figure 10.25(b) shows a contour A that, while it does not enclose open-loop poles, does generate two clockwise encirclements of —1. Thus, P = 0, N — - 2 , and the system is unstable; it has two closed-loop poles in the right half-plane since Z = P — N = 2. The two closed-loop poles are shown inside contour J CO
Im
I
v.
s-plane
o
)
o
^y
GH-plane
- O- -»- G(s)H(s)
•*- Re
-1
/
GH-plme
Test radius
o- -*- G(s)H(s)
*- Re
(b) O = zeros of 1 + G(s)H(s) = poles of closed-loop system Location not known
X = poles of 1 + G(s)H(s) = poles of G{s)H(s) Location is known
FIGURE 1 0 . 2 5 M a p p i n g examples: a. C o n t o u r does not enclose closed-loop poles;
b. contour does enclose closedloop poles
Chapter 10
564
Frequency Response Techniques
A in Figure 10.25(b) as zeros of 1 + G(s)H(s). You should keep in mind that the existence of these poles is not known a priori. In this example, notice that clockwise encirclements imply a negative value for N. The number of encirclements can be determined by drawing a test radius from —1 in any convenient direction and counting the number of times the Nyquist diagram crosses the test radius. Counterclockwise crossings are positive, and clockwise crossings are negative. For example, in Figure 10.25(6), contour B crosses the test radius twice in a clockwise direction. Hence, there are - 2 encirclements of the point —1. Before applying the Nyquist criterion to other examples in order to determine a system's stability, we must first gain experience in sketching Nyquist diagrams. The next section covers the development of this skill.
(
10.4 Sketching the Nyquist Diagram The contour that encloses the right half-plane can be mapped through the function G(s)H(s) by substituting points along the contour into G(s)H(s). The points along the positive extension of the imaginary axis yield the polar frequency response of G(s)H(s). Approximations can be made to G(s)H(s) for points around the infinite semicircle by assuming that the vectors originate at the origin. Thus, their length is infinite, and their angles are easily evaluated. However, most of the time a simple sketch of the Nyquist diagram is all that is needed. A sketch can be obtained rapidly by looking at the vectors of G(s)H(s) and their motion along the contour. In the examples that follow, we stress this rapid method for sketching the Nyquist diagram. However, the examples also include analytical expressions for G(s)H(s) for each section of the contour to aid you in determining the shape of the Nyquist diagram.
Example 10.4 J | Sketching a Nyquist Diagram PROBLEM: Speed controls find wide application throughout industry and the home. Figure 10.26(A) shows one application: output frequency control of electrical
H)
\J. (]
Generator
^™r
Sensor
1 Frequency or speed measurements
Valve actu ator
Controller Desired speed or frequency (a)
„
FIGURE 10.26
a. Turbine and generator; b. block diagram of speed control system for Example 10.4
Amplifier, valve actuator, and steam valve ,.
,
speed + ^ E<s>
?\
*Q9
.
100 (s+10)
Generator
Turbine
pressure
1 (s + 3)
m
Torque
5 0+1)
speeil
10.4 Sketching the Nyquist Diagram
565
power from a turbine and generator pair. By regulating the speed, the control system ensures that the generated frequency remains within tolerance. Deviations from the desired speed are sensed, and a steam valve is changed to compensate for the speed error. The system block diagram is shown in Figure 10.26(6). Sketch the Nyquist diagram for the system of Figure 10.26. SOLUTION: Conceptually, the Nyquist diagram is plotted by substituting the points of the contour shown in Figure 10.27(a) into G(s) = 500/[(s + l){s + 3)(A- + 10)]. This process is equivalent to performing complex arithmetic using the vectors of G(s) drawn to the points of the contour as shown in Figure 10.27(a) and (6). Each pole and zero term of G(s) shown in Figure 10.26(6) is a vector in Figure 10.27(a) and (b). The resultant vector, R, found at any point along the contour is in general the product of the zero vectors divided by the product of the pole vectors (see Figure 10.27(c)). Thus, the magnitude of the resultant is the product of the zero lengths divided by the product of the pole lengths, and the angle of the resultant is the sum of the zero angles minus the sum of the pole angles. As we move in a clockwise direction around the contour from point A to point C in Figure 10.27(a), the resultant angle goes from 0° to - 3 x 90° = -270°, or from A' to C in Figure 10.27(c). Since the angles emanate from poles in the denominator of G(s), the rotation or increase in angle is really a decrease in angle
jco s-plane
s-plane
V V\ -10
Vy -3
r
A
-i
D^y
m
(O
FIGURE 10.27 Vector evaluation of the Nyquist diagram for Example 10.4: a. vectors on contour at low frequency; b. vectors on contour around infinity; c. Nyquist diagram
Chapter 10
Frequency Response Techniques
of the function G(s); the poles gain 270° in a counterclockwise direction, which explains why the function loses 270°. While the resultant moves from A' to C' in Figure 10.27(c), its magnitude changes as the product of the zero lengths divided by the product of the pole lengths. Thus, the resultant goes from a finite value at zero frequency (at point A of Figure 10.27(A), there are three finite pole lengths) to zero magnitude at infinite frequency at point C (at point C of Figure 10.27(A), there are three infinite pole lengths). The mapping from point A to point C can also be explained analytically. From A to C the collection of points along the contour is imaginary. Hence, from A to C, G{s) = G(jco), or from Figure 10.26(b), re
\
Gijco) =
50
° (s + 1){S + 3)(5 + 10)
=
(-140,2+ 30)+y(43a,-aP)
(10 40)
-
Multiplying the numerator and denominator by the complex conjugate of the denominator, we obtain =
^ ( - 1 4 ^ + 30)-7(430,-^) (-14o,2 + 30)2 + (43o,-o, 3 ) 2
At zero frequency, Gijco) = 500/30 = 50/3. Thus, the Nyquist diagram starts at 50/3 at an angle of 0°. As co increases the real part remains positive, and the imaginary part remains negative. At co = -y/30/14, the real part becomes negative. At co = -\A3, the Nyquist diagram crosses the negative real axis since the imaginary term goes to zero. The real value at the axis crossing, point Q in Figure 10.27(c), found by substituting into Eq. (10.41), is -0.874. Continuing toward co = oo, the real part is negative, and the imaginary part is positive. At infinite frequency Gijco) 5¾ 500//a,3, or approximately zero at 90°. Around the infinite semicircle from point C to point D shown in Figure 10.27(5), the vectors rotate clockwise, each by 180°. Hence, the resultant undergoes a counterclockwise rotation of 3 x 180°, starting at point C and ending at point D' of Figure 10.27(c). Analytically, we can see this by assuming that around the infinite semicircle, the vectors originate approximately at the origin and have infinite length. For any point on the s-plane, the value of G(s) can be found by representing each complex number in polar form, as follows: G
^
=
(^-^^-0(^-3^-0(^-10^- 1 0 )
(1
°'42)
where 2?_, is the magnitude of the complex number (^ + 1), and 9--, is the angle of the complex number (s + i). Around the infinite semicircle, all R-t are infinite, and we can use our assumption to approximate the angles as if the vectors originated at the origin. Thus, around the infinite semicircle,
°W= 0^(9-, f?-, + a-ro) = 0 ^ - ( g - + ^ + ^
(1 43)
°-
At point C in Figure 10.27(6), the angles are all 90°. Hence, the resultant is 0Z - 270°, shown as point C in Figure 10.27(c). Similarly, at point D, G{s) = 0Z + 270° and maps into point D'. You can select intermediate points to verify the spiral whose radius vector approaches zero at the origin, as shown in Figure 10.27(c). The negative imaginary axis can be mapped by realizing that the real part of G(jco)H(jco) is always an even function, whereas the imaginary part of G(ja))H(jco) is an odd function. That is, the real part will not change sign when negative values of
10.4 Sketching the Nyquist Diagram
567
co are used, whereas the imaginary part will change sign. Thus, the mapping of the negative imaginary axis is a mirror image of the mapping of the positive imaginary axis. The mapping of the section of the contour from points D to A is drawn as a mirror image about the real axis of the mapping of points A to C. In the previous example, there were no open-loop poles situated along the contour enclosing the right half-plane. If such poles exist, then a detour around the poles on the contour is required; otherwise, the mapping would go to infinity in an undetermined way, without angular information. Subsequently, a complete sketch of the Nyquist diagram could not be made, and the number of encirclements of —1 could not be found. Let us assume a G(s)H(s) = N(s)/sD(s) where D(s) has imaginary roots. The s term in the denominator and the imaginary roots of D(s) are poles of G(s)H(s) that lie on the contour, as shown in Figure 10.28(a). To sketch the Nyquist diagram, the contour must detour around each open-loop pole lying on its path. The detour can be to the right of the pole, as shown in Figure 10.28(6), which makes it clear that each pole's vector rotates through +180° as we move around the contour near that pole. This knowledge of the angular rotation of the poles on the contour permits us to complete the Nyquist diagram. Of course, our detour must carry us only an infinitesimal distance into the right half-plane, or else some closed-loop, right-half-plane poles will be excluded in the count. We can also detour to the left of the open-loop poles. In this case, each pole rotates through an angle of -180° as we detour around it. Again, the detour must be infinitesimally small, or else we might include some left-half-plane poles in the count. Let us look at an example.
5-plane
s-plane
s-plane »- o-
— o
FIGURE 10.28 Detouring around open-loop poles: a. poles on contour; b. detour right; c detour left
Example 10.5 Nyquist Diagram for Open-Loop Function with Poles on Contour PROBLEM: Sketch the Nyquist diagram of the unity feedback system of Figure 10.10, where G{s) = {s + 2)/s2. SOLUTION: The system's two poles at the origin are on the contour and must be bypassed, as shown in Figure 10.29(a). The mapping starts at point A and continues in a clockwise direction. Points A, B, C, D, E, and F of Figure 10.29(a) map respectively into points A', B\ C, D, E!, andF' of Figure 10.29(6). At point A, the two open-loop poles at the origin contribute 2 x 90° = 180°, and the zero contributes 0°. The total angle at point A is thus -180°. Close to the origin, the function is infinite in magnitude because of the close proximity to the
568
Chapter 10
Frequency Response Techniques
Test radius
GH-plane
Two poles
FIGURE 10.29 a. Contour for Example 10.5; b. Nyquist diagram for Example 10.5 two open-loop poles. Thus, point A maps into point A', located at infinity at an angle of-180°. Moving from point A to point B along the contour yields a net change in angle of +90° from the zero alone. The angles of the poles remain the same. Thus, the mapping changes by +90° in the counterclockwise direction. The mapped vector goes from -180° aXA' to - 90° atS'. At the same time, the magnitude changes from infinity to zero since at point B there is one infinite length from the zero divided by two infinite lengths from the poles. Alternately, the frequency response can be determined analytically from G(jco) — (2 +;'&>)/(—
^-pfife)
(ia44)
anywhere on the s-plane where i?_2Z0_2 is the vector from the zero at - 2 to any point on the s-plane, and ROZ8Q is the vector from a pole at the origin to any point on the s-plane. Around the infinite semicircle, all J?_,- = oo, and all angles can be approximated as if the vectors originated at the origin. Thus at point B, G(s) = 0Z - 90° since all 0_f = 90° in Eq. (10.44). At point C, all R-t = oo, and all 0_f- = 0° in Eq. (10.44). Thus, G(s) = 0Z0°. At point D, all /?_, = oo, and all 0_* = -90° in Eq. (10.44). Thus, G(s) = 0Z90°. The mapping of the section of the contour from D to E is a mirror image of the mapping of A to B. The result is D' to E'. Finally, over the section EFA, the resultant magnitude approaches infinity. The angle of the zero does not change, but each pole changes by +180°. This change yields a change in the function of - 2 x 180° = -360°. Thus, the mapping from E'toA' is shown as infinite in length and rotating -360°. Analytically, we can use Eq. (10.44) for the points along the contour EFA. At E,
10.5 Stability via the Nyquist Diagram
569
G(s) = (2Z0°)/[(eZ - 90°)(eZ - 90°)] = 00ZI8O0. At F, G{s) = ( 2 Z 0 ° ) / [ ( < F Z 0 ° ) (eZO0)] = ooZ0°. At A, G{s) = (2Z0°)/[(6Z90o)(<=Z90°)] = ooZ - 180°. The Nyquist diagram is now complete, and a test radius drawn from - 1 in Figure 10.29(6) shows one counterclockwise revolution, and one clockwise revolution, yielding zero encirclements. S t u d e n t s who a r e u s i n g MATLAB s h o u l d now r u n c h l 0 p 2 i n A p p e n d i x B. You w i l l l e a r n how t o u s e MATLAB t o make a N y q u i s t p l o t and l i s t t h e p o i n t s on t h e p l o t . You w i l l a l s o l e a r n how t o s p e c i f y a r a n g e f o r f r e q u e n c y . T h i s e x e r c i s e s o l v e s Example 1 0 . 5 u s i n g MATLAB.
PROBLEM: Sketch the Nyquist diagram for the system shown in Figure 10.10 where G{S)
=
(. + 2)(5 + 4)
Compare your sketch with the polar plot in Skill-Assessment Exercise 10.1(c). ANSWER: The complete solution is located at www.wiley.com/college/nise.
In this section, we learned how to sketch a Nyquist diagram. We saw how to calculate the value of the intersection of the Nyquist diagram with the negative real axis. This intersection is important in determining the number of encirclements of —1. Also, we showed how to sketch the Nyquist diagram when open-loop poles exist on the contour; this case required detours around the poles. In the next section, we apply the Nyquist criterion to determine the stability of feedback control systems.
(10.5
Stability via the Nyquist Diagram
We now use the Nyquist diagram to determine a system's stability, using the simple equation Z = P — N. The values of P, the number of open-loop poles of G(s)H(s) enclosed by the contour, and N, the number of encirclements the Nyquist diagram makes about — 1, are used to determine Z, the number of right-half-plane poles of the closed-loop system. If the closed-loop system has a variable gain in the loop, one question we would like to ask is, "For what range of gain is the system stable?" This question, previously answered by the root locus method and the Routh-Hurwitz criterion, is now answered via the Nyquist criterion. The general approach is to set the loop gain equal to unity and draw the Nyquist diagram. Since gain is simply a multiplying factor, the effect of the gain is to multiply the resultant by a constant anywhere along the Nyquist diagram. For example, consider Figure 10.30, which summarizes the Nyquist approach for a system with variable gain, K. As the gain is varied, we can visualize the Nyquist diagram in Figure 10.30(c) expanding (increased gain) or shrinking (decreased gain) like a balloon. This motion could move the Nyquist diagram past the —1 point, changing the stability picture. For this system, since P = 2, the critical point must be encircled by the Nyquist diagram to yield N = 2 and a stable system. A reduction in
MATLAB
570
C h a p t e r 10
Frequency Response Techniques
m +,
> «*,
K(s + 3)(s + 5) (5-2)(5-4)
Qs)
(a)
Im 5-plane
GH-p\ane
(O =
\\f
-1.33 I FIGURE 10.30 D e m o n s t r a t i n g Nyquist stability: a. system; b. contour; c. Nyquist diagram
Trylt 10.2 Use MATLAB, the Control System Toolbox, and the following statements to plot the Nyquist diagram of the system shown in Figure 10.30(a). G=zpk([-3,-5], . . . [2,4],1) nyquiSt(G) After the Nyquist diagram appears, click on the curve and drag to read the coordinates.
c
\
B' / 1
1 K
A ' i 15
Re
J 8
(c)
ib)
gain would place the critical point outside the Nyquist diagram where N = 0, yielding Z = 2, an unstable system. From another perspective we can think of the Nyquist diagram as remaining stationary and the —1 point moving along the real axis. In order to do this, we set the gain to unity and position the critical point at — 1/K rather than —1. Thus, the critical point appears to move closer to the origin as K increases. Finally, if the Nyquist diagram intersects the real axis at —1, then G(jco)H(jco) — —1. From root locus concepts, when G(s)H(s) = —1, the variable s is a closed-loop pole of the system. Thus, the frequency at which the Nyquist diagram intersects —1 is the same frequency at which the root locus crosses the /co-axis. Hence, the system is marginally stable if the Nyquist diagram intersects the real axis at —1. In summary, then, if the open-loop system contains a variable gain, K, set K = 1 and sketch the Nyquist diagram. Consider the critical point to be at -1/K rather than at - 1 . Adjust the value of K to yield stability, based upon the Nyquist criterion.
Example 10.6 Range of Gain for Stability via The Nyquist Criterion PROBLEM: For the unity feedback system of Figure 10.10, where G{s) = K/[s(s + 3)(^ + 5)], find the range of gain, K, for stability, instability, and the value of gain for marginal stability. For marginal stability also find the frequency of oscillation. Use the Nyquist criterion. SOLUTION: First set K = 1 and sketch the Nyquist diagram for the system, using the contour shown in Figure 10.31(a). For all points on the imaginary axis, GUco)H(jco) =
K
5(5 + 3)(5 + 5)
-8o)2 - ;'(15&> - co3 K=1_64o;4 + w2(15-ft>2;
At co = 0, G{jco)H{jco) = -0.0356 -/00.
(10.45)
10.5 Stability via the Nyquist Diagram
571
Im (0 = 0 -
Gtf-plane I « = +« ••
*
-l - O . O O X 3 / V y '
£»=-<«
FIGURE 10.31
a. Contour for Example 10.6; b. Nyquist diagram
flj = 0'•+
(ft)
Next find the point where the Nyquist diagram intersects the negative real axis. Setting the imaginary part of Eq. (10.45) equal to zero, we find co = vT5. Substituting this value of co back into Eq. (10.45) yields the real part of -0.0083. Finally, at co = oo, G(jco)H{jco) = G(s)H(s)\sHoo = l/(yoo)3 = 0Z - 270°. From the contour of Figure 10.31(a), P = 0; for stability N must then be equal to zero. From Figure 10.31(^), the system is stable if the critical point lies outside the contour (N = 0), so that Z = P — N = 0. Thus, K can be increased by 1/0.0083 = 120.5 before the Nyquist diagram encircles — 1. Hence, for stability, K < 120.5. For marginal stability K = 120.5. At this gain the Nyquist diagram intersects — 1, and the frequency of oscillation is \/l5rad/s.
Now that we have used the Nyquist diagram to determine stability, we can develop a simplified approach that uses only the mapping of the positive /co-axis.
Stability via Mapping Only the Positiveyw-Axis Once the stability of a system is determined by the Nyquist criterion, continued evaluation of the system can be simplified by using just the mapping of the positive /co-axis. This concept plays a major role in the next two sections, where we discuss stability margin and the implementation of the Nyquist criterion with Bode plots. Consider the system shown in Figure 10.32, which is stable at low values of gain and unstable at high values of gain. Since the contour does not encircle open-loop
Im s-plane Root locus
Contour
G//-plane
,e > >
-
\
N >
Re FIGURE 10.32
a. Contour and root locus of system that is stable for small gain and unstable for large gain; b. Nyquist diagram
572
Chapter 10
Frequency Response Techniques jco
Im
(a) (b) FIGURE 10.33 a. Contour and root locus of system that is unstable for small gain and stable for large gain; b. Nyquist diagram
poles, the Nyquist criterion tells us that we must have no encirclements of —1 for the system to be stable. We can see from the Nyquist diagram that the encirclements of the critical point can be determined from the mapping of the positive/w-axis alone. If the gain is small, the mapping will pass to the right of —1, and the system will be stable. If the gain is high, the mapping will pass to the left of —1, and the system will be unstable. Thus, this system is stable for the range of loop gain, K, that ensures that the open-loop magnitude is less than unity at that frequency where the phase angle is 180° (or, equivalently, —180°). This statement is thus an alternative to the Nyquist criterion for this system. Now consider the system shown in Figure 10.33, which is unstable at low values of gain and stable at high values of gain. Since the contour encloses two open-loop poles, two counterclockwise encirclements of the critical point are required for stability. Thus, for this case the system is stable if the open-loop magnitude is greater than unity at that frequency where the phase angle is 180° (or, equivalently, —180°). In summary, first determine stability from the Nyquist criterion and the Nyquist diagram. Next interpret the Nyquist criterion and determine whether the mapping of just the positive imaginary axis should have a gain of less than or greater than unity at 180°. If the Nyquist diagram crosses ±180° at multiple frequencies, determine the interpretation from the Nyquist criterion.
Stability Design via Mapping Positive /co-Axis PROBLEM: Find the range of gain for stability and instability, and the gain for marginal stability, for the unity feedback system shown in Figure 10.10, where G(s) = K/[(s2 + 2s + 2)(s + 2)]. For marginal stability find the radian frequency of oscillation. Use the Nyquist criterion and the mapping of only the positive imaginary axis. SOLUTION: Since the open-loop poles are only in the left-half-plane, the Nyquist criterion tells us that we want no encirclements of - 1 for stability. Hence, a gain less than unity at ±180° is required. Begin by letting K = 1 and draw the portion of the contour along the positive imaginary axis as shown in Figure 10.34(A). In
10.5 Stability via the Nyquist Diagram Im
jco
B
i
X
G#-plane
n
1 4
1 20/-N B'
A
i
-2
,.
Contour <*r~"
s-plane
573
<»=w/
-1
X •"
(a)
/
Re
"
(b)
FIGURE 10.34 a. Portion of contour to be mapped for Example 10.7; b. Nyquist diagram of mapping of positive imaginary axis
Figure 10.34(6), the intersection with the negative real axis is found by letting 5 = jco in G(s)H(s), setting the imaginary part equal to zero to find the frequency, and then substituting the frequency into the real part of G(jco)H{jco). Thus, for any point on the positive imaginary axis, G(jco)H(jco) =
[s2+2s + 2){s + 2)
s—>ja>
2
4(1 - co ) -jco{6- co2) 16(1 - co2)2 + co2{6 - co2)2
(10.46)
Setting the imaginary part equal to zero, we find co = \/6. Substituting this value back into Eq. (10.46) yields the real part, -(1/20) = (1/20)Z180°. This closed-loop system is stable if the magnitude of the frequency response is less than unity at 180°. Hence, the system is stable for K < 20, unstable for K > 20, and marginally stable for K = 20. When the system is marginally stable, the radian frequency of oscillation is \/6.
Skill-Assessment Exercise 10.4 PROBLEM: For the system shown in Figure 10.10, where G(i,) =
WileyPLUS
Control Solutions
(5 + 2)(5 + 4)(^ + 6)
do the following: a. Plot the Nyquist diagram. b. Use your Nyquist diagram to find the range of gain, K, for stability. ANSWERS:
a. See the answer at www.wiley.com/college/nise. b. Stable for K < 480 The complete solution is at www.wiley.com/college/nise.
Chapter 10
Frequency Response Techniques
Gain Margin and Phase Margin via the Nyquist Diagram Now that we know how to sketch and interpret a Nyquist diagram to determine a closed-loop system's stability, let us extend our discussion to concepts that will eventually lead us to the design of transient response characteristics via frequency response techniques. Using the Nyquist diagram, we define two quantitative measures of how stable a system is. These quantities are called gain margin and phase margin. Systems with greater gain and phase margins can withstand greater changes in system parameters before becoming unstable. In a sense, gain and phase margins can be qualitatively related to the root locus, in that systems whose poles are farther from the imaginary axis have a greater degree of stability. In the last section, we discussed stability from the point of view of gain at 180° phase shift. This concept leads to the following definitions of gain margin and phase margin: Gain margin, GM. The gain margin is the change in open-loop gain, expressed in decibels (dB), required at 180° of phase shift to make the closed-loop system unstable. Phase margin, ¢ ^ . The phase margin is the change in open-loop phase shift required at unity gain to make the closed-loop system unstable. These two definitions are shown graphically on the Nyquist diagram in Figure 10.35. Assume a system that is stable if there are no encirclements of —1. Using Figure 10.35, let us focus on the definition of gain margin. Here a gain difference between the Nyquist diagram's crossing of the real axis at — \/a and the - 1 critical point determines the proximity of the system to instability. Thus, if the gain of the system were multiplied by a units, the Nyquist diagram would intersect the critical point. We then say that the gain margin is a units, or, expressed in dB, GM = 20 log a. Notice that the gain margin is the reciprocal of the real-axis crossing expressed in dB. lm
Unit circle
GW-plane
Nyquist , diagram
\
^. \
•Mi/* i i i
\
\-. \ •-. i\
v\
Gain difference \ before instability
Gain margin = GM = 20 log a
Phase difference before instability
Phase margin = $ M = «
FIGURE 10.35 Nyquist diagram showing gain and phase margins
10.6 Gain Margin and Phase Margin via the Nyquist Diagram
575
In Figure 10.35, we also see the phase margin graphically displayed. At point Q', where the gain is unity, a represents the system's proximity to instability. That is, at unity gain, if a phase shift of a degrees occurs, the system becomes unstable. Hence, the amount of phase margin is a. Later in the chapter, we show that phase margin can be related to the damping ratio. Thus, we will be able to relate frequency response characteristics to transient response characteristics as well as stability. We will also show that the calculations of gain and phase margins are more convenient if Bode plots are used rather than a Nyquist diagram, such as that shown in Figure 10.35. For now let us look at an example that shows the calculation of the gain and phase margins.
Example 10.8 Finding Gain and Phase Margins PROBLEM: Find the gain and phase margin for the system of Example 10.7 if K = 6. SOLUTION: To find the gain margin, first find the frequency where the Nyquist diagram crosses the negative real axis. Finding G(jco)H(jco), we have G(jco)H(jco)
=
[s2+2s + 2)(5 + 2)
•ya
2
6[4(1 - co ) - j(o{6 - co2)]
(10.47)
1 6 ( 1 - ^ + 0)2(6-0)2)2 The Nyquist diagram crosses the real axis at a frequency of V6 rad/s. The real part is calculated to be —0.3. Thus, the gain can be increased by (1/0.3) = 3.33 before the real part becomes —1. Hence, the gain margin is (10.48) GM = 20 log 3.33 = 10.45 dB To find the phase margin, find the frequency in Eq. (10.47) for which the magnitude is unity. As the problem stands, this calculation requires computational tools, such as a function solver or the program described in Appendix H.2. Later in the chapter we will simplify the process by using Bode plots. Eq. (10.47) has unity gain at a frequency of 1.253 rad/s. At this frequency, the phase angle is -112.3°. The difference between this angle and -180° is 67.7°, which is the phase margin. MATLAB
Students who are using MATLAB should now run chl0p3 in Appendix B. You will learn how to use MATLAB to find gain margin, phase margin, zero dB frequency, and 180° frequency. This exercise solves Example 10.8 using MATLAB. Gui Tool
MATLAB's LTI Viewer, with the Nyquist diagram selected, is another method that may be used to find gain margin, phase margin, zero dB frequency, and 180° frequency. You are encouraged to study Appendix E, at www.wiley.com/college/nise, which contains a tutorial on the LTI Viewer as well as some examples. Example E. 2 solves Example 10.8 using the LTI Viewer.
576
Chapter 10
Frequency R e s p o n s e Techniques
Skill-Assessment Exercise 10.5 Trylt 10.3 Use MATLAB, the Control System Toolbox, and the following statements to find the gain and phase margins of G(s)H(s) = 100/[(s+2) (5+4)(^+6)] using the Nyquist diagram.
PROBLEM: Find the gain margin and the 180° frequency for the problem in Skill-Assessment Exercise 10.4 if K = 100.
WileyPLUS
dJSJ Control Solutions
ANSWERS: Gain margin = 13.62 dB; 180° frequency = 6.63 rad/s The complete solution is at www.wiley.com/college/nise.
G=zpk([ ],[ - 2 , - 4 , - 6 ] , 1 0 0 ) nyquist(G) After the Nyquist diagram appears: 1. Right-click in the graph area. 2. Select Characteristics. 3. Select All Stability Margins. 4. Let the mouse rest on the margin points to read the gain and phase margins.
In this section, we defined gain margin and phase margin and calculated them via the Nyquist diagram. In the next section, we show how to use Bode diagrams to implement the stability calculations performed in Sections 10.5 and 10.6 using the Nyquist diagram. We will see that the Bode plots reduce the time and simplify the calculations required to obtain results.
I
10.7 Stability, Gain Margin, and Phase Margin via Bode Plots In this section, we determine stability, gain and phase margins, and the range of gain required for stability. All of these topics were covered previously in this chapter, using Nyquist diagrams as the tool. Now we use Bode plots to determine these characteristics. Bode plots are subsets of the complete Nyquist diagram but in another form. They are a viable alternative to Nyquist plots, since they are easily drawn without the aid of the computational devices or long calculations required for the Nyquist diagram and root locus. You should remember that all calculations applied to stability were derived from and based upon the Nyquist stability criterion. The Bode plots are an alternate way of visualizing and implementing the theoretical concepts.
Determining Stability Let us look at an example and determine the stability of a system, implementing the Nyquist stability criterion using Bode plots. We will draw a Bode log-magnitude plot and then determine the value of gain that ensures that the magnitude is less than 0 dB (unity gain) at that frequency where the phase is ±180°.
10.7 Stability, Gain Margin, and Phase Margin via Bode Plots
Example 10.9 Range of Gain for Stability via Bode Plots PROBLEM: Use Bode plots to determine the range of K within which the unity feedback system shown in Figure 10.10is stable. Let G(s) = K/[(s + 2){s + A)(s + 5)]. SOLUTION: Since this system has all of its open-loop poles in the left-half-plane, the open-loop system is stable. Hence, from the discussion of Section 10.5, the closed-loop system will be stable if the frequency response has a gain less than unity when the phase is 180°. Begin by sketching the Bode magnitude and phase diagrams shown in Figure 10.36. In Section 10.2, we summed normalized plots of each factor of G(s) to create the Bode plot. We saw that at each break frequency, the slope of the resultant Bode plot changed by an amount equal to the new slope that was added. Table 10.6 demonstrates this observation. In this example, we use this fact to draw the Bode plots faster by avoiding the sketching of the response of each term. The low-frequency gain of G(s)H(s) is found by setting 5 to zero. Thus, the Bode magnitude plot starts at AT/40. For convenience, let K = 40 so that the logmagnitude plot starts at 0 dB. At each break frequency, 2,4, and 5, a 20 dB/decade increase in negative slope is drawn, yielding the log-magnitude plot shown in Figure 10.36. The phase diagram begins at 0° until a decade below the first break frequency of 2 rad/s. At 0.2 rad/s the curve decreases at a rate of — 457decade, decreasing an additional 45°/decade at each subsequent frequency (0.4 and 0.5 rad/s) a decade below each break. At a decade above each break frequency, the slopes are reduced by 45°/decade at each frequency. o
1 A——,7?n.
-20
--20dB/dt c
-40 -60 (N
1/ -
-i. UdJ i/dec
\
>
\ \
-80
" ' -60 dB/
;j[
-100 -120 0.01
0.1
1 Frequency (rad/s)
10
100
K
^5
? a
/ -457de c
//
90°/ de
-90
60
S
\
s \
sj
\ 1357de
Su0J -135 I
7 -"^^ \
?0°Alec
-180 -225 -270 0.01
FIGURE 10.36
A C\ s fllll -A 57dec
-¾¾ 0.1
1 Frequency (rad/s)
10
Bode log-magnitude and phase diagrams for the system of Example 10.9
100
577
578
Chapter 10
Frequency Response Techniques
The Nyquist criterion for this example tells us that we want zero encirclements of —1 for stability. Thus, we recognize that the Bode log-magnitude plot must be less than unity when the Bode phase plot is 180°. Accordingly, we see that at a frequency of 7 rad/s, when the phase plot is -180°, the magnitude plot is —20 dB. Therefore, an increase in gain of +20 dB is possible before the system becomes unstable. Since the gain plot was scaled for a gain of 40, +20 dB (a gain of 10) represents the required increase in gain above 40. Hence, the gain for instability is 40 x 10 = 400. The final result is 0 < K < 400 for stability. This result, obtained by approximating the frequency response by Bode asymptotes, can be compared to the result obtained from the actual frequency response, which yields a gain of 378 at a frequency of 6.16 rad/s. MATLAB
Students who are using MATLAB should now run chl 0p4 in Appendix B. You will learn how to use MATLAB to find the range of gain for stability via frequency response methods . This exercise solves Example 10. 9 using MATLAB.
Evaluating Gain and Phase Margins Next we show how to evaluate the gain and phase margins by using Bode plots (Figure 10.37). The gain margin is found by using the phase plot to find the frequency, cocM, where the phase angle is 180°. At this frequency, we look at the magnitude plot to determine the gain margin, GM, which is the gain required to raise the magnitude curve to 0 dB. To illustrate, in the previous example with K = 40, the gain margin was found to be 20 dB. The phase margin is found by using the magnitude curve to find the frequency, Mow, where the gain is 0 dB. On the phase curve at that frequency, the phase margin, (f)M, is the difference between the phase value and 180°.
urn) OdB
Phase (degrees)
180° FIGURE 10.37
Gain and phase margins on the Bode diagrams
- log a
10.7 Stability, Gain Margin, and Phase Margin via Bode Plots
579
Example 10.10 Gain and Phase Margins from Bode Plots PROBLEM: If K = 200 in the system of Example 10.9, find the gain margin and the phase margin. SOLUTION: The Bode plot in Figure 10.36 is scaled to a gain of 40. If K = 200 (five times as great), the magnitude plot would be 20 log 5 = 13.98 dB higher. To find the gain margin, look at the phase plot and find the frequency where the phase is 180°. At this frequency, determine from the magnitude plot how much the gain can be increased before reaching 0 dB. In Figure 10.36, the phase angle is 180° at approximately 7 rad/s. On the magnitude plot, the gain is -20 + 13.98 = -6.02 dB. Thus, the gain margin is 6.02 dB. To find the phase margin, we look on the magnitude plot for the frequency where the gain is 0 dB. At this frequency, we look on the phase plot to find the difference between the phase and 180°. This difference is the phase margin. Again, remembering that the magnitude plot of Figure 10.36 is 13.98 dB lower than the actual plot, the 0 dB crossing (-13.98 dB for the normalized plot shown in Figure 10.36) occurs at 5.5 rad/s. At this frequency the phase angle is —165°. Thus, the phase margin is -165° - (-180°) = 15°. MATLAB's LTI Viewer, with Bode plots selected, is another method that may be used to find gain margin, phase margin, zero dB frequency, and 180° frequency. You are encouraged to study AppendixEatwww.wiley.com/college/nise, which contains a tutorial on the LTI Viewer as well as some examples. Example E.3 solves Example 10.10 using the LTI Viewer.
Gui Tool
•dUIB
Skill-Assessment Exercise 10.6 PROBLEM: For the system shown in Figure 10.10, where G(lS) =
(5 + 5)(5 + 20)(5 + 50)
do the following: a. Draw the Bode log-magnitude and phase plots. b. Find the range of K for stability from your Bode plots. c. Evaluate gain margin, phase margin, zero dB frequency, and 180° frequency from your Bode plots for K -10,000.
TVylt 10.4 Use MATLAB, the Control System Toolbox, and the following statements to solve Skill-Assessment Exercise 10.6(c) using Bode plots. G=zpk([], . . . [ - 5 , - 2 0 , - 5 0 ] , 10000) bode(G) g r i d on After the Bode plot appears:
ANSWERS:
a. See the answer at www.wiley.com/college/nise. b. K< 96,270 c. Gain margin=19.67 dB, phase margin=92.9°, zero dB frequency = 7.74 rad/s, and 180° frequency = 36.7 rad/s The complete solution is at www.wiley.com/college/nise.
1. Right-click in the graph area. 2. Select Characteristics. 3. Select All Stability Margins. 4. Let the mouse rest on the margin points to read the gain and phase margins.
Chapter 10
580
Frequency Response Techniques
We have seen that the open-loop frequency response curves can be used not only to determine whether a system is stable but to calculate the range of loop gain that will ensure stability. We have also seen how to calculate the gain margin and the phase margin from the Bode diagrams. Is it then possible to parallel the root locus technique and analyze and design systems for transient response using frequency response methods? We will begin to explore the answer in the next section.
I
10.8
Relation Between Closed-Loop Transient and Closed-Loop Frequency Responses Damping Ratio and Closed-Loop Frequency Response
R(s) + ,
E(s) s(s + 2£(Dtt)
In this section, we will show that a relationship exists between a system's transient response and its closed-loop frequency response. In particular, consider the secondorder feedback control system of Figure 10.38, which we have been using c ($^ since Chapter 4, where we derived relationships between the closed-loop transient response and the poles of the closed-loop transfer function,
FIGURE 10.38 Second-order closed-loop system
R(s)
= T(s) =
cot s2 + 2£(ons + a%
(10.49)
We now derive relationships between the transient response of Eq. (10.49) and characteristics of its frequency response. We define these characteristics and relate them to damping ratio, natural frequency, settling time, peak time, and rise time. In Section 10.10, we will show how to use the frequency response of the open-loop transfer function G(s) =
cot s(s + 2;con)
(10.50)
shown in Figure 10.38, to obtain the same transient response characteristics. Let us now find the frequency response of Eq. (10.49), define characteristics of this response, and relate these characteristics to the transient response. Substituting s=jco into Eq. (10.49), we evaluate the magnitude of the closed-loop frequency response as M = \T(ja>)\ =
to:
(aft-co2)2
(10.51) +4$2co2co2
A representative sketch of the log plot of Eq. (10.51) is shown in Figure 10.39. We now show that a relationship exists between the peak value of the closedloop magnitude response and the damping ratio. Squaring Eq. (10.51), differentiating with respect to co2, and setting the derivative equal to zero yields the maximum value of M, Mp, where (10.52)
10.8 Relation Between Closed-Loop Transient and Closed-Loop Frequency Responses
-20
logfflp logOBW Log-frequency (rad/s)
581
FIGURE 10.39 Representative log-magnitude plot of Eq. (10.51)
at a frequency, (op, of (On
(10.53)
== w n V / l - 2 C 2
Since £ is related to percent overshoot, we can plot Mp vs. percent overshoot. The result is shown in Figure 10.40. Equation (10.52) shows that the maximum magnitude on the frequency response curve is directly related to the damping ratio and, hence, the percent overshoot. Also notice from Eq. (10.53) that the peak frequency, cop, is not the natural frequency. However, for low values of damping ratio, we can assume that the peak occurs at the natural frequency. Finally, notice that there will not be a peak at frequencies above zero if £ > 0.707. This limiting value of £ for peaking on the magnitude response curve should not be confused with overshoot on the step response, where there is overshoot for 0 < £ < 1.
Response Speed and Closed-Loop Frequency Response Another relationship between the frequency response and time response is between the speed of the time response (as measured by settling time, peak time, and rise time) and the bandwidth of the closed-loop frequency response, which is defined here as the frequency, G>BW> at which the magnitude response curve is 3 dB down from its value at zero frequency (see Figure 10.39).
30 40 50 Percent overshoot
70
FIGURE 10.40 Closed-loop frequency response peak vs. percent overshoot for a twopole system
Chapter 10
Frequency Response Techniques
The bandwidth of a two-pole system can be found by finding that frequency for which M = \j\fl (that is, - 3 dB) in Eq.(10.51). The derivation is left as an exercise for the student. The result is ft>BW ~-
2 4 2 = w«y(i--2£ ) + V4£ -4£ +2
(10.54)
To relate &>Bw to settling time, we substitute con = 4/T 5 £ into Eq. (10.54) and obtain
-4c 2 +2 Similarly, since, con — 7t/{Tpyi
^
=
(10.55)
— £2),
rvT?^(1"2fl+
v
^
-4f2 + 2
(10.56)
To relate the bandwidth to rise time, Tr, we use Figure 4.16, knowing the desired £ and T r . For example, assume £ = 0.4 and Tr = 0.2 second. Using Figure 4.16, the ordinate Trco„ = 1.463, from which con = 1.463/0.2 = 7.315 rad/s. Using Eq. (10.54), wBw = 10.05 rad/s. Normalized plots of Eqs. (10.55) and (10.56) and the relationship between bandwidth normalized by rise time and damping ratio are shown in Figure 10.41.
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Damping ratio (a)
FIGURE 10.41 c. rise time
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Damping ratio
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Damping ratio (c) Normalized bandwidth vs. damping ratio for a. settling time; b. peak time;
10.9 Relation Between Closed- and Open-Loop Frequency Responses
Skill-Assessment Exercise 10.7 PROBLEM: Find the closed-loop bandwidth required for 20% overshoot and 2-seconds settling time. ANSWER: wBw = 5.79rad/s The complete solution is at www.wiley.com/college/nise. In this section, we related the closed-loop transient response to the closed-loop frequency response via bandwidth. We continue by relating the closed-loop frequency response to the open-loop frequency response and explaining the impetus.
(
10.9 Relation Between Closed- and Open-Loop Frequency Responses
At this point, we do not have an easy way of finding the closed-loop frequency response from which we could determine Mp and thus the transient response.2 As we have seen, we are equipped to rapidly sketch the open-loop frequency response but not the closedloop frequency response. However, if the open-loop response is related to the closedloop response, we can combine the ease of sketching the open-loop response with the transient response information contained in the closed-loop response.
Constant M Circles and Constant N Circles Consider a unity feedback system whose closed-loop transfer function is
r
(10 57)
«=r?§b
-
The frequency response of this closed-loop function is
Since G(jco) is a complex number, let G(ja>) = P{co) +jQ(co) mEq. (10.58), which yields P(co)+jQ(co) [(P(a>) + 1)+/G(a>)]
iUC0)
[W }
^
Therefore,
M' = yr\jco)\^r^
••
r ;;;;
:
[(P(co) + 1)2 + Q2(co)}
uo.60)
Eq. (10.60) can be put into the form M2 \2 „-,2 M2 i +<2 = — p
M2~lJ 2
*
(M2-l)2
r
(10-61) K
'
At the end of this subsection, we will see how to use MATLAB to obtain closed-loop frequency responses.
583
584
Chapter 10
Frequency Response Techniques
M = 0.7
*- Re
-4 -3 -2 FIGURE 10.42 Constant M circles which is the equation of a circle of radius M/(M2 - 1) centered at [—M2/(M2 - 1 ) , 0 ] . These circles, shown plotted in Figure 10.42 for various values of M, are called constant M circles and are the locus of the closed-loop magnitude frequency response for unity feedback systems. Thus, if the polar frequency response of an open-loop function, G(s), is plotted and superimposed on top of the constant M circles, the closed-loop magnitude frequency response is determined by each intersection of this polar plot with the constant M circles. Before demonstrating the use of the constant M circles with an example, let us go through a similar development for the closed-loop phase plot, the constant N circles. From Eq. (10.59), the phase angle, 0, of the closed-loop response is 1G H - 1 Q(°>) ] t a n - x ~£-4 P(co) - tan P(co) + 1
— tan
- l
Pico) 1 +
QHf
P{a>) + 1
(10.62)
(2(0))
P(m) \P(o>) + 1
after using tan (a - 0) = ( t a n a - tan £)/(1 -I- tan a tan )3). Dropping the functional notation, Q tan 4> = N = pZ + P+Q7
(10.63)
Equation (10.63) can be put into the form of a circle, +
Q-
1 \ 2 _N2 + 2N/ AN2
(10.64)
10.9 Relation Between Closed- and Open-Loop Frequency Responses Im G-plane
-3 FIGURE 10.43
-2 Constant N circles
-1
which is plotted in Figure 10.43 for various values of N. The circles of this plot are called constant N circles. Superimposing a unity feedback, open-loop frequency response over the constant N circles yields the closed-loop phase response of the system. Let us now look at an example of the use of the constant M and N circles.
Example 10.11 Closed-Loop Frequency Response from Open-Loop Frequency Response PROBLEM: Find the closed-loop frequency response of the unity feedback system shown in Figure 10.10, where G(s) = 50/[s(s+ 3)(s+ 6)], using the constant M circles, N circles, and the open-loop polar frequency response curve. SOLUTION: First evaluate the open-loop frequency function and make a polar frequency response plot superimposed over the constant M and N circles. The
585
586
Chapter 10
Frequency Response Techniques
o)= 0.81
-3 -
4
-
3
-
2
-
1
0
1
2
FIGURE 10.44 Nyquist diagram for Example 10.11 and constant M and N circles
open-loop frequency function is G(jco) =
50 -9a)2 + j{lSco - cov
(10.65)
from which the magnitude, \G(jco)\, and phase, ZG(jco), can be found and plotted. The polar plot of the open-loop frequency response (Nyquist diagram) is shown superimposed over the M and N circles in Figure 10.44.
FIGURE 10.45 Closed-loop frequency response for Example 10.11
(0=2.5
10.9 Relation Between Closed- and Open-Loop Frequency Responses
The closed-loop magnitude frequency response can now be obtained by finding the intersection of each point of the Nyquist plot with the M circles, while the closed-loop phase response can be obtained by finding the intersection of each point of the Nyquist plot with the N circles. The result is shown in Figure 10.45.3 Students who are usingMATLAB should now run chl0p5 in Appendix B. You will learn how to use MATLAB to find the closed-loop frequency response. This exercise solves Example 10.11 using MATLAB.
Nichols Charts A disadvantage of using the M and N circles is that changes of gain in the open-loop transfer function, G(s), cannot be handled easily. For example, in the Bode plot, a gain change is handled by moving the Bode magnitude curve up or down an amount equal to the gain change in dB. Since the M and N circles are not dB plots, changes in gain require each point of G(jco) to be multiplied in length by the increase or decrease in gain. Another presentation of the M and N circles, called a Nichols chart, displays the constant M circles in dB, so that changes in gain are as simple to handle as in the Bode plot. A Nichols chart is shown in Figure 10.46. The chart is a plot of open-loop magnitude in dB vs. open-loop phase angle in degrees. Every point on the M circles can be transferred to the Nichols chart. Each point on the constant M circles is represented by magnitude and angle (polar coordinates). Converting the magnitude to dB, we can transfer the point to the Nichols chart, using the polar coordinates with magnitude in dB plotted as the ordinate, and the phase angle plotted as the abscissa. Similarly, the TV circles also can be transferred to the Nichols chart.
-280 FIGURE 10.46
3
-260
-240
-220
-200 -180 -160 Phase (degrees)
-140
-120
-100
-80
Nichols chart
You are cautioned not to use the closed-loop polar plot for the Nyquist criterion. The closed-loop frequency response, however, can be used to determine the closed-loop transient response, as discussed in Section 10.8.
587
Chapter 10
588
Frequency Response Techniques
25
!
-355°
!
20
""^-^U-^T^
15
a io - - - - * =
11
J^ ^ " * \
[
.^^-.-1.4-7^-
L-340°*
( /7>
.-320°'
vT2s?^ * >^
-5
FIGURE 10.47 Nichols chart with frequency response for G{s) = K/[s(s + l){s + 2)} superimoposed. Values for K = 1 and K = 3.16 are shown
»=•1 /l.p
i
-300° t
-10
^y5=pslli /
/ \ /
-15 -280
_2()
°
.0.707
35^551¾¾ ^
—7
-280°
/A
$
&UCV - - T -60°
TSr v
•»1*1 \ ._ A——fiA^"
0--260 5 -240° -220°-200°-180°-l60° 140° ~ T T \ \ | -80° -i20°-mo°-gn° -260 -240 -220 -200 -180 -160 -140 -120 -100 -I Phase (degrees)
For example, assume the function G(s) =
K s{s + l){s + 2)
(10.66)
Superimposing the frequency response of G(s) on the Nichols chart by plotting magnitude in dB vs. phase angle for a range of frequencies from 0.1 to 1 rad/s, we obtain the plot in Figure 10.47 for K = 1. If the gain is increased by 10 dB, simply raise the curve for K = 1 by 10 dB and obtain the curve for K = 3.16(10 dB). The intersection of the plots of G(jco) with the Nichols chart yields the frequency response of the closed-loop system. MATLAB
Students who are using MATLAB should now run chl0p6 in Appendix B. You will learn how to use MATLAB to make a Nichols plot. This exercise makes a Nichols plot of G(s) = l/[s(s+ l)(s + 2)] using MATLAB. Gui Tool
MATLAB's LTI Viewer is an alternative method of obtaining the Nichols chart. You are encouraged to study Appendix E at www.wiley.com/ college/nise, which contains a tutorial on the LTI Viewer as well as some examples. Example E. 4 shows how to obtain Figure 10.47 using the LTI Viewer.
Skill-Assessment Exercise 10.8 Trylt 10.5 Use MATLAB, the Control System Toolbox, and the following statements to make a Nichols chart of the system given in Skill-Assessment Exercise 10.8 G=zpk ( [ ] , . . . [-5,-20,-501,8000) nichols(G) g r i d on
PROBLEM: Given the system shown in Figure 10.10, where 8000 G{s) = (5 + 5)(5 + 20)(5 + 50)
WileyPLUS
Control Solutions
plot the closed-loop log-magnitude and phase frequency response plots using the following methods: a. M and TV circles b. Nichols chart ANSWER: The complete solution is at www.wiley.com/college/nise.
10.10 Relation Between Closed-Loop Transient and Open-Loop Frequency Responses
[
10.10
Relation Between Closed-Loop Transient and Open-Loop Frequency Responses
Damping Ratio From M Circles We can use the results of Example 10.11 to estimate the transient response characteristics of the system. We can find the peak of the closed-loop frequency response by finding the maximum M curve tangent to the open-loop frequency response. Then we can find the damping ratio, f, and subsequently the percent overshoot, via Eq. (10.52). The following example demonstrates the use of the open-loop frequency response and the M circles to find the damping ratio or, equivalently, the percent overshoot.
Percent Overshoot from Open-Loop Frequency Response PROBLEM: Find the damping ratio and the percent overshoot expected from the system of Example 10.11, using the open-loop frequency response and the M circles. SOLUTION: Equation (10.52) shows that there is a unique relationship between the closed-loop system's damping ratio and the peak value, MP, of the closed-loop system's magnitude frequency plot. From Figure 10.44, we see that the Nyquist diagram is tangent to the 1.8 M circle. We see that this is the maximum value for the closed-loop frequency response. Thus, Mp = 1.8. We can solve for f by rearranging Eq. (10.52) into the following form: C 4 - C 2 + (1/4M^) = 0
(10.67)
Since Mp = 1.8, then £ = 0.29 and 0.96. From Eq. (10.53), a damping ratio larger than 0.707 yields no peak above zero frequency. Thus, we select f = 0.29, which is equivalent to 38.6% overshoot. Care must be taken, however, to be sure we can make a second-order approximation when associating the value of percent overshoot to the value of £. A computer simulation of the step response shows 36% overshoot.
So far in this section, we have tied together the system's transient response and the peak value of the closed-loop frequency response as obtained from the open-loop frequency response. We used the Nyquist plots and the M and N circles to obtain the closed-loop transient response. Another association exists between the open-loop frequency response and the closed-loop transient response that is easily implemented with the Bode plots, which are easier to draw than the Nyquist plots.
Damping Ratio from Phase Margin Let us now derive the relationship between the phase margin and the damping ratio. This relationship will enable us to evaluate the percent overshoot from the phase margin found from the open-loop frequency response.
589
590
Chapter 10
Frequency Response Techniques
Consider a unity feedback system whose open-loop function G(s) =
at s(s + 2¾¾¾)
(10.68)
yields the typical second-order, closed-loop transfer function T(s) =
0),,
(10.69)
s2 + 2^cons + co2
In order to evaluate the phase margin, we first find the frequency for which \G(ja>)\ = 1. Hence, ,.,2
\G(jco)\ =
1
(10.70)
0)1 = (On y -2£ 2 + v / l + 4 £ 4 '
(10.71)
2
— co + j2£io„co\
The frequency, co\, that satisfies Eq. (10.70) is
The phase angle of G(jco) at this frequency is ZG(jco) = - 9 0 - t a n - 1 - ^ -
= -90 -
-2c2 + v^p+T
tan- l
(10.72)
~2£ The difference between the angle of Eq. (10.72) and - 1 8 0 ° is the phase margin,
<E>M = 90 - tan - l
=
tan - 1
-2c2 + x/TTip
n
2C
(10.73)
J-2? + VlV^
Equation (10.73), plotted in Figure 10.48, shows the relationship between phase margin and damping ratio.
FIGURE 10.48 Phase margin vs. damping ratio
0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 Damping ratio
10.10 Relation Between Closed-Loop Transient and Open-Loop Frequency Responses
-280 -260 -240 -220 -200 -180 -160 -140 -120 -100 Open-loop phase (degrees)
-80
FIGURE 10.49 Open-loop gain vs. open-loop phase angle for —3 dB closed-loop gain
As an example, Eq. (10.53) tells us that there is no peak frequency if £ = 0.707. Hence, there is no peak to the closed-loop magnitude frequency response curve for this value of damping ratio and larger. Thus, from Figure 10.48, a phase margin of 65.52°(£ = 0.707) or larger is required from the open-loop frequency response to ensure there is no peaking in the closed-loop frequency response.
Response Speed from Open-Loop Frequency Response Equations (10.55) and (10.56) relate the closed-loop bandwidth to the desired settling or peak time and the damping ratio. We now show that the closed-loop bandwidth can be estimated from the open-loop frequency response. From the Nichols chart in Figure 10.46, we see the relationship between the open-loop gain and the closed-loop gain. The M = 0.707(-3 dB) curve, replotted in Figure 10.49 for clarity, shows the open-loop gain when the closed-loop gain is —3 dB, which typically occurs at &>BW if the low-frequency closed-loop gain is 0 dB. We can approximate Figure 10.49 by saying that the closed-loop bandwidth, O>BW (the frequency at which the closed-loop magnitude response is -3dB), equals the frequency at which the open-loop magnitude response is between —6 and —7.5 dB if the open-loop phase response is between —135° and —225°. Then, using a second-order system approximation, Eqs. (10.55) and (10.56) can be used, along with the desired damping ratio, £, to find settling time and peak time, respectively. Let us look at an example.
Example 10.13 Settling and Peak Times from Open-Loop Frequency Response PROBLEM: Given the system of Figure 10.50(a) and the Bode diagrams of Figure 10.50(6), estimate the settling time and peak time. SOLUTION: Using Figure 10.50(6), we estimate the closed-loop bandwidth by finding the frequency where the open-loop magnitude response is in the range of - 6 to —7.5 dB if the phase response is in the range of —135° to —225°. Since Figure 10.50(6) shows - 6 to —7.5 dB at approximately 3.7 rad/s with a phase response in the stated region, O>BW — 3.7 rad/s. Next find f via the phase margin. From Figure 10.50(6), the phase margin is found by first finding the frequency at which the magnitude plot is 0 dB. At this frequency, 2.2 rad/s, the phase is about -145°. Hence, the phase margin is approximately (-145° - (-180°)) = 35°. Using Figure 10.48, £ = 0.32. Finally, using Eqs. (10.55) and (10.56), with the values of WBW and £ just found, Ts = 4.86
591
Chapter 10
592
Frequency Response Techniques
seconds and Tp = 129 seconds. Checking the analysis with a computer simulation shows Ts = 5.5 seconds, and Tp = 1.43 seconds. /?(*)+, - > E W
r
cm
50 sis + 3)(.s + 6)
(a) 10 —-____ 6 2 -2 5 -6 g1 -10 o -14 -18 -22 -26 -30 1
--—-~-^_
^ 2
3
4
5
6
7
8
9
7
8
10
Frequency (rad/s) -100 -120 ~~~~—^^-__ ^
-140
M -160 u
18 1 "200 °
I-
-220 -240
2
3
4
9
10
Frequency (rad/s) ib)
FIGURE 10.50
a. Block diagram; b. Bode diagramsforsystem of Example 10.13
Skill-Assessment Exercise 10.9 PROBLEM: Using the open-loop frequency response for the system in Figure 10.10, where G(s) =
100
s(s + 5)
estimate the percent overshoot, settling time, and peak time for the closed-loop step response. ANSWER: %OS = 44%, T, = 1.64s, and 7> = 0.33 s The complete solution is at www.wiley.com/college/nise.
10.11 Steady-State Error Characteristics from Frequency Response
10.11 (
Steady-State Error Characteristics from Frequency Response
In this section, we show how to use Bode diagrams to find the values of the static error constants for equivalent unity feedback systems: Kp for a Type 0 system, Kv for a Type 1 system, and Ka for a Type 2 system. The results will be obtained from urmormalized and unsealed Bode log-magnitude plots.
Position Constant To find Kp, consider the following Type 0 system:
G(s) = K
/=i m
(10.74)
n (*+/>/)
/=i
A typical unnormalized and unsealed Bode log-magnitude plot is shown in Figure 10.51(a). The initial value is
20 log M = 20 log K i=l m
(10.75)
i=\
20 log M
20 log K
±
+- (0
20 logm n
-40 dB/dec
20 log K
<°on/>, 1=1
COQ
(c) FIGURE 10.51 Typical unnormalized and unsealed Bode log-magnitude plots showing the value of static error constants: a. Type 0; b. Type 1; c. Type 2
593
594
Chapter 10
Frequency Response Techniques
But for this system
Kp = K'ilUPi
(10.76)
which is the same as the value of the low-frequency axis. Thus, for an unnormalized and unsealed Bode log-magnitude plot, the low-frequency magnitude is 20 log Kp for a Type 0 system.
Velocity Constant To find Kv for a Type 1 system, consider the following open-loop transfer function of a Type 1 system:
G(s) = K-^ sY[(s+Pi)
(10.77)
/=i
A typical unnormalized and unsealed Bode log-magnitude diagram is shown in Figure 10.51(6) for this Type 1 system. The Bode plot starts at n
UZi 20 log M = 20 log K - ¾ —
(10.78)
o)0flPi /=i
The initial -20 dB/decade slope can be thought of as originating from a function, n
IPs G'(s)=K^—
(10.79)
sfiPi /=i
G'(s) intersects the frequency axis when n
UZi OJ = K ' ^ —
(10.80)
tlto /=i
But for the original system (Eq. (10.77)), n
UZi KV = K^ITA-
(10.81)
/=I
which is the same as the frequency-axis intercept, Eq. (10.80). Thus, we can find Kv by extending the initial -20 dB/decade slope to the frequency axis on an unnormalized and unsealed Bode diagram. The intersection with the frequency axis is K+
10.11 Steady-State Error Characteristics from Frequency Response
Acceleration Constant To find Ka for a Type 2 system, consider the following:
n (s+zd
/=l
G(s) = K
(10.82)
2
s U(s+Pi] /=1
A typical unnormalized and unsealed Bode plot for a Type 2 system is shown in Figure 10.51(c). The Bode plot starts at 11¾ 20 log M = 20 logiC
/=i in
(10.83)
<4tlPi /=I
The initial -40 dB/decade slope can be thought of as coming from a function, Uzi G'(s)=K
/=i
(10.84)
s2YlPi /=i
G'{s) intersects the frequency axis when 11¾ K /=i UPi
(10.85)
\ a But for the original system (Eq. (10.82)),
IlZi Ka=K
/=1 m
(10.86)
/=1
Thus, the initial -40 dB/decade slope intersects the frequency axis at \fKa.
Example 10.14 Static Error Constants from Bode Plots PROBLEM: For each unnormalized and unsealed Bode log-magnitude plot shown in Figure 10.52, a. Find the system type. b. Find the value of the appropriate static error constant.
595
596
Chapter 10
Frequency Response Techniques
30 25
H
s20
•"
\
o 15 o 04 10
//
-20 dB/dec'
0.1
n
1 Frequency (rad/s)
10
(a) 15 0 -5
s-25 3
-¾¾ —i
0 dB/de Zen> dB crossinR -40dB/dec~~ -20 dB/dec
-65 -85 -105 0.1
10
1
Frequency (rad/s) (A) 60 40 20
f ° o
.0 dB/de ^ . -40 dB/dec
~~"~~~-
--
^ -20
dB cross
ingH
-40
-60 0.1
FIGURE 10.52
1 Frequency (rad/s) (c) Bode log-magnitude plots for Example 10.14
10
SOLUTION: Figure 10.52(A) is a Type 0 system since the initial slope is zero. The value of Kp is given by the low-frequency asymptote value. Thus, 20 log Kp = 25, or Kp = 17.78. Figure 10.52(b) is a Type 1 system since the initial slope is -20 dB/decade. The value of Kv is the value of the frequency that the initial slope intersects at the zero dB crossing of the frequency axis. Hence, Kv = 0.55. Figure 10.52(c) is a Type 2 system since the initial slope is -40 dB/decade. The value of \/K^ is the value of the frequency that the initial slope intersects at the zero dB crossing of the frequency axis. Hence, Ka = 3 2 = 9.
10.12 Systems with Time Delay
(
( [ Skill-Assessment Exercise 10.10 J
PROBLEM: Find the static error constants for a stable unity feedback system whose open-loop transfer function has the Bode magnitude plot shown in Figure 10.53.
100 OO
M 50 o 0
0. 31
0.1
l
10
100
1000
Frequency (rad/s) FIGURE 10.53
Bode log-magnitude plot for Skill-Assessment Exercise 10.10
ANSWEF S: Kp = oo, Kv = co, Ka = 90.25 The con aplete solution is www.wiley.com/college/nise.
^ 10.12 Systems with Time Delay Time delay occurs in control systems when there is a delay between the commanded response and the start of the output response. For example, consider a heating system that operates by heating water for pipeline distribution to radiators at distant locations. Since the hot water must flow through the line, the radiators will not begin to get hot until after a specified time delay. In other words, the time between the command for more heat and the commencement of the rise in temperature at a distant location along the pipeline is the time delay. Notice that this is not the same as the transient response or the time it takes the temperature to rise to the desired level. During the time delay, nothing is occurring at the output.
Modeling Time Delay Assume that an input, R(s), to a system, G(s), yields an output, C(s). If another system, G'(s), delays the output by T seconds, the output response is c(t - T). From Table 2.2, Item 5, the Laplace transform of c(t - T) is e~sTC(s). Thus, for the system without delay, C(s) = R{s)G{s), and for the system with delay, e~sTC(s) = R(s)G'(s). Dividing these two equations, G'(s)/G(s) — e~sT. Thus, a system with time delay T can be represented in terms of an equivalent system without time delay as follows: G'{s) = e-sTG{s)
(10.87)
597
)
598
Chapter 10
Frequency Response Techniques M(dB) Gain plot - log co
OdB
Phase (degrees)
180°
>- log co Phase plot without delay
FIGURE 10.54
Phase plot with delay Effect of delay upon frequency response
The effect of introducing time delay into a system can also be seen from the perspective of the frequency response by substituting 51 = jco in Eq. (10.87). Hence, G'{jco) = e-i<°TG{jto) = \G(jco)\Z{-coT+ ZG(jco)}
(10.88)
In other words, the time delay does not affect the magnitude frequency response curve of G(jco), but it does subtract a linearly increasing phase shift, coT, from the phase frequency response plot of Gijco). The typical effect of adding time delay can be seen in Figure 10.54. Assume that the gain and phase margins as well as the gain- and phase-margin frequencies shown in the figure apply to the system without delay. From the figure, we see that the reduction in phase shift caused by the delay reduces the phase margin. Using a second-order approximation, this reduction in phase margin yields a reduced damping ratio for the closed-loop system and a more oscillatory response. The reduction of phase also leads to a reduced gain-margin frequency. From the magnitude curve, we can see that a reduced gain-margin frequency leads to reduced gain margin, thus moving the system closer to instability. An example of plotting frequency response curves for systems with delay follows.
Example 10.15 Frequency Response Plots of a System with Time Delay PROBLEM: Plot the frequency response for the system G{s) = K/[s(s + l)(s + 10)] if there is a time delay of 1 second through the system. Use the Bode plots. SOLUTION: Since the magnitude curve is not affected by the delay, it can be plotted by the methods previously covered in the chapter and is shown in Figure 10.55(a) for # = 1. The phase plot, however, is affected by the delay. Figure 10.55(6) shows the result. First draw the phase plot for the delay, e~,u>T = 1 Z - coT = 1 Z - co, since T — 1 from the problem statement. Next draw the phase plot of the system, G(jco),
10.12 Systems with Time Delay
599
0 -20 ^0 -60 «n 0.01
0.1
10
Frequency (rad/s) (a) 0
Time delaj
111
-200 ^00
'^otal -600
\
-800
0.01
10
0.1
Frequency (rad/s)
FIGURE 10.55 Frequency response plots for G(s) = K/[s(s + l)(s + 10)] with a delay of 1 second and K — 1: a. magnitude plot; b. phase plot
using the methods previously covered. Finally, add the two phase curves together to obtain the total phase response for e~i0>1G(jco). Be sure to use consistent units for the phase angles of G(Ja>) and the delay; either degrees or radians. Notice that the delay yields a decreased phase margin, since at any frequency the phase angle is more negative. Using a second-order approximation, this decrease in phase margin implies a lower damping ratio and a more oscillatory response for the closed-loop system. Further, there is a decrease in the gain-margin frequency. On the magnitude curve, note that a reduction in the gain-margin frequency shows up as reduced gain margin, thus moving the system closer to instability. Students who are using MATLAB should now run chl0p7 in Appendix B. You will learn how to use MATLAB to include time delay on Bode plots . You will also use MATLAB to make multiple plots on one graph and label the plots . This exercise solves Example 10.15 using MATLAB.
Let us now use the results of Example 10.15 to design stability and analyze transient response and compare the results to the system without time delay.
Example 10.16 Range of Gain for Stability for System with Time Delay PROBLEM: The open-loop system with time delay in Example 10.15 is used in a unity feedback configuration. Do the following: a. Find the range of gain, K, to yield stability. Use Bode plots and frequency response techniques. b. Repeat Part a for the system without time delay.
MATLAB
Chapter 10
Frequency Response Techniques
SOLUTION:
a. From Figure 10.55, the phase angle is -180° at a frequency of 0.81 rad/s for the system with time delay, marked "Total" on the phase plot. At this frequency, the magnitude curve is at -20.39 dB. Thus, K can be raised from its current value of unity to I0 2a39/20 = 10.46. Hence, the system is stable for 0 < K < 10.46. b. If we use the phase curve without delay, marked "System," —180° occurs at a frequency of 3.16 rad/s, and K can be raised 40.84 dB or 110.2. Thus, without delay the system is stable for 0 < K < 110.2, an order of magnitude larger.
Percent Overshoot for System with Time Delay PROBLEM: The open-loop system with time delay in Example 10.15 is used in a unity feedback configuration. Do the following: a. Estimate the percent overshoot if K = 5. Use Bode plots and frequency response techniques. b. Repeat Part a for the system without time delay. SOLUTION: a. Since K = 5, the magnitude curve of Figure 10.55 is raised by 13.98 dB. The zero dB crossing then occurs at a frequency of 0.47 rad/s with a phase angle of —145°, as seen from the phase plot marked "Total." Therefore, the phase margin is (-145° — (—180°)) = 35°. Assuming a second-order approximation and using Eq. (10.73) or Figure 10.48, we find £ = 0.33. From Eq. (4.38), %OS = 33%. The time response, Figure 10.56(a), shows a 38% overshoot instead of the predicted 33%. Notice the time delay at the start of the curve. b. The zero dB crossing occurs at a frequency of 0.47 rad/s with a phase angle of -118°, as seen from the phase plot marked "System." Therefore, the phase
1.4
1.2 1.0 8 0.8 0.6 0.4 FIGURE 10.56 Stepresponse for closed-loop system with G(s) =5/[s(s +1)(5 +10)]: a. with a 1-second delay; (figure continues)
o 15 20 Time (seconds)
10.12 Systems with Time Delay
601
•
1.2 ^
1.0
-
•
—
—
/
0.6 0.4
-
X
0.8 *
^
-
/
0.2 /
0
(
i
i
2
4
i
6 Time (seconds) (b)
i
i
8
10
,
FIGURE 10.56
(Continued)
b. without delay
margin is (-118° - (-180°)) = 62°. Assuming a second-order approximation and using Eq. (10.73) or Figure 10.48, we find f = 0.64. From Eq. (4.38), %OS = 7.3%. The time response is shown in Figure 10.56(6). Notice that the system without delay has less overshoot and a smaller settling time.
M
[ Skill-Assessment Exercise 10.11 J
PROBLEM: For the system shown in Figure 10.10, where
G(s)~ G{S}
10
s(s + l)
find the phase margin if there is a delay in the forward path of a. 0 s b. 0.1 s c. 3 s ANSWERS: a. 18.0° b. 0.35° c. -151.41° The complete solution is at www.wiley.com/college/nise.
WileyPLUS
Trylt 10.6 Use MATLAB, the Control
Control Solutions
System Toolbox, and the following statements to solve SkillAssessment Exercise 10.11. For each part of the problem let d = the specified delay. G=zpk([] , [ 0 , - 1 ] , 1 0 ) d=0 [numGd,denGd]=pade. . . (d,12) Gd=tf(numGd,denGd) Ge=G*Gd bode(Ge) g r i d on After the Bode diagrams appear: 1. Right-click in the graph area. 2. Select Characteristics. 3. Select AH Stability Margins. 4. Let the mouse rest on the margin point on the phase plot to read the phase margin.
602
Chapter 10
Frequency Response Techniques
In summary, then, systems with time delay can be handled using previously described frequency response techniques if the phase response is adjusted to reflect the time delay. Typically, time delay reduces gain and phase margins, resulting in increased percent overshoot or instability in the closed-loop response.
^ 10.13 Obtaining Transfer Functions Experimentally In Chapter 4, we discussed how to obtain the transfer function of a system through step-response testing. In this section, we show how to obtain the transfer function using sinusoidal frequency response data. The analytical determination of a system's transfer function can be difficult. Individual component values may not be known, or the internal configuration of the system may not be accessible. In such cases, the frequency response of the system, from input to output, can be obtained experimentally and used to determine the transfer function. To obtain a frequency response plot experimentally, we use a sinusoidal force or signal generator at the input to the system and measure the output steady-state sinusoid amplitude and phase angle (see Figure 10.2). Repeating this process at a number of frequencies yields data for a frequency response plot. Referring to Figure 10.2(6), the amplitude response is M(co) = M0(a>)/Mj(
10.13 Obtaining Transfer Functions Experimentally
Example 10.18 Transfer Function from Bode Plots PROBLEM: Find the transfer function of the subsystem whose Bode plots are shown in Figure 10.57.
^ oo °
-50
-100
10
100
1000
100
1000
Frequency (rad/s)
_
-50
\
I -100 I -150 a -2oo
V
CM -250 -300
I
10
Frequency (rad/s)
FIGURE 10.57 Bode plots for subsystem with undetermined transfer function
SOLUTION: Let us first extract the underdamped poles that we suspect, based on the peaking in the magnitude curve. We estimate the natural frequency to be near the peak frequency, or approximately 5 rad/s. From Figure 10.57, we see a peak of about 6.5 dB, which translates into a damping ratio of about £ = 0.24 using Eq. (10.52). The unity gain second-order function is thus Gi(s) = a%/(s2 + 2t;cons + afy = 25/(5 2 + 2.4s + 25). The frequency response plot of this function is made and subtracted from the previous Bode plots to yield the response in Figure 10.58.
Overlaying a -20dB/decade line on the magnitude response and a —45°/decade line on the phase response, we detect a final pole. From the phase response, we estimate the break frequency at 90 rad/s. Subtracting the response of G2(s) = 90/(5 + 90) from the previous response yields the response in Figure 10.59. Figure 10.59 has a magnitude and phase curve similar to that generated by a lag function. We draw a - 2 0 dB/decade line and fit it to the curves. The break frequencies are read from the figure as 9 and 30 rad/s. A unity gain transfer function containing a pole at - 9 and a zero at - 3 0 is G%(s) = 0.3(5 + 30)/(5 + 9). Upon subtraction of G\(s)Gi(s)G3(s), we find the magnitude frequency response flat ±1 dB and the phase response flat at —3° ± 5°. We thus conclude that we are finished extracting dynamic transfer functions. The low-frequency, or dc, value of the original curve is - 1 9 dB, or 0.11. Our estimate of the subsystem's transfer function
603
604
Chapter 10
Frequency Response Techniques
-20 -25 -30 -35 ^0 ^15 -50 10
100
1000
Frequency (rad/s)
-20
^
^to -60 cu -80
-100 1 FIGURE 10.58
1000
10
100 Frequency (rad/s) Original Bode plots minus response of Gi(s) = 25/(s2 + 2.4s + 25)
is G(s) = 0.11Gi{s)G2(s)G3(s), or 25 5 + 30 1 0.3 905+ 9 s + 2.4s + 25j\ s + 90 5 + 30 = 74.25 (5 + 9)(^ + 90)(^2 + 2.4* + 25)
G(s) = 0.11
-18 -20 -22 -24 -26 -28 -30 -32
2
\
(10.89)
s v
\ \
10
1000
100 Frequency (rad/s)
^.----
-5 -
I -lo % D
\t — ID
«• a
-20
£
-25
^ \
^
\
'
/ /
-30
-35 1 FIGURE 10.59 [90/(5 + 90)]
10
100 1000 Frequency (rad/s) Original Bode plot minus response of Gx(s)G2{s) = [25/(s2 + 2.4s + 25)]
10.13 Obtaining Transfer Functions Experimentally
605
It is interesting to note that the original curve was obtained from the function 5 + 20 G{s) = 70 (5 + 7)(5 + 70)(5 2 + 2s + 25)
(10.90) MATLAB
Students who are usingMATLAB should now run chl0p8 in Appendix B. You will learn how to use MATLAB to subtract Bode plots for the purpose of estimating transfer functions through sinusoidal testing. This exercise solves a portion of Example 10.18 usingMATLAB.
Skill-Assessment Exercise 10.12 PROBLEM: Estimate G(s), whose Bode log-magnitude and phase plots are shown in Figure 10.60. ANSWER: G(s) =
30(5 + 5)
s(s + 20)
The complete solution is at www.wiley.com/college/nise.
10 0 69
10 20 30 10
100
1000
Frequency (rad/s) -45 -50 _ -55 8" -60 | -65 3 -70 1 -75
y
\
^
TO
£
N
U*
-80 -85 -90 -95
----^^
1
10
100
1000
Frequency (rad/s) FIGURE 10.60 Bode plots for Skill-Assessment Exercise 10.12
In this chapter, we derived the relationships between time response performance and the frequency responses of the open- and closed-loop systems. The methods derived, although yielding a different perspective, are simply alternatives to the root locus and steady-state error analyses previously covered.
606
Chapter 10
Frequency Response Techniques
Case Study Antenna Control: Stability Design and Transient Performance Design
Our ongoing antenna position control system serves now as an example that summarizes the major objectives of the chapter. The case study demonstrates the use of frequency response methods to find the range of gain for stability and to design a value of gain to meet a percent overshoot requirement for the closed-loop step response. PROBLEM: Given the antenna azimuth position control system shown on the front endpapers, Configuration 1, use frequency response techniques to find the following: a. b. e. d. e.
The range of preamplifier gain, K, required for stability Percent overshoot if the preamplifier gain is set to 30 The estimated settling time The estimated peak time The estimated rise time
SOLUTION: Using the block diagram (Configuration 1) shown on the front endpapers and performing block diagram reduction yields the loop gain, G(s)H(s), as G(s)H(s) =
6.63K ^ + 1.71)(5 + 100)
0.0388tf §(*+A(*Z+i)
(10.91)
1.71 AlOO ) Letting K — 1, we have the magnitude and phase frequency response plots shown in Figure 10.61.
-20 -40 -60 -80 -100 -120 -140 -160 0.1
FIGURE 10.61 Open-loop frequency response plots for the antenna control system
10 Frequency (rad/s)
100
1000
10 Frequency (rad/s)
100
1000
-100 -120 -140 -160 -180 -200 -220 -240 -260 -280 0.1
Summary
607
a. In order to find the range of K for stability, we notice from Figure 10.61 that the phase response is -180° at co = 13.1 rad/s. At this frequency, the magnitude plot is -68.41 dB. The gain, K, can be raised by 68.41 dB. Thus, K = 2633 will cause the system to be marginally stable. Hence, the system is stable if 0 < K < 2633. b. To find the percent overshoot if K = 30, we first make a second-order approximation and assume that the second-order transient response equations relating percent overshoot, damping ratio, and phase margin are true for this system. In other words, we assume that Eq. (10.73), which relates damping ratio to phase margin, is valid. If K — 30, the magnitude curve of Figure 10.61 is moved up by 20 log 30 = 29.54 dB. Therefore, the adjusted magnitude curve goes through zero dB at co = 1. At this frequency, the phase angle is -120.9°, yielding a phase margin of 59.1°. Using Eq. (10.73) or Figure 10.48, f = 0.6, or 9.48% overshoot. A computer simulation shows 10%. c. To estimate the settling time, we make a second-order approximation and use Eq. (10.55). Since K = 30 (29.54 dB), the open-loop magnitude response is —7 dB when the normalized magnitude response of Figure 10.61 is -36.54 dB. Thus, the estimated bandwidth is 1.8 rad/s. Using Eq. (10.55), Ts = 4.25 seconds. A computer simulation shows a settling time of about 4.4 seconds. d. Using the estimated bandwidth found in c. along with Eq. (10.56), and the damping ratio found in a. we estimate the peak time to be 2.5 seconds. A computer simulation shows a peak time of 2.8 seconds. e. To estimate the rise time, we use Figure 4.16 and find that the normalized rise time for a damping ratio of 0.6 is 1.854. Using Eq. (10.54), the estimated bandwidth found in c, and £ = 0.6, we find con = 1.57. Using the normalized rise time and con, we find TT — 1.854/1.57 = 1.18 seconds. A simulation shows a rise time of 1.2 seconds. CHALLENGE: You are now given a problem to test your knowledge of this chapter's objectives. You are given the antenna azimuth position control system shown on the front endpapers, Configuration 3. Record the block diagram parameters in the table shown on the front endpapers for Configuration 3 for use in subsequent case study challenge problems. Using frequency response methods, do the following: a. Find the range of gain for stability. b. Find the percent overshoot for a step input if the gain, K, equals 3. C R e p e a t P a r t s a . a n d b . u s i n g MATLAB.
£ Summary^ Frequency response methods are an alternative to the root locus for analyzing and designing feedback control systems. Frequency response techniques can be used more effectively than transient response to model physical systems in the laboratory. On the other hand, the root locus is more directly related to the time response. The input to a physical system can be sinusoidally varying with known frequency, amplitude, and phase angle. The system's output, which is also sinusoidal
MATLAB
flTTB
Chapter 10
Frequency Response Techniques
in the steady state, can then be measured for amplitude and phase angle at different frequencies. From this data the magnitude frequency response of the system, which is the ratio of the output amplitude to the input amplitude, can be plotted and used in place of an analytically obtained magnitude frequency response. Similarly, we can obtain the phase response by finding the difference between the output phase angle and the input phase angle at different frequencies. The frequency response of a system can be represented either as a polar plot or as separate magnitude and phase diagrams. As a polar plot, the magnitude response is the length of a vector drawn from the origin to a point on the curve, whereas the phase response is the angle of that vector. In the polar plot, frequency is implicit and is represented by each point on the polar curve. The polar plot of G(s)H(s) is known as a Nyquist diagram. Separate magnitude and phase diagrams, sometimes referred to as Bode plots, present the data with frequency explicitly enumerated along the abscissa. The magnitude curve can be a plot of log-magnitude versus log-frequency. The other graph is a plot of phase angle versus log-frequency. An advantage of Bode plots over the Nyquist diagram is that they can easily be drawn using asymptotic approximations to the actual curve. The Nyquist criterion sets forth the theoretical foundation from which the frequency response can be used to determine a system's stability. Using the Nyquist criterion and Nyquist diagram, or the Nyquist criterion and Bode plots, we can determine a system's stability. Frequency response methods give us not only stability information but also transient response information. By defining such frequency response quantities as gain margin and phase margin, the transient response can be analyzed or designed. Gain margin is the amount that the gain of a system can be increased before instability occurs if the phase angle is constant at 180°. Phase margin is the amount that the phase angle can be changed before instability occurs if the gain is held at unity. While the open-loop frequency response leads to the results for stability and transient response just described, other design tools relate the closed-loop frequency response peak and bandwidth to the transient response. Since the closed-loop response is not as easy to obtain as the open-loop response because of the unavailability of the closed-loop poles, we use graphical aids in order to obtain the closed-loop frequency response from the open-loop frequency response. These graphical aids are the M and N circles and the Nichols chart. By superimposing the open-loop frequency response over the M and N circles or the Nichols chart, we are able to obtain the closed-loop frequency response and then analyze and design for transient response. Today, with the availability of computers and appropriate software, frequency response plots can be obtained without relying on the graphical techniques described in this chapter. The program used for the root locus calculations and described in Appendix H.2 is one such program. MATLAB is another. We concluded the chapter discussion by showing how to obtain a reasonable estimate of a transfer function using its frequency response, which can be obtained experimentally. Obtaining transfer functions this way yields more accuracy than transient response testing. This chapter primarily has examined analysis of feedback control systems via frequency response techniques. We developed the relationships between frequency response and both stability and transient response. In the next chapter, we apply the concepts to the design of feedback control systems, using the Bode plots.
Review Questions
£ Review Questions J | 1. Name four advantages of frequency response techniques over the root locus. 2. Define frequency response as applied to a physical system. 3. Name two ways to plot the frequency response. 4. Briefly describe how to obtain the frequency response analytically. 5. Define Bode plots. 6. Each pole of a system contributes how much of a slope to the Bode magnitude plot? 7. A system with only four poles and no zeros would exhibit what value of slope at high frequencies in a Bode magnitude plot? 8. A system with four poles and two zeros would exhibit what value of slope at high frequencies in a Bode magnitude plot? 9. Describe the asymptotic phase response of a system with a single pole at - 2 . 10. What is the major difference between Bode magnitude plots for first-order systems and for second-order systems? 11. For a system with three poles at - 4 , what is the maximum difference between the asymptotic approximation and the actual magnitude response? 12. Briefly state the Nyquist criterion. 13. What does the Nyquist criterion tell us? 14. What is a Nyquist diagram? 15. Why is the Nyquist criterion called a frequency response method? 16. When sketching a Nyquist diagram, what must be done with open-loop poles on the imaginary axis? 17. What simplification to the Nyquist criterion can we usually make for systems that are open-loop stable? 18. What simplification to the Nyquist criterion can we usually make for systems that are open-loop unstable? 19. Define gain margin. 20. Define phase margin. 21. Name two different frequency response characteristics that can be used to determine a system's transient response. 22. Name three different methods of finding the closed-loop frequency response from the open-loop transfer function. 23. Briefly explain how to find the static error constant from the Bode magnitude plot. 24. Describe the change in the open-loop frequency response magnitude plot if time delay is added to the plant. 25. If the phase response of a pure time delay were plotted on a linear phase versus linear frequency plot, what would be the shape of the curve? 26. When successively extracting component transfer functions from experimental frequency response data, how do you know when you are finished?
609
610
Chapter 10
Frequency Response Techniques
Problems 1. Find analytical expressions for the magnitude and phase response for each G(s) below. [Section: 10.1] a. G(s) =
WileyPLUS
* ( S ) + / C * E(s) Control Solutions
*w *
l
50 s(s + 3)(s + 6)
System 1
s(s + 2){s + 4)
50
b. G(s) =
(s + 2){s + 4) (5 + 3)(5 + 5) c. G(s) = s(s + 2){s + 4)
C(s)
J2C?+1)
.
(s + 4)
2. For each function in Problem 1, make a plot of the log-magnitude and the phase, using log-frequency in rad/s as the ordinate. Do not use asymptotic approximations. [Section: 10.1] 3. For each function in Problem 1, make a polar plot of the frequency response. [Section: 10.1] 4. For each function in Problem 1, sketch the Bode asymptotic magnitude and asymptotic phase plots. Compare your results with your answers to Problem 1. [Section: 10.2] 5. Sketch the Nyquist diagram for each of the systems in Figure P10.1. [Section: 10.4] WileyPLUS 6. Draw the polar plot from the separate CUE! magnitude and phase curves shown in Control Solutions Figure P10.2. [Section: 10.1]
System 2
m±£?)
20 s(s+ 1)
(* + 3) (s + 4) System 3 R(s)+/<^
—r
E(s)
100(5 + 5) it?+ 3)(5-2+ 4)
System 4 FIGURE P10.1
1° -20 o -30
0.1
10
100
10
100
Frequency (rad/s)
-50 100 150
1 Frequency (rad/s)
FIGURE PI 0.2
C(s)
1
-10
0.1
C(s)
C(s)
Problems
7. Draw the separate magnitude and phase curves from the polar plot shown in Figure P10.3. [Section: 10.1] 8
*(')+ /Ov
.
—,
x 10-3 i
i
i
i
611
K(s2-4s+U) (s + 2)(s + 4)
C(.s)
i
§
-
4
-
1 s
System 2 R(s) + 2
-
—,,
10
0
7
6
-2
GM
AGN
(s-2)
S
is +¾
/ / -
5
System 3 FIGURE P10.4
-4
A /a)=l
-6
-
3s 2
-A
(Continued)
-
-2
8
2 4 Real axis
10 xlO'*
11. For each system of Problem 10, find the gain margin and phase margin if the value of K in each part of Problem 10 is [Section: 10.6]
WileyPLUS
dp Control Solutions
a. # = 1000 b. K = 100
FIGURE P10.3
c. # = 0.1 8. Write a program in MATLAB that JJ^iL will do the following: VlillP a. Plot the Nyquist diagram of a system b. Display the real-axis crossing value and frequency Apply your program to a unity feedback system with G(s) =
(s2 + 6s + 100)(^2 + 4s + 25)
12. Write a program in MATLAB that will J^[iJL do the following: fl^IB a. Allow a value of gain, K, to be entered from the keyboard b. Display the Bode plots of a system for the entered value of K c. Calculate and display the gain and phase margin for the entered value of K
9. Using the Nyquist criterion, find out whether each Test your program on a unity feedback system of Problem 5 is stable. [Section: 10.3J system with G(s) = K/[s(s + 3)(s + 12)]. 10. Using the Nyquist criterion, find the range wileypms of K for stability for each of the systems in > V W 13. Use MATLAB's LTI Viewer to find JJ2L Figure P10.4. [Section: 10.3] control solutions the gain margin, phase margin, MfllJIM zero dB frequency, and 180° frequency for a unity feedback system with C(s)
*®+/ps -.
K
(5 + 2)
G(s) = 1 (s + 4)(.v + 6)
r*—
System 1 FIGURE P10.4 (figure continues)
8000 > + 6)(s + 20)(s + 35)
Use the following methods : a. The Nyquist diagram b. Bode plots
612
Chapter 10
Frequency Response Techniques
14. Derive Eq. (10.54), the closed-loop bandwidth in terms of £ and u>n of a two-pole system. [Section: 10.8] 15. For each closed-loop system with the following performance characteristics, find the closed-loop bandwidth: [Section: 10.8]
wileypius > V W control solutions
a. f = 0.2, Ts = 3 seconds
Test your program on the system of Figure P10.5 for K = 40.
p.
b. t = 0.2, Tp = 3 seconds
m ,Y "1
c. Ts = 4 seconds, Tp ~2 seconds d. C = 0-3, 7V = 4 seconds 16. Consider the unity feedback system of Figure 10.10. For each G(s) that follows, use the M and N circles to make a plot of the closed-loop frequency response: [Section: 10.9] 10 a. G{s) = 5(5 + 1)(5 + 2) 1000 b. G(s) = (^ + 3)(5 + 4)(5 + 5)(5 + 6) 50(5 + 3) c. G(s) = 5(5 + 2)(5 + 4)
c. Calculate and display the peak magnitude, frequency of the peak magnitude, and bandwidth for the closedloop frequency response and the entered value of K
K(s + 5) s(s2 + 4s + 25)
C(s)
FIGURE P10.5 wileypms 6139 Contro1 QuiTo0' solutions 21. Use MATLAB' s LTI Viewer with the Nichols plot to find the WilljP gain margin, phase margin, zero dB frequency, and 180° frequency for a unity feedback system with the forward-path transfer function
17. Repeat Problem 16, using the Nichols chart in place of the M and N circles. [Section: 10.9] 18. Using the results of Problem 16, estimate the percent overshoot that can be expected in the step response for each system shown. [Section: 10.10] 19. Use the results of Problem 17 to estimate the percent overshoot if the gain term in the numerator of the forward path of each part of the problem is respectively changed as follows: [Section: 10.10] a. From 10 to 30 b. From 1000 to 2500 c. From 50 to 75 20. Write a program in MATLAB that will JjJJlJL do the following: ViJ^P a. Allow a value of gain, K, to be entered from the keyboard b. Display the closed-loop magnitude and phase frequency response plots of a unity feedback system with an openloop transfer function, KG(s)
G(s) =
5(s+6) s(s2 + 4s + 15)
22. Write a program in MATLAB that will MATLAB do the following: ViJ^P a. Make a Nichols plot of an open-loop transfer function b. Allow the user to read the Nichols plot display and enter the value of Mp c. Make closed-loop magnitude and phase plots d. Display the expected values of percent overshoot, settling time, and peak time e. Plot the closed-loop step response Test your program on a unity feedback system with the forward-path transfer function G(s) =
5(s + e) s(sz + 4s + 15)
and explain any discrepancies. 23. Using Bode plots, estimate the transient response of the systems in Figure P10.6. [Section: 10.10]
613
Problems R
W + f?\
lOOC.v + 2 ) s(s+l)(s + 4)
-.
C(s)
a. Find the gain margin, phase margin, zero dB frequency, 180° frequency, and the closed-loop bandwidth. b. Use your results in Part a to estimate the damping ratio, percent overshoot, settling time, and peak time.
System 1 R(s) + (CXEif)
—.
50(5 + 3)(s + 5) s{s + 2)(s + 4)(s + 6)
C(*)
26. Write a program in MATLAB that will use an open-loop transfer function, G(s) , to do the following:
System 2
FIGURE P10.6 24. For the system of Figure P10.5, do the following: [Section: 10.10] a. Plot the Bode magnitude and phase plots. b. Assuming a second-order approximation, estimate the transient response of the system if K = 40. MATLAB or any other program e, Use to check your assumptions by sim-
MATLAB
a. Make a Bode plot b. Use frequency response methods to estimate the percent overshoot, settling time, and peak time c. Plot the closed-loop step response Test your program by comparing the results to those obtained for the systems of Problem 23.
27. The open-loop frequency response shown in Figure P10.8 was experimentally obtained from a unity W'leyPLUs feedback system. Estimate the percent overshoot and steady-state error of the closed-loop system. control solutions [Sections: 10.10, 10.11]
ulating the step response of the system.
25. The Bode plots for a plant, G(s), used in a unity feedback system are shown in Figure P10.7. Do the following:
40 20 0 00
0
-20
^\^
-40 -60 -80 -100 C.1
1
10
100
10
100
Frequency (rad/s) -50 M
-100
a
-150
3 1
MATLAB fluI^B
-200
-C
a. -250 -300 0.1 Frequency (rad/s) FIGURE P10.7
Chapter 10
614
Frequency Response Techniques
40 20 §
0
J 3 -20 ° -40 -60 -80 0.01
10
'100
10
100
1 Frequency (rad/s)
0.1
-80 -100 -120
? -140
\
8 -160 on f -180 | -200
\, \ v
K -220
>
-240
-260 0.01 -280
0.1
1 Frequency (rad/s) FIGURE P10.8
28. Consider the system in Figure P10.9. [Section: 10.12] *(*)+/<
-
r
Delay
100 (s + 5)(5 + 10)
cm
and a delay of 0.5 second, find the range of gain, K, to yield stability. Use Bode plots and frequency response techniques. [Section: 10.12] 30. Given a unity feedback system with the forwardpath transfer function
FIGURE P10.9
a. Find time b. Find each
the phase margin if the system is stable for delays of 0, 0.1, 0.2, 0.5, and 1 second. the gain margin if the system is stable for of the time delays given in Part a.
c. For what time delays mentioned in Part a is the system stable? d. For each time delay that makes the system unstable, how much reduction in gain is required for the system to be stable? 29. Given a unity feedback system with the forward-path transfer function
wHeyPtus Control Solutions
U
(5+1)(5 + 3)(5 + 6)
G{s) =
K ^(5 + 3)(5 + 12)
and a delay of 0.5 second, make a second-order approximation and estimate the percent overshoot if K = 40. Use Bode plots and frequency response techniques. [Section: 10.12] 31 Use t h e MATLAB f u n c t i o n p a d e (T, n) MATLAB to model t h e d e l a y in Problem 30. ^ES^to O b t a i n t h e u n i t s t e p r e s p o n s e and e v a l u a t e your s e c o n d - o r d e r a p p r o x i m a t i o n i n Problem 3 0 . 32. For the Bode plots shown in Figure PIO.IO, determine the transfer function by hand or via MATLAB. [Section: 10.13]
Problems
615
60 40 20 0 -20 -40 60 0.01
1 Frequency (rad/s)
10
100
10
100
-100 §
-120 -140
i--
-160 -U 0.01
0.1
1 Frequency (rad/s) FIGURE P10.10
33. Repeat Problem 32 for the Bode plots shown in Figure P10.ll. [Section: 10.13] 34. An overhead crane consists of a horizontally moving trolley of mass mr dragging a load of
mass mc, which dangles from its bottom surface at the end of a rope of fixed length, L. The position of the trolley is controlled in the feedback configuration shown in Figure 10.20. Here,
/'
10 5 0 -5 10 15
S 10
0.1
Frequency (rad/s) 50
\
V
-50 -100 -150 -200 0.1
100 Frequency (rad/s) FIGURE P10.11
616
Chapter 10
G(s)
Frequency Response Techniques
KP{s),H = l,and
a. M(s) = -K 200)
b.M(s) = -K{S s + 1000 c. Compare your results with those obtained in The input is fj{t), the input force applied to the Problem 49, Chapter 8. trolley. The output is Xj{t), the trolley displacement. 38. The simplified and linearized model for the transfer function of a certain bicycle from steer angle (5) to Also, coo = \IY aQ d a = (mL mj)jm.T (Marttinen, roll angle (cp) is given by (Astrom, 2005) 1990) Make a qualitative Bode plot of the system
1 rriT s2 (s2 + acol)
m =m
m=
36. The open-loop dynamics from dc voltage armature to angular position of a robotic manipulator joint is given by P(s) = / ^ ° ^ (Low, 2005). a. Draw by hand a Bode plot using asymptotic approximations for magnitude and phase. b. Use MATLAB to plot the exact Bode plot and compare with your sketch from Part a.
JJ^iJL CJ^JP
37. Problem 49, Chapter 8 discusses a magnetic levitation system with a plant transfer function P(s) = ~ (Galvao, 2003). Assume that the plant is F s2 -860 2 in cascade with an M(s) and that the system will be controlled by the loop shown in Figure 10.20, where G(s) = M(s)P(s) and H = 1. For each M(s) that follows, draw the Nyquist diagram when K = 1, and find the range of closed-loop stability for #>0.
M{s) =
5(5 + 0.27)
and in the closed-loop configuration shown in Figure 10.20, where G(s) = M(s)P(s) and H = 1. Do the following: a. Draw the open-loop frequency response in a Nichols chart. b. Predict the system's response to a unit step input. Calculate the %OS, cfinal, and Ts. c. Verify the results of Part b MATLAB u s i n g MATLAB s i m u l a t i o n s .
4E39
40. The Soft Arm, used to feed people with disabilities, was discussed in Problem 57 in Chapter 6. Assuming the system block diagram shown in Figure P10.12, use frequency response techniques to determine the following (Kara, 1992): a. Gain margin, phase margin, zero dB frequency, and 180° frequency b. Is the system stable? Why?
Problems Desired spoon position His) +
Controller ~*l
.
1000(5 + 0.01)(5 + 6) 5(5 + 20)(5+100)
FIGURE P10.12 Desired position
i
Robot arm — » •
617 Actual spoon C(.v)
10 s 2 +105 + 29
Soft Arm position control system block diagram
Controller
Motor and load
100,000 (5 + 500)(5 + 800)
20,000 5(5+100)
Actual position Xds)
FIGURE P10.13 Floppy disk drive block diagram
41. A floppy disk drive was discussed in wileypms Problem 57 in Chapter 8. Assuming d E J the system block diagram shown in control solutions Figure P10.13, use frequency response techniques to determine the following: a. Gain margin, phase margin, zero dB frequency, 180° frequency, and closed-loop bandwidth b. Percent overshoot, settling time, and peak time c. Use MATLAB to simulate the MATLAB closed-loop step response ^Km^P and compare the results to those obtained in Part b.
42. Industrial robots, such as that shown in Figure P10.14, require accurate models for design of high performance. Many transfer function models for industrial robots assume interconnected rigid bodies with the drive-torque source modeled as a pure gain, or first-order system. Since the motions associated with the robot are connected to the drives through flexible linkages rather than rigid linkages, past modeling does not explain the resonances observed. An accurate, small-motion, linearized model has been developed that takes into consideration the flexible drive. The transfer function
FIGURE P10.14 Robot performing construction of computer memory units I £) Michael Rosenfield/Science Faction/ © Corbis).
43. The charge-coupled device (CCD) that is used in video movie cameras to convert images into elec2 2 trical signals can be used as part of an automatic (s + 8.94^ + 44.7 ; G(s) = 999.12 2 focusing system in cameras. Automatic focusing can [s + 20.7)(^ + 34.8585 + 60.1' be implemented by focusing the center of the image relates the angular velocity of the robot base to on a charge-coupled device array through two electrical current commands (Good, 1985). Make a lenses. The separation of the two images on the Bode plot of the frequency response and identify CCD is related to the focus. The camera senses the the resonant frequencies. separation, and a computer drives the lens and
618
Chapter 10
Frequency Response Techniques
(«) Desired lens position+
Actual ^
Computer and CCD system
-
—*-
Amplifier
—*•
Motor and load
position
(b)
m^K •X Eis) r
10 s(s + 2)(5 + 10)
C(s)
(c)
FIGURE P10.15 a. A cutaway view of a digital camera showing parts of the CCD automatic focusing system ( © Stephen Sweet/ iStockphoto); b. functional block diagram; c. block diagram
focuses the image. The automatic focus system is a position control, where the desired position of the lens is an input selected by pointing the camera at the subject. The output is the actual position of the lens. The camera in Figure PI0.15(a) uses a CCD automatic focusing system. Figure P10.15(b) shows the automatic focusing feature represented as a position control system. Assuming the simplified model shown in Figure P10.15(c), draw the Bode
Desired
Roll
angle, 6d{s) + s~•^ error. 9,.(s)
9 FIGURE PI 0.16
Ship roll dynamics
Fin actuator
Transducer 5
plots and estimate the percent overshoot for a step input. 44. A ship's roll can be stabilized with a control system. A voltage applied to the fins' actuators creates a roll torque that is applied to the ship. The ship, in response to the roll torque, yields a roll angle. Assuming the block diagram for the roll control system shown in Figure P10.16, determine the gain and phase margins for the system.
Voltage
0.5 s+4
Torque
9 s2 + 0.9s + 9
Block diagram of a ship's roll-stabilizing system
Actual roll angle, 6>,(.s)
Problems
45. The linearized model of a particular network link working under TCP/IP and controlled using a random early detection (RED) algorithm can be described by Figure 10.20 where G(s) = M(s)P{s), H = 1, and (Hollot, 2001) .,, ,
0.005L
140625c-o.i? (5 + 2.67)(5+10)
a. Plot the Nichols chart for L = 1. Is the system closed-loop stable? b. Find the range of L for closed-loop stability. c. Use the Nichols chart to predict % OS and Ts for L = 0.95. Make a hand sketch of the expected unit step response. d. V e r i f y P a r t c w i t h a S i m u l i n k u n i t step response simulation.
Sjmulmk ^Ei^V
46. In the TCP/IP network link of Problem 45, let L — 0.8, but assume that the amount of delay is an unknown variable. a. Plot the Nyquist diagram of the system for zero delay, and obtain the phase margin. b. Find the maximum delay allowed for closed-loop stability. 47. Thermal flutter of the Hubble Space Telescope (HST) produces errors for the pointing control system. Thermal flutter of the solar arrays occurs when the spacecraft passes from sunlight to darkness and when the spacecraft is in daylight. In passing from daylight to darkness, an end-to-end bending oscillation of frequency f\ rad/s is experienced. Such oscillations interfere with the pointing control system of the HST. A filter with the transfer function Gf(s) =
619
the disk tilts, making information retrieval difficult. A system that compensates for the tilt has been developed. For this, a laser beam is focused on the disk surface and disk variations are measured through reflection. A mirror is in turn adjusted to align with the disk and makes information retrieval possible. The system can be represented by a unity feedback system in which a controller with transfer function Gc(s) =
78.575(5 + 436)2 (5 + 132)(5 + 8030)
and a plant P(s) =
1.163 x 108 53 + 962.552 + 5.958 x 1055 + 1.16 x 108
form an open loop transmission L(s) = Gc(s)P(s) (Kim, 2009). a. Use MATLAB to obtain the JiS^L. system' s Nyquist dia^j^^P gram. Find out if the system is stable. b. Find the system' s phase margin. c. Use the value of phase margin obtained in b. to calculate the expected system's overshoot to a step input. d. Simulate the system's response to a unit step input and verify the %OS calculated in c.
49. The design of cruise control systems in heavy vehicles such as big rigs is especially challenging due to the extreme variations in payload. A typical frequency response for the transfer function from fuel mass flow to vehicle speed is shown in Figure PI0.17.
1.96(52 + 5 + 0.25){s2 + 1,26s + 9.87) >2 + 0.015^ + 0.57)(^2 + 0.0835 + 17.2)
is proposed to be placed in cascade with the PID controller to reduce the bending (Wie, 1992). a. Obtain the frequency response of the filter and estimate the bending frequencies that will be reduced. b. Explain why this filter will reduce the bending oscillations if these oscillations are thought to be disturbances at the output of the control system. 48. An experimental holographic media storage system uses a flexible photopolymer disk. During rotation,
10-2 f(Hz) FIGURE P10.17
10°
UP
620
Chapter 10
Frequency Response Techniques
This response includes the dynamics of the engine, the gear box, the propulsion shaft, the differential, the drive shafts, the chassis, the payload, and tire dynamics. Assume that the system is controlled in a closed-loop, unity-feedback loop using a proportional compensator (van der Zalm, 2008). a. Make a plot of the Nyquist diagram that corresponds to the Bode plot of Figure P10.17. b. Assuming there are no open-loop poles in the right half-plane, find out if the system is closedloop stable when the proportional gain K — 1. C. Find the range of positive K for which the system is closed-loop stable. 50. Use LabVIEW w i t h t h e C o n t r o l ubviEW Design and S i m u l a t i o n Mod^K£flP u l e , and M a t h S c r i p t RT Module MATLAB and modify t h e CDEx N y q u i s t Analysis.vi to obtain the r a n g e of K f o r s t a b i l i t y u s i n g t h e N y q u i s t p l o t f o r any s y s t e m you e n t e r . I n a d d i t i o n , d e s i g n a LabVIEW VI t h a t w i l l a c c e p t a s an i n p u t t h e p o l y n o m i a l n u m e r a t o r and p o l y n o m i a l d e n o m i n a t o r of an o p e n - l o o p t r a n s f e r f u n c t i o n and o b t a i n a N y q u i s t p l o t f o r a v a l u e of K = 10, 000. Your VI w i l l a l s o display the following as generated from t h e N y q u i s t p l o t : (1) g a i n m a r g i n , (2) p h a s e m a r g i n , (3) z e r o dB f r e q u e n c y , and (4) 180 d e g r e e s f r e q u e n c y . Use t h e s y s t e m and r e s u l t s of S k i l l - A s s e s s m e n t E x e r c i s e 1 0 . 6 t o t e s t your V i s . 51. Use LabVIEW w i t h t h e C o n t r o l Jj^^ Design and S i m u l a t i o n Mod^K£^P M A u l e , and M a t h S c r i p t RT Module ^ t o b u i l d a VI t h a t w i l l a c c e p t W d V an o p e n - l o o p t r a n s f e r f u n c t i o n , p l o t t h e Bode d i a g r a m , and p l o t t h e c l o s e d - l o o p s t e p r e s p o n s e . Your VI w i l l a l s o u s e t h e CD P a r a m e t r i c Time Response . v i t o d i s p l a y (1) r i s e t i m e , (2) p e a k t i m e , (3) s e t t l i n g t i m e , (4) p e r c e n t o v e r s h o o t , (5) s t e a d y s t a t e v a l u e , and (6) p e a k v a l u e . Use t h e s y s t e m i n S k i l l - A s s e s s m e n t E x e r c i s e 10 . 9 t o t e s t y o u r V I . Compare t h e r e s u l t s o b t a i n e d from y o u r VI w i t h t h o s e o b t a i n e d i n Skill-Assessment Exercise 10.9. MATLAB 52. The b l o c k d i a g r a m of a c a s c a d e system used t o c o n t r o l water dUd^P l e v e l i n a s t e a m g e n e r a t o r of a n u c l e a r
power p l a n t {Wang, 2009) was p r e s e n t e d in Figure P . 6 . 1 9 . In t h a t system, the l e v e l c o n t r o l l e r , GLC (s) , i s t h e m a s t e r c o n t r o l l e r and t h e f e e d - w a t e r flow c o n t r o l l e r , GFC (s) , i s t h e s l a v e c o n t r o l l e r . Consider t h a t t h e inner feedback loop i s replacedby i t s equivalent t r a n s f e r funct i o n , Gm (s) . U s i n g n u m e r i c a l v a l u e s i n (Wang, 2009) and (Bhambhani, 2008) t h e t r a n s f e r f u n c t i o n s with a 1 second pure d e l a y a r e : Gfw(s) =
2 e 5(7i5+l)
Gwx(s) =
(45 + 1) 3(3.3335 + 1 ) '
GLC(s) =
KPLC
+
KDLCS
2-e 5(255 + 1 ) '
= 1.5(105 + 1 ) .
Use MATLAB o r any o t h e r p r o g r a m t o : a. O b t a i n Bode m a g n i t u d e and p h a s e p l o t s for t h i s system using a f i f t h - o r d e r Pade a p p r o x i m a t i o n ( a v a i l a b l e i n MATLAB) . N o t e on t h e s e p l o t s , i f a p p l i c a b l e , t h e g a i n and p h a s e m a r g i n s . b. P l o t t h e r e s p o n s e of t h e s y s t e m , c ( t ) , t o a u n i t s t e p i n p u t , r ( t ) = u ( t ) . Note on t h e c ( t ) c u r v e t h e r i s e t i m e , Tr, t h e s e t t l i n g t i m e , T s, t h e f i n a l v a l u e o f t h e o u t p u t , and, i f a p p l i c a b l e , t h e p e r c e n t o v e r s h o o t , %OS, and mid p e a k t i m e , Tp. c. R e p e a t t h e a b o v e two s t e p s f o r a p u r e d e l a y of 1.5 s e c o n d s . PROGRESSIVE ANALYSIS AND DESIGN PROBLEMS
53. High-speed rail pantograph. Problem 21 in Chapter 1 discusses active control of a pantograph mechanism for high-speed rail systems. In Problem79(a), Chapter 5, you found the block diagram for the active pantograph control system. In Chapter 8, Problem 72, you designed the gain to yield a closed-loop step response with30% overshoot. A plot of the step response should have shown a settling time greater than 0.5 second as well as a high-frequency oscillation superimposed over the step response. In Chapter 9, Problem 55, we reduced the settling time to about 0.3 second, reduced the step response steady-state error to zero, and eliminated the high-frequency oscillations by using a notch filter (O'Connor, 1997). Using the equivalent forward transfer function found in Chapter 5 cascaded
Cyber Exploration Laboratory with the notch filter specified in Chapter 9, do the following using frequency response techniques: a. Plot the Bode plots for a total equivalent gain of 1 and find the gain margin, phase margin, and 180° frequency. b. Find the range of K for stability. c. Compare your answer to Part b with your answer to Problem 67, Chapter 6. Explain any differences. 54. Control of HIV/AIDS. The linearized model for an HIV/AIDS patient treated with RTIs was obtained in Chapter 6 as {Craig, 2004); Y(s) -520s - 10.3844 U\ {s) s* + 2.681752 + 0.11« + 0.0126
m=
a. Consider this plant in the feedback configuration in Figure 10.20 with G{s) = P{s) and H{s) = 1. Obtain the Nyquist diagram. Evaluate the system for closed-loop stability. b. Consider this plant in the feedback configuration in Figure 10.20 with G(s) = -P{s) and H(s) = 1. Obtain the Nyquist diagram. Evaluate the system for closed-loop stability. Obtain the gain and phase margins. 55. Hybrid vehicle. In Problem 8.74 MAOAB we used MATLAB to plot the S Q 9 root locus for the speed control of an HEV rearranged as a unityfeedback system, as shown in Figure P7.34 (Preitl, 2007). The plant and compensator were given by £(5+0.6) G(s) = [s+ 0.5858)(5+0.0163)
and we found that K — 0.78, resulted in a critically damped system. a. Use MATLAB or any other program to plot i. The Bode magnitude and phase plots for that system, and ii. The response of the system, c(t), to a step input, r(t) = 4 u(t) . Note on the c(t) curve the rise time, Tr, and settling time, Tsf as well as the final value of the output. b. Now add an integral gain to the controller, such that the plant and compensator transfer function becomes
G(s) =
K1(s + Zc)(s+ 0.6) s(s+ 0.5858)(5+0.0163;
K,
where ^=0.78 andZ c =—=-= 0.4 . Use MATLAB or any other program to do the following: i. Plot the Bode magnitude and phase plots for this case. ii. Obtain the response of the system to a step input, r(t) = 4 u(t). Plot c(t) and note on it the rise time, Tr, percent overshoot, %OS, peak time, Tp, and settling time, Ts. c. Does the response obtained in a. or b. resemble a second-order overdamped, critically damped, or underdamped response? Explain.
Cyber Exploration Laboratory Experiment 10.1 Objective To examine the relationships between open-loop frequency response and stability, open-loop frequency response and closed-loop transient response, and the effect of additional closed-loop poles and zeros upon the ability to predict closed-loop transient response Minimum Required Software Packages MATLAB, and the Control System Toolbox
Prelab 1. Sketch the Nyquist diagram for a unity negative feedback system with a forward is
transfer function of G(s) = —.
-^-.
the range of gain, K, for stability.
621
—-. From your Nyquist plot, determine
622
Chapter 10
Frequency Response Techniques
2. Find the phase margins required for second-order closed-loop step responses with the following percent overshoots: 5%, 10%, 20%, 30%. Lab 1. Using the SISO Design Tool, produce the following plots simultaneously for the system of Prelab 1: root locus, Nyquist diagram, and step response. Make plots for the following values of K: 50,100, the value for marginal stability found in Prelab 1, and a value above that found for marginal stability. Use the zoom tools when required to produce an illustrative plot. Finally, change the gain by grabbing and moving the closed-loop poles along the root locus and note the changes in the Nyquist diagram and step response. 2. Using the SISO Design Tool, produce Bode plots and closed-loop step responses for a unity negative feedback system with a forward transfer function of G(s) —
?- Produce these plots for each value of phase margin found
.9(.9 + 10)^
in Prelab 2. Adjust the gain to arrive at the desired phase margin by grabbing the Bode magnitude curve and moving it up or down. Observe the effects, if any, upon the Bode phase plot. For each case, record the value of gain and the location of the closed-loop poles. 3. Repeat Lab 2 for G(s) = 7^. S[S T tUJ
Postlab 1. Make a table showing calculated and actual values for the range of gain for stability as found in Prelab 1 and Lab 1. 2. Make a table from the data obtained in Lab 2 itemizing phase margin, percent overshoot, and the location of the closed-loop poles. 3. Make a table from the data obtained in Lab 3 itemizing phase margin, percent overshoot, and the location of the closed-loop poles. 4. For each Postlab task 1 to 3, explain any discrepancies between the actual values obtained and those expected.
Experiment 10.2 Objective To use LabVIEW and Nichols charts to determine the closed-loop time response performance. Minimum Required Software Packages LabVIEW, Control Design and Simulation Module, MathScript RT Module, and MATLAB Prelab 1. Assume a unity-feedback system with a forward-path transfer function, G(s) = -j-—FT- Use MATLAB or any method to determine gain and phase margins. In addition, find the percent overshoot, settling time, and peak time of the closed-loop step response. 2. Design a LabVIEW VI that will create a Nichols chart. Adjust the Nichols chart's scale to estimate gain and phase margins. Then, prompt the user to enter the values of
Bibliography gain and phase margin found from the Nichols chart. In response, your VI will produce the percent overshoot, settling time, and peak time of the closed-loop step response. Lab Run your VI for the system given in the Prelab. Test your VI with other systems of your choice. Postlab Compare the closed-loop performance calculated in the Prelab with those produced by your VI.
^ Bibliography ^ Astrom, K., Klein, R. E., and Lennartsson, A. Bicycle Dynamics and Control. IEEE Control System, August 2005, pp. 26-47. Bhambhani, V., and Chen, Yq. Experimental Study of Fractional Order Proportional Integral (FOPI) Controller for Water Level Control. 47th IEEE Conference on Decision and Control, 2008, pp. 1791-1796. Bittanti, S., Dell'Orto, E, DiCarlo, A., and Savaresi, S. M., Notch Filtering and Multirate Control for Radial Tracking in High Speed DVD-Players. IEEE Transactions on Consumer Electronics, vol. 48. 2002, pp. 56-62. Bode, H. W. Network Analysis and Feedback Amplifier Design. Van Nostrand, Princeton, NJ, 1945. Craig, I. K., Xia, X., and Venter, J. W. Introducing HIV/AIDS Education into the Electrical Engineering Curriculum at the University of Pretoria. IEEE Transactions on Education, vol. 47, no. 1, February 2004, pp. 65-73. Dorf, R. C. Modern Control Systems, 5th ed. Addison-Wesley, Reading, MA, 1989. Franklin, G., Powell, J. D., and Emami-Naeini, A. Feedback Control of Dynamic Systems, 2d ed. Addison-Wesley, Reading, MA, 1991. Galvao, R. K. H., Yoneyama, T , and de Araiijo, F M. U. A Simple Technique for Identifying a Linearized Model for a Didactic Magnetic Levitation System. IEEE Transactions on Education, vol. 46, no. 1, February 2003, pp. 22-25. Good, M. G , Sweet, L. M., and Strobel, K. L. Dynamic Models for Control System Design of Integrated Robot and Drive Systems. Journal of Dynamic Systems, Measurement, and Control, March 1985, pp. 53-59. Hollot, C. V , Misra, V , Towsley, D., and Gong, W A Control Theoretic Analysis of RED. Proceedings of IEEE INFOCOM, 2001, pp. 1510-1519. Hostetter, G. H., Savant, C. J., Jr., and Stefani, R. T. Design of Feedback Control Systems, 2d ed. Saunders College Publishing, New York, 1989. Kara, A., Kawamura, K., Bagchi, S., and El-Gamal, M. Reflex Control of a Robotic Aid System to Assist the Physically Disabled. IEEE Control Systems, June 1992, pp. 71-77. Kim, S.-H., Kim, J. H., Yang, J., Yang, H , Park, J.-Y, and Park, Y-P. Tilt Detection and Servo Control Method for the Holographic Data Storage System. Microsyst Technol, vol. 15,2009. pp. 1695-1700. Kuo, B. C. Automatic Control Systems, 5th ed. Prentice Hall, Upper Saddle River, NJ, 1987. Kuo. F F Network Analysis and Synthesis. Wiley, New York, 1966. Low, K. H., Wang, H., Liew, K. M., and Cai, Y. Modeling and Motion Control of Robotic Hand for Telemanipulation Application. International Journal of Software Engineering and Knowledge Engineering, vol. 15, 2005, pp. 147-152. Marttinen, A., Virkkunen, J., and Salminen, R. T Control Study with Pilot Crane. IEEE Transactions on Education, vol. 33, no. 3, August 1990, pp. 298-305.
623
Chapter 10
Frequency Response Techniques
Nilsson, J. W. Electric Circuits, 3d ed. Addison-Wesley, Reading, MA, 1990. Nyquist, H. Regeneration Theory. Bell Systems Technical Journal, January 1932, pp. 126-147. O'Connor, D. R , Eppinger, S. D., Seering, W. P., and Worrnly, D. N. Active Control of a HighSpeed Pantograph. Journal of Dynamic Systems, Measurements, and Control, vol. 119, March 1997, pp. 1-4. Ogata, K. Modern Control Engineering, 2d ed. Prentice Hall, Upper Saddle River, NJ, 1990. Preitl, Z., Bauer, P., and Bokor, J. A Simple Control Solution for Traction Motor Used in Hybrid Vehicles. Fourth International Symposium on Applied Computational Intelligence and Informatics. IEEE. 2007. Thomas, B., Soleimani-Mosheni, M., and Fahlen, P. Feed-forward in Temperature Control of Buildings. Energy and Buildings, vol. 37, 2005, pp. 755-761. Van der Zalm, G., Huisman, R., Steinbuch, M., and Veldpaus, F. Frequency Domain Approach for the Design of Heavy-Duty Vehicle Speed Controllers. Int. J. Heavy Vehicle Systems, vol. 15, no. 1, 2008. pp. 107-123. Wang, X.-K., Yang, X.-H., Liu, G., and Qian, H. Adaptive Neuro-Fuzzy Inference System PID controller for steam generator water level of nuclear power plant, Proceedings of the Eighth International Conference on Machine Learning and Cybernetics, 2009, pp. 567-572. Wie, B. Experimental Demonstration to a Classical Approach to Flexible Structure Control. Journal of Guidance, Control, and Dynamics, November-December 1992, pp. 1327-1333.
Design via Frequency Response
^Chapter
Learning Outcomes^
After completing this chapter the student will be able to: •
Use frequency response techniques to adjust the gain to meet a transient response specification (Sections 11.1-11.2)
•
Use frequency response techniques to design cascade compensators to improve the steady-state error (Section 11.3) • Use frequency response techniques to design cascade compensators to improve the transient response (Section 11.4) •
Use frequency response techniques to design cascade compensators to improve both the steady-state error and the transient response (Section 11.5)
^Case Study Learning Outcomes^ You will be able to demonstrate your knowledge of the chapter objectives with case studies as follows: •
Given the antenna azimuth position control system shown on the front endpapers, you will be able to use frequency response techniques to design the gain to meet a transient response specification.
• Given the antenna azimuth position control system shown on the front endpapers, you will be able to use frequency response techniques to design a cascade compensator to meet both transient and steady-state error specifications. 625
626
^11.1
Chapter 11
Design via Frequency Response
Introduction In Chapter 8, we designed the transient response of a control system by adjusting the gain along the root locus. The design process consisted of finding the transient response specification on the root locus, setting the gain accordingly, and settling for the resulting steady-state error. The disadvantage of design by gain adjustment is that only the transient response and steady-state error represented by points along the root locus are available. In order to meet transient response specifications represented by points not on the root locus and, independently, steady-state error requirements, we designed cascade compensators in Chapter 9. In this chapter, we use Bode plots to parallel the root locus design process from Chapters 8 and 9. Let us begin by drawing some general comparisons between root locus and frequency response design. Stability and transient response design via gain adjustment. Frequency response design methods, unlike root locus methods, can be implemented conveniently without a computer or other tool except for testing the design. We can easily draw Bode plots using asymptotic approximations and read the gain from the plots. Root locus requires repeated trials to find the desired design point from which the gain can be obtained. For example, in designing gain to meet a percent overshoot requirement, root locus requires the search of a radial line for the point where the open-loop transfer function yields an angle of 180°. To evaluate the range of gain for stability, root locus requires a search of the /w-axis for 180°. Of course, if one uses a computer program, such as MATLAB, the computational disadvantage of root locus vanishes. Transient response design via cascade compensation. Frequency response methods are not as intuitive as the root locus, and it is something of an art to design cascade compensation with the methods of this chapter. With root locus, we can identify a specific point as having a desired transient response characteristic. We can then design cascade compensation to operate at that point and meet the transient response specifications. In Chapter 10, we learned that phase margin is related to percent overshoot (Eq. (10.73)) and bandwidth is related to both damping ratio and settling time or peak time (Eqs. (10.55) and (10.56)). These equations are rather complicated. When we design cascade compensation using frequency response methods to improve the transient response, we strive to reshape the openloop transfer function's frequency response to meet both the phase-margin requirement (percent overshoot) and the bandwidth requirement (settling or peak time). There is no easy way to relate all the requirements prior to the reshaping task. Thus, the reshaping of the open-loop transfer function's frequency response can lead to several trials until all transient response requirements are met. Steady-state error design via cascade compensation. An advantage of using frequency design techniques is the ability to design derivative compensation, such as lead compensation, to speed up the system and at the same time build in a desired steady-state error requirement that can be met by the lead compensator alone. Recall that in using root locus there are an infinite number of possible solutions to the design of a lead compensator. One of the differences between these solutions is the steady-state error. We must make numerous tries to arrive at the solution that yields the required steady-state error performance. With frequency response techniques, we build the steady-state error requirement right into the design of the lead compensator.
11.2 Transient Response via Gain Adjustment
You are encouraged to reflect on the advantages and disadvantages of root locus and frequency response techniques as you progress through this chapter. Let us take a closer look at frequency response design. When designing via frequency response methods, we use the concepts of stability, transient response, and steady-state error that we learned in Chapter 10. First, the Nyquist criterion tells us how to determine if a system is stable. Typically, an open-loop stable system is stable in closed-loop if the open-loop magnitude frequency response has a gain of less than 0 dB at the frequency where the phase frequency response is 180°. Second, percent overshoot is reduced by increasing the phase margin, and the speed of the response is increased by increasing the bandwidth. Finally, steady-state error is improved by increasing the low-frequency magnitude responses, even if the high-frequency magnitude response is attenuated. These, then, are the basic facts underlying our design for stability, transient response, and steady-state error using frequency response methods, where the Nyquist criterion and the Nyquist diagram compose the underlying theory behind the design process. Thus, even though we use the Bode plots for ease in obtaining the frequency response, the design process can be verified with the Nyquist diagram when questions arise about interpreting the Bode plots. In particular, when the structure of the system is changed with additional compensator poles and zeros, the Nyquist diagram can offer a valuable perspective. The emphasis in this chapter is on the design of lag, lead, and lag-lead compensation. General design concepts are presented first, followed by step-bystep procedures. These procedures are only suggestions, and you are encouraged to develop other procedures to arrive at the same goals. Although the concepts in general apply to the design of PI, PD, and PID controllers, in the interest of brevity, detailed procedures and examples will not be presented. You are encouraged to extrapolate the concepts and designs covered and apply them to problems involving PI, PD, and PID compensation presented at the end of this chapter. Finally, the compensators developed in this chapter can be implemented with the realizations discussed in Section 9.6.
(
11.2
Transient Response via Gain Adjustment
Let us begin our discussion of design via frequency response methods by discussing the link between phase margin, transient response, and gain. In Section 10.10, the relationship between damping ratio (equivalently percent overshoot) and phase margin was derived for G(s) = cofjsis + 2%co„). Thus, if we can vary the phase margin, we can vary the percent overshoot. Looking at Figure 11.1, we see that if we desire a phase margin, $ ^ , represented by CD, we would have to raise the magnitude curve by AB. Thus, a simple gain adjustment can be used to design phase margin and, hence, percent overshoot. We now outline a procedure by which we can determine the gain to meet a percent overshoot requirement using the open-loop frequency response and assuming dominant second-order closed-loop poles.
Design Procedure 1. Draw the Bode magnitude and phase plots for a convenient value of gain. 2. Using Eqs. (4.39) and (10.73), determine the required phase margin from the percent overshoot.
628
Chapter 11
Design via Frequency Response M(dB)
\
A Required increase in gain
logo
Phase (degrees) i.
«**«
*M
-180
FIGURE 11.1
1
log (o
D \
Bode plots showing gain adjustment for a desired phase margin
3. Find the frequency, w$M, on the Bode phase diagram that yields the desired phase margin, CD, as shown on Figure 11.1. 4. Change the gain by an amount AB to force the magnitude curve to go through 0 dB at co<&M. The amount of gain adjustment is the additional gain needed to produce the required phase margin. We now look at an example of designing the gain of a third-order system for percent overshoot.
Example 11.1 Transient Response Design via Gain Adjustment Design
PROBLEM: For the position control system shown in Figure 11.2, find the value of preamplifier gain, K, to yield a 9.5% overshoot in the transient response for a step input. Use only frequency response methods. SOLUTION: We will now follow the previously described gain adjustment design procedure. 1. Choose K = 3.6 to start the magnitude plot at 0 dB at m = 0.1 in Figure 11.3. 2. Using Eq. (4.39), a 9.5% overshoot implies f = 0.6 for the closed-loop dominant poles. Equation (10.73) yields a 59.2° phase margin for a damping ratio of 0.6.
Desired position
Preamplifier
ff(.v) - * » *
FIGURE 11.2
K
Power amplifier
Motor and load
100 (s +• 100)
1 (s + 36)
System for Example 11.1
Shalt position
Shall velocity 1 s
cm
11.2 Transient Response via Gain Adjustment o
§
629
^^^^-
-10 -20 -30
^ * HFTI
^
lagnitude after gain adjustmen
f -40 a -so
1^ ^
-60 -70
H yr 1 1 III 10
0.1
100
Frequency (rad/s)
-100
I -120 8
g> -140
• ~160
\
I -180
\
V
ss SJ
-200
-220 0.1
1
10
100
Frequency (rad/s) FIGURE 11.3
Bode magnitude and phase plots for Example 11.1
3. Locate on the phase plot the frequency that yields a 59.2° phase margin. This frequency is found where the phase angle is the difference between —180° and 59.2°, or - 1 2 0 . 8 ° . The value of the phase-margin frequency is 14.8 rad/s. 4. A t a frequency of 14.8 rad/s o n the magnitude plot, the gain is found to be —44.2 dB. This magnitude has to be raised to 0 dB to yield the required phase margin. Since the log-magnitude plot was drawn for K = 3.6, a 44.2 dB increase, or K = 3.6 x 162.2 = 583.9, would yield the required phase margin for 9.48% overshoot. The gain-adjusted open-loop transfer function is 58,390
G(s) =
^
+ 36)(^+100)
(11.1)
Table 11.1 summarizes a computer simulation of the gain-compensated system. TABLE 11.1 Characteristic of gain-compensated system of Example 11.1 Parameter Phase margin Phase-margin frequency Percent overshoot Peak time
Proposed specification 59.2° 9.5
Actual value 16.22 59.2° 14.8 rad/s 10 0.18 second
Students who are using MATLAB should now run chllpl in Appendix B. You will learn how to use MATLAB to design a gain to meet a percent overshoot specification using Bode plots. This exercise solves Example 11.1 using MATLAB.
MATLAB
Chapter 11
630
Design via Frequency Response
Skill-Assessment Exercise 11.1 WileyPLUS
PROBLEM: For a unity feedback system with a forward transfer function
Control Solutions
G(5) =
^(5 + 50)(5 + 120)
use frequency response techniques to find the value of gain, K, to yield a closedloop step response with 20% overshoot. Trylt 11.1 Use MATLAB, the Control System Toolbox, and the following statements to solve Skill-Assessment Exercise 11.1. pos=20 z=(-log(pos/100))/. . . (sqrt(piA2+... log(pos/100)A2)) Pm=atan(2*z/... (sqrt(-2*z"2+... sqrt(l+4*zM))))* . . . (180/pi) G=zpk([],... [0.-50,-120],1) sisotool
ANSWER: K = 194,200 The complete solution is located at www.wiley.com/college/nise. In the SISOTOOL Window: 1. Select Import. . . in the File menu. 2. Click on G in the System Data Window and click Browse . . . 3. In the Model Import Window select radio button Workspace and select G in Available Models. Click Import, then Close. 4. Click Ok in the System Data Window. 5. Right-click in the Bode graph area and be sure all selections under Show are checked. 6. Grab the stability margin point in the magnitude diagram and raise the magnitude curve until the phase curve shows the phase margin calculated by the program and shown in the MATLAB Command Window as Pm. 7. Right-click in the Bode plot area, select Edit Compensator . . . and read the gain under Compensator in the resulting window.
In this section, we paralleled our work in Chapter 8 with a discussion of transient response design through gain adjustment. In the next three sections, we parallel the root locus compensator design in Chapter 9 and discuss the design of lag, lead, and lag-lead compensation via Bode diagrams.
^ 11.3 Lag Compensation In Chapter 9, we used the root locus to design lag networks and PI controllers. Recall that these compensators permitted us to design for steady-state error without appreciably affecting the transient response. In this section, we provide a parallel development using the Bode diagrams.
Visualizing Lag Compensation The function of the lag compensator as seen on Bode diagrams is to (1) improve the static error constant by increasing only the low-frequency gain without any resulting instability, and (2) increase the phase margin of the system to yield the desired transient response. These concepts are illustrated in Figure 11.4. The uncompensated system is unstable since the gain at 180° is greater than 0 dB. The lag compensator, while not changing the low-frequency gain, does reduce
11.3 Lag Compensation Jtf(dB)
Uncompensated system Compensated system log co Lag compensator Phase (degrees) Phase-marg n frequency log co Lag compensa Uncompensated system Desired phase -180
FIGURE 11.4
Visualizing lag compensation
the high-frequency gain.1 Thus, the low-frequency gain of the system can be made high to yield a large Kv without creating instability. This stabilizing effect of the lag network comes about because the gain at 180° of phase is reduced below 0 dB. Through judicious design, the magnitude curve can be reshaped, as shown in Figure 11.4, to go through 0 dB at the desired phase margin. Thus, both Kv and the desired transient response can be obtained. We now enumerate a design procedure.
Design Procedure 1. Set the gain, K, to the value that satisfies the steady-state error specification and plot the Bode magnitude and phase diagrams for this value of gain. 2. Find the frequency where the phase margin is 5° to 12° greater than the phase margin that yields the desired transient response (Ogata, 1990). This step compensates for the fact that the phase of the lag compensator may still contribute anywhere from —5° to - 12° of phase at the phase-margin frequency. 3. Select a lag compensator whose magnitude response yields a composite Bode magnitude diagram that goes through 0 dB at the frequency found in Step 2 as follows: Draw the compensator's high-frequency asymptote to yield 0 dB for the compensated system at the frequency found in Step 2. Thus, if the gain at the frequency found in Step 2 is 20 log KPM, then the compensator's high-frequency asymptote will be set at - 2 0 log KPM', select the upper break frequency to be 1 decade below the frequency found in Step 2; 2 select the low-frequency asymptote to be at 0 dB; connect the compensator's high- and low-frequency asymptotes with a —20 dB/decade line to locate the lower break frequency. 4. Reset the system gain, K, to compensate for any attenuation in the lag network in order to keep the static error constant the same as that found in Step 1. The name lag compensator comes from the fact that the typical phase angle response for the compensator, as shown in Figure 11.4, is always negative, or lagging in phase angle. 2 This value of break frequency ensures that there will be only - 5 ° to - 12° phase contribution from the compensator at the frequency found in Step 2.
632
Chapter 11
Design via Frequency Response
20 18 16 14 *12 g>l0 8
6 4 2 0
\
\
\
\ s
• 0.001
0.01
10
0.1 1 Frequency (rad/s)
100
_^ -10
N\
g -20 -30
-
-40
-60
0.001
/
Range of frequencies or the desigi of the phase m argin
/ \
-50
FIGURE 11.5 Frequency response plots of a lag compensator, Gc{s) = (s+ 0.1)/(5+ 0.01)
//
\
0.01
7
--/-
/
/
/ 0.1 Frequency (rad/s)
10
100
From these steps, you see that we are relying upon the initial gain setting to meet the steady-state requirements and then relying upon the lag compensator's - 2 0 dB/decade slope to meet the transient response requirement by setting the 0 dB crossing of the magnitude plot. The transfer function of the lag compensator is
Gc(s
>-'s ++ocT ?^z
(11.2)
where a > 1. Figure 11.5 shows the frequency response curves for the lag compensator. The range of high frequencies shown in the phase plot is where we will design our phase margin. This region is after the second break frequency of the lag compensator, where we can rely on the attenuation characteristics of the lag network to reduce the total open-loop gain to unity at the phase-margin frequency. Further, in this region the phase response of the compensator will have minimal effect on our design of the phase margin. Since there is still some effect, approximately 5° to 12°, we will add this amount to our phase margin to compensate for the phase response of the lag compensator (see Step 2).
Example 11.2 Lag Compensation Design PROBLEM: Given the system of Figure 11.2, use Bode diagrams to design a lag compensator to yield a tenfold improvement in steady-state error over the gaincompensated system while keeping the percent overshoot at 9.5%. SOLUTION: We will follow the previously described lag compensation design procedure.
11.3 84 72 60 48 36 24 12 0 -12 -24 -36 -48 -60
Lag Compensation
"•"••-.s^
_JJncompensaiea system
"^-^ " Lag compensator 0.01
0.1
1 Frequency (rad/s)
10
J-M-r+H
100
1—
Lag compensator
-50
INI
1
Uncompensated system
-100 -150
4rtfflK ^
-200
Lag-compensated H system
-250
0.01
FIGURE 11.6
0.1
1 Frequency (rad/s)
10
^SNS 100
B o d e plots for E x a m p l e 11.2.
1. From Example 11.1 a gain, K, of 583.9 yields a 9.5% overshoot. Thus, for this system, Kv = 16.22. For a tenfold improvement in steady-state error, Kv must increase by a factor of 10, or Kv = 162.2. Therefore, the value of K in Figure 11.2 equals 5839, and the open-loop transfer function is 583,900 W = (113) 5(.+ 36)(5+ 100) ° The Bode plots for K = 5839 are shown in Figure 11.6. 2. The phase margin required for a 9.5% overshoot (£ = 0.6) isfoundfromEq. (10.73) to be 59.2°. We increase this value of phase margin by 10° to 69.2° in order to compensate for the phase angle contribution of the lag compensator. Now find the frequency where the phase margin is 69.2°. This frequency occurs at a phase angle of -180° + 69.2° = -110.8° and is 9.8 rad/s. At this frequency, the magnitude plot must go through 0 dB. The magnitude at 9.8 rad/s is now +24 dB (exact, that is, nonasymptotic). Thus, the lag compensator must provide -24 dB attenuation at 9.8 rad/s. 3.&4. We now design the compensator. First draw the high-frequency asymptote at —24 dB. Arbitrarily select the higher break frequency to be about one decade below the phase-margin frequency, or 0.98 rad/s. Starting at the intersection of this frequency with the lag compensator's high-frequency asymptote, draw a —20 dB/decade line until 0 dB is reached. The compensator must have a dc gain of unity to retain the value of Kv that we have already designed by setting K = 5839. The lower break frequency is found to be 0.062 rad/s. Hence, the lag compensator's transfer function is _,. 0.063(5 + 0.98) ... .. Gcis) (1L4) = (, + 0.062) where the gain of the compensator is 0.063 to yield a dc gain of unity.
633
634
Chapter 11
Design via Frequency Response
The compensated system's forward transfer function is thus ^.,^,, 36,786(^ + 0.98) ' ( ' ) = s(s + 36)(, + 100)(, + 0.062)
M„
^ <"-5>
GWG
The characteristics of the compensated system, found from a simulation and exact frequency response plots, are summarized in Table 11.2. TABLE 11.2
Characteristics of the lag-compensated system of Example 11.2
Parameter
Proposed specification
Kv
MATLAB
Actual value
162.2
161.5
Phase margin
59.2°
62°
Phase-margin frequency
—
11 rad/s
Percent overshoot
9.5
10
Peak time
—
0.25 second
Students who are using MATLAB should now run chl lp2 in Appendix B. You will learn how to use MATLAB to design a lag compensator. You will enter the value of gain to meet the steady-state error requirement as well as the desired percent overshoot. MATLAB then designs a lag compensator using Bode plots, evaluates Kv, and generates a closed-loop step response. This exercise solves Example 11.2 using MATLAB.
Skill-Assessment Exercise 11.2 PROBLEM: Design a lag compensator for the system in Skill-Assessment Exercise 11.1 that will improve the steady-state error tenfold, while still operating with 20% overshoot. ANSWER:
, _ 0.0691(6- + 2.04)
1,942,000 + 50)(5 + 120)
The complete solution is at www.wiley.com/college/nise. Trylt 11.2 Use MATLAB, the Control System Toolbox, and the following statements to solve SkillAssessment Exercise 11.2. pos=20 Ts=0.2 z= (-log (pos/100))/(sqrt (piA2+log (pos/100) "2)) Pm=atan (2*z/(sqrt (-2*zA2+sqrt (1+4* zM))))*(180/pi) Wbw=(4/(Ts*z))*sqrt ((l-2*zA2) +sqrt (4*zA4-4*zA2+2)) K=1942000 G=zpk([ ], [0,-50,-120], K)
s i s o t o o 1 (G, 1)
(2*3® continues)
11.4
Lead Compensation
{TryIt Continued) When the SISO Design for SISO Design Task Window appears: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
Right-click on the Bode plot area and select Grid. Note the phase margin shown in the MATLAB Command Window. Using the Bode phase plot, estimate the frequency at which the phase margin from Step 2 occurs. On the SISO Design for SISO Design Task Window toolbar, click on the red zero. Place the zero of the compensator by clicking on the gain plot at a frequency that is 1/10 that found in Step 3. On the SISO Design for SISO Design Task Window toolbar, click on the red pole. Place the pole of the compensator by clicking on the gain plot to the left of the compensator zero. Grab the pole with the mouse and move it until the phase plot shows a P.M. equal to that found in Step 2. Right-click in the Bode plot area and select Edit Compensator... Read the lag compensator in the Control and Estimation Tools Manager Window.
In this section, we showed how to design a lag compensator to improve the steadystate error while keeping the transient response relatively unaffected. We next discuss how to improve the transient response using frequency response methods.
£ 11.4 Lead Compensation For second-order systems, we derived the relationship between phase margin and percent overshoot as well as the relationship between closed-loop bandwidth and other time-domain specifications, such as settling time, peak time, and rise time. When we designed the lag network to improve the steady-state error, we wanted a minimal effect on the phase diagram in order to yield an imperceptible change in the transient response. However, in designing lead compensators via Bode plots, we want to change the phase diagram, increasing the phase margin to reduce the percent overshoot, and increasing the gain crossover to realize a faster transient response.
Visualizing Lead Compensation The lead compensator increases the bandwidth by increasing the gain crossover frequency. At the same time, the phase diagram is raised at higher frequencies. The result is a larger phase margin and a higher phase-marginfrequency. In the time domain, lowerpercent overshoots (larger phase margins) with smaller peak times (higher phasemargin frequencies) are the results. The concepts are shown in Figure 11.7. The uncompensated system has a small phase margin (B) and a low phasemargin frequency (A). Using a phase lead compensator, the phase angle plot (compensated system) is raised for higher frequencies.3 At the same time, the gain crossover frequency in the magnitude plot is increased from A rad/s to C rad/s. These effects yield a larger phase margin (D), a higher phase-margin frequency (C), and a larger bandwidth. One advantage of the frequency response technique over the root locus is that we can implement a steady-state error requirement and then design a transient response. This specification of transient response with the constraint of a steadystate error is easier to implement with the frequency response technique than with the root locus. Notice that the initial slope, which determines the steady-state error, is not affected by the design for the transient response. The name lead compensator comes from the fact that the typical phase angle response shown in Figure 11.7 is always positive, or leading in phase angle.
636
Chapter 11
Design via Frequency Response MfdB) Compensator C
Compensated system
*- logo
Uncompensated system Compensator
Phase (degrees) 0
Compensated system Uncompensated system
-270
FIGURE 11.7 Visualizing lead compensation
Lead Compensator Frequency Response Let us first look at the frequency response characteristics of a lead network and derive some valuable relationships that will help us in the design process. Figure 11.8 shows plots of the lead network
(11.6)
for various values of fi, where fi < 1. Notice that the peaks of the phase curve vary in maximum angle and in the frequency at which the maximum occurs. The dc gain of the compensator is set to unity with the coefficient 1/fi, in order not to change the dc gain designed for the static error constant when the compensator is inserted into the system. In order to design a lead compensator and change both the phase margin and phase-margin frequency, it is helpful to have an analytical expression for the maximum value of phase and the frequency at which the maximum value of phase occurs, as shown in Figure 11.8. From Eq. (11.6) the phase angle of the lead compensator, <$>ISc (11.7)
TVP
(11.9)
11.4 Lead Compensation 20 18 16 14 5 12 j? 10 6 4 2 0
i
^ />.
,^y 0.1
^^.„**• /3=0.2
"/3=0.3" /3=0.4 • " " £ = 0.5
-^*ffr
10
100
/3=0 A
50 40
/ "
30
.,^ \ ^ -
/
20
0
!
**€H
60
10
i i
p-Ci
^
^½
d*j ^=1L<* 1
)3= ).2 Jj= ).3
^,
\
t'**iz?A
a£
"*~
S
N
v
P=05^
pp:::
0.1
1
10
100
COT FIGURE 11.8 F r e q u e n c y r e s p o n s e o f a l e a d c o m p e n s a t o r , G c ( j ) = [l/0][(s + 1 / T ) / ( J + 1//S7*)] S u b s t i t u t i n g E q . (11.9) i n t o E q . (11.6) w i t h s — jcomax,
(11.10)
£;y<^max
Making use of tan(0! —
™
= tan
,1-jS
V? =
.
sm
-11-)3
TT^
(11.11)
and the compensator's magnitude at comax is \Gc(jcomax)\ = - =
(11.12)
We are now ready to enumerate a design procedure.
Design Procedure 1. Find the closed-loop bandwidth required to meet the settling time, peak time, or rise time requirement (see Eqs. (10.54) through (10.56)). 2. Since the lead compensator has negligible effect at low frequencies, set the gain, K, of the uncompensated system to the value that satisfies the steadystate error requirement.
637
638
Chapter 11
Design via Frequency Response
3. Plot the Bode magnitude and phase diagrams for this value of gain and determine the uncompensated system's phase margin. 4. Find the phase margin to meet the damping ratio or percent overshoot requirement. Then evaluate the additional phase contribution required from the compensator.4 5. Determine the value of p (see Eqs. (11.6) and (11.11)) from the lead compensator's required phase contribution. 6. Determine the compensator's magnitude at the peak of the phase curve (Eq. (11.12)). 7. Determine the new phase-margin frequency by finding where the uncompensated system's magnitude curve is the negative of the lead compensator's magnitude at the peak of the compensator's phase curve. 8. Design the lead compensator's break frequencies, using Eqs. (11.6) and (11.9) to find Tand the break frequencies. 9. Reset the system gain to compensate for the lead compensator's gain. 10. Check the bandwidth to be sure the speed requirement in Step 1 has been met. 11. Simulate to be sure all requirements are met. 12. Redesign if necessary to meet requirements. From these steps, we see that we are increasing both the amount of phase margin (improving percent overshoot) and the gain crossover frequency (increasing the speed). Now that we have enumerated a procedure with which we can design a lead compensator to improve the transient response, let us demonstrate.
Lead Compensation Design PROBLEM: Given the system of Figure 11.2, design a lead compensator to yield a 20% overshoot and Kv = 40, with a peak time of 0.1 second. SOLUTION: The uncompensated system is G(s) = 100K/[s(s + 36) (.s + 100)]. We will follow the outlined procedure. 1. We first look at the closed-loop bandwidth needed to meet the speed requirement imposed by Tp = 0.1 second. From Eq. (10.56), with Tp = 0.1 second and £ = 0.456 (i.e., 20% overshoot), a closed-loop bandwidth of 46.6 rad/s is required. 2. In order to meet the specification of Kv = 40, K must be set at 1440, yielding G(s) = 144,000/ [s(s + 36)(s + 100)]. 3. The uncompensated system's frequency response plots for K = 1440 are shown in Figure 11.9. 4. A 20% overshoot implies a phase margin of 48.1°. The uncompensated system with K = 1440 has a phase margin of 34° at a phase-margin frequency 4
We know that the phase-margin frequency will be increased after the insertion of the compensator. At this new phase-margin frequency, the system's phase will be smaller than originally estimated, as seen by comparing points B and D in Figure 11.7. Hence, an additional phase should be added to that provided by the lead compensator to correct for the phase reduction caused by the original system.
11.4 Lead Compensation 36 24
12
V^s
s
-12 I ncom pen satt d sten
-24
Compensated system
N X
v\ \
-36 1
10
Frequency (rad/sec)
\
100
45 0 -45
1000
Lead compensator
-90 -135 -180 -225
Uncompen sated system
Compensated *sw^ sy! tern
-270
1 FIGURE 11.9
5. 6. 7.
8. 9.
10
100 Frequency (rad/sec) Bode plots for lead compensation in Example 11.3
1000
of 29.6. To increase the phase margin, we insert a lead network that adds enough phase to yield a 48.1° phase margin. Since we know that the lead network will also increase the phase-margin frequency, we add a correction factor to compensate for the lower uncompensated system's phase angle at this higher phase-margin frequency. Since we do not know the higher phase-margin frequency, we assume a correction factor of 10°. Thus, the total phase contribution required from the compensator is 48.1° — 34° + 10° = 24.1°. In summary, our compensated system should have a phase margin of 48.1° with a bandwidth of 46.6 rad/s. If the system's characteristics are not acceptable after the design, then a redesign with a different correction factor may be necessary. Using Eq. (11.11), p = 0.42 for 0max = 24.1°. From Eq. (11.12), the lead compensator's magnitude is 3.76 dB at comax. If we select comax to be the new phase-margin frequency, the uncompensated system's magnitude at this frequency must be —3.76 dB to yield a 0 dB crossover at comax for the compensated system. The uncompensated system passes through —3.76 dB at comiiX = 39 rad/s. This frequency is thus the new phase-margin frequency. We now find the lead compensator's break frequencies. From Eq. (11.9), 1/T = 25.3 and 1/0T = 60.2. Hence, the compensator is given by 1 1 S+T = 2.38 5 + 25.3 (11.13) s + 60.2
639
640
Chapter 11
Design via Frequency Response
where 2.38 is the gain required to keep the dc gain of the compensator at unity so that Kv = 40 after the compensator is inserted. The final, compensated open-loop transfer function is then Gc(s)G(s) =
342,600(^ + 25.3) 4 ? + 36)(5 + 1 0 0 ) ( s + 60.2)
(11.14)
10. From Figure 11.9, the lead-compensated open-loop magnitude response is - 7 dB at approximately 68.8 rad/s. Thus, we estimate the closed-loop bandwidth to be 68.8 rad/s. Since this bandwidth exceeds the requirement of 46.6 rad/s, we assume the peak time specification is met. This conclusion about the peak time is based upon a second-order and asymptotic approximation that will be checked via simulation. 11. Figure 11.9 summarizes the design and shows the effect of the compensation. Final results, obtained from a simulation and the actual (nonasymptotic) frequency response, are shown in Table 11.3. Notice the increase in phase margin, phase-margin frequency, and closed-loop bandwidth after the lead compensator was added to the gain-adjusted system. The peak time and the steady-state error requirements have been met, although the phase margin is less than that proposed and the percent overshoot is 2.6% larger than proposed. Finally, if the performance is not acceptable, a redesign is necessary. TABLE 11.3 Characteristic of the lead-compensated system of Example 11.3
Parameter
Proposed specification
Actual gaincompensated value
Actual lead* compensated value
Kv
40
40
40
Phase margin
48.1°
3+
45.5°
Phase-margin frequency
— 46.6 rad/s
29.6 rad/s
39 rad/s
Closed-loop bandwidth
50 rad/s
68.8 rad/s
Percent overshoot
20
37
22.6
Peak time
0.1 second
0.1 second
0.075 second
MATLAB
Students who are using MATLAB should now run chllp3 in Appendix B. You will learn how to use MATLAB to design a lead compensator . You will enter the desired percent overshoot, peak time, and Kv. MATLAB then designs a lead compensator using Bode plots, evaluates Kv, and generates a closed-loop step response. This exercise solves Example 11.3 using MATLAB.
Skill-Assessment Exercise 11.3 WileyPLUS
Control Solutions
PROBLEM: Design a lead compensator for the system in Skill-Assessment Exercise 11.1 to meet the following specifications: %OS = 20%, Ts — 0.2 s and Kv = 50.
11.5 Lag-Lead Compensa tion ANSWER:
Q
^ , 2-27(^ + 33.2).
uimtW
(5 + 75.4)
'
641
30^000 {)
s(s + 50)(s + l20)
The complete solution is at www.wiley.com/college/nise.
(
Ttylt 11.3 Use MATLAB, the Control System Toolbox, and the following statements to solve Skill-Assessment Exercise 11.3. pos=20 Ts=0.2 z = ( - l o g ( p o s / 1 0 0 ) ) / ( s q r t (pi"2+log (pos/100) A2)) Pm=atan(2*z/(sqrt(-2*z A 2+sqrt(l+4*z A 4))))*(180/pi) Wbw=(4/(Ts*z))*sqrt((l-2*z A 2)+sqrt(4*z A 4-4*z A 2+2)) K=50*50*120 G=zpk([], [0,-50,-120],K) sisotool(G,1) When the SISO Design for SISO Design Task Window appears: 1. 2. 3. 4. 5. 6. 7.
Right-click on the Bode plot area and select Grid. Note the phase margin and bandwidth shown in the MATLAB Command Window. On the SISO Design for SISO Design Task Window toolbar, click on the red pole. Place the pole of the compensator by clicking on the gain plot at a frequency that is to the right of the desired bandwidth found in Step 2. On the SISO Design for SISO Design Task Window toolbar, click on the red zero. Place the zero of the compensator by clicking on the gain plot to the left of the desired bandwidth. Reshape the Bode plots: alternately grab the pole and the zero with the mouse and alternately move them along the phase plot until the phase plot show a P.M. equal to that found in Step 2 and a phase-margin frequency close to the bandwidth found in Step 2. 8. Right-click in the Bode plot area and select Edit Compensator . . . 9. Read the lead compensator in the Control and Estimation Tools Manager Window.
Keep in mind that the previous examples were designs for third-order systems and must be simulated to ensure the desired transient results. In the next section, we look at lag-lead compensation to improve steady-state error and transient response.
^ 11.5 Lag-Lead Compensation In Section 9.4, using root locus, we designed lag-lead compensation to improve the transient response and steady-state error. Figure 11.10 is an example of a system to which lag-lead compensation can be applied. In this section we repeat the design, using frequency response techniques. One method is to design the lag compensation to lower the high-frequency gain, stabilize the system, and improve the steady-state error and then design a lead compensator to meet the phase-margin requirements. Let us look at another method. Section 9.6 describes a passive lag-lead network that can be used in place of separate lag and lead networks. It may be more economical to use a single, passive network that performs both tasks, since the buffer amplifier that separates the lag network from the lead network may be eliminated. In this section, we emphasize laglead design, using a single, passive lag-lead network. The transfer function of a single, passive lag-lead network is ( Gc(s) = GissSd(s)GLsig(s) =
S+
1 \
Tl
1
(11.15)
642
Chapter 11
Design via Frequency Response
(a) (*) FIGURE 11.10 a. The National Advanced Driving Simulator at the University of Iowa; b. test driving the simulator with its realistic graphics (Katharina Bosse/laif/Redux Pictures.) where y > 1. The first term in parentheses produces the lead compensation, and the second term in parentheses produces the lag compensation. The constraint that we must follow here is that the single value y replaces the quantity a for the lag network in Eq. (11.2) and the quantity ft for the lead network in Eq. (11.6). For our design, a and f3 must be reciprocals of each other. An example of the frequency response of the passive lag-lead is shown in Figure 11.11. We are now ready to enumerate a design procedure.
o -5
X
-10 *-M
:
11 III! •
\
:• \ / = 10
>:;
^S
NN3Q
\ 450UXV -25
v
X*
"
•
•
^
FIGURE 11.11
-v> = 2y, : : ^
-30 -35
J
tor Asy mpiotes y=10
< $ '/ /
*/ ^
,.¾
>* /
• " • ^
0.001
0.01
0.001
0.01
0.1 1 Frequency (rad/s)
10
0.1 1 Frequency (rad/s) Sample frequency response curves for a lag-lead compensator, Gc{s) = [(s + l)(s + 0.1)]/
100
Gr+y)(*+^i
11.5 Lag-Lead Compensation
Design Procedure 1. Using a second-order approximation, find the closed-loop bandwidth required to meet the settling time, peak time, or rise time requirement (see Eqs. (10.55) and (10.56)). 2. Set the gain, K, to the value required by the steady-state error specification. 3. Plot the Bode magnitude and phase diagrams for this value of gain. 4. Using a second-order approximation, calculate the phase margin to meet the damping ratio or percent overshoot requirement, using Eq. (10.73). 5. Select a new phase-margin frequency near <WBW6. At the new phase-margin frequency, determine the additional amount of phase lead required to meet the phase-margin requirement. Add a small contribution that will be required after the addition of the lag compensator. 7. Design the lag compensator by selecting the higher break frequency one decade below the new phase-margin frequency. The design of the lag compensator is not critical, and any design for the proper phase margin will be relegated to the lead compensator. The lag compensator simply provides stabilization of the system with the gain required for the steady-state error specification. Find the value of y from the lead compensator's requirements. Using the phase required from the lead compensator, the phase response curve of Figure 11.8 can be used to find the value of y = 1//3. This value, along with the previously found lag's upper break frequency, allows us to find the lag's lower break frequency. 8. Design the lead compensator. Using the value of y from the lag compensator design and the value assumed for the new phase-margin frequency, find the lower and upper break frequency for the lead compensator, using Eq. (11.9) and solving for T. 9. Check the bandwidth to be sure the speed requirement in Step 1 has been met. 10. Redesign if phase-margin or transient specifications are not met, as shown by analysis or simulation. Let us demonstrate the procedure with an example.
Lag-Lead Compensation Design PROBLEM: Given a unity feedback system where G(s) = K/[s(s+ l)(s+ 4)], design a passive lag-lead compensator using Bode diagrams to yield a 13.25% overshoot, a peak time of 2 seconds, and Kv = 12. SOLUTION: We will follow the steps previously mentioned in this section for laglead design. 1. The bandwidth required for a 2-seconds peak time is 2.29 rad/s. 2. In order to meet the steady-state error requirement, Kv = 12, the value of K is 48. 3. The Bode plots for the uncompensated system with K — 48 are shown in Figure 11.12. We can see that the system is unstable. 4. The required phase margin to yield a 13.25% overshoot is 55°.
643
Chapter 11
Design via Frequency Response
72 60 48
f Uncompensated system
36 24
12 0 -12 -24 -36 -48 -60
•v Lag-lead-compensated system compensator i
.01
1 system
i
0.1
10
1
100
Frequency (rad/s) 100
III
I I I
Lag-lead compensato
50 0 -50
Uncortipensjtted system
00
-100
IL==
I -150 £
- Lag-1^ad-compe nsat ed system
Lag-compensated system
-200 -250 -300 0.01
0.1
1
10
100
Frequency (rad/s)
FIGURE 11.12 Bode plots for lag-lead compensation in Example 11.4
5. Let us select co = 1.8 rad/s as the new phase-margin frequency. 6. At this frequency, the uncompensated phase is -176° and would require, if we add a -5° contribution from the lag compensator, a 56° contribution from the lead portion of the compensator. 7. The design of the lag compensator is next. The lag compensator allows us to keep the gain of 48 required for Kv = 12 and not have to lower the gain to stabilize the system. As long as the lag compensator stabilizes the system, the design parameters are not critical since the phase margin will be designed with the lead compensator. Thus, choose the lag compensator so that its phase response will have minimal effect at the new phase-margin frequency. Let us choose the lag compensator's higher break frequency to be 1 decade below the new phase-margin frequency, at 0.18 rad/s. Since we need to add 56° of phase shift with the lead compensator at co = 1.8 rad/s, we estimate from Figure 11.8 that, if y- 10.6 (since y = 1/0, 0 = 0.094), we can obtain about 56° of phase shift from the lead compensator. Thus with y = 10.6 and a new phase-margin frequency of co = 1.8 rad/s, the transfer function of the lag compensator is
Glag(s) =
1 {s + 0.183) 10.6 (5 + 0.0172)
"
YTI)
(11.16)
11.5 Lag-Lead Compensation
645
where the gain term, 1/y, keeps the dc gain of the lag compensator at 0 dB. The lag-compensated system's open-loop transfer function is 4.53(. + 0.183) Ulag comp[S) [Li U) ~s(s + l)(s + 4)(s +0.0112) 8. Now we design the lead compensator. At w = 1.8, the lag-compensated system has a phase angle of 180°. Using the values of o)max = 1.8 and ft = 0.094, Eq. (11.9) yields the lower break, 1/T\ = 0.56 rad/s. The higher break is then 1/fiTi = 5.96rad/s. The lead compensator is
2% The lag-lead-compensated system's open-loop transfer function is C
M
^lag-lead-comp[5) - ^
48(. + 0.183)(. + 0.56) +
^
+
^
+
Q#()172)(J
+
g
^
% )
-
^
9. Now check the bandwidth. The closed-loop bandwidth is equal to that frequency where the open-loop magnitude response is approximately —7 dB. From Figure 11.12, the magnitude is —7 dB at approximately 3 rad/s. This bandwidth exceeds that required to meet the peak time requirement. The design is now checked with a simulation to obtain actual performance values. Table 11.4 summarizes the system's characteristics. The peak time requirement is also met. Again, if the requirements were not met, a redesign would be necessary. TABLE 11.4 Characteristics of gain-compensated system of Example 11.4 Parameter
Proposed specification
Actual value
Kv
12
12
Phase margin
55°
59.3°
Phase-margin frequency
—
1.63 rad/s
Closed-loop bandwidth
2.29 rad/s
3 rad/s
Percent overshoot
13.25
10.2
Peak time
2.0 seconds
1.61 seconds
Students who are usingMATLAB should now run chllp4 in Appendix B. You will learn how to useMATLAB to design a lag-lead compensator. You will enter the desired percent overshoot, peak time, and Kv. MATLAB then designs a lag-lead compensator using Bode plots, evaluates Kvr and generates a closed-loop step response. This exercise solves Example 11.4 usingMATLAB.
For a final example, we include the design of a lag-lead compensator using a Nichols chart. Recall from Chapter 10 that the Nichols chart contains a presentation of both the open-loop frequency response and the closed-loop frequency response. The axes of the Nichols chart are the open-loop magnitude and phase (y and x axis, respectively). The open-loop frequency response is plotted using the coordinates of the Nichols chart at each frequency. The open-loop plot is overlaying a grid that yields the closed-loop magnitude and phase. Thus, we have a presentation of both the
MATLAB
646
Chapter 11
Design via Frequency Response
open- and closed-loop responses. Thus, a design can be implemented that reshapes the Nichols plot to meet both open- and closed-loop frequency specifications. From a Nichols chart, we can see simultaneously the following frequency response specifications that are used to design a desired time response: (1) phase margin, (2) gain margin, (3) closed-loop bandwidth, and (4) closed-loop peak amplitude. In the following example, we first specify the following: (1) maximum allowable percent overshoot, (2) maximum allowable peak time, and (3) minimum allowable static error constant. We first design the lead compensator to meet the transient requirements followed by the lag compensator design to meet the steady-state error requirement. Although calculations could be made by hand, we will use MATLAB and SISOTOOL to make and shape the Nichols plot. Let us first outline the steps that we will take in the example: 1. Calculate the damping ratio from the percent overshoot requirement using Eq. (4.39) 2. Calculate the peak amplitude, Mp, of the closed-loop response using Eq. (10.52) and the damping ratio found in (1). 3. Calculate the minimum closed-loop bandwidth to meet the peak time requirement using Eq. (10.56), with peak time and the damping ratio from (1). 4. Plot the open-loop response on the Nichols chart. 5. Raise the open-loop gain until the open-loop plot is tangent to the required closed-loop magnitude curve, yielding the proper Mp. 6. Place the lead zero at this point of tangency and the lead pole at a higher frequency. Zeros and poles are added in SISOTOOL by clicking either one on the tool bar and then clicking the position on the open-loop frequency response curve where you desire to add the zero or pole. 7. Adjust the positions of the lead zero and pole until the open-loop frequency response plot is tangent to the same Mp curve, but at the approximate frequency found in (3). This yields the proper closed-loop peak and proper bandwidth to yield the desired percent overshoot and peak time, respectively. 8. Evaluate the open-loop transfer function, which is the product of the plant and the lead compensator, and determine the static error constant. 9. If the static error constant is lower than required, a lag compensator must now be designed. Determine how much improvement in the static error constant is required. 10. Recalling that the lag pole is at a frequency below that of the lag zero, place a lag pole and zero at frequencies below the lead compensator and adjust to yield the desired improvement in static error constant. As an example, recall from Eq. (9.5) thattheimprovementinstaticerrorconstantforaTypelsystemisequaltotheratio of the lag zero value divided by the lag pole value. Readjust the gain if necessary.
Example 11.5 MATLAB
Kmrm
Lag-Lead Design Using the Nichols Chart, MATLAB, and SISOTOOL PROBLEM: Design a lag-lead compensator for the plant, G(s) — —, jr-, 77^, & 5(5 + 5)(5 + 10) to meet the following requirements: (1) a maximum of 20% overshoot, (2) a peak time of no more than 0.5 seconds, (3) a static error constant of no less than 6.
11.5 Lag-Lead Compensation
647
SISO Design for SISO Design Task Efc
£ * X
Yjew O
Designs
J<. SL
analysis
loob
Window
Help
^ \m% ® I up Open-Loop Nichols Editor tor Open Loop 1 (OL1)
G.M.: 14 d8 @ 7.07 rad/sec P.M.: 48.2 deg e 2.58 rad/sec Stable loop -270
-180 Open-toop Phase (deg)
EdSed Gain
SOLUTION: We follow the steps enumerated immediately above, 1. Using Eq. (4.39), f = 0.456 for 20% overshoot. 2. Using Eq. (10.52), Mp = 1.23 = 1.81 dB for f = 0.456. 3. Using Eq. (10.56), wBw = 9.3 r/s for £ = 0.456 and T p = 0.5. 4. Plot the open-loop frequency response curve on the Nichols chart for K = 1. 5. Raise the open-loop frequency response curve until it is tangent to the closedloop peak of 1.81 dB curve as shown in Figure 11.13. The frequency at the tangent point is approximately 3 r/s, which can be found by letting your mouse rest on the point of tangency. On the menu bar, select Designs/Edit Compensator . . . and find the gain added to the plant. Thus, the plant is now G(s) = —;
-TT-. -rrr. The gain-adjusted closed-loop step response is
shown in Figure 11.14. Notice that the peak time is about 1 second and must be decreased. 6. Place the lead zero at this point of tangency and the lead pole at a higher frequency. 7. Adjust the positions of the lead zero and pole until the open-loop frequency response plot is tangent to the same Mp curve, but at the approximate frequency found in 3. 8. Checking Designs/Edit Compensator . . . shows 1286(^ + 1.4) G(s)Giead(s) = , which yields a Kv = 3. 5(5 + 5)(5 + 10)(5 + 12)
FIGURE 11.13 Nichols chart after gain adjustment
648
Chapter 11
Design via Frequency Response i Design Task
na\%
LTI Viewer
FIGURE 11.14 Gain-adjusted closed-loop step response
SISO Desitm for SISO Design Task Efe
gift
»CW Besigns
1¾ X O £ £ -¾
Analysis Ioob Wnkm
Help
tf Open-loop WichoB Editor for Open Loop 1 {0L1)
FIGURE 11.15 Nichols chart after lag-lead compensation
11.5 Lag-Lead Compensation
*mmmmam» I
LTI Viewer for SISO Design Task Bte
E*
iSWow
o
is! S3
Help
D al^^is Step Response
\2
•
-
0.8
1
0.6
-j
J
0.4
02
0
1
2
3
4
5
6
Time (sec) LTI Viewer
FIGURE 11.16
0Rear-r»ne Update
Lag-lead compensated closed-loop step response
9. We now add lag compensation to improve the static error constant by at least 2. 10. Now add a lag pole at -0.004 and a lag zero at -0.008. Readjust the gain to yield the same tangency as after the insertion of the lead. The final forward 1381(5 + 1.4)(5 + 0.008) *u* t A* fc-r*^ <\r i\ path „ found to be G(.)GIead(,)Glag(,) = s{s+ 5){s+ m s + 12){s+ om4y The final Nichols chart is shown in Figure 11.15 and the compensated time response is shown in Figure 11.16. Notice that the time response has the expected slow climb to the final value that is typical of lag compensation. If your design requirements require a faster climb to the final response, then redesign the system with a larger bandwidth or attempt a design only with lead compensation. A problem at the end of the chapter provides the opportunity for practice.
Skill-Assessment Exercise 11.4 PROBLEM: Design a lag-lead compensator for a unity feedback system with the forward-path transfer function G(s) =
K s{s + 8){s + 30)
to meet the following specifications: %OS = 10%, Tp = 0.6 s, and Kv = 10. Use frequency response techniques.
649
650
Chapter 11
Design via Frequency Response
ANSWER: G^S) = 0 . 4 5 6 g ± » G^(s)
= M s j g g , K = 2400.
The complete solution is at www.wiley.com/college/nise.
Case Studies Our ongoing antenna azimuth position control system serves now as an example to summarize the major objectives of the chapter. The following cases demonstrate the use of frequency response methods to (1) design a value of gain to meet a percent overshoot requirement for the closed-loop step response and (2) design cascade compensation to meet both transient and steady-state error requirements.
Antenna Control: Gain Design PROBLEM: Given the antenna azimuth position control system shown on the front endpapers, Configuration 1, use frequency response techniques to do the following: a. Find the preamplifier gain required for a closed-loop response of 20% overshoot for a step input. b. Estimate the settling time. SOLUTION: The block diagram for the control system is shown on the inside front cover (Configuration 1). The loop gain, after block diagram reduction, is G(s) =
6.63K 5(5+1.71)(5 + 100)
0.0388K JJ^+{\1 + 1 100
(11.20)
Letting K = 1, the magnitude and phase frequency response plots are shown in Figure 10.61. a. To find K to yield a 20% overshoot, we first make a second-order approximation and assume that the second-order transient response equations relating percent overshoot, damping ratio, and phase margin are true for this system. Thus, a 20% overshoot implies a damping ratio of 0.456. Using Eq. (10.73), this damping ratio implies a phase margin of 48.1°. The phase angle should therefore be (-180° + 48.1°) = -131.9°. The phase angle is -131.9° at m = 1.49rad/s, where the gain is -34.1 dB. Thus K = 34.1 dB = 50.7 for a 20% overshoot. Since the system is third-order, the second-order approximation should be checked. A computer simulation shows a 20% overshoot for the step response. b. Adjusting the magnitude plot of Figure 10.61 for K = 50.7, we find —7 dB at co = 2.5 rad/s, which yields a closed-loop bandwidth of 2.5 rad/s. Using Eq. (10.55) with £ = 0.456 and wBw = 2.5, we find Ts = 4.63 seconds. A computer simulation shows a settling time of approximately 5 seconds.
Case Studies
CHALLENGE: We now give you a problem to test your knowledge of this chapter's objectives. You are given the antenna azimuth position control system shown on the inside front cover (Configuration 3). Using frequency response methods do the following: a. Find the value of K to yield 25% overshoot for a step input. b. Repeat Part a using MATLAB.
Antenna Control: Cascade Compensation Design PROBLEM: Given the antenna azimuth position control system block diagram shown on the front endpapers, Configuration 1, use frequency response techniques and design cascade compensation for a closed-loop response of 20% overshoot for a step input, a fivefold improvement in steady-state error over the gain-compensated system operating at 20% overshoot, and a settling time of 3.5 seconds. SOLUTION: Following the lag-lead design procedure, we first determine the value of gain, K, required to meet the steady-state error requirement. 1. Using Eq. (10.55) with £ = 0.456, and Ts = 3.5 seconds, the required bandwidth is 3.3 rad/s. 2. From the preceding case study, the gain-compensated system's open-loop transfer function was, for K = 50.7,
3. 4. 5. 6.
7.
663K 33614 rf\m\G{s)H{s) - ^ + i n ^ + 10Q) - s{s - ln){s - 10[)) (11.21) This function yields Kv = 1.97. If K = 254, then Kv = 9.85, a fivefold improvement. The frequency response curves of Figure 10.61, which are plotted for K = X, will be used for the solution. Using a second-order approximation, a 20% overshoot requires a phase margin of 48.1°. Select co = 3 rad/s to be the new phase-margin frequency. The phase angle at the selected phase-margin frequency is -152°. This is a phase margin of 28°. Allowing for a 5° contribution from the lag compensator, the lead compensator must contribute (48.1° - 28° + 5°) = 25.1°. The design of the lag compensator now follows. Choose the lag compensator upper break one decade below the new phase-margin frequency, or 0.3 rad/s. Figure 11.8 says that we can obtain 25.1° phase shift from the lead if p = 0.4 or y = 1/fi = 2.5. Thus, the lower break for the lag is at 1/()/7/) = 0.3/2.5 = 0.12 rad/s. Hence,
8. Finally, design the lead compensator. Using Eq. (11.9), we have 7/ = — ? _ = — ^ = = 0.527 (11.23) w m a x v ^ 3N/04 Therefore the lead compensator lower break frequency is 1/7/ = 1.9 rad/s, and the upper break frequency is 1/(/37/) = 4.75 rad/s. Thus, the
652
Chapter 11
Design via Frequency Response
lag-lead-compensated forward path is r
M-
triag-lead-compW - ^
(6.63)(254)(. + 0.3)(5 + 1.9) + 1.71)(, + 100)(, + 0.12)(. + 4.75)
^
^
9. A plot of the open-loop frequency response for the lag-lead-compensated system shows —7 dB at 5.3 rad/s. Thus, the bandwidth meets the design requirements for settling time. A simulation of the compensated system shows a 20% overshoot and a settling time of approximately 3.2 seconds, compared to a 20% overshoot for the uncompensated system and a settling time of approximately 5 seconds. Kv for the compensated system is 9.85 compared to the uncompensated system value of 1.97. CHALLENGE: We now give you a problem to test your knowledge of this chapter's objectives. You are given the antenna azimuth position control system shown on the front endpapers (Configuration 3). Using frequency response methods, do the following: a. Design a lag-lead compensator to yield a 15% overshoot and Kv = 20. In order to speed up the system, the compensated system's phase-margin frequency will be set to 4.6 times the phase-margin frequency of the uncompensated system. MATLAB
b. Repeat Part a using MATLAB.
^ Summary J | This chapter covered the design of feedback control systems using frequency response techniques. We learned how to design by gain adjustment as well as cascaded lag, lead, and lag-lead compensation. Time response characteristics were related to the phase margin, phase-margin frequency, and bandwidth. Design by gain adjustment consisted of adjusting the gain to meet a phasemargin specification. We located the phase-margin frequency and adjusted the gain to 0 dB. A lag compensator is basically a low-pass filter. The low-frequency gain can be raised to improve the steady-state error, and the high-frequency gain is reduced to yield stability. Lag compensation consists of setting the gain to meet the steady-state error requirement and then reducing the high-frequency gain to create stability and meet the phase-margin requirement for the transient response. A lead compensator is basically a high-pass filter. The lead compensator increases the high-frequency gain while keeping the low-frequency gain the same. Thus, the steady-state error can be designed first. At the same time, the lead compensator increases the phase angle at high frequencies. The effect is to produce a faster, stable system since the uncompensated phase margin now occurs at a higher frequency. A lag-lead compensator combines the advantages of both the lag and the lead compensator. First, the lag compensator is designed to yield the proper steady-state error with improved stability. Next, the lead compensator is designed to speed up the transient response. If a single network is used as the lag-lead, additional design
Problems considerations are applied so that the ratio of the lag zero to the lag pole is the same as the ratio of the lead pole to the lead zero. In the next chapter, we return to state space and develop methods to design desired transient and steady-state error characteristics.
£ Review Questions ^ 1. What major advantage does compensator design by frequency response have over root locus design? 2. How is gain adjustment related to the transient response on the Bode diagrams? 3. Briefly explain how a lag network allows the low-frequency gain to be increased to improve steady-state error without having the system become unstable. 4. From the Bode plot perspective, briefly explain how the lag network does not appreciably affect the speed of the transient response. 5. Why is the phase margin increased above that desired when designing a lag compensator? 6. Compare the following for uncompensated and lag-compensated systems designed to yield the same transient response: low-frequency gain, phase-margin frequency, gain curve value around the phase-margin frequency, and phase curve values around the phase-margin frequency. 7. From the Bode diagram viewpoint, briefly explain how a lead network increases the speed of the transient response. 8. Based upon your answer to Question 7, explain why lead networks do not cause instability. 9. Why is a correction factor added to the phase margin required to meet the transient response? 10. When designing a lag-lead network, what difference is there in the design of the lag portion as compared to a separate lag compensator?
1. Design the value of gain, K, for a gain margin o 10 dB in the unity feedback system of Figure P l l . l t [Section: 11.2]
a. G{s) =
b. G(s) =
c. G(s) =
K (5 + 4)(5 + 10)(5 + 15) K 5(5 + 4)(5 + 10)
K(s + 2) 5(5 + 4)(5 + 6)(5+10)
m +,
G(s)
C(s)
FIGURE P 1 1 . 1
2. For each of the systems in Problem 1., design the gain, K, for a phase margin of 40°. [Section: 11.2] 3. Given the unity feedback system of Figure PI 1.1, use frequency response methods to determine the value of gain, K, to yield a step response with a 20% overshoot if [Section: 11.2]
Chapter 11
654 a. G(s) =
s(s
Design via Frequency Response
K 8)(^ + 15)
7. The unity feedback system shown in Figure P l l . l with
b. G(s) =
K(s + 4) 5(5 + 8)(5 + 10)(5 + 15)
c. G(s) =
K{s + 2)(s + l) 5(5 + 6)(5 + 8)(5 + 10)(5 + 15)
G(j) =
4. Given the unity feedback system of Figure PI 1.1 with K(5+ 20)(5+ 25) G(s) = 5(5 + 6)(5 + 9)(5 + 14)
a. Use frequency response methods to determine the value of gain, K, to yield a step response with a 15% overshoot. Make any required secondorder approximations. b. Use MATLAB or any other comMATLAB puter program to test your Vul^P second-order approximation by simulating the system for your designed value of K. 5. The unity feedback system of Figure P l l . l with
J S S * dJEit Control Solutions
CM-
K
5(5 + 7)
is operating with 15% overshoot. Using frequency response techniques, design a compensator to yield Kv = 50 with the phase-margin frequency and phase margin remaining approximately the same as in the uncompensated system. [Section: 11.3] 6. Given the unity feedback system of Figure P l l . l with £ ( 5 + 10)(5 + 11) {) 5(5 + 3)(5 + 6)(5 + 9) do the following: [Section: 11.3] a. Use frequency response methods to design a lag compensator to yield Kv — 1000 and 15% overshoot for the step response. Make any required second-order approximations. b. Use MATLAB o r any o t h e r com-
is operating with 15% overshoot. Using frequency response methods, design a compensator to yield a five-fold improvement in steady-state error without appreciably changing the transient response. [Section: 11.3] 8. Design a lag compensator so that the system of Figure P l l . l where G(s) =
do the following: [Section: 11.2]
MATLAB
puter program t o t e s t your ^yl^P second-order approximation by s i m u l a t i n g t h e system for your d e signed v a l u e of Kand l a g compensator.
(5 + 2)(5 + 5)(5 + 7)
K(s + 4) (5 + 2)(5 + 6)(5 + 8)
operates with a 45° phase margin and a static error constant of 100. [Section: 11.3] 9. Design a PI controller for the system of Figure 11.2 that will yield zero steady-state error for a ramp input and a 9.48% overshoot for a step input. [Section: 11.3] 10. For the system of Problem 6, do the following: [Section: 11.3] a. Use frequency response methods to find the gain, K, required to yield about 15% overshoot. Make any required second-order approximations. b. Use frequency response methods to design a PI compensator to yield zero steady-state error for a ramp input without appreciably changing the transient response characteristics designed in Part a. c. Use MATLAB or any other compu- JJJJiiL ter program to test your second- VUL^P order approximation by simulating the system for your designed value of if and PI compensator. 11. Write a MATLAB program that will J^JiJL design a PI controller assuming a Vul^P second-order approximation as follows: a. Allow the user to input from the keyboard the desired percent overshoot b. Design a PI controller and gain to yield zero steady-state error for a closedloop step response as well as meet the percent overshoot specification c. Display the compensated closed-loop step response
Problems T e s t y o u r p r o g r a m on G(s) =
16. Repeat Problem 13 using a P D compensator. [Section: 11.4]
K (s + 5)(s + 10)
and 25% o v e r s h o o t . 12. Design a compensator for the unity feedback system of Figure P l l . l with
G(s) =
655
'^l Control Solutions
K 5(5 + 3)(5 + 15)(5 + 20)
to yield a Kv = 4 and a phase margin of 40°. [Section: 11.4] 13. Consider the unity feedback system of Figure P l l . l with K G(s) = 5(5 + 5)(5 + 20)
MATLAB 17. Write a MATLAB program that will design a lead compensator assum- V M L ^ P ing second-order approximations as follows :
a. Allow the user to input from the keyboard the desired percent overshoot, peak time, and gain required to meet a steady-state error specification b. Display the gain-compensatedBodeplot c. Calculate the required phase margin and bandwidth d. Display the pole, zero, and gain of the lead compensator c. Display the compensated Bode plot
The uncompensated system has about 55% overshoot and a peak time of 0.5 second when Kv = 10. Do the following: [Section: 11.4]
f. Output the step response of the leadcompensated system to test your second-order approximation
a. Use frequency response methods to design a lead compensator to reduce the percent overshoot to 10%, while keeping the peak time and steadystate error about the same or less. Make any required second-order approximations.
Test your program on a unity feedback system where
b. Use MATLAB o r any o t h e r compu- JJ^JiiL t e r program to t e s t your ^Kiil^P s e c o n d - o r d e r a p p r o x i m a t i o n by s i m u l a t i n g t h e system for your designed v a l u e of K. 14. The unity feedback system of Figure P l l . l with [
'
b. Find Kp. c. Find the phase margin and the phase-margin frequency. d. Using frequency response techniques, design a compensator that will yield a threefold improvement in Kp and a twofold reduction in settling time while keeping the overshoot at 20%. WileyPLUS
15. Repeat the design of Example 11.3 in the text using a PD controller. .
.,.,
,1
18. Repeat Problem 17 for a PD c o n troiler.
ffTTTZfe ,, Control Solutions
MATLAB ^(^ii^P
19. Use frequency response methods to design a laglead compensator for a unity feedback system where [Section: 11.4] {
a. Find the settling time.
[Section: 11.4]
and the following specifications are to be met: percent overshoot = 1 0 % , peak time = 0 .1 second, and Kv = 30 .
(5 + 2)(5 + 6)(5 + 10)
is operating with 20% overshoot. [Section: 11.4]
rri
JCfr + 1) s(s + 2)(s+6)
>
5(5 + 5)(5+15)
and the following specifications are to be met: percent overshoot = 15%, settling time = 0.1 second, and Kv = 1000. 20. Write a MATLAB program that will MATLAB design a lag-lead compensator ^Kiil^P assuming second-order approximations as follows: [ Section: 11.5] a. Allow the user to input from the keyboard the desired percent overshoot, settling time, and gain required to meet a steady-state error specification b. Display plot
the
gain-compensated
Bode
656
Chapter 11 Commanded roll angle
Design via Frequency Response
Compensator
i®—
Actuator
Roll dynamics
200 s2+Us+100
K
500 s(s + 6)
Actual roll angle #W
—11
FIGURE P11.2 Towed-vehicle roll control c. Calculate the required phase margin and bandwidth d. Display the poles, zeros, and the gain of the lag-lead compensator e. Display the lag-lead-compensated Bode plot f. Display the step response of the laglead compensated system to test your second-order approximation Use your program to do Problem 19. 21. Given a unity feedback system with 3
WileyPLUS
G(S)
333
=s(s + 2)ts + 5)
I
S{S + Z){S-bD)
control Solutions
design a PID controller to yield zero steady-state error for a ramp input, as well as a 20% overshoot, and a peak time less than 2 seconds for a step input. Use only frequency response methods. [Section: 11.5] 22. A u n i t y f e e d b a c k s y s t e m h a s MATLAB
I \ —
G{S)
~ s(s + 3 ) ( 5 + 6) If this system has an associated 0 . 5 second delay, use MATLAB to design the value of K for 20% overshoot. Make any necessary second-order approximations, but test your assumptions by simulating your design. The delay can be represented by cascading the MATLAB function pade (T,n) with G(s) , where Tis the delay in seconds and n is the order of the Pade approximation (use 5). Write the program to do the following: a. Accept your value of percent overshoot from the keyboard b. Display the Bode plot for K= 1 c. Calculate the required phase margin and find the phase-margin frequency and the magnitude at the phase-margin frequency d. Calculate and display the value of K
DESIGN PROBLEMS 23. Aircraft are sometimes used to tow other vehicles. A roll control system for such an aircraft was discussed in Problem 58 in Chapter 6. If Figure PI 1.2 represents the roll control system, use only frequency response techniques to do the following (Cochran, 1992): a. Find the value of gain, K, to yield a closed-loop step response with 10% overshoot. b. Estimate peak time and settling time using the gain-compensated frequency response. c. Use MATLAB to simulate your MATLAB system. Compare the results of C L U ^ P the simulation with the requirements in Part a and your estimation of performance in Part b. 24. The model for a specific linearized TCP/IP computer network queue working under a random early detection (RED) algorithm has been modeled using the block diagram of Figure PI 1.1, where G{s) = M(s)P(s), with M(s) =
0.005L s + 0.005
and P(s) =
140,625e -0.1s (5 + 2.67)(^ + 10)
Also, L is a parameter to be varied (Hollot, 2001). a. Adjust L to obtain a 15% overshoot in the transient response for step inputs. b. Verify Part a with a Simulink ^"j^< unit step response simulation. ^ » * ^ ^ 25. An electric ventricular assist device (EVAD) that helps pump blood concurrently to a defective natural heart in sick patients can be shown to have a transfer function Pao(s) 1361 G{s) = Em(s) s2 + 695 + 70.85
Problems The input, Em(s), is the motor's armature voltage, and the output is Pao(s), the aortic blood pressure (Tasch, 1990). The EVAD will be controlled in the closed-loop configuration shown in Figure PI 1.1.
where 8e(s) is the elevator angle and h(s) is the change in altitude (Barkana, 2005). a. Assuming the airplane is controlled in the closedloop configuration of Figure PI 1.1 with G{s) = KP(s), find the value of K that will result in a 30° phase margin.
a. Design a phase lag compensator to achieve a tenfold improvement in the steady-state error to step inputs without appreciably affecting the transient response of the uncompensated system. b. Use MATLAB to simulate the uncompensated and compensated systems for a unit step input.
b. For the value of K calculated in Part a, obtain the corresponding gain margin. c. Obtain estimates for the system's %OS and settling times Ts for step inputs.
MARAB (dJP
d. S i m u l a t e t h e s t e p r e s p o n s e of t h e s y s t e m u s i n g MATLAB.
26. A Tower Trainer 60 Unmanned Aerial Vehicle has a transfer function P(s) =
Se(s) -34.165 3 - 144.%2 + 70475 557.2 5 s + 13.1854 + 95.9353 + 14.6152 + 31.945
Desired bearing angle
m-
Computer K
Desired wheel position
MATLAB
e. Explain the simulation results and discuss any inaccuracies in the estimates obtained in Part c. 27. Self-guided vehicles, such as that shown in Figure P11.3(a), are used in factories to transport products from station to station. One method of construction
Motor and controller \
657
5 s(s + 2)
p-*
Actual wheel position
Vehicle 1 s(s + 3)
Actual bearing angle
m FIGURE P11.3 a. Automated guided carts in the final assembly area of lithium-ion batteries for Chevrolet Volt™ electric vehicles (Rebecca Cook/Rueters/©Corbis); b. simplified block diagram of a guided cart
658
Chapter 11 Desired roll a
"g,e
Design via Frequency Response
Amplifier +/OV
-
Motor
Aileron torque Aircraft
1
K
Roll rale
10 s+5
- .
1
Actual roll angle
5
FIGURE P11.4
MATLAB is to embed a wire in the floor to provide guidance. b. Verify your design through MATLAB simulations. Another method is to use an onboard computer and a laser scanning device. Bar-coded reflective devices at known locations allow the system to determine 30. A pitch axis attitude control system gfljfgE the vehicle's angular position. This system allows utilizing a momentum wheel was the sub- " ' ' • " the vehicle to travel anywhere, including between ject of Problem 61 in Chapter 8. In that Contro1 Solu,ions problem, the compensator is shown as a PI compenbuildings (Stefanides, 1987). Figure PI 1.3(6) shows a simplified block diagram of the vehicle's bearing consator. We want to replace the PI compensator with a lag-lead compensator to improve both transient and trol system. For 11% overshoot, K is set equal to 2. Design a lag compensator using frequency response steady-state error performance. The block diagram techniques to improve the steady-state error by a for the pitch axis attitude control is shown in Figure factor of 30 over that of the uncompensated system. P11.5, where 6c(s) is a commanded pitch angle and 9(s) is the actual pitch angle of the spacecraft. If r = 28. An aircraft roll control system is shown in Figure 23 seconds and Iz = 963 1 in-lb-s2, do the following PI 1.4. The torque on the aileron generates a roll rate. (Piper, 1992): The resulting roll angle is then controlled through a a. Design a lag-lead compensator and find Gc(s) feedback system as shown. Design a lead compensaand K to yield a system with the following tor for a 60° phase margin and Kv = 5. performance specifications: percent overshoot = 29. The transfer function from applied force to arm 20%, settling time = 10 seconds, Kv = 200. Make displacement for the arm of a hard disk drive has any required second-order approximations. been identified as
U{S}
x _ X{s) _ 3.3333 x 104
~ F(s) ~
b. Use MATLAB or any other compu- ^JJATLA8 ter program to test your second- ^EJ^B order approximation by simulating the system for your designed value of Kand lag-lead compensator.
?
The position of the arm will be controlled using the feedback loop shown in Figure Pll.l (Yan, 2003). a. Design a lead compensator to achieve closed-loop stability with a transient response of 16% over- 31. For the heat exchange system described in Problem 36, Chapter 9 (Smith, 2002): shoot and a settling time of 2 msec for a step input.
//svs(.v) Pitch command
Momentum
FIGURE P11.5
Disturbance ^,/ = ^
Pitch dynamic
output
Problems a. Design a passive lag-lead compensator to achieve 5% steady-state error with a transient response of 10% overshoot and a settling time of 60 seconds for step inputs. b. Use MATLAB to simulate and verify your design.
MATLAB
32. Active front steering is used in front-steering fourwheel cars to control the yaw rate of the vehicle as a function of changes in wheel-steering commands. For a certain car, and under certain conditions, it has been shown that the transfer function from steering wheel angle to yaw rate is given by {Zhang, 2008): P(s) =
28.4s + 119.7 s2 + 7.155 + 14.7
The system is controlled in a unity-feedback configuration. a. Use the Nichols chart and follow the procedure of Example 11.5 to design a lag-lead compensator such that the system has zero steady-state error for a step input. The bandwidth of the closed-loop system must be COB = 10 rad/sec. Let the open-loop magnitude response peak be less than 1 dB and the steady-state error constant Kv = 20. b. Relax the bandwidth requirement to cog > 10 rad/sec. Design the system for a steady-state error of zero for a step input. Let the openloop magnitude response peak be less than 1 dB and Kv = 20 using only a lead compensator. c. Simulate the step response of b o th designs using MAT LAB .
MATLAB ( Q B
PROGRESSIVE ANALYSIS AND DESIGN PROBLEMS 33. High-speed rail pantograph. Problem 21 in Chapter 1 discusses active control of a pantograph mechanism for high-speed rail systems. In Problem 79(a), Chapter 5, you found the block diagram for the active pantograph control system. In Chapter 8, Problem 72, you designed the gain to yield a closed-loop step response with 38% overshoot. A plot of the step response should have shown a settling time greater than 0.5 second as well as a high-frequency oscillation superimposed over the step response. In Chapter 9, Problem 55, we reduced the settling time to about 0.3 second, reduced the step response steady-state error to zero, and
659
eliminated the high-frequency oscillations using a notch filter (O'Connor, 1997). Using the equivalent forward transfer function found in Chapter 5 cascaded with the notch filter specified in Chapter 9, design, using frequency response techniques, a lag-lead compensator to meet the following specifications: a. At least 35° phase margin b. A maximum of 10% steady-state error for the closed-loop step response c. At least 35 rad/s bandwidth 34. Control of HIV/AIDS. In Chapter 6, the model for an HIV/AIDS patient treated with RTIs was linearized and shown to be P(s) =
Y(s) [/1(5)
-520s - 10.3844 53 + 2.681752 + 0.115 + 0.0126
-520(5 + 0.02) " (5 + 2.2644)(52 + 0.045 + 0.0048) It is assumed here that the patient will be treated and monitored using the closed-loop configuration shown in Figure P l l . l Since the plant has a negative dc gain, assume for simplicity that G{s) — Gc(s) P(s) and G c (0) < 0. Assume also that the specifications for the design are (1) zero steadystate error for step inputs, (2) overdamped timedomain response, and (3) settling time Ts os 100 days (Craig, 2004). a. The overdamped specification requires a <&M ~ 90°. Find the corresponding bandwidth required to satisfy the settling time requirement. b. The zero steady-state error specification implies that the open-loop transfer function must be augmented to Type 1. The —0.02 zero of the plant adds too much phase lead at low frequencies, and the complex conjugate poles, if left uncompensated within the loop, result in undesired oscillations in the time domain. Thus, as an initial approach to compensation for this system we can try G,
5
=
-K(s2 + 0.04s + 0.0048) s{s + 0.02)
For K = 1, make a Bode plot of the resulting system. Obtain the value of K necessary to achieve the design demands. Check for closed-loop stability.
660
Chapter 11
Design via Frequency Response
c. Simulate the unit step resMATLAB ponse of the system using MAT- ^ ^ J ^ ) LAB. Adjust K to achieve the desired response. 35. Hybrid vehicle. In Part b of Problem 10.55 we used a proportional-plus-integral (PI) speed controller that resulted in an overshoot of 20% and a settling time, Ts = 3.92 seconds (Preitl, 2007). a. Now assume that the system specifications require a steady-state error of zero for a step input, a ramp input steady-state error <2%, a %OS < 4.32%, and a settling time < 4 seconds. One way to achieve these requirements is to cancel the Pi-controller's zero, Z/, with the real pole of the uncompensated system closest to the origin (located at —0.0163). Assuming exact cancellation is possible, the plant and controller transfer function becomes G(5) =
b. In most cases, perfect pole-zero cancellation is not possible. Assume that you want to check what happens if the Pi-controller's zero changes by ± 20%, e.g., if Z/ moves to: or to
Case 1:-0.01304 Case 2: -0.01956.
The plant and controller transfer function in these cases will be, respectively: Case 1: G(s) =
£ ( s + 0.6)(.y+ 0.01304) 5(5 + 0.0163)(5 + 0.5858)
Case 2: G(s) =
£(5 + 0.6)(5 + 0.01956) 5(5 + 0.0163)(5 + 0.5858)
K(s + 0.6) s(s + 0.5858)
Design the system to meet the requirements. You may use the following steps: i. Set the gain, K, to the value required by the steady-state error specifications. Plot the Bode magnitude and phase diagrams. ii.
settling time is less than 4 seconds and whether the requirement of a %OS < 4.32% has been met. Redesign if the simulation shows that the %OS and/or the steady-state error requirements have not been met. If all requirements are met, you have completed the design.
Calculate the required phase margin to meet the damping ratio or equivalently the %OS requirement, using Eq. (10.73). If the phase margin found from the Bode plot obtained in Step i is greater than the required value, simulate the system to check whether the
Set K in each case to the value required by the steady-state error specifications and plot the Bode magnitude and phase diagrams. Simulate the closedloop step response for each of the three locations of Zf. pole/zero cancellation, Case 1, and Case 2, given in the problem. Do the responses obtained resemble a secondorder overdamped, critically damped, or underdamped response? Is there a need to add a derivative mode?
Cyber Exploration Laboratory Experiment 11.1 Objectives To design a PID controller using MATLAB's SISO Design Tool. To see the effect of a PI and a PD controller on the magnitude and phase responses at each step of the design of a PID controller. M i n i m u m R e q u i r e d Software System Toolbox
Packages
MATLAB, and the Control
Prelab 1. What is the phase margin required for 12% overshoot? 2. What is the bandwidth required for 12% overshoot and a peak time of 2 seconds?
Bibliography
3. Given a unity feedback system with G(s) = — —, —, what is the gain, K, & s(s + l)(s + 4) required to yield the phase margin found in Prelab 1? What is the phase-margin frequency? 4. Design a PI controller to yield a phase margin 5° more than that found in Prelab 1. 5. Complete the design of a PID controller for the system of Prelab 3. Lab 1. Using MATLAB's SISO Design Tool, set up the system of Prelab 3 and display the open-loop Bode plots and the closed-loop step response. 2. Drag the Bode magnitude plot in a vertical direction until the phase margin found in Prelab 1 is obtained. Record the gain K, the phase margin, the phase-margin frequency, the percent overshoot, and the peak time. Move the magnitude curve up and down and note the effect upon the phase curve, the phase margin, and the phase-margin frequency. 3. Design the PI controller by adding a pole at the origin and a zero one decade below the phase-margin frequency found in Lab 2. Readjust the gain to yield a phase margin 5° higher than that found in Prelab 1. Record the gain K, the phase margin, the phase-margin frequency, the percent overshoot, and the peak time. Move the zero back and forth in the vicinity of its current location and note the effect on the magnitude and phase curve. Move the magnitude curve up and down and note its effect on the phase curve, the phase margin, and the phase-margin frequency. 4. Design the PD portion of the PID controller by first adjusting the magnitude curve to yield a phase-margin frequency slightly below the bandwidth calculated in Prelab 2. Add a zero to the system and move it until you obtain the phase margin calculated in Prelab 1. Move the zero and note its effect. Move the magnitude curve and note its effect. Postlab 1. Compare the Prelab PID design with that obtained via the SISO Design Tool. In particular, compare the gain K, the phase margin, the phase-margin frequency, the percent overshoot, and the peak time. 2. For the uncompensated system, describe the effect of changing gain on the phase curve, the phase margin, and the phase-margin frequency. 3. For the PI-compensated system, describe the effect of changing gain on the phase curve, the phase margin, and the phase-margin frequency. Repeat for changes in the zero location. 4. For the PID-compensated system, describe the effect of changing gain on the phase curve, the phase margin, and the phase-margin frequency. Repeat for changes in the PD zero location.
J Bibliography J Barkana, I. Classical and Simple Adaptive Control of Nonminimum Phase Autopilot Design. Journal of Guidance, Control, and Dynamics, vol. 28, 2005, pp. 631-638. Cochran, J. E., Innocenti, M., No, T. S., and Thukral, A. Dynamics and Control of Maneuverable Towed Flight Vehicles. Journal of Guidance, Control, and Dynamics, vol. 15, no. 5, September-October 1992, pp. 1245-1252.
Chapter 11
Design via Frequency Response
Craig, I. K., Xia, X., and Venter, J. W. Introducing HIV/AIDS Education into the Electrical Engineering Curriculum at the University of Pretoria. IEEE Transactions on Education, vol. 47, no. 1, February 2004, pp. 65-73. D'Azzo, J. X, and Houpis, C. H. Feedback Control System Analysis and Synthesis, 2d ed. McGraw-Hill, New York, 1966. Dorf, R. C. Modern Control Systems, 5th ed. Addison-Wesley, Reading, MA, 1989. Flower, T. L., and Son, M. Motor Drive Mechanics and Control Electronics for a High Performance Plotter. HP Journal, November 1981, pp. 12-15. Hollot, C. V, Misra, V., Towsley, D., and Gong, W. A Control Theoretic Analysis of RED. Proceedings of IEEE INFOCOM, 2001, pp. 1510-1519. Hostetter, G. H., Savant, C. J., and Stefani, R. T. Design of Feedback Control Systems, 2d ed. Saunders College Publishing, New York, 1989. Kuo, B. C. Automatic Control Systems, 5th ed. Prentice Hall, Upper Saddle River, NJ, 1987. O'Connor, D. N , Eppinger, S. D., Seering, W. P., and Wormly, D. N. Active Control of a HighSpeed Pantograph. Journal of Dynamic Systems, Measurements, and Control, vol. 119, March 1997, pp. 1-4. Ogata, K. Modern Control Engineering, 2d ed. Prentice Hall, Upper Saddle River, NJ, 1990. Phillips, C. L., and Harbor, R. D. Feedback Control Systems. Prentice Hall, Upper Saddle River, NJ, 1988. Piper, G. E., and Kwatny, H. G. Complicated Dynamics in Spacecraft Attitude Control Systems. Journal of Guidance, Control, and Dynamics, vol. 15, no. 4, July-August 1992, pp. 825-831. Preitl, Z., Bauer, P., and Bokor, J. A Simple Control Solution for Traction Motor Used in Hybrid Vehicles. Fourth Jnternational Symposium on Applied Computational Inteligence and Informatics. IEEE, 2007. Raven, F. H. Automatic Control Engineering, 4th ed. McGraw-Hill, New York, 1987. Smith, C. A. Automated Continuous Process Control. Wiley, New York, 2002. Stefanides, E. J. Self-Guided Vehicles Upgrade Materials Handling. Design News, 7, December 1987, pp. 80-81. Tasch, U , Koontz, J. W, Ignatoski, M. A., and Geselowitz, D. B. An Adaptive Aortic Pressure Observer for the Penn State Electric Ventricular Assist Device. IEEE Transactions on Biomedical Engineering, vol. 37, 1990, pp. 374-383. Yan, X, and Lin, R. Experimental Modeling and Compensation of Pivot Nonlinearity in Hard Disk Drives. IEEE Transactions on Magnetics, vol. 39, 2003, pp. 1064-1069. Zhang, J.-Y, Kim, J.-W., Lee, K.-B., and Kim, Y.-B. Development of an Active Front Steering (AFS) System With QFT Control. International Journal of Automotiv Technology, vol. 9, no. 6, 2008, pp. 695-702.
Design via State Space
This chapter covers only state-space methods.
^Chapter Learning Outcomes J ) After completing this chapter the student will be able to-. •
Design a state-feedback controller using pole placement for systems represented in phase-variable form to meet transient response specifications (Sections 12.1-12.2)
• Determine if a system is controllable (Section 12.3) • Design a state-feedback controller using pole placement for systems not represented in phase-variable form to meet transient response specifications (Section 12.4) • Design a state-feedback observer using pole placement for systems represented in observer canonical form (Section 12.5) • Determine if a system is observable (Section 12.6) • Design a state-feedback observer using pole placement for systems not represented in observer canonical form (Section 12.7) • Design steady-state error characteristics for systems represented in state space (Section 12.8
12
State Space
mm
664
Chapter 12
Design via State Space
^ C a s e Study Learning Outcomes^ You will be able to demonstrate your knowledge of the chapter objectives with case studies as follows: • Given the antenna azimuth position control system shown on the front endpapers, you will be able to specify all closed-loop poles and then design a state-feedback controller to meet transient response specifications. • Given the antenna azimuth position control system shown on the front endpapers, you will be able to design an observer to estimate the states. • Given the antenna azimuth position control system shown on the front endpapers, you will be able to combine the controller and observer designs into a viable compensator for the system.
£12.1 Introduction Chapter 3 introduced the concepts of state-space analysis and system modeling. We showed that state-space methods, like transform methods, are simply tools for analyzing and designing feedback control systems. However, state-space techniques can be applied to a wider class of systems than transform methods. Systems with nonhnearities, such as that shown in Figure 12.1, and multiple-input, multiple-output systems are just two of the candidates for the state-space approach. In this book, however, we apply the approach only to linear systems. In Chapters 9 and 11, we applied frequency domain methods to system design. The basic design technique is to create a compensator in cascade with the plant or in
FIGURE 12.1 A robot in a hospital pharmacy selects medications by bar code
12.2 Controller Design the feedback path that has the correct additional poles and zeros to yield a desired transient response and steady-state error. One of the drawbacks of frequency domain methods of design, using either root locus or frequency response techniques, is that after designing the location of the dominant second-order pair of poles, we keep our fingers crossed, hoping that the higher-order poles do not affect the second-order approximation. What we would like to be able to do is specify all closed-loop poles of the higher-order system. Frequency domain methods of design do not allow us to specify all poles in systems of order higher than 2 because they do not allow for a sufficient number of unknown parameters to place all of the closed-loop poles uniquely. One gain to adjust, or compensator pole and zero to select, does not yield a sufficient number of parameters to place all the closed-loop poles at desired locations. Remember, to place n unknown quantities, you need n adjustable parameters. State-space methods solve this problem by introducing into the system (1) other adjustable parameters and (2) the technique for finding these parameter values, so that we can properly place all poles of the closed-loop system.1 On the other hand, state-space methods do not allow the specification of closed-loop zero locations, which frequency domain methods do allow through placement of the lead compensator zero. This is a disadvantage of state-space methods, since the location of the zero does affect the transient response. Also, a state-space design may prove to be very sensitive to parameter changes. Finally, there is a wide range of computational support for state-space methods; many software packages support the matrix algebra required by the design process. However, as mentioned before, the advantages of computer support are balanced by the loss of graphic insight into a design problem that the frequency domain methods yield. This chapter should be considered only an introduction to state-space design; we introduce one state-space design technique and apply it only to linear systems. Advanced study is required to apply state-space techniques to the design of systems beyond the scope of this textbook.
^12.2
Controller Design
This section shows how to introduce additional parameters into a system so that we can control the location of all closed-loop poles. An nth-order feedback control system has an «th-order closed-loop characteristic equation of the form sn + an-isn-1 + • • • + a\s + ao = 0
(12.1)
Since the coefficient of the highest power of s is unity, there are n coefficients whose values determine the system's closed-loop pole locations. Thus, if we can introduce n adjustable parameters into the system and relate them to the coefficients in Eq. (12.1), all of the poles of the closed-loop system can be set to any desired location.
This is an advantage as long as we know where to place the higher-order poles, which is not always the case. One course of action is to place the higher-order poles far from the dominant second-order poles or near a closed-loop zero to keep the second-order system design valid. Another approach is to use optimal control concepts, which are beyond the scope of this text.
666
Chapter 12
Design via State Space
Topology for Pole Placement In order to lay the groundwork for the approach, consider a plant represented in state space by x = Ax + BH
(12.2a)
y = Cx
(12.2b)
and shown pictorially in Figure 12.2(a), where light lines are scalars and the heavy lines are vectors. In a typical feedback control system, the output, y, is fed back to the summing junction. It is now that the topology of the design changes. Instead of feeding back y, what if we feed back all of the state variables? If each state variable is fed back to the control, u, through a gain, kh there would be n gains, k& that could be adjusted to yield the required closed-loop pole values. The feedback through the gains, kh is represented in Figure 12.2(b) by the feedback vector -K. The state equations for the closed-loop system of Figure 12.2(6) can be written by inspection as x = Ax + Bu = Ax + B(-Kx + r) = (A - BK)x + Br
(12.3a)
y = Cx
(12.3b)
Before continuing, you should have a good idea of how the feedback system of Figure 12.2(6) is actually implemented. As an example, assume a plant signal-flow graph in phase-variable form, as shown in Figure 12.3(a). Each state variable is then fed back to the plant's input, u, through a gain, kt, as shown in Figure 12.3(6). Although we will cover other representations later in the chapter, the phase-variable
+ x^y,
x
X
I
y
C
+ ii
A (a)
r
tf
^
"v2 9
" *
B
£&?^ *» +i
P
i A
FIGURE 12.2 a. State-space representation of a plant; b. plant with state-variable feedback
-K
m
X
C
>'
12.2 Controller Design
667
o—»
-k,
form, with its typical lower companion system matrix, or the controller canonical form, with its typical upper companion system matrix, yields the simplest evaluation of the feedback gains. In the ensuing discussion, we use the phase-variable form to develop and demonstrate the concepts. End-of-chapter problems will give you an opportunity to develop and test the concepts for the controller canonical form. The design of state-variable feedback for closed-loop pole placement consists of equating the characteristic equation of a closed-loop system, such as that shown in Figure 12.3(6), to a desired characteristic equation and then finding the values of the feedback gains, fc,-. If a plant like that shown in Figure 123(a) is of high order and not represented in phase-variable or controller canonical form, the solution for the fc/s can be intricate. Thus, it is advisable to transform the system to either of these forms, design the &,'s, and then transform the system back to its original representation. We perform this conversion in Section 12.4, where we develop a method for performing the transformations. Until then, let us direct our attention to plants represented in phase-variable form.
FIGURE 12.3 a. Phasevariable representation for plant; b. plant with statevariable feedback
Chapter 12
Design via State Space
Pole Placement for Plants in Phase-Variable Form To apply pole-placement methodology to plants represented in phase-variable form, we take the following steps: 1. Represent the plant in phase-variable form. 2. Feed back each phase variable to the input of the plant through a gain, kt. 3. Find the characteristic equation for the closed-loop system represented in Step 2. 4. Decide upon all closed-loop pole locations and determine an equivalent characteristic equation. 5. Equate like coefficients of the characteristic equations from Steps 3 and 4 and solve for kt. Following these steps, the phase-variable representation of the plant is given by Eq. (12.2), with
0 1 0 A = -&H-1
C = [C]
c2
roi ;
0 B =
-
.1. (12.4)
••• c„]
The characteristic equation of the plant is thus sn + an-isn~l + • • • + a\s + a0 = 0
(12.5)
Now form the closed-loop system by feeding back each state variable to u, forming u = -Kx
(12.6)
where K=[h
k2
•••
k„]
(12.7)
The k/s are the phase variables' feedback gains. Using Eq. (12.3a) with Eqs. (12.4) and (12.7), the system matrix, A - BK, for the closed-loop system is
(12.8)
A-BK = _-(ao + fci) ~{a\+k2)
-(a2 + k3)
-(an-i
+ k„)
Since Eq. (12.8) is in phase-variable form, the characteristic equation of the closedloop system can be written by inspection as detfal - (A - BK)) = sn + (a„_, + kuV'1
+ (««-2 + fc„-iK~2
+ ---(^1 + ^ + ( ^ 0 + ^1)=0
(12.9)
Notice the relationship between Eqs. (12.5) and (12.9). For plants represented in phase-variable form, we can write by inspection the closed-loop characteristic equation from the open-loop characteristic equation by adding the appropriate kt to each coefficient.
12.2
Controller Design
Now assume that the desired characteristic equation for proper pole placement is + d2s2 + dis + d0 = 0
M 1- l Sn + Cln-is"' + dn-2SJi-2
(12.10)
where the d/s are the desired coefficients. Equating Eqs. (12.9) and (12.10), we obtain di = at + ki+i i = 0, 1, 2,..., n - 1
(12.11)
from which ki+\ =4i-
Qi
(12.12)
Now that we have found the denominator of the closed-loop transfer function, let us find the numerator. For systems represented in phase-variable form, we learned that the numerator polynomial is formed from the coefficients of the output coupling matrix, C. Since Figures 12.3(A) and (b) are both in phase-variable form and have the same output coupling matrix, we conclude that the numerators of their transfer functions are the same. Let us look at a design example.
Example 12.1 Controller Design for Phase-Variable Form PROBLEM:
Given the plant
G(s) =
20(5 + 5) 5(5 + 1)(^ + 4)
(12.13)
design the phase-variable feedback gains to yield 9.5% overshoot and a settling time of 0.74 second. SOLUTION: We begin by calculating the desired closed-loop characteristic equation. Using the transient response requirements, the closed-loop poles are -5.4 + /7.2. Since the system is third-order, we must select another closed-loop pole. The closed-loop system will have a zero at —5, the same as the open-loop system. We could select the third closed-loop pole to cancel the closed-loop zero. However, to demonstrate the effect of the third pole and the design process, including the need for simulation, let us choose -5.1 as the location of the third closed-loop pole. Now draw the signal-flow diagram for the plant. The result is shown in Figure 12.4(a). Next feed back all state variables to the control, w, through gains %, as shown in Figure 12.4(b). Writing the closed-loop system's state equations from Figure 12.4(6), we have
x =
0 0
1 0
-*1
- ( 4 + *2)
y = [100 20 0]x
0 0 x+ 0 1 1 -(5 + ^ ) .
(12.14a) ;i2.14b)
669
670
Chapter 12
Design via State Space
-4 (a)
FIGURE 12.4 a. Phase-variable representation for plant of Example 12.1; b. plant with state-variable feedback
Comparing Eqs. (12.14) to Eqs. (12.3), we identify the closed-loop system matrix as
A-BK
0 0
-h
1 0
0 1
(12.15)
-(4+ *2) ~(5 + /c3;
To find the closed-loop system's characteristic equation, form det(sl - (A - BK)) =s3 + (5 + k3)s2 + (4 + k2)s + kx = 0
:12.16)
This equation must match the desired characteristic equation, s3 + 15.9s2 + 136.085 + 413.1 = 0
(12.17)
formed from the poles -5.4 + /7.2, -5.4 - /7.2, and -5.1, which were previously determined. Equating the coefficients of Eqs. (12.16) and (12.17), we obtain ki = 413.1; k2 = 132.08; k3 = 10.9
(12.18)
12.2 Controller Design
671
0.30 -
0.25 -
0.20 -
°
0.15 -
0.10 -
0.05 -
1.0 Time (seconds)
1.5
2.0
FIGURE 12.5 Simulation of closed-loop system of Example 12.1
Finally, the zero term of the closed-loop transfer function is the same as the zero term of the open-loop system, or (5 + 5). Using Eqs. (12.14), we obtain the following state-space representation of the closed-loop system: 0 1 0 0 x+ 0 0 0 1 -413.1 -136.08 -15.9 1
x =
y = (100 20 0]x
(12.19a) (12.19b)
The transfer function is
T(s) =
20(^ + 5) 5 + 15.9^2 + 136.085 + 413.1 3
(12.20)
Figure 12.5, a simulation of the closed-loop system, shows 11.5% overshoot and a settling time of 0.8 second. A redesign with the third pole canceling the zero at —5 will yield performance equal to the requirements. Since the steady-state response approaches 0.24 instead of unity, there is a large steady-state error. Design techniques to reduce this error are discussed in Section 12.8. Students who are using MATLAB should now run chl2pl in Appendix B. You will learn how to use MATLAB to design a controller for phase variables using pole placement. MATLAB will plot the step response of the designed system. This exercise solves Example 12 .1 using MATLAB.
MATLAB
Chapter 12
672
Design via State Space
Skill-Assessment Exercise 12.1 WileyPLUS
PROBLEMS: For the plant
Conlrol Solutions
100(5 + 10)
G « = 5(5 + 3)(5+12)
Tryltl2.1 Use MATLAB, the Control System Toolbox, and the following statements to solve for the phase-variable feedback gains to place the poles of the system in Skill-Assessment Exercise 12.1 at - 3 + /5, - 3 - y'5. and - 1 0 . A=[0 1 0 001 0-36-15] B=[0;0;1] poles=[_3+5j, . . . -3-5j,-10] K=acker(A,B,poles)
represented in the state space in phase-variable form by "0 1 0 0 1 x+ x = Ax -j-Bu — 0 0 -36 -15 v = C x = [ 1 0 0 0 100 0]x design the phase-variable feedback gains to yield 5% overshoot and a peak time of 0.3 second. ANSWER:
K = [2094
373.1
14.97]
The complete solution is located at www.wiley.com/college/nise.
In this section, we showed how to design feedback gains for plants represented in phase-variable form in order to place all of the closed-loop system's poles at desired locations on the 5-plane. On the surface, it appears that the method should always work for any system. However, this is not the case. The conditions that must exist in order to uniquely place the closed-loop poles where we want them is the topic of the next section.
¢12.3 Controllability Consider the parallel form shown in Figure 12.6(A). To control the pole location of the closed-loop system, we are saying implicitly that the control signal, u, can control the behavior of each state variable in x. If any one of the state variables cannot be controlled by the control u, then we cannot place the poles of the system where we desire. For example, in Figure 12.6(b), if Xi were not controllable by the control signal and if x1 also exhibited an unstable response due to a nonzero initial condition, there would be no way to effect a state-feedback design to stabilize 3¾ Xi would perform in its own way regardless of the control signal, u. Thus, in some systems, a state-feedback design is not possible. We now make the following definition based upon the previous discussion: If an input to a system can be found that takes every state variable from a desired initial state to a desired final state, the system is said to be controllable; otherwise, the system is uncontrollable. Pole placement is a viable design technique only for systems that are controllable. This section shows how to determine, a priori, whether pole placement is a viable design technique for a controller.
12.3 Controllability
FIGURE 12.6 Comparison of a. controllable and b. uncontrollable systems
Controllability by Inspection We can explore controllability from another viewpoint: that of the state equation itself. When the system matrix is diagonal, as it is for the parallel form, it is apparent whether or not the system is controllable. For example, the state equation for Figure 12.6(a) is
x=
-at 0 0 -at 0 0
0 0 -fl3
1
x+ 1
(12.21)
_1_
or X\ = — a\X\
x2 = x3 -
-dlXi
+u
(12.22a)
+M
(12.22b)
-a3x3 + u
(12.22c)
673
674
Chapter 12
Design via State Space
Since each of Eqs. (12.22) is independent and decoupled from the rest, the control u affects each of the state variables. This is controllability from another perspective. Now let us look at the state equations for the system of Figure 12.6(6):
x =
-fl 4
0
0
0
-«5
0
0
0
-06.
0
x+
1 1_
(12.24a)
X\ = —«4*i
*3
(12.24b)
«5*2
x2 =
(12.23)
-a6x3 + u
=
(12.24c)
From the state equations in (12.23) or (12.24), we see that state variable Xi is not controlled by the control u. Thus, the system is said to be uncontrollable. In summary, a system with distinct eigenvalues and a diagonal system matrix is controllable if the input coupling matrix B does not have any rows that are zero.
The Controllability Matrix Tests for controllability that we have so far explored cannot be used for representations of the system other than the diagonal or parallel form with distinct eigenvalues. The problem of visualizing controllability gets more complicated if the system has multiple poles, even though it is represented in parallel form. Further, one cannot always determine controllability by inspection for systems that are not represented in parallel form. In other forms, the existence of paths from the input to the state variables is not a criterion for controllability since the equations are not decoupled. In order to be able to determine controllability or, alternatively, to design state feedback for a plant under any representation or choice of state variables, a matrix can be derived that must have a particular property if all state variables are to be controlled by the plant input, u. We now state the requirement for controllability, including the form, property, and name of this matrix.2 An nth-order plant whose state equation is (12.25)
x = Ax + Bu is completely controllable3 if the matrix CM = [B AB A2B
An ! B
(12.26)
is of rank n, where CM is called the controllability matrix.4 As an example, let us choose a system represented in parallel form with multiple roots. 2
See the work listed in the Bibliography by Ogata (1990: 699-702) for the derivation. Completely controllable means that all state variables are controllable. This textbook uses controllable to mean completely controllable. 4 See Appendix G at www.wiley.com/college/nise for the definition of rank. For single-input systems, instead of specifying rank n, we can say that CM must be nonsingular, possess an inverse, or have linearly independent rows and columns. 3
12.3 Controllability
675
Example 12.2 Controllability via the Controllability Matrix PROBLEM: Given the system of Figure 12.7, represented by a signal-flow diagram, determine its controllability.
FIGURE 12.7 System for Example 12.2
SOLUTION: The state equation for the system written from the signal-flow diagram is 0' 1 0 - 1i 0(>%-}n x+ 0 0 -2_
-1
x - As
liu -
0 1 1
(12.27)
At first it would appear that the system is not controllable because of the zero in the B matrix. Remember, though, that this configuration leads to uncontrollability only if the poles are real and distinct. In this case, we have multiple poles at —1. The controllability matrix is 0 22 B
CM = B AB A B
1 _
1 1
1 -2 -1 -2
1 4_
(12.28)
The rank of CM equals the number of linearly independent rows or columns. The rank can be found by finding the highest-order square submatrix that is nonsingular. The determinant of CM = - 1 - Since the determinant is not zero, the 3 x 3 matrix is nonsingular, and the rank of CM is 3. We conclude that the system is controllable since the rank of CM equals the system order. Thus, the poles of the system can be placed using state-variable feedback design. Students who are usingMATLAB should now run chl2p2 in Appendix B. You will learn how to use MATLAB to test a system for controllability. This exercise solves Example 12.2 usingMATLAB.
In the previous example, we found that even though an element of the input coupling matrix was zero, the system was controllable. If we look at Figure 12.7, we can see why. In this figure, all of the state variables are driven by the input u. On the other hand, if we disconnect the input at either dx\jdt, dx2/dt, or dxi/dt, at least one state variable would not be controllable. To see the effect, let us
MATLAB
Chapter 12
Design via State Space
disconnect the input at dxijdt. This causes the B matrix to become (12.29)
B=
We can see that the system is now uncontrollable, since x\ and x2 are no longer controlled by the input. This conclusion is borne out by the controllability matrix, which is now 22 u l
CM = B AB A B
-
0 0
0 0
1 -2
0 0 4_
(12.30)
Not only is the determinant of this matrix equal to zero, but so is the determinant of any 2 x 2 submatrix. Thus, the rank of Eq. (12.30) is 1. The system is uncontrollable because the rank of CM is 1, which is less than the order, 3, of the system.
Skill-Assessment Exercise 12.2 Trylt 12.2
PROBLEM: Determine whether the system
Use MATLAB, the Control System Toolbox, and the following statements to solve Skill-Assessment Exercise 12.2. A=[-l 1 2 0-15 0 3-4] B=[2;l;l] Cm=ctrb(A,B) Rank=rank(Cm)
x = Ax + Bu =
-1 0 0
2 2 1 -1 5 x + 1 1_ 3 -4_
is controllable. ANSWER: Controllable The complete solution is located at www.wiley.com/college/nise. In summary, then, pole-placement design through state-variable feedback is simplified by using the phase-variable form for the plant's state equations. However, controllability, the ability for pole-placement design to succeed, can be visualized best in the parallel form, where the system matrix is diagonal with distinct roots. In any event, the controllability matrix will always tell the designer whether the implementation is viable for state-feedback design. The next section shows how to design state-variable feedback for systems not represented in phase-variable form. We use the controllability matrix as a tool for transforming a system to phase-variable form for the design of state-variable feedback.
^ 12.4 Alternative Approaches to Controller Design Section 12.2 showed how to design state-variable feedback to yield desired closedloop poles. We demonstrated this method using systems represented in phasevariable form and saw how simple it was to calculate the feedback gains. Many times the physics of the problem requires feedback from state variables that are not phase variables. For these systems we have some choices for a design methodology.
12.4 Alternative Approaches to Controller Design
677
The first method consists of matching the coefficients of det(.sl — (A — BK)) with the coefficients of the desired characteristic equation, which is the same method we used for systems represented in phase variables. This technique, in general, leads to difficult calculations of the feedback gains, especially for higher-order systems not represented with phase variables. Let us illustrate this technique with an example.
Example 12.3 Controller Design by Matching Coefficients PROBLEM: Given a plant, Y(s)/U{s) = 10/[(s + l)(s + 2)], design state feedback for the plant represented in cascade form to yield a 15% overshoot with a settling time of 0.5 second. SOLUTION: The signal-flow diagram for the plant in cascade form is shown in Figure 12.8(a). Figure 12.8(b) shows the system with state feedback added. Writing the state equations from Figure 12.8(6), we have
-2
X =
1
x+
0 r 1
(12.31a) (12.31b)
y= [10 0]x where the characteristic equation is s2 + ( k2 + 3)s + (2/¾ + id + ; -) == 0
(12.32)
Using the transient response requirements stated in the problem, we obtain the desired characteristic equation s2 + 16s + 239.5 = 0
(12.33)
Equating the middle coefficients of Eqs. (12.32) and (12.33), we find k2 = 13. Equating the last coefficients of these equations along with the result for k2 yields yfci = 211.5. 10
»0-
-O.V -1
-2
FIGURE 12.8 a. Signal-flow graph in cascade form for G(s) = 10/[(s+l){s + 2)}; b. system with state feedback added
678
Chapter 12
Design via State Space
The second method consists of transforming the system to phase variables, designing the feedback gains, and transforming the designed system back to its original state-variable representation. 5 This method requires that we first develop the transformation between a system and its representation in phase-variable form. Assume a plant not represented in phase-variable form, z = Az + Bw
(12.34a)
v = Cz
(12.34b)
whose controllability matrix is C Mz = [B AB
A2B---An_1B
(12.35)
Assume that the system can be transformed into the phase-variable (x) representation with the transformation (12.36)
z = Px Substituting this transformation into Eqs. (12.34), we get x= P
(12.37a)
'APX + P^BM
(12.37b)
y = CPx whose controllability matrix is
• • • (p-iAPy*-i(P-iB)]
C Mx = [P- 2 B
(P" 1 AP)(P- 1 B)
(P- I AP) 2 (P" 1 B)
= [P _ 1 B
(P" 1 AP)(P- 1 B)
(P- 1 AP)(P- 1 AP)(P _ 1 B i
(P- 1 AP)(P- 1 AP) = P1[B
AB
A2B
•••
•••
(P-]AP)
(P- 1 AP)(P~ 1 B)]
XnlB
(12.38)
Substituting Eq. (12.35) into (12.38) and solving for P, we obtain P — CMZCMx- l
(12.39)
Thus, the transformation matrix, P, can be found from the two controllability matrices. After transforming the system to phase variables, we design the feedback gains as in Section 12.2. Hence, including both feedback and input, u — —Kxx + r, Eqs. (12.37) becomes x = P-*APX - P ! B K x x + P _ 1 Br = (P _ 1 AP - P ^ B K ^ x + P - 1 B r y = CPx
(12.40a) (12.40b)
Since this equation is in phase-variable form, the zeros of this closed-loop system are determined from the polynomial formed from the elements of CP, as explained in Section 12.2. 5
See the discussions of Ackermann's formula in Franklin (1994) and Ogata (1990), listed in the Bibliography.
12.4 Alternative Approaches to Controller Design
679
Using x = P *z, we transform Eqs. (12.40) from phase variables back to the original representation and get z = Az - BKXP xz + Br = (A - SKxP"1 )z + Br y = Cz
(12.41a) (12.41b)
Comparing Eqs. (12.41) with (12.3), the state variable feedback gain, Kz, for the original system is K, = KXP - l
(12.42)
The transfer function of this closed-loop system is the same as the transfer function for Eqs. (12.40), since Eqs. (12.40) and (12.41) represent the same system. Thus, the zeros of the closed-loop transfer function are the same as the zeros of the uncompensated plant, based upon the development in Section 12.2. Let us demonstrate with a design example.
Example 12.4 Controller Design by Transformation PROBLEM: Design a state-variable feedback controller to yield a 20.8% overshoot and a settling time of 4 seconds for a plant, G(5)
(5 + 4) (s + l)(s + 2)(5 + 5)
(12.43)
that is represented in cascade form as shown in Figure 12.9.
FIGURE 12.9 Signal-flow graph for plant of Example 12.4
SOLUTION: First find the state equations and the controllability matrix. The state equations written from Figure 12.9 are -5 "0" 1 0 0 -2 1 z+ 0 0 -1 1 0
z = A,z + Bzu y = CzZ=[-l
1 0]Z
(12.44a) (12.44b)
from which the controllability matrix is evaluated as CMZ=[BZ
A2BZ
A*B Z ] =
[0
0
1
0
1
-3
1 -1 1 Since the determinant of CMZ is — 1, the system is controllable.
(12.45)
Chapter 12
Design via State Space
We now convert the system to phase variables by first finding the characteristic equation and using this equation to write the phase-variable form. The characteristic equation, det(sl - Az), is det(sl - Az) = s3 + 8s2 + 17s + 10 = 0
(12.46)
Using the coefficients of Eq. (12.46) and our knowledge of the phase-variable form, we write the phase-variable representation of the system as x = Axx + Bxw =
[01 0 1 01 0 1 x+ 0 0 1_ 10 -17 -8_
(12.47a) (12.47b)
y = [4 1 0]x
The output equation was written using the coefficients of the numerator of Eq. (12.43), since the transfer function must be the same for the two representations. The controllability matrix, CMX> for the phase-variable system is
'Mx
Bx
0 0 11 0 1 -8 1 - 8 47 _
AXBX A..BX
(12.48)
Using Eq. (12.39), we can now calculate the transformation matrix between the two systems as
r i 0 01 P = CMzCMx =
(12.49)
5 1 0 10 7 1_
We now design the controller using the phase-variable representation and then use Eq. (12.49) to transform the design back to the original representation. For a 20.8% overshoot and a settling time of 4 seconds, a factor of the characteristic equation of the designed closed-loop system is 52 + 2s + 5. Since the closed-loop zero will be at s = —4, we choose the third closed-loop pole to cancel the closed-loop zero. Hence, the total characteristic equation of the desired closed-loop system is D(s) = (s + 4){s2 + 25 4- 5) = s3 + 6s2 + 1¾ + 20 = 0
(12.50)
The state equations for the phase-variable form with state-variable feedback are (12.51a)
x = (Ax - BxKx)x =
_-(10 + fciJ -(17 + ¾ )
-(8 + fesJ. (12.51b)
v = [4 1 0]x The characteristic equation for Eqs. (12.51) is det(.sl - (Ax - BXKX)) = s3 + {8 + k3x)s2 + (17 + k2x)s + (10 + kXx) =0
(12 52)
Comparing Eq. (12.50) with (12.52), we see that Kx = [/ci.r k2x k3x} = [10 - 4
-2
(12.53)
12.4 Alternative Approaches to Controller Design
681
FIGURE 12.10 Designed system with state-variable feedback for Example 12.4 Using Eqs. (12.42) and (12.49), we can transform the controller back to the original system as K2 = K X P- 1 = [-2Q
10
(12.54)
-2]
The final closed-loop system with state-variable feedback is shown in Figure 12,10, with the input applied as shown. Let us now verify our design. The state equations for the designed system shown in Figure 12.10 with input r are
z = ( A z - B 2 K z ) z + Bz/- = j, = C z z = [ - l
1 0 -5 0 -2 1 z + 20 -10 1
0 0 1
1 0]z
(12.55a)
(12.55b)
Using Eq. (3.73) to find the closed-loop transfer function, we obtain T(s) =
(s + 4) s + 6s2 + 13s + 20 3
1 5-2+2^ + 5
(12.56)
The requirements for our design have been met. Students who are using MATLAB should now run chl2p3 in Appendix B. You will learn how to use MATLAB to design a controller for a plant not represented in phase-variable form. You will see that MATLAB does not require transformation to phase-variable form. This exercise solves Example 12.4 using MATLAB.
MATLAB
^
Skill-Assessment Exercise 12.3 PROBLEM: Design a linear state-feedback controller to yield 20% overshoot and a settling time of 2 seconds for a plant,
WileyPLUS
CZZ29 Control Solutions
m= [s + 9)(s(s ++ 6)8)(^ + 7)
682
Chapter 12
Design via State Space
that is represented in state space in cascade form by [-7 z = Az 4- Bw = y=Cz ANSWER:
= [-l
1
0 -8 0 0 1 0]z
K2 = [-40.23
0" 1 z+ -9 j
62.24
ro" 0 u ij
-14]
The complete solution is located at www.wiley.com/college/nise.
In this section, we saw how to design state-variable feedback for plants not represented in phase-variable form. Using controllability matrices, we were able to transform a plant to phase-variable form, design the controller, and finally transform the controller design back to the plant's original representation. The design of the controller relies on the availability of the states for feedback. In the next section, we discuss the design of state-variable feedback when some or all of the states are not available.
(
12.5 Observer Design Controller design relies upon access to the state variables for feedback through adjustable gains. This access can be provided by hardware. For example, gyros can measure position and velocity on a space vehicle. Sometimes it is impractical to use this hardware for reasons of cost, accuracy, or availability. For example, in powered flight of space vehicles, inertial measuring units can be used to calculate the acceleration. However, their alignment deteriorates with time; thus, other means of measuring acceleration may be desirable (Rockwell International, 1984). In other applications, some of the state variables may not be available at all, or it is too costly to measure them or send them to the controller. If the state variables are not available because of system configuration or cost, it is possible to estimate the states. Estimated states, rather than actual states, are then fed to the controller. One scheme is shown in Figure 12.11(A). An observer, sometimes called an estimator, is used to calculate state variables that are not accessible from the plant. Here the observer is a model of the plant. Let us look at the disadvantages of such a configuration. Assume a plant, x = Ax + Bit
(12.57a)
y = Cx
(12.57b)
x = Ax + Bw
(12.58a)
y = Cx
(12.58b)
and an observer,
Subtracting Eqs. (12.58) from (12.57), we obtain x — x = A(x — x)
(12.59a)
y - y = C(x - x)
(12.59b)
12.5
Plant r=0 + +ji
Observer
Controller
Observer Design
Plant output, y
Plant output, y
Plant Estimated output, y
683
r=0 + +,. Observer
Estimated states, x
Controller
(a)
Estimated states, x
m Estimated output,
Plant output,
FIGURE 12.11 Estimated error output
To controller (c)
Thus, the dynamics of the difference between the actual and estimated states is unforced, and if the plant is stable, this difference, due to differences in initial state vectors, approaches zero. However, the speed of convergence between the actual state and the estimated state is the same as the transient response of the plant since the characteristic equation for Eq. (12.59a) is the same as that for Eq. (12.57a). Since the convergence is too slow, we seek a way to speed up the observer and make its response time much faster than that of the controlled closed-loop system, so that, effectively, the controller will receive the estimated states instantaneously. To increase the speed of convergence between the actual and estimated states, we use feedback, shown conceptually in Figure 12.11(6) and in more detail in Figure 12.11(c). The error between the outputs of the plant and the observer is fed back to the derivatives of the observer's states. The system corrects to drive this error to zero. With feedback we can design a desired transient response into the observer that is much quicker than that of the plant or controlled closed-loop system. When we implemented the controller, we found that the phase-variable or controller canonical form yielded an easy solution for the controller gains. In designing an observer, it is the observer canonical form that yields the easy solution for the observer gains. Figure 12.12(a) shows an example of a third-order plant represented in observer canonical form. In Figure 12.12(6), the plant is configured as an observer with the addition of feedback, as previously described. The design of the observer is separate from the design of the controller. Similar to the design of the controller vector, K, the design of the observer consists of
State-feedback
design using an observer to estimate unavailable state variables: a. open-loop observer; b. closed-loop observer; c exploded view of a closedloop observer, showing feedback arrangement to reduce state-variable estimation error
684
Chapter 12
Design via State Space
FIGURE 12.12 Third-order observer in observer canonical form: a. before the addition of feedback; b. after the addition of feedback
evaluating the constant vector, L, so that the transient response of the observer is faster than the response of the controlled loop in order to yield a rapidly updated estimate of the state vector. We now derive the design methodology. We will first find the state equations for the error between the actual state vector and the estimated state vector, (x - x). Then we will find the characteristic equation for the error system and evaluate the required L to meet a rapid transient response for the observer. Writing the state equations of the observer from Figure 12.11(c), we have x = Ax 4- Bw + L(y - y)
(12.60a)
y = Cx
(12.60b)
But the state equations for the plant are x = Ax + Bu
(12.61a)
y = Cx
(12.61b)
12.5 Observer Design Subtracting Eqs. (12.60) from (12.61), we obtain (x - x) = A(x - x) - L(v - y)
(12.62a)
(y-y) = C(x-x)
(12.62b)
where x - x is the error between the actual state vector and the estimated state vector, and v - y is the error between the actual output and the estimated out-put. Substituting the output equation into the state equation, we obtain the state equation for the error between the estimated state vector and the actual state vector: (x-x) = (A-LC)(x-x)
(12.63a)
(y-y) = C(x-x)
(12.63b)
Letting ex = (x - x), we have ex = (A - LC)e*
(12.64a)
y -1 = Ce,
(12.64b)
Equation (12.64a) is unforced. If the eigenvalues are all negative, the estimated state vector error, ex, will decay to zero. The design then consists of solving for the values of L to yield a desired characteristic equation or response for Eqs. (12.64). The characteristic equation is found from Eqs. (12.64) to be (12.65)
dotptl - (A - LC)] = 0
Now we select the eigenvalues of the observer to yield stability and a desired transient response that is faster than the controlled closed-loop response. These eigenvalues determine a characteristic equation that we set equal to Eq. (12.65) to solve for L. Let us demonstrate the procedure for an nth-order plant represented in observer canonical form. We first evaluate A — LC. The form of A, L, and C can be derived by extrapolating the form of these matrices from a third-order plant, which you can derive from Figure 12.12. Thus,
r-%-1 i o 0 ••• 01 -an-2
0 1 0
•••
h1 h
'
0
10
A-LC =
-m
o o
0
•••
1
0
-(ai +/„-i) . -(«o + /«)
0
0
0---1
0
0
0 - • 0
0]
4-1
0 0 ••• 0. In -] 0 - 0 "-(««-1 + / i ) 1 0 1 0 - - - 0 -(an-2 + h) 0 . -flo
0 0
J
J
(12.66)
685
Chapter 12
Design via State Space
The characteristic equation for A - LC is .^ + ( ^ - 1 + / 0 ^ ^ + ( ^ - 2 + / 2 ^ - 2
(«1 +/„-i)5 (12.67)
+ («0 + In) = 0
Notice the relationship between Eq. (12.67) and the characteristic equation, detfjJ - A) = 0, for the plant, which is ^+^-1^-^^-2^-2
+ a\s +
OQ
=0
(12.68)
Thus, if desired, Eq. (12.67) can be written by inspection if the plant is represented in observer canonical form. We now equate Eq. (12.67) with the desired closed-loop observer characteristic equation, which is chosen on the basis of a desired transient response. Assume the desired characteristic equation is s" + 4 - 1 ^ - 1 + dn-2s"-2 + • • • + d u + do = 0
(12.69)
We can now solve for the /,'s by equating the coefficients of Eqs. (12.67) and (12.69): l, = d„-i - an_i
/ = 1, 2 , . . . , n
(12.70)
Let us demonstrate the design of an observer using the observer canonical form. In subsequent sections we will show how to design the observer for other than observer canonical form.
Example 12.5 Observer Design for Observer Canonical Form PROBLEM: Design an observer for the plant
4) G(s) =(s + 1) {s + 2) (s + 5)
5+ 4 s3 + 852 + 175 + 10
(12.71)
which is represented in observer canonical form. The observer will respond 10 times faster than the controlled loop designed in Example 12.4. SOLUTION:
1. First represent the estimated plant in observer canonical form. The result is shown in Figure 12.13(a). 2. Now form the difference between the plant's actual output, y, and the observer's estimated output, y, and add the feedback paths from this difference to the derivative of each state variable. The result is shown in Figure 12.13(6). 3. Next find the characteristic polynomial. The state equations for the estimated plant shown in Figure 12.13(a) are
x = Ax + Bw = j> = C x = [ l
0
0 -8 1 0 -17 0 1 x + 1 4 -10 0 0 0]x
(12.72a)
(12.72b)
12.5 Observer Design
FIGURE 12.13 a. Signal-flow graph of a system using observer canonical form variables; b. additional feedback to create observer
From Eqs. (12.64) and (12.66), the observer error is -(8 + /1) 1 0 ex = (A - LC)ex = - ( 1 7 + /2) 0 1 [-(10 + /3) 0 oj
(12.73)
Using Eq. (12.65), we obtain the characteristic polynomial s3 + (8 + h)s2 + (17 + i2)s + (lo + /3;
(12.74)
4. Now evaluate the desired polynomial, set the coefficients equal to those of Eq. (12.74), and solve for the gains, /,•. From Eq. (12.50), the closed-loop controlled system has dominant second-order poles at - 1 ±;2. To make our observer 10 times faster, we design the observer poles to be at -10 ±/20. We
687
688
Chapter 12
Design via State Space
O.i
0.2
0.3
Time (seconds) (a)
FIGURE 12.14 Simulation showing response of observer: a. closed-loop; b. open-loop with observer gains disconnected
0.5 0.4 0.3 0.2 0.1 0 -0.1 -0.2 h -0.3 -0.4 -0.5 0
0.1
0.2 Time (seconds) (b)
select the third pole to be 10 times the real part of the dominant second-order poles, or —100. Hence, the desired characteristic polynomial is (s + 100) (s2 + 20s + 500) = s3 + 120? + 2500s + 50,000
(12.75)
Equating Eqs. (12.74) and (12.75), we find h = 112, h = 2483, and /3 = 49,990. A simulation of the observer with an input of r(t) = 100? is shown in Figure 12.14. The initial conditions of the plant were all zero, and the initial condition of X\ was 0.5. Since the dominant pole of the observer is -10 ±/20, the expected settling time should be about 0.4 second. It is interesting to note the slower response in Figure 12.14(b), where the observer gains are disconnected, and the observer is simply a copy of the plant with a different initial condition. MATLAB
Students who are using MATLAB should now run chl2p4 inAppendixB. You will learn how to use MATLAB to design an observer using pole placement. This exercise solves Example 12.5 using MATLAB.
12.6
Observability
689
Skill-Assessment Exercise 12.4 PROBLEM: Design an observer for the plant
G(s) = U
&±S
WileyPLUS
CJJEJ Control Solutions
(5 + 7)(5 + 8)(5 + 9)
whose estimated plant is represented in state space in observer canonical form as -24 1 0 x = Ax + Bw = -191 0 1 -504 0 0 y = C x = ! i 0 0]x The observer will respond 10 times faster than the controlled loop designed in SkillAssessment Exercise 12.3. ANSWER: L = [216 9730 383, 696]T, where T signifies vector transpose The complete solution is located at www.wiley.com/college/nise.
In this section, we designed an observer in observer canonical form that uses the output of a system to estimate the state variables. In the next section, we examine the conditions under which an observer cannot be designed.
(
12.6 Observability
Recall that the ability to control all of the state variables is a requirement for the design of a controller. State-variable feedback gains cannot be designed if any state variable is uncontrollable. Uncontrollabihty can be viewed best with diagonalized systems. The signal-flow graph showed clearly that the uncontrollable state variable was not connected to the control signal of the system. A similar concept governs our ability to create a design for an observer. Specifically, we are using the output of a system to deduce the state variables. If any state variable has no effect upon the output, then we cannot evaluate this state variable by observing the output. The ability to observe a state variable from the output is best seen from the diagonalized system. Figure 12.15(a) shows a system where each state variable can be observed at the output since each is connected to the output. Figure 12.15(6) is an example of a system where all state variables cannot be observed at the output. Here X\ is not connected to the output and could not be estimated from a measurement of the output. We now make the following definition based upon the previous discussion: If the initial-state vector, x(/0), can be found from u(t) and y(t) measured over a finite interval of time from t0, the system is said to be observable; otherwise the system is said to be unobservable.
Trylt 12.3 Use MATLAB, the Control System Toolbox, and the following statements to solve Skill-Assessment Exercise 12.4. A=[-24 1 0 -191 0 1 - 5 0 4 0 0] C=[l 0 0] pos=20 Ts=2 z = ( - l o g ( p o s / 1 0 0 ) ) I. . . ( s q r t ( p i A 2 +. . . l o g ( p o s / 1 0 0 ) "2)); wn=4/(z*Ts); r = r o o t s ([1, 2* z*wn, . . . wn"2]); p o l e s = 1 0 * [ r ' 10* . . . real(r(l))] l = a c k e r (A', C , p o l e s ) '
690
Chapter 12
Design via State Space
FIGURE 12.15 Comparison of a. observable, and b. unobservable systems
Simply stated, observability is the ability to deduce the state variables from a knowledge of the input, u{t), and the output, y(t). Pole placement for an observer is a viable design technique only for systems that are observable. This section shows how to determine, a priori, whether or not pole placement is a viable design technique for an observer.
Observability by Inspection We can also explore observability from the output equation of a diagonalized system. The output equation for the diagonalized system of Figure 12.15(a) is y
= Cx=[l
1 l]x
(12.76)
On the other hand, the output equation for the unobservable system of Figure 12.15(Z?) is v = Cx=[0
1 l]x
(12.77)
Notice that the first column of Eq. (12.77) is zero. For systems represented in parallel form with distinct eigenvalues, if any column of the output coupling matrix is zero, the diagonal system is not observable.
12.6
Observability
The Observability Matrix Again, as for controllability, systems represented in other than diagonahzed form cannot be reliably evaluated for observability by inspection. In order to determine observability for systems under any representation or choice of state variables, a matrix can be derived that must have a particular property if all state variables are to be observed at the output. We now state the requirements for observability, including the form, property, and name of this matrix. An nth-order plant whose state and output equations are, respectively, x = Ax
Bu
(12.78a)
y = Cx
(12.78b)
6
is completely observable if the matrix
r c "l CA
(12.79)
OM =
CA"" 1 . is of rank n, where O M is called the observability matrix.7 The following two examples illustrate the use of the observability matrix.
Example 12.6 Observability via the Observability Matrix PROBLEM: Determine if the system of Figure 12.16 is observable. SOLUTION: The state and output equations for the system are
x = Ax + Bw =
j/ = C x = [ 0
5
0 0
1 0
-4
-3
l]x
0
0
1 x+ 0 1 -2
(12.80a)
(12.80b)
FIGURE 12.16 System of Example 12.6 6
Completely observable means that all state variables are observable. This textbook uses observable to mean completely observable.
7
See Ogata {1990: 706-708) for a derivation.
691
Chapter 12
692
Design via State Space
Thus, the observability matrix, OM, is
c
OM =
CA CA 2
=
0 -4
-12
5 -3 -13
1 3
(12.81)
-9
Since the determinant of OM equals —344, OM is of full rank equal to 3. The system is thus observable. You might have been misled and concluded by inspection that the system is unobservable because the state variable xx is not fed directly to the output. Remember that conclusions about observability by inspection are valid only for diagonalized systems that have distinct eigenvalues. MATLAB
A
Students who are using MATLAB should now run chl2p5 in Appendix B. You will learn how to use MATLAB to test a system for observability. This exercise solves Example 12.6 using MATLAB.
Example 12.7 Unobservability via the Observability Matrix PROBLEM: Determine whether the system of Figure 12.17 is observable.
FIGURE 12.17
System of Example 12.7
SOLUTION: The state and output equations for the system are x = Ax + Bw = y
= Cx=[5
0 1 [-5 -21/4 J
(12.82a) (12.82b)
4]x
The observability matrix, OM, for this system is OM =
C CA
5 4 -20 -16
(12.83)
12.7 Alternative Approaches to Observer Design The determinant for this observability matrix equals 0. Thus, the matrix does not have full rank, and the system is not observable. Again, you might conclude by inspection that the system because all states feed the output. Remember that observability is valid only for a diagonalized representation of a system eigenvalues.
693
observability is observable by inspection with distinct
Skill-Assessment Exercise 12.5 PROBLEM: Determine whether the system -2 - 1 x = Ax + Bu = 0 -2 -7 -8 y = C x = [ 4 6 8]x
Trylt 12.4 -3 1 x+ -9
is observable. ANSWER: Observable The complete solution is located at www.wiley.com/college/nise.
Now that we have discussed observability and the observability matrix, we are ready to talk about the design of an observer for a plant not represented in observer canonical form.
(
12.7 Alternative Approaches to Observer Design
Earlier in the chapter, we discussed how to design controllers for systems not represented in phase-variable form. One method is to match the coefficients of det[sl - (A - BK)] with the coefficients of the desired characteristic polynomial. This method can yield difficult calculations for higher-order systems. Another method is to transform the plant to phase-variable form, design the controller, and transfer the design back to its original representation. The transformations were derived from the controllability matrix. In this section, we use a similar idea for the design of observers not represented in observer canonical form. One method is to match the coefficients of det^I — (A — LC)] with the coefficients of the desired characteristic polynomial. Again, this method can yield difficult calculations for higher-order systems. Another method is first to transform the plant to observer canonical form so that the design equations are simple, then perform the design in observer canonical form, and finally transform the design back to the original representation. Let us pursue this second method. First we will derive the transformation between a system representation and its representation in observer canonical form.
Use MATLAB, the Control System Toolbox, and the following statements to solve Skill-Assessment Exercise 12.5. A = [-2 - 1 - 3 0-2 1 - 7 - 8 -9] C=[4 6 8] Om=obsv(A, C) Rank=rank(Om)
Chapter 12
Design via State Space
Assume a plant not represented in observer canonical form, z = Az + Bw
(12.84a)
y = Cz
(12.84b)
whose observability matrix is C CA CA2
(12.85)
OMZ
CA""2 CA" -1 Now assume that the system can be transformed to the observer canonical form, x, with the transformation (12.86)
z = Px
Substituting Eq. (12.86) into Eqs. (12.84) and premultiplying the state equation by P _ 1 , we find that the state equations in observer canonical form are x = P 1 A P x + P 1 Bw
(12.87a)
y = CPx
(12.87b)
whose observability matrix, OMX, is
OMx
=
CP CP(P 1 AP) CP(P 1 AP)(P~ 1 AP) P) _CP(P-1AP)(P-- 1AP)
(P_1AP)_
r c =
i
CA CA2
p
(12.88)
.CA"- 1 .
Substituting Eq. (12.85) into (12.88) and solving for P, we obtain P
— °Mz OMX
(12.89)
Thus, the transformation, P, can be found from the two observability matrices. After transforming the plant to observer canonical form, we design the feedback gains, Lx, as in Section 12.5. Using the matrices from Eqs. (12.87) and the form suggested by Eqs. (12.64), we have ex = ( P»-i' A P - LxCP)e, v - y = CPex
(12.90a) (12.90b)
Since x = P _1 z, and x = P 1f, then ex = x - x = P 1 e z . Substituting ex = P lex into Eqs. (12.90) transforms Eqs. (12.90) back to the original representation. The result is ez = (A - PLxC)ez y - y = Cez
(12.91a) (12.91b)
12.7 Alternative Approaches to Observer Design Comparing Eq. (12.91a) to (12.64a), we see that the observer gain vector is Lz = LPX
(12.92)
We now demonstrate the design of an observer for a plant not represented in observer canonical form. The first example uses transformations to and from observer canonical form. The second example matches coefficients without the transformation. This method, however, can become difficult if the system order is high.
Example 12.8 Observer Design by Transformation PROBLEM: Design an observer for the plant G(s) =
1 {s + l)(s + 2){s + 5)
(12.93)
represented in cascade form. The closed-loop performance of the observer is governed by the characteristic polynomial used in Example 12.5: s5 + 120s2+ 2500^ + 50,000. SOLUTION: First represent the plant in its original cascade form. -5 0
z = Az + B« =
0 y = Cz = [l
0
1 0] -2 1 0 -1
roi z+ 0
(12.94a)
_i_ (12.94b)
0]z
The observability matrix, OMZ, is
c oMz
=
0 0 1 1 0 -5 25 - 7 1
CA CA 2
(12.95)
whose determinant equals 1. Hence, the plant is observable. The characteristic equation for the plant is det(sl - A) = s3 + 8s2 + 17s + 10 = 0
(12.96)
We can use the coefficients of this characteristic polynomial to form the observer canonical form: x = A x x 4- BXM
(12.97a)
y = cxx
(12.97b)
where -8
1 0
-17
0 0
-10
1 0
C« = [l
0
0
(12.98)
695
Chapter 12
Design via State Space
The observability matrix for the observer canonical form is
OMX
=
0 0 -8 1 0 47 - 8 1
r i
cx " =
^-x"x
C*<
(12.99)
We now design the observer for the observer canonical form. First form (A x — LxCxJ,
JL/x^-'\ —
- 8 1 0" -17 0 1 -10 0 0j
pi] k
-(8 + /0 1
0 01 =
./3.
1 0'
- ( 1 7 + /2)
0
-(IO + /3)
0 0
1 (12.100)
whose characteristic polynomial is det[jl - (A, - LXCX)] = s3 + (8 + h)s2 + (17 + h)s + (10 + /3)
(12.101)
Equating this polynomial to the desired closed-loop observer characteristic equation, s3 + 120s2 + 2500s + 50,000, we find
U =
112 2483 49,990
(12.102)
Now transform the design back to the original representation. Using Eq. (12.89), the transformation matrix is
P = 0**0»
0 ol 1 1 0 -3 1 -1 1
(12.103)
Transforming L x to the original representation, we obtain
U = PL, =
112 2147 47,619
(12.104)
The final configuration is shown in Figure 12.18. A simulation of the observer is shown in Figure 12.19(a). To demonstrate the effect of the observer design, Figure 12.19(6) shows the reduced speed if the observer is simply a copy of the plant and all observer feedback paths are disconnected. Students who are using MATLAB should now run chl2p6 in Appendix B. You will learn how to use MATLAB to design an observer for a plant not represented in observer canonical form. You will see that MATLAB does not require transformation to observer canonical form. This exercise solves Example 12.8 using MATLAB.
12.7 Alternative Approaches to Observer Design
697
Plant 11
s
1
1
xy^VT^ 1 s
1
s
r
-5
_1
1 i
s
1 ^2
V \
1
T1
1
1
1 5
1
-2
-1
T 1
1 S
\-2
-1
1
/ '
\ \ 5
2,147
(
J
J e-
^Sj?
. /
47,619 Observer
FIGURE 12.18 design
Observer
i 0.6 0.4 0.2 *
0 _y
-0.2
-
-0.4 -0.6
)
1
2
3
Time (seconds) (a)
i 0.6 V
0.4
*
0.2 0
y
-0.2 -0.4
(j
i
i
i
1
2
3
Time (seconds) (b)
t,
FIGURE 12.19 Observer design step response simulation: a. closed-loop observer; b. open-loop observer with observer gains disconnected
698
Chapter 12
Design via State Space
Example 12.9 Observer Design by Matching Coefficients PROBLEM: A time-scaled model for the body's blood glucose level is shown in Eq. (12.105). The output is the deviation in glucose concentration from its mean value in mg/100 ml, and the input is the intravenous glucose injection rate in g/kg/hr (Milhorn, 1966). G(s) =
407(^ + 0.916) > + 1.27)(5 + 2.69)
(12.105)
Design an observer for the phase variables with a transient response described by $ = 0.7 and con = 100. SOLUTION: We can first model the plant in phase-variable form. The result is shown in Figure 12.20(a). For the plant, A =
0 -3.42
1 -3.96
(12.106)
C = [372.81 407"
-3.42
407
—OJ
FIGURE 12.20 a. Plant; b. designed observer for Example 12.9
12.7 Alternative Approaches to Observer Design
699
Calculation of the observability matrix, OM = [ C CA ]T, shows that the plant is observable and we can proceed with the design. Next find the characteristic equation of the observer. First we have 0
A-LC =
1
-3.42 -3.96
h
'372.81 407
/2j
-372.81/1
(l-407/i)
[-(3.42+ 372.81/2)
-(3.96 + 407/2) J
,., 2
107)
Now evaluate det[XI - (A - LC)] = 0 in order to obtain the characteristic equation: , f (k + 372.81/0 det[,I - (A - LC)] = det ^ + ^
^
-(l-407/i) 1 j% + ^
+
= k2 + (3.96 + 372.81/i + 407/2)X + (3.42 + 84.39/i + 372.81¾) =0 (12.108) From the problem statement, we want £ = 0.7 and con = 100. Thus, X2 + U0X + 10,000 = 0
(12.109)
Comparing the coefficients of Eqs. (12.108) and (12.109), we find the values l\ and l2 to be -38.397 and 35.506, respectively. Using Eq. (12.60), where A = L =
0 -3.42
1 -3.96
B
C = [372.81 4071;
-38.397 35.506
(12.110)
the observer is implemented and shown in Figure 12.20(b).
Skill-Assessment Exercise 12.6 WileyPLUS
PROBLEM: Design an observer for the plant G(s) =
CJHJ
1
Control Solutions
whose estimated plant is represented in state space in cascade form as -7 1 z = Az + Bw = 0 -8 0 0 y =Cx= [1 0 0]z
0 1 z+ -9
The closed-loop step response of the observer is to have 10% overshoot with a 0.1 second settling time.
700
Chapter 12
Design via State Space
456 " 28,640 1.54 x 106 _
Lz =
The complete solution is located at www.wiley.com/college/nise.
Now that we have explored transient response design using state-space techniques, let us turn to the design of steady-state error characteristics.
£ 12.8 Steady-State Error Design via Integral Control In Section 7.8, we discussed how to analyze systems represented in state space for steady-state error. In this section, we discuss how to design systems represented in state space for steady-state error. Consider Figure 12.21. The previously designed controller discussed in Section 12.2 is shown inside the dashed box. A feedback path from the output has been added to form the error, e, which is fed forward to the controlled plant via an integrator. The integrator increases the system type and reduces the previous finite error to zero. We will now derive the form of the state equations for the system of Figure 12.21 and then use that form to design a controller. Thus, we will be able to design a system for zero steady-state error for a step input as well as design the desired transient response. An additional state variable, x^, has been added at the output of the leftmost integrator. The error is the derivative of this variable. Now, from Figure 12.21, XN
(12.111)
= r - Cx
Writing the state equations from Figure 12.21, we have x = Ax + Bw
(12.112a)
= —Cx + r
(12.112b)
XN
(12.112c)
y = Cx
-&&-*
B
-K
FIGURE 12.21 Integral control for steady-state error design
12.8 Steady-State Error Design via Integral Control Eqs. (12.112) can be written as augmented vectors and matrices. Hence, A -C
x
y = [C
0 x x 0 lN J
(12.113a)
U+
+
x
0]
(12.113b)
XN
But u = - K x + KSXN = - [ K
-Ke
X XN
(12.114)
Substituting Eq. (12.114) into (12.113a) and simplifying, we obtain X1 XN .
=
BKe] r x 0
f(A-BK) -C
y=[C
0]
r + [°1 1
rx 1 XN
(12.115a)
(12.115b)
Thus, the system type has been increased, and we can use the characteristic equation associated with Eq. (12.115a) to design K and Ke to yield the desired transient response. Realize, we now have an additional pole to place. The effect on the transient response of any closed-loop zeros in the final design must also be taken into consideration. One possible assumption is that the closed-loop zeros will be the same as those of the open-loop plant. This assumption, which of course must be checked, suggests placing higher-order poles at the closed-loop zero locations. Let us demonstrate with an example.
Example 12.10 Design of Integral Control PROBLEM: Consider the plant of Eqs. (12.116): x =
0 -3
1 -5
y - 4 1 0]x
(12.116a) (12.116b)
a. Design a controller without integral control to yield a 10% overshoot and a settling time of 0.5 second. Evaluate the steady-state error for a unit step input. b. Repeat the design of (a) using integral control. Evaluate the steady-state error for a unit step input. SOLUTION: a. Using the requirements for settling time and percent overshoot, we find that the desired characteristic polynomial is 52 + 165 + 183.1
(12.117)
701
702
Chapter 12
Design via State Space
Since the plant is represented in phase-variable form, the characteristic polynomial for the controlled plant with state-variable feedback is s2 + (5 + k2)s + (3 + kl)
(12.118)
Equating the coefficients of Eqs. (12.117) and (12.118), we have k2} = [180.1 11]
K=[h
(12.119)
From Eqs. (12.3), the controlled plant with state-variable feedback represented in phase-variable form is x = (A - BK)x + Br = y = Cx = [l
0 -183.1
1 -16
(12.120a)
0]x
(12.120b)
Using Eq. (7.96), we find that the steady-state error for a step input is e(oo) = 1 + C(A-BK) _ 1 B 0 1 = 1 + 11 0 _-183.1 -16 = 0.995
!
T
(12.121)
b. We now use Eqs. (12.115) to represent the integral-controlled plant as follows:
pr 17r o = I .-3 X2
1" -5 J
[01 [h .1. [1 0]
.%.
0 1 - ( 3 + fci) -(5 +£ 2 ) 0 -1 = [1
0
0
k2
[0" .ij 0
\ Xi "
Ke
x2 _XN_
[0 0 " M1 x2 + 0 Ke 1 0 XN
x\ x2
[01 + 0 .1. (12.122a)
(12.122b)
XN
Using Eq. (3.73) and the plant of Eqs. (12.116), we find that the transfer function of the plant is G(s) = l/(s2 + 5s + 3). The desired characteristic polynomial for the closed-loop integral-controlled system is shown in Eq. (12.117). Since the plant has no zeros, we assume no zeros for the closed-loop system and augment Eq. (12.117) with a third pole, (s + 100), which has a real part greater than five times that of the desired dominant second-order poles. The desired third-order closed-loop system characteristic polynomial is (s + 100)(^2 + 16s + 183.1) = s3 + 116s2 + 1783.1s + 18,310
(12.123)
The characteristic polynomial for the system of Eqs. (12.112) is s3 + (5 + k2)s2 + (3 + ki)s + Ke
(12.124)
12.8 Steady-State Error Design via Integral Control
Matching coefficients from Eqs. (12.123) and (12.124), we obtain fci = 1780.1
(12.125a)
^2 = 111
(12.125b)
ke = 18,310
(12.125c)
Substituting these values into Eqs. (12.122) yields this closed-loop integralcontrolled system: 0
1
-1783.1
X2 UJVJ
y=[l
0
-116 18,310
- 1 0
x2
"0" + 0
.XN.
.lj
"Xi '
0
x\ 0 0] x2 xN
(12.126a)
(12.126b)
In order to check our assumption for the zero, we now apply Eq. (3.73) to Eqs. (12.126) and find the closed-loop transfer function to be T(s) =
18,310 s + U6s + 1783.1*+ 18,310 3
(12.127)
2
Since the transfer function matches our design, we have the desired transient response. Now let us find the steady-state error for a unit step input. Applying Eq. (7.96) to Eqs. (12.126), we obtain
e(oo) = l + [l
0 1 0 1 0 0] -1783.1 -116 18,310 - 1 0 0
_1
"0" 0 = 0 1
(12.128)
Thus, the system behaves like a Type 1 system.
Skill-Assessment Exercise 12.7 PROBLEM: Design an integral controller for the plant x =
\ 0
1
- 7 --9 j v = [4 l]x
x+
r° i
to yield a step response with 10% overshoot, a peak time of 2 seconds, and zero steady-state error. ANSWER: K = [2.21 -2.7], Ke = 3.79 The complete solution is located at www.wiley.com/college/nise.
703
704
Chapter 12
Design via State Space
Now that we have designed controllers and observers for transient response and steady-state error, we summarize the chapter with a case study demonstrating the design process.
Case Study Design
Antenna Control: Design of Controller and Observer In this case study, w e use our ongoing antenna azimuth position control system to demonstrate t h e combined design of a controller a n d an observer. We will assume that t h e states are not available and must b e estimated from t h e output. T h e block diagram of t h e original system is shown on t h e front endpapers, Configuration 1. Arbitrarily setting t h e preamplifier gain t o 200 and removing the existing feedback, the forward transfer function is simplified to that shown in Figure 12.22. (/(*•) = E(s)
Y(s) = 0„(.v)
1325 s(s+\.7\)(s+ 100)
FIGURE 12.22 Simplified block diagram of antenna control system shown on the front endpapers (Configuration 1) with K = 200 T h e case study will specify a transient response for the system a n d a faster transient response for t h e observer. T h e final design configuration will consist of the plant, the observer, a n d t h e controller, as shown conceptually in Figure 12.23. The design of t h e observer a n d t h e controller will b e separate. Plant r=0 + ^
M
B
7\
X
3£
/
+9
C
A Observer U
B
+ x~
X
X
/
+
c
^fy*V 1
y
ye A
L
sJ
Controllei
-K
FIGURE 12.23 Conceptual state-space design configuration, showing plant, observer, and controller
Case Study
705
PROBLEM: Using the simplified block diagram of the plant for the antenna azimuth position control system shown in Figure 12.22, design a controller to yield a 10% overshoot and a settling time of 1 second. Place the third pole 10 times as far from the imaginary axis as the second-order dominant pair. Assume that the state variables of the plant are not accessible and design an observer to estimate the states. The desired transient response for the observer is a 10% overshoot and a natural frequency 10 times as great as the system response above. As in the case of the controller, place the third pole 10 times as far from the imaginary axis as the observer's dominant second-order pair. SOLUTION: Controller Design: We first design the controller by finding the desired characteristic equation. A 10% overshoot and a settling time of 1 second yield £ = 0.591 and con — 6.77. Thus, the characteristic equation for the dominant poles is s2 + 8s + 45.8 = 0, where the dominant poles are located at - 4 ±/5.46. The third pole will be 10 times as far from the imaginary axis, or at —40. Hence, the desired characteristic equation for the closed-loop system is (s2 + 8s + 45.8)(5 + 40) = s3 + 48s2 + 365.85 + 1832 = 0
(12.129)
Next we find the actual characteristic equation of the closed-loop system. The first step is to model the closed-loop system in state space and then find its characteristic equation. From Figure 12.22, the transfer function of the plant is 1325 1325 (12.130) 2 s(s + 1.71)(5 + 100) s{s + 101.715 + 171) Using phase variables, this transfer function is converted to the signal-flow graph shown in Figure 12.24, and the state equations are written as follows: G(s) =
x =
0" 0 0 1 x + 0 u = Ax + Bw 1 0 0 1 -101.71 0 -171
(12.131a)
y = [1325 0 0]x = Cx (12.131b) We now pause in our design to evaluate the controllability of the system. The controllability matrix, CM, is 0 0 1 2 1 -101.71 (12.132) C M = [ B AB A B 0 1 -101.71 10,173.92 The determinant of C M is - 1 ; thus, the system is controllable. 1
O
«•
O
l
l
7
s
"
O
" — O
325
*
O
-o
FIGURE 12.24 Signal-flow graph for G(s) = 1325/ [s(s2 + 101.71s + 171)]
706
Chapter 12
Design via State Space
FIGURE 12.25
Plant with state-variable feedback for controller design
Continuing with the design of the controller, we show the controller's configuration with the feedback from all state variables in Figure 12.25. We now find the characteristic equation of the system of Figure 12.25. From Eq. (12.7) and Eq. (12.131a), the system matrix, A — BK, is
A-BK =
0 0 [-ki
1 0 -(171 + ¾)
0 1 -(101.71+¾)]
(12.133)
Thus, the closed-loop system's characteristic equation is det[sl - (A - BK)] = s3 + (101.71 + k3)s2 + (171 + k2)s + % = 0
(12.134)
Matching the coefficients of Eq. (12.129) with those of Eq. (12.134), we evaluate the fc/s as follows: ki = 1832
(12.135a)
k2 = 194.8
(12.135b)
h = -53.71
(12.135c)
Observer Design: Before designing the observer, we test the system for observability. Using the A and C matrices from Eqs. (12.131), the observability matrix, OM, is
c
OM =
CA CA2
=
1325 0 0 0 1325 0 0 0 1325
(12.136)
The determinant of OM is 13253. Thus, OM is of rank 3, and the system is observable. We now proceed to design the observer. Since the order of the system is not high, we will design the observer directly without first converting to observer canonical form. From Eq. (12.64a) we need first to find A - LC. A and C from Eqs. (12.131) along with
L=
(12.137)
Case Study
are used to evaluate A — LC as follows: [-1325/i 1 0 1 0 1 A - L C = -1325/2 -1325/3 -171 -101.71 _ The characteristic equation for the observer is now evaluated as
(12.138)
detpd - (A - LC)] = A3 + (132¾ + 101.71)A2 + (134,800/i + 1325/2 + 171) A + (226,600/i + 134,800/2 + 1325/3) =0 (12.139) From the problem statement, the poles of the observer are to be placed to yield a 10% overshoot and a natural frequency 10 times that of the system's dominant pair of poles. Thus, the observer's dominant poles yield [s2 + (2 x 0.591 x 67.7)5 + 67.72] = (s2 + 80s + 4583). The real part of the roots of this polynomial is —40. The third pole is then placed 10 times farther from the imaginary axis at -400. The composite characteristic equation for the observer is {s2 + 805 + 4583)(5 + 400) = s3 + 480s2 + 36,5805 + 1,833,000 = 0 (12.140) Matching coefficients from Eqs. (12.139) and (12.140), we solve for the observer gains: /i = 0.286
(12.141a)
h = -1-57
(12.141b)
h = 1494 (12.141c) Figure 12.26, which follows the general configuration of Figure 12.23, shows the completed design, including the controller and the observer.
Observer / , = 1494
FIGURE 12.26 Completed statespace design for the antenna azimuth position control system, showing controller and observer
707
Chapter 12
0
FIGURE 12.27 Designed response of antenna azimuth position control system: a. impulse response—plant and observer with the same initial conditions, x\ (0) = x\ (0) = 0; b. portion of impulse response—plant and observer with different initial conditions, 1¾ (0) = 0.006 for the plant, x\ (0) = 0 for the observer
Design via State Space
0.2
0.4
0.6
0.8 1 1.2 1.4 Time (seconds) (a)
1.6
1.8
2.0
0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 Time (seconds) (b)
The results of the design are shown in Figure 12.27. Figure 12.27(a) shows the impulse response of the closed-loop system without any difference between the plant and its modeling as an observer. The undershoot and settling time approximately meet the requirements set forth in the problem statement of 10% and 1 second, respectively. In Figure 12.27(b), we see the response designed into the observer. An initial condition of 0.006 was given to X\ in the plant to make the modeling of the plant and observer different. Notice that the observer's response follows the plant's response by the time 0.06 second is reached. CHALLENGE: You are now given a case study to test your knowledge of this chapter's objectives: You are given the antenna azimuth position control system shown on the front endpapers, Configuration 3. If the preamplifier gain K = 20, do the following: a. Design a controller to yield 15% overshoot and a settling time of 2 seconds. Place the third pole 10 times as far from the imaginary axis as the second-order dominant pole pair. Use physical variables as follows: power amplifier output, motor angular velocity, and motor displacement. b. Redraw the schematic shown on the front endpapers, showing a tachometer that yields rate feedback along with any added gains or attenuators required to implement the state-variable feedback gains.
Summary
709
c. Assume that the tachometer is not available to provide rate feedback. Design an observer to estimate the physical variables' states. The observer will respond with 10% overshoot and a natural frequency 10 times as great as the system response. Place the observer's third pole 10 times as far from the imaginary axis as the observer's dominant second-order pole pair. d. Redraw the schematic on the front endpapers, showing the implementation of the controller and the observer. e. R e p e a t P a r t s a and c u s i n g MATLAB.
^ Summary^ This chapter has followed the path established by Chapters 9 and 11—control system design. Chapter 9 used root locus techniques to design a control system with a desired transient response. Sinusoidal frequency response techniques for design were covered in Chapter 11, and in this chapter we used state-space design techniques. State-space design consists of specifying the system's desired pole locations and then designing a controller consisting of state-variable feedback gains to meet these requirements. If the state variables are not available, an observer is designed to emulate the plant and provide estimated state variables. Controller design consists of feeding back the state variables to the input, u, of the system through specified gains. The values of these gains are found by matching the coefficients of the system's characteristic equation with the coefficients of the desired characteristic equation. In some cases the control signal, u, cannot affect one or more state variables. We call such a system uncontrollable. For this system, a total design is not possible. Using the controllability matrix, a designer can tell whether or not a system is controllable prior to the design. Observer design consists of feeding back the error between the actual output and the estimated output. This error is fed back through specified gains to the derivatives of the estimated state variables. The values of these gains are also found by matching the coefficients of the observer's characteristic equation with the coefficients of the desired characteristic equation. The response of the observer is designed to be faster than that of the controller, so the estimated state variables effectively appear instantaneously at the controller. For some systems, the state variables cannot be deduced from the output of the system, as is required by the observer. We call such systems unobservable. Using the observability matrix, the designer can tell whether or not a system is observable. Observers can be designed only for observable systems. Finally, we discussed ways of improving the steady-state error performance of systems represented in state space. The addition of an integration before the controlled plant yields improvement in the steady-state error. In this chapter, this additional integration was incorporated into the controller design. Three advantages of state-space design are apparent. First, in contrast to the root locus method, all pole locations can be specified to ensure a negligible effect of
MATLAB
«
1
»
Chapter 12
Design via State Space
the nondominant poles upon the transient response. With the root locus, we were forced to justify an assumption that the nondominant poles did not appreciably affect the transient response. We were not always able to do so. Second, with the use of an observer, we are no longer forced to acquire the actual system variables for feedback. The advantage here is that sometimes the variables cannot be physically accessed, or it may be too expensive to provide that access. Finally, the methods shown lend themselves to design automation using the digital computer. A disadvantage of the design methods covered in this chapter is the designer's inability to design the location of open- or closed-loop zeros that may affect the transient response. In root locus or frequency response design, the zeros of the lag or lead compensator can be specified. Another disadvantage of state-space methods concerns the designer's ability to relate all pole locations to the desired response; this relationship is not always apparent. Also, once the design is completed, we may not be satisfied with the sensitivity to parameter changes. Finally, as previously discussed, state-space techniques do not satisfy our intuition as much as root locus techniques, where the effect of parameter changes can be immediately seen as changes in closed-loop pole locations. In the next chapter we return to the frequency domain and design digital systems using gain adjustment and cascade compensation.
(^ Review Questions ^ 1. Briefly describe an advantage that state-space techniques have over root locus techniques in the placement of closed-loop poles for transient response design. 2. Briefly describe the design procedure for a controller. 3. Different signal-flow graphs can represent the same system. Which form facilitates the calculation of the variable gains during controller design? 4. In order to effect a complete controller design, a system must be controllable. Describe the physical meaning of controllability. 5. Under what conditions can inspection of the signal-flow graph of a system yield immediate determination of controllability? 6. In order to determine controllability mathematically, the controllability matrix is formed, and its rank evaluated. What is the final step in determining controllability if the controllability matrix is a square matrix? 7. What is an observer? 8. Under what conditions would you use an observer in your state-space design of a control system? 9. Briefly describe the configuration of an observer. 10. What plant representation lends itself to easier design of an observer? 11. Briefly describe the design technique for an observer, given the configuration you described in Question 9. 12. Compare the major difference in the transient response of an observer to that of a controller. Why does this difference exist? 13. From what equation do we find the characteristic equation of the controllercompensated system? 14. From what equation do we find the characteristic equation of the observer?
Problems
15. In order to effect a complete observer design, a system must be observable. Describe the physical meaning of observability. 16. Under what conditions can inspection of the signal-flow graph of a system yield immediate determination of observability? 17. In order to determine observability mathematically, the observability matrix is formed and its rank evaluated. What is the final step in determining observability if the observability matrix is a square matrix?
Problems 1. Consider the following open-loop transfer functions, where G(s) = Y(s)/U(s), Y(s) is the Laplace transform of the output, and U(s) is the Laplace transform of the input control signal: i. G(s) =
(* + 3)
5 + 4) 2 s ii. G(s) = (s 5)(s + l) 20s(s + 7) iii. G(s) = (5 + 3)(5 + 7)(5 + 9) 30(5 + 2)(5 + 3) iv. G{s) = (5 + 4)(5 + 5)(5 + 6) 85 + 15 v. G(s) = 2 (5 + 45+ 10)(5 2 +35+ 12)
50(52 + 75 + 25) 5(5 + 10)(5 + 20) 50(5 + 3)(5 + 4) G(s) = (5 + 5)(5 + 6)(5 + 7) G{s) =
ii.
d. Write, by inspection, the closed-loop transfer function, T(s), for your closed-loop signal-flow graphs. e. Verify your answers for T(s) by finding the closed-loop transfer functions from the state equations and Eq. (3.73).
30(5 + 2)(5 + 7) 5(5 + 3)(5 + 5)
For each, do the following: [Section: 12.4] a. Draw the signal-flow graph and show the statevariable feedback.
3. The following open-loop transfer functions can be represented by signal-flow graphs in parallel form.
a. Draw the signal-flow graph in phase-variable form. b. Add state-variable feedback to the signal-flow graph. c. For each closed-loop signal-flow graph, write the state equations.
i. G(s) =
*°^
5 ( 5 2 + 3 5 + 7) (5 + 2)(52 + 25 +10)
b. Find the closed-loop transfer function with statevariable feedback.
For each of these transfer functions, do the following: [Section: 12.2]
2. The following open-loop transfer functions can be represented by signal-flow graphs in cascade form.
.. n
wileypius >Yi'i« control solutions
For each, do the following: [Section: 12.4] a. Draw the signal-flow graph and show the statevariable feedback. b. Find the closed-loop transfer function with statevariable feedback. 4. Given the following open-loop plant, [Section: 12.2] G(s) =
20 5 + 2)(5+4)(5 + 8)
design a controller to yield a 15% overshoot and a settling time of 0.75 second. Place the third pole 10 times as far from the imaginary axis as the dominant pole pair. Use the phase variables for state-variable feedback. 5. Section 12.2 showed that controller design is easier to implement if the uncompensated system is represented in phase-variable form with its typical lower companion matrix. We alluded to the fact that the design can just as easily progress using the controller canonical form with its upper companion matrix. [Section: 12.2]
712
Chapter 12
Design via State Space
-1 FIGURE P12.1
a. Redo the general controller design covered in Section 12.2, assuming that the plant is represented in controller canonical form rather than phase-variable form.
10. Given the plant shown in Figure P12.1,
b. Apply your derivation to Example 12.1 if the uncompensated plant is represented in controller canonical form.
11. For each of the plants represented by signal-
6. Given the following open-loop plant: [Section: 12.2]
WileyPLUS
what relationship exists between b\ and b2 to make the system uncontrollable? [Section: 12.3]
wileypius aVJUK control solutions
flow graphs in Figure P12.2, determine the controllability. If the controllability can be determined by inspection, state that it can and then verify your conclusions using the controllability matrix. [Section: 12.3]
Control Solutions
100(^ + 2)(5 + 20) G(s) = (5 + 1)(5 + 3)(5 + 4) design a controller to yield 15% overshoot with a peak time of 0.5 second. Use the controller canonical form for state-variable feedback. 7. Given the following open-loop plant: [Section: 12.2] G{s) =
20(5 + 2) 5(5 + 5)(5 + 7)
design a controller to yield a 10% overshoot and a settling time of 2 seconds. Place the third pole 10 times as far from the imaginary axis as the dominant pole pair. Use the phase variables for state-variable feedback. 8. Repeat Problem 4 assuming that the plant is represented in the cascade form. Do not convert to phasevariable form. [Section: 12.4] 9. Repeat Problem 7 assuming that the plant is represented in the parallel form. Do not convert to phasevariable form. [Section: 12.4]
12. Use MATLAB to determine the
MATLAB
controllability of the systems of Figure P12 .2 (d) and (f) . 13. In Section 12.4, we discussed how to design a controller for systems not represented in phase-variable form with its typical lower companion matrix. We described how to convert the system to phasevariable form, design the controller, and convert back to the original representation. This technique can be applied just as easily if the original representation is converted to controller canonical form with its typical upper companion matrix. Redo Example 12.4 in the text by designing the controller after converting the uncompensated plant to controller canonical form. [Section: 12.4]
14. Consider the following transfer function: G(s) =
(5 + 6) (5 + 3)(5 + 8)(5 + 10)
If the system is represented in cascade form, as shown in Figure P12.3, design a controller to yield
Problems
713
FIGURE P12.2
a closed-loop response of 10% overshoot with a settling time of 1 second. Design the controller by first transforming the plant to phase variables. [Section: 12.4] 15. Use MATLAB t o d e s i g n t h e MATLAB c o n t r o l l e r gains for the tf^Tlfe s y s t e m g i v e n i n P r o b l e m 14 .
tm
i 5+10
Z 3 (5)
16. Repeat Problem 14 assuming that the plant is represented in parallel form. [Section: 12.4] wileypms 17. ^ o p en-loop system of Problem 14 JWiM-l i s represented as shown in Figure P12.4. ^ ^ 6 0 U t P u t °f e a c n b l o c k Control Solutions ' s a s s ' g n e d t o be a state variable, design the controller gains for feedback from these state variables. [Section: 12.4]
] 5+8
FIGURE P12.3
Z 2 (5)
5+6 5+ 3
K(.v)
Chapter 12 U(s]
Design via State Space Z-it*)
1 5+3
K(.s) = Z|(.s)
Zo(.v)
5+ 6
5+10
5+8 FIGURE P12.4
18. If an open-loop plant,
from the imaginary axis than the dominant poles. [Section: 12.5] 21. Design an observer for the plant
100
G(s) =
s(s + 5){s + 9)
is represented in parallel form, design a controller to yield a closed-loop response of 15% overshoot and a peak time of 0.2 second. Design the controller by first transforming the plant to controller canonical form. [Section: 12.4] 19. For a specific individual, the MATLAB linear time-invariant model of the hypothalamic-pituitaryadrenal axis of the endocrine system with five state variables has been found to be
(Kyrylov, Xi
2005)
r _-0.014
C
-1.4
0
0
-0.023
-0.023
0
0
0.67
-0.67
0.38
0.003264
0
0
0.06
-0.06
0
0
0
0.0017
0
-0.001
0.023 x2 x3 — 0.134 X4 .X5_
.
rxn m X
*3
0
+
0 do
X4
0
LX5.
LOJ
10
C( ) W
(s + 3)(s + 7){s + 15) operating with 10% overshoot and 2 seconds peak time. Design the observer to respond 10 times as fast as the plant. Place the observer third pole 20 times as far from the imaginary axis as the observer dominant poles. Assume the plant is represented in observer canonical form. [Section: 12.5] 22. Repeat Problem 20 assuming that the plant is represented in phase-variable form. Do not convert to observer canonical form. [Section: 12.7] 23. Consider the plant wileyPLus
(, + 2) G(s) = 7—^-=-,
were
(s + 5)(s + 9) whose phase variables are not available. Design an observer for the phase variables with a transient response described by £ = 0.6 and co„ — 120. Do not convert to observer canonical form. [Section: 12.7] 24. Determine whether or not each of the systems shown in Figure P12.2 is observable. [Section: 12.6] MATLAB
26. Given the plant of Figure P12.5, what relationship must exist between C\ and c2 in order for the system to be unobservable? [Section: 12.6]
a. Use MATLAB to determine if the system is controllable. b. Use MATLAB to express the matrices A and B in phase-variable form.
20. Consider the plant 1
s(s + 3)(s + l)
whose state variables are not available. Design an observer for the observer canonical variables to yield a transient response described by £ = 0.4 and con = 75. Place the third pole 10 times farther
Control Solutions
w
25. Use MATLAB to determine the observability of the systems of Figure P12.2 (a) and (f) .
The state-variable definitions given in Problem 25, Chapter 3 .
G(s) =
CUE* ^r
-1 FIGURE P 1 2 . 5
Problems
27. Design an observer for the plant 1 G(s) = (.S+ 5)(.5+ 13)(.5+ 20)
design an integral controller to yield a 10% overshoot, 0.5-second settling time, and zero steadystate error for a step input. [Section: 12.8]
represented in cascade form. Transform the plant to observer canonical form for the design. Then transform the design back to cascade form. The characteristic polynomial for the observer is to be s3 + 60052 + 40,000s + 1,500,000. 28. Use MATLAB to design the observer gains for the system given in Problem 27.
MATLAB
29. Repeat Problem 27 assuming that the plant is represented in parallel form. [Section: 12.7] 30. Design an observer for 50 r,x = U (s + 3)(s + 6){s + 9) represented in phase-variable form with a desired performance of 10% overshoot and a settling time of 0.5 second. The observer will be 10 times as fast as the plant, and the observer's nondominant pole will be 10 times as far from the imaginary axis as the observer's dominant poles. Design the observer by first converting to observer canonical form. [Section: 12.7] 31. Observability and controllability properties depend on the state-space representation chosen for a given system. In general, observability and controllability are affected when pole-zero cancellations are present in the transfer function. Consider the following two systems with representations: xt = A(-x/ = B/r y = Qx/;
" 0 11 [01 ; C ; B1 = 1 = -2 -3 1 1 r o °1 0 A2 = C) 1 ; B 2 = 0 C2 = [6 2 0 i L-6 -11 - 6 .
Ai =
r°i
a. Show
that
both
systems have the same Y(s) transfer function G,(s) = —j-~ after pole-zero R(s) cancellations.
b. Evaluate the observability of both systems. 32. Given the plant x =
-1 0
1 2 x+
wileypws u;
v = [l
llx
715
Control Solutions
33. Repeat Problem 32 for the following plant: [Section: 12.8] -2 0
x =
1 -5
u; y=[l
l]x
DESIGN PROBLEMS 34. A magnetic levitation system is described in Problem 50 in Chapter 9 (Cho,1993). Remove the photocell in Figure P9.14(Z?) and design a controller for phase variables to yield a step response with 5% overshoot and a settling time of 0.5 second. 35. Problem 24 in Chapter 3 introduced the model for patients treated under a regimen of a single day of Glargine insulin {Tarin, 2005). The model to find the response for a specific patient to medication can be expressed in phase-variable form with
A =
0
1
0
0
-501.6 x 10"
6
0 1
-128.8 x 10
-3
-854 x 10" 3
1] B =
0 ; 0
C=[0.78xl0-4
41.4 x 10 - 4
0.01 ] ;
D =0 The state variables will take on a different significance in this expression, but the input and the output remain the same. Recall that u = external insulin flow, and v = plasma insulin concentration. a. Obtain a state-feedback gain matrix so that the closed-loop system will have two of its poles placed at - 1 / 1 5 and the third pole at - 1 / 2 . b. Use MATLAB to verify that the poles appear at the positions specified in Part a.
MATLAB
36. Figure PI 2.6 shows a continuous stirred tank reactor in which an aqueous solution of sodium acetate (CH 3 COONa) is neutralized in the mixing tank with hydrochloric acid (HC1) to maintain a particular pH in the mixing tank. The amount of acid in the mix is controlled by varying the rotational speed of a feeding peristaltic pump. A nominal linearized transfer function from HC1 flowrate to pH has been shown to be
716
Chapter 12
Design via State Space Control signal
PH measurement
Inlet stream
Control acid stream
>
r
o Peristaltic pump
J
Liquid tank
Liquid pump
Mixing tank FIGURE P12.6
(Tadeo, 2000) 4
G(s) =
-4
-0.9580 x 10" s - 0.01197 x 10 s3 + 0.525052 + 0.012655 + 0.000078
a. Write the system in state-space phase-variable form. b. Use state-feedback methods to design a matrix K that will yield an overdamped output pH response with a settling time of Ts « 5 min for a step input change in pH. c. Simulate the step response F
c
...,..„ MATLAB
of the resulting closed-loop ^TT^fc system using MATLAB.
37. In the dc-dc converter of Problem 67, Chapter 4 (Van Dijk, 1995) with L = 6 mH, C = 1 mF, R = 100 fl, a 50% PWM duty cycle, and assuming the system's output is the voltage across the capacitor, the model can be expressed as
uc
0 -83.33 500 -10 J L M c J y=[Q
1
166.67 E, 0
k Uc.
Acid tank
( © 2000 I E E E )
c. Find a set of state-feedback gains to obtain 20% overshoot and a settling time of 0.5 second in the phase-variable system. d. Obtain the corresponding set of state-feedback gains in the original system. e. Verify that the set of gains in Part d places the closed-loop poles at the desired positions. f. Simulate the unit step response of the system using MATLAB.
38. a. Design an observer for the dc-dc converter of Problem 37. The observer should have time constants 10 times smaller than those of the original system. b. Simulate your system and simulink observer for a unit step input using Simulink. Assume that the initial conditions for the original 2 The observer system are 1(0) = 1 should have initial conditions 4(0) =
a. Find the system's transfer function. b. Express the system's state equations in phasevariable form.
MATLAB
0
39. a. Design an observer for the neutralization system using the continuous stirred tank reactor of
Problems
Problem 36. The observer should have time constants 10 times smaller than those of the original system. Assume that the original state variables are those obtained in the phasevariable representation. b.
_,.
, .
.
,
Simulink
717
replace the temperature feedback path with a phase-variable controller that yields a 5% overshoot and a settling time of 10 minutes. Also, design an observer that will respond 10 times faster than the system but with the same percent overshoot.
Simulate your system and 41. a. Redesign the dc-dc converter system of Problem observer for a unit step in37 to include integral control. put using Simulink. Assume that the inib. Simulate your system for a Simulink tial conditions for the original system step input using Simulink "-1 are x(0) = -10 and verify that the specifiThe observer should 3 cations are met. Inparticular, verify that the system has zero steady-state error. have initial conditions x(0) =
40. The conceptual block diagram of a gas-fired heater is shown in Figure P12.7. The commanded fuel pressure is proportional to the desired temperature. The difference between the commanded fuel pressure and a measured pressure related to the output temperature is used to actuate a valve and release fuel to the heater. The rate of fuel flow determines the temperature. When the output temperature equals the equivalent commanded temperature as determined by the commanded fuel pressure, the fuel flow is stopped and the heater shuts off (Tyner, 1968). If the transfer function of the heater, GH(s), is GH(s) =
1 degrees F (5 + 0.4)(^ + 0.8) ft3/min
and the transfer function of the fuel valve, Gv(s), is Gv{s) =
5 ft3/min s-\-5 psi
a. Design a controller to yield 10% overshoot and a settling time of 0.05 second. Assume that the state variables are the output position, output velocity, and amplifier output. b. Evaluate the steady-state error and redesign the system with an integral controller to reduce the steady-state error to zero. (Use of a program with symbolic capability is highly recommended.) c. Simulate the step response MATLAB for both the controllercompensated and integral controller-compensated systems . Use MATLAB or any othei- computer program.
III
Commanded fuel pressure
42. The floppy disk drive of Problem 57 W'leyPLus in Chapter 8 is to be redesigned ^VJilf control solutions using state-variable feedback. The controller is replaced by a unity dc gain amplifier, G„(s) = 800/(^ + 800). The plant, Gp(s) = 20,000/ [s(s + 100)], is in cascade with the amplifier.
Fuel pressure error
Fuel valve
16 -
" FIGURE P12.7
Temperature
rate Heater
Temperature se nsor and ga n
Block diagram of a gas-fired heater
718
Chapter 12
Design via State Space
43. Given the angle of attack MATLAB control system for the AFTI/ F-16 aircraft shown in Figure P9.15 (Monahemi, 1992), use MATLAB to design a controller for the plant to yield 10% overshoot with a settling time of 0 . 5 second. Assume that the phase variables are accessible. Have the program display the step response of the compensated system. 44. For the angle of attack, control MATLAB system of Problem 43, use MATLAB to design an observer for the phase variables that is 15 times faster than the controller designed system. 45. For the angle of attack control system of Problem 43, do the following: a. Design an integral control using phase variables to reduce the steady-state error to zero. (Use of a program with symbolic capability is highly recommended.) b. Use MATLAB t o o b t a i n t h e s t e p response.
MATLAB
46. The use of feedback control to vary the pitch angle in the blades of a variable speed wind turbine allows power generation optimization under variable wind conditions (Liu, 2008). At a specific operating point, it is possible to linearize turbine models. For example, the model of a three-blade turbine with a 15 m radius working in 12 m/s wind-speed and generating 220 V can be expressed as:
x =
-5
0
0
0
0
0
0
1
0
0
-10.5229
-1066.67
-3.38028
23.5107
0
0
993.804
3.125
-23.5107
0
0
0
51 0
+
0 u 0
0
10
-10
where the state variable vector is given by
I I
Here, ft = pitch angle of the wind turbine blades, £ — relative angle of the secondary shaft, cog = generator speed, and cogm — generator measurement speed. The system input is u, the pitch angle reference, and the output is y, the active power generated. a. Find a state feedback vector gain such that the system responds with a 10% overshoot and a settling time of 2 seconds for a step input.
b. Use MATLAB t o v e r i f y t h e o p e r a t i o n of t h e system under s t a t e feedback.
y = 0 0 0 1.223,-clO5 O F
MATLAB
PROGRESSIVE ANALYSIS AND DESIGN PROBLEMS
47. High-speed rail pantograph. Problem 21 in Chapter 1 discusses active control of a pantograph mechanism for high-speed rail systems (O'Connor, 1997). In Problem 79(a), Chapter 5, you found the block diagram for the active pantograph control system. For the open-loop portion of the pantograph system modeled in Chapter 5, do the following: a. Design a controller to yield 20% overshoot and a 1-second settling time. b. Repeat Part a with a zero steady-state error. 48. Control of HIV/AIDS. The linearized model of HIV infection when RTIs are used for treatment was introduced in Chapter 4 and repeated here for convenience (Craig, 2004):
T
-0.04167
A.*
T
0.0217
v
0
0
-0.0058
T
-0.24
0.0058
r
100
-2.4
v
5.2 -5.2
U\
0 T
0
(0,,. S"i
y = [0 0 1]
r v
Cyber Exploration Laboratory 2
719
+0.03787
ehU) u,U)
50
i* ««(0
T{t) 20 5 + 20
W
7-,-(0
•8f-*®
*
mm 7.226 S
W)
0.06154
7/(0 O.I £0(0 1'
'/«(0 FIGURE P12.8
T represents the number of healthy T-cells, V the number of infected cells, and v the number of free viruses. a. Design a state-feedback scheme to obtain (1) zero steady-state error for step inputs (2) 10% overshoot (3) a settling time of approximately 100 days (Hint: the system's transfer function has an openloop zero at approximately —0.02. Use one of the poles in the desired closed-loop-pole polynomial to eliminate this zero. Place the higher-order pole 6.25 times further than the dominant pair.) b. Simulate the unit step response of your design using Simulink.
with a unity steady-state gain and a time constant of 50 ms; and the power amplifier gain set to 50. Whereas the state variables remain as the motor angular speed, co(t), and armature current, Ia{t), we assume now that we have only one input variable, uc(t), the command voltage from the electronic control unit, and one output variable, car speed, v = rco/iiot = 0.06154a>. The change in the load torque, Tc(t), is represented as an internal feedback proportional to m(t), Looking at the diagram, the state equations may be written as:
Simulink y{t)
-20
-40
la
0.2491
-0.0191
0)
= v(t) = [0 0.05154]
+ w
• o i Uc(t) .1000.
V CO .
49. Hybrid vehicle. In Problem 3.32, we introduced the idea that when an electric motor is the sole motive force provider for a hybrid electric vehicle (HEV), the forward paths of all HEV topologies are similar. It was noted that, in general, the forward path of an HEV cruise control system can be represented by a block diagram similar to that of Figure P3.19 (Preitl, 2007). The diagram is shown in Figure P12.8, with the parameters substituted by their numerical values from Problem 6.69; the motor armature represented as a first-order system
a. Design an integral controller for %OS < 4.32%, a settling time, Ts< 4.4 sec, and a zero steady-state error for a step input (Hint: To account for the effect of the integral controller on the transient response, use Ts = 4 seconds in your calculation of the value of the natural frequency, con, of the required dominant poles). b. Use MATLAB to verify that the design requirements are met.
Cyber Exploration Laboratory E x p e r i m e n t 12.1 Objective To simulate a system that has been designed for transient response via a state-space controller and observer.
MATLAB
Chapter 12
Design via State Space
Minimum Required Software Packages MATLAB, Simulink, and the Control System Toolbox Prelab 1. This experiment is based upon your design of a controller and observer as specified in the Case Study Challenge problem in Chapter 12. Once you have completed the controller and observer design in that problem, go on to Prelab 2. 2. What is the controller gain vector for your design of the system specified in the Case Study Challenge problem in Chapter 12? 3. What is the observer gain vector for your design of the system specified in the Case Study Challenge problem in Chapter 12? 4. Draw a Simulink diagram to simulate the system. Show the system, the controller, and the observer using the physical variables specified in the Case Study Challenge problem in Chapter 12. Lab 1. Using Simulink and your diagram from Prelab 4, produce the Simulink diagram from which you can simulate the response. 2. Produce response plots of the system and the observer for a step input. 3. Measure the percent overshoot and the settling time for both plots. Postlab 1. Make a table showing the design specifications and the simulation results for percent overshoot and settling time. 2. Compare the design specifications with the simulation results for both the system response and the observer response. Explain any discrepancies. 3. Describe any problems you had implementing your design.
Experiment 12.2 Objective To use Lab VIEW to design a controller and observer Minimum Required Software Packages Lab VIEW, the Control Design and Simulation Module, and the MathScript RT Module. Prelab Design a LabVIEW VI that will design the controller and observer for the Antenna Control Case Study in this chapter. Your VI will have the following inputs: phase-variable form of the plant, the controller poles, and the observer poles to meet the requirements. Your indicators will display the following: the phase-variable equation of the plant, whether or not the system is controllable, the observer canonical equation of the observer, whether or not the system is observable, the gains for the controller, and the gains for the observer. Also provide the impulse response and initial response curves shown in Figure 12.27. In addition, provide similar response curves for the state variables.
Bibliography
Lab Run your VI and collect the data from which to compare the results of the case study with those found from your VI. Postlab Compare and summarize the results found from your VI with those of the Chapter 12 Antenna Control Case Study.
^ Bibliography J Cho, D., Kato, Y., and Spilman, D. Sliding Mode and Classical Controllers in Magnetic Levitation Systems. IEEE Control Systems, February 1993, pp. 42-48. Craig, I. K, Xia, X., and Venter, J. W. Introducing HIV/AIDS Education into the Electrical Engineering Curriculum at the University of Pretoria. IEEE Transactions on Education, vol. 47, no. 1, February 2004, pp. 65-73. D'Azzo, J. J., and Houpis, C. H. Linear Control System Analysis and Design: Conventional and Modem, 3d ed. McGraw-Hill, New York, 1988. Franklin, G. F, Powell, J. D, and Emami-Naeini, A. Feedback Control of Dynamic Systems, 3d ed. Addison-Wesley, Reading, MA, 1994. Hostetter, G. H, Savant, C. J. Jr., and Stefani, R. T. Design of Feedback Control Systems, 2d ed. Saunders College Publishing, New York, 1989. Kailath, T. Linear Systems. Prentice Hall, Upper Saddle River, NJ, 1980. Kyrylov, V., Severyanova, L. A., and Vieira, A. Modeling Robust Oscillatory Behavior of the Hypothalamic-Pituitary-Adrenal Axis. IEEE Transactions on Biomedical Engineering, vol. 52, no. 12, 2005, pp. 1977-1983. Liu, J.-H., Xu, D.-R, and Yang, X.-Y Multi-Objective Power Control of a Variable Speed Wind Turbine Based on Theory. Proceedings of the Seventh International Conference on Machine Learning and Cybernetics, July 2008, pp. 2036-2041. Luenberger, D. G. Observing the State of a Linear System. IEEE Transactions on Military Electronics, vol. MIL-8, April 1964, pp. 74-80. Milhorn, H. T. Jr., The Application of Control Theory to Physiological Systems. W. B. Saunders, Philadelphia, 1966. Monahemi, M. M, Barlow, J. B, and O'Leary, D. P. Design of Reduced-Order Observers with Precise Loop Transfer Recovery. Journal of Guidance, Control, and Dynamics, vol. 15, no. 6, November-December 1992, pp. 1320-1326. O' Connor, D. N, Eppinger, S. D., Seering, W P., and Wormly, D. N. Active Control of a HighSpeed Pantograph. Journal of Dynamic Systems, Measurements, and Control, vol. 119, March 1997, pp. 1-4. Ogata, K. Modern Control Engineering, 2d ed. Prentice Hall, Upper Saddle River, NJ, 1990. Ogata, K. State Space Analysis of Control Systems. Prentice Hall, Upper Saddle River, NJ, 1967. Preitl, Z., Bauer, P., and Bokor, J. A Simple Control Solution for Traction Motor Used in Hybrid Vehicles. Fourth International Symposium on Applied Computational Intelligence and Informatics. IEEE, 2007. Rockwell International. Space Shuttle Transportation System. 1984 (press information). Shinners, S. M. Modern Control System Theory and Design. Wiley, New York, 1992. Sinha, N. K. Control Systems. Holt, Rinehart & Winston, New York, 1986. Tadeo, F , Perez Lopez, O , and Alvarez, T , Control of Neutralization Processes by Robust Loop-shaping. IEEE Transactions on Control Systems Technology, vol. 8, no. 2, 2000, pp. 236-246.
Chapter 12
Design via State Space
Tarin, G, Teufel, E., Pico, I , Bondia, J., and Pfleiderer, H. J. Comprehensive Pharmacokinetic Model of Insulin Glargine and Other Insulin Formulations. IEEE Transactions on Biomedical Engineering, vol. 52, no. 12, 2005, pp. 1994-2005. Timothy, L. K, and Bona, B. E. State Space Analysis: An Introduction. McGraw-Hill, New York, 1968. Tyner, M., and May, F. P. Process Engineering Control. Ronald Press, New York, 1968. Van Dijk, E., Spruijt, J. R, O' Sullivan, D. M., and Klaasens, J. B. PWM-Switch Modeling of DC-DC Converters. IEEE Transactions on Power Electronics, vol. 10, 1995, pp. 659-665.
Digital Control Systems
^Chapter
Learning Outcomes^
After completing this chapter the student will be able to: •
Model the digital computer in a feedback system (Sections 13.1-13.2)
• • •
Find z- and inverse z-transforms of time and Laplace functions (Section 13.3) Find sampled-data transfer functions (Section 13.4) Reduce an interconnection of sampled-data transfer functions to a single sampleddata transfer function (Section 13.5) • Determine whether a sampled-data system is stable and determine sampling rates for stability (Section 13.6) • Design digital systems to meet steady-state error specification (Section 13.7) •
Design digital systems to meet transient response specifications using gain adjustment (Sections 13.8-13.9)
•
Design cascade compensation for digital systems (Sections 13.10-13.11)
^ Case Study Learning Outcomes ^ You will be able to demonstrate your knowledge of the chapter objectives with a case study as follows: •
Given the analog antenna azimuth position control system shown on the front endpapers and in Figure 13.1(a), you will be able to convert the system to a digital system as shown in Figure 13.1(6) and then design the gain to meet a transient response specification. 723
724
Chapter 13
Digital Control Systems
FIGURE 13.1 Conversion of antenna azimuth position control system from a. analog control to b. digital control •
^13.1
Given the digital antenna azimuth position control system shown in Figure 13.1(6), you will be able to design a digital cascade compensator to improve the transient response.
Introduction This chapter is an introduction to digital control systems and will cover only frequency-domain analysis and design. You are encouraged to pursue the study of state-space techniques in an advanced course in sampled-data control systems. In this chapter, we introduce analysis and design of stability, steady-state error, and transient response for computer-controlled systems. With the development of the minicomputer in the mid-1960s and the microcomputer in the mid-1970s, physical systems need no longer be controlled by expensive mainframe computers. For example, milling operations that required mainframe computers in the past can now be controlled by a personal computer. The digital computer can perform two functions: (1) supervisory—external to the feedback loop; and (2) control—internal to the feedback loop. Examples of
13.1 Introduction
supervisory functions consist of scheduling tasks, monitoring parameters and variables for out-of-range values, or initiating safety shutdown. Control functions are of primary interest to us, since a computer that performs within the feedback loop replaces the methods of compensation heretofore discussed. Examples of control functions are lead and lag compensation. Transfer functions, representing compensators built with analog components, are now replaced with a digital computer that performs calculations that emulate the physical compensator. What advantages are there to replacing analog components with a digital computer?
Advantages of Digital Computers The use of digital computers in the loop yields the following advantages over analog systems: (1) reduced cost, (2) flexibility in response to design changes, and (3) noise immunity. Modern control systems require control of numerous loops at the same time—pressure, position, velocity, and tension, for example. In the steel industry, a single digital computer can replace numerous analog controllers with a subsequent reduction in cost. Where analog controllers implied numerous adjustments and resulting hardware, digital systems are now installed. Banks of equipment, meters, and knobs are replaced with computer terminals, where information about settings and performance is obtained through menus and screen displays. Digital computers in the loop can yield a degree of flexibility in response to changes in design. Any changes or modifications that are required in the future can be implemented with simple software changes rather than expensive hardware modifications. Finally, digital systems exhibit more noise immunity than analog systems by virtue of the methods of implementation. Where then is the computer placed in the loop? Remember that the digital computer is controlling numerous loops; thus, its position in the loop depends upon the function it performs. Typically, the computer replaces the cascade compensator and is thus positioned at the place shown in Figure 13.2(a). The signals r, e,/, and c shown in Figure 13.2(a) can take on two forms: digital or analog. Up to this point we have used analog signals exclusively. Digital signals, which consist of a sequence of binary numbers, can be found in loops containing digital computers.
~X e
,
Digital computer
/,
c
Plant
(a)
r
tf 7) -i
9
A/D
Digital computer
D/A
Plant
c
(b)
FIGURE 13.2 a. Placement of the digital computer within the loop; b. detailed block diagram showing placement of A/D and D/A converters
725
726
Chapter 13
Digital Control Systems
Loops containing both analog and digital signals must provide a means for conversion from one form to the other as required by each subsystem. A device that converts analog signals to digital signals is called an analog-to-digital (A/D) converter. Conversely, a device that converts digital signals to analog signals is called a digital-toanalog (D/A) converter. For example, in Figure 13.2(b), if the plant output, c, and the system input, r, are analog signals, then an analog-to-digital converter must be provided at the input to the digital computer. Also, if the plant input,/, is an analog signal, then a digital-to-analog converter must be provided at the output of the digital computer.
Digital-to-Analog Conversion
Most significant bit
FIGURE 13.3
r/
l
-o o—
2
-a o—
4
+
f\? , output
Y$
lv oil Dij»ital-to-ana log conv(;rter
Digital-to-analog conversion is simple and effectively instantaneous. Properly weighted voltages are summed together to yield the analog output. For example, in Figure 13.3, three weighted voltages are summed. The three-bit binary code is represented by the switches. Thus, if the binary number is IIO2, the center and bottom switches are on, and the analog output is 6 volts. In actual use, the switches are electronic and are set by the input binary code.
Analog-to-Digital Conversion
Analog-to-digital conversion, on the other hand, is a two-step process and is not instantaneous. There is a delay between the input analog voltage and the output digital word. In an analog-to-digital converter, the analog signal is first converted to a sampled signal and then converted to a sequence of binary numbers, the digital signal. The sampling rate must be at least twice the bandwidth of the signal, or else there will be distortion. This minimum sampling frequency is called the Nyquist sampling rate.1 In Figure 13.4(a), we start with the analog signal. In Figure 13.4(b), we see the analog signal sampled at periodic intervals and held over the sampling interval by a device called a zero-order sample-and-hold (z.o.h.) that yields a staircase approximation to the analog signal. Higher-order holds, such as a first-order hold, generate more complex and more accurate waveshapes between samples. For example, a firstorder hold generates a ramp between the samples. Samples are held before being digitized because the analog-to-digital converter converts the voltage to a digital number via a digital counter, which takes time to reach the correct digital number. Hence, the constant analog voltage must be present during the conversion process. After sampling and holding, the analog-to-digital converter converts the sample to a digital number (as shown in Figure 13.4(c)), which is arrived at in the following manner. The dynamic range of the analog signal's voltage is divided into discrete levels, and each level is assigned a digital number. For example, in Figure 13.4(6), the analog signal is divided into eight levels. A three-bit digital number can represent each of the eight levels as shown in the figure. Thus, the difference between quantization levels is M/8 volts, where M is the maximum analog voltage. In general, for any system, this difference is M/2" volts, where n is the number of binary bits used for the analog-to-digital conversion. Looking at Figure 13.4(b), we can see that there will be an associated error for each digitized analog value except the voltages at the boundaries such as M/8 and 2M/8. We call this error the quantization error. Assuming that the quantization process rounds off the analog voltage to the next higher or lower level, the maximum 1
See Ogata (1987:170-177) for a detailed discussion.
13.2 Modeling the Digital Computer
0 I
2 3 4 Time (seconds)
2 3 4 Time (seconds)
727
5
J : 100
i 000
Digital number
m \
e
_ — o! o; c
| 1 2 3 4 Time (seconds)
5
m value of the quantization error is 1/2 the difference between quantization levels in the range of analog voltages from 0 to 15M/16. In general, for any system using roundoff, the quantization error will be (l/2)(M/2") = M/2 n+1 . We have now covered the basic concepts of digital systems. We found out why they are used, where the digital computer is placed in the loop, and how to convert between analog and digital signals. Since the computer can replace the compensator, we have to realize that the computer is working with a quantized amplitude representation of the analog signal formed from values of the analog signal at discrete intervals of time. Ignoring the quantization error, we see that the computer performs just as the compensator does, except that signals pass through the computer only at the sampled intervals of time. We will find that the sampling of data has an unusual effect upon the performance of a closed-loop feedback system, since stability and transient response are now dependent upon the sampling rate; if it is too slow, the system can be unstable since the values are not being updated rapidly enough. If we are to analyze and design feedback control systems with digital computers in the loop, we must be able to model the digital computer and associated digital-to-analog and analog-to-digital converters. The modeling of the digital computer along with associated converters is covered in the next section.
(13.2
Modeling the Digital Computer
If we think about it, the form of the signals in a loop is not as important as what happens to them. For example, if analog-to-digital conversion could happen instantaneously, and time samples occurred at intervals of time that approached zero, there would be no need to differentiate between the digital signals and the analog signals. Thus, previous analysis and design techniques would be valid regardless of the presence of the digital computer.
FIGURE 13.4 Steps in analogto-digital conversion: a. analog signal; b. analog signal after sample-and-hold; c. conversion of samples to digital numbers
728
Chapter 13
Digital Control Systems
The fact that signals are sampled at specified intervals and held causes the system performance to change with changes in sampling rate. Basically, then, the computer's effect upon the signal comes from this sampling and holding. Thus, in order to model digital control systems, we must come up with a mathematical representation of this sample-and-hold process.
Modeling the Sampler Our objective at this point is to derive a mathematical model for the digital computer as represented by a sampler and zero-order hold. Our goal is to represent the computer as a transfer function similar to that for any subsystem. When signals are sampled, however, the Laplace transform that we have dealt with becomes a bit unwieldy. The Laplace transform can be replaced by another related transform called the z-transform. The z-transform will arise naturally from our development of the mathematical representation of the computer. Consider the models for sampling shown in Figure 13.5. The model in Figure 13.5(a) is a switch turning on and off at a uniform sampling rate. In Figure 13.5(6), sampling can also be considered to be the product of the time waveform to be sampled,/(r), and a sampling function, s{t). \is{t) is a sequence of pulses of width 7V, constant amplitude, and uniform rate as shown, the sampled output, f*Tw(t), will consist of a sequence of sections of /(f) at regular intervals. This view is equivalent to the switch model of Figure 13.5(a). We can now write the time equation of the sampled waveform, ft (t). Using the model shown in Figure 13.5(6), we have 00
TTVW = /('M0
=/(0 £ u(t - kT) - u(t -kT-
Tw)
(13.1)
k=—oo
where k is an integer between —oo and +oo, Tis the period of the pulse train, and TV is the pulse width.
Pulse width = Tw
+- t
/TV«>
M
/
. \ /
\
4,«
a
*- r
T IT 3T Pulse width = Tw s(.t)
FIGURE 13.5 Two views of uniform-rate sampling: a. switch opening and closing; b. product of time waveform and sampling waveform
sit) Pulse width = T,w T IT 3T (b)
13.2 Modeling the Digital Computer
Since Eq. (13.1) is the product of two time functions, taking the Laplace transform in order to find a transfer function is not simple. A simplification can be made if we assume that the pulse width, TV, is small in comparison to the period, T, such that f(t) can be considered constant during the sampling interval. Over the sampling interval, then,/(f) — f(kT). Hence,
/rw(0 = E f(kT)lu(* - kT) - u(t -kT-
7»]
(13.2)
fc=—CO
for small 7V. Equation (13.2) can be further simplified through insight provided by the Laplace transform. Taking the Laplace transform of Eq. (13.2), we have
**7vM = E k=—co TwS
Replacing e~
kT
T„-kTs
7-kTs-Ty/s
= k=-oo E KkT)
K )
1 _
e-Tw*
,-kTs
(13.3)
with its series expansion, we obtain 1-
*r„(') = E f(kT>>
(
2
H- T -]j
,-kTs
s
/:=—oo
(13.4)
For small 7V, Eq. (13.4) becomes Tws
,-kTs
= £
f{kT)Twe-kTs
(13.5)
k=—oo
k=—oo
Finally, converting back to the time domain, we have oo
f*Tw(t) = Tw
Y^f(kT)§(f-kT)
(13.6)
k=—oo
where S(t — kT) are Dirac delta functions. Thus, the result of sampling with rectangular pulses can be thought of as a series of delta functions whose area is the product of the rectangular pulse width and the amplitude of the sampled waveform, or Twf{kT). Equation (13.6) is portrayed in Figure 13.6. The sampler is divided into two parts: (1) an ideal sampler described by the portion of Eq. (13.6) that is not dependent upon the sampling waveform characteristics,
r(t)j2f(kT)s(t-kT)
(13.7)
k=-oo
and (2) the portion dependent upon the sampling waveform's characteristics, Tw-
Modeling the Zero-Order Hold The final step in modeling the digital computer is modeling the zero-order hold that follows the sampler. Figure 13.7 summarizes the function of the zero-order hold, Ideal sampler
m
<so- fm = '±AkT)S(t-kT)
fkm =
TwZMT)S(t-kT)
FIGURE 13.6 Model of sampling with a uniform rectangular pulse train
729
730
Chapter 13
Digital Control Systems Ideal sampler
m
o f*m
Hold
/„«
t AkT)S{t-kT) FIGURE 13.7 Ideal sampling and the zero-order hold which is to hold the last sampled value of f(t). If we assume an ideal sampler (equivalent to setting 7V = 1), then /*(r) is represented by a sequence of delta functions. The zero-order hold yields a staircase approximation to f(t). Hence, the output from the hold is a sequence of step functions whose amplitude is f(t) at the sampling instant, orf(kT). We have previously seen that the transfer function of any linear system is identical to the Laplace transform of the impulse response since the Laplace transform of a unit impulse or delta function input is unity. Since a single impulse from the sampler yields a step over the sampling interval, the Laplace transform of this step, G/,(s), which is the impulse response of the zero-order hold, is the transfer function of the zero-order hold. Using an impulse at zero time, the transform of the resulting step that starts at t = 0 and ends at t = T is Gh(s) =
1-e
-Ts
(13.8)
In a physical system, samples of the input time waveform, /(kT), are held over the sampling interval. We can see from Eq. (13.8) that the hold circuit integrates the input and holds its value over the sampling interval. Since the area under the delta functions coming from the ideal sampler is f(kT), we can then integrate the ideal sampled waveform and obtain the same result as for the physical system. In other words, if the ideal sampled signal, f*{t), is followed by a hold, we can use the ideal sampled waveform as the input, rather than f*Tw{t). In this section, we modeled the digital computer by cascading two elements: (1) an ideal sampler and (2) a zero-order hold. Together, the model is known as a zero-order sample-and-hold. The ideal sampler is modeled by Eq. (13.7), and the zero-order hold is modeled by Eq. (13.8). In the next section, we start to create a transform approach to digital systems by introducing the z-transform.
(
13.3 The z-Transform The effect of sampling within a system is pronounced. Whereas the stability and transient response of analog systems depend upon gain and component values, sampled-data system stability and transient response also depend upon sampling rate. Our goal is to develop a transform that contains the information of sampling from which sampled-data systems can be modeled with transfer functions, analyzed, and designed with the ease and insight we enjoyed with the Laplace transform. We now develop such a transform and use the information from the last section to obtain sampled-data transfer functions for physical systems.
13.3 The z-Transform Equation (13.7) is the ideal sampled waveform. Taking the Laplace transform of this sampled time waveform, we obtain
r® = £/(*?>
-*7A-
(13.9)
k=0
Now, letting z = els, Eq. (13.9) can be written as
F(z) = 1£f(kT)z-*
(13.10)
Equation (13.10) defines the z-transform. That is, an F{z) can be transformed to f(kT), or an f(kT) can be transformed to F(z). Alternately, we can write (13.11) f{kT)±=_F{z) Paralleling the development of the Laplace transform, we can form a table relating f(kT), the value of the sampled time function at the sampling instants, to F(z). Let us look at an example.
Example 13.1 z-Transform of a Time Function PROBLEM: Find the z-transform of a sampled unit ramp. SOLUTION: For a unit ramp, f{kT) = kT. Hence the ideal sampled step can be written from Eq. (13.7) as (13.12) Taking the Laplace transform, we obtain oo
F*(s) = Yl kTe~kTs
(13.13)
k=0
Converting to the z-transform by letting e~kTs = z~k, we have F(z) = J2 kTz~k = T J2 kt~k = T{z~l + 2z~2
3z- 3
•)
(13.14)
Equation (13.14) can be converted to a closed form by forming the series for zF(z) and subtracting F(z). Multiplying Eq. (13.14) by z, we get zi7(z) = r ( l + 2 z - 1 + 3 z ~ 2 + ---)
(13.15)
Subtracting Eq. (13.14) from Eq. (13.15), we obtain zF(z) - F(z) = (Z - l)F(z) = r ( l + z- 1 + z- 2 +
(13.16)
But 1 = l + z _1 +z~ z + z. - 3 1 - z -1
(13.17)
731
732
Chapter 13
Digital Control Systems
which can be verified by performing the indicated division. Substituting Eq. (13.17) into (13.16) and solving for F(z) yields F(z) = T
z-iy
(13.18)
as the z-transform of f(kT) = kT. Symbolic Math
Students who are performing the MATLAB exercises and want to explore the added capability of MATLAB's Symbolic Math Toolbox should now run chl3spl in Appendix F located at www.wiley.com/ college/nise. You will learn how to find the z-transform of time functions. Example 13.1 will be solved using MATLAB and the Symbolic Math Toolbox.
The example demonstrates that any function of s, F*(s), that represents a sampled time waveform can be transformed into a function of z, F(z). The final result, F(z) = Tz/(z -1)2, is in a closed form, unlike F*(s). If this is the case for numerous other sampled time waveforms, then we have the convenient transform that we were looking for. In a similar way, ^-transforms for other waveforms can be obtained that parallel the table of Laplace transforms in Chapter 2. A partial table of z-transforms is shown in Table 13.1, and a partial table of z-transform theorems is TABLE 13.1 Partial table of z- and ^-transforms /(') 1. 2.
u® t
3.
f
4.
e-at
5.
fg-w
F(s) 1 s
7.
cos cot
8.
e_fl'sin cot
Tz
kT
dn z lim(-l)"-f; a-^ir dan z - e-"T
sn+\
z
1 s+a n\
d" (-If' 4½ da"
e-akT
z z - e~aT
(kT)ne-akT
z sin coT z2 - 2z cos coT + 1
sin cokT
v
0)
s2 + co2 s
Z(Z~ COS (oT)
S2 + C02
z2 — IzcoscoT + 1
CO 2
ze~aTsin coT z - 2ze-"TcoscoT + e-2"7 z2-ze~aT
2
rnsmlcT
„-**r s i n ,„ f c r
2
s+a (S + 0^+0)
{kTf
z - e-aT
(s + a) + co e_f"cos cot
u(kT)
(z -1)2
2
9.
z
1 S2
(s + aT * sin cot
f(kT)
z~]
+
6
F(z)
2
cos coT
z - 2ze-"T cos coT + e~2aT
P-"kTc^(likT
13.3 The z-Transform TABLE 13.2 z-transform theorems Name
Theorem 1. 2. 3. 4, 5. 6. 7.
Linearity theorem
z{af{t)} = aF{z)
z{h(t)+f2(t)} = Fx(z) +Fi(z) aT
Linearity theorem
aT
z{e- f(t)} z{f(t-nT)}
Complex differentiation
= F(e z) = z-"F(z) dF z{tfm-TZ df
Real translation Complex differentiation Initial value theorem
/(0) = lim F(z) f(oo) =
Final value theorem
l
lim(l-Z- )F(z)
Note: kT may be substituted for t in the table.
shown in Table 13.2. For functions not in the table, we must perform an inverse Z-transform calculation similar to the inverse Laplace transform by partial-fraction expansion. Let us now see how we can work in the reverse direction and find the time function from its z-transform.
The Inverse z-Transform Two methods for finding the inverse z-transform (the sampled time function from its z-transform) will be described: (1) partial-fraction expansion and (2) the power series method. Regardless of the method used, remember that since the z-transform came from the sampled waveform, the inverse z-transform will yield only the values of the time function at the sampling instants. Keep this in mind as we proceed, because even as we obtain closed-form time functions as results, they are valid only at sampling instants. Inverse z-Transforms via Partial-Fraction Expansion Recall that the Laplace transform consists of a partial fraction that yields a sum of terms leading to exponentials, that is, A/(s + a). Taking this lead and looking at Table 13.1, we find that sampled exponential time functions are related to their z-transforms as follows: e-^^^r
(13.19)
We thus predict that a partial-fraction expansion should be of the following form:
F(Z) = - ^ - + - 5 i ~ + ... Z - Zl
(13.20)
Z - Z2
Since our partial-fraction expansion of F(s) did not contain terms with s in the numerator of the partial fractions, we first form F(z)/z to eliminate the z terms in the numerator, perform a partial-fraction expansion of F(z)/z-, and finally multiply the result by z to replace the z's in the numerator. An example follows.
Example 13.2 Inverse z-Transform via Partial-Fraction Expansion PROBLEM: Given the function in Eq. (13.21), find the sampled time function.
733
734
Chapter 13
Digital Control Systems
SOLUTION: Begin by dividing Eq. (13.21) by z and performing a partial-fraction expansion.
Hz)
0.5
z
(z - 0.5)(z - 0.7)
A
B
-2.5
z - 0.5 + z - 0.7
2.5 z - 0.5 + z - 0.7
(13.22)
Next, multiply through by z. 0.5z F(z) = [z -0.5)(^-0.7)
-2.5z z-0.5
2.5z z-0.7
;i3.23)
Using Table 13.1, we find the inverse z-transform of each partial fraction. Hence, the value of the time function at the sampling instants is f(kT) = -2.5(0.5)* + 2.5(0.7)*
(13.24)
Also, from Eqs. (13.7) and (13.24), the ideal sampled time function is OO
PC
f*(t) = ] T f{kT)8{t -kT) = ] T [-2-5(0.5)* + 2.5(0.7)*]5(f - kT) k=-c
(13.25)
lc=—oc
If we substitute k = 0,1,2, and 3, we can find the first four samples of the ideal sampled time waveform. Hence, f*{t) = 08(t) + 0.5<5(r - T) + 0.65(^ - 2T) + 0.5458{t - 3T) Symbolic Math
(13.26)
Students who are performing the MATLAB exercises and want to explore the added capability of MATLAB's Symbolic Math Toolbox should now run chl3sp2 in Appendix F located at www.wiley.com/ college/nise . You will learn how to find the inverse z-transf orm of sampled time functions. Example 13.2 will be solved using MATLAB and the Symbolic Math Toolbox.
Inverse z-Transf orm via the Power Series Method The values of the sampled time waveform can also be found directly from F{z). Although this method does not yield closed-form expressions for f{kT), it can be used for plotting. The method consists of performing the indicated division, which yields a power series for F(z). The power series can then be easily transformed into F*(s) and f*(t).
Example 13.3 Inverse z-Transform via Power Series PROBLEM: Given the function in Eq. (13.21), find the sampled time function. SOLUTION: Begin by converting the numerator and denominator of F{z) to polynomials in z. 0.5z m= [z -0.5)(z-0.7)
0.5z z 2 -1.2z + 0.35
(13.27)
13.4 Transfer Functions
735
Now perform the indicated division. 0 . 5 ^ + 0 . 6 ^ + 0.5452-3 z -1.2z + 0.35)0.5z 0.5Z-0.6 + 0.175Z-1 0.6-0.175Z- 1 0.6-0.720^+0.21 0.545Z-1 - 0.21 2
(13.28)
Using the numerator and the definition of z, we obtain F*(s) = 03e-Ts + 0.6
(13.29)
from which f*{t) = 0.5S(t -T) + 0.68{t - IT) + 0.545S(r - 3 7 ) + ---
(13.30)
You should compare Eq. (13.30) with Eq. (13.26), the result obtained via partial expansion.
Skill-Assessment Exercise 13.1 PROBLEM: Derive the z-transform for fit) = sin cot u(t).
wileyPLUS Control Solutions
-1
2
1 - 2z cos(ft>7j + z~
The complete solution is located at www.wiley.com/college/nise.
Skill-Assessment Exercise 13.2 z(z + l)(z + 2) (z-0.5)(z-0.7)(z-0.9)' ANSWER: f(kT) = 46.875(0.5)* - 114.75(0.7)* 68.875(0.9)* PROBLEM: Find f(kT) if F(z) =
The complete solution is located at www.wiley.com/college/nise.
^ 13.4
Transfer Functions
Now that we have established the z-transform, let us apply it to physical systems by finding transfer functions of sampled-data systems. Consider the continuous system shown in Figure 13.8 (a). If the input is sampled as shown in Figure 13.8(6), the output is still a continuous signal. If, however, we are satisfied with finding the output at the sampling instants and not in between, the representation of the sampled-data system
736
Chapter 13
Digital Control Systems
R(s)
G(s)
C(s)
(«) R(S)
^ /
c
R IM
o
G(s)
C(s)
(b)
FIGURE 13.8 Sampled-data systems: a. continuous; b. sampled input; c. sampled input and output
-^/o^^
G(s)
C(s)
O
C*(s)
(c)
Note: Phantom sampler is shown in color.
can be greatly simplified. Our assumption is visually described in Figure 13.8(c), where the output is conceptually sampled in synchronization with the input by a phantom sampler. Using the concept described in Figure 13.8(c), we derive the pulse transfer function of G(s).
Derivation of the Pulse Transfer Function Using Eq. (13.7), we find that the sampled input, r*(f), to the system of Figure 13.8(c) is
r*(t) =
Y,r(nT)8(t-nT)
(13.31)
n=0
which is a sum of impulses. Since the impulse response of a system, G(s), is g(t), we can write the time output of G(s) as the sum of impulse responses generated by the input, Eq. (13.31). Thus, (13.32)
c(0 = £ r ( / i T ) g ( r - n r ) n=0
From Eq. (13.10),
C(z) = J^c(kT)z -k
(13.33)
k=Q
Using Eq. (13.32) with t = kT,we
obtain oc
c{kT) =
Yjr{nT)g{kT-nT)
(13.34)
n=0
Substituting Eq. (13.34) into Eq. (13.33), we obtain DO
OO
-k *=o «=o
(13.35)
13.4 Transfer Functions Letting m — k — n, we find
c
oc
oo
Y,r^nT^mT)z~(m+n)
w =£
w+rt=0 «=0
(13.36) m
=
r
n
{f^g(mT)z- \\f2 (nT)zn=0
,w=0
where the lower limit, m + n, was changed to m. The reasoning is that m + n = 0 yields negative values of m for all n > 0. But, since g(mT) = 0 for all m < 0, m is not less than zero. Alternately, g(t) = 0 for t < 0. Thus, n = 0 in the first sum's lower limit. Using the definition of the z-transform, Eq. (13.36) becomes C(z) = Y,8{mT)z-mY,r{nT)z-n m=0
=
G(z)R(z)
(13.37)
n=0
Equation (13.37) is a very important result, since it shows that the transform of the sampled output is the product of the transforms of the sampled input and the pulse transfer function of the system. Remember that although the output of the system is a continuous function, we had to make an assumption of a sampled output (phantom sampler) in order to arrive at the compact result of Eq. (13.37). One way of finding the pulse transfer function, G(z), is to start with G(s), find g(t), and then use Table 13.1 to find G(z). Let us look at an example.
Example 13.4 Converting G^(s) in Cascade with z.o.h. to G(z) PROBLEM: Given a z.o.h. in cascade with G\ {s) = {s + 2)/(s + 1) or G(*) =
1 - e~Ts {s + 2)
(13.38)
ft+i:
find the sampled-data transfer function, G(z), if the sampling time, T, is 0.5 second. SOLUTION: Equation (13.38) represents a common occurrence in digital control systems, namely a transfer function in cascade with a zero-order hold. Specifically, Gi(s) = (s + 2)/(s 4-1) is in cascade with a zero-order hold, (1 - e~Ts)/s. We can formulate a general solution to this type of problem by moving the s in the denominator of the zero-order hold to G\{s), yielding {l-e-T*)^-
G{s) =
(13.39)
from which G(z) = (1 -
z'^z
Gi(s)\
z - \
(Gi(s)
(13.40)
Thus, begin the solution by finding the impulse response (inverse Laplace transform) of Gi(s)/s. Hence, G2(s) =
Gib)
B
5 + 2 _A sis
l) ~ 7
+
s +1
l s+l
(13.41)
737
738
Chapter 13 Trylt 13.1
Use MATLAB, the Control System Toolbox, and the following statements to find G\ (s) in Example 13.4 given G(z) in Eq. (13.46) num=0.213; den=0.607; k=l; T=0 . 5; Gz=zpk(num,den,K,T) Gs=d2c(Gz,,zoh' )
Digital Control Systems
Taking the inverse Laplace transform, we get g2(t)=2-e-< from which g2(kT) = 2-e-kt Using Table 13.1, we find 2z z G2(z) = z-l z—e-T
(13.42)
(13.43)
(13.44)
Substituting T = 0.5 yields
G2(z) = z
G^s))
2Z z-l
z2 - 0.213z
z- 0.607
{z-l)(z~
0.607)
(13.45)
From Eq. (13.40), z - 0.213 G2(z) = (13.46) z z - 0.607 Students who are using MATLAB shouldnow run chl3pl in Appendix B. You will learn how to use MATLAB to convert G± (s) in cascade with a zeroorder hold to G(z). This exercise solves Example 13.4 using MATLAB. ,.
G(z)=
MATLAB
Symbolic Math
z-l
Students who are performing the MATLAB exercises and want to explore the added capability of MATLAB's Symbolic Math Toolbox should now run chl3sp3 in Appendix F located at www.wiley.com/ college/nise. MATLAB's Symbolic Math Toolbox yields an alternative method of finding the z-transform of a transfer function in cascade with a zero-order hold. Example 13 .4 will be solved using MATLAB and the Symbolic Math Toolbox with a method that follows closely the hand calculation shown in that example.
Students who are using MATLAB should now run chl3p2 in Appendix B. You will learn how to use MATLAB to convert G(s) toG(z) whenG(s) is not in cascade with a zero-order hold. This is the same as finding the z-transform of G(s) .
MATLA8
MATLAB
Students who are using MATLAB shouldnow run chl3p3 in Appendix B. You will learn how to create digital transfer functions directly. Students who are using MATLAB should now run chl 3p4 in Appendix B. You will learn how to useMATLAB to convert G(z) to G(s) when G(s) is not in cascade with a zero-order hold. This is the same as finding the Laplace transform of G(z) .
MATLAB
Skill-Assessment Exercise 13.3 Trylt 13.2 Use MATLAB, the Control System Toolbox, and the following statements to solve Skill-Assessment Exercise 13.3. G s = z p k ( [ ] , - 4 , 8) Gz=c2d(Gs, 0 . 2 5 , ' z o h ' )
PROBLEM: Find G(z) for G(s) = 8/(s + 4) in cascade with a zeroorder sample and hold. The sampling period is 0.25 second.
WileyPtUS
Control Solutions
ANSWER: G(z) = 1.264/(z - 0.3679) The complete solution is located at www.wiley.com/college/nise.
13.5 Block Diagram Reduction
739
The major discovery in this section is that once the pulse transfer function, G(z), of a system is obtained, the transform of the sampled output response, C(z), for a given sampled input can be evaluated using the relationship C(z) — R(z)G(z). Finally, the time function can be found by taking the inverse ^-transform, as covered in Section 13.3. In the next section, we look at block diagram reduction for digital systems.
£ 13.5 Block Diagram Reduction Up to this point, we have defined the z-transform and the sampled-data system transfer function and have shown how to obtain the sampled response. Basically, we are paralleling our discussions of the Laplace transform in Chapters 2 and 4. We now draw a parallel with some of the objectives of Chapter 5, namely block diagram reduction. Our objective here is to be able to find the closed-loop sampled-data transfer function of an arrangement of subsystems that have a computer in the loop. When manipulating block diagrams for sampled-data systems, you must be careful to remember the definition of the sampled-data system transfer function (derived in the last section) to avoid mistakes. For example, z{Gi(s)G2{s)} ^ Gi(z)G2(z), where z{G\ (s)G2(s)} denotes the z-transform. The s-domain functions have to be multiplied together before taking the z-transform. In the ensuing discussion, we use the notation G{G2{s) to denote a single function that is G\(s)G2{s) after evaluating the product. Hence, z{Gi(S)G2(s)} = z{G1G2(s)} = GlG2{z) * Gl(z)G2(z). Let us look at the sampled-data systems shown in Figure 13.9. The sampleddata systems are shown under the column marked s. Their z-transforms are shown under the column marked z. The standard system that we derived earlier is shown in Figure 13.9(a), where the transform of the output, C(z), is equal to R(z)G(z). This system forms the basis for the other entries in Figure 13.9. In Figure 13.9(6), there is no sampler between G\ (s) and G2 [s). Thus, we can think of a single function, G] (s)G2{s), denoted G\G%{$\ existing between the two samplers and yielding a single transfer function, as shown in Figure 13.9(a). Hence, the pulse transfer function is z{GiG 2 (5)} = GiG2{z). The transform of the output, C(z) = R{z)GiG2{z). In Figure 13.9(c), we have the cascaded two subsystems of the type shown in Figure 13.9(a). For this case, then, the z-transform is the product of the two z-transforms, or G2{z)G\(z). Hence the transform of the output C(z) = R(z)G2{z)G\ (z).
R(z)
R(z)
flfeWff0_Jg(^
R(s)
Gx(s)
c
<^/o^
R(z)
/?(*)G,(s) . / " _ [/?(*)G,(s)]* | — 1 C(s) _/ _ C*(s) RGx(z) —O O • •• Gds) — ^ O Q » (d)
G{z)
G2G\{z)
G2(z)G](z)
G2(z)
C(z)
C(z)
C(z)
C(z)
FIGURE 13.9 Sampled-data systems and their z-transforms
740
Chapter 13
Digital Control Systems
Finally, in Figure 13.9(d), we see that the continuous signal entering the sampler is R(s)Gi(s). Thus, the model is the same as Figure 13.9(a) with R(s) replaced by R(s)Gi(s), and G2(s) in Figure 13.9(d) replacing G(s) in Figure 13.9(a). The z-transform of the input to G2(s) is z{R(s)G1(s)} = z{i?Gi(s)} = RGi(z). The pulse transfer function for the system G2(s) is G2(z). Hence, the output C(z) = RG1{z)G2(z). Using the basic forms shown in Figure 13.9, we can now find the z-transform of feedback control systems. We have shown that any system, G(s), with sampled input and sampled output, such as that shown in Figure 13.9(a), can be represented as a sampled-data transfer function, G(z). Thus, we want to perform block diagram manipulations that result in subsystems, as well as the entire feedback system, that have sampled inputs and sampled outputs. Then we can make the transformation to sampled-data transfer functions. An example follows.
Example 13.5 Pulse Transfer Function of a Feedback System PROBLEM: Find the z-transform of the system shown in Figure 13.10(a). SOLUTION: The objective of the problem is to proceed in an orderly fashion, starting with the block diagram of Figure 13.10(a) and reducing it to the one shown in Figure 13.10(/). One operation we can always perform is to place a phantom sampler at the output of any subsystem that has a sampled input, provided that the nature of the signal sent to any other subsystem is not changed. For example in Figure 13.10(6), phantom sampler 54 can be added. The justification for this, of course, is that the R(s) +
C(s)
G(s)
< / O 51
His)
(«)
a.s)sS QC*^),
R{s}rS-R*(s)
o FIGURE 13.10 Steps in block diagram reduction of a sampled-data system (figure continues)
+
< /
* -0
S3
,v
G(s)
si
<mms) oSI
Note: Phantom samplers are shown in color.
c{S)^y SA
c*(S)
13.5 Block Diagram Reduction R(z) +
G(z)
741
C(z)
GH(z) id)
R(z) 1 + GH(z)
G(z)
C(z)
R(z)
G(z) C(z) 1 + GH(z)
(/)
(e)
output of a sampled-data system can only be found at the sampling instants anyway, and the signal is not an input to any other block. Another operation that can be performed is to add phantom samplers 52 and 53 at the input to a summing junction whose output is sampled. The justification for this operation is that the sampled sum is equivalent to the sum of the sampled inputs, provided, of course, that all samplers are synchronized. Next, move sampler 51 and G(s) to the right past the pickoff point, as shown in Figure 13.10(c). The motivation for this move is to yield a sampler at the input of G(s)H(s) to match Figure 13.9(b). Also, G(s) with sampler 51 at the input and sampler 54 at the output matches Figure 13.9(a). The closed-loop system now has a sampled input and a sampled output. G(s)H(s) with samplers 51 and 53 becomes GH(z), and G(s) with samplers 51 and 54 becomes G(z), as shown in Figure 13.10(d). Also, converting R*(s) to R(z) and C*(s) to C(z), we now have the system represented totally in the z-domain. The equations derived in Chapter 5 for transfer functions represented with the Laplace transform can be used for sampled-data transfer functions with only a change in variables from 5 to z. Thus, using the feedback formula, we obtain the first block of Figure 13.10(e). Finally, multiplication of the cascaded sampled-data systems yields the final result shown in Figure 13.10(f).
Skill-Assessment Exercise 13.4 PROBLEM: Find T(z) = C(z)/R(z)
R(s)
T 6
£K/O—
S
—^
for the system shown in Figure 13.11.
C(s)
FIGURE 13.11 Digital system for Skill-Assessment Exercise 13.4 ANSWER: T(z) =
GiG2(z] l + HG1G2(z)
The complete solution is located at www.wiley.com/college/nise.
FIGURE 13.10 (Continued)
742
Chapter 13
Digital Control Systems
This section paralleled Chapter 5 by showing how to obtain the closed-loop, sampled-data transfer function for a collection of subsystems. The next section parallels the discussion of stability in Chapter 6.
¢ 1 3 . 6 Stability The glaring difference between analog feedback control systems and digital feedback control systems, such as the one shown in Figure 13.12, is the effect that the sampling rate has on the transient response. Changes in sampling rate not only change the nature of the response from overdamped to underdamped, but also can turn a stable system into an unstable one. As we proceed with our discussion, these effects will become apparent. You are encouraged to be on the lookout. We now discuss the stability of digital systems from two perspectives: (1) z-piane and (2) s-plane. We will see that the Routh-Hurwitz criterion can be used only if we perform our analysis and design on the s-plane.
Digital System Stability via the z-Plane In the 5-plane, the region of stability is the left half-plane. If the transfer function, G(s), is transformed into a sampled-data transfer function, G(z), the region of stability on the z-plane can be evaluated from the definition, z — eTs. Letting s = m +jto, we obtain -. _
£Ts
_
eT(a+ja))
_
eaTe'}u>T
aT
= e (cos coT + j sin coT) = eaTZa>T
(13.47)
since (cos coT +;' sin coT) = IZ. coT. Each region of the s-plane can be mapped into a corresponding region on the z-plane (see Figure 13.13). Points that have positive values of a are in the right half
FIGURE 13.12 A lathe using digital numerical control (© David J. Green—Industry/Alamy)
13.6
Stability
743
*-plane
*-Re
FIGURE 13.13 Mapping regions of the s-plane onto the z-plane
of the i'-plane, region C. From Eq. (13.47), the magnitudes of the mapped points are eaT > 1. Thus points in the right half of the s-plane map into points outside the unit circle on the z-plane. Points on the yw-axis, region B, have zero values of a and yield points on the z-plane with magnitude — 1, the unit circle. Hence, points on the /<w-axis in the 5-plane map into points on the unit circle on the z-plane. Finally, points on the s-plane that yield negative values of a a(left-half-plane roots, region A) map into the inside of the unit circle on the z-plane. Thus, a digital control system is (1) stable if all poles of the closed-loop transfer function, T(z), are inside the unit circle on the z-plane, (2) unstable if any pole is outside the unit circle and/or there are poles of multiplicity greater than one on the unit circle, and (3) marginally stable if poles of multiplicity one are on the unit circle and all other poles are inside the unit circle. Let us look at an example.
Example 13.6 Modeling and Stability PROBLEM: The missile shown in Figure 13.14(a) can be aerodynamically controlled by torques created by the deflection of control surfaces on the missile's body. The commands to deflect these control surfaces come from a computer that uses tracking data along with programmed guidance equations to determine whether the missile is on track. The information from the guidance equations is used to develop flightcontrol commands for the missile. A simplified model is shown in Figure 13.14(6). Here the computer performs the function of controller by using tracking information to develop input commands to the missile. An accelerometer in the missile detects the actual acceleration, which is fed back to the computer. Find the closed-loop digital transfer function for this system and determine if the system is stable for K = 20 and K = 100 with a sampling interval of T = 0.1 second. SOLUTION: The input to the control system is an acceleration command developed by the computer. The computer can be modeled by a sample-and-hold. The s-plane model is shown in Figure 13.14(c). The first step in finding the z-plane model is to find G(z), the forward-path transfer function. From Figure 13.14(c) or (d), tfr)-
1
-*""**, s s(s + a)
(13.48) '
v
744
Chapter 13
Digital Control Systems
Control surfaces
Fraeking data
Amplifier —1» Airframe K dynamics
A/D —»- Computer —^- D/A
Missile acceleration
11
A/D
Acceleration command
Sam
Hold
Ple
&i
Amplifier
i-e -Ts
A'
Airframe dynamics
Missile
27
acceleration
s(s + 27)
Sample
-oV (c)
Hold
Sample
FIGURE 13.14 Finding stability of a missile control system: a. missile; b. conceptual block diagram; c. block diagram; d. block diagram with equivalent single sampler
command
tfc
—y U
U
•"
Amplifier
Airframe dynamics
K
27 s(s + 27)
\-e-Ts s
acceleration
id) where a = 27. The z-transform, G(z), is (1 - z~l)z{Ka/[s2(s + a)]}. The term Ka/[s2(s -+- a)] is first expanded by partial fractions, after which we find the z-transform of each term from Table 13.1. Hence, Ka s2(s + a)
= Kz
^2 s s + a) s2(s + a Tz z/a z/a 1 z - l ' z-e-°r (z_l)2 (1 - e-" r )z fl(z-l)(z-e-flT)
Tz (z-l)2
(13.49)
Thus, T(z - e-aT) G(z) = K
-{z-l)
(z-l)(z-e-°T)
1-e -aT (13.50)
13.6
Letting T = 0.1 and a = 27, we have K(0.0655z +0.02783) O W - ( Z -1)(,-0.0672)
Stability
745
(13 51)
"
Finally, we find the closed-loop transfer function, r(z), for a unity feedback system: T(T)=
W
gS*j
*(0.0655z + 0.02783) 2
1 + G(z) z + (0.0655A: -1.0672)^ + (0.02783^ + 0.0672) l ' ; The stability of the system is found by finding the roots of the denominator. For K = 20, the roots of the denominator are 0.12 ± /0.78. The system is thus stable for K = 20, since the poles are inside the unit circle. For K = 100, the poles are at -0.58 and -4.9. Since one of the poles is outside the unit circle, the system is unstable for K = 100. Students who are using MATLAB should now run chl3p5 in Appendix B. You will learn how to use MATLAB to determine the range of K for stability in a digital system. This exercise solves Example 13.6 using MATLAB.
In the case of continuous systems, the determination of stability hinges upon our ability to determine whether the roots of the denominator of the closed-loop transfer function are in the stable region of the s-plane. The problem for high-order systems is complicated by the fact that the closed-loop transfer function denominator is in polynomial form, not factored form. The same problem surfaces with closedloop sampled-data transfer functions. Tabular methods for determining stability, such as the Routh-Hurwitz method used for higher-order continuous systems, exist for sampled-data systems. These methods, which are not covered in this introductory chapter to digital control systems, can be used to determine stability in higher-order digital systems. If you wish to go further into the area of digital system stability, you are encouraged to look at Raible's tabular method or Jury's stability test for determining the number of a sampled-data system's closed-loop poles that exist outside the unit circle and thus indicate instability.2 The following example demonstrates the effect of sampling rate on the stability of a closed-loop feedback control system. All parameters are constant except for the sampling interval, T. We will see that varying T will lead us through regions of stability and instability just as though we were varying the forward-path gain, K.
Example 13.7 Range of rfor Stability PROBLEM: Determine the range of sampling interval, T, that will make the system shown in Figure 13.15 stable, and the range that will make it unstable. SOLUTION: Since H(s) = 1, the z-transform of the closed-loop system, T(z), is found from Figure 13.10 to be
^ = 1 ¾
(13 53)
-
'• A discussion of Raible's tabular method and Jury's stability test can be found in Kuo (1980:278-286).
MATLAB
746
Chapter 13
Digital Control Systems
m+< 5—a FIGURE 13.15 Digital system for Example 13.7
sr
T
o-*
Hold
Plant
1-.-" s
10 i+1
cm
To find G(z), first find the partial-fraction expansion of G(s). 1 - e~Ts 10 G(s) v = 10 , * s(s + l) =
<13-54)
^-^6-JTT)
Taking the z-transform, we obtain
G(z) =
lQ(z-l) z- 1
T
z — e~
= 10
(1-e -
z-e
~T\ e-T>
(13.55)
Substituting Eq. (13.55) into (13.53) yields 10(1 -e~T) T(z) = z - ( l l e - T - - l O )
(13.56)
The pole of Eq. (13.56), (lie"-7" — 10), monotonically decreases from +1 to - 1 for 0 < T < 0.2. For 0.2 < T < oo, (ll
Bilinear Transformations Bilinear transformations give us the ability to apply our s-plane analysis and design techniques to digital systems. We can analyze and design on the s-plane as we have done in Chapters 8 and 9 and then, using these transformations, convert the results to a digital system that contains the same properties. Let us look further into this topic. We can consider z — eT& and its inverse, s = (l/T) In z, as the exact transformations between z and s. Thus, if we have G(z) and substitute z = eTs, we obtain G(eTs) as the result of converting to s. Similarly, if we have G(s) and substitute 5 = (l/7)ln z, we obtain G((l/7)ln z) as the result of converting to z. Unfortunately, both transformations yield transcendental functions, which we of course take care of through the rather complicated z-transform. What we would like is a simple transformation that would yield linear arguments when transforming in both directions (bilinear) through direct substitution and without the complicated z-transform. Bilinear transformations of the form as + b
z - cs-\-d
(13.57)
13.6 Stability and its inverse, -dz + b s = cz — a
(13.58)
have been derived to yield linear variables in s and z. Different values of a, b, c, and d have been derived for particular applications and yield various degrees of accuracy when comparing properties of the continuous and sampled functions. For example, in the next subsection we will see that a particular choice of coefficients will take points on the unit circle and map them into points on the /<w-axis. Points outside the unit circle will be mapped into the right half-plane, and points inside the unit circle will be mapped into the left half-plane. Thus, we will be able to make a simple transformation from the z-plane to the 5-plane and obtain stability information about the digital system by working in the 5-plane. Since the transformations are not exact, only the property for which they are designed can be relied upon. For the stability transformation just discussed, we cannot expect the resulting G(s) to have the same transient response as G(z). Another transformation will be covered that will retain that property.
Digital System Stability via the s-Plane In this subsection, we look at a bilinear transformation that maps ;'<w-axis points on the 5-plane to unit-circle points on the z-plane. Further, the transformation maps right-half-plane points on the 5-plane to points outside the unit circle on the £-plane. Finally, the transformation maps left-half-plane points on the 5-plane to points inside the unit circle on the z-plane. Thus, we are able to transform the denominator of the pulsed transfer function, D(z), to the denominator of a continuous transfer function, D(s), and use the Routh-Hurwitz criterion to determine stability. The bilinear transformation
s-
z+l z-\
(13.59)
z
5+ 1 5-1
(13.60)
and its inverse
perform the required transformation (Kuo, 1995). We can show this fact as follows: Letting s = a+ jco and substituting into Eq. (13.60), {a+ 1)+jco z = a - 1) + jco
:i3.6i)
from which
yJ{a + l)2+co2 a-V
(13.62)
W
Thus, \z\ < 1 when a < 0
(13.63a)
\z\ > 1 when a > 0
(13.63b)
748
Chapter 13
Digital Control Systems
and \z\ = 1 when a = 0
(13.63c)
Let us look at an example that shows how the stability of sampled systems can be found using this bilinear transformation and the Routh-Hurwit criterion.
Example 13.8 Stability via Routh-Hurwitz PROBLEM: Given T(z) = N{z)/D(z), where D(z) = z3 - z2 - 0.2z + 0.1, use the Routh-Hurwitz criterion to find the number of z-plane poles of T(z) inside, outside, and on the unit circle. Is the system stable? SOLUTION: Substitute Eq. (13.60) into D{z) = 0 and obtain3 53 - 1¾2 - 45s - 17 = 0 (13.64) The Routh table for Eq. (13.64), Table 13.3, shows one root in the right-halfplane and two roots in the left-half-plane. Hence, T(z) has one pole outside the unit circle, no poles on the unit circle, and two poles inside the unit circle. The system is unstable because of the pole outside the unit circle. TABLE 13.3 Routh table for Example 13.8 1
-45
19
-17
-45.89 -17
Skill-Assessment Exercise 13.5 WileyPLUS
PROBLEM: Determine the range of sampling interval, T, that will make the system shown in Figure 13.16 stable.
Control Solutions
Hold
FIGURE 13.16 Digital system for Skill-Assessment Exercise 13.5
m + AT* r/„ *V. r T
.
Plant
l-e~ s
Ts
—*»
20 5+5
m
ANSWER: 0 < T < 0.1022 second
The complete solution is located at www.wiley.com/college/nise.
3
Symbolic math software, such as MATLAB's Symbolic Math Toolbox, is recommended to reduce the labor required to perform the transformation.
13.7 Steady-State Errors
PROBLEM: Given T(z) = N(z)/D(z), where D{z) = z3 - z2 - 0.5z + 0.3, use the Routh-Hurwitz criterion to find the number of z-plane poles of T(z) inside, outside, and on the unit circle. Is the system stable? ANSWER: T(z) has one pole outside the unit circle, no poles on the unit circle, and two poles inside the unit circle. The system is unstable. The complete solution is located at www.wiley.com/college/nise. In this section, we covered the concepts of stability for digital systems. Both z- and s-plane perspectives were discussed. Using a bilinear transformation, we are able to use the Routh-Hurwitz criterion to determine stability. The highlight of the section is that sampling rate (along with system parameters, such as gain and component values) helps to determine or destroy the stability of a digital system. In general, if the sampling rate is too slow, the closed-loop digital system will be unstable. We now move from stability to steady-state errors, paralleling our previous discussion of steady-state errors in analog systems.
f
13.7 Steady-State Errors
We now examine the effect of sampling upon the steady-state error for digital systems. Any general conclusion about the steady-state error is difficult because of the dependence of those conclusions upon the placement of the sampler in the loop. Remember that the position of the sampler could change the open-loop transfer function. In the discussion of analog systems, there was only one open-loop transfer function, G(s), upon which the general theory of steady-state error was based and from which came the standard definitions of static error constants. For digital systems, however, the placement of the sampler changes the open-loop transfer function and thus precludes any general conclusions. In this section, we assume the typical placement of the sampler after the error and in the position of the cascade controller, and we derive our conclusions accordingly about the steady-state error of digital systems. Consider the digital system in Figure 13.17(a), where the digital computer is represented by the sampler and zero-order hold. The transfer function of the plant is represented by Gi(s) and the transfer function of the z.o.h. by (1 - e~Ts)/s. Letting G(s) equal the product of the z.o.h. and G\ (s), and using the block diagram reduction techniques for sampled-data systems, we can find the sampled error, E* (s) = E{z). Adding synchronous samplers at the input and the feedback, we obtain Figure 13.17(6). Pushing G{s) and its input sampler to the right past the pickoff point yields Figure 13.17(c). Using Figure 13.9(a), we can convert each block to its z-transform, resulting in Figure 13.17(^/). From this figure, E(z) = R{z) - E(z)G(z), or
^)=1¾
( 13 - 65 >
The final value theorem for discrete signals states that e*{oo)=\im{l-Z-1)E{z) z-*\
(13.66)
749
750
Chapter 13
Digital Control Systems
1 - e~Ts —»s
T
T
cid
GM
(a.)
'<">• ^ o ^ ^ { g ) ^ c / « .£*(.?) T
^k/o^L
G(s)
T -O (b)
£*(*)
-o
G(s)
-o
C(.v)
c.(w
/
0
di)
r
r
m FIGURE 13.17 a. Digital feedback control system for evaluation of steady-state errors; b. phantom samplers added; c. pushing G(s) and its samplers to the right past the pickoff point; d, z-transform equivalent system
*fc) +fi 7) —y
E(z)
C(r.)
Qz)
G(z) id) Note: Phantom samplers are shown in color.
where e*(oo) is the final sampled value of e(t), or (alternatively) the final value of e(kT)4 Using the final value theorem on Eq. (13.65), we find that the sampled steadystate error, e*(oo), for unity negative-feedback systems is e*(oo) = lim(l - z-l)E(z) z-ii
= Hm(l - z~l) r ^ L z~*i l + y-r(z)
(13.67)
Equation (13.67) must now be evaluated for each input: step, ramp, and parabola.
Unit Step Input For a unit step input, R(s) = l/s. From Table 13.1, *(*) =
-1
(13.68)
Substituting E q . (13.68) into E q . (13.67), w e have e*(oo) =
1 I+ \im G{z) S-+1
4
See Ogam (1987: 59) for a derivation.
(13.69)
13.7 Steady-State Errors Defining the static error constant, Kp, as Kp=limG(z)
(13.70)
we rewrite Eq. (13.69) as (13.tr
Unit Ramp Input For a unit ramp input, R(z) = Tz/{z - 1 ) - Following the procedure for the step input, you can derive the fact that e*(oo) =
&
(13.72)
where Kv =
Lim(z-l)G(z)
1 z-»l
(13.73)
Unit Parabolic Input
For a unit parabolic input, R{z) = T2z/{z + l)/[2(z - 1)3]. Similarly, e*(oo) =
Ka
(13.74)
where Ka=±]im(z-l)2G(z) T z—i
[13.75)
Summary of Steady-State Errors The equations developed above for e*(oo), Kp, Kv, and Ka are similar to the equations developed for analog systems. Whereas multiple pole placement at the origin of the .y-plane reduced steady-state errors to zero in the analog case, we can see that multiple pole placement at z = 1 reduces the steady-state error to zero for digital systems of the type discussed in this section. This conclusion makes sense when one considers that s = 0 maps into z = 1 under z = eTs. For example, for a step input, we see that if G(z) in Eq. (13.69) has one pole at z = 1, the limit will become infinite, and the steady-state error will reduce to zero. For a ramp input, if G(z) in Eq. (13.73) has two poles at z = 1, the limit will become infinite, and the error will reduce to zero. Similar conclusions can be drawn for the parabolic input and Eq. (13.75). Here, G(z) needs three poles at z = 1 in order for the steady-state error to be zero. Let us look at an example.
751
752
Chapter 13
Digital Control Systems
Example 13.9 Finding Steady-State Error PROBLEM: For step, ramp, and parabolic inputs, find the steady-state error for the feedback control system shown in Figure 13.17(a) if
SOLUTION: First find G(s), the product of the z.o.h. and the plant. "1 1 1
^-¾¾^^
^+1
(13.77)
The z-transform is then
¢(2)=10(1-^1)
Tz z-lf
T -1+*= 10 z-1 z-e
z-l
+
-0~T
1
-T
(13.78)
For a step input, Kp = lim G(z) = oo; e*(oo) = *-i
For a ramp input,
l + K.
=0
Kv = i l i m ( z - l ) G ( z ) = 10; e*(oo) = ^ = 0.1 /C K, For a parabolic input, 1 1 K a ~ l i m ( z - l ) 2 G ( z ) = 0 ; e*(oo)=-±- = oc
(13.79) (13.80)
(13.81)
You will notice that the answers obtained are the same as the results obtained for the analog system. However, since stability depends upon the sampling interval, be sure to check the stability of the system after a sampling interval is established before making steady-state error calculations. MATLAB
Students who are using MATLAB should now run chl3p6 in Appendix B. You will learn how to use MATLAB to determine Kp, Kv, and Ka in a digital system as well as check the stability. This exercise solves Example 13.9 using MATLAB.
Skill-Assessment Exercise 13.7 WileyPLUS Control Solutions
PROBLEM: For step, ramp, and parabolic inputs, find the steady-state error for the feedback control system shown in Figure 13.17(a) if 20(5 + 3) Gl(i) = (, + 4)(, + 5) Let T = 0.1 second. Repeat for T = 0.5 second. ANSWER: F o r i = 0.1second,Kp = 3, Kv = 0,and# fl = 0;for7/ = 0.5second,the system is unstable. The complete solution is located at www.wiley.com/college/nise.
13.8 Transient Response on the z-Plane In this section, we discussed and evaluated the steady-state error of digital systems for step, ramp, and parabolic inputs. The equations for steady-state error parallel those for analog systems. Even the definitions of the static error constants were similar. Poles at the origin of the s-plane for analog systems were replaced with poles at +1 on the z -plane to improve the steady-state error. We continue our parallel discussion by moving into a discussion of transient response and the root locus for digital systems.
^ 13.8 Transient Response on the /-Plane Recall that for analog systems a transient response requirement was specified by selecting a closed-loop, s-plane pole. In Chapter 8, the closed-loop pole was on the existing root locus, and the design consisted of a simple gain adjustment. If the closed-loop pole was not on the existing root locus, then a cascade compensator was designed to reshape the original root locus to go through the desired closed-loop pole. A gain adjustment then completed the design. In the next two sections, we want to parallel the described analog methods and apply similar techniques to digital systems. For this introductory chapter, we will parallel the discussion through design via gain adjustment. The design of compensation is left to you to pursue in an advanced course. Chapter 4 established the relationships between transient response and the 5-plane. We saw that vertical lines on the s-plane were lines of constant settling time, horizontal lines were lines of constant peak time, and radial lines were lines of constant percent overshoot. In order to draw equivalent conclusions on the z-plane, we now map those lines through z = esT. The vertical lines on the s-plane are lines of constant settling time and are characterized by the equation s — a\ + joy, where the real part, o\ = —4/Ts, is constant and is in the left-half-plane for stability. Substituting this into z — esT, we obtain (1382) z = e
* _
(13.84)
753
754
Chapter 13
Digital Control Systems
FIGURE 13.18 Constant damping ratio, normalized settling time, and normalized peak time plots on the z-plane Hence, C
s = a +jco = -co-
yfi-f
[13.85)
+ ja>
Transforming Eq. (13.85) to the z-plane yields
Z = esT = e^&^e**
= e T ^ W 1 ^ 1 ) ZcoT
Constant percent overshoot line s= a + jco
FIGURE 13.19
Thes-plane
sketch of constant percent overshoot line
i-plane
(13.86)
13.9 Gain Design on the z-Plane
755
Thus, given a desired damping ratio, £, Eq. (13.86) can be plotted on the z-plane through a range of a>Tas shown in Figure 13.18. These curves can then be used as constant percent overshoot curves on the z-plane. This section has set the stage for the analysis and design of transient response for digital systems. In the next section, we apply the results to digital systems using the root locus.
(
13.9 Gain Design on the z-Plane
In this section, we plot root loci and determine the gain required for stability C(z) as well as the gain required to meet a transient response requirement. Since m + G(z) *<& the open-loop and closed-loop transfer functions for the generic digital system shown in Figure 13.20 are identical to the continuous system except H(z) for a change in variables from s to z, we can use the same rules for plotting a root locus. However, from our previous discussion, the region of stability on the FIGURE 13.20 Generic digital feedback control system z-plane is within the unit circle and not the left half-plane. Thus, in order to determine stability, we must search for the intersection of the root locus with the unit circle rather than the imaginary axis. In the last section, we derived the curves of constant settling time, peak time, and damping ratio. In order to design a digital system for transient response, we find the intersection of the root locus with the appropriate curves as they appear on the zplane in Figure 13.18. Let us look at the following example.
Example 13.10 Stability Design via Root Locus PROBLEM: Sketch the root locus for the system shown in Figure 13.21. Also, determine the range of gain, K, for stability from the root locus plot.
m
it>) *Vy
1
K(z+l) ( 2 - 1 )(z-0.5)
C(z)
FIGURE 13.21 Digital feedback control for Example 13.10
SOLUTION: Treat the system as if z were s, and sketch the root locus. The result is shown in Figure 13.22. Using the root locus program discussed in Appendix H.2 at www.wiley.com/college/nise, search along the unit circle for 180°. Identification of the gain, K, at this point yields the range of gain for stability. Using the program, we find that the intersection of the root locus with the unit circle is 1Z60°. The gain at this point is 0.5. Hence, the range of gain for stability is 0 < K < 0.5. Students who are using MATLAB should now run chl3p7 in Appendix B . You will learn how to use MATLAB to plot a root locus on the z-plane as well as superimpose the unit circle. You will learn how to select interactively the intersection of the root locus and the unit circle to obtain the value of gain for stability. This exercise solves Example 13.10 using MATLAB.
MATLAB
756
Chapter 13
Digital Control Systems
2-plane
1.50
3.00
Re
Unit circle Root locus
-3.00 FIGURE 13.22
Root locus for the system of Figure 13.21
In the next example, we design the value of gain, K, in Figure 13.21 to meet a transient response specification. The problem is handled similarly to the analog system design, where we found the gain at the point where the root locus crossed the specified damping ratio, settling time, or peak time curve. In digital systems, these curves are as shown in Figure 13.18. In summary, then, draw the root locus of the digital system and superimpose the curves of Figure 13.18. Then find out where the root locus intersects the desired damping ratio, settling time, or peak time curve and evaluate the gain at that point. In order to simplify the calculations and obtain more accurate results, draw a radial line through the point where the root locus intersects the appropriate curve. Measure the angle of this line and use the root locus program in Appendix H.2 at www.wiley.com/ college/nise to search along this radial line for the point of intersection with the root locus.
Example 13.11 Transient Response Design via Gain Adjustment PROBLEM: For the system of Figure 13.21, find the value of gain, K, to yield a damping ratio of 0.7. SOLUTION: Figure 13.23 shows the constant damping ratio curves superimposed over the root locus for the system as determined from the last example. Draw a radial line from the origin to the intersection of the root locus with the 0.7 damping ratio curve (a 16.62° line). The root locus program discussed in Appendix H.2 at www.wiley.com/college/nise can now be used to obtain the gain by searching along a 16.62° line for 180°, the intersection with the root locus. The results of the program show that the gain, K, is 0.0627 at 0.719 +/0.215, the point where the 0.7 damping ratio curve intersects the root locus.
13.9 Gain Design on the z-PIane
757
Root locus
«•» Re
FIGURE 13.23 Root locus for the system of Figure 13.21 with constant 0.7 damping ratio curve
We can now check our design by finding the unit sampled step response of the system of Figure 13.21. Using our design, K = 0.0627, along with R(z) = z/(z - 1), a sampled step input, we find the sampled output to be R(z)G{z)
C(z) = 1 + G{z)
0.0627z2 + 0.0627z z - 2.4373z2 + 2z- 0.5627 3
(13.87)
Performmg the indicated division, we obtain the output valid at the sampling instants, as shown in Figure 13.24. Since the overshoot is approximately 5%, the requirement of a 0.7 damping ratio has been met. You should remember, however, that the plot is valid only at integer values of the sampling instants. Students who are using MATLAB should now run chl3p8 in Appendix B. You will learn how to use MATLAB to plot a root locus on the z-planeas well as superimpose a grid of damping ratio curves . You will learn how to obtain the gain and a closed-loop step response of a digital system after interactively selecting the operating point on the root locus. This exercise solves Example 13.11 using MATLAB.
10 12 Sampling instant Note: Valid only at integer values of sampling instant
MATLAB
FIGURE 13.24 Sampled step response of the system of Figure 13.21 with K = 0.0627
758
Chapter 13
Digital Control Systems
Skill-Assessment Exercise 13.8 PROBLEM: For the system of Figure 13.20 where H(z) = 1 and
Trylt 13.3 Use MATLAB, the Control System Toolbox, and the following statements to solve Skill-Assessment Exercise 13.8. G z = z p k ( - 0 . 5 , [ 0 . 2 5,0.75], . . . 1, []) r l o c u s (Gz) z g r i d ( 0 . 5 , [ ]) [K, p] = r l o c f i n d (Gz)
{Z)
K(z +0.5) (z-0.25)(z-0.75)
find the value of gain, K, to yield a damping ratio of 0.5. ANSWER:
K = 0.31
The complete solution is at www.wiley.com/college/nise.
Note: When the root locus appears, click on the intersection of the 0.5 damping ratio curve and the root locus to calculate the gain.
Simulink
Gui Toi
MATLAB's Simulink provides an alternative method of simulating digital systems to obtain the time response. Students who are performing the MATLAB exercises and want to explore the added capability of Simulink should now consult Appendix C, MATLAB's Simulink Tutorial. Example C . 4 in the tutorial shows how to use Simulink to simulate digital systems. MATLAB's LTI Viewer provides another method of simulating digital systems to obtain the time response. Students who are performing the MATLAB exercises and want to explore the added capability of MATLAB's LTI Viewer should now consult Appendix E at www.wiley. com/college/nise, which contains a tutorial on the LTI Viewer as well as some examples. One of the illustrative examples, Example E. 5, finds the closed-loop step response of a digital system using the LTI Viewer. In this section, we used the root locus and gain adjustment to design the transient response of a digital system. This method suffers the same drawbacks as when it was applied to analog systems; namely, if the root locus does not intersect a desired design point, then a simple gain adjustment will not accomplish the design objective. Techniques to design compensation for digital systems can then be applied.
(
13.10 Cascade Compensation via the s-Plane In previous sections of this chapter, we analyzed and designed digital systems directly in the z-domain up to and including design via gain adjustment. We are now ready to design digital compensators, such as those covered in Chapters 9 and 11. Rather than continuing on this path of design directly in the z-domain, we depart by covering analysis and design techniques that allow us to make use of previous chapters by designing on the s-plane and then transforming our s-plane design to a
13.10 Cascade Compensation via the s-Plane digital implementation. We covered one aspect of s-plane analysis in Section 13.6, where we used a bilinear transformation to analyze stability. We now continue with s-plane analysis and design by applying it to cascade compensator design. Direct design of compensators on the z-plane is left for a dedicated course in digital control systems.
Cascade Compensation In order to perform design in the s-plane and then convert the continuous compensator to a digital compensator, we need a bilinear transformation that will preserve, at the sampling instants, the response of the continuous compensator. The bilinear transformation covered in Section 13.6 will not meet that requirement. A bilinear transformation that can be performed with hand calculations and yields a digital transfer function whose output response at the sampling instants is approximately the same as the equivalent analog transfer function is called the Tustin transformation. This transformation is used to transform the continuous compensator, Gc(s), to the digital compensator, Gc{z). The Tustin transformation is given by 5 (13.88)
and its inverse by
(13.89)
As the sampling interval, T, gets smaller (higher sampling rate), the designed digital compensator's output yields a closer match to the analog compensator. If the sampling rate is not high enough, there is a discrepancy at higher frequencies between the digital and analog filters' frequency responses. Methods are available to correct the discrepancy, but they are beyond the scope of our discussion. The interested reader should investigate the topic of prewarping, covered in books dedicated to digital control and listed in the Bibliography at the end of this chapter. Astrom and Wittenmark {1984) have developed a guideline for selecting the sampling interval, T. Their conclusion is that the value of Tin seconds should be in the range 0.15/co^M to 0.5/co^M, where a>
See Ogata (1987: 315-318) for a derivation.
759
760
Chapter 13
Digital Control Systems
Example 13.12 Digital Cascade Compensator Design PROBLEM: For the digital control system of Figure 13.25(a), where Gp{s)
~
(13.90)
s(s + 6)(s + 10)
design a digital lead compensator, Gc{z), as shown in Figure 13.25(c), so that the system will operate with 20% overshoot and a settling time of 1.1 seconds. Create your design in the ^-domain and transform the compensator to the z-domain. Digital controller Ms) m +£ 0 = * A/D
R(s) +
m
7) *
P
Plant
Digital computer
D/A
GM
compensator
Plant
Gc(s)
Gp(s)
C(s)
C(s)
m
m + 7)
P
£(z)
.
Digital lead compensator
Plant with sample-and-hold
GM
Gpiz)
m
(c) FIGURE 13.25 a. Digital control system showing the digital c o m p u t e r performing compensation; b. continuous system used for design; c. transformed digital system
SOLUTION: Using Figure 13.25(6), design a lead compensator using the techniques described in Chapter 9 or 11. The design was created as part of Example 9.6, where we found that the lead compensator was Gc(s) =
1977'(s + 6) (s + 29.1)
(13.91)
13.10 Cascade Compensation via the s-Plane
761
Using Eqs. (13.90) and (13.91), we find that the zero dB frequency, a>$M, for Gp(s)Gc(s) is 5.8 rad/s. Using the guideline described by Astrom and Wittenmark {1984), the lowest value of T should be in the range 0,15/6¾ = 0.026 to 0.5/w<j>M = 0.086 second. Let us use T = 0.01 second. Substituting Eq. (13.88) into Eq. (13.91) with T = 0.01 second yields Gc(z) =
1778z -1674 z - 0.746
(13.92)
The z-transform of the plant and zero-order hold, found by the method discussed in Section 13.4 with T = 0.01 second, is GP{z) =
(1.602 x l O ' V ) + (6.156 x 10~7z) + (1.478 x 10~7) z3 - 2.847z2 + 2.699^ - 0.8521
(13.93)
The time response in Figure 13.26 (T = 0.01 s) shows that the compensated closed-loop system meets the transient response requirements. The figure also shows the response for a compensator designed with sampling times at the extremes of Astrom and Wittenmark's guideline. MATLAB
Students who are usingMATLAB should now run chl3p9 in Appendix B. You will learn how to use MATLAB to design a digital lead compensator using the Tustin transformation. This exercise solves Example 13.12 usingMATLAB.
Time (seconds) FIGURE 13.26
Note: Valid only at integer values of sampling instant Closed-loop response for the compensated system of Example 13.12
showing effect of three different sampling frequencies
Chapter 13
762
Digital Control Systems
Skill-Assessment Exercise 13.9 WileyPLUS
PROBLEM: In Example 11.3, a lead compensator was designed for a unity feedback system whose plant was
Control Solutions
G(s) =
WOK s{s + 36){s + 100)
The design specifications were as follows: percent overshoot = 20%, peak time 0.1 second, and Kv = 40. In order to meet the requirements, the design yielded K = 1440 and a lead compensator, Ge{s) = 2.38
^ + 25.3 s + 60.2
If the system is to be computer controlled, find the digital controller, Gc(z). ANSWER: GAz) = 2.34
7 - 0 975 „ , T = 0.001 second 0.9416 Z —nnA
The complete solution is at www.wiley.com/college/nise. Now that we have learned how to design a digital cascade compensator, Gc(z), the next section will teach us how to use the digital computer to implement it.
(
13.11 Implementing the Digital Compensator The controller, Gc(z), can be implemented directly via calculations within the digital computer in the forward path as shown in Figure 13.27. Let us now derive a numerical algorithm that the computer can use to emulate the compensator. We will find an expression for the computer's sampled output, x*(t), whose transforms are shown in Figure 13.27 as X{z). We will see that this expression can be used to program the digital computer to emulate the compensator. Consider a second-order compensator, Gc(z), Gc(z) =
X{z) E{z)
Q3Z3 + a2z2
a\z + «o b2z2 + b\z + b0
(13.94)
Cross-multiplying, {b2z2 + bxz + b0)X(z) = («3z3 + a2z2 + fliz + a0)E(z)
(13.95)
Solving for the term with the highest power of z operating on the output, X(z), b2z2X{z) = (a3z3 + a2z2 + mz + a0)E(z) - {bxz + b0)X{z) Plant with sample-and-hold
Computer
FIGURE 13.27 Block diagram showing computer emulation of a digital compensator
emu lating compensator E(z)
Gc(z)
(13.96)
X(z)
G(z)
Clzl
13.11 Implementing the Digital Compensator e*(t)
**(')
«2
\ Delay Tseconds
Delay Tseconds
a,
e-it-T) „
">\ +'
' Delay Tseconds
. ^
9 .fvv -
%
x'U-T)
b2 Delay Tseconds
a
e-{t- 2D
^
o
x*(t-2T)
b2
Dividing by the coefficient of X{z) on the left-hand side of Eq. (13.96) yields
X{z) = a3
£ 2 , £i_ -i b2 b2
%->
*<-' l ^ - 1 + l ^
X{z)
(13.97)
Finally, taking the inverse z-transform,
-f/(^n+f/(^f/(t-T)^{t~2T) (13.98)
-^x*(t-T)-^x*{t-2T) D2
b2
We can see from this equation that the present sample of the compensator output, x*(t), is a function of future (e*(f + T)) present (e*(t)) and past (e*(t-T)) and e*(t — 2T)) samples of e(t), along with past values of the output, x*(t — T) and x*(t — 2T). Obviously, if we are to physically realize this compensator, the output sample cannot be dependent upon future values of the input. Hence, to be physically realizable, «3 must equal zero for the future value of e{t) to be zero. We conclude that the numerator of the compensator's transfer function must be of equal or lower order than the denominator in order that the compensator be physically realizable. Now assume that a 3 does indeed equal zero. Equation (13.98) now becomes
*W-5'M+!*»
T)+^-e*{tb2
bo 2T) - ^-x*(t - 7 ) - -^x*(t - 27) bi kt (13.99)
Hence, the output sample is a function of current and past input samples of the input as well as past samples of the output. Figure 13.28 shows the flowchart of the compensator from which a program can be written for the digital computer. 6 The figure shows that the compensator can be implemented by storing several successive values of the input and output. The output is then formed by a weighted linear combination of these stored variables. Let us now look at a numerical example.
6
763
For an excellent discussion on basic flowcharts to represent digital compensators, including the representation shown in Figure 13.28 and alternative flowcharts with half as many delays, see Chassaing (1999, pp. 135-143).
FIGURE 13.28 Flowchart for a second-order digital compensator (Reprinted with permission of John Wiley & Sons, Inc.)
764
Chapter 13
Digital Control Systems
Example 13.13 Digital Cascade Compensator Implementation PROBLEM: Develop a flowchart for the digital compensator defined by Eq. (13.100). X{z) z + 0.5 Gc{z) = (13.100) 2 E(z) z -0.5z + 0.7 SOLUTION: Cross-multiply and obtain {z2 - 0.5z + 0.7)X{z) = (z + 0.5)E(z)
(13.101)
Solve for the highest power of z operating on the output, X(z), z2X(z) = (z + 0.5)E(z) - (-0.5z + 0.7)X{z)
(13.102)
Solving for X(z) on the left-hand side, X{z) = (z~l + 0.5Z-2)E(Z) - (-0.5Z"1 +0.7z-2)X(z)
(13.103)
Implementing Eq. (13.103) with the flowchart of Figure 13.29 completes the design.
X*(t)
e*{i)
Delay T seconds
Delay Tseconds e*(t-T)
X*
V FIGURE 13.29
implement Gc(z) =
Delay Tseconds
Delay Tseconds
Flowchart to
z2 - 0.5z + 0.7 (Reprinted with permission of John Wiley & Sons, Inc.)
e*(t-2T)
t-T)
-0.5
0.5
0.7
x*{t-2T)
Skill-Assessment Exercise 13.10 PROBLEM: Draw a flowchart from which the compensator 1899z2 - 376U + 1861 C Z ^ '~ z 2 -1.908z +0.9075 can be programmed if the sampling interval is 0.1 second. ANSWER: The complete solution is at www.wiley.com/college/nise.
Case Studies
765
In this section, we learned how to implement a digital compensator. The resulting flowchart can serve as the design of a digital computer program for the computer in the loop. The design consists of delays that can be thought of as storage for each sampled value of input and output. The stored values are weighted and added. The engineer then can implement the design with a computer program. In the next section, we will put together the concepts of this chapter as we apply the principles of digital control system design to our antenna azimuth control system.
Case Studies Antenna Control: Transient Design via Gain We now demonstrate the objectives of this chapter by turning to our ongoing antenna azimuth position control system. We will show where the computer is inserted in the loop, model the system, and design the gain to meet a transient response requirement. Later, we will design a digital cascade compensator. The computer will perform two functions in the loop. First, the computer will be used as the input device. It will receive digital signals from the keyboard in the form of commands, and digital signals from the output for closed-loop control. The keyboard will replace the input potentiometer, and an analog-to-digital (A/D) converter along with a unity gain feedback transducer will replace the output potentiometer. Figure 13.30(A) shows the original analog system, and Figure 13.30(6) shows the system with the computer in the loop. Here the computer is receiving digital signals from two sources: (1) the input via the keyboard or other tracking commands and (2) the output via an A/D converter. The plant is receiving signals from the digital computer via a digital-to-analog (D/A) converter and the sample-and-hold. Figure 13.30(6) shows some simplifying assumptions we have made. The power amplifier's pole is assumed to be far enough away from the motor's pole that we can represent the power amplifier as a pure gain equal to its dc gain of unity. Also, we have absorbed any preamplifier and potentiometer gain in the computer and its associated D/A converter.
Design
PROBLEM: Design the gain for the antenna azimuth position control system shown in Figure 13.30(6) to yield a closed-loop damping ratio of 0.5. Assume a sampling interval of T = 0.1 second.
H*S* -
Pot
Preamj
0.64
K
Power amp 100 s+100
-3
Motor & loac Gears 2.083 —*- 5(5+1.71) —^ 0.1
e„^
(a)
AID
+ (\ 1
Computer &D/A Sample-andhold
Power amp »•
Motor & load 2.083 5(5+1.71)
1
(b)
Gears 0.1
% FIGURE 13.30 Antenna control system: a. analog implementation; b. digital implementation
Chapter 13
Digital Control Systems
SOLUTION: Modeling the System: Our first objective is to model the system in the z-domain. The forward transfer function, G(s), which includes the sample-andhold, power amplifier, motor and load, and the gears, is 0.2083 1 - erTs 0.2083 ( 1 - e 7V 2 G(s) = (13.104) s s(s + a) s (s + a) where a = 1.71, and T = 0.1. Since the z-transform of (1 — e~Ts) is (1 - z~r and, from Example 13.6, the z-transform of a/[s2 (s + a)] is
{l-e-al)z a{z-l){z-e-aT)
Tz 2
s 0 + a]
(z-1)
2
(13.105)
the z-transform of the plant, G(z), is _, ,
0.2083.. a 0.2083
_! s2(s-{ aT - ( 1 - e-aT] \z + [(1 - e-aT) - aTe~aT]
(13.106)
(z-l)(z-e-"T)
a"
Substituting the values for a and T, we obtain W
_ 9.846 x 10~4(z + 0.945) ~ ( z - l ) ( z - 0.843)
(13.107)
Figure 13.31 shows the computer and plant as part of the digital feedback control system. Designing for Transient Response: Now that the modeling in the z-domain is complete, we can begin to design the system for the required transient response. We superimpose the root locus over the constant damping ratio curves in the z-plane, as shown in Figure 13.32. A line drawn from the origin to the intersection forms an 8.58° angle. Searching along this line for 180°, we find the intersection to be (0.915 +/0.138), with a loop gain, 9.846 x 10" 4 #, of 0.0135. Hence, K = 13.71. Checking the design by finding the unit sampled step response of the closed-loop system yields the plot of Figure 13.33, which exhibits 20% overshoot (£ = 0.456). CHALLENGE: We now give you a case study to test your knowledge of this chapter's objectives: You are given the antenna azimuth position control system shown on the front endpapers, Configuration 2. Do the following: a. Convert the system into a digital system with T — 0.1 second. For the purposes of the conversion, assume that the potentiometers are replaced with unity gain transducers. Neglect power amplifier dynamics. b. Design the gain, K, for 16.3% overshoot. c. For your designed value of gain, find the steady-state error for a unit ramp input.
d. Repeat Part b using MATLAB. Computer R(z) FIGURE 13.31 Analog antenna azimuth position control system converted to a digital system
<&~
Plant = G(z) 9.846 x 10-4^ + 0.945) (z-l)(z-0.843)
C(-)
Case Studies
-0.2 -
3 4 5 Time (seconds)
0
767
6
Note: Valid only at integer values of sampling instant
-0.4 -
FIGURE 13.33 Sampled step response of the antenna azimuth position control system -0.6 -
FIGURE 13.32 Root locus superimposed over constant damping ratio curve
Antenna Control: Digital Cascade Compensator Design PROBLEM: Design a digital lead compensator to reduce the settling time by a factor of 2.5 from that obtained for the antenna azimuth control system in the previous Case Study problem in this chapter. SOLUTION: Figure 13.34 shows a simplified block diagram of the continuous system, neglecting power amplifier dynamics and assuming that the potentiometers are replaced with unity gain transducers as previously explained. We begin with an s-plane design. From Figure 13.33, the settling time is about 5 seconds. Thus, our design requirements are a settling time of 2 seconds and a damping ratio of 0.5. The natural frequency is con = 4/(£T 5 ) = 4rad/s. The compensated dominant poles are located at — £a>„ ± jcon\/l — £2 = —2 ±/3.464. Designing a lead compensator zero to cancel the plant pole on the s-plane at —1.71 yields a lead compensator pole at - 4 . Hence the lead compensator is given by Gc(s) =
Lead compensator 0,(.v) +
KGc(s)
1.71 s+4
(13.108)
Plant 0.2083 5(5+1.71)
M FIGURE 13.34
Simplified
block diagram of antenna azimuth control system
768
Chapter 13
Digital Control Systems
Using root locus to evaluate the gain, K, at the design point yields 0.2083.K = 16, or K = 76.81. We now select an appropriate sampling frequency as described in Section 13.10. Using the cascaded compensator, KGc{s) =
76.81(. + 1.71)
(13.109)
(. + 4)
and plant,
GM =
0.2083
(13.110)
. ( . + 1.71)
the equivalent forward-path transfer function, Gc(s) = KGc(s)Gp(s), Ge(s) =
is
- ^ . ( . + 4)
(13.111;
The magnitude frequency response of Eq. (13.111) is 0 dB at 3.1 rad/s. Thus, from Section 13.10, the value of the sampling interval, T, should be in the range 0.15/CD$M = 0.05 to 0.5/&>4>M = 0.16 second. Let us choose a smaller value, say T = 0.025 second. Substituting Eq. (13.88) into Eq. (13.111), where T = 0.025, yields the digital compensator
In order to simulate the digital system, we calculate the z-transform of the plant in Figure 13.34 in cascade with a zero-order sample-and-hold. The z-transform of the sampled plant is evaluated by the method discussed in Section 13.4 using T = 0.025. The result is i-5
GP(z) =
6.418 x lQ-°z + 6.327 x 10 z 2 - 1 . 9 5 8 * + 0.9582
-5
(13.113)
The step response in Figure 13.35 shows approximately 20% overshoot and a settling time of 2.1 seconds for the closed-loop digital system.
FIGURE 13.35 Closed-loop digital step response for antenna control system with a lead compensator
0
0.5
1
1.5
2
2.5
3
Time (seconds) Note: Valid only at integer values of sampling instant
Summary
e<m
x-it)
74.72
'
\
Delay 0.025 second
Delay 0.025 second
e (M) 025)
+ 1 -71.59
769
T^yr
-0.9048
'
, *t*-).025)
FIGURE 13.36 Flowchart for digital lead compensator. (Reprinted with permission of John Wiley & Sons, Inc.)
We conclude the design by obtaining a flowchart for the digital compensator. Using Eq. (13.112), where we define KGc(z) = X(z)/E(z), and cross-multiplying yields (13.114) (z - 0.9048)X(z) = (74.72z - 71.59)E(z) Solving for the highest power of z operating on X(z), zX{z) = (74.72z - 71.59)£(z) + 0.9048X(z)
(13.115)
Solving for X(z), X{z) = (74.72 - 71.59^- 1 )^) + 0 . 9 0 4 8 ^ ¾ ^
(13.116)
Implementing Eq. (13.116) as a flowchart yields Figure 13.36. CHALLENGE: You are now given a case study to test your knowledge of this chapter's objectives. You are given the antenna azimuth position control system shown on the front endpapers, Configuration 2. Replace the potentiometers with unity gain transducers, neglect power amplifier dynamics, and do the following: a. Design a digital lead compensator to yield 10% overshoot with a 1-second peak time. Design in the s-plane and use the Tustin transformation to specify and implement a digital compensator. Choose an appropriate sampling interval. b. Draw a flowchart for your digital lead compensator. C. R e p e a t P a r t a u s i n g MATLAB.
^ Summary j | In this chapter, we covered the design of digital systems using classical methods. State-space techniques were not covered. However, you are encouraged to pursue this topic in a course dedicated to sampled-data control systems. We looked at the advantages of digital control systems. These systems can control numerous loops at reduced cost. System modifications can be implemented with software changes rather than hardware changes. Typically, the digital computer is placed in the forward path preceding the plant. Digital-to-analog and analog-to-digital conversion is required within the system to ensure compatibility of the analog and digital signals throughout the system. The digital computer in the loop is modeled as a sample-and-hold network along with any compensation that it performs. Throughout the chapter, we saw direct parallels to the methods used for 5-plane analysis of transients, steady-state errors, and the stability of analog systems.
MATLAB
Chapter 13
Digital Control Systems
The parallel is made possible by the z-transform, which replaces the Laplace transform as the transform of choice for analyzing sampled-data systems. The z-transform allows us to represent sampled waveforms at the sampling instants. We can handle sampled systems as easily as continuous systems, including block diagram reduction, since both signals and systems can be represented in the z-domain and manipulated algebraically. Complex systems can be reduced to a single block through techniques that parallel those used with the s-plane. Time responses can be obtained through division of the numerator by the denominator without the partial-fraction expansion required in the ^-domain. Digital systems analysis parallels the s-plane techniques in the area of stability. The unit circle becomes the boundary of stability, replacing the imaginary axis. We also found that the concepts of root locus and transient response are easily carried into the z-plane. The rules for sketching the root locus do not change. We can map points on the s-plane into points on the z-plane and attach transient response characteristics to the points. Evaluating a sampled-data system shows that the sampling rate, in addition to gain and load, determines the transient response. Cascade compensators also can be designed for digital systems. One method is to first design the compensator on the s-plane or via frequency response techniques described in Chapters 9 and 11, respectively. Then the resulting design is transformed to a digital compensator using the Tustin transformation. Designing cascade compensation directly on the z-plane is an alternative method that can be used. However, these techniques are beyond the scope of this book. This introductory control systems course is now complete. You have learned how to analyze and design linear control systems using frequency-domain and statespace techniques. This course is only a beginning. You may consider furthering your study of control systems by taking advanced courses in digital, nonlinear, and optimal control, where you will learn new techniques for analyzing and designing classes of systems not covered in this book. We hope we have whetted your appetite to continue your education in control systems engineering.
^ R e v i e w Questions ^ 1. Name two functions that the digital computer can perform when used with feedback control systems. 2. Name three advantages of using digital computers in the loop. 3. Name two important considerations in analog-to-digital conversion that yield errors. 4. Of what does the block diagram model for a computer consist? 5. What is the z-transform? 6. What does the inverse z-transform of a time waveform actually yield? 7. Name two methods of finding the inverse z-transform. 8. What method for finding the inverse z-transform yields a closed-form expression for the time function? 9. What method for finding the inverse z-transform immediately yields the values of the time waveform at the sampling instants? 10. In order to find the z-transform of a G(s), what must be true of the input and the output? 11. If input R(z) to system G{z) yields output C(z), what is the nature of c(r)?
Problems
771
12. If a time waveform, c(t), at the output of system G(z) is plotted using the inverse z-transform, and a typical second-order response with damping ratio = 0.5 results, can we say that the system is stable? 13. What must exist in order for cascaded sampled-data systems to be represented by the product of their pulse transfer functions, G(z)? 14. Where is the region for stability on the z-plane? 15. What methods for finding the stability of digital systems can replace the RouthHurwitz criterion for analog systems? 16. To drive steady-state errors in analog systems to zero, a pole can be placed at the origin of the 5-plane. Where on the z-plane should a pole be placed to drive the steady-state error of a sampled system to zero? 17. How do the rules for sketching the root locus on the z-plane differ from those for sketching the root locus on the 5-plane? 18. Given a point on the z-plane, how can one determine the associated percent overshoot, settling time, and peak time? 19. Given a desired percent overshoot and settling time, how can one tell which point on the z-plane is the design point? 20. Describe how digital compensators can be designed on the 5-plane. 21. What characteristic is common between a cascade compensator designed on the 5-plane and the digital compensator to which it is converted?
Problems 1. Derive the z-transforms for the time functions listed below. Do not use any z-transform tables. Use the plan/(f) -+ f*(t) -+ F*(s) -+ F{z), followed by converting F(z) into closed form making use of the fact that 1 / ( 1 - ^ ) = 1 + ^ - 1 + z'2 + z- 3 Assume ideal sampling. [Section: 13.3] a. e-alu(t) b. u(t)
2. Repeat all parts of Problem 1 using MATLAB and MATLAB's Symbolic Math Toolbox.
Symbolic Math
using partial-fraction
z(z + 3)(z + 5) (z-0.4)(z-0.6)(z-0.8) (z + 0.2)(z + 0.4) b. F{Z) = (z-0.1)(z-0.5)(z-0.9) (z + l)(z + 0.3)(z + 0.4) c F(z) = z(z-0.2)(z-0.5)(z-0.7)
a. F(z) =
a. Find f(kT) using the power series expansion. b. Check your results against your answers from Problem 3.
c. t2e-alu(i) d. cos cot u{t)
3. For each F(z), find f{kT) expansion. [Section: 13.3]
4. R e p e a t a l l p a r t s of P r o b l e m 3 symbolicMaih u s i n g MATLAB and MATLAB's SymV L W b o l i c Math Toolbox. 5. For each F(z) in Problem 3, do the following: [Section: 13.3]
6. Using partial-fraction expansion and Table 13.1, find the z-transform for each G(s) shown below if T = 0.5 second. [Section: 13.3] (s + 4) a. G(s) = (s + 2){s + 5) ( J + 1)(J+ 2) 5(5 + 3)(5 + 4) 20 c. G(s) = {s + 3)(52 + 65 25) 15 d. G(s) = 5(5+ 1)(5 2 + 105 + 8 1 ; b. G(s) =
^MJJ/-% 'i T
Chapter 13
772
Digital Control Systems
7. R e p e a t a l l p a r t s of P r o b l e m 6 symbolic Math 10. Find Ciz) in general terms for the digital system us i n g MATLAB and MATLAB's Syra^HflM shown in Figure P13.3. [Section: 13.5] b o l i c Math T o o l b o x . 11. Find the closed-loop transfer function, T(z) = 8. Find G{z) = C(z)/R(z) for each of the block diaC(z)/R[z), for the system shown in Figure P13.4. grams shown in Figure P13.1 if T = 0.3 second. [Section: 13.5] [Section: 13.4] 12. Given the system in Figure P13.5, wileypms 9. Find T(z) = C(z)/R(z) for each of the systems find the range of sampling interval, > V W shown in Figure P13.2. [Section: 13.5] T, that will keep the system stable. control solutions [Section: 13.6] >0 s(s + 5)
Hold
O
m
(a)
20 s(s + 5)
Hold
O
as) (s + 3)
(b)
O*-
20 s(s + 5)
Hold
O-
Hold
as) (J+ 3)
(c) FIGURE P13.1
^ K / O ^
o o—
as)
G2(s)
R(s) +
&-*•
G2(s)
0,0)
H(s) (a)
lb) FIGURE P13.2
^ ¾ ¾ ^ &M - ^ O O
G2(S)
G&)
O*-
,v
H,{s) — Q
GJs)
as)
1
as)
H2(s)
T
H2(s) FIGURE P13.3
1 s s+1)
2
-f
T 2
FIGURE P13.4
as)
Problems
r
C(s)
1 <s+l)
Hold r
773
FIGURE P13.5 MATLAB
13. Write a MATLAB program that can
be used to find the range of sam- d l u ^ P pling time, T, for stability. The program will be used for systems of the type represented in Figure P13.6 and should meet the following requirements:
m*< m[
ZV
R(s) +,
Hold
r
r=o.i
C(s)
20 s(s + 2)
as)
System 2 1.28 z - 0.37
R(z)+< - ?
T=0.5
C(z)
System 3
C(s)
C,(.v) i
T = 0.5
1 s+2
System I
a. MATLAB will convert Gx(s) cascaded with a sample-and-hold to G{z) .
b. The program will calculate the z-plane roots of the closed-loop system for a range of Tand determine the value of T, if any, below which the system will be stable. MATLAB will display this value of Talong with the z-plane poles of the closed-loop transfer function.
Hold
Sampleand-hold
R(z)+,
?) f
T=Q.l
fc
0.13(z+l) (z-DU-0.74)
az)
FIGURE P13.6 System 4
Test t h e program on 10(s 7) Gi(s) = > + l ) ( s + 3)(s+4)(s + 5;
FIGURE P13.8
14. Find the range of gain, K, to make the system shown in Figure PI3.7 stable. [Section: 13.6]
mf<
Y.f
Hold T=0.2
3K s(s + 4)
C(s)
G(z) =
FIGURE P13.7
15. Find the static error constants and the steady-state error for each of the digital systems shown in Figure PI3.8 if the inputs are [Section: 13.7] a. u(f) b. tu{t) 1 ¼) c. 7 2
16. Write a MATLAB program that can be MATLAB used to find Kpl Kv, and Ka for digflUB ital systems. The program will be used for systems of the type represented in Figure P13 . 6 . Test your program for
WileyPLUS
(¾
0.04406Z3 - 0.03624Z2 - 0.03284z + 0.02857 z 4 -3.394z 3 + 4.2 9z 2 - 2.393z+ 0.4 966
where G(z) is the pulse transfer function for G(i)(s) in cascade with the z .o.h. and T = 0.1 second.
control solutions 17. For the digital system shown in Figure P13.6, where Gx (s) = K/[{s + 1) x (s + 4)], find the value of K to yield a 16.3% overshoot. Also find the range of K for stability. Let 7/ = 0.1 second. [Section: 13.9] 18. Use Simulink to simulate the step Simulink response for the system of Prob- ^ 0 1 _ J lem 17. Set the value of gain, K, to that designed in Probleml7 for 16.3% overshoot.
774
Chapter 13
Digital Control Systems
19. Use MATLAB's LTI Viewer to deter- JjuITo0' mine the peak time and settling ^ 1 ^ time of the closed-loop step response for System 4 in Figure P13 . 8
The designed PID controller was
20. Write a MATLAB program that can be MATLAB used to design the gain of a digi- V L U ^ P tal control system to meet a percent overshoot requirement. The program will be used for systems of the type represented in Figure Pi3.6 and meet the following requirements:
Find the digital transfer function, Gc(z), of the PID controller in order for the system to be computer controlled if the sampling interval, T, is 0.01 second. [Section: 13.10]
GAs) = 4.6
25. A continuous unity feedback system has a forward transfer function of
c. MATLAB will display the root locus on the z-plane along with an overlay of the percent overshoot curve. d. The user will click with the mouse at the intersection of the root locus and percent overshoot overlay and MATLAB will respond with the value of gain followed by a display of the step response of the closed-loop system. Apply your program to Problem 17 and compare results.
21. For the digital system shown in Figure PI3.6, where Gi(s) = K/[s(s + 1 ) ] , find the value of K to yield a peak time of 2 seconds if the sampling interval, T, is 0.1 second. Also, find the range of K for stability. [Section: 13.9]
wileyPLUs Control Solutions
a. The user will input the desired percent overshoot. b. MATLAB will convert G1(s) cascaded with the sample-and-hold to G(z) .
(5 + 55.92)(5 + 0.5)
G W
=
5(5 + 5)(5 + 8)
The system is to be computer controlled with the following specifications: Percent overshoot: 10% Settling time: 2 seconds Sampling interval: 0:01 second Design a lead compensator for the digital system to meet the specifications. [Section: 13.10] 26. R e p e a t P r o b l e m 25 u s i n g MATLAB.
MATLAB
DESIGN PROBLEMS
27. a. Convert the heading control for the UFSS vehicle shown on the back endpapers (Johnson, 1980) into a digitally controlled system. b. Find the closed-loop pulse transfer function, 7/(4, if T - 0.1 second. c. Find the range of heading gain to keep the digital system stable.
22. For the digital system shown in Figure wileypius P13.6, where' Gi(s) = K/[s(s + 1) WMH9 28. A robot equipped to perform arc welding was discussed in Problem 45, Chapter 8. The robot was (5 + 3)], find the value of K to yield a control solutions compensated by feeding back pressure and velocity 20% overshoot if the sampling interval, T, is signals as shown in Figure P8.13(Z>). Eliminating 0.1 second. Also, find the range of K for stability. these feedback paths yields the block diagram shown [Section: 13.9] in Figure PI3.9 (Hardy, 1967). 23. For the digital system shown in Figure P13.6, where Gi{s) = K(s + 2) + [$($ + 1)(5 + 3)], find the value of K to yield a settling time of 15 seconds if the sampling interval, T, is 1 second. Also, find the range of K for stability. [Section: 13.9] 24. A PID controller was designed in Example 9.5 for a continuous system with unity feedback. The system's plant was (5 + 8) G(s) = ;5 + 3)(5 + 6)(5 + 10)
FIGURE P13.9 Simplified block diagram for robot swing motion a. Convert the robot to a digital control system. Use a sampling time of 0.1 second. b. Sketch the root locus.
Problems
c. Find the range of gain, K, to keep the digital system stable. d. Repeat a l l p r e v i o u s p a r t s u s i n g MATLAB MAT LAB .
K Q P
29. The floppy disk drive of Problem 57, Chapter 8 is to be digitally controlled. If the analog system is as shown in Figure P13.10, do the following:
31. Problem 35, Chapter 9 described a two-tank system where the objective was to maintain a constant liquid level in one of the tanks via control of an inflow valve. Assume for this problem that the transfer function relating liquid-level output, Y(s), to flow rate input Fe(s), for the lower tank is (Romagnoli, 2006) G(s) =
Desired position
x,,is)
Motor and ,oac
1(9) *Vy
FIGURE P13.10 disk drive
.
20,000 s(s + 100)
Actual position
Y
M
L_
Simplified block diagram of a floppy
a. Convert the disk drive to a digital system. Use a sampling time of 0.01 second. b. Find the range of digital controller gain to keep the system stable. c. Find the value of digital controller gain to yield 15% overshoot for a digital step response. d. Repeat all previous parts and J^Ji^L obtain the step response for CiilSP Part c using MATLAB. 30. Scanning probe microscopes are used to visualize samples in the sub-micron dimensional range. They typically use a silica-based probe to physically track the sample topography to create a viable image. However, these devices are very sensitive to external disturbance and vibrations. An approach called inherent disturbance suppression tries to alleviate the disturbance problem through the addition of a laser interferometer that is used to measure the probe-sample interaction and compensate for undesired probe movements. The technique was implemented in a tapping mode atomic force microscope measuring single DNA molecules. It was shown that for a significant range of frequencies the open-loop transmission from the probe's voltage input to probe's displacement is (Sparks, 2006) Gi(s) =
775
Y(s) Fe(s)
0.0187 0.237^ + 0.00908
Assume that the system will be controlled in closed loop by means of a digital computer system with a sample period T = 1 second, as shown in Figure P13.6, with Gi(s) = KG(s). Use the bilinear transformation and the Routh-Hurwitz method to find the range of K that will result in a stable closedloop system. 32. Assume that the two-tank system of Problem 31 is controlled by a digital computer in the configuration of Figure P13.6, where Gi (s) = KG(s). If a sampling period of T = 1 second is used, do the following (Romagnoli, 2006). a. Use MATLAB t o draw t h e r o o t _MATLAB locus. Cul^P b. Find the value of K that will result in a stable system with a damping factor of £ = 0.7. c. Use the root locus of Part b to predict the stepresponse settling time, Ts, and peak time, Tp. d. Calculate the final value of the closed-loop system to a unit step input. e. Obtain the step response of simulink the system using Simulink. VE9P Verify the predictions you made in Parts c and d. 33. In Problem 48, Chapter 9, and Problem 39, Chapter 10, we considered the radial pickup position control of a DVD player. A controller was designed and placed in cascade with the plant in a unit feedback configuration to stabilize the system. The controller was given by
20000
M[S)
0.5(, + 1.63) 4 5 + 0.27)
and the plant by (Bittanti, 2002) Assuming the probe is digitally controlled in a loop, as shown in Figure P13.6, calculate the sampling period range that will result in a stable closed-loop system.
P(s) =
0.63 0.36
,
305.4
1 + ^248.2 7 7 ^ + 248.22
305.4'
0.04
776
Chapter 13
Digital Control Systems
It is desired to replace the continuous system by an equivalent discrete system without appreciably affecting the system performance. a. Find an appropriate sampling frequency for the discretization. b. Using the chosen sampling frequency, translate the continuous compensator into a discrete compensator. c. Use Simulink to simulate the simulink continuous and discrete systems on the same graph. Assume a unit step input. Are there significant differences in the system's performance?
a. Use a sampling period of T = 0.5 s and find a discrete equivalent for this system. b. Use MATLAB t o draw t h e r o o t locus.
tmm W1JP
c. Find the value of K that will result in a stable system with a damping factor of £ = 0.7. d. Use the root locus found in Part a to predict the step-response settling time, Ts, and peak time, Tp. e. Calculate the final value of the closed-loop system unit step response. f. Obtain the step response of Simulink the system using Simulink. ^E^P Verify the predictions you made in Parts c and d.
34. In Problem 25, Chapter 11, we discussed an EVAD, a device that works in parallel with the human heart 36. If you have not already done so, do wileypms to help pump blood in patients with cardiac condiProblem 45 in Chapter 9. In this probGZ29 Conlro1 tions. The device has a transfer function lem, you design a PID controller for a solutions temperature control system. Digitize your PID de1361 Pao{s) G(s) = sign and draw a flowchart from which the PID Em(s) s2 +69s+ 70.85 controller can be implemented. where Em(s) is the motor's armature voltage, and Pao(s) is the aortic blood pressure (Tasch, 1990). 37. Discrete time controlled systems can exhibit unique characteristics not available in continuous controlUsing continuous techniques, a cascaded compenlers. For example, assuming a specific input and sator is designed in a unity feedback configuration some conditions, it is possible to design a system with a transfer function to achieve steady state within one single time sam0^-fl) ple without overshoot. This scheme is well known W *" s + 0.05 and referred to as deadbeat control. We illustrate Selecting to control the device using a microcondeadbeat control design with a simple example. For troller, a discrete equivalent has to be found for a more comprehensive treatment see (Ogata, 1987). Gc(s). Do the following. Assume in Figure 13.25(a) that Gp(s) = -. a. Find an appropriate sampling frequency for the The purpose of the design will be to find a compendiscretization. sator, Gc(z), such that for a step input the system b. Translate the continuous compensator into a achieves steady state within one sample. We start by discrete compensator using the sampling fretranslating the system into the discrete domain to quency found in Part a. obtain the equivalent of Figure 13.25(c). The pulse c. Use Simulink to simulate the sjmuhnk (1 - e-T)z~x transfer function, G (z) = , , - is found p continuous and discrete sysV3^P l — e~ z 1 terns on the same graph for a unit step using Eq. (13.40), since it is assumed that the cominput. There should be little differpensator will be followed by a zero-order hold. In ence between the compensated continuFigure 13.25(c), the closed-loop transfer function is ous and discrete systems. . , C(z) - , , Gc(z)Gp(z) ,. (z)Gp(z) R{z) = T(z) = 1; +, XGc,JX 35. In Problem 46, Chapter 9, a steam-driven turbinerx» or> solving given by -£-% T(z) governor system was implemented by a unity feedfor the compensator, we get Gc(z) = 1 GJz) 1 - T(Zy back system with a forward-path transfer function (Khodabakhshian, 2005) The desired system output is a unit step delayed by one 1 K r ( , unit sample. Thus, C(z) = TZ 1 1 Since z-l ' ( s + 0.08)(J+ 2)(5 +5) z-\
Problems the input is a unit step, R(z) —
-; the desired z—1
closed-loop transfer function is —j4- = T(z) = z~\ and the resulting compensator, found by direct substitution, is given by Gc(z) =-
zf
^-
777
Problem 79(a), Chapter 5, you found the block diagram for the active pantograph control system. In Chapter 9, you designed a PID controller to yield a settling time of 0.3 second with zero steady-state error. Assuming that the active control system is to be computer controlled, do the following:
Assume now that the plant is given by Gp(s) = | , and a sampling period of 7=0.05 second is used. a. Design a deadbeat compensator to reach steady state within one time sample for a step input.
a. Convert the PID controller designed in Problem 55, Chapter 9, to a digital controller by specifying its sampled transfer function, Gc(z). Assume that the potentiometers are replaced by a keyboard, A/D converters, and unity gain transducers.
b. Calculate the resulting steady-state error for a unit-slope ramp input.
b. Draw a flowchart from which the PID controller can be implemented.
c. Simulate your system using Simulink c. Use MATLAB t o s i m u l a t e t h e s t e p J^^L SIMULINK. (Hint: Fo 11 owing K B r e s p o n s e of t h e d i g i t a l a c t i v e C u I ^ P Figure 13.25, the forward path will control system. consist of the cascading of Gc(z), a 41. Control of HIV/AIDS. In Chapter 11, a continuous zero-order hold, and Gp{s) . ) Show cascaded compensator for a unity feedback system that the system reaches steady state was designed for the treatment of the HIV-infected after one sample. Also verify your patient treated with RTIs (Craig, 2004). The transfer steady-state error ramp result. function of the designed compensator was LabViEW 38. Given - 2 x IP" V + 0.04s + 0.0048) GAs) = G(s) = s(s + 0.02) s+4 Use the LabVIEW Control Design and Simulation Module to (1) convert G(s) to a digital transfer function using a sampling rate of 0.25 second; and (2) plot the step responses of the discrete and the continuous transfer functions. 39. Given LabVIEW G(z) =
K(z + 0.5) > - 0 . 2 5 ) ( z - 0.75;
The linearized plant was given by P(s) =
Y(s) Ui (s)
-520s - 10.3844 s3 + 2.6817^2 + 0.11s + 0.0126
The compensated system is overdamped with an approximate settling time of 100 seconds. This system must be discretized for practical reasons: (1) HIV patient cannot be monitored continuously and (2) medicine dosage cannot be adjusted continuously.
Use t h e LabVIEW C o n t r o l D e s i g n ^ATJAB and S i m u l a t i o n Module and t h e ^Cd^P M a t h S c r i p t RT Module t o (1) o b t a i n t h e v a l u e of .FCthat w i l l y i e l d a damping r a t i o of 0 . 5 f o r t h e c l o s e d - l o o p s y s t e m i n F i g u r e 1 3 . 2 0 , where H(z)=l; a n d (2) d i s p l a y t h e s t e p r e s p o n s e of t h e c l o s e d - l o o p s y s tem i n F i g u r e 1 3 . 2 0 where H(z) = 1 . Comp a r e y o u r r e s u l t s w i t h t h o s e of S k i l l Assessment E x e r c i s e 1 3 . 8 .
a. Show that a reasonable sampling period for this system is T = 8 days (medicine dosage will be updated on a weekly basis). b. Use Tustin's method and T = 8 days to find a discrete equivalent to GC(S).
PROGRESSIVE ANALYSIS AND DESIGN PROBLEMS 40. High-speed rail pantograph. Problem 21 in Chapter 1 discusses active control of a pantograph mechanism for high-speed rail systems (O'Connor, 1997). In
42. Hybrid vehicle. In Problem 7.69 (Figure "*TL^_ P7.34), the block diagram of a cascade C u l ^ P scheme for the speed control of an HEV (Preitl, 2007) was represented as a unity feedback system.
C, Use Simulink to simulate the Simulink continuous and discrete com^E^P pensated systems for a unit step input. Plot both responses on the same graph.
778
Chapter 13
Digital Control Systems
In that diagram the output of the system is the speed transducer's output voltage, C(s) — KssV(s). In Part b of Problem 11.35, where a compensator was designed for this problem, we discussed the feasibility of achieving full pole-zero cancellation when we place a PI speed controller's zero, Z/, on top of the uncompensated system's real pole, closest to the origin (located at -0.0163). Noting that perfect pole-zero cancellation may not be maintained, we studied a case, in which the Pi-controller's zero changed by +20%, moving to -0.01304. In that case, the transfer function of the plant with a PI speed controller, which has a proportional gain = K, was given by: G(s) =
ir(s + 0.6)(.y +0.01304) s(j+ 0.0163)(s+ 0.5858)
Assuming that Gi(s) in Figure P13.6 equals the transfer function, G(s), given above for the vehicle with the speed controller: a. Develop a MATLAB M-f ile that would a l low you to do the following: [Hint: Refer to the M-files you developed for Problems 13 and 20 of this chapter]
whole range of the sampling time, T. Subsequently set T= 0.75Tma>:; (3) Design the gain of a digital control system to meet a percent overshoot requirement, %OS, allowingtheuser to input the value of the desired %OS and the value of the PI speed controller's proportional gain, K; (4) Plot the step response of that digital system (in per unit, p. u., v s . time in seconds) b. Run the M-f ile you developed in Part a and enter the values of the desired percent overshoot, % O S = 0 , and the PI speed controller's proportional gain, iC=61; c. Select a point in the graphics window displaying the root locus, such that all poles of the closed-loop transfer are inside the unit function, Tzl circle .
(1) Convert Gx{s) cascaded with a sample-and-hold to G(z);
d. Write the sampled-data transfer functions obtained, Gz and Tz, indicating the corresponding value of the sampling time, T, and all poles, r, of the closed-loop transfer function, T z ;
(2) Search over the range 0 < T < 5 seconds for the largest sampling period Tmax below which the system is stable.Calculatethez-planeroots of the closed-loop system for the
e. Plot the step response of that digital system (in per unit, p. u., vs. time in seconds) noting the following characteristics: final value, rise time, and settling time.
Cyber Exploration Laboratory Experiment 13.1 Objective To design the gain of a digital control system to meet a transient response requirement; to simulate a digital control system to test a design; to see the effect of sampling rate upon the time response of a digital system. Minimum Required Software Packages MATLAB, Simulink, and the Control System Toolbox
Prelab 1. Given the antenna azimuth control system shown on the front endpapers, use Configuration 2 to find the discrete transfer function of the plant. Neglect the dynamics of the power amplifier and include the preamplifier, motor, gears, and load. Assume a zero-order hold and a sampling interval of 0.01 second.
Cyber Exploration Laboratory 2. Using the digital plant found in Prelab 1, find the preamplifier gain required for a closed-loop digital system response with 10% overshoot and a sampling interval of 0.01 second. What is the peak time? 3. Given the antenna azimuth control system shown on the front endpapers, use Configuration 2 to find the preamplifier gain required for the continuous system to yield a closed-loop step response with 10% overshoot. Consider the open-loop system to be the preamplifier, motor, gears, and load. Neglect the dynamics of the power amplifier. Lab 1. Verify your value of preamplifier gain found in Prelab 2 using the SISO Design Tool to generate the root locus for the digital open-loop transfer function found in Prelab 1. Use the Design Constraints capability to generate the 10% overshoot curve and place your closed-loop poles at this boundary. Obtain a plot of the root locus and the design boundary. Record the value of gain for 10% overshoot. Also, obtain a plot of the closed-loop step response using the LTI Viewer and record the values of percent overshoot and peak time. Use the same tool to find the range of gain for stability. 2. Using Simulink set up the closed-loop digital system whose plant was found in Prelab 1. Make two diagrams: one with the digital transfer function for the plant and another using the continuous transfer function for the plant preceded by a zero-order sample-and-hold. Use the same step input for both diagrams and obtain the step response of each. Measure the percent overshoot and peak time. 3. Using Simulink, set up both the digital and continuous systems calculated in Prelabs 2 and Prelab 3, respectively, to yield 10% overshoot. Build the digital system with a sample-and-hold rather than the z-transform function. Plot the step response of each system and record the percent overshoot and the peak time. 4. For one of the digital systems built in Lab 2, vary the sampling interval and record the responses for a few values of sampling interval above 0.01 second. Record sampling interval, percent overshoot, and peak time. Also, find the value of sampling interval that makes the system unstable. Postlab 1. Make a table containing the percent overshoot, peak time, and gain for each of the following closed-loop responses: the digital system using the SISO Design Tool; the digital system using Simulink and the digital transfer functions; the digital system using Simulink and the continuous transfer functions with the zeroorder sample-and-hold; and the continuous system using Simulink. 2. Using the data from Lab 4, make a table containing sampling interval, percent overshoot, and peak time. Also, state the sampling interval that makes the system unstable. 3. Compare the responses of all of the digital systems with a sampling interval of 0.01 second and the continuous system. Explain any discrepancies. 4. Compare the responses of the digital system at different sampling intervals with the continuous system. Explain the differences. 5. Draw some conclusions about the effect of sampling.
Chapter 13
Digital Control Systems
Experiment 13.2 Objective To use the various functions from the Lab VIEW Control Design and Simulation Module for the analysis of digital control systems. Minimum Required Software Packages LabVIEW with the Control Design and Simulation Module and the MathScript RT Module; MATLAB with the Control Systems Toolbox. Prelab You are given Figure P8.28 and the parameters listed in the Prelab of Cyber Exploration Laboratory Experiment 8.2 for the open-loop NASA eight-axis ARMII (Advanced Research Manipulator II) electromechanical shoulder joint/ link, actuated by an armature-controlled dc servomotor. 1. Obtain the open-loop transfer function of the shoulder joint/link, G(s) = T . L , ,, VrefiS) or use your calculation from Cyber Exploration Laboratory Experiment 8.2. 2. Use MATLAB and design a digital compensator to yield a closed-loop response with zero steady-state error and a damping ratio of 0.7. If you already have performed Cyber Exploration Laboratory Experiment 8.2, modify your M-file from that experiment. Test your design using MATLAB. Lab Simulate your Prelab design using a Simulation Loop from the LabVIEW Control Design and Simulation Module. Plot the step response of two loops as follows: (1) a unity feedback with the forward path consisting of the continuous system transfer function preceded by a zero-order hold, and (2) a unity feedback with the forward path consisting of the equivalent discrete transfer function of your compensator in cascade with the open-loop plant. Postlab Compare the results obtained with those from your prelab MATLAB program. Comment on time-performance specifications.
f^ Bibliography^ Astrom, K. I , and Wittenmark, B. Computer Controlled Systems. Prentice Hall, Upper Saddle River, NJ, 1984. Bittanti, S., Dell'Orto, E, Di Carlo, A., and Savaresi, S. M. Notch Filtering and Multirate Control for Radial Tracking in High Speed DVD-Players. IEEE Transactions on Consumer Electronics, vol. 48, 2002, pp. 56-62. Boyd, M., and Yingst, J. C. PC-Based Operator Control Station Simplifies Process, Saves Time. Chilton's I & CS, September 1988, pp. 99-101. Chassaing, R. Digital Signal Processing. Wiley, New York, 1999. Craig, I. K., Xia, X., and Venter, J. W. Introducing HIV/AIDS Education into the Electrical Engineering Curriculum at the University of Pretoria. IEEE Transactions on Education, vol. 47, no. 1, February 2004, pp. 65-73. Craig, J. J. Introduction to Robotics. Mechanics and Control, 3d ed. Prentice Hall, Upper Saddle River, NJ, 2005. Hardy, H. L. Multi-Loop Servo Controls Programmed Robot. Instruments and Control Systems, June 1967, pp. 105-111. Hostetter, G. H. Digital Control System Design. Holt, Rinehart & Winston, New York, 1988. Johnson, H. et al. Unmanned Free-Swimming Submersible (UFSS) System Description. NRL Memorandum Report 4393. Naval Research Laboratory, Washington, D.C., 1980.
Bibliography Katz, P. Digital Control Using Microprocessors. Prentice Hall, Upper Saddle River, NJ, 1981. Khodabakhshian, A., and Golbon, N. Design of a New Load Frequency PID Controller Using QFT. Proceedings of the 13th Mediterranean Conference on Control and Automation, 2005, pp. 970-975. Kuo, B. C. Automatic Control Systems, 7th ed. Prentice Hall, Upper Saddle River, NJ, 1995. Kuo, B. C. Digital Control Systems. Holt, Rinehart & Winston, New York, 1980. Nyzen, R. J. Analysis and Control of an Eight-Degree-of-Freedom Manipulator, Ohio University Masters Thesis, Mechanical Engineering, Dr. Robert L. Williams II, Advisor, August 1999. O'Connor, D. N., Eppinger, S. D , Seering, W. P., and Wormly, D. N. Active Control of a HighSpeed Pantograph. Journal of Dynamic Systems, Measurements, and Control, vol. 119, March 1997, pp. l-A. Ogata, K. Discrete-Time Control Systems. Prentice Hall, Upper Saddle River, NJ, 1987. Phillips, C. L., and Nagle, H. X, Jr., Digital Control System Analysis and Design. Prentice Hall, Upper Saddle River, NJ, 1984. Preitl, Z., Bauer, P., and Bokor, J. A Simple Control Solution for Traction Motor Used in Hybrid Vehicles. 4th International Symposium on Applied Computational Intelligence and Informatics. IEEE, 2007. Romagnoli, J. A., and Palazoglu, A. Introduction to Process Control. CRC Press, Boca Raton, FL, 2006. Smith, C. L. Digital Computer Process Control. Intext Educational Publishers, NY, 1972. Sparks, A. W, and Manalis, S. R. Atomic Force Microscopy with Inherent Disturbance Suppression for Nanostructure Imaging. Nanotechnology, vol. 17, 2006, pp. 1574-1579. Tasch, U , Koontz, J. W , Ignatoski, M. A., and Geselowitz, D. B. An Adaptive Aortic Pressure Observer for the Penn State Electric Ventricular Assist Device. IEEE Transactions on Biomedical Engineering, vol. 37,1990, pp. 374-383. Tou, J. Digital and Sampled-Data Control Systems. McGraw-Hill, New York, 1959. Williams, R. L. II. Local Performance Optimization for a Class of Redundant Eight-Degreeof-Freedom Manipulators. NASA Technical Paper 3417, NASA Langley Research Center, Hampton VA, March 1994.
Appendix A: List of Symbols
%OS
Percent overshoot
A
Ampere — uni t of electrical current
A
System matrix for state-space representation
am
Motor time constant
B
Mechanical rotational coefficient of viscous friction in N-m-s/rad
B
Input matrix for state-space representation
C
Electrical capacitance in farads
C
Output matrix for state-space representation
C(s)
Laplace transform of the output of a system
c(t)
Output of a system
CM
Controllability matrix
D
Mechanical rotational coefficient of viscous friction in N-m-s/rad
D
Feedforward matrix for state-space representation
Da
Motor armature coefficient of viscous damping in N-m-s/rad
D„,
Total coefficient of viscous friction at the armature of a motor, including armature coefficient of viscous friction and reflected load coefficient of viscous friction in N-m-s/rad
E
Energy
E(s)
Laplace transform of the error
e(t)
Error; electrical voltage
Ea(s)
Laplace transform of the motor armature input voltage; Laplace transform of the actuating signal
ea{t)
Motor armature input voltage; actuating signal
F
Farad—unit of electrical capacitance
F(s)
Laplace transform of / (/)
/(/)
Mechanical force in newtons; general time function
/v
Mechanical translational coefficient of viscous friction
g
Acceleration due to gravity
G
Electrical conductance in mhos
G(s)
Forward-path transfer function
Gc(s)
Compensator transfer function
Gc(z)
Sampled transfer function for a compensator
GM
Gain margin
Gp(z)
Sampled transfer function for a plant
784
Appendix A: List of Symbols H
Henry—unit of electrical inductance
H(s)
Feedback-path transfer function
I
Identity matrix
m
Electrical current in amperes
J
Moment of inertia in kg-m2
J a
Motor armature moment of inertia in kg-m 2
hn
Total moment of inertia at the armature of a motor, including armature moment of inertia and reflected load moment of inertia in kg-m2
K
Controller gain matrix
K
Mechanical translational spring constant in N/m or rotational spring constant in N-m/rad; amplifier gain; residue
k
Controller feedback gain; running index
Ka Kb
Acceleration constant
m
Feedback gain
Back emf constant in V/rad/s
kg kg-m 2
Kilogram = newt on seconds 2 /meter—unit of mass Kilogram meters 2 = newton-meters seconds2/radian—unit of moment of inertia
Km
Motor gain
Kp
Position constant
K,
Motor torque constant relating developed torque to armature current in N-m/A
Kv
Velocity constant
L
Electrical inductance in henries
L
Observer gain matrix
/
Observer feedback gain
M
Mass in kilograms; slope of the root locus asymptotes
m
Meter—unit of mechanical translational displacement
M((o)
Magnitude of a sinusoidal response
m/s
Meters/second—unit of mechanical translational velocity
Mp
Peak magnitude of the sinusoidal magnitude response
N
Newton—unit of mechanical translational force in kilogram meters/second 2
N-s/m
Newton-seconds/meter—unit of mechanical translational coefficient of viscous friction
n
System type
N/m
Newton/meter—unit of mechanical translational spring constant
N-m
Newton-meter—unit of mechanical torque
N-m-s/
Newton-meter-seconds/radian—unit of mechanical rotational coefficient of
rad
viscous friction
N-m/A
Newton-meter/ampere—unit of motor torque constant
N-m/rad
Newton-meter/radian—unit of mechanical rotational spring constant
OM
Observability matrix
P
Similarity transformation matrix
pc
Compensator pole
Q
Coulomb—unit of electrical charge
q(t)
Electrical charge in coulombs
Appendix A: List of Symbols R
Electrical resistance in ohms
R(s)
Laplace transform of the input to a system
r
Nonlinear electrical resistance
r(t)
Input to a system
Ra
Motor armature resistance in ohms
rad
Radian—unit of angular displacement
rad/s
Radian/second—unit of angular velocity
s
Second—unit of time
s
Complex variable for the Laplace transform
Sp:p
Sensitivity of F to a fractional change in P
T
Time constant; sampling interval for digital signals
T(s)
Closed-loop transfer function; Laplace transform of mechanical torque
T(t)
Mechanical torque in N-m
Tm(t)
Torque at the armature developed by a motor in N-m
Tm(s)
Laplace transform of the torque at the armature developed by a motor
Tp
Peak time in seconds
Tr
Rise time in seconds
Ts
Settling time in seconds
Tw
Pulse width in seconds
u
Input or control vector for state-space representation
u
Input control signal for state-space representation
u(t)
Unit step input
V-s/rad
Volt-seconds/radian—unit of motor back emf constant
v(t)
Mechanical translation velocity in m/s; electrical voltage
vb(t)
Motor back emf in volts
ve(t)
Error voltage
vp(t)
Power amplifier input in volts
x
State vector for state-space representation
x(t)
Mechanical translation displacement in meters; a state variable
x
Time derivative of a state variable
x
Time derivative of the state vector
y
Output vector for state-space representation
y(i)
Output scalar for state-space representation
z
Complex variable for the z-transform
zc
Compensator zero
a
Pole-scaling factor for a lag compensator, where a > 1; angle of attack
/6
Pole-scaling factor for a lead compensator, where fi < 1
y
Pole-scaling factor for a lag-lead compensator, where y > 1
S
Thrust angle
f
Damping ratio
9
Angle of a vector with the positive extension of the real axis
0(t)
Angular displacement
6a
Angle of a root locus asymptote with the positive extension of the real axis
785
786
Appendix A: List of Symbols 6C
Angular contribution of a compensator on the s-plane
9m(t)
Angular displacement of the armature of a motor
X.
Eigenvalue of a square matrix
a
Real part of the Laplace transform variable, s
oa
Real-axis intercept of t h e root locus asymptotes
4>M
Phase margin
¢(0
State transition matrix
0
Sinusoidal phase angle; body angle
4>c
Sinusoidal phase angle of a compensator
Qmax
Maximum sinusoidal phase angle
n
Ohm—unit of electrical resistance
W
Mho—unit of electrical conductance
to
Imaginary part of the Laplace transform variable, s
co(t)
Angular velocity in rad/s
<WBW
Bandwidth in rad/s
cod
Damped frequency of oscillation in rad/s
mp¥
Phase-margin frequency in radians
COGM
Gain-margin frequency in radians
co„
Natural frequency in rad/s
cop
Peak-magnitude frequency of the magnitude frequency response in rad/s
Appendix B: MATLAB Tutorial
£B.1
Introduction
MATLAB is a high-level technical computing environment suitable for solving scientific and engineering problems. When used with routines from its companion software, the Control System Toolbox, MATLAB can be used to analyze and design control systems problems such as those covered in this textbook. MATLAB and the Control System Toolbox are commercial software products available from The Math-Works, Inc., 3 Apple Hill Drive, Natick, MA 01760-2098. Phone: (508) 6477000. Email: [email protected]. URL: www.mathworks.com. The MATLAB examples in this tutorial consist of solved problems that demonstrate the application of MATLAB to the analysis and design of control systems. Many problems were taken from examples in the text (identified with a MATLAB icon) that were solved without MATLAB. A Command Summary at the end of this appendix lists key MATLAB statements and their descriptions. The code in this tutorial is also available in the Control Systems Engineering Toolbox folder at www.wiley.com/college/nise and at www.mathworks.com/matlabcentral/fileexchange. You should have MATLAB Version 7.9 (R2009b) and the Control System Toolbox Version 8.4 installed on your machine to execute this appendix's code in the Control Systems Engineering Toolbox Version 6. To run the M-files, first be sure the files are either added to the search path in Set Path . . . under the File menu or appear in the Current Folder window, which is part of the MATLAB window. To see the computer responses after installing the Mfiles, run each problem by typing the M-file name, such as ch2pl, after the prompt (>>) in the Command Window. You may also run the files by right-clicking the file name, if it appears in the Current Folder window, and select Run File. To view all or part of the M-file in the Command Window, enter "type
788
Appendix B: MATLAB Tutorial
By its nature, this appendix cannot cover all the background and details necessary for a complete understanding of MATLAB. For further details, you are referred to other sources, including MATLAB reference manuals and instructions specific to your particular computer. The bibliography at the end of this appendix provides a partial listing of references. This appendix should give you enough information to be able to apply MATLAB to the analysis and design problems covered in this book. The code contained in this appendix and in the Control Systems Engineering Toolbox was developed on a PC using MATLAB Version 7.9 and the Control System Toolbox Version 8.4. The code will also run on workstations that support MATLAB. Consult the MATLAB Installation Guide for your platform for minimum system hardware requirements.
(B.2
MATLAB Examples Chapter 2: Modeling in the Frequency Domain ch2p1 Bit strings will be used to identify parts of this tutorial on the computer output. Bit strings are represented by the text enclosed in apostrophes, such as ' a b ' . Comments begin with % and are ignored by MATLAB. Numbers are entered without any other characters. Arithmetic can be performed using the proper arithmetic operator. Numbers can be assigned using a left-hand argument and an equals sign. Finally, we can find the magnitude and angle of a complex number, Q using abs (Q) and angle (Q), respectively. '(ch2pl)' 'How are you?' -3.96 -4 + 7i -5-6j (-4+7i) + (-5-6i; (-4+7j)*(-5-6j) M=5 N=6 P=M+N Q=3+4j MagQ=abs(Q) ThetaQ=(180/pil *angle(Q) pause
% Display label. % Display string. % Display scalar number -3. 96. % Display complex number -4+7i . % Display complex number -5-6 j . % Add two complex numbers and % display sum. % Multiply two complex numbers and % display product. % Assign 5 to M and display. % Assign 6 to N and display. % Assign M+N to P and display. % Define complex number, Q. % Find magnitude of Q. % Find the angle of Q in degrees .
ch2p2 Polynomials in s can be represented as row vectors containing the coefficients. Thus Pi—s3 + Is2 - 3s + 23 can be represented by the vector shown below with elements separated by a space or comma. Bit strings can be used to identify each section of this tutorial. '(ch2p2)' Pl=[l 7 -3 23] pause
% Display label. % Store polynomial s A 3 + 7s A 2 -3s + % 23 as PI and display.
B.2 MATLAB Examples
ch2p3 Running the previous statements causes MATLAB to display the results. Ending the command with a semicolon suppresses the display. Typing an expression without a left-hand assignment and without a semicolon causes the expression to be evaluated and the result displayed. Enter P2 in the MATLAB Command Window after execution. '(ch2p3)' P2 =[3 5 7 8 ] ; 3*5 pause
% Display l a b e l . % A s s i g n 3 s A 3 + 5s A 2 +7s + 8 t o P2 % without displaying. % E v a l u a t e 3*5 a n d d i s p l a y r e s u l t .
ch2p4 An F(s) in factored form can be represented in polynomial form. Thus P3 = (s + 2) (s + 5) (s + 6) can be transformed into a polynomial using po 1 y (V), where V is a row vector containing the roots of the polynomial and poly (V) forms the coefficients of the polynomial. '(ch2p4)( P3=poly ([-2 - 5 -6])
% Display l a b e l . % Store polynomial % ( s + 2 ) ( s + 5 ) ( s + 6 ) a s P3 a n d % display the coefficients
pause
ch2p5 We can find roots of polynomials using the r o o t s (V) command. The roots are returned as a column vector. For example, find the roots of 5J 4 + 7s3 + 9s2-3s + 2 = 0. r
(ch2p5)' P4=[5 7 9 - 3 2] rootsP4=roots(P4)
% Display l a b e l . % Form 5 s A 4 + 7 s A 3 + 9 s A 2 - 3 s + 2 and %display. % F i n d r o o t s of 5 s A 4 + 7 s A 3 + 9 s A 2 %-3s+2,
% assign to rootsP4, and display. pause
ch2p6 Polynomials can be multiplied together using the conv(a,b) command (standing for convolve). Thus, P5 = (s3 + Is2 + 10? + 9)(/ - 3s3 + 6s2 + 2s + 1) is generated as follows: •(ch2p6)» P 5 = c o n v ( [ l 7 10 9],[1 - 3 6 2 1])
% % % %
Display l a b e l . Form ( s A 3 + 7 s A 2 + 1 0 s + 9 ) ( s A 4 3sA3 + 6sA2+2s + l ) , a s s i g n t o P5, and d i s p l a y .
pause
ch2p7 The partial-fraction expansion for F(s) = b(s)/a(s) can be found using the [K, p , k] = r e s i d u e (b, a) command (K = residue; p = roots of denominator; k = direct quotient, which is found by dividing polynomials prior to performing a partialfraction expansion). We expand F(s) = {Is2 + 95 + ll)/[s{s + 7)(s2 + 10s + 100)] as an example. Using the results from MATLAB yields: F(s) = [(0.2554 0.3382/) / (s + 5.0000 - 8.6603¾)] + [(0.2554 + 0.3382/) / (s + 5.0000 + 8.6603/)] [0.5280/ (5 + 7)] + [0.0171/5].
789
790
Appendix B: MATLAB Tutorial *(ch2p7)' numf>[7 9 12] denf=conv(poly([0 -7]) ,[1 10 100]) ; [K, p , k]=residue (numf, denf)
% Display l a b e l . % Define numerator of F (s) . % Define denominator of F (s) . % Find r e s i d u e s and a s s i g n t o K; % find r o o t s of denominator and % a s s i g n t o p ; find % c o n s t a n t and a s s i g n t o k.
pause
ch2p8 (Example 2.3) Let us do Example 2.3 in the book using MATLAB. '(ch2p8) Example 2 . 3 ' numy=32; deny=poly ([0 -4 -8]) ; [ r , p , k]=residue (numy, deny)
% Display l a b e l . % Define numerator. % Define denominator. % C a l c u l a t e r e s i d u e s , p o l e s , and % direct quotient.
pause ch2p9 Creating Transfer Functions Vector Method, Polynomial Form
A transfer function can be expressed as a numerator polynomial divided by a denominator polynomial, that is, F(s) = N(s)/D(s). The numerator, N(s), is represented by a row vector, numf, that contains the coefficients of N(s). Similarly, the denominator, D(s), is represented by a row vector, denf, that contains the coefficients of D(s). We form F(s) with the command, F=tf (numf, denf). F is called a linear time-invariant (LTI) object. This object, or transfer function, can be used as an entity in other operations, such as addition or multiplication. We demonstrate with F(s) = 150(.s2 + 2s + 7)/[s{s2 + 5s + 4)]. Notice after executing the t f command, MATLAB prints the transfer function. Vector Method, Factored Form We also can create LTI transfer functions if the numerator and denominator are expressed in factored form. We do this by using row vectors containing the roots of the numerator and denominator. Thus G(s) = K*N(s)/D(s) can be expressed as an LTI object using the command, G=zpk (numg,deng,K), where numg is a row vector containing the roots of N(s) and deng is a row vector containing the roots of D(s). The expression zpk stands for zeros (roots of the numerator), poles (roots of the denominator), and gain, K. We demonstrate with G(s) = 20(5 + 2)(s + 4)/[(s + 7){s + 8)(s + 9)]. Notice after executing the zpk command, MATLAB prints the transfer function. Rational Expression in s Method, Polynomial Form (Requires Control System Toolbox 8.4) This method allows you to type the transfer function as you normally would write it. The statement s=tf ('s' ) must precede the transfer function if you wish to create an LTI transfer function in polynomial form equivalent to using F=tf(numf,denf). Rational Expression in s Method, Factored Form (Requires Control System Toolbox 8.4) This method allows you to type the transfer function as you normally would write it. The statement s=zpk ('s' ) must precede the transfer function if you wish to create an LTI transfer function in factored form equivalent to using G=zpk(numg,deng,K).
B.2 MATLAB Examples For both rational expression methods the transfer function can be typed in any form regardless of whether s = t f ( ' s ' ) o r s = z p k ( ' s ' ) is used. The difference is in the created LTI transfer function. We use the same examples above to demonstrate the rational expression in s methods. '(ch2p9)' 'Vector Method, Polynomial Form' numf=150*[l 2 7]
% Display label. % Display label. % Store 150 (sA2+2s+7) in numf and % display. % Store s (s + l)(s+4) in denf and denf=[l 5 4 0] % display. 'F(s)' % Display label. %FormF(s) and display. F=tf {numf, denf) clear % Clear previous variables from % workspace. % Display label. 'Vector Method, Factored Form' numg=[-2 -4] % Store (s+2)(s+4) in numg and % display. deng=[-7 -8 -9] % Store (s+7)(s+8)(s + 9) in deng % and display. K=20 % Define K. 'G(s)' % Display label. %FormG(s) and display. G=zpk (numg, deng, K) clear % Clear previous variables from % workspace. 'Rational Expression Method, Polynomial Form' % Display label. s=tf ('s') % Define 's ' as an LTI object in % polynomial form. % Form F (s) as an LTI transfer F=150*(sA2+2*s+7) /[s*(sA2+. . . 5*s+4)] % function in polynomial form. % FormG(s) as anLTI transfer G=20*(s+2)*(s+4) /[ (s+7)*. . . (s+8)*(s + 9)] % function in polynomial form. clear % Clear previous variables from % workspace. 'Rational Expression Method, Factored Form' % Display label. s=zpk {' s') % Define 's ' as an LTI object in % factored form. F=150*(sA2+2*s+7)/[s*( 5^2 + 5*3 + 4)] % Form F (s) as an LTI transfer % function in factored form. G=20*(s+2)*(s+4) /[(s+7)*(s + 8)*(s + 9)] IFormG(s) as an LTI transfer % function in factored form. pause
ch2p10 Transfer function numerator and denominator vectors can be converted between polynomial form containing the coefficients and factored form containing the roots. The MATLAB function, t f 2 zp (numt f, den t f), converts the numerator and denominator from coefficients to roots. The results are in the form of column vectors. We demonstrate this with F(s) = (10s2 + 4Qs + 60)/0 3 + 4*2 + 5^ + 7). The MATLAB function, zp2tf (numzp, denzp, K), converts the numerator and denominator from roots to coefficients. The arguments numzp and denzp must be column
792
Appendix B: MATLAB Tutorial
vectors. In the demonstration that follows, apostrophes signify transpose. We demonstrate the conversion from roots to coefficients with G(s) = 10(5 + 2) (s + 4)/[s(s + 3)(s + 5)]. '(ch2pl0)' 'Coefficients for F(s)' numf tf=[10 40 60]
% Display label. % Display label. % Form numerator of F (s) = % (10sA2+40s+60)/(sA3+4sA2+5s %+7) . denftf=[l 4 5 7] % Form denominator of F (s) = % (10sA2+40s+60)/(sA3+4sA2+5s %+7) . % Display label. 'Roots for F(s)' [numf zp, denf zp]=tf2zp (numftf ,denftf) % Convert F(s) to factored form. % Display label. 'Roots for G(s)' % Form numerator of numgzp=[_2-4] K=10 %G(s)=10(s + 2) (s + 4)/[s(s+ 3) % (3+51]. dengzp=[0 -3 -5] % Form denominator of %G(s)=10(s + 2) (s + 4)/[s(s+3) (s+5)] . % Display label. 'Coefficients for G (s)' [numgtf, dengtf] = zp2tf (numgzp', dengzp', K) % Convert G (s) to polynomial form. pause
ch2p11 LTI models can also be converted between polynomial and factored forms. MATLAB commands t f and zpk are also used for the conversion between LTI models. If a transfer function, Fzpk(s), is expressed as factors in the numerator and denominator, then t f (Fzpk) converts Fzpk{s) to a transfer function expressed as coefficients in the numerator and denominator. Similarly, if a transfer function, Ftf(s), is expressed as coefficients in the numerator and denominator, then zpk(Ftf) converts Ftf(s) to a transfer function expressed as factors in the numerator and denominator. The following example demonstrates the concepts. • (ch2pll)' 'Fzpkl(s)' F z p k l = z p k ( [ - 2 -4],[0 - 3 - 5 ] , 10) •Ftfl' F t f l = t f (Fzpkl) 'Ftf2' F t f 2 = t f ([10 40 60],[1 4 5 7])
% % % % % % % % %
Display l a b e l . Display l a b e l . Form F z p k l (s) = 10(s+2)(s + 4 ) / [ s ( s + 3 ) ( s + 5)]. Display l a b e l . C o n v e r t Fzpkl (s) t o c o e f f i c i e n t s form. Display l a b e l . Form F t f 2 (s) =
% (10sA2+40s+60)/(sA3+4sA2+5s
'Fzpk2' Fzpk2=zpk(Ftf2)
%+7). % Display l a b e l . % C o n v e r t F t f 2 (s) t o % f a c t o r e d form.
pause
ch2p12 Functions of time can be easily plotted using MATLAB's p l o t (X, Y, S), where X is the independent variable, Y is the dependent variable, and S is a character string describing the plots color, marker, and line characteristic. Type HELP PLOT in
B.2 MATLAB Examples
the Command Window to see a list of choices for S. Multiple plots also can be obtained using p l o t (XI, Yl, S1,X2, Y2, S2, X3, Y3, S3, . . . ). In the following example we plot on the same graph sin(5£) in red and cos(5/) in green for t = 0 to 10 seconds in 0.01 second increments. Time is specified as t = s t a r t : increment: final. ' (ch2pl2)' t=0:0.01:10; fl=cos(5*t) ; f2=sin(5*t) ; plot(t,fl,»r',t,f2,,g') pause
% Display label. % Specify time range and increment % Specify f 1 to be cos (5t) . % Specify f2 to be sin (5t) . % Plot f 1 in red and f 2 in green .
Chapter 3: Modeling in the Time Domain ch3p1 The square system matrix, A =
0 1 0 0 0 1 -9 - 8 - 7
is written with a space or
comma separating the elements of each row. The next row is indicated with a semicolon or carriage return. The entire matrix is then enclosed in a pair of square brackets. '(ch3pl)' A=[0 10;0 0 1; -9-8 -7] 'or' A=[0 1 0 00 1 -9-8 -7] pause
% Display label % Represent A. % Represent A.
ch3 p2 A row vector, such as the output matrix C, can be represented with elements separated by spaces or commas and enclosed in square brackets. A column vector, such as input matrix B, can be written as elements separated by semicolons or carriage returns, or as the transpose (') of a row vector. '(ch3p2)' C=[2 3 4] B=[7;8;9] 'or' B=[7 9] 'or' B=[7 8 9]' pause
% Display label. % Represent row vector C. % Represent column vector B . % Represent column vector B.
% R e p r e s e n t column v e c t o r B,
ch3p3 The state-space representation consists of specifying the A, B, C, and D matrices followed by the creation of an LTI state-space object using the MATLAB command, ss(A,B,C,D). Hence, for the matrices in (ch3pl) and (ch3p2), the statespace representation would be:
793
Appendix B: MATLAB Tutorial •(ch3p3)' A=[0 10;0 0 lf-9 -8 -7] B=[7;8;9] ; C=[2 3 4] ; D=0; F=ss (A,B,C,D)
% Display label. % Represent A. % Represent column vector B. % Represent row vector C. % Represent D.
% Create an LTI o b j e c t and d i s p l a y .
ch3p4 (Example 3.4) Transfer functions represented either by numerator and denominator or an LTI object can be converted to state space. For numerator and denominator representation, the conversion can be implemented using [A, B, C, D] = t f 2 s s (num, den). The A matrix is returned in a form called the controller canonical form, which will be explained in Chapter 5 in the text. To obtain the phasevariable form, [Ap, Bp, Cp, Dp], we perform the following operations: Ap=inv (P) *A*P; Bp=inv (P) *B; Cp=C*P, Dp=D, where P is a matrix with l's along the antidiagonal and 0's elsewhere. These transformations will be explained in Chapter 5. The command inv (X) finds the inverse of a square matrix. The symbol * signifies multiplication. For systems represented as LTI objects, the command ss (F), where F is an LTI transfer-function object, can be used to convert F to a state-space object. Let us look at Example 3.4 in the text. For the numerator-denominator representation, notice that the MATLAB response associates the gain, 24, with the vector C rather than the vector B as in the example in the text. Both representations are equivalent. For the LTI transfer-function object, the conversion to state space does not yield the phase-variable form. The result is a balanced model that improves the accuracy of calculating eigenvalues, which are covered in Chapter 4. Since s s (F) does not yield familiar forms of the state equations (nor is it possible to easily convert to familiar forms), we will have limited use for that transformation at this time. ' (ch3p4) Example 3 . 4 ' % Display l a b e l . 'Numerator-denominator r e p r e s e n t a t i o n c o n v e r s i o n ' % Display l a b e l . ' C o n t r o l l e r canonical form' % Display label. num=2 4; % Define numerator of den=[l 9 26 24]; [A, B, C, D]=tf 2ss (num, den] ' P h a s e - v a r i a b l e form' P=[0 0 1/0 1 0;1 0 0]; Ap=inv(P)*A*P Bp=inv(P)*B Cp=C*P Dp=D 'LTI object representation' T=tf(num, den)
Tss=ss(T) pause
%G(s)=C(s)/R(s) . % Define denominator of G (s) . % Convert G(s) to controller % canonical form, store matrices % A, B, C, D, and display. % Display label. % Form transformation matrix. % Form A matrix, phase-variable % form. % FormBvector, phase-variable % form. % FormCvector, phase-variable % form. % Form D phase-variable form. % Display label. % Represent T (s) =24/ (sA3+9sA2 + % 26s+24) as an LTI transfer% function object. % Convert T (s) to state space.
B.2 MATLAB Examples
ch3p5 State-space representations can be converted to transfer functions represented by a numerator and a denominator using [num,den]=ss2tf (A,B,C,D, i u ) , where i u is the input number for multiple-input systems. For single-input, single-output systems iu=l. For an LTI state-space system, Tss, the conversion can be implemented using T t f = t f (Tss) to yield the transfer function in polynomial form or Tzpk=zpk (Tss) to yield the transfer function in factored form. For example, the transfer function represented by the matrices described in (ch3p3) can be found as follows: ' (ch3p5)' 'NonLTI' A=[0 1 0;0 0 1,--9 - 8 - 7 ] ; B=[7;8;9]; C=[2 3 4] D=0; 'Ttf (s)' [num, d e n ] = s s 2 t f (A,B,C,D, 1)
'LTI' Tss=ss(A,B,C,D) ' P o l y n o m i a l form, T t f ( s ) ' Ttf=tf(Tss)
' F a c t o r e d form, T z p k ( s ) ' Tzpk=zpk(Tss)
Display label. Display label. Represent A. Represent B. Represent C . Represent D. Display label. Convert state-space representation to a transfer function represented as a numerator and denominator in polynomial form, G (s)=num/den, and display num and den . Display label. Form LTI state-space model. Display label. Transform from state space to transfer function in polynomial form. Display label. Transform from state space to transfer function in factored form.
pause
Chapter 4: Time Response ch4p1 (Example 4.6) We can use MATLAB to calculate characteristics of a secondorder system, such as damping ratio, £; natural frequency, con; percent overshoot, % OS (pos); settling time, Ts; and peak time, Tp. Let us look at Example 4.6 in the text. ' ( c h 4 p l ) Example 4 . 6 ' p l = [ l 3 + 7*i];
% Display label. % Define polynomial containing % first pole. % Define polynomial containing p2=[l 3-7*i]; % second pole . deng=conv(pi,p2); % Multiply the two polynomials to % find the 2nd order polynomial, % asA2+bs+c. omegan=sqrt(deng(3)/deng(1)) % Calculate the natural frequency, % sqrt(c/a) . zeta= (deng (2) /deng (1))/ (2*omegan) % Calculate damping ratio, % ((b/a)/2*wn). Ts=4/ (zeta*omegan) % Calculate settling time, % (4/z*wn) .
795
796
Appendix B: MATLAB Tutorial T p = p i / ( o m e g a n * s q r t (1 - z e t a A 2 ) )
% C a l c u l a t e peak time, % p i / w n * s q r t (1 - z A 2 ) . p o s = 1 0 0 * e x p ( - z e t a * p i / s q r t (1 - z e t a A 2 ) ) % Calculate percent overshoot % (100*eA(-z*pi/sqrt(l-zA2) ) . pause
ch4p2 (Example 4.8) We can use MATLAB to obtain system step responses. These responses are particularly valuable when the system is not a pure two-pole system and has additional poles or zeros. We can obtain a plot of the step response of a transfer function, T(s) =num/den, using the command s t e p (T), where T is an LTI transferfunction object. Multiple plots also can be obtained using s t e p (Tl, T2, . . .) Information about the plots obtained with s t e p (T) can be found by leftclicking the mouse on the curve. You can find the curve's label as well as the coordinates of the point on which you clicked. Right-clicking away from a curve brings up a menu. From this menu you can select (1) system responses to be displayed and (2) response characteristics to be displayed, such as peak response. When selected, a dot appears on the curve at the appropriate point. Let your mouse rest on the point to read the value of the characteristic. You may also select (3) choice for grid on or off, (4) choice to normalize the curve, and (5) properties, such as labels, limits, units, style, and characteristics. If we add the left-hand side, [y, t ] = s t e p (T), we create vectors containing the plot's points, where y is the output vector and t is the time vector. For this case, a plot is not made until the p l o t ( t , y ) command is given, where we assume we want to plot the output (y) versus time ( t ) . We can label the plot, the x-axis, and the y-axis with t i t l e ('ab' ) , x l a b e l Cab' ) , and y l a b e l ('ab' ), respectively. The command e l f clears the graph prior to plotting. Finally, text can be placed anywhere on the graph using the command t e x t (X, Y,' t e x t ' ), where (X, Y) are the graph coordinates where ' t e x t ' will be displayed. Let us look at Example 4.8 in the text. 1
(ch4p2) Example 4.8' 'Test Run' elf numtl=[24.542]; dentl=[l 4 24.542]; *T1(s)' Tl=tf(numtl,dentl) step(Tl) title ('Test Run of Tl(s)' pause 'Complete Run' [yl,tl]=step(TD; numt2=[245.42]; p l = [ l 10]; p2=[l 4 2 4 . 5 4 2 ] ; dent2=conv(pi,p2); •T2(s)' T2=tf(numt2,dent2)
% Display label. % Display label. % Clear graph. % Define numerator of Tl. % Define denominator of Tl. % Display label. % Create and display Tl (s) . % Run a demonstration step response %plot % Add title to graph. % Display label. % Run step response of Tl and % collect points . % Define numerator of T2 . % Define (s+10) in denominator %of T2. % Define (sA2+4s+24.542) in % denominator of T2. %Multiply (s + 10) (sA2+4s+24.542) % for denominator of T2 . % Display label. % Create and display T2 .
B.2 MATLAB Examples [y2,t2]=step(T2) ;
% Run step response of T2 and % collect points . numt3=[73.626]; % Define numerator of T3. % Define (s + 3) in denominator p3=[l 3]; %of T3. %Multiply (s+3)(sA2+4s+24.542) dent3=conv(p3,p2); % for denominator of T3 . % Display label. 'T3(s)' % Create and display T3 . T3=tf(numt3,dent3) % Run step response of T3 and [y3,t3]=step(T3) ; % collect points . % Clear graph. elf % Plot acquired points with all plot(tl,yl,t2,y2,t3,y3) % three plots on one graph. ;s) , andT3 (s)') t i t l e ('Step Responses of Tl (s) ,T2 % Add title to graph. % Add time axis label. x l a b e l ('Time (seconds)') % Add response axis label. % Label step response of Tl. y l a b e l ('Normalized Response') % Label step response of T2 . text(0.7,0.7,'c3(t)') % Label step response of T3 . text(0.7,l.l,'c2(t)') text(0.5,1.3,'cl (t)') pause % Use alternate method of plotting step(Tl,T2,T3) % step responses . title ('Step Responses of Tl(s T2(s) , andT3(s)') % Add title to graph. pause ch4p3 We also can plot the step response of systems represented in state space using the s t e p (T, t ) command. Here T is any LTI object and t = a : b : c is the range for the time axis, where a is the initial time, b is the time step size, and c is thefinaltime. For example, t=0 :1:10 means time from 0 to 10 seconds in steps of 1 second. The t field is optional. Finally, in this example we introduce the command g r i d on, which superimposes a grid over the step response. Place the g r i d on command after the s t e p (T, t ) command. '(ch4p3)' elf A=[0 10,-0 0 l;-24 -26 -9], B=[0;0;1]; C=[2 7 1]; D=0; T=ss(A,B,C,D) t=0:0.1:10; step(T,t) grid on pause
Display label. Clear graph. Generate A matrix. Generate B vector . Generate C vector. Generate D. Generate LTI object, T, instate space and display. Define range of time for plot. Plot step response for given range of time. Turn grid on for plot.
ch4p4 (Antenna Control Case Study) We now use MATLAB to plot the step response requested in the Antenna Control Case Study. ;ch4p4) Antenna Control Case Study' % Display label. % Clear graph. elf
797
798
Appendix B: MATLAB Tutorial numg=20.83; deng=[l 1 0 1 . 7 1 171]; 'G(s)'
G=tf(numg,deng) step(G) ; title ('Angular Velocity Response'
% Define numerator of G (s) . % Define denominator of G (s) . % Display label. % Form and display transfer % Function G (s) . % Generate step response. % Add title.
pause ch4p5 (UFSS Case Study) As a final example, let us use MATLAB to do the UFSS Case Study in the text {Johnson, 1980). We introduce table lookup to find the rise time. Using the i n t e r p l ( y , t , y l ) command, we set up a table of values of amplitude, y, and time, t , from the step response and look for the value of time for which the amplitude is y l = 0.1 and 0.9. We also generate time response data over a defined range of time using t = a : b : c followed by [ y , t ] = s t e p (G, t ) . Here G is an LTI transfer-function object and t is the range for the time axis, where a is the initial time, b is the time step size, and c is the final time; y is the output. ' (ch4p5) UFSS Case Study' elf '(a)' numg=0.0169;
% Display label. % Clear graph . % Display label. % Define numerator of 2nd order % approximation of G(s). % Define 2nd order term of deng=(l 0.22 6 0.0169]; % denominator of G(s). % Display label. 'G(s)' % Create and display G (s) . G=tf(numg,deng) % Find natural frequency. omegan=sqrt(deng(3) ) zeta=deng(2)I(2*omegan) % Find damping ratio. % Find settling time. Ts=4/ (zeta*omegan) % Find peak time. Tp=pi/(omegan*sqrt(l-zetaA2)) pos=exp/(-zeta*pi/sqrt(l-zetaA2 ! )*100 % Find percent overshoot. % Limit time to find rise time . t=0 t=0:0.1:35; % to 35 in steps of 0 .1. % Generate and save points of step [y,t]=step(G,t); % response over defined range oft. % Search table for time when Tlow=interpl(y,t,0.1); % y=0.1*finalvalue. % Search table for Thi=interpl(y,t,0.9); % time=0.9*finalvalue. % Calculate rise time . Tr=Thi-Tlow % Display label. '(b)' % Define numerator of C (s) . numc=0.125*[l 0.435]; denc=conv(poly ([0 -1.23]) ,[1 0.2260.0169]) ; % Define denominator of C (s) . % Find partial-fraction expansion [K,p, k ] = r e s i d u e (numc,denc) % Display label. ' (d)' % Define numerator of G (s) . numg=0.125*[l 0.435]; d e n g = c o n v ( [ l 1.23],[1 0 . 2 2 6 0.0169] i ; % Define denominator of G (s) . % Display label. 'G(s)' % Create and display G (s) . G=tf(numg,deng)
B.2 MATLAB Examples [y,t]=step(G); plot(t,y) title ('Pitch Angle Response ') xlabel ('Time (seconds)')
y l a b e l ('Pitch Angle ( r a d i a n s ) ' ) pause
% Generate complete step response % and collect points . % Plot points . % Add title. % label time axis . % Label y-axis .
Chapter 5: Reduction of Multiple Subsystems ch5p1 (UFSS Pitch Control System) MATLAB can be used for block diagram reduction. Three methods are available: (1) Solution via Series, Parallel, & Feedback Commands, (2) Solution via Algebraic Operations, and (3) Solution via Append & Connect Commands. Let us look at each of these methods. 1. Solution via Series, Parallel, & Feedback Commands The closed-loop transfer function is obtained using the following commands successively, where the arguments are LTI objects: s e r i e s (G1,G2) for a cascade connection of G\(s); and G2(s); p a r a l l e l (Gl, G2) for a parallel connection of Gi(s) and G2(s); f e e d b a c k (G, H, s i g n ) for a closed-loop connection with G(s) as the forward path, H(s) as the feedback, and s i g n is - 1 for negative-feedback systems or +1 for positive-feedback systems. The sign is optional for negative-feedback systems. 2. Solution via Algebraic Operations Another approach is to use arithmetic operations successively on LTI transfer functions as follows: G2*G1 for a cascade connection of Gi(.v) and G2(s); G1+G2 for a parallel connection of G\(s) and G2(s); G/ (1+G*H) for a closed-loop negative-feedback connection with G(s) as the forward path and H(s) as the feedback; G/ (1-G*H) for positive-feedback systems. When using division we follow with the function m i n r e a l ( s y s ) to cancel common terms in the numerator and denominator. 3. Solution via Append & Connect Commands The last method, which defines the topology of the system, may be used effectively for complicated systems. First, the subsystems are defined. Second, the subsystems are appended, or gathered, into a multiple-input/multiple-output system. Think of this system as a single system with an input for each of the subsystems and an output for each of the subsystems. Next, the external inputs and outputs are specified. Finally, the subsystems are interconnected. Let us elaborate on each of these steps. The subsystems are defined by creating LTI transfer functions for each. The subsystems are appended using the command G = a p p e n d ( G l , G 2 , G 3 , G4, Gn), where the Gi are the LTI transfer functions of the subsystems and G is the appended system. Each subsystem is now identified by a number based upon its position in the append argument. For example, G3 is 3, based on the fact that it is the third subsystem in the append argument (not the fact that we write it as G3). Now that we have created an appended system, we form the arguments required to interconnect their inputs and outputs to form our system. The first step identifies which subsystems have the external input signal and which subsystems have the external output signal. For example, we use i n p u t s = [ 1 5 6] and o u t p u t s = [ 3 4] to define the external inputs to be the inputs of
800
Appendix B: MATLAB Tutorial subsystems 1,5, and 6 and the external outputs to be the outputs of subsystems 3 and 4. For single-input/single-output systems, these definitions use scalar quantities. Thus i n p u t s = 5 , outputs=8 define the input to subsystem 5 as the external input and the output of subsystem 8 as the external output. At this point we tell the program how all of the subsystems are interconnected. We form a Q matrix that has a row for each subsystem whose input comes from another subsystem's output. The first column contains the subsystem's number. Subsequent columns contain the numbers of the subsystems from which the inputs come. Thus, a typical row might be as follows: [3 6 - 7 ] , or subsystem 3's input is formed from the sum of the output of subsystem 6 and the negative of the output of subsystem 7. Finally, all of the interconnection arguments are used in the connect (G Q i n p u t s , o u t p u t s ) command, where all of the arguments have been previously defined. Let us demonstrate the three methods for finding the total transfer function by looking at the back endpapers and finding the closed-loop transfer function of the pitch control loop for the UFSS with Kt = K% — I {Johnson, 1980). The last method using append and connect requires that all subsystems be proper (the order of the numerator cannot be greater than the order of the denominator). The pitch rate sensor violates this requirement. Thus, for the third method, we perform some block diagram maneuvers by pushing the pitch rate sensor to the left past the summing junction and combining the resulting blocks with the pitch gain and the elevator actuator. These changes are reflected in the program. You should verify all computer results with hand calculations. ' (ch5pl) UFSS Pitch Control System' ' & Feedback Commands ' 'Solution via Series, Parallel' % Display labels . numgl=[-l]; % Define numerator of Gl (s) . % Define denominator of Gl (s) . dengl=[l]; % Define numerator of G2 (s) . numg2=[0 2]; % Define denominator of G2 (s) . deng2=[l 2]; % Define numerator of G3 (s) . numg3=-0.125*[l 0.435]; deng3=conv([l 1.231,11 0.226 0.0169]] % Define denominator of G3 (s) . % Define numerator of Hi (s) . numhl=[-l 0]; denhl=[0 1]; % Define denominator of Hi (s) . Gl=tf(numgl,dengl); % Create LTI transfer function, % Gl(s) . G2=tf(numg2,deng2) ; % Create LTI transfer function, %G2(s) . % Create LTI transfer function, G3=tf(numg3,deng3); %G3(s) . % Create LTI transfer function, Hl=tf (numhl,denhl); %Hl(s) . % Calculate product of elevator G4=series(G2,G3); % and vehicle dynamics. % Calculate close-loop transfer G5=feedback(G4,Hl); % function of inner loop. % Multiply inner-loop transfer Ge=series(G1,G5); % function and pitch gain.
B.2 MATLAB Examples 'T(s) via Series, Parallel, & Feedback Commands' % Display label. % Find closed-loop transfer T=feedback (Ge, 1) % function . ' Solution via Algebraic Operations' % Display label. clear % Clear session. numgl=[-l]; % Define numerator of Gl (s) . dengl=[l]; % Define denominator of Gl (s) . % Define numerator of G2 (s) . numg2=[0 2]; % Define denominator of G2 (s) . deng2=[l 2]; % Define numerator of G3 (s) . numg3=-0.125*[l 0.435]; deng3 = conv([l 1.23],[1 0.226 0.0169]) ; % Define denominator of G3 (s) . % Define numerator of HI (s) . numhl=[-l 0]; denhl=[0 1]; % Define denominator of HI (s) . % Create LTI transfer function, Gl (s). Gl=tf (numgl,dengl) % Create LTI transfer function, G2 (s). G2=tf (numg2,deng2) G3=tf (numg3,deng3) % Create LTI transfer function, G3 (s). Hl=tf (numhl,denhl) % Create LTI transfer function, Hi (s). G4=G3*G2; % Calculate product of elevator and % vehicle % dynamics . G5=G4/(1+G4*H1); % Calculate closed-loop transfer % function of inner loop. % Cancel common terms . G5=minreal(G5); % Multiply inner-loop transfer Ge=G5*Gl; % functions . % Display label. 'T(s) via Algebraic Operations' % Find closed-loop transfer function. T=Ge/(l+Ge); % Cancel common terms . T=minreal(T) ' Solution via Append & Connect Commands' % Display label. 'Gl(s) = (-Kl)*(l/(-K2s) )=l/s' % Display label. numgl = [1]; % Define numerator of Gl (s) . dengl=[l 0]; % Define denominator of Gl (s) . Gl=tf(numgl,dengl) % Create LTI transfer function, % Gl (s)=pitchgain* % 1 (1/Pitch rate sensor) . 'G2(s) = (-K2s)*(2/(s+2)r % Display label. numg2=[-2 0]; % Define numerator of G2 (s) . deng2=[l 2]; % Define denominator of G2 (s) . G2=tf(numg2,deng2) % Create LTI transfer function, % G2 (s) =pitch rate sensor* vehicle % dynamics . 'G3(s)=-0.125(s+0.435)/( (s + 1.23) !sA2+0.226s+0.0169))' % Display label. % Define numerator of G3 (s) . numg3=-0.125*[l 0.435]; deng3=conv ([1 1.23],[1 0.226 0.0169]); % Define denominator of G3 (s) . % Create LTI transfer function, G3=tf (numg3,deng3); % G3 (s) =vehicle dynamics . System=append (Gl, G2, G3) ; % Gather all subsystems. input=l; % Input is at first subsystem,
801
802
Appendix B: MATLAB Tutorial
output=3; Q=[l -3 0
2 1-3
3 2 0];
%Gl(s) . % Output is output of third % subsystem, G3(s) . % Subsystem 1, Gl(s) , gets its % input from the negative of the % output of subsystem 3, G3 (s) . % Subsystem 2, G2(s), gets its % input from subsystem 1, Gl (s) , % and the negative of the output % of subsystem 3, G3(s) . % Subsystem 3, G3 (s), gets its % input from subsystem 2, G2 (s) .
T=connect(System,Q,input,output) % Connect the subsystems . ' T (s) via Append & Connect Commands' % Display label. T=tf(T); % Create LTI closed-loop transfer % function. T=minreal(T) % C a n c e l common t e r m s . pause
ch5p2 (Example 5.3) We can use MATLAB to calculate the closed-loop characteristics of a second-order system, such as damping ratio, f; natural frequency, &>„; percent overshoot, %OS (pos); settling time, Ts; and peak time, Tp. The command [numt, dent] =tf d a t a (T,'v') extracts the numerator and denominator of T(s) for a single-input/single-output system from which the calculations are based. The argument 'v' returns the numerator and denominator as simple row vectors. Omitting ' v' would return the numerator and denominator as cell arrays requiring more steps to obtain the row vectors. We end by generating a plot of the closed-loop step response. Let us look at Example 5.3 in the text. ' ( c h 5 p 2 ) Example 5 . 3 ' numg=[25]; d e n g = p o l y ( [ 0 -5]) ; 'G(s)'
G=tf(numg,deng) 'T(s)'
T=feedback(G,l) [numt, d e n t ] = t f d a t a (T, ' v ' ) ; wn=sgrt(dent(3)) z=dent(2)/ (2*wn) Ts=4/ (z*wn) Tp=pi/ (wn*sqrt (1-2^2) ) pos=exp (-z*pi/sqrt (l-zA2) ) *100 step(T) pause
% Display label. % Define numerator of G (s) . % Define denominator of G (s) . % Display label. % Create and display G (s) . % Display label. % FindT(s) . % Extract numerator & denominator % ofT(s) . % Find natural frequency. % Find damping ratio . % Find settling time. % Find peak time. % Find percent overshoot. % Generate step response .
ch5p3 MATLAB can be used to convert transfer functions to state space in a specified form. The command [Ace Bcc Ccc Dcc] ! =tf2ss (num, den) can be used to convert r(.s)=num/den into controller canonical form with matrices and vectors Ace, Bcc, Ccc, and Dec. We can then form an LTI state-space object using Scc=ss (Ace, Bcc, Ccc, Dec). This object can then be converted into parallel
B.2 MATLAB Examples
form using Sp=canon ( S e c / t y p e ' ), where t y p e = m o d a l yields the parallel form. Another choice, not used here, is t y p e = c o m p a n i o n , which yields a right companion system matrix. Transformation matrices can be used to convert to other representations. As an example, let us convert C(s)/R(s) = 24/[(s + 2)(s + 3)(s + 4)] into a parallel representation in state space, as is done in Section 5.7—Parallel Form. Notice that the product of values in the B and C vectors yields the same product as the results in Eqs. (5.49) and (5.50). Thus, the two solutions are the same, but the state variables are ordered differently, and the gains are split between the B and C vectors. We can also extract the system matrices from the LTI object using [A, B, c , D ] = s s d a t a (S), where S is a state-space LTI object and A, B, c , D, are its associated matrices and vectors. '(ch5p3)' numt=2 4; dent=poly ([-2 -3 -4]) ; 'T(s)' T=tf(numt,dent) [Ace Bcc Ccc Dcc]=tf 2ss (numt, dent)
Scc=ss(Ace,Bcc,Ccc,Dec); Sp=canon (Sec, 'modal') ; 'Controller Canonical Form' [Ace, Bcc, Ccc, Dcc]=ssdata (Seel 'Parallel Form' [Ap,Bp, Cp, Dp]=ssdata (Sp)
% Display label. % Define numerator of T (s) . % Define denominator of T (s) . % Display label. % Create and display T (s) . % Convert T (s) to controller % canonical form. % Create LTI controller canonical % state-space object. % Convert controller canonical form % to parallel form. % Display label. % Extract and display controller % canonical form matrices . % Display label. % Extract and display parallel form % matrices .
pause
ch5p4 (Example 5.9) We can use MATLAB to perform similarity transformations to obtain other forms. Let us look at Example 5.9 in the text. ' (ch5p4) Example 5 . 9' Pinv=[2 0 0; 3 2 0/ 1 4 5]; P=inv(Pinv) 'Original' Ax=[0 1 0 ; 0 0 1 ; - 2 - 5 -7] Bx=[0 0 1] Cx=[l 0 0] 'Transformed' Az=Pinv*Ax*P Bz=Pinv*Bx Cz=Cx*P pause
% % % % % % % % % % %
Display l a b e l . Define P i n v e r s e . C a l c u l a t e P. Display l a b e l . D e f i n e o r i g i n a l A. D e f i n e o r i g i n a l B. Define o r i g i n a l C . Display l a b e l . C a l c u l a t e new A. C a l c u l a t e new B. C a l c u l a t e new C.
ch5p5 Using MATLAB's [P, d ] = e i g (A) command, where the columns of P are the eigenvectors of A and the diagonal elements of d are the eigenvalues of A, we can find the eigenvectors of the system matrix and then proceed to diagonalize the system. We can also use canon ( S , ' modal' ) to diagonalize an LTI object, S, represented in state space.
803
804
Appendix B: MATLAB Tutorial '(ch5p5)' A=[3 1 5; 4 - 2 7; 2 3 1], B=[l;2;3]; C=[2 4 6]; [P,d]=eig(A) 'Via Transformation' Adt=inv(P)*A*P Bdt=inv(P)*B Cdt=C*P 'Via Canon Command' S=ss(A,B,C, 0) Sp=canon (S, 'modal')
Display label. Define original A. Define original B. Define original C. Generate transformation matrix, P, and eigenvalues, d. Display label. Calculate diagonal system A. Calculate diagonal systemB. Calculate diagonal system C. Display label. Create state-space LTI object for original system. Calculate diagonal system via canon command.
pause
Chapter 6: Stability ch6p1 (Example 6.7) MATLAB can solve for the poles of a transfer function in order to determine stability. To solve for the poles of T(s) use the pole(T) command. Let us look at Example 6.7 in the text. ' ( c h 6 p l ) Example 6.1' numg=1; d e n g = c o n v ([1 0],[2 3 2 3 2]) G=tf(numg,deng) ; 'T(s)'
T=feedback(G,l)
poles=pole(T] pause
% Display label. % Define numerator of G (s) . % Define denominator of G (s) . % CreateG(s) object. % Display label. % Calculate closed-loop T (s) % object. % Negative feedback is default % when there is no sign parameter. % Find poles of T (s) .
ch6p2 (Example 6.9) We can use MATLAB to find the range of gain for stability by generating a loop, changing gain, and finding at what gain we obtain right-halfplane poles. * (ch6p2) Example 6 . 9 ' K=[l: 1:2000]; f o r n = l : l e n g t h (K) ; d e n t = [ l 18 7 7 K { n ) ] ; poles=roots(dent) ; r=real(poles); i f max (r) > = 0, poles
Display l a b e l . D e f i n e r a n g e of K from 1 t o 2000 i n s t e p s of 1 . Set up length of DO LOOP to equal number of K values to be tested. Define the denominator of T (s) for the nth value of K. Find the poles for the nth value of K. Forma vector containing the real parts of the poles for K (n) . Test poles found for the nth value of K for a real value > 0 . Display first pole values where there is a real part > 0 .
B.2 MATLAB Examples K=K(n) break end end pause
% D i s p l a y c o r r e s p o n d i n g v a l u e of K. % Stop loop i f rhp p o l e s a r e found. % End i f . % End f o r .
ch6p3 (Example 6.11) We can use MATLAB to determine the stability of a system represented in state space by using the command e i g (A) to find the eigenvalues of the system matrix, A. Let us apply the concept to Example 6.11 in the text. ' (ch6p3) Example 6.11' A=[0 3 1;2 8 1;-10 -5 -2] eigenvalues=eig(A) pause
% Display label. % Define system matrix, A. % Find eigenvalues .
Chapter 7: Steady-State Errors
ch7p1 (Example 7.4, sys. b) Static error constants are found using lim snG(s) as s —• 0. Once the static error constant is found, we can evaluate the steady-state error. To evaluate the static error constant we can use the command d c g a i n (G), which evaluates G(s) at s = 0. Let us look at Example 7.4, system (b), in the text. ' (ch7pl) Example 7.4, sys.b' numg=500*poly([-2 -5 -6]) ; deng=poly([0 -8 -10 -12]) ; G=tf(numg,deng); 'Check Stability' T=feedback(G,l); poles=pole(T) 'Step Input' Kp=dcgain(G) ess=l/(l+Kp) 'Ramp Input' numsg=conv([l 0],numg) ; densg=poly ([0 -8 -10 -12]) ; sG=tf(numsg,densg); sG=minreal(sG);
Kv=dcgain(sG) ess=l/Kv 'Parabolic Input' nums2g=conv ([1 0 0],numg) , dens2g=poly([0 -8 -10-12]; s2G=tf(nums2g,dens2g); s2G=minreal(s2G);
Ka=dcgain(s2G) ess=l/Ka pause
% Display label % Define numerator of G (s) . % Define denominator of G(s) . % FormG(s) % Display label. % FormT(s) % Display closed-loop poles. % Display label. % Evaluate Kp=numg/deng for s=0 . % Evaluate ess for step input. % Display label. % Define numerator of sG (s) . % Define denominator of sG (s) . % Create sG (s) . % Cancel common 's' in % numerator(numsg) and % denominator(densg). % Evaluate Kv=sG(s) fors=0. % Evaluate steady-state error for ramp input. Display label. Define numerator of s A 2G (s) . Define denominator of s A 2G (s) . Create sA2G(s) . Cancel common 's' in numerator(nums2g) and denominator(dens2g). Evaluate Ka=sA2G(s) f or s=0 . Evaluate steady-state error for parabolic input.
805
806
Appendix B: MATLAB Tutorial ch7p2 (Example 7.6) We can use MATLAB to evaluate the gain, K, required to meet a steady-state error specification. Let us look at Example 7.6 in the text. '(ch7p2) Example 7.6 ' numgdK=[l 5]; dengdK=poly ([0 -6-7 -8]) ; GdK=tf(numgdK,dengdK); numgkv=conv ([1 0], numgdK) dengkv=dengdK; GKv=tf(numgkv,dengkv); GKv=minreal(GKv); KvdK=dcgain(GKv) ess=0.1 K=l/ (ess*KvdK) 'Check Stability' T=feedback (K*GdK, 1) ; poles=pole(T) pause
Display label. Define numerator of G (s) /K. Define denominator of G (s) /K. Create G(s) /K. Define numerator of sG (s) /K. Define denominator of sG (s) /K. Create sG(s) /K. Cancel common 's' in numerator and denominator of sG (s) /K. Evaluate (Kv/K)=(numgkv/dengkv) for s=0. Enumerate steady-state error. Solve for K. Display label. ForraT (s) . Display closed-loop poles .
Chapter 8: Root Locus Techniques ch8p1 (Example 8.7) MATLAB allows root loci to be plotted with the r l o c u s (GH) command, where G ^ / ^ s ^ n u m g h / d e n g h and GH is an LTI transfer-function object. Points on the root locus can be selected interactively using the [K / p]=rlocfind(GH) command. MATLAB then yields the gain (K) at that point as well as all other poles (p) that have that gain. We can zoom in and out of the root locus by changing the range of axis values using the command a x i s ([xmin, xmax, ymin, ymax]). The root locus can be drawn over a grid that shows constant damping ratio (z) and constant natural frequency (wn) curves using the s g r i d (z,wn) command. To plot multiple £ and con curves, use z = z m i n : z s t e p : zmax and wn=wnmin: w n - s t e p : wnmax to specify ranges of values. ' (ch8pl) Example 8.7' elf numgh=[l -4 20]; dengh=poly([-2 -4]); *G(s)H(s)' GH=tf(numgh,dengh) rlocus(GH) z=0.2:0.05:0.5; wn=0:l:10; sgrid(z,wn)
title ('Root Locus') pause rlocus(GH) axis ([-3 1 -4 4]) title ('Close-up')
% Display label. % Clear graph on screen. % Define numerator of G (s) H (s) . % Define denominator of G (s) H (s) . % Display label. % Create G (s)H(s) and display. % Draw root locus . % Define damping ratio values : 0.2 % to 0 . 5 in steps of 0 . 05 . % Define natural f reguency values : % 0 to 10 in steps of 1. % Generate damping ratio and % natural f reguency grid lines for % root locus . % Define title for root locus . % Draw close-up root locus . % Define range on axes for root % locus close-up view. % Define title for close-up root % locus .
B.2 M ATLAB Examples z=0. 45; wn=0; s g r i d (z,wn) for k=l: 3
[K, p ] = r l o c f ind(GH)
end pause
% D e f i n e damping r a t i o l i n e f o r % o v e r l a y on c l o s e - u p r o o t l o c u s . % Suppress n a t u r a l frequency % overlay curves . % O v e r l a y damping r a t i o c u r v e on % close-up root locus . % Loop a l l o w s 3 p o i n t s t o b e % s e l e c t e d a s p e r Example 8 . 7 , %(z=0.45, j w c r o s s i n g , b r e a k a w a y ) . % G e n e r a t e g a i n , K, and c l o s e d - l o o p % poles, p, for point selected % i n t e r a c t i v e l y on t h e r o o t l o c u s . % End l o o p .
ch8p2 (Example 8.8) We can couple the design of gain on the root locus with a step-response simulation for the gain selected. We introduce the command r l o c u s (G, K), which allows us to specify the range of gain, K, for plotting the root locus. This command will help us smooth the usual root locus plot by equivalently specifying more points via the argument, K. Notice that the first root locus plotted without the argument K is not smooth. We also introduce the command x=input (' prompt' ), which allows keyboard entry of a value for x in response to a prompt. We apply this command to enter the desired percent overshoot. We also add a variables value to the title of the root locus and step-response plots by inserting another field in the title command and use num2 s t r (value) to convert value from a number to a character string for display. Let us apply the concepts to Example 8.8 in the text. ' (ch8p2) Example 8.8' clear elf numg=[l 1.5]; deng=poly ([0 -1 -10]) ; 'G(s)' G=tf (numg,deng) rlocus (G) title ('Original Root Locus') pause K=0 .005;
% Display label. % Clear variables from workspace. % Clear graph on screen . % Define numerator of G (s) . % Define denominator of G (s) . % Display label. % Create and display G (s) . % Draw root locus (H(s)=l). % Add title.
% Specify range of gain to smooth % root locus . rlocus (G, K) % Draw smoothed root locus % (H(s)=l) . title ('Smoothed Root Locus') % Add title. % Input desired percent overshoot pos=input ('Type %OS') ; % from the keyboard. z=-log(pos/100) /sqrt(piA2+[log(pos/100)]A2) % Calculate damping ratio. % Overlay desired damping ratio sgrid (z, 0) % line on root locus . title (['Root Locus with', num2str (pos) ,'% overshoot line']) % Define title for root locus % showing percent overshoot used. [K,p]=rlocfind (G) % Generate gain, K, and closed% loop poles, p, for point selected % interactively on the root locus .
807
808
Appendix B: MATLAB Tutorial pause 'T(s)' T= feedback (K*G, 1)
% Display label % Find closed-loop transfer % function % with selected K and display. step(T) % Generate closed-loop step % response for point select on % root locus. title (['Step Response for K= ', num2str (K) ]) % Give step response a title which % includes the value of K. pause
Chapter 9: Design Via Root Locus ch9p1 (Example 9.3) We can use MATLAB to design PD controllers. The program allows us to input a desired percent overshoot via the keyboard. MATLAB then produces a root locus for the uncompensated system with an overlay of the percent overshoot line. We interactively select the intersection of the root locus and the desired percent overshoot line to set the gain. MATLAB outputs an estimate of the uncompensated system's performance specifications and a step response of the uncompensated system for us to determine the required settling time. After we input the settling time through the keyboard, MATLAB designs the PD controller and produces a root locus of the PD compensated system from which we can interactively select the gain. Finally, MATLAB produces an estimate of the PD compensated system's performance specifications and a step response of the PD compensated system. 1
(ch9pl) Example 9 . 3 ' % Display l a b e l . % Clear graph on s c r e e n . elf 'Uncompensated System' % Display l a b e l . % Generate numerator of G (s) . numg=l; deng=poly ([0 -4 -6]) ; % Generate denominator of G (s) . 'G(s)' % Display l a b e l . G=tf (numg, deng) % Create and d i s p l a y G (s) . pos=input ('Type d e s i r e d p e r c e n t o v e r s h o o t ' ) ; % Input d e s i r e d p e r c e n t o v e r s h o o t . z-log(pos/100)/sqrt(piA2+[log(pos/100)]A2) ; % C a l c u l a t e damping r a t i o . r l o c u s (G) % P l o t uncompensated r o o t locus . s g r i d (z, 0) % Overlay d e s i r e d p e r c e n t % overshoot l i n e . t i t l e (['Uncompensated Root Locus w i t h ' , num2str (pos) , . . . Overshoot Line']) % T i t l e uncompensated r o o t l o c u s . [K,p]=rlocfind(G) ; % Generate g a i n , K, and c l o s e d - l o o p % p o l e s , p , for p o i n t s e l e c t e d % i n t e r a c t i v e l y on the r o o t locus . 'Closed-loop poles=' % Display l a b e l . % Display c l o s e d - l o o p p o l e s . p f=input ('Give p o l e number t h a t i s o p e r a t i n g p o i n t ' ) ; % Choose uncompensated system % dominant pole . 'Summary of e s t i m a t e d s p e c i f i c a t i o n s for s e l e c t e d p o i n t on' 'uncompensated root l o c u s ' % Display l a b e l . o p e r a t i n g p o i n t = p (f) % Display uncompensated dominant % pole.
B.2 MATLAB Exampl gain=K % Display uncompensated gain • estimated_settling_time=4/abs(real(p(f))) % Display uncompensated settling % time. estimated_peak_time=pi/abs(imag(p(f))) % Display uncompensated peak time. estimated_percent_overshoot=pos % Display uncompensated percent % overshoot. estimated_damping_ratio=z % Display uncompensated damping % ratio. estimated_natural_frequency=sqrt(real(p(f))A2+imag(p(f))A2) % Display uncompensated natural % frequency. numkv=conv ([1 0],numg) ; % Set up numerator to evaluate Kv. denkv=deng; % Set up denominator to evaluate Kv. sG=tf(numkv,denkv); % CreatesG(s) . % Cancel common poles and zeros. sG=minreal (sG) ; Kv=dcgain (K*sG) % Display uncompensated Kv. ess=l/Kv % Display uncompensated % steady-state % error for unit ramp input. 'T(s)' % Display label. T=feedback(K*G,1) % Find uncompensated T (s) . % Plot step response of step (T) % uncompensated system. title (['Uncompensated System Step Response with ', num2str (pos) , . . . '% Overshoot']) % Add title to uncompensated step % response. 'Press any key to go to PD compensation' % Display label. pause % Display label. 'Compensated system' Ts=input ('Type Desired Settling Time ') ; % Input desired settling time from % the keyboard. wn=4/ (Ts*z) ; % Calculate natural frequency. desired_pole=(-z*wn) + (wn*sqrt(l-zA2)*i) ; % Calculate desired dominant pole % location. angle_at_desired_pole=(180/pi)*. . . angle(polyval(numg,desired_pole)/polyval(deng,desired_pole)); % Calculate angular contribution % to desired pole without PD % compensator. PD_angle=180-angle_at_desired_pole; % Calculate required angular % contribution from PD % compensator. zc=((imag(desired_pole)/tan(PD_angle*pi/180))... % Calculate PD zero location. _real (desired_pole) ) / 'PD'Compensator' % Display label. % Calculate numerator of Gc (s) . numc=[l zc]; % Calculate numerator of Gc (s) . denc=[0 1]; 'Gc(s)' % Display label.
810
Appendix B: MATLAB Tutorial Gc=tf (numc,denc) 'G(s)Gc(s)' Ge=G*Gc rlocus (Ge, 0: 0 . 005 :100)
% C r e a t e a n d d i s p l a y Gc (s) . % Display l a b e l . % Cascade G(s) andGc(s) .
% Plot root locus of PD compensated % system. % Overlay desired percent sgrid (z, 0) % overshoot line . title (['PD Compensated Root Locus with ', num2str (pos) , . . . ' % Overshoot Line']) % Add title to PD compensated root % locus . [K,p]=rlocf ind (Ge) ; % Generate gain, K, and closed-loop % poles, p , for point selected % interactively on the root locus . 'Closed-loop poles=' % Display label. p % Display PD compensated systems' % closed-loop poles . f=input ('Give pole number that is operating point') ; % Choose PD compensated system % dominant pole . 'Summary of estimated specifications for selected point on PD' 'compensated root locus' % Display label. operatingpoint=p (f) % Display PD compensated dominant %pole. gain=K % Display PD compensated gain . estimated_settling_time=4/abs(real(p(f))) % Display PD compensated settling % time. estimated_peak_time=pi/abs(imag(p(f))) % Display PD compensated peak time. % Display PD compensated percent estimated_percent_overshoot=pos % overshoot. % Display PD compensated damping estimated_damping_ratio=z % ratio. estimated_natural_frequency=sqrt(real(p(f)) A 2+imag(p(f)) A 2 % Display PD compensated natural % frequency. % Created transfer function, 's' . s=tf ([1 0], 1) ; sGe=s*Ge; % Create sGe (s) . sGe=minreal (sGe) ; % Cancel common poles and zeros . Kv=dcgain (K*sGe) % Display compensated Kv. ess=l/Kv % Display compensated % steady-state error for % unit ramp input. 'T(s)' % Display label. T=feedback (K*Ge, 1) % Create and display PD compensated %T(s) . ' Press any key to continue and obtain the PD compensated step' 'response' % Display label. pause % Plot step response for PD step(T) % compensated system. title ([' PD Compensated System Step Response with '. . . num2str (pos) , '% Overshoot']) % Add title to step response % of PD compensated system. pause
B.2 MATLAB Examples ch9p2 (Example 9.4) We can use MATLAB to design a lead compensator. The program allows us to input a desired percent overshoot via the keyboard. MATLAB then produces a root locus for the uncompensated system with an overlay of the percent overshoot line. We interactively select the intersection of the root locus and the desired percent overshoot line to set the gain. MATLAB outputs an estimate of the uncompensated system's performance specifications and a step response of the uncompensated system for us to determine the required settling time. Next we input the settling time and the lead compensator zero through the keyboard. At this point we take a different approach from that of the previous example. Rather than letting MATLAB calculate the lead compensator pole directly, MATLAB produces a root locus for every interactive guess of a lead compensator pole. Each root locus contains the desired damping ratio and natural frequency curves. When our guess is correct, the root locus, the damping ratio line, and the natural frequency curve will intersect. We then interactively select this point of intersection to input the gain. Finally, MATLAB produces an estimate of the lead-compensated system's performance specifications and a step response of the lead-compensated system. '(ch9p2) Example 9 . 4 ' % Display l a b e l . % Clear graph on screen . Clf 'Uncompensated System' % Display l a b e l . % Generate numerator of G {s) . numg=l; deng=poly ([0 -4 -6]) ; % Generate denominator of G (s) . 'G(s)' % Display l a b e l . % Create and d i s p l a y G (s) . G=tf (numg, deng) pos=input ('Type d e s i r e d p e r c e n t o v e r s h o o t ' ) ; % Input d e s i r e d p e r c e n t o v e r s h o o t . z=-log(pos/100) / s q r t (pi A 2+[log (pos/100) ]A2) ; % C a l c u l a t e damping r a t i o . % P l o t uncompensated root locus . r l o c u s (G) s g r i d ( z , 0) % Overlay d e s i r e d p e r c e n t % overshoot l i n e . t i t l e (['Uncompensated Root Locus with ', num2str ( p o s ) , . . . '% Overshoot Line']) % T i t l e uncompensated root locus . [K,p]=rlocf ind (G) ; % Generate gain, K, and c l o s e d - l o o p % p o l e s , p , for p o i n t s e l e c t e d % i n t e r a c t i v e l y on t h e r o o t l o c u s . 'Closed-loop poles=' % Display l a b e l . % Display c l o s e d - l o o p p o l e s . p f=input ('Give pole number t h a t i s o p e r a t i n g p o i n t ' ) ; % Choose uncompensated system % dominant pole . 'Summary of e s t i m a t e d s p e c i f i c a t i o n s for s e l e c t e d p o i n t on' % Display l a b e l . 'uncompensated r o o t l o c u s ' o p e r a t i n g p o i n t = p (f) % Display uncompensated dominant %pole. gain=K % Display uncompensated g a i n . estimated_settling_time=4/abs(real(p(f))) % Display uncompensated s e t t l i n g % time. estimated_peak_time=pi/abs(imag(p(f))) % Display uncompensated peak t i m e . estimated_percent_overshoot=pos % Display uncompensated p e r c e n t % overshoot.
812
Appendix B: MATLAB Tutorial estimated_damping_ratio=z
% Display uncompensated damping %ratio. estimated_natural_frequency=sqrt(real(p(f))A2+imag(p(f))A2 % D i s p l a y uncompensated n a t u r a l % frequency. % Set up numerator to evaluate Kv. numkv=conv ([1 0], numg) ; % Set up denominator to evaluate Kv. denkv=deng; sG=tf(numkv,denkv); % Create sG(s) . sG=minreal(sG); % Cancel common poles and zeros. Kv=dcgain(K*sG) % Display uncompensated Kv. ess=l/Kv % Display uncompensated % steady-state error for % unit ramp input. % Display label. 'T(s)' % Create and display T(s) . T=feedback(K*G,l) % Plot step response of step(T) % uncompensated system. title ([['Uncompensated System Step Response with ', . . . % Add title to uncompensated step num2str (pos), '% Overshoot']) % response. ' Press any key to go to lead compensation' % Display label. pause Ts=input ('Type Desired Settling Time') ; % Input desired settling time . b=input ('Type Lead Compensator Zero, (s+b) . b= ') ; % Input lead compensator zero . done=l; % Set loop flag. % Start loop for trying lead while done==l % compensator pole. a=input ('Enter a Test Lead Compensator Pole, (s+a) . a= ') ; % Enter test lead compensator pole. numge=conv (numg,[l b]) ; % Generate numerator of Gc (s) G(s) . denge=conv ([1 a], deng); % Generate denominator % of Gc(s)G(s) . Ge=tf(numge,denge); % Create Ge (s)=Gc(s)G(s) . wn=4/(Ts*z); % Evaluate desired natural % frequency. % Clear graph on screen. elf % Plot compensated root locus with rlocus(Ge) % test lead compensator pole . axis ([-10,10,-10,10]) % Change lead-compensated % root locus axes. % Overlay grid on lead-compensated sgrid(z,wn) % root locus . title (['Lead-Compensated Root Locus with', num2str (pos) , . . . % Overshoot Line, Lead Pole at', . . . num2str (-a) , 'andRequired Wn']) % Add title to lead-compensated % root locus . done=input ['Are you done? (y=0,n=l)'); % Set loop flag. % End loop for trying compensator end % pole. % Generate gain, K, and closed-loop [K,p]=rlocfind (Ge) ; % poles, p, for point selected
B.2 M A T L A B Examples % interactively on the root locus . % Display label. % Display lead compensator. % Display label. % Display Gc (s)G (s) . % Display label. % Display lead-compensated % system's % closed-loop poles. f=input ('Give pole number that is operating point') ; % Choose lead-compensated system % dominant pole. ' Summary of estimated specifications for selected point on lead' ' compensated root locus' % Display label. operatingpoint=p (f) % Display lead-compensated % dominant pole . gain=K % Display lead-compensated gain. estimated_settling_time=4/abs(real(p(f))) % Display lead-compensated % settling time. estimated_peak_time=pi/abs(imag(p(f))) % Display lead-compensated % peak time. estimated_percent_overshoot=pos % Display lead-compensated % percent overshoot. estimated_damping_ratio=z % Display lead-compensated % damping ratio. estimated_natural_frequency=sqrt(real(p(f))A2+imag(p(f))A2) % Display lead-compensated % natural frequency. % Create transfer Function, 's' . s=tf ([1 0],1); sGe=s*Ge; % Create sGe (s) to evaluate Kv. % Cancel common poles and zeros . sGe=minreal (sGe); Kv=dcgain (K*sGe) % Display lead-compensated Kv. ess=l/Kv % Display lead-compensated steady% state error for unit ramp input. 'T(s)' % Display label. % Create and display leadt=f eedback (K*Ge, 1) % compensated T (s) . 'Press any key to continue and obtain the lead-compensated step' 'response' % Display label. pause step(T) % Plot step response for lead % compensated system. title (['Lead-Compensated System Step Response with ', . . . num2str (pos), '% Overshoot']) % Add title to step response % of lead-compensated system. pause 'Gc(s)' Gc=tf ([lb],[la]) 'Gc(s)G(s)' Ge 'Closed-loop poles= ' p
Chapter 10: Frequency Response Techniques ch10p1 (Example 10.3) We can use MATLAB to make Bode plots using bode (G), where G/( s )=numg/deng and G is an LTI transfer-function object. Information about the plots obtained with bode (G) can be found by left-clicking the mouse on the curve. You can find the curve's label, as well as the coordinates of the point on which you clicked. Right-clicking away from a curve brings up a menu if the icons on the menu
813
814
Appendix B: MATLAB Tutorial
bar are deselected. From this menu you can select (1) system responses to be displayed and (2) characteristics, such as peak response. When selected, a dot appears on the curve at the appropriate point. Let your mouse rest on the point to read the value of the characteristic. You may also select (3) which curves to view, (4) choice for grid on or off, (5) returning to full view after zooming, and (6) properties, such as labels, limits, units, style, and characteristics. We can obtain points on the plot using [mag, p h a s e , w]=bode(G), where magnitude, phase, and frequency are stored in mag, p h a s e , and w, respectively. Magnitude and phase are stored as 3-D arrays. We use mag ( : , : ) ' , p h a s e ( : , : ) ' to convert the arrays to column vectors, where the apostrophe signifies matrix transpose. Let us look at Example 10.3 in the text. ' ( c h l O p l ) Example 1 0 . 3 ' % Display label. elf % Clear graph on screen. numg=[l 31; % Define numerator of G (s) . deng=conv ([1 2],[1 2 25]) ; % Define denominator of G (s) 'G(s)' % Display label. G=tf (numg,deng) % Create and display G (s) . % Make a Bode plot. bode(G) grid on % Turn on grid for Bode plot. title ('Open-Loop Frequency Response') % Adda title to the Bode plot. % Store points on the Bode plot. [mag, phase, w]=bode (G) points=[20*logl0 (mag :) )',phase(:, : ) ' , w] % List points on Bode plot with % magnitude in dB. pause
ch10p2 (Example 10.5) We can use MATLAB to make Nyquist diagrams using n y q u i s t (G), where G{s) =numg/deng and G is an LTI transfer-function object. Information about the plots obtained with n y q u i s t (G) can be found by leftclicking the mouse on the curve. You can find the curves label, as well as the coordinates of the point on which you clicked and the frequency. Right-clicking away from a curve brings up a menu if the icons on the menu bar are deselected. From this menu you can select (1) system responses to be displayed and (2) characteristics, such as peak response. When selected, a dot appears on the curve at the appropriate point. Let your mouse rest on the point to read the value of the characteristic. You may also select (3) whether or not to show negative frequencies, (4) choice for grid on or off, (5) choice for zooming to (-1,0), (6) returning to full view after zooming, and (7) properties, such as labels, limits, units, style, and characteristics. We can obtain points on the plot by using [ r e , im, w ] = n y q u i s t (G), where the real part, imaginary part, and frequency are stored in r e , im, and w, respectively, and r e and im are 3-D arrays. We can specify a range of w by using [ r e , i m ] = n y q u i s t (G, w). We use r e ( : , : ) ' , and im ( : , : ) ' to convert the arrays to column vectors. Let us look at Example 10.5 in the text. ' (chl0p2) Example 10.5' elf numg=[l 2]; deng=[l 0 0]; 'G(s)' G=tf(numg,deng) nyquist(G)
% Display label. % Clear graph on screen. % Define numerator of G (s) % Define denominator of G % Display label. % Create and display G (s) % Make a Nyquist diagram.
B.2 MATLAB Examples grid on % Turn on grid for Nyquist diagram. title ('Open-Loop Frequency Response') % Add a title to the Nyquist % diagram. % Let 0 <w< 10 in steps of 0 . 5 . w=0:0.5:10; % Get Nyquist diagram points for a [ r e , i m ] = n y q u i s t (G, w) ; % range of w. % List specified range of points p o i n t s = [ r e ( : , : ) ' , i m ( : , : ) ' , w'] % in Nyquist diagram. pause
ch10p3 (Example 10.8) We can use MATLAB to find gain margin (Gm), phase margin (Pm), the gain margin frequency, where the phase plot goes through 180 degrees (Wcg), and the phase-margin frequency, where the magnitude plot goes through zero dB (Wcp). To find these quantities we use [Gm, Pm, Wcg, Wcp]= margin (G), where G(.s)=numg/deng and G is an LTI transfer-function object. Let us look at Example 10.8 in the text. ' ( c h l 0 p 3 ) Example 1 0 . 8 ' elf numg=6; deng=conv([12],[l 2 2]);
% Display l a b e l . % C l e a r g r a p h on s c r e e n . % D e f i n e n u m e r a t o r of G ( s ) . % D e f i n e d e n o m i n a t o r of G (s) . 'G(s)' % Display l a b e l . G=tf(numg,deng) % C r e a t e a n d d i s p l a y G (s) . % Make a N y q u i s t d i a g r a m . nyquist(G) % Turn on g r i d f o r t h e N y q u i s t g r i d on %diagram. t i t l e ('Open-Loop F r e q u e n c y R e s p o n s e ' ) % Add a t i t l e t o t h e N y q u i s t %diagram. % F i n d m a r g i n s and m a r g i n [Gm, Pm, Wcg, Wcp]=margin (G) ; % frequencies. 'Gm(dB); P m ( d e g . ) ; 180 d e g . f r e q . ( r / s ) ; 0 dB f r e q . ( r / s ) ' % Display l a b e l . m a r g i n s = ( 2 0 * l o g l 0 (Gm) , Pm, Wcg, Wcp] % Display margin d a t a . pause
ch10p4 (Example 10.9) We can use MATLAB to determine the range of K for stability using frequency response methods. Let us look at Example 10.9 in the text. ' (chl0p4) Example 10.9' numg=l; deng=poly ([-2 -4 -5]) ; 'G(s)' G=tf(numg,deng) [Gm, Pm, Wcg, Wcp]=margin (G) ; K=Gm pause
% % % % % % % %
Display l a b e l . D e f i n e n u m e r a t o r of G (s) . D e f i n e d e n o m i n a t o r of G (s] Display l a b e l . C r e a t e and d i s p l a y G (s) . F i n d m a r g i n s and m a r g i n frequencies. Display K for s t a b i l i t y .
ch10p5 (Example 10.11) We can use MATLAB to find the closed-loop frequency response. Let us look at Example 10.11 in the text.
815
816
Appendix B: MATLAB Tutorial ' (chl0p5) Example 10.11* elf numg=50; deng=poly([0 -3 -6]) ;
% Display label. % Clear graph on screen. % Define numerator of G(s) . % Define denominator of G (s) . 'G(s)' % Display label. G=tf(numg,deng) % Create and display G (s) . 'T(s)' % Display label. T=feedback(G,l) % Find and display closed-loop % transfer function. bode(T) % Make a Bode plot. grid on % Turn on the grid for the plots. title ('Closed-Loop Frequency Response' % Add a title to the Bode plot. pause nyquist(T) % Make a Nyquist diagram. title ('Closed-Loop Frequency Response') % Add a title to the Nyquist % diagram. pause
ch*IOp6 We can use MATLAB to plot Nichols charts using n i c h o l s (G), where G (s) =numg/deng and G is an LTI transfer-function object. The Nichols grid can be added using the n g r i d command after the n i c h o l s (G) command. Information about the plots obtained with n i c h o l s (G) can be found by left-clicking the mouse on the curve. You can find the curve's label, as well as the coordinates of the point on which you clicked and the frequency. Right-clicking away from a curve brings up a menu if the icons on the menu bar are deselected. From this menu you can select (1) system responses to be displayed and (2) characteristics, such as peak response. When selected, a dot appears on the curve at the appropriate point. Let your mouse rest on the point to read the value of the characteristic. You may also select (3) choice for grid on or off, (4) returning to full view after zooming, and (5) properties, such as labels, limits, units, style, and characteristics. Let us make a Nichols chart of G(s) = l/[s(s + l){s + 2)). '(chl0p6)' elf numg=l; deng=poly([0 - 1 -23j 'GUI' G=tf(numg,deng) nichols(G) ngrid pause
% Display l a b e l . % Clear graph on screen . % Define numerator of G (s) % Define denominator of G % Display l a b e l . % Create and d i s p l a y G (s) , % Make a Nichols p l o t . % Add Nichols g r i d .
ch10p7 (Example 10.15) We can use MATLAB and frequency response methods to include time delay in the loop. Time delay is represented by [numd, dend]=pade (T, n ) , where T is the delay time in seconds and n is the order. Larger values of n give better approximations to the delay, G d (s)=numd/dend. Since we are plotting multiple plots, we first collect the data for the Bode plots by using [mag, p h a s e ] =bode (G, w), where w is specified as a range of frequencies. We then use the generic plotting command. Also notice the commands used to label the axes and the plots on the Bode plot (see the MATLAB instruction manual for details). Let us look at Example 10.15 in the text.
B.2 M A T L A B Examples r
(chl0p7) Example 10.15' elf hold off numg=l; deng=poly ([0 -1 -10]) ; 'G(s)' G=tf (numg, deng) w=0.01:0.1:10; [magg,phaseg]=bode (G,w); [numd, dend]=pade (1,6); Gd=tf (numd, dend) ;
% Display label. % Clear graph on screen. % Turn graph hold of f. % Define numerator of G (s) . % Define denominator of G (s) . % Display label. % Create and display G (s) . % Let 0.01<w<10 in steps of 0.1. % Collect Bode data for G (s) . % Represent the delay. % Create and display the delay, %Gd(s) . % Collect Bode data for Gd (s) . [magd,phased]=bode (Gd, w) ; Ge=Gd*G; % Form Gd (s) G (s) . [mage,phasee]=bode (Ge,w) ; % Collect Bode data for Gd (s) G (s) . % Subdivide plot area for plot 1. subplot (2,1,1) semilogx (w, 20 *logl0 (mage (:,:))) % Plot magnitude response. grid on % Turn on grid for magnitude plot. axis ([0.01,10, -80,20]); % Limit Bode plot axes. title ('Magnitude Response with Delay') % Add title to magnitude response. % Label x-axis of magnitude xlabel ('Freguency (rad/s)') % response. % Label y-axis of magnitude ylabel ('201og M') % response. % Subdivide plot area for plot 2. subplot (2,1,2) semilogx (w,phaseg (:, :) , w, phased (:, :) , w, phasee (:, :)) % Plot phase response for G (s) , % Gd(s) , andG (s) Gd(s) on one % graph . grid on % Turn on grid for phase plot. axis ([0.01,10,-900, 0]) ; % Limit Bode plot axes. title ('Phase Response with Delay') % Add title to phase response. % Label x-axis of phase response. xlabel ('Freguency (rad/s)') % Label y-axis of phase response . ylabel ('Phase (degrees)') text (1.5, -50, 'Time Delay') % Label time delay curve. text (4,-150, 'System') % Label system curve. text(2.7,-300,'Total') % Label total curve. pause
ch10p8 (Example 10.18) We can use MATLAB and frequency response methods to determine experimentally a transfer function from frequency response data. By determining simple component transfer functions and then successively subtracting their frequency response, we can approximate the complete transfer function. Let us look at Example 10.18 in the text and use MATLAB for a portion of the problem. You can complete the program for practice. For this problem we generate the original frequency response plot via a transfer function. Normally, the data for the original frequency response plot would be tabular, and the program would begin at the step [M0, P0]=bode (G0,w) where the tabular data is generated. In other words, in a real application, the data would consist of column vectors M0, P0, and w'. ' (chl0p8) Example 10.18' elf
% Display l a b e l . % Clear graph on s c r e e n .
817
818
Appendix B: M A T L A B Tutorial hold off % Turn graph hold of f. % Generate the experimental Bode plots for G0(s) =numgO/dengO, that % is, M0,P0. % Define numerator of GO (s) . numg0=70*[120]; % Partially define denominator of dengO=conv([l 7],[1 2 25]) ; %G0(s) . dengO=conv (dengO,[l 70]) ; % Complete the denominator of %G0(s) . G0=tf(numgO,dengO); % Create GO (s) . % Let K w < 1 0 0 0 in steps of 0 . 5 . w=l:0.5:1000; [MO, P0]=bode(G0,w) ; % Generate the tabular data. [20*logl0(M0(:, :) ) ' , P 0 ( : , : ) ' , w ' ] ; % Convert magnitude data to dB. % Generate a Bode plot. bode(GO,w) % Turn on grid for Bode plot. g r i d on % Add title. t i t l e ('Experimental') pause % Clear g r a p h . elf % Estimate a component part of the transfer function as % Gl (s)=25/ (sA2+2*0.22*5s+5A2) and subtract it from the experimental % frequency response % Define numerator of Gl (s) . numgl=5 A 2; % Define denominator of Gl (s) . dengl=[l 2*0.22*5 5 A 2]; % Display label. 'First estimate' % Create and display Gl (s) . Gl=tf(numgl,dengl) % Generate Bode data for Gl (s) . [Ml,Pl]=bode(Gl,w) ; M2=20*loglO(MO(:, -20*loglO(Ml : , : ) ) ; % Subtract Bode magnitude data of % Gl from original magnitude data. % Subtract Bode phase data of Gl P2=P0(:, : ) - P l ( : , : ) ; % from original phase data. % Divide plot area in two for subplot(2,1,1) % magnitude plot. % Plot magnitude response after semilogx(w(:,:),M2) % subtracting. % Turn on grid for magnitude plot. g r i d on % Add x-axis label. x l a b e l ('Frequency ( r a d / s e c ) ' ) % Add y-axis label. y l a b e l ('Gain dB') % Divide plot area in two for phase subplot(2,1,2) %plot. % Plot the phase response after semilogx(w,P2) % subtracting. % Turn on grid for phase plot. g r i d on A t i t l e ('Experimental Minus 2 5 / (s' 2 + 2*0.22*5s+5 2)') % Add title. % Add x-axis label. xlabel ('Frequency (rad/sec)') ylabel ('Phase deg') % Add y-axis label. 'This completes a portion of Example 10.18.' ' The student should continue the program for practice.' pause
Chapter 11: Design Via Frequency Response ch11 p1 (Example 11.1) We can design via gain adjustment on the Bode plot using MATLAB. You will input the desired percent overshoot from the keyboard. MATLAB will calculate the required phase margin and then search the Bode
B.2 MATLAB Examples plot for that phase margin. The magnitude at the phase-margin frequency is the reciprocal of the required gain. MATLAB will then plot a step response for that gain. Let us look at Example 11.1 in the text. ' ( c h l l p l ) Example 1 1 . 1 • % Display l a b e l . % C l e a r g r a p h on s c r e e n . elf numg=[100]; % D e f i n e n u m e r a t o r o f G (s) . % D e f i n e d e n o m i n a t o r of G (s) . d e n g = p o l y ([0 - 3 6 - 1 0 0 ] ) ; % C r e a t e a n d d i s p l a y G (s) . G=tf (numg, deng) % Input desired percent overshoot. p o s = i n p u t ( f Type%OS'); z=(-log(pos/100))/(sqrt(piA2+log(pos/100)A2)); % C a l c u l a t e r e q u i r e d damping r a t i o . Pm=atan(2*z/ ( s q r t (-2*zA2+sqrt (l+4*zA4) ) ) )*(180/pi) ; % Calculate required phase margin. w=0. 0 1 : 0 . 01:1000,% S e t r a n g e of f r e q u e n c y from 0 . 0 1 % t o 1000 i n s t e p s of 0 . 0 1 . [M, P]=bode(G,w) ; % Get Bode d a t a . % Calculate required phase angle. Ph=-180+Pm; % S e a r c h Bode d a t a f o r r e q u i r e d f o r k = l : 1: l e n g t h (P) ; % phase angle. % If r e q u i r e d phase angle i s found, i f P (k) -Ph < = 0 ; % f i n d t h e v a l u e of % m a g n i t u d e a t t h e same f r e q u e n c y . M=M(k) ; % Display l a b e l . ' R e q u i r e d K' % Calculate the required gain. K=l/M % Stop t h e loop. break % End i f . end % End f o r . end T=feedback(K*G,l) ; % F i n d T ( s ) u s i n g t h e c a l c u l a t e d K. % Generate a step response. step(T) t i t l e ( [ ' C l o s e d - L o o p S t e p R e s p o n s e f o r K= ' , n u m 2 s t r (K)]) % Add t i t l e t o s t e p r e s p o n s e . pause
ch11 p2 (Example 11.2) Let us use MATLAB to design a lag compensator. The program solves Example 11.2 in the text and follows the same design technique demonstrated in that example. You will input the value of gain to meet the steadystate error requirement followed by the desired percent overshoot. MATLAB then designs a lag compensator, evaluates Kv, and generates a closed-loop step response. ' ( c h l l p 2 ) Example 1 1 . 2 ' % Display l a b e l . % C l e a r g r a p h on s c r e e n . elf K = i n p u t ('Type v a l u e of K t o meet s t e a d y - s t a t e e r r o r r e q u i r e m e n t ' ) ; % I n p u t K. % Input desired percent overshoot. p o s = i n p u t ('Type %OS ') ; % D e f i n e n u m e r a t o r of G (s) . numg=[100*K]; d e n g = p o l y ([0 - 3 6 -100]) ; % D e f i n e d e n o m i n a t o r of G (s) . % Display l a b e l . ' G (s)' % C r e a t e and d i s p l a y G (s) . G=tf (numg, deng) z=(-log(pos/100)) I(sqrt(piA2+log(pos/100)A2)); % C a l c u l a t e r e q u i r e d damping %ratio. Pm=atan ( 2 * z / ( s q r t ( - 2 * z A 2 + s q r t ( l + 4 * z A 4 ) ) ) ) * ( 1 8 0 / p i ) + 1 0 ;
819
820
Appendix B: MATLAB Tutorial
w=0.01:0.01:100; [M, P]=bode(G,w) ; Ph=-180+Pm; for k=l:l:length(P) ; if P(k)-Ph<=0; M=M(k) / wf=w(k); break end end wh=wf/10; wl=(wh/M);
numc=[l wh]; denc=[l w l ] ; Kc=wl/wh; 'Lag compensator' Kc 'Gc(s)'
Gc=tf(Kc*numc,dene) 'Gc(s)G(s)"
GcG=Gc*G s = t f ([1 O L D ? sGcG=s*GcG; sGcG=minreal(sGcG); Kv=dcgain(sGcG) T=feedback(GcG,1); step(T)
% Calculate regui red phase margin. % S e t r a n g e of f r e g u e n c y from 0 . 01 % t o 1000 i n s t e p s of 0 . 0 1 . % Get Bode d a t a . % Calculate reguiredphase angle. % S e a r c h Bode d a t a f o r r e g u i r e d % phase a n g l e . % If r e g u i r e d p h a s e a n g l e i s found, % f i n d t h e v a l u e of % m a g n i t u d e a t t h e same f r e g u e n c y . % At t h i s f r e g u e n c y t h e m a g n i t u d e % p l o t m u s t go t h r o u g h 0 d B . % Stop t h e loop. % End i f . % End f o r . % Calculate the high-freguency % b r e a k of t h e l a g c o m p e n s a t o r . % Calculate the low-freguency % b r e a k of t h e l a g c o m p e n s a t o r ; % f o u n d from l a g c o m p e n s a t o r , % G c ( s ) = K c ( s + w h ) I ( s + w l ) , h i g h & low % freguency gain r e g u i r e m e n t s . l A t l o w w , g a i n = l . Thus, %Kc*wh/wl = l . At h i g h w, g a i n = l / M . % Thus Kc=l/M. Hence % Kc=wl/wh=l/M, o r wl=wh/M. % G e n e r a t e n u m e r a t o r of l a g % compensator, Gc(s) . % G e n e r a t e d e n o m i n a t o r of l a g % compensator, Gc(s) . % G e n e r a t e K f o r Gc (s) . % Display l a b e l . % D i s p l a y l a g c o m p e n s a t o r K. % Display l a b e l . % C r e a t e and d i s p l a y Gc (s) . % Display l a b e l . % C r e a t e and d i s p l a y Gc (s) G (s) . % Create transfer f u n c t i o n / s ' . % C r e a t e s G c ( s ) G(s) . % C a n c e l common t e r m s . % E v a l u a t e Kv. % C r e a t e T (s) .
% Generate a closed-loop, l a g % compensated s t e p r e s p o n s e . title ('Closed-Loop Step Response f o r L a g - C o m p e n s a t e d System') % Add t i t l e t o s t e p r e s p o n s e . pause
ch11p3 (Example 11.3) Let us use MATLAB to design a lead compensator. The program solves Example 11.3 in the text and follows the same design technique demonstrated in that example. You will enter desired percent overshoot, peak time, and Kv. MATLAB then designs the lead compensator using Bode plots, calculates Kv, and plots a closed-loop step response.
B.2 MATLAB ExampI • ( c h l l p 3 ) Example 1 1 . 3 ' p o s = i n p u t ('Type%OS ' ) ; T p = i n p u t ('Type p e a k t i m e ' ) ; K v = i n p u t ('Type v a l u e of Kv ' numg=[100]; d e n g = p o l y ([0 - 3 6 -100]) ; G=tf(numg,deng); s=tf([10],l); sG=s*G; sG=minreal (sG); K=dcgain(Kv/sG);
% Display l a b e l . % Input desiredpercent overshoot. % Input d e s i r e d peak time . % I n p u t Kv. % Define numerator of G(s) . % Define denominator of G (s) . % Create G (s) . % Create transfer function, 's' . % Create sG(s) . % Cancel common factors . % Solve for K. % Display label. 'G(s)» % Put K into G (s) , convert to G=zpk(K*G) % factored form, and display. z=(-log(pos/100))/(sqrt(piA2+log(pos/100)"2)); % Calculate required damping % ratio. Pm=atan(2*z/(sqrt(-2*zA2+sqrt(1+4*zA4) ) ) )*(180/pi); % Calculate required phase margin. % Calculate required natural wn=pi/ (Tp*sqrt (l-zA2) ) ; % frequency. wBW=wn*sqrt((l-2*zA2)+sqrt(4*zA4 4*z A 2+2)); % Determine required bandwidth. % Set range of frequency from 0 .)1 i w=0.01:0.5:1000; % to 1000 in steps of 0 . 5 % Get Bode data. [M,P]=bode(G,w) ; % Find current phase margin. [Gm, Pm,Wcg, Wcp]=margin (G) ; A Pmreq=atan (2*z/ (sqrt (-2*z'2+sqrt(l + 4*z 4)) ) )*(180/pi); % Calculate required phase margin . % Add a correction factor of 10 Pmreqc=Pmreq+10; % degrees . Pc=Pmreqc-Pm; % Calculate phase contribution % required from lead compensator . % Design lead compensator beta=(l-sin(Pc*pi/180))/(1+sin(Pc*pi/180)); % Find compensator beta. % Find compensator peak magnitude. magpc=l/sqrt(beta); % Find frequency at which for k=l: 1: length (M) ; % uncompensated system has a % magnitude of 1/magpc. % This frequency will be the new % phase margin frequency. % Look for peak magnitude. if M(k)-(l/magpc) <=0, % This is the frequency at the wmax=w (k); % peakmagnitude. % Stop the loop, break % Sad if. end % End for. % Calculate lead compensator zero, pole, and gain. % Calculate the lead compensators' zc=wmax*sqrt(beta); % low break frequency. % Calculate the lead compensators' pc=zc/beta; % high break frequency. % Calculate the lead compensators' Kc=l/beta;
822
Appendix B: MATLAB Tutorial
'Gc(s)' Gc=tf (Kc*[l zc],[lpc]) Gc=zpk(Gc) r
Ge(s)=G(s)Gc(s)' Ge=G*Gc sGe=s*Ge; sGe=minreal(sGe); Kv=dcgain(sGe) T=feedback(Ge,1); step(T)
% gain. % Display label. % Create Gc(s) . % Convert Gc (s) to factored form % and display. % Display label. % Form Ge (s)=Gc(s)G(s). % Create sGe(s) . % Cancel common factors. % Calculate Kv. %FindT(s) .
% Generate c l o s e d - l o o p , l e a d % compensated s t e p response . t i t l e ('Lead-Compensated Step Response') % Add t i t l e t o lead-compensated % step response. pause
ch11p4 (Example 11.4) Let us use MATLAB to design a lag-lead compensator. The program solves Example 11.4 in the text and follows the same design technique demonstrated in that example. You will enter desired percent overshoot, peak time, and Ky. MATLAB then designs the lag-lead compensator using Bode plots, calculates Kv, and plots a closed-loop step response. ' (chllp4) Example 11.4' pos=input ('Type %0S ') ; Tp=input ('Type peak time ') ; Kv=input ('Type value of Kv '); numg=[ 1] ; deng=poly ([0 -1 -4]) ; G=tf(numg,deng); s=tf ([1 01,1); sG=s*G; sG=minreal(sG); K=dcgain(Kv/sG); 'G(s)' G=tf(K*numg,deng); G=zpk(G)
% Display label. % Input desired percent overshoot. % Input desired peak time. % Input desired Kv. % Define numerator of G (s) . % Define denominator of G (s) . % Create G (s) without K. % Create transfer function,'s' . % Create sG(s) . % Cancel common factors . % Solve for K. % Display label. % Put K into G(s) . % Convert G (s) to factored form and % display. z=(-log(pos/100))/(sqrt(pi "2 + log(pos/100)A 2) ) ; % Calculate required damping ratio. Pmreq=atan(2*z/ (sqrt (-2*zA2 + sqrt(l+4*zA4))) )*(180/pi); % Calculate required phase margin. % Calculate required natural wn=pi/(Tp*sqrt(l-zA2)); % frequency. wBW=wn*sqrt ( (l-2*zA2)+sqrt(4*zA4-4*zA2+2) ) ; % Determine required bandwidth. % Choose new phase-margin wpm=0.8*wBW; % frequency. % Get Bode data. [M, P]=bode (G,wpm) ; % Find phase contribution required Pmreqc=Pmreq-(180+P)+5; % from lead compensator % with additional 5 degrees . beta=(1-sin(Pmreqc*pi/180) ) I(1+sin(Pmreqc*pi/180));
B.2 MATLAB Examples % Find beta. % Design lag compensator zero, pole, % and gain. zclag=wpm/10; % Calculate zero of lag compensator. % Calculate pole of lag compensator. pclag=zclag*beta; % Calculate gain of lag compensator. Kclag=beta; % Display label. 'Lag compensator, Glag(s)r Glag=tf (Kclag*[lzclag],[lpclag]) ; % Create lag compensator. % Convert Glag (s) to factored form Glag=zpk(Glag) % and display. % Design lead compensator zero, %pole, and gain. % Calculate zero of lead zclead=wpm*sqrt(beta) ; % compensator. % Calculate pole of lead pclead=zclead/beta; % compensator. % Calculate gain of lead Kclead=l/beta; % compensator. % Display label. 'Lead compensator' Glead=tf (Kclead*[l zclead],[l pclead]) ; % Create lead compensator. Glead=zpk(Glead) % Convert Glead(s) to factored form % and display. % Display label. 'Lag-Lead Compensated Ge (s) % Create compensated system, Ge=G*Glag*Glead %Ge(s)=G(s) Glag(s) Glead(s) . % Create sGe (s) . sGe=s*Ge; sGe=minreal(sGe); % Cancel common factors . Kv=dcgain(sGe) % Calculate Kv T=feedback(Ge, 1) ; % FindT(s) . step(T) % Generate closed-loop, lag-lead% compensated step response. title ('Lag-Lead-Compensated Step Response') % Add title to lag-lead% compensated % step response. pause
Chapter 12: Design via State Space ch12p1 (Example 12.1) We can use MATLAB to design controller gains using pole placement. You will enter the desired percent overshoot and settling time. We introduce the following commands: [num, den]=ord2 (wn, z), which produces a second-order system, given the natural frequency (wn) and the damping ratio (z). Then we use the denominator (den) to specify the dominant poles; and K=acker (A, B, - p o l e s ) , which calculates controller gains from the system matrix (A), the input matrix (B), the desired poles ( p o l e s ) . Let us look at Example 12.1 in the text. ' (chl2pl) Example 1 2 . 1 ' elf numg=20*[l 5]; deng=poly ([0 -1 -4]) ; 'Uncompensated G (s)' G=tf(numg,deng)
% Display label. % Clear graph on screen. % Define numerator of G (s) . % Define denominator of G (s! % Display label. % Create and display G (s) .
823
Appendix B: M A T L A B Tutorial pos=input ('Type desired %0S ') ; % Input desired percent overshoot. Ts=input ('Type desired settling time ') ; % Input desired settling time. z=(-log(pos/100)) I(sqrt(pi"2+log(pos/100)*2) J; % Calculate required damping ratio. wn=4 / (z *Ts) ; % Calculate required natural % frequency. % Produce a second-order system [num,den]=ord2 (wn, z) ; % that meets the transient response % requirements . r=roots (den) ; % Use denominator to specify % dominant poles . poles=[r(l) r(2) -5.1]; % Specifypole placement for all % poles . characteristiceqdesired=poly(poles) % Form desired characteristic % polynomial for display. % Find controller canonical form [Ac Be Cc Dc]=tf2ss (numg, deng) ; % of state-space representation % of G(s) . % Transformation matrix for P=[0 0 1;0 1 0/1 0 0]; % controller canonical to phase% variable form. Ap=inv(P)*Ac*P; % Transform Ac to phase-variable % form. % Transform Be to phase-variable Bp=inv (P) *Bc/ % form. Cp=Cc*P; % Transform Cc to phase-variable % form. Dp=Dc; % Transform Dc to phase-variable % form. % Calculate controller gains in Kp=acker (Ap,Bp, poles) % phase-variable form. Apnew=Ap-Bp*Kp; % Form compensated A matrix. Bpnew=Bp/ % Form compensated B matrix. Cpnew=Cp/ % Form compensated C matrix. Dpnew=Dp/ % Form compensated D matrix. [numt, dent]=ss2tf (Apnew, Bpnew, Cpnew, Dpnew) / % Form T (s) numerator and % denominator. 'T(s)' % Display label. % Create and display T (s) . T=tf (numt, dent) % Display poles of T (s) . poles=roots (dent) Tss=ss (Apnew, Bpnew, Cpnew, Dpnew) % Create and display Tss, an LTI % state-space object. % Produce compensated step step (Tss) % response. title ('Compensated Step Response') % Add title to compensated step % response. pause
ch12p2 (Example 12.2) We can test controllability by using the MATLAB command Cm=c t rb (A, B) to find the controllability matrix given the system matrix
B.2 MATLAB Examples (A) and the input matrix (B). This command is followed by r a n k (Cm) to test the rank of the controllability matrix (Cm). Let us apply the commands to Example 12.2. ' ( c h l 2 p 2 ) Example 1 2 . 2 ' A=[~l 1 0 ; 0 - 1 0 ; 0 0 - 2 ] B=[0/1;1] Cm=ctrb(A,B) Rank=rank(Cm)
% Display label. % Define compensated A matrix. % Define compensatedBmatrix. % Calculate controllability % matrix. % Find rank of controllability % matrix .
pause ch12p3 (Example 12.4) If we design controller gains using MATLAB, we do not have to convert to phase-variable form. MATLAB will give us the controller gains for any state-space representation we input. Let us look at Example 12.4 in the text. % Display label. • (chl2p3) Example 12.4' % Clear graph on screen . elf A=[-5 1 0;0 -2 1;0 0 -1]; % Define system matrix A. B=[0;0;1]; % Define input matrix B. % Define output matrix C. C=[-l 1 0]; % Define matrix D. D=0; % Input desired percent overshoot. pos=input ('Type desired %OS ' ) ; Ts=input ('Type desired settling time ') % Input desired settling time. z=(-log(pos/100))/(sqrt(pi"2+log(pos/100)A2) ) ; % Calculate required damping ratio. % Calculate required natural wn=4/(z*Ts); % frequency. % Produce a second-order system [num, den]=ord2 (wn, z) ; % that meets the transient % requirements . r=roots(den); % Use denominator to specify % dominant poles . poles=[r(l) r(2) -4]; % Specify pole placement for all % poles . % Calculate controller gains. K=acker(A,B,poles) % Form compensated A matrix. Anew=A-B*K; % Form compensated B matrix. Bnew=B; % Form compensated C matrix. Cnew=C; % Form compensated D matrix. Dnew=D; % FormLTI state-space object. Tss=ss(Anew,Bnew,Cnew,Dnew); % Display label. 'T(s)' % Create T (s) . T=tf(Tss); % Cancel common terms and display T=minreal (T) %T(s) . % Display poles of T (s) . poles=pole (T) % Produce compensated step step(Tss) % response . title ('Compensated Step Response' % Add title to compensated step % response. pause
825
826
Appendix B: MATLAB Tutorial ch12p4 (Example 12.5) We can design observer gains by using the command l = a c k e r (A' , C , p o l e s ) ' . Notice we use the transpose of the system matrix (A) and output matrix (C) along with the desired poles ( p o l e s ) . Let us look at Example 12.5 in the text. • (chl2p4) Example 12.5* numg=[l 4]; deng=poly([-l -2 -5]) ; 'G(s)»
G=tf(numg,deng) [Ac,Bc,Cc,Dc]=tf2ss (numg,deng) ; Ao=Ac' ; Bo=Cc*; Co=Bc'; Do=Dc; r = r o o t s ( [ l 2 5]) poles=10*[r' 1 0 * r e a l ( r ( l ) )] lp=acker (Ao', C o ' , p o l e s ) '
Display l a b e l . ; Define numerator of G (s) . ; Define denominator of G (s) . Display l a b e l . Create and d i s p l a y G (s) . ; Transform G (s) t o c o n t r o l l e r ; canonical form i n s t a t e space. TransformAc t o observer canonical form. Transform Be t o observer canonical form. Transform Cc t o observer canonical form. Transform Dc t o observer c a n o n i c a l form. Find t h e c o n t r o l l e r - c o m p e n s a t e d system p o l e s . Make observer p o l e s lOx b i g g e r . Find t h e observer g a i n s i n observer canonical form.
pause ch12p5 (Example 12.6) We can test observability using the MATLAB command Om=obsv(A,C) to find the observability matrix given the system matrix (A) and the output matrix (C). This command is followed by rank (Om) to test the rank of the observabihty m a t r i x (Om). Let us apply the commands to Example 12.6. '(chl2p5) Example 12.6' A=[0 10,-0 0 1,-4 - 3 - 2 ] C=[0 5 1] Om=obsv(A,C) Rank=rank(Om)
% Display l a b e l . % Define compensated A m a t r i x . % Define compensatedCmatrix. % Form o b s e r v a b i l i t y m a t r i x . % Find rank of o b s e r v a b i l i t y % matrix.
pause ch12p6 (Example 12.8) We can design observer gains using the command l=acker(A' , C , p o l e s ) ' without transforming to observer canonical form. Let us look at Example 12.8 in the text. ' (chl2p6) Example 1 2 . 8 ' A=[-5 1 0;0 -2 1;0 0 - 1 ] ; B=[0;0;1]; C=[l 0 0]; D=0; poles=roots ([1 120 2500 50000]; l=acker (A', C', poles)' pause
% Display label. % Define system matrix A. % Define input matrix B. % Define output matrix C. % Define matrix D. % Specify pole placement for all % poles . % Calculate observer gains .
B.2 MATLAB Examples
Chapter 13: Digital Control Systems ch13p1 (Example 13.4) We can convert Gi(s) in cascade with a zero-order hold (z.o.h.) to G(z) using MATLAB's G=c2d (Gl, T,' zoh' ) command, where Gl is an LTI continuous-system object and G is an LTI sampled-system object. T is the sampling interval and ' zoh' is a method of transformation that assumes G±{s) in cascade with a z.o.h. We simply put Gi{s) into the command (the z.o.h. is automatically taken care of) and the command returns G(z). Let us apply the concept to Example 13.4. You will enter T through the keyboard. r
( c h l 3 p l ) Example 1 3 . 4 ' T = i n p u t ('Type T ' ) ; numgls=[l 2]; d e n g l s = [ l 1]; 'Gl(s)' Gl=tf(numgls,dengls) 'G(z)' G=c2d(Gl,T,*zoh')
% Display l a b e l . % Input sampling i n t e r v a l . % D e f i n e n u m e r a t o r of Gl (s) . % D e f i n e d e n o m i n a t o r of Gl (s) . % Display l a b e l . % C r e a t e G l ( s ) and d i s p l a y . % Display l a b e l . % C o n v e r t Gl (s) i n c a s c a d e w i t h % z . o . h . t o G (z) and d i s p l a y .
pause
ch13p2 We also can use MATLAB to convert G(s) to G(z) when G(s) is not in cascade with a z.o.h. The command H=c2d (F, T,' zoh') transforms F(s) in cascade with a z.o.h. to #(z), where i/(z) = ({z - I)/z)*z{F(s)/s}. If weletF(.y) = sG(s), the. command solves for H(z), where H(z) = ((z - l)/z)*z{G(s)}. Hence, z{G(s)} = (z/[z - l])*H(z). In summary, input F(s) = sG{s), and multiply the result of H=c2d (F, T,' zoh' ) by (z/[z - 1]). This process is equivalent to finding the ztransform. We convert G(s) = (s + 3)/(52 + 6s +13) into G(z). You will enter T, the sampling interval, through the keyboard. T is used to form H{z). We use an unspecified sampling interval, T=[ ], to form z/(z - 1). '(chl3p2)' T = i n p u t ('Type T ' ) ; numgs=[l 3]; d e n g s = [ l 6 13]; 'G(s)' Gs=tf(numgs,dengs) Fs=Gs*tf ([1 0],1) Fs=minreal(Fs)/ Hz=c2d(Fs,T,'zoh') ; Gz=Hz*tf ([1 0],[1-1],[]) 'G(z)' Gz=minreal(Gz) pause
% Display label. % Input sampling interval. % Define numerator of G (s) . % Define denominator of G (s) . % Display label. % Create and display G (s) . % Create F(s)=sG(s) . % Cancel common poles and zeros . % Convert F(s) toH(z) assuming % z.o.h. %FormG(z)=H(z)*z/(z-l) . % Display label. % Cancel common poles and zeros .
ch13p3 Creating Digital Transfer Functions Directly Vector Method, Polynomial Form
A digital transfer function can be expressed as a numerator polynomial divided by a denominator polynomial, that is, F(z) = N{z)/D(z). The numerator, N(z), is represented by a vector, numf, that contains the coefficients of N(z). Similarly, the denominator, D(z), is represented by a vector, denf, that contains the coefficients of D(z). We form F(z) with the command, F=tf (numf, denf, T), where T is the sampling interval. F is called a linear time-invariant (LTI) object. This object, or
827
Appendix B: MATLAB Tutorial transfer function, can be used as an entity in other operations, such as addition or multiplication. We demonstrate with F{z) = I50{z2 + 2Z + 7)/(z 2 - 0.3z + 0.02). We use an unspecified sampling interval, T=[ ] . Notice after executing the t f command, MATLAB prints the transfer function. Vector Method, Factored Form
We also can create digital LTI transfer functions if the numerator and denominator are expressed in factored form. We do this by using vectors containing the roots of the numerator and denominator. Thus, G(s) = K*N(z)/D(z) can be expressed as an LTI object using the command, G=zpk (numg,deng, K,T), where numg is a vector containing the roots of N(z), deng is a vector containing the roots of D(z), K is the gain, and T is the sampling interval. The expression zpk stands for zeros (roots of the numerator), poles (roots of the denominator), and gain, K. We demonstrate with G(z) = 20(z + 2)(z + 4)/{(z - 0.5)(z - 0.7)(z - 0.8)] and an unspecified sampling interval. Notice after executing the zpk command, MATLAB prints the transfer function. Rational Expression in z Method, Polynomial Form (Requires Control System Toolbox 8.4)
This method allows you to type the transfer function as you normally would write it. The statement z=t f (' z' ) must precede the transfer function if you wish to create a digital LTI transfer function in polynomial form equivalent to using G=tf (numg, deng,T). Rational Expression in z Method, Factored Form (Requires Control System Toolbox 8.4)
This method allows you to type the transfer function as you normally would write it. The statement z=zpk('z' ) must precede the transfer function if you wish to create a digital LTI transfer function in factored form equivalent to using G=zpk (numg, —deng,K, T). For both rational expression methods the transfer function can be typed in any form regardless of whether z = t f ( ' z ' ) or z=zpk('z') is used. The difference is in the created digital LTI transfer function. We use the same examples above to demonstrate the rational expression in z methods. '(chl3p3)' 'Vector Method, Polynomial Form' numf=150*[l 2 7] denf=[l -0.3 0.02] •F(2)' F=tf (numf,denf,[]) clear 'Vector Method, Factored Form' numg=[~2 -4] deng=[0.5 0.70.8] K=20
% Display label. % Display label. % Store 150 (z~2+2z+7) innumf and % display. % Store (zA2-0.3z + 0.02) in denf and % display. % Display label. %FormF(z) and display. % Clear previous variables from % workspace. % Display label. % Store (s+2) (s+4) in numg and % display. % Store (s-0.5) (s-0.7) (s-0.8) in % deng and display. % Define K.
B.2 M A T L A B Examples 'G(z)' G=zpk (numg, deng,K,[ ]) clear
% Display label. %FormG(z) and display, % Clear previous variables from % workspace . 'Rational Expression Method, Polynomial Form' % Display label. z=tf ('z') % Define z as an LTI object in % polynomial form. F=150*(zA2+2*z+7)/(zA2-0.3*z+0.02) % Form F (z) as an LTI transfer % function in polynomial form. G=20*(z+2)*(z+4)/[(z-0.5)*(z-0.7)*(z-0.8)] % Form G (z) a s an LTI t r a n s f e r % f u n c t i o n i n p o l y n o m i a l form. clear % C l e a r p r e v i o u s v a r i a b l e s from % workspace. ' R a t i o n a l E x p r e s s i o n Method, F a c t o r e d Form' % Display l a b e l . z=zpk (' z') % D e f i n e z a s an LTI o b j e c t i n % f a c t o r e d form. F=150*(z A 2+2*z+7) / ( z A 2 - 0 . 3 * z + 0 . 0 2 ) % F o r m F ( z ) a s an LTI t r a n s f e r % f u n c t i o n i n f a c t o r e d form. G=20*(z+2)*(z + 4) /[ ( z - 0 . 5 ) * ( z - 0 . 7 ) * ( z - 0 . 8 ) ] % Form G(z) a s an LTI t r a n s f e r % f u n c t i o n i n f a c t o r e d form. pause
ch13p4 We also can use MATLAB to convert G(z) to G(s) when G(s) is not in cascade with a z.o.h. First, we create a sampled LTI transfer function, as discussed in ch!3p3. The command F=d2c (H, f zoh') transforms H(z) to F(s) in cascade with a z.o.h., where H(z) — {{z — l)/z)z{F{s)fs}. If we consider F(s) = sG(s), the command solves for sG(s) given H(z). Finally, sG(s)/s = G(s) yields the final result. In summary, form H(z), where H(z) = ((z - l)/z)G{z). Use F=d2c (H,'zoh f ) to find F(s) = sG{s). Divide the result by s and obtain G(s). We convert G{z) = z/(z — 0.3) into G(s). You will enter T, the sampling interval, through the keyboard. '(chl3p4)' T = i n p u t ('Type T ' ) ; numgz=[l 0]; dengz=[l - • 3]; 'G(z)'
G z = t f ( n u m g z , d e n g z , T) Hz=Gz*tf ([1 - 1 ] , [ 1 0],T) / Hz=minreal(Hz); Fs=d2c(Hz,'zoh') ; G s = F s * t f (1,[1 0]) ; 'G(s)' Gs=minreal(Gs) pause
% Display l a b e l . % Input sampling i n t e r v a l . % D e f i n e n u m e r a t o r of G (z) . % D e f i n e d e n o m i n a t o r o f G (z) . % Display l a b e l . % C r e a t e and d i s p l a y G (z) . % C r e a t e H(z) = ( ( z - 1 ) /z)*G (z) . % Cancel common poles and zeros . % Convert fromH(z) to F(s)=sG(s) . % Create G(s)=F(s) (1/s) . % Display label. % Cancel common poles and zeros .
ch13p5 (Example 13.6) We can use MATLAB to find the gain for stability. Let us look at Example 13.6 in the text.
829
830
Appendix B: M A T L A B Tutorial ' (chl3p5) Example 13.6» numgas=27; dengas=[l 27 0]; •Ga(s)' Ga=tf(numgas,dengas). 'G(z)' Gz=c2d(Ga,0.1,'zoh') for K=l:0.1:50; Tz=feedback(K*Gz, 1) ; r=pole(Tz); rm=max(abs(r)); if rm>=l, break; end; end; K r rm pause
Display label. Define numerator of Ga (s) . Define denominator of Ga (s) . Display label. Create and display Ga (s) . Display label. FindG(z) assuming Ga (s) in cascade with z .o.h. and display. Set range of K to look for stability. FindT (z) . Get poles for this value of K. Find pole with maximum absolute value for this value of K. See if pole is outside unit circle. Stop if pole is found outside unit circle. End if. End for. Display K value . Display closed-loop poles for this value of K. Display a b s o l u t e v a l u e of p o l e .
ch13p6 (Example 13.9) We can use MATLAB's command d c g a i n (Gz) to find steady-state errors. The command evaluates the dc gain of Gz, a digital LTI transfer function object, by evaluating Gz at z = 1. We use the dc gain to evaluate, Kp, Kv, and Ka. Let us look at Example 13.9 in the text. You will input T, the sampling interval, through the keyboard to test stability. ' (chl3p6) Example 13 . 9' T=input ('Type T ') ; numgls=[10]; dengls=poly([0 -1]) ; 'Gl(s)' Gls=tf(numgls,dengls) 'G(z)' Gz=c2d(Gls,T,'zoh') 'T(z)' Tz=feedback(Gz, 1) 'Closed-Loop z - P l a n e P o l e s ' r=pole(Tz) M=abs(r) pause Kp=dcgain(Gz) GzKv=Gz*(l/T)*tf ([1-1],[10], T)
GzKv=mineral(GzKv,0.00001) Kv=dcgain(GzKv)
% Display label. % Input sampling interval. % Define numerator of Gl (s) . % Define denominator of Gl (s) . % Display label. % Create and display Gl (s) . % Display label. % Convert Gl (s) and z . o. h . to G (z) % and display. % Display label. % Create and display T (z) . % Display label. % Check stability. % Display magnitude of roots . % Calculate Kp. %MultiplyG(z) by(l/T)*(z-l) . % Also, divide G (z) by z , which % makes transfer function proper % and yields same Kv. % Cancel common poles and zeros . % Calculate Kv.
B.2 MATLAB Examples GzKa=Gz*(l/TA2)*tf ([1-2 1],[100],T) ; % Multiply G (z) by (1/TA2) (z-1) "2. % Also, divide G (z)by zA2 , which % makes the transfer function % proper and yields the same Ka. GzKa=minreal (GzKa, 0 . 00001 ." % Cancel common poles and zeros . Ka=dcgain(GzKa) % Calculate Ka. pause
ch13p7 (Example 13.10) We now use the root locus to find the gain for stability. First, we create a digital LTI transfer-function object for G(z) = N(z)/D(z), with an unspecified sampling interval. The LTI object is created using t f (numgz,dengz,[ ]), where numgz represents N(z), dengz represents D(z), and[ ] indicates an unspecified sampling interval. MATLAB produces a z-plane root locus along with the unit circle superimposed using the command, z g r i d ( [ ] , [ ] ) . We then interactively select the intersection of the root locus and the unit circle. MATLAB responds with the value of gain and the closed-loop poles. Let us look at Example 13.10. ' (chl3p7) Example 13.10' elf numgz=[ll]; dengz=poly ([1 0.5]) ; 'G(z)' Gz=tf (numgz, dengz,[ ]) rlocus(Gz) zgrid ([],[]) title (['z-Plane Root Locus']) [K,p]=rlocfind(Gz)
% Display label. % Clear graph. % Define numerator of G (z) . % Define denominator of G (z) . % Display label. % Create and display G (z) . % Plot root locus . % Add unit circle to root locus . % Add title to root locus . % Allows input of K by selecting % point on graphic .
pause
ch13p8 (Example 13.11) We now use the root locus to find the gain to meet a transient response requirement. After MATLAB produces a z-plane root locus, along with damping ratio curves superimposed using the command z g r i d , we interactively select the desired operating point at a damping ratio of 0.7, thus determining the gain. MATLAB responds with a gain value as well as the step response of the closed-loop sampled system using s t e p (Tz), where Tz is a digital LTI transfer-function object. Let us look at Example 13.11. '(chl3p8) Example 1 3 . 1 1 ' elf numgz=[l 1]; dengz=poly ([1 0.5]); 'G(z)'
Gz=tf (numgz, dengz,[ ]) rlocus(Gz) a x i s ([0,1,-1,1]) zgrid t i t l e ([' z-Plane Root Locus']) [K,p]=rlocfind(Gz) 'T(z)' Tz=feedback(K*Gz,1)
Display label. Clear graph. Define numerator of G (z) . Define denominator of G (z) . Display label. Create and display G (z) . Plot root locus . Create close-up view . Add damping ratio curves to root locus . Add title to root locus . Allows input of K by selecting point on graphic . Display label. FindT(z) .
832
Appendix B: M A T L A B Tutorial step (Tz)
% Find step response of gain% compensated system. title (['Gain Compensated Step Response']) % Add title to step response of % gain-compensated system. pause ch13p9 (Example 13.12) Let us now use MATLAB to design a digital lead compensator. The s-plane design was performed in Example 9.6. Here we convert the design to the z-plane and run a digital simulation of the step response. Conversion of the s-plane lead compensator, G c ( s ) = n u m g c s / d e n g c s , to the z-plane compensator, G c ( z ) = n u m g c z / d e n g c z , is accomplished using the Gcz= c2d (numgcs, d e n g c s , T , ' t u s t i n ' ) command to perform a Tustin transformation, where T=sampling interval, which for this example is 1/300. This exercise solves Example 13.12 using MATLAB.
' (chl3p9) Example 13.12' elf T=0.01 numgcs=1977 *[16]; dengcs=[l 29 .1]; 'Gc(s) in polynomial form' Gcs=tf (numgcs, dengcs)
% Display label. % Clear graph. % Define sampling interval. % Define numerator of Gc (s) . % Define denominator of Gc (s) . % Print label. % Create Gc (s) in polynomial form % and display. 'Gc(s) in polynomial form' % Display label. % Create Gc(s) in factored form Gcszpk=zpk (Gcs) % and display. 'Gc (z) in polynomial form via Tustin Transformation' % Display label. Gcz=c2d(Gcs,T, 'tustin') %FormGc(z) via Tustin % transformation. 'Gc (z) in factored formvia Tustin Transformation' % Display label. Gczzpk=zpk (Gcz) %ShowGc(z) in factored form. % Define numerator of Gp (s) . numgps=l dengps=poly ([0 -6 -10]) ; % Define denominator of Gp (s) . 'Gp(s) in polynomial form' % Display label. Gps=tf (numgps,dengps) % Create Gp(s) in polynomial form % and display. % Display label. 'Gp(s) in factored form' % Create Gp(s) in factored form Gpszpk=zpk (Gps) % and display. % Display label. 'Gp(z) in polynomial form' %FormGp(z) via zoh trans formation. Gpz=c2d (Gps, T,' zoh') % Display label. 'Gp(z) in factored form' %FormGp(z) in factored form. Gpzzpk=zpk (Gpz) Gez=Gcz*Gpz % ForraGe (z) = Gc (z) Gp (z) . *Ge (z) =Gc(z) Gp (z) in factored form' % Display label. Gezzpk=zpk(Gez) %FormGe(z) in factored form % and display. 'z-1' % Display label. % Form z-1. zml=tf ([1-1],1,T) zmlGez=mineral(zml*Gez,0.00001); % Cancel common factors .
B.3 Command Summary ' (z-1) Ge (z) for finding steady-state error' % Display label. zmlGezzpk=zpk(zmlGez) %Form& display(z-1)Ge(z) in % factored form. Kv=(l/T)*dcgain(zmlGez) %FindKv. 'T(z)=Ge(z) / (1+Ge(z) )' % Display label. % Find closed-loop Tz=feedback(Gez,1) % transfer function, T(z) step (Tz, 0:T:2) % Find step reponse. title ('Closed-Loop Digital Lead Compensated Step Response') % Add title to step response .
|
B.3 Command Summary
abs(x)
Obtain absolute value of x.
acker(A,B,poles)
Find gains for pole placement.
angle(x)
Compute the angle of x in radians.
atan(x)
Compute arctan(#).
axis ([xmin,xmax, ymin, ymax])
Define range on axes of a plot.
bode(G,w)
Make a Bode plot of transfer function G(s) over a range of frequencies, co. Field co is optional.
break
Exit loop.
c2d(G,T,'tustin')
Convert G(s) to G(z) using the Tustin transformation. Tis the sampling interval.
c2d(G,T,'zoh')
Convert G(s) in cascade with a zero-order hold to G(z). Tis the sampling interval.
canon (S, 'modal')
Convert an LTI state-space object, S, to parallel form.
clear
Clear variables from workspace.
elf
Clear current figure.
conv ([a b c d],[e f gh])
Multiply (as2 + bs2 + cs + d) by (es3 + fs2 +gs + h).
ctrb(A,B)
Find controllability matrix.
d2c(G/'zoh')
Convert G(z) to G(s) in cascade with a zero-order hold.
degain(G)
Find dc gain for G(s) (that is, s = 0), or G(z) (that is, z = 1).
eig(A)
Find eigenvalues of matrix A.
end
End the loop.
exp(a)
Obtain ea.
feedback(G,H,sign)
Find T(s) = G(s)/[1 ± G(s)H(s)}. Sign = - 1 or is optional for negative feedback systems. Sign = + 1 for positive feedback systems.
grid on
Put grid lines on a graph.
hold off
Turn off graph hold; start new graph.
imag(P)
Form a matrix of the imaginary parts of the components of matrix P.
input ('str')
Permit variable values to be entered from the keyboard with prompt s t r .
interpl (x,y,xl]
Perform table lookup by finding the value of y at the value of x = x\.
inv(P)
Find the inverse of matrix P.
length(P)
Obtain dimension of vector P.
log(x)
Compute natural log of x.
833
834
Appendix B: MATLAB Tutorial
loglO(x)
Compute log to the base 10 of x.
margin
Find gain and phase margins, and gain and phase margin frequencies of transfer function, G{s). Return [Gain margin, Phase margin, 180° frequency, 0 dB frequency].
max(P) minreal(G,tol)
Find the maximum component of P. Cancel common factors from transfer function G(s) within tolerance, tol. If' t o l ' field is blank, a default value is used.
ngrid
Superimpose grid over a Nichols plot.
nichols(G,w)
Make a Nichols plot of transfer function G(s) over a range of frequencies, co.
nyquist(G,w)
Make a Nyquist diagram of transfer function G(s) over a range of frequencies, co.
Field co is optional. Field co is optional. obsv(A.C)
Find observability matrix.
ord2(wn,z)
Create a second-order system, G(s) = l/[s 2 + 2£cons + col).
pade(T,n)
Obtain nth order Pade approximation for delay, T.
pause
Pause program until any key is pressed.
plot (tl,yl,t2,y2,t3,y3;
Plot y\ versus t\,yl
versus <2, and y3 versus r3 on the same graph.
pole(G)
Find poles of LTI transfer function object, G(s).
poly ([-a -b -c])
Form polynomial (s + a)(s + b)(s + c).
polyval(P,a)
Find polynomial P(s) evaluated at a, that is, P(a).
rank(A)
Find rank of matrix A.
real(P)
Form a matrix of the real parts of the components of matrix P.
residue(numf,denf)
Find residues of F(s) = numf/denf.
rlocfind(GH)
Allow interactive selection of points on a root locus plot for loop gain, G(s)H(s). Return value for K and all closed-loop poles at that K.
rlocus(GH,K)
Plot root locus for loop gain, G(s)H(s), over a range of gain, K. The K field is optional.
roots(P)
Find roots of polynomial, P.
semilogx(w, PI)
Make a semilog plot of P | versus log10(w).
series(G1,G2)
FmdGi{s)G2(s).
sgrid(z,wn)
Overlay z(f) and wn(o)„) grid lines on a root locus.
sin(x)
Find sin(x).
sqrt(a)
Compute \/a.
ss2tf (A,B,C,D,1)
Convert a state-space representation to a transfer function. Return [num, den].
ss{A,B,C,D)
Create an LTI state-space object, S.
ss (G)
Convert an LTI transfer function object, G(s), to an LTI state-space object.
ssdata(S)
Extract A, B, C, and D matrices from LTI state-space object, 5.
step(Gl,G2, . . Gn,t)
Plot step responses of G\ (s) through Gn(s) on one graph over a range of time, t. Field t is optional as are fields Gi through Gn.
subplot(xyz)
Divide plotting area into an x by y grid with z as the window number for the current plot.
tan(x)
Find tangent of x radians.
text (a,b,'str')
Put s t r on graph at graph coordinates, x = a, y = b. Convert G(s) = numg/deng to state space in controller canonical form. Return [A, B , c , D ] .
tf2ss(numg, deng)
Bibliography tf2zp(numg,deng)
835
Convert G(s) = numg/deng in polynomial form to factored form. Return [ z e r o s , p o l e s , g a i n s ] .
tf(numg,deng,T)
Create an LTI transfer function, G(s) = numg/deng, in polynomial form.
tf (G)
Convert an LTI transfer function, G(s), to polynomial form.
tfdata (G,'v')
Extract numerator and denominator of an LTI transfer function, G(s), and convert values to a vector. Return [num, den].
Tis the sampling interval and should be used only if G is a sampled transfer function.
title ('str')
Put title s t r on graph.
xlabel ('str')
Put label s t r on x axis of graph.
ylabel ('str')
Put label s t r o n y axis of graph.
zgrid
Superimpose z (f) and wn (co,,) grid curves on a z-plane root locus.
zgrid ([],[]) zp2tf ([-a-b]*,[~c-d]', K)
Superimpose the unit circle on a z-plane root locus.
zpk(numg,deng,K,T)
Create an LTI transfer function, G(s) = numg/deng, in factored form.
zpk(G)
Convert an LTI transfer function, G(s), to factored form.
Convert F(s) = K(s + a)(s + b)/(s + c)(s + d) to polynomial form. Return [num, den]. Tis the sampling interval and should be used only if G is a sampled transfer function.
£ Bibliography ) Johnson, H. et al. Unmanned Free-Swimming Submersible (UFFS) System Description. NRL Memorandum Report 4393. Naval Research Laboratory, Washington, D.C., 1980. The MathWorks. Control System Toolbox™ 8 Getting Started Guide. The MathWorks, Natick, MA. 2000-2009. The MathWorks. Control System Toolbox™ 8 User's Guide. The MathWorks, Natick, MA. 2001-2009. The MathWorks. MATLAB Jfc 7 Getting Started Guide. The MathWorks. Natick, MA. 19842009. The MathWorks. MATLAB'® 7 Graphics. The MathWorks. Natick, MA. 1984-2009. The MathWorks. MATLAB® 7 Mathematics. The MathWorks. Natick, MA. 1984-2009. The MathWorks. MATLAB® 7 Programming Fundamentals. The MathWorks. Natick, MA. 1984-2009. The MathWorks. Simulink® 7 Getting Started Guide. The MathWorks. Natick, MA. 19902009. The MathWorks. Simulink!® 7 User's Guide. The MathWorks. Natick, MA. 1990-2009.
Appendix C: MATLAB's Simulink Tutorial
Introduction Readers who are studying MATLAB may want to explore the functionality and convenience of MATLAB's Simulink. Before proceeding, the reader should have studied Appendix B, the MATLAB Tutorial, including Section B.l, which is applicable to this appendix. MATLAB's Simulink Version 7.4 and MATLAB Version 7.9(R2009b) are required in order to use Simulink. The models described in this appendix, which are available at www.wiley.com/ college/nise, were developed on a PC using MATLAB Version 7.9 and Simulink Version 7.4. The code will also run on workstations that support MATLAB. Consult the MATLAB Installation Guide for your platform for minimum system hardware requirements. Simulink is used to simulate systems. It uses a graphical user interface (GUI) for you to interact with blocks that represent subsystems. You can position the blocks, resize the blocks, label the blocks, specify block parameters, and interconnect blocks to form complete systems from which simulations can be run. Simulink has block libraries from which subsystems, sources (that is, function generators), and sinks (that is, scopes) can be copied. Subsystem blocks are available for representing linear, nonlinear, and discrete systems. LTI objects can be generated if the Control System Toolbox is installed. Help is available on the menu bar of the MATLAB Window. Under Help select Product Help. When the help screen is available, choose Simulink under the Contents tab. Help is also available for each block in the block library and is accessed either by right-clicking a block's icon in the Simulink Library Browser and selecting Help for . . . or by double-clicking the block's icon and then clicking the Help button. Finally, screen tips are available for some toolbar buttons. Let your mouse's pointer rest on the button for a few seconds to see the explanation.
Using Simulink The following summarize the steps to take to use Simulink. Section C.3 will present four examples that demonstrate and clarify these steps.
C.l MATUSB 7.9:o (R2009&J Fjle
Edit
Debug
Desktop
rix
v\/i
•QC9U
Using Simulink
B # &\
: Shortcuts g ] How to Add gp Whafs New
I i* »
3imulin)c
•3
MATLAB
•
Toolboxes
>
Simulink
•
1¾¾ Shortcuts Command History Web
1 1 3 Current Folder Workspace
Get Product Trials
Check for Updates IH1 File Exchange 1¾- Editor ^ j Preferences... [ § | Find Files...
0 | Path B
View Start Button Configuration I
<0 Help V Demos
FIGURE C.I MATLAB Window showing how to access Simulink. The Simulink Library Browser button is shown circled.
1. Access Simulink The Simulink Library Browser, from where we begin Simulink, is accessed by typing simulink in the MATLAB Command Window or by clicking on the Simulink Library Browser button on the toolbar, shown circled in Figure C.l. In response, MATLAB displays the Simulink Library Browser shown in Figure C.2(a). We now create an untitled window, Figure C.2(b), by clicking on the Create a new model button (shown circled in Figure C.2(a)) on the toolbar of the Simulink Library Browser. You will build your system in this window. Existing models may be opened by clicking on the Open a model button on the Simulink Library Browser toolbar. This button is immediately to the right of the Create a new model button. Existing models may also be opened by selecting the Current Folder from the Command Window Start menu or the tab on the left side of the Command Window as shown in Figure C.l, selecting your file names, and then dragging them to the MATLAB Command Window. 2. Select blocks Figure C.2(a) shows the Simulink Library Browser from which all blocks can be accessed. The left-hand side of the browser shows major libraries, such as Simulink, as well as underlying block libraries, such as Continuous. The
837
Appendix C
MATLAB's Simulink Tutorial
Libraries
Library: Simulink
[ 3 Simulink |
Continuous
Discontinuities
Discrete
IIS
Logic and Bit Operations
Lookup Tables
+-
Math Operations
Model Verification
Model-Wde Utilities
Ports & Subsystems
Signal Attributes
Signal Routing
Sinks
Sources
User-Defined Functions
Additional Math & Discrete
j-Discontinuities ^Discrete
I
;• Logic and Bit Operations
i
j - Lookup Tables
Most Frequently Used Blocks
Commonly Used Blocks
r-Commonly Used Blocks }-• Continuous
j
| JSearch Results: (none)
|—Math Operations I-Model Verification !•- Model-Wide Utilities ! -Ports & Subsystems j- Signal Attributes r-Signal Routing (-Sinks
t«»? 't-wnt
I-Sources i
j-User-Defined Functions
i
(3 Additional Math & Disc...
*t\
;-1¾ Control System Toolbox a g j Real-Time Workshop B - W Simscape IB-53 Simulink 3D Animation 1 - ¾ Simulink Control Design i ) - S Simulink Extras M
Stateflow
Showing: Simulink
(«)
He
Edit Hew
D | 0 ? H
Simulation Format Tools
% % e !
Q/jp
|UJ0
> <=*> -if i £5 <:
|Nom>al
TJ| g
igj (?)
M
Start simulation
Stop simulation
"'•Qde45
Ready
(/') FIGURE C.2
a. Simulink Library Browser window showing the Create a new model button
encircled b. resulting untitled model window
right-hand side of Figure C2(a) also shows the underlying block libraries. To reveal a block library's underlying blocks, select the block library on the left-hand side or double-click the block library on the right-hand side. As an example, the Continuous library blocks under the Simulink major library are shown exposed in Figure C3(a). Figures C3(b) and C.3(c) show some of the Sources and Sinks library blocks, respectively. Another approach to revealing the Simulink block library is to type open__ system ('simulink.mdl') in the MATLAB Command Window. The window shown in Figure C.4 is the result. Double-clicking any of the libraries in Figure C.4
C.2 Using Simulink
File
Edit
View
G*
*
Help
Enter search term
S«fK
Library Simulink/Continuous
Libraries (it-g| Simulink i H Commonly Used Blocks [ Continuous j j - Discontinuities '•• Discrete j- Logic and Bit Operations !• Lookup Tables j - Math Operations j- Model Verification j -Model-Wide Utilities [Ports & Subsystems :- Signal Attributes i Signal Routing |- Sinks i- Sources
j Search Results: (none)
•
Derivative
>
PID Controller (2DOF)
x-=A**eu y"0x«u
Transport Delay
Most Frequently Used Blocks
Integrator
PID Controller
State-Space
Transfer Fen
Variable Time Delay
Vanable Transport Delay
Zero-Pole
j- User-Defined Functions ffi Additional Math & Disc S Control System Toolbox ffl-S Real-Time Workshop ®~M Simscape ill S | Simulink 3D Animation I" JS Simulink Control Design IB-SI Simulink Extras Stateflow Showing: Simulink/Continuous
(a)
File
mm
Edit a;
View
Help
-B ; Enter search term
Libraries
E*
Library: Simuhnk/Sources
8-18 Simulink i Commonly Used Blocks ! ™ i {-• Continuous f- Discontinuities - Discrete -Logic and Bit Operations I Lookup Tables j j - Math Operations j- Model Verification ! [-Model-Wide Utilities i" Ports & Subsystems | j-Signal Attributes r Signal Routing
i i I
i
h Sinks j- User-Defined Functions B Additional Math & Disc... H Control System Toolbox Jjf Real-Time Workshop S j Simscape S) Simulink 3D Animation WK Simulink Control Design B l Simulink Extras M Stateflow
Search Results, (none) : Most Frequently Used Blocks
Band-Limited
'234
JUl
L
Chirp Signal
Clock
Constant
Counter FreeRunning
Counter Limited
Digital Clock
Enumerated Constant
Iwififcisutt From File
From Workspace
Ground
( 1 >ln1
Pulse Generator
0
Repeating Sequence
H
Random Number
Repeating Sequence Inlerpo..
hh
Repeating Sequence Stair
Signal Generator
[•«•*» Signal Builder
Step
Ramp
E
Sine Wave
Uniform Random Number
Showing: Simulink/Sources
FIGURE C.3 Simulink block libraries: a. Continuous systems b. Sources (figure continues)
839
840
Appendix C
MATL AB 's Simulink Tutorial
FIGURE C.3 (Continued)
c. Sinks
reveals an individual window containing that library's blocks, equivalent to the right-hand side of the Simulink Library Browser as shown in the examples of Figure C.3. 3. Assemble and label subsystems Drag required subsystems (blocks) to your model window from the browser, such as those shown in Figure C.3. Also, you may access the blocks by double-clicking the libraries shown in Figure C.4. You can position, resize, and rename the blocks. To position, drag with the mouse; to resize, click on the subsystem and drag the handles; to rename, click on the existing name, select the existing text, and type the new name. The text can also be repositioned to the top of the block by holding the mouse down and dragging the text. 4. Interconnect subsystems and label signals Position the pointer on the small arrow on the side of a subsystem, press the mouse button, and drag the resulting crosshair pointer to the small arrow of the next subsystem. A line will be drawn between the two subsystems. Blocks may also be interconnected by singleclicking the first block followed by single-clicking the second block while holding down the control key. You can move line segments by positioning the pointer on the line, pressing the mouse button, and dragging the resulting four-arrow pointer. Branches to line segments can be drawn by positioning the pointer where you want to create a line segment, holding down the mouse's right button, and dragging the resulting cross hairs. A new line segment will form. Signals can be labeled by double-clicking the line and typing into the resulting box. Finally, labels can be placed anywhere by double-clicking and typing into the resulting box.
C.3 Examples
841
I . Library: simulink file
Edit View Format Help
fe 3¾ *g Sinks
Sources
Continuous
Bbcksetsft
Toolboxes
L o g i c a n d Bit Operations
Discontinuities
Signal Routing
Lookup Tables
J Commonly Used Blocks
User-Defined Functions
*Ewn Signal Attributes
Misc
y***
II " Math Operations
Discrete
Model Verification
DtffM
Ports & Subsystems
Model-Wide Utilities
Simulink Block Library 7.4 Copyright (<£ 1990-2009 The Math Works, Inc.
Memorial Man & Discrete
5. Choose parameters for the subsystems Double-click a subsystem in your model window and type in the desired parameters. Some explanations are provided in the Block Parameters window. Press the Help button in the Block Parameters window for more details. The parameters can be read later without opening the block. Let your mouse's pointer rest on the block for a few seconds, and a screen tip will appear, identifying the block and listing its parameters. The information displayed in the screen tip first must be selected in the Block Data Tips Options in the model window's View menu. Explore other options by right-clicking on a block. 6. Choose parameters for the simulation Select Configuration parameters . . . under the Simulation menu in your model window to set additional parameters, such as simulation time. Press the Help button in the Configuration parameters window for more details. 7. Start the simulation Make your model window the active window. Double-click the Scope block (typically, the scope is used to view the simulation results) to display the Scope window. Select Start under the Simulation menu in your model window or click on the Start simulation icon on the toolbar of your model window as shown in Figure C2(b). Clicking the Stop simulation icon will stop the simulation before completion. 8. Interact with the plot In the Scope window, using the toolbar buttons, you can zoom in and out, change axes ranges, save axis settings, and print the plot. Rightclicking on the Scope window brings up other choices. 9. Save your model Saving your model, by choosing Save under the File menu, creates a file with an .mdl extension, which is required.
^C.3
Examples
This section will present four examples of the use of Simulink to simulate linear, nonlinear, and digital systems. Examples will show the Simulink block diagrams as well as explain the settings of parameters for the blocks. Finally, the results of the simulations will be shown.
FIGURE C.4 Simulink Block Library window
842
Appendix C
MATLAB's Simulink Tutorial
Example C.I Simulation of Linear Systems Our first example develops a simulation of three linear systems to compare their step responses. In particular, we solve Example 4.8 and reproduce the responses shown in Figure 4.24. Figure C.5 shows a Simulink block diagram formed by following Steps 1 through 5 in Section C.2 as follows:
Ffe
Edit
View
D |G?H
X ^
«3
mi
Normal
1 52+45+24.542 1 volts
Transfer Fen T1
Gain 245.42
1
s+10
s2+4s+24.542
Transfer Fen T2a
Transfer Fen T 2 t
73.626 s+3 Transfer Fen T3a
CI
—•
C2
ti • 1 Mux
1
Scope
1 52+45+24.542
C3
Transfer Fen T3b
Example C.1: Simulation to reproduce Figure 4.24 in Example 4.8
Ready
1100%
bde45
/A
FIGURE C.5 Simulink block diagram for Example C.l Access Simulink; select, assemble, and label subsystems The source is a 1-volt step input, obtained by dragging the Step block from the Simulink Library Browser under Sources to your model window. The first system, T l , consists of two blocks, Gain and Transfer Fen. Gain is obtained by dragging the Gain block from the Simulink Library Browser under Math Operations to your model window. Transfer function, T l , is obtained by dragging the Transfer Fen block from the Simulink Library Browser under Continuous to your model window. Systems T2 and T3 are created similarly. The three output signals, CI, C2, and C3, are multiplexed for display into the single input of a scope. The Mux (multiplexer) is obtained by dragging the Mux block from the Simulink Library Browser under Signal Routing to your model window. The sink is a scope, obtained by dragging the Scope block from the Simulink Library Browser under Sinks to your model window.
C.3 Examples Alternatively, all blocks can be dragged from the Library: simulink window shown in Figure C.4. The Mux can be found under Signal Routing in the Library: simulink window. The labels for the blocks can be changed to those shown in Figure C.5 by following Step 3 in Section C.2. Interconnect subsystems and label signals Follow Step 4 to interconnect the subsystems and label the signals. You must set the mux's parameters before the wiring can be completed. See the next paragraph. Choose parameters for the subsystems Let us now set the parameters of each block using Step 5. The Block Parameters window for each block is accessed by double-clicking the block on your model window. Figure C.6 shows the Block Parameters windows for the 1 volt step input, gain, transfer function 1, and mux. Set the parameters to the required values as shown.
MM&\Mmim^m Sep u 3®02
>i<
Step Output a step. Parameters Step time: 0 Initial value:
Final value:
Sample time: 0 0
Interpret vector parameters as 1-0
0
Enable zero-crossing detection
nn
Cancel
Help
(a) FIGURE C.6 Block parameters windows for a. 1 volt step source; (figure continues)
843
844
Appendix C
M ATLAB's Simulink Tutorial
Function Block Parameters: Gain
Sement-wise gain (y = K.*u) or matrix gain (y = K*u or y = u*K). Main
Attributes
Parameter Attributes
24.542 Multiplication: Sement-wise(K.*u) Sample time (-1 for inherited):
-1
Apply
(*)
Function Block Parameters: Transfer Fc'ft'TT Transfer Fen The numerator coefficient can be a vector or matrix expression. The denominator coefficient must be a vector. The output width equals the number o f rows in the numerator coefficient You should specify the coefficients in descending order of powers ofs. Parameters Numerator coefficients:
Denominator coeffitients:
114 24.542] Absolute tolerance: auto State Name: (e.g.,'position')
(c)
FIGURE C.6 b. gain; c. transfer function 1; (figure continues)
C.3
Examples
845
: Q Function Block Parameters: Mux
Multiplex scalar or vector Parameters o
ion: bar
Apply
id)
FIGURE C.6 [Continued) d. mux The scope requires further explanation. Double-clicking the Scope block in your model window accesses the scope's display, Figure CJ(a). Clicking the Parameters icon on the Scope window toolbar, shown in Figure CI (a), accesses the 'Scope' parameters window as shown in Figure C.7(6). The 'Scope' parameters window contains two tabs, General and Data history, as shown in Figure C.7(b) and (c), respectively.
"SiiiSS*-/ jlSlftUi-dSJiat© J General
Data history
Tip: try right clicking on axes
Axes Number of axes: 1
3] floating scope
Time range: auto Tick labels:
bottom axis only
||
Sampling Decimation
,v 1
OK
Cancel (b)
FIGURE C.7 Windows for the scope: a. Scope; b. 'Scope' parameters, General tab; (figure continues)
Help
Apply
Appendix C
MATLAB's Simulink Tutorial
Ht3^:^MJs^ig Genera!
Data history
Tip: try right clicking on axes
0 Limit data points to last: 5000 Y~max:
Y-min: Q Save data to workspace
Title ('%<SignalLabel>' replaced by signal name):
Variable name: ScopeData Format:
Array Cancel
OK
Apply
(d)
OK
Cancel
Apply
Help
(c) FIGURE C.7 (Continued) c. 'Scope' parameters, Data history tab: d. 'Scope' properties: axis 1
Finally, right-clicking in the plotting area in the Scope window and selecting Axis properties . . . reveals the 'Scope' properties: axis 1 window, Figure CJ(d). We now can set the display parameters, such as amplitude range. Choose parameters for the simulation Follow Step 6 to set simulation parameters. Figure C.8 shows the resulting Configuration Parameters window. Among other parameters, the simulation start and stop times can be set.
Select Data Import^xport OpdmCation 0 Diagnostics j-SampleTme j - Data Validity |- Type Conversion r ConnectivitY -Compatibility '—Model Referencing — Saving •--Hardware Implementation -Model Referencing 3-Simulabon Target h Symbols -Custom Code
Simulation Ome Stoptime: 3 Solve options T v j Solver:
TVpei Max step sire: |«Jto_ Mnstepsne:
Absolute tolerance:
jauto
Into! step she: ;auto
iOde-15 (Dormand-Prince)
$
j Relative tolerance: |"le-3 le-6
Shape preservation: (DsaWe all
:s
fvl Algorithm:
;a
Nunber of consecutive mm steps: Tasking and sample erne options Tadong mode foe periockcsample times:
•
AutomabcaBy hande rate transtbon for data transfer
•
Hgher prtontv value indicates higher task prionty
Zero
Zero-crossing control: ,Use local settings Time
tolerance:
[l0"12fl*eps
.Honadaptrve
Signal threshold: auto
Number of consecutive rem crossngs:
FIGURE C.8 Configuration Parameters window for Solver tab
] [~SreT
C.3 Examples Start the simulation Now run the simulation by following Step 7. Figure C.9 shows the result in the Scope window. Plots are color coded in the order in which they appear at the mux input as follows: yellow, magenta, cyan, red, green, and dark blue. If the mux has more inputs, the colors recycle. Interact with the plot The toolbar of the Scope window shown in Figure C.9 has several buttons that can be used to interact with the plot. Let us summarize the function and operation of each, starting with the left-most button: Button 1 executes a plot print. Button 2 has already been explained and is used to set scope parameters. Button 3 permits zooming into the plot in both the x and v directions. Press the button and drag a rectangle over the portion of the curve you want to expand. Button 4 allows zooming in the x direction only. Drag a horizontal line over the plot covering the extent of x you want to expand. Button 5 allows zooming in the v direction only. Drag a vertical line over the plot covering the range of y you want to expand. Button 6 autoscales axis for use after zooming. Button 7 saves current axis settings. Button 8 restores saved axis settings.
FIGURE C.9 Scope window after Example C. 1 simulation stops
Appendix C
MATLAB's Simulink Tutorial
Button 9 toggles floating scope. It must be turned off to use zooming. See documentation for use of floating scopes. Button 10 toggles lock for current axis selection. Button 11 allows selection of signals to view when using floating scope.
Effect of Amplifier Saturation on Motor's Load Angular Velocity This example, which generated Figure 4.29 in the text, shows the use of Simulink to simulate the effect of saturation nonlinearity on an open-loop system. Figure CIO shows a Simulink block diagram formed by following Steps 1 through 5 in Section C.2 above. Saturation nonlinearity is an additional block that we have not used before. Saturation is obtained by dragging to your model window the Saturation block in the Simulink Library Browser window under Discontinuities as shown in Figure C.ll(fl) and setting its parameters to those shown in Figure Cll(b). Now run the simulation by making your model window active and selecting Start under the Simulation menu of your model window or clicking on the Start simulation button on your model window toolbar. Figure C.12 shows the result in the Scope window.
FIGURE C.10 Simulink block diagram for Example C.2
C.3
File
Edit
Examples
View
0 G* *
: Enter search term
Lbraries
Hn
Library: Simulink/Discontinuities Backlash
-Commonly Used Blocks -Continuous
» 1/ XI
j - Discrete
i Search Results: (none) j
m
> S j Simulink
Dead Zone Dynamic
r Logic and Bit Operations
Most
Coulomb & V i scous Friction
'7 I.
Dead Zone
Hit Crossing
H
Quantizer
Rate Limiter Dynamic
r Lookup Tables
Relay
:- Math Operations r Model Verification
) y t- i
Saturation Dynamic
Saturation
'-Model-Wide Utilities
>J2L
Wrap To Zero
j - Ports & Subsystems [-•Signal Attributes ;-Signal Routing | Sinks j - Sources r User-Defined Functions IB Additional Math & D i s c . H
Control System Toolbox
H
Real-Time Workshop
H
Simscape
£ j Simulink 3D Animation H
Simulink Control Design
H
Simulink Extras
H
Stateflow
(a)
L J Function Block Parameters: Saturation ±5 volts
Main
Signal Attributes
Upper limit:
Lower limi -5 0
Treat as gain when linearizing
0
Enable zero-crossing detection
Sample time (-1 for riherited); -1
(b) FIGURE C.11
a. Simulink library for nonlinearities; b. parameter settings for saturation
849
850
Appendix C
MATLAB's Simulink Tutorial
FIGURE C.12 Scope window after simulation of Example C.2 stops. The lower curve is the output with saturation
Simulating Feedback Systems Simulink can be used for the simulation of feedback systems. Figure C. 13(a) is an example of a feedback system with saturation. In this example, we have added a feedback path (see Step 4 in Section C.2) and a summing junction, which is obtained by dragging the Sum block from the Simulink Library Browser, contained in the Math Operations library, to your model window. The Function Block Parameters: Sum window, Figure C.13(£>), shows the parameter settings for the summer. You can set the shape as well as set the plus and minus inputs. In the list of signs, the "|"symbol signifies a space. We place it at the beginning to start the signs at "nine o'clock," conforming to our standard symbol, rather than at "12 o'clock." The result of the simulation is shown in Figure C.14.
C.3 Examples R
apcex3
-
nx
File Edit View Simulation Format Tools Help
43 =£ ^
D
Ql •
10
"HI
Normal
-•100 s+1.71 Gain
Step 10 volts
Saturation ±5 volts
Motof, load, Sgeais
Example C.3: Simulation of a feedbadt system with a nonlinearity
(a)
Function Block Parameters: Sum Add or subtract inputs, Specify one 1 a) string containing + or - for each input port, | for spacer between ports (e.g. + + H b} scalar, >= 1, specifies the number o f input ports to be summed, When there is only one input port, add or subtract elements over i specified dimension
Main
or one
Signal Attributes
Icon shape: round
v>
List of signs:
Sample time (-1 for inherited):
-1
(b)
FIGURE C.13 a. Simulation block diagram for a feedback system with saturation; b. block parameter window for the summer
851
852
Appendix C
MATLAB's Simulink Tutorial
FIGURE C.14 Simulation output for Example C.3
This example demonstrates two methods of generating digital systems via Simulink for the purpose of simulation, as shown in Figure C.15. The first approach uses a linear transfer function cascaded with a Zero-Order Hold block obtained from the Simulink Library Browser under the Discrete block library, shown on the right-hand side of Figure C.16. The second method uses a discrete transfer function also obtained from the Simulink Library Browser under the Discrete block library. The remainder of the block diagram was obtained by methods previously described.
C.3 f
"" ">
. q x
\T., apcex4_6 1 Fife Edit
View
Examples
Simulation Farmat l o o k
Help
|D|G*H#|&%©|<=»={>iM:QC:|^
• f"
I [ Normal
H
Sum1
wf^
V i i
Step
J1-
s+2
Z€ aro-Order
Transfer Fen
s+1
Hold
»
Scope
Su m2 2-0.214
.n V
z-0.607
L
Discrete Transfer Fen
Example C.4: Simulation of digital systems
IReady
bde4
100%
FIGURE C.15
Simulink block diagram for simulating digital systems two ways
? aimtehjda-^IBa^T File 0
Edit
View
Q & -e
/A
—
1
JLQ
Help
:[Enter search term
Libraries
M f |
[jf
Library: Simulink/Discrete
Search Results: (none) II Most Frequently Used Blocks j
L| H Simulink
- Ports & Subsystems Signal Artnbutes ^ Signal Routing -Sinks Sources j - User-Defined Functions ] i Additional Math & Disc... j - f i j Control System Toolbox f S I Real-Time Workshop & M Simscape E ] 5 j Simulink 3D Animation Simulink Control Design Simulink Extras Staleflow
Discrete Derivative
Differ ence
I- Commonly Used Blocks I Continuous j - Discontinuities - Discrete Logic and Bit Operations -Lookup Tables - Math Operations Model Verification - Model-Wide Utilities
Discrete FIR Filter
ito.sr 1
Discrete PID Controller Discrete StateSpace
ran
Discrete PtD Controller (2D...
>
Discrete ZeroPole
0 05z z-0 95
s
Memory
JoclayJ.
Transfer Fen First Order Transfer Fen Real Zero
JK.
1
First-Order Hold
1 ±23 I
0
Discrete Filter
Zero-Order Hold
Showing: Simulink/Discrete
FIGURE C.16 Simulink library of discrete blocks
1-0.75 z-0.95
Discrete Transfer Fen Discrete-Time Integrator Integer Delay
Tapped Delay Transfer Fen Lead or Lag Unit Delay
853
Appendix C
854
MATLAB's Simulink Tutorial
Zero-Order Hold Zero-order hold. Parameters Sample time (-1 for inherited]: 0.5
OK
Lanee I
Help
Apply
(a)
Discrete Transfer Fen Implement a z-transform transfer function. Spedfy the numerator and denominator coeffidents in descending powers of z. The order of the denominator must be greater than or equal to the order of the numerator. The numerator coeffidents must either be a scalar bO or a vector |b0 b 1 b2...]. The denominator coeffidents must either be a scalar aO or a vector [aO a t a2...]. Main
Data Types | State Attributes
Numerator coeffidents:
[1 -0.214]
Denominator coeffidents:
[1 -0.607]
Initial states: Sample time {-1 for inherited):
0.5
LJ" Optimize by skipping divide by leading denominator coeffident (aO)
00 FIGURE C.I 7 Function Block parameter windows for: a. Zero-Order Hold block; b. Discrete Transfer Fen block
The block parameters for the Zero-Order Hold and Discrete Transfer Fen blocks are set as shown in Figures C. 17(A) and (6), respectively. Select Configuration parameters . . . under the Simulation menu in your model window and set the simulation stop time to 4 seconds, the type to fixedstep, and the solver to ode4 (Runge-Kutta). The result of the simulation is shown in Figure C.18.
Summary
FIGURE C18
Outputs of the digital systems
{^Summary J | This appendix explained Simulink, its advantages, and how to use it. Examples were taken from Chapters 4. 5, and 13 and demonstrated the use of Simulink for simulating linear, nonlinear, and digital systems. The objective of this appendix was to familiarize you with the subject and get you started using Simulink. There are many blocks, parameters, and preferences that could not be covered in this short appendix. You are encouraged to explore and expand your use of Simulinkby using the on-screen help that was explained earlier. The references in the Bibliography of this appendix also provide an opportunity to learn more about Simulink.
856
Appendix C
MATLAB'sSinrulink Tutorial
^ Bibliography J) The MathWorks. Control System Toolbox ™ 8 Getting Started Guide. The MathWorks. Natick, MA. 2000-2009. The MathWorks. Control System Toolbox ™ 8 User's Guide. The MathWorks. Natick, MA. 2001-2009. The MathWorks. MATLAB® 7 Getting Started Guide. The MathWorks. Natick, MA. 19842009. The MathWorks. MATLAB® 7 Graphics. The MathWorks. Natick, MA. 1984-2009. The MathWorks. MATLAB® 7 Mathematics. The MathWorks. Natick, MA. 1984-2009. The MathWorks. MATLAB® 7 Programming Fundamentals. The MathWorks. Natick, MA. 1984-2009. The MathWorks. Simulin^ 7 Getting Started Guide. The MathWorks. Natick, MA. 19902009. The MathWorks. Simulink® 7 User's Guide. The MathWorks. Natick, MA. 1990-2009.
Appendix D: LabVIEW™1 Tutorial
^D.1
Introduction
LabVIEW is a programming environment that is presented here as an alternative to MATLAB. Although not necessary, the reader is encouraged to become acquainted with MATLAB before proceeding, since familiarity with MATLAB can enhance the understanding of the relationship between textual (MATLAB) and graphical (LabVIEW) programming languages and extend the functionality of LabVIEW. In this tutorial, we will show how to use LabVIEW to (1) analyze and design control systems, and (2) simulate control systems. This appendix was developed using LabVIEW 2009. LabVIEW is a graphical programming environment that produces virtual instruments (VI's). A VI is a pictorial reproduction of a hardware instrument on your computer screen, such as an oscilloscope or waveform generator. The VI can consist of various controls and indicators, which become inputs and outputs, respectively, to your program. Underlying each control and indicator is an associated block of code that defines its operation. The LabVIEW model thus consists of two windows: (1) Front Panel, which is a replica of the hardware front panel showing the controls and indicators, and (2) Block Diagram, which contains the underlying code for the controls and indicators on the Front Panel. Associated with the Front Panel window is a Controls palette window containing numerous icons representing controls and indicators. The icons can be dragged onto a Front Panel window to create that control or indicator. Simultaneously, the associated code block is formed on the Block Diagram window. Alternately, the block diagram can be formed first, and then the front panel is created from the block diagram. Associated with the Block Diagram window is a Functions palette window containing numerous icons representing a wide range of functions. Icons can be dragged onto a Block Diagram window to create that code block. For example, Figure D.l(a) is the front panel of a signal generator. The generator consists of a control to select the signal type and a waveform graph that shows the output waveform. Figure D.l(b) shows the underlying code, which is contained in the code blocks. Here, the signal type selector is a control, while the waveform graph is an indicator. Later we will show how to make connections to other VI's. The palette windows for the front panel and block diagram are shown respectively in Figures D.l(c) and (d). 1
LabVIEW is a registered trademark, of National Instruments Corporation.
Appendix D
858
LabVIEW Tutorial
i'nillffllfiiit'illllii Edit Vie.v Project Operate S
S
Tools
W Help
[ " 1 [ f ] 1 ¾ P * o W I 3 ^ (^P t ApplicationFort
Waveform Graph
(b)
FIGURE D.1 A LabVIEW function generator VI: a. Front Panel window; b. Block Diagram window; (figure continues)
|
D.2
Control Systems Analysis, Design, and Simulation LabVIEW can be used as an alternative to or in conjunction with MATLAB to analyze, design, simulate, build, and deploy control systems. In addition to LabVIEW, you will need the LabVIEW Control Design and Simulation Module. Finally, as an option that will be explained later, you may want to install the MathScript RT Module. Analysis and design can be thought of as similar to writing MATLAB code, while simulation can be thought of as similar to Simulink. In LabVIEW, analysis and design, as opposed to simulation, are handled from different subpalettes of the Functions window's Control Design and Simulation palette. See Figure D.l(rf). Analysis and design, and simulation will typically begin with the Block Diagram window, where icons representing code blocks will be interconnected. Parameters
D.3
Using LabVIEW
Q» Search | g ^ View j •
Programming
•
Measurement I/O
•
Instrument I/O Vision and Motion Mathematics Signal Processing
•
Modern
•
System
•
Classic
•
Express
;j • • • • •
Data Communication Connectivity •
Con trol Design & Simula bon
•
Express
•
Addons
Control Design & Simulabon .NET & ActiveX Signal Processing Addons User Controls
•
Favorites
•
User Libraries Select a V I . . .
Select a Control...
(c)
FIGURE D.1
(d)
{Continued) c. Controls palette; d. Functions palette
used by the code can be conveniently selected, changed, and passed to the code through VI controls on the Front Panel window created from the code icons. Any results, such as time response, can be displayed through VI indicators on the Front Panel window created from the code icons.
(D.3
Using LabVIEW
The following steps start you on your way to using LabVIEW for control systems analysis, design, and simulation. These steps will be illustrated in the examples that follow. 1. Start LabVIEW LabVIEW starts with the Getting Started window shown in Figure D.2, where you can select a New file or Open an existing file. You may also select various resources. Selecting Blank VI under the New label or New VI under the File menu brings up the Front Panel and Block Diagram windows shown in Figure D.l. If necessary, a window can be opened from the Window tab on the menu bar of the Front Panel and Block Diagram. Right-click the Block Diagram window to bring up the Functions palette and click the thumb tack in the upper left-hand corner to dock the window. Repeat for the Front Panel window to access the Controls palette.
859
Appendix D
LabVIEW Tutorial
> Gettinp, Started
Latest from ni.com
Empty Project
Technical Content
VIfromTemplate,
Open Discussion Forums
Figure D_l.vi Browse...
labVTHV Help list of AS New Features
0 ^ Find Examples...
FIGURE D.2 LabVIEW's Getting Started window
2. Select blocks Make the Block Diagram window active, or access it from Window on the menu bar. Right-click the Block Diagram window or use the View menu to bring up the Functions palette. Expand the palette window by clicking the doubleup arrows at the bottom. At the top of the palette window click View, and select View This Palette As/Category (Icons and Text) to add a text description below each icon. For control systems analysis, design, and simulation, expand Control Design & Simulation in the Functions palette by clicking the arrow to the left of this category. If you are performing a simulation click the subpalette Simulation. If you are performing control system analysis or design, click the subpalette Control Design. An arrow in the upper-right corner of a subpalette indicates additional underlying palettes or blocks. If the name of the icon is incomplete, resting the mouse over the icon will bring up its complete identification. To obtain detailed help about an icon, right-click the icon and select Help. 3. Move blocks to the block diagram window To move the icon to the Block Diagram, left-click the mouse to attach the icon (some icons take a little time to complete this operation). When the pointer turns into a hand, click the spot on the Block Diagram where you want to place the icon. 4. Obtain information about the block You will now want to obtain information about how to interconnect the block to other blocks and pass parameters to the block as well as other characteristics about the block. Select the yellow question mark at the right of the Block Diagram toolbar to turn on the Context Help window. This window will provide help about a particular icon if you rest your
D.3 Using LabVIEW mouse over that icon. Additional help is available under the Help menu on the Block Diagram menu bar. Finally, right-click the icon to bring up a menu with additional choices, such as Properties, if any. In particular, you will use this menu to create the block's front panel's controls and indicators. This front panel will be your interface with the block to choose parameters and see responses. 5. Interconnect and label blocks Once blocks are placed on the Block Diagram they can be moved about by clicking on them or dragging your mouse across several or them to establish a selection pattern. After the selection pattern has been established, depress the mouse left button and drag to a new location. To delete a block, select the block and press the Delete button. The context help for the block includes a description of the block's terminals. Let your mouse rest on a terminal until the mouse pointer turns into a spool of wire. Click the terminal and then move the mouse to the next icon's terminal where you want to make the connection. Click the destination terminal to complete the wiring. Notice that the terminal in the Context Help window blinks when your mouse resides above that terminal on the block, ensuring that you are on the correct terminal. If you make an error in wiring, click on the wire and press the Delete button or right-click the wire and select Delete Wire Branch. Block labels can be displayed or hidden. Right-click on the block to bring up the pop-up menu and check or uncheck Visible Items/Label to display or hide, respectively, the label. Double-clicking on the label above some blocks will allow you to select and change the text. One click of the mouse on the label will place a selection pattern around the label and allow you to hold down the left key of the mouse and move the label to a different location. 6. Create the interface to your block You will now want to create the interface to your block in order to control or select functions, specify parameters, or view responses. This interface will be accessed via the Front Panel window. Right-click a terminal on a block for which you want to create an interface. On the pop-up menu, choose Create/Control to be able to interact with the block or Create/ Indicator to view a response or setting. 7. Set the controls Switch to the Front Panel window and set your controls. For example, enter parameter values, select functions, etc. If you want to change values and at some future time return to the current values, click on Edit on the Block Diagram menu bar and select Make Current Values Default. To return to the default values in the future, click on Edit on the Block Diagram menu bar and select Reinitialize Values to Default. 8. Run the program Click on the arrow at the left of the toolbar on either the Block diagram or Front Panel window to run the program. The program can be run continuously by clicking the curved arrow button on the toolbar second from the left. Continuously running your program permits changing functions and parameter values during execution. In order to identify the buttons, let your mouse rest on a button to bring up a context menu. Stop your simulation by pressing the red-dot button, third from the left. If you are performing control systems analysis and design, another way to continuously run the program is to place a While Loop around your block diagram. The loop is available in the Functions palette at Express/Execution Control/While Loop. This loop also places a Stop button on the Front Panel. The program executes until you press the stop button. In lieu of the Stop button, any true/false Boolean can be wired to the condition block (red dot) created inside the While Loop.
Appendix D
LabVIEW Tutorial
If you are performing simulation, you can use a Simulation Loop available in the Functions palette at Control Design and Simulation/Simulation/Simulation Loop. Place the Simulation Loop around your simulation block diagram by dragging the mouse. Right-click on the Simulation Loop outline and choose Configure Simulation Parameters . . . to determine the parameters for executing the simulation. The Front Panel indicators and controls are also configurable. Right-click on the indicator or control and select Properties.
(
D.4 Analysis and Design Examples In this section, we will present some examples showing the use of LabVIEW for the analysis and design of control systems. In the next section, examples of the use of LabVIEW for simulation will be presented. Analysis and design examples use icons selected from the Control Design subpalette under the Control Design and Simulation palette. In the next section showing examples of simulation, we will use icons taken from the Simulation subpalette under the Control Design and Simulation palette.
Example D.1 Open-Loop Step Response Trylt D.l numg=100; deng=[l 2 100]; 'G(s)' G=tf(numg,deng) step(G); title ('Angular Velocity'
Analysis and design usually begins by selecting icons from the Control Design subpalette and dragging them to the Block Diagram window. The icons represent blocks of code and the cascading of code blocks can be thought of as a sequence of lines of code. Thus, an advantage of LabVIEW over MATLAB is that the programmer does not need to memorize coding language. For example, consider the MATLAB code shown in Trylt D.l that produces the step response of G(s) = 100/(52 + 2s + 100): This step response can be produced in LabVIEW without knowing any coding language. We now demonstrate by following each step of Section D.3: 1. Start LabVIEW Start LabVIEW and select Blank VI from the window shown in Figure D.2. 2. Select blocks From the Functions palette, select the blocks shown in Figure D.30) and (b). 3. Move/blocks to the Block Diagram window Drag your icons one at a time to the Block Diagram window, Figure D.4. 4. Obtain information about the block Right-click each of the blocks and be sure the first two items under Visible Items are checked. Look at the CD Construct Transfer Function Model.vi. A Polymorphic VI Selector is shown at the bottom. Click the selector to bring up the menu. Select SISO. This block effectively creates the transfer function shown in the first four steps of the MATLAB code in Trylt D. 1. Repeat for the CD Draw Transfer Function Equation.vi and select TF from the Polymorphic VI Selector. This block will write the transfer function symbolically in the display. Your selection from the polymorphic vi selector should match the format of the transfer function created by the CD Construct Transfer Function Model.vi.
D.4
Analysis a n d Design E x a m p l e s Functions
Mi
Programming Instrument I/O Vision and Motion
Connectivity Control Design & Simulation
L Control Design L
rime Response
Instrument I/O
Data Communication Connectivity Control Design L Model Construction
|> CD Construct,. CD Construct...
SigManip
• CD Draw Stat.
CDDravyZer... CD Read Mod.
Addons
•
Favorites
•
User Libraries
Select a VI.
CD Write Mod.,. •
Exec Control
fv)
Express
(a) FIGURE D.3
Selecting a. C D Construct . . . and C D D r a w . . . ; b . C D Step R e s p o n s e . . .
Repeat for the CD Step Response.vi. and select TF from the Polymorphic VI Selector. This block will collect the data for the step response and permit plotting the data. This block effectively creates the last two commands of the MATLAB code shown in Try It D.l. 5. Interconnect and label blocks You should now have the Block Diagram window shown in Figure D.4. Interconnect the code blocks. Click on the question mark on the right side of the toolbar to bring up the context menu. As your mouse passes above an icon, its context menu appears, showing the terminals. See Figure D.5. Interconnect the terminals by letting the mouse rest on a terminal until it becomes a spool of wire.
(b)
Ariih&Cpmpar
864
Appendix D
LabVIEW Tutorial
Example 1 .vi Block Diagram '
- O X
CDConstaict Transfer Function Model.vi
CD Step Response.vi " S 3
,
m
S3
^r(
TF "
CD Draw Transfer Function Equation.vi
3?
tm
<J FIGURE 0.4
M Block Diagram window
|Transfer Function Model] CD Construct Transfer Function Model.vi
CD Step Response.vi
Delay error in (no error; Creates a transfer function representation of a system using the Sampling Time (s), Numerator, Denominator, and Delay. This VI also produces a transfer function model which specifies the data in symbolic form. You must manually select the polymorphic instance to
FIGURE D.5 Context Help for CD Construct Transfer Function Model.vi Click on the terminal and then click on the destination terminal. The two terminals will appear as wired together. Continue wiring terminals until you have the Block Diagram window shown in Figure D.6. Mid-wire connections as shown can be made by letting your mouse rest at the connection point until it becomes a spool of wire. 6. Create the interface to your block You will now want to create the interface to specify parameters and view responses. This step will create the interface that will be accessed on the Front Panel window. The interfaces we will create are: • CD Construct Transfer Function Modekvi input parameter controls. Right-click on the numerator terminal shown in Figure D.5 and select Create/Control. Repeat for the denominator.
D.4 Analysis and Design Examples &
Example 1.vi Block Diagram
Fjle
§dit
Vjew
Project
Operate H
Tods W M o t
13pt Application Font
CD Construct Transfer Function Mode), vi
\.\ S t H I ^ H
^
CD Step Response. vi
CD Draw Transfer Function Equation.vi
FIGURE D.6 Interconnected blocks CD Step Response.vi response plot indicator. Right-click on the Step Response Graph terminal and select Create/Indicator. CD Draw Transfer Function Equation.vi symbolic transfer function indicator. Right-click on the Equation terminal and select Create/Indicator. Your Block Diagram should now look similar to Figure D.7(a). As an option, you can create transfer functions using a MathScript block if the MathScript RT Module is installed. This option is generally compatible with MATLAB's M-file code statements for creating your transfer function. Interfaces are then created to pass parameters to and from the M-file code. You should be familiar with MATLAB to use this option. The MathScript block is found in the Programming/Structures/MathScript palette. You create M-file code inside the MathScript block. Input and output interfaces are created and named identically > Example 1.vi Block Diagram Fie B i t Jfiew Project Operate Tools Jg
IJ31 ® j |Sjgj I k i i f f M V1391 App^fo"Font
i -• j flg^ll -00-- j [¢5
Numerator
Step Response Graph CD Construct Transfer Function Model, vi
CD Step Response, vi
(a)
FIGURE D.7 Block Diagram window: a. with Control Design blocks and interfaces; (figure continues)
865
866
Appendix D
LabVIEW Tutorial
FIGURE D.7 (Continued) b. with MathScript block
to those within the M-file code. However, when using MathScript, you must create controls first on the Front Panel, rather than the Block Diagram. For example, to create the numeric interfaces for K, a, and b, right-click the Front Panel to produce the Controls palette. From this palette, produce each numeric control from Modern/Numeric/Numeric Control. The resulting controls are shown in Figure D.8(b). These interfaces are then wired to the appropriate terminals on the Block Diagram. Your Block Diagram should now look similar to Figure D.7(6). On the Block Diagram window menu bar, select Window/Show Front Panel. You will see the Front Panel shown in Figure D.8 created by your interfaces. You can double-click the labels above your interfaces either in the Front Panel window or the Block Diagram window to change the label to be more descriptive of your project. 7. Set the controls Using the Front Panel window, enter polynomial coefficients for the numerator and denominator in ascending order—lowest to highest. The selector to the left of the numerator and denominator shows the power of s for
' •'.
I 3
FIGURE D.8 Front Panel: a. for Block Diagram shown in Figure D.7(a); (figure continues)
s
*
. t
•
m
a
D.4 Analysis and Design Examples
FIGURE D.8 (Continued) b. for Block Diagram shown in Figure DJ(b)
the left-most coefficient. Increasing the counter allows entry of higher-order coefficients not visible originally. To make all coefficients of a polynomial visible, let the mouse move on the right-hand edge of the polynomial indicator until the pointer becomes a double arrow and blue dots appear at the left and right edges of the entire polynomial indicator. You can then drag the right blue dot to expose more cells. Familiarize yourself with the choices on the menu bar as well as those on the pop-up menus created when you right-click on any indicator or control. For example, under the Edit menu, among other choices, you can Make Current Values Default or Reinitialize Values to Default. Right-clicking the indicators or controls brings up a menu from which, among other choices, Properties can be selected to configure the indicator or control as desired. 8. Run the program Figure D.9 shows Example D.l after execution. The figure shows the values entered, the equation, and the step response. Execution was initiated by clicking the arrow at the left of the toolbar.
FIGURE D.9 Front Panel after execution: a. for block diagram in Figure 7(a); (figure continues)
868
Appendix D
LabVIEW Tutorial
** Example 1 with WathScript.vi Front Panel '"
FIGURE D.9
(Continued)
b. for block diagram in Figure 1(b) The program can run continuously by clicking the curved arrows on the toolbar. Now, change values; hit the Enter key and see the results immediately displayed. Stop the program execution by clicking on the red hexagon on the toolbar. Another way of continuously running the program is to place a While Loop around the block diagram as shown in Figure D.lQ(a). The loop is accessed from Functions/Express/Execution Control as shown in Figure D.10(b). After
• ** Example 1 v/ith While I oop.vi Block Diagram f>
&tt
59ew Pjoject Operate Toots ffihdow a *
^]#i • / N f f j B y g ^ i^**>«*•"fa* Hfs^i3£^[^iKiiBQiNumef atof
Step Response Graph CD Construct Transfer Function Model.vi
CD Step Response, vl
Measurement I/O
•
Instrument I/O
•
Vision and Motion
>
Signal Processing
•
Data Communication
•
Connectivity
•
Control Design a SimiJaSon
•
SgnaExpress
•
Express
CD Draw Transfer Function Equation, vi
m <J
Case Structure
TF-|
Time Delay
•
Favorites
•
User Libraries
BapsedTme
SetectaVI...
(b)
FIGURE D.10 a. Block diagram with While Loop; b. Functions palette showing While Loop location
D.4 Analysis and Design Examples
869
selecting the While Loop, drag the cursor across the block diagram to create the continuous loop. A stop button will appear on the block diagram as well as on the Front Panel. At the lower right is a Loop Interation icon, which can be used to control the While Loop. The reader should consult the on-line documentation for further information.
Example D.2 Closed-Loop Step Response In this example, we show how to display the step response of a unity-feedback system. For variety, we represent the open-loop system as a ratio of zeros over poles
II •
Data Communication
I •
Signal Processing
•
Connectivity
•
•
Con trol Design & Simula Bon L Control Design L Model Construction
•
Connectivity
•
Control Design & Simulation
Data Communication
L Control Design L
3 £
TSfi CD Construct... CD Construct
Model Interconnection
3E
3 E
$>
£>
$>
CD Add Mode... CD Subtract... -rfiL. CD Construct.. CD Construct 33E 3E
$>
CD Multiply M... I E
as HjG]
CDDivideMo... CDHorizontal... CD Vertical C...
m. CD Construct.. CD Construct...
w CDDrawTra...
CDDrawZer...
CDDrawStat. 3 E
CD Read Mod..
CD Write Mod... •
SignaExpress
•
Express
| •
Express
•
Addons
•
Favorites
1• • •
Favorites
User Libraries Select a VI.
User Libraries Select a VI...
(b) (a)
FIGURE D.11 a. Obtaining zero-pole-gain transfer function from the Functions palette; b. Obtaining Feedback interconnection from Functions palette
870
Appendix D
LabVIEW Tutorial
with a multiplying gain, analogous to MATLAB's zpk function. In the previous example, we represented the system as a ratio of polynomials, analogous to MATLAB's tf function. 1. Select blocks The zero-pole-gain transfer function is obtained from the Functions palette as shown in Figure D.ll(a). We place this transfer function in the forward path of a unity-feedback system by following its block with a Feedback block obtained from the Functions palette as shown in Figure D.ll(b).
> Closed-Loop Step Response.VJ Block Diagram
fO @l : . r f i l l ^ S M t f l a t I ISptApttationFont 1
I J
I
.1 ..:.
~ '
-~? • - .
-.:
\
1(1111^111- I'
. •
MIIIEHI^* •'
'
I — .
unit,in
.,n
Open -loop Zeros Oosed'tQop Step Response Graph
IS
<1 (a)
FIGURE D.12 a. Block Diagram for Example D.2; b. R-ont Panel for Example D.2
D.4 Analysis and Design Examples
If the Model 2 input to the Feedback block is left unconnected, then a unityfeedback interconnection is assumed. Other options for interconnection, such as parallel and series, are shown on the palette of Figure D.ll(6). Interconnect and label blocks Producing the closed-loop step response is similar to Example D.l, except the step-response blocks are placed at the output of the Feedback block. The equation writer is wired to the system output as in Example D.l. All data types must be compatible and are shown selected with the pull-down menu at the base of the blocks. If you select Automatic in the pull-down menu, LabVIEW will select the correct form for you as you connect the blocks. The final Block Diagram and Front Panel for this example are shown in Figure D.12 (a) and (b), respectively. Notice that you enter open-loop poles, zeros, and gain on the Front Panel in place of polynomial open-loop numerator and denominator coefficients.
Example D.3 Root Locus Analysis and Design We can obtain root locus plots by adding the Root Locus block obtained from the Functions palette as shown in Figure D.13. The Root locus block is connected to the output of the openloop system and a Root Locus Graph indicator is formed at the output of the Root Locus block. The resultant Block Diagram and Front Panel are shown in Figure D.l4(a) and (b) respectively. Figure D.13 shows other characteristic blocks that can be added. For example, closed-loop poles and zeros, as well as damping ratio and natural frequency, can be displayed.
•
Measurement I/O
•
Instrument I/O
•
Vision and Motion
•
Mathematics
•
Data Communication
•
Connectivity
•*" Control Design & Simula Bon L
•
Control Design
Express
•
Addons
•
Favorites
>
User Libraries SelectaVI...
FIGURE D.13 Functions palette showing location of Root Locus block
872
Appendix D
LabVIEW Tutorial
CD'Root locus, vi
Root l o o s &aph U S
Openioop Zoos
£S (a)
(b)
FIGURE D.14 Windows showing root locus analysis: a. Block Diagram; b. Front Panel
D.4 Analysis and Design Examples
Example D.4 Open- and Closed-Loop Sinusoidal Frequency Analysis and Design We can obtain open- and closed-loop sinusoidal frequency response curves by replacing the Root Locus block with the Bode block to yield the open-loop frequency response. A copy of the Bode block can be added at the output of the Feedback block to obtain the closed-loop frequency response. Figure D.15 shows where to obtain the Bode block. Figure D.16 shows the Block Diagram and Front Panel with open- and closedloop Bode analysis. In order to display the plots, the indicators shown at the outputs of the Bode blocks were created. Figure D.15 shows other alternatives for frequency response analysis. For example, in addition to the Bode plots, you can create an indicator telling you the gain and phase margins by using the Gain and Phase Margin block. Figure D.17 shows that result. Finally, if you need to use Nyquist or Nichols charts, the associated blocks are shown in Figure D.15 and can replace the Bode blocks.
¢ ^ Search | g l V r e w ) f p •
Programming
•
Measurement I/O
•
Instalment I/O
•
Vision and Motion
>
Mathematics
•
Signal Processing
•
Data Communication
•
Connectivity
•
Control Design & Simulation L
Control Design .frequency R> FTO
vCD Bode.viy
fe CD Singular V... CD All Margin...
Ho> CD Evaluate... •
SignalExpress
•
Express
•
Favorites
•
User Libraries
CDBandwidt.. CDGetFrequ.
SelectaVI...
FIGURE D.15 Functions window showing frequency response blocks, such as Bode, Nyquist, Nichols, and Gain and Phase Margin blocks
873
874
Appendix D
LabVIEW Tutorial
(a)
[3-
|„
1•
! 1;
i, '
:,. • j !
1, j
-;«-
10* ja>>
S^_l 1
13
»9
(b) FIGURE D.16 Bode analysis via LabVIEW: a. Block Diagram; b. From Panel
DA Analysis and Design Examples [ Bode Analysis andOesign with Additional Analysis.* Block file
Edit
View
Project
Operate
"" I » 1 H W J j M J M & S k j
lools
Window
Help
[20DiADolicaiion F o m l ' l l M f s n i S H l f ^ l Open-Loop Bode Magnitude CD Gain and Phase Marginvi
Open-Loop Bode Phase
Gain and Phase Margins Open-Loop Poles
CD Construe! Zero-Pole-Gain Model-vi
Openkoop Gain Open-Loop Equation
3 («) I Bode Analysis and Desert with Additn«ial AratysKvi from Panel * £i|e
Edil
View
Project
Operate
lools
Itfindow
Help
[¢1¾ ® [ l T | r ^ A o o [ t a t f e | F o r * H j ^ l i ^ - | ; 3 i - ] ! f t ' n
-F
. - .
. in
'
.
YOCufB J A J j
•' 1
4.7893
)
56403
p>nw Mtrgm
FIGURE D.17 Bode analysis with gain and phase margin: a. Block Diagram; b. Front Panel
875
876
(
Appendix D
Lab VIEW Tutorial
D.5 Simulation Examples Whereas the Lab VIEW block sequence for design and analysis is analogous to following the code statement sequence in a MATLAB M-file, the Lab VIEW block sequence for simulation is analogous to following the block sequence of a Simulink diagram. In this section, we show examples of simulation using LabVIEW For control system simulation, icons for the block diagram are taken from the Simulation subpalette under the Control Design and Simulation palette. Our examples will parallel the examples shown in Appendix C which uses Simulink.
Simulation of Linear Systems Create Block Diagram and Front Panel Figure D.18 shows the Block Diagram and Front Panel for simulating a linear system. The simulation reproduces Example C.l in Appendix C, which uses Simulink. Blocks are selected from the Simulation subpalette under the Control Design and Simulation palette and must be placed within the Simulation Loop obtained from Functions/Control Design and Simulation/Simulation/Simulation Loop. We now enumerate the detailed steps required to create the Block Diagram and Front Panel: 1. Transfer functions are obtained from Functions/Control Design and Simulation/ Simulation/Continuous Linear Systems/Transfer Function. Right-click on each transfer function and select Configuration to enter the parameter values shown in Figure D.18(#) or equivalently in Figure C.5 2. The gain block is obtained from Functions/Control Design and Simulation/ Simulation/Signal Arithmetic/Gain. Right-click on the gain block and select Configuration to enter the parameter value.
(a) FIGURE D.18
Simulation of linear systems: a. Block Diagram; (figure continues)
D.5 Simulation Examples
E)
i ""
""•'.. '
"~~"
" 1 S3
(ft)
FIGURE D.18 (Continued) b. Front Panel
3. The step-input block is obtained from Functions/Control Design and Simulation/Simulation/Signal Generation/Step Signal. Right-click on the gain block and select Configuration to enter the parameter value. 4. In order to display the three step-response curves simultaneously, we use a Build Array block obtained from Functions/Programming/Array/Build Array. Drag the bottom of the icon to expose the correct number of inputs three for this case). 5. To create the display, we use the Simulation Time Waveform block obtained from Functions/Control Design and Simulation/Simulation/Graph Utilities/ Simtime Waveform. Right-click the output of the Simtime Waveform block and select Create/Indicator to produce the Waveform Chart icon and the Front Panel display. Configure simulation loop Finally, set the simulation parameters by right-clicking the Simulation Loop and selecting Configure Simulation Parameters . . . Set the parameters as shown in Figure D.19. Configure graph parameters On the Front Panel, right-click the graph and select Properties to configure graph parameters if required. Select the legend and expand it vertically to expose all three plot identities. The titles in the legend can be changed to reflect meaningful labels for the plots. Run the simulation Perform the simulation by clicking the arrow at the extreme left of the toolbar on the Front Panel window. You can erase curves between trials by right-clicking the display and selecting Data Operations/Clear Chart.
Appendix D
878
laamim^Mtmnn*™^
LabVIEW Tutorial
•
*" Configure Simulation Parameters
E
Simulation Parameters | Timing Parameters
Simula bon Parameters
Enable Synchronized Timing Simulation Time
0 Synchronize Loop to Timing Source RrtalTime(s)
Initial Time (s)
Timing Source Source type
Solver Method 00E Solver [Runge-Kutta 4
1 kHz
DNan/Inf Check
Continuous Time Step a n d Tolerance Source name 1kHz
to 0.01 Mawnum Step Size (s)
Loop Timing Attributes Period
ilE-10
• j
0.001
Offset/Phase
'lE-7
Auto Period
Priority
[too Deadline
Discrete Time S t e p
1
Timeout (ms)
Discrete Step Size (s)
fo.i
0 Auto Discrete Time
'm
Processor Assignment Mode j Automatic
OK
OX (a)
FIGURE D.19
v1
Cancel
m
Configuring the Simulation Loop parameters: a. Simulation parameters; b. Timing parameters
Example D.6 Effect of Amplifier Saturation on Motor's Load Angular Velocity Create Block Diagram and Front Panel The Block Diagram and Front Panel for simulating a dc motor with and without saturation are shown in Figure D.20. The Saturation block is obtained from Control Design & Simulation/Simulation/Nonliner Systems/Saturation.
Satuabon
Transfer Kntbon
1ST
avtia&onTWWavpform IWBv^c^Oyti Transfer Function 2
(a)
FIGURE D.20 Simulation of a dc motor with and without saturation: a. Block Diagram; (figure continues)
D.5
FIGURE D.20
(Continued)
Simulation E x a m p l e s
879
b. Front Panel
>^<,
Format il Plots
Scales
Documentation I Data Binding
Simulation Time (X-Axis) Name
Simulation Time
0
Show scale label
0
Show scale
l~1 Autoscale
• Log
10
O Inverted •
Maximum
Scaling Factors
Expand digital buses
—Scale Style and Colors
1
I Major tick |
Minor tick
|
Marker text
Offset
Grid Style and Colors
j T Major grid T Minor grid
O Ignore waveform time stamp on x-axes
OK
Cancel
Help
FIGURE D.21 Chart Properties: Waveform Chart Window
880
Appendix D
LabVIEW Tutorial
Configure simulation loop Configure the simulation loop as shown in figure D.19, except change the Final Time (s) in Figure D. 19(a) to 10. Configure graph parameters On the Front Panel, right click the graph and select Properties to configure graph parameters. Select the Scales tab and enter 10 in the Maximum box as shown in Figure D.21. Select the legend and expand it vertically to expose both plot identities. The titles in the legend can be changed to reflect meaningful labels for the plots. Run the simulation Perform the simulation by clicking the arrow at the extreme left of the toolbar on the Front Panel window. You can erase curves between trials by right-clicking the display and selecting Data Operations/Clear Chart.
Simulating Feedback Systems Create Block Diagram and Front Panel The Block Diagram and Front Panel for simulating feedback systems is shown in Figure D.22. The Summation block is obtained from Control Design & Simulation/Simulation/Signal Arithmetic/Summation. Configure Summation and other blocks Right-click the Summation block and select Configuration . . . Repeat for other blocks. Configure simulation loop Configure the simulation loop as shown in Figure D.19, except change the Final Time (s) in Figure D.19(a) to 10. Configure graph parameters On the Front Panel, right click the graph and select Properties to configure graph parameters. Select the Scales tab and enter 10 in the Maximum box as shown in Figure D.21.
FIGURE D.22 Simulation of feedback systems: a. Block Diagram; (figure continues)
D.5 Simulation Examples
FIGURE D.22 (Continued) b. Front Panel Run the simulation Perform the simulation by clicking the arrow at the extreme left of the toolbar on the Front Panel window. You can erase curves between trials by right-clicking the display and selecting Data Operations/Clear Chart.
Simulating Digital Systems with the Simulation Palette Digital systems, such as Example C.4 in Appendix C, can be simulated using LabVIEW. However, there are restrictions on the transfer functions used in the simulation. LabVIEW requires that all inputs to the transfer functions be present at the beginning of the simulation or else a cycle error will result. Unfortunately, this requirement limits the use of transfer functions to those with a denominator of higher order than the numerator. Under these conditions, the reader is advised to use either MATLAB or the Control Design palette rather than the Simulation palette of the Control Design & Simulation function. Our first digital example will simulate a digital feedback system using the Simulation palette with proper transfer functions. The next example will simulate Example C4 in Appendix C, which does not have proper transfer functions, using Lab VIEW'S Control Design palette. Create Block Diagram and Front Panel The Block Diagram and Front Panel for simulating digital systems is shown in Figure D.23. The Discrete Zero-Order Hold block is obtained from Control Design & Simulation/Simulation/Discrete Linear Systems/Discrete Zero-Order Hold. The Discrete Transfer Function is obtained
882
Appendix D
LabVIEW Tutorial
Simulating Digital Closed loop Systems.vi Block Diagram ' Fie B*t Wew Project
Operate Tools JMndow fcjeip
O i # | W p J l i l F f l J g i l w l t f | r > [TJotApptcattonFont
j?
1 ^ ^ ^ ^ ( ¾ ¾
Id
HE: p5SPf .
Dsaete Zero-Order Hold Transfer Function Bucd Array
SmJation Time Waveform
W*Y«form Chart
Discrete Transfer Function
;i-MH*+0,WS
I ]
ra i>]
(«)
FIGURE D.23
Simulation of digital systems with Simulation palette: a. Block Diagram;
b. front Panel from Control Design & Simulation/Simulation/Discrete Linear Systems/Discrete Transfer Function. Configure Discrete Zero-Order Hold and other blocks Right click the Discrete Zero-Order Hold block and select Configuration . . . Set the sample period to 0.5 second. Configure the transfer functions as shown on the Block Diagram. Configure the Step Signal to be a unit step. Configure simulation loop
Configure the simulation loop as shown in Figure D.19.
D.5 Simulation Examples Configure graph parameters On the Front Panel, right click the graph and select Properties to configure graph parameters. Select the Scales tab and enter three in the Maximum box for both the x-and y-axes as shown in Figure D.21. Select the legend and expand it vertically to expose both plot identities. The titles in the legend can be changed to reflect meaningful labels for the plots. Run the simulation Perform the simulation by clicking the arrow at the extreme left of the toolbar on the Front Panel window. You can erase curves between trials by right-clicking the display and selecting Data Operations/Clear Chart. The simulation shows the difference in responses obtained by (1) modeling the digital system as a zero-order hold cascaded with a linear system (Plot 0), or (2) modeling the system with a digital transfer function (Plot 1).
Example D.9 Simulating Digital Systems with the Control Design Palette In order to avoid cycle errors in Lab VIEW, we use the Control Design palette when we have transfer functions for which the numerator and denominator are of the same order. This example reproduces Simulink Example C.4. Create Block Diagram and Front Panel The Block Diagram and Front Panel for this example are shown in Figure D.24. Wire the blocks as shown. aM*jtmnCTitifiMitfai*aMB.-ta 0i M^tjjijl Eat
»ew
6o)«t
Operate l o t *
ffindro
a *
[frig] ["llflfgJI'wI^lJhaP'^'^f"''
1-jd^lfS^ll^lM
Numerator Continuous
Step Response of Continuous and Discrete
(a) FIGURE D.24 Simulation of digital systems with the Control Design palette: a. Block Diagram; (figure continues)
884
Appendix D
Lab VIEW Tutorial
(b)
FIGURE D.24 (Continued) b. Front Pane)
Most of the blocks were previously discussed in Example D.l and D.2. Digital transfer functions are created using the same blocks as continuous systems, but with a nonzero Sampling Time(s) input. The CD Convert Continuous to Discrete.vi, is obtained from Functions/ Control Design & Simulation/Control Design/Model Conversion/CD Convert Continuous to Discrete.vi. The Build Array is obtained from Functions/Programming/Array/Build Array. Expand the Build Array block to show two inputs. Configure parameters for Build Array Right-click on Build Array and select Concatenate Inputs. Right-click again on Build Array and select Create/Indicator. Right-click the indicator on the front panel and select Replace. Using the resulting palettes as shown in Figure D.25, select the XY Graph. On the front panel expand the legend to show two graphs. Title the legend components as shown. Change the x- and y-axes' starting and ending points as desired by right-clicking the graph and selecting Properties. In the Properties window, select Scales and enter the desired information. Right-click the graph on the front panel and select Data Operations and make your current values the default. Also, right-click again and choose to reinitialize to your default values. You may also choose to clear the current plot.
Summary
FIGURE D.25 Choosing XYGraph Configure parameters for CD Convert Continuous to Discrete.vi Right-click and create a control for Sample Time(s), Numerator, and Denominator as described in Example D.l. Set the values as shown on the Front Panel. Configure parameters for CD Construct Transfer Function Model.vi as a discrete model Right-click and create a control for Sample Time(s), Numerator, and Denominator as described in Example 1. Set the values as shown on the Front Panel. Configure parameters for all CD Draw Transfer Function Equation.vi Rightclick and create a control for Equation as described in Example D.l. Set the values as shown on the Front Panel. Run simulation Figure D.24(b).
See Example D.l for a description. The results are shown in
^ Summary ^ This appendix presented Lab VIEW as an alternative to MATLAB for analysis, design, and simulation. Our discussion was divided into analysis and design, and simulation.
885
886
Appendix D
LabVIEW Tutorial
Analysis and design is performed by interconnecting code blocks, which is analogous to writing in-line code for MATLAB M-files. Since the LabVIEW code blocks are represented by icons, an advantage of using LabVIEW is that you do not have to know specific code statements. Simulation is performed by interconnecting code blocks and is analogous to Simulink flow diagrams. LabVIEW has more extensive applications than those covered here. You can create virtual instruments on your computer monitor that can operate external hardware and transmit and receive telemetric data. It is left to the interested reader to pursue these advanced topics.
£ Bibliography]) National Instruments. Getting Started with LabVIEW. National Instruments, Austin, TX. 2003-2007. National Instruments. LabVIEW Fundamentals. National Instruments, Austin, TX. 20032007. National Instruments. LabVIEW™ Control Design User Manual. National Instruments, Austin, TX. 2004-2008. National Instruments. Introduction to LabVIEW in 3 Hours for Control Design and Simulation. National Instruments Course Notes, Austin, TX.
Glossary
Acceleration constant lim^G^) s—*0
Actuating signal The signal that drives the controller. If this signal is the difference between the input and output, it is called the error. Analog-to-digital converter A device that converts analog signals to digital signals. Armature The rotating member of a dc motor through which a current flows. Back emf The voltage across the armature of a motor. Bandwidth The frequency at which the magnitude frequency response is —3 dB below the magnitude at zero frequency. Basis Linearly independent vectors that define a space. Bilinear transformation A mapping of the complex plane where one point, s, is mapped into another point, z, through z = (as + b)/(cs + d). Block diagram A representation of the interconnection of subsystems that form a system. In a linear system, the block diagram consists of blocks representing subsystems, arrows representing signals, summing junctions, and pickoff points. Bode diagram (plot) A sinusoidal frequency response plot where the magnitude response is plotted separately from the phase response. The magnitude plot is dB versus log w, and the phase plot is phase versus log w. In control systems, the Bode plot is usually made for the open-loop transfer function. Bode plots can also be drawn as straight-line approximations. Branches Lines that represent subsystems in a signal-flow graph. Break frequency A frequency where the Bode magnitude plot changes slope. Breakaway point A point on the real axis of the s-plane where the root locus leaves the real axis and enters the complex plane. Break-in point A point on the real axis of the s-plane where the root locus enters the real axis from the complex plane. Characteristic equation The equation formed by setting the characteristic polynomial to zero.
Glossary Characteristic polynomial The denominator of a transfer function. Equivalently, the unforced differential equation, where the differential operators are replaced by s or X. Classical approach to control systems See frequency domain techniques. Closed-loop system A system that monitors its output and corrects for disturbances. It is characterized by feedback paths from the output. Closed-loop transfer function For a generic feedback system with G(s) in the forward path and H(s) in the feedback path, the closed-loop transfer function, T(s), is G(s)/[1 ± G(s)H(s)\, where the + is for negative feedback, and the - is for positive feedback. Compensation The addition of a transfer function in the forward path or feedback path for the purpose of improving the transient or steady-state performance of a control system. Compensator A subsystem inserted into the forward or feedback path for the purpose of improving the transient response or steady-state error. Constant M circles The locus of constant, closed-loop magnitude frequency response for unity feedback systems. It allows the closed-loop magnitude frequency response to be determined from the open-loop magnitude frequency response. Constant TV circles The locus of constant, closed-loop phase frequency response for unity feedback systems. It allows the closed-loop phase frequency response to be determined from the open-loop phase frequency response. Controllability A property of a system by which an input can be found that takes every state variable from a desired initial state to a desired final state in finite time. Controlled variable The output of a plant or process that the system is controlling for the purpose of desired transient response, stability, and steady-state error characteristics. Controller The subsystem that generates the input to the plant or process. Critically damped response The step response of a second-order system with a given natural frequency that is characterized by no overshoot and a rise time that is faster than any possible overdamped response with the same natural frequency. Damped frequency of oscillation The sinusoidal frequency of oscillation of an underdamped response. Damping ratio The ratio of the exponential decay frequency to the natural frequency. Decade Frequencies that are separated by a factor of 10. Decibel (dB) The decibel is defined as 10 logPo, where PQ is the power gain of a signal. Equivalently, the decibel is also 20 logVc, where VG is the voltage gain of a signal. Decoupled system A state-space representation in which each state equation is a function of only one state variable. Hence, each differential equation can be solved independently of the other equations.
Glossary Digital compensator A sampled transfer function used to improve the response of computer-controlled feedback systems. The transfer function can be emulated by a digital computer in the loop. Digital-to-analog converter A device that converts digital signals to analog signals. Disturbance An unwanted signal that corrupts the input or output of a plant or process. Dominant poles The poles that predominantly generate the transient response. Eigenvalues Any value, kt, that satisfies AXj = %iX\ for X| ^ 0. Hence, any value, A,-, that makes Xj an eigenvector under the transformation A. Eigenvector Any vector that is collinear with a new basis vector after a similarity transformation to a diagonal system. Electric circuit analog An electrical network whose variables and parameters are analogous to another physical system. The electric circuit analog can be used to solve for variables of the other physical system. Electrical admittance The inverse of electrical impedance. The ratio of the Laplace transform of the current to the Laplace transform of the voltage. Electrical impedance The ratio of the Laplace transform of the voltage to the Laplace transform of the current. Equilibrium The steady-state solution characterized by a constant position or oscillation. Error The difference between the input and the output of a system. Euler's approximation A method of integration where the area to be integrated is approximated as a sequence of rectangles. Feedback A path through which a signal flows back to a previous signal in the forward path in order to be added or subtracted. Feedback compensator A subsystem placed in a feedback path for the purpose of improving the performance of a closed-loop system. Forced response For linear systems, that part of the total response function due to the input. It is typically of the same form as the input and its derivatives. Forward-path gain The product of gains found by traversing a path that follows the direction of signal flow from the input node to the output node of a signal-flow graph. Frequency domain techniques A method of analyzing and designing linear control systems by using transfer functions and the Laplace transform as well as frequency response techniques. Frequency response techniques A method of analyzing and designing control systems by using the sinusoidal frequency response characteristics of a system. Gain The ratio of output to input; usually used to describe the amplification in the steady state of the magnitude of sinusoidal inputs, including dc. Gain margin The amount of additional open-loop gain, expressed in decibels (dB), required at 180° of phase shift to make the closed-loop system unstable.
Glossary
Gain-margin frequency The frequency at which the phase frequency response plot equals 180°. It is the frequency at which the gain margin is measured. Homogeneous solution See natural response. Ideal derivative compensator See proportional-plus-derivative controller. Ideal integral compensator See proportional-plus-integral controller. Instability The characteristic of a system defined by a natural response that grows without bounds as time approaches infinity. Kirchhoff 's law The sum of voltages around a closed loop equals zero. Also, the sum of currents at a node equals zero. Lag compensator A transfer function, characterized by a pole on the negative real axis close to the origin and a zero close and to the left of the pole, that is used for the purpose of improving the steady-state error of a closed-loop system. Lag-lead compensator A transfer function, characterized by a pole-zero configuration that is the combination of a lag and a lead compensator, that is used for the purpose of improving both the transient response and the steady-state error of a closed-loop system. Laplace transformation A transformation that transforms linear differential equations into algebraic expressions. The transformation is especially useful for modeling, analyzing, and designing control systems as well as solving linear differential equations. Lead compensator A transfer function, characterized by a zero on the negative real axis and a pole to the left of the zero, that is used for the purpose of improving the transient response of a closed-loop system. Linear combination A linear combination of n variables, Xi, for i = 1 to n, given by the following sum, S: S = KnXn + Kn-\Xn-\ + •••-!- K\X\ where each Kj is a constant. Linear independence The variables x/, for i = 1 to independent if their linear combination, 5, equals and no xt = 0. Alternatively, if the x/'s are linearly Kn-\xn-\ H h K\x\ = 0 cannot be solved for any % as a linear combination of the other xfs.
n, are said to be linearly zero only if every K[ = 0 independent, then Knx„ + Thus, no x^ can be expressed
Linear system A system possessing the properties of superposition and homogeneity. Linearization The process of approximating a nonlinear differential equation with a linear differential equation valid for small excursions about equilibrium. Loop gain For a signal-flow graph, the product of branch gains found by traversing a path that starts at a node and ends at the same node without passing through any other node more than once, and following the direction of the signal flow. Major-loop compensation A method of feedback compensation that adds a compensating zero to the open-loop transfer function for the purpose of improving the transient response of the closed-loop system.
Glossary Marginal stability The characteristic of a system defined by a natural response that neither decays nor grows, but remains constant or oscillates as time approaches infinity as long as the input is not of the same form as the system's natural response. Mason's rule A formula from which the transfer function of a system consisting of the interconnection of multiple subsystems can be found. Mechanical rotational impedance The ratio of the Laplace transform of the torque to the Laplace transform of the angular displacement. Mechanical translational impedance The ratio of the Laplace transform of the force to the Laplace transform of the linear displacement. Minor-loop compensation A method of feedback compensation that changes the poles of a forward-path transfer function for the purpose of improving the transient response of the closed-loop system. Modern approach to control systems See state-space representation. Natural frequency The frequency of oscillation of a system if all the damping is removed. Natural response That part of the total response function due to the system and the way the system acquires or dissipates energy. Negative feedback The case where a feedback signal is subtracted from a previous signal in the forward path. Newton's law The sum of forces equals zero. Alternatively, after bringing the ma force to the other side of the equality, the sum of forces equals the product of mass and acceleration. Nichols chart The locus of constant closed-loop magnitude and closed-loop phase frequency responses for unity feedback systems plotted on the open-loop dB versus phase-angle plane. It allows the closed-loop frequency response to be determined from the open-loop frequency response. Nodes Points in a signal-flow diagram that represent signals. No-load speed The speed produced by a motor with constant input voltage when the torque at the armature is reduced to zero. Nonminimum-phase system A system whose transfer function has zeros in the right half-plane. The step response is characterized by an initial reversal in direction. Nontouching-loop gain The product of loop gains from nontouching loops taken two, three, four, and so on at a time. Nontouching loops Loops that do not have any nodes in common. Notch filter A filter whose magnitude frequency response dips at a particular sinusoidal frequency. On the s-plane, it is characterized by a pair of complex zeros near the imaginary axis. Nyquist criterion If a contour, A, that encircles the entire right half-plane is mapped through G(s)H(s), then the number of closed-loop poles, Z, in the right half-plane equals the number of open-loop poles, P, that are in the right half-plane minus the number of counterclockwise revolutions, N, around — 1, of the mapping; that is, Z — P-N. The mapping is called the Nyquist diagram of G(s)H(s).
892
Glossary Nyquist diagram (plot) A polar frequency response plot made for the open-loop transfer function. Nyquist sampling rate The minimum frequency at which an analog signal should be sampled for correct reconstruction. This frequency is twice the bandwidth of the analog signal. Observability A property of a system by which an initial state vector, x(to), can be found from u(t) and y(t) measured over a finite interval of time from to. Simply stated, observability is the property by which the state variables can be estimated from a knowledge of the input, u(t), and output, y(t). Observer A system configuration from which inaccessible states can be estimated. Octave Frequencies that are separated by a factor of two. Ohm's law For dc circuits the ratio of voltage to current is a constant called resistance. Open-loop system A system that does not monitor its output nor correct for disturbances. Open-loop transfer function For a generic feedback system with G(s) in the forward path and H(s) in the feedback path, the open-loop transfer function is the product of the forward-path transfer function and the feedback transfer function, or G(s)H(s). Operational amplifier An amplifier—characterized by a very high input impedance, a very low output impedance, and a high gain—that can be used to implement the transfer function of a compensator. Output equation For linear systems, the equation that expresses the output variables of a system as linear combinations of the state variables. Overdamped response A step response of a second-order system that is characterized by no overshoot. Partial-fraction expansion A mathematical equation where a fraction with n factors in its denominator is represented as the sum of simpler fractions. Particular solution See forced response. Passive network A physical network that only stores or dissipates energy. No energy is produced by the network. Peak time, Tp The time required for the underdamped step response to reach the first, or maximum, peak. Percent overshoot, %OS The amount that the underdamped step response overshoots the steady-state, or final, value at the peak time, expressed as a percentage of the steady-state value. Phase margin The amount of additional open-loop phase shift required at unity gain to make the closed-loop system unstable. Phase-margin frequency The frequency at which the magnitude frequency response plot equals zero dB. It is the frequency at which the phase margin is measured. Phase variables State variables such that each subsequent state variable is the derivative of the previous state variable.
Glossary Phasor A rotating vector that represents a sinusoid of the form A cos((ot + ¢). Pickoff point A block diagram symbol that shows the distribution of one signal to multiple subsystems. Plant or process The subsystem whose output is being controlled by the system. Poles (1) The values of the Laplace transform variable, s, that cause the transfer function to become infinite; and (2) any roots of factors of the characteristic equation in the denominator that are common to the numerator of the transfer function. Position constant lim G(s) s—»0
Positive feedback The case where a feedback signal is added to a previous signal in the forward path. Proportional-plus-derivative (PD) controller A controller that feeds forward to the plant a proportion of the actuating signal plus its derivative for the purpose of improving the transient response of a closed-loop system. Proportional-plus-integral (PI) controller A controller that feeds forward to the plant a proportion of the actuating signal plus its integral for the purpose of improving the steady-state error of a closed-loop system. Proportional-plus-integral-plus-derivative (PED) controller A controller that feeds forward to the plant a proportion of the actuating signal plus its integral plus its derivative for the purpose of improving the transient response and steady-state error of a closed-loop system. Quantization error For linear systems, the error associated with the digitizing of signals as a result of the finite difference between quantization levels. Raible's tabular method A tabular method for determining the stability of digital systems that parallels the Routh-Hurwitz method for analog signals. Rate gyro A device that responds to an angular position input with an output voltage proportional to angular velocity. Residue The constants in the numerators of the terms in a partial-fraction expansion. Rise time, Tr The time required for the step response to go from 0.1 of the final value to 0.9 of the final value. Root locus The locus of closed-loop poles as a system parameter is varied. Typically, the parameter is gain. The locus is obtained from the open-loop poles and zeros. Routh-Hurwitz criterion A method for determining how many roots of a polynomial in s are in the right half of the s-plane, the left half of the s-plane, and on the imaginary axis. Except in some special cases, the Routh-Hurwitz criterion does not yield the coordinates of the roots. Sensitivity The fractional change in a system characteristic for a fractional change in a system parameter. Settling time, Ts The amount of time required for the step response to reach and stay within ±2% of the steady-state value. Strictly speaking, this is the definition of
894
Glossary
the 2% settling time. Other percentages, for example 5%, also can be used. This book uses the 2% settling time. Signal-flow graph A representation of the interconnection of subsystems that form a system. It consists of nodes representing signals and lines representing subsystems. Similarity transformation A transformation from one state-space representation to another state-space representation. Although the state variables are different, each representation is a valid description of the same system and the relationship between the input and the output. Stability That characteristic of a system defined by a natural response that decays to zero as time approaches infinity. Stall torque The torque produced at the armature when a motor's speed is reduced to zero under a condition of constant input voltage. State equations A set of n simultaneous, first-order differential equations with n variables, where the n variables to be solved are the state variables. State space The n-dimensional space whose axes are the state variables. State-space representation A mathematical model for a system that consists of simultaneous, first-order differential equations and an output equation. State-transition matrix The matrix that performs a transformation on x(0), taking x from the initial state, x(0), to the state x(t) at any time, t > 0. State variables The smallest set of linearly independent system variables such that the values of the members of the set at time to along with known forcing functions completely determine the value of all system variables for all t>tQ. State vector A vector whose elements are the state variables. Static error constants The collection of position constant, velocity constant, and acceleration constant. Steady-state error The difference between the input and the output of a system after the natural response has decayed to zero. Steady-state response See forced response. Subsystem A system that is a portion of a larger system. Summing junction A block diagram symbol that shows the algebraic summation of two or more signals. System type The number of pure integrations in the forward path of a unity feedback system. System variables Any variable that responds to an input or initial conditions in a system. Tachometer A voltage generator that yields a voltage output proportional to rotational input speed. Time constant The time for e~al to decay to 37% of its original value at t = 0. Time-domain representation See state-space representation.
Glossary
Torque-speed curve The plot that relates a motor's torque to its speed at a constant input voltage. Transducer A device that converts a signal from one form to another, for example from a mechanical displacement to an electrical voltage. Transfer function The ratio of the Laplace transform of the output of a system to the Laplace transform of the input. Transient response That part of the response curve due to the system and the way the system acquires or dissipates energy. In stable systems it is the part of the response plot prior to the steady-state response. Tustin transformation A bilinear transformation that converts transfer functions from continuous to sampled and vice versa. The important characteristic of the Tustin transformation is that both transfer functions yield the same output response at the sampling instants. Type See system type. Undamped response The step response of a second-order system that is characterized by a pure oscillation. Underdamped response The step response of a second-order system that is characterized by overshoot. Velocity constant limsG(,s) 5-»0
z-transformation A transformation related to the Laplace transformation that is used for the representation, analysis, and design of sampled signals and systems. Zero-input response That part of the response that depends upon only the initial state vector and not the input. Zero-order sample-and-hold (z.o.h.) A device that yields a staircase approximation to the analog signal. Zeros (1) Those values of the Laplace transform variable, s, that cause the transfer function to become zero; and (2) any roots of factors of the numerator that are common to the characteristic equation in the denominator of the transfer function. Zero-state response That part of the response that depends upon only the input and not the initial state vector.
to Selected Problems
Chapter 1 2 /2 8 19. c. x(t) = - - e~4t ( - cos 3f + — sin 3/ 20. b. *(*) = -e~l + 9te~c + 5e"2f+ / - :2 Chapter 2 3. b. x(t) 7. 8.
X(s) Sx
1tf b.
3r1
#)
T(s) 92(s) 43. Ea(s)
18 1 • . cos 3/ -—sm3r 65 65
3/(0
1
)
5+ 2
')
52+25 + 2 5 + 253 + 352 + 35 + 2
^ Vi(s)
m
3 10
f 1 1 ^2 + 1 2 ^ + 18* = df dr dt
V
Us)
2f
53 + 452 + 65 + 8 53 + 352 + 55 + 1
Y(s)
16. a.
33.
_15 26
4
3 2052 +135 + 4 1 1305 + 4005 + 55 0.0833 s(s + 0.75) 2
897
898
Answers to Selected Problems Chapter 3 11 3 2 3 1 3
1. X =
y=[0
0 1]
+
2 3 1 3 1 L3J
Vi
K L 'V J
in the text. 0 0 0 in Figure Note: L\ is0left-most P3.1 i 1 inductor 0 1 0 0 0 r(t) 0 1 x+ 0 0 0 11. a. x = -13 - 5 -1 - 5 LU
c(f) = [10 8 0 14. a.
Y(s) R{s)
0]J
10 s* + 5s2 + 2s + 3 D eq
TW]
0
J eq
1 KbN2
JeqN2 0 0
L LaNx
La\
19. x =
o J£
0>L
la
0 0
+ J. lLaJ
0)L
y
0
W °
Chapter 4
U**{t)=\
1-
,-0.5/
COS
/19 1 ——/ - arctan 2
20. a. £ = 0.375; con = 4 rad/s; 7, = 2.67 s; "7> p ==0.847 s; %OS = 28.06 23. a. 5 = -6.67+/9.88 35. s = -5.79, -1.21 36. a. s3 ~ 8s2 - lis + 8 = 0 b. s = 9.11,0.534,-1.64 40.y(f) = ! - | r 5 ' 43. 0.21822
Answers to Selected Problems x(t) =
1.0455e-°-20871f - 0.045545
y(t) = 0.60911e-°-20871f + 0.39089e-47913' 73. D = 0.143 N-m-s/rad 76. R = 912(1 Chapter 5 f
C{s) R(s)
\ C{s) R(s) 6
C(s) R{s)
q C(s) R(s)
G3(G!G 2 + 1) 1 + Gitfi G1G2 + G3 1 + G3H + GiG2H + G2G4 GiG 5 1 4- G1G2 + G1G3G4G5 + G1G3G5G6G7 + G1G5G8 G4G6 + G2G5G6 + G3G5G6 1 + G 6 + GiG 2 + G1G3 + GiG 2 G 6 + G1G3G6 + G4G6G7 + G2G5G6G7 + G3G5G6G7
26.
C{s) R{s)
27.
C(s) R(s)
28.
G1G2G3G4 2 + G2G3G4 + 2G3G4 + 2G4
C(s) R(s)
1 - G6G7H3(G2
GiG 6 G 7 (G2 + G3)(G4 + G5) + G3){G4 + G5) - G6HX - G7H2 +
3
s + l 2s + s2 + 2s 4
1
-5
0
0 - 5
30. b. x =
0
0
x+
0 - 7
0 0 0 - 7
y-
37. x =
-i * -^ 0 -1 0
1 0 0
1 - 1 0 c=\-l
0 0 1 0 0 1 0.
1 0 0]x
73. DL = 3560 N-m-s/rad Chapter 6 1. 2 rhp, 3 lhp, 0 jco 3. 3 rhp, 2 lhp, 0 jco
x+
r(t)
'«
GeGjHtfy
899
Answers to Selected Problems 4. 5. 9. 17.
1 rhp, 0 lhp, 4 jeo 0 rhp, 2 lhp, 2 jco Unstable 1 rhp, 2 lhp, 4 /&>
23. £ > I
X < -1
39. a. - 4 < £ < 20.41; b. 1.36rad/s 41. a. 0 < K < 19.69; b. K = 19.69; c * = ± /1.118, -4.5, -3.5 42. - ? < £ < 0 Chapter 7 4. esteP(oo) = 0; eramp(oo) = 127.5; eparaboia(oo) = oo 7. e(oo) = 0.9 10. a. %OS = 14.01; b. Ts = 0.107 sec; c. esteP(oo) = 0; d. eramp(oo) = 0.075; e. eparaboia (oo) = oo 13. a. Kp = -, Kv = 0, Ka = 0; 20. 27. 31. 35. 41.
b. e(oo) = 37.5, oo, oo, respectively;
c. Type 0 £ = 110,000 p = 1, K = 1.16, a = 7.76, or $ = - 1 , K = 5.16, a = 1.74 a. K = 831,744, a = 831.744 Ki = 125,000, # 2 = 0.016 a. Step: e(oo) = 1.098; ramp: e(oo) = oo
Chapter 8 16. Breakaway point = -2.333; asymptotes: aa— - 5 ; /w-axis crossing = ± /7.35 19. b. Asymptotes: aa = -~; 20. K = 9997; 23. a. aa = - - ; 26. 30, 39. 42.
c. K = 140.8;
d. K = 13.12
a =7 b. s = -1.38, -3.62;
c. 0 < K < 126; d. K = 10.3
b. K = 9.4; c. Ts = 4.62 s, Tp = 1.86 s; d, 5 = -4.27; a=9 a. 0 < K < 4366; b. K = 827.2; c. K = 527.6 a. £ = 170.1; b. iC = 16.95
e. 0 < K < 60
Chapter 9 1. Gc(s) = : ^ ± 5 i
K ~ 72.23 for both cases; KPo = 2.44;
%OS0 = %OSN = 16.3;
TS0 = TSN = 2.65 s
#PA, = oo;
Answers to Selected Problems 9. a. s = -2.5 + /5.67; b. Angle = -59.27°; c. 5 = -5.87 d. K = 225.79; e. s = -11.59, -1.36 10. a. s = -2.4 ± y'4.16; b. s = -6.06; c. # = 29.12; d. s = -1.263; f. Ka = 4.8 14. a. Gc(5) =
- - ¾ # = 5452; dominant poles = -4.13 ± /10.78 F y 5 + 37.42' 2 4 . a . Kuc = 10; tfc = 9.95; b . KPuc = 1.25; KPc = 6.22; c. %OS M C = %OSc = 4.32; d. Uncompensated: exact second-order system, approximation OK; compensated: closed-loop pole at —0.3, closed-loop zero at —0.5, simulate e. Approach to final value longer than settling time of uncompensated system w
ts f n G\L Li Cr(5) f« W =
404.1(5 + 0.5)(^ + 4) ... . — 7T7 T-TTT ^TT^TT yields approximately a 5 times FF (5 + 2)(5 + 4)(5 + 0.1)(5 + 28.36) y '
improvement in speed.
28. Poles = -0.747 + ; 1.237, -2.51 ; zeros-none Chapter 10 10. System 1: 0 < K < 490.2; System 2: 0 < K < 1.4; System 3: 1 < K < oo (Answers are from exact frequency response) 11. a. System 1: GM — -6.38 dB; ¢ ^ = —20.3° (Answers are from exact frequency response) 15. c. G>BW = 2.29 rad/s 23. System 2: Ts = 2.23 sec, Tp = 0.476 s, %05 = 42.62 (Answers are from exact frequency response) 44. GM = 1.17 dB, &M = 6.01° (Answers are from exact frequency response) Chapter 11 1. a. K = 2113 (Answer is from exact frequency response) 2. a. K = 2365 (Answer is from exact frequency response) 3. a. K = 575 (Answer is from exact frequency response)
(Answer is from exact frequency response) 2 1 . Gc{s) = ('
+
°ml'
+ 2 16
- \K-
25.189
5
(Answer is from exact frequency response) Chapter 12 52 + (^2+8)5+(^,+16) 5+3 1. d. For function i: T(s) =
901
Answers to Selected Problems , , - . . . « , * 6.25 t. 3. b. For function i: G(s) w = J
27.5 71.25 — -\ —, 5 + 10 ^ + 20
. 2 0 0 ^ + 7 5 + 25) T(s) w = -7-=-*—*—; 4^3 + as2 + fe + c
where a = (25A:3 - 110Jfe2 + 285&i + 120) b = (750k3 - 2200A:2 + 2850&1 + 800) c = 5000fc3 andC = [l
1 1]; B = [71.25 -27.5 6.25]T was used
11. a. Uncontrollable; b. Controllable; c. Controllable 14. K = [92.35 36.78 -7] for a characteristic polynomial of (s + 6)(52 + 85 + 45.78) = 53 + 1452 + 93.785 + 274.7 23... X. = I -671.19 1472.4}T for a characteristic polynomial of s2 + 1445 + 14,400 Chapter 13 3. a. f(kT) = 229.5(0.4)* - 504(0.6)* + 275.5(0.8)* 6.c.G( Z ) = 0.395
(Z+0'2231> z - 0.2231) {z2 + 0.1857z + 0.04979)
8. b. G{z) = 0.0517
z2 +2.2699^ + 0.2995 ( z - l ) ( z - 0 . 2 2 3 1 ) ( z - 0.4065)
9. a. T(z) = 14.0
G1(z)G2(z) l + G1(z)G2H(z)
15.76
15. a. Kp = -, e*(oo) = -;
Kv = 0, e*(oo) = oo;
Ka = 0, e*(oo) = oo
17. K = 14.18 for 16.3% of overshoot; 0 < K < 109.28 for stability
Credits
Figure and Photo Credits Figures, photos, Case Studies, Examples, and Problems in Chapters 4,5,6,8,9,13, Appendix B, and rear endpapers: Adapted from Johnson, H., et al. Unmanned Free-Swimming Submersible (UFSS) System Description, NRL Memorandum Report 4393 (Washington, D.C.: Naval Research Laboratory, 1980). MATLAB screen shots in Appendixes C and E were reprinted with permission from The MathWorks.
Chapter 1 1.3: (a): © Bettman/Corbis; (b): ART on FILE/© Corbis. 1.4: © Hank Morgan/ Rainbow/PNI. L5b: Pioneer Electronics (USA), Inc. 1.7: © Donald Swartz/ iStockphoto. 1.8: © Peter Menzel. P1.3: Adapted from Ayers, J. Taking the Mystery Out of Winder Controls, Motion System Design, April 1988. Penton Media, Inc. P1.5: Jenkins, H. E.; Kurfess, T. R.; and Ludwick, S. J. Determination of a Dynamic Grinding Model, Journal of Dynamic Systems, Measurements and Control, vol. 119, June 1997, p. 290. 1997 ASME. Reprinted with permission of ASME. P1.6: Vaughan, N. D., and Gamble, J. B. The Modeling and Simulation of a Proportional Solenoid Valve, Journal of Dynamic Systems, Measurements and Control, vol. 118, March 1996, p. 121. 1996 ASME. Reprinted with permission of ASME. P1.7(a), (b), (c): Reprinted figure with permission from Bechhofer, J., Feedback for Physicists: A Tutuorial Essay on Control, Reviews of Modern Physics, pp. 77, 783, 2005. Copyright (2007) by the American Physical Society. P1.8: D. A. Weinstein/Custom Medical Stock Photo. P l . l l : O'Connor, D. N ; Eppinger, S. D.; Seering, W P.; and Wormly, D. N. Active
Control of a High-Speed Pantograph, Journal of Dynamic Systems, Measurements and Control, vol. 119, March 1997, p. 2. 1997 ASME. Reprinted with permission of ASME. P1.12, P1.13: Mark Looper, www.Altfuels.org.; P1.14: Robert Bosch GmbH, Bosch Automotive Handbook, 7th ed., Wiley UK.
Chapter 2 2.34: © Debra Lex. 2.51: Adapted from Milsum, J. H. Biological Control Systems Analysis (New York: McGraw-Hill, 1966), p. 182. © 1966 McGraw-Hill, Inc. Used with permission of the publisher. P2.36: Lin Jung-Shan, Kanellakopoulos Ioannis. Nonlinear Design of Active Suspensions, IEEE Control Systems Magazine, vol. 17, no. 3. June 1997, pp. 45-49. Fig. 1, p. 46. P2.37: Marttinen A., Virkkunen J., Salminen R. T. Control Study with Pilot Crane, IEEE Trans, on Education, vol. 33, No. 3, August 1990. Fig. 2, p. 300. P2.38: Wang J. Z., Tie B., Welkowitz W, Semmlow J. L., Kostis J. B. Modeling Sound Generation in Stenosed Coronary Arteries, IEEE Trans, on Biomedical Engineering, vol. 37, no. 11, November 1990. P2.39(a): From O'Connor, D. N ; Eppinger, S. D.; Seering, W P.; and Wormly, D. N. Active Control of a High-Speed Pantograph, Journal of Dynamic Systems, Measurements and Control, vol. 119, March 1997, p. 2. 1997 ASME. Reprinted with permission of ASME. P2.39(b): Adapted from O'Connor, D. N.; Eppinger, S. D.; Seering, W. P.; and Wormly, D. N. Active Control of a High-Speed Pantograph, Journal of Dynamic Systems, Measurement and Control, vol. 119, March 1997, p. 3. 1997 ASME. Reprinted with permission of ASME. P2.40: Craig, I. K., Xia, X., and Venter, J. W Introducing HIV/AIDS Education into the Electrical Engineering
Curriculum at the University of Pretoria. IEEE Trans, on Education, vol. 47, no. 1, February 2004, pp. 65-73. P2.41: Robert Bosch GmbH, Bosch Automotive Handbook, 7th ed., Wiley UK.
Chapter 3 3.13: Bruce Frisch/S.S./Photo Researchers. P3.14(a), (b): Hong, X; Tan, X.; Pinette, B.; Weiss, R.; and Riseman, E. M. Image-Based Homing, IEEE Control Systems, Feb. 1992, pp. 38-45. © 1992 IEEE. P3.1S(a), (b): Adapted from Cavallo, A.; De Maria, G; and Verde, L. Robust Flight Control Systems: A Parameter Space Design, Journal of Guidance, Control, and Dynamics, vol. 15, no. 5, September-October, 1992, pp. 1210-1211. 1992 AIAA. Reprinted by permission of the American Institute of Aeronautics and Astronautics, Inc. P3.16: Adapted from Chiu, D. K., and Lee, S. Design and Experimentation of a Jump Impact Controller, IEEE Control Systems, June 1997, Fig. 1, p. 99. 1997 IEEE. Reprinted with permission. P3.17: Liceaga-Castro, E., vander Molen G. M. Submarine H°° Depth Control Under Wave Disturbances, IEEE Trans. on Control Systems Technology, vol. 3, no. 3, 1995. Fig. 1, p. 339. P3.18: Li, S., Jarvis, A. J., Leedal, D. T , Are Response Function Representations of the Global Carbon Cycle Ever Interpretable?, Tellus vol. 61B, Wiley UK. P3.19: Preitl, Z., Bauer, P., Bokor, J., A Simple Control Solution for Traction Motor Used in Hybrid Vehicles, 4 th International Symposium on Applied Computational intelligence and Informantics, 2007. 4 th International Symposium on Applied Computational Intelligence and Informatics, IEEE, 2007, Fig. 8, p. 2. P3.31(c): (table) Craig, I. K., Xia, X., and Venter, J. W Introducing HIV/AIDS Education
903
904
Credits
into the Electrical Engineering Curriculum at the University of Pretoria. IEEE Trans, on Education, vol. 47, no. 1, February 2004, pp. 65-73. Table II, p. 67.
Chapter 4 422: Yoshikazu Tsuno/AFP/Getty Images, Inc. 4.27: Adapted from Dorf, R. C. Introduction to Electric Circuits, 2nd ed. (New York: John Wiley & Sons, 1989, 1993), p. 583. © 1989,1993 John Wiley & Sons. Reprinted by permission of the publisher. 4.33: Courtesy of Naval Research Laboratory. P4.ll: Courtesy of Pacific Robotics, Inc. P4.12: Borovic B., Liu A. Q., Popa D., Lewis F. L. Open-loop versus closed-loop control of MEMS devices: choices and issues. J. Micromech. Microeng. vol. 15, 2005. Fig. 4, p. 1919. P4.14: DiBona G. F. Physiology in Perspective: The Wisdom of the Body. Neural Control of the Kidney, Am. J. Physiol. Regul. Integr. Comp. Physiol, vol. 289, 2005. Fig. 6, p. R639. Used with permission. P4.24: From Manring, N. D., and Johnson, R. E. Modeling and Designing a Variable Displacement Open-Loop Pump, Journal of Dynamic Systems, Measurement and Control, vol. 118, June 1996, p. 268.1996 ASME. Reprinted with permission of ASME.
Jung-Shan, Kanellakopoulos Ioannis. Nonlinear Design of Active Suspensions, IEEE Control Systems Magazine, vol. 17, no. 3. June 1997, pp. 45-49. Fig. 3, p. 48. P5.44: de Vlugt, Schouten A. G, van der Helm F. C. T. Adaptation of reflexive feedback during arm posture to different environments, Biol. Cybern. vol. 87,2002. Fig. A l , p. 24. by P5.45: Karkoub, M., Her, M-G, Chen, J.M., Design and Control of a Haptic Interactive Motion, Robotica vol. 28, 2008. Copyright © 2010 Cambridge University Press. Reprinted with permission. P5.46: Piccin, O., Barbe, L., Bayle, B., de Mathelin, M., Gangi, A., A Force Teleoperated Needle Insertion Device Percutaneous Procedures, International Journal of Robotics Research, vol. 28, 2009. Reprinted with permission from Sage Publications. P5.47: Lee, S.R., Ko, S., Dehbonei, H., Jeon, C.H., Kwon, O.S., Operational Characteristics of PV/Diesel Hybrid Distributed Generation System Using Dual Voltage Source Inverter for Weak Grid, ISIS 2007 Proceedings, 8 t h Symposium on Advanced Int. Sys. 2007. P5.48: Kong, E, de Keyser, R., Identification and Control of the Mold Level in a Continuous Casting Machine, 2 nd IEEE Conference on Control Applications. Vancouver, B.C., 1993. Fig. 1, p. 53, pp. 53-58.
Chapter 6 Chapter 5 5.1: NASA-Houston. 533: © Rob Catanach, Woods Hole Oceanographic Institution. P532: Tanis, D. Space Shuttle GN&C Operations Manual (Downey, CA: Rockwell International), August 1988. P535(a): Courtesy of Hank Morgan/Rainbow/ PNI. P5.36(a): Bailey, F. N ; Cockburn, J. C ; and Dee, A. Robust Control for High-Performance Materials Testing, IEEE Control Systems, April 1992, p. 63. © 1992 IEEE. P5.38: Lepschy A. M., Mian G A., Viaro U. Feedback Control in Ancient Water and Mechanical Clocks, IEEE Trans, on Education, vol. 35, 1992. Figs. 1 and 2, p. 4. P5.39: Ben-Dov D., Salcudean S. E. A ForceControlled Pneumatic Actuator, IEEE Trans, on Robotics and Automation, vol. 11, 1995. Fig. 6, p. 909. P5.43: Lin
6.9: Courtesy of Woods Hole Oceanographic Institution. 6.11: Courtesy of FANUC Robotics North America, Inc. P6.14(a): Courtesy of Kazuhiko Kawamura, Vanderbilt University. P6.16: From Rober, S. X; Shin, Y. C ; and Nwokah, O. D. I. A Digital Robust Controller for Cutting Force Control in the End Milling Process, Journal of Dynamic Systems, Measurement and Control, vol. 119, June 1997, p. 147. 1997 ASME. Reprinted with permission of ASME. P6.17(a): © Japan Air Lines/ Photo Researchers. P6.17(b): Adapted from Bittar, A., and Sales, R. M. H 2 and Hoo Control for MagLev Vehicles, IEEE Control Systems, vol. 18, no. 4, August 1998, Equations 7, 8, and Table 2 on pp. 20-21. © 1998 IEEE. Reprinted with permission.
Chapter 7 7.9: Chuck O'Rear/Westlight/Corbis Images. 7.23(a): Isailovic, J., Videodisc and Optical Memory Technologies, © 1985, p. 77. Reprinted by permission of Pearson Education, Inc., Upper Saddle River, N.J. P7.22: Lam C. S., Wong M. C , Han Y D. Stability Study on Dynamic Voltage Restorer (DVR) Power Electronics Systems and Applications 2004, Proceedings First International Conference on Power Electronics 2004. Fig. 7, p. 68. P7.28(a), (c): From Kumar, R. R.; Cooper, P. A.; and Lim, T. W Sensitivity of Space Station Alpha Joint Robust Controller to Structural Modal Parameter Variations, Journal of Guidance, Control, and Dynamics, vol. 15, no. 6, Nov/Dec 1992, pp. 1427-1428. © 1992 AIAA. Reprinted by permission of the American Institute of Aeronautics and Astronautics, Inc. P7.29: Yin, G , Chen, N , Li, P., Improving Handling Stability Performance of Four-Wheel Steering Vehicle via |x-Synthesis Robust Control, IEEE Transactions on Vehicular Technology vol. 56, no. 5,2007. Fig. 2, p. 2434. pp. 2432-2439 © 2007 IEEE. Reprinted with permission. P7.32: Hess, R. A.; Malsbury, T ; and Atencio, A., Jr. Flight Simulator Fidelity Assessment in a Rotorcraft Lateral Translation Maneuver, Journal of Guidance, Control, and Dynamics, vol. 16, no. 1 Jan/Feb 1993, p. 80. © 1992 AIAA. Reprinted by permission of the American Institute of Aeronautics and Astronautics, Inc. P733(a), (b): Ohnishi, K.; Shibata, M.; and Murakami, T. Motion Control for Advanced Mechatronics, IEEE/ASME Transactions on Mechatronics, vol. 1, no. 1, March 1996, (a): Fig. 14, p. 62, (b): Fig. 16, p. 62. © 1996 IEEE. Reprinted with permission.
Chapter 8 8.4(a): Largeformat 4x5/iStockphoto. P8.13: Tony Dejak/©AP/Wide World Photos. North America, Inc. P8.13(b): Adapted from Hardy, H. L. MultiLoop Servo Controls Programmed Robot, Instruments and Control Systems, June 1967, p. 105. P8.14: GNC FSSR FC Ascent, vol. 1, June 30,1985 (Downey,
Credits CA: Rockwell International). P8.15(a): Bruner, A. M.; Belvin, W. K.; Horta, L. G.; and Juang, J. Active Vibration Absorber for the CSI Evolutionary Model: Design and Experimental Results, Journal of Guidance, Control, and Dynamics, vol. 15, no. 5, Sept/Oct 1992, p. 1254. © 1992 AIAA. Reprinted by permission of the American Institute of Aeronautics and Astronautics, Inc. P8.17: Karlsson, P., and Svensson, J. DC Bus Voltage Control for a Distributed Power System, IEEE Trans. Power Electronics, vol. 18, no. 6, 2003. Fig. 4, p. 1406. pp. 1405-1412. (c) 2003 IEEE. P8.20: Cho, D., and Hedrick, J. K. Pneumatic Actuators for Vehicle Active Suspension Applications, ASME Journal of Dynamic Systems, Measurement and Control, March 1985, p. 68, Fig. 4. Reprinted with permission of ASME. P8.23(a), (b): Adapted from Annaswamy, A. M., and Ghonien, A. F. Active Control in Combustion Systems, IEEE Control Systems, December 1995, p. 50,51, and 59. © 1995 IEEE. Reprinted with permission. P8.24(a): © Hammondovi/iStockphoto. P8.24(b), (c): Adapted from Anderson, C G ; Richon, J.-B.; and Campbell, T. J. An Aerodynamic Moment-Controlled Surface for Gust Load Alleviation on Wind Turbine Rotors, IEEE Transactions on Control System Technology, vol. 6, no. 5, September 1998, pp. 577-595. © 1998 IEEE. P8.25: Reproduced by permission of M. Spong et al., Robot Modeling and Control. John Wiley & Sons. Hoboken, NJ, 2006. Fig. 6.20, p. 221. Reprinted with permission of John Wiley & Sons, Inc. P8.26: Reproduced by permission of M. Spong et al., Robot Modeling and Control. John Wiley & Sons. Hoboken, NJ, 2006. Fig 6.22, pg 223.
Chapter 9 9.46: Photo by Mark E. Van Dusen. P9.5: Romagnoli, J. A., and Palazoglu, A. Introduction to Process Control, CRC Press, Boca Raton, 2006. p. 44, Fig. 3.4. P9.6: Smith, C. A. Automated Continuous Process Control. John Wiley & Sons, New York,NY,2002.p.l28,Fig.6-l.l.P9.14(a): Cho, D ; Kato, Y; and Spilman, D. Sliding Mode and Classical Controllers in
Magnetic Levitation Systems, IEEE Control Systems,Feb. 1993,p.43,Fig. 1. © 1993 IEEE. Reprinted with permission.
Chapter 10 10.1: Courtesy National Instruments Corporation © 2010 P10.14: © Michael Rosenfield/ Science Faction/©Corbis. P10.15(a): © Stephen Sweet/iStockphoto. P10.17: Van der Zalm, G , Huisman, G , Steinbuch, M., Veldpaus, F , Frequency Doman Approach for the Design of Heavy-Duty Vehicle Speed Controllers, International Journal of Heavy Vehicle Systems vol 15, no. 1.
Chapter 11 11.10(a), (b): Katharina Bosse/laif/ Redux Pictures. P11.3(a): Rebecca Cook/Rueters/© Corbis.
Chapter 12 12.1: Robin Nelson/Zuma Press. P12.6: Tadeo F , Perez, Loepez O., and Alvarez T Control of Neutralization Processes by Robust Loopsharing. IEEE Trans. on Cont. Syst. Tech., vol. 8, no. 2, 2000. Fig. 2, p. 239.
Chapter 13 13.12: © David J. Green—Industry/ Alamy 13.28: Adapted from Chassaing, R. Digital Signal Processing (New York: John Wiley & Sons, Inc, 1999), p. 137. © 1999 John Wiley & Sons, Inc. Reprinted with permission of John Wiley & Sons, Inc. 13,29: Adapted from Chassaing, R. Digital Signal Processing (New York: John Wiley & Sons, Inc., 1999), p. 137. © 1999 John Wiley & Sons, Inc. Reprinted with permission of John Wiley & Sons, Inc. 13.36: Adapted from Chassaing, R. Digital Signal Processing (New York: John Wiley & Sons, Inc, 1999), p. 137. © 1999 John Wiley & Sons, Inc. Reprinted with permission of John Wiley & Sons, Inc.
Figure Caption Sources Back Cover: cover photo caption from Dennis Hong/Virginia Polytechnic
905
Institute. 1.3(b): The World of Otis, 1991, p. 2, and Tell Me About Elevators, 1991, pp. 20-25, United Technologies Otis Elevator Company. © 1991 Otis Elevator Company. 1.8: Overbye, D. The Big Ear, OMNI, Dec. 1990, pp. 4 1 ^ 8 . 5.33: Ballard, R. D. The Discovery of the Titanic (New York: Warner Books, Inc., 1987). 6.9: Ballard, R. D. The Riddle of the Lusitania, National Geographic, April 1994, pp. 68-85. 6.11: FANTJC Robotics North America, Inc., 7.9: Bylinski, G. Silicon Valley High Tech: Window to the Future (Hong Kong: Intercontinental Publishing Corp., Ltd., 1985). 10.1: National Instruments Corporation
Trademarks AMTRAK is a registered trademark of National Railroad Passenger Corporation. Adobe and Acrobat are trademarks of Adobe Systems, Inc. which may be registered in some jurisdictions. FANTJC is a registered trademark of FANUC, Ltd. Microsoft, Visual Basic, and PowerPoint are registered trademarks of Microsoft Corporation. QuickBasic is a trademark of Microsoft Corporation. MATLAB and SIMULINK are registered trademarks of The MathWorks, Inc. The Control System Toolbox, LTI Viewer, Root Locus Design GUI, Symbolic Math Toolbox, and MathWorks are trademarks of the MathWorks, Inc. Intelligent Soft-Arm Control (ISAC) is a trademark of the Intelligent Robotics Lab, Vanderbilt University. HelpMate is a trade-mark of HelpMate Robotics, Inc. Lab VIEW is a registered trademark of National Instruments Corporation. Segway is a registered trademark of Segway, Inc. in the United States and/or other countries. Chevrolet Volt is a trademark of General Motors LLC. Virtual plant simulations pictured and referred to herein are trademarks or registered trademarks of Quanser Inc. and/or its affiliates. © 2010 Quanser Inc. All rights reserved. Quanser virtual plant simulations pictured and referred to herein may be subject to change without notice.
Index
Abscissa of convergence, 35n Absorption, 146-148 Acceleration constant, 595 Achouayb, K., 115 Ackerman's formula, 678 Acoustic waves, 444 Active-circuit realization, of compensation, 504 Active queue management (AQM) algorithm, 383 Active suspension system, 291,379,443 Active vibration absorber, 440 Actuating signal, 9 Actuator block diagram, 290 Admittance, 54 AFTI/F-16 aircraft attack control system, 718 bearing angle control, 527 Aggarwal, J. K., 115 AIDS. See HIV/AIDS Aircraft attitude, 24 Aircraft longitudinal dynamics, 153 Aircraft roll control system, 658 Alertness monitoring, 27 Alvarez, X, 721 Alvin, 272 Amplifier saturation, 88 load angular velocity response and, 197 Amplifier saturation simulation, with Lab VIEW program, 878-880 Amplifiers operational, 58-61 transfer functions and, 94 Amplitudes, 164 AMTRAK train active suspension system, 443 Anagnost, J. J., 337 Analogs explanation of, 84-85 parallel, 86-87 series, 85-86
Analog-to-digital control conversion, 726-727 antenna azimuth for, 724 steps to, 727 Analysis of control systems, 10-15,18-19 via input substitution, 366-367 Anderson, C. G., 447,452 Anesthesia regulation, 26,221 Angles of departure/arrival from complex pole, 409 in root locus sketching, 407-409 Angular displacement, in lossless gears, 75 Angular velocity, 82 Annaswamy, A. M., 445,452 Antenna azimuth, 12 analog- to-digital control conversion for, 724 block diagram for, 18 position control system, 13-15,208 Antenna azimuth position control, state-space design for, 708 Antenna control, 94 cascade compensation and, 650-651 closed-loop response design for, 272-276 controller/observer design and, 704-709 digital cascade compensator design and, 767-769 gain design and, 650-651 lag-lead compensation and, 508-511 open-loop response and, 207-208 root locus for, 426 stability design/transient performance and, 606-607 stability design via gain, 323-325 state-space representation and, 144 steady-state errors and, 368-371 transient design via gain and, 426-427,765-767 Aquifer system model, 147 Aquifers, 147-148 Aragula, S., 223 Arc welding robot, 439 Armature, 80 Armature circuit, 16,80 907
908
Index
Armature resistance, 81 Armature voltage, 80 torque-speed curve with, 82 Artificial heart, open-loop transfer function, 223 Ashkenas, I., 233 Assembly-line robots, steady-state errors and, 354 Astrom, K., 299,452,616,623,759,780 Asymptotes break frequency, 542 high-frequency, 542 low-frequency, 542 root locus sketching with, 400-402 Asymptotic approximations, 540-559 Atencio, A., Jr., 386 Atracurium, 221 Automated guided carts, for Chevrolet Volt electric vehicles, 657 Automatic generation control (AGC), 524 Automobile guidance system, 380 Ayers, J., 25,31 Back electromotive force, 80 Backlash, 74,88 Backlash effect, on load angular displacement response, 199 Bagchi, S., 337,623 Bahill,A.T.,31 Bailey, F. R , 289,299 Ball-drop experiment, 155 Ballard, R. D., 289,336 Bandwidth, 581 Baratta, R. V, 234 Barkana, I., 377,386,661 Barlow, J. B., 532,721 Barrows, B., 299 Bathtub water level, 25 Bechhoefer, X, 27,31 Behavior at infinity, root locus sketching and, 399-402 Bell Telephone Laboratories, 5 Belvin,W.K.,452 Ben-Dov, D., 290,299 Bennett, S., 4n, 31 Benningfield, L. M., 116 Bessemer, Henry, 5 Bicycle dynamics, 295 Bilinear transformations, in digital control systems, 746-747 Biological system, 95-97 Bittanti, S., 525,531,616,623,775,780 Bittar, A., 333,337 Black Hawk (UH-60A) helicopter, 382 Block diagram(s), 17-18 of multiple subsystems, 236-237 Block diagram reduction, 18 digital control systems and, 739-742 by moving blocks, 243-245 of sampled-data systems, 740-741
via familiar forms, 242-243 Block diagram window, in Lab VIEW program, 862-868 Block parameters, in MATLAB Simulink program, 843-845 Blood vessel blockages, 108 Bode, H.W., 5 Bode plots of (s+a), 542 for G(s) = (s+a), 541-544 for G(s) = 1/s, 545-546 for G(s) = l/(s 2 + 2 ^
+ &>2T|), 552-556
for gain adjustment, 628 gain margin/phase margin from, 579 for G(s) = s, 545 for G(s) = s2 + 2£
Index in digital control systems, 759 steady-state error design via, 626 steady-state errors via, 459-469 transient response improvement via, 469-481 Cascade compensation via s-plane, digital control systems and, 758-762 Cascade compensators, 494 Cascaded interconnections, 34 Cascaded subsystems, 238 Cascaded systems, load in, 238 Cascade form of multiple subsystems, 237-239 of state space, 257-259 Cascade PI controller, robotic manipulator with, 447 Catenary, pantograph and, 110 Cavallo, A., 153,159,289,299,452 Cereijo, M. R., 159 Characterizing response, from damping ratio, 176 Charge-coupled device, in digital camera, 617-618 Chassaing, R., 763n, 780 Chebyshev, P.L., 5 Chemical process, temperature control system, 525 Chesmond, C. J., 380,386 Chetouani, A., 115 Chevrolet Volt electric vehicles, automated guided carts for, 657 Chignola, R., 109,115 Chiu, D. K., 153,159 Cho, D., 153,452,531,715,721 Circuit, transformed, 49 Classical technique, 118. See also Frequency-domain technique Cleveland, J. P., 233 Clifford, William Kingdon, 5 Closed-loop frequency responses, closed-loop transient responses and, 580-583 Closed-loop/open-loop frequency responses, relation between, 583-588 Closed-loop polar plot, 587n Closed-loop poles, 303-305,388-389,392,415,418, 424,461 Closed-loop response design, for antenna control, 272-276 Closed-loop step response, with Lab VIEW program, 869-871 Closed-loop system, 9,162 block diagram of, 8 error, 342 for ideal integral compensator, 461 root sensitivity of, 425 Closed-loop transfer function, sensitivity of, 362-363 Closed-loop transient responses closed-loop frequency responses and, 580-583 open-loop frequency responses and, 589-592 Closed-loop vehicle response, for train stopping, 441 Cochin,!., 115,159
Cochran, J. E., 332,337,661 Cockburn, J. C , 288,299 Coefficient of viscous friction, 62,70 Combustor, with microphone/loudspeaker, 445 Companion matrices, 262 Compensated system, root locus for, 462 Compensating zero, via rate feedback, 497-500 Compensation active-circuit realization of, 504 physical realization of, 503-508 techniques, 458 Compensator, 9 passive realization of, 506 root locus with, 460 root locus without, 460 Completely controllable, 674n Completely observable, 691 n Complex circuits via mesh analysis, 51-52 via nodal analysis, 54-56 Complex numbers, vector representation of, 389-391 Complex pole, angle of departure/arrival from, 409 Component design, transient response through, 185-186 Component responses, of three-pole system, 188 Computer-aided design, 20-21 Computer-controlled systems, 9-10 Computer hard disk drive, 10 Computer simulation, of step responses, 429 Conductance, 54n Conservation, flow for, 148 Constant-acceleration inputs, 341 Constant command, 18 Constant M circles, 583-584,586 Constant N circles, 583,585,586 Constant-velocity inputs, 341 Continuous casting, in steel production, 294 Continuous stirred tank reactor, 715 Contours, 560-563 Control design palette, in LabVIEW program, 883-885 Controllability, 672-676 by inspection, 673-674 via controllability matrix, 675-676 Controllability matrix, 674 controllability via, 675-676 Controlled variable, 34 Controller canonical form, of state space, 260-262 Controller design, 665-672 alternative approaches to, 676-682 by matching coefficients, 677 for phase-variable form, 669-671 by transformation, 679-681 Controller/observer design, antenna control and, 704-709 Control system problem, for root locus, 388-389
909
910
Index
Control systems. See also Feedback control systems; specific control systems advantages, 3-4 analysis of, 10-15,18-19 components, 2 configurations of, 7-10 derivative, 459 description of, 2 design, 18-19 digital computers in, 6 engineering, 21-22 history of, 4-7 integral, 459 prevalence of, 23 proportional, 459 schematic for, 16-17 test waveforms, 19 theory, 5 twentieth-century developments, 5 Control systems analysis, with Lab VIEW program, 858-859 Control System Toolbox, 157,228,248,297,335,384, 450-451,530-531,621,660,778-779 Convolution integral, 203 Cook, P. A., 115 Cooper, P. A., 386 Coordinate measuring machine, 525-526 Coulomb friction, 65n Craig, I. K., 31,110,115,156,159,228,232,299,337,383,386, 452,529,531,621,623,659,662,718,721,777,780 Cramer's rule, 53 Crane loading, 107 Crawshaw, L. I., 32 Critically damped response, 171-172 Critical points, root locus sketching and, 412^414 Crosslapper, 224 Cubitt, William, 5 Cutaneous rabbit, 28 Cutting force control system, 332 D 'Alembert's principle, 17 D'Ambrosia, R. D., 234 Damped frequency of oscillation, 182 Damper, mass and, 125 Damping, 81 Damping frequency, exponential, 182 Damping ratio characterizing response from, 176 definition of, 174 natural frequency and, 208 v. percent overshoot, 180 from phase margin, 589-591 v. rise time, 182 of second-order system, 173-175 second-order underdamped responses for, 178 Dancer, 25
Davis, S. A., 115 D'Azzo, J. X, 31,337,386,531,662,721 Dc-dc converter, 225 Dc motor, 79 driving rotational mechanical load, 81 load and, 83-84 Dc servomotor, load and, 152 Deadzone effect, on load angular displacement response, 198 Decay frequency, exponential, 174 de Araujo, F. M., 116,453,623 Decoupled equations, 292 Decoupled variables, 125 Dee, A., 288,299 Deflection response, of fluid-filled catheter, 222 Degrees of freedom, 65 in rotational systems, 70 De Keyser, R., 299 Dell'Orto, R, 531,623,780 De Maria, G., 153,159,299,452 Dependent source, electrical network with, 128-130 Derivative compensation, ideal, 470-477 Derivative control systems, 459 Design computer-aided, 20-21 with LabVIEW program, 858-859 objectives, 10-15 theory, 5 Design process flowchart of, 15 steps of, 15-20 Design via frequency response, with MATLAB program, 818823 Design via root locus, with MATLAB, 808-813 Design via state space, with MATLAB program, 823-826 Desoer, C. A., 337 de Vlugt, E., 292,299 Destination shaft, 76 Diabetes population model, 105 Diagonalizing system in state space, 270-271 system matrix, 268 DiBona, G. E, 222,232 Di Carlo, A., 531,623,780 Differential calculus, 404 Diesel power distribution system, hybrid solar cell and, 294 Differential equation coefficients, 5 Laplace transform solution of, 39-40 linearization of, 91-92 single loop via, 48-49 transfer function for, 45 Digital camera, charge-coupled device in, 617-618 Digital cascade compensator design, 760-761 antenna control and, 767-769
Index Digital compensator, implementing, 762-765 Digital computers advantages, 725-726 in control systems, 6 modeling, 727-730 placement within loop, 725 Digital control systems, 723-725 bilinear transformations in, 746-747 block diagram reduction and, 739-742 cascade compensation in, 759 cascade compensation via s-plane and, 758-762 digital system stability in, 742-749 gain design on z-plane and, 755-758 with MATLAB program, 827-833 with MATLAB Simulink program, 852-855 stability design via root locus in, 755-756 steady-state errors and, 749-753 transfer functions of, 735-739 transient response design via gain adjustment and, 756-757 transient response on z-plane, 753-755 z-transform and, 730-735 Digital feedback control system steady-state errors for, 750 unit parabolic input for, 751 unit ramp input for, 751 unit step input for, 750-751 Digital numerical control, lathe with, 742 Digital system simulation, with LabVIEW program, 881-885 Digital system stability digital control systems in, 742-749 via Routh-Hurwitz, 748 via 5-plane, 747-748 via z-plane, 742-743 Digital-to-analog conversion, 729 Digital versatile disc players, 525 Dirac delta functions, 729 Disk drive arm, 447 Disk drive position control system, 442 Distributed parameter, 71n Disturbances, steady-state errors for, 356-358 DoebelimE. 0.,31,115 Dominant-pole argument, 223 Dorf, R. C , 31,115,193,232,337,453,531,623,662 Drebbel, Cornelis, 4 Driving simulator, 642 DVD player, 7 Drug absorption, 146-148 D'Souza,A.F.,26,31,115 Duals, 263 Dynamic voltage restorer (DVR), 378,441 Dynamometer, 26 Dynamometer test, 81,82 Economics, as design consideration, 12 ECU. See Electronic control unit
911
Edelstein-Keshet, L , 108,109,115 Eigenvalues, 268 poles and, 200-202 transfer function poles and, 200-202 Eigenvector, 268,269 Ekeberg, 6., 159 Electrical constants, of motor transfer function, 82 Electrical network branch currents in, 126 with dependent source, 128-130 representation of, 126-127 transfer function, 46-61 Electrical to mechanical systems analogies, 62 Electric circuit analogs, 84-87 Electric network, 28 Electric ventricular assist device (EVAD), 292,776 Electromagnetic systems, 79-84 Electromechanical system transfer functions, 75-80 Electronic control unit (ECU), 30 Elevator response, 2 Elevators, 3 El-Gamal, M., 337,623 Elkins,J.A.,U5,159 El-Samad, H., 453 Emami-Naeini, A., 31,115,159,232,453,623,721 Energy storage elements, 126 Enzyme breakdown, 107 Eppinger, S. D., 32,116,160,233,300,337,386,453,532,624, 662,721,781 Epsilon method, stability vi, 308-309 Equations of motion, 63,71 by inspection, 67-68,72-73 Equilibrium, 89 Errors, 9. See also Steady-state errors Estimator, 682 EVAD. See Electric ventricular assist device Evans, X, 288,299 Evans, Walter, 5 Existing transient response, 10 Exponential damping frequency, 182 Exponential decay frequency, 174 Exponential frequency, 167 Exponential response, 164 Exponential time constant, 174 F4-E military aircraft pitch stabilization loop, 444 steering control, 153 Factoring, via Routh-Hurwitz, 319 Fagergren, A., 155,159 Fahlen, P., 337,624 FANUC M-410iB robot, 323 Feedback amplifier analysis, 5
912
Index
Feedback compensation, 495-503 approach 1,496-500 approach 2,500-503 generic control system, 495 minor-loop, 500-503 Feedback control systems, 9,240. See also Control systems; specific control systems analysis/design of, 245-246 for ideal derivative compensation, 472 with MATLAB Simulink program, 850-852 Feedback form, of multiple subsystems, 240-241 Feedback path, 9 Feedback system simulation, with Lab VIEW program, 880881 Fenn's law, 291 Fertilizer applicator, 448 Final value theorem, steady-state errors using, 365 Finances, of control systems, 12 First-order system, 166-168 poles of, 163 unit step and, 166 zeros of, 163 First-order transfer functions via testing, 167 Fission reaction, 25 Fixed field, 80 Floor vibration eliminator, 447 Floppy disk drive, block diagram, 617 Flower, T. L., 662 Flow for conservation, 148 Fluid-filled catheter, deflection response, 222 Flyball speed governor, 5 Force-displacement, 62 Forced response, 11,162,164 Force-velocity, 62 Foroni, R. I., 115 Forssberg, H., 159 Forward-path gain, 251 Forward-path transfer function, 445 Forward transfer function, 339. See also Open-loop transfer function Frankle,J.T.,32 Franklin, G. E, 31,115,159,231,453,623,721 Free-body diagram, 63 transformed, 63 Free viruses, 110 Frequency, exponential, 167 Frequency domain modeling, with MATLAB program, 788793 Frequency-domain technique, 118. See also Classical technique Frequency/gain, at imaginary-axis crossing, 406-407 Frequency response analytical expressions for, 536-537 concept of, 535-536 lead compensator, 636-637
with MATLAB program, 813-818 sinusoidal, 535 steady-state errors from, 593-597 techniques, 533-608 from transfer function, 538-539 Frequency response design methods antenna control and, 650-652 lag compensation and, 630-635 lag-lead compensation and, 641-650 lead compensation and, 635-641 overview of, 627 root locus and, 626 transient response via gain adjustment and, 627-630 Frequency response plots, 537-538 of time delay systems, 598-599 Friction, 65n Fuel-cell power plants, 6 Functional block diagram, 14 drawing of, 16 Functions, linearizing, 90 G(s), steady state error as, 345-348 Gain-adjusted antenna control system, step responses of, 427 Gain adjustment bode plots for, 628 stability/transient response design via, 626 transient response design via, 415-419,626 transient response via, 627-630 Gain design antenna control and, 650-651 for transient response, 247-248 Gain design on z-plane, digital control systems and, 755-758 Gain margin/phase margin from Bode plots, 579 evaluating, 578 via Nyquist diagram, 574-576 Galvaeo, R.K.H., 115,453,616,623 Gamble, J.B., 26,32,300 Gas-fired heater, block diagram, 717 Gauthier, M., 234 Gear backlash, 88 Gear driven rotational systems, 75 Gear systems, 74-78 with loss, 77-78 motion equation for, 77 schematic, 74 Gear train, 77 Geselowitz, D. B., 300,662,781 Ghonien, A. F., 452 Gillard, D., 234 Glantz, A. S., 222,232 Global carbon cycle, schematic description of, 155 Golbon, N., 532,781 Gompertz growth model, 109 Gong, W , 386,453,623,662
Index Good, M. C , 233, 623 Graham, D., 233 Graphical user interface (GUI), 196 Griggs, G. E., 115,159 Graphical user interface (GUI), 20,21 Grinder system, 26 GUI. See Graphical user interface Guy, W., 453 Gyro systems, 151 Hacisalihzade, S. S., 32 Hammel, H. T., 32 Han, Y. D., 386,453 Harbor, R. D., 337,662 Hardy, H. L., 439,453,774,780 Harmonic drives, robotic manipulator with, 448 Hatopoglu, C , 454 Head, 147 Heat-exchanger process, 521-522 Hedrick, J. K., 452 Hekman, K. A., 333,337 Heller, H. G, 32 HelpMate transport robot, 288-289 Hess, R. A., 382,386 High-frequency asymptotes, 542 High-speed proportional solenoid valve, 26 High-speed rail pantograph control problem, 28-29,109-110, 155-156,227,296-297,334,383,449,528,620-621,659, 718,777 HIV/AIDS control system problem, 29,110-111,156, 227-228,297,334-335,383,449-450,528-529, 621,659, 718-719,777 Hogan, B. X, 32 Hold zero-order, 728 zero-order sample-and-, 726,730,737-738 Hollot, C. V., 386,441,453,623,662 Home entertainment systems, 6 Homogeneity, 88 Hong, X, 152,160 Horizontal canards, 153 Hormonal regulation mechanisms, 441 Horta, L. G , 452 Hospital pharmacy robot, 664 Hostetter, G. H., 32,299,337,386,531,623,662,720,780 Houpis, G H., 31,337,386,531,662,720 Hsu, J.C., 115 Hubble Space Telescope (HST), 619 Human eye movement, 288 Human growth population, 108 Human leg, transfer function of, 95-96 Human postural dynamics, 107 Human response, to visual cue, 220 Hybrid solar cell, diesel power distribution system and, 294
913
Hybrid vehicle control problem, 29,111-112,156-157,228, 297-298,335,384,529,621,660,719,777-778 Hydraulic actuator, 26 Hydraulic circuits, 227 Hydraulic pumps, 227 diagram of, 227 Hypothalamic-pituitary-adrenal axis, linear time-invariant model of, 154 ICE. See Internal combustion engine Ideal compensators, 458 Ideal derivative compensation, 469,470-480 design, 472-476 feedback control system for, 472 predicted characteristics for, 471 root locus for, 473,475 uncompensated/compensated system, 472-473 Ideal integral compensated system response, uncompensated system response and, 463 Ideal integral compensator, 459,461 closed-loop system for, 461 effect of, 461 implementing, 463 Ideal sampling, zero-order hold and, 730 Identity matrix, 139 Ignatoski, M. A., 300,622,781 Imaginary-axis crossing, frequency/gain at, 406-407 Impedance for mechanical components, 64 Impedance relationships, 48 Impedance rotational relationships, 70 Impedance translational relationships, 62 Implantable medical devices, with in-body batteries, 447 Impulse, 18,19 In-body batteries, implantable medical devices with, 447 Inductors, 130 Industrial robots, 200-221,617. See also Robots Inertia, 17,70,81 moment of, 70 Inherent disturbance suppression, 775 Inigo, R. M , 160 Initial conditions, 45 Inner ear hair cell transducers, 105 Innocenti, M., 337,661 Input, 2 Input potentiometer, 94 Input signals root locus and, 421 test of, 18 Input substitution analysis via, 366-367 steady-state errors using, 367 Input transducer, 8 Insect flight dynamics, 225 Inspection, mesh equations via, 56-57 Instability, 11,302,303-304. See also Stability
914
Index
Insulin concentration-time evolution, 153-154 Integral control design, 701-703 steady-state error design via, 700-704 systems, 459 Intelligent Soft Arm Control (ISAC), 331,332 Interconnection of subsystems, block diagram of, 34 Internal combustion engine (ICE), 29 Inverse Laplace transform, 35,36,166 Inverse z-transform via partial-fraction expansion, 733-734 via power series method, 734 Inverting operational amplifier, 58 circuit, 59 schematic, 58 lonescu, C , 233 Ionic polymer-metal composite, 225 ISAC. See Intelligent Soft Arm Control Isailovic, X, 386 Isoflurane, 221 Jannett, T. C , 221,233 Jason, 317 Jason Junior, 272 Jenkins, H. E., 26,32 Johansson, R., 116 Johnson, H., 233,289,299,337,453,531,780,800,835 Johnson, R. E., 227,233 Joint flexibility, model representing, 448 Jordan canonical form, 260 Juang, J., 452 Jury's stability test, 745 /co-axis crossings, root locus sketching and, 405-407 Kailath,T., 35,116,160,721 Kandel, A., 160 Kanellakopoulos, I., 107,116,291,300,386 Kara, A., 337,616,623 Kato, Y., 531,721 Katz, P., 781 Kawamura, K., 332,337,623 Kermurjian, A , 116 Kesson, M., 116 Khaminash, M., 453 Kharitonov's theorem, 330 Khodabakhshian, A., 524,532,776 Kirchhoffs current law, 17,47,84 Kirchhoff's nodal equations. See Nodal equations Kirchhoffs voltage law, 17 Klaasens,J.B.,234,722 Klapper, J., 32 Klein, R. E., 299,452,623 Knight, B., 234 Koontz, J. W., 300,662,781 Kostis, J. B., 109,116
Krishnamurthy, B., 299 Ktesibios' water clock, 4,290 Kumar, R. R., 380,386 Kuo, B. C , 233,453,532,623,662,745n, 781 Kuo, F. E, 116,623 Kurfess, T. R., 26,32 Kurland, M., 287,299 Kwatny, H. G., 453,662 Kyrylov, V , 154,160,714,721 LabVIEW program, 21 amplifier saturation simulation with, 878-880 analysis examples with, 862-875 block diagram window in, 862-868 closed-loop step response with, 869-871 control design palette in, 883-885 control systems analysis with, 858-859 design examples with, 862-875 design with, 858-859 digital system simulation with, 881-885 feedback system simulation with, 880-881 linear systems simulation with, 876-878 open-loop/closed-loop sinusoidal frequency analysis/design with, 873-875 open-loop step response with, 862-869 root locus analysis/design with, 871-872 simulation palette in, 881-882 simulation with, 858-859 using, 859-862 Lag compensation, 464-469,630-635 design procedure, 631-634 root locus and, 465 type 1 systems, 464 visualizing, 630-631 Lag compensator, 459 design, 466-468 Lag-lead compensation, 641-643 antenna control and, 508-511 design procedure, 643-646 using Nichols chart, 646-649 Lag-lead compensator, 487 design, 487-491 ramp response error for, 491 root locus for, 488,489,490 Lago, G , 116 Lam, C. S., 379,386,453 Landesberg, A., 300 Laplace transform, 17,35-36 definition of, 35 of differential equation, 39-40 inverse, 35,36 review, 35-44 of state-transition matrix, 203-204 state-transition matrix via, 206-207 table, 36
Index theorems, 37 of time function, 35-36 Laplace transformed circuit, 49 Laplace transform solution, 200-202 of state equations, 198-202 Lathe, with digital numerical control, 742 Lead compensation, 477-481 Bode plots for, 639 design, 478-481,637-640 geometry of, 477 possible solutions, 478 visualizing, 635-636 Lead compensator, 469 frequency response, 636-637 realization, 507 Ledgerwood, B. K., 115 Lee, Edmund, 4 Lee, S., 153,159 Lennartsson, A., 299,452,623 Leo, D. J., 233 Lepschy, A. M., 289,300,377,386 Lewis, F. L., 222,232 Liang, S. Y., 337 Liceage-Castro, E., 154,160 Liew, K. M., 386,453,623 Lim, T. W., 386 Lin, J.-S., 107,116,291,300,379,386 Lin, R., 338,454,662 Linear combination, 121 Linear control systems analysis, 5 Linear independence explanation of, 123 state variables and, 123-124 Linear systems, 88 Linear system simulation with Lab VIEW program, 876-878 with MATLAB Simulink program, 842-848 Linear time-invariant differential equation, 17 Linear time-invariant model, of hypothalamic-pituitaryadrenal axis, 154 Linear voltage differential transformer (LVDT), 26,223 Linearity, 88 Linearization, 89-97 about a point, 89 of differential equations, 91-92 of function, 90 state-space representation and, 141-143 Linearized magnetic levitation system block, 440 Linearly dependent motions, 65 Linearly increasing command, 19 Linearly independent, 122 state variables, 124-125 Linkens, D. A., 221,233 Liquid-level control, 4 Lithium-ion battery charger, 333
915
Liu, A. Q., 222, 232 Load in cascaded systems, 238 dc motor and, 83-84 dc servomotor and, 152 motor and, 95,144-145 tester, 289 Load angular displacement response backlash effect on, 199 deadzone effect on, 198 Load angular velocity response, amplifier saturation and, 197 Log-magnitude plots, 541-542,551-552,576-577 Longitudinal flight model linearization, 224 Look-ahead offset, 334 Loop analysis. See Mesh analysis Loop gain, 241,251 Loops major, 496 minor, 495,496 nontouching, 251 Lordi, N. G., 160 Lossless gears, 75 angular displacement in, 75 system with, 76-77 Low back pain, motor trunk patterns and, 223 Low, K. H., 386,453,616,623 Low-frequency asymptotes, 550 LTI Viewer, 217,229,230,575,579 Ludwick, S. X, 26,32 Luenberger, D. G., 721 Lumelsky, V, 299 Lumped parameter, 71 n Lusitania, 317 Lyapunov, Alexandr Michailovich, 5 Mablekos,VE.,116 Magnetic levitation transportation system, 332,526-527 Magnitude frequency response, 536 Magnitude plots, 537 Magnusson, M., 116 Mallavarapu, K., 225,233 Malsbury, T., 386 Malthus, Thomas, 108 Manned submersible, 272 Manring, N. D., 227,233 Mapping contour, 560-561 Mapping only positive /Va-axis, stability via, 571-573 Marginally stable systems, 303,304 Marginal stability, 302 Martin, R. H., Jr., 32 Marttinen, A , 108,116,330,337,616,623 Mason, S. J., 251,300 Mason's rule multiple subsystems and, 251-254 transfer function via, 252-253
916
Index
Mass, 62,64 damper and, 125 Matching coefficients, controller design by, 677 Mathematical models, 17-18 from physical system schematics, 34 Math Works Inc., 20 MATLAB program, 20-21 command summary for, 833-835 design via frequency response with, 818-823 design via root locus with, 808-813 design via state space with, 823-826 digital control systems with, 827-833 examples, 788-833 frequency domain modeling with, 788-793 frequency response techniques with, 813-818 M-files with, 787 multiple subsystems with, 799-804 root locus with, 806-808 stability with, 804-805 time domain modeling with, 793-795 time response with, 795-799 using, 787 MATLAB Simulink program accessing, 837 block parameters in, 843-845 creating new model with, 838 digital control systems with, 852-855 examples, 841-855 feedback systems with, 850-852 libraries, 838-841 linear system simulation with, 842-848 saturation nonlinearity with, 848-850 simulation parameters in, 846-847 using, 836-841 Matrices companion, 262 controllability, 674-676 observability, 691-693 state-transition, 203,204,206-207 system, 268,270-271 transformation, 266,268,270,272 Maxwell, James Clerk, 5 May, F. P., 722 Mayr, O., 4n, 32 McRuer, D., 224,233 Mechanical constants, 81 Mechanical displacement, 62 Mechanical system into parallel analog, 87 into series analog, 86 Mechanical system transfer functions rotational, 69-74 translational, 61-69 Meier, R., 32 MEMS (Micro Electromechanical System), 221
Mendoza, C , 116 Mesh, 48-49 Mesh analysis complex circuits via, 51-52 single loop via, 48-50 Mesh equations, via inspection, 56-57 Meyer, A. U , 116 M-files, with MATLAB program, 787 Mian, G. A., 290,300,386 Michaelis-Menten equations, 107 Micro Optical Electromechanical Systems (MOEMS), 221 Milhorn, H. T , Jr., 288,300,721 Milsum,J.H.,105,116 Minnichelli, R. X, 300,337 Minor loop, 495,496 Minor-loop feedback compensation, 500-503 root locus for, 502 step response simulation for, 503 Minorsky, Nicholas, 5 Misra, V., 386,453,623,662 Missile control system modeling of, 743-745 stability of, 743-745 Missile steering control, 152 MOEMS. See Micro Optical Electromechanical Systems Monahemi, M. M., 532,721 Moment of inertia, 70 Momentum wheel, pitch axis attitude control system with, 444 Motion equation, for gear systems, 77 Motors explanation of, 79-80 transfer functions and, 95-96 Motor, load and, 95,144-145 Motorcycle radio volume, 25 Motor dead zone, 88 Motor transfer function, electrical constants of, 82 Motor trunk patterns, low back pain and, 223 Mott,C.,27,32 Multiple loops, 52-53 Multiple nodes, 54 with current sources, 55-56 Multiple root of multiplicity, 40 Multiple subsystems. See also Subsystems background on, 236 block diagrams of, 236-237 cascade form of, 237-239 feedback form of, 240-241 Mason's rule, 251-254 with MATLAB program, 799-804 parallel form of, 239 signal-flow graphs of, 248-251 similarity transformations, 266-277 in space shuttle, 237
Index Multiplicity, 40 Murakami, X, 386 Muscle relaxation, 221 Nafion sheet, 225 Nagle,H.T.,233,781 Nakamura, M., 223,233 Nano-positioning device, 223 NASA flight simulator robot arm, 79 Nashner, L. M., 221,233 National Instruments PXI, 534 Natural frequency damping ratio and, 208 of general second-order system, 172 Natural period, 174 Natural response, 11,162,164 n-channel enhancement-mode MOSFET Source Follower circuit, 280-281 Neamen,D.A.,291,300 Negative feedback, 240n Negative-feedback systems, 421 Negative step response, of pitch control, 212 Network theory, 127 Newbury, K., 233 Newton's laws, 17,63 Nichols charts, 587-588 lag-lead compensation design using, 646-649 Nieuwland, J., 32 Nilsson,J.W.,116,624 No, T. S., 337,661 No-load speed, 82 Nodal analysis complex circuits via, 54-56 simple circuits via, 50-51 Nodal equations form of, 56 method to write, 54,55 Nodes, of signal-flow graphs, 248-249 No integration systems, steady state error for, 347-348 Noload speed, 82 Noninverting operational amplifier, 59-60 circuit, 60 schematic, 60 Nonlinear electrical network, 92-93 Nonlinearities, 88-89 physical, 88 time response and, 196-198 Nonlinear systems, 88 representation of, 142-143 Nonlinear translational mechanical system, 143 Nonminimum-phase electric circuit, 193 Nonminimum-phase system step responses of, 192,194 transfer function of, 192-194 Nontouching loops, 251-252
917
Nonunity feedback systems steady-state actuating signal for, 361 steady-state errors for, 358-362 Norton's theorem, 55 Notch filter, 492-494 root locus for, 492-493 Novosad, J. P., 32 nth-order differential equations converted to n simultaneous first-order differential equations, 120 explanation of, 17-18 Nwokah, O.D.I., 321 Nuclear power generating plant, 25 Nuclear reactor, 25 Nyquist, H, 5 Nyquist criterion, 559-576 derivation of, 560-563 range of gain for stability via, 570-571 stability determination with, 563-564 Nyquist diagram gain margin/phase margin via, 574-576 for open-loop function, 567-569 sketching, 564-569 stability via, 569-573 Nyquist sampling rate, 726 Observability, 689-693 by inspection, 690 via observability matrix, 691-692 Observability matrix, 691 observability via, 691-692 unobservability via, 692-693 Observer, 682 Observer canonical form observer design for, 686-688 of state space, 262-265 Observer design, 682-689 alternative approaches, 693-700 by matching coefficients, 697-699 for observer canonical form, 686-688 by transformation, 695-697 O'Connor, D. N , 28,32,109,116,160,227,233,296,300,334,337, 383,386,449,453,528,532,620,624,659,662,718,777,781 Octave, 541 Ogata, K., 32,116,233,532,624,662,674n, 678n, 691n, 721, ' 726n, 750n, 759n, 781 Ohnishi, K., 383,386 O'Leary, D. P., 532,721 OMS. See Orbital maneuvering system One integration systems, steady state error for, 348-349 Open-loop/closed-loop sinusoidal frequency analysis/design, with Lab VIEW program, 873-875 Open-loop frequency responses closed-loop transient responses and, 589-592 response speed from, 591-592
918
Index
Open-loop function, Nyquist diagram for, 567-569 Open-loop pitch response, UFSS and, 207-208 Open-loop poles, 381-382,385,391,399-400,441 Open-loop response, antenna control and, 207-208 Open-loop step response, with LabVIEW program, 862-869 Open-loop systems, 8-9 block diagram of, 8 Open-loop transfer function, 241 for artificial heart, 223 Operational amplifier, 58,193 schematic of, 58 Optical disk recording system, 6 Orbital maneuvering system (OMS), 6 Oscillations damped, 14-15,174 damped frequency of, 170 O'Sullivan, D. M., 234,722 Output, 2 Output engine fan speed, 330 Output equation, 121,123 Output potentiometer, 94 Output response, 162 Output transducer, 9 Overdamped behavior, 213 Overdamped response, 170,172 Overshoot, 178,410,416-417, 600-601 ozel, T., 526,532 ozgiiner, U., 337,454 Packet information flow, 383 Pade approximation, 334,382 Palazoglu, A., 532 Pantograph, catenary and, 110 Pantograph head displacement, 110 Papin, Denis, 4 Papson, T. P., 299 Parabolic inputs, 19 steady state error and, 347 Parallel analog, 86-87 development of, 87 mechanical system converted into, 87 parameters for, 87 Parallel form of multiple subsystems, 239 of state space, 259-260 Parallel hybrid-electric vehicle, 29-30 Parallel subsystems, 238 Paramagnetic oxygen analyzer, 380 Partial-fraction expansion, 37-44 inverse z-transform via, 733-734 Particular solutions, 11,162n Passive-circuit realization, 506-507 PD controllers. See Proportional-plus-derivative controllers Peak time, 178 evaluation of, 179
lines of constant, 183 from pole location, 184 from transfer function, 181-182 Pendulum, simple, 142 Percent overshoot, 178 v. damping ratio, 180 evaluation of, 180 lines of constant, 183 from pole location, 184 for time delay systems, 600-601 from transfer function, 181-182 Performance, 2 Perez Lopez, O., 721 Pfleiderer, H. X, 160,722 Pharmaceutical drug absorption, 146-147 Pharmaceutical drug-level concentrations, 146 Phase frequency response, 536 Phase margin, damping ratio from, 589-591 Phase shift oscillator, 333 Phase-variable representation controller design for, 669-671 for plant, 667 Phase variables, 133 block diagram of, 135 choice, 133 Phasors, 535 Philco Technological Center, 160 Phillips, C. L., 233,337,662,781 Philon of Byzantium, 4 pH processes, modeling/control of, 224 Phugoid mode, 224 Physical system, transform requirements into, 16 Physical system schematics, mathematical models from, 34 Pickoff points, 236 Pico, J., 160,722 PI controllers. See Proportional-plus-integral controllers PID controllers. See Proportional-plus-integralplus-derivative controllers Piecewise linear systems, 104 Pinette, B., 152,160 Pioneer Electronics, Inc., 7 Piper, G. E., 444,453,662 Pitch angle control representation, in UFSS, 276-277 Pitch axis attitude control system, momentum wheel with, 444 Pitch control loop root locus of, 428 for UFSS vehicle, 211 Pitch control loop without rate feedback, step responses, 429 Pitch control loop with rate feedback, step responses of, 430 Pitch control system negative step response of, 212 for space shuttle, 287-288 Pitch gain, 324 Pitch stabilization loop, of F4-E military aircraft, 444 Plant
Index phase-variable representation for, 667 pole placement for, 668-669 state-space representation of, 666 with state-variable feedback, 706 Plate dispenser, 105 Polar plot, 587n Pole(s), 162-163 eigenvalues and, 200-202 evaluating response with, 165 of first-order system, 163 imaginary part of, 214 real part of, 214 of transfer function, 163 underdamped response using, 171 Pole distribution, via Routh table with row of zeros, 312-313 Pole location peak time from, 184 percent overshoot from, 184 for plant, 668-669 for root locus, 393 settling time from, 184 topology for, 666 Pole plot, for underdamped second-order system, 182 Pole sensitivity, root locus and, 424-425 Pole-zero plot, 164 Popa, D., 232 Position constant, 593-594 Position control system, 12,34 antenna azimuth, 13-15,208 response of, 14 tachometer as, 495 Positive-feedback systems, root locus for, 421-424 Postural arm reflexes, 292-293 Potentiometer, 9,24 Powell, J. D., 31,115,159,232,453,623,721 Power amplifier, 94,144 Power series method, inverse z-transform via, 734 Preamp, 94 Precision grip dynamics, 155 Prewarping, 759 Process control industry, 6 Processes, 2,8 Prochazka, A., 234 Proportional control system, 459 Proportional-plus-derivative (PD) controllers, 469 Proportional-plus-integral (PI) controllers, 459,464 Proportional-plus-integral-plus-derivative (PID) controllers, 5 characteristics of, 484 design, 482^186 implementing, 505 root locus for, 483 Pulse transfer function derivation of, 736-737 of feedback system, 740-741
919
Pupil dilation, 26-27 Pythagorean theorem, 182 Qualitative analysis and design, 162 Qualitative method, 162 Quantization error, 726 Quarter-car model, for suspension design, 107 Radio antenna, 12 Raible's tabular method, 745 Ramp, 19 Ramp input steady state error and, 346-347 steady-state error and, 341,342 Ramp response error, for lag-lead compensator, 491 Random-access memory (RAM), 354 Random early detection (RED) algorithm, 383,441,656 Range of gain for stability for time delay systems, 599-600 via Bode plots, 577-578 via Nyquist criterion, 570-571 Range of sampling interval, for stability, 745-746 Rate feedback, compensating zero via, 497-500 Raven, F. H., 116,662 RCS. See Reaction control system Reaction control system (RCS), 6 Read/write head displacement, 330 Real-axis breakaway, root locus sketching and, 402^405 Real-axis break-in points, root locus sketching and, 402-405 Real-axis pole, transient response and, 165 Real-axis segments, root locus sketching and, 398 Realization active-circuit, 404-405 of lag-lead compensator, 509 passive-circuit, 506-507 Reciprocal, of time constant, 167 Reference, 8 Reference input, 34 Remote-controlled robot, 3 Residues, 195 Resistance, 49 Resistor, 47 Response, exponential, 164 Response speed, from open-loop frequency response, 591-592 Retinal light flux, 443 Reverse coefficients, stability via, 310 Richon, J.-B., 452 Riedel, S. A., 116 Riegelman, S., 160 Riseman, E. M., 152,160 Rise time, 167,178 v. damping ratio, 182 evaluation of, 181-183 from transfer function, 181-182 Rober, S. 1,332,337
920
Index
Robotic manipulator with cascade PI controller, 447 harmonic drives with, 448 target environment and, 153 Robots, 3. See also specific robots arc welding, 439 assembly-line, 354 FANUCM-410iB,323 hospital pharmacy, 664 industrial, 220,617 input commands to, 187 leg of, 142 remote-controlled, 3 with television imaging system, 152 transport, 288-289 vacuum, 220 walking, 141 Robust design, 12 Rockwell International, 6,30,691 Romagnoli, J. A., 532,775,781 Room temperature control, 521 Root locus, 5 for antenna control, 426 for compensated system, 462 with compensator, 460 without compensator, 460 control problem for, 388-389 definition, 388,392-394 design via, 455-459 from general control system, 394 generalized, 419-421 for ideal derivative compensation, 473,475 lag compensation and, 465 for lag-lead compensator, 488,489,490 with MATLAB program, 806-808 for minor-loop feedback compensation, 502 for notch filter, 492-493 for PID controllers, 483 of pitch control loop, 428 plotting/calibrating, 410 pole location for, 393 pole plot for, 393 pole sensitivity and, 424-425 for positive-feedback systems, 421-424 properties of, 394-397 sample, 456 for security camera system, 392-393 starting/ending points and, 398-399 for uncompensated system, 462 vector representation of complex numbers and, 389-391 Root locus analysis/design, with LabVIEW program, 871-872 Root locus sketching angles of departure/arrival in, 407-409 with asymptotes, 400-402 behavior at infinity, 399^02
branches and,397 critical points and, 412-414 ;'w-axis crossings and, 405-407 real-axis breakaway and, 402-405 real-axis break-in points and, 402-405 real-axis segments and, 398 refining, 402-411 rules for, 411-412 symmetry and, 397-398 Root sensitivity, of closed-loop system, 425 Roots of denominator of F(s) complex or imaginary, 41-44 real and distinct, 38-40 real and repeated, 40-41 Rotational mechanical impedances, 76 Rotational mechanical load, D C motor driving, 81 Rotational mechanical system transfer functions, 69-74 Rotational systems degrees of freedom in, 70 driven by gears, 75 Rotor, 80 Routh, Edward John, 5 Routh-Hurwitz criterion digital system stability via, 748 examples of, 314-320 factoring via, 319 special cases of, 308-313 of stability, 305-308 with zero in first column, 314-315 Routh table generating, 306-307 interpreting, 307 pole distribution via, 312-313 with row of zeros, 312-313,316-317 stability via, 310-311 zero in, 308-311 .Rover, 3 Rubbertuators, 331 Running resistances, 111 Safety valve, 4 Salapaka, M. V., 223,233 Salapaka, S., 233 Salcudean, S. E., 290,299 Sales, R.M., 337 Salminen, R. T., 108,116,337,623 Sampled-data system. See Digital control systems Sampled-data systems block diagram reduction of, 740-741 transfer functions and, 735-739 z-transform and, 739 Sampler, modeling, 728-729 Sarcomere, 292 Saturation nonlinearity, with MATLAB Simulink program, 848-850
Index Savant, C. J., Jr., 32,299,337,386,531,623,662,721 Savaresi, S. M , 531,623,780 Sawusch, M. R., 233 Scanning probe microscope, 775 Schematic, for control system, 16-17 Schierman, J. D., 330,337 Schmidt, D. K., 337 Schneider, R. T„ 220,233,383,386 Schnell, S., 116 Schouten, A. C , 292,299 Sebastian, A., 233 Second-order step response approximation, 195 Second-order step response components, 170 Second-order system damping cases, step responses for, 172 Second-order systems, 169-177 damping ratio of, 173-175 natural frequency of, 172 Second-order transfer functions, via testing, 186 Second-order underdamped responses for damping ratio values, 178 specifications, 178 Second-order underdamped systems, step responses of, 184 Security camera system, root locus for, 392-393 Seering, W. P., 28,32,110,116,160,233,300,337,386,453, 532,624,662,721,781 Segway personal transporter, 27 Self-guiding vehicle, bearing angle control of, 527 Semmlow,J.L.,109,116 Sensitivity of closed-loop transfer function, 362-363 steady-state errors and, 362-364 Sensor, 9 Serial hybrid-electric vehicle, 29 Series analog, 85-86 mechanical system converted into, 86 Series RLC electrical network, 49 Settling time, 167,178 lines of constant, 183 from pole location, 184 from transfer function, 181-182 Severyanova, L. A., 160,721 Shaw, D. A., 32 Shibata, M., 386 Shin, Y. C , 337 Shinners, S. M., 721 Ship roll axis, 212 Ship stability, 5 Ship steering, 5 Shortening muscle velocity, 292 Short period mode, 224 Signal-flow graphs components, 248 converting block diagrams to, 249-250 development stages of, 254
921
of multiple subsystems, 248-251 of state equations, 254-256 Similarity transformations of multiple subsystems, 266-277 on state equations, 267 Simple circuits via nodal analysis, 50-51 via voltage division, 51 Simulation, with LabVIEW program, 858-859 Simulation palette, in LabVIEW program, 881-882 Simulation parameters, in MATLAB Simulink program, 846-847 Simulink (MATLAB), 190,196,199,225,228,247,297, 335, 384,720-721,758,787-835 Single loop via differential equation, 48-49 via mesh analysis, 48-50 via transform methods, 50 Single node, 50-51 Sinha, N. K., 721 Sinusoidal frequency analysis, 5 Sinusoidal inputs, 19 SISO Design Tool, 20 Sivan, R., 300 Skewis, T, 299 Smith, C. A., 532,662 Smith, C. L., 781 Smoother, block diagram, 440 Soft Arm, 616 Solar alpha rotary joints, 380 Solar arrays, in space station, 380 Soleimani-Mosheni, M., 337,624 Solenoid coil circuit, 289 Solomonow, M., 234 Son, M., 662 Source shaft, 76 Space shuttle, 6 automatic steering program, 439 main engine controller, 10 multiple subsystems in, 237 pitch control system, 287-288 Space station solar arrays, 380 vibration stabilization, 440 Sparks, A. W„ 775,781 Speed control, 4-5 Sperry Gyroscope Company, 5 Spilman, D., 531,721 5-plane, digital system stability via, 747-748 s-plane mapping, onto z-plane, 743 Split-power hybrid-electric vehicle, 30 Spring constant, 62,70 Spruijt, J. N., 234,722 Squid jet locomotion, 109
922
Index
Stability, 11 closed-loop poles/response in, 304-305 definition, 302 determining, 576 evaluation of, 303 with MATL AB program, 804-805 Maxwell's criterion of, 5 of missile control system, 743-745 range of sampling interval for, 745-746 Routh-Hurwitz criterion of, 305-308 in state space, 320-323 via epsilon method, 308-309 via mapping only positive /w-axis, 571-573 via Nyquist diagram, 569-573 via reverse coefficients, 310 via Routh-Hurwitz criterion, 318-319 via Routh table, 310-311 Stability design/transient performance, antenna control and, 606-607 Stability design via gain in antenna control, 323-324 inUFSS,324 Stability design via root locus, in digital control systems, 755756 Stability/transient response design, via gain adjustment, 626 Stable systems, steady-state error and, 341 Stall torque, 82 State equations, 122,123,124 Laplace transform solution of, 198-202 signal-flow graphs of, 254-256 similarity transformations on, 267 State-feedback design, 683 State solutions, time domain solution of, 203-212 State space, 123 alternative representations in, 256-265 cascade form of, 257-259 controller canonical form of, 260-262 diagonalizing system in, 270-271 graphic representation of, 123 observer canonical form of, 262-265 parallel form of, 259-260 stability in, 320-323 transfer function conversion to, 132-138 State space conversion, to transfer function, 139-141 State-space design, 663-665 for antenna azimuth position control, 708 State-space representation, 18,117 advantages of, 119 antenna control and, 144 application of, 124-132 computer simulation and, 149 general, 123-124 linearization and, 141-143
of plant, 666 to transfer function, 140 State-transition matrix, 203 Laplace transform of, 203-204 via Laplace transform, 206-207 State-variable feedback, plant with, 706 State variables, 123 linearly independent, 124-125 minimum number of, 125-126 State vector, 123 graphic representation of, 123 Static error constants, 349-350,464 from Bode plots, 595-596 steady-state error via, 350-352 Steady-state actuating signal, for nonunity feedback systems, 361 Steady-state error design via cascade compensation, 626 via integral control, 700-704 Steady-state errors, 2,15,19. See also Errors antenna control and, 368-371 assembly-line robots and, 354 definition, 340 digital control systems and, 749-753 digital feedback control system for, 750 for disturbances, 356-358 evaluating, 341-342 finding, 752 from frequency response, 593-597 improving, 457-458,482-494 with MATLAB program, 805-806 for no integration systems, 347-348 for nonunity feedback systems, 358-362 for one integration systems, 348-349 parabolic input and, 347 ramp input and, 341,342,346-347 sensitivity of, 362-364 sources of, 343 specifications, 353-356 stable systems and, 341 from step disturbances, 357 step input and, 346 for systems in state space, 364-367 system type and, 352-353 in terms of G(s), 345-348 in terms of 7/(s), 344-345 test inputs, 340-341 test waveforms for, 340 transient response, 19,482-494 for unity feedback systems, 343-349 using final value theorem, 365 using input substitution, 367 via cascade compensation, 459-469 via static error constants, 350-352
Index Steady-state response, 11 Steady-state velocity error, 375 Steam-driven power generators, 524 Steam generator, water level control in, 333 Steam pressure control, 4 Steel production, continuous casting in, 294 Steering control, of F4-E military aircraft, 153 Stefani, R. T., 32,220,233,299,337,380,386,531, 623,662,721 Stefanides, E. J., 662 Step, 19 Step disturbances, steady-state errors from, 357 Step input, steady state error and, 346 Step responses computer simulation of, 429 of gain-adjusted antenna control system, 427 of nonminimum-phase network, 194 of nonminimum-phase system, 192 of pitch control loop without rate feedback, 429 of pitch control loop with rate feedback, 430 for second-order system damping cases, 172 of second-order underdamped systems, 184 of three-pole systems, 189 for transfer functions, 190 Step response simulation, for minor-loop feedback compensation, 503 •s-transform, table of, 732 Strobel, K. L., 221,623 Student population control system, 25 Submarine autopilot, 154 Subsystems, 2. See also Multiple subsystems Summers, T. A., 233 Summing admittances, 56,86 Summing impedances, 56,57 Summing junctions, 8 block diagram for, 241 Summing torques, of pendulum, 142 Summing voltages, 57 Sun, M., 225,233 Superposition, 88 Susceptance, 54n Suspension design, for quarter-car model, 107 Sweet, L. M., 233,623 Symbolic Math Toolbox, 21 Symbols list, 783 Symmetry, root locus sketching and, 397-398 System matrix, diagonalizing a, 268 System representation, block diagram of, 34 System response, 162-163 with additional poles, 186-190 from transfer function, 46 with zeros, 191-196 Systems in state space, steady-state errors for, 364-367
923
System step response test, laboratory results of, 168 System type, steady-state errors and, 352-353 System variable, 123 T(s), steady state error as, 344-345 Tabular method (Raible), 745 Tachometer as position control system, 495 transfer function of, 496 Tadeo, E, 721 Tanis, D., 287 Tan, X., 152,160 Tarin, C , 153,160,715,722 Tactile feedback suit, 27-28 Target environment, robotic manipulator and, 153 Tasch, U , 292,300,776,781 Taylor series, 58,59,80,142 Television imaging system, robot with, 152 Temperature control system, 4,24 chemical process, 525 Testing first-order transfer functions via, 167-168 second-order transfer functions via, 186 Test inputs, for steady-state error, 340-341 Test waveforms, 19 for steady-state error, 340 Teufel, E., 160,722 Theophylline concentration, 221 Thermistor, 9 Thermostat, 6 Third-order observer, 684 Third-order system gain design, 416^-19 system characteristics, 417-418 Thomas, B., 333,337,532,616,624 Three-loop electrical network, 56 Three-mode controllers. See PID (proportional-plus-integralplus-derivative) controllers Three-pole systems comparing responses of, 189-190 component responses of, 188 step responses of, 189 Thrust vectoring, 287 Thukral, A., 337,661 Tie, B., 109,116 Time constant, 166-167 exponential, 174 reciprocal of, 167 Time delay systems, 597-602 frequency response plots of, 598-599 percent overshoot for, 600-601 range of gain for stability for, 599-600 Time domain modeling, 117-122 with MATLAB program, 793-795 of state solutions, 203-212
924
Index
Time function Laplace transform of, 35-36 z-transform of, 731-732 Time response with MATLAB program, 795-799 nonlinearities and, 196-198 Time-varying systems, 118 Timothy, L. K., 160,233,300,337,722 Titanic, 272 Top-down design, 22 Torque, of motor, 80 Torque-angular displacement, 70 Torque-angular velocity, 70 Torque equivalent mechanical loading, 80 Torque-speed curve, 82,83 with armature voltage, 82 Total response, 11 Tou,J.,781 Towed vehicle roll control, 332 Tower Trainer 60 Unmanned Aerial Vehicle, 657 Towsley, D., 386,453,623,662 Tracking radar, 382 Train stopping, closed-loop vehicle response for, 441 Transducer inner ear hair cell, 105 input, 8 output, 9 Transfer function(s), 17 block diagram of, 45 from Bode plots, 603-605 decomposing, 136,137 for differential equation, 45 of digital control systems, 735-739 electrical network, 47-61 experimentally obtaining, 602-605 frequency response from, 538-539 of human leg, 95-96 matrix, 139 nonminimum-phase system of, 192-194 peak time from, 181-182 percent overshoot from, 181-182 poles of, 163 rise time from, 181-182 sampled-data systems and, 735-739 second-order approximation, 190 settling time from, 181-182 state space conversion to, 140 state-space representation to, 140 step responses for, 190 system response from, 46 of translational mechanical system, 61-69 via Mason's rule, 252-253 zeros of, 163 Transfer function conversion with constant term in numerator, 134-135
with polynomial in numerator, 136-137 to state space, 132-138 Transfer function poles, eigenvalues and, 200-202 Transformation controller design by, 679-681 observer design by, 695-697 Transformation matrix, 266,268,270,272 Transformations bilinear, 746-747 to canonical form, 260-263 controller design by, 678-681 observer design by, 693-697 similarity, 266-270 Transformed circuit, 49 Transformed free-body diagram, 63 Transform methods, single loop via, 50 Transform of the response, 177 Transient response, 2,10 through component design, 185-186 desired, 10 gain design for, 247-248 improving, 456-457 modeling, 19 real-axis pole and, 165 steady-state errors and, 19,482-494 via gain adjustment, 627-630 Transient response design, via gain adjustment, 415-419,626 Transient response design via gain adjustment antenna control and, 426-427,765-767 digital control systems and, 756-757 UFSS and, 427-430 Transient response improvement, via cascade compensation, 469^181 Transient response modeling steady-state error, 19 Transient response on z-plane, digital control systems and, 753-755 Transition method, 303 Translational mechanical system representation of, 130-131 transfer functions, 61-69 Transpose, 128 A Treatise on the Stability of a Given State of Motion (Routh), 5 Trylt, 40-43,46,57,72,138,141,186,190,191,195,202,245, 248,261,263,271,308,316,322,353,355,359,364,365, 391,397,414,467,477,559,570,576,579,588,601,630, 634,641,672,676,689,693,738,758 Tumor cell growth model, 109 Turnbull, G. A., 32 Tustin transformation, 759 Twizell, E. H., 115 Two degrees of freedom translational mechanical system, 65-66 Two-lop electrical network, 52-53 Two-pole system, zeros and, 191 Two-tank liquid control system, 521
index Tyberg, V. X, 232 Tyner, M., 722 UFSS. See Unmanned Free-Swimming Submersible UNAIDS, 32 Unbounded input, 302 Uncompensated/compensated system, of ideal derivative compensation, 472-473 Uncompensated system ideal derivative compensation and, 472 root locus for, 462 Uncompensated system response, ideal integral compensated system response and, 463 Uncontrollable system, 673 Undamped response, 171,172 Undamped second-order systems, 177-186 Undamped sinusoidal oscillations, 213 Underdamped curve, 174 Underdamped response, 170,172 using poles, 171 Underdamped second-order system, pole plot for, 182 Underwater remote-controlled vehicle, 317 Uniform-rate sampling, 728 Uniform rectangular pulse train, 729 Unit multiplicity, 312n Unit parabolic input, for digital feedback control system, 751 Unit ramp input, for digital feedback control system, 751 Unit step, first-order system and, 166 Unit step input, for digital feedback control system, 750-751 Unity feedback systems forming an equivalent, 358 steady state error for, 343-349 Unity gain, 9 Unmanned autonomous vehicle, 527-528 Unmanned Free-Swimming Submersible (UFSS), 162,272 lead/feedback compensation in, 511-513 open-loop pitch response and, 207-208 pitch angle control representation, 276-277 pitch control loop for, 211 stability design via gain in, 324 transient design via gain and, 427-430 Unobservability, via observability matrix, 692-693 Unstable systems, 303. See also Stability Unyelioglu, K. A., 337,454 Vacuum robot, 220 van der Helm, F C. T., 292,299 van der Molen, G. M., 154,160 Van de Vegte, J., 532 Van Dijk, E., 225,234,722 Van Valkenburg, M. E., 116 Variable speed wind turbine, feedback control, 718 Vaughan, N. D., 26,32,289,300
925
Vector-matrix form, 127 Vector representation, of complex numbers, 389-391 Vectors evaluation of complex function via, 391 Laplace transform of, 139n state, 123 Vehicle steering control model, 441 Velocity, 374 Velocity constant, 594 Vertical spindle surface grinding, 333 Venter, J. W., 31,110,115,159,232,299,337,386,455,531, 623,662,721,789 Verde, L., 153,159,299,452 Vertical risers, 4 Viaro, U , 290,300,386 Vibration stabilization, in space station, 440 Video disc laser recording, 370 Vidyasagar, M., 116,386,453 Vieira, A., 160,721 Virkkunen, 1,108,116,337,623 Virtual Experiment, 65,83,142,166,182,247,313,357, 473,501 Virtual reality simulator, 293 Viscous damper, 64,125 Viscous damping, 17 Visual cue, human response to, 220 Voltage-charge, 48 Voltage-current, 48 Voltage-dependent current source, 128 Voltage division, simple circuits via, 51 Voltage droop control, 442 Walking robots. See Robots Wang, H., 386,453,623 Wang, J. Z., 109,116 Water clock, 4 Water level control, in steam generator, 333 Watt, James, 5 Waveforms, 19 Weiss, R., 152,160 Welkowitz, W , 109,116 Wie, B., 624 Winders, 25 Windmill speed control, 4-5 Wind turbines, 446 Wittenmark, B., 759,780 Wolfson, P., 233 Wong, M. C , 386,453 Woods Hole Oceanographic Institution, 317 Wormly, D. N., 28,32,110,116,160,233,300,337,386,453, 532,624,662,721 Xia, X., 31,110,115,159,232,299,337,386,452,531,623,662, 721,780 Xiong, Y., 233
926
Index
Yan, T., 330,338,447,454,662 Yaniv, Y., 292,300 Yingst, J. C, 780 Yoneyama, T., 116,453,623 Zbinden, A. M., 32 Zedka, M., 223,234 Zero(s), 162-163 entire row is, 310-311 in first column, 308-309,314-315 of first-order system, 163 in Routh table, 308-311 system response with, 191-196 of transfer function, 163 two-pole system and, 191 Zero-input response, 203
Zero-order hold ideal sampling and, 730 modeling, 729-730 Zero-order sample-and-hold, 726, 730 Zero-state response, 203,214 Zhou, B. H., 221,234 z-plane digital system stability via, 742-743 s-plane mapping onto, 743 z-transform, 728,730-735 digital control systems and, 730-735 sampled-data systems and, 739 table of, 732 theorems, 733 of time function, 731-732
Unmanned Free-Swimming Submersible Vehicle Pitch Control System
Pitch command
Pitch gain
W * <<)-J -Ki i
Commanded elevator deflection
•Xtf* *-W V
Elevator Elevator actuator deflection
Vehicle dynamics
$.(*)
-0.125(5+0.435) (s+[.23){s2+0.226s+0.0\69)
i +2
Pitch rate sensor A. 2 »
Heading Control System
Heading command
Heading gain
Commanded rudder deflection
Rudder actuator
Rudder deflection
Vehicle dynamics
Vc<*) +
-0.125(5 + 0.437) (.9+1.29)(5 + 0.193)
Yaw
Heading (yaw) rate
Pitch
«M
Modeling
Root Locus lKG{s)H{s) = - 1 = 1/(2* + 1)180°
Z2(s) Zi(»)
Vols) Vi(s)
°1 = 1 = ^-
V0(s) Vi(s)
(2.97);
(2.133);
Tt
Zl(s) + Z2(s) Ziis) e2
Ni
_ J2 finite poles - £] finite zeros # finite poles - # finite zeros
(2.104)
/
K,/(RaJm)
ft,, fr) £„(*)
U>
KL=Tsm "•a
( 2 1 6 2 )
9 = J2 finite zero angles - £ finite pole angles K
.
_
1 |G(j)ff(j)|
^
=
_ ^ L _
l
Mp =
(2.163)
(10.52);
2f
= tan - l
2
-2? + 0 + 4C4
Time Response (4.9);
Ts = a
s2 + 2t;co„s + col
= tan
(4.10)
-ln(%O5/100)
(10.53)
(4.34);
CM = [B AB £ = —
(11.12)
|G C (M
ex = ( A - L C ) e x ; K
*=K ° «
(733)
4-0
y-y
C CA
Kv = \imsG(s)
e(cc) = eparaboia(oo) = I - ^ M ( 7 . 3 2 ) ;
= Ccx
(12.79)
CAn~
(12.64)
Digital Control e"(oo) = lim(l - z~] )E{z)
(7.31);
(12.26)
x = (A - BK)x + Br; y = Cx (12.3); O M =
l+ltaGW("0)i
(?(oo) = eramp(oo) = r -^hm.yG(.s)
A 2 B ••• A ' ^ B ]
(4.42)
%<®n
4-.0
(11.11)
State Space
Steady-State Error e(oo) = esicp(oc) =
(11.9);
(10.73)
(4.39)
^ 2 + In2 (%OS/100)
tfcVT^?
1+,
2v^
TV?
(4.22)
%OS = e - t ^ / V ^ ) x 100 (4.38)
r„ =
<0p=
fflBW =
(3.73)
#M
£=
'
^) no-load
^ ) = - ^ | = C(5l-A)-1B + D
G(s)
[
Frequency Response
^a
Tr = — a
j , 11 finite pole lengths M n ^ 111 ^ zero lengths
(2.153) K,Kh
S + T-ID
(8.27)
(2*+l)7T (8.28) # finite poles — # finite zeros
(2.135)
Number of teeth of V 2 gear on destination shaft (see after 2.138) Number of teeth of V gear on source shaft /
(8.13)
(13.66)
(7.34)
4-.0
^-JnpK*)
£ p = limG(z)
(7.35) K =~\im(z-lfG(z) a l
z—l
(13.70);
Kv =-\\m(z (13.75)
- l)G(z)
(13.73)