Professional Documents
Culture Documents
Anthony Rossiter
Department of Automatic Control
and Systems Engineering
University of Sheffield
www.shef.ac.uk/acse
MSc ACS6012: MPC Department of Automatic
© University of Sheffield 2009 This work is licensed under a Control and Systems
Creative Commons Attribution 2.0 License. Engineering
2
MPC
Road
CAR
MSc
Horizon
ACS6012: MPC Department of Automatic
Control and Systems
Engineering
7
Receding horizon
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
steady-state behaviour.
3. Prediction class should include the desired closed-
loop behaviour.
4. Performance indices must be realistic and matched
to model accuracy. AND
5. Constraints must be built in from the beginning.
6. Efficient computation requires linear models and
simple parameterisations of d.o.f.
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
MSc
of existing products.
ACS6012: MPC Department of Automatic
HOWEVER, do ask whatever you most want Control andto
Systems
Engineering
18
Overview
y = H u + Px
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.
y = H u + Px
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.
J = ∑i =1 (ri − yi ) + λ ∑i =0 ∆u
ny 2 nu −1 2
i
Then
d T
dx ( a x )
1
a1
d T d ( a T x ) a2 d T
(a x) = dx2 = = a; ( x Ax) = Ax + AT x
dx dx
d T
an
(a x)
dxn
MSc ACS6012: MPC Department of Automatic
Control and Systems
Engineering
30
Optimising J
dJ
= 2 H T ( H∆u + Px − r ) + 2λ∆u
d∆ u
dJ
= 0 ⇒ ∆u = ( H T H + λI ) −1 H T (r − Px)
d∆ u
Optimum at
t+1
3 .1 Prediction
Input increments
Closed-loop
2
Input not LQRoptimal
1 close to
optimum!
0
-1
0 5 10 15 20 25 30 35 40 45 50
1.5
1
Outputs
0.5
0
0
MSc 5 10 15 20 25
ACS6012: 30
MPC 35 40 45
Department50of Automatic
Samples Control and Systems
Engineering
ny=50,nu=2,Wu=0 43
3 .1Input not
Prediction
2 close to
Input increments
Closed-loop
1 closed-loop! LQRoptimal
-1
-2
0 5 10 15 20 25 30 35 40 45 50
1.5
1
Outputs
0.5
0
MSc 0 5 10 15 20ACS6012:
25 MPC30 35 40 45
Department 50Automatic
of
Samples Control and Systems
Engineering
ny=5,nu=1,Wu=1 44
1
Prediction
0.8
Input increments
Closed-loop
0.6 LQRoptimal
0.4
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0.25
Input not
0.2
close to
optimum!
Outputs
0.15
0.1
0.05
0
MSc
0 0.5 1 1.5 2 2ACS6012:
.5 3 MPC 3.5 4 4.5 Department
5 of Automatic
Samples Control and Systems
Engineering
45
Summary
• GPC algorithms can give ill-posed
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
In behaviour
many large and slow
closely enough.
I would recommend
processes, the DMC
a careful check of
assumption is close to
potential mismatch
desired behaviour and
before using an
consequently it works well.
MSc ACS6012: MPC algorithm.
Department of Automatic
Control and Systems
Engineering
46
PFC approaches
Ideal path (not
actual)
~ ~ ~~ 2 2
J = r − H∆u − P ∆u − Q y + λ ∆u 2
2
dJ ~ ~
= 0 ⇒ ∆u = ( H T H + λI ) −1 H T (r − P ∆u~ − Q ~y )
d∆u
~ ~ ~ ~
= P r − D ∆u − N y
r k k
where
Pr = e1T ( H T H + λI ) −1 H T
~ ~
Dk = Pr P
~ ~
N k = Pr Q
MSc ACS6012: MPC Department of Automatic
Control and Systems
Engineering
53
Control law in z-
transforms
Eliminate the filtered variables using
~
∆u = ∆ u ~
; y= y
T t
~ ~ ~ ~
∆uk = Pr r − Dk ∆u − N k y
∆u ( z ) y( z)
−1 ~ ~
[T ( z ) + z Dk ( z ) ] = Pr r − N k ( z )
T T
~ ~
Dk ( z ) N k ( z)
∆u ( z ) = Pr r − y
T T
MSc ACS6012: MPC Department of Automatic
Control and Systems
Engineering
54
Closed-loop poles –
T-filter
In simplified terms, the loop controller
and hence poles are:
~
Nk b
K = ~ ;G = and ( pc = 0) ≡ (1 + GK = 0)
Dk ∆ a
~ ~
Dk ∆a + bN k = pc
I 0 L ∆u 1
− I 0 1
∆u + uk −1 ≤ − L ∆u ; L =
E L Lu
− E − L − Lu 1
Where E is lower triangular matrix of ones.
C∆u ≤ d ; d = d ( x, u , u ,...)
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.
J k = ∑ i =1 (rk + i − yk + i ) + λ ∑ i = o ∆u
MSc ∞ ACS6012: MPC 2 ∞ 2
Department of Automatic
Control and Systems
k +i
Engineering
82
With infinite horizons,
J is Lyapunov (b)
1. Now compare the cost at subsequent sampling
instants, assuming one uses the tail.
Jk = ∑ e + λ ∑i =o ∆u k2+ i|k
∞ 2 ∞
i =1 k + i|k
J k +1 = J k − ek2+1|k − λ∆uk2|k
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 steady-state. Moreover, one can always
re-optimise at each sample to make K even smaller
still.
MSc ACS6012: MPC 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.
⇒
A SA = ∑i =1 ( Ai )T Ai = S − I
T ∞
nc m Terminal
oves State
max
imu
m
Decision variables
Future outputs
K Model
r
CLOSED LOOP
PREDICTION
M
MSc ACS6012: MPC Department of Automatic
Control and Systems
Engineering
89
Stability and dual
mode paradigm
Historically: Now:
1. academics spent a 1. most people advise
lot of time discussing
the tuning and the dual mode
stability of MPC. paradigm.
2. it was thought that 2. the tuning parameter
input/output horizons is the terminal control
and control law.
weighting were
‘tuning’ parameters. 3. the ‘control horizon’
3. there were few affects feasibility and
stability results. computational load.
nc=1
nc=2
nc=3
MSc
J
ACS6012: MPC
= ∑ k Λck ;Department
c
k =0
T
Λ > 0of Automatic
Control and Systems
Engineering
96
Constraint handling
regions
x ∈ Si ⇒ c = − K i x + pi
MSc ACS6012: MPC Department of Automatic
Control and Systems
Engineering
102
Illustration of
regions (b)
The JISC logo is licensed under the terms of the Creative Commons Attribution-Non-Commercial-No 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.