ECE-380: Analog Control Systems SPRING TERM, 2022 Andrew J. Heunis © Department of Electrical and Computer Engineering University of Waterloo Waterloo Ontario N2L 3G1 April 17, 2022 Contents 1 Motivation and background review 3 1.1 Motivational remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2 Impulse or delta functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.3 The Laplace transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.4 Rational functions and partial fractions . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.5 Linear differential equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2 Transfer functions, block diagrams, Mason formula, system models 16 2.1 Transfer functions and block diagrams . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.2 Rules for manipulation of transfer functions . . . . . . . . . . . . . . . . . . . . . . 18 2.3 Manipulation of block diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.4 Signal flow graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 2.5 The Mason formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 2.6 Mathematical models of systems - general comments . . . . . . . . . . . . . . . . . 46 2.7 Basic electrical and mechanical models . . . . . . . . . . . . . . . . . . . . . . . . . 47 3 Design specifications for control systems 69 3.1 Basic specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 3.2 Second order systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 3.3 Analysis of a servo-mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 3.4 Tachometric motor control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 4 Stability and tracking 94 4.1 Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 4.2 The Routh test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 1 4.3 Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 4.4 System type and tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 4.5 Control system design - preliminary comments . . . . . . . . . . . . . . . . . . . . . 112 5 The root locus method 115 5.1 The root locus diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 5.2 Rules for root locus construction 5.3 Proportional, PD, PI and PDI controllers . . . . . . . . . . . . . . . . . . . . . . . . 139 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 6 The Nyquist stability criterion 148 6.1 Motivating remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 6.2 Winding numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 6.3 The Nyquist relation - preliminary version . . . . . . . . . . . . . . . . . . . . . . . 156 6.4 The Nyquist stability criterion - preliminary version . . . . . . . . . . . . . . . . . . 161 6.5 The Nyquist relation and stability criterion - general version . . . . . . . . . . . . . 168 6.6 Bode plots and Nyquist plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 7 Compensator design 193 7.1 Gain and phase margins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 7.2 Lag and lead compensators - preliminary properties . . . . . . . . . . . . . . . . . . 202 7.3 Design of a lag compensator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 7.4 Design of a lead compensator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 2 Chapter 1 Motivation and background review 1.1 Motivational remarks (I) Control systems are everywhere in modern technology from the most basic to the most sophisticated. (II) Typical applications of control systems include: • flight control systems in an aircraft (for landing gear, engines, flaps, slats etc.) • inertial guidance of aircraft, satellites, drones, missiles etc. • robotic control systems • mechatronics • control of your gas furnace • control of the water level in a storage dam There are many more applications besides these! ECE-380 in an introductory course on the analysis (about 80% of the course) and design (about 20% of the course) of analog control systems. ECE-380 is preparation for several fourth-year technical electives including 3 • ECE-484 Digital control applications • ECE-486 Robot dynamics and control • ECE-488 Multivariable control systems In these technical electives the emphasis is more on control system design, which in turn relies on the basic principles of analysis learned in ECE-380. Prior to getting started we need to recall some simple but essential background from ECE-207 Signals & Systems so the remainder of this chapter is devoted to a review of the most important of these ideas. In ECE-207 much effort was devoted to the study of Laplace transforms, Fourier series, and Fourier transforms. The study of analog control systems in the present course makes hardly any use of Fourier series and Fourier transforms but does rely in an essential way on the basic properties of Laplace transforms together with the preliminary concept of an impulse function. We therefore begin with a review of these basic properties. 1.2 Impulse or delta functions The impulse function (or delta function) δ(t) is characterized by the following property: for any t0 ≥ 0 and any function f (t) which is continuous at t0 one has Z ∞ f (t)δ(t0 − t)dt = f (t0 ). (1.2.1) 0 More generally, for each integer n = 1, 2, . . ., one can define the n-th order impulse function δ (n) (t) by the following property: for any t0 ≥ 0, and any function f (t) whose n-th order derivative function f (n) (t) is continuous, one has Z ∞ f (t)δ n (t0 − t)dt = f (n) (t0 ). (1.2.2) 0 In a very abstract sense one can regard δ (n) (t) as the n-th order derivative of the impulse function δ(t), although we shall seldom need this identification in the present course. 1.3 The Laplace transform From now on we use s to denote the general complex variable s = σ + jω, 4 in which σ and ω are real numbers. Now suppose that f (t) is a complex-valued function defined for all t ≥ 0. The Laplace transform of the function f (t) is the complex-valued function F (s) which is defined for each complex s = σ + jω as follows: Z ∞ (1.3.3) F (s) = f (t)e−st dt. 0 We normally denote the function F (s) by L{f }(s) or L{f (t)}(s), so that (1.3.3) becomes Z ∞ (1.3.4) L{f }(s) ≡ L{f (t)}(s) = f (t)e−st dt for all complex s = σ + jω. 0 We now recall the most important properties of Laplace transforms: (I) Linearity: Suppose that f (t) and g(t) are complex-valued functions defined for all t ≥ 0 and a and b are complex constants. Then L{af + bg}(s) = aL{f }(s) + bL{g}(s). (II) Derivatives: Suppose that f (t) is a complex-valued function defined for all t ≥ 0 with Laplace transform F (s) (see (1.3.3)). If f (n) (t) is the n-th order derivative function of f (t), for some integer n = 1, 2, . . ., then the Laplace transform of the derivative f (n) (t) is given by L{f (n) (t)}(s) = sn F (s) − sn−1 f (0) − sn−2 f (1) (0) − . . . sf (n−2) (0) − f (n−1) (0). Laplace transforms of the first and second derivatives of f (t) are particularly important: L{f (1) (t)}(s) = sF (s) − f (0), and L{f (2) (t)}(s) = s2 F (s) − sf (0) − f (1) (0). (III) Convolution: Suppose that f (t) and g(t) are complex-valued functions defined for all t ≥ 0. Recall that the convolution of the functions f and g is the function (f ∗ g)(t) defined for all t ≥ 0 as follows: Z (f ∗ g)(t) = t f (t − τ )g(τ )dτ. 0 It is an easy exercise in calculus to show that Z t Z t (f ∗ g)(t) = f (t − τ )g(τ )dτ = f (σ)g(t − σ)dσ = (g ∗ f )(t), 0 0 5 for all t ≥ 0. A property of Laplace transforms which is essential for analog control systems is the following: Suppose that the complex-valued function f (t) has Laplace transform F (s) and the complex-valued function g(t) has Laplace transform G(s). Then L{(f ∗ g)(t)}(s) = F (s) G(s). This identity can also be written in the notation L{(f ∗ g)(t)}(s) = L{f (t)}(s) L{g(t)}(s), or more simply (suppressing the variable s): L{(f ∗ g)(t)} = L{f (t)} L{g(t)}, or even more simply, suppressing both variables s and t: L{(f ∗ g)} = L{f } L{g}. (IV) Integrals: Suppose that f (t) is a complex-valued function with the Laplace transform F (s), and define the complex-valued function g(t) for all t ≥ 0 as follows: Z t g(t) = f (τ )dτ. 0 Then F (s) . s (V) Exponential shift: Suppose that f (t) is a complex-valued function with the Laplace transform L{g(t)}(s) = F (s) and α is a complex constant. Then L{eαt f (t)}(s) = F (s − α). (VI) Final value theorem: Suppose that f (t) is a complex-valued function with the Laplace transform F (s), and that furthermore f (t) tends towards a finite constant c as t → ∞, that is lim f (t) = c. t→∞ Then we have the identity lim sF (s) = c, s→0 that is (1.3.5) lim sF (s) = lim f (t). s→0 t→∞ 6 Remark 1.3.1. In the Final Value Theorem (Property (VI)) it is essential that f (t) tend to a finite constant as t → ∞, otherwise the identity (1.3.5) fails to hold. For example, take the case of f (t) = et , (1.3.6) for which of course one has (1.3.7) lim f (t) = +∞. t→∞ From a table of Laplace transforms we know that F (s) = L{et }(s) = 1 , s−1 so that (1.3.8) s = 0. s→0 s − 1 lim sF (s) = lim s→0 Now it follows from (1.3.8) and (1.3.7) that (1.3.5) cannot hold. The problem here of course is that, although f (t) tends to a limit as t → ∞, this limit fails to be finite. Similarly, the Finite Value Theorem cannot hold in the case of f (t) = cos(t), which does not tend towards any value as t → ∞, so the right hand side of (1.3.5) is undefined, and therefore this identity cannot be expected to hold. Remark 1.3.2. The Final Value Theorem may look strange, since it seems to give a complicatedlooking formula in terms of the Laplace transform F (s) for determining the limiting value of a time-domain signal f (t) as t tends towards +∞. However, as we shall see during this course, in analog control systems one typically knows the Laplace transform F (s) of a time-domain signal f (t) but usually not the signal itself. Of course one could find the signal f (t) by taking the inverse Laplace transform of F (s), and then take t → ∞, but that is usually a complicated and difficult business. The Final Value Theorem is useful because it gives the limiting value of the time-domain signal f (t) directly in terms of its Laplace transform F (s). Given a complex-valued function F (s) of the complex variable s, the problem of inverse Laplace transforms is to determine the function f (t) such that L{f (t)}(s) = F (s). 7 In this case the function f (t) is called the inverse Laplace transform of the given function, and is denoted by f (t) = L−1 {F (s)}(t). It is usually difficult to determine this function f (t) for general complex-valued functions F (s). Fortunately, in the study of analog control systems, we need only determine inverse Laplace transforms for the very limited class of functions F (s) in the right column of the following table (the corresponding function f (t) is in the left column of the table): Signal f (t) for t ≥ 0 Laplace Transform F (s) δ(t) 1 δ (n) (t), n = 1, 2, . . . sn unit step fn. u(t) 1/s tn , n = 0, 1, 2, . . . n!/sn+1 eαt , α complex 1/(s − α) n αt t e , α complex n!/(s − α)n+1 n = 0, 1, 2, . . . sin ωt ω/(s2 + ω 2 ) cos ωt s/(s2 + ω 2 ) eαt sin ωt ω/[(s − α)2 + ω 2 ] eαt cos ωt (s − α)/[(s − α)2 + ω 2 ] Of particular importance is the 6-th row of the table, from which we see that 1 1 −1 (1.3.9) L (t) = tn−1 eαt n (s − α) (n − 1)! for all t ≥ 0 and n = 1, 2, . . . This inverse Laplace transform will be particularly useful in the next section. 1.4 Rational functions and partial fractions A function P (s) of the complex variable s is a polynomial in s when it has the form P (s) = an sn + an−1 sn−1 + . . . + a1 s + a0 , 8 in which the ai are complex constants, and n is a positive integer. Assuming that an ̸= 0, the integer n is called the degree of P (s), usually written as deg(P ). According to a profound theorem of Gauss (known as the Fundamental Theorem of Algebra) the polynomial P (s) can always be factorized as follows: P (s) = an (s − p1 )m1 (s − p2 )m2 . . . (s − pl )ml , in which the pi , i = 1, 2, . . . , l, are distinct complex constants (i.e. pi ̸= pj when i ̸= j), called the roots of P (s), and the mi are positive integers (i.e. mi ≥ 1) such that n = m1 + m2 + . . . + ml . Furthermore, if the constants ai are real (this is typically the case in analog control systems) then the roots pi always occur in conjugate pairs. The integer mi is called the multiplicity of the root pi . If N (s) and D(s) are polynomials in s then the function X(s) = N (s) D(s) is called a rational function of the complex variable s. When N (s) and D(s) have no roots in common then X(s) is called a coprime rational function. If a rational function X(s) is not coprime then clearly it can be made coprime by factorizing the numerator and denominator polynomials N (s) and D(s) and cancelling the factors (s − pi ) which give rise to the common roots. In analog control systems we must often find the inverse Laplace transform of a given coprime rational function. The following theorem gives an algorithmic method for this: Theorem 1.4.1 (Heaviside expansion theorem). Let X(s) = N (s) D(s) be a coprime rational function such that deg(N ) < deg(D), 9 and factorize the denominator polynomial D(s) as follows D(s) = an (s − p1 )m1 (s − p2 )m2 . . . (s − pl )ml . Then X(s) can be expanded as X(s) = (m l i X X i=1 j=1 rij (s − pi )j ) , in which the rij are complex constants given by (1.4.10) rij = dmi −j 1 [X(s)(s − pi )mi ]|s=pi , (mi − j)! dsmi −j for each i = 1, 2, . . . , l, for each j = 1, 2, . . . , mi . Remark 1.4.2. The expansion of the coprime rational function X(s) given by Theorem 1.4.1 is usually called the method of partial fractions. Remark 1.4.3. From (1.3.9) we know that 1 1 −1 L tj−1 epi t , (t) = j (s − pi ) (j − 1)! for all t ≥ 0, hence the inverse Laplace transform of the coprime rational function X(s) in Theorem 1.4.1 is (m ) l i X X rij x(t) = tj−1 epi t , for all t ≥ 0. (j − 1)! j=1 i=1 Remark 1.4.4. Theorem 1.4.1 provides us a with a “closed-form” mechanical formula (1.4.10) for computing the constants rij in a partial fraction expansion. How is this theorem established? The proof is based on the so-called “covering method” which is taught in ece-207. Rather than developing this idea in full generality we shall illustrate the covering method by a simple example. The proof of Theorem 1.4.1 just abstracts this idea into a general context. Example 1.4.5. Find the partial fraction expansion of X(s) = (s2 1 + 1)(s − 2)2 and then determine its inverse Laplace transform. We have D(s) = (s2 + 1)(s − 2)2 = (s + j)(s − j)(s − 2)2 . 10 Using Theorem 1.4.1 we can then write r11 r21 r31 r32 (1.4.11) X(s) = + + + . (s + j) (s − j) (s − 2) (s − 2)2 It remains to find the rij . We begin with r11 . Multiply each side of (1.4.11) by (s + j) to get (s + j)X(s) = r11 + r21 (s + j) (s + j) (s + j) + r31 + r32 . (s − j) (s − 2) (s − 2)2 Now put s = −j. Then the last three terms on the right hand side vanish and we get r11 = (s + j)X(s)|s=−j 1 (s − j)(s − 2)2 = 0.08 + 0.06j. = s=−j One can find r21 in exactly the same way, that is by multiplying each side of (1.4.11) by (s − j) and taking s = j. However, it is easier to note that r21 is the complex conjugate of r11 since the coefficients in the denominator polynomial of X(s) are real, thus r21 = 0.08 − 0.06j. It remains to determine r31 and r32 . Multiply each side of (1.4.11) by (s − 2)2 : (1.4.12) (s − 2)2 X(s) = r11 (s − 2)2 (s − 2)2 + r21 + r31 (s − 2) + r32 . (s + j) (s − j) Taking s = 2 makes the first three terms on the right hand side of (1.4.12) vanish, giving r32 = (s − 2)2 X(s) 1 = 2 (s + 1) s=2 1 . = 5 s=2 It remains to determine r31 . For this we take derivatives with respect to s on each side of (1.4.12), namely (1.4.13) Now d d (s − 2)2 d (s − 2)2 2 (s − 2) X(s) = r11 + r21 + r31 . ds ds (s + j) ds (s − j) d (s − 2)2 2(s − 2)(s + j) − (1)(s − 2)2 = , ds (s + j) (s + j)2 11 so that d (s − 2)2 ds (s + j) s=2 d (s − 2)2 ds (s − j) s=2 = 0. Similarly, = 0. Substituting these into (1.4.13) then gives r31 = = d (s − 2)2 X(s) ds s=2 1 d = −0.16. ds (s2 + 1) s=2 Substituting the values for rij into (1.4.11) then gives 0.08 + 0.06j 0.08 − 0.06j 0.16 0.2 X(s) = + + − + . (s + j) (s − j) (s − 2) (s − 2)2 Using the table of inverse Laplace transforms we obtain x(t) = (0.08 + 0.06j)e−jt + (0.08 − 0.06j)ejt − 0.16e2t + 0.2te2t , for all t ≥ 0. Although the preceding expression is the required inverse Laplace transform the presence of the imaginary numbers gives it a rather inconvenient form. We can get rid of these by using the Euler formula ejα + e−jα = 2 cos α, ejα − e−jα = 2j sin α. so that x(t) can be written in the more convenient form x(t) = 0.16 cos t + 0.12 sin t − 0.16e2t + 0.2te2t , for all t ≥ 0. Remark 1.4.6. In the preceding example, in place of the covering method used above, we could have simply substituted X(s) into the expression (1.4.10) and evaluated the rij directly. Either method is perfectly acceptable. Remark 1.4.7. The method of partial fractions given by Theorem 1.4.1 enables us to find the inverse Laplace transform of a coprime rational function X(s) = 12 N (s) D(s) when deg(N ) < deg(D). Now suppose we must find the inverse Laplace transform when deg(N ) ≥ deg(D). Put m = deg(N ) − deg(D). Then, by simple algebra, we can divide D(s) into N (s) to get X(s) = Q(s) + R(s) , D(s) where R(s) is the remainder polynomial with deg(R) < deg(D), while Q(s) is the quotient polynomial, with deg(Q) = m, namely Q(s) = γm sm + γm−1 sm−1 + . . . + γ1 s + γ0 , where the γi are constants. We can then get the inverse Laplace transform of X(s) as follows: R(s) −1 −1 L {X(s)} (t) = L Q(s) + (t) D(s) −1 −1 R(s) (t) = L {Q(s)} (t) + L D(s) Since deg(R) < deg(D) we can use partial fractions (i.e. Theorem 1.4.1) to find the inverse Laplace transform L −1 R(s) D(s) (t). As for the inverse Laplace transform of Q(s), we note from the table of Laplace transforms that L−1 {1} (t) = δ(t) and L−1 {sn } (t) = δ (n) (t), for each n = 1, 2, . . ., and thus L−1 {Q(s)} (t) = L−1 γm sm + γm−1 sm−1 + . . . + γ1 s + γ0 (t) = γm L−1 {sm } (t) + γm−1 L−1 sm−1 (t) + . . . + γ1 L−1 {s} (t) + γ0 L−1 {1} (t) = γm δ (m) (t) + γm−1 δ (m−1) (t) + . . . + γ1 δ (1) (t) + γ0 δ(t). 13 Example 1.4.8. Determine the inverse Laplace transform of the rational function X(s) = 3s3 + 3s2 − 5s − 2 . s2 + s − 2 By long division we get X(s) = 3s + s2 s−2 . +s−2 From the table of Laplace transforms we have L−1 {3s} (t) = 3L−1 {s} (t) = 3δ (1) (t), and by the method of partial fractions, we easily see s2 so that L −1 s−2 −1 4 = + , +s−2 3(s − 1) 3(s + 2) s−2 s2 + s − 2 4 1 (t) = e−2t − et , 3 3 and therefore L −1 3s3 + 3s2 − 5s − 2 s2 + s − 2 1 4 (t) = 3δ (1) (t) + e−2t − et , 3 3 for all t ≥ 0. Remark 1.4.9. We see from the preceding discussion and example that whenever deg(N ) ≥ deg(D) then the inverse Laplace transform of the rational function X(s) = N (s) D(s) always includes “shocks” in the form of impulse functions and high-order impulse functions. 1.5 Linear differential equations Recall that Laplace transforms are particularly useful for solving linear differential equations with constant coefficients. An example illustrates the general idea: Example 1.5.1. Find y(t) such that (1.5.14) y (2) (t) + 3y (1) (t) + 2y(t) = et , for all t ≥ 0, subject to the initial conditions (1.5.15) y (1) (0) = −2. y(0) = 1 14 Put Y (s) = L{y(t)} (s). Take Laplace transforms of each term in (1.5.14): L y (2) (t) (s) = s2 Y (s) − sy(0) − y (1) (0) = s2 Y (s) − s + 2, L y (1) (t) (s) = sY (s) − y(0) = sY (s) − 1, L et (s) = 1 . s−1 Now substitute these Laplace transforms in (1.5.14): (s2 Y (s) − s + 2) + 3(sY (s) − 1) + 2Y (s) = i.e. (s2 + 3s + 2)Y (s) = i.e. Y (s) = 1 + 1 + s, s−1 s2 . (s − 1)(s2 + 3s + 2) Now take partial fractions on the right side: Y (s) = 1/2 4/3 1/6 − + , s−1 s+1 s+2 and then take inverse Laplace transforms: y(t) = et e−t 4e−2t − + . 6 2 3 15 1 , s−1 Chapter 2 Transfer functions, block diagrams, Mason formula, system models 2.1 Transfer functions and block diagrams We recall the following result from ECE-207 “Signals and Systems”: Suppose that a linear timeinvariant system has the impulse response function h(t), with input and output signals u(t) and y(t) defined for all t ≥ 0 (see Fig. 2.1). If the linear system is initially at rest (essentially this Figure 2.1: Linear time-invar. system with input u(t) and output y(t) means that all initial conditions within the system are equal to zero) then, in response to the input signal u(t), the corresponding output y(t) is given by the convolution of the impulse response and the input signal: (2.1.1) y(t) = (h ∗ u)(t), 16 that is t Z (2.1.2) h(t − τ )u(τ )dτ, y(t) = t ≥ 0. 0 Using the rule for Laplace transforms of convolutions at (2.1.1) gives (2.1.3) Y (s) = H(s)U (s), in which Y (s) = L{y(t)} (s), U (s) = L{u(t)} (s), H(s) = L{h(t)} (s). The function H(s) i.e. the Laplace transform of the impulse response function, is the transfer function of the linear system. We can therefore represent the linear system in Fig. 2.1 in Laplace transform notation in the following block diagram shown in Fig. 2.2. Throughout this course Figure 2.2: Block diagram representation of a linear time-invar. system we shall in fact always use the block diagram representation of linear systems in terms of the transfer function H(s) in Fig. 2.2, in preference to the time-domain representation in terms of the impulse response h(t) shown in Fig. 2.1. Remark 2.1.1. From (2.1.3) we find (2.1.4) H(s) = Y (s) . U (s) From (2.1.4) we get an alternative interpretation of transfer functions, namely the transfer function of a linear system is the ratio of the Laplace transform Y (s) of the output signal y(t) to the Laplace transform U (s) of the corresponding input signal u(t). This interpretation of a transfer function, as the ratio of the Laplace transform of the output signal to the Laplace transform of the corresponding input signal, is especially useful, and will be used throughout this course. 17 2.2 Rules for manipulation of transfer functions Here we recall from ECE-207 the following basic rules for manipulating transfer functions: (I) Transfer functions in series: Here we have two linear systems with transfer functions H1 (s) and H2 (s) in a series combination (see the block diagram in Fig. 2.3). From the relation (2.1.3) Figure 2.3: Block diagram for series combination applied to the transfer functions H1 and H2 , with reference to the signals in Fig. 2.3 we get (2.2.5) Z(s) = H1 (s) U (s), Y (s) = H2 (s) Z(s). Combining the equations at (2.2.5) then gives Y (s) = H2 (s)H1 (s)U (s), that is (2.2.6) Y (s) = H(s) U (s) for H(s) = H2 (s)H1 (s). In view of (2.2.6) and Remark 2.1.1 one sees that the transfer function of the overall series combination in Fig 2.3, with input U (s) and output Y (s), is given by H(s) = H2 (s) H1 (s). (II) Transfer functions in parallel: Here we have two linear systems with transfer functions H1 (s) and H2 (s) in a parallel combination (see the block diagram in Fig. 2.4). In this case the 18 Figure 2.4: Block diagram for parallel combination two component systems have a common input signal U (s) and respective output signals Z1 (s) and Z2 (s). From the relation (2.1.3) applied to the transfer functions H1 and H2 , with reference to the signals in Fig. 2.4 we get (2.2.7) Z1 (s) = H1 (s)U (s), Z2 (s) = H2 (s)U (s). Moreover, writing the equation for the summing junction in Fig. 2.4, we get (2.2.8) Y (s) = Z1 (s) + Z2 (s), and, from (2.2.7) and (2.2.8), Y (s) = [H1 (s) + H2 (s)]U (s) so that (2.2.9) Y (s) = H(s) U (s) for H(s) = H1 (s) + H2 (s). In view of (2.2.9) and Remark 2.1.1 one sees that the transfer function of the overall series combination in Fig 2.4, with input U (s) and output Y (s), is given by H(s) = H1 (s) + H2 (s). Transfer functions in a feedback system: Here we have two linear systems with transfer functions G(s) and H(s) in the feedback combination shown in the block diagram at Fig. 2.5. 19 Figure 2.5: Block diagram for feedback combination Introduce the signals E(s) and Z(s) shown in Fig. 2.5. Then, from the equation for the difference junction, we have E(s) = U (s) − Z(s). (2.2.10) From the relation (2.1.3) applied to the transfer functions G(s) and H(s), with reference to the signals in Fig. 2.5 we get (2.2.11) Y (s) = G(s)E(s), Z(s) = H(s)Y (s). From (2.2.10) and (2.2.11) we find E(s) = U (s) − H(s)Y (s) and Y (s) = G(s)[U (s) − H(s)Y (s)] = G(s)U (s) − G(s)H(s)Y (s), that is Y (s)[1 + G(s)H(s)] = G(s)U (s) so that (2.2.12) Y (s) = K(s) U (s) with K(s) = 20 G(s) . 1 + G(s)H(s) In view of (2.2.12) and Remark 2.1.1 one sees that the transfer function of the overall feedback combination in Fig 2.5, with input U (s) and output Y (s), is given by K(s) = G(s) . 1 + G(s)H(s) This transfer function will be used repeatedly throughout the course! Remark 2.2.1. A particularly important special case of the feedback combination is when the signals Y (s) and Z(s) are identical, namely Z(s) = Y (s), so that, from the second equation of (2.2.11), we have H(s) = 1. In this case the output Y (s) feeds directly back to the differencing junction, and the block diagram for the feedback system in Fig. 2.5 reduces to the so-called unit negative feedback system shown in Fig. 2.6. The transfer function for the unit negative feedback combination is of course Figure 2.6: Block diagram for unit negative feedback combination K(s) = G(s) . 1 + G(s) 21 2.3 Manipulation of block diagrams In control systems one often encounters quite complex interconnections of linear systems, represented schematically as a block diagram. This is illustrated in the next example: Example 2.3.1. A block diagram is shown in Fig. 2.7, in which we write G1 for the transfer function G1 (s) etc. The input signal is U and the output signal is Y . We must determine the Figure 2.7: Interconnection - 1 overall (or equivalent) transfer function which relates the output signal Y to the input signal U . Clearly we should first combine transfer functions G2 and H2 in a feedback combination to get the block diagram in Fig. 2.8: Next combine the two transfer functions in series to get the block Figure 2.8: Interconnection - 2 diagram in Fig. 2.9: In this figure there is an obvious parallel combination with the transfer function 22 Figure 2.9: Interconnection - 3 (2.3.13) G4 = G3 + G1 G2 G3 (1 + G2 H2 ) + G1 G2 = 1 + G2 H2 1 + G2 H2 from which we get the block diagram in Fig. 2.10: Finally, we can take the feedback combination Figure 2.10: Interconnection - 4 in Fig. 2.10 to get the overall transfer function of the block diagram in Fig. 2.7: (2.3.14) Y G4 = U 1 + G4 H1 Now substitute G4 from (2.3.13) into (2.3.14) and simplify to get the overall transfer function of the system in Fig. 2.7: Y G3 (1 + G2 H2 ) + G1 G2 = . U 1 + G2 H2 + H1 [G3 (1 + G2 H2 ) + G1 G2 ] 23 Example 2.3.2. A system with input U and output Y is shown in the block diagram of Fig. 2.11. For later manipulations we let Z be the signal at the output of H1 . We must determine the overall Figure 2.11: Interconnection - 1 transfer function from U to Y . This system has a combination of both feedback as well as “feedforward” through the transfer function G2 . Systems of this kind, with a combination of feedback and feed-forward, are used, for example, to control of the landing gear of an aircraft. In this case it is not as easy to proceed as in Example 2.3.1. Combining G1 and H1 in a feedback combination means that we will lose the signal at the input to transfer function G2 , while combining G1 and G2 in parallel will deprive us of the signal at the input to transfer function H1 . We will try to “unlock” the system by shifting the input to the transfer function G2 to the left of the difference junction, and must compensate for this by feeding the output of H1 directly to the input of G2 , to get the block diagram in Fig. 2.12, in which the input to G2 remains the signal U − Z. Next, we Figure 2.12: Interconnection - 2 remove the difference junction at the input to G2 by reproducing G2 as shown in the block diagram 24 of Fig. 2.13: At this point it is still not clear how one can begin to combine pairs of transfer Figure 2.13: Interconnection - 3 functions in parallel, series and feedback. In an attempt to improve the situation let us “reproduce” H1 as shown in the block diagram of Fig. 2.14. Note that in Fig. 2.14 we have introduced, for Figure 2.14: Interconnection - 4 convenience, a transfer function identically equal to unity to account for the direct feed in parallel with the series combination of H1 and G2 . Now, finally, we can use the rules for parallel, series and feedback combination to get the block diagram in Fig. 2.15, and lastly, again applying the rules for combining systems in series and parallel in Fig. 2.15, we obtain the overall transfer function Y G1 (1 − G2 H1 ) = G2 + U 1 + G1 H1 G1 + G2 = . 1 + G1 H1 25 Figure 2.15: Interconnection - 5 2.4 Signal flow graphs From Example 2.3.2 one sees that it is not always so easy to apply the rules for parallel, series and feedback combination in order to determine the overall transfer function of a complicated block diagram. In this example we had to use a certain amount of guesswork to “unravel” the given block diagram into a form to which we could apply these rules. In a genuine control system, such as the automatic pilot of an aircraft, for which the block diagram typically comprises many component blocks interconnected in a very complicated way, the guesswork-based approach used in the example is usually hopeless, and there is no clear way to bring the system into a form to which we can successively apply the rules for parallel, series and feedback combinations. In this section we shall study an approach for dealing with block diagrams of potentially unlimited complexity, which gives a completely algorithmic method for determining the overall transfer function, and which avoids entirely the sort of guesswork that we had to use in Example 2.3.2. The approach of this section divides naturally into two steps: • represent the block diagram as a signal flow graph; • apply the so-called Mason gain formula to the signal flow graph in order to determine the overall transfer function. We shall now discuss these steps in detail, starting with the notion of a signal flow graph. To this end note that a block diagram of interconnected component systems always involves signals. For example, the block diagram for a series interconnection in Fig. 2.3 involves the signals U , Z and Y , while the block diagram for the feedback interconnection shown in Fig. 2.5 includes the signals U , E, Y and Z. A signal flow graph comprises nodes (or points), together with edges from one node 26 to another. When we represent a block diagram as a signal flow graph we fix one distinct node for every signal in the block diagram. The edges in the signal flow graph are then the transfer functions which relate the signals corresponding to these nodes. This is illustrated in the following examples: Example 2.4.1. Take the simple block diagram in Fig. 2.2 which includes signals U and Y related by the transfer function H. The corresponding signal flow graph is shown in Fig. 2.16, in which we Figure 2.16: Signal flow graph of a single system have nodes for the signals U and Y , together with an edge to which we attach the transfer function H. Notice that there is a direction attached to the edge; this direction is from the input signal U to the output signal Y . Example 2.4.2. Take the block diagram for the series combination in Fig. 2.3. Here we have the signals U , Z and Y , for which we fix corresponding nodes shown in the signal flow graph of Fig. 2.17, together with edges corresponding to the transfer functions H1 and H2 . Again, these edges have directions from the input to the output signal. Figure 2.17: Signal flow graph of a series combination Example 2.4.3. Take the block diagram for a sum-difference junction shown in Fig. 2.18, in which one has input signals U1 , U2 and U3 , and the output signal Y . We represent this block diagram by the signal flow graph in Fig. 2.19, with nodes for each of the signals in Fig. 2.18. In this case the corresponding edges have unit-gain transfer functions attached to them, with a negative sign for the difference edge. The signal at the node Y in Fig. 2.19 is interpreted to be given by Y = (+1)U1 + (−1)U2 + (+1)U3 = U1 − U2 + U3 , 27 Figure 2.18: Block diagram of sum-difference junction Figure 2.19: Signal flow graph of sum-difference junction which is exactly what we want, in light of the block diagram in Fig. 2.18. Remark 2.4.4. Note that each of the unit-gain edges in the signal flow graph shown in Fig. 2.19 is completely indispensable. Indeed, if we took away, for example, the unit-gain edge from the node U1 to the node Y then these nodes would be coincide (i.e. be the same node) in which case the signals U1 and Y would be identical. This is clearly not the case in the block diagram of Fig. 2.18, so the unit gain edge is clearly essential! This is part of a recurring theme that we shall see throughout the present section - unit gain edges will often play an indispensable role in constructing signal flow graphs which correctly represent a given block diagram. Example 2.4.5. Now look at the block diagram for the parallel combination shown in Fig. 2.4. The representation of this block diagram by a signal flow graph is shown in Fig. 2.20. 28 Figure 2.20: Signal flow graph of a parallel combination Example 2.4.6. Let us draw the signal flow graph for the block diagram shown in Fig. 2.21, with input signals U1 , U2 and U3 , and output signals Y1 and Y2 . Introduce a signal Z for the output of the sum-difference junction. The corresponding signal flow graph is shown in Fig. 2.22. Note the Figure 2.21: Block diagram negative sign attached to the transfer function H2 in the edge from node U2 to the node Z; this of course accounts for the subtraction in the sum-difference junction. Finally, note that the incoming signals to the node Z, through the edges H1 , −H2 and H3 in the signal flow graph, are H1 U1 , −H2 U2 and H3 U3 . The signal at the node Z is then understood to be the sum of these incoming signals, that is Z = H1 U1 − H2 U2 + H3 U3 , as required to be consistent with the block diagram in Fig. 2.21. Note that the signal at node Z depends solely on the edges H1 , −H2 and H3 which are directed towards Z, and has absolutely nothing to do with the outgoing edges H4 and H5 directed away from Z. Again, this is for consistency with the block diagram in Fig. 2.21. 29 Figure 2.22: Signal flow graph Example 2.4.7. Take the block diagram for the feedback combination in Fig. 2.5, which includes the signals U , E, Y and Z. The corresponding signal flow graph is in Fig. 2.23: Note the edge with Figure 2.23: Signal flow graph of feedback combination gain −1, which ensures that the signal at node E is E = (+1)U + (−1)Z = U − Z, as required for consistency with the block diagram in Fig. 2.5. The unit-gain edge from U to E in the signal flow graph must be included; were this edge to be omitted the nodes for U and E would merge into a single node, and the signals at U and E would then be identical. This is clearly not consistent with the block diagram in Fig. 2.5! However, if the signal Z is of no interest (which is frequently the case), then we can replace the pair of edges H (from node Y to node Z) and −1 (from node Z to the node E) with the single edge −H directly from node Y to node E, as shown in Fig. 2.24: In this case the signal at the node E is (recall Example 2.4.6) E = (+1)U + (−H)Y = U − HY, which is consistent with Fig. 2.5. 30 Figure 2.24: Signal flow graph of feedback combination - without Z Remark 2.4.8. For the signal flow graph in Fig. 2.20 of two systems in parallel it is often the case that the signals at nodes Z1 and Z2 are of no interest. In this case the unit-gain edges are not needed and the signal flow graph can be simplified as in Fig. 2.25: Now it follows that the signal Figure 2.25: Signal flow graph of parallel combination at the node Y is (recall Example 2.4.6) Y = H1 U + H2 U, as required. Example 2.4.9. A block diagram is shown in Fig. 2.26 with input signal U and output signal Y . Draw the signal flow graph. Applying the rules developed in the above examples we see that this is as given in Fig. 2.27: Notice that there are several unit-gain edges in this signal flow graph. Which of these edges are superfluous (i.e. unnecessary) and which are essential? For the unit gain edge from node b to node c the input and output signals for the edge are related by c = (1)b − H1 d thus 31 c ̸= b, Figure 2.26: Block diagram in the Example 2.4.9 Figure 2.27: Signal flow graph so the signals at nodes c and b are different. This means that the unit gain edge from b to c is essential. In fact, suppose that we omitted this unit gain edge, so that the signal flow graph reduces to that shown in Fig. 2.28: Now the block diagram whose signal flow graph is that in Fig. 2.28 is shown in Fig. 2.29 (you should check this), which is certainly not the block diagram in Fig. 2.26! Similarly, the unit gain edge between the nodes d and e in Fig. 2.27 is again essential since the signals at these nodes are related by e = (1)d + G2 b thus e ̸= b, so that the signals at nodes d and e (i.e. the input and output nodes of the unit gain edge) are different. You should draw the signal flow graph with this unit gain edge removed, then draw the corresponding block diagram and check that this is different from the block diagram in Fig. 2.26. On the other hand the signals at the nodes U and b are clearly identical, so the unit gain edge 32 Figure 2.28: Reduced signal flow graph - 1 Figure 2.29: Block diagram for reduced signal flow graph - 1 between these nodes is superfluous and could be removed (i.e. the nodes U and b can be “merged” into the single node U ). Similarly the unit gain edge between the nodes e and Y is also superfluous. However, it is still a good idea to include these edges because they nicely “space out” the signal flow graph. Remark 2.4.10. To summarize, a unit gain edge in a signal flow graph is superfluous, and can be discarded, when the signals at the input and output nodes of the unit gain edge are identical, whereas a unit gain edge is essential when the signals at the input and output nodes of the unit gain edge are different. Thus, in Fig. 2.30(i) the signals at the nodes a and b of the unit gain edge are identical, so that the unit gain edge can be discarded i.e. the nodes a and b can be “merged” into a single node. On the other hand, in Fig. 2.30(ii) the signal at the node b is equal to the signal at the node a plus the output signal from the edge G5 , thus the signals at the nodes a and b are different, and the unit gain edge is essential. Put another way, if there are one or more incident or incoming edges to the output node of a unit gain edge (besides the unit gain edge itself) then the signals at the input and output nodes of the unit gain edge must be different, and the unit gain edge is essential. This is the case in Fig. 2.30(ii), the incident edge to the output node b of the unit gain edge being G5 . On the other hand, if the only incident edge to the output node of a unit 33 Figure 2.30: Superfluous and essential unit gain edges gain edge is just the unit gain edge itself, then the unit gain edge is superfluous. This is the case in Fig. 2.30(i). Referring to Example 2.4.9, ones sees that signals at nodes U and b in Fig. 2.27 are identical, thus the unit gain edge from U to b can be discarded, and the same holds true for the unit gain edge from the node e to the node Y , since the signals at these nodes are again identical. On the other hand, as discussed in the Example 2.4.9, the signals at the nodes b and c are different, hence the unit gain edge from b to c is essential. Likewise, the signals at the nodes d and e are different, so the unit gain edge from d to e is essential. Remark 2.4.11. As a practical matter do not try to “economize” on unit gain edges when drawing a signal flow graph. Superfluous unit gain edges in a signal flow graph are completely harmless, and can actually help to nicely “space out” a signal flow graph. On the other hand, by being too “economical” in the use of unit gain edges you may end up mistakenly omitting an essential unit gain edge, in which case the signal flow graph no longer represents the given block diagram. 34 2.5 The Mason formula We have learned how to represent a block diagram in the form of a signal flow graph, and can now move on the Mason gain formula. This formula is applied to the signal flow graph of the block diagram, and yields, in a completely algorithmic way, the overall transfer function of the block diagram. Before stating the Mason formula we need some terminology: In a signal flow graph a path from a node ns to a node ne is a sequence of edges {E1 , E2 , E3 , . . . , Ek } such that • the first edge E1 starts at the node ns , and the last edge Ek ends at the node ne ; • the ending node of the edge Ei is the starting node of the edge Ei+1 ; • a node never occurs more than once as the path {E1 , E2 , E3 , . . . , Ek } is traversed from ns to ne in the order indicated. Intuitively a path is a sequence of edges such that each edge begins at the node at which the preceding edge ends, and which never cuts across itself. Thus Fig. 2.31 shows a sequence of edges {E1 , E2 , E3 , E4 , E5 } which is a path. On the other hand Fig. 2.32 shows a sequence of edges which fails to be a path (the node a occurs more than once as the sequence of edges is traversed, and therefore the sequence cuts across itself). Figure 2.31: Path in a signal flow graph 35 Figure 2.32: Not a path in a signal flow graph A loop in a signal flow graph is a path which begins and ends at the same node. Two loops in a signal flow graph make up a non-touching pair of loops when the loops do not have any nodes in common. Similarly, three loops in a signal flow graph make up a non-touching triple of loops when none of the three loops have any nodes in common. Likewise for a non-touching quadruple of loops etc. The signal flow graph in Fig. 2.33 illustrates these ideas. In this signal flow graph Figure 2.33: Pairs and triples of loops there are three loops namely L1 = {G1 , G2 , G3 }, L2 = {G4 , G5 , G6 }, L3 = {G7 , G8 , G9 , G10 }. Then {L1 , L3 } is a pair of non-touching loops, since the loops L1 and L3 do not have any nodes in common. Similarly, {L2 , L3 } is also a pair of non-touching loops. On the other hand, L1 and L2 are touching loops (having the node a in common) therefore {L1 , L2 } fails to be a pair of non-touching loops. Finally, the triple of loops {L1 , L2 , L3 } fails to be non-touching since loops L1 and L2 are touching loops. 36 Example 2.5.1. Draw the signal flow graph of the block diagram in Fig 2.7. Then identify all loops in the signal flow graph, as well as all pairs, triples, etc. of non-touching loops. The signal flow graph is shown in Fig. 2.34: Figure 2.34: Signal flow graph for block diagram in Fig. 2.7 The loops in the signal flow graph are the following sequences of edges: L1 = {1, G1 , G2 , 1, 1, −H1 }, L2 = {G2 , −H2 }, L3 = {G3 , 1, −H1 , 1}. There is one pair of non-touching loops, namely {L2 , L3 }, and there are no triples, quadruples etc. of non-touching loops in the signal flow graph. Note that the sequence of edges {G1 , G2 , −H2 , G2 , 1, 1, −H1 , 1} is not a loop. Although this sequence of edges starts and ends at the node b the sequence cuts across itself and therefore cannot be a loop. We next identify all paths in the signal flow graph from node b to node a. These are clearly P1 = {G1 , G2 , 1, 1, −H1 }, P2 = {G3 , 1, −H1 }. On the other hand, the sequence of edges {G1 , G2 , −H2 , G2 , 1, 1, −H1 } fails to be a path from b to a because the sequence cuts across itself, and therefore cannot be a path. 37 The gain of a path {E1 , . . . , Ek } in a signal flow graph is the product of all edges in the path. Thus, the paths P1 and P2 in Example 2.5.1 have the respective gains P1 = −G1 G2 H1 , P2 = −G3 H1 . In exactly the same way, the gain of a loop in a signal flow graph is again the product of all edges in the loop. Thus, the gains of the loops L1 , L2 , L3 in Example 2.5.1 have the respective gains L1 = −G1 G2 H1 , L2 = −G2 H2 , L3 = −G3 H1 . Finally, a node in a signal flow graph is an independent node when there are only outgoing edges and no incoming edges. Essentially an independent node corresponds to an input signal. In Fig. 2.35 the node a is an independent node, while on the other hand the node b fails to be an independent node because there is an incoming edge E1 towards this node. We are now finally Figure 2.35: Independent and non-independent nodes able to state the Mason gain formula. To this end suppose that a given block diagram has been reduced to a signal flow graph. Then the transfer function from an independent node ns to any other node ne in the signal flow graph is given by P i Pi ∆i (2.5.15) . ∆ 38 The denominator ∆ of (2.5.15) is defined as follows: (2.5.16) ∆ = 1 − [sum of the gains of all loops in the s.f.g.] + [sum of the products of the gains of all non-touching pairs of loops in the s.f.g] − [sum of the products of the gains of all non-touching triples of loops in the s.f.g] + [sum of the products of the gains of all non-touching quadruplrs of loops in the s.f.g] . . . As for the numerator of (2.5.15): • The summation index i in the numerator counts over all possible paths in the signal flow graph from ns to ne . • Pi is the gain of the i-th path from ns to ne . • ∆i is evaluated in exactly the same way as ∆ except that, in place of using all loops in the signal flow graph, one uses only those loops in the signal flow graph which do not touch the i-th path from ns to ne (that is, one disregards all loops which actually do touch the i-th path from ns to ne ). Remark 2.5.2. The are only finitely many terms on the right side of (2.5.16) (in even the most complex signal flow graphs one seldom comes across any quadruples of non-touching loops, and one almost never finds any quintuples of non-touching loops!) Remark 2.5.3. One may justifiably ask how the Mason formula is established. The result is in fact obtained using tools from a branch of mathematics known as graph theory. We make no attempt to prove the Mason formula here - our goal is to become expert in its use. Example 2.5.4. In Example 2.3.2 we used block diagram manipulation to determine the overall transfer function for the block diagram in Example 2.3.2, and learned that this is quite a difficult and cumbersome method. Here we shall use the Mason gain formula to determine this transfer function. We first reduce the block diagram in Fig. 2.11 to the signal flow graph in Fig. 2.36. Notice that unit-gain edges from b to c and from e to f are not essential and can be omitted, since the signals at the nodes b and c are identical (but it is nice to include them to “space-out” the signal flow graph). On the other hand, the unit-gain edge from d to e is essential because the signals at the nodes d and e are different. Similarly, the unit gain edge from a to b is essential. We now evaluate the denominator in the Mason formula (see (2.5.15)) and for this we must first determine 39 Figure 2.36: S.f.g for the block diagram in Fig. 2.11 all possible loops in the signal flow graph. From Fig. 2.36 one see that there is only one loop in the signal flow graph, namely L1 = {1, G1 , −H1 }, with loop gain L1 = −G1 H1 . Clearly there are no pairs, triples, quadruples etc. of non-touching loops (since we have only one loop in the signal flow graph!), thus one sees from (2.5.16) that ∆ = 1 − [L1 ] = 1 + G1 H1 . It remains to evaluate the numerator in the Mason formula (2.5.15). To this end we must first determine all possible paths from U to Y (i.e. from a to f ) through the signal flow graph. From Fig. 2.36 there are two such paths, namely P1 = {1, 1, G1 , 1, 1}, P2 = {1, 1, G2 , 1}, with corresponding path gains P1 = G1 , P2 = G2 . From (2.5.15) we then have Y P1 ∆1 + P2 ∆2 = , U ∆ in which it remains to evaluate ∆1 and ∆2 . Now ∆1 is evaluated in exactly the same way as ∆ (see (2.5.16)) but using only the loops in the signal flow graph which do not touch the path P1 . However, there is only one loop in the signal flow graph, namely L1 , which clearly does touch path P1 . Since we must discard this loop it follows that we have no loops at all when evaluating ∆1 , and therefore all terms in square brackets in (2.5.16) vanish, giving ∆1 = 1. 40 Similarly, since the loop L also touches the path P2 , we have ∆2 = 1. From the Mason formula (2.5.15) we get Y P1 ∆1 + P2 ∆2 = U ∆ G1 + G2 = , 1 + G1 H1 which agrees with the transfer function found in Example 2.3.2. The Mason gain formula is clearly much easier to use than block diagram manipulation! Example 2.5.5. Determine the transfer function from the input signal U to the output signal Y in the block diagram shown in Fig. 2.37. Note that it would be rather difficult to determine this Figure 2.37: Block diagram for the Example 2.5.5 transfer function by direct block diagram manipulation, combining systems successively in parallel, series and feedback. We therefore try to use the Mason formula instead. The corresponding signal flow graph is shown in Fig. 2.38. Note that the unit gain edge from node U to the node b is essential (why?), while the unit gain edge from the node c to the node Y is superfluous (why?) thus nodes c and Y can be merged into a single node. We next evaluate the denominator ∆ in the Mason formula (2.5.15) (see (2.5.16)). To this end we must first determine all of the loops in the signal flow graph. These are clearly L1 = {G3 , G4 , −H1 }, L2 = {G2 , G3 , −H2 }, L3 = {G1 , G2 , G3 , G4 , −H3 }, 41 Figure 2.38: S.f.g for the block diagram in Fig. 2.37 with corresponding loop gains L1 = −G3 G4 H1 , L2 = −G2 G3 H2 , L3 = −G1 G2 G3 G4 H3 . From Fig 2.38 one sees that the loops L1 , L2 and L3 are all touching, so that we do not have any pairs of non-touching loops, and therefore of course do not have any triples, quadruples etc. of non-touching loops either. Thus, from (2.5.16) we find ∆ = 1 − [sum of the gains of all loops in the s.f.g.] = 1 − [L1 + L2 + L3 ] = 1 + G3 G4 H1 + G2 G3 H2 + G1 G2 G3 G4 H3 . It remains to evaluate the numerator in the Mason gain formula. For this we must first identify all possible paths from U to Y in the signal flow graph. From Fig 2.38 on sees that there is only one such path, namely P1 = {1, G1 , G2 , G3 , G4 , 1} with path gain From the Mason formula (2.5.15) we then obtain P1 ∆1 Y = , U ∆ 42 P1 = G1 G2 G3 G4 . in which ∆1 is evaluated in exactly the same way as ∆, but with the loops touching the path P1 excluded. Equivalently, we evaluate ∆1 using only the loops L1 , L2 and L3 which do not touch path P1 . However, from Fig 2.38, each of these loops does in fact touch the path P1 , so it follows from (2.5.16) that ∆1 = 1. Combining all of the above gives the overall transfer function Y G1 G2 G3 G4 = . U 1 + G3 G4 H1 + G2 G3 H2 + G1 G2 G3 G4 H3 Example 2.5.6. A signal flow graph is shown in Fig. 2.39. Determine the transfer function from the input U to the output Y . We first evaluate the denominator ∆ in the Mason formula (2.5.15) Figure 2.39: S.f.g for the Example 2.5.6 (see (2.5.16)). To this end we must determine all of the loops in the signal flow graph. These are clearly (2.5.17) Li = {Gi , Hi }, i = 1, 2, . . . , 5. with corresponding loop gains (2.5.18) Li = Gi Hi , i = 1, 2, . . . , 5. 43 Next determine all pairs of non-touching loops. A systematic procedure for this is to list all pairs of non-touching loops which include the loop L1 . From Fig. 2.39 one sees that these pairs are {L1 , L3 }, (2.5.19) {L1 , L4 }, {L1 , L5 }. Again, list all pairs of non-touching loops which include the loop L2 . From Fig. 2.39 these are {L2 , L4 }, (2.5.20) {L2 , L5 }. Again, list all pairs of non-touching loops which include the loop L3 . From Fig. 2.39 these are {L3 , L1 }, (2.5.21) {L3 , L5 }. Again, list all pairs of non-touching loops which include the loop L4 . From Fig. 2.39 these are {L4 , L1 }, (2.5.22) {L4 , L2 }, {L4 , L5 }. Finally, list all pairs of non-touching loops which include the loop L5 . From Fig. 2.39 these are {L5 , L1 }, (2.5.23) {L5 , L2 }, {L5 , L3 }, {L5 , L4 }. We appear to have a total of 14 pairs listed in (2.5.19) - (2.5.23). However, among these pairs there occur identical pairs. For example the pairs {L1 , L3 } and {L3 , L1 } are identical (the order of the pairs does not matter), so we should keep (any) one of these pairs and discard the other. Doing this for all identical pairs appearing in (2.5.19) - (2.5.23) we are left with the following distinct pairs of non-touching loops: (2.5.24) {L1 , L3 }, {L1 , L4 }, {L1 , L5 }, {L2 , L4 }, {L2 , L5 }, {L3 , L5 }, {L5 , L4 }. We next write out all triples of non-touching loops. Again, proceeding systematically, we first write out all triples of non-touching loops which include loop L1 . From Fig. 2.39 these are (2.5.25) {L1 , L3 , L5 }. Again, list all triples of non-touching loops which include the loop L2 . From Fig. 2.39 these are (2.5.26) {L2 , L4 , L5 }. Again, list all triples of non-touching loops which include the loop L3 . From Fig. 2.39 these are (2.5.27) {L3 , L1 , L5 }. 44 Likewise, all triples of non-touching loops which include the loop L4 are {L4 , L1 , L5 }, (2.5.28) {L4 , L2 , L5 }, and all triples of non-touching loops which include the loop L5 are {L5 , L1 , L3 }, (2.5.29) {L5 , L1 , L4 }, {L5 , L2 , L4 }. Among the triples of non-touching loops displayed in (2.5.25) - (2.5.29) there are several identical triples. For example, the triples {L1 , L3 , L5 }, {L3 , L1 , L5 } and {L5 , L1 , L3 } are identical, since the order does not matter. Thus, we should keep (any) one of these triples and discard the other two. Removing all such redundant triples in (2.5.25) - (2.5.29) results in the following distinct triples of non-touching loops: {L1 , L3 , L5 }, (2.5.30) {L1 , L4 , L5 }, {L2 , L4 , L5 }. Are there any quadruples of non-touching loops? From Fig. 2.39 it is clear that there are none, and therefore there cannot be any quintuples etc. of non-touching loops. It therefore follows from (2.5.30), (2.5.24), and (2.5.16) that the denominator in the Mason formula must be ∆ = 1 − [L1 + L2 + L3 + L4 + L5 ] (2.5.31) + [L1 L3 + L1 L4 + L1 L5 + L2 L4 + L2 L5 + L3 L5 + L4 L5 ] − [L1 L3 L5 + L1 L4 L5 + L2 L4 L5 ]. It remains to calculate the numerator in the Mason formula (2.5.15). To this end, all paths through the signal flow graph from U to Y must be determined. From Fig. 2.39 it is clear that there is only one such path, namely (2.5.32) P1 = {1, 1, G5 , 1} with path gain P1 = G5 . From the Mason formula (2.5.15) we then get (2.5.33) Y P1 ∆1 G5 ∆1 = = , U ∆ ∆ in which ∆ is given by (2.5.31) and (2.5.18), and it remains to determine ∆1 . From the Mason formula we know that ∆1 is evaluated in exactly the same way as ∆ except that, instead of using all loops in the signal flow graph, one uses only those loops which do not touch the path P1 . From Fig. 2.39 ones sees that the only loops in the signal flow graph which do not touch the path P1 are (2.5.34) L2 , L3 , 45 L4 . Among these loops one sees from Fig. 2.39 that the only pair of non-touching loops is {L2 , L4 }, (2.5.35) and it is clear that there are no triples (and therefore no quadruples etc.) of non-touching loops among the loops at (2.5.34). Accordingly, from (2.5.34) and (2.5.35), we find ∆1 = 1 − [L2 + L3 + L4 ] + L2 L4 . (2.5.36) The transfer function from U to Y is therefore given by (2.5.33), (2.5.36) and (2.5.31), in which the Li are given by (2.5.18). As an exercise you should draw the the block diagram for which the signal flow graph is shown in Fig. 2.39. 2.6 Mathematical models of systems - general comments An essential notion central to control systems (and indeed to modern science and engineering in general) is that of a mathematical model of a physical system. A mathematical model of a physical system is a “mathematical description” of the system, typically in the form of a set of ordinary and/or partial differential equations. Most physical systems by their very nature tend to be extremely complex, typically involving the interaction of some combination of electrical, mechanical, chemical, biological and other phenomena. Mathematical models of complex physical systems are always approximate and never perfect. Indeed, a perfect mathematical model of a system, such as a jet engine or the respiratory mechanism in a living organism, would be so complicated as to be completely useless, not to mention that such perfect models are in any case completely unattainable as a practical matter. The purpose of a mathematical model is to clarify and describe the mechanisms of primary importance in the physical system and to neglect those mechanisms which are of only secondary importance. As such a mathematical model of a physical system should always be as simple as possible consistent with the use to which the model will be put. Of course there remains the problem of deciding which mechanisms in a physical system are primary and which are secondary. There are no clear rules for this, and as a result the construction of mathematical models is typically an iterative trial-anderror process involving a considerable element of judgement. One begins by deciding which of the underlying mechanisms are primary, and then builds a model based on these; if it turns out that 46 the model is “too simple”, in the sense that some of the neglected secondary mechanisms should have been taken into account as primary mechanisms, then one must include these in a revised mathematical model. In this course our goal is certainly not to build mathematical models of complex physical systems, which is a major undertaking quite distinct from the area of control systems, and our mathematical models will be considered “given”, typically in the form of a transfer function. Nevertheless, there are some very simple electrical and mechanical systems which are essential elements in building more sophisticated mathematical models, and we must be aware of these. In the next section we shall study some of these simple electrical and mechanical systems, and see how they can be applied to obtain mathematical models and transfer functions of more complex systems. 2.7 Basic electrical and mechanical models In the present section we recall some basic electrical and mechanical system elements, which should be familiar from introductory physics and electrical circuits. We then illustrate the application of these with several examples. Electrical system elements: The most basic electrical system elements are resistors, inductors, and capacitors. These are shown in Fig. 2.40(i)(ii)(iii). In each case v(t) denotes the voltage drop from left to right, and i(t) denotes the current flow, again from left to right, at the instant t. Resistor: For the resistor in Fig. 2.40(i) the relation between current and voltage is given by Ohm’s law, that is (2.7.37) v(t) = Ri(t), in which R is a constant - the resistance with units in ohms - which is characteristic of the resistor. Inductor: For the inductor in Fig. 2.40(ii) the relation between current and voltage is given by (2.7.38) v(t) = L di(t) , dt in which L is a constant - the inductance with units in henrys - which is characteristic of the inductor. 47 Figure 2.40: Electrical system elements Capacitor: For the capacitor in Fig. 2.40(ii) the relation between current and voltage is given by (2.7.39) 1 v(t) = v(0) + C Z t i(s)ds, 0 in which C is a constant - the capacitance with units in farads - which is characteristic of the capacitor. We can use the basic laws of electrical circuits - the Kirchhoff voltage and current laws - to obtain the transfer functions of systems made up of resistors, capacitors and inductors, as illustrated in the following example. Example 2.7.1. The system shown in Fig. 2.41 is a series combination of a resistor, an inductor and a capacitor. The input signal is the applied voltage v(t) and the output signal is the corresponding current i(t). From KVL we know that v(t) is the sum of the voltage drops across the resistor, the capacitor and the inductor, thus from (2.7.37) - (2.7.39) we find Z di(t) 1 t v(t) = Ri(t) + L + i(s)ds, dt C 0 48 Figure 2.41: RLC circuit where we have assumed that the initial voltage across the capacitor is zero. Upon taking Laplace transforms (with all initial conditions assumed to be zero) we find V (s) = RI(s) + LsI(s) + 1 I(s), Cs and from this we obtain (2.7.40) I(s) Cs = . 2 V (s) LCs + RCs + 1 Now (2.7.40) gives the ratio of the Laplace transform I(s) of the output signal i(t) to the Laplace transform V (s) of the input signal v(t), and is therefore the transfer function of the system (see Remark 2.1.1). Mechanical system elements (translational motion): We recall from physics the simplest mechanical system elements associated with translational motion along a straight line. We shall always use the basic sign convention shown in Fig. 2.42. If 0 is some designated point on a straight Figure 2.42: Sign convention for translational motion 49 line, and at instant t a point on the line is displaced a distance x(t) to the right of 0, then we take x(t) > 0, that is any displacement to the right of the origin is positive. On the other hand, if a point on the line is displaced a distance x(t) to the left of 0 at instant t then we take x(t) < 0, that is any displacement to the left of the origin is negative. If at some instant t one has x(1) (t) > 0 then x(t) is increasing and the point is moving to the right at instant t, and similarly if x(1) (t) < 0 then the point is moving to the left at the instant t. Furthermore, if f (t) is a force exerted along the straight line at instant t, then f (t) > 0 is understood to indicate that the force is directed from left to right, while f (t) < 0 indicates that the force is directed from right to left. The most basic mechanical system elements are mass, springs, and dampers. These are shown in Fig. 2.43(i)(ii)(iii). Figure 2.43: Mechanical system elements Force and mass: In Fig. 2.43(i) a mass m has a displacement x(t) from the fixed origin 0 at instant t. Under these conditions the second law of Newton states that a force f (t) must be exerted on the mass m (by some external agent) and this force at instant t is given by (2.7.41) f (t) = mx(2) (t). When x(2) (t) > 0, so that f (t) > 0, then the force is directed to the right, and when x(2) (t) < 0, so that f (t) < 0, then the force is directed to the left. 50 Remark 2.7.2. In Newton’s second law stated at (2.7.41) it is most important that the displacement x(t) (and corresponding acceleration x(2) (t)) be with reference to a point 0 which is fixed on the surface of the earth. If the point 0 is itself accelerating, rather than fixed to the surface of the earth, then (2.7.41) does not hold when x(t) and its derivatives are measured with reference to the point 0. More generally, Newton’s second law holds in so-called inertial reference frames. A general discussion of inertial reference frames is well beyond the scope of this course. Provided that we neglect the astronomical movement of the earth (such as its rotation or orbit around the sun), any point 0 fixed to the surface of the earth is the origin of an inertial frame. Spring: In Fig. 2.43(ii) the left end of the spring is attached to some origin 0. We assume that the spring has zero length when it is not stretched. If at instant t an external agent stretches the spring by a displacement x(t) then Hooke’s law states that spring exerts a force f (t) at the point A which is given by (2.7.42) f (t) = −kx(t). In this equation k is a positive constant - called the spring constant - which is characteristic of the spring. The negative sign in the equation is important, for it tells us that f (t) < 0 when x(t) > 0, and f (t) > 0 when x(t) < 0, that is the force f (t) exerted by the spring at point A is directed to the left when x(t) > 0 and is directed to the right when x(t) < 0. This means that the force f (t) exerted by the spring at point A always opposes the stretching of the spring, that is the spring resists being extended. Damper: A damper (or dashpot) comprises a piston moving in a cylindrical tube with viscous friction between the wall of the tube and the edge of the piston. Fig. 2.43(iii) shows a damper with the cylinder attached to some origin 0 and the piston being pulled (to the right for concreteness) by an external agent. If at instant t the external agent displaces the piston with a velocity x(1) (t) then the law of viscous friction states that the viscous friction in the damper exerts a force f (t) at the point A which is given by (2.7.43) f (t) = −Bx(1) (t). In this equation B is a positive constant - called the damping constant - which is characteristic of the damper. The negative sign in the equation indicates that f (t) < 0 when x(1) (t) > 0, and f (t) > 0 when x(1) (t) < 0. It follows that the force of viscous friction f (t) is directed to the left 51 when the movement of the piston is to the right, and is directed to the right when the movement of the piston is to the left, that is the force f (t) opposes the motion of the piston. Clearly this happens because the viscous force in the damper resists motion of the piston relative to the cylindrical tube. Remark 2.7.3. In contrast to Newton’s second law (see (2.7.41)), which requires that the origin 0 be fixed to the surface of the earth (recall Remark 2.7.2), for Hooke’s law (see (2.7.42)) and the damper law (see (2.7.43)) it is not required the reference origin 0 be fixed to the surface of the earth, and these laws continue to hold even when the reference point 0, with reference to which x(t) and its derivatives are measured, is accelerating relative to the surface of the earth. Remark 2.7.4. Suppose that a spring with constant k has zero length in the “unstretched” state. When the spring is extended by a distance x(t), as shown in Fig. 2.44(i), then we know that the spring exerts a force f (t) = −kx(t), at its right end A. This force opposes the extension of the spring and is therefore directed to the left when x(t) > 0. In exactly the same way the spring exerts a force −f (t) = kx(t) at its left end B; this force has the same magnitude as the force f (t) exerted by the spring at A, but is directed to the right when x(t) > 0, again because the spring opposes any extension. That is, the forces exerted by the spring at ends A and B are always equal in magnitude but opposite in direction. In much the same way, for the damper with constant B shown in Fig. 2.44(ii), the force exerted by Figure 2.44: Equal but opposite forces 52 viscous friction at the right end A of the damping piston is f (t) = −Bx(1) (t), this force being directed to the left when x(1) (t) > 0 since the viscous friction in the damper opposes movement of the piston. In exactly the same way the viscous friction exerts a force −f (t) = Bx(1) (t) at the left end B of the damper. This force is equal in magnitude to the force f (t) exerted at A, but is directed to the right when x(1) (t) > 0, and directed to the left when x(1) (t) < 0, again because the viscous friction opposes movement of the piston. Therefore, just as for the spring, the forces exerted by viscous friction at ends A and B of the damper are always equal in magnitude but opposite in direction. Example 2.7.5. In Fig. 2.45(i) a block of mass m slides on a level surface and is attached to a fixed origin 0 by a spring with constant k and a damper with constant B. An external agent applies a force f (t) to the mass, resulting in the displacement x(t) of the mass as shown. Determine the Figure 2.45: For the Example 2.7.5 relation between the applied force f (t) and the displacement x(t). If one regards f (t) as the input and x(t) as the output of the system determine the transfer function of the system. At instant t the spring exerts a force fs (t), and viscous friction in the damper exerts a force fd (t), these forces being given by (see (2.7.42) and (2.7.43)) fd (t) = −Bx(1) (t). fs (t) = −kx(t), 53 These are shown in Fig. 2.45(ii), from which it follows that the resultant force on the mass m is fres (t) = f (t) + fs (t) + fd (t) = f (t) − kx(t) − Bx(1) (t). From Newton’s second law fres (t) = mx(2) (t), and combining these equations gives the required relation mx(2) (t) + Bx(1) (t) + kx(t) = f (t). (2.7.44) To determine the transfer function of the system take Laplace transforms at (2.7.44) with all initial conditions on x(t) put equal to zero. We find ms2 X(s) + BsX(s) + kX(s) = F (s), and from this we obtain the transfer function X(s) 1 = . 2 F (s) ms + Bs + k Example 2.7.6. A simple accelerometer comprises a cylindrical capsule which is in motion from left to right as shown in Fig. 2.46. Mounted inside the capsule is a mass m which is free to move horizontally, and which is attached to the right end of the cylinder by a spring with constant k (which has zero length when not stretched) and a damper with coefficient of viscous damping B. The right end of the capsule is a distance y(t) from a fixed point 0, and the mass m is a distance x(t) from the right end of the cylinder. Determine y(t) in terms of x(t), supposing that the initial conditions are zero: x(0) = 0, x(1) (0) = 0, y(0) = 0, y (1) (0) = 0. Let fs (t) be the force exerted on m by the spring and let fd (t) be the force exerted on m by the viscous damping, as shown in Fig. 2.46. Then (2.7.45) fd (t) = Bx(1) (t), fs (t) = kx(t), so that the resultant force on m is (2.7.46) m fres (t) = fs (t) + fd (t) = kx(t) + Bx(1) (t). 54 Figure 2.46: Accelerometer in the Example 2.7.6 Now put z(t) = y(t) − x(t). (2.7.47) Since the displacement of m from the fixed point 0 is z(t) one sees from Newton’s second law that m mz (2) (t) = fres (t). (2.7.48) Combine (2.7.48), (2.7.47) and (2.7.46): m[y (2) (t) − x(2) (t)] = kx(t) + Bx(1) (t), that is the acceleration of the capsule, relative to the fixed point 0, in terms of the displacement x(t) is given by (2.7.49) y (2) (t) = x(2) (t) + B (1) k x (t) + x(t). m m When all initial conditions are zero we can integrate (2.7.49) twice to get Z Z Z s B t k t (2.7.50) y(t) = x(t) + x(s)ds + x(u)du ds. m 0 m 0 0 Remark 2.7.7. In an actual accelerometer the displacement x(t) of the mass m from the right end of the capsule is measured in real-time by a MEMS device such as a differential capacitor, and the 55 integrations on the right side of (2.7.50) are carried out in real-time using operational amplifiers (or in software). If the capsule is mounted in an aircraft which flies from left to right, and 0 is a fixed point on the earth (e.g. the point where the aircraft began its flight), then (2.7.50) gives the total distance flown by the aircraft in terms of the measured displacement x(t). This is the basis of the inertial navigators found in aircraft and space satellites (and also mobile phones). Example 2.7.6 illustrates the principle explained in Remark 2.7.2, that is in Newton’s second law the displacement of the mass must be relative to a fixed point on the surface of the earth i.e. the displacement z(t). We cannot write Newton’s second law as m mx(2) (t) = fres (t), (c.f. (2.7.48)) because the displacement x(t) is relative to the right end of the capsule, which itself is generally accelerating with respect to the earth. Example 2.7.6 also illustrates the significance of Remark 2.7.3, that is we can apply Hooke’s law (see (2.7.42)) and the damper law (see (2.7.43)), even though the spring and the damper are attached to the right end of the capsule which is itself accelerating. Mechanical system elements (rotational motion): Previously we studied various mechanical system elements in the case of translational motion, that is left-or-right motion along a straight line. We shall now recall from physics the simplest corresponding mechanical elements for rotational motion, that is clockwise-or-counterclockwise rotation around a fixed axis. We adopt the sign convention shown in Fig. 2.47, in which the axis is perpendicular “out of the page” through the point 0. A counterclockwise angular displacement θ(t) relative to a fixed straight baseline Figure 2.47: Sign convention for rotational motion 56 is positive, that is θ(t) > 0, while a clockwise angular displacement θ(t) relative to the baseline is negative, that is θ(t) < 0 (this is just the rotational analogue of the convention already adopted that a translational displacement x(t) to the right of the fixed origin 0 is positive while a translational displacement x(t) to the left of the origin 0 is negative). If at some instant t we have θ(1) (t) > 0 then θ(t) is increasing and we must have counterclockwise rotation at instant t, and similarly if θ(1) (t) < 0 then we must have clockwise rotation at the instant t. Finally, we emphasize that for problems which involve rotational motion we always measure angles in radians and never use degrees. Torque and moment of inertia: We first recall the notion of torque, which is a “rotational analogue” of the force that we have seen above which pushes a mass either left or right along a straight line. To understand torque picture a straight-line axis AB shown in Fig. 2.48 which, for concreteness, can be regarded as a straight metal shaft. A torque T (t) at some instant t is an externally Figure 2.48: Torque and shaft rotation applied “rotational” or “twisting” action which causes the shaft to rotate either clockwise or counterclockwise resulting in an angular displacement θ(t) (measured in radians) at the instant t. We shall always use the following sign convention for the torque: If the torque T (t) rotates or twists in a counterclockwise direction then T (t) > 0, and if T (t) twists in a clockwise direction then T (t) < 0. Newton’s second law in rotational form states that the relation between the applied torque T (t) and the resulting angular displacement θ(t) is (2.7.51) T (t) = Jθ(2) (t), in which J is a positive constant called the moment of inertia of the shaft. When θ(2) (t) > 0 then T (t) > 0, and the sense or direction of the torque is counterclockwise; when θ(2) (t) < 0 then 57 T (t) < 0, and the direction of the torque is clockwise. Rotational spring: Fig. 2.49 shows a spring with ends A and B wound around a straight spindle, which is fixed and not free to rotate. The end A is attached to the fixed spindle, and is therefore itself fixed, and the end B is free to rotate around the fixed spindle as the spring is “twisted” or “wound up” around the spindle. We assume that B has zero angular displacement when the spring is not “twisted” or “wound up”. If at instant t an external agent rotates the end B of the Figure 2.49: Rotational spring spring through the angular displacement θ(t) then the rotational form of Hooke’s law states that spring exerts a torque T (t) at the point B which is given by (2.7.52) T (t) = −kθ(t). In this equation k is a positive constant - called the rotational spring constant - which is characteristic of the spring. The negative sign in (2.7.52) indicates that T (t) < 0 when θ(t) > 0, and T (t) > 0 when θ(t) < 0. That is the torque T (t) exerted by the spring at the point B is clockwise when θ(t) > 0, and is counterclockwise when θ(t) < 0. It follows that the torque T (t) exerted by the spring at the point B always opposes “winding” of the spring by an external agent. Rotational damper: A rotational damper (or journal bearing) comprises a straight shaft rotating within a fixed cylindrical sleeve (which is not free to rotate), with viscous friction between the wall of the sleeve and the surface of the shaft arising from lubrication fluid (e.g. oil or grease) in the gap between the shaft and the inner wall of the cylindrical sleeve. Fig. 2.50 shows a rotational damper with the cylindrical sleeve being fixed and unable to rotate, and the shaft free to rotate inside the stationary sleeve. If at instant t an external agent rotates the shaft with an angular 58 Figure 2.50: Rotational damper velocity θ(1) (t) then the law of viscous friction in rotational form states that viscous friction in the damper exerts a torque T (t) on the shaft which is given by (2.7.53) T (t) = −Dθ(1) (t). In this equation D is a positive constant - called the coefficient of viscous friction (or rotational damping constant) - which is characteristic of the rotational damper. The negative sign in the equation indicates that T (t) < 0 when θ(1) (t) > 0, and T (t) > 0 when θ(1) (t) < 0. It follows that the torque T (t) exerted on the shaft by viscous friction is clockwise when θ(1) (t) > 0 (i.e. when the shaft rotates counterclockwise), and is counterclockwise when θ(1) (t) < 0 (i.e. when the shaft rotates clockwise). This is because the viscous friction in the damper resists rotation of the shaft by an external agent. Example 2.7.8. Fig. 2.51 shows a rotational damper (or journal bearing) with coefficient of viscous friction D. An external agent applies a torque T (t) to the shaft resulting in an angular displacement θ(t) of the shaft, which has moment of inertia J. We must determine the relation between the applied torque T (t) and the resulting angular displacement θ(t). The law of viscous friction in rotational form states that the viscous friction exerts a torque Tvf (t) on the shaft which is given by (2.7.53), thus Tvf (t) = −Dθ(1) (t). We thus have the torque T (t) externally applied to the shaft, together with the torque Tvf (t) of viscous friction also applied to the shaft, therefore the resultant or total torque Tres (t) rotating the shaft must be the sum of T (t) and Tvf (t), that is Tres (t) = T (t) + Tvf (t) = T (t) − Dθ(1) (t). 59 Figure 2.51: For the Example 2.7.8 Now Tres (t) is the torque to be used in the left-hand side of Newton’s second law in rotational form (2.7.51), that is Tres (t) = Jθ(2) (t). Combining the preceding two equations gives (2.7.54) T (t) = Jθ(2) (t) + Dθ(1) (t), which is the required relation. Example 2.7.9. In this example we study a physiological system, namely a muscle, for which a simple but widely used model is shown in Fig. 2.52. In this model the spring with constant k1 models elasticity in the muscle tendons, while the spring with constant k2 models elasticity in the muscle sarcolemma. Each of these springs is attached on the left to a fixed origin 0 which represents the skeleton. The damper with constant B models viscous damping within the muscle tissue itself. The model also includes an active contractile element (ACE) which accounts for the contractive force exerted by the muscle. The ACE in turn can be modeled as a cylinder, as shown in Fig. 2.52. In response to signals from the nervous system at instant t the ACE exerts a force F0 (t) at the left end of the cylinder, the force being directed to the right, and also exerts the equal but opposite force −F0 (t) at the right end of the cylinder, which is directed to the left (this models the “contraction” of muscle fibre in response to signals from the nervous system). Finally, an external agency (e.g. gravity) applies a force F (t) to the right side of the muscle as shown in Fig. 2.52, and as a result of the force F (t) the entire muscle is stretched to the right through a displacement x(t). Our goal is to determine the relation between the applied force F (t), the contractive force F0 (t) and the displacement x(t) through which the muscle is stretched. 60 Figure 2.52: For the Example 2.7.9 It is clear from Fig. 2.52 that the spring with constant k2 is stretched to the right through the displacement x(t). Let x1 (t) be the displacement to the right through which the spring with constant k1 is stretched. From Fig. 2.52 it follows that the piston of the damper is necessarily displaced to the right through x(t) − x1 (t). Now consider the point C in Fig. 2.52, to which is attached the right end of the ACE, the right end of the damper, the right end of the spring with constant k2 , and on which the force F (t) is applied directed to the right. The right end of the spring with constant k2 exerts the force fs2 (t) = −k2 x(t), on point C (see (2.7.42)). Similarly the right end of the damper also exerts the force (1) fd (t) = −B[x(1) (t) − x1 (t)], on point C (see (2.7.43)). Finally, one sees from Fig. 2.52 that the ACE exerts a force −F0 (t) at the point C. The forces exerted at point C are shown in Fig. 2.53, and must be in balance (that is sum to zero): F (t) − F0 (t) + fd (t) + fs2 (t) = 0. It follows that (2.7.55) (1) F (t) = F0 (t) + B[x(1) (t) − x1 (t)] + k2 x(t). 61 Figure 2.53: Forces at points A and C Now consider the point A in Fig. 2.52 to which is attached the right end of the spring with constant k1 , the left end of the ACE, and the left end of the damper. The right end of the spring with constant k1 exerts a force fs1 (t) = −k1 x1 (t), at the point A. Moreover, it follows from Remark 2.7.4 that the left end of the damper exerts a force (1) −fd (t) = B[x(1) (t) − x1 (t)], at the point A. Finally one sees from Fig. 2.52 that the ACE exerts the force F0 (t) at the point A, as shown in Fig. 2.53. Now the forces at point A must be in balance, that is F0 (t) − fd (t) + fs1 (t) = 0, and thus (2.7.56) (1) F0 (t) + B[x(1) (t) − x1 (t)] = k1 x1 (t). From (2.7.55) and (2.7.56) we get F (t) = k1 x1 (t) + k2 x(t), 62 and therefore x1 (t) = F (t) − k2 x(t) . k1 Substituting x1 (t) from the preceding expression in (2.7.55) gives k2 B F (t) = F0 (t) + B 1 + x(1) (t) − F (1) (t) + k2 x(t), k1 k1 from which we easily find the required relation (2.7.57) k1 dx(t) k1 k2 dF (t) k1 + F (t) = F0 (t) + (k1 + k2 ) + x(t). dt B B dt B This equation is sometimes written in terms of the compliance Ci of the springs, which is defined as the reciprocal of the spring constants namely Ci = 1 , ki i = 1, 2, so that 1 1 dF (t) + F (t) = F0 (t) + dt BC1 BC1 1 1 + C1 C 2 1 dx(t) + x(t). dt BC1 C2 Example 2.7.10. In this example we study a model for another physiological system, namely the lung mechanism, which is represented by the electrical network shown in Fig. 2.54. Although Figure 2.54: For the Example 2.7.10 the physiological aspects are not central to the purpose of analyzing the model, we briefly mention that the parameters in the model have the following physiological interpretation: • Voltage v(t) models the pressure at the central airway of the lung 63 • Current i(t) models volumetric flow rate of air though the central airway of the lung • Voltage v1 (t) models the pressure at entrance of the peripheral airway of the lung • Current i1 (t) models volumetric flow rate of air through the alveoli of the lung • Resistance Rc models fluid mechanical resistance in the central airway of the lung • Resistance Rp models fluid mechanical resistance in the alveoli of the lung • Capacitance Ceq models compliance of the lung and chest combined • Capacitance Cσ models compliance of the shunt airway in the lung. Our goal is to determine the relation between the voltage v(t) (pressure at the central airway) and current i(t) (volumetric flow rate through the central airway). We apply KVL around the loop ABEF A: v(t) = Rc i(t) + v1 (t). But i − i1 is the current through the capacitor Cσ , and therefore Z t 1 v1 (t) = (i(s) − i1 (s))ds. Cσ 0 Combining the preceding expressions gives 1 v(t) = Rc i(t) + Cσ (2.7.58) Z t (i(s) − i1 (s))ds. 0 Now apply KVL around the loop BCDEB: 1 v1 (t) = Rp i1 (t) + Ceq Z t i1 (s)ds, 0 and therefore (2.7.59) 1 Cσ Z 0 t 1 (i(s) − i1 (s))ds = Rp i1 (t) + Ceq Z t i1 (s)ds. 0 Now take Laplace transforms of (2.7.59) and (2.7.58). This gives: (2.7.60) 1 1 [I(s) − I1 (s)] = Rp I1 (s) + I1 (s), sCσ sCeq 64 (2.7.61) V (s) = Rc I(s) + 1 [I(s) − I1 (s)]. sCσ It remains to eliminate I1 (s) from (2.7.61) and (2.7.60) to get the relation between V (s) and I(s). From (2.7.60) 1 1 I(s) = Rp I1 (s) + sCσ s 1 1 + Ceq Cσ I1 (s). Upon defining CT by 1 1 1 = + , CT Cσ Ceq (2.7.62) we obtain 1 I(s) = Cσ 1 sRp + CT I1 (s), and thus (2.7.63) I1 (s) = 1 I(s). Cσ [sRp + (1/CT )] From (2.7.63) and (2.7.61) 1 1 I(s) − I1 (s) V (s) = Rc I(s) + sCσ sCσ 1 1 = Rc + I(s), I(s) − sCσ sCσ2 [sRp + (1/CT )] and multiplying across by s[sRp + (1/CT )] gives 1 1 1 1 s sRp + V (s) = sRp + Rc s + I(s) − 2 I(s) CT CT Cσ Cσ Rc Rp 1 1 2 = Rc Rp s + s + + − 2 I(s). CT Cσ Cσ CT Cσ From (2.7.62) 1 1 1 − 2 = , Cσ CT Cσ Cσ Ceq and thus 1 Rc Rp 1 2 s sRp + V (s) = Rc Rp s + s + + I(s). CT CT Cσ Cσ Ceq Multiplying across by 1/Rp then leads to the required relation between v(t) and i(t): s Rc 1 1 2 2 s + V (s) = Rc s + + s+ I(s). CT R p CT Rp Cσ Cσ Ceq Rp 65 If we prefer to write this relation in the time-domain (instead of the Laplace domain) we just take inverse Laplace transforms to get the differential equation d2 v(t) d2 i(t) 1 di(t) 1 1 dv(t) Rc i(t). = R + + + + c dt2 CT Rp dt dt2 CT Rp Cσ dt Cσ Ceq Rp Example 2.7.11. Field controlled servo-motors are found in many applications, including the flap mechanism on the wings of an aircraft, robotic-arm manipulators on industrial assembly lines, and precision surgical instruments, to mention just a few. In this example we derive the transfer function of this type of servo-motor. In a field controlled servo-motor a voltage vf (t) is applied to field windings in the motor, and the field windings in turn generate a magnetic field inside the motor. Mounted in this magnetic field is an armature, which is attached to a shaft and free to rotate. Conducting wires carrying a constant current ia are wound around the armature, and the interaction of the current-carrying windings on the armature and the magnetic field produces a torque (in accordance with the force-law for current-carrying conductors in a magnetic field) which causes the armature to rotate. The shaft of the armature rotates in a journal bearing (or rotational damper) with coefficient of viscous friction D (recall Fig. 2.50). A schematic representation of the field controlled servo-motor is shown in Fig. 3.8. We regard the servo-motor as a system for Figure 2.55: Field-controlled servo-motor which the input signal is the voltage vf (t) applied to the field windings of the motor, and the output signal is the angular displacement y(t) of the shaft attached to the armature of the motor 66 (for consistency with the customary notation for electric motors we use y(t) instead of θ(t) for the angular displacement of the armature shaft). To summarize: • the input is the voltage vf (t) applied to the field windings which have a resistance Rf and an inductance Lf ; • the output is the angular position y(t) of the armature shaft (in radians) with moment of inertia J; • the current ia through the armature of the motor is constant (and specified by the manufacturer of the motor); • the armature shaft rotates in a journal bearing (or rotational damper) with coefficient of viscous friction D; • a magnetic field set up in the motor by the field current if (t) causes a torque T (t) on the motor shaft at instant t which is directly proportional to the current if (t) at the same instant t, that is (2.7.64) T (t) = Km if (t). Here Km is the so-called motor constant, which is characteristic of the design of the motor. The value of constant Km is provided by the manufacturer of the motor. When a voltage vf (t) is applied to the field windings a current if (t) passes through the field windings in response, the relation between vf (t) and if (t) being given by KVL (applied to the field windings): (2.7.65) vf (t) = Rf if (t) + Lf dif (t) . dt From the rotational version of Newton’s second law applied to the motor shaft in Fig. 3.8 we obtain (2.7.66) T (t) = Jy (2) (t) + Dy (1) (t), (by the same calculation which gave (2.7.54) in Example 2.7.8). Note that, in (2.7.66) • J is moment of inertia of the motor shaft • D is the coefficient of viscous friction in the journal bearings of the motor shaft 67 (the constants D and J are supplied by the manufacturer of the motor). From (2.7.66) and (3.2.6) one finds (2.7.67) if (t) = J (2) D (1) y (t) + y (t). Km Km Taking Laplace transforms in (2.7.67), supposing all initial conditions are zero, we get (2.7.68) If (s) = J 2 D s Y (s) + sY (s), Km Km and taking Laplace transforms in (2.7.65), again supposing all initial conditions are zero, gives (2.7.69) Vf (s) = Rf If (s) + sLf If (s). Eliminating If (s) between (2.7.68) and (2.7.69) and simplifying gives D Vf (s) sJ + , sY (s) = Km K m Rf + sLf thus the transfer function of the field controlled servo-motor is (2.7.70) Y (s) Km /Rf = . Vf (s) s(sJ + D)(1 + sLf /Rf ) Now it is typically the case that the time-constant Lf /Rf is negligibly small, thus the transfer function at (2.7.70) simplifies to (2.7.71) Y (s) Km /Rf = . Vf (s) s(sJ + D) We shall use the transfer function (2.7.71) in Example 3.2.1 in Chapter 3. 68 Chapter 3 Design specifications for control systems A control system must always meet certain design specifications if it is to function effectively. These design specifications are very much dependent on the intended application of the control system. For example the design specifications for the inertial guidance system of an aircraft are going to be rather different from the design specifications for the controller of a robot arm on an industrial assembly line. Despite these differences there are certain very basic design specifications which are common for nearly all control systems . The goal of this chapter is to study the most important of these basic specifications. 3.1 Basic specifications In this section we shall introduce and discuss some of the most basic and important design specifications, namely • stability • tracking • unit step response These specifications are then examined in more detail in later sections of the chapter in the context of a particularly important system called a second order system. (1) Stability: You will be familiar with the notion of system stability from ECE-207. In view of its great importance we shall briefly summarize the essential elements of system stability here. 69 Prior to defining stability of a system we recall the idea of a bounded signal. A signal x(t), t ≥ 0, is said to be bounded when there is a finite number M such that (see Fig. 3.1) |x(t)| ≤ M for all t ≥ 0, or equivalently −M ≤ x(t) ≤ M for all t ≥ 0. There are no conditions on the number M except that it be positive and finite. For example, the signals x(t) = cos(t), t ≥ 0, and x(t) = e−t , t ≥ 0, are bounded signals. On the other hand the signals x(t) = et , t ≥ 0, and x(t) = t, t ≥ 0, fail to be bounded and are called unbounded signals. Now suppose that a linear system has an Figure 3.1: Bounded signal x(t) input u(t) and an output y(t) defined for all t ≥ 0 (see Fig. 3.2). Then the system is said to be stable when, for each and every bounded input signal u(t), the corresponding output signal y(t) is also bounded. If there is at least one bounded input signal u(t) for which the corresponding output signal y(t) is unbounded then the system is said to be unstable. For example if the output corresponding to the bounded input u(t) = 20 cos(t), t ≥ 0, is the unbounded signal y(t) = et sin(t), t ≥ 0, 70 Figure 3.2: System with input u(t) and output y(t) then the system is unstable. In principle, to determine whether or not a given system is stable, one must test that the response of the system to each and every bounded input signal is also bounded, which is a task of infinite extent! Fortunately we can establish criteria for stability which do not require that one physically check boundedness of the system response to every possible bounded input signal. From ECE-207 we have the following result: Theorem 3.1.1. Suppose that a system is linear time-invariant with the impulse response h(t), t ≥ 0. Then the system is stable if and only if Z ∞ |h(t)|dt < ∞. 0 This test involves checking the integral of the absolute value of the impulse response h(t) over the range t ≥ 0; the system is stable if and only if this integral is finite. In particular, if the integral has the value +∞ then the system is unstable, meaning that there must be one or more bounded input signals which cause an unbounded output signal. The converse is also true: if the system is unstable then the integral must take the value +∞. This result is obviously a huge improvement over directly testing the system for each and every bounded input, but from our point of view has one drawback; we typically deal not with the impulse response h(t) of a system, but rather with its transfer function, which is the Laplace transform H(s) of the impulse response: H(s) = L{h(t)}(s). From now on, for the remainder of this course, we are going to assume that all transfer functions are coprime rational functions, that is H(s) is the ratio of two polynomials: (3.1.1) H(s) = N (s) , D(s) in which N (s) and D(s) are, respectively, the numerator polynomial and the denominator polynomial, and these polynomials do not have any roots in common. In particular, D(s) has the 71 form (3.1.2) D(s) = an sn + an−1 sn−1 + . . . + a1 s + a0 , in which the ai are complex constants with an ̸= 0. The integer n, which is the highest power of s on the right hand side, is denoted by deg(D), and called the degree of the polynomial D(s): deg(D) = n. Identical comments hold for the numerator polynomial N (s). The transfer function H(s) at (3.1.1) is proper when (3.1.3) deg(N ) ≤ deg(D), and is strictly proper when (3.1.4) deg(N ) < deg(D). Finally, at (3.1.1), the roots of the denominator polynomial D(s) are called the poles of the transfer function H(s) while the roots of the numerator polynomial N (s) are called the zeros of the transfer function H(s). Since H(s) is coprime one can never have the case where any pole and zero of H(s) coincide. With this terminology recalled we can state the following result, which should be familiar from ECE-207: Theorem 3.1.2. Suppose that the transfer function H(s) of a linear time-invariant system is the coprime rational function H(s) = N (s) . D(s) Then the system is stable if and only if the the following two conditions hold: (a) H(s) is proper i.e. deg(N ) ≤ deg(D) (b) all poles of H(s) (i.e. all roots of D(s)) have strictly negative real parts. Remark 3.1.3. Part (b) of Theorem 3.1.2 means the following: if the complex number p is a pole of H(s), that is D(p) = 0, then re{p} < 0. Note the strict inequality - this is a stronger condition than just requiring re{p} ≤ 0. 72 Example 3.1.4. The system with transfer function H(s) = s2 1 +1 is unstable. This is because the poles of H(s) (i.e. the roots of s2 + 1 = 0) are p2 = −j, p1 = j, thus re(p1 ) = re(p2 ) = 0, thus condition (b) in Theorem 3.1.2 does not hold. We shall examine stability of control systems in detail in later chapters, and Theorem 3.1.2 will be an essential tool for this. At this point we just remark that stability is a compulsory design specification for every control system; from a practical standpoint a control system which is unstable is completely useless. We now move on to the next design specification which is: (2) Tracking: Recalling the system in Fig. 3.2 there are many applications where we would like the output y(t) to “track” or “follow” or “stay close” to the input signal u(t). For example, if a robot arm is working in a dangerous environment manipulating radio-active materials inside a nuclear reactor, then we would want the actual angle y(t) of the robot arm (the output of the system) to track the angle u(t) set by an operator (the input to the system), the operator being a safe distance away from the robot. We say that a system tracks the input signal u(t) when the corresponding output y(t) is such that lim (y(t) − u(t)) = 0, t→∞ equivalently, for a tracking error defined by e(t) = y(t) − u(t), we require lim e(t) = 0, t→∞ (see Fig. 3.3). Tracking essentially means that the discrepancy e(t) between the input and output signals vanishes as t → ∞ i.e. if we wait long enough. The more quickly the discrepancy e(t) vanishes as t increases the “faster” is the tracking of the input u(t) by the output y(t). For example, 73 Figure 3.3: Output y(t) tracks the input u(t) Figure 3.4: Fast and slow tracking in Fig. 3.4 we have tracking of a unit step input in both cases, but the tracking of System-1 on the left is clearly much “faster” than the tracking of system-2 on the right. In many applications, such as the example of the robot arm mentioned above, we want the tracking to be fast, at least for a step input. This takes us to the next specification, namely the unit step response that is the response y(t) when the input u(t) is specifically the unit step function. 74 (3) The unit step response: In order to specify the “goodness” of tracking, including the speed of tracking, we introduce the unit step response, which is the output signal y(t) when the input signal u(t) is specifically a unit step function, that is for all t ≥ 0. u(t) = 1 From the unit step response y(t) we obtain the following quantitative parameters which are commonly used as design specifications: • steady state error • rise time • overshoot • settling time We next examine each of these parameters: (i) Steady state error: This is the quantity ess defined by ess = lim e(t), t→∞ in which e(t) is the usual tracking error, that is e(t) = y(t) − u(t) = y(t) − 1, since u(t) is the unit step input. Clearly the system tracks the unit step input if and only if ess = 0 (see Fig. 3.5). (ii) Rise time: Define the steady state output yss by yss = lim y(t), t→∞ it being understood that the input u(t) is the unit step function (see Fig. 3.5). Note that ess = yss − 1, thus the system tracks the unit step input if and only if yss = 1. Then the 90% rise time is defined as the first instant tb such that (see Fig. 3.6) y(tb ) = 0.9yss , 75 Figure 3.5: ess and yss that is the first instant t at which the output y(t) attains 90% of the steady state output yss . A variant of this is the so-called 10% - 90% rise time, which is defined as the difference tb − ta , in which tb is the 90% rise time defined above and ta is the first instant at which y(ta ) = 0.1yss . (iii) Overshoot: Suppose that the unit step response u(t) attains a maximum value ymax with ymax > ess (see Fig. 3.6). Then the overshoot of the unit step response is defined by the quantity O.S. = ymax − yss . yss (iv) Settling time: The 2% settling time is the first instant ts such that Figure 3.6: Rise time and overshoot 0.98yss ≤ y(t) ≤ 1.02yss 76 for all t ≥ ts that is, the first instant ts such that y(t) is within 2% of the steady state value yss for all t ≥ ts . One can similarly define for example the 5% settling time. 3.2 Second order systems Until now we have not been at all specific about the system with input u(t) and output y(t). In this section we focus on a very specific system called a second order system which has the transfer function (3.2.5) H(s) = s2 b , + as + b in which a and b are constants with b > 0 (the constant a can be either positive or negative). Notice that the numerator is identical to the constant term in the denominator in a second order system. Second order systems are among the most important in the applications of control, modelling as they do an extraordinarily wide variety of practical control systems. Example 3.2.1. One of the most important examples of a second order system is a so-called servo-mechanism, which is ubiquitous in applications such as robotics, aerospace engineering, automated manufacturing, and high-precision medical instruments. The basic structure of a servomechanism is shown in Fig. 3.7. This comprises an amplifier with a gain K in series with a Figure 3.7: Servo-mechanism servo-motor, and unit negative feedback. Specifically, the block labeled“servo-motor” represents a field controlled servo-motor such as we have seen in Example 2.7.11. The output y(t) is the actual angular position of the servo-motor shaft and the input u(t) is the desired angular position of the servo-motor shaft. In a typical application one might have a robot arm attached to the shaft of 77 the servo-motor so that the angle of the robot arm corresponds to the shaft angle y(t) of the servomotor. One would want the angle y(t) of the robot arm to track the desired angle u(t) specified by the operator of the robot (e.g. by rotating a dial or shifting a control lever). This type of mechanism is very common in remote surgical applications. We are now going to derive the transfer function of the servo-mechanism in Fig. 3.7 and establish that this is a second order system with transfer function H(s) of the form given by (3.2.5). We recall from Example 2.7.11 the schematic representation of the field controlled servo motor shown in Fig. 3.8, in which • the input to the servo-motor is the voltage vf (t) applied to the field windings which have a resistance Rf and an inductance Lf , the voltage vf (t) itself being the output of the amplifier with the gain K; • the output is the angular position y(t) of the armature shaft (in radians) of the servo-motor; • the current ia through the armature of the motor is constant (and specified by the manufacturer of the motor); • the armature shaft has moment of inertia J, and rotates in a journal bearing (or rotational damper) with coefficient of viscous friction D; • a magnetic field set up in the motor by the field current if (t) causes a torque T (t) on the motor shaft at instant t which is directly proportional to the current if (t) at the same instant t, that is (3.2.6) T (t) = Km if (t). Here Km is the so-called motor constant, which is characteristic of the design of the motor. The value of constant Km is provided by the manufacturer of the motor. In Example 2.7.11 we established that the transfer function of the servo-motor is given by (2.7.71), that is (3.2.7) Y (s) Km /Rf = , Vf (s) s(sJ + D) (assuming that the time-constant Lf /Rf of the servo-motor field windings is negligible). We now insert the servo-motor transfer function given by (3.2.7) into the servo-motor block in Fig. 3.7 to obtain the block diagram for the whole servo-mechanism in Fig. 3.9. Now put 78 Figure 3.8: Field-controlled servo-motor H(s) = Y (s) . U (s) Applying the rule for feedback combination to the block diagram in Fig. 3.9 we obtain the following transfer function for the servo-mechanism: (3.2.8) H(s) = 1 KKm /Rf s(sJ+D) KKm /Rf + s(sJ+D) = s2 KKm /(JRf ) . + (D/J)s + KKm /(JRf ) From (3.2.8) one sees that the servo-mechanism transfer function H(s) is a second order transfer function of the form (3.2.5) with the constants a and b given by (3.2.9) a= D , J b= KKm . JRf Remark 3.2.2. Do not confuse the amplifier gain K with the motor constant Km at the equations (3.2.8) and (3.2.9). These are entirely different quantities! In particular, the constant Km is characteristic of the motor and is fixed while the gain K is adjustable. One sees from (3.2.9) that, by adjusting or “tuning” the amplifier gain K, one can adjust the constant b in the transfer function H(s), whereas the constant a is fixed (since D and J are fixed). Example 3.2.1 illustrates one important application - a servo-mechanism - in which the second order transfer function with the form (3.2.5) naturally arises. There are in fact many other applications which also give rise to second order transfer functions. Because second order transfer 79 Figure 3.9: Block diagram of the servo-mechanism functions arise in so many applications we are now going to study the properties of this transfer function in general (i.e. without reference to servo-mechanisms or any particular application). To this end it is convenient to replace the constants a and b in (3.2.5) with other constants ωn and ζ defined as follows: √ ωn = + b > 0, (3.2.10) a ζ= √ . 2 b The constant ωn is called the undamped natural frequency and the constant ζ is called the damping factor. We shall see shortly that the constants ωn and ζ have very useful interpretations. From (3.2.10) we have b = ωn2 . a = 2ζωn , We can then write the second order transfer function at (3.2.5) in terms of the constants ωn and ζ as follows (3.2.11) H(s) = ωn2 . s2 + 2ζωn s + ωn2 From now on we shall always write the second order transfer function in this form. We can factorize the denominator of (3.2.11) as follows: s2 + 2ζωn s + ωn2 = (s − p1 )(s − p2 ) (3.2.12) in which (3.2.13) p1 = (−ζ + p ζ 2 − 1)ωn , p2 = (−ζ − are the poles of H(s). 80 p ζ 2 − 1)ωn , We are now going to examine the stability of H(s) as the damping factor ζ is adjusted. We p first suppose that ζ ≤ −1. We then have −ζ ≥ 1 and ζ 2 − 1 ≥ 0 so that (−ζ + p ζ 2 − 1) ≥ 1, and from this inequality with (3.2.13) we get p1 is real with p1 > 0. Therefore H(s) has a pole p1 with a positive real part, so that condition (b) of Theorem 3.1.2 fails to hold and we conclude the second order transfer function H(s) is unstable when ζ ≤ −1. We next suppose −1 < ζ ≤ 0. From (3.2.13) p1 = (−ζ + j p 1 − ζ 2 )ωn , and therefore re{p1 } = −ζωn ≥ 0. Again one sees that condition (b) of Theorem 3.1.2 fails to hold and we conclude the second order transfer function H(s) is unstable when −1 < ζ ≤ 0. Remark 3.2.3. In view of the above we see that the second order transfer function H(s) is unstable when ζ ≤ 0. We therefore take no further interest in this case and move on to the case where ζ > 0. We first suppose that ζ ≥ 1 so that ζ > −ζ + p ζ2 − 1 < 0 p ζ 2 − 1 and therefore while it is clear that −ζ − p ζ 2 − 1 < 0. In light of these inequalities and (3.2.13) we find that re{p1 } = p1 < 0 and re{p2 } = p2 < 0, and it is then immediate from Theorem 3.1.2 that the second order transfer function H(s) is stable when ζ ≥ 1. 81 As for the case 0 < ζ < 1, it follows from (3.2.13) that p1 = (−ζ + j p 1 − ζ 2 )ωn , p2 = (−ζ − j p 1 − ζ 2 )ωn , from which it is immediate that re{p1 } = re{p2 } = −ζωn < 0. It now follows from Theorem 3.1.2 that the second order transfer function H(s) is stable when 0 < ζ ≤ 1. We therefore conclude the second order transfer function H(s) is stable when ζ > 0. With this in mind we now proceed to analyze the case in which ζ > 0, and focus in particular in determining the unit step response of H(s) when ζ > 0. Equating constants in (3.2.12) we have ωn2 = p1 p2 , (3.2.14) and therefore, from (3.2.14), (3.2.12) and (3.2.11) we get the second order transfer function in factored form: (3.2.15) H(s) = p 1 p2 . (s − p1 )(s − p2 ) We next calculate the unit step response Y (s) assuming that the poles of H(s) are distinct, that is p1 ̸= p2 . (3.2.16) We have 1 s when u(t) is the unit step function, so the unit step response of H(s) is U (s) = Y (s) = H(s)U (s) = (3.2.17) H(s) s p1 p2 s(s − p1 )(s − p2 ) 1 p1 1 p2 1 = + + , s p2 − p1 s − p2 p1 − p2 s − p1 = 82 where we have used a simple partial fraction expansion and (3.2.16) at the last equality. Taking inverse Laplace transforms at (3.2.17) we see that the unit step response of H(s) is given by p1 p2 p2 t (3.2.18) y(t) = 1 + e + ep1 t , t ≥ 0. p2 − p1 p 1 − p2 We shall now look at the unit step response of H(s) for different values of the damping ratio ζ in the range ζ > 0, and will address separately the cases 0 < ζ < 1, ζ = 1 and ζ > 1, because, as will be seen, the unit step response is significantly different in each case. ζ > 1 (overdamped case): We have that ζ > p ζ 2 − 1, and then, from (3.2.13), one sees that the poles p1 and p2 are real numbers with (3.2.19) 0 > p1 > p2 . In view of (3.2.18) we have the unit step response y(t) = 1 + z(t), t ≥ 0, (3.2.20) in which (3.2.21) z(t) = p1 p2 − p1 p2 t e + p2 p1 − p2 ep1 t , t ≥ 0. In view of (3.2.21) and (3.2.19) we get z(0) = −1, (3.2.22) and lim z(t) = 0. t→∞ Next observe that (3.2.23) z(t) < 0 for all t ≥ 0. To see this observe from (3.2.21) that (3.2.24) z(t) = p2 ep1 t − p1 ep2 t , p1 − p2 t ≥ 0. Moreover, from (3.2.19) we have (3.2.25) ep1 t > ep2 t > 0, t ≥ 0, and − p2 > −p1 > 0, and from (3.2.25) we find (−p2 )ep1 t > (−p2 )ep2 t > (−p1 )ep2 t , t ≥ 0, 83 and multiplying through by −1 we find p1 ep2 t > p2 ep1 t , t ≥ 0. (3.2.26) Now (3.2.23) follows from (3.2.26) and p1 > p2 . In view of (3.2.23) and (3.2.22) we obtain z(0) = −1, z(t) < 0 for all t ≥ 0 and z(t) → 0 as t → ∞, and from this, together with (3.2.20), we see that (3.2.27) y(0) = 0, y(t) < 1 for all t ≥ 0 and y(t) → 1 as t → ∞. Moreover, from (3.2.20) and (3.2.21) one has y (1) (t) = z (1) (t) = p1 p2 (ep1 t − ep2 t ) > 0, p 1 − p2 t ≥ 0, in which the strict inequality follows from (3.2.25), so that (3.2.28) y(t) is monotonically increasing as t increases. In view of (3.2.27) and (3.2.28) one sees that the unit step response must be of the form shown in Fig. 3.10. ζ = 1 (critically damped case): From (3.2.13) we obtain Figure 3.10: Unit step response for overdamped case: ζ > 1 (3.2.29) p1 = p2 = −ωn , 84 and, from (3.2.11), H(s) = ωn2 , (s + ωn )2 so that the unit step response is Y (s) = ωn2 H(s) = . s s(s + ωn )2 Taking inverse Laplace transforms gives the unit step response y(t) = 1 − (ωn t + 1)e−ωn t , t ≥ 0. This unit step response is shown in Fig. 3.11. Remark 3.2.4. It can be shown that the unit step response for the critically damped case is always greater than the unit step response for the overdamped case, as shown in Fig. 3.11. This means that the critically damped case gives faster tracking of a unit step input than the overdamped case. Figure 3.11: Unit step response for critically damped case: ζ = 1 0 < ζ < 1 (underdamped case): We define the constants (3.2.30) σ = ζωn , ω = ωn p 1 − ζ 2 > 0. From (3.2.30) and (3.2.13) we find (3.2.31) p1 = −σ + jω, p2 = −σ − jω. 85 Since these poles are distinct we can substitute p1 and p2 into the unit step response given by (3.2.18) and then simplify using the Euler formula: (3.2.32) ejθ = cos(θ) + j sin(θ), θ in radians. We then obtain the unit step response in the underdamped case: (3.2.33) y(t) = 1 − e−σt cos(ωt) − σ −σt e sin(ωt), t ≥ 0. ω This unit step response is shown in Fig. 3.12. From Fig. 3.12 one sees that the unit step response Figure 3.12: Unit step response for underdamped case: 0 < ζ < 1 y(t) peaks at an instant tmax before decaying to the steady state value yss = 1. Put ymax = y(tmax ). We now determine the overshoot, which was defined as O.S. = ymax − yss = y(tmax ) − 1. yss We must therefore determine the instant tmax at which maximum overshoot occurs. From (3.2.33) we find σ 2 + ω 2 −σt y (t) = e sin(ωt), ω (1) 86 and we find that y (1) (t) = 0 From Fig. 3.12 it follows that tmax nπ , n = 0, 1, 2, . . . ω corresponds to the case n = 1 that is π tmax = . ω when t= Then, from (3.2.33), we find y(tmax ) = 1 + e−σtmax = 1 + exp −σπ ω ( = 1 + exp −ζπ p 1 − ζ2 ) , where, at the final equality, we have used the constants defined at (3.2.30). We then obtain the overshoot in terms of the damping factor ζ: ( (3.2.34) O.S. = exp −ζπ p 1 − ζ2 ) . In Fig. 3.13 we have superimposed the unit step response for the overdamped case ζ > 1, the critically damped case ζ = 1, and the underdamped case 0 < ζ < 1. From Fig. 3.13 it is clear that Figure 3.13: Unit step response: all cases of damping tracking of the unit step response becomes faster as the damping factor ζ is reduced from ζ > 1 to ζ = 1, and that the fastest step response without overshoot is for the critically damped case ζ = 1. If we require even faster tracking of a unit step input than we get from the critically damped case then we must reduce ζ even further to the range 0 < ζ < 1 and must necessarily accept some overshoot as the price for this faster tracking. Whether or not any overshoot is acceptable depends on the application. We discuss this further in the next section. 87 3.3 Analysis of a servo-mechanism Here we return to the servo-mechanism in Fig. 3.9. From (3.2.8) and (3.2.9) we know that the transfer function of the servo-mechanism is (3.3.35) H(s) = s2 b , + as + b with a= D , J b= KKm . JRf We note that the constants D (coefficient of viscous friction), J (moment of inertia), Km (motor constant) and Rf (resistance of the field windings) are fixed constants which are characteristic of the servo-motor and cannot be adjusted in any way. On the other hand it is assumed that we have an amplifier with an adjustable gain K. We are going to look at the unit step response of the servo-mechanism as we adjust the amplifier gain K. From (3.3.35) and (3.2.11) we have s p √ D Rf KKm a (3.3.36) ωn = + b = + . , ζ= √ = √ JRf 2 KKm J 2 b From (3.3.36) it is clear that one can adjust the undamped natural frequency ωn and the damping factor ζ by adjusting the gain K of the amplifier. When K is small then ζ is large, and as K is increased the damping factor ζ decreases. In particular for critical damping ζ = 1 we must have p D Rf 1= √ , 2 KKm J and solving for the amplifier gain K in this relation gives the critical gain Kc : (3.3.37) Kc = D2 Rf . 4Km J We then have the following: • when 0 < K < Kc then ζ > 1 and the servo-mechanism overdamped; • when K = Kc then ζ = 1 and the servo-mechanism critically damped; • when K > Kc then 0 < ζ < 1 and the servo-mechanism underdamped. It follows that fastest tracking of a unit step input without overshoot corresponds to the case K = Kc . In order to get a faster step response we must increase the amplifier gain so that K > Kc in which case there will be overshoot. There are applications in which overshoot is completely acceptable in order to obtain a faster step response. For example, the flaps attached to the wings 88 of an aircraft are driven by a servo-mechanism. When landing an aircraft, it is important that the flaps attached to the wings be lowered quickly even if there is overshoot; the duration of the overshoot before the steady-state value yss is attained is very short and has negligible effect on the flight path of the aircraft. Typically one has overshoot of 10% to 15% in the flap-controls of a large airliner. On the other hand, if the servo-mechanism is driving the arm of an industrial robot which is inserting crank-shafts into engines on an assembly line, then clearly absolutely no overshoot is acceptable in the unit step response! 3.4 Tachometric motor control There are many applications, particularly in robotic assembly-line production, where it is essential to not have any overshoot (e.g. in the manufacture of engines, watches, electronic circuit boards etc.), but at the same time, in order to increase rates of production, one requires a faster unit step response than that obtainable from the critically damped case of the servo-mechanism studied in Section 3.3. In this section we look at the closed loop servo-motor control system shown in Fig. 3.14. Comparing this with the servo-mechanism in Fig. 3.9 we see that the amplifier with adjustable gain K has been replaced with a tachometric motor controller with a transfer function Gc (s) = Kp + Kd s, in which Kp and Kd are adjustable constants. Put Figure 3.14: Tachometric motor control G1 (s) = (Kp + Kd s)(Km /Rf ) . s(sJ + D) 89 Then the closed loop system in Fig. 3.14 has the transfer function G1 (s) 1 + G1 (s) cs + b = 2 , s + as + b H(s) = (3.4.38) in which (3.4.39) a= D Km Kd + , J JRf Km Kp , JRf b= c= Km Kd . JRf Observe that H(s) is a second order system only when Kd = 0 since we then have c = 0. The transfer function H(s) at (3.4.38) is typical of transfer functions which occur in a wide variety of applications besides tachometric motor control. We are therefore going to study the unit step response of the general transfer function (3.4.40) H(s) = s2 cs + b , + as + b in which a, b and c are constants subject to the following Condition 3.4.1. The constants a, b and c are real (i.e. have zero imaginary part) with b > 0. In addition, the constants a and b are fixed such that the poles of H(s) (i.e. the roots of s2 + as + b) are real numbers (i.e. with zero imaginary part), distinct, and strictly negative (i.e. < 0). Remark 3.4.2. It is important to understand that the transfer function (3.4.40) is not a second order transfer function unless c = 0, in which case (3.4.40) clearly simplifies to the second order transfer function (3.2.5). However, when c ̸= 0, the difference between the transfer function (3.4.40) and the second order transfer function (3.2.5) is huge. In particular, the unit step response of the second order transfer function (3.2.5) is simple enough to be completely represented by the damping factor ζ and undamped natural frequency ωn defined at (3.2.10). In the case of the transfer function (3.4.40) (with c ̸= 0) the unit step response is much too complicated to be represented by constants such as ζ and ωn defined at (3.4.40), and we do not attempt to associate a damping factor or undamped natural frequency with this transfer function. We are going to see that, with the constants a and b chosen such that Condition 3.4.1 holds, one can then fix the constant c in order to get a unit step response without overshoot. In view of Condition 3.4.1 one has (3.4.41) s2 + as + b = (s + α)(s + β), 90 for some real numbers α and β such that (3.4.42) b = αβ, α > 0, β > 0. Thus the poles of H(s) are −α < 0 and −β < 0. Without loss of generality we shall suppose (3.4.43) α > β > 0. In view of (3.4.42), (3.4.41) and (3.4.40) we have (3.4.44) H(s) = cs + αβ , (s + α)(s + β) and the unit step response of H(s) is (3.4.45) Y (s) = H(s) cs + αβ = . s s(s + α)(s + β) By partial fraction expansion at (3.4.45), and then taking inverse Laplace tramsforms, we get c − β −αt c − α −βt (3.4.46) y(t) = 1 + e + e , for all t ≥ 0. β−α α−β From (3.4.46) and (3.4.43) one sees (3.4.47) y(0) = 0, lim y(t) = 1. t→∞ Remark 3.4.3. From (3.4.46) one sees that, upon fixing the constants a and b such that α and β are large and positive - recall (3.4.41) - we get rapid convergence of y(t) to yss = 1 as t → ∞, that is we have arbitrarily fast tracking of a the unit step input. The following question now arises: do we get overshoot in the unit step response y(t)? This depends on the relative values of the constants c, α and β. One cannot exclude the possibility that these values are such that the unit step response has the form shown in Fig. 3.15, in which overshoot does indeed occur. Note however that this is never oscillatory overshoot, such as one gets for an underdamped second order system, since the poles of H(s) are the real numbers −α and −β without any imaginary parts. If overshoot occurs at some instant t ≥ 0 then we must have (3.4.48) y (1) (t) = 0. Since one obviously cannot get overshoot at the initial instant t = 0, we look at the values of t > 0 which satisfy (3.4.48). From (3.4.46) one has c − β −αt c − α −βt (1) (3.4.49) y (t) = (−α) e + (−β) e , β−α α−β 91 for all t > 0. Figure 3.15: Unit step response with overshoot It follows from (3.4.49) that one has (1) y (t) = 0 if and only if c − β −αt c − α −βt α e =β e , β−α β−α that is (3.4.50) (1) y (t) = 0 if and only if −(α−β)t e β c−α . = α c−β Now we have that α − β > 0 (see (3.4.43)) and therefore (3.4.51) 0 < e−(α−β)t < 1, for all t > 0. It then follows from (3.4.50) that overshoot occurs at some t > 0 if and only if β c−α < 1, (3.4.52) 0< α c−β and then the instant of overshoot is given by (3.4.53) 1 β(c − α) t= log β−α α(c − β) On the other hand, if one has either β c−α (3.4.54) ≤0 α c−β or β c−α ≥ 1, α c−β then it follows from (3.4.51) that there cannot exist any t > 0 such that β c−α −(α−β)t e = , α c−β 92 and therefore, in view of the equivalence at (3.4.50), there cannot exist any t > 0 such that one has y (1) (t) = 0. This means, of course, that overshoot cannot occur in the unit step response provided that either of the alternatives at (3.4.54) hold. Thus, in order to get a unit step response without overshoot, one must fix the values of c, α and β such that either of the alternatives at (3.4.54) holds. In fact, an easy (although tedious) manipulation of inequalities, which we will not go into here, establishes the following equivalence: β c−α (3.4.55) 0< <1 α c−β if and only if c > α. It follows from logical negation of the equivalence at (3.4.55) that one has either of the alternatives at (3.4.54) (we do not know which alternative, and we do not care) provided that c ≤ α, from which it follows that (3.4.56) if c ≤ α then H(s) has a unit step response without any overshoot. Remark 3.4.4. The result at (3.4.4) is extremely useful, for it tells us that we can fix α and β to be large and positive in the transfer function H(s) - see (3.4.44). Then the exponentials e−αt and e−βt decay rapidly as t increases, and thus, from (3.4.46), one has a rapid step response. Now fix the constant c such that c ≤ α to ensure that there is no overshoot. Remark 3.4.5. There are applications for which even a small overshoot is unacceptable. For example, if a robot arm on an assembly line is inserting electronic chips into circuit boards, or inserting crankshafts into engines, then it is clear that any overshoot is completely unacceptable. On the other hand, one would like the robot arm to have a fast step response in order to increase the rate of production. If the robot arm were to be driven by the servo-mechanism in Fig. 3.9, for which the transfer function H(s) is a second order system, then the most rapid step response without overshoot corresponds to the critically damped case, and this could be too slow for a fast production rate. On the other hand, if the robot arm were driven by the tachometric motor control system in Fig. 3.14, for which the transfer function is of the form (3.4.40), then one can get arbitrarily fast step response (i.e. production rate) without overshoot. 93 Chapter 4 Stability and tracking Out goal in the present chapter is to study in some detail two essential design specifications which were briefly introduced in the previous chapter, namely stability and tracking. 4.1 Stability In the previous chapter we defined stability of a linear system with an input u(t) and an output y(t): When, for each and every bounded input signal u(t), the corresponding output signal y(t) is also bounded, then the system is said to be stable. On the other hand if there exists at least one bounded input signal u(t) for which the corresponding output signal y(t) is unbounded then the system is said to be unstable. In principle, to determine whether or not a given system in stable or unstable, one must check the output signal for each and every input signal, an obviously Herculean task! Fortunately we can usually exploit additional properties which a system might have in order to obtain simple and practical tests for stability. Among the most important of these is Theorem 3.1.2 which we have already used in Chapter 3 and which we repeat here: Theorem 4.1.1. Suppose that the transfer function H(s) of a linear time-invariant system is the coprime rational function H(s) = N (s) . D(s) Then the system is stable if and only if the the following two conditions hold: (a) H(s) is proper i.e. deg(N ) ≤ deg(D) 94 (b) all poles of H(s) have strictly negative real parts. Remark 4.1.2. Part (b) of Theorem 4.1.1 means the following: if the complex number p is a pole of H(s), that is D(p) = 0, then re{p} < 0. Note the strict inequality - this is a stronger condition than just requiring re{p} ≤ 0. A seeming obstacle to the usefulness of Theorem 4.1.1 is that we apparently need to determine the poles of H(s), which means determining the roots of the possibly high-degree denominator polynomial D(s). Determination of such roots is generally difficult. In the following section we give the Routh test. Using this test we can very easily determine when the roots of a given polynomial all have strictly negative real parts without having to actually calculate the roots themselves. This is exactly what we need in order to use Theorem 4.1.1. 95 4.2 The Routh test Suppose we are given the n-degree polynomial P (s) = an sn + an−1 sn−1 + . . . + a1 s + a0 , with an ̸= 0. The essence of the Routh test is to first construct a Routh table from the coefficients ai of the polynomial. By reading off a column of numbers in this table we can immediately determine whether or not all roots of the polynomial P (s) have strictly negative real parts. We now consider how to construct the Routh table. This is a table comprising n + 1 rows as follows: sn an an−2 an−4 an−6 ...... a0 0 an−1 an−3 an−5 an−7 ...... 0 0 s(n−2) b1 b2 b3 b4 ...... s(n−3) c1 c2 c3 c4 ...... s3 w1 w2 w3 w4 s2 x1 x2 x3 s1 y1 y2 0 z1 s s (n−1) Construction of the Routh table proceeds as follows: • In the first column of the table list the terms si as i descends from n to zero. • Fill the polynomial coefficients ai into the first two rows following the alternating pattern between the first and second rows as shown. • Insert the number zero in the first two rows of the column which is immediately to the right of the column containing the coefficient a0 . • When n is an even integer (thus a0 is in the first row of the table) insert the number zero in the second row of the column which contains a0 i.e. just below a0 in the table. 96 Now calculate the entries bi of the third row using the numbers in the preceding two rows according to the following pattern: an−1 an−2 − an an−3 , an−1 an−1 an−4 − an an−5 b2 = , an−1 an−1 an−6 − an an−7 b3 = , an−1 an−1 an−8 − an an−9 , b4 = an−1 b1 = etc. Continue this calculation until you get zero from the zeros entered below and to the right of a0 . Next calculate the entries ci of the fourth row using the numbers in the preceding two rows according to exactly the same pattern: b1 an−3 − an−1 b2 , b1 b1 an−5 − an−1 b3 c2 = , b1 b1 an−7 − an−1 b4 , c3 = b1 b1 an−9 − an−1 b5 c4 = , b1 c1 = etc. One continues this construction until calculating the entry z1 in the row corresponding to s0 , and then stop. Thus x1 w 2 − w 1 x2 , x1 x1 w 3 − w 1 x3 y2 = , x1 y1 x2 − x1 y2 z1 = . y1 y1 = Why should the seemingly strange Routh table be of any interest? The answer is in the following result: Theorem 4.2.1. Construct the Routh table as above for the polynomial P (s) = an sn + an−1 sn−1 + . . . + a1 s + a0 . 97 We then have the following: (a) All roots of P (s) have strictly negative real parts if and only if all entries in the second column of the table (that is an , an−1 , b1 , c1 , . . . w1 , x1 , y1 , z1 ) are nonzero and have identical sign. (b) If all elements in the second column of the table are nonzero then the number of roots of P (s) with positive real parts (i.e. real parts ≥ 0) is equal to the number of sign changes as we move down the second column. Remark 4.2.2. For application of Theorem 4.1.1 we especially need part (a) of Theorem 4.2.1. Occasionally part (b) is also useful. The following examples show that the construction of Routh tables is very easy. Example 4.2.3. For the polynomial P (s) = s4 + 2s3 + 5s2 + 4s + 9, determine whether or not all roots have strictly negative real parts. We construct the Routh table for P (s): s4 1 5 9 0 s3 2 4 0 0 s2 3 9 0 s 1 -2 0 s 0 9 Note the two zeros in the first two rows of the fifth column; this is because a0 = 9 is in the fourth column. As well, since n = 4 is even, we insert a zero immediately beneath a0 = 9 in the Routh table. We now calculate the third row: b1 = 2(5) − 1(4) = 3, 2 b2 = 2(9) − 1(0) = 9, 2 b3 = 2(0) − 1(0) = 0, 2 and at this point we stop. For the fourth row of the table we have c1 = 3(4) − 2(9) = −2, 3 c2 = 3(0) − 2(0) = 0, 3 and at this point we stop. For the fifth row we have d1 = −2(9) − 3(0) = 9. −2 98 We need calculate no further since we have completed the second column of the table, which all that the test of Theorem 4.2.1 requires. Now there are two sign changes as we move down the second column of the table. According to Theorem 4.2.1(b) the polynonial P (s) must have two roots with real parts ≥ 0. Example 4.2.4. For the polynomial P (s) = s3 − 3s + 2, determine whether or not all roots have strictly negative real parts. We construct the Routh table for P (s): s3 -1 -3 0 s2 0 2 0 Note the two zeros in the first two rows of the fourth column; this is because a0 = 2 is in the third column. At this point we cannot continue further because computation of b1 involves division by zero. However this does not matter; we can still apply Theorem 4.2.1 with the table that we have. Since there is a zero in the second column we conclude from Theorem 4.2.1(a) that not all roots of P (s) have strictly negative real parts (although, in this case we cannot use Theorem 4.2.1(b) to determine how many roots have real parts ≥ 0). Example 4.2.5. In the closed loop system shown in Fig. 4.1 the gain K of the amplifier is adjustable, and G(s) = (s + 1 . + 2s + 5) 1)(s2 Determine the values of K for which the system is stable. The closed loop transfer function is H(s) = = KG(s) 1 + KG(s) s3 + 3s2 K , + 7s + (5 + K) with the denominator polynomial D(s) = s3 + 3s2 + 7s + (5 + K). For closed loop stability we must determine the values of K for which all poles of H(s) have strictly negative real parts, and therefore the values of K for which all roots of D(s) have strictly negative 99 Figure 4.1: Block diagram for the Example 4.2.5 real parts. We therefore construct the Routh table for polynomial D(s): s3 1 7 0 s 2 3 5+K 0 s 1 (16 − K)/3 0 s0 5+K For the third row of the table: b1 = 3(7) − 1(5 + K) 16 − K = , 3 3 b2 = 3(0) − 1(0) = 0, 3 and for the fourth row: b1 (5 + K) − 3(0) = 5 + K. b1 From Theorem 4.2.1(a) the poles of H(s) have strictly negative real parts if and only if all entries c1 = in the second column are non-zero and positive, that is 16 − K > 0, 3 5 + K > 0, and, by simple manipulation of inequalities, this is equivalent to −5 < K < 16. Thus the closed loop system is stable if and only if −5 < K < 16. Example 4.2.6. In the closed loop system shown in Fig. 4.1 the gain K of the amplifier is adjustable, and G(s) = (s − 1)2 + 9 . (s − 1)[(s + 4)2 + 4] 100 Determine the values of K for which the system is stable. After some simple algebra we find the closed loop transfer function: H(s) = = KG(s) 1 + KG(s) s2 − 2s + 10 , s3 + (7 + K)s2 + (12 − 2K)s + (10K − 20) with the denominator polynomial: D(s) = s3 + (7 + K)s2 + (12 − 2K)s + (10K − 20). We construct the Routh table for the polynomial D(s): s3 1 s2 (7 + K) (10K − 20) 0 s1 b1 s0 c1 (12 − 2K) 0 0 For the third row of the table (7 + K)(12 − 12K) − 1(10K − 20) (7 + K) 2 −2K − 12K + 104 = , 7+K b1 = while b2 = (7 + K)(0) − 1(0) = 0. 7+K For the fourth row of the table c1 = b1 (10K − 20) − (7 + K)(0) = 10K − 20. b1 From Theorem 4.2.1(a) and the Routh table one sees that the closed loop system is stable if and only if 7 + K > 0, b1 > 0, c1 > 0, if and only if 7 + K > 0, −2K 2 − 12K + 104 > 0, 7+K 101 10K − 20 > 0, if and only if −2K 2 − 12K + 104 > 0, K > −7, K > 2, if and only if K 2 + 6K − 52 < 0, K > −7, K > 2. Solving for the value K in the quadratic equation K 2 + 6K − 52 = 0 one sees that K 2 + 6K − 52 < 0 ⇐⇒ −10.81 < K < 4.81. We therefore see that the closed loop system is stable if and only if K > −7, K > −10.81, K < 4.81, K > 2. Now K must satisfy all of these inequalities together, thus one gets that the closed loop system is stable if and only if 2 < K < 4.81. Remark 4.2.7. Example 4.2.6 illustrates an important general principle. The transfer function G(s) = (s − 1)2 + 9 . (s − 1)[(s + 4)2 + 4] is unstable, as follows from Theorem 4.1.1 since one of the poles of G(s) is at s = 1. This being the case, one might be tempted to conclude that the closed loop system in Fig. 4.1 might also be unstable since the unstable transfer function G(s) is part of the closed loop system. However, Example 4.2.6 shows that this is not the case, and in fact gives a range of values of K for which the closed loop system is stable. 102 4.3 Tracking In this section we develop conditions on a stable transfer function H(s) which are enough to ensure that the output y(t) tracks certain specified inputs u(t). Recall that this means (4.3.1) lim e(t) = 0, e(t) = y(t) − u(t). in which t→∞ (see Fig. 4.2). Figure 4.2: Basic arrangement for tracking Remark 4.3.1. Notice H(s) must be stable! This is because the very notion of tracking is meaningless when H(s) is unstable. It is impossible to design a stable transfer function H(s) which can track completely general inputs u(t). Instead, we focus on the following standard inputs: Bounded decaying inputs: These are input signals u(t) which are both bounded and decay to zero in the sense that lim u(t) = 0. t→∞ See Fig. 4.3. Step inputs: These take some fixed value u(t) = a for all t ≥ 0, a being some real constant. See Fig. 4.4. When a = 1 then we have a unit step input. Ramp inputs: These are of the form t ≥ 0, u(t) = at, 103 Figure 4.3: Bounded decaying input Figure 4.4: Step input in which a is some real constant. See Fig. 4.5. These standard inputs have been chosen because they are the simplest to study and occur very commonly in applications; this is particularly true of step and ramp inputs. The following theorem addresses the case of tracking an input function which is bounded and decaying: Theorem 4.3.2. Recall Fig. 4.2 and suppose that H(s) is stable. Then the system tracks every bounded decaying input u(t) (in the sense that (4.3.1) holds). Significantly more important than bounded decaying inputs are step and ramp inputs. For tracking step inputs we have: Theorem 4.3.3. Recall Fig. 4.2 and suppose that H(s) is stable. Then the system tracks every step input u(t) (in the sense that (4.3.1) holds) if and only if H(0) = 1. 104 Figure 4.5: Ramp input Finally, for tracking ramp inputs, we have: Theorem 4.3.4. Recall Fig. 4.2 and suppose that H(s) is stable. Then the system tracks every ramp input u(t) (in the sense that (4.3.1) holds) if and only if H(0) = 1, and H (1) (0) = 0, in which H (1) (0) is the first derivative of H(s) with respect to s evaluated at s = 0. Remark 4.3.5. The proofs of the preceding theorems on tracking are an elementary application of the final value theorem of Laplace transforms, and illustrate again the immense usefulness of the method of Laplace transforms. We do not give the proofs here since we are primarily concerned with using these results. Remark 4.3.6. Suppose that the stable transfer function H(s) can track ramp inputs. Then, from Theorem 4.3.4, we know that H(0) = 1. It then follows from Theorem 4.3.3 that H(s) also tracks step inputs. Thus, if a stable transfer function H(s) can track ramp inputs then it can also track step inputs. 105 4.4 System type and tracking In the previous section we looked at tracking by a system with a stable transfer function H(s), and obtained conditions on H(s) for tracking step and ramp inputs. In most applications this transfer function is typically that of a feedback combination of systems, by far the most important of which is of the form shown at Fig. 4.6, with a transfer function G(s) in the forward loop and unit negative feedback. Then the closed loop transfer function is Figure 4.6: Unit negative feedback system (4.4.2) H(s) = G(s) . 1 + G(s) In order to verify that this closed loop system tracks step and ramp inputs we must check that the closed loop transfer function H(s) is stable and satisfies the additional conditions required by Theorem 4.3.3 for tracking step inputs, or by Theorem 4.3.4 for tracking ramp inputs. This is certainly a workable procedure, but it is actually much more useful to have conditions which apply directly to the transfer function G(s) itself which ensure that the closed loop system can track step and ramp inputs. The conditions on G(s) are stated in terms of the so-called system type which we now define: • the transfer function G(s) is of type zero when G(s) has no poles or zeros at the origin s = 0. • the transfer function G(s) is of type m (where m is a positive integer) when G(s) has m-poles at the origin s = 0, without any zeros at the origin. • the transfer function G(s) is of type minus m (where m is a positive integer) when G(s) has m zeros at the origin s = 0, without any poles at the origin. 106 The type of a system G(s) is therefore an integer which is denoted by type{G(s)}. For example: s−1 (s + 1)(s − 4)(s − 7) s−1 G(s) = 2 s (s + 1)(s − 4)(s − 7) s3 (s − 1) G(s) = (s + 1)(s − 4)(s − 7) G(s) = has type{G(s)} = 0; has has type{G(s)} = 2; type{G(s)} = −3. The main result on type and system tracking is: Theorem 4.4.1. In the closed loop system shown in Fig. 4.6 suppose that G(s) is such that the closed loop system is stable. We then have the following: (a) The closed loop system tracks step inputs if and only if type{G(s)} ≥ 1. (b) The closed loop system tracks ramp inputs if and only if type{G(s)} ≥ 2. Remark 4.4.2. It is worth noting that Theorem 4.4.1 is an extremely useful tool when designing closed loop control systems to satisfy design specifications on the tracking error for step and ramp inputs (ramp inputs being particularly important for aerospace applications). This is discussed further in Section 4.5. Example 4.4.3. Determine if the closed loop system in Fig. 4.6 tracks ramp inputs in the following cases: (a) G(s) = 1 + 3) (b) G(s) = s2 (s (s + 1) s2 (s + 3) In each case we have type{G(s)} = 2 In view of Theorem 4.4.3 this suggests that the closed loop system can track both steps and ramps. However, we must make sure that we have closed loop stability! (a) In this case, from (4.4.4) we have the closed loop transfer function (4.4.3) H(s) = G(s) 1 = 3 . 1 + G(s) s + 3s2 + 1 Now check for stability of H(s). The Routh table for the denominator polynomial is s3 1 0 0 2 3 1 0 s s -1/3 0 s0 1 107 From the Routh table and Theorem 4.2.1 one sees that the closed loop system is unstable, so there is no hope of tracking. (b) In this case, from (4.4.4) we have the closed loop transfer function (4.4.4) H(s) = G(s) s+1 = 3 . 1 + G(s) s + 3s2 + s + 1 Now check for stability of H(s). The Routh table for the denominator polynomial is s3 1 1 0 s2 3 1 0 s 2/3 0 s 0 1 From the Routh table and Theorem 4.2.1 one sees that the closed loop system is stable. Thus, in this case, the closed loop system can track both step and ramp inputs, by Theorem 4.4.1. In light of Theorem 4.4.1 we can ask the following question: Suppose that the closed loop system in Fig. 4.6 is stable, and one has type{G(s)} = 0. According to Theorem 4.4.1(a) we are just “one less” than the minimum type required for tracking step inputs, namely type{G(s)} = 1. One can therefore ask what form the response to a step input will take in this case. As we shall soon see, it turns out that the response to a step input takes the form shown in Fig. 4.7, that is a steady state tracking error develops between the output and the step input. Again suppose that the closed loop system in Fig. 4.6 is stable and type{G(s)} = 1. From Theorem 4.4.1(b) we are just “one less” than the minimum type required for tracking ramp inputs, namely type{G(s)} = 2, and again one can ask what form the response to a ramp input will take in this case. As we shall see, the response to a ramp input takes the form shown in Fig. 4.8, that is a steady state tracking error develops between the output and the ramp input. We now give a result which quantifies these steady state tracking errors: 108 Figure 4.7: Closed loop step response when type{G(s)} = 0 Theorem 4.4.4. In the closed loop system shown in Fig. 4.6 suppose that G(s) is such that the closed loop system is stable. We then have the following: (a) If type{G(s)} = 0 and the input u(t) is a unit step input then there is a steady state tracking error ess , as shown in Fig. 4.7, which is given by ess = 1 1 + Kp in which Kp = G(0). (b) If type{G(s)} = 1 and the input u(t) is a unit ramp input (i.e. u(t) = t, t ≥ 0) then there is a steady state tracking error ess , as shown in Fig. 4.8, which is given by ess = 1 Kv in which Kv = sG(s)|s=0 . Remark 4.4.5. Theorem 4.4.4 is stated with reference to unit step and unit ramp inputs. Now suppose that the step input is u(t) = a for some constant a. Then, by linearity together with Theorem 4.4.4(a), the steady state tracking error is ess = a 1 + Kp in which Kp = G(0). Similarly, suppose that the ramp input is u(t) = at, t ≥ 0, for some constant a. Again, by linearity and Theorem 4.4.4(b), the steady state tracking error is ess = a Kv in which 109 Kv = sG(s)|s=0 . Figure 4.8: Closed loop ramp response when type{G(s)} = 1 Figure 4.9: Closed loop system in the Example 4.4.6 Example 4.4.6. In the closed loop system shown in Fig. 4.9 the gain K is adjustable and G1 (s) = (s − 2) . (s + 1)(s + 2)(s + 3) Determine value(s) of the gain K to approximately minimize the steady state tracking error when a unit step input is applied. Put G(s) = KG1 (s). Then the system in Fig. 4.9 is identical to the system shown in Fig. 4.6. Moreover, it is clear that type{G(s)} = type{G1 (s)} = 0. 110 Thus, for a unit step input, from Theorem 4.4.4(a) there is a steady state tracking error given by ess = 1 1 1 3 = = = , 1 + G(0) 1 + KG1 (0) 1 − K/3 3−K provided that the closed loop system is stable! We therefore use the Routh test to determine the values of K for closed loop stability. The closed loop transfer function is H(s) = = KG1 (s) 1 + KG1 (s) s3 + 6s2 K(s − 2) . + (11 + K)s + (6 − 2K) Now construct the Routh table for the denominator polynomial: s3 1 11 + K 0 2 6 6 − 2K 0 s b1 0 s0 6 − 2K s Here 6(11 + K) − 1(6 − 2K) 60 + 8K = . 6 6 From the Routh test we have closed loop stability if and only if b1 = 6 − 2K > 0, b1 > 0, if and only if 60 + 8K > 0, 6 6 − 2K > 0, 60 + 8K > 0, 6 − 2K > 0, if and only if if and only if −7.5 < K < 3. Now we have seen that 3 . 3−K It follows that, in order to reduce the steady state tracking error we must try to “minimize” ess ess = with respect to K in the range −7.5 < K < 3. It follows that we should choose K > −7.5 with K ≈ −7.5, to make the denominator as large as possible. However, since the closed loop system 111 is unstable when K = −7.5, we cannot get perfect minimization of ess by taking K = −7.5, but only approximate minimization with K ≈ −7.5 and K > −7.5. Note that one should not choose K too close to −7.5. For example, suppose one fixed K = −7.4999. Then of course the closed loop system is stable. The trouble with this choice of K is that if the calibration of the variable gain amplifier in not perfect (and such calibrations are seldom perfect) then we might be getting an actual gain from the amplifier of something like K = −7.5001, when we think we are getting the gain K = −7.4999, so that the closed loop system is actually unstable! For these reasons a choice of something like K = −7 would be more reasonable. 4.5 Control system design - preliminary comments In this section we discuss Theorem 4.4.1 and Theorem 4.4.4 from the point of view of controller design. First however, we briefly discuss the general problem of control system design in general terms. A control system is a device which controls the “output” of a physical plant by appropriately adjusting the “input” to the physical plant. An example of a physical plant is a robot arm, the output being the the angle of the arm and the input being the voltage across the field windings of the motor which drives a shaft to which the robot arm is attached. Another example of a physical plant is a jet engine, the output being the engine thrust and the input being the flow-rate of fuel to the engine. The control system is always required to function in such a way that the output of the physical plant, denoted by y(t) (or Y (s) in Laplace domain), mimics, follows, or at least approximates some given signal, usually denoted by u(t) (or U (s) in Laplace domain), which represents the desired output of the physical system. The given signal u(t) must be of the same kind as the output y(t) of the physical plant which is to be controlled. Thus, if the plant is a robot arm, with output y(t) being the arm angle (in radians), then u(t) must specify the desired angle in the same units. Likewise, if the plant is a jet engine, with the output being engine thrust (in newtons), then u(t) must specify the desired thrust in the same units. How is this “control” of the output of a physical plant to be realized? The most natural idea is to use the discrepancy or error e(t) between the desired output u(t) and the actual output y(t) of the physical plant, that is (in Laplace domain) the signal E(s) = U (s) − Y (s), as the input to a specially designed system called the controller. The output z(t) (or Z(s)) of the controller in turn serves as the input to the physical plant itself, as shown in Fig. 4.10, in which Gp (s) is the transfer function of the physical plant and Gc (s) is the transfer function of the 112 controller. Notice that the need to form the discrepancy signal E(s) is the entire reason for the unit Figure 4.10: Feedback control of a physical plant negative feedback in Fig. 4.10, which is a characteristic feature of all feedback control systems. The essential idea is that, when the discrepancy signal E(s) is the input to the controller Gc (s), then the corresponding the output Z(s) of Gc (s) will “drive” the physical plant Gp (s) in such a way that the discrepancy between u(t) and y(t) becomes small. Stated more formally, the goal of control system design is to design the controller transfer function Gc (s) such that the closed loop system satisfies certain design specifications which might include some or all of the following items: • closed loop stability • zero or at least small steady state tracking error for step inputs • zero or at least small steady state tracking error for ramp inputs. Of these items closed loop stability is absolutely compulsory, and will appear in every conceivable list of design specifications. The importance of closed loop stability simply cannot be over-emphasized, and one never even thinks of designing a controller Gc (s) such that the resulting closed loop system is unstable! On the other hand, depending on the physical plant, not all of the remaining specifications need be included. For example if the physical plant is an industrial furnace which must operate at a fixed temperature, then the response to ramp inputs is unlikely to be of any relevance, and will not be included in the design specifications, while on the other hand, for problems in aerospace, the response to ramp inputs is often extremely relevant and certainly will be included among the design specifications. Finally, there may well be other design specifications in addition to those listed above, for example specifications on the unit step response such as rise time and overshoot. 113 In light of this discussion we can obtain a greater appreciation for results such as Theorem 4.4.1 and Theorem 4.4.4. If we put G(s) = Gp (s)Gc (s), then the closed loop system in Fig. 4.10 takes the form shown in Fig. 4.6 to which these theorems apply. If tracking of step inputs by the closed loop system is a design specification then we know from Theorem 4.4.1 that the controller Gc (s) must be designed such that type{Gp (s)Gc (s)} = type{G(s)} = 1. If, in addition, there is also a specified steady state tracking error for the unit ramp input then Gc (s) will have to be designed such that G(0) = Gp (0)Gc (0) satisfies the criterion of Theorem 4.4.4(b). It is in this sense that Theorem 4.4.1 and Theorem 4.4.4 are very useful design tools, for these theorems provide essential clues on how to “design” the controller transfer function Gc (s). 114 Chapter 5 The root locus method In this chapter we focus on the root locus method which is an indispensable tool in the analysis and design of control systems. 5.1 The root locus diagram Take the simple closed loop system in Fig. 5.1, with an adjustable gain K in series with a transfer function G(s), and unit negative feedback. Two basic conditions which are always satisfied in applications, and which will be assumed throughout this chapter, are that the transfer function G(s) is proper, that is G(s) is the rational function (5.1.1) G(s) = N (s) D(s) with deg(N ) ≤ deg(D), and G(s) is a coprime rational function, that is the numerator and denominator polynomials N (s) and D(s) do not have any roots in common. Remark 5.1.1. The simple closed loop system in Fig. 5.1 is usually called the standard closed loop system. Although many closed loop systems occurring in applications are not of this simple form, the standard closed loop system is nevertheless a particularly important special case and will be seen often during this course. The root locus method is a technique for displaying the paths followed by the closed loop poles in the complex plane as the gain K is adjusted. Such a display is called the root locus diagram of the closed loop system. Root locus diagrams are extremely useful for understanding 115 Figure 5.1: Standard closed loop system the properties of a given closed loop system, and are indispensable for designing closed loop systems to meet given design specifications. The transfer function for the closed loop system in Fig. 5.1 is (5.1.2) H(s) = KG(s) KN (s) KN (s) = = , 1 + KG(s) D(s) + KN (s) ∆(s) with the denominator polynomial (5.1.3) ∆(s) = D(s) + KN (s). The closed loop poles are of course just the roots of the denominator polynomial ∆(s). Clearly these roots depend on the value of the gain K, so the root locus diagram just amounts to a display of the movement of the roots of ∆(s) in the complex plane as K is adjusted. Note that, since G(s) is a coprime rational function, it necessarily follows that the closed loop transfer function H(s) is also coprime for every value of the gain K. To see this, fix some value of the gain K, which without loss of generality can be taken to be non-zero, that is K ̸= 0. By way of contradiction suppose that H(s) is not coprime, so there must be some complex number s1 which is a common root of the numerator and denominator polynomials KN (s) and ∆(s) at (5.1.2), thus N (s1 ) = 0, D(s1 ) + KN (s1 ) = 0. But, combining the previous two equalities, it follows that D(s1 ) = 0, so that s1 is a common root of N (s) and D(s), which contradicts the fact that N (s) and D(s) cannot have any common roots (since G(s) is coprime). It follows that H(s) must after all be coprime. 116 Example 5.1.2. Here we shall give an explicit construction of a root locus diagram in a particularly simple case. For the standard closed loop system in Fig. 5.1 suppose that (5.1.4) G(s) = s2 s , +1 that is G(s) = N (s) D(s) with D(s) = s2 + 1. N (s) = s, We are going to determine the movement of the closed loop poles in the complex plane as K is adjusted through K ≥ 0. The closed loop transfer function is H(s) = Ks KG(s) = 2 , 1 + KG(s) s + Ks + 1 so the denominator polynomial of H(s) is ∆(s) = s2 + Ks + 1 = D(s) + KN (s). (5.1.5) The closed loop poles are the roots of the quadratic ∆(s), that is √ √ −K + K 2 − 4 −K − K 2 − 4 (5.1.6) s1 = , s2 = . 2 2 From (5.1.6) we have the following: when K = 0 then s1 = j and s2 = −j, and for all 0 ≤ K ≤ 2 we have √ −K + j 4 − K 2 s1 = , 2 √ −K − j 4 − K 2 s2 = , 2 from which one sees the following: when K increases through the range 0 ≤ K ≤ 2 then s1 traces the arc AC from A to C, while s2 traces the arc BC from B to C in Figure 5.2 Note that AC and BC are circular arcs of unit radius centered at the origin s = 0. Now s1 and s2 are on the real axis for all K ≥ 2, and since K− √ K2 − 1 → 0 as 117 K → ∞, Figure 5.2: Movement of closed loop poles in Example 5.1.2 we see from (5.1.6) that (5.1.7) −1 ≤ s1 < 0 for all K≥2 with lim s1 = 0, K→∞ and (5.1.8) s2 ≤ −1 for all K≥2 with lim s2 = −∞. K→∞ It follows that the closed loop pole s1 follows the path ACO in Fig. 5.2 as K increases from K = 0 with K → ∞, while the closed loop pole s2 follows the path BCD (where D is at “minus infinity” on the real axis) as K increases from K = 0 with K → ∞. Remark 5.1.3. Fig. 5.2 displays the root locus diagram of the closed loop system in Fig. 5.1 when the transfer function G(s) is given by (5.1.4). Each of the paths ACO and BCD in Fig. 5.2, followed by the poles s1 and s2 respectively as K increases from K = 0, is called a branch of the root locus, so we see that there are two branches in the root locus. Our construction of the root locus diagram in Example 5.1.2 relies in an essential way on the fact that the closed loop denominator polynomial ∆(s) is a quadratic function of s, the roots of which we can explicitly compute in terms of K. This of course is a consequence of the simplicity of the transfer function (5.1.4). Our main goal in this chapter is to construct root locus diagrams for general closed loop 118 systems in which is it not possible to get the sort of explicit formulae for the closed loop poles that we were able to use in Example 5.1.2. This will be taken up in Section 5.2 We shall also be concerned with root locus diagrams for closed loop systems which are not necessarily in the standard form of Fig. 5.1. An important example such a closed loop system is shown in Fig. 5.3, in which the gain K is again adjustable and G(s) is again given by (5.1.1). This closed loop system, which is very common in applications, and will be studied in later in the course, is not in standard form since K does not occur multiplicatively in series with a transfer function (as in Fig. 5.1) but is instead embedded as part of a transfer function. Again, we would like to Figure 5.3: Non-standard closed loop system determine the root locus diagram, that is a display of the movement of the closed loop poles in the complex plane as K is adjusted. For this we must determine the denominator polynomial for the closed loop transfer function: Put G1 (s) = K 1+ s G(s) = (s + K)N (s) sD(s) The transfer function for the closed loop system in Fig. 5.3 is then (5.1.9) H(s) = G1 (s) (s + K)N (s) = , 1 + G1 (s) sD(s) + (s + K)N (s) with the denominator polynomial (5.1.10) ∆(s) = sD(s) + (s + K)N (s) = s[D(s) + N (s)] + KN (s). Again, the closed loop poles are the roots of the polynomial ∆(s) at (5.1.10), so the root locus diagram is really a display of the movement of the roots of this polynomial as K is adjusted. 119 Remark 5.1.4. The preceding discussions show that the construction of root locus diagrams for a wide class of closed loop systems boils down to the problem of displaying the movement of the roots of a polynomial having the general form (5.1.11) ∆(s) = P (s) + KQ(s), as the real parameter value K is adjusted, in which P (s) and Q(s) are polynomials with deg(Q) ≤ deg(P ). (5.1.12) We see that the general polynomial at (5.1.11) includes as a special case the polynomial at (5.1.3), the roots of which are the poles of the standard closed loop system shown in Fig. 5.1, when we identify Q(s) = N (s), P (s) = D(s). Similarly, the general polynomial (5.1.11) includes as a special case the polynomial at (5.1.10), the roots of which are the poles of the non-standard closed loop system shown in Fig. 5.3, when we identify Q(s) = N (s), P (s) = s[D(s) + N (s)]. As will be seen, using this general method we shall be able to deal with a wide variety of closed loop systems besides the examples indicated above. 5.2 Rules for root locus construction We are given polynomials P and Q such that (5.1.12) holds, namely (5.2.13) deg(Q) ≤ deg(P ). Define the polynomial ∆ in terms of P and Q according to (5.1.11), that is (5.2.14) ∆(s) = P (s) + KQ(s). A complex number s is a root of the polynomial ∆ when ∆(s) = 0, that is s satisfies the relation (5.2.15) P (s) + KQ(s) = 0. Clearly, as the real parameter K changes, so the root s which satisfies this relation must also change, moving along a path in the complex plane as K is adjusted. The path in the complex plane followed 120 by a designated root s of ∆ as K is adjusted through the range K ≥ 0 is called a branch of a root locus (for the polynomial ∆). Recall that branches of root loci have already been seen in Example 5.1.2 for the particular polynomial (5.1.5) (recall Remark 5.1.3). Remark 5.2.1. Thus a complex number s is on a branch of a root locus when s satisfies the relation (5.2.15) for some value of K ≥ 0. We are now going to formulate eight rules for sketching the branches of root loci. These rules may appear a bit mysterious at first sight, but with some practice it will soon become clear that they are very easy to apply. To this end we define an “artificial” transfer function in terms of the given polynomials P and Q on the right hand side of the general polynomial ∆(s) at (5.2.14): (5.2.16) G̃(s) = Q(s) P (s) deg(Q) ≤ deg(P ). where we recall that Put (5.2.17) np = deg(P ), nz = deg(Q), that is np is the number of poles of G̃, while nz is the number of zeros of G̃. Remark 5.2.2. In Example 5.1.2 we explicitly constructed root loci for the polynomial ∆(s) defined at (5.1.5), that is (5.2.18) ∆(s) = P (s) + KQ(s), with Q(s) = s, P (s) = s2 + 1, the root loci being shown in Fig. 5.2. In this case (5.2.19) G̃(s) = Q(s) s = 2 , P (s) s +1 np = 2, nz = 1. As we present the rules for constructing root loci we shall illustrate these rules with reference to the root locus diagram in Fig. 5.2 for the polynomial ∆(s) at (5.2.18). We can now state the rules for the construction of root loci for the polynomial ∆(s) defined at (5.2.14): Rule RL.1 - number of branches: There are exactly np = deg(P ) branches of root loci. Rule RL.2 - symmetry around real axis: The root locus diagram is completely symmetric around the real axis of the complex plane. That is, if the complex number s = a + jb is on a branch of a root locus then its conjugate s̄ = a − jb is also on a branch of the root locus. 121 Remark 5.2.3. With reference to Remark 5.2.2 one sees rules RL.1 and RL.2 illustrated by the root locus diagram in Fig. 5.2 for the polynomial ∆(s) at (5.2.18). There are np = 2 branches of root loci (recall Remark 5.1.3), and the root locus diagram in Fig. 5.2 is symmetric around the real axis of the complex plane. Rule RL.3 - branches of root loci on the real axis: Take any point s on the real axis of the complex plane. Then s is on a branch of the root locus if and only if the total number of poles and zeros of G̃(s) to the right of the point s is an odd number. Remark 5.2.4. It follows from rule RL.3 that any point s on the real axis for which the total number of poles and zeros of G̃(s) to the right of that point is an even number cannot be on a branch of the root locus. In particular, if there are neither poles nor zeros of G̃(s) to the right of s on the real axis then s cannot be on a branch of the root locus (since the number zero is even). Remark 5.2.5. With reference to the polynomial (5.2.18), we see that G̃(s), which is given by (5.2.19), has np = 2 poles and nz = 1 zero, all on the imaginary axis, namely (5.2.20) p1 = j, p2 = −j, z1 = 0. Thus, for any point s on the real axis with s < 0, it follows that there is a total of 2 + 1 = 3 poles and zeros of G̃(s) which are to the right of s (since the poles and zeros of G̃(s) are on the imaginary axis). Rule RL.3 says that every such s must be on a branch of a root locus. This confirms what we see in the root locus diagram Fig. 5.2. In fact, if we fix any s on the real axis with s < 0, then one sees from Fig. 5.2 that s is either on the part CO of the branch of root locus ACO, or on the part CD of the branch of root locus BCD. Rule RL.4 - departure of branches from poles of G̃(s): Each branch of a root locus begins at a pole of G̃ (i.e. a root of P ) when K = 0, and moves away from this pole as K is increased from K = 0. If p is a pole of G̃ with multiplicity m (i.e. p is a root of P (s) which is repeated m-times, m ≥ 1) then exactly m distinct branches of root loci depart from the pole p as K is increased from K = 0. Remark 5.2.6. Rule RL.4 is illustrated by the root locus diagram in Fig. 5.2 for the polynomial (5.2.18), for which G̃ is given by (5.2.19) with poles and zeros given by (5.2.20). In fact, one sees from Fig. 5.2 that the branch of root locus ACO departs from the pole p1 = j, while the branch of root locus BCD departs from the pole p2 = −j, when K is increased from K = 0. 122 For the remaining rules recall from (5.2.17) and (5.1.12) that nz ≤ np , so that we have the separate cases nz = np and nz < np . Rule RL.5 - asymptotic properties of root loci: (a) Suppose that nz = np . Then every branch of a root locus tends towards a zero of G̃ as K → ∞. Moreover, if z is a zero of G̃ with multiplicity r (i.e. z is a root of Q which is repeated r-times, r ≥ 1) then exactly r branches of root loci tend towards z as K → ∞. (b) Suppose that nz < np so that np − nz ≥ 1 (this is the case when G̃ is strictly proper). Then exactly nz branches of root loci tend towards the zeros of G̃ as K → ∞; furthermore, if z is a zero of G̃ with multiplicity r then exactly r of these nz branches tend towards z as K → ∞. As for the remaining np − nz branches of root loci, these tend towards infinity along asymptotes as K → ∞. These asymptotes are straight lines centered at a point on the real axis given by P P poles of G̃ − zeros of G̃ , σ= np − nz at angles relative to the positive real axis given by ϕ= (2q + 1)π , np − nz q = 0, 1, 2, . . . (np − nz − 1). Each and every asymptote is approached by exactly one branch of a root locus as K → ∞. Remark 5.2.7. For rule RL.5(b) one never gets two or more branches of root loci tending towards infinity along the same asymptote, neither does it ever happen that one has an “empty” asymptote which is not approached by any branch of a root locus as K → ∞. Remark 5.2.8. Rule RL.5 is illustrated by the root locus diagram in Fig. 5.2 for the polynomial (5.2.18), for which G̃ is given by (5.2.19) with poles and zeros given by (5.2.20). In this case we have np = 2, nz = 1, so that nz < np . Then Rule RL.5(b) says that nz = 1 branch of root locus tends towards the zero z1 = 0 of G̃ as K → ∞. This is precisely what one sees from Fig. 5.2, from which it is clear that the closed loop pole s1 (which traverses the branch ACO) tends towards the zero z1 = 0 as K → ∞ (recall (5.1.7)). Furthermore, Rule RL.5(b) also says that the remaining np − nz = 2 − 1 = 1 branch of root locus tends towards infinity along an asymptote with centre σ = p1 + p2 − z1 = j − j − 0 = 0, 123 and angle relative to the positive real axis given by (2q + 1)π np − nz ϕ= with q = 0, that is ϕ = π, (since np − nz = 1). Thus the asymptote is just the negative real axis. This is confirmed by Fig. 5.2, from which one sees that the closed loop pole s2 (which traverses the branch BCD) tends to infinity along the negative real axis (recall (5.1.8)). We have presented rules RL.1 to RL.5 and seen that these rules are consistent with the root locus diagram in Fig. 5.2 for the simple polynomial at (5.2.18). In the following example we use rules RL.1 to RL.5 to trace the branches of root loci of a polynomial ∆(s) of the form (5.2.14) when we cannot explicitly calculate the roots (in the way that we could for the polynomial at (5.2.18)). Example 5.2.9. We are given the polynomials P (s) = (s − 1)2 (s + 2), Q(s) = (s − 2)(s + 1), and must sketch the paths followed by the roots of the polynomial ∆(s) = P (s) + KQ(s), as K is increased from K = 0 through K → ∞. Following (5.2.16) put G̃(s) = Q(s) (s − 2)(s + 1) = . P (s) (s − 1)2 (s + 2) We now apply the above rules to G̃. The poles and zeros of G̃ are shown in Fig. 5.4. The poles are p1 = −2, p2 = +1, p3 = +1, np = 3, and the zeros are z1 = −1, z2 = +2, nz = 2. Fix any s on the real axis with s < −2. We then see that there is an odd number of poles and zeros of G̃ to the right of s (5 in all). Therefore according to rule RL.3 one sees that s must be on a branch of a root locus. We conclude (5.2.21) s on the real axis & s < −2 ⇐⇒ s on a branch of the root locus. Similarly, from RL.3, one has (5.2.22) s on the real axis & − 1 < s < +1 124 ⇐⇒ s on a branch of the root locus, since there are 3 poles and zeros (an odd number) of G̃ to the right of any such s, and (5.2.23) s on the real axis & + 1 < s < +2 ⇐⇒ s on a branch of the root locus. since there is 1 zero (an odd number) of G̃ to the right of any such s. Moreover, from rule RL.4: (5.2.24) 1 branch of root locus departs from pole p1 = −2 as K increases from K = 0, (5.2.25) 2 branches of root loci depart from pole p2 = p3 = 2 as K increases from K = 0. From rule RL.5(b) (5.2.26) nz = 2 branches of root loci converge towards the zeros z1 = −1 and z2 = 2 as K → ∞, and (5.2.27) np − nz = 1 branch of root locus converge to infinity along an asymptote as K → ∞. The asymptote is centered at σ= p1 + p2 + p3 − z1 − z2 = −2 + 1 + 1 − (−1) − 2 = −1, np − nz at the angle relative to the positive real axis given by ϕ= (2q + 1)π np − nz with q = 0, that is ϕ = π, (since np − nz = 1). Thus the asymptote is the entire negative real axis to the left of σ = −1. From (5.2.22), (5.2.23) and (5.2.25) we obtain 2 branches of root loci starting at p2 = p3 = 1 when K = 0 and converging to the zeros z1 = −1 and z2 = 2 as K → ∞; these are shown in Fig. 5.4. Furthermore, from (5.2.27) and (5.2.21), we obtain a third branch of root locus starting at p1 = −2 when K = 0 and converging to infinity along the real axis as K → ∞ (see 5.4). Remark 5.2.10. In Example 5.2.9 one sees that there are a total of 3 branches of root loci, which is consistent with the rule RL.3, since G̃ has np = deg(P ) = 3 poles. In addition to the rules RL.1 to RL.5 given above there are three remaining rules which we now present: 125 Figure 5.4: Root locus for the Example 5.2.9 Rule RL.6 - break-away of root loci: When two or more branches of root loci meet (or “collide”) at a point s in the complex plane then a “break-away” in the root loci occurs at the point s. This means that the root loci undergo a discontinuous change in direction as the root loci pass through the point s. Furthermore, the points s at which branches of root loci meet and break away are among the roots of the equation dG̃(s) = 0. ds (5.2.28) Remark 5.2.11. Rule RL.6 is illustrated by the root locus diagram in Fig. 5.2 for the polynomial (5.2.18). In fact, from Fig. 5.2 one sees that the branches of root loci AC and BC meet at the point s = −1 as K → 2 in the range 0 ≤ K < 2, and then undergo a discontinuous change in direction, moving along the real axis for all K ≥ 2. Example 5.2.12. Use rules RL.1 to RL.6 to draw the root locus diagram for the polynomial ∆(s) = P (s) + KQ(s), in which Q(s) = 1, P (s) = s(s + 3). Then G̃(s) = Q(s) 1 = , P (s) s(s + 3) so that nz = 0 and np = 2, and G̃ has poles p2 = −3. p1 = 0, Since nz = 0 and np = 2, one sees from rule RL.5(b) that there are np −nz = 2 asymptotes, centered at σ = [−3 − 0]/2 = −1.5, 126 at angles ϕ= (2q + 1)π , 2 q = 0, 1, thus ϕ = π/2, ϕ = 3π/2. From rule RL.3 one sees that every s on the real axis in the interval −3 < s < 0 is on a branch of a root locus. From rule RL.4, one branch of root locus departs from p1 = 0 as K increases from K = 0, and from what we have just seen above, this branch can only move to the left along the real axis. Similarly, another branch of root locus departs from the pole p2 = −3, and can only move to the right along the real axis as K increases from K = 0. By the rule RL.6 these branches of root Figure 5.5: Root locus for the Example 5.2.12 loci meet at a point s on the real axis somewhere between −3 and 0 and then break away. The point s is obtained from solving dG̃(s) = 0, ds that is solving −(2s + 3) = 0, s2 (s + 3)2 from which we get s = −1.5. The root locus diagram is therefore as shown in Fig. 5.5, making a discontinuous change in direction at and moving away from the real axis at −1.5, and tending towards infinity along the asymptotes as K → ∞. 127 Remark 5.2.13. In the root locus diagram at Fig. 5.5 one sees that the break away point s = −1.5 coincides with the center of asymptotes σ = −1.5, and that the root loci do not just approach the asymptotes but are on top of the asymptotes as K → ∞. It is important to understand that these are just “fortunate accidents” arising from the great simplicity of Example 5.2.12, and should not be regarded as typical. Generally, break away points and centres of asymptotes do not coincide, and branches of root loci tending towards infinity along asymptotes usually only approach the asymptotes as K → ∞ and are not directly on top of the asymptotes. In fact one seldom uses the equation (5.2.28) to determine break-away points, mainly because this is typically a difficult equation to solve (as we shall later see in more realistic examples), and because it is usually not important to exactly determine the break-away points; intelligent guesswork is often good enough to approximately locate these points. Thus, in the Example 5.2.12, we know that the break-away point is somewhere on the real axis between s = −3 and s = 0. On the basis of this we could have sketched the less precise root locus diagram shown in Fig. 5.6, and this would in fact be just as useful as the more accurate root locus diagram at Fig. 5.5. Figure 5.6: Approximate root locus for the Example 5.2.12 The preceding rules RL.1 to RL.6 are usually enough to get a rough sketch of the root locus diagram, and a rough sketch of the root loci is frequently quite good enough for most applications. However, when more accuracy is needed we have the remaining rules RL.7 and RL.8 which we now discuss. 128 The next rule complements rule RL.4 in that it gives more precise information on how branches of root loci depart from a pole of G̃ as K increases from K = 0: Rule RL.7 - departure angles of branches: Suppose that p is a pole of G̃ with multiplicity m. From rule RL.4 we know that m-branches of root loci depart from p as K increases from K = 0. These branches of root loci depart from p at angles relative to the positive real axis given by θdep = ∠G̃1 (p) − (2k + 1)π , m k = 0, 1, 2, . . . , (m − 1), in which G̃1 (s) = (s − p)m G̃(s). In the same way rule RL.8 which follows complements the RL.5 in giving the angles at which branches of root loci approach a zero of G̃ as K → ∞: Rule RL.8 - arrival angles of branches: Suppose that z is a zero of G̃ with multiplicity r. From rule RL.5 we know that r branches of root loci tend towards z as K → ∞. These branches of root loci tend towards z at angles relative to the positive real axis given by θar = (2k + 1)π − ∠G̃2 (z) , r k = 0, 1, 2, . . . , (r − 1), in which G̃2 (s) = G̃(s) . (s − z)r Example 5.2.14. We are given the polynomials Q(s) = 1, P (s) = s(s + 3)(s2 + 2s + 2), and must sketch the paths followed by the roots of the polynomial ∆(s) = P (s) + KQ(s), as K is increased from K = 0 through K → ∞. Following (5.2.16) put (5.2.29) G̃(s) = Q(s) 1 = . P (s) s(s + 3)(s2 + 2s + 2) 129 Then nz = 0 and np = 4, and G̃ has poles p2 = −3, p1 = 0, p3 = −1 − j, p4 = −1 + j. Since nz = 0 and np = 4, one sees from rule RL.5(b) that there are np −nz = 4 asymptotes, centered at σ= 0 − 3 + (−1 − j) + (−1 + j) 5 =− . 4 4 at angles ϕ= (2q + 1)π , 4 q = 0, 1, 2, 3, thus ϕ = π/4, ϕ = 3π/4, ϕ = 5π/4, ϕ = 7π/4. From rule RL.3 one sees that every s on the real axis in the interval −3 < s < 0 is on a branch of a root locus. In fact, when −3 < s < −1, then there are 3 poles of G̃ which are to the right of s (these are p1 , p3 , p4 ), which is an odd number, so every such s is on a branch of a root locus. When −1 ≤ s < 0 then there is one pole of G̃ which is to the right of s (this is p1 ), so again every such s is on a branch of a root locus. From rule RL.4, one branch of root locus departs from p1 = 0 as K increases from K = 0, and from what we have just seen above this branch must move to the left along the real axis, while another branch of root locus departs from the pole p2 = −3, and can only move to the right along the real axis as K increases from K = 0. By the rule RL.6 these branches of root loci meet on the real axis somewhere between p2 = −3 and p1 = 0, and then break away at the point b, as shown in Fig. 5.7, making a discontinuous change in direction and moving away from the real axis. Likewise, a branch of root locus departs from the pole p4 = −1 + j as K increases from K = 0, and similarly for the pole p3 = −1 − j. We can use rule RL.7 to calculate the departure angle from p4 . In fact, since the multiplicity of the pole p4 is m = 1, from rule RL.7 the angle of departure from p4 is θdep = ∠G̃1 (p4 ) − π, in which G̃1 (s) = (s − p4 )G̃(s) = 1 . s(s + 3)(s + 1 + j) Thus G̃1 (p4 ) = 1 , (−1 + j)(2 + j)(2j) so that ∠G̃1 (p4 ) = −251.6 degrees, 130 Figure 5.7: Root locus for the Example 5.2.14 and the departure angle from p4 = −1 + j is given by θdep = −251.6 − 180 = −71.6 degrees. One could similarly calculate the departure angle from the pole p3 = −1 − j but there is absolutely no need for this; by symmetry around the real axis (see rule RL.2) the departure angle from p3 must be θdep = +71.6 degrees. We must now sketch the branches of root loci as K → ∞. Since nz = 0, from rule RL.5 we know that each and every asymptote is approached by exactly one branch of a root locus as K → ∞, thus it is a matter of deciding which branch tends towards which asymptote. This requires some intelligent guesswork. The departure angle θdep = −71.6 degrees from the pole p4 strongly suggests that the branch of root locus which departs from p4 will likely tend towards infinity along the asymptote A as K → ∞. It then follows that the asymptote B in Fig. 5.7 must be approached by the branch of root locus after the break away at point b. The remaining two branches of root loci in the lower half of the s-plane can then be sketched by symmetry around the real axis. Remark 5.2.15. We could have attempted to calculate the point of break-away on the real axis by solving the equation (5.2.28) when G̃ is given by (5.2.29). However, the resulting equation is 131 difficult to solve, so we simply guess some point b on the real axis between s = −3 and s = 0. In cases where it is important to actually know the value of b one would resort to the use of MATLAB. Remark 5.2.16. The following consequences of rule RL.7 should be noted: (a) if p is a complex pole of G̃, with conjugate pole p̄, then the departure angle of a root locus from p̄ is the negative of the departure angle from p of the symmetric image of the root locus. This is illustrated in the case of the pole p3 seen in Example 5.2.14. (b) if p is a real pole of multiplicity m = 1 then the only possible angles of departure of root loci from p are 0 degrees and 180 degrees. That is, branches of root loci depart from p along the real axis moving either left or right. Again, this is illustrated in the cases of the poles p1 and p2 in Example 5.2.14. Remark 5.2.17. Example 5.2.14 is somewhat tricky because one can sketch an alternative root locus which is different from that shown in Fig. 5.7 but still consistent with rules RL.1 - RL.8. This is shown in Fig. 5.8. In this case the branches of root loci tend towards infinity along asymptotes Figure 5.8: Alternative root locus for the Example 5.2.14 which are different from those in Fig. 5.7 but nevertheless still consistent with rules RL.1 - RL.8. Which of these alternatives is correct? The rules do not tell us, and one would have to use a program such as MATLAB, which explicitly calculates the roots of ∆(s) at (5.1.10) over range of values of 132 K, to determine this. In the present case the root locus at Fig. 5.7 is actually the correct one. In a test or examination you would get full credit for either Fig. 5.7 or Fig. 5.8. Example 5.2.18. We are given the polynomials Q(s) = (s − 1)2 + 4, P (s) = (s + 2)2 + 1, and must sketch the paths followed by the roots of the polynomial ∆(s) = P (s) + KQ(s), as K is increased from K = 0 through K → ∞. Following (5.2.16) put G̃(s) = Q(s) , P (s) The zeros of G̃ are z1 = 1 + 2j, z2 = 1 − 2j, p1 = −2 + j, p2 = −2 − j, nz = 2, and the poles of G̃ are np = 2, as shown at Fig. 5.9, and we have np = nz = 2. From rule RL.5(a) each branch of the root locus moves from a pole of G̃ to a zero of G̃ as K → ∞. We now calculate the departure angle from the pole p1 as K increases from K = 0. Since p1 is a pole of multiplicity m = 1, it follows from rule RL.7 that the departure angle from p1 is θdep = ∠G̃1 (p1 ) − π, in which G̃1 (s) = (s − p1 )G̃(s) = (s − 1)2 + 4 . (s + 2 + j) From this one easily sees that ∠G̃1 (p1 ) = 243 degrees, and therefore the departure angle from p1 is θdep = 243 − 180 = 63 degrees. 133 Figure 5.9: Root locus for the Example 5.2.18 We next calculate the arrival angle at the zero z1 as K → ∞. Since z1 is a zero of multiplicity r = 1, we have from the rule RL.8 that the arrival angle at z1 is θar = π − ∠G̃2 (z1 ), in which G̃2 (s) = G̃(s) s − 1 + 2j . = s − z1 (s + 2)2 + 1 From this one easily sees that ∠G̃2 (z1 ) = 25.6 degrees, and therefore the arrival angle at the zero z1 is θar = 180 − 25.6 = 153.4 degrees. The root locus diagram for the closed loop system is as shown in Fig. 5.9. Remark 5.2.19. In Example 5.2.18 one might justifiably ask if an alternative root locus diagram could be as shown in Fig. 5.10. This would certainly be the case if the root locus diagram were consistent with rules RL.1 - RL.8. However, if we take the point s1 where the two branches of root 134 Figure 5.10: Possible root locus for the Example 5.2.18 loci meet, we see that s1 must be on the real axis (by symmetry around the real axis from rule RL.2), and there is an even number (namely 2) of poles and zeros of G̃ to the right of s1 . However, rule RL.3 requires that this be an odd number, and so Fig. 5.10 is not a valid root locus diagram for the closed loop system in Example 5.2.18. Remark 5.2.20. In the previous examples we have demonstrated the use of rules RL.1 - RL.8 for determining the paths followed in the complex plane by the roots of the polynomial (5.2.14) subject to the condition (5.2.13). We are now going to deal with the construction of root locus diagrams for closed loop systems. This of course is just a matter of applying the rules to the closed loop denominator polynomial. For the standard closed loop system shown in Fig. 5.1 in which G(s) is of the form G(s) = N (s) , D(s) deg(N ) ≤ deg(D), we know that the denominator polynomial is given by (see (5.1.3)) ∆(s) = P (s) + KQ(s) with Q(s) = N (s) 135 and P (s) = D(s), and therefore from (5.2.16) one sees that G̃(s) = Q(s) N (s) = = G(s). P (s) D(s) Thus, when constructing the root locus diagram for a closed loop system in standard form (as in Fig. 5.1), we just apply the rules RL.1 - RL.8 to the transfer function G(s). On the other hand, when the closed loop system is not in standard form (see e.g. Fig. 5.3), then we must calculate the closed loop transfer function, extract the denominator polynomial of the closed loop system in the form (5.1.11), and then apply rules RL.1 - Rl.8 to the transfer function G̃ defined at (5.2.16). We shall illustrate this in Example 5.2.23. Example 5.2.21. In the standard closed loop system in Fig. 5.1 the transfer function G(s) is given by G(s) = (s + 5) N (s) = . (s + 1)(s + 2) D(s) Sketch the root locus diagram for the closed loop system (i.e. sketch the paths followed by the closed-loop poles) as K is increased from K = 0 with K → ∞. Since the closed loop system is in standard form it follows from Remark 5.2.20 that the root locus diagram is obtained by applying rules RL.1 - RL.8 to the transfer function G̃ = G. Now G̃ = G has the zero z1 = −5, and the poles p1 = −1, p2 = −2, with nz = 1 and np = 2, as shown at Fig. 5.11. From rule RL.3 all points s on the real axis and in the interval −2 < s < −1 are on branches of root loci (why?), and it follows that one such branch must depart from p1 = −1, moving to the left as K increases from K = 0, while another branch must depart from the pole at p2 = −2, moving to the right as K increases from zero (why?). From rule RL.6 these branches of root loci meet (or collide) and break away into the complex part of the s-plane at some breakaway point b on the real axis between p2 = −2 and p1 = −1, of course with symmetry around the real axis (why?). Furthermore, again from Rule RL.3, all points s on the real axis such that s < z1 = −5 are on branches of root loci (why?). From 1 = nz < np = 2 and rule RL.5(b), exactly one branch of a root locus must tend towards the zero z1 as K → ∞, and 136 Figure 5.11: Root locus for the Example 5.2.21 this branch must tend towards z1 along the real axis from the right (why?). Furthermore, another branch of root locus must tend to infinity along an asymptote centered at σ=2 at the angle ϕ = π, (check these numbers). This asymptote is along the negative real axis, and the branch of root locus which tends to infinity along this asymptote must therefore be on the negative real axis (why?). Thus, on the real axis and to the left of z1 = −5, there is one branch of a root locus which tends towards z1 from the right as K → ∞, together with another branch of a root locus which moves to the left along the negative real axis to −∞ as K → ∞. This is possible only if the branches of root loci which break away from the real axis between p1 and p2 curve around to the left and then break away again on the real axis at a point c which is to the left of z1 , as shown in Fig. 5.11. This gives the full root locus diagram. Remark 5.2.22. We could have calculated the break-away points b and c on the real axis by solving the equation (5.2.28). However these values are most easily found using MATLAB. Example 5.2.23. In the non-standard closed loop system shown in Fig. 5.3 the transfer function G(s) is given by G(s) = (s + 4) , s(s + 2) thus N (s) = s + 4, D(s) = s(s + 2). 137 Sketch the root locus diagram for the closed loop system (i.e. sketch the paths followed by the closed-loop poles) as K is increased from K = 0 with K → ∞. The closed loop poles are the roots of the polynomial ∆(s) at (5.1.10), namely ∆(s) = s[D(s) + N (s)] + KN (s) = P (s) + KQ(s), with P (s) = s[D(s) + N (s)] = s(s2 + 3s + 4), Q(s) = s + 4. Now, following (5.2.16), define G̃(s) = Q(s) s+4 = . P (s) s(s2 + 3s + 4) We now apply the above rules to the transfer function G̃, exactly as in the preceding examples. We see that G̃ has nz = 1 zero and np = 3 poles, the zero being z1 = −4, and the poles being √ √ −3 + j 7 −3 − j 7 p1 = 0, p2 = , p3 = . 2 2 From the rule RL.3 we see that every real s in the interval −4 < s < 0 is on a branch of a root locus, thus we get a branch of a root locus departing from p1 = 0 as K increases from K = 0, and moving to the left along the real axis, converging to the zero at −4 as K → ∞. Since np − nz = 2, from rule RL.5(b) there are two asymptotes centered at σ= p1 + p2 + p3 − z1 1 = , 2 2 at the angles π π , − . 2 2 As K increases from K = 0 branches of root loci depart from p2 and p3 and converge to infinite ϕ= along these asymptotes as K → ∞. The root locus diagram is shown in Fig. 5.12. 138 Figure 5.12: Root locus for the Example 5.2.23 5.3 Proportional, PD, PI and PDI controllers In Section 4.5 of Chapter 4 we briefly discussed the problem of designing a controller Gc (s) for a given physical plant Gp (s) such that the closed loop system shown in Fig. 4.10 satisfies certain design specifications. In the present section we shall look at some commonly used controllers Gc (s), using the root locus method to get some insight into the properties of these controllers. For convenience we repeat Fig. 4.10 at Fig. 5.13. Proportional controller: This is the simplest possible controller being just an amplifier with a gain K: (5.3.30) Gc (s) = K. The following simple examples demonstrate that proportional controllers are usually inadequate. Example 5.3.1. In the closed loop system of Fig. 5.13 the plant has the transfer function Gp (s) = 1 . (s + 0.2)(s + 0.4) Our goal is to design a proportional controller Gc (s) to attain the following design specifications: 139 Figure 5.13: Feedback control of a physical plant • the closed loop system is stable • the closed loop system has small steady state tracking error for a unit step input. In this case “design” really just means determining the appropriate amplifier gain K. Now put G(s) = Gc (s)Gp (s) = K . (s + 0.2)(s + 0.4) We then have type{G(s)} = 0, and therefore, from Theorem 4.4.4(a) we get the following steady state tracking error for a unit step input: ess = 1 0.08 = , 1 + G(0) 0.08 + K provided that the closed loop system is stable. In order to reduce ess , one must clearly choose K to be large. However, we must also check that we have closed loop stability when K is made large! We shall use the root locus method for this. With Gc (s) given by (5.3.30) it is apparent that the closed loop system in Fig. 5.13 takes the form shown in Fig. 5.14. This is a closed loop system in standard form. In accordance with Remark 5.2.20 we can apply the rules RL.1 - RL.8 to the transfer function G̃ defined by G̃ = Gp , to get the root locus diagram in Fig. 5.15 (the details are left to the reader, recall Remark 5.2.13). From Fig. 5.15 one sees that the closed loop poles remain in the left half of the complex plane as 140 Figure 5.14: Closed loop system in Example 5.3.1 K → ∞, which means that the closed loop system remains stable as K is increased. On the surface this looks like an acceptable design: we make K large enough to ensure small ess and have closed loop stability. However, this in fact not a very satisfactory design. From the root locus diagram we see that, for large values of K, the closed loop poles are essentially on the asymptote through σ = −0.3, but with large imaginary parts, that is the closed loop poles are of the form (5.3.31) −0.3 + jω and − 0.3 − jω for large ω. This means that the unit step response will be of the form y(t) = c0 + c1 e−0.3t cos(ωt) + c2 e−0.3t sin(ωt), in which c0 , c1 and c2 are constants which can be calculated by the method of partial fractions. Notice that we have c0 ≈ 1 when K is large (since the steady state tracking error is small when K is large). Although the second and third terms decay to zero as t → ∞, they are nevertheless extremely high-frequency terms and also decay rather slowly, because of the small decay exponent 0.3. Such terms lead to a highly oscillatory unit step response and are extremely unwelcome! Thus, although we do in principle satisfy the design criteria, in practice we do not have a very good design. This example illustrates some of the drawbacks of proportional control. Remark 5.3.2. We could of course have used the Routh test, instead of the root locus method, to establish closed loop stability for all K ≥ 0. However, this would not have given us very much 141 Figure 5.15: Root locus for proportional controller insight into the defects of proportional control. These become evident only from the root locus diagram, which tells us that for large values of K the closed loop poles are as at (5.3.31), from which it follows (as discussed above) that the unit step response is not very satisfactory when we reduce steady state tracking error by making K large. This illustrates the sort of insight into design which the root locus method provides. Proportional-derivative (PD) control: With reference to the closed loop system in Fig. 5.13 a PD controller has the transfer function (5.3.32) Gc (s) = Kp + Kd s, in which Kp is a constant, known as the proportional constant, and Kd is another constant, known as the derivative constant. The terminology “proportional-derivative” derives from the following: if Z(s) = Gc (s)E(s) then, in time domain, one has z(t) = Kp e(t) + Kd 142 de(t) . dt In contrast to the proportional controller (5.3.30), in which there is only one constant K to adjust (or “tune”), in a PD-controller one can adjust the two constants Kd and Kp . In the following discussion we shall simplify matters by supposing that the adjustable constants Kp and Kd are equal, that is K p = Kd = K in which K is adjustable, and with this simplification the PD-controller transfer function Gc (s) defined at (5.3.32) takes the form (5.3.33) Gc (s) = K(s + 1). We now repeat Example 5.3.1 but with a PD-controller in place of a proportional controller. Example 5.3.3. In the closed loop system of Fig. 5.13 the plant has the transfer function Gp (s) = 1 . (s + 0.2)(s + 0.4) Our goal is to design a PD-controller Gc (s) given by (5.3.33) which attains the same design specifications as in Example 5.3.1, that is • the closed loop system is stable • the closed loop system has small steady state tracking error for a unit step input. Now put G(s) = Gc (s)Gp (s) = K(s + 1) . (s + 0.2)(s + 0.4) We then have type{G(s)} = 0, and therefore, from Theorem 4.4.4(a) we get the following steady state tracking error for a unit step input: ess = 1 0.08 = . 1 + G(0) 0.08 + K Thus, in order to reduce ess , one must choose K to be large, and must of course check that we have closed loop stability when K is made large. Again we shall use the root locus method for this. With Gc (s) defined by (5.3.33) one sees that the closed loop system in Fig. 5.13 amounts to the closed loop system shown in Fig. 5.16. This is a closed loop system in standard form, and it follows 143 Figure 5.16: Closed loop system in Example 5.3.3 from Remark 5.2.20 that the root locus diagram is obtained by applying the rules RL.1 - RL.8 to the transfer function G̃ defined by G̃(s) = (s + 1) . (s + 0.2)(s + 0.4) This is shown in Fig. 5.17 (the construction of the root locus diagram is very similar to that in Example 5.2.21): From Fig. 5.17 one sees that the closed loop poles remain in the left half of Figure 5.17: Root locus for PD-controller the complex plane as K → ∞, which means that the closed loop system remains stable as K is 144 increased. Moreover, as K becomes large, one closed loop pole migrates towards −∞ along the negative real axis, while the other closed loop pole migrates towards the point −1, again along the negative real axis. Thus, for large values of K, the closed loop poles are approximately located at −1 −γ and in which γ > 0 is large (this accounts for the closed loop pole migrating to −∞ along the negative real axis as K → ∞). The unit step response is then given by y(t) = c0 + c1 e−t + c2 e−γt , for constants c0 , c1 and c2 , in which c0 ≈ 1. Since γ > 0 is large the third term on the right decays to zero very quickly. In contrast to what happens in Example 5.3.1, these closed loop poles are very nice and do not add any oscillatory terms to the unit step response. This is a very satisfactory design. Remark 5.3.4. Note how much insight the root locus method gives into the properties of proportional controllers and PD-controllers. Proportional-integral (PI) control: With reference to the closed loop system in Fig. 5.13 a PI controller has the transfer function (5.3.34) Gc (s) = Kp + Ki , s in which Kp is a constant, the so-called proportional constant, and Ki is another constant, the so-called integral constant. The terminology “proportional-integral” control derives from the following: if Z(s) = Gc (s)E(s) then, in time domain, one has Z z(t) = Kp e(t) + Ki t e(s)ds. 0 Design of a PI-controller is a matter of determining values for the constants Kp and Ki such that the design specifications are satisfied. From (5.3.34) one has Gc (s) = Ki + K p s , s 145 and it then follows that type{G(s)} ≥ 1, for G(s) = Gc (s)Gp (s), regardless of the choice of Kp and Ki (provided that Ki ̸= 0 and Gp (s) does not have any zeros at s = 0). Then, from Theorem 4.4.1(a), we get tracking of unit step inputs, that is ess = 0, for all values of Kp and Ki (with Ki ̸= 0) such that the closed loop system is stable. In particular, there is no need to make the tunable constants Kp and Ki large in order to reduce ess , as was the case in Example 5.3.1 and Example 5.3.3. In fact we are now free to fix the constants Kp and Ki to satisfy other design criteria, including of course closed loop stability. Proportional-derivative-integral (PDI) control: With reference to the closed loop system in Fig. 5.13 a PDI controller has the transfer function (5.3.35) Gc (s) = Kp + Kd s + Ki , s in which Kp , Kd and Ki are constants, known respectively the proportional constant, the derivative constant, and the integral constant. Thus if one has Z(s) = Gc (s)E(s), then, in time domain, de(t) z(t) = Kp e(t) + Kd + Ki dt Z t e(s)ds. 0 Design of a PDI-controller is again a matter of determining values for the constants Kp , Kd and Ki , such that the design specifications are satisfied. From (5.3.34) one has Gc (s) = Ki + Kp s + Kd s2 , s and, just as for PD-controller, it follows that type{G(s)} ≥ 1, for G(s) = Gc (s)Gp (s), regardless of the choice of Kp , Kd and Ki (provided that Ki ̸= 0 and Gp (s) does not have zeros at s = 0). Again, from Theorem 4.4.1(a), we get tracking of unit step inputs for all values of Kp , Kd , and Ki , with Ki ̸= 0 and such that the closed loop system is stable. We are now free to fix the constants Kp , Kd and Ki to satisfy other design criteria. 146 Remark 5.3.5. PDI-controllers combine the advantages of both PD-controllers and PI-controllers. In particular, PDI-controllers involve three degrees of freedom, in the sense that one can adjust three separate parameters Kp , Ki and Kd in order to attain the design specifications. In contrast, for PD-controllers and PI-controllers, one can adjust only two parameters, while for proportional control one can adjust only a single parameter. PDI-controllers are ubiquitous in closed loop control across the full range of applications, from the most basic to the most sophisticated, including process control in chemical engineering, control of robots, cruise control in motorcars, and flight control systems in high-performance jet aircraft. Remark 5.3.6. In the present chapter we have devoted considerable effort to formulating a set of eight rules for sketching root locus diagrams. These days one has available powerful tools such as MATLAB which provide root locus plots with much greater accuracy and completeness than one could ever get from a sketch based on the eight rules, so one can reasonably question why such emphasis is still placed on the rules, or why one should even bother to learn the rules in the first place. The rules remain useful nonetheless, despite the availability of MATLAB, because of the insight and understanding that the rules provide. It is incredibly useful to know, for example, that closed loop poles move towards the zeros of a transfer function as a gain parameter K is made large, and to understand what happens to the closed loop poles when there are fewer zeros than poles in a transfer function. This sort of understanding can be exploited to choose the location of poles and zeros so as to deliberately shape the root locus plots in ways that help to attain the design criteria. As Example 5.3.1 makes clear, the root locus method can also quickly reveal hidden flaws in a design which seemingly attains the design objectives. In fact, with the availability of MATLAB, the rules actually become more useful than ever, because MATLAB makes it so easy to implement the essentially iterative trial-and-error process of design. The eight rules, together with MATLAB, make a very powerful combination in coming up with controller designs. 147 Chapter 6 The Nyquist stability criterion 6.1 Motivating remarks In most of this chapter we shall focus on the stability of the standard closed loop system in Fig. 5.1, which is reproduced at Fig. 6.1, in which G(s) is a coprime and proper rational function, thus (6.1.1) G(s) = N (s) D(s) with deg(N ) ≤ deg(D), and the polynomials N (s) and D(s) do not have any roots in common. We are interested in the Figure 6.1: Standard closed loop system Nyquist stability criterion, which is a method for determining the range of values of K for closed loop stability. One can immediately object that the Routh test of Chapter 4 already gives this range of values, so why do we need another such result? The Nyquist criterion is valuable because, in addition to the range of values of K for closed loop stability, the criterion provides a lot of additional insight, not available from the Routh test, which is particularly valuable when 148 designing controllers. There is, in addition, a second major reason for the importance of the Nyquist criterion: Recall that the closed loop transfer function of the system in Fig. 6.1 is given by (6.1.2) H(s) = KG(s) KN (s) = , 1 + KG(s) D(s) + KN (s) with the denominator polynomial (6.1.3) ∆(s) = D(s) + KN (s). The closed loop poles are the roots of polynomial ∆(s), and it is to this polynomial that we must apply the Routh test (recall Theorem 4.2.1). To construct polynomial ∆(s) we must of course have exact knowledge of the numerator and denominator polynomials N (s) and D(s), that is we must know the degrees and the coefficients of these polynomials. Unfortunately, in many problems of control, this information is not easily available. For an example which illustrates this, consider the wing section of an aircraft, as shown in Fig. 6.2. This wing is itself a system, the input u(t) Figure 6.2: The wing of an aircraft being the upward force (in newtons) applied to the tip of the wing, and the output y(t) being the corresponding angle (in radians) by which the wing flexes in response to this applied force. How are we to determine the transfer function which relates these signals? The wing of an aircraft is an exceptionally complex structure. Mounted in the wing are the landing gear, fuel tanks and numerous supporting struts and spars. In addition, in the case of a long range airliner, it is usually the case that an engine (sometimes two engines) is suspended under each wing. This complexity effectively rules out determining the transfer function relating U (s) to Y (s) by writing down a few differential equations and taking Laplace transforms (as we did in the case of a servo-motor in Chapter 3). The key to addressing this challenge is in the following result from ECE-207: If a 149 sinusoidal signal (6.1.4) u(t) = cos(ωt), is the input to a stable system with transfer function G(s) then the steady-state response is the sinusoidal signal (6.1.5) y(t) = |G(jω)| cos[ωt + ∠G(jω)]. In view of this result we can measure the transfer function G(s) at s = jω by applying the input signal (6.1.4) and then reading off the values of the amplitude |G(jω)| and phase shift ∠G(jω) in the corresponding steady-state response (6.1.5) to get the complex number (in polar form) G(jω) = |G(jω)|∠G(jω). (6.1.6) By repeating this measurement for many values of ω we can, in principle, measure the restriction to the imaginary axis of the transfer function G(s), that is we can measure the frequency response (6.1.7) G(jω), for all ω ≥ 0. For the aircraft wing the sinusoidal force at the tip of the wing is exerted by a device which can be programmed for a wide range of frequencies, and the corresponding angle of deflection of the wing is measured by strain gauges embedded in the structure of the wing. We shall see that the Nyquist criterion gives bounds on the gain K for stability of the closed loop system at Fig. 6.1, as well as a good deal of other useful information, based only on the frequency response (6.1.7); in particular, one does not need to know the transfer function G(s) for all complex s in order to use the Nyquist criterion (in contrast to the Routh test for which one must know G(s) for all s in the complex plane). A particularly important consequence of this fact is that one can use the Nyquist criterion for complex systems, the transfer function G(s) of which is unknown, but the frequency response G(jω) of which can be measured over a range of frequencies ω. In short, one can use the Nyquist criterion based only on measured data of the response of the system. This is a huge advantage of the Nyquist criterion. 6.2 Winding numbers The Nyquist criterion depends on some very elementary ideas from algebraic geometry which we introduce in this section. By a closed curve in the complex plane is meant a continuous curve 150 which begins and ends at the same point. A simple closed curve in the complex plane is a closed curve which does not cross over itself. Thus, in Fig. 6.3, the curve at (i) is a simple closed curve. On the other hand, the curve at (ii) is a closed curve which fails to be a simple closed curve (since it crosses over itself), while the curve at (iii) also fails to be a simple closed curve since it is not a closed curve. Any continuous curve in the complex plane (not necessarily simple or even closed) Figure 6.3: Continuous curves in the plane can have one of only two possible directions - see Fig. 6.4. A simple closed curve in the complex Figure 6.4: Continuous curves with possible directions plane with a direction is said to be positively oriented when, upon traversing the curve in the 151 given direction, the region enclosed is always on the left. Similarly, a simple closed curve in the complex plane with a direction is said to be negatively oriented when, upon traversing the curve in the given direction, the region enclosed is always on the right - see Fig. 6.5. Figure 6.5: Positive and negative orientations Remark 6.2.1. Observe that orientation does not make any sense for a closed curve which fails to be simple, as shown in Fig. 6.6. Here one has a closed curve with a given direction, which encloses both an upper and a lower region. As one traverses the curve in the direction indicated the upper enclosed region is on the left, while the lower enclosed region is on the right. Therefore one cannot define an unambiguous orientation. Figure 6.6: Closed curve without an orientation 152 Remark 6.2.2. We now introduce a simple “game” which will lead us to the essential concept of a winding number. Fix a point p in the complex plane, and take a piece F of a continuous curve in the complex plane which does not pass through the point p, as shown in Fig. 6.7, i.e. the point p is not on the curve F. Draw any straight line (or ray) R starting at p which cuts across the curve Figure 6.7: Scoring along a straight line ray F as shown in Fig. 6.7(i)(ii). Think of a vector, the tail of which is at point p, and the tip of which moves along curve F in the direction of F. If this vector rotates in a counter-clockwise direction when it passes through the point where the curve F and the ray R intersect, then attach a score of +1 to that point of intersection (see Fig. 6.7(i)). On the other hand, if this vector is rotating in a clockwise direction when it passes through the point where the curve F and the ray R intersect then attach a score of −1 to the point of intersection (see Fig. 6.7(ii)). Finally, if as shown in Fig. 6.7(iii), the ray R just touches the curve F but does not cut across F (in contrast to the cases (i) and (ii)), then assign a score of zero to the point where the curve F and the ray R touch. Remark 6.2.3. With the method of “scoring” introduced in Remark 6.2.2 we are now able to formulate the so-called winding number of a closed curve around a point. This will be essential when we formulate the Nyquist criterion. Take any closed curve F in the complex plane, with a given direction (the curve need not be a simple curve), and fix any point p in the complex plane which is not on F. Draw several straight lines (or rays) radiating outwards from p, labeled R1 , R2 and R3 (see Fig. 6.8). Now give a score of +1, −1 or 0 to each point where the ray intersects the closed curve F, and then add up the scores along the ray to get a total score for that ray. Thus the ray R1 intersects F just once with a score of +1, and the total score is then +1. The ray R2 153 Figure 6.8: Point p not on closed curve F intersects F at five points, with scores of +1, +1, −1, −1, +1 (moving along R2 away from p), so the total score for the ray R2 is 1 + 1 − 1 − 1 + 1 = +1. As for the ray R3 , this intersects F at four points, with scores of +1, 0, −1, +1, so the total score for the ray R3 is 1 + 0 − 1 + 1 = +1. We notice that the scores for the rays R1 , R2 and R3 are identical! Actually, a profound theorem in algebraic geometry asserts the following: for any closed curve F and any point p which is not on F one obtains the identical (6.2.8) score along each and every straight line ray outwards from point p. This common score is called the winding number of the closed curve F around the point p, and is denoted by windp F. Thus, for the closed curve F and point p shown in Fig. 6.8 we have windp F = 1 154 It follows that, when calculating the winding number of a closed curve F around a point p, one should choose a ray R from p which intersects F at the least number of points. Thus, in Fig. 6.8, one would use a ray such as R1 instead of rays R2 or R3 . Example 6.2.4. Determine the winding number of the closed curve F around the point p in Fig. 6.9. Fix a ray R1 which does not intersect the curve F anywhere. Thus there is a zero total score so that one immediately obtains windp F = 0 On the other hand, a masochist might choose the ray R2 ; the result would be the same. Figure 6.9: Point p and closed curve F in Example 6.2.4 Remark 6.2.5. The definition of the winding number windp F of a closed curve F around the point p relies on (6.2.8), namely the scores along every possible straight-line ray through a point p not located on F are identical. This invariance property fails to hold when the point p is actually located on F, as shown in Fig. 6.10. In Fig. 6.10(i) we indicate straight-line rays R1 and R2 through p; the score along R1 is zero (we do not count p as point where the ray cuts F), whereas the score along R2 is +1, that is there are different scores along different rays. Similarly, in Fig. 6.10(ii), there are rays R1 , R2 and R3 located on F. The score along R1 is zero, whereas along R2 the score is +1 and along R3 the score is −1. Since these scores depend on which ray through p is chosen there is no basis for defining the winding number when p is actually on F, that is the winding number is undefined (i.e. does not make sense) when p is located on F. 155 Figure 6.10: Point p located on the closed curve F 6.3 The Nyquist relation - preliminary version In this section we formulate the Nyquist relation. This relation is an essential half-way house to the Nyquist stability criterion, as well as being of considerable interest in its own right. We shall see that the winding number of a closed curve around a point, studied in the previous section, is essential for stating the Nyquist relation. Throughout this section we focus on the standard closed loop system shown in Fig. 6.1, with (6.1.1) in force. We shall also temporarily impose the following condition on the transfer function G(s): Condition 6.3.1. The transfer function G(s) in Fig. 6.1 does not have poles on the imaginary axis. Remark 6.3.2. Note that Condition 6.3.1 permits G(s) to have poles with both strictly positive and strictly negative real parts, but excludes any poles with real part equal to zero. Of course, this is a very restrictive condition, since it excludes, for example, type-one transfer functions such as G(s) = 1 . s(s + 1) As we know from Chapter 4 such transfer functions are essential for tracking step and ramp inputs. We nevertheless introduce this condition because it is a little too ambitious to formulate the Nyquist relation in a single step without assuming the condition. Once we thoroughly understand the Nyquist relation with Condition 6.3.1 in place, we shall then be able to discard the condition and 156 state the Nyquist relation in completely general terms. This is why we have referred to the result in the present section as the “preliminary version”. The Nyquist contour, always denoted by C, is the negatively oriented, closed simple curve in the complex plane shown in Fig. 6.11. This curve runs along the imaginary axis, then moves into the right half of the complex plane following a semicircular arc ABC with infinite radius. The Nyquist plot of the transfer function G(s) is the closed (but usually not simple) curve Figure 6.11: Nyquist contour C G in the complex plane followed by the complex number G(s) as the complex number s traverses the Nyquist contour C in the direction shown (see Fig. 6.11). Example 6.3.3. The transfer function G(s) is (6.3.9) G(s) = 10(s + 2) . (s − 1)(s + 5) Sketch the Nyquist plot of G(s). From Fig. 6.11 we observe that the Nyquist contour C comprises the successive branches OA, ABC, and CO. We draw the path followed by G(s) as s traverses each of these branches in the direction shown. 157 Branch OA: Here we have ω ≥ 0, s = jω, so that we must plot the path followed by (6.3.10) G(jω) = 10(2 + jω) , (−1 + jω)(5 + jω) for all ω ≥ 0. From (6.3.10) we have G(j0) = −4. (6.3.11) For large ω one sees from (6.3.10) that G(jω) ≈ 10 10(jω) = , (jω)(jω) jω that is 10 ∠−π/2, ω so that G(jω) tends to the origin at an angle of −90 degrees as ω → ∞. G(jω) ≈ We have evaluated G(jω) when ω = 0, and as ω → ∞. It remains to determine G(jω) for intermediate values 0 < ω < ∞. Thus fix some 0 < ω < ∞: from (6.3.10) we have (6.3.12) ∠G(jω) = ∠(2 + jω) − ∠(5 + jω) − ∠(−1 + jω), and it is clear that −1 + jω is in the second quadrant, that is π/2 < ∠(−1 + jω) < π, thus (6.3.13) −π < −∠(−1 + jω) < −π/2. Moreover it is clear that π/2 > ∠(2 + jω) > ∠(5 + jω), so that (6.3.14) 0 < ∠(2 + jω) − ∠(5 + jω) < π/2. 158 Upon adding (6.3.14) and (6.3.13) we get −π < ∠(2 + jω) − ∠(5 + jω) − ∠(−1 + jω) < 0, and from this together with (6.3.12) we find that −π < ∠G(jω) < 0, (6.3.15) for all 0 < ω < ∞. It follows from (6.3.15) that G(jω) is in either the third or fourth quadrant when 0 < ω < ∞, and never crosses the real axis for any 0 < ω < ∞ (for, if G(jω) is on the real axis, then G(jω) = −π or G(jω) = 0, which cannot happen since the inequalities at (6.3.15) are strict). Moreover, from (6.3.11), we see that G(j0) = −4 is on the boundary of the third quadrant, thus G(jω) moves into the third quadrant as ω increases from ω = 0. Branch ABC: Since the radius of the semicircular arc ABC is R = ∞ we have that |s| = ∞ for all s on arc ABC. Now deg(N ) < deg(D), so that G(s) = 0 for all s on ABC. Thus, as s traverses the arc ABC, we see that G(s) waits at the origin until s reaches the point C i.e. the point −j∞ on the Nyquist contour. It follows that the arc ABC of the Nyquist contour contributes nothing to the Nyquist plot G. Branch CO: We have |G(−jω)| = |G(jω)| ∠G(−jω) = −∠G(jω), and ω ≥ 0, that is G(−jω) = G∗ (jω), ω ≥ 0, and from this it follows that the path followed by G(s) as s traverses the branch CO is the symmetric image around the real axis of the path followed by G(s) as s traverses the branch OA of the Nyquist contour. The previous calculations suggest that the full Nyquist plot should therefore have the form shown in Fig. 6.12. Remark 6.3.4. Example 6.3.3 illustrate two characteristic features of every Nyquist plot, namely 159 Figure 6.12: Nyquist plot of transfer function G(s) in Example 6.3.3 • The Nyquist plot is symmetric around the real axis • The infinite radius arc ABC of the Nyquist contour C contributes nothing to the Nyquist plot; the complex number G(s) just waits at the same point in the complex plane while s traverses the arc ABC. Remark 6.3.5. A question frequently asked about the Nyquist plot concerns the accuracy with which the path followed by G(jω) must be plotted as ω moves through the range 0 ≤ ω < ∞. Thus, in Example 6.3.3, we could have specifically calculated G(jω) for several values of ω, e.g. ω = 1, 10, 100, 1000 etc. However, when we come to the Nyquist relation and Nyquist criterion, we shall see that this path actually need not be accurately plotted at all, but can just be roughly sketched, and the only thing that really matters are the points at which G(jω) crosses the real axis as ω moves through the range 0 ≤ ω ≤ ∞. In Example 6.3.3 we have seen from (6.3.15) that G(jω) never crosses the real axis for any ω in the range 0 < ω < ∞, so the only such points are −4 (corresponding to ω = 0) and the origin (corresponding to ω → ∞ i.e. ω = ∞). Having defined the Nyquist contour and the Nyquist plot we can now proceed to the Nyquist relation, which concerns the standard closed loop system in Fig. 6.1. The closed loop transfer function is of course (6.3.16) H(s) = KG(s) . 1 + KG(s) 160 Now put (6.3.17) ν+ (G) = number of poles p of G(s) s.t. re{p} > 0. and similarly ν+ (H) = number of poles p of H(s) s.t. re{p} ≥ 0. (6.3.18) Remark 6.3.6. Note the strict inequality re{p} > 0 at (6.3.17), versus the non-strict inequality re{p} ≥ 0 at (6.3.18). Actually, in view of Condition 6.3.1, which says that G(s) does not have any poles on the imaginary axis, we could have used the non-strict inequality re{p} ≥ 0 at (6.3.17) and obtained the same value for ν+ (G). However, it will be essential to use the strict inequality for ν+ (G) in later sections of the chapter, when we discard Condition 6.3.1 and allow G(s) to have poles on the imaginary axis. With this notation we have Theorem 6.3.7. Consider the standard closed loop system shown in Fig. 6.1, and suppose that Condition 6.3.1 holds. Fix some gain K such that the point −1/K (which is on the real axis of the complex plane) is not on the Nyquist plot G of the transfer function G(s). Then ν+ (H) = ν+ (G) − wind−1/K G. (6.3.19) The relation (6.5.23) is the celebrated Nyquist relation. 6.4 The Nyquist stability criterion - preliminary version Again we focus on the standard closed loop system in Fig. 6.1 with (6.1.1) in force, and again we assume Condition 6.3.1. Later this condition will be discarded. The Nyquist stability criterion is as follows: Theorem 6.4.1. Consider the standard closed loop system shown in Fig. 6.1, and suppose that Condition 6.3.1 holds. The closed loop system is stable if and only if the following two conditions both hold: (a) ν+ (G) = wind−1/K G (b) the point −1/K is not on the Nyquist plot G. 161 Of course closed loop stability is equivalent to ν+ (H) = 0, and therefore condition (a) in Theorem 6.4.1 is an immediate consequence of the Nyquist relation (6.5.23). However, the winding number wind−1/K G is undefined when −1/K is on the closed curve G. It can be shown that the closed loop system is unstable in this case, and this is the reason for condition (b). In the important special case where G(s) is stable we have ν+ (G) = 0 so that condition (a) of Theorem 6.4.1 reduces to wind−1/K G = 0. Example 6.4.2. In the closed loop system of Fig. 6.1 the transfer function is given by (6.3.9). Use the Nyquist stability criterion to determine the values of K for closed loop stability. We have already sketched the Nyquist plot for this transfer function at Fig. 6.12, which is reproduced at Fig. 6.13. From (6.3.9) we have Figure 6.13: Nyquist plot for the Example 6.4.2 ν+ (G) = 1. 162 We now determine the winding number wind−1/K G as K varies (actually as −1/K varies): −∞ < −1/K < −4: In this case wind−1/K G = 0, thus wind−1/K G ̸= ν+ (G). From Theorem 6.4.1 we conclude that the closed loop system is unstable. −4 < −1/K < 0: In this case wind−1/K G = 1, thus wind−1/K G = ν+ (G). Moreover −1/K is not on G. We therefore conclude from Theorem 6.4.1 that the closed loop system is stable. 0 < −1/K < ∞: In this case wind−1/K G = 0, thus wind−1/K G ̸= ν+ (G), so that the closed loop system is unstable. From now on we shall present the above reasoning and conclusions in the form of a table as shown below: Range of K wind−1/K G C-L stable/unstable −∞ < −1/K < −4 0 unstable −4 < −1/K < 0 1 stable 0 < −1/K < ∞ 0 unstable We see that the closed loop system is stable when −4 < −1/K < 0, that is for all K > 1/4. Remark 6.4.3. In Example 6.4.2 we made sure that condition (b) of Theorem 6.4.1 always holds by deliberately choosing −1/K to not be on G. Since −1/K is on the real axis this means that −1/K must avoid the values −4 and 0, which is where the Nyquist plot G crosses the real axis (as a practical matter we could never have (−1/K) = 0, since this would require K = ∞, which is impossible). Notice that the winding number changes as −1/K passes through the points where the Nyquist plot G crosses the real axis. For this reason that it is very important to accurately determine the points where G crosses the real axis. The next example also illustrates this. 163 Example 6.4.4. In the closed loop system in Fig. 6.1 the transfer function is given by G(s) = −5(s − 8) . (s − 2)(s + 10) Use the Nyquist criterion to determine the values of K for closed loop stability. We must first sketch the Nyquist plot of G(s). In contrast to Example 6.4.2, for which we were able to sketch the Nyquist plot without any detailed numerical computations (see Example 6.3.3), in this case the transfer function G(s) is a bit tricky, and we resort to MATLAB to get the Nyquist plot shown in Fig. 6.14 (note that MATLAB computes G(jω) for a wide range of values of ω). We Figure 6.14: Nyquist plot for the Example 6.4.4 have G(j0) = −2. For the branch OA of the Nyquist plot at Fig. 6.11 we have G(jω) = −5(jω − 8) , (jω − 2)(jω + 10) for all 0 ≤ ω < ∞. As ω → ∞ we have G(jω) ≈ −5 , jω thus 164 G(jω) ≈ 5 ∠π/2. ω It follows that G(jω) tends towards the origin at an angle of 90 degrees as ω → ∞. Note that the Nyquist plot G crosses the real axis at the points −2, −0.65 and 0, so we must make sure that −1/K does not take any of these values. Now ν+ (G) = 1. We summarize the conclusions from Theorem 6.4.1 in the table which follows Fig. 6.14. Range of K wind−1/K G C-L stable/unstable −∞ < −1/K < −2 0 unstable −2 < −1/K < −0.65 1 stable −0.65 < −1/K < 0 −1 unstable 0 < −1/K < ∞ 0 unstable The closed loop system is therefore stable when K satisfies the inequality −2 < −1/K < −0.65, that is 0.5 < K < 1.54. Remark 6.4.5. Example 6.4.4 illustrates clearly why it is important to accurately determine the points at which the Nyquist plot G crosses the real axis, for it is when −1/K transitions across these points that the closed loop stability can change. Example 6.4.6. In the closed loop system in Fig. 6.1 the transfer function is given by G(s) = (s − 6) . (s + 1)(s2 + 4s + 9) Use the Nyquist criterion to determine the values of K for closed loop stability. We must first sketch the Nyquist plot of G(s). As was the case with Example 6.4.4 one cannot really do a sketch which accurately gives the points at which the Nyquist plot crosses the real axis without calculating G(jω) for a range of values of ω. We threfore resort to MATLAB to get the Nyquist plot which is shown in Fig. 6.15. Note that the Nyquist plot G crosses the real axis at the points −2/3, 0 and 1/5, so we must make sure that −1/K does not take any of these values. Now ν+ (G) = 0. We summarize the conclusions from Theorem 6.4.1 in the following table: 165 Figure 6.15: Nyquist plot for the Example 6.4.6 Range of K wind−1/K G C-L stable/unstable −∞ < −1/K < −2/3 0 stable −2/3 < −1/K < 0 −1 unstable 0 < −1/K < 1/5 −2 unstable 1/5 < −1/K < ∞ 0 stable The closed loop system is stable when K satisfies either of the inequalities −∞ < −1/K < −2/3 and 1/5 < −1/K < ∞. By simple manipulation of inequalities we then get that the closed loop system is stable when K satisfies either −5 < K < 0 or 0 < K < 3/2. Example 6.4.7. We are given a linear time-invariant system with strictly proper rational transfer function G(s) which is stable, and therefore cannot have any poles on the imaginary axis, but about which we otherwise know nothing. The frequency response G(jω) is measured over the frequency range 0 ≤ ω < ∞, from which we get the Nyquist plot shown in Fig. 6.16 (which in not drawn to scale!). Since the measurements are over the frequency range 0 ≤ ω < ∞, these give the part of the Nyquist plot corresponding to the branch OA of the Nyquist contour C shown in Fig. 6.11. As ω → ∞ one sees from the measurements that G(jω) tends towards the origin (at an angle of -90 degrees). From Remark 6.3.4 we know that G(s) waits at the origin while s traverses the arc AB, 166 Figure 6.16: Measured Nyquist plot for the Example 6.4.7 and then the Nyquist plot is completed by drawing the symmetric image around the real axis of the plot for the branch OA. Since G(s) is stable we have ν+ (G) = 0. We must determine the range of values of K for which the closed loop system in Fig. 6.1 is stable. From the measured Nyquist plot we see that the Nyquist contour passes through the real axis at the points −0.1, −10−4 , 0 and 1, and therefore we make sure that −1/K avoids these values in our choice of inequalities. From Theorem 6.4.1 we obtain the following table: Range of K wind−1/K G C-L stable/unstable −∞ < −1/K < −0.1 0 stable −0.1 < −1/K < −10−4 −2 unstable 0 stable 0 < −1/K < 1 −1 unstable 1 < −1/K < ∞ 0 stable −4 −10 < −1/K < 0 From the table one sees that the closed loop system is stable when K satisfies any one of the following inequalities: −∞ < − 1 < −0.1, K −10−4 < − 167 1 < 0, K 1<− 1 < ∞. K That is the closed loop system is stable when K satisfies any one of the following inequalities: 104 < K, 0 < K < 10, −1 < K < 0. Remark 6.4.8. Example 6.4.7 illustrates a situation which is very common in applications: the transfer function G(s) represents such a complex system that we cannot write it out in terms of explicit numerator and denominator polynomials N (s) and D(s), and must therefore resort to physical measurement of the frequency response of G(s), as briefly described in Section 6.1. One cannot determine closed loop stability by means of the Routh test in such cases, but Example 6.4.7 shows that we can still use the Nyquist stability criterion. This is a particularly valuable property of the Nyquist criterion. 6.5 The Nyquist relation and stability criterion - general version In the previous section we presented the Nyquist relation (Theorem 6.3.7) and the Nyquist stability criterion (Theorem 6.4.1) subject to Condition 6.3.1. This excludes for example any transfer function G(s) with type{G(s)} = m ≥ 1, which has m-poles clustered at the origin s = 0. Such transfer functions are of course extremely important for tracking, as we saw in Chapter 4, so it is important that we extend the Nyquist relation and stability criterion to hold without having to suppose Condition 6.3.1. To fix ideas suppose that, in the closed loop system in Fig. 6.1, the transfer function G(s) is (6.5.20) G(s) = s3 (s2 (s + 3) , + 1)(s2 + 2s + 2) which has the following poles on the imaginary axis: p1 = 0, p2 = j, p3 = −j. In this case we introduce the so-called extended Nyquist contour shown in Fig. 6.17. This is similar to the Nyquist contour shown in Fig. 6.11 except that we now introduce small semicircular indentations into the right-half complex plane to “by-pass” the poles of G(s) which are on the imaginary axis. Thus the extended Nyquist contour, still denoted by C, is made up of the branches 168 Figure 6.17: Extended Nyquist contour C ABC, CD, DEF , F G, GHI, IJ, JKL, and LA. Consider the branch ABC shown in detail in Fig. 6.18. This is a semicircular arc with radius ϵ for some very small ϵ > 0, e.g. ϵ = 10−10 , and centered at the pole p1 = 0. Then, since s traverses the arc ABC, we have π π s = ϵ ejθ , − ≤θ≤ . 2 2 As for the branch DEF , this is also shown in Fig. 6.18. Again this branch is a semicircular arc with radius ϵ > 0, for some very small ϵ, but centered at the pole p2 = j. Since s traverses the arc DEF , we have π π ≤θ≤ . 2 2 Exactly the same thing holds for the branch JKL, except that s traversing around this branch is s = j + ϵ ejθ , − given by π π ≤θ≤ . 2 2 We see that the extended Nyquist contour is a simple closed curve, which is negatively oriented. By s = −j + ϵ ejθ , − the extended Nyquist plot of the transfer function G(s) is meant the closed curve G traced in the 169 Figure 6.18: Branches ABC and DEF in extended Nyquist contour complex plane by G(s) as s traverses the extended Nyquist contour. As the next example shows, the small semicircular indentations in the extended Nyquist contour contribute huge semicircular branches to the extended Nyquist plot. Example 6.5.1. Draw the extended Nyquist contour C and the extensded Nyquist plot G for the transfer function G(s) = 1 , + 2) s4 (s and determine the winding number windp G when p = 2. We have G(jω) = 1 , ω 4 (2 + jω) for all 0 < ω < ∞. The extended Nyquist contour is shown in Fig. 6.19, with the semicircular indentation ABC around the cluster of 4 poles at the origin. We next determine the extended Nyquist plot, calculating the contribution of each of the branches in the extended Nyquist contour. Branch CD: Point C corresponds to s = jϵ, in which ϵ > 0 is the radius of the branch ABC, thus the branch CD corresponds to ω ≥ ϵ, s = jω, and we must sketch the path in the complex plane followed by G(jω) for all ω ≥ ϵ. Since ϵ is small, 170 Figure 6.19: Extended Nyquist contour in the Example 6.5.1 e.g. ϵ = 10−10 , we have |G(ϵj)| ≈ 1 , 2ϵ4 ∠G(ϵj) = −∠(2 + ϵj), that is G(ϵj) (denoted by C̃ on Fig. 6.20) is just inside the fourth quadrant. On the other hand, as ω → ∞ we get 1 1 = 5 ∠−π/2. 5 jω ω Thus G(jω) approaches the origin s = 0 at an angle of −90 degrees as ω → ∞. Furthermore, since G(jω) ≈ π > ∠2 + jω) > 0, 2 for all 0 < ω < ∞, it is clear that π < ∠G(jω) < 0, for all 0 < ω < ∞. 2 It follows that G(jω) is in the fourth quadrant and never crosses the real axis for all 0 < ω < ∞. − Thus, without any detailed calculation, we can sketch the path C̃ D̃ traced by G(jω) in the complex plane for all ω ≥ ϵ, as shown in Fig. 6.20. Branch DE: Here |s| = ∞ for all s on the branch DE, since DE is a semicircular arc of essentially infinite radius, and thus G(s) = 0 for all s on the branch DE. 171 Figure 6.20: Extended Nyquist plot in the Example 6.5.1 Thus G(s) just waits at the origin as s traverses the branch DE, therefore branch DE contributes nothing to the Nyquist plot. Branch EA: As s traverses EA the complex number G(jω) traces out a path Ẽ à in the complex plane which is the symmetric image around the real axis of the path C̃ D̃ in the Nyquist plot. Note that the points D̃ and à are identical points at the origin s = 0, since the branch DE contributes nothing to the Nyquist plot. Branch ABC: Here we have s = ϵ ejθ , − π π ≤θ≤ , 2 2 and thus, since s + 2 ≈ 2 (why?), we have G(s) ≈ 1 1 1 = = 4 j4θ , 4 jθ 4 s 2(ϵ e ) 2ϵ e − π π ≤θ≤ , 2 2 that is G(s) ≈ 1 −j4θ 1 e = 4 ∠−4θ, 4 2ϵ 2ϵ 172 − π π ≤θ≤ . 2 2 As θ increases from −π/2 to π/2, so the complex number e−j4θ traces out exactly four semicircular arcs of unit radius in a clockwise sense, thus the complex number G(s) traces out exactly four semicircular arcs of radius 1/(2ϵ4 ) in a clockwise sense. Put another way, as s traverses the arc ABC in the Nyquist contour, so the complex number G(s) traces out exactly two circles of radius 1/(2ϵ4 ) in a clockwise sense in the Nyquist plot. In Fig. 6.20 we have drawn these circles slightly displaced from each other to emphasize that there are actually two such circles. Finally, we determine the winding number windp G when p = 2. In Fig. 6.20 a straight line ray outwards from p = 2 is drawn. This ray is crossed 3 times in a clockwise direction by the Nyquist plot G, thus windp G = −3 when p = 2. Remark 6.5.2. To state the extended versions of the Nyquist relation and Nyquist criterion we recall for easy reference some notation defined previously: (6.5.21) ν+ (G) = number of poles p of G(s) s.t. re{p} > 0, (6.5.22) ν+ (H) = number of poles p of H(s) s.t. re{p} ≥ 0. Here H(s) is of course the transfer function of the standard closed loop system in Fig. 6.1. Note that ν+ (G) counts only the unstable poles of G(s) which have strictly positive real parts (i.e. does not count the unstable poles of G(s) which are on the imaginary axis), whereas ν+ (H) counts all unstable poles of the closed loop transfer function H(s), whether on the imaginary axis or not. We are now able to state the Nyquist relation without assuming Condition 6.3.1 (compare with Theorem 6.3.7). Theorem 6.5.3. Consider the standard closed loop system shown in Fig. 6.1. Fix some gain K such that the point −1/K (which is on the real axis of the complex plane) is not on the extended Nyquist plot G of the transfer function G(s). Then (6.5.23) ν+ (H) = ν+ (G) − wind−1/K G. Similarly we can state the Nyquist stability criterion without assuming Condition 6.3.1 (compare with Theorem 6.4.1): Theorem 6.5.4. Consider the standard closed loop system shown in Fig. 6.1, and let G denote the extended Nyquist plot. The closed loop system is stable if and only if the following two conditions both hold: 173 (a) ν+ (G) = wind−1/K G (b) the point −1/K is not on the extended Nyquist plot G. Remark 6.5.5. We have seen in Example 6.5.1 that the indentations in the extended Nyquist contour C cause large circular arcs in the extended Nyquist plot G, and these in turn have a significant affect on the winding number wind−1/K G appearing in Theorem 6.5.3 and Theorem 6.5.4. This in turn affects the values of K for closed loop stability as the next example demonstrates. Example 6.5.6. For the standard closed loop system in Fig. 6.1 the transfer function G(s) is (6.5.24) G(s) = s+1 . s2 (s + 2) Determine all values of K such that the closed loop system is stable. We have (6.5.25) G(jω) = 1 + jω . (jω)2 (2 + jω) The extended Nyquist contour is as shown in Fig. 6.21. Note the semicircular branch (or indentation) ABC around the double pole at s = 0. The branch ABC is of radius ϵ, with 0 < ϵ ≪ 1, e.g. ϵ = 10−10 . We must determine the contribution to the extended Nyquist plot of each branch Figure 6.21: Extended Nyquist contour in the Example 6.5.6 in the extended Nyquist contour. These branches are of course CD, DE, EA and ABC. 174 Branch CD: Branch CD corresponds to ϵ ≤ ω < ∞, s = jω, thus we must plot the path followed by G(jω) for ω ≥ ϵ. At the point C we have s = ϵj, and from (6.5.25) we obtain G(ϵj) = 1 + ϵj 1 1 ≈ = 2 ∠−π. 2 2 (ϵj) (2 + ϵj) 2(ϵj) 2ϵ Again from (6.5.25) ∠G(jω) = ∠(1 + jω) − π − ∠(2 + jω), ω ≥ ϵ. Moreover it is clear that π > ∠(1 + jω) > ∠(2 + jω) > 0, 2 ω ≥ ϵ, π > [∠(1 + jω) − ∠(2 + jω)] > 0, 2 ω ≥ ϵ, thus and therefore π > ∠G(jω) > −π, ω ≥ ϵ. 2 It follows that G(jω) stays in the third quadrant for all ω ≥ ϵ. Finally, as ω → ∞, we see from − (6.5.25) that G(jω) ≈ jω 1 =− 2 3 (jω) ω and therefore G(jω) tends to the origin at an angle of −180 degrees (i.e. along the negative real axis) as ω → ∞. In view of these facts, and without any further calculation, we can sketch the branch C̃ D̃ followed by G(jω), for all ω ≥ ϵ, as shown in Fig. 6.22. Branch DE: For every s on the infinite-radius branch DE we have |s| = +∞ thus G(s) = 0 for all such s. The infinite-radius branch contributes nothing to the extended Nyquist plot, and G(s) waits at the origin as s traverses branch DE. Branch EA: This gives the branch Ẽ à in the extended Nyquist plot which is the symmetric image around the real axis of the branch C̃ D̃, as shown in Fig. 6.22. 175 Figure 6.22: Extended Nyquist contour in the Example 6.5.6 Branch ABC: The branch ABC corresponds to s = ϵ ejθ , − π π ≤θ≤ , 2 2 thus from (6.5.25) G(s) = (1 + ϵ ejθ ) , (ϵ ejθ )2 [2 + ϵ ejθ ] − π π ≤θ≤ . 2 2 Since ϵ is small we have π 1 π ∠−2θ, − ≤θ≤ . 2 2ϵ 2 2 One sees from this that G(s) follows two semicircular arcs in a clockwise direction with the radius G(s) ≈ 1/2ϵ2 . This amounts to a single circle with radius 1/2ϵ2 in a clockwise direction starting at à and ending at C̃. This completes the extended Nyquist plot G in Fig. 6.22. Now fix K ̸= 0, so that −1/K is on the real axis. In the extended Nyquist plot in Fig. 6.22 the branch ÃC̃ is a semicircular arc with radius 1/(2ϵ2 ). Since we can take ϵ to be as small as we like, we can really regard this branch as having infinite radius, and we shall do this from now on. With this interpretation we see from Fig. 6.22 that the extended Nyquist contour passes through the real axis only at the origin of the complex plane. Consequently, when we apply the extended Nyquist 176 stability criterion to determine the values of K for closed loop stability we need consider only the cases −(1/K) < 0 and 0 < −(1/K). We can now use the extended Nyquist criterion (i.e. Theorem 6.5.4) to determine the values of K for closed loop stability. From (6.5.21) and (6.5.24) we have ν+ (G) = 0. In view of this, together with Theorem 6.5.4 and Fig. 6.22, we obtain Range of K wind−1/K G C-L stable/unstable −∞ < −1/K < 0 0 stable 0 < −1/K < ∞ unstable −1 The closed loop system is stable when −∞ < −1/K < 0 (i.e. when K > 0) and unstable when 0 < −1/K < ∞ (i.e. when K < 0). Example 6.5.7. For the standard closed loop system in Fig. 6.1 the transfer function G(s) is G(s) = s2 (s2 10 . + 1)(s + 1) (a) determine all values of K such that the closed loop system is stable. (b) determine the number of unstable closed loop poles (i.e. determine ν+ (H)) when K = −1. (a) The transfer function G(s) has the following poles on the imaginary axis: p1 = 0, p2 = j, p3 = −j. The extended Nyquist contour C is shown in Fig. 6.23. This comprises the branches AB, BC, CD, DE, EF , F G, GH and HA. The branches HA, BC and F G are semicircular arcs with radius ϵ > 0, ϵ being extremely small, e.g. ϵ = 10−10 , and centered at the poles p1 , p2 and p3 respectively. From G(s) we have (6.5.26) G(jω) = (jω)2 (1 10 10 =− 2 . 2 + (jω) )(1 + jω) ω (1 − ω 2 )(1 + jω) We now evaluate the contribution of each branch of the extended Nyquist contour to the extended Nyquist plot: Branch AB: Branch AB corresponds to s = jω, ϵ ≤ ω ≤ 1 − ϵ, 177 Figure 6.23: Extended Nyquist contour in the Example 6.5.7 thus we must plot the path followed by G(jω) for ϵ ≤ ω ≤ 1 − ω. We now look at the end points A and B of the arc AB. At the point A have s = ϵj, and from (6.5.26) we get G(ϵj) = (ϵj)2 (1 10 10 ≈ , 2 + (ϵj) )(1 + ϵj) (ϵj)2 and therefore G(ϵj) ≈ − 10 . ϵ2 We denote G(ϵj) by the point à on the extended Nyquist plot shown in Fig. 6.24. At the point B have s = (1 − ϵ)j. From (6.5.26) we have G((1 − ϵ)j) = ((1 − ϵ)j)2 )(1 10 . + ((1 − ϵ)j)2 )(1 + (1 − ϵ)j) Since ϵ is small: ((1 − ϵ)j)2 ≈ j 2 = −1, 178 (1 + (1 − ϵ)j) ≈ (1 + j). It is tempting to put (1 + ((1 − ϵ)j)2 ) ≈ (1 + j 2 ) = 0, but this gives division by zero in the expression for G((1 − ϵ)j), which is an indication that our approximation is not sufficiently accurate. Instead we approximate more precisely as follows: (1 + ((1 − ϵ)j)2 ) = (1 − (1 − ϵ)2 ) = 2ϵ − ϵ2 ≈ 2ϵ, and now we get G((1 − ϵ)j) ≈ 10 5 5 = √ ∠−225 = √ ∠135, (−1)(1 + j)(2ϵ) ϵ 2 ϵ 2 the angles being expressed in degrees. We denote G((1 − ϵ)j) by the point B̃ on the extended Nyquist plot shown in Fig. 6.24. We must now sketch the path followed by G(jω) defined at (6.5.26), when ω varies through the range ϵ ≤ ω ≤ 1 − ϵ. From (6.5.26) we have ∠G(jω) = π − ∠(1 + jω), ϵ≤ω ≤1−ϵ for all and clearly 0 < ∠(1 + jω) < π , 4 ϵ ≤ ω ≤ 1 − ϵ, for all thus 3π < ∠G(jω) < π, for all ϵ ≤ ω ≤ 1 − ϵ. 4 From this it follows in particular that G(jω) stays in the second quadrant when ϵ ≤ ω ≤ 1 − ϵ. Thus, without any detailed calculation, we can sketch the branch ÃB̃ followed by G(jω), as shown in Fig. 6.24. Branch BC: The branch BC corresponds to s = j + ϵ ejθ , − π π ≤θ≤ , 2 2 thus G(s) = (j + ϵ ejθ )2 [1 10 , + (j + ϵ ejθ )2 )][1 + (j + ϵ ejθ )] Since ϵ is small: (j + ϵ ejθ )2 ≈ −1, 179 − π π ≤θ≤ . 2 2 [1 + (j + ϵ ejθ )] ≈ 1 + j, [1 + (j + ϵ ejθ )2 )] = [1 − 1 + 2ϵjejθ + ϵ2 ej2θ ] = 2ϵjejθ + ϵ2 ej2θ ≈ 2ϵjejθ . We therefore have G(s) ≈ 10 , (−1)(1 + j)(2ϵjejθ ) − π π ≤θ≤ , 2 2 that is 5 5 G(s) ≈ √ = √ ∠[45 − θ], ϵ 2∠[180 + 45 + 90 + θ] ϵ 2 −90 ≤ θ ≤ 90, in which all angles are now in degrees. We therefore see that G(s) traces a single semicircular arc √ in a clockwise direction with radius 5/(ϵ 2), ending at the point C̃ which corresponds to θ = 90: 5 G((1 + ϵ)j) = √ ∠−45, ϵ 2 (6.5.27) (angles in degrees). This gives the (semicircular) branch B̃ C̃ in the extended Nyquist plot shown in Fig. 6.24. Branch CD: The branch CD corresponds to ω ≥ 1 + ϵ, s = jω, thus we must plot G(jω) at (6.5.26) for the range ω ≥ 1 + ϵ. This branch begins at C̃, which is given by (6.5.27) when ω = 1 + ϵ. From (6.5.26) it follows that G(jω) = ω 2 (ω 2 10 , − 1)(1 + jω) for all 1 + ϵ ≤ ω < ∞, from which one gets ∠G(jω) = −∠(1 + jω), for all 1 + ϵ ≤ ω < ∞. Since it is clear that π π < ∠(1 + jω) < , 4 2 for all 1 + ϵ ≤ ω < ∞, one sees that π π < ∠G(jω) < − , for all 1 + ϵ ≤ ω < ∞. 2 4 It follows that G(jω) stays in the fourth quadrant for all ω ≥ 1 + ϵ. Finally, as ω → ∞, we see − from (6.5.26) that G(jω) ≈ 180 10 jω 5 and therefore G(jω) tends to the origin at an angle of −90 degrees as ω → ∞. In view of these facts, and without any further calculation, we can sketch the branch C̃ D̃ followed by G(jω), for all ω ≥ 1 + ϵ, as shown in Fig. 6.24. Branch DE: For every s on the infinite-radius branch DE we have |s| = +∞ thus G(s) = 0 for all such s. As usual the infinite-radius branch contributes nothing to the extended Nyquist plot, and G(s) waits at the origin as s traverses branch DE. Branch EF : This gives the branch Ẽ F̃ in the extended Nyquist plot which is the symmetric image around the real axis of the branch C̃ D̃, as shown in Fig. 6.24. In particular F̃ is given by the complex number (with angles in degrees) 5 √ ∠45. ϵ 2 Branch F G: This gives the branch F̃ G̃ in the extended Nyquist plot which is the symmetric image around the real axis of the branch B̃ C̃, as shown in Fig. 6.24. Branch GH: This gives the branch G̃H̃ in the extended Nyquist plot which is the symmetric image around the real axis of the branch ÃB̃, as shown in Fig. 6.24. Branch HA: The branch HA corresponds to s = ϵ ejθ , − π π ≤θ≤ , 2 2 thus G(s) = (ϵ ejθ )2 [1 10 , + (ϵ ejθ )2 )][1 + ϵ ejθ ] − π π ≤θ≤ . 2 2 Since ϵ is small we have 10 ∠−2θ, −90 ≤ θ ≤ 90, ϵ2 all angles being in degrees. It follows from this that G(s) follows two semicircular arcs in a clockwise G(s) ≈ direction with the radius 10/ϵ2 . This amounts to a single circle with radius 10/ϵ2 in a clockwise direction starting at H̃ and ending at Ã, as shown in Fig. 6.24. This completes the extended Nyquist plot G in Fig. 6.24. Remark 6.5.8. In the extended Nyquist plot shown in Fig. 6.24 the branches B̃ C̃ and F̃ G̃ are √ semicircular arcs with radius 5/(ϵ 2), while branch H̃ à is a circle with radius 10/ϵ2 . Since we can 181 Figure 6.24: Extended Nyquist plot in the Example 6.5.7 take ϵ to be as small as we like, we can really regard these branches as having infinite radius, and we shall do this from now on. With this interpretation we see from Fig. 6.24 that the extended Nyquist contour passes through the real axis only at the origin of the complex plane. Consequently, when we apply the extended Nyquist stability criterion (see Theorem 6.5.4) to determine the values of K for closed loop stability we need consider only the cases −(1/K) < 0 and 0 < −(1/K), as in the following table: Range of K wind−1/K G C-L stable/unstable −∞ < −1/K < 0 −2 unstable 0 < −1/K < ∞ unstable −3 In the preceding table the winding numbers are obtained from the extended Nyquist plot G. In 182 view of (6.5.21) we have ν+ (G) = 0, since only the poles of G(s) with strictly positive real parts are counted. The right column of the table is then obtained from Theorem 6.5.4. It follows that the closed loop system is unstable for all values of K. (b) Now K = −1 so that − 1 = 1. K From the extended Nyquist plot we find wind1 G = −3, and then from the extended Nyquist relation (see Theorem 6.5.3) we obtain ν+ (H) = ν+ (G) − wind1 G = 0 + 3 = 3. Remark 6.5.9. In the preceding examples on the use of the Nyquist relation and Nyquist criterion we have seen that it is essential to determine the points at which the Nyquist plot crosses the real axis. In some examples (namely Example 6.4.2, Example 6.5.1 and Example 6.5.7) this could be accomplished on the basis of simple inequalities but without any detailed numerical computations or resort to MATLAB. On the other hand, there are also examples (such as Example 6.4.4 and Example 6.4.6) where it was necessary to use computational tools such as MATLAB in order to determine these points. Needless to say, on tests and examinations we shall be concerned only with problems for which the Nyquist plot can be sketched without any detailed numerical computations. 183 6.6 Bode plots and Nyquist plots In the preceding sections we have seen that one must know the path in the complex plane followed by G(jω), for the range 0 ≤ ω < ∞, in order to sketch the Nyquist plot; this path is the so-called polar plot of the transfer function G(s). The polar plot in turn is most conveniently represented in the form of a Bode plot, also called a frequency domain plot, which actually comprises two separate plots, namely • A magnitude plot of 20 log |G(jω)| against ω, with the angular frequency ω plotted on a logscale (here log is understood to be the logarithm in the base 10). The units of the magnitude plot are decibels (abbreviation dB). • An angular plot of ∠G(jω) against ω, again with the angular frequency ω plotted on a log10 -scale. The units of the angular plot are usually degrees (rather than radians). The magnitude and angular plots are each represented on a semi-log scale, in which the angular frequency ω is plotted using a log10 -scale on the horizontal axis, whereas the corresponding magnitude 20 log |G(jω)| and angle ∠G(jω) are each plotted vertically on a linear (i.e. “normal”) scale. Thus, in Fig. 6.25 one always interprets the horizontal scale as angular frequency ω, the frequency range in Fig. 6.25 being 10−2 ≤ ω ≤ 102 . On the other hand, the vertical scale can be interpreted as giving the magnitude 20 log |G(jω)| or the angle ∠G(jω) at the frequency ω. Thus, suppose that the vertical scale represents decibels (dB) on which the magnitude 20 log |G(jω)| is plotted. Then the point A corresponds to ω = 10−1 rads/sec., 20 log |G(jω)| = 40 dB, the point B corresponds to ω = 2 × 10−1 rads/sec., 20 log |G(jω)| = 30 dB, the point C corresponds to ω = 5 × 10−1 rads/sec., 20 log |G(jω)| = 20 dB, the point D corresponds to 20 log |G(jω)| = −20 dB, ω = 7 rads/sec., 184 Figure 6.25: Semi-log representation and the point E corresponds to 20 log |G(jω)| = −40 dB. ω = 30 rads/sec., Likewise, if the vertical scale represents degrees on which the angle ∠G(jω) is plotted then point A corresponds to ω = 10−1 rads/sec., ∠G(jω) = 40 degrees, point B corresponds to ω = 2 × 10−1 rads/sec., ∠G(jω) = 30 degrees, and so on. Typically one wants G(jω) over a broad frequency range (potentially 0 ≤ ω < ∞ when drawing a polar plot); the reason for the log10 -scale for frequency is of course to pack a wide frequency range into the width of a piece of graph paper. Fig. 6.25 gives a four-decade frequency 185 range, so-called because the ratio of the highest to the lowest frequency is 102 = 104 . 10−2 For some applications, where very low frequencies are important, one might want for example the frequency range 10−3 ≤ ω ≤ 102 , and for this one would need a graph with a five-decade frequency range. The Bode plot of a given system with transfer function G(s) is typically arrived at in one of two possible ways: (a) If G(s) is known as a rational function of the complex variable s then one can compute the complex number G(jω) over a wide frequency range and make two separate plots, namely the magnitude 20 log |G(jω)| versus ω, and the angle ∠G(jω) versus ω, with ω plotted on a log10 -scale in each case. In practice one would actually use a program such as MATLAB, into which one enters the transfer function G(s); the program then does all the necessary computations and produces a Bode plot on a specified frequency range (see Example 6.6.1 which follows). (b) When the system is too complex to represent G(s) by a simple ratio of polynomials (as in the case of an aircraft wing discussed in Section 6.1) one can instead make direct frequency response measurements of |G(jω)| and ∠G(jω) over a wide range of frequencies ω, and then make separate magnitude and angular plots from the measurements to get the Bode plot. Example 6.6.1. One is given the transfer function G(s) = 30(s + 1) , (s − 1)(s2 + s + 20) and must construct a Bode plot of the transfer function over the stipulated frequency range 10−2 ≤ ω ≤ 102 . Manually calculating G(jω) for ω over such a wide frequency range would of course be quite arduous. Fortunately the MATLAB program does all the necessary computations and gives the Bode plots shown in Fig. 6.26. From this Bode plot we can read off, for example, the following data: at ω = 5 × 10−1 we have 20 log |G(jω)| = 4 dB and ∠G(jω) = −130 degrees (see points A and B on Fig. 6.26), and at ω = 4 we have 20 log |G(jω)| = 16 dB 186 and ∠G(jω) = −80 degrees Figure 6.26: Bode plot for the Example 6.6.1 (see points C and D on Fig. 6.26). By converting out of the log10 -scale we can then determine the magnitude |G(jω)|, and therefore the entire complex number G(jω) = |G(jω)| ∠G(jω), for the above values of ω, and indeed for all ω in the range 10−2 ≤ ω ≤ 102 . This in turn gives the polar plot of G(jω) for ω in the range 10−2 ≤ ω ≤ 102 . Example 6.6.1 shows that one can easily transition from the Bode plot of a transfer function to the corresponding polar plot. Of course, one can also transition in the opposite direction, namely from a given polar plot to the Bode plot, as sketched in Fig. 6.27, in which the first plot is the polar plot, and the second and third plots comprise the magnitude and angular parts of the corresponding Bode plot. Typically however, one usually begins with the Bode plot and uses this to construct the polar plot, which is of course the most important single ingredient in the Nyquist plot. The Bode plot is particularly useful for representing the polar plot over a wide frequency range (because the 187 Figure 6.27: Bode plot and polar plot frequency ω is plotted on a log-scale). Such wide-spectrum data is often necessary in applications of the Nyquist stability criterion, even for relatively simple transfer functions G(s), as the next Example 6.6.2 demonstrates: Example 6.6.2. For the standard closed loop system in Fig. 6.1 the transfer function G(s) is (6.6.28) G(s) = (s + 50)2 , (s + 1)(s + 2)(s + 5)(s + 500) (this is a reduced-order model of a jet engine). Determine the values of K for closed loop stability. For this transfer function one cannot simply sketch the Nyquist plot without detailed numerical computation of G(jω) over a range of frequencies ω, as has been possible with some of the simpler examples seen previously. We shall therefore use MATLAB to generate the Nyquist plot of G(s), as shown in Fig. 6.28. Notice that one cannot clearly discern from this figure the form of the Nyquist 188 Figure 6.28: Nyquist plot of G(s) defined by (6.6.28) plot near the origin s = 0 of the complex plane, but there appears to be crossing of the real axis near the origin, at very high frequencies, which will affect the winding number wind−1/K G when −1/K is near to the origin. Use of the “zoom” facility in MATLAB does not yield very useful information on the situation near the origin. We shall therefore instead use MATLAB to generate the Bode plot of G(s) as shown in Fig. 6.29, and sketch the Nyquist plot based on the Bode plot. As preliminary information, from (6.6.28) we know that 1 G(j0) = ∠0, 2 and, for large ω, 1 , ω2 that is, G(jω) tends to the origin s = 0 along the negative real axis as ω → ∞. We now use the G(jω) ≈ − 189 Figure 6.29: Bode plot of G(s) defined by (6.6.28) Bode angular plot at Fig. 6.29 to determine all frequencies ω such that ∠G(jω) = mπ for some integer m, for it is at such frequencies ω that G(jω) (and therefore the Nyquist plot) crosses the real axis. From the angular plot at Fig. 6.29 one sees that these frequencies are at points A and C, that is ω1 = 4.9 rads per sec ω2 = 45 rads per sec, and ∠G(jω1 ) = ∠G(jω1 ) = −π. From the magnitude plot at Fig. 6.29 we find (see the point B) 20 log |G(jω1 )| = −31 decibels, 190 that is |G(jω1 )| = 0.028. Similarly, again from the magnitude plot at Fig. 6.29 we find (see the point D) 20 log |G(jω2 )| = −80 decibels, that is |G(jω2 )| = 10−4 . We therefore have G(jω2 ) = −10−4 . G(jω1 ) = −0.028, Based on the above information we can sketch the Nyquist plot of G(s). Since G(s) has no poles or zeros on the imaginary axis the Nyquist contour is shown at Fig. 6.11, and therefore the Nyquist plot of G(s) is shown in the following Fig. 6.30. This figure is definitely not to scale, but nevertheless gives significantly more information than the Nyquist plot at Fig. 6.28, and in particular tells us exactly what is happening near to the origin s = 0. In particular, we can use the sketched Nyquist plot in Fig. 6.30 to determine the values of K for closed loop stability. From (6.6.28) one has ν+ (G) = 0, and therefore, from the Nyquist stability criterion (Theorem 6.5.4) we obtain the following table: Range of K wind−1/K G C-L stable/unstable −∞ < −1/K < −0.028 0 stable −0.028 < −1/K < −10−4 −2 unstable 0 stable 0 < −1/K < 1/2 −1 unstable 1/2 < −1/K < ∞ 0 stable −4 −10 < −1/K < 0 We see that the closed loop system is stable when K is such that any of the following holds: −∞ < −1/K < −0.028, −10−4 < −1/K < 0, 1/2 < −1/K < ∞, that is when K is such that any of the following holds: 0 < K < 35.71, K > 104 , 191 −2 < K < 0. Figure 6.30: More accurate Nyquist plot of G(s) defined by (6.6.28) Remark 6.6.3. Example 6.6.2 illustrates that it is often useful to first determine the Bode plot of a transfer function G(s) as a half-way house to getting the Nyquist plot. This is particularly true when an accurate sketch of the Nyquist plot requires that one know G(jω) over a wide frequency range, since Bode plots can represent information over wide frequency ranges (because ω is plotted on a log-scale). In the present example the need for a wide range of frequencies arises because of the “spread” of the poles of G(s) (from s = −1 to s = −500). This sort of spread is quite common in practical systems. 192 Chapter 7 Compensator design In the present chapter we address the simplest aspects of the design of controllers (also called compensators) in the frequency domain. Our main conceptual tool will be the frequency domain viewpoint and Nyquist stability analysis established in Chapter 6. Specifically, we shall introduce two frequency domain parameters associated with a given transfer function G(s), namely the gain margin and the phase margin. With reference to the standard closed loop system in Fig. Figure 7.1: Standard closed loop system 7.1, it will be seen shortly that these frequency domain parameters give an indication of just how “near” to instability the closed loop system is when K = 1. In particular, a small value of the gain margin of G(s) indicates that the closed loop system with K = 1 is “near” to being unstable (an unsafe and undesirable condition), whereas a large value of the gain margin of G(s) means that the closed loop system with K = 1 is a “long way” from being unstable (a safe and desirable condition). Similar comments apply to the phase margin. In addition, as we shall see in the discussion of Remark 7.1.6, a small phase margin carries the risk that stability criteria (such as the Nyquist criterion of 193 Chapter 6), when applied to approximate mathematical models of a complex system, can lead to incorrect conclusions in regard to closed loop stability. As such, small phase margin is very much a condition to be avoided. With this in mind, the principal objective of this chapter can be formulated as follows: we are given a transfer function G(s) which has a small phase margin, and must design a compensator with transfer function Gcp (s), such that the series combination Gcp (s)G(s) has a (larger) specified phase margin. We shall see that there are two possible compensator designs for attaining this goal, namely lag compensators and lead compensators, each with their own advantages and drawbacks. 7.1 Gain and phase margins In this section we focus on the standard closed loop system in Fig. 7.1, in which K is an adjustable gain constant and G(s) is a proper rational function: (7.1.1) G(s) = N (s) D(s) m = deg(N ) ≤ deg(D) = n. with The following basic result holds: Suppose that the closed loop system in Fig. 7.1 is stable when K = 1. Then (7.1.2) there is some r > 1 such that the closed loop system is stable for all 1 ≤ K < r. In short, if the closed loop system is stable when K = 1, then we can always increase K beyond K = 1 (perhaps only slightly!) such that the closed loop system remains stable at this larger value of K. To see why this should be true let pi , i = 1, 2, . . . , n, be the closed loop poles, that is the roots of the denominator polynomial ∆(s) = D(s) + KN (s), (some of these roots may of course be repeated). As K is adjusted these roots will generally change, that is the roots pi depend on K, and are therefore functions of K, which will be written as pi (K), i = 1, 2, . . . , n. Since the closed loop system is assumed to be stable when K = 1 we know that re{pi (1)} < 0, i = 1, 2, . . . , n. 194 Now it is a basic fact of mathematics that the roots pi (K) of ∆(s) are continuous functions of K, that is a small change in K causes only a correspondingly small change in each of the roots pi (K). It follows that re{pi (K)} < 0, i = 1, 2, . . . , n, for all K close enough to K = 1, and in particular one sees from this that we can find a number r > 1 such that re{pi (K)} < 0, i = 1, 2, . . . , n, for all 1 ≤ K < r, that is the closed loop system is stable for all 1 ≤ K < r. This establishes (7.1.2). In light of this basic fact we can formulate the following: Definition 7.1.1. (gain margin of G(s)) Suppose that the closed loop system in Fig. 7.1 is stable when K = 1. Then the gain margin of the transfer function G(s), denoted by γm (G), is that number r > 1 such that the closed loop system is stable for all 1 ≤ K < r but unstable when K = r. If the closed loop system is unstable when K = 1 then the gain margin of G(s) is undefined (i.e. does not make sense). In this definition it may be the case that the closed loop system is stable for all K ≥ 1. In this case we define the gain margin of G(s) by γm (G) = +∞. Remark 7.1.2. The gain margin γm (G) is the amount by which the gain K in Fig. 7.1 can be increased beyond K = 1 until the closed loop system goes unstable (provided that the closed loop system is stable when K = 1). When the gain margin γm (G) is large then the closed loop system in Fig. 7.1 is “safely stable” when K = 1 because a lot of gain K can be inserted in series with G(s) before the closed loop system becomes unstable; on the other hand, when γm (G) is small then the closed loop system is not as safely stable when K = 1 because much less gain can be inserted in series with G(s) before closed loop instability results. The gain margin is easily determined from the polar plot of G(s), as the following examples demonstrate: Example 7.1.3. For the standard closed loop system in Fig. 7.1 the transfer function G(s) is stable, and the polar plot of G(s) (i.e. the path in the complex plane followed by G(jω) as ω 195 Figure 7.2: Polar plot of G(s) in Example 7.1.3 increased from ω = 0 through to ω → ∞) is the curve ABCDO shown in Fig. 7.2. Determine whether or not the gain margin γm (G) is defined, and determine the gain margin if it is defined. Since G(s) is stable it cannot have any poles on the imaginary axis, and one gets the full Nyquist plot G by sketching the symmetric image of ABCDO around the real axis, as shown in Fig. 7.2. Furthermore, again by the stability of G(s), one has ν+ (G) = 0. From Fig. 7.2 one obtains wind−1 G = 0, wind−1/K G = ν+ (G) thus when K = 1. It then follows from the Nyquist criterion that the closed loop system is stable when K = 1, and thus the gain margin γm (G) is defined. Now as K increases beyond K = 1 one sees that −1/K moves away from −1 to the right along the real axis, and the closed loop system remains stable until 1 1 =− , K 3 when the closed loop system becomes unstable. i.e. the closed loop system is stable for all 1 ≤ K < 3 − and is unstable when K = 3. We conclude that the gain margin of G(s) is γm (G) = 3. For the remainder of this chapter we suppose that G(s) is strictly proper that is (recall (7.1.1)) deg(N ) < deg(D). 196 It then follows that |G(jω)| → 0 as ω → ∞, and therefore there is some frequency ωc (called the gain crossover frequency of G(s)) such that |G(jωc ) = 1 and |G(jω) < 1 for all ω > ωc . That is, ωc is the frequency at which the polar plot of G(s) enters the unit disc centered at the origin s = 0 and stays inside the unit disc for all ω > ωc . See Fig. 7.3 (in which ω1 fails to be the gain crossover frequency, since G(jω) leaves the unit disc for some ω2 > ω1 ). With the gain Figure 7.3: Gain crossover frequency ωc crossover frequency ωc understood one can now formulate the following: Definition 7.1.4. Suppose that the closed loop system in Fig. 7.1 is stable when K = 1 and G(s) is strictly proper. Then the phase margin of the transfer function G(s), denoted by ϕm (G), is the angle between the negative real axis and the vector G(jωc ) (see Fig. 7.3), equivalently ϕm (G) = π + ∠G(jωc ), (since angles are measured modulo 2π radians or 360 degrees). If the closed loop system is unstable when K = 1 then the phase margin is undefined (i.e. does not make sense). 197 Remark 7.1.5. When the phase margin ϕm (G) is small then it is immediate from Definition 7.1.4 and Fig. 7.3 that the polar plot of G(s) passes near to the point −1. Remark 7.1.6. We have seen at Remark 7.1.2 that a small gain margin indicates a closed loop system which is “close” to instability, a condition which is clearly undesirable and to be avoided. In this remark we shall discuss some of the problems associated with small phase margin, and see why a small phase margin should also be avoided. Suppose that the transfer function G(s) in Fig. 7.1 is a stable transfer function which represents a system of such complexity that we do not have precise knowledge of the numerator and denominator polynomials of G(s). Since G(s) is stable we nevertheless do know that G(s) does not have poles on the imaginary axis and ν+ (G) = 0 (recall (6.3.17)). In a situation of this kind one usually builds a simplified mathematical model which approximates Figure 7.4: Model closed loop system the complex system. We then obtain from this simplified mathematical model a “model” transfer function Ḡ(s) which approximates the actual (but unknown) transfer function G(s). Since G(s) is stable one should certainly make sure that the simplified mathematical model is such that the resulting transfer function Ḡ(s) is also stable, and we assume that this is the case. It follows that there are no poles of Ḡ(s) in the imaginary axis, and ν+ (Ḡ) = 0. One certainly expects that the closed loop system in Fig. 7.4, based on the simplified transfer function Ḡ(s), is an accurate representation of the closed loop system in Fig. 7.1, which is based on the actual (but unknown) transfer function G(s), since we can only do our analysis and design using the closed loop system in Fig. 7.4 with the known transfer function Ḡ(s). In particular, if the closed loop system in Fig. 7.4 is stable for some designated value of K, then one expects that the 198 Figure 7.5: Polar plots of G(s) and Ḡ(s) closed loop system in Fig. 7.1 should likewise be stable for the same value of K. We are now going to see that this is not necessarily the case when the phase margin of the (known) model transfer function Ḡ(s) is small. Assuming that ϕm (Ḡ) is small, one sees from Remark 7.1.5 that the polar plot of Ḡ(s) passes near to the point −1, as shown in Fig. 7.5. Since the model transfer function Ḡ(s) approximates the actual transfer function G(s) the polar plots of these transfer functions should be “close”, as shown in Fig. 7.5. We now draw the Nyquist plots Ḡ and G, for the transfer functions Ḡ(s) and G(s) respectively, in Fig. 7.6 (this is just a matter of drawing the symmetric image of each polar plot around the real axis). From Fig. 7.6 one sees in particular that wind−1 G = −2, thus wind−1 G = ̸ ν+ (G) = 0, and wind−1 Ḡ = 0, wind−1 Ḡ = ν+ (Ḡ) = 0. thus From the Nyquist criterion one sees that the actual closed loop system, with the transfer function G(s), is unstable when K = 1, whereas the model closed loop system, based on the approximating transfer function Ḡ(s), is stable when K = 1. We therefore get unreliable information about closed loop stability based on the model transfer function, a most unacceptable state of affairs! The source of the problem of course is that the small phase margin of Ḡ(s) means that the point −1 can be on opposite sides of the polar plots for Ḡ(s) and G(s) (as shown in Fig 7.5), even when Ḡ(s) 199 Figure 7.6: Nyquist plots Ḡ(s) and G(s) Figure 7.7: Larger phase margin for Ḡ(s) is a good approximation of G(s), resulting in different winding numbers around −1 for the two Nyquist plots. On the other hand, if the phase margin of Ḡ(s) is large, then one readily sees from Fig. 7.7 that this sort of undesirable behaviour is much less likely. This discussion shows that the phase margin is an essential parameter when it comes to using simplified mathematical models for complex systems. In the following sections we shall study the design of compensators which enable one to increase the phase margin of a transfer function. To this end we recall the idea of the bandwidth (more precisely the −3 dB-bandwidth) of a transfer function G(s). Bandwidth is determined from the magnitude plot of the Bode plot of G(s), and defined as that frequency ωB such that 20 log |G(jωB )| = 20 log |G(0)|−3, and 20 log |G(jω)| > 20 log |G(0)|−3 200 for all 0 ≤ ω < ωB , that is, ωB is the first frequency at which the magnitude plot of G(s) decreases to 3 decibels less than the value at ω = 0 (see Fig. 7.8). Note in particular that Figure 7.8: Bandwidth of G(s) |G(jωB )| = |G(0)| √ , 2 √ (since 20 log( 2) = 3). In practical terms a transfer function G(s) with a narrow bandwidth (i.e. Figure 7.9: Narrow and wide bandwidth small ωB ) has a slow step response, while a transfer function with a wide bandwidth (large ωB ) has a fast step response, often with overshoot, as shown in Fig. 7.9. Alternative notation for the bandwidth ωB of G(s) is BW(G). 201 7.2 Lag and lead compensators - preliminary properties Our goal is to address the following problem. We are given a transfer function G(s) for which the phase margin ϕm (G) is small. We must “design” a transfer function Gcp (s), called a compensator, such that ϕm (Gcp G), the phase margin of the series combination of Gcp (s) and G(s), attains a specified value larger than ϕm (G), the phase margin of G(s). The compensator transfer function is of the following form: (7.2.3) Gcp (s) = 1 + s/a , 1 + s/b in which a and b are real constants, and the process of “design” is really a matter of determining values for the constants a and b such that ϕm (Gcp G) attains the specified value ψ. Furthermore, (7.2.4) Gcp (s) is a phase lag compensator when a > b > 0, and (7.2.5) Gcp (s) is a phase lead compensator when b > a > 0. We shall now establish some preliminary properties of lag and lead compensators. Phase lag compensator: In this case (7.2.4) holds. The polar plot of Gcp (s) is shown at Fig. 7.10. One easily sees that Gcp (jω) traces out a semicircular arc ADB in the fourth quadrant of the complex plane, for ω in the range 0 ≤ ω < ∞, with 1 b centre = 1+ , 2 a 1 radius = 2 b 1− . a The Bode plot of Gcp (s) has the form shown at Fig. 7.11. One sees from Fig. 7.11 that there is a frequency of maximum phase lag ω̂, and note that Gcp (j ω̂) corresponds to the point D in Fig. 7.10. Furthermore, by solving for ω in the equation d∠Gcp (jω) = 0, dω it is easy although tedious to show that the frequency of maximum phase lag is given by √ (7.2.6) ω̂ = ab. From the Pythagoras theorem applied to the right-triangle OCD in Fig. 7.10 one finds r b (7.2.7) |Gcp (j ω̂)| = OD = , a 202 Figure 7.10: Polar plot of lag compensator Gcp (s) and the angle ϕ̂ of maximum phase lag is given by 1 − b/a (7.2.8) sin(ϕ̂) = . 1 + b/a We usually put (7.2.9) a α= (thus α > 1), b 1 |Gcp (j ω̂)| = √ , α sin(ϕ̂) = α−1 α+1 . Phase lead compensator: In this case (7.2.5) holds. The polar plot of Gcp (s) is shown at Fig. 7.12. Then Gcp (jω) traces out a semicircle ACB in the first quadrant of the complex plane, for ω in the range 0 ≤ ω < ∞, with 1 centre = 2 b +1 , a 1 radius = 2 b −1 . a The Bode plot of Gcp (s) is shown at Fig. 7.13. Exactly as in the case of the lag compensator one sees that the frequency ω̂ of maximum phase lear is again √ (7.2.10) ω̂ = ab. From the right-triangle OCD in Fig. 7.12 one sees that the angle ϕ̂ of maximum phase displacement is given by (7.2.11) CD sin(ϕ̂) = = OD b/a − 1 b/a + 1 . Moreover, again from the right-triangle OCD in Fig. 7.12 and the Pythagoras theorem: r b (7.2.12) |Gcp (j ω̂)| = OC = . a 203 Figure 7.11: Bode plot of lag compensator Gcp (s) Remark 7.2.1. The terminology phase lag compensator and phase lead compensator is immediately apparent from the phase plots at Fig. 7.11 for the phase lag case, and at Fig. 7.13 for the phase lead case. 7.3 Design of a lag compensator We are given a transfer function G(s) for which the phase margin ϕm (G) is small. In this section we shall establish a method for designing a lag compensator Gcp (s) such that the phase margin ϕm (Gcp G) of the series combination of G(s) and Gcp (s) attains a specified value ψ which is larger than ϕm (G): ϕm (Gcp G) = ψ > ϕm (G). This is a matter of “designing” constants a and b in the transfer function Gcp (s) at (7.2.3) with a > b > 0. With reference to Fig. 7.14 we have drawn the polar plot of G(s) indicating the gain crossover frequency ωc and phase margin ϕm (G). Draw the straight line ray OC which makes an angle of ψ with the negative real axis as shown, and read off the frequency ωmod such that (7.3.13) ∠G(jωmod ) = ψ + π, (see the point B in Fig. 7.14). Now suppose that the constants a and b in (7.2.3) are such that 204 Figure 7.12: Polar plot of lead compensator Gcp (s) a > b > 0 (for the lag case) and such that the following two conditions hold: (7.3.14) |Gcp (jωmod )G(jωmod )| = 1, (7.3.15) ∠{Gcp (jωmod )G(jωmod )} = ψ + π. Essentially (7.3.14) and (7.3.15) tell us that the polar plot of the series transfer function Gcp G(s) passes through the point A in Fig. 7.14 at the frequency ω = ωmod , so that ωmod is the gain crossover frequency of the series combination Gcp G(s), and therefore, from Definition 7.1.4 (applied to the transfer function Gcp G(s)) we get (7.3.16) ϕm (Gcp G) = ψ, as required. Thus it remains to determine (or “design”) constants a and b in (7.2.3) such that a > b > 0 (for the lag case) and such that and design the lag compensator Gcp (s) such that (7.3.14) and (7.3.15) hold. To this end put α = |G(jωmod )|. (7.3.17) Now the point B in Fig. 7.14 is the complex number G(jωmod ), and since B is outside the unit-disc centered on s = 0 we have (7.3.18) α > 1. Next, fix any frequency a which is very much less than ωmod : (7.3.19) 0 < a ≪ ωmod , e.g. a= 205 ωmod 10 is a typical choice, Figure 7.13: Bode plot of lead compensator Gcp (s) and then put (7.3.20) b= a , α so that a > b > 0 (see (7.3.18)). It follows that we have a lag compensator (see (7.2.4)), and it remains to verify that that (7.3.14) and (7.3.15) hold for these values of a and b. At Fig. (7.15) we have sketched the Bode plots for the lag transfer function Gcp (s) given by (7.2.3), with ωmod displayed. In view of (7.3.19), that is ωmod is much greater than a, one sees from the Fig. (7.15) that the following approximations hold: (7.3.21) b |Gcp (jωmod )| = , a ∠Gcp (jωmod ) = 0. Then, from (7.3.21) and (7.3.13), we get ∠{Gcp (jωmod )G(jωmod )} = ∠Gcp (jωmod ) + ∠G(jωmod ) = 0 + ψ + π, which is (7.3.15). It remains to verify that (7.3.14) holds. We have b |Gcp (jωmod )G(jωmod )| = |Gcp (jωmod )||G(jωmod )| = α = 1, a where we have used (7.3.21) and (7.3.17) at the second equality, and have used (7.3.20) at the third equality. This verifies (7.3.14). In light of the preceding we can design the lag compensator using the following two steps: 206 Figure 7.14: Frequency ωmod Step 1: From the angular Bode plot of the transfer function G(s) read off that frequency ωmod such that (see (7.3.13)) ∠G(jωmod ) = ψ + π. Step 2: From the magnitude Bode plot of G(s) read off the magnitude |G(jωmod )| and define α = |G(jωmod )|, a= ωmod , 10 b= a . α In this way we obtain constants a and b for a lag compensator Gcp (s) (since a > b > 0 in view of (7.3.18)) such that ϕm (Gcp G) = ψ, as was required. Remark 7.3.1. We have established a simple and effective two-step method for improving the phase margin of a given transfer function G(s). One should be aware, however, that this method comes at a price, namely a possibly significant reduction in bandwidth. This is apparent from Fig. 7.16, in which we have superimposed the Bode magnitude plots for the transfer functions G(s) and Gcp (s). The resulting magnitude plot of the series combination Gcp G(s) is then the sum of the magnitude plots for Gcp (s) and G(s). We see that the bandwidth BW(Gcp G) of Gcp G(s) is less than the bandwidth BW(G) of G(s). Whether or not this reduction in bandwidth is acceptable really depends on the application. For example, in the control of a chemical plant in chemical 207 Figure 7.15: Bode plot of lag compensator with ωmod indicated engineering, it is often the case that the plant reacts extremely slowly anyway, and the slowdown in step response resulting from a reduction in bandwidth hardly matters. In this case an improvement in phase margin by means of a lag compensator is quite likely acceptable. On the other hand, in applications to aerospace, where one typically requires rapid response to step inputs, the loss in bandwidth (and consequent slow-down in the step response) resulting from the use of a lag compensator may not be acceptable, and one would have to resort to phase lead compensation. This will be examined in the next section. 208 Figure 7.16: Bandwidths BW(G) and BW(Gcp G) for phase lag Gcp (s) Example 7.3.2. Determine the phase margin ϕm (G) of the transfer function 40 . + s + 40 Then design a phase lag compensator Gcp (s) such that (7.3.22) G(s) = s2 ϕm (Gcp G) = 40 + ϕm (G), (here the angles are in degrees). Determine the actual phase margin ϕm (Gcp G) and check the bandwidths of G(s) and Gcp G(s). From MATLAB one obtains the Bode plot of G(s) shown in Fig. 7.17. To determine the gain crossover frequency of G(s) read off the frequency ωc such that |G(jωc )| = 1, i.e. 20 log |G(jωc )| = 0, and 20 log |G(jω)| < 0 for all ω > ωc . From the magnitude Bode plot of G (see point D in Fig. 7.17) one finds that ωc = 8.8 rads/sec, which is the gain crossover frequency. From the angular Bode plot of G (see point A in Fig. 7.17) one sees ∠G(jωc ) = −168 deg, 209 Figure 7.17: Bode plot of G(s) defined by (7.3.22) thus the phase margin of G(s) is ϕm (G) = 180 + ∠G(jωc ) = 12 deg. We must design a phase lag compensator Gcp (s) such that the phase margin ϕm (Gcp G) of the series transfer function Gcp G(s) attains the specified value ψ = 40 + ϕm (G) = 52 deg. From Step 1 we must determine frequency ωmod such that ∠G(jωmod ) = ψ + 180 = 232 deg = −128 deg. 210 From the angular Bode plot of G (see point B in Fig. 7.17) we get ωmod = 6.5 rads/sec. This completes Step 1. As for Step 2, from the magnitude Bode plot of G (note point C in Fig. 7.17), one sees that 20 log |G(jωmod )| = 14 dB, and therefore α = |G(jωmod )| = 5. Then ωmod = 0.65, 10 so that the phase lag compensator is a= (7.3.23) Gcp (s) = b= a = 0.13, α 1 + s/a 1 + 1.54s = . 1 + s/b 1 + 7.7s Now check the validity of the design. From MATLAB we obtain the Bode plot of the series transfer function Gcp G shown in Fig. 7.18. From this Bode plot we determine the actual value of ϕm (Gcp G). First read off the gain crossover frequency ωc of the transfer function Gcp G, that is the frequency ωc such that 20 log |Gcp G(jωc )| = 0, 20 log |Gcp G(jω)| < 0 for all ω > ωc . and From the magnitude Bode plot of Gcp G(s) (see point A in Fig. 7.18) we find that the gain crossover frequency of Gcp G is ωc = 6.5 rads/sec, and from the angular Bode plot of Gcp G(s) (see point B in Fig. 7.18) we find ∠Gcp G(jωc ) = −128 deg, thus ϕm (Gcp G) = 180 + ∠Gcp G(jωc ) = 52 deg . The designed and actual phase margins are identical! As for the bandwidths, from point E on Fig. 7.17 one sees that BW(G) = 10 rads/sec, 211 Figure 7.18: Bode plot of Gcp G(s) defined by (7.3.22) and (7.3.23) and from point C on Fig. 7.18 one sees that BW(Gcp G) = 0.13 rads/sec. The seemingly drastic reduction in bandwidth is actually quite misleading. In fact the magnitude plot of Gcp G(s) levels out quite rapidly, and as a result the step response will not be as slow as suggested by the large reduction in the somewhat arbitrary −3dB-bandwidth. For many applications in which speed of response is not of paramount importance this design is quite acceptable. Remark 7.3.3. Suppose that the transfer function G(s) is such that the closed loop system in Fig. 7.19(i) is stable but the phase margin ϕm (G) is small. At Remark 7.1.6 we have discussed why this 212 is to be avoided, and accordingly we design a lag compensator Gcp (s) to improve the phase margin in the sense that ϕm (Gcp G) > ϕm (G). With Gcp (s) in series with G(s) we get the closed loop system in Fig. 7.19(ii). One can reasonably Figure 7.19: Lag compensation in closed loop ask how the tracking properties of the closed loop systems (i) and (ii) in Fig. 7.19 compare, a point which we now discuss. Throughout this discussion we shall assume that both of the closed loop systems (i) and (ii) in Fig. 7.19 are stable so that the notion of tracking makes sense in each case. From (7.2.3) one sees that the lag transfer function Gcp (s) has neither poles nor zeros at the origin s = 0, and therefore type{Gcp G} = type{G} . Then, in view of Theorem 4.4.1(a), one sees that the closed loop system in Fig. 7.19(i) tracks step inputs if and only if the closed loop system in Fig. 7.19(ii) tracks step inputs, and in this case type{Gcp G} = type{G} ≥ 1. In exactly the same way, from Theorem 4.4.1(b), the closed loop system in Fig. 7.19(i) tracks ramp inputs if and only if the closed loop system in Fig. 7.19(ii) tracks ramp inputs, and in this case type{Gcp G} = type{G} ≥ 2. 213 Thus the ability to track step and ramp inputs is unaffected by the use of lag compensation, but the closed loop system in Fig. 7.19(ii) has the definite advantage of being “safer” (from the point of view of stability) than the closed loop system in Fig. 7.19(i). Now suppose that type{G} = 0, so that type{Gcp G} = 0. Then we know from Theorem 4.4.4(a) that the closed loop system in Fig. 7.19(i) cannot track step inputs, but for a unit step input will have a steady state tracking error 1 1 + Kp ess = in which Kp = G(0). That is, for the system in Fig. 7.19(i), the steady state tracking error for a unit step input is (7.3.24) ess = 1 . 1 + G(0) Similarly, the system in Fig. 7.19(ii) cannot track step inputs but will have the steady state tracking error ess = 1 1 + Kp in which Kp = Gcp (0)G(0). That is, for the system in Fig. 7.19(ii), the steady state tracking error for a unit step input is (7.3.25) ess = 1 . 1 + Gcp (0)G(0) But, from (7.2.3), one has Gcp (0) = 1, thus G(0) = Gcp G(0), so it follows from (7.3.25) and (7.3.24) that the closed loop systems (i) and (ii) in Fig. 7.19 have identical steady state tracking errors for a unit step input when type{G} = 0. Similar reasoning holds for unit ramp inputs when type{G} = 1, so that type{Gcp G} = 1. Since it is clear from (7.2.3) that Kv = sG(s)|s=0 = sGcp (s)G(s)|s=0 , it follows from Theorem 4.4.4(b) that the closed loop systems (i) and (ii) in Fig. 7.19 have identical steady state tracking errors for a unit ramp input when type{G} = 1. We conclude from this that tracking properties are completely unaffected by the insertion of phase lag compensation in the forward path of the closed loop. 214 Example 7.3.4. In this example the transfer function P (s) models a physical plant, and is strictly proper with type{P (s)} = 0. In the closed loop system of Fig. 7.20 the transfer function C(s) is a controller having the form C(s) = KGcp (s), Gcp (s) = 1 + s/a , 1 + s/b with a > b > 0, in which K is an adjustable gain. The controller C(s) is thus the series combination of K and a phase lag compensator Gcp (s). The goal is to design a controller C(s) of the above form such that Figure 7.20: Closed loop system in the Example 7.3.4 the following design objectives are met: • (1) the closed loop system has a steady state tracking error of ess = 0.2 for a unit step input; • (2) for a given angle ρ one has ϕm (CP ) = ρ + ϕm (P ), that is the phase margin must be increased by the specified angle ρ; • (3) the closed loop system must be stable! That is, we must determine a value for the constant K, as well as constants a > b > 0 in the phase lag compensator Gcp (s) such that the above design objectives are met. In this example we briefly indicate the main elements in the design process without going into details. Put M (s) = C(s)P (s) = KGcp (s)P (s), so that the closed loop system in Fig. 7.20 is the same as that shown in Fig. 7.21. Now we have that type{M (s)} = type{P (s)} = 0. 215 Figure 7.21: Closed loop system in the Example 7.3.4 It then follows from Theorem 4.4.4(a) that the steady state tracking error of the closed loop system for a unit step input is ess = 1 . 1 + M (0) Now M (0) = C(0)P (0) = KGcp (0)P (0) = KP (0), so that we must have 1 = 0.2. 1 + KP (0) Solving this equation one sees that the gain K must have the value K∗ = (7.3.26) 4 , P (0) in order to attain the design specification (1). It remains to design the phase lag compensator Gcp (s). To this end we first determine ϕm (P ) from a Bode plot of P (s), so that we can calculate the desired phase margin ψ = ρ + ϕm (P ), in the design specification (2). Now put G(s) = K ∗ P (s), so that C(s)P (s) = Gcp (s)G(s). Then item (2) demands that we design the phase lag compensator Gcp (s) to attain the phase margin ϕm (Gcp G) = ψ. 216 For this we follow Step 1 and Step 2 above using the Bode plot for the transfer function G(s) = K ∗ P (s); note that we do not use the Bode plot for the plant P (s) itself when we design Gcp (s)! This completes the design of the controller C(s). Finally, as the last but most important step, we must check that the closed loop system in Fig. 7.20 is stable for the controller C(s) which we have designed. If the closed loop system is in fact unstable then we must relax the specifications on steady state error and/or the improvement in phase margin and repeat the design. Remark 7.3.5. The term “phase lag compensator” is somewhat inconsistently used in the literature. In these notes a phase lag compensator has the transfer function given by (7.2.3) and (7.2.4). However, one commonly finds that the following transfer function, which includes a gain K, is also referred to as a phase lag compensator (this is just the controller C(s) in Example 7.3.4): 1 + s/a Gcp (s) = K , with a > b > 0. 1 + s/b Be prepared for this alternative terminology when reading books and lab. manuals. 7.4 Design of a lead compensator In the previous section we have seen how to design a phase lag compensator Gcp (s) which improves the phase margin of a given transfer function G(s). One side-effect of phase lag design is that the bandwidth of Gcp G(s) is less than the bandwidth of G(s). For some applications, in which speed of response is particularly important, this reduction in bandwidth may not be acceptable. In the present section we present a method for designing a phase lead compensator Gcp (s) with the same goal as before, namely to improve the phase margin of a given transfer function G(s), with the specific goal that ϕm (Gcp G) = ψ > ϕm (G), in which ψ is a stipulated phase margin which is larger than the phase margin ϕm (G) of G(s). However, unlike the phase lag compensator, a phase lead compensator comes with the additional benefit of actually increasing the bandwidth, that is BW(Gcp G) > BW(G). This is clear from Fig. 7.22, in which we have superimposed the Bode magnitude plots for the transfer functions G(s) and Gcp (s). One sees that the bandwidth BW(Gcp G) of Gcp G(s) is greater than the bandwidth BW(G) of G(s). The main drawback of the method of phase lead design 217 Figure 7.22: Bandwidths BW(G) and BW(Gcp G) for phase lead Gcp (s) presented here is that it works only when the transfer function G(s) is “nice” or “regular” in a sense that we shall shortly make clear; when G(s) does not have this regularity property then the method may fail to work. Before stating the design method we develop a basic identity from which the method will become immediately clear. Recall from (7.2.3) and (7.2.5) that the phase lead transfer function is (7.4.27) Gcp (s) = 1 + s/a , 1 + s/b with 0 < a < b. Furthermore, if ω̂ is the frequency of maximum phase displacement and ϕ̂ is the corresponding maximum phase lag (see Fig. 7.13), then (7.4.28) √ ω̂ = ab, sin[∠Gcp (j ω̂)] = sin(ϕ̂) = b/a − 1 b/a + 1 r , |Gcp (j ω̂)| = b , a (see (7.2.10) - (7.2.12)). Now fix an angle θ in the range (7.4.29) 0 < θ < 90, (all angles in degrees). We are now going to “design” a phase lead compensator Gcp (s) based on the angle θ. Put (7.4.30) α= 1 + sin θ , 1 − sin θ thus α>1 218 and sin θ = α−1 . α+1 From a Bode magnitude plot of the given system G(s) read off frequency ωmod such that 1 |G(jωmod )| = √ < 1. α (7.4.31) Now fix constants a and b in (7.4.27) as follows: (7.4.32) √ b = ωmod α, ωmod a= √ , α thus 0<a<b and b α= . a From (7.4.32) and (7.4.28) (7.4.33) ωmod = ω̂, that is a and b are such that the frequency of maximum displacement ω̂ of the phase lead compensator Gcp (s) coincides with the frequency ωmod determined from G(s) by (7.4.31). Upon combining (7.4.28) and (7.4.32) we find that sin[∠Gcp (j ω̂)] = α−1 α+1 , and comparing this with (7.4.30) we get (7.4.34) ∠Gcp (j ω̂) = θ. Moreover, from (7.4.28) and (7.4.32) we have |Gcp (j ω̂)| = (7.4.35) √ α. Then |Gcp G(jωmod )| = |Gcp (jωmod )|.|G(jωmod )| (7.4.36) = |Gcp (j ω̂)|.|G(jωmod )| =1 (see (7.4.33)) (see (7.4.35) and (7.4.31)) Now (7.4.36) suggests that ωmod is the gain crossover frequency of the transfer function Gcp G(s), and from now on we assume that this is the case. Then (see Definition 7.1.4) ϕm (Gcp G) = 180 + ∠Gcp G(jωmod ), that is ϕm (Gcp G) = 180 + ∠Gcp (jωmod ) + ∠G(jωmod ) (7.4.37) = 180 + ∠Gcp (j ω̂) + ∠G(jωmod ) = 180 + θ + ∠G(jωmod ) 219 (see (7.4.33)) (see (7.4.34)) Now put (7.4.38) η = ϕm (G) − [180 + ∠G(jωmod )]. Then ∠G(jωmod ) = ϕm (G) − η − 180, and combining this with (7.4.37) leads to the basic identity (7.4.39) ϕm (Gcp G) = ϕm (G) + (θ − η). Remark 7.4.1. To summarize: We start with a given transfer function G(s), and fix some angle θ as at (7.4.29). We compute α in terms of θ as at (7.4.30), and then use the magnitude Bode plot of G(s) to determine ωmod in terms of α as at (7.4.31). Finally we compute constants a and b in terms of α and ωmod as at (7.4.32), and with these constants get a phase lead compensator Gcp (s). With this phase lead compensator we find from (7.4.39) that the increase ϕm (Gcp G) − ϕm (G) in phase margin is equal to θ − η, with η being defined by (7.4.38). How does this help to design a phase lead compensator Gcp (s) such that the phase margin ϕm (Gcp G) is equal to a specified value ψ? If, in place of the basic identity (7.4.39), the above design recipe led to the simpler relation (7.4.40) ϕm (Gcp G) = ϕm (G) + θ, then matters would be completely straightforward: we just determine the phase margin ϕm (G), put θ = ψ − ϕm (G), and with this value of θ follow the design recipe to get (7.4.40), from which we find ϕm (Gcp G) = ψ, as required. However, the design recipe given above for the constants a and b leads to the identity (7.4.39), not the simpler identity (7.4.40), and the term η on the right of (7.4.39) complicates things. To understand how one can deal with this term we note from (7.4.31) that G(jωmod ) is inside the unit circle centered at s = 0, and this suggests that ωmod > ωc , in which ωc is gain crossover frequency of G(s). This is shown in Fig. 7.23, which displays the angle 220 Figure 7.23: The angle η at (7.4.38) η defined at (7.4.38). From Fig. 7.23 it is plausible that the angle η will be small (e.g. η ≤ 15 deg.) provided that the magnitude of the derivative (7.4.41) d∠G(jω) |ω=ωc dω is itself small. The magnitude of the derivative at (7.4.41) is called the roll-off in the phase of G(s) in the vicinity of the gain crossover frequency, and we expect η to be small when this roll-off is small. Assuming this to be the case we can define (7.4.42) θ = ψ + δ − ϕm (G), in which δ is some fixed angle in the range 5 ≤ δ ≤ 15 deg. We then follow the design method developed above to design a phase lead compensator Gcp (s) such that (7.4.39) holds, that is ϕm (Gcp G) = ϕm (G) + θ − η = ϕm (G) + (ψ + δ − ϕm (G)) − η (from (7.4.42)) and therefore (7.4.43) ϕm (Gcp G) = ψ + δ − η. 221 If the roll-off in the phase of G(s) in the vicinity of the gain crossover frequency is small then we can expect to have 0 ≤ η ≤ δ, and it then follows from (7.4.43) that ϕm (Gcp G) ≥ ψ, that is the required phase margin is more than attained. In summary we can write out the design method developed above in the following sequence of steps for implementing the design of a phase lead compensator Gcp (s) to attain ϕm (Gcp G) ≥ ψ, in which ψ is a specified phase margin. Step 1: Determine the phase margin ϕm (G) of G(s), and fix an “offset” angle δ in the range 5 ≤ δ ≤ 15 deg. Put θ = ψ + δ − ϕm (G). Step 2: Define 1 + sin θ . 1 − sin θ Step 3: From the Bode magnitude plot of the given transfer function G(s) read off the frequency α= ωmod such that 1 |G(jωmod )| = √ , α 20 log |G(jωmod )| = −10 log α. that is Step 4: Put √ b = ωmod α, ωmod a= √ , α and then define Gcp (s) = 1 + s/a . 1 + s/b This completes the design of the phase lead compensator Gcp (s). Remark 7.4.2. Remember that the above design method will only work when the transfer function G(s) is “nice” in the sense that the roll-off (7.4.41) in the angle of G(s) at the gain crossover frequency ωc of G(s) is small enough that one has η ≤ δ (recall Remark 7.4.1). 222 In Example 7.1.3 we designed a phase lag compensator to attain a specified phase margin, and we saw that this involved a considerable loss of bandwidth. For some applications this loss of bandwidth may be acceptable, but for other applications it is not. In this latter case we would then try to design a phase lead compensator, as in the next example. Example 7.4.3. Given the transfer function (7.4.44) G(s) = s2 40 , + s + 40 design a phase lead compensator Gcp (s) such that ϕm (Gcp G) ≥ 40 + ϕm (G), (here the angles are in degrees). Step 1: In Example 7.1.3 we found that ϕm (G) = 12 deg, so the required phase margin is ψ = 40 + ϕm (G) = 52 deg . Now fix an “offset” δ = 5 deg, then θ = ψ + δ − ϕm (G) = 52 + 5 − 12 = 45 deg . Step 2: We have sin θ = 0.707, thus α= 1 + sin θ = 5.83. 1 − sin θ Step 3: We read off ωmod from the Bode magnitude plot of G(s) such that 20 log |G(jωmod )| = −10 log α = −7.66. Now the Bode magnitude plot of G(s) is given in Fig. 7.17, from which we find ωmod = 11 rads/sec, 223 (see point F on Fig. 7.17). Step 4: Put √ b = ωmod α = 26.57. ωmod a = √ = 4.55, α Then the phase lead compensator is (7.4.45) Gcp (s) = 1 + 0.22s 1 + s/a = . 1 + s/b 1 + 0.04s It remains to check that this phase lead compensator indeed attains the required phase margin. To this end we use MATLAB to get the Bode plots of the transfer function Gcp (s)G(s) as shown in Fig. 7.24. From points A and B on Fig. 7.24 one sees that Figure 7.24: Bode plots of Gcp G defined by (7.4.44) and (7.4.45) 224 ϕm (Gcp G) = 180 − 128 = 52 deg, exactly as required, so the design objective is attained. As for the bandwidths, in Example 7.3.2 we have seen that BW(G) = 10 rads/sec, and from point C on Fig. 7.24 one sees that BW(Gcp G) = 17 rads/sec, so there has been a substantial improvement in the bandwidth as well. Remark 7.4.4. At Remark 7.3.3 we discussed the effect on the tracking properties of a closed loop system when a phase lag compensator Gcp (s) is inserted in the forward path of the closed loop system, as shown in Fig. 7.19. We found that the tracking properties are completely unaffected by the insertion of Gcp . In the reasoning for Remark 7.3.3 we used only the basic form of Gcp , namely Gcp (s) = 1 + s/a , 1 + s/b but never the fact that a > b > 0, which characterizes lag compensators. It follows that all conclusions on tracking in Remark 7.3.3 carry over immediately from lag compensators to lead compensators. That is, when Gcp (s) is a phase lead compensator, then the tracking properties of the two closed loop systems in Fig. 7.19 are again identical, in the sense that one closed loop system tracks step [ramp] inputs if and only if the other closed loop system tracks step [ramp] inputs. Thus the ability to track step and ramp inputs is unaffected by the use of lead compensation. Likewise, when Gcp (s) is a phase lead compensator, then the closed loop systems (i) and (ii) in Fig. 7.19 have identical steady state tracking error for a unit step input when type{G} = 0, and have identical steady state tracking error for a unit ramp input when type{G} = 1. Remark 7.4.5. In the spirit of Remark 7.4.4 we could repeat Example 7.3.4, but with a controller of the form C(s) = KGcp (s), Gcp (s) = 1 + s/a , 1 + s/b with b > a > 0, that is C(s) is the series combination of a gain K and a phase lead compensator. The basic approach would be exactly the same as that used for the Example 7.3.4 except that, in designing Gcp (s), we would follow the steps for phase lead design. 225