Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series 4.0 context and direction In Lesson 3 we performed a material balance on a mixing tank and derived a first-order system model. We used that model to predict the open-loop process behavior and its closed-loop behavior, under feedback control. In this lesson, we complicate the process, and find that some additional analysis tools will be useful. DYNAMIC SYSTEM BEHAVIOR 4.1 math model of continuous blending tanks We consider two tanks in series with single inlet and outlet streams. F, CAi F, CA1 F, CA2 volume V1 volume V2 Our component A mass balance is written over each tank. d V1C A1 = FC Ai − FC A1 dt d V2 C A 2 = FC A1 − FC A 2 dt (4.1-1) As in Lesson 3, we have recognized that each tank operates in overflow: the volume is constant, so that changes in the inlet flow are quickly duplicated in the outlet flow. Hence all streams are written in terms of a single volumetric flow F. Again, we will regard the flow as constant in time. Also, each tank is well mixed. Putting (4.1-1) into standard form dC A1 + C A1 = C Ai dt dC A 2 τ2 + C A 2 = C A1 dt τ1 revised 2006 Mar 6 (4.1-2) 1 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series we identify two first-order dynamic systems coupled through the composition of the intermediate stream, CA1. If we view the tanks as separate systems, we see that CA1 is the response variable of the first tank and the input to the second. If instead we view the pair of tanks as a single system, CA1 becomes an intermediate variable. The speed of response depends on two time constants, which (as before) are equal to the ratio of volume for each tank and the common volumetric flow. We write (4.1-2) at a steady reference condition to find C A ,r = C Ai ,r = C A1,r = C A 2,r (4.1-3) We subtract the reference condition from (4.1-2) and thus express the variables in deviation form. dC 'A1 τ1 + C 'A1 = C 'Ai dt dC 'A 2 τ2 + C 'A 2 = C 'A1 dt (4.1-4) 4.2 solving the coupled equations - a second-order system As usual, we will take the initial condition to be zero (response variables at their reference conditions). We may solve (4.1-4) in two ways: Because the first equation contains only C′A1, we may integrate it directly to find C′A1 as a function of the input C′Ai. This solution becomes the forcing function in the second equation, which may be integrated directly to find C′A2. That is t C'A1 = 1 − t τ1 t τ1 ' e ∫ e C Ai dt τ1 0 (4.2-1) C 'A 2 = t t 1 − t τ2 t τ 2 ⎡ 1 − t τ1 t τ1 ' ⎤ e ∫ e ⎢ e ∫ e C Ai dt ⎥ dt τ2 0 0 ⎣ τ1 ⎦ (4.2-2) On defining a specific disturbance C′Ai we can integrate (4.2-2) to a solution. Alternatively, we may eliminate the intermediate variable C′A1 between the equations (4.1-4) and obtain a second-order equation for C′A2 as a function of C′Ai. The steps are (1) differentiate the second equation (2) solve the first equation for the derivative of C′A1 revised 2006 Mar 6 2 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series (3) solve the original second equation for C′A1 (4) substitute in the equation of the first step. The result is τ1τ 2 d 2 C 'A 2 dC 'A 2 ( ) + τ + τ + C 'A 2 = C 'Ai 1 2 dt 2 dt (4.2-3) Two mass storage elements led to two first-order equations, which have combined to produce a single second-order equation. A homogeneous solution to (4.2-3) can be found directly, but the particular solution depends on the nature of the disturbance: C'A 2 = A1e −t τ1 + A 2e −t τ2 ( ) + C'A 2,part C 'Ai (4.2-4) where the constants A1 and A2 are found by invoking initial conditions after the particular solution is determined. 4.3 response of system to step disturbance Suppose a step change ΔC occurs in the inlet concentration at time td. Either (4.2-2) or (4.2-4) yields − (t − t d ) − (t − t d ) ⎡ τ1 τ2 τ1 τ2 ⎤ C'A2 = U ( t − t d ) ΔC ⎢1 − e e + ⎥ τ1 − τ2 ⎣ τ1 − τ2 ⎦ (4.3-1) Each tank contributes a first-order response based on its own time constant. However, these responses are weighted by factors that depend on both time constants. The result in Figure 4.3-1 looks somewhat different from the first-order responses we have seen. We have plotted the step response of a secondorder system with τ1 = 1 and τ1 = 1.5 in arbitrary units. At sufficiently long time, the initial condition has no influence and the outlet concentration will become equal to the new inlet concentration; in this respect it looks like the first-order system response. However, the initial behavior differs: the outlet concentration rises gradually instead of abruptly. This S-shaped curve, often called “sigmoid”, is a feature of systems of order greater than one. Physically, we can understand this by realizing that the change in inlet concentration must spread through two tanks, and it reaches the second tank only after being diluted in the first. revised 2006 Mar 6 3 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series C* Ai/ C 1 0.5 0 1 0 1 2 3 4 5 6 0 1 2 3 4 5 6 C*A2/ C 0.8 0.6 0.4 0.2 0 t Figure 4.3-1: Response to step change in inlet composition 4.4 introducing the Laplace transform We bother with the Laplace transform for two reasons: • after the initial learning pains, it actually makes the math easier, so we will use it in derivations • some of the terminology in linear systems and process control is based on formulating the equations with Laplace transforms. Definition: the Laplace transform turns a function of time y(t) into a function of the complex variable s. Variable s has dimensions of reciprocal time. All the information contained in the time-domain function is preserved in the Laplace domain. ∞ y(s) = L{y( t )} = ∫ y( t )e −st dt (4.4-1) 0 (In these notes, we use the notation y(s) merely to indicate that y(t) has been transformed; we do not mean that y(s) has the same functional dependence on s that it does on t.) Functional transforms: textbooks (for example, Marlin, Sec. 4.2) usually include tables of transform pairs, so these derivations from definition (4.4-1) are primarily to demonstrate how the tables came to be. revised 2006 Mar 6 4 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series ∞ L{CU ( t − t d )} = ∫ CU ( t − t d )e −st dt 0 ∞ = C ∫ e −st dt (4.4-2) td − C −st e s Ce −st d = s = { ∞ td ∞ } L Ce −at = ∫ Ce −at e −st dt 0 − C −(s + a ) t ∞ e 0 s+a C = s+a = (4.4-3) Operational transforms: this allows us to transform entire equations, not just particular functions. ∞ df ( t ) −st ⎧ df ( t ) ⎫ L⎨ e dt ⎬=∫ ⎩ dt ⎭ 0 dt ∞ d ⎡ ⎤ = ∫ ⎢sf ( t )e −st + (fe −st )⎥ dt dt ⎦ 0 ⎣ ∞ = s ∫ f ( t )e −st dt + f ( t )e −st 0 (4.4-4) ∞ 0 = sL{f ( t )}− f (0) ⎞ ⎫ ∞⎛ t ⎧t L ⎨∫ f (ξ )dξ⎬ = ∫ ⎜⎜ ∫ f (ξ )dξ ⎟⎟e −st dt ⎭ 0⎝0 ⎠ ⎩0 t ∞ ∞ ⎞ ⎞ 1 ⎛⎜ ⎛ 1 −st ⎜ = ∫ f (t )e dt − ∫ d ⎜ ∫ f (ξ )dξ ⎟⎟e −st ⎟ ⎟ s 0 ⎜⎝ ⎝ 0 s0 ⎠ ⎠ ⎞ 1⎛ 1 = L{f (t )} − ⎜⎜ ∫ f (ξ )dξ ⎟⎟e −st s⎝0 s ⎠ t ∞ (4.4-5) 0 1 = L{f (t )} s revised 2006 Mar 6 5 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series Inverting transforms: use the tables to invert simple Laplace-domain functions to their time-domain equivalents. To simplify the polynomial functions often found in control engineering we may use partial fraction expansion. The complicated ratio in (4.4-6) can be inverted if is expanded into a series of simpler fractions. N (s) N (s) C1 C2 C3 = = + + ... + + ... n −1 n n m D(s) (s − α1 ) (s − α 2 ) ... (s − α1 ) (s − α1 ) (s − α 2 ) m (4.4-6) In (4.4-6), α1 and α2 are repeated roots of the denominator. The inverse transform of each term will involve an exponential function of the root αi. f (s) = C (s − α) n ⇒ f (t) = Ct n −1e αt (n − 1)! (4.4-7) Variety in the values of the coefficients Ci comes from the numerator function N(s). how to write the expansion Arrange the denominator so that the coefficient of each s is 1. If there are no repeated roots, each root appears in one term. C3 C1 C2 N(s) = + + (s − α1 )(s − α 2 )(s − α 3 ) (s − α1 ) (s − α 2 ) (s − α 3 ) (4.4-8) If a root is repeated, it requires a term for each repetition. C3 C1 C2 N(s) = + + 2 2 (s − α1 ) (s − α 2 ) (s − α 2 ) (s − α1 )(s − α 2 ) (4.4-9) Some roots may appear as complex conjugate pairs, so that, for example α1 = a + jb α 2 = a − jb (4.4-10) where j is the square root of -1. how to solve for the coefficients - it’s only algebra 1) For each of the real, distinct roots, multiply the expansion by each RH denominator and substitute the value of the root for s to isolate the coefficient. This also works for the highest power of a repeated root. 2) With some coefficients determined, it may be easiest to substitute arbitrary values for s to get equations in the unknown coefficients. revised 2006 Mar 6 6 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series 3) For repeated roots, either (3a) multiply the expansion by s and take the limit as s → ∞. However, this will not isolate coefficients associated with repeated complex roots. (3b) multiply the expansion by the RH denominator of highest power. Differentiate this equation with respect to s, and substitute the value of the root for s. Continue differentiating in this manner to isolate successive coefficients. 4) For complex roots, solving for one coefficient is enough. The other coefficient will be the complex conjugate. 4.5 solving linear ODEs with Laplace transforms We return to (4.1-4), the two equations that describe concentration in the tanks. dC 'A1 τ1 + C 'A1 = C 'Ai dt dC 'A 2 τ2 + C 'A 2 = C 'A1 dt (4.1-4) We perform the Laplace transform on the entire first equation. It distributes across addition, and constant τ1 may be factored out. ⎧ dC ' ⎫ L ⎨τ1 A1 + C 'A1 ⎬ = L C 'Ai dt ⎩ ⎭ ⎧ dC ' ⎫ τ1L ⎨ A1 ⎬ + L C 'A1 = L C 'Ai ⎩ dt ⎭ { } { } { } (4.5-1) We next perform an operational transform on the derivative. Because the functional forms of the variables C′A1 and C′Ai are not yet known, we simply indicate a variable in the Laplace domain. { } τ1 sC'A1 (s) − C'A1 (0) + C'A1 (s) = C'Ai (s) τ1sC'A1 (s) + C'A1 (s) = C'Ai (s) (4.5-2) We can easily solve (4.5-2) for C′A1. If we similarly treat the second equation in (4.1-4), we arrive at the equivalent formulation in the Laplace domain. revised 2006 Mar 6 7 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series C 'A1 (s) = 1 C 'Ai (s) τ1s + 1 1 C (s) = C 'A1 (s) τ 2s + 1 (4.5-3) ' A2 Equations (4.5-3) are not solutions - we have not solved anything! We merely have a new formulation of problem (4.1-4), a formulation that is more abstract (what on earth is Laplace domain?) and yet simpler, by virtue of being algebraic. It is important to remember that all the information held in the differential equations (4.1-4) is preserved in the Laplace domain formulation (4.5-3). We proceed toward solution by eliminating the intermediate variable in (4.5-3). We find C 'A 2 (s) = 1 1 C 'Ai (s) τ 2s + 1 τ1s + 1 (4.5-4) With (4.5-4) we have gone as far as we can without knowing more about the disturbance. That is, we cannot invert the right-hand side of (4.5-4) until we can actually substitute a functional transform for the variable C′Ai(s). In this sense, (4.5-4) resembles (4.2-2) and (4.2-4): a solution needing more specification. As in Section 4.3, suppose a step change ΔC occurs in the inlet concentration at time td. C 'Ai ( t ) = U (t − t d )ΔC (4.5-5) We must take the Laplace transform, C 'Ai (s) = ΔC − t d s e s (4.5-6) which we may substitute into (4.5-4). C 'A 2 (s) = 1 1 ΔC − t ds e τ 2s + 1 τ1s + 1 s (4.5-7) This IS the solution, the step response of the two tanks in series. Of course, it really must be inverted to the time domain. We treat the polynomial denominator from either the tables or partial fraction expansion: revised 2006 Mar 6 8 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series −t −t ⎧ 1 τ1 τ2 1 1⎫ τ1 τ2 = − + L−1 ⎨ 1 e e ⎬ τ + τ + τ − τ τ − τ s 1 s 1 s 1 2 1 1 2 ⎩ 2 ⎭ (4.5-8) Next we apply the time delay −( t − t d ) −( t − t d ) ⎧ 1 ⎡ τ1 τ2 1 1 − t ds ⎫ τ1 τ2 ⎤ + L−1 ⎨ e ⎬ = U(t − t d )⎢1 − e e ⎥ τ1 − τ 2 ⎩ τ 2s + 1 τ1s + 1 s ⎣ τ1 − τ 2 ⎦ ⎭ (4.5-9) Remembering the constant factor, we complete the inverse transform of (4.5-7). −( t − t d ) −( t − t d ) ⎡ τ1 τ2 τ1 τ2 ⎤ + C'A 2 = U( t − t d )ΔC⎢1 − e e ⎥ τ1 − τ 2 ⎣ τ1 − τ 2 ⎦ (4.5-10) which, of course, is identical to (4.3-1), derived in the time domain. 4.6 describing systems with transfer functions In Section 4.1 we derived a system model to describe transient behavior in a tanks-in-series process. Then in Section 4.5 we used Laplace transforms to solve it. Let us now do the same procedure in the abstract. Begin with the first-order lag, written in deviation variables: τ dy ' + y ' = Kx ' ( t ) dt y ' (0) = 0 (4.6-1) After taking Laplace transforms, we relate input and output by an algebraic equation: y ' (s) = K ' x (s) τs + 1 (4.6-2) The ratio in (4.6-2) multiplies x′(s) (the transform of disturbance x′(t)) and in the process converts that signal into y′(s) (the transform of the response y′(t)). We call this ratio the transfer function G(s). y ' (s) K G (s) = ' = x (s) τs + 1 (4.6-3) G(s) contains all the information about the ODE (4.6-1). We should from now recognize it, when we see it, as a first-order lag. Should we want to know how the first-order lag behaves in response to some disturbance, we transform the disturbance, multiply it by the first-order lag transfer function, and then take the inverse transform of the result. Let us generalize (4.5-4), which described two first-order lags in series: revised 2006 Mar 6 9 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series y ' (s) = K1 K2 x ' (s) τ1s + 1 τ 2s + 1 (4.6-4) The transfer function for this second-order system is a product of two firstorder lags y ' (s) K1 K2 = = G1 (s)G 2 (s) = G (s) ' x (s) τ1s + 1 τ 2s + 1 (4.6-5) We shall consider a transfer function to be a completely satisfactory description of a dynamic system. We shall learn to notice its gain (longterm steady-state relationship between y′ and x′), time constants, and poles (roots of the denominator). Table 4.6-1: Characteristics of systems we have studied type equation transfer function 1st order lag K dy' + y ' ( t ) = Kx ' ( t ) τs + 1 dt nd ' 2 ' 2 order K d y dy + y ' = Kx ' ( t ) overdamped* τ1τ2 2 + (τ1 + τ2 ) ( τ1s + 1)(τ 2s + 1) dt dt nd *why “overdamped”? There are other 2 order forms to be encountered. τ poles steady state gain -τ-1 K -τ1-1 -τ2-1 K 4.7 describing systems with block diagrams The block diagram is a graphical display of the system in the Laplace domain. x′(s) y′(s) G(s) It comprises blocks and arrows, and thus resembles many other types of flow diagram. In our use with control systems, however, the arrows represent signals, variables that change in time, which are not necessarily actual flow streams. The block contains the transfer function, which may be as simple as a units conversion between x and y, or a description of more complicated dynamic behavior. Remember that the transfer function incorporates all the dynamic information in the system equations. This diagram implies the Laplace domain relationship y ' (s) = G (s) x ' (s) (4.7-1) The real value of block diagrams is to represent the flow of signals among multiple blocks. The Block Diagram Rules (see Marlin, Sec.4.4): revised 2006 Mar 6 10 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series • exclusion: only one input and output to a block. inputs • summing: two signals may be summed at an explicit summing junction. The algebraic sign is indicated at the junction (if omitted, is presumed to be positive). x'‘ 1(s) G1(s) y‘' 1(s) + x' 3(s) x' 2(s) • outputs system G2(s) G3(s) y' 3(s) y' 2(s) multiple assignment: a single signal may feed its value to multiple blocks. This does NOT indicate that the signal is divided up among the blocks. x 1(s) x' G1(s) y 1(s) y' G2(s) y' 1(s) G3(s) y 2(s) y' y' 3(s) Block diagrams may be turned into equations by simple algebra. It is usually most convenient to start with an output and work backwards by substitution. In the summing diagram y 3' (s) = G 3 (s)x 3' (s) = G 3 (s)(y1' (s) − y '2 (s) ) = G 3 (s)(G1 (s)x1' (s) − G 2 (s)x '2 (s) ) (4.7-2) = G 3 (s)G1 (s)x1' (s) − G 3 (s)G 2 (s)x '2 (s) In the multiple assignment diagram y '2 (s) = G 2 (s) y1' (s) = G 2 (s)G1 (s) x1' (s) y 3' (s) = G 3 (s) y1' (s) (4.7-3) = G 3 (s)G1 (s) x1' (s) revised 2006 Mar 6 11 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series Similarly, equations may be turned into block diagrams. System (4.7-2) has two inputs and thus requires at least 2 blocks. x' 1(s) G1(s) G3(s) + y' 3(s) x' 2(s) G2(s) G3(s) System (4.7-3) has two outputs for one input. Input x*1 is not split – its full value is sent to each of two blocks. G1(s) G2(s) x 1(s) x' G1(s) G3(s) y' 2(s) y 3(s) y' This pair of block diagrams is equivalent to the pair from which they were derived. As a further illustration, we apply the block diagram rules to the two-tank system in (4.5-3): C' Ai(s) C' A1(s) C' A2(s) 1 1 τ1s + 1 τ 2s + 1 OR C' Ai(s) C' A2(s) 1 1 τ1s + 1 τ 2 s + 1 4.8 frequency response from the transfer function In Section 3.5 we derived the system response to a sine input by integrating the differential equation. We learned that the frequency response - that is, the long-term oscillation - could be characterized by its amplitude ratio and phase angle; these quantities were expressed on a Bode plot. Alternatively, we may derive the frequency response directly from the transfer function by substituting jω for s, where j is the square root of -1 and ω is the radian frequency of the sine input. For the second-order transfer function (4.6-5), revised 2006 Mar 6 12 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series G ( jω) = K 1K 2 (1 + τ1ωj)(1 + τ2ωj) (1 − τ1ωj)(1 − τ 2ωj) = K 1K 2 (1 + τ ω )(1 + τ 2 = K 1K 2 2 2 1 2 ω2 ) (4.8-1) 1 − τ1τ 2 ω2 − ω(τ1 + τ 2 ) j 2 2 1 + τ1 ω2 1 + τ 2 ω2 ( )( ) The function G(jω), although perhaps daunting to behold, is simply a complex number. As such, it has real and imaginary parts, and a magnitude and a phase angle. It turns out that the magnitude of G(jω) is the amplitude ratio of the frequency response. (1 − τ τ ω ) + (ω(τ 2 2 G ( jω) = K1K 2 1 2 1 2 2 (1 + τ ω )(1 + τ ω ) 1 + ω (τ + τ ) + ω τ τ (1 + τ ω )(1 + τ ω ) 2 2 2 = K 1K 2 2 2 1 = + τ 2 )) 2 1 2 2 1 2 2 4 2 2 1 2 2 2 (4.8-2) 2 K 1K 2 2 2 1 + τ1 ω2 1 + τ 2 ω2 Furthermore, the phase angle of G(jω) is the frequency response phase angle. Im(G ( jω) ) Re(G ( jω) ) − ω(τ1 + τ 2 ) = tan −1 1 − τ1τ 2 ω2 ∠G ( jω) = tan −1 (4.8-3) In Figure 4.8-1, the Bode plot abscissa has been normalized by the square root of the product of the time constants. We see that the amplitude ratio of a second-order system declines more swiftly than that of a first-order system: the slope of the high-frequency asymptote is -2. Unbalancing the time constants further decreases the amplitude ratio. The phase angle can reach -180º. It is symmetric about -90º. revised 2006 Mar 6 13 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series amplitude ratio/gain 1.00 0.10 0.01 0.01 0 1 1.1 -30 phase angle (deg) 0.1 τ2 = 20 τ1 -60 10 100 10 100 5 -90 -120 -150 -180 0.01 0.1 1 ω(τ1τ2)0.5 (radians) Figure 4.8-1: Bode plot for overdamped second order system 4.9 stability of the two-tank system, and linear systems in general The step response (4.5-10) shows no terms that grow with time, so long as the time constants are positive. Furthermore, the amplitude ratio in Figure 4.8-1 is bounded. Thus, a second-order overdamped system appears to be stable to bounded inputs. In practical terms, a concentration disturbance at the inlet should not provoke a runaway response at the outlet. We have seen first- and second-order linear systems. Let us generalize to arbitrary order: an d n y' d n −1 y ' dy ' " + a + + a + y' = x ' n −1 1 dt dt n dt n −1 (4.9-1) The function x′ represents all manner of bounded disturbances, expressed in deviation form. The system properties, however, reside on the left-hand side of (4.9-1), and its stability behavior should be independent of the particular nature of the disturbances x′. Hence, we may examine the homogeneous equation revised 2006 Mar 6 14 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series an d n y' d n −1 y ' dy ' + + " + + y' = 0 a a n −1 1 n n −1 dt dt dt (4.9-2) The solution to (4.9-2) is the sum of n terms, each containing a factor eαit, where αi is a real root, or the real part of a complex root, of the characteristic equation. a n r n + a n −1r n −1 + " + a 1r + 1 = 0 (4.9-3) Hence if all the αi are negative, the solution cannot grow with time and will thus be stable. If we take the Laplace transform of (4.9-1), 1 y ' (s) = G (s) = ' n n −1 a n s + a n −1s + " + a 1s + 1 x (s) (4.9-4) we see that the denominator of the transfer function is identical to the characteristic equation. Hence, the stability of the system is determined by the poles of the transfer function: poles with zero or positive real parts indicate a system unstable to bounded disturbances. Table 4.6-1 shows that first-order lag and overdamped second-order systems are stable if their time constants are positive. CONTROL SCHEME 4.10 step 1 - specify a control objective for the process Our control objective is to maintain the outlet composition CA2 at a constant value. 4.11 step 2 - assign variables in the dynamic system The controlled variable is clearly CA2. The inlet composition CAi is a disturbance variable. The composition CA1 is an intermediate variable. We have no candidate manipulated variable; hence we decide to add a concentrated make-up stream as we did with the single tank in Lesson 3. We could add the stream to the first or the second tank - we seek advice: One advisor says, “Add it to the first tank, where the disturbance enters. That way, the manipulation can interact thoroughly with the disturbance; it’s a matter of success through cooperation.” A second advisor says, “Add it to the second tank. That way the manipulated variable can affect the controlled variable more directly, through one tank instead of two.” This advice brings to mind the difference we have seen between first- and second-order responses. Yet the first advisor is better-dressed, friendlier, and has a comforting manner - we decide to add the make-up stream to the first tank. revised 2006 Mar 6 15 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series Material balances on the solute give V1 dC A1 F C + C A1 = C Ai + Ac Fc F + Fc dt F + Fc F + Fc (4.11-1) V2 dC A 2 + C A 2 = C A1 F + Fc dt We expect to use a relatively small make-up flow Fc of concentration CAc; hence we make the approximation that F + Fc ~ F. Hence C V1 dC A1 + C A1 = C Ai + Ac Fc F F dt V2 dC A 2 + C A 2 = C A1 F dt (4.11-2) As is our custom, we write (4.11-2) at a steady reference condition and subtract this reference to leave the variables in deviation form. After taking Laplace transforms, we eliminate intermediate variable C′A1(s) to find C 'A 2 (s) = 1 (τ1s + 1)(τ 2s + 1) C 'Ai (s) + C Ac F Fc' (s) (τ1s + 1)(τ 2s + 1) (4.11-3) The time constants are the usual volume-to-flow ratios. The poles of the two transfer functions are negative, so adding a make-up stream has not made the system unstable. Compare (4.11-3) to (4.5-4), which describes the two tanks without makeup flow. Figure 4.11-1, the block diagram of (4.11-3), emphasizes that controlled variable CA2 is influenced by both disturbance CAi and manipulated variable Fc. C'Ai (s) Fc' (s ) 1 (τ1s + 1)(τ 2s + 1) C Ac F τ + ( 1s 1)(τ2s + 1) C'A 2 (s) Figure 4.11-1: Block diagram of two-tank mixing process 4.12 step 3 - proportional control We will use proportional control. Although we recognize the disadvantage of offset, as demonstrated in Lesson 3, we feel confident in revised 2006 Mar 6 16 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series our ability to manage it at an acceptable level by increasing the controller gain. The proportional algorithm is Fc − Fbias = K gain (C A 2,setpt − C A 2 ) (4.12-1) Should the outlet composition fall below the set point, the error will become positive. A positive controller gain Kgain will increase make-up flow Fc above the bias value, which will act to increase the outlet composition. 4.13 step 4 - choose set points and limits As in Section 3.16, we identify any applicable safety limits, choose the desired operating point, specify limits of tolerable variation about it, and supply make-up flow in sufficient quantity to counteract the anticipated disturbances. EQUIPMENT 4.14 components of the feedback control loop We should consider the equipment more realistically. Figure 4.14-1 is a block diagram showing the four components found in most process control applications: process, sensor, controller, and final control element. Each block contains a transfer function that relates output to input. The signals between blocks are Laplace transforms of deviation variables. We recognize that the process will typically comprise multiple blocks for disturbance and manipulated variable inputs. An example is the mixing tank process that shown in Figure 4.11-1. process x’d(s) x’m(s) final control element Gd(s) y’c (s) Gm(s) sensor Gv(s) y’ Gs(s) controller co(s) y’sp,e(s) Gc(s) Gsp(s) ε’ (s) - y’s (s) y’sp(s) Figure 4.14-1: General block diagram of feedback control loop revised 2006 Mar 6 17 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series The output signal that we have designated as the controlled variable y′c is measured by a sensor. In our mixing tank example, we need some measurement that reliably indicates composition; depending on the nature of the solution, it might be a chromatograph, conductivity meter, spectrometer, densitometer, etc. The controller subtracts the sensor signal y′s from the set point y′sp and executes the controller algorithm Gc(s) on the error. The subtraction is sometimes said to take place in the comparator. The controller output y′co drives a final control element to produce manipulated variable x′m. In chemical process industries this is most often a valve in a pipe carrying some fluid stream, but it could also be a motor, a heater control, etc. 4.15 transfer functions for loop components Although we are not yet ready to address hardware, we can improve our description of equipment behavior by posing transfer functions for each of the closed loop components indicated in Figure 4.14-1. Notice that a transfer function has two main parts: steady and dynamic. • The steady part is the gain; gain indicates the magnitude of the effect of the transfer function on the input signal, and it performs the units conversion between input and output. In (4.11-3), the transfer function that converts make-up flow Fc into outlet concentration CA2 has a gain of CAc/F. The gain depends on these two process parameters, and the units are chosen to be consistent with those of the input and output signals. The other transfer function in (4.11-3) has a dimensionless unity gain, independent of process parameters. • The dynamic part is everything else - all the system time constants and the functions of the Laplace variable s. The dynamic part characterizes the way that an input signal is processed in time. In (4.11-3), both transfer functions feature second-order dynamics. sensor Let us presume that the sensor is fast - really fast - so that negligible time elapses between a change in the controlled variable yc and its measurement ys. Then the transfer function is y s' = K s y 'c (4.15-1) Being really fast means that the transfer function has NO dynamic part. Such a transfer function indicates a “pure gain” process, one in which changes in the input are “instantaneously” seen in the output. The dimensions of the gain Ks are revised 2006 Mar 6 18 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series K s ( =) controller _ in controlled var iable (4.15-2) where the sensor is presumed to deliver the measurement to the controller in suitable “controller_in” units. controller We see that a proportional controller is also a pure gain process between error signal and controller response. y 'co = K c ε ' (4.15-3) where the error is conventionally defined with the set point as positive: ' ε ' = y sp − y s' (4.15-4) For now we will leave the controller signal dimensions unspecified. However, we can be sure that the gain has dimensions of K c ( =) controller _ out controller _ in (4.15-5) set point The error signal has dimensions suitable for the controller, which implies that ysp and ys have the same units. However, the operator might prefer to have the set point expressed in the units of the controlled variable (socalled engineering units), which implies that ysp,e and yc have the same units. The set point transfer function performs this unit conversion; it is a pure gain process with gain identical to that of the sensor. That is G sp = K s (4.15-6) final control element The valve is a mechanical device that takes some time to move. We might imagine that a valve can change more quickly than a large chemical process vessel, and thus that for many control applications the valve dynamics can be neglected. In our case, however, we will assume that the valve operates with first-order dynamics, such that x 'm = Kv ' y co τ vs + 1 (4.15-7) The valve gain has dimensions of revised 2006 Mar 6 19 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series K v ( =) flow controller _ out (4.15-8) CLOSED LOOP BEHAVIOR 4.16 assembling the components into a closed loop The closed loop block diagram in Figure 4.14-1 shows how the loop components are arranged. The transfer functions for the various components are defined in Section 4.15. We will now use the block diagram rules to derive the equations for the closed loop, in three steps: • in general, good for any application of Figure 4.14-1 • applying the choices we made in Section 4.15 • adapting the general nomenclature of Section 4.15 to the two-tank mixing process We begin with the controlled variable, which is the output of the closed loop system, and work backward through the diagram until all paths are traced and the inputs appear. y 'c (s) = G d x 'd (s) + G m x 'm (s) = G d x 'd (s) + G m G v G c ε ' (s) ' ' = G d x 'd (s) + G m G v G c (G sp y sp , e (s) − G s y c (s) ) (4.16-1) At this point, we collect the controlled variable on the left-hand side. ' y 'c (s)(1 + G m G v G c G s ) = G d x 'd (s) + G m G v G c G sp y sp ,e (s) y 'c (s) = G m G v G c G sp Gd ' y sp (s) x 'd (s) + (1 + G m G v G c G s ) (1 + G m G v G c G s ) ,e (4.16-2) Equation (4.16-2) shows how a controlled variable responds to a disturbance and set point inputs. It is derived from Figure 4.14-1 and applies to any system that can be represented by the figure. We now specialize (4.16-2) with transfer functions we defined in Section 4.15. These use the general nomenclature of Figure 4.14-1, but depend on assumptions we made about fast sensors and first-order valves. Kv K cKs Gd τ vs + 1 ' ' ' y c (s) = x d (s) + y sp ,e (s) ⎞ ⎞ ⎛ ⎛ Kv Kv ⎜⎜1 + G m ⎜⎜1 + G m K c K s ⎟⎟ K c K s ⎟⎟ τ vs + 1 τ vs + 1 ⎠ ⎠ ⎝ ⎝ Gm revised 2006 Mar 6 (4.16-3) 20 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series Equation (4.16-3) begins to show how the general transfer functions become specific functions of the Laplace variable s. Now we further specialize (4.16-3) to the two-tank problem by substituting the process transfer functions and specific nomenclature from (4.11-3) or, equivalently, Figure 4.11-1. C Ac F Kv KcKs ( ( τ1s + 1)(τ 2s + 1) τ vs + 1 τ1s + 1)(τ 2s + 1) ' ' C 'A 2,sp (s) C Ai (s) + C A 2 (s) = ⎞ ⎞ ⎛ ⎛ C Ac F Kv C Ac F Kv ⎜⎜1 + ⎜⎜1 + K c K s ⎟⎟ K c K s ⎟⎟ ⎠ ⎠ ⎝ (τ1s + 1)(τ 2s + 1) τ vs + 1 ⎝ (τ1s + 1)(τ 2s + 1) τ v s + 1 1 (4.16-4) Beneath its apparent complexity, (4.16-4) simply tells how the outlet concentration reacts to disturbances and to a set point input. This closedloop response is compared in Figure 4.16-1 to the open-loop response of the process. transfer function for disturbance 1 C 'A 2 (s) = (τ1s + 1)(τ 2s + 1) other inputs C 'Ai (s) + C Ac F Fc' (s) (τ1s + 1)(τ2s + 1) C Ac F Kv K cKs ( ( τ1s + 1)(τ 2s + 1) τ v s + 1 τ1s + 1)(τ 2s + 1) ' ' C A 2 (s) = C Ai (s) + C 'A 2,sp (s) ⎞ ⎞ ⎛ ⎛ C Ac F Kv C Ac F Kv ⎜⎜1 + ⎜⎜1 + K c K s ⎟⎟ K c K s ⎟⎟ ⎠ ⎠ ⎝ (τ1s + 1)(τ2s + 1) τ vs + 1 ⎝ (τ1s + 1)(τ 2s + 1) τ v s + 1 1 Figure 4.16-1: Comparing open- and closed-loop responses It is clear that the disturbance response has a different character, because the transfer function has changed. IF we made a good decision on control algorithm, and IF we tune the controller properly, the closed-loop response should be better. 4.17 some perspective on how we derived the closed-loop response Remember what we did: we proposed a block diagram of feedback control and derived the associated transfer functions between inputs and output. Then we substituted the component transfer functions appropriate to our particular problem. Instead of the block diagram algebra, we could have combined the Laplace domain equations of Section 4.15 directly, eliminating intermediate variables until we arrived at (4.16-4). revised 2006 Mar 6 21 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series Furthermore, we could have proceeded entirely in the time domain, as we did in Lesson 3. That is, the second-order process ODE could have been combined with the first-order valve ODE and algebraic equations for sensor and controller to arrive at an ODE for the controlled variable with disturbance and set point forcing functions. We have used new tools - the Laplace transform and the block diagram but the underlying objective, and the relationships between inputs and outputs, were the same as working in the time domain. This is not mysterious. 4.18 calculating closed-loop responses But how does the closed-loop perform? We approach this by simplifying (4.16-4). τ vs + 1 τ1τ 2 τ v C 'Ai (s) C 'A 2 (s) = ⎛ τ + τ + τ ⎞ 1 + K v K c K s C Ac F ⎛1 1 1⎞ s 3 + ⎜⎜ + + ⎟⎟s 2 + ⎜⎜ 1 2 v ⎟⎟s + τ1τ 2 τ v ⎝ τ1τ 2 τ v ⎠ ⎝ τ1 τ 2 τ v ⎠ 1 + K v K c K s C Ac F τ1τ 2 τ v C 'A 2,sp (s) + ⎛ τ + τ + τ ⎞ 1 + K v K c K s C Ac F ⎛1 1 1⎞ s 3 + ⎜⎜ + + ⎟⎟s 2 + ⎜⎜ 1 2 v ⎟⎟s + τ1τ 2 τ v ⎝ τ1τ 2 τ v ⎠ ⎝ τ1 τ 2 τ v ⎠ (4.18-1) Clearly we did not succeed at that... As with (4.5-4) and (4.11-3), we would like to substitute a particular disturbance for C′Ai(s) in (4.18-1) and invert the result to obtain the time response of CA2. Here we encounter an obstacle: our transform tables do not feature anything as complicated as (4.18-1). Furthermore, to use partial fraction expansion we must find the roots of the cubic equation; however, we are unlikely to find an analytical expression for these. That is unfortunate, because it would be helpful to know how the transfer function poles depend on the controller gain Kc. We resort to numerical methods. Here is our plan: • do a partial-fraction expansion of each transfer function in (4.18-1) in terms of the poles • multiply each term in the expansion by the disturbance of interest and invert to find the response • for a particular value of controller gain Kc, find the poles numerically • repeat for different values of Kc to map out the behavior This expedient of using numerical calculations does not show us the functional dependence of the response on the parameters, but it does get the job done. revised 2006 Mar 6 22 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series We will begin with the disturbance transfer function in (4.18-1). The polynomial ratio part of the transfer function is written as the sum of fractions. τ vs + 1 ⎛ τ + τ + τ ⎞ 1 + K v K c K s C Ac F ⎛1 1 1⎞ s 3 + ⎜⎜ + + ⎟⎟s 2 + ⎜⎜ 1 2 v ⎟⎟s + τ1τ 2 τ v ⎝ τ1τ 2 τ v ⎠ ⎝ τ1 τ 2 τ v ⎠ τ vs + 1 = (s − α1 )(s − α 2 )(s − α 3 ) = (4.18-2) C1 C2 C3 + + s − α1 s − α 2 s − α 3 The poles of the transfer function are αi, and the coefficients Ci depend on these poles, as well as the numerator. We will keep in mind that both αi, and Ci depend on the system time constants and gains, as well as the controller gain Kc. Solving for the coefficients is an algebra problem. The results are C1 = τ v α1 + 1 (α1 − α 2 )(α1 − α 3 ) C2 = τvα 2 + 1 (α 2 − α1 )(α 2 − α 3 ) C3 = τvα3 + 1 (α 3 − α1 )(α 3 − α 2 ) (4.18-3) Thus numerical values of coefficients Ci can be computed for each set of poles αi. Now we use expansion (4.18-2) to rewrite (4.18-1) for a disturbance response. With no change in set point, C′A2,sp(s) is identically zero. ⎡ C1 C3 ⎤ ' C2 + + ⎥ C Ai (s) ⎢ − α − α − α s s s 1 2 3⎦ ⎣ −1 −1 ⎡ −1 ⎤ C3 ⎥ C1 C2 ⎢ α 1 α α ⎢ 1 ⎥ C 'Ai (s) = + 2 + 3 τ1τ 2 τ v ⎢ − 1 s + 1 − 1 s + 1 − 1 s + 1⎥ ⎢⎣ α1 ⎥⎦ α3 α2 C 'A 2 (s) = 1 τ1τ 2 τ v (4.18-4) Now, as an example, we pose a step disturbance in the inlet composition. revised 2006 Mar 6 23 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series C 'Ai ( t ) = ΔCU ( t − t d ) C 'Ai (s) = (4.18-5) ΔC − t ds e s We substitute the step disturbance (4.18-5) into the system model (4.18-4) to obtain ⎡ −1 ⎤ −1 −1 C3 ⎥ C1 C2 ⎢ α3 ΔC ⎢ α1 α2 ⎥ e − t ds C 'A 2 (s) = + + ⎢ τ1τ 2 τ v ⎛ − 1 ⎞ ⎥ ⎞ ⎛ −1 ⎞ ⎛ −1 ⎢ ⎜⎜ s + 1⎟⎟s ⎜⎜ s + 1⎟⎟s ⎜⎜ s + 1⎟⎟s ⎥ ⎠ ⎝ α3 ⎠ ⎝ α2 ⎠ ⎦⎥ ⎣⎢ ⎝ α1 (4.18-6) Each term inverts to a step response. Remembering to apply the time delay, we find the result C′A 2 (t) = ⎤ ΔCU(t − t d ) ⎡ −C1 − C3 −C 2 1 − eα1 (t − t d ) + 1 − eα2 (t − t d ) + 1 − eα3 (t − t d ) ⎥ ⎢ τ1τ2 τ v α2 α3 ⎣ α1 ⎦ ( ) ( ) ( ) (4.18-7) Examining (4.18-7) we learn that the exponential terms contribute according to the magnitude of the pole αi: small poles (larger time constants) cause the term to persist. We see that there will be offset, because C′A2 does not go to zero at long times. The amount of offset will depend on the magnitude of the coefficients Ci; our experience in Lesson 3 would suggest that these will become smaller as the controller gain Kc increases. 4.19 calculating the response for a particular example We begin with similar parameter values to our example in Lesson 3: F = 1.2 m3 min-1 Fc,r = 6×10-3 m3 min-1 V1 = 6 m3 (thus τ1 = 5 min) V2 = 4 m3 (thus τ2 = 3.33 min) CAi,r = 8 kg m-3 CAo,r = 10 kg m-3 CAc = 400 kg m-3 τv = 0.1 min Kv = 0.01 m3 min-1 controller_out-1 Ks = 0.5 controller_in m3 kg-3 We may calculate roots in (4.18-2) with calculators, spreadsheets, or computer code. For example, using matlab we obtain roots of polynomial s2 + 3s +4 by >> roots ([1 3 4]) revised 2006 Mar 6 24 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series ans = -1.5000 + 1.3229i -1.5000 - 1.3229i Table 4.19-1: poles of closed loop disturbance transfer function Kc (out in-1) α1 (min-1) α2 (min-1) α3 (min-1) 0 -10 -0.2 -0.3 0.012 -10.0001 -0.2143 -0.2856 0.024 -10.0003 -0.2437 -0.2561 Notice that zero controller gain leads to poles equal to the negative inverse of the three system time constants. Thus our closed-loop transfer function reduces to describe the behavior of the process alone, under open-loop conditions. After using the poles in Table 4.19-1 to compute the solution (4.18-7) we obtain a plot of the response behavior. Indeed controller gain can be increased to reduce the effects of the input disturbance. revised 2006 Mar 6 25 Spring 2006 Process Dynamics, Operations, and Control 10.450 1.5 1 0.5 0 -0.5 00 10 10 20 20 0.0 30 30 40 40 30 40 Kc = 0 -0.5 -6 3 -1 make-up deviation (10 m s ) inlet comp deviation (kg m -3 ) Lesson 4: Two Tanks in Series -1.0 0.012 -1.5 -2.0 0.024 -2.5 -3 outlet composition deviation (kg m) 1.20 1.00 0.80 0.60 0.40 0.20 0.00 0 10 20 time (min) Figure 4.19-1: Step response of two tanks under proportional control 4.20 surprise - increasing gain introduces oscillations! We have been very tentative with the gain setting, so we act more aggressively to suppress offset. The poles become complex! revised 2006 Mar 6 26 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series Table 4.20-1: complex poles of transfer function Kc (out in-1) α1 (min-1) α2 (min-1) 0.1 -10.001 -0.249 + j0.088 10 -10.10 -0.198 + j1.00 50 -10.48 -0.011 + j2.20 α3 (min-1) -0.249 - j 0.088 -0.198 - j1.00 -0.011 - j2.20 We must modify (4.18-7) to accommodate complex numbers. The roots α2 and α3 are complex conjugates, and (recalling our discussion of partial fraction expansion) so are coefficients C2 and C3. We define four new real quantities to replace the complex ones: α 2 = a + jb α 3 = a − jb C2 = A + jB α2 C3 = A − jB α3 (4.20-1) We substitute these definitions into (4.18-7), recalling Euler’s relation, e (a + jb )t = e at (cos bt + j sin bt ) (4.20-2) to obtain C 'A 2 ( t ) = ⎤ ΔCU ( t − t d ) ⎡ − C1 1 − e α1 ( t − t d ) − 2A + 2e a ( t − t d ) (A cos b( t − t d ) − B sin b( t − t d ) )⎥ (4.20-3) ⎢ τ1τ 2 τ v ⎣ α1 ⎦ ( ) Parameters A, B, a, and b are not variables with time, in the sense of CA2, but they do depend on the value of the controller gain Kc. Parameters a and b are found (via the root-finding procedure) in Table 4.20-1. A and B come via complex algebra from (4.18-3). A= ( ) − bτ v a 2 + b 2 + α1b − 2ab 2 2b a 2 + b 2 (α1 − a ) + b 2 ( τ (a B= v )[ )(α ] 2 +b 1 − a ) + a (α1 − a ) + b 2 2b a 2 + b 2 (α1 − a ) + b 2 2 2 ( )[ (4.20-4) ] Taking data from Table 4.20-1 and using (4.20-4), we can plot response (4.20-3). revised 2006 Mar 6 27 Spring 2006 Process Dynamics, Operations, and Control 10.450 -5 3 -1 make-up flow deviation (10 m s ) -3 inlet comp deviation (kg m) Lesson 4: Two Tanks in Series 1.5 1 0.5 0 -0.5 00 10 10 20 20 30 30 4400 0 -2 -4 -6 -8 -10 -12 -14 -3 outlet composition deviation (kg m) 0.90 0.80 Kc = 0.1 0.70 0.60 0.50 0.40 0.30 0.20 0.10 10 50 0.00 0 10 20 30 40 time (min) Figure 4.20-1: Oscillatory step response For the single tank of Lesson 3, the closed loop behavior was qualitatively the same as that of the process itself. Here, however, closing the loop has introduced behavior we would NOT see in the process alone: the response variable oscillates in response to a steady input. The key is the third-order characteristic equation, which can admit complex roots. The transfer function is third order because the second-order process was placed in a feedback loop with a first-order valve. If the system mathematics provide revised 2006 Mar 6 28 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series a true representation of the process equipment, we will see oscillations in operation. 4.21 closed-loop stability by the Bode criterion Figure 4.20-1 shows us that, despite the onset of oscillations, increasing gain suppresses the offset. However, we must still be mindful of the possibility of instability. In Figure 4.21-1 we plot the poles on a complex plane. We see that increasing gain brings the closed loop to the point of oscillation and then increases the imaginary (oscillatory) component. We observe also that the real component approaches zero. Recalling that stability depends on the real parts of the poles being negative, we see that the closed loop will become unstable at a controller gain between 50 and 60. 4.00 3.00 arrows show increasing Kc -1 imaginary (min ) 2.00 from 0 to 100 1.00 0.00 -1.00 -2.00 -3.00 -4.00 -12 -10 -8 -6 -4 -2 0 2 -1 real (min ) Figure 4.20-1: Root locus plot This root locus plot provides a map of the stability limit; this is particularly helpful, because we were unable to derive a single expression that showed the effect of controller gain on the real parts of the poles. We might imagine that finding the poles will only become more difficult as we consider more complicated processes and controllers. Hence we introduce an alternative means of predicting stability: the Bode criterion. We develop the criterion intuitively; recalling Figure 4.14-1, we begin by realizing that instability in a previously stable system happens because of feedback in a closed loop. Suppose that the output signal y′c contains some fluctuating component at a particular frequency ωc. This component is inverted in the comparator by being subtracted from the set point, and is revised 2006 Mar 6 29 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series fed to the controller. If the loop (process, controller, sensor, valve, etc.) contributes a phase delay of -180° at frequency ωc, the inverted signal returns to the output in phase to reinforce the fluctuation. If in addition the amplitude ratio at ωc is greater than one, the fluctuation will grow. We are not contriving a circumstance here. In any realistic process there will be small disturbances, fluctuations over a wide domain of frequency. The loop processes these fluctuations according to its frequency response characteristics. Depending on the amplitude ratio, signals at some frequencies may be amplified. Assuredly, signals at high frequencies will be delayed by at least 180°. If these conditions overlap, there will be an oscillating signal that will grow. We need not supply it; the system will select it from the spectrum of background noise. This intuitive development is described in more detail by Marlin (Sec.10.6). To turn our intuition into a method, we return to the general description of the closed loop transfer function in (4.16-2). Recall that the poles are the roots of the characteristic equation, which is the denominator of the transfer function. This characteristic equation is always of the form 1 plus the product of the transfer functions around the loop. For convenience, we will call this product the loop transfer function GL. characteristic equation = 1 + G s G c G v G m = 1+ GL (4.21-1) It is the amplitude ratio and phase angle, that is, the frequency response, of GL that determines whether signals will grow in the loop. First we find ωc, the frequency at which the phase delay is -180°. At this crossover frequency, we inspect the amplitude ratio; if it is less than one, the system will attenuate reinforced disturbances, and thus be stable. Thus the Bode criterion evaluates the stability of (1 + GL)-1 from the frequency response of GL. For our process, (4.16-4) gives G L (s) = C Ac F Kv KK (τ1s + 1)(τ2s + 1) τ vs + 1 c s (4.21-2) The phase angle of GL is the sum of the phase angles of the various elements in (4.21-2). revised 2006 Mar 6 30 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series ∠G L ( jω) = ∠ C Ac 1 1 1 KcKsK v + ∠ +∠ +∠ F τ1s + 1 τ 2s + 1 τ vs + 1 = 0 + tan −1 (− ωτ1 ) + tan (− ωτ2 ) + tan (− ωτ v ) −1 (4.21-3) −1 Equation (4.21-3) may be solved for the crossover frequency ωc; that is, the frequency at which the loop delays the signal by -180º. − 180D = tan −1 (− ωc τ1 ) + tan −1 (− ωc τ 2 ) + tan −1 (− ωc τ v ) (4.21-4) The amplitude ratio of GL is the product of the amplitude ratios of the various elements in (4.21-2). G L ( jω) = C Ac 1 1 1 KcKsK v × × × F τ1s + 1 τ 2s + 1 τ vs + 1 C = Ac K c K s K v F 1 1 1 + ω2 τ1 2 (4.21-5) 1 1 + ω2 τ 2 2 1 + ω2 τ v 2 We are particularly interested in the amplitude ratio at the crossover frequency, RAc. R Ac = C Ac KcKsK v F 1 1 2 1 + ωc τ1 2 1 2 1 + ωc τ 2 2 2 1 + ωc τ v 2 (4.21-6) Using the data in Section 4.19, we find the crossover frequency from (4.21-4) to be 2.25 radians minute-1. We notice that phase lag in the loop depends only on the tanks and valve; the proportional controller, being a “pure gain” system, contributes no lag to the dynamic response of the loop. Hence the crossover frequency does not vary with the controller gain setting. Using the crossover frequency and further data from Section 4.19, we find from (4.21-6) that the crossover amplitude ratio will be 1 when the controller gain Kc is 52.55. The effect of controller gain is to amplify the signals in the loop. Around Kc = 52.55, therefore, the system output will oscillate unabated at frequency ωc. At higher gain settings, the amplitude of the oscillation will grow in time. (The frequency of these oscillations depends on the poles of the transfer function.) Figure 4.21-1 is a Bode plot for the loop transfer function GL, showing gains below, at, and above the instability threshold. The stability threshold (amplitude ratio = 1, phase angle = -180°) is shown by a single point at the crossover frequency revised 2006 Mar 6 31 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series 1000 amplitude ratio 100 10 1 Kc = 100 52.55 0.1 0.01 0.01 0 25 0.1 1 10 100 phase angle (deg) -50 -100 -150 crossover point -200 -250 -300 0.01 0.1 1 10 100 -1 ω (radians min ) Figure 4.21-1: Bode plot for loop transfer function Figure 4.21-2 shows unstable step responses at gains of 60 and 100. The latter response quickly gets out of hand. Notice how the make-up flow varies in response to the increasing error in the outlet composition. revised 2006 Mar 6 32 Spring 2006 Process Dynamics, Operations, and Control 10.450 -3 -5 3 -1 make-up flow deviation (10 m s ) inlet comp deviation (kg m) Lesson 4: Two Tanks in Series 1.5 1 0.5 0 -0.5 00 55 10 10 15 15 20 20 25 25 30 30 50 40 30 20 10 0 -10 -20 -30 -40 -50 -3 outlet composition deviation (kg m) 0.30 0.20 Kc = 100 0.10 60 0.00 -0.10 -0.20 -0.30 0 5 10 15 20 25 30 time (min) Figure 4.21-2: Step response for two-tank process at high gains 4.22 tuning based on stability limit - gain and phase margin We tune a controller seeking good performance, somewhere between the extremes of “no control” and “instability”. One method of tuning is simply to maintain a reasonable distance from the instability limit and presume that the result is an improvement over having no control. Thus, revised 2006 Mar 6 33 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series we find the instability threshold and tune the controller to leave margins between these conditions and normal operation. The margins are indicated in Figure 4.22-1, which shows a Bode plot for the loop transfer function GL at some arbitrary controller setting. RA (2) 1 GM > 1 RAc (3) φ φ1 PM > 0 (1) -180 (4) ω1 ωc ω Figure 4.22-1: Illustration of gain margin and phase margin at a single controller setting The gain margin and phase margin are the distances shown on the ordinates. Their definitions are GM = 1 R Ac (> 1 for stability ) PM = 180D + φ1 (> 0 for stability ) (4.22-1) The controller setting determines the amplitude ratio and phase angle curves. From those curves we then calculate the margins to see if they are satisfactory: (1) (2) (3) (4) use a phase angle of -180° to find the crossover frequency ωc use an amplitude ratio of 1 to find the frequency ω1 use ωc to find the amplitude ratio RAc, and thus GM use ω1 to find the phase angle φ1, and thus PM In Figure 4.22-1, the system is stable. However, as the controller gain is increased, the Bode plot will shift so that ω1 and ωc approach each other. At the instability threshold, ω1 equals ωc, the gain margin is 1, and phase margin is zero. revised 2006 Mar 6 34 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series A procedure for tuning proportional controllers by stability margin is: (1) (2) (3) (4) (5) use a phase angle of -180° to find the crossover frequency ωc at ωc, find the gain that makes RAc = 1 (stability limit) at ωc, reduce the gain to make RAc = 1/GM (gain margin) use a phase angle of PM -180° to find the frequency ω1 at ω1, find the gain that makes RA = 1 (phase margin) Marlin (Sec.10.8) recommends tuning to maintain GM ~ 2 and PM ~ 30°. Typically one or the other will be limiting. Figure 4.22-2 shows the results of calculations for our tank example. Earlier, we found the crossover frequency from (4.21-4). Then (4.21-6) was solved for the controller gain that gave RAc = 0.5 (thus GM = 2). The result was Kc = 26.3. Then (4.21-3) was solved for the frequency ω1 to give a phase angle of -150° (thus PM = 30°). Then (4.21-5) was solved for the controller gain that gave an amplitude ratio of 1 at frequency ω1. The result was a much lower gain of 7. Therefore for our system, PM is limiting, and the lower gain would be chosen. For reference, Figure 4.222 also shows the stability limit determined earlier. The gain and phase margins have given us a tuning criterion for selecting a controller gain. Using the chosen gain, we can now predict the performance in response to disturbances and set point changes. The calculations would be similar to those illustrated in Sections 4.19 and 4.20: a partial fraction expansion leading to an expression for the response, with parameter values based on numerical root-finding. revised 2006 Mar 6 35 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series amplitude ratio 100 10 Kc = 52.55 1 26.3 0.1 7 0.01 0.01 0 0.1 1 10 100 0.1 1 10 100 phase angle (deg) -50 -100 -150 -200 -250 -300 0.01 -1 ω (radians min ) Figure 4.22-2: Bode plot illustrating GM and PM limits on gain 4.23 conclusion We have completed dynamic analysis and control of a more complicated process than in Lesson 3. In doing so we have introduced new tools for analysis - the Laplace transforms and block diagrams - and developed stability and tuning criteria. Was it a good idea to listen to the appealing advisor and put the make-up flow into the first tank? A good way to examine the question would be to repeat the full analysis for the other case. Even without doing that, however, we might reflect how removing one lag from the system might affect the Bode stability criterion for the closed loop… 4.24 reference Marlin, Thomas E. Process Control. 2nd ed. Boston, MA: McGraw-Hill, 2000. ISBN: 0070393621. 4.25 a nomenclature constant revised 2006 Mar 6 36 Spring 2006 Process Dynamics, Operations, and Control 10.450 Lesson 4: Two Tanks in Series A A1,A2 b B C C1… CA1 CA2 CAc CAi CAs ΔC F Fc f G Im j K L N(s) r Re RA RAc s t td U V1 V2 x(t) y(t) α1 … ε τ1 τ2 τv ξ ω ωc constant constants of integration constant constant constant constants in partial fraction expansion intermediate stream concentration of solute A exit stream concentration of solute A make-up stream concentration of solute A inlet stream concentration of solute A reference concentration of solute A at steady state change in solute concentration volumetric flowrate volumetric flowrate of make-up stream function transfer function operator that takes imaginary part of complex number square root of -1 gain (time-independent part of transfer function) Laplace operator polynomial in s dummy variable in polynomial characteristic equation operator that takes real part of complex number the amplitude ratio of the loop transfer function the amplitude ratio of the loop transfer function at the crossover frequency complex Laplace domain variable time time at which disturbance occurs unit step function volume of tank 1 volume of tank 2 input signal to system output signal from system roots of polynomial in s error; set point minus controlled variable time constant of tank 1 time constant of tank 2 time constant of valve dummy variable of integration radian frequency (has dimensions of radians time-1) crossover frequency, at which loop transfer function lag is -180° revised 2006 Mar 6 37