Professional Documents
Culture Documents
A pocket guide
by Gregory K. McMillan
and Robert A. Cameron
Copyright © 2004
ISBN 1-55617-857-3
– Data is in Progress –
PREFACE xiii
Table of Contents
Overview ................................................1
Procedure................................................8
Examples ..............................................24
References.............................................32
Overview ..............................................33
Procedure..............................................50
Examples ..............................................56
References.............................................70
Chapter 3.0—Setup.....................................................71
Overview ..............................................71
Procedure..............................................86
Examples ..............................................88
References.............................................96
TABLE OF CONTENTS ix
Chapter 4.0—Tuning ..................................................99
Overview ..............................................99
Procedure............................................111
Examples ............................................117
References...........................................141
x TABLE OF CONTENTS
1.0—Simulation
Overview
Process control deals with change. If process
conditions were constant there would be no
need for a control system. In a plant, the operat-
ing conditions continually fluctuate, primarily
because of changes in raw materials, production
rate, product mix, equipment performance, foul-
ing, catalyst, utilities, and ambient conditions.
Except for production rate changes, most of
these disturbances, as well as their effect on key
process variables, are not measured on line.
Control systems do not eliminate this variabil-
ity, but they can transfer it from a controlled
variable to a less important manipulated vari-
able. Control systems can also move the process
to a more optimum operating point.
SIMULATION 1
tuner than any knowledge of the process dynam-
ics and objectives. Plants rarely try to decouple
PID controllers, but when they do it is primarily
based on just some estimated steady state gains.
2 SIMULATION
MPC uses an experimental dynamic model that
is obtained by making steps in the manipulated
and disturbance variables, identifying either
matrix coefficients directly or the parameters,
such as process gain, time delay, and time lag, so
as to predict a trajectory from previous changes
in the manipulated and disturbance variables.
The models are linear, and the effects are com-
bined by linear superposition. Thus, the knowl-
edge of the future that MPC provides excludes
the effect of nonlinearities and unmeasured
upsets. These unknowns are addressed in the
present by biasing the trajectory by a fraction of
the difference between the predicted and actual
value. The old adage that you can only control
what you know still applies.
SIMULATION 3
apply dynamic PFD models to improve the
capability of MPC. Consider what opportunities
would open up if the conditions, properties, and
compositions of each stream in the PFD that was
used to design the plant were updated dynami-
cally and displayed. The previously unknown
upsets could become disturbance variables, and
users could add compositions and yields that are
real indicators of product quality and process
performance as controlled variables to the MPC.
The dynamic PFD model could be driven to
explore nonlinearities and new operating regions
as well as step-tested to identify the parameters
for the MPC experimental models. At a mini-
mum, the insight and knowledge users gain from
exploring the dynamics and pathways of vari-
ability would improve the design and justifica-
tion of MPC systems.
4 SIMULATION
accumulating energy and material within a
volume. These models typically could only be
run and maintained by the programmer, who
was one of an elite handful of specialists in the
process industry.
SIMULATION 5
they do not involve partial differential equa-
tions. Since the accumulation, generation, and
consumption are all zero, steady state models
cannot be used to simulate batch operations,
startups, shutdowns, transitions, reaction kinet-
ics, crystal growth or attrition, and cell birth,
growth, or death. With respect to process
dynamics, successive runs could be made to
show the change in the process variable within
the volume for a specific change in a disturbance
or manipulated variable. In fact, a steady state
model excels at this capability since it has the
quality and complexity of detail that’s needed to
reveal process relationships and interactions.
6 SIMULATION
SIMULATION Figure 1-1 — Lumped Parameter Model
recycle
Subsystem Boundary
Inputs Outputs
Accumulation, Generation,
and Consumption of
Material and Energy
In steady state models, the accumulation, generation, and consumption are zero. Valve size, pressure
drop, and position have no effect on flow. The outputs are calculated from inputs. For recycle streams,
the program iterates until the output and the input of the recycle block are within a tolerance spec.
7
recently, developing dynamic models was a sepa-
rate and intensive effort that involved program-
ming hundreds to thousands of differential
equations. Now that dynamic PFD models can
be built on the knowledge stored in the steady
state model, we have the best of both worlds.
Procedure
The procedure presented in this section
describes how to create the high-fidelity virtual
plant on a laptop shown in figure 1-2 by build-
ing a “dynamic ready” graphical steady state
PFD model with an OPC interface to a virtual
DCS that has integrated advanced control tools
[1.1]. While some of the specific terms used in
these procedures are pertinent to a particular
software package, the steps and concepts are gen-
erally applicable.
8 SIMULATION
SIMULATION Figure 1-2 — High-Fidelity Virtual Plant on a Laptop
Integrated Advanced Control Tools:
Online Performance Monitoring
Abnormal Situation Management
Online Property Estimation
Model Predictive Control
10 SIMULATION
SIMULATION
11 Figure 1-3 — Conditions, Properties, and Compositions of Streams
number in black is a value that the model
calculates or the fluid package sets and can
be exported to the DCS. When the PFD is
complete, verify that the dynamic specifica-
tion is pressure for each stream entering
and exiting the PFD.
12 SIMULATION
5. To combine streams, use a mixer with
“equalize all” for the pressure specification.
Use a mixer to provide valves in parallel.
This will enable you to simulate split-
ranged valves or prevent excessive surge by
ensuring a minimum leakage flow to a com-
pressor or turbine.
SIMULATION 13
and switch the dynamic specification from
pressure drop to flow coefficient for both
the tube and shell side.
14 SIMULATION
flow coefficient for each tray. Make sure the
inlet pressure of each stream matches the
pressure in the equipment. For columns,
this means matching feed, reflux, and
reboiler stream pressures to the proper tray
pressure.
SIMULATION 15
stream and control valve so as to provide an
inert blanket. To prevent negative pres-
sures, make sure that the size of the inlet
valve is large enough to handle the fastest
emptying rate of the vessel. Set the recycle
nozzle vapor efficiencies to 0.01 percent to
ensure that the nitrogen does not dissolve
in the liquid and create a vapor phase. If
liquids can separate into layers in the equip-
ment, adjust the nozzle heights and size to
get a representative discharge mixture.
16 SIMULATION
SIMULATION
17 Figure 1-4 — A User Variable Program for a Charge Balance
14. Add transfer functions to simulate transpor-
tation delays and sensor and transmitter
time delays and lags and introduce mea-
surement noise. In a spreadsheet, calculate
the transportation delays as a volume
divided by a throughput rate or a distance
divided by a velocity.
18 SIMULATION
SIMULATION
19 Figure 1-5 — A User Variable Program for Valve Stick-Slip and Deadband
level rises above 95 percent, there may be
liquid entrainment in the vapor phase and
vent flow. If a liquid level drops below 5
percent there may be vapor entrainment in
the liquid discharge that will choke a pump
or valve.
20 SIMULATION
crete (on-off) signals to start and stop
pumps and to open and close isolation
valves from the DCS, and (c) any blue or
red model input parameters for adapting
the model so it matches plant operations, as
shown in figure 1-6.
SIMULATION 21
22
Figure 1-6 — DCS Interface Table Import Screen
SIMULATION
integration step size so it is inversely pro-
portional to the acceleration factor.
SIMULATION 23
and are controlling the liquid and gas
inventories.
Examples
Figure 1- 7 shows the PFD for a two-stage contin-
uous neutralizer model. The first stage is a static
24 SIMULATION
mixer that combines the flow from split-ranged
large and small base valves for the purpose of
neutralizing an acidic feed. The second stage is a
well-mixed reactor that has a heat exchanger in
the recirculation line for temperature control
and an inert blanket for pressure control. A
mixer is used to simulate the dip tube and com-
bine the flows from split-ranged acid and base
valves. A “User Variable” program is used in the
“Static Mixer” and “Rx-Mixer” to calculate pH
from acid and base concentrations. Cascade
control has been added for the second stage
where a primary-reactor pH controller sends a
remote set point to a secondary reagent flow
controller. This controller reduces the effects of
valve nonlinearities and reagent pressure upsets.
Transfer functions are used to simulate transpor-
tation delays and sensor (electrode and ther-
mowell) time lags.
SIMULATION 25
26
Figure 1-7 — Continuous Neutralizer Model
SIMULATION
Figure 1-8 — Continuous Column Model
SIMULATION
27
The vapor efficiencies of the recycle and feed
nozzle are all set to 0.01 percent to reduce vapor
in the condensate. About 5 degrees of superheat
is added to the incoming steam temperature to
ensure that no condensate forms in the steam to
the reboiler during feed upsets. A mixer and
splitter are used to provide parallel pumps on
the sump bottoms. The model in figure 1- 8
shows the addition of a differential-pressure
transmitter, which provides a forewarning of
weeping. It also shows the addition of an ana-
lyzer for high boiler concentration in the distil-
late, which provides feedback correction of an
estimator for overheads composition. Note that
secondary flow controllers have been added to
facilitate ratio (feedforward) control.
28 SIMULATION
Figure 1-9 — Batch Reactor Model
SIMULATION
29
combined to simulate an overhead condenser
and to reflux recovered condensate back to the
reactor. (These details are necessary to show how
coolant capacity limits reactant feed rate.) A sep-
arator is also used to simulate the volume of the
vent header in order to show the interactions
between header and reactor pressure control.
The reaction pre-exponential coefficient was
large enough to provide an essentially instanta-
neous reaction rate, and the activation energy
was adjusted to give the correct percentage of
conversion at operating temperature. Analyzers
for measuring reactant losses to the vent system
and product formation in the reactor have been
added to provide a feedback correction of neural
network estimators.
30 SIMULATION
Figure 1-10 — Boiler Model
SIMULATION 31
density measurement as input for a waste-heat
value estimator. To simulate inverse response
(drum shrink and swell), a spreadsheet is used to
combine the outputs of level transfer functions
with a fast time lag of opposite sign and a slower
time lag of correct sign.
References
1.1 Mansy, Michael M., Gregory K. McMillan,
and Mark S. Sowell, “Step into the Virtual
Plant,” Chemical Engineering Progress, Febru-
ary 2002, pp. 56-61.
32 SIMULATION
Overview
Models used for model predictive control
(MPC) must be able to provide a reasonably
accurate time response of the change in each
process output (controlled or constraint vari-
ables) for a change in each process input (manip-
ulated or disturbance variables). Any control
loops that use these MPC variables must be in
manual while the process is tested. Otherwise, it
is difficult to impossible to separate the response
of the controller algorithms and tuning from the
process [2.1]. Plants should seek the smallest-
sized MPC that meets the process objectives in
order to minimize the number of loops in man-
ual and the test time.
Procedure
1. Set the exception reporting for the I/O,
data highway, and data historian to less
than the A/D resolution (0.05% for a 12-bit
A/D with one sign bit).
Ri - APVlAt
AMV
where
K, = pseudo integrator gain (e.u./e.u.)
Kp = process gain (steady state gain) (e.u./e.u.)
AMV = change in the manipulated variable (e.u.)
APV = change in the process variable (e.u.)
At = time iilterval (seconds)
K, = time lag (open-loop time constant)
(seconds)
11. If you have a noise model (Box-Jenkins)
and a continuous process, conduct a PRBS
test at the proper operating point in which
the flip time is equal to one half the maxi-
mum time lag seen in the bump test. For
ARX models that lack noise models and
batch processes, conduct extensive step
tests instead of PRBS tests. In the examples
section we will see that PRBS tests have
minimal value for an ARX model that has
been developed from a separate test for
each manipulated variable. When several
manipulated variables are moved in the
same test, PRBS tests may be needed.
Examples
Tests of ARX and Box-Jenlcins software identifi-
cation packages were conducted for process
responses characterized by various mismatches
or interferences. The following plots show how
various factors affect the accuracy of the identifi-
cation process for an ARX model. The shape of
the plot and the relative changes are more
important than the specific values. We will dis-
cuss the relative merits of Box-Jenlrins models
but not detail them here. Appendix A describes
a web site where users can access an Excel
spreadsheet containing data and plots of ARX
and Box-Jenkins model errors for all of the tests
conducted for this guidebook. The first set of
plots, in figures 2-5a and 2-5b, are for a bump
test; the plots in figures 2-5c and 2-5d are for a
PRBS test. These figures show that error in the
identified time lag is generally positive and that
the error is also several times larger for a PRBS
than a bump test for an error in the time delay.
The figures also show that the error in the time
lag is greater than the error in the process gain.
This error is also larger for a time-delay estimate
that is smaller than the actual time delay (nega-
tive time delay error). The exception to this is a
radical exponential error and an eventual rever-
sal of the sign of the process response, which
occurs for very large positive time-delay errors in
ARX models that are dominated by a time delay.
References
2.1 Smith, Cecil L., "Intelligently Tune PID
Controllers - Part 11," Chemical Engineering,
February 2003, pp. 54-59.
Overview
To properly set up a model predictive control
(MPC) system you must select the best set of
controlled, constraint, manipulated, and distur-
bance variables. This setup process must take
into account the process objectives, what loops
are best left as PID controllers, and the condi-
tion number.
SETUP 71
favored in the 1990s when the pressures of eco-
nomic expansion required most production
units to run well beyond nameplate capacity.
Usually, this involved simply maximizing feed
by ramping or pushing the feed to a key unit
operation until a violation of an operating con-
straint, such as control valve position or equip-
ment temperature or pressure, was projected.
Maximizing waste fuel and waste reagent was
consistent with an increase in both efficiency
and capacity. Since 2001, process efficiency has
generally become more important in the chemi-
cal industry in the United States and Europe
since they must compete with countries that
have low labor, raw material, and environmental
costs. However, the high profit margins for phar-
maceuticals and specialty chemicals mean that
the bigger issues in these industries are time-to-
market and pounds of production for new prod-
ucts before their patent protection or technolog-
ical advantage expires.
72 SETUP
graded, recycled, returned, or scrapped. Less
obvious is the product that is given away in
terms of extra purity or quantity in anticipation
of variability. Other benefits gained from reduc-
ing variability often include minimizing fuel,
reactant, reagent, reflux, steam, coolant, recycle,
or purge flow or making a more optimal selec-
tion of set points. If the best set points for con-
trolled variables have a fixed value or inter-
relationship, the user can often set them manu-
ally based on the process knowledge he or she
has gained while exploring an offline process
simulation. If the optimum targets of controlled
variables vary independently, then the user
should employ a linear program (LP) and online
process simulation for real-time optimization
(RTO) to automatically find the best MPC tar-
gets for linear and nonlinear relationships,
respectively. Any controlled variable whose set
point should be optimized is a prime candidate
for MPC because MPC excels at responding to
set point changes and handling constraints and
interactions.
SETUP 73
controlled variable (CV) and its set point (SP) as
well as each constraint variable (AV) and its limit
over a specified time horizon. MPC also calcu-
lates a series of future moves for the manipu-
lated variables that will minimize the sum of the
squared errors between the CV and SP or pre-
vent the AV from violating a limit. The number
of future moves, which varies from three to fif-
teen, depends upon the software package
options and the degree of performance versus
robustness the user desires. If aggressive control
is preferred more than patient control, MPC
spreads the total correction over a smaller num-
ber of moves. The trajectory of the CV and AV
is based on the previous moves of the manipu-
lated variables (MV) and the current value of dis-
turbance variables (DV). The models are linear
in that the change in a MV or DV is propor-
tional to the change in the CV or AV. MPC pro-
vides a form of linear integral-only control. If
one of the manipulated variables (typically a
flow) needs to optimized, it can be assigned as
both an MV and CV whose set point is maxi-
mized or minimized as long as a future violation
of constraint is not projected. MPC can be set
up to manage a unit operation and provide an
74 SETUP
SETUP Figure 3-1 — MPC and PID Views
MPC sees future trajectory based on past moves of
manipulated variables ('MV) and present changes in
disturbance variables ('DV) as inputs to a linear
PID model. It provides an integral-only type of control.
loop
only
sees PID dead time controlled variable (CV)
this compensator or constraint variable (AV)
sees one dead
time ahead
response
set point
time
76 SETUP
also computes the trajectories of constrained
variables and has built-in capabilities for maxi-
mizing or minimizing a manipulated variable, it
is well suited to multivariable control problems
and optimization.
SETUP 77
constant, and they can achieve tight control that
is hard to duplicate with an MPC. However,
controlling temperature at more than one point
in a reactor or column introduces interactions
that are best solved by using an MPC system.
Moreover, using composition control for reac-
tors and columns often introduces stair-step
response and delays from the transportation and
processing of analyzer samples that are best han-
dled by MPC. Similarly, plug-flow reactors,
extruders, sheets, webs, and fibers are prime can-
didates for MPC since they are dominated by a
transportation delay. Gain and rate action is
unsuitable for the square-wave response of dead
time dominant systems. These loops are best
tuned with mostly integral (reset) action. Unfor-
tunately, reset has no sense of direction and
increases overshoot, particularly for set point
changes [3.1]. Thus, MPC with proper identifi-
cation, setup, and tuning will outperform a con-
ventional PI feedback controller on a dead time
dominant application.
78 SETUP
lem, let’s consider the steady state open-loop
gains for a system that has two manipulated and
two controlled variables, as shown in equations
3-1a and 3-1b. The equations are combined via
the matrix representation in equation 3- 1c. The
determinant of the steady state gain of a 2x2
matrix is equal to the product of the diagonal
gains minus the product of the off-diagonal
gains (K11 K22 K12 K21)
'CV 1 K 11 K 12 'MV 1
= * (3-1c)
'CV 2 K 21 K 22 'MV 2
SETUP 79
'CV 1 'MV 1
= 4.1 6.0 * (3-1d)
'CV 2 4.4 6.2 'MV 2
'CV 1 'MV 1
= 4.1 6.0 * (3-1e)
'CV 2 2.2 3.1 'MV 2
80 SETUP
nately, the determinant is 0.9, which is far
enough above zero to provide a false sense of
security. The condition number of the matrix
provides a more universal indication of a poten-
tial problem than either the determinant or rela-
tive gain matrix (RGA) [3.2]. A higher condition
number indicates a greater problem. For equa-
tion 3- 1f, the condition number exceeds 10,000.
Appendix B shows how to calculate the condi-
tion number for a 2x2 matrix. The equations for
a 2x2 are simple enough to be implemented in a
spreadsheet. For large matrices, special programs
are used [3.3].
SETUP 81
of independence between controlled variables. If
two or more gains of any column are larger by
an order of magnitude or more than the gains
for the corresponding controlled variables of
another column, this indicates a loss of a degree
of freedom.
82 SETUP
SETUP Figure 3-2 — Linear Superposition of Response of a CV to a Step in MV1 and MV2
set point
CV1 = f('MV1)
process vector
time
process vector
time
process vector
set point
CV1 = f('MV1 'MV2)
time
83
the middle plot. The MPC control algorithm
then calculates a series of moves in the manipu-
lated variables that will provide a control vector
that is the mirror image of the process vector
about the set point. This is shown in the bottom
plot of figure 3- 3. If there are no nonlinearities,
load upsets, or model mismatch, the predicted
response and its mirror image should cancel out,
and the controlled variable should end up at its
set point. How quickly the controlled variable
reaches set point depends upon the time delay
and lag, move suppression, move size limit, and
number of moves. In general, this rise time is
larger than for a PID loop that has a very large
time lag because the PID controller, with its high
gain, will immediately overdrive its output to
saturation for a set- point change [3.4].
84 SETUP
SETUP Figure 3-3 — Shift of Process Vector and Mirror Image Control Vector
process vector
predicted CV
set point
actual CV
time
process vector
shift vector set point
to correct
model error
time
compute future process vector
moves for a
mirror image set point
vector to bring control vector
process to set
point trajectory
time
85
Often an operator concentrates on just one con-
trolled variable and thinks that the MPC is going
in the wrong direction. Thus, both training and
improved displays should be provided so opera-
tors understand the relative contributions that
projected deviations of controlled, constraint,
and disturbance variables make to the manipu-
lated variable.
Procedure
1. Select the unit operation that is key to the
plant’s performance.
86 SETUP
controlled variables of greater economic
value. If there is negligible interaction, sepa-
rate the variables into multiple MPC imple-
mentations so that each MPC matrix can
run at its optimum time horizon and execu-
tion frequency.
SETUP 87
7. Select the manipulated variables that need
to be minimized or maximized and make
them candidates for optimization by means
of a pusher or ramper. Ideally, the number
of controlled variables should equal the
number of manipulated variables so the
matrix is square. Most MPC algorithms can
handle nonsquare matrices automatically
by performing an optimization at the time
of formulation or execution based on con-
dition number and the penalties on errors
or tuning weights that establish the relative
importance of the controlled variables.
Examples
For our first example, consider the first process
in chapter 1, which is the neutralizer shown in
figure 1- 7. The process objective in this case is
both to minimize the pH variability and the
reagent usage for the static mixer and to reduce
the effect of feed upsets on the final pH. The
titration curve is steepest at 7 pH and gets flatter
as you go lower in pH. For that reason, the user
can minimize variability in the static mixer pH
by minimizing the pH set point, which will also
minimize the more expensive reagent require-
88 SETUP
ment to the first stage. One factor that con-
strains the degree to which the contribution
from the first stage can be minimized is how far
the second-stage reagent valve is open. To
reduce the open-loop gain and pH variability
from stick-slip, which is a percentage of stroke
and thus capacity, the second-stage reagent valve
size is about one-tenth the size of the first stage.
This puts the second stage at risk of being
unable to handle large increases in the feed.
SETUP 89
90
manipulated disturbance
variables variable
reactor
pH PV
optimization
variable
reactor reagent
valve position
SETUP
composition of the column overheads despite
large feed upsets. A dynamic linear estimator is
first developed and commissioned to measure
the concentration of the high boiler in the over-
heads, based on the control tray temperature
and pressure in the top of the column. Instead
of selecting the overheads’ temperature for the
estimator input, a control tray temperature is
selected because it provides the largest and most
linear response to a change in distillate flow. The
estimator output is passed through a time lag
and delay function for synchronization with a
feedback correction from a distillate composi-
tion measurement. The MPC setup uses the esti-
mator output without the time lag and delay as
the controlled variable, the distillate flow as the
manipulated variable, the column differential
pressure as a constraint variable, the feed flow as
a disturbance variable, and finally the reboiler
steam flow as an optimization variable.
SETUP 91
92
manipulated disturbance
variables variable
column differential
(tray weeping) PV
SETUP
response has a huge time delay and lag from
the distillate receiver volume, and its signal can
be erratic and unreliable. The estimator pro-
vides a faster, smoother, and more reliable
response [3.5].
SETUP 93
94
reactant loss
rate in vapor PV
controlled
variable
product accumulation
rate in liquid PV
temperature SP
variable
reactor condenser
valve position
constraint
variables
SETUP
reactor jacket
valve position
For our fourth example, consider the fourth pro-
cess in chapter 1, which is the boiler shown in
figure 1- 10. The process objectives in this case
are to minimize the energy loss out of the stack
and to maximize the usage of waste fuel. The
MPC setup uses signal-linearized combustibles
and oxygen in the stack to create a new variable
(percentage of excess air-flow demand) as a con-
trolled variable. It uses a bias to the calculated
air flow as a manipulated variable, fuel valve and
air damper position as the constraint variables,
and finally the waste-fuel heat input as an opti-
mization variable. A ramper maximizes the
waste usage if the projected position of the main
fuel valve is above its minimum limit. A split-
ranged controller for firing demand could have
added waste fuel before purchased fuel. How-
ever, MPC avoids the severe discontinuity and
nonlinearity of the split-range point. A waste-
heat value estimator is used to provide a waste-
heat controller instead of just a waste-flow con-
troller. MPC manipulates a bias to a calculated
air flow rather than air-to-fuel ratio both to keep
the cross-limit (lead-lag) system intact for
changes in firing demand and to make the
response more linear. An increase in the bias
results in a decrease in actual air flow. The set
SETUP 95
point for the percentage of excess air-flow
demand is computed from steam flow to ensure
that it is larger for low firing rates when lower
turbulence reduces the mixing of air and fuel.
The MPC setup is shown in figure 3-7.
References
3.1 McMillan, Gregory, K., Good Tuning – A
Pocket Guide, Research Triangle Park, NC:
ISA, 2001.
3.2 Ogunnaike, B.A., and W. H. Ray, Process
Dynamics, Modeling and Control, New York:
Oxford University Press, 1994.
3.3 Press, W. H., Numerical Recipes in C – The
Art of Scientific Computing, Cambridge:
Cambridge University Press, 1988.
3.4 McMillan, Gregory K., “Advanced Batch
Control,” ChemPID tutorial, ISA Expo,
Chicago, 2002.
3.5 Blevins, Terrence L., Gregory K. McMillan,
Willy K.Wojsznis, and Michael W. Brown,
Advanced Control Unleashed –Plant Perfor-
mance Management for Optimum Benefits,
Research Triangle Park, NC: ISA, 2002.
96 SETUP
SETUP Figure 3-7 — MPC Setup for a Boiler
manipulated
variables
controlled
steam
variable
flow fcn. % excess air
demand PV
optimization
ramper variable waste heat
null
input SP
air damper
valve position
constraint
variables
main fuel
valve position null
97
4.0—Tuning
Overview
Each controlled variable (CV) and manipulated
variable (MV) in a model predictive control
(MPC) system has a tuning weight. For a CV, it
is usually called a “penalty on error” (PE), and it
determines the relative significance of the error
for a CV. A higher PE indicates that the CV is
more important and that its errors should be
more heavily penalized. Most MPC systems
convert the engineering units of the measure-
ments from engineering units into percentage
terms so the PE sets the relative importance of a
percentage error in each CV. For tighter control,
the PE would be increased. However, one major
MPC supplier uses engineering units in the
matrix and calls the tuning weight for the CV an
“equal concern error,” which must be adjusted
to account for the differences in engineering
unit scales. For example, an error of 1ºC on a
scale of 0 to 100ºC might be of as much concern
as 100 gpm on a scale of 0 to 10,000 gpm. In a
sense, the equal concern error combines scaling
and penalty on error into one factor.
TUNING 99
The tuning weight for the MV is called a “pen-
alty on move” (PM) and sets the relative impor-
tance of reducing the movement of an MV.
Penalty on move is also known as “move sup-
pression.” A higher PM indicates that the move-
ment of the MV should be decreased even
though it will increase the error in a CV. Thus, a
larger PM increases the robustness but decreases
the performance of MPC. If a CV is oscillating,
it can often be stabilized by increasing the PM of
the MV that has the greatest effect on the CV
(largest process gain). The PM is an excellent
way of determining the amount of variability
that is transferred from the CV to the MV and is
one of the principal tuning advantages of MPC
compared to PID.
100 TUNING
robustness. There is almost always a trade-off
between performance and robustness in that
maximum performance has minimum robust-
ness and vice versa.
TUNING 101
the stroking time of valves, as well as other
known process limitations.
102 TUNING
a cascade control system, the status of all of the
primary and secondary controllers must be
included. Foundation Fieldbus functional blocks
take care of this bumpless transfer and anti-reset
windup protection automatically by using “back
calculate” (BKCAL) connections and the initial-
ization manual (IMAN) mode for the MPC.
TUNING 103
errors includes the effect of an adjustable filter
time constant (filter time). A larger filter time
will increase the robustness, meaning smoother
control with less overshoot. However, a larger
filter time will decrease the performance (rise
time) for set point changes. This filter time is
typically adjusted on line in increments, from a
minimum of one-half of the time to steady state
to a maximum of twice the time to steady state
for the CV [4.2].
104 TUNING
rates MPC performance. In fact, a decrease in
plant time delay can be more disruptive than an
increase in plant time delay for a dead time
dominant process, particularly for a short MPC
execution time interval, because it can cause
growing oscillations. This leads us to a rule not
widely recognized: it is better to underestimate
than overestimate the time delay for any model-
based controller, including the Smith Predictor,
particularly when it is applied to a dead time
dominant process [4.3]. Since the opposite is
true for the computation of tuning settings for
PID controllers, even consultants often mistak-
enly believe that an overestimate of time delay
will help to ensure robustness. An overestimate
of time delay can also cause a catastrophic break-
down in the identification of the process lag.
Figure 2-5b in chapter 2 shows an exponential
increase in the lag error if the time delay is over-
estimated by more than 30 percent for a dead
time dominant process.
TUNING 105
portation delays are large and variable, an MPC
system should have the variable portion of its
time delay computed on line as the volume
divided by flow for pipelines and the distance
divided by the speed for web and sheet lines.
Until recently, most MPC systems did not offer
a variable time delay.
106 TUNING
which leads to the rule of thumb that the time
delay is one half of the scan time. However, this
corresponds to large errors in the time delay
from digital computations. To further aggravate
the situation, most simulations that are packaged
with MPC systems will not show the full extent
of the problem of analyzer cycle time and digital
scan time. The reason for this is that when the
change is synchronized with MPC execution,
the time-delay time is consistently indicated as
equal to zero or a multiple of the MPC execu-
tion time.
TUNING 107
Adding a filter to the model output has an effect
similar to increasing the MPC execution time in
that it makes the MPC more stable for model
mismatch but slows down the response to
unmeasured load upsets [4.4]. Set Point
response tests and upsets that are introduced
into the measurement instead of the process will
show an improvement in robustness for large
execution time intervals and model filters. How-
ever, they will fail to show the full deterioration
in the ability to reduce process variability from
unmeasured load upsets that enter as process
inputs [4.5].
108 TUNING
should be used whenever there are large and
variable transportation delays and operating
point nonlinearities.
TUNING 109
There may be quiet periods of operation sepa-
rated by a series of oscillations. The effects vary
with software implementation. A well-condi-
tioned matrix would have a condition number
that is just slightly larger than 1, which is the
minimum number. If the high condition num-
ber is caused by high process gains, then scaling
factors can be applied to the matrix. High pro-
cess gains do not necessarily translate to a high
condition number but can still cause problems.
High process gains amplify the effects of incor-
rect MPC moves and valve stick-slip and will
increase the IAE from model mismatch and
valve problems.
110 TUNING
Procedure
1. Set the MV output and CV set point (tar-
get) limits to match the process require-
ments.
TUNING 111
Tx = MAX { Wo, Wd > Wd / Tss) ],
Ti / Kc} (4-1a)
where:
112 TUNING
Ph = Tss / Tx (4-2)
where:
TUNING 113
can handle the largest change in MV. If
there is a minimum move size, set it larger
than the valve stick-slip and dead band.
These relationships for maximum and min-
imum move size are expressed through the
following inequalities.
'MVmax < Tv Tx (4-3)
where:
114 TUNING
CV as for another CV, quadruple the PE.
Use the PE only to change the relative per-
formance of a CV. Use the PM to work a
compromise between total performance
and robustness.
PM = 3 [ 1 + ( Wd / Ph) ( Kp Wd / Ph) @
(4-5)
TUNING 115
where:
116 TUNING
momentarily in manual and changing a
MV. Test how the MPC responds to mea-
sured disturbances by making step changes
in each DV.
Examples
A virtual plant was used to look at the perfor-
mance and robustness of a 2x2 MPC for model
mismatch and condition number. The first con-
trolled variable (CV1) has a time response domi-
nated by lag for changes in either manipulated
variable. The model of CV1 for MPC has a time
lag that is equal to 30 seconds and a time delay
equal to 6 seconds for all cases. The second con-
trolled variable (CV2) has a time response that is
dominated by a delay for changes in either
manipulated variable. The model of CV2 for
MPC has a time delay that is equal to 30 seconds
and a time lag equal to 6 seconds for all cases.
The steady state gains are varied to show differ-
TUNING 117
ent condition numbers, and actual plant dynam-
ics are changed to show model mismatch. The
execution time interval of the MPC module was
set equal to the loop scan time of the PID and PI
controllers, which was 1 second.
CV 1 1.0 0.1 MV 1
= * (4-6)
CV 2 0.1 1.0 MV 2
118 TUNING
the IAE. CV1 is not totally immune to the prob-
lem in that it shows some oscillations that dou-
ble the IAE. A decrease in process time delay or
lag has very little effect on the IAE for PID and
PI control.
TUNING 119
Figure 4-1a — PID/PI Response to Load Upset for
Constant Linear Process (CN=1.2)
120 TUNING
Figure 4-1b — PID/PI Response to Load Upset for
Doubled Plant Delay (CN=1.2)
TUNING 121
Figure 4-1c — PID/PI Response to Load Upset for
Halved Plant Delay (CN=1.2)
122 TUNING
Figure 4-1d — PID/PI Response to Load Upset for
Halved Plant Lag (CN=1.2)
TUNING 123
Figure 4-1g shows that halving the process time
delay is even more detrimental because it causes
the CV2 to become unstable. An increase in the
PM from three to nine will kill the growing oscil-
lations and improve the MPC IAE for CV2 so
that it is only about five times larger than the
MPC IAE for a perfect model. Figure 4-1h shows
that halving the process time lag causes an
erratic response and severe overshoot for both
CV1 and CV2. An increase in the PM from three
to nine will smooth out the response, but the
MPC IAE stays at about three and five times the
IAE for a perfect model for CV1 and CV2,
respectively. Instead of increasing the PM, the
robustness of the MPC could also have been
increased by slowing down the MPC execution
or adding a model output filter.
124 TUNING
Figure 4-1e — MPC Response to Load Upset for
Perfect Model (CN=1.2)
TUNING 125
Figure 4-1f — MPC Response to Load Upset for
Doubled Plant Delay (CN=1.2)
126 TUNING
Figure 4-1g — MPC Response to Load Upset for
Halved Plant Delay (CN=1.2)
TUNING 127
Figure 4-1h — MPC Response to Load Upset for
Halved Plant Lag (CN=1.2)
128 TUNING
Equation 4-7 shows the steady state gain matrix
for the second case. It has a condition number
of 3.0, which was used for the second series of
test runs of the virtual plant.
CV 1 1.0 0.5 MV 1
= * (4-7)
CV 2 0.5 1.0 MV 2
TUNING 129
condition number. A decrease in process time
delay or lag has very little effect on the IAE for
PID and PI control. The PI IAE for CV2 is actu-
ally slightly less for a higher condition number
for a doubled time delay. However, CV1 starts to
become more oscillatory and the IAE deterio-
rates for changes in the process dynamics.
130 TUNING
tions actually disappear for a higher condition
number (CN > 12) for a halved process delay.
TUNING 131
Figure 4-2b — PID/PI Response to Load Upset for
Doubled Plant Delay (CN=3.0)
132 TUNING
Figure 4-2c — PID/PI Response to Load Upset for
Halved Plant Delay (CN=3.0)
TUNING 133
Figure 4-2d — PID/PI Response to Load Upset for
Halved Plant Lag (CN=3.0)
134 TUNING
Figure 4-2e — MPC Response to Load Upset for
Perfect Model (CN=3.0)
TUNING 135
Figure 4-2f — MPC Response to Load Upset for
Doubled Plant Delay (CN=3.0)
136 TUNING
Figure 4-2g — MPC Response to Load Upset for
Halved Plant Delay (CN=3.0)
TUNING 137
Figure 4-2h — MPC Response to Load Upset for
Halved Plant Lag (CN=3.0)
138 TUNING
Figures 4-3, 4-4, and 4-5 are based on data pre-
sented on the web site described in appendix A.
These figures show how the total IAE for a
twenty-minute test run deteriorates with MPC
condition number for a perfect model. They also
show how the total IAE for a twenty-minute test
run with a very low condition number improves
with MPC execution time interval for a doubled
and halved time delay.
60
50
IAE over 20 minutes
40
CV1
30
CV2
20
10
0
0 20 40 60 80 100
Condition Number
TUNING 139
Figure 4-4 — Effect of MPC Execution Time Interval
on IAE for a Doubled Delay
2x Delay
16 350
14
300
12
250
10
200 CV1 @ 1 sec.
CV1 IAE
CV2 IAE
CV1 @ 6 sec.
8
CV2 @ 1 sec.
150 CV2 @ 6 sec.
6
100
4
50
2
0 0
0 2 4 6 8 10 12 14 16 18 20
Time (minutes)
0.5x Delay
25 500
450
20 400
350
15 300
CV1 @ 1 sec.
CV1 IAE
CV2 IAE
CV1 @ 6 sec.
250
CV2 @ 1 sec.
CV2 @ 6 sec.
10 200
150
5 100
50
0 0
0 2 4 6 8 10 12 14 16 18 20
Time (minutes)
140 TUNING
Even though the test results show that MPC
is sensitive to model mismatch and can be
affected by a large condition number, the
benefits from an integrated constraint handling
and optimization in a MPC system usually
more than out weighs any reduction in IAE
offered by PID control.
References
4.1 McMillan, Gregory K., “Has Your Control
Valve Responded Lately?” Control, May
2003, pp. 65-68.
TUNING 141
4.5 Shinskey, F. G., “Process Control: As
Taught versus As Practiced,” Advances in
Instrumentation and Control, November,
2001.
142 TUNING
INDEX
aggressive 74
analyzer 28 78 91
105
anti-reset windup 102
ARX (auto regressive
with external inputs) 38 54 56
AV ( constraint
variable) 74 151
batch 6 28 48
52 54 93
96 155 157
boiler 15 28 30
91 95 97
Box-Jenkins 43 45 51
54 56 64
67 70
bump (step) 36 44 48
52 57 62
64 67 87
144 157
calibration 41
capacity 15 30 71
89
column 5 14 25
27 34 77
82 89 91
159
composition
(concentration) 10 21 28
34 72 78
91 93 160
compressor 13 20 24
condenser 25 30 93
condition number 45 71 81
87 109 117
129 139 141
143 147 149
152
conditions 1 3 6
10 158
constraint 2 73 158
variable (AV) 20 33 41
48 50 71
74 84 86
89 91 93
95 115 141
151 156
constraints 2 158
control horizon 103 113 115
151
data
highway 50
data (Cont.)
historian 50
dead time (delay) 34 39 41
55 76 78
104 108 119
129 154 159
dominant 78 105 108
119 129
deadband 18 34
delay (dead time) 154
derivative 76 159
determinant 79 148
difference 3 38 43
disturbance
variable (DV)
41 74 87
89 91 117
151
disturbances 1 77 117
dynamic 2 8 10
12 21 23
33 91 152
154 160
engineering unit 99
entrainment 20 23
estimator 28 32 91
93 95 160
exception reporting 50
execution 38 41 56
87 101 105
111 117 124
139 144 153
exothermic 52
experimental models 4 34
first-principle 3 87
flip time 45 54
flow
characteristic 12
coefficient 12
diagram 3
fluid package (physical
properties) 8 10 12
21
heat exchanger 13 25 28
31
higher-order 39 42
IAE (integrated
absolute error) 100 102 107
109 119 124
129 139
integral 74 76 78
101 111
integrator gain 48 53
interaction 1 87
interface 8 20
interlock 18
inventories 24
inverse response 32 55 67
kinetics 6
lag (Cont.)
84 91 93
95 104 107
111 117 119
123 128 130
134 138 154
157
level 20 23 25
32 39 52
77 86 101
limit 43 74 84
89 91 93
95 102 151
linear
program 73
superposition 3 82
maximizing 72 77
minimizing 72 77 88
153
mismatch 55 58 84
104 107 115
130 141 144
move size 55 84 101
113
neutralization 16
neutralizer 24 26 88
noise 18 35 42
45 47 51
54 57 62
154
nonlinearities 3 25 50
55 82 84
100 104 109
operator 47 86 156
optimization 31 73 77
88 91 93
95 115 141
152 155
overshoot 78 104 124
parametric models 35
patience 103
PE (penalty on error) 99 114 153
penalty on error 99 153
penalty on move (move
suppression) 100 116 153
performance 1 4 70
performance (Cont.)
74 76 86
96 100 103
107 115 117
129 153
pH 25 88 113
115
physical properties
(fluid package) 4 23
PM (penalty on move) 100 108 115
119 124 130
153
57 100 109
115 153 157
production rate (feed) 1 44 71
properties 4 10 23
proportional 23 44 74
76
proportional-integral-
derivative (PID) 1 18 21
41 51 70
75 84 86
100 104 111
118 129 141
ramp rate 39 52
ramper 88 91 93
95
ratio 28 80 93
95 149
raw weights (response
coefficients) 35 37
reaction 6 14 21
30 93
reactor 15 25 28
77 89 93
real time 21 33 113
153
reboiler 15 25 28
91
recycle 15 24 28
73
reflux 15 30 73
regions 4 6 34
residuals 55
resolution 50 103 112
rise time 84 104
robustness 2 44 74
100 103 108
111 115 117
124
runaway 77 159
run-time model 55
self-regulating 38 53
separator 14 25 30
set point 21 25 41
51 73 78
84 88 93
95 100 102
106 108 111
116 151
sine wave 64
singular values 148
smoothness 100
stationary 38
steady state 2 5 8
15 24 33
35 38 41
45 47 51
79 87 104
112 116 129
147 154 157
gain (plant process gain) 41 53 79
81 118 129
147
steam
trap 25
step
size 23 43 45
51 56
step (bump) 4 21 23
32 35 42
47 51 54
70 78 82
117 154 157
stick-slip 1 18 34
38 51 55
89 110 114
stiff 80
temperature 8 10 14
25 28 30
72 77 86
91 93
test time 33 47 53
time
constant (lag) 34 38 41
53 77 104
154
horizon 74 87
transfer functions 18 25 32
34
transportation 18 25 34
44 78 105
109 113
upsets 3 23 28
39 43 45
47 50 84
87 91 107
111 115 118
129
valve 12 14 16
18 24 30
34 38 41
51 55 72
valve (Cont.)
89 93 95
101 110 113
141 152
vapor 15 20 28
variability 1 4 72
88 100 108
112 115
variable
delay 44
gain 41 108
virtual plant 8 32 70
117 129 143
154
ConditionNumber2x2.xls
Excel XP workbook file to determine the matrix
condition number of a simple 2x2 matrix
Matrix2x2case02.xls
Condition number and RGA calculations for
case02
Matrix2x2case03.xls
Condition number and RGA calculations for
case03
ModelsBUMP.xls
Bump test data for various dynamics and
interferences
ModelsPRBS.xls
PRBS test data for various dynamics and
interferences
ModelsPlots2rev1.xls
Identification results from bump and PRBS test
data
MPCDelayMismatch.xls
MPC runs for delay mismatch at 1, 6, and 15
second execution periods
Plant2x2case01.ppt
Virtual plant PID and MPC runs (screen prints)
for case01
Plant2x2case02.ppt
Virtual plant PID and MPC runs (screen prints)
for case02
Plant2x2case03.ppt
Virtual plant PID and MPC runs (screen prints)
for case03
TuneCV1case01.xls
CV1 PID tuning for case01
TuneCV2case01.xls
CV2 PI tuning for case01