This action might not be possible to undo. Are you sure you want to continue?
Control and Systems
Engineering
Predictive control
Anthony Rossiter
Department of Automatic Control
and Systems Engineering
University of Sheffield
www.shef.ac.uk/acse
© University of Sheffield 2009 This work is licensed under a
Creative Commons Attribution 2.0 License.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
2
MPC
Predictive control technique is chosen as
being very widely implemented within
industry and hence of the widest potential
use.
Predictive control describes an ‘approach’ to
control design, not a specific algorithm.
A user would ideally interpret the approach
to define an algorithm suitable for their
own needs.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
3
Organisation
1. Introduction to the key concepts of
predictive control. MOST IMPORTANT
2. Some numerical/algebraic details.
OBVIOUS if CONCEPTS UNDERSTOOD
3. Some examples.
4. The laboratory session.
5. The assignment.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
4
Review main
components of MPC
1. Prediction
2. Receding horizon
3. Modelling
4. Performance index
5. Constraint handling
6. Multivariable
Having reviewed
these components,
we can talk about
algorithm design
and tuning.
The key to
effective
implementation is
real
understanding of
how MPC works!
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
5
Prediction
• Why is prediction
important?
• How far should
we predict?
• Consequences of
not predicting.
• How do we
predict?
• How accurate do
predictions need
to be?
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
6
Illustration
Road
CAR
Horizon
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
7
Receding horizon
•
What is a receding horizon?
•
Why is it essential ?
(uncertainty/feedback)
•
How is it embedded into MPC?
•
What advantages does it bring and
what repercussions does it have on
prediction accuracy?
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
8
Illustration of initial
prediction
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
9
Illustration
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
10
Illustration
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
11
What do we learn
•
Did not observe all constraints at
outset – ended up in a deadend (or
DEAD).
•
If had reoptimised at t=T, would not
be able to use previous optimum
trajectory.
Previous optimum
was not optimum!
WHAT WAS IT
THEN?
Optimisation of
prediction is
meaningless unless it
can be implemented.
MPC based on optimisation – make sure this well posed!
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
12
Modelling
1. What is the model used for ?
2. How does the model use impact on the
modelling steps?
3. What type of model is required: FIR, state
space, mental, etc. ?
4. How much effort should the modelling
take?
5. How accurate and/or precise should the
model be?
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
13
Performance index
1. What is the performance index used for ?
2. How should the performance index be
designed?
3. Trade offs between optimal and safe
performance.
4. What performance indices do humans use
in every day life? How do these change as
we get older e.g. (babies to adults)?
5. What horizons do we use and why? (skill
levels)
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
14
Constraint handling
1. How are constraints embedded into
most control strategies?
2. Do you use a posteriori or a priori
design?
3. How do humans embed constraints
into their behaviour and why?
4. How is MPC different from most
conventional approaches?
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
15
Multivariable
Ordinarily, how does industry cope
with MIMO loops and what are the
consequences?
How does MPC differ and what are the
pros and cons?
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
16
Summary – well posed
MPC
1. Modelling efforts should be focussed on efficacy for
prediction, including dependence on d.o.f..
2. Predictions must capture all the transient and
steadystate behaviour.
3. Prediction class should include the desired closed
loop behaviour.
4. Performance indices must be realistic and matched
to model accuracy.
5. Constraints must be built in from the beginning.
6. Efficient computation requires linear models and
simple parameterisations of d.o.f.
Who will
manage this
controller?
Their needs are
… ?
AND
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
17
Organisation
•
Remainder of this talk looks at how we
might design an algorithm meeting these
requirements.
•
KEY POINT: MPC is a concept – you must
design an algorithm to meet YOUR needs!
•
By having clear insight, you should be able
to identify the cause when MPC is not
delivering.
I have designed this talk to help you become a
designer, not just a user of existing products.
HOWEVER, do ask whatever you most want to
know.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
18
Overview
1. Prediction with transfer function
and state space models.
2. Formulation of a GPC control law.
3. Modifying structures to improve
robustness.
4. Modifying performance indices to
improve stability and tuning.
5. Including constraints.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
19
Numerical and
algebraic details
1. Prediction with state space models.
2. Formulation of a GPC control law.
3. Robustness.
4. Performance and stability.
5. Including constraints.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
20
Prediction with state
space models.
You should be aware of the key result. All predictions
for linear models take the form:
Where x is measured data (e.g. current state), u is
future controls and y is predicted output.
Hence, one can manipulate predicted outputs directly
by changing predicted inputs.
Definitions of H, P are secondary issues.
Px u H y + ·
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
21
Philosophy of
prediction
Form a one step ahead prediction model and predict
y(k+1).
Use this model recursively, so given y(k+i) find
y(k+i+1).
Continue until one has predicted ny steps ahead and
group results as on previous slide.
Hence prediction is equivalent to solving a large set of
simultaneous equations.
In general some filtering is needed to reduce the
sensitivity to noisy measurements.
Coding is trivial if one has access to software with
matrix algebra.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
22
Remark
Different algorithms
may choose the
future control
sequence in
several ways.
KEY POINT: Your
predictions must
be unbiased in the
steadystate. [See
notes]
... ..., ,
... ..., ,
1
1 1
· − ·
· ∆ − · ∆
+
+ −
k ss k k
k k k k
u u u u
u u u u
δ δ
u
u
δ
∆
Change in
control
Distance from
expected
steadystate
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
23
Prediction with transfer
function and state space
models.
You should be aware of the key result. All
predictions for linear models take the form:
Where x is measured data (current state and/or
past inputs and outputs).
Hence, one can manipulate predicted outputs
directly by changing predicted inputs.
Definitions of H, P are secondary issues.
Px u H y + ·
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
24
Philosophy of
prediction
Form a one step ahead prediction
model and predict y(k+1).
Use this model recursively, so given
y(k+i) find y(k+i+1).
In fact Diophantine equations replicate
this, but personally I think they obscure
what is happening and hence recommend
you DO NOT USE THEM!
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
25
Prediction
continued
1. Given prediction is a simple recursion, one
can write down all the relevant equations as
a group of simultaneous equations.
2. Hence prediction is equivalent to solving a
large set of simultaneous equations.
3. This approach gives insightful and compact
algebra. Also easy to code in MATLAB.
4. Easier extension to more complex cases
(e.g. MIMO and Tfilter).
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
26
Prediction
illustrations in
lecture
1. Steps for ARMA prediction with
summary.
2. Extension to MIMO.
3. Prediction with state space
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
27
GPC control law
Define a performance index which
measures predicted errors and
control activity over some horizons:
Choose the future control moves to
minimise the predicted cost, that is,
optimise expected performance.
∑ ∑
·
−
·
∆ + − ·
y u
n
i
n
i
i i i
u y r J
1
1
0
2 2
) ( λ
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
28
GPC control law
Write the performance index in more
compact form using vectors and matrices.
Find the optimum with a grad operator as
index is quadratic (always positive).
2
2
2
2
2
2
2
2
u Px u H r
u y r J
∆ + − ∆ − ·
∆ + − ·
λ
λ
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
29
Gradient operations
A quick review of differentiation of
vector variables. Let
Then
x A Ax Ax x
dx
d
a
a
a
a
x a
dx
d
x a
dx
d
x a
dx
d
x a
dx
d
T T
n T
n
T
T
T
+ · ·
]
]
]
]
]
]
·
]
]
]
]
]
]
]
]
]
]
· ) ( ;
) (
) (
) (
) (
2
1
2
1
T
n
T
n
x x x a a a ] ,..., [ ; ] ,..., [
1 1
· ·
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
30
Optimising J
Grad operation on J is now by
inspection
) ( ) ( 0
2 ) ( 2
1
2
2
2
2
Px r H I H H u
u d
dJ
u r Px u H H
u d
dJ
u Px u H r J
T T
T
− + · ∆ ⇒ ·
∆
∆ + − + ∆ ·
∆
∆ + − ∆ − ·
−
λ
λ
λ
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
31
Control law
Take the first component of the input
We have ignored algebraic details
required for integral action,
disturbance rejection, etc. You can find
these in the text books.
Kx r P
Px r P
Px r H I H H e u e u
r
r
T T T T
− ·
− ·
− + · ∆ · ∆
−
) (
) ( ) (
1
1 1
λ
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
32
Control law
Take the first component of the input
Q P N
P P D
H I H H e P
where
y N u D r P
y Q u P r P
y Q u P r H I H H e u e u
r k
r k
T T T
r
k k r
r
T T T T
·
·
+ ·
− ∆ − ·
− ∆ − ·
− ∆ − + · ∆ · ∆
−
−
1
1
1
1 1
) (
) (
) ( ) (
λ
λ
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
33
Control law in z
transforms
Next we write the law in terms of z
transforms so that we can analyse
poles.
y z N r P z u D
z y z N y N
z u z D
u
u
D D
u
u
D
N N N D D D
y N u D r P u
k r k
k k
k
k
n
k
k
m o k n k
k k r k
) ( ) (
) ( ) (
) ( ) ( ] ..., , 1 [ ] , 1 [
] ,..., [ ]; ..., [
, 1
, 1
− · ∆
≡
∆ ≡
]
]
]
∆
∆
·
]
]
]
∆
∆
· ·
− ∆ − · ∆
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
34
Closedloop poles
As the control law is fixed and linear, we
can find the equivalent closedloop
poles.
In simplified terms, the loop controller and
hence poles are:
Warning: b(z) will contain a delay.
c k k
c
k
k
p bN a D
GK p and
a
b
G
D
N
K
· + ∆
· + ≡ · ·
∆
· ) 0 1 ( ) 0 ( ;
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
35
Closedloop poles
As the control law is fixed and linear, we
can find the equivalent closedloop
poles.
In simplified terms, the loop controller
and hence closedloop system are:
x BK A x
Bu Ax x
Kx u
) ( − · ⇒
¹
'
¹
+ ·
− ·
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
36
MIMO case
1. This is identical to the SISO case.
2. This is a major advantage of MPC,
the basic algebra is the same for
SISO and the MIMO case.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
37
Tuning to get good
poles
•
Take a system and explore how the poles move
as the horizons are changed.
•
You may find it difficult to see a pattern.
•
Low output horizons can give fast responses but
possible unstable or poor otherwise. WHY?
•
Low input horizons give cautious behaviour –
WHY?
•
Large output horizons with unit input horizon give
openloop behaviour. WHY?
•
Control weighting is only effective if the output
horizon is close to the settling time. WHY?
•
How many closedloop poles are there?
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
38
GPC may not always be
good
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
39
Problems with GPC
1. Next few slides illustrate the potential
weaknesses of using GPC.
2. The fundamental concept is called ‘prediction
mismatch’.
3. Prediction mismatch means that the class of
predictions over which you optimise:
i. do not include the prediction you would really like.
ii. are not close to the actual closedloop behaviour
that arises.
We leave aside issues about whether the tuning
parameters are intuitive for technical engineers. PFC
proposes tuning by time constants.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
40
Optimised predictions
with different nu (1,2,
∝)
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
41
Optimised predictions
one sample later
Optimum
at t
Optimum at
t+1
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
42
ny=50,nu=1,Wu=0
.1
0 5 10 15 20 25 30 35 40 45 50
1
0
1
2
3
I
n
p
u
t
i
n
c
r
e
m
e
n
t
s
0 5 10 15 20 25 30 35 40 45 50
0
0.5
1
1.5
O
u
t
p
u
t
s
Samples
Prediction
Closedloop
LQRoptimal
Input not
close to
optimum!
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
43
0 5 10 15 20 25 30 35 40 45 50
2
1
0
1
2
3
I
n
p
u
t
i
n
c
r
e
m
e
n
t
s
0 5 10 15 20 25 30 35 40 45 50
0
0.5
1
1.5
O
u
t
p
u
t
s
Samples
Prediction
Closedloop
LQRoptimal
ny=50,nu=2,Wu=0
.1
Input not
close to
closedloop!
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
44
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0
0.2
0.4
0.6
0.8
1
I
n
p
u
t
i
n
c
r
e
m
e
n
t
s
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0
0.05
0.1
0.15
0.2
0.25
O
u
t
p
u
t
s
Samples
Prediction
Closedloop
LQRoptimal
ny=5,nu=1,Wu=1
Input not
close to
optimum!
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
45
Summary
• GPC algorithms can give illposed
optimisations.
• A consequence could be very poor behaviour.
• Good behaviour could be more luck than
design; receding horizon arguments are not
reliable!
• Fundamental problem is the choice of control
trajectories which may not match the desired
behaviour closely enough.
In many large and slow
processes, the DMC
assumption is close to
desired behaviour and
consequently it works well.
I would recommend
a careful check of
potential mismatch
before using an
algorithm.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
46
PFC approaches
Ideal path (not
actual)
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
47
The Tfilter
1. Why is this introduced?
2. How is it introduced?
3. What impact does it have on the
predictions? (No simple analytic formulae
can be given, only intuition and a
posteriori observations.)
Summary: Filter data before predicting, then
antifilter back to original domain.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
48
CARIMA model and
prediction
Focus on the key steps/philosophy. Fine
details are obvious once this is clear.
1. Write model in terms of filtered data.
2. Form predictions in terms of filtered data in
exactly same way as ARMA model.
3. Need unfiltered future for the performance
index. Filtered past are known values.
Translate future filtered values to future
unfiltered values. Leave past filtered values as
they are.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
49
CARIMA model and
prediction (b)
Compare the expressions with and without a T
filter.
1. Clearly the matrices multiplying past (or known)
data have changed. The mapping from the past to
the future has changed.
2. This change in mapping, changes how noise in the
signals effects the predictions. If 1/T is lowpass, it
filters out high freq. and hence improves quality.
y Q u P u H y
y Q u P u H y
+ ∆ + ∆ ·
+ ∆ + ∆ ·
~
~
~
~
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
50
Change filtered to
unfiltered
Use Toeplitz and Hankel matrices for
convenience of algebra.
A similar statement can be applied to
u. Hence
]
~
[
~ ~ ~
~ ~
1
y H y C y or y y H y C
y y T
T
y
y
T T T T
− · · +
· ⇒ ·
−
y Q u P u H u HC y H y C
y Q u P u H y
T T T T
~ ~
]
~
[ ]
~
[
~ ~ ~ ~
1 1
+ ∆ + ∆ − ∆ · −
⇒ + ∆ + ∆ ·
− −
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
51
Optimising J with a
Tfilter
Modify J to take appropriate prediction
)
~
~
~
~
( ) ( 0
~
~
~
~
1
2
2
2
2
y Q u P r H I H H u
u d
dJ
u y Q u P u H r J
T T
− ∆ − + · ∆ ⇒ ·
∆
∆ + − ∆ − ∆ − ·
−
λ
λ
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
52
Control law
Modify control law accordingly
Q P N
P P D
H I H H e P
where
y N u D r P
y Q u P r H I H H e u e u
r k
r k
T T T
r
k k r
T T T T
~ ~
~
~
) (
~
~
~
~
)
~
~
~
~
( ) (
1
1
1
1 1
·
·
+ ·
− ∆ − ·
− ∆ − + · ∆ · ∆
−
−
λ
λ
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
53
Control law in z
transforms
Eliminate the filtered variables using
( )
y
T
z N
r P z u
T
z D
T
z y
z N r P
T
z u
z D z z T
y N u D r P u
k
r
k
k r k
k k r k
) (
~
) (
) (
~
) (
) (
~ ) (
]
~
) ( [
~
~
~
~
1
− · ∆
− ·
∆
+
− ∆ − · ∆
−
t
y
y
T
u
u ·
∆
· ∆
~
;
~
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
54
Closedloop poles –
Tfilter
In simplified terms, the loop controller
and hence poles are:
NOTE: In fact the poles will include T(z)
as a factor (see notes).
c k k
c
k
k
p N b a D
GK p and
a
b
G
D
N
K
· + ∆
· + ≡ · ·
∆
·
~ ~
) 0 1 ( ) 0 ( ;
~
~
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
55
Robustness
1. How can an MPC law be tuned to
give better robustness?
2. What is the role of the Tfilter? How
can it be selected?
3. How can sensitivity be measured?
We give some introductory views on
these issues.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
56
Robustness
measures
Robustness can be defined for many
scenarios such as
1. Sensitivity to modelling errors.
2. Sensitivity to disturbances.
3. Sensitivity to noise.
In each case one can form the
transference from the uncertainty to
the input or output.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
57
Parameter
uncertainty
Consider first multiplicative
uncertainty in G(z). Poles are
determined from (1+GK)=0.
c
k
G
G
p
bN
S
GK
GK
S
GK
GK
GK
GK GK GK
GK GK
·
+
· ⇒ ·
+
+ + ⇒
· + + · + +
+ + → +
1
0 )
1
1 )( 1 (
0 ) 1 ( )) 1 ( 1 (
)) 1 ( 1 ( ) 1 (
δ
δ δ
δ
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
58
Sensitivity to
disturbances
Find the transference from disturbance
to input (or output). Use forward path
over (1+return path).
c
k
ud
c
k
yd
k
k
p
aN
GK
K
S
p
aD
GK
S
D
N
K
a
b
G
− ·
+
− ·
∆
·
+
·
∆
· ·
1
;
1
1
;
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
59
Sensitivity to noise
1. Find the transference from noise to input (or
output). Using forward path over (1+return path)
one gets a similar relationship to that for the
disturbances.
2. Technically, disturbances are embedded within G
and so more complex relationships can arise.
This is outside the remit of this course.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
60
Impact of the Tfilter
on sensitivity
1. Tfilter changes
sensitivity significantly,
as observed below.
2. Notable change is a
reduction in sensitivity at
high frequency with some
loss at low/intermediate
freq.
3. Notice T in the
denominator, but note
also that the numerator
has changed.
T p
N a
S
p
aN
S
T p
D a
S
p
aD
S
T p
N b
S
p
bN
S
c
k
ud
c
k
ud
c
k
ydT
c
k
yd
c
k
GT
c
k
G
~
:
~
:
;
~
:
· ·
∆
·
∆
·
· ·
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
61
Other ways of
changing sensitivity
1. The Tfilter is known to be effective at reducing
input sensitivity to noise, and can help with
model uncertainty. However the impact is not
deterministic a priori.
2. T is not easy to design systematically and in
fact sometimes has the opposite effect to that
expected.
3. We need an alternative approach that gives
more direct handles on sensitivity, more akin to
formal robust control methods.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
62
Youla
parameterisations
1. Youla parameterisations change the control law without
having an impact on nominal tracking/poles!
2. The change is therefore used to impact on sensitivity with
loss of nominal performance.
3. As long as Q is stable, can be chosen however you please
and will not change nominal tracking!
) (
) ( ) (
; ;
unchanged aD bN p
bQ D a Q a N b p
Q a N N
bQ D D
aD bN p r
p
a
u r
p
b
y
k k c
k k c
k k
k k
k k c
c c
∆ + ·
∆ − + ∆ + ·
⇒
¹
'
¹
∆ + →
− →
∆ + · · ·
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
63
Selecting Q
1. Because the control parameters, and
therefore the sensitivity functions, are
affine in Q, one can use simple optimisers
to identify the best Q to minimise some
freq. domain measure of sensitivity.
2. Can be extended to the MIMO case with
almost identical algebra (taking some care
of commutativity issues).
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
64
Robustness and T
filter
1. Why is this introduced? Essential in
practice
2. How is it introduced? Filter data before
predicting, then antifilter back to original
domain.
3. What impact does it have on the
predictions? Much less sensitive to noise
and other high frequency uncertainty
(better robustness).
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
65
Constraints
1. How are constraints introduced into
MPC?
2. How are constraint equations
constructed?
3. What is the impact on the control
law?
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
66
Typical constraints
Systems often have limits on:
1. Inputs
2. Input rates
3. Outputs
4. States
These constraints can be time varying but more
normally are constant and apply all the time.
These constraints must be satisfied by the
optimised predictions.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
67
Input constraints
and predictions
Consider the following limits and an
equation testing satisfaction over
the input horizon.
]
]
]
]
]
]
]
]
]
]
]
−
−
−
≤
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
−
−
⇒
¹
¹
¹
¹
¹
'
¹
≤ ≤
≤ ≤
≤ ≤
− +
+
− +
+
u
u
u
u
u
u
u
u
u u u
u u u
u u u
u
u
n k
k
k
n k
k
k
1
1
1
1
0
0
1
1
0
0
0
1
0
0 1 0
0 0 1
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
68
Input constraints
with increments
Note that
and hence:
]
]
]
]
]
]
]
]
]
]
]
−
−
−
≤
]
]
]
]
]
]
]
]
]
]
−
−
+
]
]
]
]
]
]
]
∆
∆
∆
]
]
]
]
]
]
]
]
]
]
− −
−
⇒
¹
¹
¹
¹
¹
'
¹
≤ ≤
≤ ≤
≤ ≤
−
− +
+
− +
+
u
u
u
u
u
u
u
u
u
u u u
u u u
u u u
k
n k
k
k
n k
k
k
u
u
1
1
1
1
1
1
1
1
1
1
0
0
1
1
0
1
1
1
1
0 1 1
0 0 1
i k k k k i k
u u u u u
+ + − +
∆ + + ∆ + ∆ + ·
1 1
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
69
Combining input rate
and input constraints
Input rate constraints and input constraints
together take the form
Where E is lower triangular matrix of ones.
]
]
]
]
]
]
·
]
]
]
]
]
]
]
−
∆ −
∆
≤
]
]
]
]
]
]
−
+ ∆
]
]
]
]
]
]
−
−
−
1
1
1
;
0
0
1
L
u L
u L
u L
u L
u
L
L
u
E
E
I
I
k
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
70
Extension to the
MIMO case
Replace elements of 1 by identity
matrix of suitable dimension.
Otherwise, the structure will remain
the same except that individual
components have been replaced by
vectors or matrices as appropriate.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
71
Output or state
constraints
This can be a little more messy, but
not if you keep a clear head.
;
]
]
]
]
−
≤
]
]
]
−
+ ∆
]
]
]
−
≤ + ∆ · ≤
y
y
x
P
P
u
H
H
or
y Px u H y y
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
72
Summary of
constraints
The constraints all take the form
Note that d depends upon:
1. measurements (past inputs and outputs)
2. fixed values such as upper and lower limits.
3. Set point, disturbances.
Hence it must be updated every sample.
,...) , , ( ; u u x d d d u C · ≤ ∆
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
73
Combining with the
cost function
Must minimise J, subject to predictions
satisfying constraints:
1. This is called a quadratic
programming problem.
2. Solution is tractable and quick,
even for quite large problems.
d u C t s u Px u H r J
u
≤ ∆ ∆ + − ∆ − ·
∆
. . min
2
2
2
2
λ
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
74
Interpreting a QP
I will give some illustrations in lectures
of what the optimisation looks like.
Once again we note that the only
difference between MIMO and SISO is
the dimension of the optimisation,
but not in structure or set up.
Discuss again the impact of constraints
on performance and control.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
75
Stability
1. We can find the poles of MPC aposteriori.
2. How do we decide, apriori:
a. what are good values for the horizons and
weights?
b. will the nominal closedloop system be stable?
c. what happens when constraints are included?
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
76
Early work
1. In the 1980s many authors suggested very
specific combinations of horizons/weights
to gaurantee stability. However most of
this work is pointless as it gives little
useful insight, especially with regard to
performance.
2. We are most interested in, what choice of
horizons is likely to give good
performance, as stability is then
automatic.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
77
Accepted solutions
1. The academic literature has a globally
accepted method for ensuring stability and
good performance.
2. This method is powerful because it does
not rely on linear analysis and hence also
applies to the constraint handling case
(assuming recursive feasibility).
3. In fact, the underlying requirements are
common sense and similar to strategies
used by humans.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
78
The tail
1. The first requirement is that the prediction you choose
now, can also be used at the next sampling instant.
2. Hence, if you choose a sensible strategy now, and it is
working, you must be able to continue with that strategy
when you update your decisions.
3. We call this riding on the tail, you pick up the part of the
strategy as yet not implemented and continue with it.
4. This puts very specific requirements on the class of
predictions. The tail must always be in the class.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
79
Large horizons
1. You must always look far enough ahead so
that your predictions contain all the
dynamics.
2. That is, the predictions should be constant
beyond the horizon, otherwise the ignored
part of the predictions may include
undesirable behaviour, which will be
inherited in subsequent samples.
3. Large enough usually means input horizon
+ settling time.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
80
Summary
1. Infinite horizons and the inclusion of
the tail guarantee closedloop
stability (nominal case).
2. There is no need to compute the
closedloop poles.
3. The proof applies even in the
presence of constraints and therefore
extends to nonlinear behaviour.
Proof given next.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
81
With infinite horizons,
J is Lyapunov
Let the optimum predictions at k be
Now at k+1, inclusion of the tail implies on
can select:
Next consider that the cost is defined as
T
k n k k k k k
T
k n k k k k k
y y y y u u u u ] , , , , [ ; ] , , , , [
  2  1   1 
+ + + + +
· ·
T
k n k k k
T
k n k k k
T
k n k k k
T
k n k k k
y y y y
u u u u
] , , , [ ] , , , [
] , , , [ ] , , , [
  2 1  1  2
  1 1  1  1
+ + + + + +
+ + + + + +
·
·
∑ ∑
∞
·
∞
·
+ + +
∆ + − ·
1
2 2
) (
i o i
i k i k i k k
u y r J λ
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
82
With infinite horizons,
J is Lyapunov (b)
1. Now compare the cost at subsequent sampling
instants, assuming one uses the tail.
2. It should be clear that
3. That is, J is always reducing unless (r=y) and Du=0.
This can only happen repeatedly if one is already at
the desired steadystate. Moreover, one can always
reoptimise at each sample to make K even smaller
still.
∑ ∑
∑ ∑
∞
·
∞
·
+ + + + +
∞
·
∞
·
+ +
∆ + ·
∆ + ·
1
2
 1
2
 1 1
1
2

2

i o i
k i k k i k k
i o i
k i k k i k k
u e J
u e J
λ
λ
2

2
 1 1 k k k k k k
u e J J ∆ − − ·
+ +
λ
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
83
Proof applies during
constraint handling
1. The only difference during constraint handling is
that J is minimised subject to constraints.
2. If predictions at time k satisfy constraints, then
so does the tail. Hence the tail can be used at
k+1 and the Lyapunov property still holds.
3. There is however a need for feasibility, that is
one must assume that there exists, at the
outset, a prediction class which satisfies
constraints.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
84
Proof applies with a
finite input horizon
1. This is obvious by simply going through
the steps of the proof but altering the
costing horizon on the inputs to be nu.
2. All the steps of the proof are identical
because restricting nu simply adds lots
of zeros for the future control
increments.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
85
Are infinite
horizons
impractical
1. You need a Lyapunov equation to sum the
errors over an infinite horizon.
2. This is straightforward when the prediction
dynamics are linear.
I S A A SA A
A A S Sx x J
x A A x x x J Ax x
i
i T i T
i
i T i
k
T
k
k
i T i T
k i k
T
i k k k
− · ·
⇒
· ·
· · ·
∑
∑
∑ ∑
∞
·
∞
·
∞
+
∞
+ +
1
0
1
) (
) ( ;
) ( ;
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
86
Different ways of
implementing infinite
horizons
1. People usually use dualmode
predictions.
a) Mode 1, immediate transients, one has
total freedom in the control chosen.
b) Mode 2, is the asymptotic behaviour and
is chosen with predetermined dynamics.
2. The choice of mode 2 is the main
flexibility in the design.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
87
Dual mode paradigm
(or closedloop
prediction)
Terminal region in which
the control law u=Kx
satisfies constraints.
Initial state
t
r
a
j
e
c
t
o
r
y
n
c
m
o
v
e
s
m
a
x
i
m
u
m
Terminal
State
In at most nc samples, predicted
state moves into the terminal
region while satisfying constraints.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
88
Open and closedloop
prediction
Model
Future inputs
Future outputs
OPEN LOOP
PREDICTION
Model
M
K
Future outputs
r
Decision variables
CLOSED LOOP
PREDICTION
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
89
Stability and dual
mode paradigm
Historically:
1. academics spent a
lot of time discussing
the tuning and
stability of MPC.
2. it was thought that
input/output horizons
and control
weighting were
‘tuning’ parameters.
3. there were few
stability results.
Now:
1. most people advise
the dual mode
paradigm.
2. the tuning parameter
is the terminal control
law.
3. the ‘control horizon’
affects feasibility and
computational load.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
90
Mode 2 choices
1. You need to make a choice between
cautious control with large feasible
regions and optimal control with better
performance but smaller regions of
applicability (and perhaps less
robustness).
2. I will outline typical choices in the
lecture.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
91
Feasible regions for
n
c
=1,2,3
nc=3
nc=2
nc=1
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
92
Terminal region
variation with
different feedback
gains
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
93
What about DMC?
DMC and similar algorithms have been successfully and
widely applied. Why is this ‘new’ approach needed?
Insights:
1. explain the success of DMC and therefore improve user
confidence.
2. give better understanding of the limitations of DMC and
what needs changing.
Summary:
1. DMC can be considered as a dual mode law with a
terminal control law of K=0 (openloop) as industrial
practise has favoured large output horizons (effectively
equivalent to infinity).
2. Will be less effective when openloop behaviour is poor.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
94
Closedloop
prediction
Current thinking is that, ordinarily, one should predict in
the closedloop.
1. Better conditioned predictions and embeds desired
behaviour.
2. Predictions automatically close to desired behaviour,
more robust optimisation.
3. Especially important for openloop unstable plant.
4. Makes tuning more straightforward.
5. Handling feasibility can be easier.
NOTE: Differs from DMC which assumes default
behaviour is openloop dynamics.
PFC partially meets this aim (uses openloop predictions
but matches to a desired dynamic).
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
95
Closedloop MPC
algorithm
Standard MPC objective
Decision variables are
perturbations c
k
to
control trajectory
J is equivalent to
∑
∞
·
+ ·
0 k
k
T
k k
T
k
Qu u Qx x J
∑
−
·
> Λ Λ ·
1
0
0 ;
c
n
k
k
T
k
c c J
c k k
c k k k
n k Kx u
n k c Kx u
≥ − ·
− · + − · 1 , , 1 , 0
Nominal
behaviour
Ideally c
=0
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
96
Constraint handling
It is well known, that for
an LTI model, one can
express predictions in
the form.
Therefore constraint
satisfaction of the
predictions is equivalent
to set membership of S.
]
]
]
]
]
]
]
· + ·
]
]
]
]
]
]
− +
+
+
+
1
1
1
;
c
n k
k
k
k
n k
k
k
c
c
c
c c H Px
x
x
x
} : { d c N Mx x S
k k
≤ + ·
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
97
MPC algorithm with
constraint handling
Perform, each sample, the quadratic
programming optimisation
Implement the optimum control as
follows:
d c N Mx t s c c J
k D
T
c
≤ + Λ · . . min
c e c c Kx u
T
k k k k 1
; · + − ·
More detail of these computations are in the
handout.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
98
Why does this
paradigm give
stability
Implicitly uses infinite horizons,
therefore anticipates and
allows for entire future.
As long as d.o.f. parameterised
such that one can reuse old
decisions, one can continue to
ride on good policies to
convergence.
Optimise around ‘good’
trajectories, therefore well
conditionned.
No dead
ends!
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
99
Summary OMPC
Main components are prediction, optimisation
and explicit inclusion of constraints.
• Now accepted that the dual mode (or closed
loop) paradigm is a good mechanism for
ensuring stability and well posed optimisation.
• Implicitly uses infinite costing horizons.
• Tuning depends on the terminal law and
feasibility on the terminal law and number of
d.o.f.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
100
Parametric
solutions
A major insight of the last few years is
the potential of parametric solvers for
MPC problems.
Instead of an online optimisation:
1. parameterise all possible
optimisations
2. solve these offline
3. Online: determine and implement
appropriate solution.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
101
Illustration of
regions
Each region has a
different control
law
i i i
p x K c S x + − · ⇒ ∈
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
102
Illustration of
regions (b)
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
103
Parametric solvers
•
Major benefit is transparency of control
law. Huge potential where rigorous testing
and validation is required.
•
Downside is large number of regions.
Identifying active region can be more
demanding than solving original QP.
Data storage requirements for regions.
For small dimension problems, may be
invaluable and far simpler to implement.
[In essence a Lookup table]
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
104
Conclusion
1. Focussed on some key concepts from linear MPC.
2. Quickly overviewed how understanding the key
concepts allows the development of algorithms
which:
i. Make good engineering sense
ii. Have a priori results on performance and stability.
iii. Allows the user to quickly identify what is wrong when MPC
fails.
MPC is very flexible. Don’t assume
you have to go with an off the
bench algorithm.
If you are unsure about anything
today, please come and talk to me.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
105
Today’s laboratory
You will be given the chance to
experiment with different:
1. Algorithms
2. Tuning parameters.
3. Uncertainty.
The software is simple to enable
insight and easy editing, but not
intended for general distribution.
ACS6012: MPC MSc Department of Automatic
Control and Systems
Engineering
This resource was created by the University of Sheffield and released as an open educational resource through the Open
Engineering Resources project of the HE Academy Engineering Subject Centre. The Open Engineering Resources project
was funded by HEFCE and part of the JISC/HE Academy UKOER programme.
© 2009 University of Sheffield
This work is licensed under a Creative Commons Attribution 2.0 License.
The JISC logo is licensed under the terms of the Creative Commons AttributionNonCommercialNo Derivative Works 2.0 UK: England & Wales Licence. All
reproductions must comply with the terms of that licence.
The HEA logo is owned by the Higher Education Academy Limited may be freely distributed and copied for educational purposes only, provided that
appropriate acknowledgement is given to the Higher Education Academy as the copyright holder and original publisher.
The name and logo of University of Sheffield is a trade mark and all rights in it are reserved. The name and logo should not be reproduced without the
express authorisation of the University.
Where Matlab® screenshots are included, they appear courtesy of The MathWorks, Inc.