Book MPC
Book MPC
WITH CONSTRAINTS
J.M.Maciejowski
Reader in Control Engineering
University of Cambridge
Fellow, Pembroke College, Cambridge
15 October 2000
ii
http://www.booksites.net/maciejowski/
Preface
• The only generic control technology which can deal routinely with equipment
and safety constraints.
Operation at or near such constraints is necessary for the most profitable or most ef-
ficient operation in many cases. The penetration of predictive control into industrial
practice has also been helped by the facts that
• It is more powerful than PID control, even for single loops without constraints,
without being much more difficult to tune, even on ‘difficult’ loops such as those
containing long time delays.
Predictive control was developed and used in industry for nearly 20 years before
attracting much serious attention from the academic control community. This com-
munity tended to ignore its potential for dealing with constraints, thus missing its
main advantage. In addition, it tended to point to the fact that, when constraints
are ignored, predictive control is equivalent to conventional, though generally ‘ad-
vanced’, linear control, and hence apparently nothing new. This is true, but again
misses the important point that issues such as tunability and understandability are
crucial for the acceptance of a control technology, at least in the process control envi-
ronment. Fortunately the academic community has for some years now appreciated
that predictive control really does offer something new for control in the presence
of constraints, and has provided much analysis, and new ideas, to such an extent
that it has gone beyond current industrial practice, and is preparing the ground for
iii
iv 0. Preface
much wider application of predictive control — potentially to almost all control en-
gineering problems. The constant increase in computing speed and power certainly
makes that a real prospect.
In this book I have attempted to bring everything together. I have tried to convey
the simplicity of the underlying concepts of predictive control, but also to show how
it relates to existing control theory, and indeed how much more can be done with
it when its use is informed by a knowledge of standard control techniques, such as
state estimation, disturbance modelling, and frequency response analysis. Predictive
control involves optimization, and I have included details of how to solve at least
some of the optimization problems encountered. I have also tried to display the main
directions of current research, and give some indication of likely future directions,
both of research and of applications.
This book assumes that the reader has some previous exposure to control theory,
such as a first course and some contact with state-space models. It will be suitable
for graduate students taking systems and control courses, but I hope that it will also
prove useful to practising industrial engineers. In order to increase its usefulness to
non-students, and also to alleviate the problem of prerequisites for students, I have
included a number of minitutorials. These are one-page summaries of topics, such
as observers or Lyapunov equations, that are needed in order to understand the ma-
terial at certain points. I believe that the minitutorials contain enough explanation
to allow the reader to follow the developments in the book, but of course they are
not meant to replace in-depth study of these important topics.
http://www.booksites.net/maciejowski/
The versions of software used for the preparation of this book were:
MATLAB 5.3.1
Control System Toolbox 4.2.1
Model Predictive Control Toolbox 1.0.4
Optimization Toolbox 2.0
My students Eric Kerrigan and Simon Redhead were responsible for most of the
modifications to Model Predictive Control Toolbox functions which are available on
the web site.
v
This book originated in a course of lectures given at the Faculty of Aerospace Engi-
neering in Delft, during November and December 1997. I would like to thank Bob
Mulder, Hans van der Vaart, and Samir Bennani for inviting me to spend a sab-
batical term at Delft, for making all the arrangements, for making my stay at Delft
both pleasant and interesting, and above all for having enough vision to believe that
a course on predictive control was not out of place in an aerospace department. I
would also like to thank Ton van den Boom for giving me feedback on the first few
chapters, Rob de Vries (both of TU Delft) for some valuable help with chapter 4,
and Hans van der Vaart for providing me with the linearised model of the Citation
aircraft which is used in a number of illustrative examples in the book. The use of an
aircraft example may seem quirky, since predictive control has been used almost ex-
clusively in the process industries. There are two reasons for this. Firstly, it reflects
my conviction that predictive control has great potential in all application sectors,
as a result of continuing increases in real-time computational possibilities. Secondly,
most process control examples require considerable explanation of the context to
those who are not chemical engineers, whereas most readers will be able to under-
stand the (very simplified) aircraft example from their own experience. Of course
there are also examples based on process control in the book, and the major case
studies in Chapter 9 are both taken from process control.
I gave a graduate course based on the material in this book to the Centre for Process
Control Design at Lund University, and received several very valuable suggestions
from both faculty and students who attended that course. Andrew Ogden-Swift of
Honeywell Hi-Spec Solutions, Sean Goodhart of Aspentech, David Sandoz of SimSci–
Predictive Control, and Jacques Richalet of Adersa have all been very generous of
their time, have provided me with details of their companies’ products, and have
discussed the practicalities of predictive control most valuably and stimulatingly.
David Sandoz and David Clarke both provided extremely useful, but also encour-
aging, feedback at various stages of the development of the manuscript, and Fred
Loquasto of UC Santa Barbara read the almost-final version in record time, and
picked up several errors and infelicities.
J.M.Maciejowski
14 October 2000
vi 0. Preface
Contents
Preface iii
1 Introduction 1
1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.11 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
vii
viii CONTENTS
2.6 Prediction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
2.8 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
6 Stability 185
7 Tuning 207
10 Perspectives 303
References 320
1 Quadratic Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2 State Observers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
xv
xvi LIST OF MINI-TUTORIALS
List of Figures
1.9 Simulation of system with input and output disturbances, and mea-
surement noise, using noisympc. . . . . . . . . . . . . . . . . . . . . 24
xvii
xviii LIST OF FIGURES
3.8 Soft output constraints restore feasibility. 1-norm penalty with ρ = 104 .114
3.10 Response to disturbance with softened altitude rate constraint, ρ = 104 .117
4.2 The first 15 singular values of H250 for the example. . . . . . . . . . 135
5.5 Cost contours and constraints for LP (left) and QP (right) problems.
The black dot shows the optimal solution in each case. . . . . . . . . 169
6.1 Finite and infinite horizons (no disturbances, perfect model) . . . . . 192
6.3 Youla parametrisation of all stable feedback systems (if the plant is
stable). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
7.9 Singular values of S(z) (solid line) and T (z) (broken line) for mean-
level control of the headbox. . . . . . . . . . . . . . . . . . . . . . . . 221
7.14 Control of water temperature with perfect plant model, and model
of air temperature disturbance. W = 1, V = 10−6 . The broken line
shows the air temperature. . . . . . . . . . . . . . . . . . . . . . . . . 229
8.2 The disturbance and noise model used by Lee and Yu [LY94] . . . . 244
9.2 Open-loop step responses of the ‘Shell’ heavy oil fractionator. . . . . 277
9.3 Hankel singular values of the ‘Shell’ heavy oil fractionator, with Ts = 4
minutes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
LIST OF FIGURES xxi
9.10 Largest singular values of sensitivity S(z) (broken line) and comple-
mentary sensitivity T (z) (solid line). . . . . . . . . . . . . . . . . . . 290
9.11 Largest singular value (solid line), and estimates of complex µ (broken
line) and real µ (chained line) of K(z)S(z)W (z). . . . . . . . . . . . 291
9.15 Largest singular value (solid line), complex µ (broken line) and real
µ (chained line) of K(z)S(z)W (z) with the reduced-gain controller. . 294
9.18 Simulation with single linearised model, obtained at the initial equi-
librium condition. (Broken lines show the set-points.) . . . . . . . . 299
10.1 Execution of a step change in yaw angle with a jammed rudder. . . . 306
xxii LIST OF FIGURES
Introduction
1.1 Motivation
The only advanced control methodology which has made a significant impact on
industrial control engineering is predictive control. It has so far been applied mainly
in the petrochemical industry, but is currently being increasingly applied in other
sectors of the process industry. The main reasons for its success in these applications
are:
4. Control update rates are relatively low in these applications, so that there is
plenty of time for the necessary on-line computations.
1
2 1. Introduction
For this reason, this book does not make a big distinction between the two varieties of
predictive control identified above, but gives a unified treatment of both of them. In
this chapter, the underlying ideas are introduced along the lines of the ‘easy-to-tune,
intuitive’ variety — which is already capable of handling very non-trivial problems,
as Example 1.8 shows. More details of this approach to predictive control are given
later in section 5.6. But most of the following chapters treat the predictive control
problem in its full complexity, and hence in its most useful form: multivariable, and
with constraints.
The importance of being able to take account of constraints arises for several reasons.
The reason cited most often for the success of predictive control in the process
industries, is that the most profitable operation is often obtained when a process is
running at a constraint, or even at more than one constraint. Often these constraints
are associated with direct costs, frequently energy costs; if a product requires heating
during its manufacture, for instance, the manufacturing cost can be minimised by
keeping the heat supplied as small as possible; nevertheless the heat supplied (and its
profile with time) has to be sufficient, and this is a constraint on the manufacturing
process. If a product has to be of at least a certain quality in order to be useful, the
cost can usually be minimised by making its quality just sufficient; again, this is a
constraint which has to be respected. These are examples of constraints on outputs
of controlled processes: the quality of the product is either a controlled variable
itself, or depends on some combination of controlled variables.
Figure 1.1 shows a semi-batch reactor. A reactant enters the reactor on the left. An
exothermic reaction occurs, whose temperature is controlled to a set-point by adjust-
ing the flow of cooling water to the heat-exchanger shown on the right. A successful
reaction requires the temperature to be held close to the set-point (possibly within
specified limits). The reactant flow rate and the cooling water flow rate can both be
adjusted between minimum and maximum limits. The economic objective is to finish
the batch as quickly as possible, subject to these requirements and constraints. In
practice, that is equivalent to keeping the reactant flow rate as large as possible.
There are many other control systems in which the performance is limited by the
presence of constraints, even if that performance is not naturally expressed in mon-
etary terms. Traditionally, control system performance requirements have not been
formulated in a way which reflects this, partly because the available control design
and implementation technologies have not been able to support such a formulation.
But the feasibility of using predictive control in an increasing range of applications
highlights not only the importance of constraints in such applications, but also the
natural way in which quite complex control objectives can be stated, once constraints
can be explicitly stated as part of the problem formulation.
Of course one does not really want to operate a plant exactly at the real limits
of its capabilities. One has to have something in reserve, to deal with unexpected
disturbances from various sources. But the better the control system is at dealing
with such disturbances, the closer can one operate to the constraints. A classical
argument in favour of linear optimal control is that if the disturbances are random,
and if one can reduce the variance of the controlled outputs as far as possible, then
one can operate as near as possible to the constraints, and hence operate the plant
as near as possible to its optimal performance. This is illustrated in Figure 1.2.
This shows three hypothetical probability distributions of some controlled output of
a plant, and a constraint beyond which the output should not stray. Distribution
(a) shows the Gaussian shape and relatively large variance which results from the
use of a relatively badly-tuned linear controller, assuming that the plant behaves
approximately linearly, and that the disturbances have a Gaussian distribution. In
order to have an acceptably low probability of violating the constraint, the set-point
for the output variable has to be set relatively far away from the constraint, and
hence the plant operates far away from the optimal point for the great majority of
the time. Distribution (b) shows a distribution which might be achieved by the use
of linear optimal control. The variance has been reduced, thus allowing the set-point
to be significantly closer to the constraint. The distribution remains Gaussian, since
the control law is linear.
Distribution (c) shows the effect of using predictive control. The controller is aware
of the constraint, and hence reacts very differently in response to a disturbance
which pushes the output towards the constraint, than it would do in response to
a disturbance which pushes it away from it. The controller is therefore nonlinear,
and the distribution of the output variable is no longer Gaussian . It becomes
significantly unsymmetric, with the result that it is possible to operate the plant
with a set-point very close to the constraint, while retaining an acceptably small
1.1. Motivation 5
(c)
(b)
Constraint
(a)
Figure 1.2: Set-point improvement available from the use of predictive control.
Another reason for the importance of being able to take account of constraints
is the presence of buffer tanks in many processes. Such tanks are often used to
store product between individual units in production processes, and their principal
purpose is to absorb the effects of disturbances in one unit, thus preventing the
propagation of the effects to downstream units. The level of liquid in such a buffer
tank has to be controlled, in order to ensure that it does not become completely
empty or full, but between these limits it can be allowed to vary. In fact, the whole
point of having such a tank is for the level to vary, since that is the means by which
it absorbs the effects of disturbances. There is no point whatever in controlling the
level in a buffer tank to a set-point, since that would destroy its purpose. Traditional
process control deals with this problem by means of overrides and other ad hoc fixes.
Predictive control, however, provides a very natural means of handling the control
of buffer tanks, within its standard formulation: constraints on the levels of such
tanks are defined, but no set-points are specified. (The control objectives for such
outputs are sometimes called zone objectives — see Section 5.5.) Similar control
objectives exist in other contexts, and it has even been suggested [ZAN73] that the
majority of process control problems are naturally formulated in this way.
2
The figure is supposed to illustrate the qualitative effects of using predictive control. Since the
control action becomes nonlinear once constraints become active, it is usually extremely difficult to
compute the actual probability distribution achieved.
6 1. Introduction
Figure 1.3 shows a train of fractionators. The liquid heavy fraction in each column
drains to the sump at the bottom, and is then passed on to the next fractionator. The
flow rate is controlled to keep the level in the sump between minimum and maximum
levels. The sump acts as a buffer, and absorbs any surges in flow which might arise
from upstream columns. The sump levels are thus naturally controlled by defining
them as zone objectives. The buffering action would be destroyed by tight control to
set-points.
There is one more reason why predictive control’s ability to handle constraints ex-
plicitly is important. The fact that the controller is aware of input constraints,
in particular of actuator saturation constraints, and never generates input signals
which attempt to violate them, removes the problem of integrator wind-up . This
problem occurs with conventional controllers if long-duration set-point errors cause
integrator outputs to exceed the saturation limits, and can result in large overshoots
and even instability [FPEN94]. Standard remedies for the problem are known, but
these have to be ‘tacked on’ to a conventional controller, increasing its complexity
considerably. With predictive control, the wind-up problem does not arise.
Another factor which is crucial to the industrial success of predictive control is the
natural way in which it can handle multivariable problems. Profit maximisation,
and more generally performance optimization, requires integrated control of com-
plex plants and processes. This implies monitoring the future behaviour of many
1.2. The ‘Receding Horizon’ Idea 7
output variables, and using the full range of possible control variables to keep a pro-
cess operating as economically as possible, and safely, over some future prediction
horizon. Looking ahead to future applications of predictive control, one can cite
as a suitable example the integrated control of advanced aircraft, in which engines,
lateral thrusters, vortex separation control, and aerodynamic surfaces, are all used
in a coordinated manner. All the ideas, and most of the algorithms, can be applied
without modification to such multivariable problems, and are not significantly dif-
ferent if the number of available control inputs exceeds, is the same as, or is smaller
than, the number of controlled outputs.
So far, reasons have been given for the practical success which predictive control has
had to date. There is another reason which can be expected to become prominent in
the future. Predictive control is model based in the sense that it uses an explicit in-
ternal model to generate predictions of future plant behaviour. The models currently
used are usually ‘black-box’ linear input-output models, obtained from simple plant
tests or by applying system identification methods to plant data. But there is an
increasing use of nonlinear ‘first-principles’ models in the process industries. These
are models which are obtained from an understanding of the physical and chemical
transformations occurring inside a process. Some of them are extremely detailed
and complex. As methodologies and technologies for supporting the development of
such models improve, so the cost of developing them can be expected to fall from
its current level, which is very high, and their use is therefore likely to become more
widespread. There is much potential for future synergy of first-principles models
with (model-based) predictive control. This may be realised by increasing use of
nonlinear models in order to give more accurate predictions of process behaviour in
nonlinear regimes (which leads to difficulties with predictive control — see Chap-
ter 10), or by using nonlinear models to derive linear approximate models without
the need for plant tests, or by using them in some other, as yet undeveloped, way.
Figure 1.4 shows the basic idea of predictive control. In this presentation of the
basics, we confine ourselves to discussing the control of a single-input, single-output
(SISO) plant. We assume a discrete-time setting, and that the current time is
labelled as time step k. At the current time the plant output is y(k), and the
figure shows the previous history of the output trajectory. Also shown is a set-point
trajectory, which is the trajectory that the output should follow, ideally. The value
of the set-point trajectory at any time t is denoted by s(t).
Distinct from the set-point trajectory is the reference trajectory. This starts at the
current output y(k), and defines an ideal trajectory along which the plant should
return to the set-point trajectory, for instance after a disturbance occurs. The ref-
erence trajectory therefore defines an important aspect of the closed-loop behaviour
of the controlled plant. It is not necessary to insist that the plant should be driven
8 1. Introduction
s(t)
r(t|k)
Hp
y(t)
ŷ(t|k)
ŷf (t|k)
k k + Hp Time
Input
k k + Hp Time
back to the set-point trajectory as fast as possible, although that choice remains
open. It is frequently assumed that the reference trajectory approaches the set-
point exponentially from the current output value, with the ‘time constant’ of the
exponential, which we shall denote Tref , defining the speed of response. That is, if
the current error is
then the reference trajectory is chosen such that the error i steps later, if the output
followed it exactly, would be
where Ts is the sampling interval and λ = e−Ts /Tref . (Note that 0 < λ < 1.) That
1.2. The ‘Receding Horizon’ Idea 9
The notation r(k + i|k) indicates that the reference trajectory depends on the con-
ditions at time k, in general. Alternative definitions of the reference trajectory are
possible — for example, a straight line from the current output which meets the
set-point trajectory after a specified time.
A predictive controller has an internal model which is used to predict the be-
haviour of the plant, starting at the current time, over a future prediction hori-
zon. This predicted behaviour depends on the assumed input trajectory û(k + i|k)
(i = 0, 1, . . . , Hp − 1) that is to be applied over the prediction horizon, and the idea
is to select that input which promises the best predicted behaviour. We shall assume
that the internal model is linear; this makes the calculation of the best input rela-
tively straightforward. The notation û rather than u here indicates that at time k
we only have a prediction of what the input at time k + i may be; the actual input at
that time, u(k + i), will probably be different from û(k + i|k). Note that we assume
that we have the output measurement y(k) available when deciding the value of the
input u(k). This implies that our internal model must be strictly proper, namely
that according to the model y(k) depends on past inputs u(k − 1), u(k − 2), . . . , but
not on the input u(k).
In the simplest case we can try to choose the input trajectory such as to bring
the plant output at the end of the prediction horizon, namely at time k + Hp ,
to the required value r(k + Hp ). In this case we say, using the terminology of
Richalet [Ric93b], that we have a single coincidence point at time k + Hp . There
are several input trajectories {û(k|k), û(k + 1|k), . . . , û(k + Hp − 1|k)} which achieve
this, and we could choose one of them, for example the one which requires the
smallest input energy. But it is usually adequate, and in fact preferable, to impose
some simple structure on the input trajectory, parametrised by a smaller number of
variables. Figure 1.4 shows the input assumed to vary over the first three steps of
the prediction horizon, but to remain constant thereafter: û(k + 2|k) = û(k + 3|k) =
· · · , û(k + Hp − 1|k), so that there are three ‘parameters’ to choose: û(k|k), û(k +
1|k), û(k + 2|k). The simplest possible structure is to assume that the input will
remain constant over the prediction horizon: û(k|k) = û(k + 1|k) = · · · = û(k +
Hp − 1|k). In this case there is only one parameter, namely û(k|k); since there is
also only one equation to be satisfied — ŷ(k + Hp |k) = r(k + Hp |k) — there is a
unique solution.
Once a future input trajectory has been chosen, only the first element of that tra-
jectory is applied as the input signal to the plant. That is, we set u(k) = û(k|k),
where u(k) denotes the actual signal applied. Then the whole cycle of output mea-
surement, prediction, and input trajectory determination is repeated, one sampling
interval later: a new output measurement y(k + 1) is obtained; a new reference tra-
jectory r(k + i|k + 1) (i = 2, 3, . . . ) is defined; predictions are made over the horizon
10 1. Introduction
In the simplest case considered above, when there is only one coincidence point
and only one parameter to choose for the future input trajectory, there is a unique
solution, as has already been stated. More commonly, there are several coincidence
points in the prediction horizon — perhaps even all the points k +1, k +2, . . . , k +Hp
are coincidence points. Even if there is more than one parameter to be chosen for the
future input trajectory, in the usual situation there are more coincidence points than
parameters. In this case there are more equations to be satisfied than the number
of available variables, and it is in general impossible to solve them exactly. That
is, it is impossible to choose the future input trajectory such that the predicted
output coincides with the reference input at all the coincidence points. In this
case, some kind of approximate solution is necessary. Most commonly, a least-
squares
P solution is found, namely one such that the sum of the squares of the errors,
iP [r(k + i|k) − ŷ(k + i|k)] , is minimised, where P denotes the set of indices i
2
which correspond to coincidence points. As will be seen shortly, if the internal model
is linear, the least-squares solution is easily found, and in fact yields a linear control
law.
Again, let us consider the simplest case first, with one coincidence point k + Hp
and one parameter to choose, û(k|k). Conceptually, one can proceed as follows.
The internal model can first be used to predict the free response ŷf (k + Hp |k) of
the plant, namely the response that would be obtained at the coincidence point if
the future input trajectory remained at the latest value u(k − 1). The details of
how this is obtained will depend on the form of model available, because the ‘initial
conditions’ depend on the form of the model. If a step or pulse response is available
as the model, then all the available past inputs are needed. For a transfer function
or difference equation model, n past inputs and outputs are needed, where n is the
order of the transfer function. For a state-space model, the current state is needed,
or an estimate of it. Now let S(Hp ) be the response of the model to a unit step
input, Hp steps after the unit step is applied. The predicted output at time k + Hp
is
3
The receding horizon concept corresponds to the usual behaviour of the Earth’s horizon: as one
moves towards it, it recedes, remaining a constant distance away from one.
1.3. Computing the Optimal Inputs 11
where
is the change from the current input u(k − 1) to the predicted input û(k|k). We
want to achieve
Note that we have assumed that the model output and the plant output are the
same up to time k. This will not be so in practice, but we shall address that in the
next section.
Example 1.3 Suppose that the set-point is constant at value s(k + i) = 3, and that
Tref = 9 sec, the sampling interval is Ts = 3 sec, there is a single coincidence point
at Hp = 2 (steps; that is, 6 sec into the future), and the plant’s z-transform transfer
function is
2
G(z) = (1.10)
z − 0.7
The previous and current outputs are y(k−1) = y(k) = 2, and the latest control input
is u(k−1) = 0.3. What is the optimal input û(k|k), assuming that û(k|k) = û(k+1|k)
?
To get the free response, we put the transfer function into difference equation form:
Finally we need S(2), the step response Hp = 2 time steps after a unit step input
is applied. We can get this from (1.11) by assuming u(k) = u(k + 1) = 1 and
y(k) = y(k − 1) = 0:
We now have everything required to compute the optimal input, using (1.9):
2.487 − 2.0
∆û(k|k) = = 0.1432 (1.16)
3.4
û(k|k) = u(k − 1) + ∆û(k|k) = 0.4432 (1.17)
This is the input signal applied to the plant: u(k) = û(k|k) = 0.4432. If our model
of the plant is perfect, and there are no disturbances, then this would result in the
next plant output value being y(k + 1) = 0.7 × 2 + 2 × 0.4432 = 2.2864.
If there is more than one coincidence point, then there are more equations to be
satisfied than there are variables, and we therefore have to be satisfied with an
approximate solution. Suppose we have c coincidence points, with corresponding
values of the reference trajectory r(k + P1 |k), r(k + P2 |k), . . . , r(k + Pc |k), with
Pc ≤ Hp . Since we would like to achieve ŷ(k + Pi |k) = r(k + Pi |k) for i = 1, 2, . . . , c,
we would like to choose û(k|k) to solve the following equations:
Most commonly, this equation is solved in the ‘least-squares’ sense. Some details of
least-squares solutions are given in Chapter 3, but for the moment we just note that
if we define the vectors
r̂(k + P1 |k) ŷf (k + P1 |k) S(P1 )
r̂(k + P2 |k) ŷf (k + P2 |k) S(P2 )
T = .. Yf = .. S= .. (1.21)
. . .
r̂(k + Pc |k) ŷf (k + Pc |k) S(Pc )
then in MATLAB the least-squares solution is obtained using the ‘backslash’ oper-
ator as:
Example 1.4 Consider the same set-up as in Example 1.3, but this time with two
coincidence points: P1 = 1, P2 = Hp = 2. We have
and hence
We can already see at this point how predictive control can easily be given the capa-
bility of respecting constraints. If there are constraints on the inputs and/or outputs,
then the simple ‘linear least-squares’ solution has to be replaced by a ‘constrained
least-squares’ solution. To be sure, it is no longer possible to obtain a closed-form
solution and some form of iterative optimization algorithm must be employed, but
if the constraints are in the form of linear inequalities then we have a quadratic pro-
gramming problem, which can be solved very reliably and relatively quickly. We will
look in detail at solving the constrained predictive control problem in Chapters 3
and 5.
Now suppose that we allow a more complicated future input trajectory. We could
assume that the input is allowed to change over the next Hu steps, for example, so
that we have to choose û(k|k), û(k + 1|k), . . . , û(k + Hu − 1|k), and assume that
û(k + Hu − 1|k) = û(k + Hu |k) = · · · = û(k + Hp − 1|k) = if Hu < Hp . (It would
be unusual to choose Hu > Hp , but this could be done. Usually Hu is chosen to be
considerably smaller than Hp .) Now the predicted output at time k + Pi is given by
where H(j) = S(j)−S(j −1) is the unit pulse response coefficient of the system after
j time steps. The reason why pulse reponse coefficients appear in this expression,
rather than step response coefficients, is that each of the input values û(k|k), û(k +
1|k), . . . , û(k + Hu − 2|k) is assumed to be applied for only one sampling interval.
Only the last one, û(k + Hu − 1|k), remains unchanged until step Pi , and its effect is
therefore obtained by multiplying it by the step response coefficient S(Pi − Hu + 1).
Since we assume that the system is strictly proper, we have H(0) = 0 and S(0) = 0,
and of course H(j) = 0 and S(j) = 0 if j < 0 because of causality. So if Pi ≤ Hu
then the last non-zero term in this expression is H(1)û(k + Pi − 1|k).
by regrouping terms. Now we can write a set of equations for the predicted outputs
at all the coincidence points in matrix-vector form:
Y = Yf + Θ∆U (1.25)
14 1. Introduction
where
ŷ(k + P1 |k) ∆û(k|k)
ŷ(k + P2 |k) ∆û(k + 1|k)
Y = .. ∆U = .. (1.26)
. .
ŷ(k + Pc |k) ∆û(k + Hu − 1|k)
and
S(P1 ) S(P1 − 1) · · · S(1) 0 ··· 0 0 ··· 0
S(P2 ) S(P2 − 1) · · · ··· ··· ··· S(1) 0 ··· 0
Θ= .. .. .. .. .. .. .. .. .. ..
. . . . . . . . . .
S(Pc ) S(Pc − 1) · · · ··· ··· ··· ··· ··· ··· S(Pc − Hu + 1)
(1.27)
Again, since we want to achieve Y = T , but usually don’t have enough variables to
do so exactly, we obtain the least-squares solution:
∆U = Θ\[T − Yf ] (1.28)
As was said before, we now select the first element of the vector ∆U , namely ∆û(k|k),
use it to form the input applied to the plant:
and repeat the whole cycle of calculations at the next time step, starting with the
next measurement of the plant output, y(k + 1).
Example 1.5 We return to Example 1.4. This time in addition to having the two
coincidence points P1 = 1 and P2 = 2, we will choose Hu = 2, so that we compute
optimal values of û(k|k) and û(k + 1|k) at each step. T , Yf and S remain the same
as before. The new entity now is
S(1) 0 2.0 0
Θ= =
S(2) S(1) 3.4 2.0
From Example 1.3 we know that u(k − 1) = 0.3. Note that in this case the number
of variables to be chosen is the same as the number of coincidence points, so that
the matrix Θ is square and can be inverted, and the solution is unique. MATLAB’s
‘backslash’ operator still gives the correct solution in this case:
∆U = Θ\[T − Yf ]
0.1420
=
0.0021
Clearly, some software is needed not only to implement predictive control, but even
to study it. Even for the simple scenarios studied in Section 1.3, with just one or
two coincidence points and one or two variables, one needs to repeat the calcula-
tions many times in order to see how the resulting control law performs. A simple
MATLAB program, called basicmpc, has been written to simulate basic predictive
control, as described in this chapter. A complete listing of it is given in Appendix B,
and it is also available on this book’s web site:
http://www.booksites.net/maciejowski/
This shows one way of organising the computations. The reader should be able to use
it as a ‘template’ which can be modified to handle other formulations of predictive
control problems. For more complicated scenarios, however, such as multivariable
problems and/or those involving constraints, and for simulation of nonlinear plants,
we will later rely on the use of MATLAB’s Model Predictive Control Toolbox, which
is described in Appendix C.
In this section we shall explain the main features of basicmpc, without going through
all the details.
basicmpc assumes that an exponential reference trajectory is used, and the program
starts by defining Tref . The variable Tref is used, and as far as possible variables
are used which correspond to the notation used in this chapter. Note that the
program is in the form of a MATLAB script file, not a function, so that values of
variables such as Tref are changed by editing the file, not by supplying arguments.
The reader can easily modify the program so that it becomes a function, if desired.4
The possibility Tref = 0 is allowed for, which represents immediate return of the
reference trajectory to the set-point trajectory: r(k + i|k) = s(k + i). Next, the
sampling interval Ts is defined; by default this is set to Tref /10 (or 1 if Tref = 0),
but this can be changed as required.
Linear, Time-Invariant systems in the Control System Toolbox. In the rest of the
program, the plant is represented by the numerator and denominator polynomials of
its z-transform transfer function representation, nump and denp, respectively. Con-
sequently, however plant has been defined, it is then coerced into transfer function
form, and these polynomials are extracted:
This allows the plant to be defined in many ways. For example, from a continuous-
time state-space description:
Next, the model is defined in the same way, as variable model. This allows model to
be different from plant, so that the effects of modelling errors can be studied, but as
supplied the program sets model = plant. Again the numerator and denominator
polynomials are extracted, this time with names numm and denm.
The coincidence points are defined in the vector P in terms of the number of sampling
intervals, so that P1 = 3, P2 = 7, P3 = 12 would be represented by P=[3;7;12], etc.
Later this vector is multiplied by Ts to get the corresponding vector of coincidence
times, which is needed to compute the values of exp(−Pi Ts /Tref ) (in vector errfac).
The variable M is used to store the control horizon Hu , the change of notation here
being made for compatibility with the Model Predictive Control Toolbox, which also
uses M for this purpose.
The set-point trajectory is defined in the vector setpoint. Note that its length
has to be nsteps + max(P) where nsteps is the number of steps to be simulated,
because the controller needs to have a prediction of the set-point, even when it
reaches the end of the simulation.
Next, the Control System Toolbox function step is used to compute the step response
of the model over the required prediction horizon (which is max(P)), and form the
1.4. A Simple MATLAB Program 17
stepresp = step(model,[0:Ts:max(P)*Ts]);
theta = zeros(length(P),M);
for j=1:length(P),
theta(j,:) = [stepresp(P(j):-1:max(P(j)-M+1,1))’,zeros(1,M-P(j))];
end
S = stepresp(P);
Everything described so far needs to be done only once, before the simulation is
started. The remaining calculations need to be repeated for every simulation step.
This is done in a big ‘for-loop’ (for k=1:nsteps). First the reference trajectory
has to be computed over the prediction horizon, starting at the current plant output
yp(k); the reference trajectory is stored in the vector reftraj.
Next the free response of the model over the prediction horizon is obtained and
stored in ymfree, by iterating the difference equation which corresponds to the
transfer function of the model. At each iteration the previous values of the free
response are held in the vector yfpast, which is initialised to the previous values of
the model output, from previous steps (that is, from lower values of k:
Note that ufpast is needed to hold past values of the model input, even though the
new values applied over the prediction horizon are all the same.
Now everything is ready for computing the optimal value of ∆U (variable dutraj)
and forming the new input to the plant u(k) (variable uu(k)):
dutraj = theta\(reftraj-ymfree(P)’);
uu(k) = dutraj(1) + uu(k-1);
Finally the plant and model are simulated for one step to obtain their next outputs.
It is important to note here that, if there is any difference between the plant and
the model, then their outputs evolve independently:
% Simulate plant:
18 1. Introduction
% Simulate model:
% Update past model inputs:
umpast = [uu(k);umpast(1:length(umpast)-1)];
ym(k+1) = -denm(2:ndenm+1)*ympast+numm*umpast; % Simulation
% Update past model outputs:
ympast = [ym(k+1);ympast(1:length(ympast)-1)];
Richalet [Ric93b] has drawn attention to the importance of this independent model
implementation, because it makes dealing with plant-model errors relatively simple,
as we shall see in the next section. We shall also see, however, that it is not always
possible to respect this desideratum.
If the program is modified to simulate the effects of disturbances and/or noise, care
should be taken to modify only the simulation of the plant, not of the model. For
details, examine the program noisympc, which is available on the web site — also
see the end of the next section.
When the simulation has been completed, a summary of the parameters is written
out to the screen, and the results are presented graphically.
Example 1.6 The program basicmpc is supplied with the plant defined by the trans-
fer function
1
z2 − 1.4z + 0.45
with Tref = 6, Ts = 0.6, Hp = P1 = 8, M = 1, and with model = plant. Figure 1.5
shows the simulation results, when the set-point is constant at 1, all initial conditions
are zero, and there are no disturbances or noise.
If the model is not the same as the plant, in particular if the steady-state gain of
the model is not correct, then the plant output will reach an incorrect final value.
This is illustrated in Figure 1.6, which shows the results of running basicmpc with
the plant having transfer function
1
z2 − 1.4z + 0.45
1.5. Offset-free Tracking 19
0.8
0.6
0.4
0.2
0
0 10 20 30 40 50 60
Time
Input
0.07
0.065
0.06
0.055
0.05
0.045
0 10 20 30 40 50 60
Time
where 1 denotes a vector [1, 1, . . . , 1]T . Note that the step response coefficients in
Θ are those of the model, not the plant, since the true plant step response is not
known to the controller. The corresponding change in the software is to insert the
line
20 1. Introduction
0.5
0
0 10 20 30 40 50 60
Time
Input
0.075
0.07
0.065
0.06
0.055
0.05
0.045
0 10 20 30 40 50 60
Time
d = yp(k) - ym(k);
and to replace
by
The program trackmpc incorporates this modification, and is available on this book’s
web site. Simulation results, when using this modification with the same plant-model
mismatch as in Figure 1.6, are shown in Figure 1.7. This figure shows that the plant
output now reaches the set-point correctly.
This works — for asymptotically stable plant and model — for the following reason.
Let the steady-state gain of the plant be Sp (∞), and the steady-state gain of the
model be Sm (∞). Also assume that the closed-loop is asymptotically stable, and
that the set-point is a constant s(k) = s∞ . Then the input, and both the plant
and model outputs settle to constant values, say u(k) → u∞ , yp (k) → yp∞ , and
ym (k) → ym∞ , where yp and ym denote the plant and model outputs, respectively.
Then yp∞ = Sp (∞)u∞ and ym∞ = Sm (∞)u∞ , so that
d(k) → d∞ = [Sp (∞) − Sm (∞)]u∞ (1.32)
1.5. Offset-free Tracking 21
1.2
0.8
0.6
0.4
0.2
0
0 10 20 30 40 50 60
Time
Input
0.07
0.065
0.06
0.055
0.05
0.045
0 10 20 30 40 50 60
Time
In steady-state conditions, since both the set-point trajectory and the plant output
are constant, the reference trajectory does not depend on k: r(k + i|k) = ri . Hence
T is a constant vector. Also Yf is a constant vector, since the free response is always
computed from the same initial conditions, once steady-state has been reached. Now
recall from (1.25) that we have
Θ∆U = Y − Yf
1ym∞ − Yf = 0 (1.35)
The reason for this is a little subtle: the free response starts from a constant level
of ym∞ , since it is the free reponse of the model. But we are assuming steady-state
conditions, so that the free response remains constant at its initial value. So we
conclude that
But in the steady state ∆U = 0, and hence T = 1yp∞ , or ri = yp∞ . So the reference
trajectory is constant, with value yp∞ . But ri = s∞ − λi (s∞ − yp∞ ), so we conclude
22 1. Introduction
that
yp∞ = s∞ (1.37)
which shows that the plant output reaches the set-point value, despite the modelling
error.
Note that this analysis has assumed that the closed loop is stable, which is not
guaranteed, of course.
This same ‘trick’ also gives offset-free tracking of constant set-points if there is an
unknown constant additive disturbance acting at either the input or the output of
the plant, since both of these have the same effect as an incorrect steady-state gain
of the model. In fact, the use of (1.31) can be seen as explaining any error between
the current plant and model outputs as a disturbance acting at the plant output,
and assuming that this disturbance will continue to act throughout the prediction
horizon. This method of obtaining offset-free tracking is used in every commercial
predictive control product known to the author. (See Appendix A for descriptions
of some of these products.)
The reader familiar with conventional control may wonder how it is possible to
eliminate steady-state errors without the use of ‘integral action’. We shall show
later that the scheme just described can in fact be interpreted as incorporating a
‘discrete-time integrator’ in the control law in a particularly simple way.
The use of the disturbance estimate (1.30) is in fact the only way in which feedback
enters the predictive control law. Using it in (1.31) corresponds to assuming that
the currently-estimated disturbance will persist at the same level into the future.
This is not the only assumption that can be made; for example, it could be assumed
that the disturbance dies away exponentially with a known time constant, though
the offset-free tracking property would be lost in that case.
The program noisympc has been written, and is available on this book’s web site.
This program provides offset-free tracking, but in addition simulates the effects of
measurement noise, and of input and output disturbances, as shown in Figure 1.8.
The vectors noise, udist and ydist contain the measurement noise, and the input
and output disturbances. The actual plant output, with the output disturbance
included (variable ypd), and the measured output (variable ypm), are formed by the
statements
One has to be careful to use ypm instead of yp in the definition of the reference
trajectory (errornow = setpoint(k)-ypm(k)) and of the output disturbance esti-
mate (d = ypm(k) - ym(k)). The model output is left unaltered — because of the
‘independent model’ idea, and because neither the noise nor the disturbances are
1.6. Unstable Plant 23
known directly to the controller. Input disturbances are included by modifying the
definition of the vector uppast, which holds the past values of the input received by
the plant:
uppast = [uu(k)+udist(k);uppast(1:length(uppast)-1)];
The graphical display is now a little more elaborate: both the real and the measured
plant outputs are shown. Also both the controller output and the effective plant
input are plotted — if input disturbances are present these are not the same. As
Input Output
disturbance disturbance
Plant
output
PLANT
Controller
output
Noise
Measured
output
supplied, the program simulates noise of standard deviation 0.1, a constant input
disturbance of value 0.1, and an output disturbance which switches from value +0.1
to -0.1 halfway through the simulation.
Example 1.7 Figure 1.9 shows the graphical output from simulating the same sys-
tem as shown in figures 1.5 and 1.7, with noise and disturbances present, using the
program noisympc. Note how the plant output reaches the correct set-point, despite
the unknown input and output disturbances. The output disturbance switches from
+0.1 to -0.1 halfway through the simulation, at t = 30.
Some plants contain integrations, typically if the output is the level of a tank con-
taining liquid, or the position or attitude of an inertial object such as an aircraft.
These are no longer asymptotically stable, but the basic predictive controller as de-
veloped in the previous two sections can still be applied to such ‘marginally stable’
plants — see Problem 8.
24 1. Introduction
1.5
0.5
−0.5
0 10 20 30 40 50 60
Time
0.15
0.1
0.05
−0.05
−0.1
0 10 20 30 40 50 60
Time
Figure 1.9: Simulation of system with input and output disturbances, and measure-
ment noise, using noisympc.
However, if the plant is unstable, in the sense that its impulse or pulse response is
unbounded (continuous-time poles in the right half-plane, discrete-time poles outside
the unit circle), then the scheme as presented will no longer work. The problem is
precisely the use of the ‘independent model’ that was previously advocated as a
desirable feature, because this means that the model is running ‘open loop’. If the
model is unstable and running open-loop, then its behaviour will rapidly diverge
from the real plant behaviour, and numerical errors in the simulation will be rapidly
amplified by the instability, so that its value as a predictor of plant behaviour will
be completely lost.
The only remedy in this case is to stabilise the model somehow, and that requires
the ‘independence’ of the model to be given up. The easiest way of stabilising the
model is to ‘re-align’ it on the plant outputs. That is, when running it to generate
predictions of plant behaviour, the initial conditions are taken to be those of the
plant, not those resulting from the previous model simulation step. Suppose that
the unstable model corresponds to the difference equation
X
n X
n
ym (k) = − ai ym (k − i) + bi u(k − i) (1.38)
i=1 i=1
1.6. Unstable Plant 25
That is, actual past plant outputs (and inputs) are used whenever they are available.
We shall see later that this always stabilises the model, and that it can be interpreted
as implementing a deadbeat observer for the plant, so the model does not diverge
much from the plant. But it does not necessarily lead to a stable closed loop. Note
that (1.39) introduces feedback into the predictive controller, in a manner different
from the use of (1.30).
ympast = [ym(k+1);ympast(1:length(ympast)-1)];
by
ympast = yppast;
Example 1.8 The transfer function from the rotor angle to the forward speed of a
helicopter in a particular flight condition is given by
9.8(s2 − 0.5s + 6.3)
(s + 0.6565)(s2 − 0.2366s + 0.1493)
This has zeros at +0.25 ± 2.5j and poles at +0.118 ± 0.37j. It is therefore both non-
minimum-phase and unstable — certainly a difficult plant to control. Figure 1.10
shows the response obtained using the program unstampc when an exact model is
assumed, and parameters Tref = 6 and Ts = 0.6 are used, with a single coincidence
point P1 = 8, and Hu = 1. This example shows that predictive control, although
Plant output (solid) and set−point (dashed)
1.4
1.2
0.8
0.6
0.4
0.2
0
0 10 20 30 40 50 60
Time
−4 Input
x 10
20
15
10
−5
0 10 20 30 40 50 60
Time
simple and intuitive in its formulation, can produce some very sophisticated control
action when required. In order to stabilise this unstable plant, classical theory tells
us that the Nyquist locus of the loop-gain frequency response must encircle the point
−1 twice, and this can only be achieved by supplying sufficient phase lead at the
appropriate frequencies. Doing this successfully requires considerable skill on the part
of a designer using classical ‘loop-shaping’ techniques. Predictive control achieves
this implicitly, given only some ‘reasonable’ design specifications.
On the other hand, this does not mean that classical theory can be forgotten. For this
example it tells us, for instance, that the loop gain must increase to values greater
than 1 at a frequency no lower than 0.4 rad/sec, approximately, and must decrease
again to values smaller than 1 at a frequency no higher than 2.5 rad/sec, approx-
imately [Mac89, chapter 1]. Its range of possible behaviours is rather restricted,
therefore, and this knowledge certainly helps to give the predictive controller a ‘rea-
sonable’ specification to achieve.
1.7. Early History and Terminology 27
The reader will find that improving the performance — for example, reducing the
overshoot or speeding up the response — by adjusting the parameters of the predictive
controller, is not so easy in this case.
Cutler and Ramaker [CR80] also proposed predictive control, calling it Dynamic Ma-
trix Control, or DMC. This emphasised optimal plant operation under constraints,
and computed the control signal by repeatedly solving a linear programming (LP)
problem. DMC went on to become the most well-known of the commercial predictive
control products. A patent for it was granted to Prett et al in 1982 [PRC82].
All of these proposals shared the essential features of predictive control: an explicit
internal model, the receding horizon idea, and computation of the control signal
by optimising predicted plant behaviour. Early academic publications containing
similar ideas include those of Propoi [Pro63], Kleinman [Kle70], Kwon and Pear-
son [KP75], and Rouhani and Mehra [RM82]. A very early contribution which
adressed a rather different problem, but introduced some ideas similar to those now
standard in predictive control, was that of Coales and Noton [CN56]. This provided
an approximate solution to the problem of synthesising minimum-time ‘bang-bang’
optimal controls; it did so by generating predictions of plant behaviour, using a fast
simulation model and assuming constant control signals, and deciding whether to
switch the sign of the control signal on the basis of the predicted behaviour at the
end of the prediction horizon. The horizon was not constant, however, so it was not
a receding horizon strategy; but it did contain the essential ideas of using predic-
28 1. Introduction
tions, generated from an explicit internal model (which was assumed at that time
to be an analog computer), and of computing an optimal control signal on-line in
real time.5
Of course, the idea of using predictions is a very old and common one in control.
The well-known Smith predictor [Smi57], for example, which is a controller for plants
with large time delays, has at its heart a model of the plant without the time delay,
thus providing a prediction of the plant output. Obtaining the prediction is a means
of obtaining phase lead, which offsets the large phase lag caused by the delay in the
plant. More fundamentally, any controller which uses derivative action, or a phase
lead compensator, can be viewed as providing a prediction of some signal. In a basic
‘proportional and derivative’ controller, for instance, the control signal depends on
y + T (dy/dt), where y is the plant output. This can be seen as a ‘T -second-ahead’
prediction of the output, on the assumption that dy/dt will remain constant over this
interval. The point of this discussion is to indicate that we will not consider every
control law which involves some kind of prediction as being an instance of ‘predictive
control’. Only those which include, as a minimum, an explicit model of the plant,
the receding horizon idea, and some kind of optimization, will be considered in this
book.
and so on. Generic names which have become widely used to denote the whole
area of predictive control are Model Predictive Control, or MPC, and Model Based
Predictive Control, or MBPC.
Figure 1.11 shows how predictive control is typically used in the process industries
at present. At the top level there is determination of set-points, usually by means
5
For an extended discussion of this proposal, and later developments, see [Rya82].
1.8. Predictive Control in the Control Hierarchy 29
(daily)
(hourly)
Predictive Control
(Logic, Overrides, Decoupling,
Exception handling)
Actuators
In between the static optimization layer and the local controller layer, there is tra-
ditionally a complex layer of logic, overrides, decoupling networks and exception
handling, to deal with all those conditions which cannot be handled by the simple
‘one set-point, one control loop’ paradigm. This layer usually consists of a collec-
tion of ad-hoc solutions to individual problems, and so tends to evolve during the
30 1. Introduction
lifetime of a plant, rather than being the product of an integrated design process.
Each solution is unlikely to take account of the behaviour of the whole process or
plant, and the overall behaviour of this layer is very far from being optimised.
It is in replacing this ad-hoc layer that predictive control currently has its most
successful niche in the process industries. The most commonly used combination,
of linear dynamic models and constrained optimization, allows it to handle very
many of the ‘exceptional’ (but not rare) conditions previously handled by the layer
of ad-hoc ‘fixes’. Furthermore, because predictive control is an integrated solution
to handling all these problems, it can provide dramatically better performance than
the technology it is replacing.
The fact that predictive control is usually implemented on top of traditional lo-
cal controllers had had important implications for its acceptance and development.
Firstly, it has allowed operating companies to be relatively brave in introducing this
new technology; if a predictive controller starts to misbehave, it is usually possible
to disable it, and let the local loop controllers hold the plant at the last set-points
they received from higher levels. The great majority of process plant is stable in this
condition, so although this may not be the most profitable condition, it is at least
a safe one. This is one of the reasons why there were many predictive controllers
installed even before there was a satisfactory stability theory for predictive control,
and indeed why many current installations take no account of that stability theory.
Secondly, it has resulted in commercial predictive controllers being developed almost
exclusively for stable plant. The plant ‘seen’ by the predictive controller is one which
is already running under closed-loop control, and is almost invariably stable.
Not all predictive controllers play the role shown in Figure 1.11. There are some
which are used as replacements of low-level controllers, for instance in servomechan-
sims, and in applications where adaptive control is required [CBB94, Cla88, ReADAK87].
It can be expected, especially as predictive control spreads to new application areas,
that it will become increasingly common for predictive control to include the lower
level currently populated by PI controllers, leaving only the actuator servos below it.
This is illustrated in Figure 1.12. In applications such as flight or spacecraft control,
for example, there is no scope for individual loops above the actuator level, because
holding each set-point (such as climb rate, or 3-axis attitude) requires coordinated
action by several actuators. Faster control update rates are needed if lower-level
control functions are to be performed, but these are becoming possible as comput-
ing hardware becomes faster. The other feature shown in Figure 1.12 is integration
of economic (short-term set-point) optimization with the dynamic performance op-
timization currently implemented by predictive control.
1.8. Predictive Control in the Control Hierarchy 31
(daily)
PREDICTIVE
CONTROL
Actuators
(valve servos etc)
In some ways this theory solved an extremely wide range of problems. Suppose that
the ‘plant’ being controlled has an input vector u and a state vector x, and has
nonlinear behaviour governed by the vector differential equation
dx
= f (x, u).
dt
Also suppose that the control objective is to minimise a ‘cost function’ (or ‘value
function’) which has the form
Z T
V (x, u, t) = `(x(t), u(t), t)dt + F (x(T ))
0
where `(x(t), u(t), t) is some function which is never negative, and that the control
input is constrained to be in some set u(t) ∈ U .
This is a very general formulation, and just about every sensible problem can be
represented in this form by using suitable functions f , F and `.
Example 1.9 Suppose the plant is a rocket which is to be transferred from the
launch site — state x0 — to a low-earth orbit — state xf — using as little fuel as
possible, and the vector of inputs includes the fuel flow rate as the first element, u1 .
This problem can be represented by setting
and
∞ if x(T ) 6= xf
F (x(T )) =
0 if x(T ) = xf
The vector function f depends on the dynamics of the rocket. The optimization will
be subject to the constraint 0 ≤ u1 (t) ≤ umax , where umax is the maximum possible
fuel flow rate.
In principle, the solution to such general problems is known: you have to solve the
so-called Hamilton-Jacobi-Bellman equation [BH75]:
∂ 0 ∂ 0
V (x, t) = min H(x, u, V (x, t))
∂t u∈U ∂x
1.9. General Optimal Control Formulation 33
where H(x, u, λ) = `(x, u)+λf (x, u), with the boundary condition V 0 (x, T ) = F (x).
Once you have solved this, you choose the control input signal as the one which
minimises H:
∂ 0
u0 (x, t) = arg min H(x, u, V (x, t)).
u∈U ∂x
Note that this is a feedback control law, because it depends, at time t, on x(t), which
itself depends on what has happened over the whole interval from the initial time to
the current time. (Note: You do not have to know where all this comes from. The
point is to see that it is nasty.)
One way to go is to assume that the plant is linear, so that the function f (x, u)
takes the special form:
ẋ = A(t)x(t) + B(t)u(t)
where Q(t), R(t) and S are square, symmetric, positive-definite matrices. In that
case the Hamilton-Jacobi-Bellman equation simplifies to an ordinary differential
equation (the Riccati equation) which can be solved, and which leads to a linear
(but time-varying) feedback law:
u(t) = F (t)x(t)
where F (t) is a matrix (the ‘state feedback’ matrix) which depends on the solution
of the Riccati equation [BH75, KR72]. Probably more than 95% of the development
of optimal control has been devoted to going in this direction. It leads to a very
complete and powerful theory, which has been widely applied — particularly in its
‘dual’ form, for the filtering problem, in which case it leads to the theory of Kalman
filters. But it has nothing to say about constraints or other nonlinearities.
The other way to go is down the road of Predictive Control. The difficulty of the
general optimal control problem arises because it is a function optimization problem.
Instead of ordinary calculus, it needs the Calculus of Variations, to find the optimal
input function among all possible ones. (For a very nice account of how this theory
developed see [SW97].) The main idea of Predictive Control is to avoid this difficulty
by restricting the set of possible inputs to such an extent that the optimization is
performed only over a finite set of parameters or ‘decision variables’, rather than
over a set of functions. Most commonly this is done as has already been seen: by
34 1. Introduction
cutting up time into discrete intervals, optimising over a finite horizon, and hence
over a finite number of intervals, and assuming that the input signal is held constant
during each interval, or even during several intervals. The future values of the input
signal are then the decision variables. Furthermore, predictive control does not
usually attempt to solve the feedback problem; it solves a sequence of open-loop
problems, with feedback entering rather indirectly, the latest measurements being
used to provide initial conditions for the next open-loop optimization. Other ways
of reducing the problem to an ‘ordinary’ optimization problem are possible — see
sections 5.6 or 8.4, for example.
This chapter has introduced the main concepts involved in predictive control:
• An internal model capable of simulating the plant behaviour faster than real
time.
These concepts together provide an intuitively appealing way, and a powerful way,
of controlling various systems. The rest of this book elaborates on the use of these
concepts in predictive control.
Most of the interest in predictive control comes from its ability to handle constraints,
and from the natural way in which it can be applied to the control of multivariable
systems, without losing its intuitive aspect. Chapter 2 introduces a standard for-
mulation of predictive control which assumes the presence of constraints, and of a
multivariable plant. For this purpose a state-space setting is used — it is the most
convenient for multivariable problems, and it includes all other approaches. Some of
the questions which have arisen in this chapter, especially the independent model,
offet-free tracking and stabilisation of an unstable model, are all illuminated by dis-
cussing them in the context of state observers. So far we have assumed a small
number of coincidence points — only one in all the examples. More commonly, co-
incidence points are spaced ‘densely’ over the prediction horizon — often there is a
coincidence point at each point in the horizon. Similarly, more than one parameter
is commonly used to characterise the assumed future control signal (Hu > 1).
1.10. What Is In This Book 35
Chapter 3 then considers how to solve the on-line optimization problems which arise
in predictive control when constraints are present. It includes discussion of relatively
recent algorithms, such as ‘interior point’ methods. It also discusses the structure
of the resulting controller, assuming the standard formulation adopted in chapter 2.
A major problem which arises when constraints are present is the possibility that
the optimization problem becomes infeasible; strategies are needed for handling this
eventuality. A commonly-adopted strategy is to ‘soften’ the constraints, namely to
allow their violation as a last resort if no other possibility exists. Chapter 3 includes
an explanation of how this can be done.
It was seen in section 1.3 that the only information really needed to implement a
predictive controller is the plant’s step response — so long as the plant is assumed to
behave linearly. It is therefore very understandable that the original developments
of predictive control assumed a model in the form of a step response, sometimes
referred to as a ‘dynamic matrix’.6 Some developments, especially the very well-
known Generalised Predictive Control, or GPC, assumed the model to be in the
form of a transfer function. Chapter 4 deals with formulations of predictive control
based on step response and transfer function models, and shows how these are related
to the state-space setting used in the rest of the book. It tries to persuade the reader
that it is best to use state-space models.
Many variations on the basic formulation are possible. If there are measured dis-
turbances, conventional control attempts to compensate for them by using ‘feed-
forward’. The same is possible with predictive control. It is possible to use other
criteria than a quadratic one for finding the optimal future input trajectory. And
it is possible to be creative when defining required performance. These and other
possibilities are introduced in chapter 5.
Chapter 6 shows how to adjust the formulation and the tuning parameters so that
closed-loop stability is guaranteed. The two principal methods are to introduce ‘ter-
minal constraints’ at the end of the prediction horizon, or to distribute coincidence
points evenly along an infinite prediction horizon. Some other methods are also
introduced. All the analysis in this chapter is concerned with ‘nominal stability’,
namely the stability of the closed loop under the assumption that an exact model
of the plant is available. The important problem of ensuring that a predictive con-
troller is robust to inexact modelling is addressed in chapter 8, which presents some
recent research proposals — this problem is still at the research stage.
6
Hence the name of the commercial product Dynamic Matrix Control, or DMC — see Ap-
pendix A.
36 1. Introduction
Finally, chapter 10 presents some wider perspectives on predictive control: the possi-
bilities of constraint management within the predictive control framework, the use of
nonlinear models, and the potential of predictive control as a basis for fault-tolerant
control systems are all discussed here.
The Appendices provide details of some leading predictive control commercial prod-
ucts, of the software described in this chapter, and of MATLAB’s Model Predictive
Control Toolbox, the use of which will be assumed in later chapters.
1.11. Problems 37
1.11 Problems
1. Continue Example 1.3 for two more steps to find the optimal values of û(k +
1|k + 1) and û(k + 2|k + 2). (Note that the steady-state gain of the model is
20/3, so that the input signal should converge to 3/(20/3) = 0.45 if the control
scheme is stable.)
Verify that the output at time k + 2, y(k + 2), is not the same as that predicted
at time k, ŷ(k + 2|k), even though a perfect model and absence of disturbances
are assumed.
2. Continue Example 1.4 for two more steps, using MATLAB or other suitable
software (or a calculator) as necessary.
3. Repeat Examples 1.3 and 1.4 using a ‘straight-line’ reference trajectory, with
(1.2) replaced by
(
1− iTs
Tref (k) if iTs < Tref
(k + i) =
0 otherwise
2e−1.5s
1 + 7s
that is, it has a steady-state gain of 2, a time constant of 7 sec, and a time
delay of 1.5 sec. The set-point has a constant value s(t) = 3, and the reference
trajectory is exponential with Tref = 5 sec. A predictive controller operates
with a sampling interval Ts = 0.5 sec, and coincidence points at 6 sec and
10 sec ahead of the current time. The future control input is assumed to be
constant over the prediction horizon (Hu = 1).
If the plant output is constant at 1 (y(k) = 1, ẏ(k) = 0), find the optimal
input u(k)
6. Explain why a coincidence point nearer than 1.5 sec into the future (P1 × Ts <
1.5) should not be chosen in Problem 5.
7. Show how equation (1.31) and the subsequent analysis of the offset-free track-
ing property simplifies if there is only one coincidence point, and Hu = 1.
38 1. Introduction
8. Suppose the plant includes an integrator, so that its z-domain transfer function
is 1/(z −0.5)(z −1). Its gain is modelled incorrectly, so that the model transfer
function is 1.1/(z − 0.5)(z − 1). Apply the programs basicmpc and trackmpc
in this case. Verify that using basicmpc results in a steady-state error when
the set-point is constant (despite having an integrator in the plant), whereas
using trackmpc results in offset-free tracking.
9. Explain the following surprising fact. If the basic algorithm contained in pro-
gram basicmpc is used, without the modification to obtain offset-free tracking,
and if Tref = 0, so that the reference trajectory returns immediately to the
set-point trajectory, then the control signal is completely unaffected by mea-
surement noise. Why is this no longer the case when offset-free tracking is
included, as in program trackmpc?
10. The discussion of unstable systems emphasises the problem of having an un-
stable model running open-loop inside the controller. This implies that it may
be possible to control an unstable plant using the ‘independent model’ imple-
mentation used in basicmpc and trackmpc, providing that the model is stable.
This can in fact be done, providing that the plant and model are ‘close enough’,
in some sense, for the controller to stabilise the plant despite the modelling
error. The reader can check that this occurs for the following example:
11. Show, by using the program unstampc, that the parameters used in Exam-
ple 1.8 give a reasonably robust controller, in the sense that some plant-model
mismatch can be tolerated without losing closed-loop stability. Observe that
in such cases a steady-state offset exists between the output and the set-point.
(For example, changing the gain factor from 9.8 to 9.9, or the constant term
in the second denominator factor from 0.1493 to 0.15 — in the model only, of
course — leaves the closed loop stable.)
12. Modify the program unstampc by changing the computation of the optimal
input trajectory to the form given in (1.31). Verify that offset-free tracking
is not obtained if the steady-state gain is modelled incorrectly, or if there is a
constant input or output disturbance acting on the plant.
1.11. Problems 39
13. Write a version of the program unstampc which allows the plant and the model
transfer functions to have different orders.
14. In (1.25)–(1.27) we assumed that the control signal changes at every one of the
first Hu sampling intervals, and then it remains constant: û(k + Hu − 1|k) =
û(k + Hu |k) = · · · . Suppose that the number of changes remains the same,
but the instants at which the changes occur are arbitrarily distributed over
the prediction horizon: û(k + i|k) = uj for Mj ≤ i < Mj+1 , j = 1, 2, . . . , Hu ,
M1 = 0, MHu < Hp . Describe the corresponding changes that need to be
made to ∆U and Θ. (Note that their dimensions should remain unchanged.)
Comment: In practice it is often desirable to have more frequent changes of
û near the beginning of the prediction horizon, and less frequent later; for
example, in non-minimum-phase systems which exhibit fast ‘inverse response’
followed by slow settling. In the Model Predictive Control Toolbox this is
referred to as ‘blocking’, because the input signal is assumed to remain constant
over ‘blocks’ of sampling intervals.
15. Using the programs basicmpc, trackmpc and noisympc (available on this
book’s web site), and the system defined in Example 1.6, observe the effects
of changing the parameters Tref , Ts , the number and spacing of coincidence
points, and the control horizon Hu (variable M). Also try non-constant set-point
trajectories.
40 1. Introduction
Chapter 2
A Basic Formulation of
Predictive Control
The reason for using this standard form is mainly that it connects well with the
standard theory of linear systems and control. We will often generalise this model by
including the effects of measured or unmeasured disturbances, and of measurement
noise.
We are going to assume that the sequence of actions at time step k is the following:
41
42 2. A Basic Formulation of Predictive Control
This implies that there is always some delay between measuring y(k) and applying
u(k). For this reason there is no ‘direct feed-through’ from u(k) to y(k) in the
measured output equation (2.2), so that the model is ‘strictly proper’ . Taking
computational delay into account is considered in more detail in section 2.5.
The controlled outputs z(k) could, in principle, depend on u(k). That is, the de-
scription
with Dz 6= 0 could be appropriate and useful in some cases. This would, however,
complicate the computation of the optimal u(k) slightly. This complication can be
avoided, without losing anything, by defining a new vector of controlled outputs
which clearly depends on x(k) only, without any direct feed-through from u(k):
z̃(k) = Cz x(k). The corresponding changes to the cost function and constraints
are easily made — see Problems 12 and 13. We shall therefore assume that the
controlled outputs are defined by (2.3).
The relationship between the linear model (2.1) – (2.3) and the real plant needs
careful consideration for predictive control. In most control methodologies the linear
model is used off-line, as an aid to analysis and design. In predictive control it is
used as part of the control algorithm, and the resulting signals are applied directly
to the plant. Therefore careful attention must be paid to appropriate treatment of
measurements before using them in the control computation algorithm, and of the
computed control signal.
The plant in reality behaves in some complicated nonlinear fashion. Suppose that
its state vector X evolves according to some nonlinear differential equation
dX
= f (X, U, t) (2.6)
dt
where U is the vector of inputs. (This is a simplification. Many processes are
naturally described by implicit equations of the form
and the extraction of the explicit form (2.6) may not be easy — but that is not
important here.) Suppose the process is in some state X = X0 , with input U = U0 ,
2.1. State-space models 43
dX
= f (X0 + x, U0 + u, t) (2.8)
dt
∂f ∂f
≈ f (X0 , U0 , t) + x+ u (2.9)
∂X (X0 ,U0 ,t) ∂U (X0 ,U0 ,t)
where quadratic and higher-order terms in x and u have been neglected. The ex-
pressions ∂f /∂X|(X0 ,U0 ,t) and ∂f /∂U |(X0 ,U0 ,t) denote matrices of partial derivatives,
evaluated at (X0 , U0 , t). Denote these (‘Jacobian’) matrices by Ac and Bc , respec-
tively. Since X = X0 + x and X0 is a particular value of X, we have dX/dt = dx/dt.
Hence we have the linearised model
dx
= Ac x + Bc u + f (X0 , U0 , t) (2.10)
dt
If (X0 , U0 ) is an equilibrium point (that is, a possible steady state) at time t, namely
if f (X0 , U0 , t) = 0, then clearly this model simplifies further, to the familiar form
of continuous-time linear state-space model used very widely in systems and control
theory, namely
dx
= Ac x + Bc u (2.11)
dt
This is the most common case: linearised models are usually found for the neigh-
bourhood of an equilibrium point.
dx
ẋ = − (Ẋ)0 (2.12)
dt
to obtain
ẋ = Ac x + Bc u (2.13)
The form of this equation is the same as the one obtained when linearising about an
equilibrium point, and it can be used in much the same way. But it must be remem-
bered that ẋ is now a perturbation of the time derivative dx/dt, not the derivative
itself. This affects the formation of predictions, for instance. The exact linearisation
about a non-equilibrium trajectory of a system is a time-varying linear model, since
the state X does not remain constant at X0 . When using such models for predictive
control, one does not necessarily re-linearise at each time step, however. Often the
same linear model is retained for a number of time steps before re-linearising, even
if the plant is being transferred from one state to another.
1
Note that this is different from dX0 /dt, which is zero. Non-standard notation is being used
here; also our use of ẋ is non-standard.
44 2. A Basic Formulation of Predictive Control
For predictive control we need the difference equation model (2.1), since we use a
discrete-time setting. This can be obtained from the linearised differential equation
by standard techniques, usually assuming that the input u is constant between
sampling intervals [FPEN94]. Section 2.5 considers what to do if the computational
delay is too large to allow the standard conversion formulae to be used.
The outputs of a real plant are also determined from the state in a nonlinear way:
Y = g(X, t) (2.15)
where g is some nonlinear function, and we have assumed no explicit dependence
on the input U . Proceeding as before, suppose that Y0 = g(X0 , t) and Y = Y0 + y.
Then
Y = g(X0 + x, t) (2.16)
∂g
≈ g(X0 , t) + x (2.17)
∂X (X0 ,t)
= Y 0 + Cy x (2.18)
which leads to (2.2). The linearised equation (2.3) for the controlled ouptputs z can
obviously be obtained in the same way. Since we assume that the output equations
are static equations, their linearisations are the same in both the continuous-time
and the discrete-time models. When obtaining measurements from the plant, the
‘baseline’ values Y0 must be subtracted before using them in the linearised model.
When making predictions, and when expressing constraints and objectives, care must
be taken to either re-insert Y0 at the appropriate points, or to express everything
relative to Y0 . Conceptually this is very straightforward, but it requires care and a
systematic approach to get it right on a complex plant.
Similar considerations apply when applying the control signal to the plant. The
predictive control calculations usually give a value of u, and the ‘baseline’ value U0
must be added to this before applying it to the plant. However, as we saw in the
previous chapter, in predictive control we most often compute the required changes
in the control signal from one time step to the next, ∆u(k) = u(k) − u(k − 1). Since
∆u = ∆U , the required change can be applied directly. But the correct expression
of constraints again requires attention to consideration of U0 , as does the expression
of objectives in those cases in which the input values, as well as their changes, are
of concern.
2.1. State-space models 45
The linearised model (2.1)–(2.3) used in predictive control can be obtained in two
ways, essentially. Most commonly, it is obtained by performing tests on the plant,
which involve injecting known signals, such as steps, multi-sines, pseudo-random, or
others, at the plant inputs, and recording the resulting plant outputs. Linearised
models can then be obtained by using the techniques of system identification, which
range from simple curve-fitting to sophisticated statistically-based methods; there
is a large literature on this, and we refer the reader to [Lju89, Nor86, vOdM96]
as good starting points. It is sometimes claimed that predictive control has special
requirements, as regards system identification. This is probably inaccurate, however;
but it is certainly true that most applications of predictive control are in the process
industries, and these industries have special requirements, largely because of the
multivariable cross-couplings between inputs and outputs, and because of the slow
dynamics that are typical. Some material on system identification specifically for
the process industries can be found in [Ric91, RPG92, SMS92, ZB93, Zhu98].
Models obtained in this way are ‘black-box’ models, which represent only the input-
output behaviour of the plant, and carry no information about its internal structure.
In some cases special-purpose tests may be unnecessary or impossible, but it may
be possible to identify a linearised model on the basis of normal operating data; in
particular, this is the situation in adaptive control[ÅW89, SR96a, Mos95].
It should be emphasised that the form of linear model that is adopted does not
constrain the kind of test that should be applied to the plant. There appears to be
quite a widespread misconception that step inputs are required in order to identify
a model in step-response form, or that pseudo-random inputs are needed to obtain
a transfer-function model form, and so on. This is not true; if one is lucky enough
to have some choice of the input signal to use, that choice should depend primarily
on the experimental conditions — how much testing is possible, how noisy are the
measurements, etc — and on the inherent requirements of the model — at which
operating point should it be valid, what range of signal amplitudes are expected,
over what range of frequencies should it be accurate, etc. Once a linear model is
obtained in any of the standard forms, it is very straightforward to transform it to
any other form. This point will be emphasised again in chapter 4, and some specific
transformation procedures will be discussed there.
availability of such a model corresponds to having (2.7) available, though one should
be aware that the innocuous-looking notation f (X, dX/dt, U, t) = 0 can represent a
very large collection of differential-algebraic equations, containing non-smooth ele-
ments such as switches (case statements) and look-up tables.
For the basic formulation of predictive control we shall assume that the plant model
is linear, that the cost function is quadratic, and that constraints are in the form
of linear inequalities. We shall also assume that everything is time-invariant. Fur-
thermore, we shall assume that the cost function does not penalise particular values
of the input vector u(k), but only changes of the input vector, ∆u(k), which are
defined as before. This formulation coincides with that used in the majority of the
predictive control literature.
To make the formulation useful in the real world, we shall not assume that the state
variables can be measured, but that we can obtain an estimate x̂(k|k) of the state
x(k), the notation indicating that this estimate is based on measurements up to time
k — that is, on measurements of the outputs up to y(k), and on knowledge of the
inputs only up to u(k − 1), since the next input u(k) has not yet been determined.
û(k+i|k) will denote a future value (at time k+i) of the input u, which is assumed at
time k. x̂(k + i|k), ŷ(k + i|k) and ẑ(k + i|k) will denote the predictions, made at time
k, of the variables x, y and z at time k + i, on the assumption that some sequence of
inputs û(k + j|k) (j = 0, 1, . . . , i − 1) will have occurred. These predictions will be
made consistently with the assumed linearised model (2.1)–(2.3). We will usually
assume that the real plant is governed by the same equations as the model, although
this is not really true. Only in Chapter 8 will we explicitly consider the fact that
the model is inevitably inaccurate.
Cost function:
The cost function V penalises deviations of the predicted controlled outputs ẑ(k+i|k)
from a (vector) reference trajectory r(k +i|k). Again the notation indicates that this
reference trajectory may depend on measurements made up to time k; in particular,
its initial point may be the output measurement y(k), as in Chapter 1. But it may
also be a fixed set-point, or some other predetermined trajectory. We define the cost
2.2. A Basic Formulation 47
function to be
X
Hp u −1
HX
V (k) = kẑ(k + i|k) − r(k + i|k)k2Q(i) + k∆û(k + i|k)k2R(i) (2.19)
i=Hw i=0
There are several points to note here. The prediction horizon has length Hp , but
we do not necessarily start penalising deviations of z from r immediately (if Hw >
1), because there may be some delay between applying an input and seeing any
effect. Hu is the control horizon. We will always assume that Hu ≤ Hp , and that
∆û(k + i|k) = 0 for i ≥ Hu , so that û(k + i|k) = û(k + Hu − 1|k) for all i ≥ Hu .
(Recall Figure 1.4.)
The form of the cost function (2.19) implies that the error vector ẑ(k+i|k)−r(k+i|k)
is penalised at every point in the prediction horizon, in the range Hw ≤ i ≤ Hp .
This is indeed the most common situation in predictive control. But it is possible
to penalise the error at only a few coincidence points, as was done in chapter 1, by
setting Q(i) = 0 for most values of i. It is also possible to have different coincidence
points for different components of the error vector, by setting appropriate elements
of the weighting matrices Q(i) to 0. To allow for these possibilities, we do not insist
on Q(i) > 0, but allow the weaker condition Q(i) ≥ 0.2 (At least this condition is
required, to ensure that V (k) ≥ 0.)
Example 2.2 Suppose that there are two controlled outputs. The prediction horizon
is Hp = 3. There is only one coincidence point for the first output, at i = 2. For the
second output there are two coincidence points, at i = 2 and i = 3. Errors in the
second output are penalised more heavily than errors in the first output. This could
be represented by
0 0 1 0 0 0
Q(1) = Q(2) = Q(3) = (2.20)
0 0 0 2 0 2
We also need R(i) ≥ 0 to ensure that V (k) ≥ 0. Again, we do not insist on the
stronger condition that R(i) > 0, because there are cases in which the changes in
the control signal are not penalised — for instance, all the examples considered
in chapter 1. The weighting matrices R(i) are sometimes called move supression
factors, since increasing them penalises changes in the input vector more heavily.
2
The notation Q ≥ 0 usually excludes the extreme possibility that Q = 0. But we use it here to
include this possibility.
48 2. A Basic Formulation of Predictive Control
Expressions like xT Qx and uT Ru, where x, u are vectors and Q, R are symmetric
matrices, are called quadratic forms, and are often written as kxk2Q and kuk2R , re-
spectively. They are just compact representations of certain quadratic functions in
several variables. This is best illustrated by an example.
and
10 4
Q = .
4 3
Then
T
10 4 x1
x Qx = x 1 x2
4 3 x2
= 10x21 + 8x1 x2 + 3x22 .
If xT Qx > 0 for every x except x = 0, then this quadratic form is called positive
definite. It can be shown that a quadratic form is positive definite if and only if
all the eigenvalues of the matrix involved in it are positive, in which case we write
Q > 0. If xT Qx ≥ 0 then the quadratic form is called semi-positive definite and
we write Q ≥ 0.
The matrix Q in the example has both eigenvalues positive. So the quadratic form
is positive-definite. You can try substituting any real values for x1 and x2 (even
negative ones), and you will see that the value is always positive. Note that this
happens even if x1 = 0 or x2 = 0, provided that they are not both zero.
If Q = I then xT Qx = xT x = ||x||2 , the squared ‘length’ of the vector, or squared
Euclidean norm. Even if Q 6= I (but Q ≥ 0), it is possible to think of a quadratic
form as the square of a ‘weighted norm’, since xT Qx = kQ1/2 xk2 . Hence the notation
kxk2Q .
The only other thing we will need to know about a quadratic form is how to find its
gradient. Let V = xT Qx, but now consider the general case where x has n elements,
x = [x1 , x2 , . . . , xn ]T , and Q is an n × n matrix. Then the gradient of V is given by:
∂V ∂V ∂V
∇V = , ,... ,
∂x1 ∂x2 ∂xn
= 2xT Q
(We are not going to prove this here.) Note that we have defined the gradient to
be a row vector. Sometimes it is defined to be a column vector, in which case it is
given by 2Qx.
Mini-Tutorial 1: Quadratic Forms
2.2. A Basic Formulation 49
penalises deviations of the input vector from some ideal resting value. Usually this
is done only if there are more inputs than variables which are to be controlled to
set-points. We shall not include such a term in our basic formulation, but it will be
discussed in more detail in section 10.1.
The prediction and control horizons Hp and Hu , the ‘window’ parameter Hw , the
weights Q(i) and R(i), and the reference trajectory r(k + i), all affect the behaviour
of the closed-loop combination of plant and predictive controller. Some of these
parameters, particularly the weights, may be dictated by the economic objectives
of the control system, but usually they are in effect tuning parameters which are
adjusted to give satisfactory dynamic performance. Chapters 6, 7, and 8 all discuss
the influence of these parameters (and others).
Constraints: In the following we use vec(0) to denote a column vector, each element
of which is 0. We also use vec(a, b, c) to denote the vector [a, b, c]T , etc. We assume
that constraints of the following form hold over the control and prediction horizons:
Example 2.3 Suppose we have a plant with 2 input variables and 2 controlled vari-
ables. The control horizon is Hu = 1 and the prediction horizon is Hp = 2 (with
Hw = 1). We have the following constraints, which are to hold at each time:
−2 ≤ ∆u1 ≤ 2 (2.24)
0 ≤ u2 ≤ 3 (2.25)
z1 ≥ 0 (2.26)
z2 ≥ 0 (2.27)
3z1 + 5z2 ≤ 15 (2.28)
To put these into our standard form, we rewrite the ∆u1 constraints as follows.
∆u1
1
−2 ≤ ∆u1 ⇔ −∆u1 ≤ 2 ⇔ − ∆u1 − 1 ≤ 0 ⇔ [−1/2, 0, −1] ∆u2 ≤ 0
2
1
∆u1
1
δu2 ≤ 2 ⇔ ∆u1 − 1 ≤ 0 ⇔ [1/2, 0, −1] ∆u2 ≤ 0
2
1
50 2. A Basic Formulation of Predictive Control
It will be seen that the dimensions of the matrices E, F and G can become very
large very quickly (Hp may be 10 or 20 or more). However, assembling them from
the given constraints is simple, and this job can be automated. In fact, the software
which we will use — the Model Predictive Control Toolbox for MATLAB— does this
for the user.
The important thing about the constraints is that they are all in the form of linear
inequalities. When we come to solve the predictive control optimization problem, all
these inequalities will need to be translated into inequalities concerning ∆û(k + i|k).
Since we assume a linear model, we will see that these inequalities remain linear,
even after this translation (Problem 5). This is going to be crucial for being able to
solve the optimization problem reliably and efficiently.
Notice that in the example there are variables (u1 , ∆u2 ) which are not constrained.
It is also possible to have the converse situation, of variables which are constrained,
but do not appear in the cost function (zone objectives). This is only likely to
occur with the z variables, and is represented in our standard formulation by having
appropriate zero entries in the weighting matrices Q(i).
2.2. A Basic Formulation 51
Np Gp
Stock
Feed
Tank
H1 N1 Headbox
H2 N2
Nw
Wire Wet
paper
Gw
White water
This example is based on an example in the Model Predictive Control Toolbox User’s
Guide[MR95], and some of the software-based problems will refer to it.
Part of a paper-making machine is shown in Figure 2.1. The following variables are
involved:
where time has been measured in minutes. Predictive control is to be applied to this
plant, with an update interval of Ts = 2 minutes. Discretising the model with this
sample interval (using the MATLAB function c2d for example) gives
0.0211 0 0 0 0.6462 0.6462
0.1062 0.4266 0 0 0.2800 0.2800
A=
B =
1.5237 −0.7391
0 0 0.2837 0
0.1012 −0.6688 0.2893 0.4266 0.9929 0.1507
Note that the matrices Cy and Cz remain the same in the discrete-time model.
The prediction horizon is to be Hp = 10 (that is, 20 minutes) and the control horizon
is to be Hu = 3. Since control of consistency is more important than control of level,
errors in consistency (N2 ) are penalised more than errors in level (H2 ):
0.2 0
Q(i) =
0 1
Changes of the two valves are penalised equally, and the same penalties are applied
at each step of the prediction and control horizons (that is, for each i):
0.6 0
R(i) =
0 0.6
Since there is no delay in the plant (beyond the usual 1-step delay — u(k) does not
affect x(k)), errors are penalised from the first step, namely Hw = 1.
The headbox level (H2 ) is constrained, so that the headbox never runs dry, or over-
fills:
−3 ≤ z1 ≤ 5
Note that if an operating point is represented by u = 0, then with a linear model we
must also have y = 0 at that point (unless there is integration in the plant).
From these constraints we can assemble the matrices E, F and G which appear in
our standard formulation of the predictive control problem. These matrices will have
the following dimensions:
E: 4×7 F : 4×7 G: 20 × 21
2.3. General Features of Constrained Predictive Control 53
Since predictive control problems usually include constraints, the resulting control
law is usually nonlinear. It is easy to understand why this is so. Suppose we have a
gas-turbine engine with a ‘hard’ state constraint of the form xj (t) < Xj — such as
‘Turbine temperature lower than 1000 ◦ C’. If the turbine is running at 995 ◦ C and a
disturbance d occurs which has the effect of moving xj away from Xj — the cooling
oil flow rate increases for some reason, say — then the control system will react
in a fairly ‘relaxed’ way, and will coordinate bringing xj back to its set-point with
maintaining other objectives — correct turbine speed, power output, fuel economy,
etc. Now if a disturbance −d occurs instead, then by definition a linear controller
would react in a similarly relaxed way, replacing a control signal u(t) by −u(t).
In contrast, a controller which is aware of the constraint will react in ‘panic mode’.
It ‘knows’ that there is no point in worrying about other objectives, because if the
constraint is exceeded catastrophic failure is likely to result. It therefore reacts in
a very different way to the disturbance −d than it would to disturbance +d — in
our example, perhaps it will cut the fuel flow rate sharply and change the inlet vane
angle to get maximum air flow. In a multi-engine aircraft it might even shut the
engine down. Such behaviour is of course nonlinear.
We will see later that ‘standard’ predictive controllers in fact behave linearly so
long as the plant is operating safely away from constraints, but nonlinearly when
constraints are approached too closely. On the other hand, a standard predictive
controller would not go so far as to shut down an engine, and it does not have the
authority to do so. That kind of decision is usually handled by a separate higher-level
‘supervisor’, which may be a human operator or pilot.
Although constrained predictive controllers are nonlinear, they are usually time-
invariant. This means that there is a function h, such that the control signal can
be expressed as u = h(x), namely it depends only on the current state, and not
explicitly on time (that is, it is not necessary to write u = h(x, t)). Of course this
function ‘exists’ only in a mathematical sense; it would be impossibly difficult to
write it down in ‘closed-form’ (as a formula). In order to see what u is, you have to
feed x into an optimization algorithm and see what comes out. This time-invariance
occurs so long as there is nothing in the problem formulation that depends explicitly
on time: the model of the plant, the cost function and the constraints must all be
independent of time.
We have to be rather careful about what this means exactly. First of all, our model
(2.1)–(2.3) does not depend on the time k, except through x and u. Secondly, the
cost function (2.19) can depend on i — the weights Q(i) and R(i) can vary over
the prediction and control horizons — but not on k. So a different weight can be
attached to an error predicted to be 3 steps in the future than to an error predicted
1 step ahead. But when the problem is solved at the next k value, it must have the
same pattern of weights. As time moves on, so k increases to k + 1, but exactly
54 2. A Basic Formulation of Predictive Control
the same problem is solved as was solved at time k. So the cost function does not
depend on time.
is ok, whereas
As usual, our plant model (2.1) expresses the plant state x in terms of the values of
the input u. But the cost function penalises changes in the input, ∆u, rather than
the input values themselves. We shall see in the next chapter that the predictive
control algorithm will in fact produce the changes ∆u rather than u. It is therefore
convenient for many purposes to regard the ‘controller’ as producing the signal ∆u,
and the ‘plant’ as having this signal as its input. That is, it is often convenient to
regard the ‘discrete-time integration’ from ∆u to u as being included in the plant
dynamics. Figure 2.2 shows the real controller producing the signal u, which is
passed to the real plant. It also shows the MPC ‘controller’ producing the signal
∆u, which is passed to the MPC ‘plant’.
There are several ways of including this ‘integration’ in a state-space model of the
MPC ‘plant’. All of them involve augmenting the state vector. The first way is to
2.4. Alternative State Variable Choices 55
MPC ‘PLANT’
MPC
∆u u REAL
z
‘CONTROLLER’
z−1 PLANT
REAL CONTROLLER
Figure 2.2: The boundary between controller and plant — a matter of convenience
Then, assuming the linear model (2.1) holds for the real plant state, we have
x(k + 1) A B x(k) B
= + ∆u(k) (2.34)
u(k) 0 I u(k − 1) I
x(k)
y(k) = [Cy , 0] (2.35)
u(k − 1)
x(k)
z(k) = [Cz , 0] (2.36)
u(k − 1)
where ∆x(k) = x(k) − x(k − 1) is the change in the state at time k. From (2.1) we
have
y(k + 1) = Cy x(k + 1)
= Cy [∆x(k + 1) + x(k)]
= Cy [A∆x(k) + B∆u(k)] + y(k) (2.41)
z(k + 1) = Cz x(k + 1)
= Cz [∆x(k + 1) + x(k)]
= Cz [A∆x(k) + B∆u(k)] + z(k) (2.42)
Both of these state-space representations have been used in the literature of pre-
dictive control. For example, the first representation (2.33) was used in [Ric90],
while the second one (2.37) was used in [PG88] and many other publications. The
second representation is also used in the Model Predictive Control Toolbox for some
purposes. These two seem to be the most useful, although other representations are
possible — see Problem 8. Note that if the number of inputs is not the same as
the number of measured and controlled outputs, then at least one of these represen-
tations is not minimal — that is, it must be either uncontrollable or unobservable
— since the two representations will then have different state dimensions, but both
give the same input-output transfer function.
The measurement interval and control update interval are assumed to be the same,
with length Ts . The plant output vector is measured at time kTs , and this mea-
surement is labelled y(k). If there is a measured disturbance this is assumed to be
measured at the same time, and this is labelled dm (k). There is then a delay of τ ,
which is the time taken by the predictive controller to complete its computations,
after which a new control vector is produced and applied as the plant input signal.
This input signal is labelled u(k). The input signal is assumed to be held constant
2.5. Allowing for Computational Delay 57
Disturbance
dm (k) dm (k + 1)
Time
Output Ts
y(k) y(k + 1)
Time
Input u(k)
τ u(k + 1)
Time
kTs (k + 1)Ts
kTs + τ (k + 1)Ts + τ
until it is recomputed Ts time units later. This sequence is repeated at time (k+1)Ts ,
and regularly thereafter.
In practice, process plants may have hundreds of measurements which may be taken,
and/or made available, at various times during the measurement interval. If accurate
modelling is required, this may have to be taken into account. Also the computation
delay τ may vary in practice, in which case the decision must be taken whether to
apply the new control signal to the plant as soon as it becomes available — which
probably improves the control but complicates the modelling and analysis — or
whether the result should be held up until a standard interval has elapsed before
applying it to the plant. It would be impossible to deal with all such eventualities
here, so we will assume that all the measurements are taken synchronously, as shown
in Figure 2.3, and that the computational delay τ is the same at each step.
Now we suppose that we have a linearised model for the continuous-time plant in
the state-space form:
(It is enough to consider the measured outputs y. Controlled outputs z are treated
in exactly the same way.) The assumptions shown in Figure 2.3 imply that y(k) =
yc (kTs ), and that
so that we have
Ac xc (t) + Bc u(k − 1) for kTs ≤ t < kTs + τ
x˙c (t) = (2.48)
Ac xc (t) + Bc u(k) for kTs + τ ≤ t < (k + 1)Ts
where t0 < t is some initial time, and xc (t0 ) is the initial state at that time. So,
applying this solution over the interval kTs ≤ t < kTs + τ , and defining x(k) =
xc (kTs ), gives
Z kTs +τ
Ac (kTs +τ −θ)
Ac τ
xc (kTs + τ ) = e x(k) + e dθ Bc u(k − 1) (2.50)
kTs
Similarly, applying (2.49) over the interval kTs + τ ≤ t < (k + 1)Ts gives
Z (k+1)Ts !
Ac (Ts −τ ) Ac ([k+1]Ts −θ)
x(k + 1) = e xc (kTs + τ ) + e dθ Bc u(k)(2.53)
kTs +τ
Ac (Ts −τ )
= e [e x(k) + Γ1 Bc u(k − 1)] +
Ac τ
Z Ts −τ
Ac η
+ e dη Bc u(k) (2.54)
0
= Ax(k) + B1 u(k − 1) + B2 u(k) (2.55)
where
Z Ts −τ
A = eAc Ts B1 = eAc (Ts −τ ) Γ1 Bc B2 = eAc η dηBc (2.56)
0
Now this is not in the standard form of a discrete-time state-space model, because of
the dependence of x(k + 1) on u(k − 1). But we can easily bring it into the standard
form by introducing the state
x(k)
ξ(k) = (2.57)
u(k − 1)
which gives the state equation in standard form:
ξ(k + 1) = Ãξ(k) + B̃u(k) (2.58)
where
A B1 B2
à = B̃ = (2.59)
0 0 I
From (2.46) the associated equation for the measured outputs is
y(k) = Cc x(k) = C̃ξ(k) (2.60)
Because of this possibility, we can continue to assume that the linearised plant model
has the form (2.1)–(2.3), providing that an appropriate definition of the state vector
is used. The reason for using this standard form is mainly that it connects well with
the standard theory of linear systems and control. It is not necessarily the best form
for implementation — for example it may be more efficient to use the form (2.55)
in some circumstances.
The reader is warned that most standard software for finding discrete-time equiva-
lents of continuous-time systems, such as the Control System Toolbox for MATLAB
function c2d, does not take account of computation delay. It is, however, fairly easy
to obtain the required model using such software — see Problem 9.
2.6 Prediction
In order to solve the predictive control problem, we must have a way of computing
the predicted values of the controlled variables, ẑ(k + i|k), from our best estimate of
the current state, x̂(k|k), and the assumed future inputs, or equivalently, the latest
input, u(k − 1), and the assumed future input changes, ∆û(k + i|k).
It may seem that this is really part of the solution, not of the problem formulation, so
that it belongs in the next chapter. But it turns out that the way the predictions are
made has a great effect on the performance of the closed-loop system running under
predictive control. So the choice of prediction strategy is another ‘tuning parameter’
for predictive control, just as choices of horizons and cost functions are. Furthermore,
the prediction strategy follows in a rather systematic way from assumptions made
about disturbances acting on the system and measurement errors such as noise.
So we can say that, rather than choosing a prediction strategy, we are specifying
a model of the environment in which the plant is operating. And that properly
belongs here, as part of the problem formulation.
However, prediction can get very complicated. So to avoid being too distracted by
it at this stage, we will deal with a few simple cases here — which will already cover
much of industrial practice — and come back to more general cases later.
We will start with the simplest situation. Assume that the whole state vector is
measured, so that x̂(k|k) = x(k) = y(k) (so Cy = I). Also assume that we know
nothing about any disturbances or measurement noise. Then all we can do is to
predict by iterating the model (2.1)–(2.3). So we get
In the first line we have used û(k|k) rather than u(k), because at the time when we
need to compute the predictions we do not yet know what u(k) will be.
Now recall that we have assumed that the input will only change at times k, k +
1, . . . , k + Hu − 1, and will remain constant after that. So we have û(k + i|k) =
û(k + Hu − 1) for Hu ≤ i ≤ Hp − 1. In fact we will later want to have the predictions
expressed in terms of ∆û(k + i|k) rather than û(k + i|k), so let us do that now.
2.6. Prediction 61
Recall that ∆û(k + i|k) = û(k + i|k) − û(k + i − 1|k), and that at time k we already
know u(k − 1). So we have
..
.
x̂(k + Hu |k) = AHu x(k) + (AHu −1 + . . . + A + I)B∆û(k|k) +
. . . + B∆û(k + Hu − 1|k) + (AHu −1 + . . . + A + I)Bu(k − 1)
or
Cz 0 · · · 0
ẑ(k + 1|k) x̂(k + 1|k)
.. 0 Cz · · · 0 ..
. = .. .. . . .. . (2.72)
. . . .
ẑ(k + Hp |k) x̂(k + Hp |k)
0 0 ··· Cz
d(k)
y(k) = z(k)
u(k)
PLANT
ŷ(k|k − 1) = ẑ(k|k − 1)
The safest way of computing the predictions is probably to iterate one step at a
time. This is in effect what is done if the predictions are not computed explicitly
when computing the optimal control signal, but if
Now we will assume that there are disturbances acting on the plant. The simplest
assumption is that the measured and controlled outputs are the same (z = y), and
that there is an ‘output disturbance’ — see Figure 2.4. At time k we do not know
ˆ
what the disturbance d(k) is, but we can form an estimate of it, d(k|k), by comparing
the measured output with the predicted one:
ˆ
y(k) = ŷ(k|k − 1) + d(k|k) (2.74)
ˆ
= Cy x̂(k|k − 1) + d(k|k) (2.75)
Another simple assumption is that this disturbance will continue unchanged during
the prediction horizon. This means that, although we keep (2.2) and (2.3), we
predict y and z using
ˆ + i|k)
ẑ(k + i|k) = ŷ(k + i|k) = Cy x̂(k + i|k) + d(k (2.76)
64 2. A Basic Formulation of Predictive Control
where
ˆ + i|k) = d(k|k)
d(k ˆ (2.77)
So at time step k we do the following:
We will generally follow this scheme, but Step 2 will become more elaborate when
we make more elaborate assumptions about the nature of the disturbance. In Step 3
we need to assume future input movements, in order to use (2.1) or (2.66) to predict
x̂(k + i|k).
Notice that, even if Cy = I, we now have ŷ(k + i|k) 6= x̂(k + i|k). In general, this
means that we need an observer to estimate x̂.
If we cannot measure the full state vector, or if the measured outputs consist of some
linear combinations of the states, so that the states cannot be measured directly,
then an observer can be used to estimate the state vector. It is instructive to see how
the ‘constant output disturbance’ assumption we made in the previous subsection
can be handled using observer theory. We can do this by augmenting the model of
the plant, so that it also includes a model of the output disturbance. We do this by
defining a new augmented state:
x(k)
ξ(k) =
d(k)
Since we assume that the output disturbance is constant, the new state and output
equations are
x(k + 1) A 0 x(k) B
= + u(k) (2.78)
d(k + 1) 0 I d(k) 0
x(k)
y(k) = [Cy I] (2.79)
d(k)
2.6. Prediction 65
The general structure of a state observer is shown in Figure 2.5, for a plant described
by the equations
It is a copy of the plant, with feedback from the measured plant output, through
the gain matrix L, to correct the state estimate x̂.
The equations of the observer are:
Substituting the third equation into the first, and eliminating x̂(k|k), we get
where L = AL0 . This is a stable system if the eigenvalues of A−LC lie inside the unit
disk. Furthermore if we define the state estimation error as e(k) = x(k) − x̂(k|k − 1),
then using (2.80) we have
e(k + 1) = (A − LC)e(k)
which shows that the state estimation error converges to zero if the observer is stable,
at a rate determined by the eigenvalues of A − LC.
If the pair (A, C) is observable, then given an arbitrary set of locations in the
complex plane, a gain matrix L exists which places the observer eigenvalues at these
locations. The problem of finding L is the dual of the state-feedback pole-placement
problem, and can be solved using the same algorithm. (See functions place, acker,
or kalman in MATLAB’s Control System Toolbox.)
If the state and output equations of the plant are assumed to be subjected to white
noise disturbances with known covariance matrices, then L can be chosen such that
the mean square state estimation error is the smallest possible. The observer is then
known as a Kalman Filter.
Mini-Tutorial 2: State Observers
66 2. A Basic Formulation of Predictive Control
PLANT
y(k)
u(k) x(k)
B z −1 C
+
+
A
+
L
+
−
x̂(k|k − 1)
B z −1 C
+
ŷ(k|k − 1)
+
A
OBSERVER
then applying the standard observer equation (see Minitutorial 2) gives the following
estimates:
x̂(k + 1|k) A 0 Lx x̂(k|k − 1) B Lx
ˆ + 1|k) = − [Cy I] ˆ + u(k) + y(k)
d(k 0 I Ld d(k|k − 1) 0 Ld
(2.86)
ˆ + 1|k) = d(k|k)
and since we assume that d(k ˆ we have
ˆ + 1|k) = −Cy x̂(k|k − 1) + y(k)
d(k (2.87)
We can see that the estimate obtained from the observer is the same as this if the
observer gain matrix L is
Lx 0
L= =
Ld I
2.6. Prediction 67
This gives
A 0 Lx A 0
− [Cy I] =
0 I Ld −Cy 0
The block-triangular structure of this matrix shows that the observer’s eigenvalues
are those of the plant (the matrix A) and the remaining ones are zeros. The zeros
indicate that ‘deadbeat’ estimation of the disturbance is obtained, namely that the
disturbance estimate is exact after a finite number of steps — and we can see from
(2.87) that it is in fact exact after only 1 step (if the real disturbance behaves exactly
according to our model).
The fact that the observer’s eigenvalues include those of A shows that this simple
disturbance estimation scheme can be used only with stable plants — otherwise the
estimate x̂(k + 1|k) will get worse and worse as k increases. So we see that, although
the ‘DMC scheme’ for estimating disturbances is simple and intuitive, it has some
limitations. We also see that it is easy to overcome these limitations: we can keep
the same disturbance model, but use a different observer gain matrix L. Even with
unstable plants, it is possible to find L such that all the observer’s eigenvalues lie
inside the unit disk (providing that the pair (A, Cy ) is observable).
Note that if an observer is used, then the form of the state prediction equation (2.66)
remains the same, but x(k) has to be replaced by x̂(k|k). We will look at the details
of this later.
Suppose now that we use the alternative state-space representation (2.37), and
assume again that y and z are the same. Since we are now assuming the presence
of a disturbance on the output, we must distinguish between the actual measured
output y(k), and the output η(k) that would have been obtained in the absence of
any disturbance. We now take the state vector to be
∆x(k)
ξ(k) = (2.88)
η(k)
which gives the plant model:
A 0 B
ξ(k + 1) = ξ(k) + ∆u(k) (2.89)
Cy A I Cy B
y(k) = [0 I]ξ(k) + d(k) (2.90)
The first bracketed term is what we would expect the output to be at time k + 1
in the absence of any disturbance at time k + 1, and this is corrected by the second
term, which depends on the error in the previous prediction.
ˆ
Now if we have Lη = I, and if we write d(k|k) = y(k) − η̂(k), then we get precisely
the DMC prediction of the next plant output. That is, the difference between the
actual and the predicted outputs is taken as the estimate of an output disturbance,
and the same estimate is assumed to affect the next output. So we see that, in both
state-space representations, the DMC estimate is obtained by the same observer
gain matrix:
Lx 0 L∆x
= = (2.93)
Ld I Lη
(Note that the partitions in these two observer gain matrices have the same dimen-
sions, since d and η are vectors with the same number of elements.) From (2.91) we
see that in this case the observer’s state transition matrix is
A 0 L∆x A 0
− [0 I] = (2.94)
Cy A I Lη Cy A 0
so again the observer’s eigenvalues are located at the plant’s pole locations and at
zero.
On the other hand, if some measurements are known to be very noisy, then there
is no point in having the estimate of the real (ie meaningful) output jump about,
following the noise at every step, which will not only cause unnecessary moves of the
plant inputs, but might also cause random activation and de-activation of output
constraints. In that case, at least we should be sure that the estimated output follows
the real output ‘on average’. In particular, if the measured output is constant, the
2.6. Prediction 69
estimated output should converge to the same constant value. Since the observer
should be designed to be asymptotically stable, we know that, if the plant input
and output measurements are constant (∆u(k) = 0 and ∆x(k) = 0), then the state
estimate will converge to a constant value. Suppose that η̂(k) converges to η0 . From
(2.92) we see that, if the measured plant output has constant value y(k) = y0 , then
η0 = η0 + Lη (y0 − η0 ) (2.95)
and hence η0 = y0 whatever the value of Lη (providing that det Lη 6= 0). So, ‘on
average’ the observer will always estimate the measured plant output correctly, so
long as it is asymptotically stable. If there is no bias (no systematic error) in the
measurement, then it will also estimate the real plant output correctly ‘on average’.
The same conclusion follows if we use the representation (2.78)–(2.79) — see Problem
16.
In chapter 1 we noted the idea of having an independent model, namely one whose
predictions are influenced only by the inputs which are applied to the plant, but
not by the actual plant response. We can now see that this corresponds precisely
to choosing an observer gain such that Lx = 0 (or L∆x = 0 if the alternative
representation is used). That part of the model’s state vector which is supposed to
correspond to the plant’s state vector is not affected by output measurements in this
case, as can be seen from equation (2.86) or (2.91).
Consider the case when no attempt is made to model any disturbance. This corre-
sponds to the use of equation (1.39). Suppose that a difference-equation model is
given in the form
X
r X
r
y(k) + Ai y(k − i) = Bi u(k − i) (2.96)
i=1 i=1
Several equivalent state-space forms can be obtained [Kai80]. One simple way of
getting a state-space form of this model is to define the state to be made up of past
70 2. A Basic Formulation of Predictive Control
Since this matrix is block-triangular, the top-left block is zero, and all the eigenvalues
of J are zero, it is clear that all the eigenvalues of A − LC are zero. That is, this
observer is always stable, and in fact ‘deadbeat’; note that no assumptions have
been made about the stability of the plant.
2. It is not the only way of dealing with unstable plant models. There are many
other observer gain matrices which give a stable observer, and may sometimes
be more suitable.
ẋ = Ax + Bu y = Cx + Du
where
−1.2822 0 0.98 0 −0.3
0 0 1 0 0
A= −5.4293
B=
0 −1.8366 0 −17
−128.2 128.2 0 0 0
0 1 0 0 0
C= 0 0 0 1 D= 0
−128.2 128.2 0 0 0
For the purposes of this example we will pretend that this is an accurate represen-
tation of the aircraft dynamics.
The elevator angle is limited to ±15◦ (±0.262 rad), and the elevator slew rate is
limited to ±30◦ /sec (±0.524 rad/sec). These are limits imposed by the equipment
design, and cannot be exceeded. For passenger comfort the pitch angle is limited to
±20◦ (±0.349 rad).
72 2. A Basic Formulation of Predictive Control
Figure 2.6 shows the response to a step change of 40 m in the altitude set-point at
time 0, with set-points for pitch angle and altitude rate held at 0, and the reference
trajectory equal to the set-point: r(k + i|k) = [0, 40, 0]T for k ≥ 0. The sampling
interval is Ts = 0.5 sec, the prediction horizon is Hp = 10 (5 sec), and the control
horizon is Hu = 3 (1.5 sec). Tracking errors are penalised over the whole prediction
horizon (Hw = 1). The weights on tracking errors are Q(i) = I3 (the same at each
point in the prediction horizon) and the weights on control moves are R(i) = 1 (the
same at each point in the control horizon). For this magnitude of change none of
20 40
15 Altitude (m)
Pitch (deg)
30
10
20
5
10
0
−5 0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
25 15
Elevator angle (deg)
Altitude rate (m/sec)
20 10
5
15
0
10
−5
5
−10
0
−15
−5
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
the constraints are active at any point of the transient, and a linear time-invariant
controller results — as will be shown in detail in Chapter 3.
Note that the altitude tracking error dominates the pitch angle and altitude rate
errors during most of the transient, so that the pitch angle and altitude rate depart
from their set-points in order to allow the altitude error to be reduced. As the
required altitude is acquired, all three outputs settle rapidly to their set-points.
This behaviour is entirely a result of the numerical values of the errors which arise,
the altitude error being sufficiently larger, numerically, than the other errors for its
contribution to the cost function to be the dominant one. This will not be the case
in general, and — as in all multivariable control problems — problem-dependent
scaling must be employed to obtain the desired performance. (For example, if the
pitch angle had been represented in degrees rather than radians in the predictive
2.7. Example: Citation Aircraft Model 73
control algorithm then the pitch set-point would have been much more significant,
and would have impeded the acquisition of the required altitude.)
Other specifications are possible for this manoeuvre. One obvious possibility is
to allow the pitch angle and altitude rate to be free until the altitude error has
been reduced to some small value. This could be done by reducing the weights on
the corresponding errors, possibly for a fixed time, based on the anticipated time
required to complete the manoeuvre:
0 if k + i < 8
Q1 (k + i|k) = Q3 (k + i|k) = (2.105)
1 if k + i ≥ 8
But this would need to be adjusted for each amplitude of required altitude change,
and would be prone to error if the manoeuvre was not performed exactly as planned;
a much better alternative would be to make the weights state-dependent4 :
0 if |r2 (k + i|k) − ŷ2 (k + i|k)| > 5
Q1 (k + i|k) = Q3 (k + i|k) = (2.106)
1 if |r2 (k + i|k) − ŷ2 (k + i|k)| ≤ 5
In figures 2.6 and 2.7 the rate of change of altitude was unconstrained. Suppose
now that it is constrained to 30 m/sec, and an altitude change of 400 m is again
required. Figure 2.8 shows the resulting response. It can be seen that the pitch
angle constraint is briefly active near the beginning of the transient, but that the
altitude rate constraint is active for most of the time. The resulting (nonlinear)
behaviour is close to that obtained from a conventional autopilot during an altitude
change: a required rate of climb is held until the required altitude is nearly acquired,
whereupon the required altitude is acquired and held.
This example demonstrates some of the flexibility that results from the ability to
specify and respect constraints. Quite complicated behaviours can be obtained by
relatively simple specifications, without any need to introduce mode-switching logic
explicitly.5 It should be emphasised that the intention here is to demonstrate just
how much flexibility there is. It is not being proposed that constraints are usually
a good substitute for set-points. In this example it may well be preferable to have
a set-point for the altitude rate, either simultaneously with a constant set-point
4
Simulation with state-dependent weights is not possible in the Model Predictive Control Toolbox.
However the modified functions scmpc2 and scmpcnl2 available on this book’s web site make this
possible, albeit inefficiently.
5
There is an analogy here with the difference between ‘procedural’ programming, in which soft-
ware is used to tell a computer how to perform a required computation, and ‘declarative’ program-
ming, in which it is used to define what is to be computed. Mode-switching logic specifies how
the controller is to achieve the required behaviour, whereas the use of constraints specifies what
beaviour it must achieve.
74 2. A Basic Formulation of Predictive Control
20 400
15
Altitude (m)
Pitch (deg)
300
10
200
5
100
0
−5 0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
40 10
5
30
0
20
−5
10 −10
0 −15
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
Figure 2.7: Response of Citation aircraft to 400 m step change in altitude set-point.
for the altitude (which may require changing the weights during the maneouvre, as
in (2.105) or (2.106)), or to ramp the altitude reference trajectory from the latest
altitude measurement:
0
r(k + i|k) = y2 (k) + 30Ts i if ŷ2 (k + i|k) < 395 (2.107)
30
0
r(k + i|k) = 400 if ŷ2 (k + i|k) ≥ 395 (2.108)
0
20 400
15
Altitude (m)
Pitch (deg)
300
10
200
5
100
0
−5 0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
15
30
Elevator angle (deg)
Altitude rate (m/sec)
10
20 5
0
10 −5
−10
0
−15
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
Figure 2.8: Response of Citation aircraft to 400 m step change in altitude set-point,
with altitude rate constraint.
the pitch angle to change suddenly from about 13◦ to −5◦ , before recovering to a
steady value of +11◦ . This value of the pitch angle holds the altitude rate at its
constraint while the disturbance is present. The disturbance ceases suddenly 10
seconds into the manoeuvre, which has the immediate effect of reducing the altitude
rate. Since there is now no danger of the altitude rate constraint being violated, the
controller reacts to this in a much less agressive manner than it did to the onset of
the disturbance. This nicely illustrates the nonlinear behaviour of the controller.
Figure 2.10, on the other hand, shows what happens when there is a set-point of
30 m/sec for the altitude rate instead of a constraint. The set-points for the pitch
angle and altitude are constant, as before, at 0◦ and 400 m, respectively. In order
to give the altitude rate set-point sufficient weight, compared with the altitude set-
point, the tracking error weights Q(i) were chosen to be Q(i) = diag[1, 1, 100] for
i = 1, . . . , 5, and Q(i) = I3 for i = 6, . . . , 10 — recall that Hp = 10. It can be seen
that the response to the disturbance is now much milder. Although the altitude
rate remains above 30 m/sec for a little longer than in the previous case, overall it
remains closer to this value than in the previous case, because there is no big dip
below 30 m/sec, since the elevator action is now much smaller. It can also be seen
that the responses to the start and end of the disturbance pulse are now much more
symmetric, as a result of the fact that the controller is now operating in linear mode.
76 2. A Basic Formulation of Predictive Control
20
400
10
Altitude (m)
Pitch (deg)
300
0
200
−10
100
−20
0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
30 10
5
20 0
−5
10
−10
0 −15
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
The fact that at the end of the manoeuvre there is a more violent transient than in
the previous case is an unimportant artefact of the choice of weights and set-point
specifications, and could be removed by more careful tuning.
Now suppose that the gain from the elevator angle to the altitude rate is mis-
modelled, so that the model used by the predictive controller underestimates this
gain by 10%. (That is, elements A(4, 1), A(4, 2), C(3, 1), C(3, 2) are 10% smaller in
the model than in the plant.) Figure 2.11 shows the response to an altitude set-point
change of 400 m, when the altitude rate is constrained to 30 m/sec, and when the
constant output disturbance assumption is made on each output. Comparing the
response with figure 2.8 shows that the response is now a little more erratic, with
more elevator activity. The altitude rate constraint is violated briefly about 1.5 sec
into the transient (by about 0.5 m/sec), but after that it is not violated again. The
required altitude is acquired and held without any error in the steady state.
2.8. Problems 77
20
400
10
Altitude (m)
Pitch (deg)
300
0
200
−10
100
−20
0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
10
30
5
20 0
−5
10
−10
0 −15
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
2.8 Problems
The first 3 problems can be skipped by those familiar with quadratic forms, ∇V ,
etc.
1. Use MATLAB to find the eigenvalues of the matrix Q which appears in Ex-
ample 2.1. Check that they are both positive.
2. (a) Suppose V (x) = 9x21 + 25x22 + 16x23 . Find Q such that V (x) = xT Qx.
(b) Suppose V (x, u) = (5x21 + 2x22 + x23 ) + (100u21 + 4u22 ). Find Q and R such
that V (x) = xT Qx + uT Ru.
(c) Are the functions V which appear in this problem positive-definite?
3. Check that the formula (2.20) for the gradient is correct for Example 2.1, by
working out the partial derivatives in the elementary way, and comparing the
results.
20 400
15
Altitude (m)
Pitch (deg)
300
10
200
5
100
0
−5 0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
15
30
Elevator angle (deg)
Altitude rate (m/sec)
10
5
20
0
10 −5
−10
0
−15
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
Figure 2.11: Response of Citation aircraft to 400 m step change in altitude set-point,
with altitude rate constraint and plant-model error.
Is the system stable? With the default discretization method used by c2d
each eigenvalue λ of Ac should be mapped to exp(λTs ). Check this (using the
functions eig and exp).
7. Suppose that in Example 2.4 the feed tank level H1 is constrained, to ensure
that the feed tank neither runs dry nor overfills (in addition to the other
constraints).
(a) Explain why the matrix Cz in the basic formulation must be changed to
represent this. What is the new value of this matrix?
(b) What are the new dimensions of the matrices E, F and G in this case?
(c) Do you anticipate any additional difficulty with this case? (Hint: Com-
pare the matrices Cy and Cz .)
10. For the linearised model of the Citation aircraft defined in section 2.7:
(The function makecita, available on this book’s web site, creates the continuous-
time Citation model.)
80 2. A Basic Formulation of Predictive Control
11. Using equations (2.67)–(2.70), or (2.72), write the predictions ẑ(k + i|k) in
matrix-vector form (analogously to (2.66)).
12. Suppose that Dz 6= 0 in (2.4). Introduce the new vector of controlled variables
z̃(k) = z(k) − Dz u(k). Show that if the cost function and linear inequality
constraints are re-written in terms of z̃ instead of z then the predictive con-
trol problem remains in the standard form, namely the cost function remains
quadratic in ∆û and the constraints remain as linear inequalities involving ∆û.
13. Suppose that Dz 6= 0 in (2.4), but that the change of variable z̃(k) = z(k) −
Dz u(k) is not made. How does the computation of ẑ(k + i|k) need to be
modified from (2.67)–(2.70)? Can you find an expression for the vector [ẑ(k +
1|k), . . . , ẑ(k + Hp |k)]T in matrix-vector form? (Note that the predictions ẑ
remain linear in the x̂ and ∆û variables.)
14. Show that the pair
A 0
, [Cy , I]
0 I
is observable if and only if the pair (A, Cy ) is observable.
(The significance is that if this pair is observable then an observer gain matrix
L can always be found which places the eigenvalues of the ‘constant output’
observer (2.86) at arbitrary locations.)
15. A plant with 1 input, 1 output and 1 state has the model
x(k + 1) = 0.9x(k) + 0.5u(k), y(k) = x(k)
Predictive control is to be used with Q(i) = 1, R(i) = 0, Hp = 30, and
Hu = 2. A constant step disturbance at the plant input is assumed (that is,
u(k) is replaced by u(k) + d(k)).
(a) Show how the plant model can be augmented to incorporate this distur-
bance model.
(b) Design a state observer with a ‘deadbeat’ response for the plant with
this disturbance model. (The easy way to do this is to use the Model
Predictive Control Toolbox function smpcest(imod,Q,R), where Q and R
are fictitious state and output noise covariances, respectively, with R very
small. The observer approaches a deadbeat observer as R approaches 0.)
(c) Simulate the response of the predictive controller to an input step dis-
turbance when your observer is used. Compare the response to that
obtained when the default ‘DMC’ observer is used. (Assume there are no
constraints.)
(d) How does the observer design affect the set-point response?
(e) Work out the details of how to use the Control System Toolbox function
place to design observers for use with the Model Predictive Control Tool-
box. (You will need to pay attention to the model representations used
by the Model Predictive Control Toolbox.)
2.8. Problems 81
16. Using the representation (2.78)–(2.79) show that the plant output estimated
by any asymptotically stable observer converges to the measured plant output,
if that is constant (assuming that the plant input and state are both constant).
82 2. A Basic Formulation of Predictive Control
Chapter 3
This chapter explains how the standard predictive control problem can be solved. It
also discusses the structure of the controller which results. Active set and interior
point methods of solving the optimization problems which arise in predictive control
are introduced, and the very important topic of constraint softening is treated.
X
Hp u −1
HX
V (k) = ||ẑ(k + i|k) − r(k + i)||2Q(i) + ||∆û(k + i|k)||2R(i) (3.1)
i=Hw i=0
where
ẑ(k + Hw |k) r̂(k + Hw |k) ∆û(k|k)
.. .. ..
Z(k) = . T (k) = . ∆U (k) = .
ẑ(k + Hp |k) r̂(k + Hp |k) ∆û(k + Hu − 1|k)
83
84 3. Solving Predictive Control Problems
Also recall from (2.66) and (2.72) — and from Problems 11 and 13 of Chapter 2 —
that Z has the form
This can be thought of as a ‘tracking error’, in the sense that it is the difference
between the future target trajectory and the ‘free response’ of the system, namely
the response that would occur over the prediction horizon if no input changes were
made — that is, if we set ∆U (k) = 0. And if E(k) really were 0, then it would
indeed be correct to set ∆U (k) = 0. Now we can write
where
and
H = ΘT QΘ + R, (3.12)
To find the optimal ∆U(k) we can now find the gradient of V (k) and set it to zero.
From (3.10) we find
1
∆U (k)opt = H−1 G (3.14)
2
Remember that we use only the part of this solution corresponding to the first step,
in accordance with the receding horizon strategy. So if the number of plant inputs
is ` then we just use the first ` rows of the vector ∆U (k)opt . We can represent this
as
Note that we can write ∆u(k)opt here, rather than û(k|k)opt , because we have now
found the solution and this is the input that is really applied to the plant at time k.
Does ∆U(k)opt really give a minimum of the cost function V ? It certainly gives a
stationary point, but that is not enough to guarantee a minimum. Differentiating
the gradient ∇∆U (k) V (3.13) again with respect to ∆U (k) gives the matrix of second
derivatives, or Hessian, of V :
∂2V
= 2H = 2(ΘT QΘ + R). (3.16)
∂∆U(k)2
We have assumed that Q(i) ≥ 0 for each i, and this ensures that ΘT QΘ ≥ 0. So if
R > 0 then the Hessian is certainly positive-definite, which is enough to guarantee
that we have a minimum. And this will be the case if R(i) > 0 for each i.
But sometimes we may want to have no penalty on the input moves, which would
lead to R = 0. Or we may want to leave the moves of some inputs unpenalised, or
the moves at some points in the control horizon unpenalised. In these cases we will
have R ≥ 0, but not R > 0. When R = 0 we need ΘT QΘ > 0 in order to have a
minimum — and of course, to ensure that H−1 exists. In intermediate cases, when
R ≥ 0, we need to ensure that ΘT QΘ + R > 0.
Let us check the dimensions of the various matrices introduced in this section. Θ has
as many rows as there are elements in Z. If we have p controlled outputs, and we
predict between steps Hw and Hp , then there are p(Hp − Hw + 1) of these elements.
The number of columns in Θ is the same as the number of elements in ∆U (k), which
is `Hu . Q(i) has m rows and columns, so Q has m(Hp − Hw + 1) of each. Thus
H = ΘT QΘ is square, with `Hu rows and columns. This agrees (as it must!) with
the number of rows and columns in R. Similar checks on the remaining matrices
lead to Table 3.1.
86 3. Solving Predictive Control Problems
Matrix Dimensions
Q m(Hp − Hw + 1) × m(Hp − Hw + 1)
R `Hu × `Hu
Ψ m(Hp − Hw + 1) × n
Υ m(Hp − Hw + 1) × `
Θ m(Hp − Hw + 1) × `Hu
E m(Hp − Hw + 1) × 1
G `Hu × 1
H `Hu × `Hu
Table 3.1: Dimensions of matrices and vectors involved in computing the optimal
input moves. (The plant has ` inputs, n states, and m controlled outputs.)
Since Q ≥ 0 and R ≥ 0, we can find matrices SQ and SR which are their ‘square-
roots’:
T
SQ SQ = Q T
SR SR = R
SQ {Θ∆U(k) − E(k)}
SR ∆U(k)
We shall show that the squared ‘length’ of this vector, or equivalently, the sum of
squares of its elements, is the same as the cost function V (k), so that ∆U (k)opt is
3.1. Unconstrained Problems 87
Equations of the form Aθ = b can be solved in a least-squares sense using the ‘QR’
algorithm. In MATLAB this solution is obtained as θopt = A\b. Although formally
this solution is the same as θopt = (AT A)−1 AT b, (which gives (3.14)), this algorithm
avoids ‘squaring up’ A, and never forms the product AT A, or computes its inverse.
If A is ill-conditioned and/or large this is crucial, since it avoids unnecessary loss
of precision. For more details see any book on numerical linear algebra, such as
[GL89], or Chapter 8 of [Mac89] (or the MATLAB documentation).
Equation (3.22) is almost always over-determined: there are not enough degrees of
freedom to get an exact solution. It contains m(Hp −Hw +1)+`Hu scalar equations,
but there are only `Hu variables to be solved for. Even in the special case of R = 0,
when there is no penalty on input moves, and the equation simplifies to
there are usually more scalar equations than variables. A unique exact solution exists
only if the matrix SQ Θ is square and non-singular, which requires m(Hp −Hw +1) =
`Hu . However, we usually have m(Hp − Hw + 1) > `Hu . Note that in the case of
R = 0 we cannot remove SQ from each side of the equation — doing so would give
a different solution, since it would change the weighting used when minimising the
sum of squares of the error.
88 3. Solving Predictive Control Problems
and
The only part of this solution which changes from step to step is the ‘tracking error’
E(k). Consequently the predictive controller, for the unconstrained problem and
with full state measurement, can be drawn as in figure 3.1.
We point out that the ‘correct’ way of computing KM P C is (again using MATLAB
notation, including the ‘:’ operator to pick out the first ` rows of the solution):
SQ Θ SQ
Kf ull = (3.28)
SR 0
KM P C = Kf ull (1 : `, :) (3.29)
(This works for the following reason: If we had E(k) = [1, 0, . . . , 0]T then we would
effectively have only the first column of SQ on the right hand side of (3.23). E(k) =
[0, 1, 0, . . . , 0]T would effectively give the second column, etc. Since E(k) enters the
3.1. Unconstrained Problems 89
z(k)
T (k) E(k) ∆u(k) u(k)
KM P C z
+ z−1 I PLANT
− y(k) = x(k)
−
u(k − 1)
Υ z −1 I
CONTROLLER
Figure 3.1: Structure of controller with no constraints and full state measurement.
solution linearly, it is only necessary to solve (3.23) with these columns on the right
hand side. The ‘\’ operator in MATLAB is smart enough to solve for all the columns
simultaneously — and this is very effficient, since most of the work involved is in
computing the QR decomposition of the left hand side, which needs to be done only
once.)
It is clear from the figure that the controller is a linear time-invariant system in
this case. So it is possible to compute its frequency response, stability margins,
etc. We shall do that kind of analysis in a later chapter. Note that the controller
is, in general, dynamic. It is not just ‘state feedback’, except under very special
circumstances.
The matrix Ks computed by the Model Predictive Control Toolbox function smpccon
is related to KM P C as follows:
I
I
Ks = KM P C .. , −Ψ, −Υ (3.30)
.
I
so that
T (k)
∆u(k)opt = Ks x(k) (3.31)
u(k − 1)
90 3. Solving Predictive Control Problems
Now we need to address the more realistic case, when we do not have measurements
of the whole state vector, and must use an observer. We will see that the solution
is very similar to the solution in the previous case. In fact, we will see that all
the gain matrices involved are exactly the same as in the previous case. The only
difference is that we need to use an observer, and use the state estimate x̂(k|k) to
replace the measured state x(k). The controller structure in this case is shown in
figure 3.2. This is again a linear time-invariant system, but now with more dynamic
complexity, because its state vector includes the observer state.
z(k)
T (k) E(k) ∆u(k) u(k)
z
+ KM P C z−1 I PLANT
− y(k)
−
u(k − 1)
Υ z −1 I
x̂(k|k)
Ψ OBSERVER
CONTROLLER
So now we define
and we make the corresponding change in the definition of the ‘tracking error’ E(k)
3.2. Constrained Problems 91
Once these changes have been made, the derivation of the optimal control ∆u(k)opt
is exactly the same as in earlier sections. Hence we arrive at the controller structure
shown in figure 3.2.
Now we deal with the case when constraints are present. Recall that these are in
the form:
∆U(k)
E ≤0 (3.34)
1
U (k)
F ≤0 (3.35)
1
Z(k)
G ≤0 (3.36)
1
F = [F1 , F2 , · · · , FHu , f ]
where each Fi is of size q × m, and f has size q × 1, so that (3.35) can be written as
X
Hu
Fi û(k + i − 1|k) + f ≤ 0.
i=1
Since
X
i−1
û(k + i − 1|k) = u(k − 1) + ∆û(k + j|k)
j=0
X
Hu X
Hu X
Hu
Fj ∆û(k|k) + Fj ∆û(k + 1|k) + . . . + FHu ∆û(k + Hu − 1|k) + Fj u(k − 1) + f ≤ 0
j=1 j=2 j=1
92 3. Solving Predictive Control Problems
PH u
Now define zi = j=i Fj and z = [z1 , . . . , zHu ]. Then (3.35) can be written as
where the right hand side of the inequality is a vector, which is known at time k.
So we have converted (3.35) into a linear inequality constraint on ∆U (k).
Note that if we have simple range constraints on the inputs, of the form
then this inequality takes quite a simple form. (See Problem 6.)
Now we have to do a similar thing for (3.36). Fortunately we have already done
most of the work needed in this case. Assuming full state measurements, we can use
(3.5) to write (3.36) as
Ψx(k) + Υu(k − 1) + Θ∆U(k)
G ≤0
1
Now letting G = [Γ, g], where g is the last column of G, this is the same as
or
If we have only state estimates available, then we replace x(k) by x̂(k|k), just as we
did in section 3.1.4.
W ∆U (k) ≤ w (3.40)
(see Problem 6). Then we can assemble inequalities (3.37), (3.39), and (3.40) into
the single inequality
z −z1 u(k − 1) − f
ΓΘ ∆U(k) ≤ −Γ[Ψx(k) + Υu(k − 1)] − g (3.41)
W w
Now the cost function V (k) which we have to minimise is still the same as in the
unconstrained case. So, from (3.10), we see that we have to solve the following
constrained optimization problem:
subject to the inequality constraint (3.41). But this has the form
1
min θ T Φθ + φT θ (3.43)
θ 2
subject to
Ωθ ≤ ω (3.44)
A major problem which can occur with constrained optimization is that the prob-
lem may be infeasible. Standard QP solvers just stop in such cases, their only
output being a message such as Problem Infeasible, or perhaps some diagnostics
in certain cases. This is obviously unacceptable as a substitute for a control signal
which must be provided to the plant. So when implementing predictive control it
is essential to take steps either to avoid posing an infeasible problem, or to have a
‘back-up’ method of computing the control signal. Various approaches to this have
been suggested, including:
The straight line joining any two points on the cost surface is never below the surface.
A Quadratic Program is an optimization problem of the form
1
min θ T Φθ + φT θ subject to Ωθ ≤ ω
θ 2
Here the objective function is V (θ) = 12 θ T Φθ + φT θ and its Hessian is Φ. If there are
no constraints this is clearly convex if Φ ≥ 0. (Without this condition there might
be no minimum, since arbitrarily large negative values of V might be attainable.)
Since the constraints are linear inequalities, the surfaces on which they are active
are hyperplanes. So the constrained objective function can be visualised as a convex
quadratic surface, parts of which have been cut off by a number of flat ‘faces’. It is
intuitively clear that this constrained surface remains convex, although we shall not
give a formal proof of this.
A Linear Program (or LP) is the special case of a QP when Φ = 0, so that the
objective function is linear rather than quadratic. It is also convex when Ω and
φ are such that a minimum exists; in this case the minimum always occurs at a
vertex (or possibly an edge). The constrained objective surface can be visualised
as a convex object with flat faces. Such an object is called a simplex. There are
standard algorithms for solving large LP problems, including the famous ‘simplex
method’.
The literature of convex optimization, LP and QP problems is enormous. Good
general books on optimization which include relevant material are [Fle87, GMW81].
A whole book on using convex optimization for control design (but which does not
deal with predictive control) is [BB91].
Mini-Tutorial 3: Convex Optimization, QP and LP Problems
3.2. Constrained Problems 95
So long as all the constraints are inactive, the solution of the predictive controller
is exactly the same as in the unconstrained case. But if constraints become active
then the controller becomes nonlinear and the structure shown in figures 3.1 and
3.2 is lost. Figure 3.3 shows the controller structure in this case. The controller is
nonlinear because the box labelled ‘OPTIMIZER’ computes a nonlinear function of
its inputs.
z(k)
T (k) ∆u(k) z u(k)
OPTIMIZER
z−1 I PLANT
y(k)
u(k − 1)
Υ z −1 I
x̂(k|k)
Ψ OBSERVER
CONTROLLER
We can say a little more about the controller structure. Suppose a particular set of
constraints is active. That is, in the QP problem (3.43)–(3.44), suppose that
Ωa θ = ωa (3.47)
where Ωa is made up of those rows of Ω which relate to the active constraints, and ωa
is made up of the corresponding elements of ω. If we knew before solving the problem
that these would be the active constraints, and were therefore equality rather than
inequality constraints, then we could (only in principle!) pose the optimization
problem
1
min θ T Φθ + φT θ subject to Ωa θ = ω a (3.48)
θ 2
which could, by the theory of Lagrange multipliers, be solved by solving the problem
where
1 T
L(θ, λ) = θ Φθ + φT θ + λ(Ωa θ − ωa ) (3.50)
2
Now
or
Φ ΩTa θ −φ
∇L(θ, λ) = − (3.53)
Ωa 0 λ ωa
We can therefore conclude that the constrained predictive control law is a linear
time-invariant control law, so long as the set of active constraints is fixed. A more
intuitive explanation can be given on the basis of Figures 3.4 and 3.5. These show
a quadratic cost function as a surface in the case when there are only two decision
variables. In Figure 3.4 a linear inequality constraint restricts the decision variables
so that only part of the cost surface is ‘attainable’, but the unconstrained minimum
is in the feasible region, so the optimal solution is at the unconstrained minimum. In
Figure 3.5 the constraint is active, so that the optimal solution is on the intersection
of the cost surface and the inequality constraint. It can be seen that the optimal
solution is still the global minimum of a quadratic surface, but one of lower dimension
— in this case, the minimum of a quadratic curve. It is the fact that a quadratic
problem is still being solved that leads to the controller being linear.
In practice the set of active constraints changes, so we have the picture of the control
law as consisting of a number of linear controllers, each with a structure similar to
that shown in figure 3.2, and switching between them. If we could be sure that
3.2. Constrained Problems 97
90
80
70
60
50
40
30
20
10
10
8
0 6
−2 4
0
2 2
4
6 0
8
10 −2
Figure 3.4: A quadratic cost surface and a linear inequality constraint: Constraint
inactive.
98 3. Solving Predictive Control Problems
90
80
70
60
50
40
30
20
10
10
8
0 6
−2 4
0
2 2
4
6 0
8
10 −2
Figure 3.5: A quadratic cost surface and a linear inequality constraint: Constraint
active.
3.2. Constrained Problems 99
changes of active constraint sets occurred rarely enough — and there is no reason
to suppose that this would be the case in general — we might be able to exploit this
structure to perform some analysis of the constrained controller.
In [BMDP, BMDP99] a promising attempt is made not only to use the piecewise-
linear nature of the controller as a basis for analysis, but also as a way of computing
the optimal solution efficiently for small problems. In this context ‘small’ means
that the number of constraints is such that the number of possible active constraint
sets is manageable, since a separate solution is pre-computed explicitly for each such
set. Note that the number of possible active constraint sets can be extremely large.
If there are q constraints in the problem formulation (Ω has q rows) then there are
2q possible sets of active constraints. Analysis of specific problems can often reduce
the size of this set to some extent — for example, lower and upper limits on variable
values cannot be active simultaneously.
Ωθ ≤ ω(x̂) (3.55)
The vector on the right-hand side of the inequality depends on the (estimate of the)
current state, which can be thought of as a set of parameters of the QP problem.
Techniques of multiparametric programming are then employed to analyse the set
of solutions. One new result which is obtained by this means is that the control
law is continuous in x̂. Algorithms are also given for determining efficiently the
boundaries (in the state-space) at which changes from one piecewise-linear control
law to another occur. The idea, then, is that for small problems, in which the
state-space is divided up into a manageably small number of (convex) pieces, one
could pre-compute (off-line) the control law that should be applied in each piece,
and then the MPC algorithm would consist simply of reading the appropriate gain
matrix from a table look-up, depending on the current state estimate. This should
be particularly useful in high-bandwidth applications, when high control update
rates are required.
Although this idea is not feasible for applications in which the number of constraints
is large (q > 10, say), it may be possible even in large problems to compute the
solution by conventional means (as described in the next subsection) when a region
of the state-space is entered for the first time, but then to store it in a growing
database, as the state-space is explored, so that if the region is revisited later the
solution does not need to be recomputed. Many variations of this can be easily
imagined.
100 3. Solving Predictive Control Problems
1
min θ T Φθ + φT θ (Φ = ΦT ≥ 0) (3.56)
θ 2
subject to
Hθ = h (3.57)
and
Ωθ ≤ ω (3.58)
This is the same as the QP problem introduced earlier, except that the equality
constraints Hθ = h have been identified explicitly. We shall assume that it is not
feasible to pre-compute the solutions in the manner described at the end of the
previous subsection.
Two approaches to solving the QP problem appear to offer the best performance:
Active Set methods [Fle87], and the more recent Interior Point methods [NN94,
Wri97, RTV97] . It is tempting to assume that the more recent methods should
offer the best performance, but Wright [Wri96] argues that for predictive control
this issue is still open. He points out that the predictive control problem has a
lot of special structure, and that the main performance gains are to be obtained
by exploiting this structure, whichever approach is used. The special structure is
primarily due to two features:
In this section, both the Active Set and the Interior Point methods will be de-
scribed very briefly, and some of the points at which the structure of the predic-
tive control problem can be exploited will be identified. The presentation is based
on [Fle87]and [Wri96].
As a result of the QP problem being convex, the necessary and sufficient conditions
for θ to be the global optimum are given by the Karush-Kuhn-Tucker (or KKT)
conditions [Fle87, Wri97]: there must exist vectors (Lagrange multipliers) λ ≥ 0
3.3. Solving QP Problems 101
The Active Set method assumes that a feasible solution is available. (We shall
consider later how that might be found.) For such a solution, the equality constraints
(3.57) are of course satisfied, and some subset of the inequality constraints (3.58)
is active, namely the constraints hold with equality for this subset. This subset
is called the active set; it is possible for it to be empty, if none of the inequality
constraints is active at the current feasible solution. Using the same notation as
earlier, we use the subscript a to denote those rows of (3.58) which are in the active
set, so that
Ωa θ = ωa
Suppose that at the r’th iteration we have the feasible solution θr . The active set
method then finds an improved solution θr + ∆θ which minimises the cost (3.56)
while satisfying the equality constraints Hθ = h and Ωa θr = ωa , without worrying
about the inactive inequality constraints. If this new solution is feasible, that is
if Ω(θr + ∆θ) ≤ ω, then it is accepted as the next iteration: θr+1 = θr + ∆θ.
If it is not feasible, then a line-search is made in the direction ∆θ to locate the
point at which feasibility is lost — namely the point at which one of the inactive
inequality constraints becomes active. The solution at this point is accepted as the
next iteration: θr+1 = θr + αr ∆θ, where 0 < αr < 1, and the newly active constraint
is added to the active set.
It remains to decide whether this new solution is already the global optimum of
the QP problem, or whether further improvement can be obtained. This decision
can be made by checking whether the KKT conditions (3.59)–(3.62) are satisfied at
θr+1 . Note that the complementarity condition (3.62) implies that those elements of
λ corresponding to inactive constraints are zero, since the corresponding elements of
t are positive. So only those elements of λ corresponding to active constraints need
to be evaluated; if they are all nonnegative then the global solution has been found,
because of the condition λ ≥ 0, otherwise further iteration is needed. So suppose
that λq < 0. Since λq is a Lagrange multiplier corresponding to the q’th inequality
constraint, which is active (by assumption), its negative value indicates that the cost
function could be reduced by making that constraint inactive, namely moving to a
solution θ for which Ωq θ < ωq . Thus the q’th constraint is removed from the active
set. (If more than one element of λ is negative, then the constraint corresponding
to the most negative one is removed from the active set.) So now a new active set
has been selected, and the whole process is repeated, replacing θr by θr+1 .
102 3. Solving Predictive Control Problems
Note that V (θr+1 ) < V (θr ), where V (θ) = 12 θ T Φθ + φT θ is the cost function, so that
this iterative process is guaranteed to terminate at the global optimum, because of
the convexity of the QP problem. A potential advantage of the active-set method
over other methods, for predictive control, is that the iterations remain feasible once
an initial feasible solution has been found. In many predictive control problems it is
the feasibility of the solution, rather than exact optimality, that is most important.
So if the QP solver has failed to terminate by the time the next control move is
required, using the latest available iteration may be an adequate solution, and in
many cases it is likely to be nearly as effective as the true optimal solution. This
may arise, for example, when an unusually large disturbance occurs, so that the
most important thing is to keep the plant within a safe operating region — that is,
find a feasible solution, if the constraints delineate the boundary of this region; in
these circumstances, a good initial guess of the solution is not likely to be available
from earlier steps.
Now we consider in more detail the minimisation of the cost function at the r’th
iteration. The new cost is
1
V (θr + ∆θ) = (θr + ∆θ)T Φ(θr + ∆θ) + φT (θr + ∆θ) (3.63)
2
1
= V (θr ) + ∆θ T Φ∆θ + (φT + θrT Φ)∆θ (3.64)
2
1
min ∆θ T Φ∆θ + φTr ∆θ (3.65)
∆θ 2
subject to
Once this factorisation has been obtained, the solution is obtained very quickly, since
it requires the solution (for η) of
−φr
Lη = 0
0
Taking the predictive control QP problem to be defined by (3.41) and (3.42), we see
that the corresponding values for Φ and Ω are
Φ = H = ΘT QΘ (3.72)
z
Ω = ΓΘ (3.73)
W
and H does not exist. Although Q is block-diagonal, Θ is nearly full, so that Φ does
not have any particular structure which can be exploited, apart from symmetry.
solver. That is, we still minimise the cost function (3.2), but instead of replacing
Z(k) by using (3.5), we use (2.72) and impose the equality constraints
x̂(k + j + 1|k) = Ax̂(k + j|k) + B û(k + j|k) for j = 0, . . . , Hp − 1 (3.74)
and
û(k + j + 1|k) = û(k + j|k) + ∆û(k + j + 1|k) for j = 0, . . . , Hu − 1
(3.75)
(with û(k − 1|k) = u(k − 1)). The minimisation is then performed over the variables
∆û(k + j|k) and û(k + j|k) for (j = 0, . . . , Hu − 1), and x̂(k + j|k) for j = 1, . . . , Hp .
This introduces `Hu + nHp additional variables into the problem (where ` is the
number of inputs and n is the state dimension), which looks like a bad idea. But the
potential benefit is that now the matrix which has to be factorised in the active-set
method can be banded. If the variables are ordered in the following way:
û(k|k)
∆û(k|k)
x̂(k + 1|k)
û(k + 1|k)
∆û(k + 1|k)
x̂(k + 2|k) T
.
θ=
.
.
(3.76)
û(k + Hu − 1|k)
∆û(k + Hu − 1|k)
x̂(k + Hu |k)
x̂(k + H + 1|k)
u
.
..
x̂(k + Hp |k)
then we have (assuming Hw = 1 and Hu < Hp for simplicity):
0 0 0 0 0 0 ··· 0 0
0 R(0) 0 0 0 0 ··· 0 0
0 0 Q̄(1) 0 0 0 ··· 0 0
0 0 0 0 0 0 ··· 0 0
0 0 0 0 R(1) 0 ··· 0 0
Φ = (3.77)
0 0 0 0 0 Q̄(2) ··· 0 0
. . .. .. .. .. .. .. ..
.. .. . . . . . . .
0 0 0 0 0 0 0 Q̄(Hp − 1) 0
0 0 0 0 0 0 0 0 Q̄(Hp )
B 0 −I 0 0 0 0 ··· 0 0
I −I 0 −I 0 0 0 ··· 0 0
0 0 A B 0 −I 0 · · · 0 0
H = 0 0 0 I −I 0 −I · · · 0 0 (3.78)
.. .. .. .. .. .. .. .. .. ..
. . . . . . . . . .
0 0 0 0 0 0 0 ··· A −I
3.3. Solving QP Problems 105
where Q̄(i) = CzT Q(i)Cz . The point here is that both Φ and H have a banded
structure (ie all their non-zero entries are relatively close to the principal diagonal),
as does the matrix Ω associated with the inequality constraints. Now this does not
itself make the matrix to be factorised in (3.71) banded, but this can also be achieved
by reordering the order of the variables. The key is to keep all the variables associated
with predicted time k+j grouped together, including the relevant elements of ∆ζ and
∆λ. The bandedness can be exploited to speed up the factorisation. Furthermore,
the matrix to be factorised at the (r + 1)’th iteration of the active set method is
only a little different from the one factorised at the r’th iteration. Wright [Wri96]
proposes a method which takes advantage of both of these features.
These examples suggest that the banded scheme is likely to be worthwhile in many
cases. As we will see in chapters 6 and 8, long prediction horizons help to ensure
closed-loop stability, and to minimise the risk of driving the plant into ‘dead-ends’
from which no feasible solution is possible; thus there are good reasons for making
Hp as large as computation speed will allow. Note that if Hu Hp then the original
‘dense’ scheme will be more favoured over the ‘banded’ scheme than inequality (3.79)
suggests. The comparison should be done more carefully for any particular applica-
tion, since it will be affected by factors such as how many constraints are likely to
be active typically (which it may be possible to predict for particular applications).
Also, the comparison as made above disregards the difference in the difficulty of
106 3. Solving Predictive Control Problems
One more point remains to be dealt with: how to find an initial feasible solution.
This is needed in order to get the iterations of the active set method started. The
basic idea is the following. Suppose that we have an infeasible solution θ0 , which
satisfies the equality constraints Hθ0 = h, and that a subset of the inequality con-
straints is satisfied, so that Ωs θ0 ≤ ωs , and the remaining inequality constraints are
not satisfied: Ωu θ0 > ωu . Then a solution θ is sought for the linear programming
(LP) problem:
X
min (ωuj − Ωju θ) (3.80)
θ
j
subject to
Hθ = h (3.81)
and
Ωs θ ≤ ωs (3.82)
where Ωju denotes the j’th row of Ωu and ωuj denotes the j’th element of ωu . The
usual simplex algorithm for solving LP problems can be used, which searches among
the vertices of the feasible region. However, the problem formulation is changed
at every new vertex visited, because the selection of rows in Ωs and Ωu (and of
corresponding elements in ωs and ωu ) changes at every vertex. Eventually either
all the inequality constraints are satisfied, in which case a feasible solution has been
found, or the cost (3.80) is still positive and the Lagrange multipliers indicate that
it cannot be improved, in which case the problem is infeasible. Problems with this
basic idea are:
1. The feasible solution which is found is arbitrary, and can be very far from the
optimal solution of the QP problem.
2. The simplex algorithm always requires as many active constraints as the di-
mension of θ. So it may not be possible to use the solution of the QP problem
solved at the previous step as an initial guess (hot starting), because that may
have a different number of active constraints.
These problems can be overcome by adding a small multiple of the QP cost to the
cost function (3.80). This ‘biases’ the initial feasible solution towards the optimal
solution of the QP problem, hopefully leading to fewer iterations of the active set
method, and it also changes the initial feasibility problem from an LP problem into
a QP problem, which can be started with any number of active constraints.
3.3. Solving QP Problems 107
In the last twenty years or so, a rival family of algorithms for solving convex
optimization problems has emerged. These are the so-called interior point meth-
ods [NN94, Wri97, RTV97] . They first came to prominence with Kamarkar’s algo-
rithm for solving LP problems, the first serious rival to the simplex algorithm, and
one which was potentially dramatically faster for large problems. Much develop-
ment since then has led to versions of interior point methods which are particularly
effective for solving QP problems. The attraction of these new methods is that their
computational complexity (number of iterations, time to complete, . . . ) is no worse
than some polynomial function of parameters such as the number of constraints or
the number of variables, whereas the complexity of other known approaches, includ-
ing active set methods, can be exponential in these parameters in the worst case.
We remark that the availability of interior point methods for more general convex
optimization problems has led to the intense current interest in linear matrix in-
equalities (LMIs) for solving control and other ‘systems’ problems [BGFB94] — we
shall make use of them in section 8.4.
In this subsection we shall give a brief indication of how interior point methods work.
As with active set methods, one can apply interior point methods to the predictive
control problem ‘naively’, that is regarding it as just a standard QP problem, or one
can exploit the particular structure inherent in predictive control problems. The
second alternative has been investigated in detail by Wright et al [Wri96, RWR98].
Whereas the main iterations of the active set methods search among points on the
boundary of the feasible region, early interior point methods searched among points
in the ‘interior’ of this region; in other words, the iterates were always feasible
solutions of the optimization problem being solved. It turned out that this was not
a particularly efficient strategy, among other things requiring an initial feasible point
to be found. The iterates in more recent versions are not feasible — until the end
of the search, typically — but they are still away from the boundary of the feasible
region, and in that sense ‘interior’ (and they are in the interior of a certain positive
orthant).
where aTi is the i’th row of A, bi is the i’th element of the vector b, and γ is some
positive scalar. If the minimum of f (x, γ) is being sought by some search strategy,
starting in the feasible region, then the logarithmic barrier function prevents the
search leaving the feasible region, since it becomes infinite on the boundary of the
108 3. Solving Predictive Control Problems
region. 1 Let xγ be the minimiser of f (x, γ), and let x∗ be the solution of the original
problem, namely the minimiser of V (x) which satisfies the constraints. x0 is known
as the analytic centre of the constraints; if the feasible region is not empty then
x0 lies in its interior, and does not depend on the objective function V (x) at all.
On the other hand, xγ → x∗ as γ → ∞. The underlying idea is that if an initial
(feasible) solution is found in the vicinity of x0 , then it can be continuously improved
by increasing γ and minimising f (x, γ), until kx∗ − xγ k is sufficiently small. The
path traced out by xγ is known as the central path.
Example 3.1 Consider the following QP problem, taken from Fletcher [Fle87, Prob-
lem 10.4]:
subject to
θ1 ≥ 0
θ2 ≥ 0
θ1 + θ2 ≤ 2
Figure 3.6 shows the feasible region — the interior of the triangle — and some
contours of V (θ). It is clear that the optimal solution is at (3/2, 1/2), where the
V (θ) = −11/4 contour is tangential to the constraint θ1 + θ2 ≤ 2. The small circle
in the middle of the triangle shows the analytic centre, which is at (2/3, 2/3), and
the dots show the central path traced out as γ increases from 0 to 100. To get the
sequence of solutions shown, the γ values were spaced logarithmically between 0.01
and 100, using 20 values (MATLAB command: logspace(-2,2,20)).
Examining the neighbourhood of the optimal solution in Figure 3.6 reveals a draw-
back of naive implementations of the interior point approach: one of the solutions
seems to be at the constraint, but a little way away from the optimum — in fact, it
is at (1.5266, 0.4742), which is just infeasible. This is the solution obtained with the
last few values of γ, and it is clearly incorrect. The reason is that with these values of
γ the solution is very close to the constraint boundary, where the logarithmic barrier
function is increasing extremely quickly, and as a result the optimization problem
becomes very ill-conditioned. The solution which is obtained then depends strongly
on the particular algorithm used; the solution shown in the figure was obtained us-
ing the very unsophisticated ‘direct-search’ approach implemented by MATLAB’s
Optimization Toolbox function fmins. The major reason why good interior point
algorithms are relatively complicated is that they take elaborate precautions to deal
with this ill-conditioning.
1
Other barrier functions are possible.
3.3. Solving QP Problems 109
2.5
1.5
0.5
−0.5
−0.5 0 0.5 1 1.5 2 2.5
At present the most effective interior-point algorithms are the so-called primal-dual
methods [Wri97]. These find solutions to convex optimization problems and their
dual problems simultaneously. Recall the KKT conditions (3.59)–(3.62) for the QP
problem. If the complementarity condition (3.62) is relaxed to
1
tT λ = >0 (3.84)
γ
then the equations (3.59), (3.60), (3.61), (3.84) define a central path which converges
to the optimal solution of the QP problem, and simultaneously of its dual, as γ → ∞.
The basic idea of primal-dual methods is to alternately take steps towards the central
path (γ fixed), and ‘parallel’ to the central path (γ increased). For both kinds of
step the search direction is found by solving an equation of the form
Φ HT ΩT ∆θ rφ
H 0 0 ∆ζ = rH (3.85)
Ω 0 Λ T −1 ∆λ rΩ
where Λ = diag{λi } and T = diag{ti }. The vector on the right-hand side of (3.85)
varies, depending on which kind of step is being performed, and on which particular
variant of primal-dual algorithms is being implemented. It will be seen that the
matrix on the left-hand side of this equation has the same form as the matrix which
110 3. Solving Predictive Control Problems
appears in (3.70). As in the active set method, the speed of solution is dominated
by the speed with which equation (3.85) can be solved. Therefore much the same
considerations apply as were discussed in the previous section. Once again, it is
advantageous to order the variables so that the matrix in (3.85) is banded. For
further details see [RWR98, Wri97] .
A serious problem which can occur with the predictive control problem as we have
formulated it so far, is that the optimiser may be faced with an infeasible problem.
This can happen because an unexpectedly large disturbance has occurred, so there
is really no way in which the plant can be kept within the specified constraints. Or
it can happen because the real plant behaves differently from the internal model;
the predictive controller may attribute differences between the plant and the model
behaviours to large disturbances, and if these keep growing then it can eventually
decide — erroneously — that it does not have enough control authority to keep the
plant within the constraints. There are many ways in which the predictive control
problem can become infeasible, and most of them are difficult to anticipate.
Because of this, it is essential to have a strategy for dealing with the possibility of
infeasibility. Standard algorithms for solving QP problems just give up, and output
a message such as ‘Infeasible problem’. Clearly this is unacceptable behaviour for
an on-line controller. Various possibilities exist, ranging from ad-hoc measures such
as outputting the same control signal as in the previous step, or (better) the control
signal computed as û(k + 2|k) in the previous step, to sophisticated strategies of
‘constraint management’, in which one tries to relax the least-important constraints
in an attempt to regain feasibility — see section 10.2.
One systematic strategy for dealing with infeasibility is to ‘soften’ the constraints.
That is, rather than regard the constraints as ‘hard’ boundaries which can never be
crossed, to allow them to be crossed occasionally, but only if really necessary.
A first way of doing this is to add a quadratic penalty for constraint violations
[OB94]. The optimization problem (3.43)–(3.44) is modified to
1
min θ T Φθ + φT θ + ρkk2 (3.86)
θ, 2
subject to
Ωθ ≤ ω +
(3.87)
≥0
Alternatives are to penalise the 1-norm (sum of violations) or the ∞-norm (maximum
violation) of the constraint violations:
X
1 T 1
min θ Φθ + φT θ + ρkk1 = min θ T Φθ + φT θ + ρ j (3.88)
θ, 2 θ, 2
j
subject to
Ωθ ≤ ω +
(3.89)
≥0
or
1 T 1 T
min θ Φθ + φT θ + ρkk∞ = min θ Φθ + φT θ + ρ max j
θ, 2 θ, 2 j
subject to
Ωθ ≤ ω +
≥0
subject to
Ωθ ≤ ω + 1
(3.91)
≥0
where is a scalar, and 1 is a vector, each element of which is 1. In this form only
one slack variable is introduced, which gives, in general, a much faster algorithm.
Penalising the 1-norm of constraint violations requires a separate slack variable for
every constraint, at every point of the prediction horizon for which the constraint is
enforced. The number of slack variables can (greatly) exceed the number of decision
variables in the original ‘hard-constrained’ problem. Both of these ‘soft’ optimization
problems are again equivalent to QP problems.
It can be shown that, with ρ large enough, using either the 1-norm or the ∞-
norm penalty on constraint violations gives an ‘exact penalty’ method, which means
that constraint violations will not occur unless there is no feasible solution to the
original ‘hard’ problem. That is, the same solution will be obtained as with a ‘hard’
formulation, if a feasible solution exists. The reason for this difference in behaviour
between these formulations and the quadratic penalty formulation is that, starting
from the true constrained solution θ ∗ , there exists a move to an infeasible solution
θ ∗ + εd, for some vector d, which gives a reduction in the cost function of o(ε). Since
the penalty for the violation is o(ε2 ) then the violation gives a smaller value of the
‘softened’ cost function (3.86), for small enough ε. But in the cost functions (3.88)
and (3.90) the penalty is also o(ε), so if the coefficient ρ is large enough then such
a move results in an increase in the cost function. ‘Large enough’ means ‘larger
than kd( 12 θ ∗T Φθ ∗ + φT θ ∗ )/dωk∞ at the optimal solution’; this can be related to the
Lagrange multipliers of the original ‘hard’ problem at the optimal solution — for
details see [Fle87]. Unfortunately, in the context of predictive control, the Lagrange
multipliers will depend on the current state, so it is not easy to decide just how large
ρ should be [OB94, SR96b] . A contribution towards solving this problem is made
in [KM00b]. In [SR96b] a mixture of linear and quadratic penalties on constraint
violations is proposed.
The following example shows that it can be difficult to predict the circumstances
in which infeasibility is encountered, and hence the virtual necessity of softening
constraints. In this example the infeasibility arises as a result of modelling error.
Example 3.2 Consider again the linearised Citation aircraft, as introduced in sec-
tion 2.7. In that section it has already been shown that some error in the model can
be tolerated without serious difficulty. But this is not always true. Suppose that the
gain from elevator to altitude rate is over-estimated by 20%, and that a constraint
is imposed on the altitude, in an attempt to ensure a very small overshoot. If the
altitude is to be increased by 400 m, as in figure 2.8, the constraint
is imposed for all k and i, and all other parameters are the same as in section 2.7,
figure 2.8, then the result is shown in figure 3.7. 13 seconds into the manoeuvre, the
predictive controller is faced with an infeasible problem, and stops working.
20 400
15
Altitude (m)
Pitch (deg)
300
10
200
5
100
0
−5 0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
15
30
Elevator angle (deg)
Altitude rate (m/sec)
10
20 5
0
10 −5
−10
0
−15
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
Figure 3.8 shows the results when the output constraints are softened, using a 1-
norm penalty function with weight ρ = 104 . Note that the pitch angle constraint
is violated briefly in the early part of the manoeuvre, although this did not happen
with hard output constraints — see figure 3.7; this suggests that the penalty func-
tion is not exact, despite the large value of ρ. Another notable feature is that the
altitude constraint of 405 m is not violated — in fact there is no overshoot, and
the altitude never exceeds 400 m. This may seem inconsistent with the fact that
the hard-constrained problem became infeasible after 13 seconds. The explanation is
that the figure shows the actual altitude of the aircraft, whereas the infeasibility arose
from the controller’s predictions of the altitude, which were based on an inaccurate
model. This phenomenon, of the controller predicting a constraint violation which
does not actually occur, is quite common. The converse phenomenon can be seen in
figure 2.11; there the altitude rate constraint is violated briefly, yet no infeasibility is
detected by the controller. Again, the explanation is that the controller’s predictions
were inaccurate and did not indicate an inevitable constraint violation.
20 400
15
Altitude (m)
Pitch (deg)
300
10
200
5
100
0
−5 0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
15
30
Elevator angle (deg)
Altitude rate (m/sec)
10
20 5
0
10 −5
−10
0
−15
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
Figure 3.8: Soft output constraints restore feasibility. 1-norm penalty with ρ = 104 .
decision variables, namely û(k + i|k) for i = 0, 1, 2, since Hu = 3 and there is only
one control input. When the output constraints are softened using a 1-norm penalty,
4 slack variables are introduced at each point in the prediction horizon — one for
each constraint: maximum pitch angle, minimum pitch angle, maximum altitude
rate, and maximum altitude. Since the constraints are enforced at each point of the
prediction horizon, which has length Hp = 10, there are 40 slack variables altogether.
So the total number of decision variables has increased from 3 to 43, as a result of
softening the constraints in this way. The average time required to solve and simulate
one step on a 333 MHz Pentium II processor was 0.81 sec. (Most of this time is
taken by the optimization, since simulation of a linear model is very fast.) Solving the
same problem using an ∞-norm penalty, again with ρ = 104 , gave virtually identical
results, but required only 0.15 sec per step. The average time required per step for
the hard-constrained problem was 0.04 sec.2 These solution times are summarised
in Table 3.2.
Table 3.2: Relative solution times for different formulations of altitude change ma-
noeuvre.
The next example illustrates this, and again shows the efficacy of softening con-
straints. It also shows that using inexact penalty functions can give a useful com-
promise between the harshness of constraints and the ‘sponginess’ of set-point spec-
ifications.
Example 3.3 In section 2.7, Figure 2.9, the response was shown to a disturbance of
5 m/sec in the altitude rate, arising from turbulence acting on the Citation aircraft.
If, however, the disturbance is slightly greater, 6 m/sec instead of 5 m/sec, then the
controller finds that it cannot return the altitude rate to below 30 m/sec within one
sample period — because of the elevator angle being limited to 15◦ — and infeasibility
occurs. Note that this is true even if the model is perfect.
If, however, the constraints are softened, then the disturbance can be dealt with.
Figure 3.9 shows the response when an ∞-norm penalty function is used with ρ =
5×105 . Such a large value of ρ is needed to get an exact penalty function in this case;
the peak value of all the Lagrange multipliers obtained during the simulation shown
in Figure 2.9 was approximately 4 × 105 . This response is very similar to that shown
in Figure 2.9; thus, although the manoeuvre can be completed successfully despite
the large disturbance, the disadvantage of a violent response to avoid violation of the
constraints is still present.
If, however, the penalty coefficient is reduced to ρ = 104 , so that the penalty function
is no longer exact, then the response shown in Figure 3.10 is obtained. The response
to the onset of the disturbance is now significantly less agressive than before, al-
though still more agressive than the response to the disappearance of the disturbance
5 seconds later. The inexactness of the penalty function reveals itself by the slight
violation of the altitude rate constraint before the disturbance occurs.
Using a 1-norm penalty function (instead of ∞-norm) gives very similar results for
this example, if the same values of the penalty coefficient ρ are used.
20
400
10
Altitude (m)
Pitch (deg)
300
0
200
−10
100
−20
0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
40 15
Elevator angle (deg)
Altitude rate (m/sec)
10
30
5
20 0
−5
10
−10
0 −15
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
effect. Furthermore, the solution that is produced is one which tries to minimise
the worst-case constraint violation, in the sense of minimising the peak value of the
violation.
20
400
10
Altitude (m)
Pitch (deg)
300
0
200
−10
100
−20
0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
30 10
5
20
0
−5
10
−10
0 −15
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)
Figure 3.10: Response to disturbance with softened altitude rate constraint, ρ = 104 .
3.5 Problems
(a) Use MATLAB’s Control System Toolbox to show that the corresponding
discrete-time model is
0 ≤ q ≤ 40 kW (3.97)
(You are advised to save any models created, and to keep a record of MATLAB
commands you use — using diary for example — as this swimming pool
example will reappear in later examples and problems. See Problems 1 and 6
of Chapter 5, Example 7.4, and Problem 6 of Chapter 7.)
4. If blocking is used, as in the Model Predictive Control Toolbox, how should the
details of equation (2.23) be changed? (Also see Problem 14 of Chapter 1.)
3.5. Problems 119
5. Suppose that the cost function used in the predictive control formulation was
changed to include the penalty term
u −1
HX
||û(k + i|k) − uref (k + i)||2S(i)
i=0
in addition to the terms penalising tracking errors and control moves, where
uref denotes some prescribed future trajectory for the plant inputs.
(a) Describe in detail the changes that would need to be made to the com-
putations of predictions and the optimal solution.
(b) Briefly list some reasons for and against making such a modification.
6. (a) If inequality (3.35) arises from the simple range constraints (3.38), show
that z takes the simple form
I 0 ··· 0
−I 0 · · · 0
I I ··· 0
−I −I · · · 0
.. .. ..
z= . . ... .
I I ··· 0
−I −I · · · 0
I I ··· I
−I −I · · · −I
What form does the vector on the right hand side of inequality (3.37)
take in this case? (Note that it is possible to reorder the inequalities so
that z takes the form of two lower-triangular matrices stacked on top of
each other in this case, each one being made up of identity matrices. This
is commonly done in the literature [PG88].)
(b) Put inequality (3.34) into the form W ∆U(k) ≤ w, where W is a matrix
and w is a vector. If (3.34) arises from simple rate constraints of the form
−B(k + i) ≤ ∆û(k + i|k) ≤ B(k + i), what form do W and w take?
7. If you look at the code for function smpccon in the MPC Toolbox (using type
smpccon), you will see how the weights are forced to be diagonal before solving
for the unconstrained gain matrix KM P C . Copy the function to your own
directory, change its name, and edit it so that you can specify arbitrary weights.
Then solve Example 6.1 and Problem 2 of Chapter 6 using your new function.
Simulate the designs using smpcsim.
8. Put the QP problem stated in Example 3.1 into the standard form (3.56)–
(3.58). Check that Φ ≥ 0, and hence that the problem is convex. Check that
the point (θ1 = 3/2, θ2 = 1/2) satisfies the KKT conditions (3.59)–(3.62), and
hence that it is the optimal solution, as claimed in the example.
120 3. Solving Predictive Control Problems
10. Check that the optimization problems (3.88)–(3.89) and (3.90)–(3.91) are stan-
dard QP problems.
11. Suppose that the gain from the elevator angle to the altitude rate of the Ci-
tation aircraft model is underestimated by 20%, rather than overestimated,
as in Example 3.2, but everything else is the same as in Example 3.2. Show
that infeasibility is not encountered in this case, but the response is relatively
oscillatory — as one would expect with conventional control if the plant gain
were higher than expected.
(The function mismatch2, available from this book’s web site, makes it easy to
run the simulation. Use parameter values: percent=-20 to simulate the 20%
gain undermodelling, and pencoeff=inf, normtype=’inf-norm’ to enforce
hard constraints.)
12. Verify that similar results to those shown in Example 3.3 are obtained if a
1-norm penalty function is used instead of an ∞-norm penalty function.
(The function disturb2, available from this book’s web site, makes it easy
to run the simulation. The parameter pencoeff corresponds to the penalty
coefficient ρ, and can either be a scalar (the same coefficient for each con-
straint violation) or a vector, one element corresponding to each constraint.
Set normtype=’1-norm’ to select the 1-norm penalty function.)
Chapter 4
The original formulations of predictive ccontrol, such as DMC [CR80, PG88], used
step or pulse response models instead of state-space models. Some commercial
products still use these representations. GPC [CMT87, Soe92] popularised the use
of transfer function, or difference equation, models in predictive control; these models
are the most widely-used in the academic literature of predictive control, and are
also used in some commercial products. This chapter shows the details of using
these models in predictive control. Wherever possible, everything is related to what
has already been done with state-space models.
The idea behind step-response models is that one can apply a step input to each input
(‘manipulated variable’ or actuator) of the plant, and record the open-loop response
of each output variable, until all the output variables have settled to constant values.
Because of the assumed linearity of the plant, knowing the (multivariable) step
response allows one to deduce the response to any other input signal (vector). This
is an easy and intuitive concept; however it does have some drawbacks:
• Estimating models from step responses gives a lot of emphasis to low fre-
121
122 4. Step Response and Transfer Function Formulations
quencies. For feedback control other frequencies are usually more important.
In particular, step response tests estimate steady-state gains very well. But
steady-state gains are relatively unimportant for feedback design — the feed-
back changes them anyway. (However, steady-state gains are important for
certain purposes, such as sizing actuators, and steady-state optimization.)
• Step response models are only adequate if all the controlled variables are mea-
sured outputs. (Otherwise one needs some other kind of model to predict how
the unmeasured outputs will behave.)
There are some myths about step-response models, particularly in the process in-
dustries, which are simply not true:
Mathematically, a more fundamental concept than the step response is the pulse
response. Suppose that the plant is at steady-state, with all inputs and outputs
initially at 0. We apply a unit pulse at time 0 on input j:
We can arrange a matrix which shows how each output responds to a unit pulse on
each input:
h11 (t) h12 (t) . . . h1m (t)
h21 (t) h22 (t) . . . h2m (t)
H(t) = .. .. .. .. (4.1)
. . . .
hp1 (t) hp2 (t) . . . hpm (t)
4.1. Step and Pulse Response Models 123
Now the response y(t) to an arbitrary input signal vector {u(0), u(1), . . . } is —
because of linearity — given by the convolution sum:
X
t
y(t) = H(t − k)u(k) (4.2)
k=0
(This is just the discrete-time equivalent of the convolution integral which occurs in
continuous-time linear systems theory.)
In principle, the sequence of pulse response matrices {H(0), H(1), . . . , H(N )} can
be obtained from pulse response tests. However it is very rarely practical to perform
such tests, because unacceptably large pulse amplitudes are usually needed in order
to excite the plant sufficiently to get useful results. The sequence must be long
enough so that H(N ) ≈ 0. If one really performed such a test, the initial steady-
state would not be at zero, and the sequence would really provide information about
the differences y(t) − y(−1) resulting from pulse inputs on u.
Now let us return to the concept of the step response of the plant. Consider a unit
step on input j: {uj (t)} = (1, 1, 1, . . . ). Using (4.2) the response of output i is:
X
t
yi (t) = hij (t − k)uj (k)
k=0
Xt
= hij (t − k)
k=0
X
t
= hij (k)
k=0
X
t
S(t) = H(k) (4.3)
k=0
This matrix (or perhaps the whole sequence (S(0), S(1), . . . ) — it is not clear) is
sometimes called the Dynamic Matrix of the plant, which gives rise to the name
Dynamic Matrix Control, or DMC. The sequence (S(0), S(1), . . . , S(N )) can be
used as a model of the plant, if N is sufficiently large that S(N + 1) ≈ S(N ).
Recall that in the standard formulation we use changes of the input ∆u(t) = u(t) −
u(t − 1), rather than the input itself. We can express the output which results from
an arbitrary input sequence by using the step response matrices and the changes of
124 4. Step Response and Transfer Function Formulations
the input, instead of pulse response matrices and the actual input as we did in (4.2):
X
t
y(t) = H(t − k)u(k) (4.4)
k=0
Xt X
k
= H(t − k) ∆u(i) (assuming u(0) = 0) (4.5)
k=0 i=0
X
t X
t−1
= H(k)∆u(0) + H(k)∆u(1) + . . . + H(0)∆u(t) (4.6)
k=0 k=0
Xt
= S(t − k)∆u(k) (4.7)
k=0
Notice the similarity in form of this expression and of (4.2). Again, in practice we
should replace y(t) by y(t) − y(−1).
It is clear from this sequence that the pulse response matrix sequence is given by
The matrix Cy Ak−1 B is called the k’th Markov parameter of the state-space model.
From this we immediately get the step response sequence, using (4.3), as
Looking back at equations (2.66) and (2.72), and at Problems 11 and 12 of Chapter
2 — and remembering that here we must assume that y = z — one can see that most
of the expressions appearing in the matrices required for computing the predictions
needed for predictive control in fact involve the step response matrices. In particular,
recalling (3.5):
and
S(Hw ) S(Hw − 1) ... 0
S(Hw + 1) S(Hw ) ... 0
.. .. .. ..
. . . .
Θ=
S(Hu ) S(Hu − 1) ... S(1)
(4.28)
S(Hu + 1) S(Hu ) ... S(2)
.. .. .. ..
. . . .
S(Hp ) S(Hp − 1) ... S(Hp − Hu + 1)
So we can immediately use the results from Chapter 2 for prediction, and those from
Chapter 3 for obtaining a solution, if we have a step response model of the plant.
Well, not quite immediately, because the predictions in Chapter 2 made use of the
state x(k). With a step response model we do not seem to have a state, so we need
to replace x(k) with something else. The state of a system summarises its ‘past
history’ — if you know x(k) you don’t need to know anything that happened before
time k in order to predict its future behaviour. But now we do not have a state
accessible, so it is reasonable to expect that we will have to use ‘old’ information,
about what happened to the system before time k — in principle we need to look
infinitely far back into the past.
In order to see what exactly we should do, it is easiest to start from first principles.
Given that the only model that we have of plant behaviour is the step response
(matrix) sequence {S(0), . . . , S(N )} (by assumption) — or, equivalently, the pulse
response sequence {H(0), . . . , H(N )}, and no disturbance model for the time being,
we can form predictions of future outputs, as:
∞
X
ẑ(k + j|k) = ŷ(k + j|k) = H(i)ũ(k + j − i) (4.29)
i=1
where the input sequence {ũ} consists of known inputs from the past and predicted
inputs in the future:
(
u(i) if i < k,
ũ(i) = (4.30)
û(i|k) if i ≥ k.
4.1. Step and Pulse Response Models 127
Now from equation (2.66) we had (using the relations derived in the previous sub-
section, and remembering that z = y in this section):
X
j
ẑ(k + j|k) = Cy Aj x(k) + S(j)u(k − 1) + S(i)∆û(k + j − i|k) (4.37)
i=1
The second and third terms are the same in both cases. So we see that the term
Cy AHw
..
Ψx(k) = . x(k) (4.38)
Cy A H p
which appears in the prediction when a state-space model is used must be replaced
by the term
S(Hw + 1) S(Hw + 2) · · · ··· ··· S(N − 1) S(N ) ∆u(k − 1)
S(Hw + 2) S(Hw + 3) · · · ··· ··· S(N ) S(N ) ∆u(k − 2)
.. .. .. .. .. .. .. ..
. . . . . . . .
S(Hp + 1) S(Hp + 2) · · · S(N ) ··· S(N ) S(N ) ∆u(k + Hw − N )
(4.39)
128 4. Step Response and Transfer Function Formulations
Not surprisingly, one must have N > Hp . In addition, one must store the last N −Hw
input moves (or input values). This gives a striking illustration of the ‘efficiency’ of
state-space models at representing the past history of a system.
A matrix such as this, with blocks along ‘anti-diagonals’ being the same, is called
a block-Hankel matrix. Such matrices appear frequently in systems theory, usually
when relating ‘past inputs’ to ‘future outputs’, as here.
The only disturbance model commonly used with step-response models is the ‘con-
stant output disturbance’ model that was treated in Section 2.3.2, and the distur-
bance is estimated using the ‘DMC scheme’ described there. The disturbance is
simply estimated as the difference between the measured and the predicted outputs:
ˆ
d(k|k) = y(k) − ŷ(k|k − 1), (4.40)
it is assumed that it will remain the same over the prediction horizon:
ˆ + j|k) = d(k|k)
d(k ˆ (4.41)
X
N
ẑ(k + j|k) = S(i)∆u(k + j − i) + S(j)u(k − 1) +
i=j+1
X
j
+ ˆ + j|k)
S(i)∆û(k + j − i|k) + d(k (4.42)
i=1
ˆ + j|k) = αj d(k|k)
d(k ˆ with 0 < α < 1 (4.43)
The main reason why a constant disturbance is commonly assumed is that this
leads to integral action in the controller, as we shall see later in the book. More
complicated disturbance models can be handled much more systematically when one
uses state-space or transfer function models.
There is really no good reason for working with step (or pulse) response models. If
one has such a model, one can easily obtain a state-space model which reproduces
the step response exactly, without losing anything. But this model will be of large
state dimension — N ×min(m, p) if the plant has m inputs, p outputs, and you want
to match N step response matrices. Usually it is possible to get an approximate
4.1. Step and Pulse Response Models 129
model of much lower state dimension, which matches the step response matrices
very closely. This subsection will describe one way in which this can be done.
First we start with a very simple method of getting state-space models, best de-
scribed by an example.
CB = c3 = 0
CAB = c2 = −1
CA2 B = c1 = 3
A state-space model for any single-input, single-output (‘SISO’) system can be ob-
tained from step response data in this way. Even for a multivariable system it is
possible to use this method for one input at a time, and then combine the 1-input
models. However for large N , and with more than one input and output, numerical
problems begin to arise. And models obtained in this form (the ‘controller form’)
tend to have numerical problems.
A better practical algorithm is the following. Recall from subsection 4.1.2 that the
pulse response matrices are related to the state-space matrices by
(
D (k = 0)
H(k) = k−1
CA B (k > 0)
130 4. Step Response and Transfer Function Formulations
That is, the block-Hankel matrix built up from the pulse response matrices factorises
into the product of the (extended) observability and controllability matrices. Since
each of these has rank n for a minimal state-space system of state dimension n, the
block-Hankel matrix must also have rank n.
Given a set of step response matrices S(0), . . . , S(N ), we obtain a corresponding set
of pulse response matrices H(0), . . . , H(N ), and assemble them into a block-Hankel
matrix, as shown in (4.44). The rank of this matrix will usually be large. But it is
usually ‘close’ to a matrix of much lower rank. The idea now is to approximate it by
a lower-rank matrix, factorise it into two low-rank matrices, and compute A, B, and
C from these. The essential tool for doing this is the Singular Value Decomposition
or SVD — see Minitutorial 4.
Suppose that the available pulse response matrices are assembled into an ‘anti-upper
triangular’ block-Hankel matrix as follows:
H(1) H(2) · · · H(N )
H(2) H(3) · · · 0
HN = .. .. .. .. (4.49)
. . . .
H(N ) 0 ··· 0
HN = U ΣV T . (4.50)
This has rank N × min(m, p). But the singular values usually approach zero very
quickly, so that HN is usually close to a matrix of lower rank. Somehow choose a
value n < N × min(m, p). This step is not rigorous, but for example one can choose
n such that σn < σ1 /100, or some similar (heuristic) criterion. It is sometimes
suggested that one should choose n such that there is a significant ‘gap’ between σn
and σn+1 , but with real data no such gap is usually evident. Let Σn be the result
of replacing σn+1 , σn+2 , . . . in Σ by zeros.
Now we have
Hn = U Σ n V T (4.51)
4.1. Step and Pulse Response Models 131
M = U ΣV T (4.46)
Mn = U Σn V T
M † = V Σ† U T (4.47)
kM xk
σ1 = sup (4.48)
x6=0 kxk
This is the origin of the importance of the SVD in robust control theory.
Mini-Tutorial 4: The Singular Value Decomposition
132 4. Step Response and Transfer Function Formulations
and
Γn = [In , 0]Σ1/2 T
n V . (4.53)
1/2 √
where Σn is the same as Σn , but with each σi replaced by σi . Note that Ωn has
n columns, Γn has n rows, and
Hn = Ω n Γn (4.54)
Now the idea is to find the A,B and C matrices of an n-state model, which have Ωn
and Γn as their observability and controllability matrices, respectively.
Finding B and C is easy: just take B as the first m columns of Γn , and take C
as the top p rows of Ωn . Finding A is almost as easy. Notice that if an (exact)
observability matrix Ω is ‘shifted upwards’ by p rows to form the matrix Ω↑ , then
Ω↑ = ΩA. So if we obtain Ω↑n from Ωn by shifting it upwards by p rows, then we
can estimate a suitable A by solving the equation
Ω↑n = Ωn A (4.55)
A = Σ−1/2
n U T U ↑ Σ1/2
n (4.56)
The algorithm described here is due to Kung [Kun78] and to Zeiger and McEwen
[ZM74]. It can be shown that if n is taken as the largest possible value, namely n =
N × min(m, p), then the state-space model obtained reproduces the pulse response
(and hence the step response) exactly, and all the eigenvalues of A are then at zero,
so that it is a ‘deadbeat’ or ‘finite impulse response’ model.
Example 4.2 Applying this method to the problem of Example 4.1, with n = N = 3,
gives
−0.7021 0.5117 −0.0405 1.0430
A = −0.5117 0.0023 0.4807 B = −1.2499
−0.0405 −0.4807 0.6998 0.6887
C = [1.0430, 1.2499, 0.6887] D=0
The reader can check that it reproduces the original step response exactly.
4.1. Step and Pulse Response Models 133
An interesting property of this algorithm is that, once one has a model for a given
value of n, it is possible to obtain the model for a smaller value, say q, by ‘truncating’
the matrices: Aq = An (1 : q, 1 : q), Bq = Bn (1 : q, :), and Cq = Cn (:, 1 : q), using
MATLAB notation. So the heavy computation involved in finding the SVD has to
be done only once, and a range of approximate linear realizations of various state
dimensions is then easily obtained. For more details of this, and the associated topic
of approximation by balanced truncation or balanced model reduction, see [Mac89,
ZDG96].
Example 4.3 Figure 4.1 shows the step responses of a high-fidelity, first-principles,
nonlinear simulation of a 3-input, 2-output distillation column. The solid curves
show the original responses, while the dotted curves show the approximate responses
achieved by a model obtained using the algorithm described above, with only 8 states.
Note that some of the responses have quite intricate shapes; yet a model with such a
low number of states was able to reproduce these quite accurately.
The original step response data was sampled at 10 second intervals, and 250 samples
were available (N = 250). A model of largest possible state dimension was first
obtained, namely one with min(2, 3) × 250 = 500 states. This matched the original
step responses exactly, as expected.
Figure 4.2 shows the first 15 singular values (of 500) of the block-Hankel matrix HN .
Assessing these ‘by eye’ indicates that about 8 states should be enough for a good
approximation. The 8-state model was obtained by following the algorithm described
above, with n = 8.
The data for this example is available in the DAISY database of data used for various
system identification exercises, which is available on the World-Wide Web1 . A brief
description of the data, and relevant references, are available in DAISY.
The state of the state-space model constructed above does not have any direct
physical interpretation. It is possible to otain state-space models from step reponses
in such a way that the elements of the state vector do have physical interpretations,
so long as one does not approximate the model by one with a smaller state vector.
For example, Lee et al give a way of constructing a state-space model in which the
state variables can be interpreted as future outputs [LMG94]. In [CC95, CC99]
an alternative is given, in which the state vector contains past values of the plant
outputs and control moves.
4
x 10
2.45 0.287
2.44
2.43 0.286
2.42
2.41 0.285
2.4
2.39 0.284
0 100 200 300 0 100 200 300
step response from u1 to y1 step response from u1 to y2
4
x 10
1.215 0.1435
1.21
0.143
1.205
0.1425
1.2
1.195 0.142
0 100 200 300 0 100 200 300
step response from u2 to y1 step response from u2 to y2
5
x 10
1.2 1.45
1.18
1.445
1.16
1.44
1.14
1.435
1.12
1.1 1.43
0 100 200 300 0 100 200 300
step response from u3 to y1 step response from u3 to y2
Figure 4.1: Step response of 3-input, 2-output distillation column. Solid curves:
original responses. Dotted curves: responses of 8-state model.
4.2. Transfer Function Models 135
160
140
120
100
80
60
40
20
0
0 2 4 6 8 10 12 14 16
Figure 4.2: The first 15 singular values of H250 for the example.
We will use z to denote both the ‘time advance’ operator and the complex variable
used with z-transforms. Since z −1 is the transfer function of a one-step time delay,
there is no inconsistency between writing w̄(z) = z −1 ȳ(z) as the z-transform of a
delayed version of the signal {y(k)}, and writing w(k) = z −1 y(k) to denote that
w(k) = y(k − 1). For most purposes the interpretation of z −1 as a time delay
operator will be the one required. (Many texts use q −1 to denote the time delay
operator, perhaps to emphasise this interpretation rather than the transform one.)
In the case of a single-input, single-output plant A(z −1 ) and B(z −1 ) are the poly-
nomials:
A(z −1 ) = 1 + a1 z −1 + · · · + an z −n (4.58)
−1 −1 −n
B(z ) = b 0 + b1 z + · · · + bn z (4.59)
The input-output delay d has been ‘pulled out’ of the polynomial B(z −1 ). This is
convenient, but not essential.
If we take z-transforms of the input and output sequences, then we obtain the
transfer-function description
B(z −1 ) B̃(z)
ȳ(z) = P (z)ū(z) = z −d ū(z) = z −d ū(z) (4.63)
A(z −1 ) Ã(z)
For multivariable systems, A(z −1 ) and B(z −1 ) are the polynomial matrices:
A(z −1 ) = Ip + A1 z −1 + · · · + An z −n (4.64)
B(z −1 ) = B0 + B1 z −1 + · · · + Bn z −n (4.65)
Note that pulling out the delay d is not very useful in the MIMO case, because
in general each input-output channel may have a different delay. However, setting
d = 1 represents the assumption that the input u(k) does not affect y(k) — the
model is ‘strictly proper’. These polynomial matrix and transfer function matrix
descriptions are much less useful and convenient than in the SISO case, although in
principle nearly everything can be carried over to the multivariable case. We will
therefore confine ourselves almost entirely to the SISO case in this Chapter.
4.2. Transfer Function Models 137
and hence
We can also move between transfer function models and step response or pulse
response models. In fact, the transfer function is defined as the z-transform of the
pulse response, so that:
∞
X
P (z) = z −k H(k) (4.75)
k=0
= H(0) + z −1 H(1) + z −2 H(2) + · · · (4.76)
= D + z −1 CB + z −2 CAB + · · · (4.77)
138 4. Step Response and Transfer Function Formulations
(where the last line applies if we have a state-space model). This means that, at
least in the SISO case, we can obtain the pulse response from the transfer function
by ‘long division’.
1 − 0.7z −1
P (z) = z −1 (4.78)
1 − 1.6z −1 + 0.6z −2
z − 0.7
= 2 (4.79)
z − 1.6z + 0.6
and so on.
We can also see from (4.75) that a finite pulse response corresponds to a transfer
function with all its poles at 0.
Example 4.5 If H(0) = 3, H(1) = −2, H(2) = 1, H(k) = 0 for k > 2, then
3z 2 − 2z + 1
P (z) = 3 − 2z −1 + 1z −2 =
z2
and we can use this as the basis for prediction, if d ≥ 1. (Recall that we assume
u(k) is not yet known when we predict ŷ(k + i|k).)
4.2. Transfer Function Models 139
or, in general,
X
n X
n
ŷ(k + i|k) = − aj ỹ(k − j) + bj ũ(k − d − j) (4.84)
j=1 j=0
or
where
(
u(`) if ` < k
ũ(`) = (4.86)
û(`|k) if ` ≥ k
and
(
y(`) if ` ≤ k
ỹ(`) = (4.87)
ŷ(`|k) if ` > k
(We referred to this earlier as ‘re-aligning’ the model — see sections 1.6 and 2.6.4.)
Since the prediction ŷ(k + i|k) depends on some other predicted outputs, which are
themselves obtained from measurements of past outputs, it is possible to find an
expression for ŷ(k + i|k) which depends only on the measured outputs y(k), y(k −
1), . . . (and of course, on actual past inputs and predicted future inputs). This
saves on computation, which is particularly important in applications to adaptive
control, where the predictors — as well as the predictions themselves — have to be
computed on-line. It also gives some insight into the way the predictor design affects
the predictive controller.
1 −1
−1 −i Fi (z )
= Ei (z ) + z (4.88)
A(z −1 ) A(z −1 )
or
Ei (z −1 )A(z −1 ) = 1 − z −i Fi (z −1 ) (4.89)
140 4. Step Response and Transfer Function Formulations
or
In this section we will assume that the plant has an unmeasured output disturbance,
which is modelled as some other signal passed through a filter with transfer function
C(z −1 )/D(z −1 ):
B(z −1 )
y(k) = z −d u(k) + d(k) (4.99)
A(z −1 )
C(z −1 )
d(k) = v(k) (4.100)
D(z −1 )
4.2. Transfer Function Models 141
where all the variables are either polynomials or polynomial matrices. We will
consider only the scalar case, when they are all polynomials, in which case these
two equations are the same. In these equations, A(z −1 ), B(z −1 ) and C(z −1 ) are
assumed to be known, while X(z −1 ) and Y (z −1 ) are unknown polynomials.
If X0 and Y0 is a pair of solutions of the Diophantine equation, then it is clear that
X = X0 − B2 P and Y = Y0 + A2 P is also a pair of solutions, if A2 and B2 are
polynomials such that B2 /A2 = B/A, and P is any polynomial. This follows since
So it is clear that the solution (pair) of a Diophantine equation is not unique. How-
ever, a solution in which either X or Y has the smallest possible degree is unique,
and can be obtained as follows. Find polynomials Q and Γ such that Y0 = A2 Q + Γ.
(This is itself a Diophantine equation, but simpler than the general one.) These
can be obtained by ‘long division’: Q is the quotient, and Γ the remainder, of the
division Y0 /A2 . The degree of Γ is necessarily smaller than the degree of A2 . Hence
we have Y = Y0 + A2 P = A2 (Q + P ) + Γ. Now take P = −Q to make the degree
of Y as small as possible. Then we have the unique solution pair X = X0 + B2 Q,
Y = Γ. Similarly, a solution pair in which either X or Y has a specified degree is
unique.
An important special case of Diophantine equations arises if C(z −1 ) = 1, in which
case the equation is also known as the Bezout identity. This has a solution if and
only if A and B are coprime — have no common factors. For suppose that they did
have a common factor D, so that A = P D and B = QD. Then the Bezout identity
would be D(P X + QY ) = 1, which is impossible unless D = 1. Because of this, the
Bezout identity plays a large role in the theory of feedback stability, and in system
theory.
When used for predicting stochastic processes we usually have B(z −1 ) = z −i when
finding an i-step-ahead prediction. Rewriting the Diophantine equation as
z −i C(z −1 )
Xi (z −1 ) + Y i (z −1
) = (4.95)
A(z −1 ) A(z −1 )
and imposing the requirement that Xi be of degree i − 1, shows that the coefficients
in Xi are the first i terms in the pulse response of the transfer function C/A. If
both A and C have degree n, then Yi must have degree n − 1. For more details see
[ÅW84]. There is an efficient recursive algorithm for computing the coefficients in
Xi and Yi for a sequence of values of i [Soe92].
Mini-Tutorial 5: Diophantine Equations
142 4. Step Response and Transfer Function Formulations
C(z −1 ) = 1 + c1 z −1 + . . . + cν z ν (4.101)
−1 −1 ν
D(z ) = 1 + d1 z + . . . + dν z (4.102)
Note that we can take both C(z −1 ) and D(z −1 ) to be monic (their leading coefficients
are 1), because the magnitude of v(k) can be adjusted to compensate for this if
necessary.
This model is general enough to allow both deterministic and stochastic disturbances
to be modelled, as well as mixtures of these. Deterministic disturbances are usually
modelled by taking C(z −1 ) = 1 (ci = 0) and making only the first few values of v(k)
non-zero.
where Ts is the sampling interval, and v(0) = v0 , v(1) = v1 . Then the z-transform
of d(k) is given by
¯ = v0 + v1 z −1
d(z) (4.106)
1 − 2 cos(ω0 Ts )z −1 + z −2
which is the z-transform of a signal of the form
d(k) = A cos(ω0 Ts k + φ) (4.107)
Note that since |C(e−jωTs )|2 = C(e−jωTs )C(e+jωTs ), it is always possible to choose
C(z −1 ) such that all its roots lie inside the unit disk — that is, without restricting
the spectral densities which can be modelled in this way. Also, for the same reason,
factors of z −j in C(z −1 ) do not affect the spectral density.
30
25
20
15
Singular Values (dB)
10
−5
−10
−15
−20
0.001 0.01 0.1 1 10
Frequency (rad/sec)
Figure 4.3: Spectral density of crew disturbance, modelled by (4.109) with ρ = 0.98.
with Ei0 (z −1 ) of degree at most i − 1, and Fi0 (z −1 ) of degree at most ν − 1. That is,
these polynomials solve the Diophantine equation
Note that in this case the first term on the right hand side is the polynomial C(z −1 ),
whereas in (4.89) it was 1. This difference arises because the plant input u is known,
whereas the disturbance v is not. Using (4.110) in (4.100) we get
0 (z −1 )
0
ˆ + i|k) = E (z ) + z −1 −i Fi
d(k v̂(k + i|k) (4.112)
i
D(z −1 )
F 0 (z −1 )
= Ei0 (z −1 )v̂(k + i|k) + i −1 v̂(k|k) (4.113)
D(z )
Now the difference from our previous use of the Diophantine equation is that al-
though we have split the prediction up into ‘future’ and ‘past’ terms, in this case we
do not know the ‘past’ process {v(k)}. This has to be estimated somehow.
B(z −1 ) C(z −1 )
y(k) = z −d u(k) + v(k) (4.114)
A(z −1 ) D(z −1 )
where ŷ(k) is the output prediction obtained by filtering the input u through the
model of the plant. Here we see the importance of ensuring that C(z −1 ) has all its
roots inside the unit disk — if it did not, this estimator would be unstable.
A(z −1 )C(z −1 )v̂(k|k) = A(z −1 )D(z −1 )y(k) − z −d B(z −1 )D(z −1 )u(k) (4.117)
This can be solved as a ‘re-aligned’ difference equation, with the interpretation that
z −i v̂(k|k) = v̂(k − i|k − i). (Which is not the only possible one — for example one
could use the interpretation z −i v̂(k|k) = v̂(k − i|k), using some ‘smoothed’ estimate
of v(k − i).) These two interpretations are not the same; different estimates are
4.2. Transfer Function Models 145
u(k) −1
z −d B(z )
A(z −1 )
+
v̂(k|k)
D(z −1 )
C(z −1 )
y(k) −
obtained. The interpretation shown in Figure 4.4 seems to be more ‘correct’, while
that of (4.117) seems more sensible, since more information is being used, because
past measurements y(k), y(k − 1), . . . are being used at time k, rather than y(k)
only. In practice the difference equation (re-aligned model) interpretation is the one
used, and that is what we shall assume.
B(z −1 ) Fi0 (z −1 )
ŷ(k + i|k) = z −d ũ(k + i) + E 0 −1
(z )v̂(k + i|k) + v̂(k|k) (4.118)
A(z −1 ) i
D(z −1 )
B(z −1 )
= z −d ũ(k + i) + Ei0 (z −1 )v̂(k + i|k) +
A(z −1 )
Fi0 (z −1 ) −d B(z )
−1
+ y(k) − z u(k) (4.119)
C(z −1 ) A(z −1 )
Before getting too alarmed at this expression, the reader should note that usually
some simplifications are introduced, as for example in the next subsection.
This prediction includes the term Ei0 (z −1 )v̂(k + i|k), which contains only predictions
of future values of v(k). The best way of making these predictions should depend
on the assumptions being made about the nature of the disturbance. However, it
is not sensible to assume that v(k) is a signal which is predictable in any way —
because if that was the case, then such a belief should already have been reflected
in the choice of the C and D polynomials. If we believe that the disturbance d(k)
is deterministic, then that usually corresponds to the belief that v(k) = 0, as we
saw in the earlier examples. In such a case the estimate v̂(k|k) serves as an ‘initial
condition’ (together with the previous one or two estimates, perhaps), but it is then
appropriate to assume that v̂(k + i|k) = 0 for i > 0.
On the other hand, if the disturbance is assumed to be stochastic, then one can
consider predicting v(k + i) in such a way as to optimise the prediction ŷ(k + i|k) in
some way. The usual choice at this point is to go for a minimum variance prediction.
The idea is to form the prediction in such a way that the variance of the error between
146 4. Step Response and Transfer Function Formulations
the predicted and the actual values, E{||y(k+i)− ŷ(k+i|k)||2 } is as small as possible.
But there is a theorem in probability theory which says that the minimum variance
prediction is obtained by choosing ŷ(k+i|k) = E{y(k+i)|k}, namely the conditional
mean value, the conditioning being on all the information available at time k. (See
[Mos95, ÅW84] for more details.) Now the conditional mean of a sum of terms is
the sum of the conditional means, so we should choose v̂(k + i) = E{v(k + i)|k}.
But in the stochastic case {v(k)} is assumed to be a zero-mean white-noise process,
so its conditional mean is the same as its unconditional mean, namely 0, so we set
v̂(k + i) = 0. Thus finally we have the minimum variance predictor:
B(z −1 )
ŷ(k + i|k) = z −d ũ(k + i) +
A(z −1 )
Fi0 (z −1 ) −1
−d B(z )
+ y(k) − z u(k) (4.120)
C(z −1 ) A(z −1 )
For the purpose of solving the predictive control problem, it is necessary to separate
out the ‘free response’ part of this — the predicted response which would occur if
∆û(k + i|k) = 0 — from the ‘forced response’, namely that part which depends on
∆û(k + i|k). In other words, it is necessary to separate out the part which depends
on the past from that which depends on future inputs. This can be done by solving
another Diophantine equation.
Since the only signal which crosses over the ‘past-future’ boundary in the prediction
(4.120) is ũ, and that is filtered by the transfer function z −d B/A, we need to extract
the first i − d + 1 terms of the pulse response of B/A when finding ŷ(k + i|k). (Only
i−d+1 because the signal is delayed by d steps, so we do not need to consider inputs
which occur later than k + i − d. Our ‘past-future’ boundary is between k − 1 and
k.) Thus we need to find the solution pair (Ei (z −1 ), Fi (z −1 )) of the Diophantine
equation
B(z −1 ) −1
−1
−(i−d) Fi (z )
= Ei (z ) + z (4.121)
A(z −1 ) A(z −1 )
with the degree of Ei no bigger than i − d. (Note that this is not quite the same as
4.2. Transfer Function Models 147
Note that using the minimum variance predictions does not necessarily lead to a
minimum mean value of the cost function (2.9), in the stochastic case. But that
is what is generally done; as in the state-space case, this is in general a heuristic
application of the ‘separation’ or ‘certainty equivalence’ principle.
so
Solution of (4.121):
E1 = 0.5, F1 = 0.45
Note that although a transfer function description of the plant is being used, diffi-
culties will arise if the stochastic interpretation is adopted for the disturbance and
the plant is unstable. Even with a stable plant, the disturbance is not stationary
if this model is used, because D(z −1 ) has a root at 1 — this implies that, even if
v(k) is white noise, the disturbance d(k) will be a ‘random walk’. A justification
for this choice of disturbance model is provided by the following, non-stochastic,
argument. If disturbances enter ‘inside’ the plant, rather than at its output — think
of disturbances entering the state equations, if we had any — then they will appear
at the output of the plant as if they had been filtered through a transfer function
of the form C(z −1 )/A(z −1 ). Since most realistic disturbances do in fact arise in
this way, it seems reasonable to include A(z −1 ) as a factor of D(z −1 ). Including the
factor (1 − z −1 ) in D(z −1 ) allows constant disturbances to be represented, which is a
rather common and important case. Furthermore, allowing v(k) to consist of pulses
occurring at random times leads to a disturbance which is piecewise-constant and
jumps at random times. This is often a realistic representation of phenomena such as
load disturbances in a plant — for example, a sudden increase in load torque, which
reduces the effective torque available from a controller. Also, and very importantly,
including the factor (1 − z −1 ) leads to the controller having ‘integral action’. One
could make the disturbance model more elaborate, but using (4.125) leads to some
nice interpretations and keeps things relatively simple.
Returning to (4.117), substituting (4.100), and cancelling A(z −1 ) from each term
gives
and using the notation ∆y(k) = (1 − z −1 )y(k) — analogously to our use of ∆u(k)
— gives
from which v̂(k|k) is computed. Then the ‘minimum variance’ output prediction is
obtained as
B(z −1 ) C(z −1 )
ŷ(k + i|k) = z −d ũ(k + i) + v̂(k + i|k) (4.128)
A(z −1 ) A(z −1 )(1 − z −1 )
B(z −1 ) Fi0 (z −1 )
= z −d ũ(k + i) + v̂(k|k) (4.129)
A(z −1 ) A(z −1 )(1 − z −1 )
where we have put v̂(k + i|k) = 0 for i > 0 to get the second equality. Substituting
in for v̂(k|k) from (4.127) gives the same equation as (4.120).
Recall that in Chapter 2 we had the following equation, which describes the evolution
of the estimated state in an observer:
¯
x̂(z) = [zI − (A − LCy )]−1 [Lȳ(z) + B û(z)]
¯ (4.131)
All further predictions are based on x̂(k+1|k) — for example, x̂(k+i|k) = Ai−1 x̂(k+
1|k) + . . . . So we see that the output measurements y(k) get filtered by [zI − (A −
LCy )]−1 L before being used to generate predictions. But in the transfer function
approach we can see, for example from equation (4.120) or (4.124), that the output
measurements get filtered by 1/C(z −1 ) before being used to generate predictions.
Recalling that the inverse of a matrix is given by the formula X −1 = adjX/ det X,
we see that we have the following correspondence between the state-space and the
transfer function formulations:
(Recall that factors of powers of z in C(z −1 ) have no effect on the spectral density
of the disturbance.)
• Using the state-space formulation we can augment the model with additional
states to represent the effects of disturbances. The dynamics of these states
correspond to the polynomial D(z −1 ) in the transfer function formulation, and
we can choose the observer gain L such that the observer dynamics match any
desired numerator polynomial C(z −1 ).
• When dealing with one signal at a a time, it is often easier to think in terms of
transfer functions than in terms of state-space models. Even in multivariable
systems, it is often enough to think of disturbances on each output being
independent of each other. In such cases some designers seem to find it easier
to think in terms of ‘C(z −1 ) and D(z −1 )’, but to compute and implement using
state-space methods.
Example 4.10 Returning to the crew disturbance example (Example 4.8), there we
had
where
0 1 0
Ad = Bd = Cd = [−1, 1]
−ρ2 2ρ cos(ω0 Ts ) 1
(This actually gives C(z −1 ) = z −1 (1 − z −1 ).) We can combine this with a plant
model
as follows:
xp (k + 1) Ap 0 xp (k) Bp 0
= + u(k) + v(k) (4.133)
xd (k + 1) 0 Ad xd (k) 0 Bd
xp (k)
y(k) = [Cp , Cd ] (4.134)
xd (k)
Partitioning the observer gain matrix as L = [LTp , LTd ]T , the complete observer gain
matrix becomes
Ap − Lp Cy −Lp Cd
A − LC = (4.135)
−Ld Cy Ad − Ld Cd
4.2. Transfer Function Models 151
Assuming the plant is stable, a possible choice is Lp = 0 — that is, leave the open-
loop plant dynamics as part of the observer dynamics, in which case we get
Ap 0
A − LC = (4.136)
−Ld Cy Ad − Ld Cd
and we can choose Ld to get any eigenvalues we like for Ad −Ld Cd , providing that the
pair (Ad , Cd ) is observable. It is easy to see that we can place the eigenvalues of Ad −
Ld Cd at 1 and 0 — the roots of z −1 C(z −1 ) — by choosing Ld = [1, 2ρ cos(ω0 Ts )]T
for the crew disturbance example, because in this case we have
1 0
Ad − Ld Cd =
−ρ2 + 2ρ cos(ω0 Ts ) 0
Why did we set Lp = 0? Because if the transfer function model is written in the
common-denominator form
z −d D(z −1 )B(z −1 )u(k) + A(z −1 )C(z −1 )v(k)
y(k) =
A(z −1 )D(z −1 )
then it is clear that the open-loop plant pole polynomial should be included in the
observer dynamics.
This shows how we can recover the disturbance model using the state-space formula-
tion. It also shows, however, that there is more design freedom with the state-space
formulation. For example, there is no need to choose Lp = 0; other choices are
possible. In particular, with the state-space formulation it is possible to choose the
observer dynamics independently of the numerator polynomial of the disturbance
model. Whether this additional freedom is actually useful for the designer is debat-
able. If one has a physically based disturbance model, such as one for crew motions,
then it probably is useful, because C(z −1 ) represents known physical characteristics.
This is particularly true if one also has a statistical description of measurement noise,
because then the observer gain matrix L can be chosen optimally, using Kalman filter
theory.
There is another connection that can be made between the transfer function and
state-space formulations, through Kalman filter theory. It is known that whatever
combination of state and output noises act on a plant, a disturbance with the same
spectral density at the output can be obtained from the model
from which we make the association z ν D(z −1 ) → det(zI − Ad ), and we see that
C(z −1 ) is the polynomial whose roots are the same as the roots of det[Cd (zI −
Ad )−1 Ld +I]. In the single-output case this is just the polynomial [Cd (zI−Ad )−1 Ld +
1] det(zI − Ad ). This seems to be different from the association obtained in (4.132)
above. But, using the matrix inversion lemma2 it can be shown that
[zI − (Ad − Ld Cd )]−1 = (zI − Ad )−1 [Ld Cd (zI − Ad )−1 + I]−1 (4.140)
[zI − (Ad − Ld Cd )]−1 Ld = (zI − Ad )−1 Ld [Cd (zI − Ad )−1 Ld + I]−1 (4.141)
The denominators on the two sides of the equation are det[zI − (Ad − Ld Cd )] on
the left, and det[Cd (zI − Ad )−1 Ld + I] on the right (det(zI − Ad ) cancels on the
right with the numerator). Thus we see that there is no contradiction in the two
associations we have made for C(z −1 ).
There are usually several ways of modelling a disturbance in the state space formula-
tion, which are all equivalent to a single output disturbance. If the GPC disturbance
model is adopted (D(z −1 ) = (1 − z −1 )A(z −1 )), most of its dynamics are shared with
those of the plant. It is only necessary to add m states, therefore, (where m is the
number of outputs) in order to model the additional disturbance poles at +1:
We will now show how a state-space model and observer can be defined which
correspond precisely to the GPC model, and to the use of a ‘re-aligned’ model.
That is, we shall extend the development of section 2.6.4 to the case when there is
a disturbance which is modelled as in GPC. Using similar notation to that used in
equation (4.127) we can write the GPC model in the form
(where we assume d = 1). Assume that the polynomial matrices A(z −1 ), B(z −1 ), C(z −1 )
— we can do everything for the multivariable case here — are given by
A(z −1 ) = I − A1 z −1 − · · · − An z −n (4.146)
−1 −1 −p
B(z ) = B1 z + · · · + Bp z (4.147)
−1 −1 −2 −q
C(z ) = Iz + C2 z + · · · + Cq z (4.148)
Notice that we can take the leading coefficient matrices of A(z −1 ) and C(z −1 ) to
be the identity I, without loss of generality. The model can be written in difference
2
(W + XY Z)−1 = W −1 − W −1 X(ZW −1 X + Y −1 )−1 ZW −1 .
In this case we apply it with W = (zI − Ad ), X = Ld , Y = I, Z = Cd .
4.2. Transfer Function Models 153
equation form as
x(k) = [y(k)T , y(k − 1)T , . . . , y(k − n)T , u(k − 1)T , . . . , u(k − p)T ,
v(k − 1)T , . . . , v(k − q + 1)T ]T (4.150)
then (4.149) is equivalent to the (non-minimal) state-space model
x(k + 1) = Ax(k) + Bu u(k) + Bv v(k) (4.151)
y(k) = Cx(k) (4.152)
where
A11 A12 A13
A = 0 A22 0 (4.153)
0 0 A33
and the sub-matrices are given by:
I + A1 A2 − A1 · · · An − An−1 −An
I 0 ··· 0 0
A11 = .. .. .. .. .. (4.154)
. . . . .
0 0 ··· I 0
B2 − B1 · · · Bp − Bp−1 −Bp
0 ··· 0 0
A12 = .. .. .. .. (4.155)
. . . .
0 ··· 0 0
C2 · · · Cq
0 ··· 0
A13 = .. .. .. (4.156)
. . .
0 ··· 0
0 0 ··· 0 0
I 0 ··· 0 0
A22 = .. .. .. .. .. (4.157)
. . . . .
0 0 ··· I 0
| {z }
p blocks
0 0 ··· 0 0
I 0 ··· 0 0
A33 = .. .. .. .. .. (4.158)
. . . . .
0 0 ··· I 0
| {z }
q−1 blocks
154 4. Step Response and Transfer Function Formulations
Bu = [B1T , 0, . . . , 0 , I, 0, . . . , 0 , 0, . . . , 0 ]T (4.159)
| {z } | {z } | {z }
n blocks p−1 blocks q−1 blocks
and
Bv = [C1T , 0, . . . , 0 , 0, . . . , 0, I, 0, . . . , 0 ]T (4.160)
| {z } | {z } | {z }
n blocks p blocks q−2 blocks
C = [I, 0, . . . , 0] (4.161)
Ax∞ = x∞ (4.163)
which shows that any x∞ of this form is an eigenvector of A, with eigenvalue +1.
This is another way of saying that any set of constant outputs is an equilibrium
point for this system, when the inputs and disturbances are all zero.
The first identity matrix in L0 gives ŷ(k|k) = y(k). As in section 2.6.4, the structure
of A and Bu then ensures that the top n + p + 1 elements of x̂(k|k) contain measured
outputs and inputs after max(n + 1, p) steps of running the observer. The second
identity matrix in L0 gives the disturbance estimate v̂(k|k) = y(k)− ŷ(k|k−1), where,
as usual, ŷ(k|k−1) = C x̂(k|k−1), and x̂(k|k−1) = Ax̂(k−1|k−1)+Bu u(k−1). This
is a reasonable estimate of the disturbance, given the model. Is this observer stable?
In section 2.6.4, with no disturbances, we found that the observer was deadbeat,
with all the eigenvalues of A − LC = A(I − L0 C) being zero. The situation now is a
little more complicated. The matrix A − LC = A(I − L0 C) is the same as the matrix
A, except that the first block column (that is, the first m columns, where m is the
number of outputs) is replaced by
This matrix has its eigenvalues at zero, and at the roots of the polynomial C(z −1 ).
The observer is therefore stable, providing that C(z −1 ) has all of its roots inside
the unit disk. Recall that this is the same as the condition that was required when
estimating the disturbance from equation (4.116). The zero eigenvalues reflect the
fact that those elments of the state vector which correspond to past values of inputs
and outputs are estimated exactly after a finite number of steps.
Note that, as in section 2.6.4, this observer can be used even with unstable plants.
For further examples of state-space interpretations of the GPC model, see [OC93].
Note on use of Model Predictive Control Toolbox. The Model Predictive Control
Toolbox uses the alternative state-space representation (2.37), with the assumption
that y and z are the same (which is also assumed by GPC). The observer gain that
must be supplied to Model Predictive Control Toolbox functions must be compatible
with this choice of state vector. In this case using the observer gain
0
0 L
L = (4.166)
I
where L0 is given by (4.164), gives the GPC model — see Problem 11. L0 is the
matrix that must be supplied as the argument Kest in Model Predictive Control
Toolbox functions such as scmpc.
Example 4.11 Consider the unstable helicopter of Example 1.8. We saw in Chap-
ter 1 that the simple ‘DMC’ disturbance model is not adequate to give offset-free
tracking when the plant is unstable, because an independent model cannot be used
— see Problem 11 of Chapter 1. In order to overcome this problem the GPC model
(4.145) can be used.
With a sampling interval of 0.6 sec, the discrete-time transfer function of the heli-
copter is
6.472z 2 − 2.476z + 7.794
(4.167)
z 3 − 2.769z 2 + 2.565z − 0.7773
Dividing the numerator and denominator by z −3 gives
A(z −1 ) = 1 − 2.769z −1 + 2.565z −2 − 0.7773z −3 (4.168)
−1 −1 −2 −3
B(z ) = 6.472z − 2.476z + 7.794z (4.169)
so that n = p = 3. We need to choose the polynomial C(z −1 ), ensuring that its roots
are inside the unit disk. Let us choose the polynomial (q = 2)
C(z −1 ) = z −1 − 0.8z −2 = z −1 (1 − 0.8z −1 ) (4.170)
which has one root at z = 0.8 — see section 7.4.2 for some motivation for this
choice. Choosing the state vector as in (4.150) gives
x(k) = [y(k), y(k − 1), y(k − 2), u(k − 1), u(k − 2), v(k − 1)]T (4.171)
156 4. Step Response and Transfer Function Formulations
and
1 + A1 A2 − A1 A3 − A2 −A3 B2 − B1 B3 − B2 −B3 C2
1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0
A =
0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0
0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0
−1.769 5.334 −3.3423 0.7773 −8.948 10.27 −7.794 −0.8
1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0
=
0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0
0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0
Bu = [6.472, 0, 0, 0, 1, 0, 0, 0]
T
Bv = [−0.8, 0, 0, 0, 0, 0, 0, 1]T
Choosing the observer gain matrix L0 as in (4.164), namely
L0 = [1, 0, 0, 0, 0, 0, 0, 1]T (4.172)
gives the observer state-transition matrix
0.8 5.334 −3.3423 0.7773 −8.948 10.27 −7.794 −0.8
0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0
A − LC = 0
0 0 0 0 0 0 0
0 0 0 0 1 0 0 0
0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0
(4.173)
which has, as expected, 7 eigenvalues at 0 and one at 0.8.
The solid lines in Figure 4.5 show the response when GPC is applied, without con-
straints, with Hp = 5, Hu = 2, Q = 1, and R = 0, assuming a perfect model. The
set-point is s(k) = 1. The plant and internal model both have zero initial state, and
there are no disturbances for the first 10 seconds. Then an unmeasured step distur-
bance of -0.1 is added to the input. It can be seen that, after a transient lasting about
10 seconds, the output returns to its set-point. The input increases to compensate
for the disturbance.
The dashed lines in Figure 4.5 show the response when a deadbeat observer is used —
namely, when the observer pole is placed at z = 0 instead of z = 0.8. It is seen that
4.2. Transfer Function Models 157
1.4
1.2
1
Output
0.8
0.6
0.4
0.2
0
0 5 10 15 20 25 30
Time (seconds)
0.4
0.3
Input
0.2
0.1
0
0 5 10 15 20 25 30
Time (seconds)
the peak error from the set-point is reduced, compared with the previous response,
but the control actions are more agressive, and the transient is not finished any more
quickly. Note that the two responses are identical for the first 10 seconds. This is
because in this idealised situation the state of the internal model tracks the state of
the plant exactly, and hence the observer has no effect, until the disturbance occurs.
Since everything that can be done with a transfer function formulation of predictive
control can also be done with a state-space formulation, and more, there seems to be
no reason for using transfer functions. This is particularly true for the multivariable
case. In the SISO case there are at least some nice interpretations which are not seen
so clearly with state-space models. But this is no longer true in the multivariable
case.
It is sometimes claimed that the transfer function formulation is more suitable for
adaptive applications. This claim does not appear to have been justified in detail.
Plant parameter estimation is no more difficult for state-space models than it is for
general transfer function models — in the SISO case it is equally difficult, whereas
in the multivariable case it is probably easier with state-space models — see [CM97],
158 4. Step Response and Transfer Function Formulations
4.3 Problems
1. Suppose you are given the sequence of step response matrices S(0), S(1), . . . , S(N )
for a plant. Show how to obtain the sequence of pulse response matrices
H(0), H(1), . . . . What is the last one you can obtain?
2. (a) Write a MATLAB function ss2step which computes the step response
matrices S(M ), S(M + 1), . . . , S(N ) of a state-space model, and stores
them in a three- dimensional array, so that Sij (t) is stored in S(i,j,t).
It should have the interface specification:
S = ss2step(A,B,C,D,M,N)
(b) Write MATLAB functions step2ups and step2the for computing the
matrices Υ (‘upsilon’) and Θ (‘theta’) from the step response sequence.
The input data should be the three- dimensional array created in part
(a), holding S(1), . . . , S(N ), where N ≥ Hp . Hw , Hp and Hu should be
input arguments. The interface specifications should be:
upsilon = step2ups(S,Hw,Hp)
theta = step2the(S,Hw,Hp,Hu)
4. A 2-input, 1-output system has the step response sequence S(0) = [0, 0],
S(1) = [0, 2], S(2) = [1, 3], S(k) = S(2) for k > 2. Find a state-space model
which reproduces this step response exactly. Note: You need 4 states.
5. Show that, as an alternative to equation (4.55), one could estimate A from the
equation
Γ←
n = AΓn
6. Solve the two Diophantine equations (4.110) and (4.121) for Example 4.9, for
the case when the 2-step-ahead predictor is required.
Show that the transfer functions from the vector w(k) to the output y(k) all
have the same denominator as the transfer function from the input u(k) to
y(k). (You may prefer to do this for a specific 2 or 3-state example rather
than in general.)
9. Verify that the model (4.142) – (4.144) corresponds to the GPC disturbance
model.
10. Verify that the state-space model (4.151)–(4.160) corresponds to the difference
equation (4.149).
11. Verify that the observer gain L0 given by (4.166) corresponds to the GPC
model when the state vector is chosen as
ξ(k) = [∆x(k)T , η(k)T ]T (4.176)
(that is, as in the Model Predictive Control Toolbox) and when the ‘A’ and ‘C’
matrices of the state-space model are chosen to be
A 0
and 0 I (4.177)
CA I
by taking the following steps:
First observe that if
x̂(k|k) = (I − L0 C)x̂(k|k − 1) + L0 y(k)
then
∆x̂(k|k) = (I − L0 C)∆x̂(k|k − 1) + L0 [y(k) − y(k − 1)] (4.178)
Then show that use of the observer gain
0 L∆x
L =
Lη
gives η̂(k|k) = y(k) if Lη = I and hence that
∆x̂(k|k) = (I − L∆x C)∆x̂(k|k − 1) + L∆x [y(k) − y(k − 1)] (4.179)
from which the result follows.
12. Use the Model Predictive Control Toolbox function scmpc to reproduce the re-
sults shown in Figure 4.5 for Example 4.11. (The input disturbance used to
generate the figure changed from 0 to -0.1 in 3 increments: du (k) = (−0.03, −0.07, −0.1)
for k = 17, 18, 19 — recall that k counts time increments, and the sampling
interval is 0.6 second. This is obtained by passing the following argument wu
to function scmpc: wu=[zeros(16,1);-0.03;-0.07;-0.1]. Also note that
the observer gain argument Kest must be passed to the function scmpc in the
form shown in (4.166).)
Investigate the responses obtained for other values of the observer pole, such
as 0.3 and 0.99.
Chapter 5
Other Formulations of
Predictive Control
It is frequently the case that the effects of some disturbances can be anticipated,
and approximately cancelled out by suitable control actions. When this is done it is
called feedforward control. It can be more effective than feedback control, because
the latter has to wait until the effect of the disturbance becomes apparent, before
taking corrective action. In order to anticipate the effect of the disturbance, it is
necessary to have some measurement which indicates that it is on its way. Examples
of measured disturbances which can be corrected in this way are:
161
162 5. Other Formulations of Predictive Control
Measured
disturbance dm (k)
CONTROLLER
− +
r(k) + u(k) + y(k)
C(z) P1 (z) P2 (z)
Set−point +
−
Conceptually, the control structure can be visualised as shown in Figure 5.1. The
plant is shown as a linear model, which is split up into several blocks, to allow for
the fact that often the control inputs and the disturbances pass through common
dynamics — in this case the transfer function matrix P2 (z). The measured distur-
bances are shown as passing first through the transfer function matrix Pd (z). Thus
their effect could be completely cancelled by adding the signal −P1 (z)−1 Pd (z)d(z)¯
to the control input. This is shown in the figure, except that the notation P̂1 (z) and
P̂d (z) is used, to emphasis that the transfer functions are never known exactly, and
that it is usually impossible to realise inverses exactly — P1 (z) may not even be a
square matrix, so it may be impossible to find an inverse even in principle.
Feedforward is easily incorporated into predictive control. All that has to be done
is to include the effects of the measured disturbances in the predictions of future
outputs. The optimiser will then take these into account when computing the control
signal. Looking back to Chapter 3, it will be seen that the only change that is
required is to include the effects of the measured disturbances in the vector Z(k) of
predicted outputs.
We shall modify the model (2.1)–(2.3) to include the measured disturbance vector
dm (k):
Plant Model With Measured Disturbance:
where we assume that the disturbance has no effect on the outputs until some time
after it has been measured.
Example 5.1 Suppose that the transfer functions P1 (z), P2 (z) and Pd (z), which
5.1. Measured Disturbances and Feedforward 163
The state estimate x̂(k|k) is still given by (2.81) — with L0 designed using the model
(5.1)–(5.3) of course — but (2.82) has to be replaced by
where
dm (k)
ˆ
dm (k + 1|k)
Dm (k) = .. (5.8)
.
dˆm (k + Hp − 1|k)
and
C z Bd 0 ··· 0
Cz ABd Cz Bd ··· 0
Ξ= .. .. .. .. (5.9)
. . . .
Cz AHp −1 Bd Cz AHp −2 Bd · · · C z Bd
The matrices Ψ, Υ and Θ remain unchanged. We have assumed here that the
measurement dm (k) is made at the same time as the measurement y(k), and can be
used for the calculation of u(k).
The output predictions will clearly be influenced by what one assumes about the fu-
ture behaviour of the measured disturbance, as represented by dˆm (k+1|k), . . . , dˆm (k+
Hp − 1|k). Common practice is to assume that it will remain constant at the last
measured value, namely dm (k) = dˆm (k + 1|k) = . . . = dˆm (k + Hp − 1|k). (This is
the assumption made by the Model Predictive Control Toolbox, for instance.) Other
164 5. Other Formulations of Predictive Control
The only remaining change required is to redefine the ‘tracking error’ E(k) — see
(3.33) — as
Once this change has been made, the optimal solutions in the unconstrained and
constrained cases can be found as detailed in Chapter 3.
So far we have always computed predictions on the assumption that the plant is
running ‘open-loop’, and we have computed the control signals as changes from a
‘do-nothing’ policy. Furthermore, we have assumed that after the end of the control
horizon the input signal will remain constant. But this is not the only possibility.
Suppose that we assume that the ‘do-nothing’ policy will be to apply the linear
state-feedback control
for the indefinite future. And of course we will assume that the state-feedback gain
K is one which stabilises the linear model, namely that all the eigenvalues of A−BK
lie inside the unit disk. Then the ‘do-nothing’ predictions are formed as follows:
Now we can use optimization over a control horizon Hu to modify these baseline
‘do-nothing’ predictions, so as to minimise our cost function, and to ensure that the
5.2. Stabilised Predictions 165
predicted behaviour stays within the constraints. This means that the prediction of
the future input value û(k + i|k) will no longer be given by −K x̂(k + i|k), but by
The important point here is that instead of high powers of A, which we had in the
expressions for the ‘open-loop’ predictions in Chapter 2, here we have high powers
of A − BK. And because K is chosen to be stabilising, we have (A − BK)i → 0 as
i → ∞, so the likelihood of numerical problems due to finite-precision arithmetic is
greatly reduced.
In this formulation the ‘decision variables’ of the optimization problem are the q(i)’s,
in place of the old ∆û(k+i)’s. We need to check whether we still have a QP problem.
Equation (5.15) shows that the predicted plant input û(k + i|k) is related linearly
to q(i). (x̂(k + i|k) is related linearly to q(j), j < i.) And clearly
∆û(k + i|k) = [−K x̂(k + i|k) + q(i)] − [−K x̂(k + i − 1|k) + q(i − 1)]
= −K∆x̂(k + i|k) + ∆q(i) (5.21)
This makes it clear that the ∆q(i)’s, and hence the q(i)’s themselves, are linearly
related to the ∆û(k + i|k)’s. So the linear inequalities in the variables ∆û(k + i|k)
remain as linear inequalities in the variables q(i). So we still have a QP problem to
solve.
The use of stabilised predictions was first introduced in [KR92, RK93]. The emphasis
in these papers was on the use of feedback to obtain deadbeat, or finite impulse
response FIR, behaviour prior to the use of optimization, as a stratagem to prove
closed-loop stability — see section 6.2. The numerical benefits for prediction were
noticed later [RRK98]. In [MR93b, MR93a, RM93, SR96b]a parametrisation of the
form u(k) = −K x̂(k|k) was assumed after the end of the control horizon, and was
166 5. Other Formulations of Predictive Control
The remaining question is, which stabilising state-feedback gain K should be used?
In principle there are many possibilities to choose from, obtained for example by
pole-placement techniques. But in practice, with state dimensions bigger than about
5, it is very difficult to get pole-placement to work (because of the difficulty of
knowing what closed-loop pole locations are reasonably attainable), and the only
practical alternatives are to obtain K by solving a ‘Linear Quadratic’, or possibly an
‘H∞ ’ problem. In the context of predictive control with a quadratic cost function, the
natural choice is to obtain K as the solution to the infinite-horizon linear quadratic
problem, with the same cost function as that used in the formulation of the predictive
control problem. One proposal for obtaining ‘robust’ predictive control is to make
K the ‘decision variable’, namely to have K chosen (for each k) by an optimiser —
see section 8.4.
Richalet’s PFC approach uses a very different approach to dealing with unstable
systems, from the approach taken by GPC [Ric93b]. Since PFC insists on an ‘in-
dependent model’, namely one in which the plant outputs are not used to correct
the internal model, the poles of the internal model are necessarily cancelled by the
controller. But this is unacceptable if the internal model is unstable, since it leads
to loss of internal stability — for example, the transfer function from the plant input
to the plant output is unstable when the feedback loop is closed (see Chapter 6 for
details).
P1 (z)
P (z) = (5.23)
1 − P2 (z)P1 (z)
ŷ ŷ
u u
P (z) P1 (z)
+
+
P2 (z)
This representation is now redrawn as in Figure 5.3. This shows P1 (z) driven by the
input, but the feedback loop is replaced by the open-loop block P2 (z)P1 (z) driven
by the output of the model. The ingenious trick which Richalet uses at this point is
to take P1 (z) as the internal model, and to regard the effect of the model output,
passing through P2 (z), as a measured disturbance. Of course, some approximation
enters at this point, because the future output has to be estimated, in order to
obtain predictions of itself. Richalet suggests replacing the model output ŷ at the
input of P2 (z) by the actual plant output y, and deriving predictions from this by
making plausible assumptions. For example, if the set-point is constant one could
assume that future output values will be equal to the latest measured values.
u ŷ
P1 (z)
+
+
ŷ
P1 (z)P2 (z)
Figure 5.3: Decomposition of unstable plant as stable model and ‘measured quasi-
disturbance’.
u y u ŷ
Ñ (z) I Ñ (z)
+ +
+ +
ŷ
I − M̃ (z) I − M̃ (z)
such that M̃ (z) and Ñ (z) are stable, and effective algorithms for doing this ex-
ist [Mac89, ZDG96]. (‘Coprime’ means that there are no unstable pole-zero cancel-
lations between the factors.) A block diagram which corresponds to this factorisation
is shown on the left of Figure 5.4. Note that the system I − M̃ (z) is stable, since
M̃ (z) is stable. On the right of Figure 5.4 is shown an approximation of the coprime
factorisation, using an estimate ŷ of the output as the input to the feedback block.
It is possible to modify the cost function used in predictive control, so that absolute
values of errors are penalised, rather than squared values:
X X
Hp p
V (k) = |ẑj (k + i|k) − rj (k + i)|qj (5.25)
i=1 j=1
subject to the usual constraints on û(k + i|k), ∆û(k + i|k), and ẑ(k + i|k). (The qj ’s
are nonnegative weights.) This cost function was used in [CS83]. Such problems are
Linear Programming (LP) rather than Quadratic Programming (QP) problems,1 as
we shall show shortly.
One of the historical reasons for adopting such a formulation is that LP problems
can be solved more quickly than QP problems, and that there is more experience
(particularly in industrial and commercial environments) of solving LP problems,
1
Some authors have started to adopt the phrase Linear Optimization, because the meaning of
‘programming’ has changed since the 1940’s. While this is undoubtedly correct and logical, we
retain the traditional terminology for the sake of easy recognition.
5.4. Non-quadratic Costs 169
x2 Increasing V x2
x1 x1
Figure 5.5: Cost contours and constraints for LP (left) and QP (right) problems.
The black dot shows the optimal solution in each case.
with excellent and well-proven software available. The importance of this reason is
decreasing rapidly, because of the great strides being made in the development of
algorithms and software for solving QP and other convex problems — see section
3.3.
But another reason — and a better one — for adopting this alternative formulation
of the predictive control problem is that the resulting behaviour is different. The
solutions of LP problems are always at the intersection of constraints — occasionally
on a single constraint — whereas solutions of QP problems can be off constraints, on
a single constraint, or (relatively rarely) at an intersection of constraints. An attempt
to illustrate this behaviour is made in Figure 5.5 which shows a problem with only
two ‘decision variables’ x1 and x2 . The thick solid lines represent linear inequality
constraints, with the feasible region being the interior of the region bounded by these
lines. The dashed lines represent constant cost contours, those for an LP problem
being shown on the left — these are straight lines, or hyperplanes in general — and
those for a QP problem being shown on the right — these are ellipses, or hyper-
ellipsoids in general. For the LP problem the cost increases as one moves upwards
in the figure, and for the QP problem the cost increases as one moves out from the
centre of the ellipse.
It can be seen from the figure on the left, that the optimal solution to an LP problem
must always lie on at least one constraint. Also, it can be expected to lie at the
intersection of more than one constraint, the only exception being if the slope of
the cost contours is the same as the slope of at least one constraint. Furthermore,
the solution is relatively robust with respect to the cost function: the slope of the
cost contours can vary quite a lot before the optimal solution changes — but when
it does change, it jumps suddenly to one of the other corners of the feasible region.
On the other hand, the optimal solution is sensitive to the constraints, and changes
170 5. Other Formulations of Predictive Control
The figure on the right shows that the optimal solution to a QP problem behaves
very differently. As shown, the optimal solution is on one of the constraints. But
it is easy to imagine a situation in which the centre of the ellipse is in the feasible
region, and the solution will then not be on any of the constraints. It is also easy
to see that it would be very unusual for the solution to be at the intersection of
more than one constraint. (In problems with particular structure it may not be
so unusual. For example, in the predictive control context, a big disturbance may
make an output constraint active over several steps of the prediction horizon. Seen
from the viewpoint of the QP algorithm this would mean that the solution is on the
intersection of several constraints.) In this case the optimal solution is completely
insensitive to changes in the constraints if it is in the interior of the feasible region,
but depends continuously on the cost function. If it is on the boundary of this region
— that is, some constraints are active — then it depends continuously on both the
cost function and the constraints.
Each of these behaviours has its merits. For example, if it is known that most prof-
itable operation is obtained with the plant at the intersection of several constraints,
and if the constraints are known precisely, and the model is reasonably accurate,
whereas the ‘true’ (economic) cost function is not known so precisely, then the ro-
bust behaviour of the LP solution is appropriate — it will try to keep the plant at
the true optimal operating point, despite the uncertainty about the true cost func-
tion. In practice, however, one would not risk trying to hold the plant at the real
constraints, so these would be replaced by synthetic constraints, which allowed some
margin for unavoidable constraint violations. Such violations will arise because of
unexpected disturbances, errors in the model of the plant, errors in measurements,
and errors in the constraint specifications themselves. So in practice the LP solution
would try to hold the plant robustly at a fixed operating point, but one which was
not the true optimum. In this case the QP solution looks more attractive.
In the situation just outlined, a QP formulation would try to hold the plant at a
point just inside the feasible region, close to the optimal operating point, as shown in
Figure 5.6. Because of the awareness that the predictive control formulation has of
constraints, and the resulting nonlinear action if the constraints are approached, this
operating point can be much closer to the constraints than could be contemplated
if a linear controller were used. The QP formulation now offers a lot of flexibility,
all of which can potentially be exercised on-line by plant operators:
1. The desired operating point, namely the centre of the iso-cost ellipsoids, can
be moved around within the feasible region in a natural way. (In an LP
formulation this can only be done by redefining the constraints.)
2. The relative weights in the cost function can be altered to change the uncon-
strained behaviour. For example the right half of Figure 5.6 shows the same
operating point defined, but a lower cost indicated for deviations of the x2
variable rather than the x1 variable.
5.4. Non-quadratic Costs 171
x2 x2
x1 x1
Figure 5.6: Using a QP formulation to place the desired operating point just inside
the feasible region. Left: x1 deviations cheaper than x2 deviations. Right: x2
deviations cheaper than x1 deviations.
We return now to the cost function (5.25). We want to demonstrate that minimising
this, subject to the usual constraints on input changes, inputs and outputs, is indeed
an LP problem. The standard form of an LP problem is:
where θ is the vector of decision variables, b and c are vectors, and A is a matrix.
A problem of the form
where cTj is the j’th row of the matrix C, is equivalent to the LP problem
X I −C −d
I γ
min γj subject to C ≥ d (5.31)
γ,θ θ
j 0 A b
where γ is now a vector. This is now very close to the predictive control problem
we want to solve.
where Θ, E(k) and ∆U (k) are as defined in section 3.1.1 and Q consists of Hu copies
of Q stacked on top of each other, where Q = diag{q1 , . . . , qp }. This has to be
minimised subject to inequality (3.41). This problem is in the same form as (5.30),
so we see that this is an LP problem.
V (k) = kQ[Θ∆U (k) − E(k)]k∞ = max max |ẑj (k + i|k) − rj (k + i)|qj (5.33)
i j
subject to the usual constraints. This attempts to minimise the peak deviation
from the set-points, over all the controlled outputs and over the prediction horizon.
Using the ‘1-norm’ as in (5.25) or the ‘2-norm’ as in (3.45) minimises something like
5.5. Zones, Funnels and Coincidence Points 173
the average deviation, loosely speaking, but can permit occasional large deviations.
Using the ‘∞-norm’ is an attempt to overcome this, if it is a problem.
This is again an LP problem, which can be seen as follows. The problem is of the
form
This is equivalent to
1 −C −d
1 γ
min γ subject to C ≥ d (5.36)
γ,θ θ
0 A b
where γ is now a scalar, and 1 denotes a vector, each element of which is 1. Clearly
this is an LP problem.
We have represented the control objectives as a reference trajectory for the controlled
outputs to follow. In some applications the exact values of the controlled outputs
are not important, so long as they remain within specified boundaries, or ‘zones’, as
shown in Figure 5.7. This is easily accommodated within our ‘standard problem’ by
setting Q(i) = 0, and leaving only constraints on the controlled outputs to define the
performance objectives. If R(i) = 0 also, then something has to be done to ensure
that the optimization remains well-defined. The optimization problem typically
simplifies from a QP to an LP problem, if all the objectives are ‘zone’ objectives.
A variation of this is to represent the objectives by ‘funnels’, which are the same as
‘zones’, except that they become narrower over the prediction horizon. If moving
towards a set-point sj from a lower value zj (k), for example, one can define a ‘funnel’
whose upper boundary is sj , and whose lower boundary is a first-order ‘trajectory’:
as illustrated in Figure 5.8. The shaded areas in the figure show that the predicted
trajectory is penalised only when it leaves the funnel. The advantage of this, over
defining a reference trajectory
is that, in the multivariable case, the reference trajectories for different outputs can
be inconsistent with each other. Following one reference trajectory might cause
174 5. Other Formulations of Predictive Control
Zone
Predicted output
another output to return to its set-point more quickly than its reference trajectory
specifies. The use of funnels in this situation allows the controller to take advantage
of this benign turn of events, rather than impeding the return of both outputs to
their set-points unnecessarily.
A variation on this is to make the lower boundary of the funnel a straight line, as
shown in Figure 5.9. This is what is done in Honeywell’s RMPCT product.
A third alternative is to use only a few coincidence points, rather than penalising
errors between r(k + i) and ẑ(k + i|k) over the whole prediction horizon, as we did
in the simple examples of Chapter 1. This is illustrated in Figure 5.10. This is
in some ways similar to the ‘zone’ idea; if the coincidence points are at the end of
the prediction horizon, this corresponds to expressing indifference about the precise
trajectory of the controlled outputs, so long as they are reasonably close to their set-
points eventually. If different controlled outputs respond with different time-scales,
then the coincidence points for some variables can be made different from those for
others. This idea is easily accommodated within our standard problem formulation:
just set most elements of Q(i) to zero for most i.
5.6. Predictive Functional Control (PFC) 175
Set-point
Funnel
Reference trajectory
Predicted output
Perhaps the most distinctive feature of PFC is that the future input is assumed to
be a linear combination of a few simple basis functions. In principle these could be
any appropriate functions, but in practice a polynomial basis is usually adopted. In
this case the future input is assumed to be of the form
Thus the future input profile is parametrised by the c+1 coefficients u0 (k), u1 (k), . . . , uc (k).
In practice low values of c are used, such as 1 or 2, so that the optimization is per-
formed over only 2 or 3 parameters, for single-input systems. The notion of ‘control
horizon’ therefore does not exist, but is replaced by the number of basis functions
used. The same idea extends to multi-input systems, by taking u0 (k), . . . , uc (k)
to be vectors of coefficients. The coefficients are shown here indexed by the time
argument (u0 (k) etc) in order to emphasise that the coefficients are chosen to be
optimal at each k, and so are different at each step.
176 5. Other Formulations of Predictive Control
Set-point Funnel
Reference trajectory
Predicted output
The time window over which the cost function is minimised, namely i = Hw to
i = Hp (called the coincidence horizon in the PFC literature) usually contains only
a few points, and often a single point, so that the cost function is frequently of the
form
In the case of a SISO system, with the number of coincidence points equal to the
number of parameters in (5.38), no optimization is necessary, since one can solve
analytically for the input which makes V (k) = 0 — at least, if constraints are
ignored. We have already seen examples of this in Chapter 1.
Correction for plant-model mismatches in steady-state gains, and for persistent dis-
5.6. Predictive Functional Control (PFC) 177
Set-point
Coincidence points
Reference trajectory
Hp
Predicted output
k Time
k Time
k Time
u(k) = v0 + v1 k + · · · + vν kν (5.41)
Since this input is applied to both the model and the plant, the error between the
model output and the plant output will, at worst, be a polynomial of degree ν.
Hence the predicted plant-model error is assumed to have the form
X
ν
ê(k + i|k) = e(k|k) + ej ij (5.42)
j=1
where e(k|k) = y(k)− ŷ(k|k−1) is the current error between the plant output and the
model output. The coefficients e1 , . . . , eν are obtained by fitting a trend to previous
errors in some way — for example, a least-squares fit. The model predictions are
corrected by this plant-model error, so that the future input trajectory is chosen to
minimise the cost
X
ν+1
V (k) = ks(k + Pi ) − ŷ(k + Pi |k) − e(k + Pi |k)k2 (5.43)
i=1
where ν +1 coincidence points have been chosen, at times k +P1 , . . . , k +Pν+1 . Since
the only term in the cost that depends on the future input trajectory is ŷ(k + Pi |k),
5.6. Predictive Functional Control (PFC) 179
the cost can be made zero by choosing the input trajectory such that
and this can be done if the number of inputs is at least as great as the number
of outputs. Now, by assumption, y(k + Pi ) = ŷ(k + Pi |k) + e(k + Pi |k), so we get
y(k +Pi ) = s(k +Pi ). (Otherwise our original assumption that the plant-model error
can be extrapolated by a polynomial would not be valid.) Note that this argument
does not depend on the model which produces ŷ(k + Pi |k) being accurate in any
respect, except for the feature that a polynomial input should result in the output
being a polynomial of the same degree.
An important point is that the polynomial parametrisation of the input is not nec-
essary to obtain error-free tracking. The essentials are:
Thus other forms of predictive control, which do not use such an input parametri-
sation, can achieve error-free tracking if they employ a suitably rich internal model
of the plant-model mismatch, if there are sufficiently many coincidence points, and
if the control horizon is long enough.
PFC generally uses a reference trajectory which is re-anchored at the latest output
measurement, as already described in Chapter 1. Recall that, if the current set-point
is s(k), then the current error is ε(k) = s(k) − y(k), and the reference trajectory
r(k + i|k) is defined so that s(k + i) − r(k + i|k) = ε(k + i) decreases from ε(k)
to zero gradually as i increases. Most commonly, the reduction is exponential:
ε(k + i) = λi ε(k), where 0 ≤ λ < 1.
only errors due to outputs being ‘on the wrong side’ of the reference trajectories
are penalised. This idea is implemented in Honeywell’s product RMPCT, which
is described in Appendix A. In this product, however, the reference trajectory
is a straight line from the current output to some point on the future set-point
trajectory, rather than an exponential curve. Some further discussion of how a
reference trajectory modifies the feedback loop is given in section 7.5.
There are two reasons why the cost function used in PFC often omits any penalty
on control moves. One is that the required performance is largely determined by the
reference trajectory, so that it is not necessary to use the weights Q and R in the cost
function as tuning parameters to obtain the required performance. The other is that
the polynomial structure of the future control signal results in relatively few degrees
of freedom being available to the optimiser — because low degree polynomials are
usually used — and this usually results in relatively smooth input trajectories being
obtained. It is therefore not necessary to use a control move penalty to reduce the
‘roughness’ of the input signal.
The results obtained above for error-free tracking of polynomial set-point trajec-
tories continue to hold if such reference trajectories are used, essentially because
the reference trajectory coincides (asymptotically) with the set-point trajectory if
steady disturbance-free conditions are assumed. For details see [Ric93b].
PFC deals with constraints in a heuristic manner — that is, in a way which does
not yield the true constrained optimal solution in general. This approach originates
in the application of PFC to high-bandwidth servomechanism systems, for which
computing the true optimal solution could not be done in real time — especially
in the 1970’s, when this version of predictive control was originally developed. It
is claimed, however, that in many applications the heuristic solution is adequate,
particularly with SISO plant.
Constraints on input levels and rates of change are dealt with in PFC simply by
‘clipping’. Consider a single-input plant for simplicity. Suppose that the constraints
on the input level are umin < u(k) < umax and on the input move are ∆umin <
∆u(k) < ∆umax , and that the solution algorithm computes an input move ∆u(k)∗ ,
without taking any constraints into account. Then the move actually applied to the
plant is (assuming umin < 0 and umax > 0)
min (∆u(k)∗ , ∆umax , umax − u(k − 1)) if ∆u(k)∗ > 0
∆u(k) = (5.45)
max (∆u(k)∗ , ∆umin , umin − u(k − 1)) if ∆u(k)∗ < 0
Of course the same move must be applied to the internal model as to the plant. This
not only helps to keep the predictions accurate, but also avoids problems analogous
to ‘integrator wind-up’. This heuristic approach will not give the true optimal
solution in general, but it often gives very similar results. (See Problem 6 for an
example.)
PFC does not have a clear strategy for dealing with state and output constraints.
The commercial product based on PFC, in common with several other MPC prod-
5.7. Continuous-time Predictive Control 181
ucts, adopts heuristics to find a sub-optimal solution when such constraints are
active.
It was already remarked in section 1.3 that predictive control does not require a
discrete-time model; it is enough to know the values of the step response at the co-
incidence points. But it is possible to go further, and formulate the whole predictive
control problem, and its solution, in continuous time. This has been proposed by
Gawthrop et al [DG91, DG92, GDSA98].
If a linear model is used then the optimal parameters u(t), u̇(t), . . . , u(m) (t) can be
found by solving a least-squares problem, if there are no constraints. Suppose that
a state-space model is used:
ẋ(t) = Ax(t) + Bu(t), y(t) = Cx(t) (5.49)
Then
y(t) C
ẏ(t) CA
Y(t) = .. = .. x(t) +
. .
y (n) (t) CAn
0 0 ··· 0 0 u(t)
CB 0 ··· 0 0 u̇(t)
.. .. .. .. .. .. (5.50)
. . . . . .
CAn−1 B CAn−2 B · · · CB 0 u(n−1) (t)
182 5. Other Formulations of Predictive Control
so the prediction (5.47) can be obtained if it is assumed that the current state is
known, and it is linear in u(t), u̇(t), . . . , u(m) (t). Now if (5.47) is written in the form
τn
ŷ(t + τ |t) = 1, τ, . . . , Y(t) (5.51)
n!
then, assuming for simplicity that there is only one output, so that y and r are
scalars,
Z τ2 Z τ2
kr(t + τ ) − ŷ(t + τ |t)k dτ = Y(t) Φ(τ1 , τ2 )Y(t) − 2φ(τ1 , τ2 )Y(t) +
2 T
r(t + τ )2 dτ
τ1 τ1
(5.52)
where
1
Z τ2
τ τn
Φ(τ1 , τ2 ) = . . . 1, τ, . . . , n! dτ (5.53)
τ1
τn
n!
and
Z τ2
τn
φ(τ1 , τ2 ) = 1, τ, . . . , r(t + τ )dτ (5.54)
τ1 n!
Rτ
One can find a similar expression for τ12 kû(t + τ |t)k2 dτ using (5.48).
Thus the cost function V (t) is a quadratic function of Y(t) and of the input and
its derivatives, and Y(t) is itself linear in the input and its derivatives, so V (t)
is a quadratic function of the parameters u(t), u̇(t), . . . , u(m) (t). So minimising it
requires the solution of a least-squares problem, as was claimed earlier. Although
it is not explored in the work of Gawthrop et al, the addition of linear inequality
constraints on the inputs and outputs, and possibly on their derivatives, would give
rise to a quadratic programming problem , just as in the discrete-time case.
While this formulation nicely parallels the discrete-time formulation, the proposal
is not complete, in that it does not specify how the solution should be implemented.
Conceptually, the optimal u(t) is computed and applied continuously — the deriva-
tives found as part of the solution are not used, which is analogous to discarding all
but the initial part of the optimal input trajectory in the discrete-time formulation.
In practice this would not be feasible, and presumably some kind of frequent update
would need to be implemented, with care being taken to impose sufficient smooth-
ness on the input trajectory actually applied to the plant, for it to be consistent
with the use of (5.50). The use of Taylor series for prediction is very vulnera-
ble to measurement errors, since it relies on knowing high-order time derivatives.
In [DG91, DG92, GDSA98] there is some discussion of how the robustness of the
continuous-time scheme can be increased.
5.8. Problems 183
5.8 Problems
1. Consider the swimming pool from Problem 3 of Chapter 3, with a sinusoidal di-
urnal variation of the ambient air temperature θa defined as in (3.96). Suppose
that the air temperature is now measured and used for feedforward. Assume
that weights and horizons remain the same as earlier.
(a) Show by simulation that if the model is perfect and there are no con-
straints on the input power then the control system compensates perfectly
for the variation in air temperature.
(b) If there is a modelling error, as in part (c) of Problem 3 of Chapter 3, show
that there is a residual variation of approximately 0.2 degC in the water
temperature. (Recall that when the air temperature is an unmeasured
disturbance and the power is unconstrained, the residual variation in θ is
approximately 0.5 degC, with both the perfect and the imperfect models.)
(c) If the input power is constrained to 0 ≤ q ≤ 40 kW, show that the
set-point is held much more accurately when the air temperature is mea-
sured and used for feedforward, but only in those periods when the input
constraints are not active. In those periods when the input power is con-
strained the water temperature variations are almost the same, regardless
of whether the air temperature is measured or not.
2. Suppose that the ‘1-norm’ cost function (5.25) is augmented by penalties on
input moves:
X X
Hp p
X
Hu X
m
V (k) = |ẑj (k + i|k) − rj (k + i)|qj + |∆ûj (k + i|k)|rj (5.55)
i=1 j=1 i=1 j=1
where the rj ’s are nonnegative weights. Show that minimising this, subject to
the usual constraints, is an LP problem.
3. Consider the unstable helicopter model of Example 4.11, with transfer function
6.472z 2 − 2.476z + 7.794
P (z) =
(z − 0.675)(z − 1.047 + 0.2352i)(z − 1.047 − 0.2352i)
Find a pair of coprime factors Ñ (z), M̃ (z), such that P (z) = Ñ (z)/M̃ (z) and
both Ñ (z) and M̃ (z) are stable. Ensure that each factor is proper (numerator
degree does not exceed denominator degree), so that each could be realised as
a state-space system. (Note: There are many possible solutions.)
Note that finding a ‘decomposition’ of the form (5.22) is harder.
4. Using the notation of sections 1.3 and 5.6, show that the predicted model
output resulting from the input u0 (k) + u1 (k)i is
ŷ(k + Hp |k) = S(Hp )u0 (k) + [S(Hp − 1) + · · · + S(1)]u1 (k) + ŷf (k + Hp |k)
5. Suppose that an asymptotically stable plant has one controlled output, which
is to follow a ramp set-point without error, using PFC.
(a) What is the smallest number of coincidence points that must be used?
(b) If there is only one input, and a polynomial basis is used to structure
the assumed future input trajectory, what degree of polynomial should
be used?
(c) Suppose two inputs are available. Discuss the possibilities for structuring
the future input trajectories.
(d) What other feature must be included in the control scheme, if error-free
tracking of the ramp is to be obtained?
(a) Show that in this case the behaviour obtained by ‘clipping’ the uncon-
strained solution is the same as that obtained by solving the QP problem.
(b) If there is also a slew rate constraint of |q̇| < 20 kW/hour, show that the
QP and clipped solutions are no longer the same, although they are still
very close.
Note: Use the Model Predictive Control Toolbox function smpcsim to get the
clipped solution.
7. Verify that the vector Y(t), containing y(t) and its time derivatives, is given
by (5.50).
8. Define a vector U(t), analogous to Y(t), which contains u(t) and its time
derivatives. Express the continuous-time cost V (t), defined by (5.46), as a
quadratic function of U (t).
Chapter 6
Stability
If one is designing a predictive controller off-line then nominal stability of the closed
loop is hardly an issue. It is quite easy to obtain stability by tuning the parameters
in the problem formulation, and very easy to check that the designed system is stable
(assuming the correct plant model). This at least is the typical situation with current
applications of predictive control. Current applications are invariably implemented
on stable plants, and the dynamic performance demanded from predictive controllers
is typically not very challenging. As predictive control is applied more widely, with
tight dynamic specifications, and especially if it is applied to unstable plants, then
this situation may change.
Predictive control, using the receding horizon idea, is a feedback control policy.
There is therefore a risk that the resulting closed loop might be unstable. Even
though the performance of the plant is being optimised over the prediction horizon,
and even though the optimization keeps being repeated, each optimization ‘does not
care’ about what happens beyond the prediction horizon, and so could be putting
the plant into such a state that it will eventually be impossible to stabilise. This
is particularly likely to occur when there are constraints on the possible control
input signals. It is easy to construct an example where this happens, even without
constraints:
185
186 6. Stability
x1 (k + 1) = u(k)
x2 (k + 1) = x1 (k)
(which is positive-definite). The predictive control problem is to find u(k) which will
minimise V (k).
Using the model, the predictions are x̂1 (k + 1|k) = u(k) and x̂2 (k + 1|k) = x1 (k).
Substituting these into V (k) gives
To find the minimum of this, differentiate and set the derivative to zero:
∂V
= 2u(k) + 4x1 (k)
∂u(k)
= 0 if u(k) = − 2x1 (k).
Substituting this back into the model gives the closed-loop equations:
x1 (k + 1) = −2x1 (k)
x2 (k + 1) = x1 (k)
or
−2 0
x(k + 1) = x(k).
1 0
Clearly this is unstable, since the closed-loop transition matrix has an eigenvalue at
−2, outside the unit circle.
One might guess that this problem arises in the Example because the prediction
horizon is too short, so that the control is too ‘short-sighted’. This is correct, and
it turns out that stability can usually be ensured by making the prediction horizon
long enough, or even infinite. We will see that later in this chapter.
6.1. Terminal Constraints Ensure Stability 187
Another way of ensuring stability is to have any length of horizon, but to add a
‘terminal constraint’ which forces the state to take a particular value at the end
of the prediction horizon. And it is surprisingly easy to prove this, even in a very
general case, by using a Lyapunov function, as was first shown by Keerthi and
Gilbert [KG88]. For the purpose of proving stability it is enough to consider the
case when the state is to be driven to the origin, from some initial condition.
Theorem 6.1 Suppose that predictive control is obtained for the plant
X
Hp
V (k) = `(x̂(k + i|k), û(k + i − 1|k))
i=1
x̂(k + Hp |k) = 0
The minimisation is over the input signals {û(k + i|k) : i = 0, 1, . . . , Hu − 1}, with
Hu = Hp (for simplicity), subject to the constraints û(k+i|k) ∈ U and x̂(k+i|k) ∈ X,
where U and X are some sets. We assume that x = 0, u = 0 is an equilibrium
condition for the plant: 0 = f (0, 0). The receding horizon method is applied, with
only u0 (k|k) being used from the optimal solution {u0 (k + i|k) : i = 0, . . . , Hu − 1}.
Proof 6.1 The proof makes use of concepts from Minitutorial 6. Let V 0 (t) be the
optimal value of V which corresponds to the optimal input signal u0 , as evaluated at
time t. Clearly V 0 (t) ≥ 0, and V 0 (t) = 0 only if x(t) = 0 — because if x(t) = 0 then
the optimal thing to do is to set u(t + i) = 0 for each i. We are going to show that
V 0 (t + 1) ≤ V 0 (t), and hence that V 0 (t) is a Lyapunov function for the closed-loop
system.
As usual in stability proofs, we will assume that the plant model is perfect, so that the
predicted and real state trajectories coincide: x(t+i) = x̂(t+i|t) if u(t+i) = û(t+i|t).
188 6. Stability
X
Hp
0
V (t + 1) = min `(x(t + 1 + i), u(t + i))
u
i=1
XHp
= min `(x(t + i), u(t − 1 + i)) − `(x(t + 1), u(t))+
u
i=1
since the optimum is certainly no worse than keeping the optimal solution found at
time t, which will take us up to time t + Hp , then doing the best we can for the final
step. But we have assumed that the constraint x(t + Hp ) = 0 is satisfied, since the
optimization problem was assumed to be feasible, so we can make u(t + Hp ) = 0 and
stay at x = 0, which gives
This sounds too good to be true. It seems too easy to guarantee stability. The
problem is with the assumption that the optimization problem has a solution at each
step, and that the global optimum can be found at each step. General constrained
optimization problems can be extremely difficult to solve, and just adding a terminal
constraint may not be feasible. But we will use the idea of this proof several times
later, in more realistic situations.
Example 6.2 If we look again at Example 6.1 and try to get stability by adding the
terminal constraint x(k + 1) = 0, we get an infeasible problem, because that could
only be achieved if x1 (k) = 0, which will not be true in general. (In general you need
at least 2 steps to drive a 2-state linear system to the origin.) Problem 2 shows that
for this example stability is obtained by increasing the prediction horizon to Hp = 2,
even without a terminal constraint.
The same basic idea can be applied in various ways. Two particular ways, associated
with GPC, have become quite well known and have been incorporated into particular
versions of GPC: ‘Stable input-output receding horizon control’, or SIORHC (see
[Mos95, Chapter 5.8]), and ‘Constrained receding horizon predictive control’, or
CRHPC (see [CC95, Chapter 6.5]).
6.1. Terminal Constraints Ensure Stability 189
Equilibrium: The equation x(k + 1) = f (x(k), u(k)) has an equilibrium (or ‘fixed
point’) at state x0 and input u0 if x0 = f (x0 , u0 ).
Note that we can always introduce a change of coordinates z(k) = x(k) − x0 , v(k) =
u(k) − u0 , so that the equilibrium is at (0, 0) in the new coordinates:
and if, along any trajectory of the system x(k + 1) = f (x(k), u(k)) in some neigh-
bourhood of (0, 0) the property
However, since we shall see in the following sections that stability can be achieved
without imposing conditions as severe as single-point terminal constraints, we shall
not pursue this approach further.
It has recently been argued [MRRS00]that all MPC schemes which have been pro-
posed to date and which guarantee closed-loop stability, have a terminal constraint
set built into them (possibly implicitly, and possibly consisting of a single point).
Furthermore they contain a control law defined on this terminal set which respects
all the constraints, and which keeps the state in the set, once the state trajectory
has entered it. Finally, they all contain (possibly implicitly) a terminal cost, that is,
a cost penalising non-zero states at the end of the prediction horizon; furthermore,
the terminal cost function is such that it is a Lyapunov function, when confined to
the terminal constraint set. In many of the published proposals one or more of these
elements are trivial — for instance, the terminal constraint set may consist of only
the origin, the control law on this set (point) may be the prescription u ≡ 0, and the
terminal cost function may be F (x) = ∞ if x 6= 0, F (x) = 0 if x = 0. Nevertheless,
the explicit identification of these elements may be valuable for future proposals; in
particular the recognition that both a terminal constraint set and a terminal cost
can usefully be part of a successful ‘prescription’ is a surprising revelation.
The specific approach described in this section was originated in [RM93], and elabo-
rated upon in [MR93b, MR93a], although the underlying ideas are similar to those in
[KG88], where it was shown that infinite-horizon constrained control problems could
be approximated by finite-receding-horizon problems with a terminal constraint. It
had been known for some time (eg see [BGW90]) that making the horizons infinite
in predictive control leads to guaranteed stability, but it was not known how to
handle constraints with infinite horizons. The work of Rawlings and Muske made
6.2. Infinite Horizons 191
a break-through in this respect. The same ideas have also been applied to the
transfer-function formulation [Sco97]— not surprisingly, the whole development can
be repeated in that setting.
The key idea is to re-parametrise the predictive control problem with infinite horizons
in terms of a finite number of parameters (instead of the infinite number of control
decisions ∆u(k|k), ∆u(k + 1|k), . . . ), so that the optimization can still be performed
over a finite-dimensional space — in fact, it remains a QP problem. Since the
original work of Rawlings and Muske, several other proposals have been made, which
can be interpreted as different re-parametrizations of the infinite horizon problem
[RK93, SR96b].
In [Mor94] the opinion has been expressed that there is now no longer any reason
to use finite horizons — at least with linear models.
Let us begin by examining why the use of an infinite costing horizon guarantees
stability.
Figure 6.1 shows an essential difference between a finite, receding horizon formulation
of predictive control, and an infinite horizon formulation. The top half of the figure
depicts the finite-horizon formulation, with the plant output heading towards a
constant set-point. At time k a particular trajectory is optimal over the prediction
horizon of length Hp . In the absence of disturbances, and with a perfect model, the
plant at time k + 1 is precisely in the state which was predicted at the previous time
step. One might expect, therefore, that the initial portion of the optimal trajectory
over the prediction horizon from time k + 1 to time k + 1 + Hp would coincide with
the previously computed optimal trajectory. But a new time interval now enters
the picture which had not been considered when the earlier optimization had been
performed — the interval between time k + Hp and time k + 1 + Hp . The presence of
this new time interval may lead to an optimal trajectory completely different from
the one computed at the earlier step.
The lower half of Figure 6.1 shows the situation with an infinite horizon. At time k an
optimal trajectory over the whole infinite horizon is determined (implicitly). At time
k + 1 no new information enters the optimization problem, so the optimal trajectory
from this time on is the same as the ‘tail’ of the previously computed trajectory.
(This is Bellman’s celebrated principle of optimality, which states that the tail of
any optimal trajectory is itself the optimal trajectory from its starting point. It does
not apply in the finite-horizon case, because there a different optimization problem
arises at each step.) This leads to the cost function V (k) decreasing as k increases
(under the no-disturbance, perfect-model assumption), which allows it to be used as
a Lyapunov function, hence establishing stability.
192 6. Stability
Hp
Hp
Time
k k+1
Time
k k+1
Figure 6.1: Finite and infinite horizons (no disturbances, perfect model)
Figure 6.2 shows a particular case for which closed-loop stability can be established
despite the use of a finite horizon. This is when deadbeat behaviour is enforced,
with settling to the set-point occuring within the prediction horizon. In this case
the situation is similar to the infinite-horizon case, in that at each step the optimal
trajectory is the ‘tail’ of the previously computed one. (It can also be regarded as
a finite-horizon case with terminal constraint.) So in this case V (k) is also decreas-
ing, and hence stability can be established. This strategy for ensuring closed-loop
stability was used in [KR92].
Hp
Hp
Time
k k+1
Let us now consider the details of the infinite-horizon formulation. We modify our
standard set-up a little. First, we keep the weights constant across the prediction
horizon, so that Q(i) = Q and R(i) = R. Secondly, we penalise control levels as
well as moves over an infinite horizon. Thirdly, we assume a ‘regulator’ formulation,
namely that we want to drive the output to zero:
∞
X
V (k) = kẑ(k + i|k)k2Q + k∆û(k + i − 1|k)k2R + kû(k + i − 1|k)k2S (6.1)
i=1
although we still assume that only the first Hu control moves are non-zero:
∆û(k + i − 1|k) = 0 for i > Hu (6.2)
We assume that S > 0 and Q ≥ 0, R ≥ 0. (In [RM93]it was assumed that the
control levels were penalised, not the control moves. In [MR93b] both control levels
and control moves were penalised. A proof which holds in the general case is given
in [MR93a]. Unfortunately the weights R and S in our notation have the opposite
meanings to those used in [RM93, MR93b, MR93a].)
Suppose initially that we have full state measurement, so that x(k) = y(k), and that
the plant is stable. Then the following argument shows that closed-loop stability is
obtained for any Hu > 0, providing that the optimization problem is, and remains,
feasible, and that the global optimum is found at each step.
Let V 0 (k) be the optimal value of the cost function at time k, let u0 denote the
computed optimal input levels, and let z 0 denote values of the controlled output
obtained as a result of applying u0 . Note that, since u0 (k + i) = u0 (k + Hu − 1) for
all i ≥ Hu , and since the steady-state value of u0 needed to keep z at 0 is 0 (according
to the optimiser’s internal model), the optimiser will certainly put u0 (k + i) = 0 for
i ≥ Hu , since an infinite cost would otherwise result. Thus we have
∞
X X
Hu
V 0 (k) = kẑ 0 (k + i|k)k2Q + k∆û0 (k + i − 1|k)k2R + kû0 (k + i − 1|k)k2S
i=1 i=1
(6.3)
Now if we assume, as usual in proofs of nominal stability, that our model is exact
and that there are no disturbances, then z 0 (k + 1) = ẑ 0 (k + 1|k). Thus the value of
V , evaluated at time k + 1, but maintaining the same control sequence û0 (k + i|k)
as computed at time k, would be
V (k + 1) = V 0 (k) − kz 0 (k + 1)k2Q − k∆û0 (k|k)k2R − kû0 (k|k)k2S (6.4)
But at time k + 1 the new optimization problem, with initial condition z 0 (k + 1) =
Cz x0 (k + 1) — which is known, since we assume full state measurement — is solved,
so that
V 0 (k + 1) ≤ V (k + 1) (6.5)
= V (k) − kz (k +
0 0
1)k2Q − k∆û 0
(k|k)k2R − kû 0
(k|k)k2S (6.6)
< V 0 (k) (6.7)
194 6. Stability
To infer stability we must now show that V 0 (k + 1) < V 0 (k) implies that ||x(k)|| is
decreasing. Since we have assumed that S > 0, it is clear that u0 (k) is decreasing
(since u0 (k) = û0 (k|k)), which implies that x0 (k) is eventually decreasing, since we
have assumed a stable plant. But we can relax the S > 0 condition, if we replace it
by something else. For example, assuming that Q > 0 and observability of the state
from z implies that ||x0 || must eventually be decreasing, even if S = 0, as in our
standard formulation. So there are a number of possible assumptions which ensure
that decreasing V 0 implies decreasing ||x0 ||, and that is enough to show that V 0 is
a Lyapunov function for the closed loop, which shows, in turn, that the closed-loop
system is stable.
Now we must consider the case of an unstable plant. The essential difference in this
case is that the unstable modes must be driven to 0 within Hu steps. Otherwise
these modes, which are uncontrolled for i ≥ Hu , would become unbounded, giving
an infinite cost value. But it is known that in general it is not possible to drive
the states of a system to zero in less than n steps, where n is the state dimension.
Since only the unstable modes need to be driven to zero, only nu steps are actually
needed, if nu is the number of unstable modes. Thus we have to take Hu ≥ nu for an
unstable plant. We also need to ensure that the unstable modes can be driven to zero
by some input. Technically, we have to assume that the pair (A, B) is stabilisable —
namely that the unstable modes are controllable from the input; the stable modes
do not have to be controllable, since they decay to zero anyway.
With these provisos, stability follows by the same argument as for stable plants,
providing that feasibility is maintained.
When full state measurement is not available (y(k) 6= x(k)) an observer must be
used to obtain the state estimate x̂(k|k). Subject to a few technical conditions,
and assuming a perfect model as usual, x̂(k|k) → x(k) as k → ∞ if the observer
dynamics are stable. Consequently, as k increases, the value of the optimal cost
function V 0 (k) will approach the same value as in the case of y(k) = x(k), and
stability can again be inferred.
In order to be able to pose problems which are feasible over the whole infinite horizon,
it is necessary to introduce two new parameters Cw and Cp , which are analogous to
the horizons Hw and Hp , but which refer to the times over which output constraints
are enforced. To be precise, suppose that the output constraints are of the form
zi,min ≤ ẑi (k + j) ≤ zi,max for j = Cw , Cw + 1, . . . , Cp . (6.8)
In order to apply the stability theorems, both Cw and Cp must be chosen large
enough. Cw must be chosen large enough that the problem is feasible at time k. Cp
must be chosen large enough that if the problem is feasible over the finite horizon
up to time k + Cp , then it will remain feasible over the rest of the infinite horizon.
In [RM93]it is shown that finite values of Cw and Cp always exist — although for
unstable plants they depend on x(k), in general.
6.2. Infinite Horizons 195
Now we need to consider how constrained predictive control problems can be solved,
when the horizons are infinite. As we have already seen, for the regulator problem
the computed input signal û(k + i − 1|k) is necessarily zero for i ≥ Hu . The cost
function can therefore be written as
∞
X X
Hu
V (k) = kẑ(k + i − 1|k)k2Q + kẑ(k + i − 1|k)k2Q +
i=Hu +1 i=1
+k∆û(k + i − 1|k)k2R + kû(k + i − 1|k)k2S (6.9)
Now consider the first term in this expression. Since û(k + i − 1|k) = 0 for i ≥ Hu ,
we have
so that
∞
" ∞
#
X X
kẑ(k + i|k)k2Q = x̂(k + Hu |k) T T i
(A ) CzT QCz Ai x̂(k + Hu |k) (6.13)
i=Hu +1 i=0
Now let
∞
X
Q̄ = (AT )i CzT QCz Ai (6.14)
i=0
This equation is known as the matrix Lyapunov equation, and it can be solved for
Q̄, given A, Cz and Q. (In MATLAB it can be solved using the function dlyap from
the Control System Toolbox.) Furthermore, it is well known that Q̄ ≥ 0 if Q ≥ 0
and A has all its eigenvalues inside the unit disk, namely if the plant is stable. Thus
the cost function can be written as
X
Hu
V (k) = x̂(k + Hu |k)T Q̄x̂(k + Hu |k) + kẑ(k + i − 1|k)k2Q +
i=1
+k∆û(k + i − 1|k)k2R + kû(k + i − 1|k)k2S (6.17)
196 6. Stability
This now looks like a predictive control problem formulated over a finite horizon of
length Hu , with a terminal cost penalty — which shows, incidentally, that imposing
a terminal equality constraint to obtain stability is unnecessarily restrictive.
If the controlled output is to follow a set-point with a non-zero final value, then it
is necessary to replace the term kû(k + i − 1|k)k2S by kû(k + i − 1|k) − us k2S in the
cost function in order to get a bounded cost, where us is a steady input value which
is predicted to bring the controlled output to the required steady value rs :
Example 6.3 In [BGW90] the following plant is used as an example of one which
is difficult to control:
−0.0539z −1 + 0.5775z −2 + 0.5188z −3
P (z) = (6.20)
1 − 0.6543z −1 + 0.5013z −2 − 0.2865z −3
One state-space realization of this has
0.6543 −0.5013 0.2865
A = 1.0000 0 0 Cz = [−0.0536, 0.5775, 0.5188] (6.21)
0 1.0000 0
Suppose that Q = I3 , then
1.2431 −0.1011 0.1763
Q̄ = −0.1011 0.8404 0.1716 (6.22)
0.1763 0.1716 0.3712
6.2. Infinite Horizons 197
With an unstable plant there are two reasons why we cannot proceed exactly as
before:
• We need to impose the constraint that the unstable modes must be at zero at
the end of the control horizon.
We proceed by decomposing the plant into its stable and unstable parts, by means
of an eigenvalue-eigenvector (Jordan) decomposition:1
A = W JW −1 (6.23)
Ju 0 W̃u
= [Wu , Ws ] (6.24)
0 Js W̃s
Because of this constraint, only the stable modes contribute to the infinite sum in
(6.9), which therefore has a finite value:
∞
X ∞
X
kẑ(k + i − 1|k)k2Q = kCz W̃s x̂(k + i − 1|k)k2Q (6.28)
i=Hu +1 i=Hu +1
Again Q should be as in (6.19), with Q̄ being obtained from (6.30). Predictions are
obtained as before.
The significant difference now is the appearance of the equality constraint (6.27).
This can be simply added to the QP formulation as an equality constraint. But,
as pointed out by Scokaert in the GPC context [Sco97], this equality constraint re-
moves some degrees of freedom from the optimization (as many as there are unstable
modes), and it is possible to reparametrize the problem so that the optimization is
over a smaller number of decision variables.
In the state-space setting this can be done as follows. From equation (2.66) we see
that
+ A B · · · B ∆U (k)
i
(6.33)
i=0
This represents nu equations, if there are nu unstable modes. Now we can use these
equations to express any nu of the variables in the vector ∆U (k) in terms of the
remaining ones, and thus eliminate these variables from the optimization. Scokaert
[Sco97] considers single-input systems, and expresses the last nu elements in ∆U (k),
namely the last nu elements of the computed input signal, in terms of the other. The
same can be done with multi-input systems, but other possibilities may be equally
sensible, such as selecting the last nu elements of the j 0 th input signal ∆ûj (k + i|k)
for i = Hu − nu , Hu − nu + 1, . . . , Hu − 1. But it is not clear whether it matters how
these nu elements are selected, even in the single-input case. The computational
saving is small — typically one has only one or two unstable modes — so it may be
as well to let the optimiser decide how to ‘use’ the equality constraints.2
Fake Algebraic Riccati Technique replaces this equation with an algebraic (time-
invariant) Riccati equation which looks like the one that occurs in infinite-horizon
LQ problems. If this equation has properties analogous to those which occur for
the (real) algebraic Riccati equation of infinite-horizon control, then stability can be
inferred. In order to develop the details we shall need to refer to Minitutorial 7, on
linear-quadratic optimal control.
Secondly, the LQ cost function weights ||x(k)|| and ||u(k)||, whereas in our standard
problem we weight ||z(k)|| and ||∆u(k)||. We can put our standard problem into the
LQ framework as follows. Introduce the augmented state ξ, and the new matrices
à and B̃:
x(k) A B B
ξ(k) = Ã = B̃ = (6.42)
u(k − 1) 0 I I
then the two models
are equivalent (with our usual definition ∆u(k) = u(k) − u(k − 1)). Furthermore,
||z(k)||Q = ||ξ(k)||Q̃ , where
T
Cz QCz 0
Q̃ = (6.44)
0 0
(where z(k) = Cz x(k) — recall (2.3)). So our standard predictive control problem
is the same as the LQ problem, if we replace A and B in the plant model by à and
B̃, and the weight QN −j−1 by Q̃N −j−1 in the cost function. (The weight RN −j−1
stays unchanged in the cost function, but of course it is now interpreted as the
weight which penalises ∆u(k).) The optimal control is obtained as ∆u(t + N − j) =
−K̃j−1 ξ(t + N − j), where K̃ is the state-feedback gain matrix obtained from (6.36)
when these substitutions have been made.
Thirdly, a single horizon N is used in the LQ cost function, whereas we use the two
horizons Hp and Hu . This is no problem so long as Hu ≤ Hp , because we can always
set RN −j−1 = ∞ for j ≥ Hu , which will effectively reduce the control horizon to
Hu .3
When we apply the receding horizon control strategy, we always apply the first
part of the finite-horizon control strategy, which means that we apply the constant
3
Note that the Riccati difference equation (6.35) becomes the Lyapunov equation Pj+1 =
A Pj A + Qj when Rj = ∞.
T
200 6. Stability
Finite Horizon:
We consider the problem of having an initial state x(t) at time t, and finding a
control sequence which will minimise the finite-horizon cost function
X
N −1
VN (x(t)) = {||x(t + j)||2QN−j−1 + ||u(t + j)||2RN−j−1 } + ||x(t + N )||2P0 (6.34)
j=0
and the optimal value of the cost (6.34) obtained in this way is VN (x(t))0 =
||x(t)||2PN .
Infinite Horizon:
Now suppose that the horizon becomes infinite (N → ∞), we consider the infinite-
horizon cost
and the weighting matrices are constant: Qj = Q, Rj = R. Then, if R > 0, the pair
(A, B) is stabilizable, and the pair (A, Q1/2 ) is detectable, then Pj → P∞ ≥ 0 (as
j → ∞), and (6.35) is replaced by the Algebraic Riccati Equation:
Hence
Kj → K∞ = (B T P∞ B + R)−1 B T P∞ A (6.40)
It can be proved that this feedback law is stabilising — otherwise the cost V∞ (x(t))
would be infinite — so that all the eigenvalues of the closed-loop state-transition
matrix A − BK∞ lie strictly within the unit circle (if the stated conditions hold).
The optimal cost is now V∞ (x(t))0 = ||x(t)||2P∞ .
Mini-Tutorial 7: Linear Quadratic Optimal Control
6.3. Fake Algebraic Riccati Equations 201
state-feedback law
(assuming no constraints for the present discussion). The big question now is, when
can this law be guaranteed to be stabilising? That is, when will all the eigenvalues
of à − B̃ K̃N −1 be guaranteed to lie inside the unit circle?
We now revert to using the notation which appears in the LQ problem, namely
we use A, Q, K, etc, with the understanding that these are replaced by Ã, Q̃, K̃
etc when necessary. (See Problem 6.) From the infinite-horizon LQ problem, it is
apparent (subject to the technical conditions: Q ≥ 0, (A, B) stabilisable, (A, Q1/2 )
detectable) that so long as the algebraic Riccati equation (6.39) has a positive semi-
definite solution (P ≥ 0), and a constant state feedback gain matrix is obtained from
this solution by the formula (6.40), then the resulting feedback law will be stable.
In the finite horizon problem we have the Riccati difference equation (6.35) instead
of (6.39). Let us suppose that we use constant weighting matrices: QN −j−1 = Q
and RN −j−1 = R, so that (6.35) becomes
Qj = Q − (Pj+1 − Pj ) (6.47)
But this is an algebraic Riccati equation (because the same matrix Pj appears on
both left and right hand sides). It has been called the Fake Algebraic Riccati Equa-
tion (or F ARE) because it does not arise directly from an infinite-horizon LQ prob-
lem. If this equation has a solution Pj ≥ 0, and if Qj ≥ 0, then applying the constant
state-feedback gain Kj (ie apply the same gain Kj at each time) will give a stable
feedback law, where Kj is obtained from Pj using (6.40). So, one way of ensuring
a stable (unconstrained) predictive control law is to ensure that the fake algebraic
Riccati equation
It should be emphasised that the FARE approach gives sufficient but not necessary
conditions for stability of predictive control laws. In particular, if the GP C formu-
lation of predictive control is used, in which P (0) is fixed as P (0) = Q = CyT Cy and
R = λI, and if the prediction and control horizons are made the same, Hp = Hu ,
then Pj can be shown to be monotonically nondecreasing, rather than nonincreas-
ing [BGW90]. Nevertheless, GP C laws can be stabilising, even with this choice of
horizons.
4
As is done in ‘information filter’ versions of the Kalman filter, and in recursive least-squares.
6.4. Using the Youla Parametrization 203
If the plant is stable, then it is known that the feedback system shown in Figure
6.3 is internally stable if and only if the block labelled Youla parameter is stable,
providing that the internal model is an exact model of the plant [Mac89, ZDG96].
This holds under rather general conditions; all the blocks shown in the figure can be
nonlinear operators, for example. Furthermore, for linear systems it is known that
every stable feedback system can be represented in this way (if the plant is stable)
— so nothing is lost by assuming this form. (The term ‘parameter’ here comes from
the fact that as the Youla parameter ranges over all stable systems, so it generates
all possible stabilising controllers for the given plant. But it is not just a number!)
d(k)
+
YOULA
u(k) + y(k)
PLANT
PARAMETER
+
INTERNAL −
MODEL
CONTROLLER
Figure 6.3: Youla parametrisation of all stable feedback systems (if the plant is
stable).
Let the Youla Parameter shown in Figure 6.3 have transfer function (matrix) Q(z),
and let both the Plant and the Internal Model have transfer function P (z). We have
so that
and hence
From this, it is very easy to obtain the correspondence in the other direction:
Q(z) = −K(z)H(z)[I + P (z)K(z)H(z)]−1 (6.54)
If the plant is unstable (and linear) then closed-loop stability can still be char-
acterised by the stability of the Youla parameter, but its definition in terms of the
controller becomes more complicated [Mac89, ZDG96]. Figure 6.3 has to be replaced
by a more complicated block diagram.
Example 6.4 All SISO FIR systems of order n are parametrized linearly by the n
terms of their pulse responses H(0), H(1), . . . , H(n − 1).
From Figure 6.3 it is apparent that u(z) = Q(z)d(z), where d is the output distur-
bance. But if Q(z) is an FIR filter of order n then Q(z) = H(0) + z −1 H(1) + . . . +
z −n H(n). Hence the control signal can be computed as
X
n
û(k + j|k) = ˆ + j − i|k)
H(i)d(k (6.55)
i=0
or, equivalently,
X
n
∆û(k + j|k) = ˆ + j − i|k) − d(k
H(i)[d(k ˆ + j − i − 1|k)] (6.56)
i=0
Note that ∆û(k + j|k) is linear in the pulse response coefficients H(0), . . . , H(n).
Furthermore, the disturbance estimates d(kˆ + j − i|k) do not depend on future inputs
û(k + j|k). So substituting (6.56) into (2.66), for instance, makes the state predic-
tions depend linearly on the pulse response coefficients, and hence the cost function
(2.19) is quadratic in these coefficients. So the problem remains quadratic.
Note, however, that the constraints on the input levels and the input moves are now
related to the ‘decision variables’, namely to the pulse response coefficients, through
transfer functions.
5
One consequence of this is that the minimisation of any induced norm of a closed-loop transfer
function, ||XQY + Z||, is a convex optimisation problem. The book [BB91] is devoted to exploiting
this.
6.5. Problems 205
6.5 Problems
1. Simulate the model and control law from Example 6.1 using MATLAB, and
check that the closed loop is unstable.
Recommended procedure: Create the state-space matrices a,b,c,d corre-
sponding to the closed-loop system, then create a Matlab object representing
this closed-loop system using:
clsys=ss(a,b,c,d,1);
(Use help ss to see what this does.) Then get the response from initial con-
dition x0=[1;0] — or some other initial condition — by typing
initial(clsys,x0);
2. Consider the plant given in Example 6.1 again. But now suppose that the
prediction horizon is Hp = 2, with the cost being
T 1 2 T 1 2
V (k) = x̂(k + 1|k) x̂(k + 1|k) + x̂(k + 2|k) x̂(k + 2|k)
2 6 2 6
(a) Keep Hu = 1, so that only u(k) is to be optimised, with the assumption
that u(k + 1) = u(k). Show that the predictive control law is u0 (k) =
− 16 x1 (k), and hence that the closed loop is stable.
(b) Now let Hu = 2, so that u(k) and u(k+1) have to be optimised. By setting
both derivatives (∂V /∂u(k)) and (∂V /∂u(k + 1)) to zero (or ∇u V = 0 if
you are happy with that notation) show that the predictive control law
is u0 (k) = − 23 x1 (k), and hence that the closed loop is stable.
(c) Simulate the closed-loop behaviours for these two cases, using MATLAB.
(Note that the Model Predictive Control Toolbox does not allow non-diagonal
weights.)
3. Consider Example 6.1 again, and Problem 2. Solve and simulate them using
the Model Predictive Control Toolbox. However, the Toolbox only allows diago-
nal weighting matrices to be specified. If you have solved Problem 7 of Chapter
3, then you can keep the original non-diagonal weight. Otherwise change the
weight to diag(1,6) (that is, just keep the diagonal elements). Unfortunately
this will not give the same results, but it is still a good exercise to see how the
results differ for the cases
• Hp = Hu = 1
• Hp = 2, Hu = 1
• Hp = Hu = 2
4. Verify that Q̄ is given by (6.30) and (6.31) in the case of an unstable plant.
5. For the plant
x(k + 1) = 0.9x(k) + 0.5u(k), y(k) = x(k)
suppose that the infinite-horizon case (Hp = ∞) is to be solved.
206 6. Stability
Verify that if
16 0
PN −1 = (6.58)
0 16
Tuning
There are many adjustable parameters in predictive control, even in the standard
formulation:
• Weights
• Horizons
• Reference Trajectory
In this chapter we shall examine the effects of these, try to obtain some insight into
the effects of these parameters, and some systematic methods of adjusting them.
It will be seen that tuning can be based on a few theorems, but it is mostly a matter
of ‘rules of thumb’, based largely on experience gained from simulations of ‘typical’
problems.
More can be said in the case of single-input, single-output (SISO) plant, than in
the (more important) case of multivariable plant. In particular, Soeterboek [Soe92]
gives more details for the SISO case than we give here.
• Feedback is dangerous.
207
208 7. Tuning
Feedback is dangerous because it can, among other things, destabilise systems which
are themselves quite stable. The reason for using feedback is that it can be a very
effective strategy for reducing the effects of unexpected and unmeasurable distur-
bances, and for reducing the effects of uncertainty about the behaviour of a system.
It is important to realise that this is the only justifiable reason for using feedback.
(One important application of feedback is to stabilise unstable plant. But it can
be argued that this is also necessary because of some uncertainty: if the model and
initial conditions were known perfectly, then it would be possible to stabilise an
unstable plant using an open-loop strategy.)
It follows that simulating the response to a step set-point change is not a meaningful
way of assessing a feedback system, except under very special circumstances. If we
really wanted to follow a set-point, and there were no uncertainty, then the best way
to do it would be by using an open-loop pre-computed control signal. Looking at
set-point step responses is meaningful only under the following circumstances:
• If the set-point step response allows us to deduce something about the robust-
ness — insensitivity — of the closed-loop behaviour to modelling errors.
This is typically the case with linear control systems.
• If the set-point step response can be easily related to the way in which the
feedback loop deals with disturbances.
This is true for ‘one degree of freedom’ linear feedback systems, in which the
set-point response completely determines the disturbance response. This is
typically not true for predictive control systems.
• If the step response allows us to deduce how the system would respond to
other signals.
This is true for linear systems. It is therefore true for most predictive control
systems so long as the constraints are inactive, but not otherwise.
Figure 7.1 shows a ‘two degree of freedom’ feedback system. It shows the set-point
signal being filtered by the pre-filter F (z) before becoming the ‘reference’ input
to the feedback loop. It also shows the part of the controller which is inside the
feedback loop split into two transfer functions, K(z) in the ‘forward path’, and H(z)
in the feedback path. This is done to have a similar structure to that shown for the
unconstrained predictive controller in Figure 3.2. We will assume, for simplicity,
that the measured and controlled outputs are the same: z(k) = y(k).
Apart from the set-point signal s, the figure shows an output disturbance d and
measurement noise n entering the system. We need to find the transfer functions
relating these input signals to the plant input and output signals u and y. We do this
for the general case, with each signal being a vector, and so each transfer function
being a matrix. We write ȳ(z) for the z-transform of y(k), and similarly for other
7.1. What Are We Trying To Do? 209
PLANT d
+
s r e u +
F (z) K(z) P (z)
+ y
−
H(z)
CONTROLLER +
n +
signals.
¯ + P (z)K(z)ē(z)
ȳ(z) = d(z) (7.1)
ē(z) = F (z)s̄(z) − H(z)[n̄(z) + ȳ(z)] (7.2)
so
and hence
Finally, we have
¯ + S(z)P (z)K(z)F (z)s̄(z) − T (z)n̄(z)
ȳ(z) = S(z)d(z) (7.5)
where
Roughly speaking, the ‘smaller’ the sensitivity function, the better the feedback
action, in the sense that the effect of the output disturbance d is kept small. It
210 7. Tuning
can also be shown that the sensitivity of the closed-loop performance to open-loop
changes depends on S(z), and is small if S(z) is ‘small’ in some sense. On the other
hand, the ‘smaller’ the complementary sensitivity T (z), the smaller is the effect of
measurement noise. It can also be shown that the ‘gain’ of T (z) is a kind of stability
margin: if T (z) is ‘large’ in some sense, then a small plant-model mismatch may
cause the feedback loop to be unstable. Note that S(z) and T (z) are completely
determined by each other, because
S(z) + T (z) = I (7.8)
It is therefore not possible to have both S(z) and T (z) very ‘small’ (near 0) simul-
taneously. However, if measured by their frequency responses, it is possible to have
both S(z) and T (z) very large simultaneously (because the frequency responses are
complex quantities); so it is certainly possible to have very bad feedback designs,
although there are limits to how good they can be.
Note that the response of the output to the set-point can be designed independently
of the response to disturbances or noise, by means of the pre-filter F (z). Actually,
even without F (z) it can be designed independently if K(z) and H(z) can be de-
signed independently. However in the predictive controller it is not easy to influence
these two independently of each other. But it should be noted that, even without
a pre-filter (F (z) = I), the response of the output to set-point changes — trans-
fer function S(z)P (z)K(z) — is significantly different from the response to output
disturbances — transfer function S(z).
The formulation of the predictive control problem emphasises tracking the reference
signal r, subject to constraints. This is supposed to be a nice, intuitive formulation
which can be easily related to real-world requirements. But we can see that this is
only partly true. It is easily related to tracking requirements and to real constraints,
but not at all easily related to good feedback properties.
Recall that the main reason for using predictive control is its ability to handle
constraints. This means that when tuning a predictive controller, we should consider
its performance — including its feedback properties — when constraints are active.
Unfortunately, we have few theoretical tools to help us do this — or even to formulate
appropriate measures of performance under these conditions. We have to rely on
simulation to assess performance with active constraints, because we have little else
for the time being. In this chapter we shall devote most space to the case when
constraints are not active, because then the controller is linear and we can do some
analysis. But the reader should be aware that this is a rather distorted emphasis,
forced by necessity.
We can look at some special choices of parameters, and deduce heuristically how the
predictive controller will then behave.
7.2. Some Special Cases 211
Note first that increasing the weights R(i) on the control moves relative to the
weights Q(i) on the tracking errors has the effect of reducing the control activity
— recall the cost function (2.19). (In some MPC products the elements of R(i) are
called move supression factors for this reason.) Increasing these weights indefinitely
will reduce the control activity to zero, which ‘switches off’ the feedback action.
If the plant is stable, this will result in a stable system, but not otherwise. Thus
with a stable plant, we can expect to obtain a stable closed loop by increasing the
control weighting sufficiently. The penalty of doing this will be slow response to
disturbances, since only small control actions will result. With an unstable plant we
can expect an unstable feedback loop, if the R(i)’s are increased too much.
We have already seen in Chapter 6 that there are better ways of ensuring closed-loop
stability than using heavy penalty weights R(i).
Suppose that the plant is stable. Choose Hu = 1 and R(i) = 0. Suppose that the
reference trajectory changes to a new constant value: r(k +i) = r1 . So the predictive
controller tries to minimise
X
Hp
||ŷ(k + i|k) − r1 ||2Q(i) (7.9)
i=Hw
using only one control move ∆u(k). If Hw is fixed and Hp → ∞, clearly the optimal
thing to do is to move the control to that level which will give y = r1 in the
steady-state. So in the absence of any disturbances the control signal will be a
step (vector). The transient response at the plant output will therefore just be the
open-loop response of the plant. That is, we will have, assuming a ‘square’ plant:
r1
ȳ(z) = P (1)−1 P (z) (7.10)
1 − z −1
where the ‘zero-frequency plant gain’ P (1) has been introduced to adjust the steady-
state level correctly. Comparing this with (7.5) we see that
1
S(z) = (7.12)
P (1)K(z)
which is the transfer function that governs the response to output disturbances. It
turns out that making the observer dead-beat (placing all the eigenvalues of A − LC
212 7. Tuning
Note that the discussion here is consistent with Problem 3 of Chapter 4, which shows
that the controller is non-dynamic if the parameters are chosen as for mean-level
control, and with full state measurement.
It has been argued that mean-level control is suitable for many applications: it
allows the plant to follow set-point changes at its ‘natural’ rate, while being able to
react to disturbances very quickly — at a rate determined by the observer design
(or the choice of the polynomial C(z −1 ) in the transfer-function formulation).
Now suppose that Hw = Hu = n, the number of states in the plant, together with
any additional states needed for the disturbance model. Again take R(i) = 0, assume
that r(k + i) = r1 , and this time choose Hp ≥ 2n. So now the cost function being
minimised is
X
2n
||ŷ(k + i|k) − r1 ||2Q(i) (7.13)
i=n
Now the idea is that the controller has enough time to drive the output to r1 and
leave it there thereafter — in general, at most n steps are needed to do this. Since
Hw = n, errors do not start entering the cost function until the set-point has been
achieved exactly. Consequently this strategy achieves zero cost, and hence it is the
optimal one.
The reason for making Hp ≥ 2n is to have a long enough costing interval. This
ensures that the output remains at zero for at least n steps, which is enough to
ensure that there are no ‘delayed modes’ inside the controller which might emerge
in the future.
This behaviour can only be explained by a ‘dead-beat’ closed loop. That is, all the
closed-loop poles are at zero. So we have, from (7.5):
N (z)
S(z) = (7.15)
z n P (z)K(z)
which shows that S(z) (and hence T (z)) is likely to contain the zeros of the plant
among its poles (if they are not cancelled by poles of K(z) or zeros of N (z)). This
would lead to instability if P (z) had zeros outside the unit disk, and to very resonant
7.2. Some Special Cases 213
behaviour if P (z) had zeros close to the unit disk. (Plants with zeros outside the
unit disk usually exhibit ‘inverse response’, and are often called non-minimum-phase
plants.) Again a detailed treatment of dead-beat control is given in [CM89].
If the sampling interval is small then the control signals needed to achieve dead-beat
control may be too agressive to be usable, in which case the expected behaviour will
not be obtained because input constraints will be active. But in a sense ‘mean-
level’ control and ‘dead-beat’ control are two extremes obtained with R(i) = 0.
The main ‘parameter’ for moving between them is the combination of control and
window horizons, Hu and Hw . (Note that the dead-beat behaviour is not obtained
if Hw < n.)
Now we examine the case which the Model Predictive Control Toolbox User’s Guide
calls the ‘perfect’ controller. This is obtained by choosing Hu = Hp = 1 and
R(i) = 0. In this case the cost being minimised is ||ŷ(k + 1|k) − r(k + 1)||2Q(i) .
Clearly the ‘optimal’ thing to do in this case is to choose the input signal so that the
next output matches the reference as closely as possible, without taking any account
of future consequences. The easiest way to see the result of this is to consider the
scalar case:
B(z −1 )
ȳ(z) = P (z)ū(z) = ū(z) (7.16)
A(z −1 )
But if this is done at each step, then we will eventually have — assuming no distur-
bances — y(k) = r(k), y(k − 1) = r(k − 1), etc, so that eventually we will have
which shows that the controller is essentially the inverse of the plant in this case.
As with the dead-beat controller, this will lead to an unstable feedback loop if the
plant has zeros outside the unit disk, and unacceptable performance if it has zeros
214 7. Tuning
close to the unit disk — but for a different reason. This time the zeros of B(z −1 )
will not show up in the poles of S(z) or T (z), because they will be cancelled when
forming the product of the controller and the plant transfer functions P (z)K(z)H(z).
But there will be ‘internal instability’ due to the cancellation of unstable poles with
unstable zeros, which will show up as an unstable transfer function between the
disturbance d and the plant input u.
Example 7.1 We apply predictive control, without constraints, to the Paper Ma-
chine Headbox described in Example 2.2. Recall that there are 2 inputs:
But we will control only outputs 1 and 3, which is achieved in the Model Predictive
Control Toolbox by setting the output weight to ywt=[1,0,1] (as in the Toolbox
demo file pmlin.m).
So the plant is stable, with real negative zeros. (Using variable names as in the demo
file pmlin.m, the poles are computed using eig(PHI), while the zeros are computed
using
tzero(PHI,GAM,C([1,3],:),D([1,3],:))
where only the first and third rows of C and D are used, since we are only controlling
outputs 1 and 3.)
Outputs
1
0.8
0.6
0.4
0.2
−0.2
−0.4
0 5 10 15 20 25 30
Time (minutes)
Inputs
1.6
1.4
1.2
0.8
0.6
0.4
0.2
0 5 10 15 20 25 30
Time (minutes)
Outputs
1.4
1.2
0.8
0.6
0.4
0.2
0
0 5 10 15 20 25 30
Time (minutes)
Inputs
0.4
0.2
−0.2
−0.4
0 5 10 15 20 25 30
Time (minutes)
Figures 7.4 and 7.5 show the responses to a unit step unmeasured disturbance acting
on the states. Of these the first shows the responses with the default (DMC) observer
gain of [0, I]T , while the second shows the response with a deadbeat observer. In the
latter case the oscillatory nature of the input signals shows the presence of negative
216 7. Tuning
real observer poles, which originate from the negative real zeros of the plant. The
disturbance is reduced more effectively, however. In each case the response to set-
point changes is exactly the same — the observer design does not affect it.
Outputs
0.6
0.5
0.4
0.3
0.2
0.1
−0.1
0 5 10 15 20 25 30
Time (minutes)
Inputs
0.3
0.2
0.1
−0.1
−0.2
−0.3
−0.4
0 5 10 15 20 25 30
Time (minutes)
Outputs
0.6
0.5
0.4
0.3
0.2
0.1
−0.1
0 5 10 15 20 25 30
Time (minutes)
Inputs
0.3
0.2
0.1
−0.1
−0.2
−0.3
−0.4
0 5 10 15 20 25 30
Time (minutes)
Observer design in the Model Predictive Control Toolbox needs a few tricks, because
7.2. Some Special Cases 217
the Toolbox uses the augmented state vector [∆xT , y T ]T , as described in section 2.4.
This model is obtained from the ordinary one using function mpcaugss. The deadbeat
observer was designed as follows:
Here the function place is used to place the observer poles at the locations specified
in the vector. (The augmented system has 7 states.) Ideally these would all be at
0, but place allows the multiplicity of each pole to be no greater than the number
of outputs, which is 3 in this case. So 3 poles were placed at 0, 3 at 0.01, and 1 at
0.005. This should result in behaviour rather close to deadbeat.
0.5
−0.5
−1
0 5 10 15 20 25 30
Time (minutes)
Inputs
1.5
0.5
0
0 5 10 15 20 25 30
Time (minutes)
ywt = [ 0 0 0
0 0 0
218 7. Tuning
0 0 0
0 0 0
1 0 1 ]
Perfect Control. Finally, Figures 7.7 and 7.8 show the set-point step responses with
Hu = Hp = 1. This gives the so-called ‘perfect’ controller; as expected, the negative
real plant zeros now appear as poles of the closed-loop set-point response, which is
seen by the oscillatory nature (‘ringing’) of both the control inputs, and one of the
plant outputs.
Outputs
2
−1
−2
−3
−4
−5
0 5 10 15 20 25 30
Time (minutes)
Inputs
5
−1
0 5 10 15 20 25 30
Time (minutes)
Examining time responses gives only part of the story about feedback performance.
Frequency response analysis helps to complete the picture — see Minitutorial 8 for
an introduction. Frequency responses can be generated directly from a state-space
model, without computing a transfer function first. For example, using (4.74) the
frequency response of P (z) can be obtained by evaluating
for a set of values of ω. Since we can write all the equations governing the closed loop
plant-controller combination in state-space form, it is straightforward to compute
7.3. Frequency-Response Analysis 219
Outputs
3
2.5
1.5
0.5
−0.5
0 5 10 15 20 25 30
Time (minutes)
Inputs
1.5
0.5
−0.5
−1
−1.5
0 5 10 15 20 25 30
Time (minutes)
any frequency response we like, connected with a predictive control system - so long
as constraints are not active.1
Note: In the Model Predictive Control Toolbox it should be easy to compute the
frequency responses of the sensitivity and complementary sensitivity functions S(z)
and T (z) using functions mod2frsp and smpccl, and using plotfrsp or svdfrsp to
see the corresponding Bode plots. However the closed-loop model formed by smpccl
has additional inputs and outputs which must be removed in order to get T (z) —
you have to select the first ` inputs and the first m outputs, using mod2ss to get at
the individual state-space matrices, and ss2mod to put them together again.
Example 7.2 Figure 7.9 shows the singular values of the sensitivity S(z) and the
complementary sensitivity T (z) for the mean-level control of the paper machine head-
box, using the default (DMC) observer. This shows that σ̄[T (z)] reaches a peak value
of almost 2. This √is a little higher than is usually considered acceptable for a good
feedback design. ( 2 is often taken as a ‘good’ peak value, but this is application-
dependent to some extent.)
Note that there are two singular values of each of S and T at each frequency, because
only two outputs have been retained — the headbox level and the headbox consistency
— so that S(z) and T (z) are 2 × 2 transfer function matrices. The plots are shown
1
Since we showed in Chapter 3 that a predictive controller is linear and time-invariant so long
as the set of active constraints remains fixed, it is also possible to perform a frequency response
analysis for a given fixed set of active constraints.
220 7. Tuning
SISO feedback design is often performed using open-loop frequency responses, us-
ing Nyquist’s theorem to ensure stability of the closed loop, and judging stability
margins by the ‘closeness’ of the Nyquist locus to the point −1. With multivariable
systems it is not so useful to examine open-loop frequency loci (although Nyquist’s
theorem still holds, in a generalised form [Mac89]). But if SISO design rules are
interpreted in terms of the closed-loop transfer functions S(z) and T (z), then it is
possible to generalise them to the multivariable case quite easily.
With reference to Figure 7.1, if we let C(z) = K(z)H(z) then S(z) = [I +
P (z)C(z)]−1 , or in the SISO case, S(z) = 1/[1 + P (z)C(z)]. So in the SISO case,
the reciprocal of the smallest distance between the point −1 and the Nyquist locus
of P (z)C(z) is the peak value of |S(ejωTs )|. So the bigger this peak, the smaller the
stability margin. This generalises to the multivariable case as follows.
The ‘gain’ of a multivariable system depends on the ‘direction’ of the input signal.
If a finite-energy signal is applied at the input of a stable system, the output is
also a finite-energy signal. At a given frequency ω, we can define the ‘gain’ of a
multivariable system as the largest amplification (output energy / input energy) for
any possible input direction. It turns out that this can be measured as the largest
singular value of the frequency response matrix evaluated at the given frequency.
This is a consequence of the fact that the largest singular value is an induced norm
for matrices — see Minitutorial 4:
where σ̄ is used to denote the largest singular value. So in the multivariable case
one can display σ̄[S(ejωTs )] on a Bode plot, and take the peak value as an indication
of the stability margin. (Rigorous interpretations in terms of robustness to plant
modelling error can be given [Mac89, ZDG96].)
Another criterion traditionally used for SISO design is the ‘peak M -value’, and is
another measure of how closely the open-loop Nyquist locus approaches the point
−1. But this is nothing other than the peak value of |T (ejωTs )|. Again this can
be generalised to the multivariable case: plot σ̄[T (ejωTs )] on a Bode plot, and read
off the peak value. Again this value can be interpreted rigorously as a robustness
measure. Note that large peak values of σ̄[S(ejωTs )] or σ̄[T (ejωTs )] can only occur
as a result of ‘resonant’ closed-loop poles lying very close to the unit circle. So not
only do they indicate a danger of losing stability, but also the fact that some signals
in the loop are likely to exhibit ‘ringing’ (lightly damped oscillations).
Apart from the peak values, the plots of σ̄[S(ejωTs )] and σ̄[T (ejωTs )] can be used to
see the frequencies at which the feedback loop rejects disturbances (small σ̄[S(ejωTs )]
is good), and how well it filters out measurement noise (small σ̄[T (ejωTs )] is good).
These two objectives conflict with each other.
Singular values of other closed-loop transfer functions can also be plotted if appro-
priate. Modern multivariable robust control theory emphasises the importance of
examining the transfer functions S(z)P (z) and C(z)S(z) in addition to S(z) and
T (z).
Note that the singular value plots do not indicate whether the closed loop is stable.
That has to be checked independently (eg by computing the closed- loop poles). If
it is stable, they can be used to indicate whether the stability is ‘robust’ or ‘fragile’.
Mini-Tutorial 8: Interpreting Frequency Responses
7.4. Disturbance Models and Observer Dynamics 221
1
10
0
10
−1
10
−2
10
−3
10
−3 −2 −1 0 1
10 10 10 10 10
Frequency (rad/min)
Figure 7.9: Singular values of S(z) (solid line) and T (z) (broken line) for mean-level
control of the headbox.
up to the Nyquist frequency π/Ts = π/2 rad min−1 (recall that the sampling interval
is Ts = 2 minutes for the headbox).
This example shows that the mean-level controller for the paper machine headbox is
not very good, as a feedback controller. The design parameters can be altered to try
to improve its performance in this respect. But at present there is little knowledge
of how to change them systematically, so as to improve performance. So we have
good analysis tools, but the design is still to a large extent a matter of trial and
error. Some progress towards a systematic approach has been reported in [LY94].
Two very important tuning ‘parameters’ in predictive control are the choice of dis-
turbance model, and the choice of observer dynamics. In the transfer function
formulation this corresponds to the choice of the D(z −1 ) and C(z −1 ) polynomials,
222 7. Tuning
respectively. In GPC D(z −1 ) = (1−z −1 )A(z −1 ) is fixed, so only the choice of C(z −1 )
remains. In DMC both are fixed.
The essential fact about the disturbance model is that its poles become poles of
the (open-loop) controller. So both the DMC and the GPC disturbance models
(poles at +1) result in the controller having integral action, and hence offset-free
tracking (zero steady-state error) in the presence of constant output disturbances.
This is an example of a more general phenomenon, known as the Internal Model
Principle [Won74].2 Suppose that a ‘persistent’ deterministic disturbance acts on
a system — that is, one which does not decay to zero. Examples encountered in
practice can often be approximated by constant, ramp or sinusoidal signals, but in
principle the discussion applies to any signals which have poles on or outside the
unit circle. Then a feedback controller can compensate perfectly for that disturbance
— asymptotically with time — only if the poles of the disturbance signal appear
among the poles of the controller. (The detailed requirements are a little stronger:
the controller must have an ‘internal model’ whose state-space structure is the same
as that of the disturbance.) When we augment the internal model of a predictive
controller by a disturbance model, we are responding to the requirements of this
principle.
Example 7.3 Using the DMC/GPC disturbance model gives integral action in the
controller. Consequently constant disturbances are rejected perfectly (asymptotically
with time). Therefore the steady-state gain from output disturbances to controlled
outputs should be zero. But this is the zero-frequency response of the transfer function
relating d to y in Figure 7.1. So, from (7.5), we expect S(1) = 0. (Remember that
ω = 0 corresponds to z = 1.) Looking at the frequency response plots for Example
7.2, we see that indeed σ̄[S(ejωTs )] approaches zero as ω → 0. Furthermore, the slope
of the graph is 20 dB per decade of frequency, as expected from a single integrator
in the controller — there are actually two integrators in this controller, one for each
output.
Since T (z) + S(z) = I, we also expect T (1) = I. This is confirmed by the fact that
both singular values of T (z) become 1 (0dB) at low frequencies.
Augmenting the plant model with a disturbance model certainly makes it possible
for the controller to exhibit the disturbance poles, but does not seem to be sufficient
to ensure that this occurs. After all, the poles of the plant do not usually appear
as poles of the controller, even though the plant model is made available to the
controller in a similar way.
It is possible to understand how the DMC model leads to integral action without a
technical derivation. One explanation was already given in section 1.5; here we give
2
The Internal Model Principle, due to Wonham, should not be confused with Internal Model
Control, a way of looking at feedback systems due to Morari [GM82, MZ88], and originally intended
as a way of understanding predictive control.
7.4. Disturbance Models and Observer Dynamics 223
another one. The essential property of a controller with integral action is that it is
impossible for the closed-loop system to be at an equilibrium unless the error e, as
shown in Figure 7.10, is zero. (The figure shows a ‘PI’ controller for illustration.)
Because if it is non-zero, then the output of the integrator will change, and so the
plant input u will not remain constant. Now consider a predictive controller with the
DMC disturbance model. Suppose, for simplicity, that all set-points are constant.
At each step the controller estimates the magnitude of an output disturbance, and
produces a control signal to counteract it. Typically the estimate will be incorrect,
so that the plant outputs will move to different values than those predicted. The
ˆ
predictive controller attributes this difference to a changed disturbance (d(k|k) =
y(k) − ŷ(k|k − 1)), and revises its estimate, thus producing a new control signal.
If the disturbance is actually constant — and the closed-loop is stable — then
the controller iteratively ‘learns’ the magnitude of the disturbance in this way, and
eventually compensates for it exactly. It is therefore impossible for the closed-loop
system to be at an equilibrium unless the outputs are at their set-points, which
is precisely the key property of integral action. (This discussion assumes that no
constraints are active. Similarly for the PI controller, the discussion assumes that
the integrator is not saturated.)
PI CONTROLLER
u y
e
Kp PLANT
+ +
− +
Ki
s
In general the ‘internal model principle’ works for persistent disturbances, such as
ramps and sinusoids, because such disturbances can be predicted perfectly, and hence
corrected for, once the initial conditions which specify a particular ramp or sinusoid
have been estimated. The principle demands that the dynamic equation governing
such a disturbance should be included in the controller, and a (stable) observer
should then be used to estimate the initial conditions. The disturbance dynamics
in the augmented model are not controllable from the plant input u. Recall that a
typical augmented model is of the form:
xp (k + 1) Ap X xp (k) Bp
= + u(k) (7.23)
xd (k + 1) 0 Ad xd (k) 0
These dynamics therefore remain unchanged as eigenvalues of the closed-loop, be-
cause in effect there is no feedback loop around them. They do not, however, appear
224 7. Tuning
in any of the closed-loop transfer functions, since only modes which are both con-
trollable and observable appear as poles of transfer functions.
Ψ u(k − 1)
Υ z −1 I
x̂(k|k) A
+
x̂(k|k − 1) +
z −1 I B
+
+
Cy
L0
OBSERVER
−
+ y(k)
This block-diagram can be simplified slightly to the one shown in Figure 7.12, and
then again to the one shown in Figure 7.13.
This confirms that the measured outputs are filtered before affecting anything in the
controller, and that the poles of the filter are the observer eigenvalues. This filtering
7.4. Disturbance Models and Observer Dynamics 225
Ψ u(k − 1)
Υ z −1 I
x̂(k|k) A
+
+
I − L 0 Cy z −1 I B
+
+
y(k)
L0
OBSERVER
will clearly affect the response of the controller to disturbances — since it detects
them only through the measured outputs — and the stability of the closed loop.
One could go on to obtain an expression for the forward path transfer function
K(z), but that would give a rather complicated expression which would not be very
illuminating.
Note that if constraints are active, the measured outputs y(k) are still filtered by a
filter with the same poles, in order to form the state estimate x̂(k|k). The nonlinear
effects arise afterwards, in the optimization.
So how should one choose the observer dynamics? Choosing deadbeat dynamics
gives a fast response to disturbances. But if the magnitudes of typical disturbances
are such that this leads to frequent saturation of actuators, then it may be better to
accept a slower response to disturbances, reserving actuator saturation for dealing
with exceptional large disturbances. Also, if the observer dynamics are made fast,
then the system will react relatively strongly to high-frequency variations in the
measured output signal. If there is an appreciable amount of measurement noise
in this signal, it may be better to have slower observer dynamics, in order to have
some low-pass filtering of the noise. (This is the usual feedback design trade-off
between small S(z) and small T (z).) If statistical information is available about
the relative strengths of disturbances and noise, then the optimal trade-off for state
226 7. Tuning
−1
z −1 (I − L0 Cy ) I − z −1 A(I − L0 Cy ) B
+
+
−1 y(k)
I − z −1 A(I − L0 Cy ) L0
estimation can be made by using Kalman filter theory to design the observer. If such
information is not available, Clarke [Cla94] advocates using the observer polynomial
C(z −1 ) = A(z −1 )(1 − βz −1 )Hw , noting that β = 0.8 seems to be always satisfactory.
(This assumes the GPC disturbance model, so that D(z −1 ) = (1 − z −1 )A(z −1 ).)
Consider the swimming pool of Problem 3 of Chapter 3. That problem showed that
a predictive controller with the standard ‘DMC’ disturbance model does not com-
pensate perfectly for a sinusoidal diurnal variation of the air temperature if the air
temperature is not measured. With the particular choice of parameters used there
and a 10 degC amplitude of the air temperature, the water temperature oscillates
with an amplitude of about 0.5 degC if there are no constraints on the heater power.
Problem 1 of Chapter 5 then showed that if the air temperature is measured and used
for feedforward control, then the air temperature is perfectly compensated, providing
that the model is perfect. If there is some modelling error then a residual oscillation
of the water temperature remains, although it typically has smaller amplitude than
when the air temperature is not measured.
can be removed completely, even if the model is not perfect. This can be done as
follows.
First, note that it is reasonable to assume that we know that the air temperature
variation is sinusoidal, and its period, from our knowledge of the physical situation.
The amplitude and phase of the variation, however, are not known in advance. Thus
we can model the air temperature by the differential equation
2
2π
θ̈a + θa = 0 (7.26)
24
with unknown initial conditions on θ and θ̇, which will determine the amplitude and
phase. Choosing state variables θa and θ̇a gives the state-space model
d θa 0 1 θa
= 2 (7.27)
dt θ̇a − 2π 24 0 θ̇a
The corresponding discrete-time model for the nominal parameters T = 1 hour and
k = 0.2 degC/kW, when the sampling interval is Ts = 0.25 hour, is
θ 0.7788 0.2210 0.0288 θ 0.0442
θa (k + 1) = 0 0.9979 0.2498 θa (k) + 0 q(k)
θ̇a 0 −0.0171 0.9979 θ̇a 0
(7.29)
If this plant model is used for predictive control, together with the standard ‘DMC’
estimator, then no improvement of performance is obtained — a residual oscillation
of the water temperature remains, as before. The reason is that the ‘DMC’ estimator
yields an observer whose poles are the plant’s poles and a pole at 0 — see the analysis
in section 2.6.3. But the plant poles include the two disturbance poles on the unit
circle, so the observer is not asymptotically stable. The result is that any initial
error in estimating the initial conditions θ(0), θ̇(0) results in an oscillating, but not
reducing, error as measurements of θ become available. The remedy for this is to
use an alternative observer gain, which will make the observer asymptotically stable.
In Example 7.1 we used ‘pole placement’ to obtain the observer gain. Here we
will pretend that the model of the air temperature disturbance is subject to random
disturbances, and that measurements of the water temperature are subject to random
noise. We will then use Kalman filter theory to obtain the observer gain. When
228 7. Tuning
the state vector has only 3 elements, as here, both methods will work; but when the
state dimension becomes larger than about 5, only the Kalman filter method remains
useful in practice. In order to do this, the model (7.29) has to be modified to admit
another input w, which is the random disturbance on θ̇:
θ 0.7788 0.2210 0.0288 θ 0.0442 0
θa (k + 1) = q(k)
0 0.9979 0.2498 θa (k) + 0 0
w(k)
θ̇a 0 −0.0171 0.9979 θ̇a 0 1
(7.30)
and the output equation has to be modified to admit measurement noise v:
θ
θ(k) = 1 0 0 θa (k) + v(k) (7.31)
θ̇a
Now making various assumptions about the variances W and V of w and v, respec-
tively, gives various observer gains, and hence various observer pole locations. Note
that this modification of the model is needed only for computing the observer gain;
it is not needed for the internal model in the controller, which should be (7.29).
Since the Model Predictive Control Toolbox uses the augmented state vector (2.37)
described in section 2.4, there are 4 state variables when working through this ex-
ample with the Model Predictive Control Toolbox, and hence 4 observer poles. The
choice W = 1, V = 10−6 gives observer poles (eigenvalues of A(I − L0 C) in (7.24))
at −0.5402, −0.1783, and 0.0562 ± 0.0618i. These are all within the unit circle, so
the observer is asymptotically stable, as expected. Since V is very small relative to
W , the measurements are considered to be very accurate, and hence the estimation
of θa (0) and θ̇a (0) by the observer is very fast, as shown by the two poles very close to
the origin. (Deadbeat estimation —poles at zero — would be expected with V = 0.3
This leads to relatively agressive control action. Figure 7.14 shows the resulting
performance of the predictive controller. This figure was produced using the Model
Predictive Control Toolbox function scmpc, which sets the initial states of both the
plant and the internal model to zero at the beginning of the simulation. There is
therefore an initial transient, lasting about 10 samples, or 2.5 hours, during which
the air temperature disturbance is estimated and the water temperature is brought
up to its set-point of 20 degC. Once this transient has been completed, the set-point
is held very accurately, with perfect compensation for the sinusoidal air temperature
variation. Note that, in addition to compensating for the sinusoidal variation, which
is due to the inclusion of the model (7.27), the controller also compensates for the
mean air temperature (15 degC), even though it does not know the value of k/T
accurately; this is due to the use of the augmented state, which results in the DMC
constant-disturbance model being included implicitly.
The results shown in Figure 7.14 were obtained with the controller having a perfect
model of the plant — that is, correct estimates of the parameters T and k (1 hour and
3
The observer gain was computed using the Model Predictive Control Toolbox function smpcest.)
This function requires V to be positive definite.
7.4. Disturbance Models and Observer Dynamics 229
25
Temperature (deg C)
20
15
10
0
0 5 10 15 20 25 30 35 40 45 50
Time (hours)
Manipulated Variables
600
400
Heater power (kW)
200
−200
−400
0 5 10 15 20 25 30 35 40 45 50
Time (hours)
Figure 7.14: Control of water temperature with perfect plant model, and model of
air temperature disturbance. W = 1, V = 10−6 . The broken line shows the air
temperature.
0.2 degC/kW, respectively). If the same controller is applied when the parameters
change to T = 1.25 hour and k = 0.3 degC/kW then the closed loop is unstable. If the
observer is re-designed on the assumption that W = 1 and V = 1 then the observer
poles become 0.7397± 0.3578i and 0.6118± 0.1136i. Since the measurements are now
assumed to be much more noisy, the observer estimates the disturbance more slowly,
but remains asymptotically stable. The control is now less agressive, as is shown by
the solid line in Figure 7.15. The initial transient lasts longer than before: about 20
samples, or 5 hours. The benefit of this ‘de-tuning’ is that the control is now much
more robust. If the same controller is applied to the pool when the parameters change
to T = 1.25 hour and k = 0.3 degC/kW then the closed loop remains stable, and the
response is almost unchanged — this is shown by the broken line in Figure 7.15. The
most important thing to notice here is that the compensation of the sinusoidal air
temperature variation remains perfect, although the controller now has the incorrect
values of the parameters T and k. This illustrates that modelling the disturbance
correctly gives robust disturbance compensation, even when the disturbance is not
measured.
The responses shown in Figures 7.14 and 7.15 were obtained with no constraints on
the heater power. In particular, the heater power was allowed to be negative at those
230 7. Tuning
Water temperature
30
25
20
Temperature (deg C)
15
10
0
0 5 10 15
Time (hours)
Figure 7.15: Control of water temperature with model of air temperature distur-
bance. Perfect (solid line) and imperfect (broken line) models. W = 1, V = 1.
times when the air temperature exceeded the set-point temperature. If the heater
power is limited to
0 ≤ q ≤ 60 kW
then the responses shown in Figure 7.16 are obtained when the same controller as
used in Figure 7.15 is used, with an imperfect model. The controller now cannot
correct for the air temperature rising above the set-point, but the notable feature is
that it still compensates perfectly at other times. It is able to do this only because it
is aware of the actual power that the heater is providing, so that its estimate of the
air temperature remains accurate, even when it cannot provide effective control.
The model of an unmeasured persistent disturbance does not have to be perfect; even
a mild improvement on the ‘constant disturbance’ assumption can lead to a big im-
provement in performance. Problem 6 demonstrates that a big improvement can be
obtained by assuming that the air temperature varies as a ramp, even if it actually
varies sinusoidally. The explanation of this is that the observer is constantly re-
estimating the disturbance as a ramp, and this allows the controller to predict the
sinusoidal disturbance quite well over a short interval.
All the responses shown for this example were computed and displayed using the
7.5. Reference Trajectory and Pre-Filter 231
20
Temperature (deg C)
15
10
0
0 5 10 15 20 25 30 35 40 45 50
Time (hours)
Manipulated Variables
60
50
Heater power (kW)
40
30
20
10
−10
0 5 10 15 20 25 30 35 40 45 50
Time (hours)
Figure 7.16: Control of water temperature with model of air temperature distur-
bance, heater power constraints, and imperfect model. W = 1, V = 1.
MATLAB function swimpool, which is available on this book’s web site. This func-
tion enables the reader to experiment with the disturbance model, the observer design,
the plant/model error, and the heater constraints.
To see how the use of a reference trajectory modifies the feedback loop, we can
232 7. Tuning
proceed as follows.4 Assume first that future set-point changes are not known.
A set of exponential reference trajectories, one for each controlled output, can be
represented by
where s(k) is the current set-point and z(k) the current value of the controlled
output, Λ = diage−Ts /Tref ,1 , e−Ts /Tref ,2 , . . . , e−Ts /Tref ,n , and Tref ,j is the time constant
applicable to the j’th output zj . T (k) in equation (3.2) becomes
I − ΛHw ΛHw
I − ΛHw +1 ΛHw +1
T (k) = .. s(k) + .. z(k) (7.33)
. .
I − ΛHp ΛHp
This modification of T (k) is shown in block-diagram form in Figure 7.17 for the
(over-simplified) case when the controlled output z(k), the measured output y(k),
and the state x(k), are all the same. This figure clearly exhibits the additional
feedback loop, compared with Figure 3.1.
+ ∆u(k|k) 1 u(k|k)
KMPC 1−z −1
I Plant
T (k|k) - -
z(k)
z −1 I
u(k−1)
Υ
Ψx(k)
Ψ
s(k) I − ΛH w ΛH w
.
.. .
. + + .
I −Λ pH ΛH p
If the controller is aware of future set-point changes, then this information can be
exploited in the definition of the reference trajectory. The easiest way to generate
exponential reference trajectories in this case is with an iterative loop, in which ytraj
is a ‘dummy’ variable:
• for i = 1 : p
4
The development in this section, and the figures, are due to my student Simon Redhead.
7.5. Reference Trajectory and Pre-Filter 233
• end
which is equivalent to
(I − Λ)s(k + Hw ) Λr(k + Hw − 1|k)
(I − Λ)s(k + Hw + 1) Λr(k + Hw |k)
T (k) = .. + .. (7.34)
. .
(I − Λ)s(k + Hp ) Λr(k + Hp − 1|k)
If Hw = 1 then
r(k + 1|k) (I − Λ)s(k + 1) Λr(k|k)
r(k + 2|k) (I − Λ)s(k + 2) Λr(k + 1|k)
T (k) = .. = .. + .. (7.35)
. . .
r(k + Hp |k) (I − Λ)s(k + Hp ) Λr(k + Hp − 1|k)
where r(k|k) is initialised to the current controlled output: r(k|k) = z(k). Using z
to also denote the forward shift operator, equation (7.35) can then be rewritten as:
0 0 ... 0 0
(I − Λ)z Λ Λ 0 . . . 0 0
(I − Λ)z 2 0
0 Λ 0 0
T (k) = .. s(k) + .. z(k) + T (k) (7.36)
. . .. .. ..
. . .
(I − Λ)z Hp 0
0 0 ... Λ 0
or, equivalently,
−1
I 0 ... 0 0
−Λ I 0 0
(I − Λ)z Λ
.. .. (I − Λ)z 2
0
T (k) =
0 −Λ . . .. s(k) + .. z(k) (7.37)
.. .
. .
. .. I 0 (I − Λ)z Hp 0
0 0 ... −Λ I
Figure 7.18 shows this in block diagram form. This is just a particular filter with
inputs z(k) and s(k + i|k) (i = 1, . . . , Hp ), and output T (k). More complicated
reference trajectories can be represented by replacing it by other filters. Note that
in Figure 7.18 Ξ(z) represents the vector of transfer functions
(I − Λ)z
(I − Λ)z 2
Ξ(z) = ..
.
(I − Λ)z Hp
+ ∆u(k|k) 1 u(k|k)
KMPC 1−z −1
I Plant
T (k|k) - -
z(k)
z −1 I
u(k−1)
0 0 . . . 00
Υ
Λ 0 . . . 00
0 Λ 00
. .
..
. . .
. + +
.
0 0 . . . Λ0 Ψx(k)
Ψ
Λ
s(k) 0
.
Ξ(z) .
+ + .
0
maximum amplitudes of such changes are known, then passing this change through
a low-pass filter before forming the error can be used to limit the error amplitude
to such a magnitude that the actuators do not become saturated. With predictive
control there seems to be less reason to do this, since we have a more systematic way
of handling constraint violations, so there is no particular reason to avoid activating
constraints. But there are still good reasons for avoiding saturation:
• The behaviour of the closed loop is not understood so well when constraints
are active.
• It seems a good idea to keep some control authority ‘in reserve’ for dealing
with unexpected disturbances.
7.6 Problems
1. Prove equation (7.8): S(z) + T (z) = I.
2. Consider a SISO plant with transfer function P (z) = B(z)/A(z), and suppose
that K(z)H(z) = X(z)/B(z), as in the case of ‘perfect’ control, where X(z) is
some transfer function. Show that the transfer function from the disturbance
d to the plant input u has B(z) as a factor of its denominator. (Hence the
feedback loop is internally unstable if B(z) has any zeros outside the unit disk.)
3. (a) Design a mean-level controller for the plant used in the mpctutss demo in
the Model Predictive Control Toolbox. (An easy way to load the data is to
run the demo first. You can then save it to file using the save command
and retrieve it with the load command.)
(b) With horizons set as for ‘perfect’ control, investigate whether you can
achieve similar responses to those achieved with mean-level control, by
using non-zero weights R(i) on the input moves. (Consider both set-point
and disturbance responses.)
(c) Investigate the sensitivity and complementary sensitivity functions for
some of your designs.
4. (a) For the paper machine headbox (demo pmlin in the Model Predictive
Control Toolbox), find (by trial and error) the best combination of hori-
zons and weights that you can, with the default (DMC) observer. (Ignore
constraints.)
(b) Try improving your best design so far by changing the observer design.
(a) Design and simulate a ‘perfect’ controller for this plant, and explain the
results.
(b) Explain why increasing Hp will eventually give closed-loop stability (as-
suming no active constraints). Find the smallest Hp which gives stability,
if Hu = 1 and R(i) = 0. What are the closed-loop poles in this case?
Roughly what is the time constant of the set-point response in this case?
(c) Simulating this system with predictive control, with Hu = 2, Hp = 30,
Q(i) = 1 and R(i) = 0.1 shows that stability is obtained, but the response
to set-point step changes shows that the output moves in the ‘wrong’
direction initially. Show (by simulation) that this effect can be reduced
by limiting the input moves to |∆u(k)| < 0.1 for each k.
(a) Verify, using the Model Predictive Control Toolbox, that if the plant model
(7.29) is used with the default (DMC) observer, then an oscillating water
temperature will result when the air temperature varies sinusoidally as
in (3.96).
(Note: The model (7.29) should be used only for the controller’s internal
model, namely the argument imod of function scmpc. The argument
pmod, which represents the plant, should remain the same as in Problem
3 of Chapter 3.)
(b) Modify the function swimpool (which is available on this book’s web site)
so that the air temperature is modelled as a ramp rather than a sinusoidal
disturbance, although the actual disturbance remains a sinusoid with pe-
riod 24 hours. Show, by simulation, that a residual sinusoidal variation of
the water temperature remains, but that it is much smaller than the one
obtained by assuming a constant disturbance. (For example, with V = 1,
T = 1.25, and k = 0.3, a residual variation with amplitude approximately
0.01 degC is obtained. In Problem 3 of Chapter 3 an amplitude of ap-
proximately 0.5 degC is obtained when the disturbance is assumed to be
constant.)
(c) Investigate the sensitivity functions obtained when the air temperature
disturbance is modelled as a sinusoid, and as a ramp, respectively, assum-
ing that all constraints are inactive. Verify that in each case the frequency
response of the sensitivity becomes zero at the frequency of the assumed
disturbance, namely 2π/24 if the sinusoid is assumed, and 0 if the ramp
is assumed. Comment on the rate at which the sensitivity approaches
zero as ω → 0. (Note: Use the Model Predictive Control Toolbox function
smpccon to obtain the linear controller for the unconstrained case.)
eαj eβj
r(k + j|k) = s(k + j) − [s(k + j) − z(k)] − [s(k + j) − z(k)]
2 2
Most formulations of robust control problems take the following general form. The
plant is assumed to be known only approximately; this is represented by assuming
that the plant lies in a set which can be characterised in some quantitative way.
The objective of robust control design is then to ensure that some performance
specification is met by the designed feedback system, so long as the plant remains
in the specified set.
Most robust control theory assumes that the controller is linear. But, as we have
seen, predictive controllers are nonlinear if constraints become active. Nevertheless,
this theory remains useful even for predictive control, because many predictive con-
trollers operate in their unconstrained mode most of the time, or at a fixed set of
active constraints for long periods of time. In either case, predictive controllers for-
mulated with quadratic costs, linear models, and linear constraints, behave linearly
in these conditions.
In this chapter we begin by examining two approaches to tuning for robust control
which assume a linear controller, then go on to look at approaches which acknowledge
the presence of constraints.
239
240 8. Robust Predictive Control
where, in each case, ∆ is a stable bounded operator, and P0 (z) is often normalised in
such a way that ||∆|| ≤ 1. Of course one does not know exactly what ∆ is. Various
assumptions can be made about the nature of ∆: nonlinear, linear time-varying,
linear parameter-varying, linear time-invariant being the most common ones. Also
various norms can be used; the most commonly used one is the ‘H-infinity’ norm
||∆||∞ , which is defined even for nonlinear systems, as the worst-case ‘energy gain’
of an operator.
A linear feedback controller K(z) designed for the nominal plant P0 (z) will certainly
give a stable closed-loop if the plant is exactly the same as the model P0 (z). But
it will not necessarily be stable when used with the real plant P (z). It is therefore
important to have some way of testing whether it will remain stable for all possible
plants allowed by the uncertainty description. Suppose that the uncertainty about
the plant is represented by the additive model (8.4). Then the feedback combination
of the real plant with the controller can be drawn as shown in Figure 8.1. The
uncertainty ∆ is in parallel with the nominal plant model P0 , but the figure has
been drawn to show it as being in feedback around the closed loop formed by the
controller K and P0 (which is enclosed by the broken line). The transfer function
(matrix) of the block within the broken line can be shown to be K(z)S(z), where
S(z) = [I + P0 (z)K(z)]−1 is the sensitivity function introduced in section 7.1, and
8.1. Formulations of Robust Control 241
this transfer function is of course stable, by design. Thus the ‘loop gain’ transfer
function is KS∆. It then follows from the small-gain theorem1 that the feedback
combination of this system with the uncertainty block ∆ will remain stable if
σ̄[K(ejωTs )S(ejωTs )]k∆k∞ < 1 (8.7)
where σ̄[.] denotes the largest singular value — see Minitutorial 8 and section 7.3.
K(z)
+
−
P0 (z)
Figure 8.1: Feedback combination of controller and plant, with additive uncertainty
model.
Inequality (8.7) can be tested for a given design, to check whether robust stability
is guaranteed for any plant within the set allowed by the uncertainty description.
When tuning a controller, one can try to influence the frequency response properties
in such a way as to make (8.7) hold. Note that (8.7) is only a sufficient condition
for robust stability; if it is not satisfied, robust stability may nevertheless have been
obtained.
Other uncertainty descriptions lead to other tests for robust stability. For example,
the ‘input multiplicative’ uncertainty model (8.5) leads to the following sufficient
condition for robust stability:
σ̄[K(ejωTs )P0 (ejωTs )(I + K(ejωTs )P0 (ejωTs ))−1 ]k∆k∞ < 1 (8.8)
(Note that for multivariable systems, KP0 6= P0 K, so that the transfer function
which appears in (8.8) is not the same as the complementary sensitivity introduced in
section 7.1.) And the ‘coprime factor’ uncertainty model (8.6) leads to the condition:
K(ejωTs ) jωTs −1 jωTs −1
σ̄ [I + P0 (ejωTs
)K(e )] M0 (e ) k[∆M , ∆N ]k∞ < 1 (8.9)
I
1
Alternatively, from a generalisation of the classical Nyquist stability theorem
242 8. Robust Predictive Control
Descriptions such as those given in (8.4)–(8.6), in which the only specification on the
uncertainty ∆ is a norm-bound, are known as unstructured uncertainty descriptions.
In practice much more specific information is available about the way in which the
plant behaviour can vary. For example it may be known that specific physical pa-
rameters, such as mass or resistance, can vary within known limits. In such cases
a norm-bounded description can still be used, but the operator ∆ then is restricted
to have a fixed structure. It can usually be arranged that this structure is that of a
block-diagonal transfer function, with specified sizes of the blocks. The advantage
of doing this is that robust stability tests can then be used which are less conser-
vative than singular-value tests such as (8.7) or (8.8). This is due to the fact that
the singular-value tests check whether any perturbation ∆ of the permitted ‘size’
(as measured by the norm) could destabilise the closed loop, even a perturbation
whose structure does not correspond to any possible parameter variation. A more
refined test, which checks only perturbations of the permitted size and structure, is
the structured singular value, also commonly referred to as µ. Even this gives suffi-
cient conditions only for robust stability, because it checks for plant perturbations
which may be complex-valued (such as phase perturbations in frequency-response
properties), even if only real-valued perturbations are known to occur in the plant.
In principle, a necessary and sufficient test of robust stability can be obtained by
a further refinement, the real structured singular value, or ‘real-µ’. In practice, it
is known that ‘real-µ’ can be extremely difficult to compute (its computation is
known to be ‘NP-hard’), and one has to be content with upper and lower bounds
for it. Consequently, there is usually some conservativeness in the robust stability
robustness test, even if a ‘real-µ’ test is employed.2
One of the important attributes of the structured singular value is that it can be
used to assess not only whether stability is robustly preserved, but a similar test
can be performed for robust preservation of performance, if this can be expressed in
terms of norm-bounds.
Early approaches to robust predictive control assumed that the model was defined
as an FIR system of fixed order, and the uncertainty was in the form of bounds
on the pulse response coefficients [CM87]. This had the advantage that the uncer-
tainty appeared linearly in the model description. But unfortunately it was later
shown that design methods based on such descriptions did not guarantee robustness
[ZM95b].
A more recent approach is to assume that a number of ‘corner’ points are known:
and that the real plant lies in the polytope3 which is the convex hull of these corners:
X
L X
L
[A, B] = λi [Ai , Bi ], λi = 1 (8.11)
i=1 i=1
The real plant does not need to be fixed. It can vary with time, so long as it remains
within this polytope [KBM96]. We shall use this uncertainty description in section
8.4.
This model generalises the DMC disturbance model, which is obtained if each αi = 0
and the covariance of v(k) is zero. The use of integrated white noise ensures offset-
free performance in the face of constant disturbances and plant/model steady-state
3
A polytope is a finite region of n-dimensional space bounded by a finite number of hyperplanes.
It is not necessarily convex, though the particular polytope referred to here is convex. The set
of solutions to the vector inequality Ax ≤ b, where x has n elements, is a convex n-dimensional
polytope, if it is bounded. A 3-dimensional polytope is usually referred to as a polyhedron.
244 8. Robust Predictive Control
z 1
∆w(k) z−1 w(k) z−α1 Disturbance
.. ..
. .
z 1
z−1 z−αp
d(k)
Measured
+ output
Input +
PLANT
u(k) + y(k)
+
v(k) Noise
Figure 8.2: The disturbance and noise model used by Lee and Yu [LY94]
gain mismatches. The filters allow the designer to specify that disturbances on vari-
ous outputs appear with different ‘speeds’, and hence that the disturbance rejection
can be performed with a different speed of response on each output. This allows
the disturbance rejection to be less agressive than it would be with the DMC model
(assuming the same cost function is used), and thus provides a useful additional
set of tuning parameters. These parameters can be used to enhance the robust-
ness of the controller: the intuition that control has to be ‘de-tuned’ in order to
increase robustness is usually sound,4 and one can perform rigorous analysis of the
robustness for various choices of the αi parameters, at least for the case of inactive
constraints. In addition to the filter time constants, one can adjust the covariances
of the processes ∆w(k) and v(k), namely the relative strengths of the disturbance
and the measurement noise on each output. This again influences the response of
the controller to apparent disturbances — if an output measurement is specified as
being very noisy, then the estimator, if designed properly, should regard most vari-
ations as being due to noise, and so ‘tell’ the predictor — and hence the controller
— that there is not much disturbance on that output, and hence not much response
is needed. (Note that this is a frequency-independent effect, whereas adjusting the
filter time constants ‘shapes’ the frequency response.)
It seems plausible that the filter parameters αi and the relative strengths of dis-
turbances and noises could be made available to plant operators as on-line tuning
parameters, since their meanings can be easily understood. But that depends on the
extent to which the effects of adjusting these parameters corresponds to intuition.
Lee at al [LMG94] and Lee and Yu [LY94] have performed a detailed investigation
of these effects. We will give only a summary of their analysis and findings.
4
‘De-tuned’ here is used in the traditional sense, referring to less agressive control action. Of
course if one’s objectives include increasing robustness then the tuning is actually being improved
by ‘de-tuning’.
8.2. The Tuning Procedure of Lee and Yu 245
where ξ(k) is a suitable state vector, and we can use ∆w(k) and v(k) because they
are already assumed to be white, as required in the standard form. Now, using our
usual plant model, our assumptions correspond to:
where x(k) is the state of the plant itself, and we need a state-space model of the
disturbance process d(k). It is convenient to obtain this in two steps: first a model
of d(k) obtained from w(k), then a model of w(k) obtained from ∆w(k). For the
first step we have:
where w, xw and d all have the same dimensions, and Aw = diag{αi }. Combining
this with (8.14) and (8.15) gives
x(k + 1) A 0 x(k) B 0
= + u(k) + w(k) (8.18)
xw (k + 1) 0 Aw xw (k) 0 I
x(k)
y(k) = [C I] + v(k) (8.19)
xw (k)
Since ∆w(k) = w(k)−w(k −1) we can take the second step by using the ‘differenced’
or ‘velocity’ form of the model as developed in section 2.4. By analogy with that
development, we have:
∆x(k + 1) A 0 0 ∆x(k)
∆xw (k + 1) = 0 Aw 0 ∆xw (k) +
η(k + 1) CA Aw I η(k)
B 0
+ 0 ∆u(k) + I ∆w(k) (8.20)
CB I
∆x(k)
y(k) = [0 0 I] ∆xw (k) + v(k) (8.21)
η(k)
This is now in the form of the standard model (8.12)–(8.13), with u replaced by ∆u.
Note that the stochastic disturbance ∆w(k) does not excite the plant state ∆x(k),
246 8. Robust Predictive Control
which means that any unstable modes in the plant model will not be stabilised by
the Kalman filter (estimator) gain. So, just like the DMC model, this disturbance
model can only be used with asymptotically stable plants. This is true for any model
which treats all disturbances as being output disturbances which do not affect the
plant state.
To complete the model, the covariance matrices of ∆w(k) and v(k) must be specified.
By assumption these are both digaonal: W = diag{ρi }, V = diag{σi }, with ρi ≥ 0
and σi ≥ 0.
The Kalman filter gain can now be computed by solving the appropriate discrete-
time Riccati equation — see (8.27). (In [LMG94] the plant state vector is chosen
to be made up of predicted values of the plant output. It is pointed out that this
choice reduces the dimension of the Riccati equation which must be solved. But
this is now a minor issue, given current computing power, and considering that this
equation needs only be solved off-line.5 ) It is also shown in [LMG94] that the DMC
estimator/predictor is obtained if αi = 0 and V = 0.
Note that the Model Predictive Control Toolbox function smpcest has an option in
which this disturbance/noise model is assumed, and only the αi , ρi and σi parameters
need to be specified.
It is easy to verify that the Riccati equation (8.27) for the model (8.20)–(8.21) has
a solution with the structure
0 0 0
P = 0 P22 P23 (8.31)
0 P23T P33
(assuming an asymptotically stable plant, of course) where the dimensions of the
blocks correspond to the dimensions of the vectors x, xw and y. Consequently the
Kalman filter gain matrix is given by
0
L = P23 [P33 + V ]−1 (8.32)
P33
Furthermore, since Aw , W and V are all diagonal, the blocks P22 , P23 and P33 are
all diagonal (and square). Consequently L has the form
0 0
L = L∆w = diag{φi } (8.33)
Lη diag{ψi }
In [LY94] it is shown that
ψi2
φi = (8.34)
1 + αi − αi ψi
5
Computing the Kalman filter gain for a random system with 100 states and 20 outputs, using
the MATLAB Control System Toolbox’s function dlqe takes about 30 seconds on a Pentium II
processor running at 333 MHz with 128Mb of main memory.
8.2. The Tuning Procedure of Lee and Yu 247
in which w and v are white noise processes with covariance matrices E{wwT } =
W ≥ 0, E{vv T } = V > 0, and E{wv T } = 0 (ie w and v are uncorrelated). w is
supposed to be a disturbance which affects the plant behaviour (and must therefore
be ‘tracked’ by the filter in some sense), whereas v is supposed to be a measurement
noise (which must therefore be ‘rejected’ by the filter in some sense). An optimal
(minimum error variance) estimate of the state x can be obtained by iterating the
following equations which define the Kalman filter [AM79, BGW90, BH75, KR72]:
and
−1
P (k + 1) = AP (k)AT − AP (k)C T CP (k)C T + V CP (k)AT + ΓW ΓT (8.26)
The model and covariances can be time-varying, but if they are all constant then the
Riccati equation (8.26) converges to P∞ ≥ 0, which is a solution to the (filtering)
algebraic Riccati equation:
−1
P∞ = AP∞ AT − AP∞ C T CP∞ C T + V CP∞ AT + ΓW ΓT (8.27)
Note that the Kalman filter equations have the form of an observer, with a special
choice of observer gain. If the pair (A, ΓW 1/2 ) is stabilisable and the pair (C, A) is
detectable, then the closed-loop observer state-transition matrix A(I − L0∞ C) has
all its eigenvalues within the unit disk, so that the observer is stable. Also, note
that V ≥ 0 or even V = 0 is allowed, providing that CP∞ C T > 0.
Optimal predictions are obtained by assuming that future values of the disturbance
and noise will be equal to their mean values (ie 0) and hence are obtained from the
optimal filtered state estimate x̂(k|k) by using the recursion
In [LY94] the tuning procedure is expressed in terms of adjusting the gain ψi directly,
rather than adjusting the variances ρi and σi .
Lee and Yu [LY94] suggest a two-step tuning procedure. The first step is concerned
with choosing cost-function weights and horizons such as to obtain nominal stability
(ie closed-loop stability, assuming that the linear plant model is perfect). They
therefore suggest choosing the control penalty weighting matrix as R = 0, making
the control horizon as large as practically possible, and the prediction horizon at
least as large as the control horizon, possibly infinite. The reason for making the
horizons as large as possible is to make the ‘regulator’ part of the controller behave
as closely as possible to an infinite-horizon linear quadratic state-feedback controller,
since such a controller usually exhibits very good feedback properties. (More will
be said about this in section 8.3.) In the light of section 6.2 a better suggestion now
is to make both horizons infinite, so that the exact ‘linear quadratic’ behaviour is
obtained, so long as all the constraints are inactive. The reason for choosing R = 0
is so as not to limit the controller action unnecessarily at this stage — but a further
reason will be seen in section 8.3.
The second step consists of ‘de-tuning’ the controller so as to obtain robustness with
respect to plant/model mismatch. This is done by adjusting the disturbance and
noise parameters αi , ρi and σi , or (almost) equivalently the parameters αi and ψi .
If there is only one output being controlled then there is only one filter parameter,
α1 , and one gain, ψ1 , to adjust. The situation is then identical to adopting a second-
order ‘observer polynomial’ C(z) in GPC — see sections 4.2.4 and 4.2.5, and Problem
2. Broadly speaking, increasing ψ1 (or ρi /σi ) increases the bandwidth of the closed
loop with the whole predictive controller in place. More precisely, it increases the
frequency at which the gain of the sensitivity function |S(ejωTs )| becomes close to 1,
and at which the gain of the complementary sensitivity |T (ejωTs )| begins to deviate
significantly from 1. Increasing α1 has the effect of improving (ie reducing) the
sensitivity at low frequencies, but at the cost of increasing both the sensitivity and
the complementary sensitivity at high frequencies, and hence reducing robustness to
modelling errors and leading to underdamped (‘ringing’) behaviour. The appropriate
performance/robustness trade-off has to be decided by examining the Bode plots of
these functions for specific cases.
For the multivariable case, Lee and Yu [LY94] give an extensive discussion of how
the tuning should be related to what is known about the uncertainty structure
of the plant, as referred to either its inputs or outputs. They suggest that the
disturbance/noise parameters should be used to tune for robustness in the face
8.3. The LQG/LTR Tuning Procedure 249
of output uncertainty, but that the control penalty matrix R should be used to
tune for robustness against input uncertainty. However, in most cases information
about the uncertainty structure is not available sufficiently precisely to allow one
to follow this advice. In such cases one is reduced to adjusting the αi and ψi
(or ρi , σi ) parameters, using one’s understanding of their effects in the single-output
case, monitoring the singular values of the sensitivity and complementary sensitivity
functions, and accepting that their effects interact with each other.
Disadvantages of increasing R from its initial value of 0 are that its effects are some-
times counter-intuitive, and that they can be completely lost if output constraints
become active, since the need to respect constraints then takes precedence over min-
imisation of the cost. On the other hand, the functioning of the state estimator is
not affected by the constraints, so some of the benefits achieved by tuning the esti-
mator may remain in place even if output constraints become active. This is a very
heuristic argument, but there is some practical experience which indicates that it
has some validity.
‘Loop Transfer Recovery’, or LTR, is a tuning technique developed for use with the
‘Linear Quadratic Gaussian’, or LQG, design approach. LQG theory says that if
we have a Linear plant model, Quadratic penalty cost, and disturbance and noise
signals with Gaussian probability distributions, then the optimal control problem
separates into two sub-problems, which can be solved independently:
1. Estimate: Use a Kalman filter to obtain the optimal estimate x̂(k|k) of the
plant state (from plant input and output signals). See Minitutorial 9 for
details.
2. Control: Find the optimal state feedback gain matrix KLQ for the determin-
istic (ie no disturbance or noise) control problem with the same cost function
for the same plant. (See Minitutorial 7 for details.) Then use the optimal state
estimate as if it were a measurement of the true state: apply the feedback law
u(k) = −KLQ x̂(k|k).
We have already used the LQG approach in the previous section. The proposal to
use the LQG/LTR tuning procedure is very close to the procedure proposed in the
previous section, namely the Lee and Yu procedure. It generalises it, by using a
more general disturbance model. This allows more freedom to shape the frequency
response, if required, and it removes the restriction to stable plants. Also, it allows
the disturbance model to include correlated disturbances, which is an advantage
in those applications in which strong correlation is present, and is known precisely
enough to be worth modelling — for example in the control of ships, in which state
disturbances are highly correlated because they are due to common causes such
250 8. Robust Predictive Control
LLQ
Ã
−K∞
as waves. On the other hand, the complexity is not increased very much — if at
all — because the weights in the cost function are fixed in advance, and only the
noise model is adjusted. Also, the tuning can be pursued by monitoring an open-
loop frequency response (that of the Kalman filter), which makes it easier to take
inherent plant characteristics into account while tuning.
At the heart of the LQG/LTR approach is the recognition that both the (infinite
horizon) ‘LQ state-feedback’ scheme and the (steady-state) Kalman filter are them-
selves feedback systems. This is shown in Figures 8.3 and 8.4. Furthermore, each
of them usually exhibits excellent ‘feedback properties’. In continuous time, it is
known that each of the feedback loops identified by LLQ and LKF in these figures
has infinite gain margin against gain increases in individual input channels, a gain
margin of at least 2 against gain decreases in individual input channels, and at least
60◦ phase margin against unmodelled phase lags in individual input channels, etc
[Kal64, SA77]. In discrete time, these properties are not achieved exactly, and can-
not be guaranteed. Nevertheless, providing that reasonable demands are made of
these feedback systems — usually, that the loop gains have fallen to small values
well before the Nyquist frequency π/Ts is approached — then they usually exhibit
comparable properties.
8.3. The LQG/LTR Tuning Procedure 251
à LKF
−
+
ÃL∞
y(k)
LLQ
y(k)
B̃ DELAY C̃ −K∞ PLANT
+ u(k)
++
à LKF
LLQG
−
+
ÃL∞
CONTROLLER
The fact that the complete closed-loop system containing the plant and an LQG
controller is made up of these two feedback systems, each of which has such good
feedback properties, was often held to imply that the complete system would have
good feedback properties. In other words, that the loop identified by LLQG in
Figure 8.5 would inherit these good properties. Rosenbrock [Ros71] pointed out
that this was not necessarily the case, and Doyle [Doy78] showed that LQG loops
could exhibit arbitrarily bad feedback behaviour — in particular, arbitrarily small
stability margins. These and similar observations motivated the development of ‘H∞
control theory’; but in the meantime the LTR tuning techniques was developed for
use with the LQG approach [DS81, Mac85, SA87].
LQG/LTR theory shows that, under certain circumstances, if the state feedback
gain K∞ is obtained by solving the LQ problem with Q = C T C and R → 0, then
LLQG → LKF . To be more precise, the return-ratio, the sensitivity function, and the
252 8. Robust Predictive Control
Here we will concentrate on how to use this procedure for tuning predictive con-
trollers, and not derive this convergence result. For the technical details the reader
is referred to [DS81] for the original development, in continuous time, and to [Mac85]
and [BGW90] for the development in discrete time (which is surprisingly different).
The latter reference discusses how to apply LQG/LTR to unconstrained predictive
control. Extensive discussions of the use of LQG/LTR in continuous time design are
available in [SA87, Mac89, SCS93]. But a few points about the details are in order:
1. The convergence theorem assumes that the linear plant model is square — has
equal numbers of inputs and outputs. The technique can still be used if there
are more outputs than inputs, by adding ‘dummy inputs’.
2. The convergence theorem assumes that the linear plant model is minimum-
phase — that is, that there are no zeros outside the unit disk, and that the
product CB is non-singular. If this does not hold, convergence is still usually
obtained in practice, at least for frequencies below those at which the effects of
the non-minimum-phase zeros become significant. This is not usually a signifi-
cant restriction, because such zeros in any case limit the achievable bandwidth
obtained using any feedback control. In particular, any non-minimum-phase
zeros introduced by discretisation (ie which do not arise from right half-plane
zeros in the continuous-time system) place no practical restriction on the tech-
nique.
3. In continuous time there is a complete duality between the Kalman filter and
the LQ state feedback controller. Consequently, one can follow a dual proce-
dure, namely tuning the LQ state-feedback loop, then recovering its properties
at the input of the plant by choosing the disturbance and noise covariances
according to a formula (W = BB T , V → 0). This allows, among other things,
the use of the LTR technique when there are more inputs than outputs. In dis-
crete time the duality is not so complete, and hence the corresponding theorem
does not hold. But again, in practice, enough recovery occurs in practice to be
useful, providing that the sampling frequency is high enough, relative to the
demanded bandwidth. (Basically, if the sampling frequency is high enough,
then all the continuous-time results hold approximately enough.)
8.3. The LQG/LTR Tuning Procedure 253
Instead of the model (8.14)–(8.15) which we used in the previous section, we will
now use the model:
x(k + 1) = Ax(k) + Bu(k) + Γx d(k) (8.35)
y(k) = Cx(k) + v(k) (8.36)
The disturbance d now acts on the state rather than the output. It can be generated
by the model
xw (k + 1) = Aw xw (k) + Γw w(k) (8.37)
d(k) = Cw xw (k) + Dw w(k) (8.38)
where now the dimensions of xw and d are not fixed, and Aw need not be diagonal.
Now (8.18)–(8.19) is replaced by
x(k + 1) A Γ x Cw x(k) B Γx Dw
= + u(k) + w(k)
(8.39)
xw (k + 1) 0 Aw xw (k) 0 Γw
x(k)
y(k) = [C 0] + v(k) (8.40)
xw (k)
One could take w(k) to be white noise and Dw = I, which would allow any desired
spectral density to be modelled for d(k) by (8.37)–(8.38). But since we usually want
to make the spectrum of d unbounded at frequency ω = 0, in order to obtain offset-
free tracking, it is more convenient to consider w(k) to be integrated white noise, as
we did in the previous section. That is, we assume ∆w(k) to be white noise. In this
case we get (by analogy with the development in section 2.4) the ‘differenced’ form
∆x(k + 1) A Γ x Cw 0 ∆x(k)
∆xw (k + 1) = 0 Aw 0 ∆xw (k) +
η(k + 1) CA CΓx Cw I η(k)
B Γx Dw
+ 0 ∆u(k) + Γw ∆w(k) (8.41)
CB CΓx Dw
∆x(k)
y(k) = [0 0 I] ∆xw (k) + v(k) (8.42)
η(k)
In many cases the full complexity of this model is not needed. The return-ratio which
is recovered by the LTR procedure is that of the Kalman filter shown in Figure 8.4,
with the loop broken at the output of the plant model, namely C̃[zI − Ã]−1 ÃL0∞ .
Suppose that the disturbance d(k) is just taken to be integrated white noise. In that
case the state xw is not needed and we can take Dw = I (so that d(k) = w(k)), so
the model simplifies to
∆x(k + 1) A 0 ∆x(k)
= +
η(k + 1) CA I η(k)
B Γx
+ ∆u(k) + ∆w(k) (8.43)
CB CΓx
∆x(k)
y(k) = [0 I] + v(k) (8.44)
η(k)
254 8. Robust Predictive Control
Once the disturbance model has been adjusted so that the Kalman filter return-
ratio, and the associated sensitivity and complementary sensitivity functions, have
‘good’ frequency characteristics across the whole frequency range, then the ‘recovery
step’ is taken. In relation to the standard LQG system shown in Figure 8.5, this is
done by using the cost function
∞ n
X o
V (k) = ||ξ̂(k + l|k)||2C̃ T C̃ + ρ||∆û(k + l − 1|k)||2
l=1
∞
X
= ||η̂(k + l|k)||2 + ρ||∆û(k + l − 1|k)||2
l=1
∞
X
= ||ŷ(k + l|k)||2 + ρ||∆û(k + l − 1|k)||2 (8.48)
l=1
6
The number of integrators is given by the rank of the residue matrix of the return-ratio at
z = 1, namely by limz→1 (z − 1)C̃[zI − Ã]−1 ÃL0∞ = CA(I − A)−1 L∆x + Lη . Usually the rank of
this matrix is the same as the number of outputs, so that there is an integrator for each output.
8.3. The LQG/LTR Tuning Procedure 255
∆w(k)
z
z−1 I
w(k)
Cw (zI − Aw )−1 Γw + Dw
Disturbance d(k)
Measured
+ output
Input x(k)
+
B DELAY C
+ y(k)
u(k)
+ +
v(k)
A Noise
where the last equality follows because the mean value of future measurement noise
is always zero, so v̂(k + l|k) = 0. Recovery of the Kalman filter characteristics is
then obtained at the plant output as ρ → 0 (under the conditions specified earlier).
But this is in the standard form of a predictive control cost function, with infinite
horizons and fixed weights (except for the scalar parameter ρ). So all the tuning has
been transferred to the design of the disturbance model, and a fixed, but sensible,
control cost function remains.
How far should one reduce ρ? It is possible to set ρ = 0 (in fact, for discrete-time
LQG/LTR the main convergence theorem relates to this extreme case), but it is usu-
ally not a good idea. The continuous-time Kalman filter (and LQ state-feedback)
has excellent feedback properties only because it behaves like a set of first-order
lags at high frequencies. In the single-outptut case, the phase lag never exceeds
90◦ . This has an associated penalty, which is that the loop gain decreases rela-
tively slowly at high frequencies — slope −1 on log-log scales, or −20 decibels per
decade of frequency. Since all real plants exhibit larger high-frequency phase lags,
and steeper attenuation of gain with frequency, it would only be possible to recover
these characteristics perfectly by making the controller have ‘high-pass’ character-
istics at high frequencies — that is to have increasing gain at high frequencies. But
this is always very undesirable, because there is usually no useful frequency content
at high frequencies, and the result would only be to amplify measurement noise,
with consequent rapid actuator movements and increased risk of hitting actuator
constraints. Now as ρ is reduced the usual effect is for the transfer functions eval-
256 8. Robust Predictive Control
uated at the plant output to converge to the Kalman filter transfer functions over
an increasing range of frequencies. The convergence is usually most rapid at low
frequencies. Therefore one should monitor the return-ratio, and the sensitivity S(z)
and complementary sensitivity T (z) as ρ is reduced, and stop reducing ρ once the
feedback properties have become adequately good over a wide enough range of fre-
quencies. ‘Wide enough’ means to at least the desired closed-loop bandwidth, and a
little way beyond. This whole procedure is based on ‘continuous-time thinking’, so
it cannot be expected to work if the sampling interval Ts is too long, relative to the
desired closed-loop bandwidth. The Nyquist frequency π/Ts should be (at least) a
factor of 10, say, larger than the required bandwidth.
8.4.1 Overview
The formulation of [KBM96] looks rather different from the one that we have been
considering. The cost function and the constraints are similar to the ones we have
used, the difference being that ||u|| is penalised rather than ||∆u|| — but this differ-
ence can be overcome by reformulating the problem as in Section 6.3. (If this is not
done then properties such as integral action will not be obtained.) The bigger dif-
ference is that the optimization is performed over state feedback matrices Kk , such
that û(k + i|k) = −Kk x(k) for all i > 0. (This is similar to the approach taken
in [SR96b].) At each step it is assumed that the same state feedback matrix will
be used over an infinite prediction horizon, and this guarantees that this matrix is
stabilising. But in addition to stabilising the nominal plant, it is guaranteed that
any plant in the uncertainty set will be stabilised. This is achieved by obtaining Kk
8.4. LMI Approach 257
Further LMI problems can be posed to handle input constraints, and certain aspects
of performance requirements (such as speed of response). These can all be combined
with the previous LMI’s.
There are potential problems with this formulation. Firstly, it is not clear whether it
all extends to the case when an observer is used to estimate the state. Secondly, the
LMI optimization problems always minimise an upper bound for the quantity which
is really of interest. It is possible that such upper bounds are very conservative in
some cases, which could seriously reduce the practicality of the approach. However,
in [KBM96]it is claimed that typically the bounds are not too conservative. And
thirdly, although algorithms for solving LMI problems are fast, the problem size
becomes very substantial for real applications, so the use of this approach in real
time will be restricted to applications with relatively slow dynamics.
in which the notation A(k), etc, means that the matrices in this model can change
at each step, but it is not meant to imply that their variation is known ahead of
time (as a function of k). Because their precise variation is not known, the model
behaviour is uncertain. The ‘amount’ of uncertainty is prescribed by the assumption
that
where U (k) = [û(k|k)T , . . . , û(k + Hu − 1|k)T ]T , and the maximization is over all
j ≥ 0.
Now suppose that a function V (x) = xT P x exists, with P > 0, such that for any
pair x̂(k + j|k), û(k + j|k) corresponding to the uncertain model (8.49),
for each j ≥ 0. Then such a function is an upper bound for the cost V∞ (k). This
can be shown as follows. Assume that V∞ (k) < ∞, then x̂(∞|k) = 0, and hence
V (x̂(∞|k)) = 0. Now sum both sides of (8.54) from j = 0 to j = ∞, which gives
Since (8.54) was assumed to hold for any model in the assumed uncertainty set, we
have that
Consequently we can replace the nasty problem (8.53) by the nicer problem:
subject to the constraints that (8.54) holds and P > 0. Some conservativeness
enters the problem formulation here, because V (x(k|k)) is only an upper bound for
the cost that we really want to minimise. But it is stated in [KBM96] that this is not
a source of much conservativeness in practice. The reason that (8.57) is a relatively
nice optimization problem is that it is convex, whereas (8.53) is not. Problem (8.57)
can be solved with the aid of LMI’s.
where we understand that the solution P depends on U(k) in some way, which
will become clear shortly. But P > 0, so we can define Q = γP −1 > 0, which
makes the inequality constraint equivalent to 1 − x(k|k)T Q−1 x(k|k) ≥ 0. From the
8.4. LMI Approach 259
X̀
F (v) = F0 + vi Fi ≥ 0 (8.58)
i=1
where each Fi is a symmetric matrix, and the scalar variables vi appear in the
inequality affinely. It is clear that a set of LMIs, F1 (v) ≥ 0, . . . , Fm (v) ≥ 0 is the
same as one large LMI, obtained by assembling all the matrices Fi (v) into one large
block-diagonal matrix.
The importance of LMIs is due to the fact that optimization problems of the kind
where F (v) ≥ 0 is an LMI, are convex problems, that very many convex problems
can be written in this form [BGFB94], and that there are very efficient algorithms
for solving problems of this kind [Mat].
One of the major reasons why LMIs can be used to represent such a wide range of
problems is that convex quadratic inequalities are equivalent to LMIs. In particular,
if Q(v) = Q(v)T and R(v) = R(v)T , and Q(v), R(v) and S(v) are all affine in v,
then the pair of inequalities
This is equivalent to
γ − xT Qx − q T x − r ≥ 0
min γ subject to (8.64)
γ,x Ax ≥ b
which is equivalent to
min γ subject to
γ,x
(Ax − b)1 · · · 0
I Q1/2 x .. .. ..
≥ 0 and . . . ≥ 0 (8.65)
xT Q1/2 γ − r − qT x
0 ··· (Ax − b)m
where (Ax − b)i denotes the i’th element of Ax − b, which is in the form of (8.59)
— see Problem 5.
Mini-Tutorial 10: Linear Matrix Inequalities
260 8. Robust Predictive Control
equivalence between the pair of conditions (8.60) and (8.61), and (8.62), we see that
this constraint is equivalent to the LMI
Q x(k|k)
≥0 (8.67)
x(k|k)T 1
Now we assume that the control signal will be determined by the state feedback law
û(k + j|k) = Kk x̂(k + j|k), for some matrix Kk , and we substitute for û(k + j|k) in
inequality (8.54). This gives the inequality
x̂(k + j|k)T {A(k + j) + B(k + j)Kk }T P {A(k + j) + B(k + j)Kk }−
−P + KkT RKk + Q1 x̂(k + j|k) ≤ 0 (8.68)
This inequality turns out to be another LMI. It can be pre- and post-multiplied by
Q, since Q > 0, and then the substitution P = γQ−1 made. Defining Y = Kk Q
then gives the inequality
Now suppose that [A(k + j), B(k + j)] belongs to the convex polytope Ω = [A, B]
defined by (8.11). Since the LMI (8.71) is affine in A(k + j) and B(k + j), it is
satisfied for every [A(k + j), B(k + j)] ∈ Ω if and only if it is satisfied at its ‘corners’,
namely for every pair (Ai , Bi ). So we need the following set of LMIs to be satisfied:
Q 0 0 Ai Q + Bi Y
1/2
0 γI 0 Q1 Q
≥ 0 for every i = 1, . . . , L
0 0 γI R1/2 Y
T T T T /2 T T /2
QAi + Y Bi QQ1 Y R Q
(8.72)
8.4. LMI Approach 261
So finally we see that we obtain a robust solution to the predictive control problem
without constraints by solving the convex problem:
min γ subject to (8.67) and (8.72) (8.73)
γ,Q,Y
and, if it has a solution, setting Kk = Y Q−1 and û(k + j|k) = Kk x̂(k + j|k). As
remarked earlier, this solution assumes that the state vector is measured, because
x(k|k) = x(k) appears as data in (8.67).
Note that the state-feedback matrix Kk may change with k, since it depends on
x(k), even though we have so far considered the unconstrained problem. This is a
distinct difference from the ‘standard’ formulation, in which the model uncertainty
is not considered. In that case, of course, we get a time-invariant feedback law.
Input and output constraints can be included in the robust predictive control for-
mulation, by adding further LMIs. Thus the nature of the solution algorithm does
not change, although the complexity of the problem increases, of course. In this
section we again assume that [A(k + j), B(k + j)] belongs to the convex polytope
Ω = [A, B] defined by (8.11). Similar results for a norm-bounded uncertainty model
are available in [KBM96].
Now suppose that we have symmetric constraints on the levels of the input signals:
|ûi (k + j|k)| ≤ ui (8.74)
We can get a (probably conservative) sufficient condition for this as follows:
2
max |ûi (k + j|k)|2 = max Y Q−1 x̂(k + j|k) i (8.75)
j j
2
≤ max Y Q−1 v i
(8.76)
v∈Eρ
2
≤ ρ2 Y Q−1/2 (8.77)
i 2
−1 T
= ρ2 Y Q Y ii (8.78)
262 8. Robust Predictive Control
where Y Q−1/2 i denotes the i’th row of Y Q−1/2 , and (8.77) is a consequence of the
Cauchy-Schwarz inequality.8 Now, using the fact that A ≥ B ⇒ Aii ≥ Bii , we can
be sure that this is satisfied if there exists X = X T , such that
X ρY
≥ 0 with Xii ≤ u2i , i = 1, . . . , m. (8.79)
ρY T Q
Since this is affine in A(k + j) and B(k + j), this inequality will be satisfied for every
[A(k + j), B(k + j)] ∈ Ω if
Q ρ[Aj Q + Bj Y ]T CiT
≥ 0 for j = 1, . . . , L. (8.86)
ρCi [Aj Q + Bj Y ] zi2
Of course simultaneous satisfaction of all the input and output constraints is ensured
by simultaneous satisfaction of the LMIs (8.79) and (8.86).
In [KBM96] it is also shown that ‘energy’ constraints on ||û(k + j|k)||2 and ||ẑ(k +
j|k)||2 can be satisfied by the satisfaction of similar LMIs.
in the specified uncertainty set Ω), providing that it is feasible. The argument is
essentially the same as that used in section 6.2.1. Let V (x(k|k)) = x(k|k)T Pk x(k|k),
where Pk = γk Q−1 k and γk , Qk are the values of γ and Q obtained by solving the
LMI problem at time k. If we assume, as usual in stability proofs, that no new
disturbances occur after time k, then
max x(k + 1|k + 1)T Pk x(k + 1|k + 1) = max x̂(k + 1|k)T Pk x̂(k + 1|k).
[A,B]∈Ω [A,B]∈Ω
Thus the function V (x(k|k)) is a Lyapunov function for the uncertain system, and
hence the closed loop is robustly stable.
The use of soft constraints greatly ameliorates the problem of unexpectedly running
into infeasibility, but the problem of avoiding constraint violations remains a very
important one. If a system is frequently violating the specified constraints then it is
clearly not working as intended, even though constraint softening may be keeping the
control algorithm running. Contraints cannot always be softened. Input constraints,
for instance, usually cannot be softened. Also, recall that in section 6.2.3 there was a
constraint that the unstable modes of the plant should be brought to equilibrium by
the end of the control horizon; this constraint cannot be softened if that particular
predictive control algorithm is used in order to guarantee stability. So the possibility
of softening constraints certainly does not remove the necessity of considering the
question of feasibility.
Although infeasibility can occur even if there is no uncertainty about the plant model
or about disturbances, it arises most commonly as a result of such uncertainty, or of
mismodelling — for example, a mismatch between the linearised internal model and a
nonlinear plant. Therefore the essential problem facing the user of predictive control
is that of robust feasibility: designing the predictive controller so that it maintains
feasibility despite uncertainty about the plant being controlled, and its environment.
It bears repeating that the question of robust feasibility is also closely connected with
the question of robust stability when constraints are present. The reason for this is
264 8. Robust Predictive Control
that most stability proofs for predictive control rely on the assumption that the
on-line optimization problem is solved correctly at each step, and this implicitly
assumes that the problem is feasible at each step. In fact, a variation of predictive
control in which the horizon is not fixed, but is one of the variables chosen by the
optimiser, was proposed by Michalska and Mayne [MM93]; the robust stability of
this scheme relies only on having a feasible solution at each step, rather than an
optimal solution [May96]. (Also see section 10.3 and [SMR99].)
In section 8.4 one approach to ensuring robust feasibility was described. A major
problem with that approach is that the state is forced to remain within an invariant
set whose nature is chosen to fit with the mathematical framework being used,
rather than matching the real constraints. For example, in section 8.4.3 the state
was confined to the ellipsoid Eρ = {z : ||z||P ≤ ρ}, which could be a much smaller
set than that implied by the real constraints. This makes the LMI approach very
conservative; indeed, it may lead one to conclude wrongly that no robust solution
exists.
The key to reducing such conservativeness is to estimate the set within which the
state must be confined as accurately as possible. A very important contribution to
this was made by Gilbert and Tan [GT91], who introduced the notion of maximal
output admissible sets and showed how they could be computed. If an autonomous
(no input) time-invariant linear system x(k + 1) = F x(k), y(k) = Hx(k) has to
satisfy an output constraint y(k) ∈ Y for each k, then a set O is output admissible
if x(0) ∈ O implies that y(k) ∈ Y for all k > 0, which is equivalent to HF k x(0) ∈ Y
for all k > 0. The maximal output admissible set O∞ is the largest such set, namely
the set of all initial conditions x(0) for which HF k x(0) ∈ Y holds for all k > 0.
Note that the set Y is assumed to be constant, which is not always the case in
predictive control; the definitions could be generalised to allow for Y changing with
k. A set X is positively invariant if x(0) ∈ X implies that x(k) ∈ X for all k > 0.
In general, output admissible sets are not necessarily positively invariant, but the
maximal output admissible set is always positively invariant.
As in section 8.4, we shall assume that the objective is to drive the system to the
origin, so that 0 ∈ Y for consistency. In fact we shall assume for simplicity that 0
is in the interior of Y (rather than on the boundary), so that a steady-state at the
origin corresponds to all constraints being inactive. So far we have not mentioned
inputs; that is because the definitions are going to be applied to closed-loop systems,
in which the input depends on the state. For example, suppose that linear state
feedback u(k) = −Kx(x) is applied to the system x(k + 1) = Ax(k) + Bu(k),
z(k) = Cx(k), with constraints u(k) ∈ U and z(k) ∈ Z. Then we have
−K
y(k) = Hx(k) = x(k) ∈ Y (8.89)
C
In predictive control the constraints are usually defined by linear inequalities, and
these include bounds on input and output amplitudes. This results in Y being
a convex polytope. In [GT91] it is shown that this results in O∞ being convex,
bounded (provided that (F, H) is an observable pair), and containing the origin in
its interior (provided that F is stable, possibly including simple eigenvalues on the
unit circle, such as those due to integrations). Furthermore, O∞ scales with Y : if
Y is scaled by a factor α, then O∞ is scaled by the same factor, without changing
shape.
The set Ot is defined as the set of initial conditions x(0) such that the output satisfies
the constraints for t steps, namely such that HF k x(0) ∈ Y for k = 1, 2, . . . , t.
Clearly Ot2 ⊂ Ot1 if t2 > t1 . Now it may happen that the sequence of sets Ot
(t = 1, 2, . . . ) stops getting smaller as t increases. That is, there may be a value
t∗ , such that Ot = Ot∗ for all t > t∗ . In that case it is clear that O∞ = Ot∗ , and
O∞ is said to be finitely determined. The maximal output admissible set O∞ can
be computed relatively easily if and only if it is finitely determined. An important
theorem states that O∞ is finitely determined if and only if Ot = Ot+1 for some t.
In [GT91] it is shown that if F is asymptotically stable and (F, H) is an observable
pair, and if Y is bounded with 0 in its interior, then O∞ is finitely determined. It is
also shown that if the stability assumption is relaxed to allow simple eigenvalues on
the unit circle then O∞ can be approximated arbitrarily closely, and an algorithm
for doing so is given.
O∞ = {x : P HF t x ≤ p, 0 ≤ t ≤ t∗ } (8.90)
9
If Y is not a polytope then a similar algorithm, with Y defined by more general inequalities,
works conceptually, but finding the global maximum of Ji (x) may not be possible, even if Y is
convex.
266 8. Robust Predictive Control
In order to apply these ideas to predictive control, three further ideas have to be
introduced. Firstly, suppose that an unmeasured disturbance w acts on the system,
so that
If it is known that w(k) ∈ W , where W is some bounded set, then one can define
the robust maximal output admissible set as the set of all current states x(k), such
that Hx(k + j) ∈ Y for all j > 0 for all possible w(k + i), i = 0, 1, . . . , j − 1. This
is the same as the set of states x(k) such that
X
j
HF j x(k) + H F i−1 w(k + j − i) ∈ Y (8.92)
i=1
If Y and W are convex polytopes then this robust maximal output admissible set
can be computed using similar methods to those outlined above [DH99, GK95].
Secondly, in the predictive control context F is not fixed. If linear state feedback is
used then F = A − BK, and there is some freedom in choosing K. More generally,
the control sequence u(k + i) can be chosen, not necessarily according to a linear
law. For this reason, the notion of a maximal (A, B)-invariant admissible set was
introduced in [DH99]. This is the set of current states x(k), such that a sequence
of future inputs u(k + j) exists for which y(k + j) ∈ Y for all j > 0 (and for
all w(k + j) ∈ W , if there are disturbances). Given a current state x(k) and a
disturbance set W , one does not know, in general, whether x(k) is in this maximal
(A, B)-invariant set. Several authors [CM87, GN93, ZM95b] have suggested that in
such problems the future inputs u(k +j) should be determined by solving a min-max
problem, of the type
X
N
min max L(x(k + j), u(k + j − 1)) (8.93)
u(k+j)∈U w(k+j)∈W
j=1
subject to
Hx(k + j) ∈ Y
where L(., .) denotes some suitable cost function — usually quadratic, but various
proposals have been made. If this problem is solved successfully then one not only
discovers that x(k) is in the maximal (A, B)-invariant set, but one also discovers a
suitable future input trajectory which maintains y(k + j) ∈ Y .
have been advanced by Lee and Yu [LY97] and Scokaert and Mayne [SM98]. Adopt-
ing the notation of [SM98], let the set of possible future disturbance trajectories
be
`
wk+j|k ∈ W, j>0 (8.94)
X
N
min max L(x`k+j|k , u`k+j−1|k ) (8.95)
u`k+j|k ∈U `
j=1
subject to
Hx`k+j|k ∈ Y (8.96)
x`k+N |k ∈ X0 (8.97)
x`k+j|k
1
= x`k+j|k
2
⇒ u`k+j|k
1
= u`k+j|k
2
(8.98)
The main point here is that the optimization is performed over a whole set of pos-
sible input trajectories, rather than selecting a single trajectory. x`k+j|k and u`k+j|k
denote the state and input trajectories which correspond to the disturbance tra-
`
jectory wk+j|k , and (8.98) is a causality constraint which prevents the optimization
from ‘cheating’ by assuming knowledge of future disturbances — that is, the value
of the disturbance wk+j+i which occurs at time k + j + i, for i > 0, is not allowed
to influence the value of uk+j|k .
The mathematical notation here can disguise the radical difference between the
closed-loop, or feedback, optimization (8.95) and the open-loop optimization (8.93).
As in the LMI approach of [KBM96]described in section 8.4, the proposal here is to
optimise over feedback policies10 rather than over input trajectories. The difference
is perhaps best illustrated by an example, which is taken from [SM98].
Over the 3-step horizon there are 8 (= 23 ) possible realisations of the disturbance
sequence in which the disturbances take their extreme values ±1 at each step. Two
of these possible realisations are
1
wk|k 1
= wk+1|k 1
= wk+2|k = −1 (8.101)
and
8 8 8
wk|k = wk+1|k = wk+2|k = +1 (8.102)
The corresponding state predictions are
x̂1k+3|k = x(k) + û(k|k) + û(k + 1|k) + û(k + 2|k) − 3 (8.103)
and
x̂8k+3|k = x(k) + û(k|k) + û(k + 1|k) + û(k + 2|k) + 3 (8.104)
Now to perform the open-loop optimization (8.93) one has to find a single sequence
of input signals, û(k|k), û(k + 1|k), û(k + 2|k) which will satisfy the state constraints
|x̂1k+3|k | ≤ 1.2 and |x̂8k+3|k | ≤ 1.2. Clearly this is impossible, since x̂8k+3|k − x̂1k+3|k >
2 × 1.2. So in this case the optimization would fail, since the problem is infeasible.
For the closed-loop optimization (8.95), however, one can look for a different se-
quence of input signals for each different realisation of the disturbance sequence.
The space W of possible disturbance sequences,
W = {wk+i|k
`
: i = 0, 1, 2, |wk+i|k
`
| ≤ 1} (8.105)
is a convex polyhedron with 8 vertices:
1
(wk|k 1
, wk+1|k 1
, wk+2|k ) = (−1, −1, −1) (8.106)
2
(wk|k 2
, wk+1|k 2
, wk+2|k ) = (+1, −1, −1) (8.107)
3
(wk|k 3
, wk+1|k 3
, wk+2|k ) = (−1, +1, −1) (8.108)
4
(wk|k 4
, wk+1|k 4
, wk+2|k ) = (+1, +1, −1) (8.109)
5 5 5
(wk|k , wk+1|k , wk+2|k ) = (−1, −1, +1) (8.110)
6
(wk|k 6
, wk+1|k 6
, wk+2|k ) = (+1, −1, +1) (8.111)
7 7 7
(wk|k , wk+1|k , wk+2|k ) = (−1, +1, +1) (8.112)
8 8 8
(wk|k , wk+1|k , wk+2|k ) = (+1, +1, +1) (8.113)
Since the plant model is linear, these 8 disturbance sequences are the worst cases, as
regards feasibility. If the control problem is feasible for each of these sequences, it
will be feasible for any other disturbance sequence in W . Now consider the following
4 input sequences:
(u1k|k , u1k+1|k , u1k+2|k ) = (−x(k), 1, 1) (8.114)
(u2k|k , u2k+1|k , u2k+2|k ) = (−x(k), −1, +1) (8.115)
(u3k|k , u3k+1|k , u3k+2|k ) = (−x(k), 1, −1) (8.116)
(u4k|k , u4k+1|k , u4k+2|k ) = (−x(k), −1, −1) (8.117)
8.5. Robust feasibility 269
5
Since wk+i|k 1
= wk+i|k for i = 0, 1, and the causality constraint (8.98) holds, we get
xk+i|k = xk+i|k for i = 1, 2. This leads to u5k+i|k = u1k+i|k , and similarly we get
5 1
u6k+i|k = u2k+i|k , u7k+i|k = u3k+i|k , and u8k+i|k = u4k+i|k for i = 0, 1, 2. This gives the
state predictions:
x`k+i+1|k = wk+i|k
`
= ±1 ` = 1, 2, . . . , 8, i = 0, 1, 2 (8.118)
Thus all the predicted states satisfy the constraint |x(k)| ≤ 1.2, so the problem
is feasible even if worst-case disturbances occur, providing that the search is over
feedback policies.
F X0 + W = (A − BK)X0 + W ⊂ W (8.119)
must hold, and for any state in X0 all the constraints must be satisfied. Such a
set is called robust control invariant. If all the eigenvalues of A − BK are at the
origin, so that F s = (A − BK)s = 0 for some s, then a suitable candidate for X0
is the set W + F W + . . . + F s−1 W . Although the optimization must be performed
over infinitely many possible disturbance trajectories, it is pointed out in [SM98]
that if W is convex then with a linear model the search is over a convex polytope,
and it is sufficient to search over the (finitely-many) vertices of this polytope. On
each vertex a convex optimization is required, the exact nature of which depends on
the cost function L(.) in (8.95) — usually one would envisage an LP or QP being
needed here. Nevertheless, the number of vertices increases exponentially with the
horizon length, so closed-loop min-max is computationally a relatively demanding
procedure.
Example 8.2 In Example 8.1 we established feasibility, but the particular input
signals considered there were not necessarily optimal. If the cost function L(., .) is
convex then the optimal solution to the min-max problem (8.95) will occur for one
of the 8 worst-case disturbance sequences considered in that example, so 8 convex
optimizations need to be performed to find the optimal solution.
is found that x(k) is in the maximal (A, B)-invariant set then determination of a
future input trajectory can proceed by optimising deviations from the control law
u(k+j) = −Kx(k+j). This is in effect identical to the use of ‘stabilised predictions’,
which we discussed in section 5.2. Roughly speaking, making A − BK ‘more stable’,
in particular placing its eigenvalues closer to 0, gives a better chance of concluding
that a feasible solution exists, if x(k) is in the maximal (A, B)-invariant set. (If all
the eigenvalues are at zero, so that (A − BK)s = 0 for some s, then the maximal
(A, B)-invariant set depends on only a finite portion (of length s) of the disturbance
trajectory.) An example in [Bem98] shows that, if one uses ‘open-loop’ predictions,
namely K = 0, F = A, then one may falsely conclude that no feasible trajectory
exists, because the uncertainty about the disturbance accumulates with time, and
can result in an empty output admissible set being indicated. This is most likely to
happen if A has eigenvalues close to the unit circle, namely slowly decaying dynam-
ics. A further proposal is made in [KRSar]. This uses stabilised predictions again,
but chooses K for (possibly robust) performance of the unconstrained system, then
chooses deviations from this fixed control law in order to maximise the volume of a
positively-invariant ellipsoid which is output admissible. The computations required
for this are based on LMI’s.
The third idea that is needed relates to horizon lengths. Infinite-horizon predictive
control formulations require the constraints to be enforced over a finite horizon only.
In general, the minimum length of that horizon, which ensures that the constraints
will not be active beyond the horizon, depends on the current state — recall section
6.2. Let t∗ be the smallest t, such that Ot = Ot+1 , and hence that O∞ = Ot . t∗
indicates the length of the horizon over which the constraints must be enforced,
beyond the end of the control horizon. That is, one should choose Hp − Hu > t∗ . (In
this case, F , and hence Ot∗ , depends on the linear law implemented by the predictive
controller when the constraints are inactive.)
The literature on the concepts discussed in this section is growing rapidly. Robust
feasibility is an active current research area. It addresses a most important problem
for predictive control, but it is probably fair to say that the solutions advanced to
date are still some way from implementation in real applications. Some possibilities
of what to do if one finds that infeasibility is unavoidable are discussed in section
10.2. Most of the concepts introduced in this section can be applied to nonlinear
systems and arbitrary (non-convex) sets [KM00a], but computation of the relevant
sets then becomes very difficult, in general.
8.6. Problems 271
8.6 Problems
where ∆ is a stable operator, and the controller K(z) stabilises the nominal
plant P0 (z). Show that the feedback connection of the controller with the
actual plant P (z) can be represented as the feedback connection of the uncer-
tainty ∆ with the complementary sensitivity function T (z) = P0 (z)K(z)[I +
P0 (z)K(z)]−1 (see section 7.1). Hence infer that a sufficient condition for ro-
bust stability is
2. Show that the observer poles obtained from using the simplified disturbance/noise
model of section 8.2 are the plant poles, together with the eigenvalues of the
matrices
αi −φi
(8.122)
αi 1 − ψi
for i = 1, 2, . . . , p.
4. Show that any inequality of the form F (v) ≥ 0, in which F (v) is symmetric
and affine in the vector v, is an LMI.
5. (a) Verify that the minimisation problem (8.65) corresponds to the QP prob-
lem (8.63).
(b) Verify that (8.65) is in the form of (8.59) — use Problem 4.
8. Supply the missing step in the proof of robust stability in section 8.4.3: Note
that the only LMI which depends explicitly on the state measurement x(k|k)
is (8.67). Use the fact that x(k + 1|k + 1) is obtained by the state feedback law
272 8. Robust Predictive Control
Kk , and that EV (x(k|k)) is an invariant set for x(k + j|k + j) (in the absence of
disturbances), to show that
Qk x(k + 1|k + 1)
≥0 (8.123)
x(k + 1|k + 1)T 1
and hence that the solution obtained at time k remains feasible at time k + 1.
9. Prove that the maximal output admissible set is positively invariant (unless it
is empty).
Chapter 9
In this section we shall consider the well-known ‘Shell’ heavy oil fractionator (dis-
tillation column) problem, as defined in [PM87]. This is a linear model which does
not represent a real, existing process, but was devised to exhibit the most significant
control engineering features faced on real oil fractionators. It was intended to serve
as a standard problem on which various control solutions could be demonstrated (in
simulation). We shall simplify the problem definition of [PM87] slightly, and adopt
the problem definition assumed in [PG88].
The fractionator is shown in Figure 9.1. A gaseous feed enters at the bottom of the
fractionator. Three product streams are drawn off, at the top, side and bottom of
the fractionator (shown on the right-hand side in the figure). There are also three
circulating (reflux) loops at the top, middle (subsequently referred to as intermedi-
ate) and bottom of the fractionator, which are shown on the left-hand side of the
figure. Heat is carried into the fractionator by the feed, and these circulating reflux
loops are used to remove heat from the process, by means of heat exchangers. The
heat removed in this way is used to supply heat to other processes, such as other
fractionators. The amount of heat removed by each reflux loop is expressed as heat
duty; the larger the duty, the more heat is recirculated back into the fractionator,
and thus the smaller the amount of heat removed. The gains from heat duties to
temperatures are therefore positive. The heat removed in the top two reflux loops
is determined by the requirements of other processes, and these therefore act as
disturbance inputs to the fractionator. An important difference between them is
that the Intermediate Reflux Duty is considered to be measured, and is therefore
available for feedforward control, whereas the Upper Reflux Duty is an unmeasured
disturbance. The Bottoms Reflux Duty, by contrast, is a manipulated variable,
273
274 9. Two Case Studies
which can be used to control the process. The Bottoms Reflux is used to generate
steam for use on other units; so, although the Bottoms Reflux Duty can be used to
control the oil fractionator, keeping it as low as possible corresponds to generating
as much steam as possible, and is therefore economically advantageous. There are
two additional manipulated variables (that is, control inputs): the Top Draw and
the Side Draw, namely the flow rates of the products drawn off at the top and side
of the fractionator. Again, these are defined in such a way that a positive change
leads to an increase of all temperatures in the fractionator. Altotgether, then, there
are 5 inputs to the fractionator, of which three are manipulated variables (control
inputs) and two are disturbances.
Top
Temperature T
Top
Draw
Upper
Reflux Duty
A Top End Point
Composition
T
Upper
Reflux Temperature
Intermediate
Reflux Duty Side
T Draw
T
Intermediate
Reflux Temperature A Side End Point
Composition
Bottoms
Reflux Duty Side Draw
Temperature
Bottoms
Reflux Temperature T
Feed
There are 7 measured outputs from the fractionator. The first two outputs are the
compositions of the Top End Point product and of the Side End Point product.
These are measured by analysers, and the composition is represented by a scalar
variable in each case. The remaining 5 outputs are all temperatures: the Top Tem-
perature, the Upper Reflux Temperature, the Side Draw Temperature, the Inter-
mediate Reflux Temperature, and the Bottoms Reflux Temperature. Only three of
these outputs are to be controlled: the Top End Point and Side End Point composi-
tions, and the Bottoms Reflux temperature. The remaining 4 output measurements
are available for use by the controller. (In the original problem definition of [PM87]
the possibility is raised that the two analysers may be unreliable, in which case
9.1. Shell Oil Fractionator 275
The transfer function from each input to output is modelled as a first-order lag
with time delay. We shall order the inputs and outputs as shown in Table 9.1.
The transfer functions from the control inputs (manipulated variables) to all the
outputs are shown in Table 9.2. Note that all the time constants and time delays are
expressed in minutes. The transfer functions from the two disturbance inputs to the
outputs are shown in Table 9.3. These tables show the nominal transfer functions.
The gain in each transfer function is uncertain, the uncertainties associated with
each input being correlated with each other. Table 9.4 specifies the uncertainty in
each gain. The nominal model is obtained when δj = 0 for each j; but it is assumed
that each δj can vary in the range −1 ≤ δj ≤ 1.
Table 9.1: Names, roles and symbols of input and output variables.
u1 u2 u3
y1 , z1 4.05e−27s 1
1.77e−28s 1
5.88e−27s 1
50s+1 60s+1 50s+1
y2 , z2 5.39e−18s 1
5.72e−14s 1
6.90e−15s 1
50s+1 60s+1 40s+1
y3 3.66e−2s 9s+1
1
1.65e−20s 30s+1
1
5.53e−2s 40s+1
1
y4 5.92e−11s 1
2.54e−12s 1
8.10e−2s 1
12s+1 27s+1 20s+1
y5 4.13e−5s 8s+1
1
2.38e−7s 19s+1
1
6.23e−2s 10s+1
1
y6 4.06e −8s 1
4.18e −4s 1
6.53e −1s 1
13s+1 33s+1 9s+1
y7 , z3 4.38e−20s 33s+1
1
4.42e−22s 44s+1
1 1
7.20 19s+1
Figure 9.2 shows the nominal unit step response from each input — including the two
disturbance inputs, the columns being arranged in the order u1 , u2 , u3 , dm , du — to
each output of the fractionator. This confirms that the fractionator is asymptotically
stable, and that the settling times range from about 10 minutes (for element (5,4)
— from the Intermediate Reflux Duty to the Side Draw Temperature) to about 250
276 9. Two Case Studies
dm du
y1 , z1 1.20e−27s 1
1.44e−27s 1
45s+1 40s+1
y2 , z2 1.52e −15s 1
1.83e−15s 1
25s+1 20s+1
1 1
y3 1.16 11s+1 1.27 6s+1
1 1
y4 1.73 5s+1 1.79 19s+1
1 1
y5 1.31 2s+1 1.26 22s+1
1 1
y6 1.19 19s+1 1.17 24s+1
1 1
y7 , z3 1.14 27s+1 1.26 32s+1
u1 u2 u3 dm du
y1 , z1 4.05 + 2.11δ1 1.77 + 0.39δ2 5.88 + 0.59δ3 1.20 + 0.12δ4 1.44 + 0.16δ5
y2 , z2 5.39 + 3.29δ1 5.72 + 0.57δ2 6.90 + 0.89δ3 1.52 + 0.13δ4 1.83 + 0.13δ5
y3 3.66 + 2.29δ1 1.65 + 0.35δ2 5.53 + 0.67δ3 1.16 + 0.08δ4 1.27 + 0.08δ5
y4 5.92 + 2.34δ1 2.54 + 0.24δ2 8.10 + 0.32δ3 1.73 + 0.02δ4 1.79 + 0.04δ5
y5 4.13 + 1.71δ1 2.38 + 0.93δ2 6.23 + 0.30δ3 1.31 + 0.03δ4 1.26 + 0.02δ5
y6 4.06 + 2.39δ1 4.18 + 0.35δ2 6.53 + 0.72δ3 1.19 + 0.08δ4 1.17 + 0.01δ5
y7 , z3 4.38 + 3.11δ1 4.42 + 0.73δ2 7.20 + 1.33δ3 1.14 + 0.18δ4 1.26 + 0.18δ5
Table 9.4: Extent of gain uncertainty in each transfer function. |δj | ≤ 1 for each j.
minutes (for element (2,2) — from the Side Draw to the Side End Point). The
various time delays can also be seen clearly in the figure.
Step Response
10
0
10
0
10
0
Amplitude
10
0
10
0
10
0
10
0
0 120 2400 120 2400 120 2400 120 2400 120 240
Time (minutes)
Figure 9.2: Open-loop step responses of the ‘Shell’ heavy oil fractionator.
because it does not matter, but because it is too difficult to articulate in advance.)
In addition there are constraints on inputs and outputs as shown in Table 9.5. The
variables have been scaled so that they all have similar constraints, and the input
move constraints, which are 0.05 per minute for each input, have been expressed
as limits on |∆uj |, consistently with our earlier notation, in terms of the sampling
and control update interval Ts . Note that the Bottoms Reflux Temperature has
constraints but no set-point, so it has a ‘zone’ objective, as discussed in section 5.5.
Table 9.5: Input and output constraints for the oil fractionator. (Ts is the control
update interval.)
The two disturbance inputs are known to take values in the range ±0.5, but they
are otherwise unspecified.
278 9. Two Case Studies
One of the objectives is to minimise the Bottoms Reflux Duty, which is one of the
control inputs. The most straightforward way to do this is to make this input also
an output, and make its set-point equal to its lowest permitted value, which is −0.5.
Since we require the model to be strictly proper (no direct feed-through from input
to output — see section 2.1) we define a new controlled output z4 as
z4 (k) = u3 (k − 1) (9.1)
and its set-point will be s4 (k) = −0.5 for all k. This approach is not ideal, however,
because this set-point cannot be held in the steady state without violating the con-
straints, even when the model is exact and there are no disturbances. To see this,
consider the matrix of steady-state gains from the control inputs to the controlled
outputs:
z1 4.05 1.77 5.88
z2 5.39 5.72 6.90 u1
z3 = 4.38 4.42 7.20 u2 (9.2)
u3
z4 0 0 1
In order to hold the vector [z1 , z2 , z4 ] at the set-point vector [0, 0, −0.5], the input
vector would have to be [u1 , u2 , u3 ] = [0.7860, −0.1375, −0.5], so the Top Draw (u1 )
would have to violate its upper constraint. Furthermore, this input vector would
give z3 = −0.7651, so the Bottoms Reflux Temperature would have to violate its
lower constraint. The unsatisfactory aspect of this formulation is that the distinction
between genuine set-points for z1 and z2 , and the constraint on z4 , has been lost.
Making the outcome reflect the real objectives may require tuning the weights in the
MPC formulation, and there is no guarantee that the same weights will be suitable
for various combinations of disturbances and model errors.
The real solution is to adopt one of the strategies discussed in section 10.1.2. But
here we will continue to use the simple approach, of defining a set-point for z4 (= u3 ).
One way of alleviating the difficulty is to find a set-point which does not lead to
constraint violations at steady-state. Assuming no disturbances and a perfect model,
obtaining z1 = z2 = 0 requires
u1
0 4.05 1.77 5.88
= u2 (9.3)
0 5.39 5.72 6.90
u3
This can be attained by any vector u in the null-space of the matrix in (9.3), which
is one-dimensional:
u1 1
u2 = α −0.175 (9.4)
u3 −0.6361
9.1. Shell Oil Fractionator 279
Choosing α = 0.5 gives u = [0.5, −0.0875, −0.3181]T , which satisfies the input con-
straints, and this in turn gives z3 = −0.4867, which satisifies (just!) the lower
constraint on the Bottoms Reflux Temperature. So −0.3181 may be a better set-
point for u3 than −0.5. However, there may be some combinations of disturbances,
and some departures of the real fractionator gains from the modelled ones, which
will allow a lower value of u3 to be held.
The next issue to consider is the sampling interval to be used, Ts . There are three
aspects to consider:
The last of these is the least important, given modern memory capacities. Table
9.6 shows the storage requirements of z-transform transfer function models, of exact
state-space models, and of step response models for various sampling times.1 Later
we shall see that approximate state-space models of considerably smaller state di-
mension can in fact be used, and their storage requirements are considerably smaller
than those shown in the Table. The transfer function models are represented as LTI
objects in MATLAB’s Control System Toolbox, whereas the state-space models are
in the Model Predictive Control Toolbox’s MOD format, and the step response mod-
els are in the Model Predictive Control Toolbox’s STEP format. The step response
model is truncated after 250 minutes (and so gets smaller as the sampling time is
increased), and all variables are stored in double precision. It should be emphasised
that the table shows the amount of storage needed just to represent the model, not
the amount required by the controller algorithm. In each case the state-space model
has had redundant modes removed, using the Control System Toolbox’s minimal re-
alization function minreal. The dependence of the state dimension on the sampling
inerval is due to the fact that each delay requires a state variable to represent it,
and the number of delays is reduced by increasing the sampling interval. (The state
dimension includes the one additional state required because of definition (9.1).)
Since we have no information about measurement noise, and very little about the
disturbances, there is not much scope for being clever with observers and disturbance
models in this case. In addition the model is asymptotically stable, so all three model
representations — that is, step response, transfer function, or state-space — can be
used. In these circumstances, each of the three model representations could be used
equally well.
Table 9.6: Memory storage, in kilobytes, needed for various model representations
and various sampling times. (State-space models are exact.)
region of 120–250 minutes (the relevant open-loop time constants range from 40 to
60 minutes; closed-loop time constants are to be between 80% and 125% of these
values; take the settling time to be 3× time constant and add the time delay of
between 14 and 28 minutes). Recall from section 7.2.2 that ‘mean-level’ design gives
a closed-loop set-point response speed similar to the open-loop speed, and is achieved
by making the prediction horizon very large and the control horizon very small. We
will not go to the extreme of Hp = ∞ and Hu = 1, but, guided by that example, we
will try a relatively long prediction horizon. Since constraints are to be enforced at
all times, the option of choosing a small number of coincidence points is not available,
at least for constraint enforcement — it remains a possibility for penalising tracking
errors in the cost function. Choosing a small sampling interval will therefore lead to
a large prediction horizon, which will be computationally demanding. On the other
hand, the effect of the Intermediate Reflux Duty, which is a measured disturbance,
on the Bottoms Reflux Temperature, is relatively fast, with no time delay and a
time constant of 27 minutes. Therefore choosing a sampling interval as large as 10
minutes may not give enough opportunity for effective feedforward action. We shall
therefore try Ts = 4 minutes — the same value as chosen in [PG88].
If only the Top and Side End Point compositions and the Bottoms Reflux Temper-
ature have been retained as outputs, and the Bottoms Reflux Duty is brought out
as an additional output (with a one-step delay), then a minimal state-space real-
ization of a discrete-time model, with Ts = 4 minutes, has 80 states. Reducing the
number of states would speed up the controller computations, and reduce the risks
of hitting numerical problems. A lower-order approximation can be obtained in a
number of ways. One way is to simulate the pulse response, and use the algorithm
presented in section 4.1.4. Since a state-space model is already available, a related
but better way is to first obtain a balanced realization of the 80-state system, and
(from the same computation) its Hankel singular values. The balanced realization
has the property that its state variables are ordered according to the contribution
they make to the input-output behaviour, loosely speaking, and approximations can
therefore be obtained by truncating the state vector, and truncating the matrices
of the state-space model correspondingly. The Hankel singular values can be used
as a guide to how many state variables should be truncated. (State variables which
make no contribution to the input-output behaviour correspond to zero Hankel sin-
9.1. Shell Oil Fractionator 281
Figure 9.3 shows the Hankel singular values of the fractionator model, when only the
Top and Side End Point compositions and the Bottoms Reflux Temperature have
been retained as outputs, and the Bottoms Reflux Duty has been brought out as
an additional output (with a one-step delay). On the left these singular values are
shown on a linear scale, while on the right their logarithm (to base 10) is shown.
The logarithmic plot suggests that a ‘natural’ choice of order would be either 30 or
50, since that is where reductions of several orders of magnitude occur. But in fact
reducing to only 20 states gives step responses which are almost indistinguishable
from those of the full 80-state model. We shall use the 20-state approximate model
for all our investigations.3
10 2
9 0
−2
8
−4
7
Log10 of Hankel singular values
−6
Hankel singular values
6
−8
5
−10
4
−12
3
−14
2
−16
1 −18
0 −20
0 10 20 30 40 50 60 70 80 0 10 20 30 40 50 60 70 80
Figure 9.3: Hankel singular values of the ‘Shell’ heavy oil fractionator, with Ts = 4
minutes.
Table 9.7 shows the storage requirements for the full 80-state and the approximate
20-state models. These are seen to be much smaller than for the exact model of the
dynamics of all the measured outputs. In fact the 20-state model requires about
50% less memory than the step response model.
In order to predict beyond the expected settling time — up to 300 minutes, say
— the choice of sampling interval Ts = 4 minutes will require a prediction horizon
Hp = 75. Because of the significant time delays in many of the transfer functions
between control inputs and controlled outputs, it will be advisable not to enforce
2
Obtaining a balanced realization proved problematic. The Control System Toolbox function
balreal did not work, because of numerical finite-precision effects — the 80-state model is too
close to being uncontrollable. But the Robust Control Toolbox function dobal worked without
difficulty.
3
This model is available in the MATLAB-readable file oilfr20.mat on this book’s web site.
282 9. Two Case Studies
State Memory
dimension required
n (kbytes)
80 58.5
20 5.2
Table 9.7: Memory storage, in kilobytes, needed for the exact and approximate
state-space models for outputs z1 , z2 and z3 only, with Ts = 4 minutes.
constraints over the initial part of the prediction horizon, or to soften them, or both.
The largest time delay is 28 minutes, which corresponds to 7 steps into the prediction
horizon.
The choice of control horizon will have a large impact on the computational load on
the controller algorithm. Since there is a large spread of slow and fast dynamics in the
various transfer functions of the fractionator, the use of blocking, namely non-uniform
intervals between control decisions — see Problem 14 of Chapter 1 and Problem 4
of Chapter 3 — seems appropriate here, as that allows control adjustments to be
made throughout the predicted transient period without having too many decision
variables in the optimization problem. Guided by the responses shown in Figure 9.2,
we guess that it may be appropriate to keep û(k|k), û(k + 1|k), û(k + 3|k), û(k + 7|k)
and û(k + 15|k) as the decision variables, so that the blocking pattern is as follows,
each block being twice as long as the previous one:
û(k|k) (9.5)
û(k + 1|k) = û(k + 2|k) (9.6)
û(k + 3|k) = û(k + 4|k) = û(k + 5|k) = û(k + 6|k) (9.7)
û(k + 7|k) = û(k + i|k) for i = 8, 9, . . . , 14 (9.8)
û(k + 15|k) = û(k + i|k) for i = 16, 17, . . . (9.9)
In this way we have only 15 decision variables (3 control inputs × 5 decision times),
but control decisions are taken up to 60 minutes into the prediction horizon.
Next we must choose weights for the cost function. Since the Bottoms Reflux Tem-
perature (z3 ) has a zone objective only, the tracking error weight for it is 0. For the
Top End Point and Side End Point compositions we have very little information on
which to base our choice. We assume that the variables have already been scaled
such that equal errors on each of these are equally important, and hence give them
equal weight. We will also keep the weights constant over the prediction horizon,
except that we will not weight the Top End Point errors during the first 7 steps, or
the Side End Point errors during the first 4 steps, because of the long time delays in
the transfer functions involved. The Bottoms Reflux Duty (z4 ) tracking error will
also be given equal weight with the others, since there is no clear reason for any
other choice. This weight in particular may be adjusted in the light of experience,
in order to change the trade-off between tracking the Top End Point and Side End
9.1. Shell Oil Fractionator 283
Point compositions, and minimising the Bottoms Reflux Duty. Thus we have
0 0 0 0
0 0 0 0
Q(i) =
0 0 0 0 for i ≤ 4 (9.10)
0 0 0 1
0 0 0 0
0 1 0 0
Q(i) =
0 0 0 0 for 5 ≤ i ≤ 7 (9.11)
0 0 0 1
1 0 0 0
0 1 0 0
Q(i) =
0 0 0 0 for i ≥ 8 (9.12)
0 0 0 1
No penalties will be imposed on control moves initially; the specification does not
require input moves to be minimised. If the response is later found to be too erratic,
or too sensitive to model uncertainty, then this decision will be reviewed. Thus we
have R(i) = 03,3 for each i.
Figure 9.4 shows the response with these tuning parameters, when the set-points for
z1 and z2 are both 0, the set-point for u3 is initially −0.32, and is changed to −0.5
after 300 minutes. This response was obtained using the Model Predictive Control
Toolbox function scmpc; the 80-state model was taken as the plant, and the 20-state
approximation as the controller’s internal model. Both the plant and the internal
model had zero initial state vectors. In the initial transient z3 violates its lower
constraint for about 150 minutes by a small amount before settling at the constraint
value. z1 and z2 take about 200 minutes to settle to their set-points, and during this
time u1 gradually increases up to its constraint. After 300 minutes all the variables
have settled to the values expected from our earlier steady-state analysis. We note
that the settling time of about 200 minutes is in accordance with the specification. It
is also noteworthy that the control activity does not appear to be excessive, despite
the fact that control moves have not been penalised.
After 300 minutes the set-point for u3 is changed to −0.5, in order to encourage it
to become as close as possible to its lower constraint. u1 does not change at all,
since it is already on its upper constraint. u2 and u3 change very slightly, with
the result that z1 and z2 depart from their set-points, and settle at +0.025 and
−0.05, respectively, which is outside the steady-state specification. This indicates
that the current weighting of tracking errors, as defined by (9.10)–(9.12), gives too
much importance to the u3 set-point, relative to the z1 and z2 set-points, since we
want the latter two to be the primary objectives of control. We therefore increase
284 9. Two Case Studies
0.1
−0.1
Outputs
−0.2 z1
z2
−0.3
z3
−0.4
−0.5
−0.6
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)
0.6
0.4 u1
u2
u3
0.2
Inputs
−0.2
−0.4
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)
the z1 and z2 weights (namely element (2, 2) in (9.11) and elements (1, 1) and (2, 2)
in (9.12)) from 1 to 10, leaving the weight on u3 unchanged at 1. This was found
to reduce the steady-state errors on z1 and z2 to +0.001 and −0.001, respectively,
which is within specification. But the inputs, especially u2 and u3 , were now seen
to be oscillating considerably during the transient, and z3 showed some oscillation
about its constraint before settling down. The penalty weighting R(i) = I3 was
therefore imposed on control moves. This removed the oscillations, but now caused
the steady-state error on z1 to increase to just outside the specified value of ±0.001.
The weight on z1 tracking errors was therefore increased from 10 to 20, which had
the desired effect. The corresponding response is shown in Figure 9.5.
Next we examine the effect of a disturbance on the Intermediate Reflux Duty (dm ),
which is a measured disturbance, and can therefore be countered by feedforward
action. Figure 9.6 shows the fractionator initially at the same steady-state as reached
at the end of the run shown in Figure 9.5. A disturbance occurs as follows — this
is expressed in steps, each step lasting 4 minutes:
0 for k ≤ 12
+0.5 for 12 < k ≤ 37
dm (k) = 0 for 37 < k ≤ 62 (9.13)
−0.5 for 62 < k ≤ 87
0 for k > 87
9.1. Shell Oil Fractionator 285
0.2
0
z1
Outputs
z2
−0.2
z3
−0.4
−0.6
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)
0.6
0.4
u1
u2
0.2
Inputs
u3
−0.2
−0.4
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)
Figure 9.5: Response with increased weight on z1 and z2 tracking errors, and pe-
nalised control moves.
Recall that an increase in the Intermediate Reflux Duty corresponds to less heat
being taken away from the fractionator. Thus the initial disturbance of +0.5 allows
the Bottoms Reflux Duty (u3 ) to be reduced at first. This, however, leads to the
Bottoms Reflux Temperature (z3 ) falling below its constraint, so u3 increases again,
this being compensated by a reduction of u1 away from its constraint. u2 follows
a similar pattern to u3 . When the disturbance ceases, there is a transient lasting
about 100 minutes, by the end of which all the variables have returned to their initial
values. Then the disturbance dm = −0.5 arrives; u1 cannot increase now, since it is
already at its upper constraint, so u3 has to increase (from −0.32 to −0.22) for as
long as the disturbance lasts. Note that the Bottoms Reflux Temperature (z3 ) now
moves away from its lower constraint, since it is a ‘zone’ rather than a ‘set-point’
variable. Finally (for k > 87, namley after about 350 minutes) the disturbance
ceases again, and all the variables return to their initial values.
We now consider the response to a change of the Upper Reflux Duty, which is an
unmeasured disturbance, so that feedforward cannot be used to correct its effects.
We will apply the same pattern of disturbance as defined by (9.13). But we expect
the control to be less effective in this case, since only feedback action is available.
Figure 9.7 shows that this is indeed the case. The departures of z1 and z2 from
their set-points are much bigger now, and take longer to correct, and the controller
barely manages to keep the outputs within their constraints — in fact several minor
286 9. Two Case Studies
0.2
0
z1
Outputs
z2
−0.2 z3
−0.4
−0.6
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)
0.6
0.4
u1
0.2 u2
Inputs
u3
−0.2
−0.4
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)
All the results shown so far were obtained with hard constraints enforced on outputs
as well as inputs. For more severe disturbances it is necessary to soften the output
constraints. For example, if measured and unmeasured disturbances occur together
with the following form:
0 for k ≤ 12
dm (k) = du (k) = +0.5 for 12 < k ≤ 62 (9.14)
−0.5 for k > 62
then infeasibility occurs when both disturbances take the value −0.5. (Note that not
only do both disturbances occur together, but they both suddenly jump from +0.5
to −0.5, which is a much bigger change than in the simulations shown up to now.)
If, however, the constraints are softened using an exact ∞-norm penalty function,
with penalty coefficient ρ = 103 (see section 3.4), then the result is shown in Figure
9.8 — larger values of ρ give essentially the same results. When both disturbances
are positive, there is no particular difficulty. All output variables are kept within
constraints, and all inputs come off their constraints. When both disturbances
9.1. Shell Oil Fractionator 287
1
z1
z2
0.5 z3
Outputs
−0.5
−1
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)
0.5
Inputs
u1
−0.5 u2
u3
−1
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)
become negative (after about 250 minutes), however, it is not possible to hold any
of the three outputs within their constraints initially.
Very similar results are obtained if hard constraints are enforced, but not for the first
three steps in the prediction horizon. That is, if there are no constraints enforced
on ẑ(k + i|k) for i = 1, 2, 3. The results are shown in Figure 9.9. Although this is
an alternative way of recovering feasibility, it can be seen that there are more z3
constraint violations than seen in Figure 9.8, and the peak violations are slightly
larger. In particular, note the small but sustained z3 constraint violation from about
100 to about 250 minutes into the simulation, which is not present in Figure 9.8.
In both the cases shown in Figures 9.8 and 9.9 the steady-state values eventually
assumed by z1 and z2 are within the ±0.001 range permitted by the specification.
(This is not visible on the figures, as the variables do not reach their steady-state
values within the 500 minutes shown.) This is to be expected, because the steady-
state values are determined by the same trade-off as in Figure 9.5. The disturbances
cause the inputs to have different steady-state values now (u1 = 0.5, u2 = −0.0525,
u3 = −0.1042). The first two of these play no role in the cost function; the third does
play a role, but the weight on its tracking error (away from its set-point of −0.5)
is sufficiently small, compared with the weights on z1 and z2 , that the primary
objectives are met within specification. Note that the set-point for u3 prevents
offset-free tracking from being obtained, despite the low error weight associated
288 9. Two Case Studies
1
z1
z2
0.5
z3
0
Outputs
−0.5
−1
−1.5
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)
1
u1
u2
0.5 u3
Inputs
−0.5
−1
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)
Figure 9.8: Response to measured and unmeasured disturbances, and soft con-
straints.
with it.
It is not enough that our controller works when the plant is exactly as expected. The
gains of the real fractionator may vary as described in Table 9.4, and the controller
must continue to work satisfactorily as they do so.
Recall from sections 7.3 and 8.1.1 that singular values of multivariable frequency
responses give some indication of the robustness of a feedback design to modelling
errors. However, these can only be computed for the linear controller which is
obtained when all the constraints are inactive. Figure 9.10 shows the largest singular
values of the sensitivity and complementary sensitivity functions, S(s) and T (s)
respectively, for the linear controller which results from the design presented in the
previous section, when all the constraints are inactive. Since only outputs z1 and
z2 are controlled to set-points, these singular values have been computed on the
assumption that these two are the only outputs. (The singular values are shown for
frequencies ω up to the Nyquist frequency π/Ts .) It will be seen that σ̄[T (ejωTs )],
the largest singular value of T (z), has a value 1 (0 dB) at low frequencies. This
indicates offset-free tracking, which is expected so long as constraints are not active.
9.1. Shell Oil Fractionator 289
1
z1
z2
0.5
z3
0
Outputs
−0.5
−1
−1.5
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)
1
u1
u2
0.5 u3
Inputs
−0.5
−1
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)
Figure 9.9: Response to measured and unmeasured disturbances, and hard con-
straints on ẑ(k + i|k) for i > 3.
It has a peak value barely larger than 1; this can be shown to imply reasonably
good robustness of the design to multiplicative perturbations of the plant’s transfer
function [Mac89, ZDG96]. It can also be seen that σ̄[T (ejωTs )] falls to about 0.5
(-6 dB) at ‘high’ frequencies, namely near ω = π/Ts . This indicates that not much
attenuation of any measurement noise takes place, so that z1 and z2 will tend to
follow any measurement noise that is present on the analyser outputs. This is not
a serious problem, since the Nyquist frequency is rather low (0.78 rad min−1 , or
0.002 Hz), so that any electrical noise can be assumed to have been removed from
the measurements; however, no specification of measurement noise is given in the
problem definition [PM87].
The plot of σ̄[S(ejωTs )] shown in Figure 9.10 shows it falling to zero at low fre-
quencies, which is again what is expected of the unconstrained behaviour, since it
indicates offset-free tracking and is consistent with the behaviour of σ̄[T (ejωTs )].
Its peak value is 2 (6 dB), however, which is usually a little too large for comfort.
It crosses the 0 dB line just above 0.03 rad min−1 , which shows that a sinusoidal
(unmeasured) output disturbance with period shorter than about 200 (= 2π/0.03)
minutes will be amplified rather than reduced by the feedback action.
We can employ the robust stability tests introduced in section 8.1.1 to get a more ac-
curate indication of the designed system’s vulnerability to the possible gain changes
290 9. Two Case Studies
10
−5
Singular values (dB)
−10
−15
−20
−25
−30
−35
−3 −2 −1 0
10 10 10 10
Frequency (rad/min)
Figure 9.10: Largest singular values of sensitivity S(z) (broken line) and comple-
mentary sensitivity T (z) (solid line).
defined in Table 9.4. The nominal (continuous-time) plant model P0 (s) is defined in
Table 9.2. The actual plant can be represented as
where ∆ = diag{δ1 , δ2 , δ3 }, and W (s) is a transfer function matrix with the same
lag and delay structure as P0 (z), but gains taken from Table 9.4. So, for example,
2.11e−27s
W (s)11 = . (9.16)
50s + 1
We shall abuse notation slightly and refer to the transfer functions corresponding to
P0 (s), P (s) and W (s), after conversion to discrete-time representations, as P0 (z),
P (z) and W (z). Note that the diagonal block ∆ remains unchanged in the discrete-
time representation.4
As was said in section 8.1.1, this test is likely to be too conservative — if it is not
satisfied, this does not mean that the closed loop is not robustly stable. A less
conservative condition is
where µ[.] denotes the structured singular value for the diagonal uncertainty struc-
ture. But this is still conservative, because it allows for possibly complex gain
perturbations. The conservativeness can be reduced further by checking the ‘real-µ’
condition
Figure 9.11 shows the largest singular value σ̄[KSW ], the complex structured sin-
gular value µ[KSW ], and an upper bound for the real structured singular value
µR [KSW ], computed for an uncertainty structure of 1 × 1 blocks — these cor-
respond to the scalar uncertainties δi in the process gains. Although this figure
50
25
−25
−50
−3 −2 −1 0
10 10 10 10
Figure 9.11: Largest singular value (solid line), and estimates of complex µ (broken
line) and real µ (chained line) of K(z)S(z)W (z).
suggests that the designed controller should give instability with one of the possible
plants, it is difficult to find such a plant — recall that the small-gain and complex-µ
292 9. Two Case Studies
robustness tests give only sufficient, not necessary, conditions for robust stability,
and that only an upper bound is available for µR . With δ1 = −1, δ2 = δ3 = 1, very
underdamped closed-loop behaviour is obtained, which suggests that the system is
close to instability for this perturbation. Figure 9.12 shows the response with this
plant perturbation, when the same unmeasured disturbance is present as defined
in (9.13) and δ5 = 1. This response was obtained with soft constraints (ρ = 103 ),
since the optimization became infeasible with hard constraints, as a result of the
plant-model mismatch. Although not technically unstable, the response is now so
erratic that the controller is in effect useless.
1.5
z1
1 z2
z3
0.5
Outputs
−0.5
−1
−1.5
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)
0.5
Inputs
u1
−0.5 u2
u3
−1
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)
less erratic.
1
z1
z2
0.5 z3
Outputs
−0.5
−1
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)
0.5
Inputs
u1
−0.5 u2
u3
−1
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)
Figure 9.14 shows the response with R(i) = 10I when the model is exact (δi = 0 for
all i). Comparing this figure with Figure 9.7, it is seen that not very much has been
lost in nominal performance — the control of the outputs is not much worse than
with the original design. Figure 9.15 shows the largest singular value, complex µ and
real µ of KSW for the reduced-gain controller. Comparing this figure with Figure
9.11, it can be seen that a significantly more robustly stable system is indicated for
the reduced-gain controller.
In cases where the control specification is more demanding, the simple solution of
reducing the controller gain by increasing R(i) may not be sufficient. It may be
necessary to introduce disturbance models in order to control the controller gain
more selectively in some frequency ranges. (The Lee-Yu tuning procedure presented
in section 8.2 offers one way of doing this.)
294 9. Two Case Studies
0.5
0
Outputs
−0.5
z1
−1 z2
z3
−1.5
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)
0.5
Inputs
−0.5 u1
u2
u3
−1
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)
Figure 9.14: Response with correct model, unmeasured disturbance, and increased
control move penalty.
50
25
−25
−50
−3 −2 −1 0
10 10 10 10
Figure 9.15: Largest singular value (solid line), complex µ (broken line) and real µ
(chained line) of K(z)S(z)W (z) with the reduced-gain controller.
9.2. Newell and Lee Evaporator 295
Cooling water
T201
F200, T200
Vapor
F4,T3
Condenser
L2 Condensate
P2 Separator F5
Steam
F100 P100
T100
Evaporator
F3
Condensate
Feed
Product
F1, X1, T1
F2, X2, T2
The three controlled outputs, together with their initial equilibrium (steady-state)
values and constraints, are given in Table 9.8. The three manipulated variables
(control inputs) to be considered in this study, together with the corresponding
equilibrium values and their constraints, are given in table 9.9. There are no rate
constraints on the manipulated variables; the first-order lags, combined with the
amplitude constraints, result in rate constraints being satisfied without imposing
them explicitly.
There are five disturbance variables, although in this study we will leave them fixed.
These, together with their corresponding equilibrium vaues, are given in Table 9.10.5
The nonlinear equations describing the operation of the evaporator are given in
[NL89], and will not be repeated here.
Disturbance Equilibrium
Circulating flow rate F3 50.0 kg/min
Feed flow rate F1 10.0 kg/min
Feed concentration X1 5.0 %
Feed temperature T1 40.0 degC
Cooling water entry temperature T200 25.0 degC
A Simulink simulation model which implements these equations has been imple-
mented, and is shown in Figure 9.17. The three manipulated variables, and the
circulation flow rate F3 , would in practice be controlled by local servos operating
valves. These are not modelled in detail, but are represented by first-order lags
with time-constants of 1.2 minutes. For this reason inputs to the model are labelled
5
In Chapter 12 of [NL89] the circulating flow rate F3 is considered to be another manipulated
variable.
9.2. Newell and Lee Evaporator 297
as F2SP rather than F2 (etc), to denote that they are set-points for the manipu-
lated variables, rather than the variables themselves. This model is available on this
book’s web site, including the lower-level sub-models, namely the heat exchanger,
the condenser, the separator, and the steam-jacket (in file evaporator.mdl) . The
model is in a form suitable for use with the Model Predictive Control Toolbox func-
tion scmpcnl, and its modified version scmpcnl2, which is also available on the web
site.
Since the model is nonlinear, it is linearised in order to get a linear internal model
to be used by the predictive controller. An initial linearisation is performed at
the equilibrium condition defined in Tables 9.8–9.10. Figure 9.18 shows the result
of using predictive control, when the set-point for the product concentration X2 is
ramped down linearly from 25% to 15% over a period of 20 minutes (between 20 and
40 minutes into the simulation run), and the operating pressure P2 is simultaneously
ramped up from 50.5 kPa to 70 kPa. It should be noted that the controller had no
advance information about the planned set-point trajectories, so it was reacting to
tracking errors, rather than anticipating set-point changes.
The sampling interval used was Ts = 1 minute, and the MPC tuning parameters
used to obtain these results were:
Hp = 30, Hu = 3, Q(i) = diag(1000, 100, 100), R(i) = I3 (9.20)
These parameters were not tuned carefully, but were almost the first set of parame-
ters tried, the objective here being to show the effects of nonlinearities. The penalty
on L2 tracking errors is 10 times larger than those on X2 and P2 because L2 is
confined between 0 and 2 m, whereas the numerical values of X2 and P2 are consid-
erably larger; these penalty weights indicate that a 1 m error in the separator level
is considered equally undesirable as a 10% error in the product concentration, or a
10 kPa error in the operating pressure.
It is seen from Figure 9.18 that control is initially satisfactory. The initial set-points
are held quite closely (after a brief initial transient during which all the variables in
the simulation settle to their equilibrium values), even when X2 and P2 start chang-
ing as they follow their ramp set-points. But about half-way through the ramp the
separator level L2 drifts considerably off its set-point and does not return to it. Al-
though the product concentration X2 tracks the set-point change quite closely, and
settles correctly at the required steady-state level, all the other variables indicate
underdamped closed loop behaviour, with the operating pressure P2 oscillating and
drifting away from its set-point. The manipulated variables show undesirable os-
cillation, with the cooling water flow rate F200 being particularly erratic, switching
between shutting off the water flow completely and restoring it to its initial value.
This deterioration of closed-loop behaviour is due to the fact that the linearised
model used by the predictive controller has become a very inaccurate representation
of the small-deviation behaviour of the evaporator at the new operating conditions.
Figure 9.19 shows the same scenario, but with the internal model used by the predic-
tive controller re-linearised 70 minutes into the simulation run, namely 30 minutes
5
F1 F1
10.0 P2 3
9. Two Case Studies
F2
Constant3 T2
P2
1 Q100 T2
1 40.0 F4
1.2s+1 F2
F2SP F5
F2 Lag Saturation Constant X2 2
7 T1
T3
X2
T1 6 X1
Constant1
1
3 F200 Terminator
1.2s+1 F200
F200SP T3’ F5’
F200 Lag Saturation2
8 T200
T200 condenser
1
2 P100
1.2s+1 P100
P100SP Q100’
Saturation1 25.0 Q100
P100 Lag T2’
Constant2
F1’’
F100
1 F100
4 F3’
1.2s+1 F3
F3SP steamjacket
F3 Lag F1’ Saturation3
50.0
F2’ L2 1
Constant4
L2
F4’
separator
298
9.2. Newell and Lee Evaporator 299
1.4 25
X2 (%)
L2 (m)
1.2 20
1 15
0.8 10
0 20 40 60 80 100 0 20 40 60 80 100
Operating Pressure Product Flow Rate SP
75 4
70 3.5
F2 (kg/min)
P2 (kPa)
65 3
60 2.5
55 2
50 1.5
0 20 40 60 80 100 0 20 40 60 80 100
Steam Pressure SP Water Flow Rate SP
300 400
250 300
F200 (kg/min)
P100 (kPa)
200 200
150 100
100 0
0 20 40 60 80 100 0 20 40 60 80 100
Time (minutes) Time (minutes)
Figure 9.18: Simulation with single linearised model, obtained at the initial equilib-
rium condition. (Broken lines show the set-points.)
after the new operating conditions have been (approximately) reached. Large tran-
sients are seen on all three manipulated variables as the new model is switched in —
no attempt has been made to achieve ‘bumpless transfer’ in the simulation. Both L2
and P2 are brought back close to their set-points within 10 minutes of updating the
inernal model, and the manipulated variables have become less oscillatory within
this time.
Figure 9.20 shows the results when the internal model is re-linearised every 10
minutes. Now it remains a reasonably good representation of the plant behaviour
throughout the change of operating conditions, and it is clearly seen that the qual-
ity of control is much better. The product concentration and operating pressure are
both held very close to their set-points throughout, and the separator level, although
still undergoing considerable deviations from its set-point, is now controlled much
more satisfactorily than before.
1.4 25
X2 (%)
L2 (m)
1.2 20
1 15
0.8 10
0 20 40 60 80 100 0 20 40 60 80 100
Operating Pressure Product Flow Rate SP
75 4
70 3.5
F2 (kg/min)
P2 (kPa)
65 3
60 2.5
55 2
50 1.5
0 20 40 60 80 100 0 20 40 60 80 100
Steam Pressure SP Water Flow Rate SP
300 400
250 300
F200 (kg/min)
P100 (kPa)
200 200
150 100
100 0
0 20 40 60 80 100 0 20 40 60 80 100
Time (minutes) Time (minutes)
different intervals, using the MATLAB program contained in file simevap.m, and
with different scenarios. It should be noted, however, that this program does not
implement any of the checks which would be required in practice, to check that
a reasonable model has been obtained. Also, the linearised model obtained is not
quite correct if the plant is not at equilibrium — see section 2.1.2.
9.3. Problems 301
1.2
25
1.1
X2 (%)
L2 (m)
20
1
15
0.9
0.8 10
0 20 40 60 80 100 0 20 40 60 80 100
Operating Pressure Product Flow Rate SP
75 4
70 3.5
F2 (kg/min)
P2 (kPa)
65 3
60 2.5
55 2
50 1.5
0 20 40 60 80 100 0 20 40 60 80 100
Steam Pressure SP Water Flow Rate SP
300 400
250 300
F200 (kg/min)
P100 (kPa)
200 200
150 100
100 0
0 20 40 60 80 100 0 20 40 60 80 100
Time (minutes) Time (minutes)
Figure 9.20: Simulation with a re-linearised internal model obtained every 10 min-
utes of simulated time. (Broken lines show the set-points.)
9.3 Problems
These problems are based on the two case-studies which appear in this chapter. They
require use of the Model Predictive Control Toolbox and of files provided on this
book’s web site. They are open-ended in the sense that there is no unique correct
answer, and they may require considerable time to solve. The problems related to
the Evaporator require some familiarity with Simulink.
5. Simulate the same scenario as shown in Figures 9.18–9.20, but with the sep-
arator level treated as a zone variable — namely with no set-point, but only
the constraints 0.5 < L2 < 1.5. (See section 5.5.)
6. It makes more sense to re-linearise the internal model when the operating point
has changed significantly, rather than at regular intervals of time. Examine
the MATLAB script file simevap.m. It allows the evaporator model to be
re-linearised at regular intervals of time. Modify it so that the model is only
re-linearised if the state has changed by more than some threshold amount.
(You will still need to interrupt the simulation at regular intervals, then test
whether the state has changed significantly.)
Using the modified file, simulate the same scenario as shown in Figures 9.18–
9.20, re-linearising the model whenever the product concentration X2 has
changed by more than 5%.
Chapter 10
Perspectives
This chapter introduces a few topics which are potentially very important, but which
are mostly still at the research stage.
If the plant has more inputs than outputs, then a particular constant set-point
ys can be held by a whole family of constant input vectors us . There may be good
reasons for preferring one of these, usually because there are different economic costs
associated with the different control inputs. (Reducing air flow may be cheaper than
burning more fuel, for instance.) The traditional story in optimal control has been
to say that such preferences should be reflected in the choice of the R(i) matrices.
But in practice that is not so easy as it sounds, since Q(i) and R(i) have complicated
effects on the dynamic performance. The desirable constant values of the inputs are
usually determined at the same time as the set-points are determined, using static
optimization — usually by solving an LP problem.
If for some reason set-points are known, but the control inputs are not determined
uniquely, then the solution sometimes adopted is to first do a steady-state least-
squares optimization, to find the best combination of steady-state inputs which will
give a desired set-point vector. If the numbers of inputs and outputs are equal and
the steady-state gain matrix is nonsingular, then this is unnecessary because the
solution is unique. If there are more inputs than outputs, then the equation
ys − S(∞)Wu us = 0 (10.1)
is solved in a least-squares sense, where S(∞) is the steady-state gain matrix and
Wu is a diagonal weighting matrix. This gives the solution with the smallest value
303
304 10. Perspectives
of ||Wu us ||. (If there are more outputs than inputs then it is usually impossible to
reach the correct set-point, and in this case the equation
When there are more inputs than outputs the elements of us are called the ideal
resting values of the plant inputs for the given set-points. Once they have been found
the cost function
PHused in the predictive control problem formulation is augmented
u −1
with the term i=0 ||û(k + i|k) − us ||2Σ(i) , to encourage the inputs to converge to
these ‘ideal’ values. A danger of this is that, if the steady-state gains are not known
accurately, or if there are constant disturbances, then the computed values of us will
not be exactly correct for attaining ys at the output, and offset-free tracking may
be lost as a result.
It is difficult to express all the objectives of control into a single cost function. For
example, assigning a high weight to the control of a particular output is not really
the same as assigning it a high priority. It does not express the objective ‘Keep
output j near its set-point only if you can also keep output ` at its set-point’. A
‘multiobjective’ formulation makes it easier to do this. This can be applied also in
situations in which it may be impossible to meet all the objectives simultaneously.
There are several approaches to multiobjective optimization, but one well-suited to
the situation in which there are various priorities for various objectives is to have
a hierarchy of optimization problems. The most important one is solved first, then
this solution is used to impose equality constraints when performing the second
optimization, and so on. For example, the ‘ideal resting value’ problem treated
above may be better solved by making the achievement of set-points the primary
objective, and the achievement of ideal resting values a secondary objective to be
pursued only when the controlled outputs are close to their set-points, and imposing
the equality constraints that the outputs should equal their set-points.
The complexity of the optimization problem to be solved may not increase, and may
even decrease, as a result of adopting such a strategy. Predictive control problems
solved in this way can keep a QP formulation at each step, and it is generally quicker
to solve several small problems than one large equivalent problem. In particular, the
first, most important problems to be solved have the smallest number of conflicts
and the largest number of degrees of freedom, so have the best prospects of a good
solution being found, and of this being done quickly. If one runs out of comput-
ing time before the next control signal must be produced, then the still-unsolved
problems are the least-important ones.
10.1. Spare Degrees of Freedom 305
Predictive controllers seem to offer very good possibilities for fault-tolerant control.
If a sensor of a controlled output fails, for example, it is possible to abandon control of
that output by removing the corresponding output from the cost function (by setting
the corresponding elements of Q(i) to zero). An actuator jam is easily represented by
changing the constraints (|∆uj | = 0). If a failure affects the capabilities of the plant,
then it is possible to change the objectives, or the constraints, or both, accordingly.
This is also possible with other control strategies, but it is particularly clear, in the
predictive control formulation, how the required changes should be introduced into
the controller. This is mainly due to the fact that the control signal is re-computed
at each step by solving an optimization problem, so that one can make changes in
the problem formulation. This is a very different proposition to changing the gains
or time constants in a pre-computed controller.1
Note that it may not be an easy problem to know how to change the problem
formulation if a failure occurs. All that can be said is that, if an appropriate change
is known, then it is easy to introduce it and implement it in the predictive control
framework.
But it has also been noticed that predictive control has certain fault-tolerant prop-
erties even in the absence of any knowledge of the failure. In [Mac98] it is shown
that predictive control, with the standard ‘DMC’ model of disturbances and with
hard constraints on the input levels, can automatically redistribute the control effort
among actuators, if there are more actuators than controlled outputs, and one (or
more) actuator fails.
Some of these capabilities are illustrated in Figure 10.1, which is taken from [Mac97].
It shows a predictive controller responding to a step demand in the yaw angle of a
large civilian aircraft when the rudder is jammed.
Case 1 is the normal response when the rudder is working correctly. Case 2 shows the
response when the rudder is jammed, and the predictive control problem formulation
has no constraints; even in this situation the set-point is eventually achieved, which
indicates that other control strategies could achieve this too. Case 3 shows the
response when the controller is aware of the usual ±20◦ rudder angle limit. The
response is now faster, because after a few seconds the controller ‘thinks’ that it
has driven the rudder to the limit, and starts to move the other control surfaces;
1
However, it might be possible to re-compute on-line controllers for other strategies, which have
traditionally been pre-computed off-line, rather like ‘classical’ adaptive control proposals.
306 10. Perspectives
0.8
1
0.6
0.4
0.5
0.2
0 0
0 20 40 60 80 100 0 20 40 60 80 100
Time [s] Time [s]
Sideslip angle
0.2
0
Case 1
−0.2 Case 2
−0.4 Case 3
−0.6 Case 4
−0.8 Case 5
−1
0 20 40 60 80 100
Time [s]
Figure 10.1: Execution of a step change in yaw angle with a jammed rudder.
but the controller has no knowledge of the failure in this case. Case 4 shows the
response when the rudder failure is communicated to the controller by reducing
the ‘rudder move’ constraint to zero. This makes surprisingly little difference in
this case (the curves for Cases 3 and 4 are indistinguishable); the only difference is
that the controller knows immediately that it cannot move the rudder, whereas in
Case 3 it took about 3 seconds before it realised this. This does not make much
difference to the complete manoeuvre. Case 5 shows that better response can be
achieved by changing the weights — in this case the weight on keeping the roll angle
set-point was reduced, so that the controller made more use of roll angle to reach
its objective; this also shows a potential difficulty of this approach to fault-tolerant
control, namely that in general some re-tuning may be necessary, and this may not
be an easy thing to do on-line.
temperatures of the three heat exchangers (of the natural gas). The compressor
speed is limited to the range 25 to 50 revs/sec; the valve fully-closed to fully-open
range is represented by -500 to +500. In the example considered the sampling
interval is 10 sec, and at this long interval the input rates are effectively unlimited.
Each separator level is limited to the range -2 to +2 m (relative to the operating
point), and the evaporator exit temperatures are limited to the ranges -6 to +30 K,
-13 to +7 K, and -11 to +4 K, relative to their nominal values.
Figure 10.3 shows the simulated response to a step demand of +10 K on the exit
temperature of heat exchanger C, when there is no failure, the set-points for both
separators and heat exchanger F are zero, and the exit temperature of heat exchanger
E is not controlled, providing it remains within its constraints. The horizons are
Hp = 80 and Hu = 5.
Figure 10.4 shows the response in the same situation, but with valve H stuck at
+60, and with the controller unaware that this failure has occured. It will be seen
that the inputs have been reconfigured to adjust for the failure, with all outputs
eventually returning to their set-points, except for the uncontrolled one, which re-
mains within its allowed constraints. Note that the time-scale is different in this
figure; the transient takes much longer than in normal operation, but all constraints
are respected, and effective control over the process is maintained. Typically the
penalty of such reconfiguration will be reduced production rate (valve K not at its
nominal position), but at least continued production is possible.
When the controller is aware that valve H is stuck, and of its position then, not
surprisingly, the transient is finished much more quickly, and in fact resembles very
closely the one obtained in normal operation. (All the simulations shown here were
performed on a linearised model.)
G
J
E
B C C F
I
H
The potential of predictive control for fault-tolerant control has also been considered
in [GBMR98, GMR99].
308 10. Perspectives
Outputs
15
10
−5
−10
0 100 200 300 400 500 600 700 800 900 1000
Time
Manipulated Variables
300
200
100
−100
0 100 200 300 400 500 600 700 800 900 1000
Time
10
−5
0 500 1000 1500 2000 2500 3000
Time
Manipulated Variables
300
200
100
−100
−200
−300
−400
0 500 1000 1500 2000 2500 3000
Time
Example 10.1 This example is taken from [TM99, Example 1]. For the steady-
state model
y1 0 1 d1
y2 = 1 0 u1 + d2 (10.3)
u2
y3 1 1 d3
the most important constraint is maxj |yj | ≤ 2, while a secondary objective is |y2 | ≤
310 10. Perspectives
, where > 0 is very small. The top-priority constraint can be represented by the
conjunction (simultaneous satisfaction) of three pairs of inequalities such as (for
|y1 | ≤ 2):
u2 + d1 ≤ 2 + 10(1 − `1 ) (10.4)
−u2 − d1 ≤ 2 + 10(1 − `1 ) (10.5)
u1 + d2 ≤ + 10(1 − `2 ) (10.6)
−u1 − d2 ≤ + 10(1 − `2 ) (10.7)
where again `2 ∈ {0, 1}. The idea is that `1 = 1 corresponds to the first constraint
being enforced, and `2 = 1 corresponds to the second one being enforced. Now the
clever trick is that the priorities are represented by the linear inequality
`1 − `2 ≥ 0 (10.8)
The optimal control can now be found by solving the (mixed-integer) optimization
problem:
(In this case the only objective is the satisfaction of the constraints. There is no
linear or quadratic penalty of deviations from the set-point.)
A refinement of this ensures that if one or both constraints cannot be met, then the
amount by which the highest-priority constraint is violated is minimised.
This approach has recently been extended to a very promising framework for han-
dling a variety of hybrid system problems that involve mixtures of numerical and
logical variables [BM99a]. A Mixed Logical Dynamical (MLD) system is one of the
form
in which the state vector x, the input vector u and the output vector y all contain
both real-valued and {0, 1}-valued elements. δ is a vector of binary {0, 1}-valued
auxiliary variables, and z a vector of real-valued auxiliary variables. These auxil-
iary variables are needed for transforming propositional logic statements into linear
10.3. Nonlinear Internal Models 311
inequalities. Inequality (10.12) specifies all the constraints on the system, as well as
specifying priorities for objectives and constraints (as was done in (10.8)).
In a parallel development [VSJ99] it has been shown how the magnitudes of low-
priority constraint violations can be minimised, without the use of mixed-integer
optimization. In fact, only a single linear programme is required, provided that the
objective function is properly chosen, which gives a great simplification compared
with the use of mixed-integer programming. The idea is to formulate an optimization
problem such that a lower-priority constraint violation cannot be decreased without
increasing a higher-priority constraint violation. The solution to such a problem is
called a lexicographic minimum of the violated constraints (by analogy with the way
in which entries are ordered in a telephone directory, for example). The solution
proposed in [VSJ99] is to minimise a linear combination of the slack variables which
appear in a penalty function, such as was introduced in section 3.4 for softening
constraints. If the slack variables are ordered such that the first one corresponds
to the highest-priority constraint, and the last one to the lowest-priority constraint,
then a lexicographic minimum can be ensured by choosing a sufficiently large ratio
between succeeding weights in the linear combination. Determining how large this
ratio needs to be involves solving another LP problem (but off-line).
In [KBM+ 00] a similar idea to that of [VSJ99] is used in combination with MLD sys-
tems. Mixed-integer optimization is relied on, but greater flexibility of specification
is gained. For example, the satisfaction of the greatest number of constraints, either
taking priorities into account or not, can be enforced, as can prioritised minimisation
of the duration of constraint violations. It is also shown how the same approach can
be used to formulate multiobjective problems, and prioritising multiple objectives
as well as constraints.
If the plant exhibits severe nonlinearities, the usefulness of predictive control based
on a linearised model is limited, particularly if it is used to transfer the plant from
one operating point to another one. The obvious solution is to use a nonlinear model,
and quite a lot of research is going on into this possibility. The main disadvantage is
that convexity of the optimization problem is then lost, which is a serious drawback
for on-line application. The disadvantage is not so much that the global optimum
may not be found, since the use of a linearised model only gives the illusion of
finding a global optimum — one finds the global optimum of the wrong problem.
The real disadvantage for on-line use is that one has very little idea of how long each
optimization step will take to complete, whether it will ever terminate, what to do
if a feasible solution cannot be found, and so on.
312 10. Perspectives
The most straightforward approach to the nonlinear MPC problem is to retain the
formulation of MPC as we have developed it in this book, simply replacing the
linear model by a nonlinear one, and rely on suitable optimization methods to try
to overcome the loss of convexity. This approach may lead to perfectly acceptable
performance in practice, at least in suitable applications, but is usually very difficult
or impossible to analyse. Lack of analysis, however, has not been an obstacle to the
application of predictive control in the past.
A compromise solution, and the one which is most commonly used in practice, is
to re-linearise the nonlinear model as the plant moves from one operating point to
another, and to use the latest linear model as the internal model at each step. The
linearised model is not necessarily updated at each step, but may be left unaltered
as long as the plant is in the vicinity of a particular operating condition. This results
in a QP problem to be solved at each step, although the model changes from time
to time. If the nonlinearity is expected to be significant because set-points are due
to be changed — for example from one production rate to another — then one can
use a time-varying linear model which varies during the prediction horizon [HM98].
At each point in the horizon one uses the linearisation corresponding to the state at
which one expects to be at that time. Note that this linearisation cannot depend on
the optimised input trajectory if convexity of the optimization is to be maintained.
Another problem which becomes very prominent with nonlinear MPC is state esti-
mation. In most applications the true state x(k) is not measured, and an estimate
x̂(k|k) must be obtained. This becomes much more problematic when the model is
nonlinear [GZ92, Beq91, QB99].
If a nonlinear internal model is used, then several optimization algorithms are avail-
able. The one which is closest to the algorithms introduced in chapter 3 is sequential
quadratic programming (or ‘SQP’). Suppose that a general constrained optimization
problem is to be solved, of the form:
where {Hi (.)} and {Ωj (.)} are sets of nonlinear functions, and that an iterate θk has
been obtained. The SQP algorithm makes a quadratic approximation to V (θk ):
1 T 2
qk (d) = d ∇θθ L(θk , λk )d + ∇V (θk )T d (10.14)
2
P P
where L(θ, λ) = V (θ)+ i λi Hi (θ)+ j λj Ωj (θ) is the Lagrangian. The next iterate,
θk+1 , is given by
θk+1 = θk + dk (10.15)
10.3. Nonlinear Internal Models 313
where dk is found by solving the quadratic programming problem which results from
minimising qk (d), subject to local linear approximations of the constraints:
This is the basic idea of SQP, but there are several variations, for example taking
different approaches to estimating the vector of Lagrange multipliers, λk , or the
Hessian matrix ∇2θθ L(θk , λk ). The iterate θk may well violate the original constraints,
since it only satisfies the local linear approximations to the constraints. A variation
which may be of particular significance for predictive control is feasible SQP, which
ensures that each iterate satisfies the original nonlinear constraints. This may be
an important feature for real-time optimization, if there is insufficient time to allow
the iterates to converge, and one has to take the best iterate found so far.
The models used in nonlinear MPC can be either detailed ‘first-principles’ models,
or ‘black-box’ models such as neural nets or Volterra models. Both kinds lead to the
basic problem of a non-convex optimization problem. Bock et al [BDLS99, BDLS00]
propose a multiple shooting approach for solving nonlinear MPC problems, which is
particularly intended for use with complex ‘first-principles’ nonlinear models, con-
sisting of large sets of differential or differential-algebraic equations. When such
models are used, solution of the model by numerical integration is not trivial, and
should be considered together with the problem of solving the optimization prob-
lem to find the control input trajectory. The proposed ‘multiple shooting’ approach
exploits the structure of the nonlinear MPC problem, taking the numerical integra-
tion into account, in particular by suitable adaptations of the SQP algorithm. The
term ‘multiple shooting’ refers to the solution strategy, which divides the prediction
horizon up into smaller intervals, and initially finds almost-independent iterates on
each interval, gradually reconciling the iterates with each other so that a continuous
input trajectory is obtained as the solution.2 This strategy lends itself naturally to
parallelisation, if multiple processors are available for the optimization.
For our purposes, neural net-based models are just one class of black-box nonlinear
models. They are of interest because they are increasingly being used with success
in a wide range of applications, because they have theoretically attractive approx-
imating power, and because there are established techniques for estimating them.
2
On each interval, the input trajectory is assumed to be structured as a low-order polynomial,
which makes an interesting connection with predictive functional control — see section 5.6.
314 10. Perspectives
Here we will outline two specific ways of using neural nets for nonlinear MPC which
have been proposed, without going into any details of the neural nets themselves.
In order to find such details the reader is referred to [NRPH00], which includes a
section on the use of neural nets for predictive control. Also see [Lee00], and [LD99]
for an interesting application.
One interesting attempt to use nonlinear neural net models, while retaining the
advantages of convex optimization, is presented in [LKB98], in which it is suggested
that the nonlinear system should be approximated by a set of neural-net predictors
which are affine in the inputs. A different predictor in the set is used for each
prediction length:
1 −1
PX
x̂(k + P1 |k) = f (x(k)) +
1
gi1 (x(k))û(k + i|k) (10.17)
i=0
..
.
c −1
PX
x̂(k + Pc |k) = f c (x(k)) + gic (x(k))û(k + i|k) (10.18)
i=0
where the functions f j (.) and gij (.) (for j = 1, . . . , c) are nonlinear functions imple-
mented by the set of c neural nets. This results in a convex optimization problem,
so long as the cost function is linear or quadratic (or some other convex function).
This approach may be of particular interest if the number of coincidence points c is
small. The identification of suitable neural nets is discussed in [LKB98]. (The idea
of using a separate predictor for each prediction interval can also be found in the
research literature emphasising the use of predictive control schemes for adaptive
control, such as MUSMAR. There linear models are used, and the benefit of sepa-
rate predictors is that implicit system identification algorithms can be kept relatively
simple, because only linear regression is required [Mos95].)
Neural net models are used differently in the commercial MPC product Process
Perfecter developed by Pavilion Technologies [PSRJG00]. Here a neural net is used
to approximate the steady-state input-output map. It is assumed that the plant is
to be transferred from one initial steady state, say yi , to another final steady state,
say yf . Steady-state optimization is performed to find suitable steady-state input
values, say ui and uf , respectively. Consider a single-input, single-output plant, for
simplicity — the ideas carry over to multivariable plant, but the notation becomes
messy.3 The neural net model is then used to obtain the ‘local’ input-output gains,
at the initial and final steady states:
∂y ∂y
gi = , gf = (10.19)
∂u ui ,yi ∂u uf ,yf
(These are the steady-state gains of the locally linearised models at the two steady
states.) Finally a second-order dynamic model is assumed, in difference-equation
3
In essence we need a multivariate Taylor series expansion, up to quadratic terms.
10.3. Nonlinear Internal Models 315
where δ now signifies deviations from initial steady-state values: δu(t) = u(t) − ui ,
δy(t) = y(t) − yi , and d is an input-output delay. The coefficients a1 and a2 are
fixed, as in a linear difference equation model, but v1 and v2 depend on gi , while w1
and w2 depend on both gi and gf . In an exact Taylor series expansion one would
have vj = ∂y(t)/∂u(t − d − j), and wj = ∂ 2 y(t)/∂u(t − d − j)2 . It is not surprising,
then, that these coefficients are given a gain-dependence of the following form:
gf − gi
vj = bj gi , wj = bj (j = 1, 2) (10.21)
uf − u i
where b1 and b2 are some fixed coefficients. If the vj and wj coefficients were fixed,
a nonlinear model would still be obtained; but allowing them to vary in this way
results in a much better approximation being obtained while retaining the simple
quadratic model, because the coefficients are ‘tuned’ for the particular transient that
needs to be performed. Note that since the resulting dynamic model is quadratic in
the inputs, the optimization which needs to be performed for MPC is not convex,
in general. However, the model has been kept very simple, so that the optimization
needs to be performed over relatively few decision variables. The hope is that this
results in a tractable optimization problem, and apparently this turns out to be the
case in many applications [PSRJG00]. The assumption behind the form of (10.21)
is that the change in steady-state gains is the principal nonlinearity in the plant.
The identification of suitable models of this form is aided by the fact that there is
often an extensive database of historical data available, from which one can estimate
steady-state gains for a wide range of operating conditions.
A more radical way of avoiding the problems associated with non-convex optimiza-
tion, or at least of ameliorating them, is to shift the emphasis away from opti-
mization, and towards the satisfaction of constraints as the primary objective. An
interesting proposal in this direction has been made by Scokaert, Mayne and Rawl-
ings [SMR99]. This involves a dual-mode strategy, in which the state is steered
towards a terminal constraint set X0 , as in [MM93] and [SM98]. It is assumed
that, once the state has entered X0 , a robust asymptotically stabilising controller
u(k) = hL (x(k)) is available which drives the state to the origin, and such that
X0 is a positively-invariant set for x(k + 1) = f (x(k), hL (x(k))). (The subscript L
denotes a ‘local’ controller.) The original feature of the proposal, however, is the
MPC strategy which is used while the state is outside X0 . The system is assumed
to be nonlinear:
and it is assumed that the cost falls to zero once the state has entered X0 , namely
L(x, hL (x)) = 0 if x ∈ X0 . The following terminal constraint is imposed:
x̂(k + N |k) ∈ X0 (10.25)
Now the control is chosen not by minimising the cost (10.24), but by finding a
predicted control trajectory which gives a sufficient reduction of the cost. Any
control trajectory which gives
V (k) ≤ V (k − 1) − µL(x̂(k|k − 1), û(k − 1|k − 1)) (10.26)
where 0 < µ ≤ 1, is acceptable, providing that (10.23) and (10.25) are satisfied.
As usual in MPC, the applied control is u(k) = û0 (k|k), where û0 (k + j − 1|k),
j = 1, . . . , N is the selected input trajectory. It is shown in [SMR99] that, under
mild technical conditions, which we omit, this sub-optimal MPC strategy gives an
asymptotically stable closed loop, and the region of attraction — namely the set of
initial states which are driven to the origin by this strategy — is precisely the set of
states which can be driven to X0 in N steps without violating the constraints. It is
also shown that, in the absence of disturbances, the state is driven into X0 in a finite
number of steps. In order to prove these results, a generalised Lyapunov stability
theorem is proved in [SMR99], which allows the control law to be nonunique and
discontinuous — both features being needed because of the way the future control
trajectory is chosen.
The main significance of this result is that it removes the need for finding the global
minimum of a non-convex function. In fact, it is not even necessary to find a local
minimum. All that is needed is to find a solution which gives a sufficient reduction
in the cost function at each step, as defined in (10.26). If sufficient time is available
for the computation, one can continue searching for solutions which give a bigger
reduction, but that is not necessary. Also, the difficulty of finding such a solution
can be controlled by adjusting the value of µ. Values close to zero make it relatively
easy to find a solution, though of course at the cost of poor performance, in the sense
of relatively small reduction of the cost function at each step. Such small values may
be appropriate if there are large modelling errors, or large disturbances, so that it
is difficult to find a feasible trajectory. Another interesting feature of this MPC
strategy is that, if there were no modelling errors or disturbances, then one would
only need to calculate the future trajectory initially (at k = 0), and not recalculate it
again. This is because the initially calculated trajectory is feasible and provides the
required cost reduction at each step — optimality is no longer an issue. In practice,
of course, recalculation is necessary, but previously calculated trajectories provide
good initial guesses (‘hot starts’).
10.4. Moving-Horizon Estimation 317
The standard way of estimating the state of a dynamic system from input-output
measurements is to use a state observer. For a linear model there is a complete theory
— see Minitutorial 2 — and if statistical information is available about disturbances
and measurement noise then optimal estimates can be obtained by using the Kalman
filter. Although there is some observer theory for use with nonlinear models, it is
much less complete. Optimal state estimation problems can still be defined, but
usually they cannot be solved exactly, and ad hoc approximations must be used,
such as the Extended Kalman Filter. One such ad hoc approach is moving-horizon
estimation, which is a kind of ‘dual’ of predictive control.
Instead of predicting ahead, one looks back at input-output data over a finite horizon,
and tries to find an estimated state trajectory which is consistent with an assumed
model, and which fits the measured data as closely as possible. For example, with
a linear model and a moving horizon of length N , one can pose a problem such as
X
N −1
min {kŷ(k − i|k) − y(k − i)k2Q + kx̂(k − N |k) − x0 k2 } (10.27)
x̂(k−i|k)
i=0
subject to
where the data u(k − i), y(k − i) : i = 0, 1, . . . , N are given, and the last term in
(10.27) is an initial cost which penalises deviations of the initial estimate x̂(k − N |k)
from some known value x0 , which may perhaps be the corresponding estimate ob-
tained at the previous step, x̂(k − N |k − 1). This is a linear least-squares problem;
but if the real state variables are known to be bounded, from physical considera-
tions, or more general linear constraints are known to hold, then linear inequality
constraints of the form
can be added, and the problem becomes a quadratic programming problem. This
problem is outside the scope of conventional state estimation theory.
We have given only the simplest formulation here; the problem can be generalised,
especially to the use of nonlinear models. Similar questions arise as in predictive
control, in particular:
• How to deal with lack of convexity when nonlinear models are used?
• How to ensure stability of the estimator — that is, how to ensure that the
estimate x̂(k|k) converges to x(k), assuming the model is correct?
318 10. Perspectives
• How to ensure that the stability of the estimator is robust with respect to
errors in the model?
The investigation of such questions has begun [SR95, RR99a]. The use of moving
horizon estimation has also been suggested with systems described in the mixed
logical-dynamic (MLD) framework — see (10.10)–( 10.12) — for estimating states
in hybrid systems, for detecting faults, etc [BMM99].
Constrained moving horizon estimation has also been proposed for the related prob-
lem of data reconciliation [LEL92]. This arises when one has not only a partly
unknown state, but also limited confidence in the correctness of the measurements,
and possibly uncertainty about the model. The objective is to modify the mea-
surements so that they become consistent with the model. The model is often a
nonlinear first-principles model, and one frequently knows constraints on the real
values of measured variables, and on states. This approach has also been suggested
for detecting failed sensors and other faults.
A recent survey, quoted in [QB96], states that a conservative estimate of the number
of predictive control installations in industry worldwide in 1996 was 2200. Most of
these were in refining and petrochemical applications, but some penetration into
other industries such as food processing and pulp-and-paper was evident. (The
company Adersa reported 20 applications in the aerospace, defence and automotive
industries. No other vendor reported any applications in these industries.) The
largest of these was an olefines plant, with 283 inputs and 603 outputs.
2. Commercial predictive control software does a lot more than solve predictive
control problems as formulated in this book. A hierarchy of optimization prob-
lems is solved typically, and there are features which aid constraint and goal
management in case of failures or unusually large disturbances. Combining
such functionality with other control strategies might be equally effective —
and there is no particular reason why this could not be done.
4. The basic ideas behind predictive control are easy to explain and understand.
Although the technicalities can become very intricate when plant-wide con-
strained optimization is implemented, it is still possible to present information
to plant operators in such a way that they retain confidence in the actions taken
by a predictive controller. This has been very important for the acceptance of
predictive control.
I believe that these features of predictive control will lead to its very wide use in
control engineering, beyond the process industries. One can already find references
to its use in flight control [LP95, SSD95, PHGM97] , submarines [SB98] and medical
applications [ML98], for example. For a practitioner’s view of future applications of
predictive control see [San98].
5
In fact, predictive control vendors usually insist on ‘tuning up’ the low-level PI controllers which
receive set-points from the predictive controllers. One wonders how much of the success is already
due to this preliminary activity.
320 10. Perspectives
References
[AM79] B.D.O. Anderson and J.B. Moore. Optimal Filtering. Prentice Hall,
1979.
[AM90] B.D.O. Anderson and J.B. Moore. Optimal Conrol, Linear Quadratic
methods. Prentice Hall, 1990.
[Åst80] K.J. Åström. A robust sampled regulator for stable systems with
monotone step responses. Automatica, 16:313–315, 1980.
321
322 REFERENCES
[BH75] A.E. Bryson and Y-C. Ho. Applied Optimal Control; Optimization,
Estimation, and Control. Hemisphere, Washington, 1975.
[CC95] E.F. Camacho and C.Bordons. Model Predictive Control in the Process
Industry. Advances in Industrial Control. Springer, Berlin, 1995.
[CM97] C.T. Chou and J.M. Maciejowski. System identification using bal-
anced parameterizations. IEEE Transactions on Automatic Control,
42:965–974, July 1997.
[CMT87] D.W. Clarke, C. Mohtadi, and P.S. Tuffs. Generalised predictive con-
trol — Parts I and II. Automatica, 23:137–160, 1987.
[CN56] J.F. Coales and A.R.M. Noton. An on-off servo mechanism with pre-
dicted change-over. Proc. Institution of Electrical Engineers, Part B,
103:449–462, 1956.
[CR80] C.R. Cutler and B.L. Ramaker. Dynamic matrix control — a com-
puter control algorithm. In Proceedings, Joint American Control Con-
ference, San Francisco, 1980.
[CRSV90] J.E. Cuthrell, D.E. Rivera, W.J. Schmidt, and J.A. Vergeais. Solution
to the Shell standard control problem. In Prett et al. [PGR90].
[CS83] T.S. Chang and D.E. Seborg. A linear programming approach to mul-
tivariable feedback control with inequality constraints. International
Journal of Control, 37:583–597, 1983.
[DOP95] F.J. Doyle, B.A. Ogunaike, and R.K. Pearson. Nonlinear model-based
control using second-order volterra models. Automatica, 31:697–714,
1995.
324 REFERENCES
[Doy78] J.C. Doyle. Guaranteed margins for LQG regulators. IEEE Transac-
tions on Automatic Control, AC-23:756–757, 1978.
[GL89] G.H. Golub and C.F. Van Loan. Matrix Computations. Johns Hopkins
University Press, Baltimore, MD, 2nd edition, 1989.
[GMW81] P.E. Gill, W. Murray, and M.H. Wright. Practical Optimization. Aca-
demic Press, London, 1981.
[GN93] H. Genceli and M. Nikolau. Robust stability analysis of constrained
`1 -norm model predictive control. American Institute of Chemical
Engineers’ Journal, 39:1954–1965, 1993.
[GT91] E.G. Gilbert and K.T. Tan. Linear systems with state and control
constraints: the theory and application of maximal output admissible
sets. IEEE Transactions on Automatic Control, 36:1008–1020, 1991.
[GZ92] G. Gattu and E. Zafiriou. Nonlinear quadratic dynamic matrix control
with state estimation. Ind. Eng. Chem. Research, 31:1096–1104, 1992.
[HM97] M. Huzmezan and J.M. Maciejowski. Notes on filtering, robust track-
ing and disturbance rejection used in model based predictive control
schemes. In Preprints, 4th IFAC Conference on System Structure and
Control, Bucharest, October, pages 238–243, 1997.
[HM98] M. Huzmezan and J.M. Maciejowski. Reconfiguration and scheduling
in flight using quasi-LPV high-fidelity models and MBPC control. In
Proc. American Control Conference, Philadelphia, 1998.
[Kai80] T. Kailath. Linear Systems. Prentice Hall, 1980.
[Kal64] R.E. Kalman. When is a linear control system optimal? Journal of
Basic Engineering (Trans. ASME D), 86:51–60, 1964.
[KBM96] M.V. Kothare, V. Balakrishnan, and M. Morari. Robust constrained
model predictive control using linear matrix inequalities. Automatica,
32, 1996.
[KBM+ 00] E.C. Kerrigan, A. Bemporad, D. Mignone, M. Morari, and J.M. Ma-
ciejowski. Multi-objective prioritisation and reconfiguration for the
control of constrained hybrid systems. In Proceedings, American Con-
trol Conference, Chicago, June 2000.
[KG88] S.S. Keerthi and E.G. Gilbert. Optimal infinite-horizon feedback laws
for a general class of constrained discrete-time systems: stability and
moving-horizon approximations. Journal of Optimization Theory and
Applications, 57:265–293, 1988.
[KGC96] J.C. Kantor, C.E. Garcia, and B. Carnahan, editors. Conference on
Chemical Process Control, CPC V, Tahoe City, 1996.
[Kle70] D. Kleinman. An easy way to stabilise a linear constant system. IEEE
Transactions on Automatic Control, AC-15, 1970.
[KM00a] E.C. Kerrigan and J.M. Maciejowski. Invariant sets for constrained
nonlinear discrete-time systems with application to feasibility in
model predictive control. In Proceedings, IEEE Control and Decision
Conference, Sydney, December 2000.
326 REFERENCES
[KM00b] E.C. Kerrigan and J.M. Maciejowski. Soft constraints and exact
penalty functions in model predictive control. In Control 2000 Con-
ference, Cambridge, September 2000.
[KP77] W.H. Kwon and A.E. Pearson. A modified quadratic cost problem
and feedback stabilization of a linear system. IEEE Transactions on
Automatic Control, AC-22:838–842, 1977.
[LC96] J.H. Lee and B. Cooley. Recent advances in model predictive control
and other related areas. In Kantor et al. [KGC96].
[Lee00] J.H. Lee. Modeling and identification for nonlinear model predictive
control: requirements, current status and future research needs. In
Allgöwer and Zheng [AZ00], pages 269–293.
[LEL92] M.J. Liebman, T.F. Edgar, and L.S. Lasdon. Efficient data reconcili-
ation and estimation for dynamic processes using nonlinear program-
ming techniques. Computers in Chemical Engineering, 16:963–986,
1992.
[LGM92] J.H. Lee, M.S. Gelormino, and M. Morari. Model predictive control
of multi-rate sampled-data systems: a state-space approach. Interna-
tional Journal of Control, 55:153–191, 1992.
[Lju89] L. Ljung. System Identification: Theory for the User. Prentice Hall,
1989.
REFERENCES 327
[ML99] M. Morari and J.H. Lee. Model predictive control: past, present and
future. Computers and Chemical Engineering, 23:667–682, 1999.
[MR93a] K.R. Muske and J.B. Rawlings. Linear model predictive control of
unstable processes. Journal of Process Control, 3:85, 1993.
[MR93b] K.R. Muske and J.B. Rawlings. Model predictive control with linear
models. American Institute of Chemical Engineers’ Journal, 39:262–
287, 1993.
[MR95] M. Morari and N.L. Ricker. Model Predictive Control Toolbox: User’s
Guide. The Mathworks, 1995.
[MRRS00] D.Q. Mayne, J.B. Rawlings, C.V. Rao, and P.O.M. Scokaert. Con-
strained model predictive control: stability and optimality. Automat-
ica, 36:789–814, 2000.
[NL89] R.B. Newell and P.L. Lee. Applied Process Control — A Case Study.
Prentice Hall, New York, 1989.
REFERENCES 329
[NN94] J.E. Nesterov and A.S Nemirovsky. Interior Point Polynomial Meth-
ods in Convex Programming: Theory and Applications. SIAM,
Philadelphia, 1994.
[NP97] V. Nevistic and J.A. Primbs. Finite receding horizon control: A gen-
eral framework for stability and performance analysis. Technical Re-
port AUT 97-06, Automatic Control Laboratory, ETH Zurich, 1997.
[NRPH00] M. Nørgaard, O. Ravn, N.K. Poulsen, and L.K. Hansen. Neural Net-
works for Modelling and Control of Dynamic Systems. Springer, Lon-
don, 2000.
[OB94] N.M.C.de Oliveira and L.T. Biegler. Constraint handling and stability
properties of model predictive control. American Institute of Chemical
Engineers’ Journal, 40:1138–1155, 1994.
[OC93] A.W. Ordys and D.W. Clarke. A state-space description for GPC
controllers. International Journal of Systems Science, 24:1727–1744,
1993.
[PG88] D.M. Prett and C.E. Garcia. Fundamental Process Control. Butter-
worths, Boston, 1988.
[PGR90] D.M. Prett, C.E. Garcia, and B.L. Ramaker, editors. The Second
Shell Process Control Workshop. Butterworths, Boston, 1990.
[PM87] D.M. Prett and M. Morari, editors. The Shell Process Control Work-
shop. Process Control Research: Industrial and Academic Perspec-
tives. Butterworths, Boston, 1987.
[PRC82] D.M. Prett, B.L. Ramaker, and C.R. Cutler. Dynamic matrix control
method. United States Patent 4349869, 1982.
[QB96] S.J. Qin and T.A. Badgwell. An overview of industrial model predic-
tive control technology. In Kantor et al. [KGC96], pages 232–256.
[QB99] S.J. Qin and T.A. Badgwell. An overview of nonlinear model pre-
dictive control applications. In Allgöwer and Zheng [AZ00], pages
369–392.
[RM82] R. Rouhani and R.K. Mehra. Model algorithmic control (MAC): basic
theoretical properties. Automatica, 18:401–414, 1982.
[RM93] J.B. Rawlings and K.R. Muske. The stability of constrained receding
horizon control. IEEE Transactions on Automatic Control, 38:1512–
1516, 1993.
[RM00] C.A. Rowe and J.M. Maciejowski. Tuning MPC using H∞ loop shap-
ing. In Proceedings, American Control Conference, Chicago, 2000.
[RPG92] D.E. Rivera, J.F. Pollard, and C.E. Garcia. Control-relevant prefilter-
ing: a systematic design approach and case study. IEEE Transactions
on Automatic Control, 37:964–974, 1992.
REFERENCES 331
[RR99a] C.V. Rao and J.B. Rawlings. Nonlinear moving horizon estimation.
In Allgöwer and Zheng [AZ00].
[RR99b] C.V. Rao and J.B. Rawlings. Steady states and constraints in model
predictive control. American Institute of Chemical Engineers’ Jour-
nal, 45:1266–1278, 1999.
[RTV97] C. Roos, T. Terlaky, and J-Ph. Vial. Theory and Algorithms for Linear
Optimization — An Interior Point Approach. Wiley, Chichester, 1997.
[RWR98] C.V. Rao, S.J. Wright, and J.B. Rawlings. Application of interior-
point methods to model predictive control. Journal of Optimization
Theory and Applications, 99:723–757, 1998.
[Rya82] E.P. Ryan. Optimal Relay and Saturating Control System Synthesis.
Peter Peregrinus, Stevenage, UK, 1982.
[SA77] M.G. Safonov and M. Athans. Gain and phase margin for multi-
loop LQG regulators. IEEE Transactions on Automatic Control, AC-
22:173–179, 1977.
[SB98] G.J. Sutton and R.R. Bitmead. Experiences with model predictive
control applied to a nonlinear constrained submarine. In Proceedings,
37th IEEE Conference on Decisions and Control, Tampa, Florida,
December 1998.
[SCS93] A. Saberi, B.M. Chen, and P. Sannuti. Loop Transfer Recovery: Anal-
ysis and Design. Springer, 1993.
332 REFERENCES
[SM98] P.O.M. Scokaert and D.Q. Mayne. Min-max feedback model predic-
tive control for constrained linear systems. IEEE Transactions on
Automatic Control, 43:1136–1142, 1998.
[Smi57] O.J.M. Smith. Close control of loops with deadtime. Chemical Engi-
neering Progress, 53:217–?, 1957.
[SMR99] P.O.M. Scokaert, D.Q. Mayne, and J.B. Rawlings. Suboptimal model
predictive control (feasibility implies stability). IEEE Transactions
on Automatic Control, 44:648–654, 1999.
[SR95] P.O. Scokaert and J.B. Rawlings. Receding horizon recursive state
estimation. In Proc. IFAC Symposium on Nonlinear Control Systems,
Tahoe City, USA, 1995.
[SR96b] P.O. Scokaert and J.B. Rawlings. Infinite horizon linear quadratic
control with constraints. In Proceedings, IFAC World Congress, pages
109–114, San Francisco, July 1996.
[SR99] P.O.M. Scokaert and J.B. Rawlings. Feasibility issues in linear model
predictive control. American Institute of Chemical Engineers’ Jour-
nal, 45:1649–1659, 1999.
[SW97] H.J. Sussmann and J.C. Willems. 300 years of optimal control: from
the brachystochrone to the maximum principle. IEEE Control Sys-
tems Magazine, 17:32–44, 1997.
[TC88] T.T.C. Tsang and D.W. Clarke. Generalised predictive control with
input constraints. IEE Proceedings, Part D, 135:451–460, 1988.
[TM99] M.L. Tyler and M. Morari. Propositional logic in control and moni-
toring problems. Automatica, 35:565–582, 1999.
[vdBdV95] T.J.J. van den Boom and R.A.J. de Vries. Constrained predictive
control using a time-varying Youla parameter: a state space solution.
In Proceedings, European Control Conference, Rome, 1995.
[YP93] T.H. Yang and E. Polak. Moving horizon control of nonlinear systems
with input saturations, disturbances and plant uncertainties. Inter-
national Journal of Control, pages 875–903, 1993.
[ZDG96] K. Zhou, J.C. Doyle, and K. Glover. Robust and Optimal Control.
Prentice Hall, New York, 1996.
[ZM74] H.P. Zeiger and A.J. McEwen. Approximate linear realization of given
dimension via Ho’s algorithm. IEEE Transactions on Automatic Con-
trol, AC-19:153, 1974.
334 REFERENCES
335
336 A. Some Commercial MPC Products
predictive controller has trouble controlling the plant, then the operators have the
option of switching the controller off — which does not mean that the plant is left
uncontrolled, but that it is returned to the relative safety of conventional low-level
control. It will be appreciated that if operated in this way, some of the issues treated
earlier in the book, such as guarantees of closed-loop stability, are not of paramount
importance.
DMCPlus is a derivative of the product DMC, which is an acronym for Dynamic Ma-
trix Control. DMC was originally developed and patented by Shell [CR80], then fur-
ther developed and marketed by the DMC Corporation, a company which was later
acquired by Aspentech. DMC and DMCPlus are the most widely known and used of
the commercially-available predictive control products, with particularly deep pen-
etration of the petrochemicals sector. A variant of DMC, known as Quadratic DMC
or QDMC, was also developed by Shell, and there are some references to it in the
literature [GM86], but the commercial rights to it have been retained by Shell.
DMCPlus uses multivariable finite step response models to represent plant models,
as described in Chapter 4. An extension to these models allows integrators to be
modelled as well as asymptotically stable plants. When making predictions, the
disturbance model referred to earlier as the DMC model is used, namely any error
between the prediction of a current output and its latest measurement is assumed
to be due to an output disturbance, and that disturbance is assumed to remain
unchanged in the future. For variables which are outputs of integrators, the operator
is also allowed to define a ‘rotation factor’. This is essentially the slope of a line
used to correct the predictions of integrated outputs, so it is a means of correcting
mis-modelled integrator gains.
The predictive control law is computed in DMCPlus in two steps. First a set of
steady-state ‘target’ levels or set-points is computed for the controlled variables
(outputs). These are chosen on economic grounds, the operators having the ability
to supply information on the current economic value of achieving product of a given
quality, and on the current economic costs of the input variables (typically flows of
expensive goods). The cost function is linear in this step (which is possible because of
A.1. Aspentech: DMCPlus 337
the use of a linear model). Input and output constraints are imposed and respected
in this step. These are in the form of linear inequality constraints, so that the target
levels are chosen by solving an LP problem. It should be emphasised that, although
a ‘steady-state’ problem is being solved in this first step, and so only the steady-state
gain information from the model is needed, this problem is re-solved at the same rate
as the dynamic control, and it is re-solved on the basis of the latest measurements.
In order to solve a meaningful optimization problem, the LP solver must know the
‘current’ steady-state. But at any particular time, the process is unlikely to be in
steady state, so the dynamic model is used to compute what the steady-state would
be, if the inputs all remained at their current levels, and this steady-state is taken
as the ‘current’ one.
In the second step, a future control trajectory is computed, over a control horizon,
which is predicted to bring the plant outputs to the target levels computed by the
LP optimization. This is computed as the solution of a least-squares problem, which
includes quadratic penalisation of control moves (referred to in DMCPlus as ‘move
suppression’). Constraints are not imposed explicitly, but the penalty weights are
increased as the predicted inputs and/or outputs approach constraints. So in effect
‘soft constraints’ are imposed, by means of a kind of ‘penalty function’ approach —
see Chapter 5. The time horizon for driving the plant to the new targets is taken to
be the same as the prediction horizon. However, the dimension of the optimization
problem is kept relatively small by using ‘blocking’, namely non-uniform spacing of
the ‘decision times’ during this horizon.
The operators are asked to define two kinds of equal concern errors, ‘steady-state’
and ‘dynamic’. Essentially, they are asked to specify how big a deviation of each
controlled output beyond its constraint boundary causes them significant concern.
The ‘steady-state’ equal concern errors are used in the target-setting step, if the
LP problem is found to be infeasible. In this case one of two strategies is adopted:
either a ‘minimum distance’ solution is found, which minimises a weighted sum of
distances of targets from their constraint boundaries, with the weights reflecting the
equal concern errors; or the equal concern errors are used to define priorities for the
constraints, and the constraints with lowest priority are allowed to be violated, until
feasibility of the LP is re-established.
The ‘dynamic’ equal concern errors are used to implement soft constraints in the sec-
ond step of computing the solution. If an output approaches its constraint boundary,
then the weight associated with its error from its target in the least-squares prob-
lem is increased. At what point the increase begins, and how much the weight is
increased, depends on the equal concern errors.
Some support for the control of nonlinear processes is provided, primarily by the
availbaility of a number of invertible transformations, such as square-root or loga-
rithmic transformations, and facilities to define others. These are useful when the
process is essentially (close to) linear, except for nonlinear transformations of input
and output variables, due to factors such as valve characteristics. Also a kind of
338 A. Some Commercial MPC Products
The name RMPCT is an acronym for Robust Multivariable Predictive Control Tech-
nology, a product which has been developed by Honeywell.
It can be seen that the ‘agressiveness’ with which an output is returned to its target
zone is determined by the slope of the edge of the ‘funnel’ which is constructed to
bring it back into the allowed range. Thus this edge serves as a straight-line reference
trajectory, combining this concept with the funnel concept. Conventional set-point
control of a variable is obtained by making the low and high limits the same for that
variable.
Like DMCPlus, the RMPCT controller is also organised in two levels, one for op-
timization and one for control. A steady-state model is used to find the optimal
steady-state for the process, on the assumption that the ‘current steady-state’ is the
A.2. Honeywell: RMPCT 339
currently-predicted steady-state. The cost function used for this purpose is a combi-
nation of the traditional linear cost function which captures the economic benefits of
producing particular quantities of various products and the economic costs of using
control inputs, with a quadratic function which represents the costs of moving away
from the currently-predicted steady-state inputs and outputs. Process variables can
appear in this cost function which do not appear in the cost function used for dy-
namic control, and vice versa. The steady-state optimization can be performed for
several process units simultaneously, and the results passed down to the individual
dynamic controllers. The interaction between the steady-state and the dynamic op-
timization is not the conventional one, of simply passing steady-state objectives to
the dynamic controller. Rather, the new steady-state values are included in the dy-
namic optimization, but with a variable weighting which allows the ‘strength’ with
which the process is pushed to the new steady-state to be varied. If it is recalled
that RMPCT encourages most controlled outputs to have target zones rather than
set-points, it will be appreciated that putting a low weighting on the steady-state
solution will result in the controller concentrating on correcting any predicted excur-
sions outside the target zones, but pushing the process to the desirable steady-state
when no such excursions are predicted.
The net result of this combination of steady-state and dynamic optimization is soft
constraints on controlled variables, with an inexact penalty function — that is, in
some circumstances zone boundary violations may occur even if there is a feasible
trajectory which avoids them.
RMPCT allows ‘blocking’ of the predicted control moves, so that the moves com-
puted by the optimization are not assumed to be spaced at equal intervals in the
control horizon.
1
Actually RMPCT computes a ‘URV’ decomposition rather than an SVD, in which U and V
are orthogonal, as in SVD, but R is triangular rather than diagonal.
340 A. Some Commercial MPC Products
In QP-LR mode, a quadratic cost function is optimised, taking into account (hard)
input constraints, while output constraints are ignored. As in LR mode, weights
are adjusted to remove any predicted output constraint violations. In QP mode,
both input and output constraints are included in the optimization problem. All
constraints are ‘soft’, an exact penalty function being used, with weights used to
define constraint violation priorities.
The motivation for having these different modes is reducing computational effort.
For example, in LR mode, the feedback gains need to be found only once, although
the iterative adjustment of set-points (if necessary) of course requires additional
computation. In QP-LR mode, the number of constraints is smaller than in QP
mode, so the optimal solution is easier to compute.
The quadratic cost function can be defined to penalise both control moves, and
deviations of the control input values from their target values, if these are defined.
As is the case with the other products summarised here, the optimization algorithm
assumes uneven intervals between predicted control moves, or ‘blocking factors’, over
the control horizon.
Connoisseur uses internal models in the ARX form, similar to those used by RM-
PCT. Recursive least-squares is used to estimate the order and parameters of the
model. Adaptive control is possible, the recursive estimator being used to update
the model continuously.
A.4. Adersa: PFC and HIECON 341
The actual model used is slightly modified from the form given above, because
different sampling intervals are permitted for the input and output variables (and
measured disturbances).
Successful applications of the Adersa products range from process applications such
as batch reactors, rolling mills, and milk dryers, to ‘servo’ applications such as fuel
injection in car engines, gun turret control, and attitude control of launchers and
missiles.
ABB’s product uses state-space models and quadratic cost functions, so of all the
products described here it is the one whose technical framework is the closest to
the standard one described in this book. Hard constraints can be defined for inputs
(manipulated variables) and their rates of change, and these can be supplemented
by soft constraints which indicate desriable rather than mandatory ranges for the
inputs. Soft constraints can be defined on outputs (controlled variables), and these
can be prioritised.
Considerable support is available for system identification from operating data, in-
cluding direct identification of the state-space model using subspace methods, as an
option.
Pavilion Technologies Inc offer a predictive control product which is aimed primarily
at applications in which the use of nonlinear models brings large avantages, or is for
some reason unavoidable. It is based on ‘black-box’ neural net models, and relies on
the assumption that all the significant nonlinearities show up as changes in steady-
state gains. A more detailed account of the technical basis of this product is given
in section 10.3.3.
Appendix B
This is the complete listing of MATLAB program basicmpc. It is also available from
the web site: http://www.booksites.net/maciejowski/
343
344 B. MATLAB Program basicmpc
if Tref == 0,
tend = 100*Ts;
else
tend = 10*Tref; % Duration of simulation (default 10*Tref)
end
nsteps = floor(tend/Ts); % (Number of steps in simulation).
tvec = (0:nsteps-1)’*Ts; % Column vector of time points (first one 0)
% Initial conditions:
umpast = zeros(ndenm,1);
uppast = zeros(ndenp,1);
ympast = zeros(ndenm,1); % For model response
yppast = zeros(ndenp,1); % For plant response
%%%%%%%%%%%%%%%% SIMULATION:
346 B. MATLAB Program basicmpc
for k=1:nsteps,
% Simulate plant:
% Update past plant inputs
uppast = [uu(k);uppast(1:length(uppast)-1)];
yp(k+1) = -denp(2:ndenp+1)*yppast+nump(2:nnump+1)*uppast; % Simulation
% Update past plant outputs
yppast = [yp(k+1);yppast(1:length(yppast)-1)];
% Simulate model:
% Update past model inputs
umpast = [uu(k);umpast(1:length(umpast)-1)];
ym(k+1) = -denm(2:ndenm+1)*ympast+numm(2:nnumm+1)*umpast; % Simulation
% Update past model outputs
ympast = [ym(k+1);ympast(1:length(ympast)-1)];
end % of simulation
diffpm = get(plant-model,’num’);
if diffpm{:}==0,
disp(’Model = Plant’)
else
disp(’Plant-Model mismatch’)
end
figure
subplot(211)
% Plot output, solid line and set-point, dashed line:
plot(tvec,yp(1:nsteps),’-’,tvec,setpoint(1:nsteps),’--’);
grid; title(’Plant output (solid) and set-point (dashed)’)
xlabel(’Time’)
subplot(212)
% plot input signal as staircase graph:
stairs(tvec,uu,’-’);
grid; title(’Input’)
xlabel(’Time’)
348 B. MATLAB Program basicmpc
Appendix C
Most of the examples which appear in this book, after Chapter 1, were worked out
with the help of the Model Predictive Control Toolbox for MATLAB. This same
software (or other software with similar functionality) is needed for many of the
Problems.
A comprehensive User’s Guide is available for the Model Predictive Control Toolbox.
It includes a Tutorial section, and it is not proposed to repeat that material here.
But it may be useful to relate some of the material in that documentation to the
material in this book. Historically, predictive control was first developed for step-
response models of plants, and the layout of the User’s Guide reflects this:
• Chapter 3 deals with state-space models. (And with transfer function models,
since the Toolbox includes functions for converting transfer functions to state-
space models.)
This is in contrast with this book, which places much more emphasis on state-space
models than on other forms. Fortunately Chapter 3 of the User’s Guide is written
in such a way that it can be read without reading Chapter 2 first.
The Model Predictive Control Toolbox uses its own format for representing state-
space models, which is called the MOD format. There is also a special format for
representing step-response models. The Toolbox includes functions for converting
models to and from these special formats. Before starting to use the Model Predictive
Control Toolbox it is recommended that the following sections of the User’s Guide
should be read:
349
350 C. The MPC Toolbox
It will be seen from section 3.1 of the Guide that the model assumed in the MPC
Toolbox is more general than the one which appears in the basic formulation intro-
duced in Chapter 2 of this book, having additional elements such as disturbances
and noise which are introduced in later chapters.
Unfortunately the variable names are also different. The approximate correspon-
dences are given in Table C.1. The correspondences are only approximate because,
for example, we distinguish between measured outputs y and controlled outputs z,
whereas the Toolbox stacks both controlled and uncontrolled outputs in the same
vector y, with the convention that the controlled outputs appear at the top of the
vector.
Entity Name in Name in
book Toolbox
State transition matrix A Φ
Input distribution matrix B Γu
Disturbance distribution matrix Bd Γd
Output matrix Cy and/or Cz C
Inputs u u
y
Outputs y
z
Measured disturbance dm d
Unmeasured disturbance du w and/or z
Prediction horizon Hp P
Control horizon Hu M
Tracking error weight Q(i) ywt
Control penalty weight R(i) uwt
• scmpc: Solves constrained predictive control problem with linear plant, and
simulates solution.
(Reference: User’s Guide pages 186–193).
• scmpcnl: Solves constrained predictive control problem with nonlinear plant
in the form of a Simulink model, and simulates solution. (The internal model
used by the MPC controller is linear.)
(Not described in User’s Guide, but interface similar to scmpc).
There are many other functions, described in the User’s Guide. The Tutorial section
of the Guide shows how to use the functions, and the examples which appear in the
Tutorial are also available as on-line demos.
The functions smpccon, scmpc and scmpcnl take the input argument M, which is used
to specify which input moves the optimiser can make. If M is a scalar (integer) then
it is just the control horizon, namely the same as our Hu . But if it is a row vector
then it specifies that blocking should be used: each element specifies the number
of steps over which ∆u = 0, or over which the input u remains unchanged. So
M=[m1,m2,m3] means that û(k|k) = û(k+1|k) = . . . = û(k+m1−1|k), û(k+m1|k) =
û(k + m1 + 1|k) = . . . = û(k + m1 + m2 − 1|k), etc.
One significant restriction is that only diagonal tracking error weight matrices Q(i)
and control move penalty weight matrices R(i) can be specified. This is done through
the arguments ywt and uwt, respectively. The diagonal elements of Q(i) (R(i)
respectively) are represented by the i’th row of ywt (uwt respectively). There is no
way of representing off-diagonal elements, so these are always assumed to be zero.
This can be a restriction, for example if one wants to represent a Q(i) obtained as
the solution of a Lyapunov equation, as in section 6.2.1. Problem 7 of Chapter 3
asks you to modify smpccon so as to remove this restriction. The other functions
could be modified similarly.
The way in which the Model Predictive Control Toolbox handles set-points is quite
restricted. There is no distinction between set-point and reference signals, of the
kind we made in section 1.2, and have implemented in the MATLAB functions
basicmpc, trackmpc and unstampc. Tracking errors are always defined as being
differences between the set-point and output vectors. Furthermore, although it
is possible to define a set-point trajectory over the duration of a simulation, the
functions scmpc and scmpcnl do not make any use of future values of the set-point
when computing the control signals. That is, the optimization algorithm is not
352 C. The MPC Toolbox
aware, at each step, of what the future of the set-point trajectory will be, and just
assumes that it will be constant at its current value. The function scmpcr allows
the optimiser to use such information about the future; this can be exploited to
perform limited simulations of the effects of defining specific reference trajectories,
for example by defining exponential set-point trajectories. But it is not possible to
simulate, say, the use of a reference trajectory in the presence of disturbances.
Most of the arguments can be omitted, and then take sensible default values. How-
ever, if P is omitted it defaults to 1, which is not usually a sensible prediction
horizon. With all possible arguments set to default values one obtains what is some-
times called a ‘perfect controller’ — see section 7.2.4. But in fact there are a lot of
problems with such a controller.
Constraints are represented in the functions scmpc and scmpcnl by the arguments
ulim (constraints on u and ∆u) and ylim (constraints on y). Like the weight
parameters, each row of these corresponds to one step in the prediction or control
horizon, so that the constraints can vary over the horizons. The bounds on ∆u are
always assumed to be symmetric (−Uj ≤ ∆uj ≤ Uj ), and they must be specified to
be finite, although they may be very large.
The MPC Toolbox allows arbitrary disturbance and noise models to be defined, and
disturbances can be specified to be measured or unmeasured, with feedforward action
being applied if measured disturbances are present. If no disturbance or noise model
is specified then by default the DMC disturbance model is assumed, namely a step
disturbance on each output, with no measurement noise. Observer gains can also
be specified, the default observer gain being taken to be the optimal observer for
the DMC disturbance model, namely [0, I]T — see section 2.6.3. If a more elaborate
model is needed, there is a simplified way of specifying the disturbance/noise model
of Lee and Yu — see section 8.2. For other disturbance and noise models the user
must specify the dynamics as state-space models, but there are facilities which help
with building up the augmented model which includes the plant, disturbance and
noise dynamics.
The Model Predictive Control Toolbox also contains functions for frequency-response
analysis of predictive controllers, under the assumption that constraints are not
active. For example, singular value plots of various closed-loop transfer functions,
such as the sensitivity and complementary sensitivity — see section 7.3 — can be
obtained by using the functions clmod, mod2frsp and svdfrsp.
The method used to solve the QP problem which arises in functions scmpc and
scmpcnl is described in [Ric85].
C.2. Functions scmpc2 and scmpcnl2 353
Modified versions of the functions scmpc and scmpcnl are available on this book’s
web site. These modified functions have the names scmpc2 and scmpcnl2, respec-
tively, and the modifications extend the functionality of the original functions in the
following ways.
1. Non-default observer gains can be used. Although this is also possible with
the standard functions scmpc and scmpcnl, those provide no facility for initial-
ising the observer state. When simulating a plant with non-zero initial state
(a common requirement particularly when using scmpcnl) and using a non-
default observer gain, it is important to be able to specify the initial observer
state. This possibility has been added.
It is anticipated that this feature will be mostly used to interrupt and resume
a simulation occasionally, but it is also possible to interrupt it at every step
— that is, to perform one step of the simulation, make suitable updates, then
perform one more step, etc.
Table C.2 lists the additional input arguments which have been made available in
functions scmpc2 and scmpcnl2.
354 C. The MPC Toolbox
Argument Purpose
xm0 Initial observer state
tvec Specification of start and end times of simulation
(replaces tend)
suwt, sywt Specified penalty coefficient on constraint violations
normtype Specifies 1-norm 2-norm, ∞-norm, or mixed-norm penalty for constraint violations
Function scmpc2 has been further modified to allow simulation with exponential
reference trajectories, as described in section 7.5. Function scmpc3 implements
reference trajectories without anticipation of future set-point changes (see Figure
7.17), while scmpc4 assumes that future set-point changes are known, and anticipates
them (see Figure 7.18).
Both functions have an additional argument, Tref, which is a vector of time con-
stants, one for the reference trajectory of each controlled output. Zero values are
allowed, which indicates that the reference trajectory coincides with the set-point
trajectory.
Author Index
355
356 AUTHOR INDEX
Johansen, T.A., 311 Morari, M., 99, 133, 166, 172, 191,
Johnson, D., 314, 315 222, 243, 244, 246, 250, 256–
258, 261, 262, 266, 267, 273,
Kadirkamanathan, V., 314 274, 289, 309–311, 318
Kailath, T., 58, 69, 129, 137 Morshedi, A.M., 336
Kalman, R.E., 250 Mosca, E., 45, 146, 147, 151, 158, 188,
Keerthi, S.S., 187, 190 198, 200, 235, 314
Kerrigan, E.C., 112, 270, 311 Murray, W., 94
Kleinman, D., 27 Muske, K.R., 165, 190, 193, 194, 308
Kolmanovsky, I., 235, 266
Kothare, M.V., 243, 256–258, 261, 262, Nemirovsky, A.S., 100, 107
267 Nesterov, J.E., 100, 107
Kouvaritakis, B., 115, 165, 166, 191, Newell, R.B., 295, 296
192, 204, 270 Nikolau, M., 266
Kung, S.Y., 132 Norton, J.P., 45, 135
Kuntze, H.B., 30, 177 Noton, A.R.M., 27
Kwakernaak, H., 33, 200, 247 Nørgaard, M., 314
Kwon, W.H., 27
Ogunaike, B.A., 313
Lasdon, L.S., 318 Ordys, A.W., 155
Lee, J.H., 133, 221, 243, 244, 246, 248,
250, 267, 314 Papageorgiou, G., 319
Lee, P.L., 295, 296 Papon, J., 27, 175, 177
Leineweber, D., 313 Pearson, A.E., 27
Liebman, M.J., 318 Pearson, R.K., 313
Linkens, D.A., 319 Piché, S., 314, 315
Liu, G.P., 314 Pierson, B.L., 319
Ljung, L., 45, 135 Pistikopoulos, E.N., 99
Lu, P., 319 Pollard, J.F., 45
Poulsen, N.K., 314
Maciejowski, J.M., 26, 87, 112, 131, Powell, J.D., 6, 44, 58
133, 157, 168, 197, 203, 204, Prett, D.M., 27, 56, 64, 119, 121, 161,
220, 234, 242, 251, 252, 256, 242, 273, 274, 280, 289
270, 281, 289, 305, 311, 312, Propoi, A.I., 27
319
Magni, L., 202 Qin, S.J., 88, 174, 312, 318
Mahfouf, M., 319
Martin Sanchez, J.M., 27, 45 Rago, C., 307
Mayne, D.Q., 190, 202, 264, 267, 269, Ramaker, B.L., 27, 64, 121, 336
315, 316 Rao, C.V., 2, 63, 107, 110, 190, 202,
McEwen, A.J., 132 318
Mehra, R.K., 27, 307 Rault, A., 27, 175, 177
Michalska, H., 190, 264, 269, 315 Ravn, O., 314
Mignone, D., 311, 318 Rawlings, J.B., 2, 63, 107, 110, 112,
Miller, R.H., 235 116, 165, 190, 191, 193, 194,
Mohtadi, C., 25, 45, 121, 212, 213 202, 250, 256, 264, 308, 315,
Moore, J.B., 90, 247 316, 318
AUTHOR INDEX 357
358
INDEX 359
GPC, 25, 28, 35, 121, 148, 150, 152, Kalman filter, 65, 90, 151, 202, 226,
155, 160, 166, 188, 202, 222, 227, 245–247, 249, 250, 253,
226, 235, 248 317
extended, 317
H-infinity Karush-Kuhn-Tucker conditions, 100,
control, 166, 256 102, 109
norm, 240
Hankel matrix, 128, 130, 133 Lagrange multiplier, 95, 100–102, 106,
Hankel singular value, 280, 281 112, 115, 313
Hessian, 85, 94, 313 Lagrangian, 312
HIECON, 341 large disturbance, 115
high-bandwidth applications, 1, 99 least-squares, 10, 12, 14, 86, 115, 132,
historical data, 315 303, 317
hot starting, 106, 316 recursive, 340
hybrid system, 310 Lee and Yu tuning, 243, 352
lexicographic minimum, 311
ideal resting value, 49, 304
limits on feedback performance, 210
IEC 1131-3 standard, 341
linear controller, 89, 96, 171
IEEE Standard arithmetic, 62
linear inequality, 265
ill-conditioned problem, 88, 108
linear matrix inequality, 107, 256, 259,
impulse response, see pulse response
262, 270
independent model, 18, 24, 69, 155
induced norm, 131, 220 linear programming, 94, 106, 168, 169,
infeasibility, 93, 110, 113, 263, 286, 308 171, 173, 183, 265, 303, 311,
infinite horizon, 166, 190, 194, 195, 337
197, 200, 250, 255, 256 linear quadratic control, 166, 199, 200,
∞-norm 250, 318
cost, 172 linearised model, 43, 44, 46, 59
penalty, 111 local optimum, 94
information filter, 202 loop transfer recovery, 249–256
innovations representation, 151 dual procedure, 252
input constraints, 110 LQG design, 249
input disturbance, 80, 273 LTR, see loop transfer recovery
integral action, 22, 128, 148, 222, 223, LU factorisation, 103
254 Lyapunov
integrated white noise, 253 equation, 195, 198, 199, 351
integrator wind-up, 6, 180, 318 function, 187, 189, 191, 194, 263
interior point method, 100, 107 stability theorem, 189, 316
internal model, 7, 9, 34, 193, 203, 283,
297, 299, 312 manipulated variable, 273, 296
control, 222 Markov parameter, 125
principle, 222, 223 MATLAB file
internal stability, 203, 214 basicmpc.m, 15–18
invariant set, 261, 264 disturb2.m, 120
inverse response, 213 evaporator.mdl, 297, 302
makecita, 79
Jordan decomposition, 197 mismatch2.m, 120
INDEX 361