Lesson 4: Two Tanks in Series: Spring 2006 Process Dynamics, Operations, and Control 10.450
Lesson 4: Two Tanks in Series: Spring 2006 Process Dynamics, Operations, and Control 10.450
Lesson 4: Two Tanks in Series: Spring 2006 Process Dynamics, Operations, and Control 10.450
10.450
volume V1 volume V2
F, CA2
(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
(4.1-2)
Spring 2006
10.450
(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.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 CA1, we may integrate it directly to find CA1 as a function of the input CAi. This solution becomes the forcing function in the second equation, which may be integrated directly to find CA2. That is
(4.1-4)
C'A1 =
1 t 1 t 1 ' e e C Ai dt 1 0
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-1)
C 'A 2 =
(4.2-2)
On defining a specific disturbance CAi we can integrate (4.2-2) to a solution. Alternatively, we may eliminate the intermediate variable CA1 between the equations (4.1-4) and obtain a second-order equation for CA2 as a function of CAi. The steps are (1) differentiate the second equation (2) solve the first equation for the derivative of CA1 revised 2006 Mar 6 2
Spring 2006
10.450
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
+ A 2e
( )
(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.
Spring 2006
10.450
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.
C*A2/ C
y(s) = L{y( t )} = y( t )e st dt
0
(4.4-1)
(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.
Spring 2006
10.450
= C e st dt
td
(4.4-2)
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 =
Operational transforms: this allows us to transform entire equations, not just particular functions.
(4.4-3)
(4.4-4)
t t L f ( )d = f ( )d e st dt 00 0
t 1 1 st f ( )d e st = f (t )e dt d s 0 0 s0
1 1 = L{f (t )} f ( )d e st s0 s
t
(4.4-5)
1 = L{f (t )} s
Spring 2006
10.450
(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.
(4.4-8)
C3 C1 C2 N(s) = + + 2 2 (s 1 ) (s 2 ) (s 2 ) (s 1 )(s 2 )
Some roots may appear as complex conjugate pairs, so that, for example 1 = a + jb 2 = a jb where j is the square root of -1. how to solve for the coefficients - its 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
(4.4-9)
(4.4-10)
Spring 2006
10.450
dC 'A1 1 + C 'A1 = C 'Ai dt dC 'A 2 2 + C 'A 2 = C 'A1 dt 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.1-4)
{ }
{ } { }
(4.5-1)
We next perform an operational transform on the derivative. Because the functional forms of the variables CA1 and CAi 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)
We can easily solve (4.5-2) for CA1. If we similarly treat the second equation in (4.1-4), we arrive at the equivalent formulation in the Laplace domain.
(4.5-2)
Spring 2006
C 'A1 (s) =
' A2
10.450
(4.5-3)
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 CAi(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)
(4.5-6)
(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:
Spring 2006
10.450
(4.5-8)
(4.5-9)
(4.5-10)
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).
(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:
Spring 2006
y ' (s) =
10.450
(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 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
(4.6-5)
poles
K dy' + y ' ( t ) = Kx ' ( t ) s + 1 dt nd ' 2 ' 2 order K d y dy + y ' = Kx ' ( t ) overdamped* 12 2 + (1 + 2 ) ( 1s + 1)( 2s + 1) dt dt nd *why overdamped? There are other 2 order forms to be encountered.
4.7 describing systems with block diagrams The block diagram is a graphical display of the system in the Laplace domain.
x(s) G(s)
y(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):
10
Spring 2006
10.450
inputs
system
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) G2(s) y' 2(s) G3(s) y' 3(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' x 1(s) G1(s) y' y 1(s) G2(s) y' y 2(s)
y' 1(s)
G3(s)
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) ) ' = G 3 (s)G1 (s)x1 (s) G 3 (s)G 2 (s)x '2 (s)
(4.7-2)
(4.7-3)
11
Spring 2006
10.450
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.
y' 2(s)
x' x 1(s)
G1(s) G2(s)
G1(s) G3(s)
y' y 3(s)
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),
12
Spring 2006
G ( j) =
10.450
= K 1K 2 = K 1K 2
1 1 2 2 (1 + 2 ) j 2 2 1 + 1 2 1 + 2 2
(1 + )(1 + ( )(
(1 1j)(1 2j)
2 2
(4.8-1)
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. G ( j) = K1K 2 = K 1K 2 =
(1 + )(1 + ) 1 + ( + ) + (1 + )(1 + )
2 2 2 1 2 2 2 1 2 2 1 2 4 2 2 2 1 2 2
(1 ) + ((
2 2 1 2
1 2
+ 2 ))
2 2
(4.8-2)
K 1K 2 1 + 1 2 1 + 2 2
2 2
Furthermore, the phase angle of G(j) is the frequency response phase angle.
G ( j) = tan 1 Im(G ( j) ) Re(G ( j) ) (1 + 2 ) = tan 1 1 1 2 2
(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.
13
Spring 2006
1.00 amplitude ratio/gain
10.450
0.10
0.01 0.01 0 -30 phase angle (deg) -60 -90 -120 -150 -180 0.01
0.1
10
100
1.1
2 = 20 1
0.1
1 (12)0.5 (radians)
10
100
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 ' + a n 1 n 1 + dt n dt + a1 dy ' + y' = x ' dt (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
10.450
The solution to (4.9-2) is the sum of n terms, each containing a factor eit, 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 + x (s) (4.9-4)
+ a 1s + 1
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; its 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
10.450
(4.11-1)
C V1 dC A1 + C A1 = C Ai + Ac Fc F F dt V2 dC A 2 + C A 2 = C A1 F dt 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 CA1(s) to find
C 'A 2 (s) =
(4.11-2)
(1s + 1)( 2s + 1)
C 'Ai (s) +
(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)
(1s + 1)( 2s + 1)
C Ac F 1s + 1)( 2s + 1) ( C'A 2 (s)
Fc' (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
16
Spring 2006
10.450
Fc Fbias = K gain (C A 2,setpt C A 2 ) 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 xd(s) xm(s) Gd(s) Gm(s) yc (s)
(4.12-1)
sensor Gv(s) y
co(s)
Gs(s) ys (s)
ysp,e(s)
ysp(s)
17
Spring 2006
10.450
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
18
Spring 2006
10.450
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 ' where the error is conventionally defined with the set point as positive:
' ' ' = y sp y s
(4.15-3)
(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 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)
(4.15-6)
19
Spring 2006
10.450
(4.15-8)
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)
y 'c (s) =
(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 KcKs KcKs vs + 1 vs + 1 Gm
(4.16-3)
20
Spring 2006
10.450
C 'A 2 (s) =
(1s + 1)( 2s + 1)
1
C 'Ai (s) +
C Ac F Kv KK (1s + 1)( 2s + 1) vs + 1 c s C' (s) (1s + 1)(2s + 1) ' ' C A 2 (s) = C Ai (s) + A 2 ,sp C Ac F Kv C Ac F Kv 1 + 1 + ( s + 1)( s + 1) s + 1 K c K s ( s + 1)( s + 1) s + 1 K c K s 1 2 v 1 2 v
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).
21
Spring 2006
10.450
(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 CAi(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.
22
Spring 2006
10.450
(4.18-2)
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 = C2 = C3 = v 1 + 1 (1 2 )(1 3 ) v 2 + 1 ( 2 1 )( 2 3 ) v3 + 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, CA2,sp(s) is identically zero.
C 'A 2 (s) = C1 C3 ' C2 + + C Ai (s) s 1 s 2 s 3 1 1 1 C3 C2 C1 1 1 C 'Ai (s) = + 2 + 3 1 2 v 1 s + 1 1 s + 1 1 s + 1 1 3 2 1 1 2 v
(4.18-4)
23
Spring 2006
10.450
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 1 2 v 1 1 s + 1s s + 1s s + 1s 1 3 2 Each term inverts to a step response. Remembering to apply the time delay, we find the result
C 2 (t) = A CU(t t d ) C1 C3 C 2 1 e1 (t t d ) + 1 e2 (t t d ) + 1 e3 (t t d ) 12 v 2 3 1
(4.18-6)
(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 CA2 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 = 610-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])
24
Spring 2006
10.450
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.
25
Spring 2006
10.450
10 10
20 20
30 30
40 40
-6
3 -1
Kc = 0
0.012
0.024
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!
26
Spring 2006
10.450
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 C2 = A + jB 2
3 = a jb C3 = A jB 3 (4.20-1)
We substitute these definitions into (4.18-7), recalling Eulers relation, e (a + jb )t = e at (cos bt + j sin bt ) 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
(4.20-2)
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=
( (a B=
v
b v a 2 + b 2 + 1b 2ab 2 2b a 2 + b 2 (1 a ) + b 2
2 2
2 +b 1 a ) + a (1 a ) + b 2 2b a 2 + b 2 (1 a ) + b 2
)[ )(
(4.20-4)
)[
Taking data from Table 4.20-1 and using (4.20-4), we can plot response (4.20-3).
27
Spring 2006
inlet comp deviation (kg m)
10.450
3 -1
-5
-3
0.80 0.70 0.60 0.50 0.40 0.30 0.20 0.10 0.00 0 10 20 time (min)
Kc = 0.1
10 50
30 40
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
10.450
-2
real (min )
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 yc 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
10.450
The phase angle of GL is the sum of the phase angles of the various elements in (4.21-2).
30
Spring 2006
10.450
= 0 + tan
( 1 ) + tan ( 2 ) + tan ( v )
1 1
(4.21-3)
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. 180 = tan 1 ( c 1 ) + tan 1 ( c 2 ) + tan 1 ( c v ) 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 1 1 + 2 1
2
(4.21-4)
C = Ac K c K s K v F
1 1 + 2 2
2
1 1 + 2 v
2
(4.21-5)
We are particularly interested in the amplitude ratio at the crossover frequency, RAc. R Ac = C Ac KcKsK v F 1 1 + c 1
2 2
1 1 + c 2
2 2
1 1 + c v
2 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
31
Spring 2006
10.450
Kc = 100 52.55 25
0.1
10
100
-50 phase angle (deg) -100 -150 -200 -250 -300 0.01
crossover point
0.1
1 (radians min )
-1
10
100
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.
32
Spring 2006
10.450
-3
0.20
Kc = 100
0.10 0.00 -0.10 -0.20 -0.30 0 5 10 15 time (min) 20 25 30
60
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,
33
Spring 2006
10.450
1 -180
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
(4.22-1)
PM = 180 + 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.
34
Spring 2006
10.450
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.
35
Spring 2006
10.450
amplitude ratio
0.01 0.01 0
0.1
10
100
-50 phase angle (deg) -100 -150 -200 -250 -300 0.01
0.1
1 (radians min )
-1
10
100
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
36
Spring 2006
10.450
37