You are on page 1of 9

Fall 2004 ICE Topics: Process Control by Design 10.

492
Lecture Notes 2: Simulating the Shower Process

the shower process is simple enough that we can simulate its operation
Over the past decade our tools for simulating processes have greatly improved. In particular, we
can predict how the process will behave under dynamic conditions: startup, disturbance, and
shutdown. Dynamic simulation can aid in specifying the control scheme and may catch potential
operating problems.

For the shower, we do not need a complex computer code – we can derive and solve a decent
equation set by hand. We will do this simulation to illustrate
• a simple control algorithm
• how the process behavior was indicated by the RGA and DC tools

Simulation thus allows us to check the efficacy of our screening tools.

first we need to talk some more about process control


Recall how we defined feedback control: measurement of CV used to motivate a change in MV
to keep CV at set point. To put this into practice, we must assert some control algorithm, that is,
a way to calculate how much to move MV. We begin by defining error:

ε( t ) = SP − CV( t ) (2-1)

Error is the difference between the desired value of CV, called the set point SP, and CV. Of
course, CV might wander around with passing time, and so error would, as well. If CV is at the
set point, the error is zero; should CV be disturbed, the error might be positive or negative. The
error is the input to the control algorithm.

the simple Proportional algorithm for a controller


An intuitively appealing algorithm is to make the response proportional to the error.

MV( t ) = BC + K C ε( t ) (2-2)

MV the manipulated variable, which may vary in time


BC the value of MV when error is zero; known as the bias
KC adjustable controller gain (+ or -)

we apply the proportional controller to our process


Start with flow control. Call the set point Fsp. Then the error in the flow is

ε F = Fsp − F
= Fsp − Fr − F + Fr (2-3)
= Fsp' − F'

By introducing our reference value Fr into the definition, we see that the error is also the
difference between two deviation variables. In many cases, of course, we would take the set
point value Fsp to be the same as our reference value, so that Fsp′ is identically zero. However,

revised 2004 Dec 16 Dr. Barry S. Johnston, Copyright 2004. 1


Fall 2004 ICE Topics: Process Control by Design 10.492
Lecture Notes 2: Simulating the Shower Process
distinguishing Fsp from Fr allows us to easily describe set point changes – that is, moving the
process from one condition to another under the supervision of the controller.

the error can be scaled


When we divide the error by the operating range for flow, we obtain a dimensionless error.

εF
ε*F = = Fsp*' − F*' (2-4)
∆F

If we pair CV flow and MV hot water, the controller algorithm (2-2) is now written in these
dimensionless terms.

Fh*' = K *CF ε *F (2-5)

Fh*’ the scaled deviation hot water flow


KCF* dimensionless gain (+, so that an increase in F will decrease Fh)

The magnitude of the gain KCF* may be increased to provide more aggressive controller action.
For example, a gain of 1 means that a 10% error will motivate a 10% change in manipulated
variable. Increasing the gain to 2 produces a 20% change in MV. Notice that the bias in (2-2)
has been absorbed into the deviation variables. When error εF* is zero, no change is made to Fh,
so Fh*′ is zero.

we treat the temperature controller the same way


We will control T by manipulating the cold water flow.

εT
ε*T = = Tsp*' − T *' (2-6)
∆T

Fc*' = K *CT ε*T (2-7)

In contrast to the flow controller, KCT* should be negative, so that the controller will respond to
an increase in temperature (εT* < 0) by increasing the cold flow Fc.

what is a controller anyway?


The controller is some device that receives the error input and puts out a direction to the
manipulated variable. Often, it is a computer that runs a control program; the program computes
the MV value at frequent intervals, and the resulting number is transmitted to a transducer that
moves a valve stem. The controller can instead be a mechanical device – a common example is
the lever mechanism in the flush toilet. Whatever the hardware, its job is to execute the
algorithm, and if the device and the math are reasonably close, we can describe its behavior
mathematically.

revised 2004 Dec 16 2


Fall 2004 ICE Topics: Process Control by Design 10.492
Lecture Notes 2: Simulating the Shower Process
the control algorithm becomes part of the math model of the system
We have a linear system model of the shower, and we propose to install controllers. Thus the
controller equations (2-5) and (2-7) must be introduced into the M&EB equations. They
eliminate the manipulated variables, resulting in

∆Fh * *' ∆F
F*' =
∆F
( ) (
K CF Fsp − F*' + c K *CT Tsp*' − T *'
∆F
) (2-8)

⎡ T − Tr ⎤ ∆Fh * *' ⎡ T − Tr ⎤ ∆Fc * F ∆Th *' Fcr ∆Tc *'


T *' = ⎢ hr
F

∆T
( )
K CF Fsp − F*' + ⎢ cr
F

∆T
( )
K CT Tsp*' − T *' + hr
F ∆T
Th +
F ∆T
Tc (2-9)
⎣ r ⎦ ⎣ r ⎦ r r

Now we have some rearrangement to do: we must express these two equations so that the outputs
(F*′ T*′) are functions of inputs (disturbances Th*′ Tc*′ and set points Fsp*′ Tsp*′). We can do this
by
• solving the MB (2-8) for F*′
• substituting F*′ into the EB (2-9) and solving that for T*′
• substituting T*′ back into the MB and solving again for F*′

the result isn’t pretty

⎧⎡ ∆Fh * ∆F ∆F 1 ⎤ ⎡ ∆F ⎤ ⎫
⎪⎢ K CF + c h K *CF K *CT (Tcr − Thr )⎥ Fsp*' + ⎢ c K *CT ⎥ Tsp*' ⎪
⎪⎣ ∆F ∆F ∆T Fr ⎦ ⎣ ∆F ⎦ ⎪1
F*' = ⎨ ⎬ (2-10)
⎪+ ⎡− ∆Fc ∆Th Fhr K * ⎤ T *' + ⎡− ∆Fc ∆Tc Fcr K * ⎤ T *' ⎪D
⎪ ⎢ CT ⎥ h ⎢ CT ⎥ c ⎪
⎩ ⎣ ∆F ∆T Fr ⎦ ⎣ ∆F ∆T Fr ⎦ ⎭

⎧⎡ ∆Fh Thr − Tr * ⎤ *' ⎡ ∆Fc Tcr − Tr * ∆F ∆F T − Thr * * ⎤ *' ⎫


⎪⎢ K CF ⎥ Fsp + ⎢ K CT + c h cr K CF K CT ⎥ Tsp ⎪
⎪⎣ ∆T Fr ⎦ ⎣ ∆T Fr ∆F ∆T Fr ⎦ ⎪1
T =⎨
*'
⎬ (2-11)
⎪+ ⎡ ∆Th Fhr ⎛1 + ∆Fh K * ⎞⎤ T *' + ⎡ ∆Tc Fcr ⎛1 + ∆Fh K * ⎞⎤ T *' ⎪D

⎪ ∆T F ⎝ ⎜ CF ⎟ ⎥ h ⎢ ⎜ CF ⎟ ⎥ c ⎪
⎩ ⎣ r ∆F ⎠⎦ ⎣ ∆T Fr ⎝ ∆F ⎠⎦ ⎭

where

∆Fh * ∆F 1 ∆F ∆F 1
D = 1+ K CF + c K *CT (Tcr − Tr ) + c h K *CF K *CT (Tcr − Thr ) (2-12)
∆F ∆T Fr ∆F ∆T Fr

these equations represent a different system: the original piping plus controllers
That is why they are more complicated than our original M&EB. The first thing we notice,
perhaps, is that temperature disturbances affect the flow rate! Of course, this is due to the
feedback structure, which begins turning valves when either the flow or temperature departs
from set point. We notice, as well, that changing either set point affects both controlled
variables.

revised 2004 Dec 16 3


Fall 2004 ICE Topics: Process Control by Design 10.492
Lecture Notes 2: Simulating the Shower Process

These interactions may not in themselves be bad. However, looking at the equations in more
detail will show that a persistent change in either inlet temperature – such that Th*′ or Tc*′ remains
non-zero – will cause both F*′ and T*′ to remain non-zero. Thus our controllers are not satisfying
our original operating objectives of keeping the shower at the set point!

This inability to return to set point is a property of proportional control; it is known as “offset”.
Offset also occurs for a change in set point: the controlled variables cannot attain the new desired
values. Offset can be reduced by increasing the controller gain. It can be eliminated by a more
sophisticated controller algorithm, but that is the subject of 10.450.

This is a good time to recall that our model regards all input changes as being immediately
transmitted to the output. Hence, equations (2-10) through (2-12) can describe a steady state, but
they also describe time-varying behavior, even though time does not appear explicitly.

always try out a complicated model on simple cases


We can learn more about our system by examining how the equations simplify for limiting
conditions.

no temperature control – turn KCT* down to zero (open the temperature loop)
The material balance (2-10) becomes

∆Fh *
K CF
F =
*' ∆F Fsp*' (2-13)
∆F
1 + h K *CF
∆F

Without the temperature controller, there is no mechanism for temperature disturbances to affect
the flow. A set point change will never be fully achieved (offset), but increasing the gain KCF*
makes the approach closer. The energy balance (2-11) becomes

∆Fh Thr − Tr *
K CF
∆T Fr ∆T F ∆T F
T =
*'
Fsp*' + h hr Th*' + c cr Tc*' (2-14)
∆F ∆T Fr ∆T Fr
1 + h K *CF
∆F

Temperature disturbances affect the shower temperature without interference from the flow
controller. A set point change in shower flow will affect the temperature by an amount that
increases with the controller gain. Hence, attempting to reduce flow offset will increasingly
disturb temperature.

no flow control – turn KCF* down to zero (open the flow loop)
The balances become

revised 2004 Dec 16 4


Fall 2004 ICE Topics: Process Control by Design 10.492
Lecture Notes 2: Simulating the Shower Process

⎧⎡ ∆F ⎤ ⎡ ∆F ∆Th Fhr * ⎤ *' ⎡ ∆Fc ∆Tc Fcr * ⎤ *' ⎫ 1


F*' = ⎨⎢ c K *CT ⎥ Tsp*' + ⎢− c K CT ⎥ Th + ⎢− K CT ⎥ Tc ⎬ (2-15)
⎩ ⎣ ∆F ⎦ ⎣ ∆F ∆T Fr ⎦ ⎣ ∆F ∆T Fr ⎦ ⎭D

⎧⎡ ∆F T − Tr * ⎤ *' ⎡ ∆Th Fhr ⎤ *' ⎡ ∆Tc Fcr ⎤ *' ⎫ 1


T *' = ⎨⎢ c cr K CT ⎥ Tsp + ⎢ ⎥ Th + ⎢ ⎥ Tc ⎬ (2-16)
⎩⎣ ∆T Fr ⎦ ⎣ ∆T Fr ⎦ ⎣ ∆T Fr ⎦ ⎭ D

where

∆Fc 1 *
D = 1+ K CT (Tcr − Tr ) (2-17)
∆T Fr

As controller gain is increased, the outlet temperature is less affected by inlet temperature
disturbances. Correspondingly, temperature set point changes are more faithfully followed.
Once again, however, increased gain means that the flow is increasingly affected by both
disturbances and temperature set point changes.

does the simulation bear out our RGA predictions?


The RGA said that our hot-flow-to-flow and cold-flow-to-temperature pairings would be good if
the flow were mostly hot, and bad if the flow were mostly cold. Let’s take the best case: the
outlet flow at the reference condition is entirely composed of hot inlet flow. Thus

Fr = Fhr Fcr = 0 (2-18)

and

Tr = Thr (2-19)

Making these substitutions, we find

∆Fh * ∆Fc *
K CF K CT
F*' = ∆F Fsp*' + ∆F Tsp*'
∆Fh * ⎛ ∆Fh * ⎞⎛ ∆Fc Tcr − Tr * ⎞
1+ K CF ⎜1 + K CF ⎟⎜⎜1 + K CT ⎟⎟
∆F ⎝ ∆F ⎠⎝ ∆T Fr ⎠
(2-20)
∆F ∆Th *
− c K CT
+ ∆F ∆T Th*'
⎛ ∆Fh * ⎞⎛ ∆Fc Tcr − Tr * ⎞
⎜1 + K CF ⎟⎜⎜1 + K CT ⎟⎟
⎝ ∆F ⎠⎝ ∆T Fr ⎠

revised 2004 Dec 16 5


Fall 2004 ICE Topics: Process Control by Design 10.492
Lecture Notes 2: Simulating the Shower Process
∆Fc Tcr − Tr * ∆Th
K CT
∆T Fr ∆T
T *' = T*' + T *' (2-21)
∆Fc Tcr − Tr * sp ∆Fc Tcr − Tr * h
1+ K CT 1+ K CT
∆T Fr ∆T Fr

The flow (2-20) can be made to approach set point by increasing KCF*. Increasing KCF* also
helps to suppress the effects of temperature set point and disturbance changes on flow. The flow
controller gain has no effect on the outlet temperature (2-21). Increasing KCT* improves
temperature set point response and suppresses the effect of disturbances.

Reducing loop interaction, as directed by the RGA results, certainly improves the control
response! In this limiting case, we seem to be able to increase controller gains arbitrarily without
ill effect. If we are sufficiently curious, we can check out the opposite limiting case.

does the simulation bear out our DC predictions?


DC said that the most difficult disturbance combination to overcome was a change by both inlet
temperatures in the same direction. Of course, by using proportional control in our simulation,
we have allowed offset to occur in the controlled variables. By having offset, we violate the
assumption of perfect control that we used to derive DC. Even so, we should be able to examine
what the simulation predicts for disturbances. We assume that set points are unchanged, so that
the set point deviation variables are zero. From (2-10) through (2-12) the disturbance responses
are

⎧⎡ ∆F ∆Th Fhr * ⎤ *' ⎡ ∆Fc ∆Tc Fcr * ⎤ *' ⎫ 1


F*' = ⎨⎢− c K CT ⎥ Th + ⎢− K CT ⎥ Tc ⎬ (2-22)
⎩ ⎣ ∆F ∆T Fr ⎦ ⎣ ∆F ∆T Fr ⎦ ⎭D

⎧⎡ ∆T F ⎛ ∆F ⎞⎤ ⎡ ∆T F ⎛ ∆F ⎞⎤ ⎫ 1
T *' = ⎨⎢ h hr ⎜1 + h K *CF ⎟⎥ Th*' + ⎢ c cr ⎜1 + h K *CF ⎟⎥ Tc*' ⎬ (2-23)
⎩⎣ ∆T Fr ⎝ ∆F ⎠⎦ ⎣ ∆T Fr ⎝ ∆F ⎠⎦ ⎭ D

where

∆Fh * ∆F 1 ∆F ∆F 1
D = 1+ K CF + c K *CT (Tcr − Tr ) + c h K *CF K *CT (Tcr − Thr ) (2-24)
∆F ∆T Fr ∆F ∆T Fr

If Th*′ = Tc*′ (whether positive or negative)

∆Fc 1 1 K *CT *'


F*' = − Th [∆Th Fhr + ∆Tc Fcr ] (2-25)
∆F ∆T Fr D

1 1 ⎛ ∆Fh * ⎞ Th*'
T *' = ⎜1 + K CF ⎟ [∆Th Fhr + ∆Tc Fcr ] (2-26)
∆T Fr ⎝ ∆F ⎠ D

revised 2004 Dec 16 6


Fall 2004 ICE Topics: Process Control by Design 10.492
Lecture Notes 2: Simulating the Shower Process
If Th*′ = -Tc*′

∆Fc 1 1 K *CT *'


F =−
*'
Th [∆Th Fhr − ∆Tc Fcr ] (2-27)
∆F ∆T Fr D

1 1 ⎛ ∆Fh * ⎞ Th*'
T *' = ⎜1 + K CF ⎟ [∆Th Fhr − ∆Tc Fcr ] (2-28)
∆T Fr ⎝ ∆F ⎠ D

For the first case, in which disturbances move in the same direction, the term in brackets is
larger, which implies a larger offset in the controlled variables. Thus the case identified by DC
as the most costly to mitigate also shows the worst control response.

is there a best design to propose?


The real shower will have some degree of interaction between the loops, so that cavalier
increases in controller gain are to be avoided. Probably the easiest way to answer this question
(when we are not at a limiting case) is to compute numerical predictions from the equations over
a domain of realistic conditions. Perhaps we can find gain settings that allow two controllers to
maintain conditions at better offsets than would either controller acting alone. The spreadsheet
model “shower controllability analysis.xls” demonstrates these computations.

let’s review what we have done, as a guide to designing a process


• We began with a process scheme for a shower, which we sketched out as a process flow
diagram.
• We made material and energy balances. This allowed us to compute steady state
reference conditions.
• Thinking about transients, we specified our control objectives.
• We classified the variables into useful input and output categories. Specifically, we
identified controlled, manipulated, and disturbance variables.
• We simplified the material and energy balances by Taylor series linearization. This
allowed us to express our process behavior using a standard linear system form.

y*' = Pm* x *'m + Pd* x *'d

• Using the linear system, we computed the RGA to explore pairing of CV and MV.
• We also computed DC to identify the most severe disturbance conditions.
• Upon choosing a control algorithm, we added controller equations to the system model
and computed the system response under control.

final message
• The next step would be the detailed design – pipe sizes, and so forth – which will be
beyond our scope. Of course, we could have gone straight to detailed design after
computing the steady-state reference conditions. However, some transient screening
tools applied in the early stages may save you from designing a fine-looking steady-state
that would be an operating disaster.

revised 2004 Dec 16 7


Fall 2004 ICE Topics: Process Control by Design 10.492
Lecture Notes 2: Simulating the Shower Process
• Actually, the RGA has shown us that loop interaction will always be present for realistic
operating conditions. Hence a better design would attack the interaction problem
directly.

For example, we could redefine our manipulated variables. We add a total flow control
valve, directed by the flow measurement. Then we use a ratio controller to set hot and
cold proportions. The controller algorithms are standard and non-specific to our
particular process. (Perhaps you have seen showers in which you set temperature by
rotating a valve handle and set flow by adjusting the shower nozzle. There is usually
insignificant interaction between the two manipulations.)

Fh T h F T

FT

Fc T c

Alternatively, we could write a special-purpose controller algorithm (it would surely


include material and energy balance equations!) that would accept two measurement
inputs and compute two valve settings. Sometimes this extra effort in control design pays
off in better process operation.

Fh T h F T

FT

Fc T c

Thus we can do better than the simple two-loop control scheme we proposed in the
beginning. The RGA has allowed us to recognize this in the preliminary design stage,
before we committed too much money on something that wouldn’t work.

• The shower is a simple system, so we could analyze the whole problem with math. We
will next go to a more complicated system for which analytic solutions are impractical,
even if possible. However, we will follow the same design scheme, with the same
intentions, even if we use different tools to get the job done.

nomenclature
BC bias; the value of MV when the controlled variable is at its set point

revised 2004 Dec 16 8


Fall 2004 ICE Topics: Process Control by Design 10.492
Lecture Notes 2: Simulating the Shower Process
D a constant denominator in several equations
F volumetric flow rate
KC controller gain
Pd matrix of gain coefficients for the disturbance variables
Pm matrix of gain coefficients for the manipulated variables
T temperature
xd vector of input variables into the system, the disturbance variables
xm vector of input variables into the system, the manipulated variables
y vector of output variables from the system, the controlled variables
∆F the range over which flow is expected to operate
∆T the range over which temperature is expected to operate
ε error; the set point value minus the controlled variable value at any time

abbreviations
CV “controlled variable”, a system output that we wish to maintain at a set point value
DC “disturbance cost”
DV “disturbance variable”, a system input that we have no influence over
MV “manipulated variable”, a system input that we may adjust for our purposes
RGA “relative gain array”
SP “set point”, the desired value of the controlled variable

subscripts
c cold water supply stream
F pertaining to the flow controller
h hot water supply stream
r a reference operating condition around which we derive a linear approximation
sp set point value of controlled variable F or T
T pertaining to the temperature controller

superscripts
′ indicates a deviation variable; i.e., the physical variable minus a reference value
*
indicates a scaled variable; i.e., variable has been divided by its operating range

revised 2004 Dec 16 9

You might also like