Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

Demo 4: Model Predictive Control in a purification plant:

model inaccuracy

If we have another look at the sketch of the outlay of a model predictive control
system (Figure 1), then we see that what we have discussed so far is only a subset of
a model predictive control system. We have only looked at setpoint calculations on
the basis of a steady-state model; we have not looked at system dynamics. We also
haven’t considered the fact yet that the model that we use to describe the process
isn’t a perfect model, and that there will be a difference between model output and
plant output.
Setpoint
calculations

Prediction Process
Control Process outputs y
calculations

Inputs u Model +
Model outputs
_

Residuals

Figure 1. Block diagram for model predictive control.

We will leave systems dynamics for later, and first look at model inaccuracy. A
primary cause of model inaccuracy is the fact that often linear matrix models are
used to describe plant behaviour. Matrix models are comparatively easy to design,
build and maintain. They perform well in a lot of applications. Unfortunately, most
plants are actually not truly linear. As a result linear matrix models are generally low
fidelity models. Fortunately, in a lot of cases this is not a practical disadvantage.
Simple models that perform well are often preferable to complex ones that perform
slightly better, because the complex ones cost more to develop and maintain. Most
errors introduced by the differences between the model and the actual plant can be
overcome by introducing a feedback loop that takes care of these differences. To do
this it is essential to have feedback from every CV (for reasons which will become
clear later). In the process we looked at before we had two CVs (flow and product
purity). We already had a feedback loop for the flow; we now have to add an
analyser, AI-2, on the product line (see Figure 2).
Figure 2. The feed cleaning plant
Demo4
A spreadsheet (Demo4) is available for investigating the way model predictive control deals
with model inaccuracy. In the spreadsheet, the control model CV’s are labelled cv1 and cv2,
and the equivalent plant CV’s are cvp1 and cvp2. The equations used for the calculations
are:

The expressions for cv1, cv2 and cvp1 are linear. A more generalised expression for
linear matrix models and their initialisation is shown in Appendix 1. The expressions
cvp2 is different: the plant model is non-linear. The gains in the equations of the
control model were determined experimentally (see Appendix 2). This situation is
similar to that on a plant: the model of the plant that is used for controlling the plant
has to be determined experimentally, for example by performing step tests and then
analysing the plant response. Linear models are easiest to understand and therefore
preferred.
Since the control model and plant are very different, they generate different values of
CV2. They therefore also describe different product purity lines. If you key in an
upper purity limit of 0.263 wt% (the composition at the initial condition) the two
lines will be close (see Figure 3A)- though still not exactly the same. At any other
composition the lines will significantly diverge (See Figure 3B)

A B

Figure 3. A: at 0.263 wt% n-butane in the product; B: at 0.6%


Under normal circumstances the dashed line would be invisible to the engineer. So,
one consequence of model inaccuracy is that the controller only sees approximate
CV boundaries, not the real ones. If the only model you possess is an empirical one
derived from step tests, you have no basis for plotting the dashed line.

Running the Demo

First run the Demonstration with No Feedback:


 Reload the spreadsheet to restore the initial conditions.
 Reset the simulation.

This initialises the biases and aligns the model with the plant (as would occur in a
real control system at commissioning time).
The biases initialise as follows:

Bias b1 initialises to 0 because the linear model represents the plant’s mass balance
perfectly with zero bias.
After initialisation, the model and plant CV’s are perfectly aligned:
Run the simulation for a few scans until the operating point stabilises. The results
should be as follows (Figure 4):

Figure 4. Model and plant outputs without feedback


We see that the controller has driven the plant to the optimum according to its view
of the feasible region. However the model and plant are no longer aligned. A
discrepancy has appeared in their CV2 values:

The plant is not fully optimised. It still has a little way to go to reach the purity
constraint at 0.6 wt%. The discrepancy has appeared because all the moves the
controller made after commissioning were based entirely on model predictions –
without reference to the plant. The plant in this case remains within the real feasible
region (bounded by the dashed line), but in different systems this type of error could
just as drive the plant outside the feasible region, leading to the violation of the
constraint.
Turning on the Feedback

One way to describe the problem is that the controller used pure feedforward action
based on a (flawed) model, with no way of detecting and correcting errors. Some
feedback action is required to put this right. A common way to do this is to alter the
bias on the basis of the difference between the plant output and the control model
output. The bias update algorithm is executed at the beginning of each scan:
 b2t = b2t-1 + (cf2 * (cvp2t-1 - cv2t-1))
Where:
 t denotes values at time t.
 t-1 denotes values from the previous scan, at time t-1.

This simple feedback mechanism acts to reduce the discrepancy between the model
and plant.
The dimensionless correction factor, cf2, is ranged from 0 to 1:
 0 corresponds to no correction (pure feedforward action).
 1 corresponds to full correction on each scan (maximum feedback action).

Set CV2’s bias correction factor to 0.5 and run the controller for a few more scans.

The results should be like the ones in Figure 5. We see that the CV2 discrepancy
rapidly disappears. The modelled purity line retains the same slope but the value of
b2 decreases on successive scans, and this has the effect of shifting the line down the
mv2 axis. Profit increases and the plant moves to the true optimum.

Figure 5. Alignment of control model and plant output with feedback.


One way to visualise how the feedback mechanism works is to imagine yourself in
the place of the controller: At the beginning of each scan, you could reason that if
the moves you predicted on the last scan were accurate the plant and model would
have settled with the same CV values. If it turns out the CV’s are not the same, you
know that this is the fault of your model - because the plant is always right.
You can improve the model by adjusting its biases to bring its CV’s closer to those of
the plant. If you do this on every scan, you will guarantee that at steady state the
model and plant CV’s will align perfectly, and that their respective CV operating lines
will intersect at the current operating point – hence the plant will settle at the true
optimum.
If the plant is disturbed or prices or limits change, you have to take action to drive it
to a new optimum – and you will need to adjust the biases on the way to get them
right for a different operating point.
If the correction factors are set to 1, the feedback mechanism completely realigns
the model with the plant on each scan. This is acceptable if the plant has time to
settle to steady state between scans, which it does in this demonstration because the
abstract plant has no dynamic elements and settles instantly. However, plants don’t
generally settle completely between scans, and excessive feedback usually causes
overshoot and instability (which will be illustrated in Demonstration 5). It is best to
err on the low side when setting the amount of feedback.
Different control systems may use different feedback mechanisms, and the correction
factor may have a different name and be expressed in different units – but the
principle is always the same: all model-based controllers have a feedback mechanism
for correcting modelling errors.
The degree of feedback is usually tuneable on each CV (reflecting the fact that some
CV’s are modelled more accurately than others). In this example CV1’s correction
factor can be set to 0 because it is modelled perfectly, and the model and plant CV’s
simply stay aligned all the time. In real systems, all CV’s require feedback.
Feedforward and Feedback Control Working Together
Reset the simulation and run it from the start with b2’s correction factor still set to
0.5. The results should be similar to those in Figure 6. We see that the CV2
discrepancy remains small throughout, and the plant moves fairly quickly to the
optimum. Clearly the linear model makes reasonable feedforward predictions of the
plant response on each scan, and the feedback mechanism is able to reduce errors.

Figure 6. Response when feedback is applied from the start.

We see that the addition of a small amount of feedback greatly enhances the
performance of model-based controllers. It can make low fidelity models appear to
act like a high fidelity ones. The approach fails if models are extremely inaccurate.
Accuracy requirements are different in every application, but as a very rough guide,
errors around +/-25% begin to create problems. +/-25% might sound like very poor
accuracy, but an error of -25% means that the controller has correctly predicted 75%
of the move, leaving only 25% to be determined by feedback. The performance of
such systems can be much better than those that use no feedforward action and rely
on 100% feedback.
Appendix 1: Linear matrix models

The simplest linear matrix form is:


cv = G.iv …(1)

Where cv is a vector of Controlled Variables, CV’s.

G is a gain matrix
iv is a vector of Independent Variables, comprised of MV’s and DV’s (which are identical in
terms of modelling and may be placed in the vector in any order).
This form is good for modelling changes, i.e. predicting the changes in CV’s resulting from
given changes in MV’s and DV’s. It is not useful for predicting absolute values of CV’s.
However, it can be improved in this respect by biasing:
cv = G.iv + b …(2)

Where b is a vector of biases.

The initial values of the biases are determined when the control is being commissioned, in
order to align the modelled CV’s with the observed plant CV’s. The initialisation function is:

b = cvp - G.iv …(3)

Where cvp is a vector of observed plant CV’s.

Although linear matrix models are extremely useful, it is important to realise that
they are not suitable for all applications.
They cannot be applied when:
o The plant is severely non-linear.
o The plant’s responses are not monotonic.
o The model is required to reflect mass and energy balance.
o The model must have high absolute accuracy.

Some extra expenditure is usually justified in this field to develop more accurate
models, using forms that are more expressive than matrices. In a lot of cases the
payback is quick. Better absolute accuracy improves performance. It also reduces
dependency on feedback - but never entirely eliminates it.
Appendix 2: Step Testing
One method of determining linear gains is to step-test the plant. This involves
making small changes to MV’s and DV’s and measuring the magnitude of the CV
responses.
The spreadsheet can be used to illustrate the process. Try verifying the gains in
equations 4 and 5 by the following method:
 Reset the simulation.
 Note the initial operating point:

Write down the values of the plant CV’s (cvp1 and cvp2).
 Step the initial value of mv1 by a small amount, say from 1.0 to 1.1 te/h:

 Reset the simulation. This has the effect of moving the plant to the new
initial condition with the higher value of mv1.
 Write down the new CV values.

 Calculate the gains:


o ∆cvp1/∆mv1 = (8.10 – 8.00) / (1.10 – 1.00) = 1.00, dimensionless
o ∆cvp2/∆mv1 = (0.272 – 0.250) / (1.10 – 1.00) = 0.22, wt%/(te/h)
 Return mv1 to 1.0 te/h.
 Repeat the process making small changes to mv2 and dv2 in turn and
calculate ∆cvp1/∆mv2, ∆cvp2/∆mv2, ∆cvp1/∆dv1 and ∆cvp2/∆dv1.
 Verify that the calculated gains match those shown in equations 4 and 5 (they
may vary slightly, according to the size of the steps you chose to make).
The equivalent procedure on a real plant would be:
 Back away from active constraints to allow some leeway for disturbances (this
usually involves reducing the throughput a little).
 Step the MV’s in turn, wait for the plant to settle after each step, record the
CV responses and calculate the gains.
 Step the DV’s if possible, but in cases where they are outside the operator’s
control and cannot be stepped, look for records of ‘naturally occurring’
disturbances on the DCS trend displays and try to estimate the gains from
these.
Some gains may be derived theoretically rather than empirically. This is the case in
equation for CV1 for example, is based on a simple mass balance. It is fairly easy to
reason why its gains are 1, 1 and 0.

You might also like