Date post: | 19-Jan-2015 |
Category: |
Devices & Hardware |
Upload: | jarossiter |
View: | 1,548 times |
Download: | 0 times |
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
Predictive control
Anthony RossiterDepartment of Automatic Control
and Systems Engineering
University of Sheffieldwww.shef.ac.uk/acse
© University of Sheffield 2009 This work is licensed under a
Creative Commons Attribution 2.0 License.
ACS6012: MPCMSc 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: MPCMSc 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: MPCMSc 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. MultivariableHaving reviewed these components, we can talk about algorithm design and tuning.
The key to effective
implementation is real
understanding of how MPC works!
ACS6012: MPCMSc 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: MPCMSc Department of Automatic Control and Systems
Engineering
6
Illustration
Road
CAR
Horizon
ACS6012: MPCMSc 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: MPCMSc Department of Automatic Control and Systems
Engineering
8
Illustration of initial prediction
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
9
Illustration
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
10
Illustration
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
11
What do we learn
• Did not observe all constraints at outset – ended up in a dead-end (or DEAD).
• If had re-optimised 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: MPCMSc 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: MPCMSc 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: MPCMSc 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: MPCMSc 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: MPCMSc Department of Automatic Control and Systems
Engineering
16
Summary – well posed MPC1. 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.
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: MPCMSc 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: MPCMSc 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: MPCMSc 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: MPCMSc 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.
PxuHy
ACS6012: MPCMSc 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: MPCMSc 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 steady-state. [See notes]
......,,
......,,
1
11
ksskk
kkkk
uuuu
uuuu
u
u
Change in control
Distance from expected steady-state
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
23Prediction 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.
PxuHy
ACS6012: MPCMSc 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: MPCMSc 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 T-filter).
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
26
Prediction illustrations in lecture1. Steps for ARMA prediction with
summary.
2. Extension to MIMO.
3. Prediction with state space
ACS6012: MPCMSc 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 un
i
n
i iii uyrJ1
1
0
22)(
ACS6012: MPCMSc 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
uPxuHr
uyrJ
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
29
Gradient operations
A quick review of differentiation of vector variables. Let
Then
xAAxAxxdx
da
a
a
a
xadx
d
xadx
d
xadx
d
xadx
d TT
nT
n
T
T
T
)(;
)(
)(
)(
)( 2
1
2
1
Tn
Tn xxxaaa ],...,[;],...,[ 11
ACS6012: MPCMSc 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
PxrHIHHuud
dJ
urPxuHHud
dJ
uPxuHrJ
TT
T
ACS6012: MPCMSc 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.
KxrP
PxrPPxrHIHHeueu
r
r
TTTT
)()()( 1
11
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
32
Control law
Take the first component of the input
QPN
PPD
HIHHeP
where
yNuDrP
yQuPrP
yQuPrHIHHeueu
rk
rk
TTTr
kkr
r
TTTT
11
111
)(
)(
)()(
ACS6012: MPCMSc 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.
yzNrPzuD
zyzNyN
zuzDu
uDD
u
uD
NNNDDD
yNuDrPu
krk
kk
kk
nk
k
moknk
kkrk
)()(
)()(
)()(]...,,1[],1[
],...,[];...,[
,1
,1
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
34
Closed-loop poles
As the control law is fixed and linear, we can find the equivalent closed-loop poles.
In simplified terms, the loop controller and hence poles are:
Warning: b(z) will contain a delay.
ckk
ck
k
pbNaD
GKpanda
bG
D
NK
)01()0(;
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
35
Closed-loop poles
As the control law is fixed and linear, we can find the equivalent closed-loop poles.
In simplified terms, the loop controller and hence closed-loop system are:
xBKAxBuAxx
Kxu)(
ACS6012: MPCMSc 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: MPCMSc 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
open-loop behaviour. WHY?• Control weighting is only effective if the output
horizon is close to the settling time. WHY?• How many closed-loop poles are there?
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
38
GPC may not always be good
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
39
Problems with GPC1. 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 closed-loop behaviour that arises.
We leave aside issues about whether the tuning parameters are intuitive for technical engineers. PFC proposes tuning by time constants.
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
40
Optimised predictions with different nu (1,2, )
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
41
Optimised predictions one sample later
Optimum at t
Optimum at t+1
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
42ny=50,nu=1,Wu=0.1
0 5 10 15 20 25 30 35 40 45 50-1
0
1
2
3
Inpu
t in
crem
ents
0 5 10 15 20 25 30 35 40 45 500
0.5
1
1.5
Out
puts
Samples
Prediction
Closed-loop
LQR optimalInput not close to
optimum!
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
43
0 5 10 15 20 25 30 35 40 45 50-2
-1
0
1
2
3In
put
incr
emen
ts
0 5 10 15 20 25 30 35 40 45 500
0.5
1
1.5
Out
puts
Samples
Prediction
Closed-loop
LQR optimal
ny=50,nu=2,Wu=0.1
Input not close to
closed-loop!
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
44
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 50
0.2
0.4
0.6
0.8
1
Inpu
t in
crem
ents
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 50
0.05
0.1
0.15
0.2
0.25
Out
puts
Samples
Prediction
Closed-loop
LQR optimal
ny=5,nu=1,Wu=1
Input not close to
optimum!
ACS6012: MPCMSc Department of Automatic 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 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: MPCMSc Department of Automatic Control and Systems
Engineering
46
PFC approachesIdeal path (not
actual)
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
47
The T-filter
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 anti-filter back to original domain.
ACS6012: MPCMSc 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: MPCMSc 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 low-pass, it filters out high freq. and hence improves quality.
yQuPuHy
yQuPuHy
~~~~
ACS6012: MPCMSc 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 yHyCyoryyHyC
yyTT
yy
TTTT
yQuPuHuHCyHyC
yQuPuHy
TTTT~~]~[]~[
~~~~
11
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
51
Optimising J with a T-filter
Modify J to take appropriate prediction
)~~~~()(0
~~~~
1
2
2
2
2
yQuPrHIHHuud
dJ
uyQuPuHrJ
TT
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
52
Control law
Modify control law accordingly
QPN
PPD
HIHHeP
where
yNuDrP
yQuPrHIHHeueu
rk
rk
TTTr
kkr
TTTT
~~
~~)(
~~~~)~~~~
()(
11
111
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
53
Control law in z-transforms
Eliminate the filtered variables using
yT
zNrPzu
T
zD
T
zyzNrP
T
zuzDzzT
yNuDrPu
kr
k
krk
kkrk
)(~
)()(
~
)()(
~)(]
~)([
~~~~
1
tyyT
uu ~;~
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
54
Closed-loop poles – T-filter
In simplified terms, the loop controller and hence poles are:
NOTE: In fact the poles will include T(z) as a factor (see notes).
ckk
c
k
k
pNbaD
GKpanda
bG
D
NK
~~
)01()0(;~
~
ACS6012: MPCMSc 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 T-filter? How can it be selected?
3. How can sensitivity be measured?
We give some introductory views on these issues.
ACS6012: MPCMSc 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: MPCMSc 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
kG
G
p
bNS
GK
GKS
GK
GKGK
GKGKGK
GKGK
10)
11)(1(
0)1())1(1(
))1(1()1(
ACS6012: MPCMSc 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
kud
c
kyd
k
k
p
aN
GK
KS
p
aD
GKS
D
NK
a
bG
1;
1
1
;
ACS6012: MPCMSc 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: MPCMSc Department of Automatic Control and Systems
Engineering
60
Impact of the T-filter on sensitivity
1. T-filter 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.
Tp
NaS
p
aNS
Tp
DaS
p
aDS
Tp
NbS
p
bNS
c
kud
c
kud
c
kydT
c
kyd
c
kGT
c
kG
~:
~:
;~
:
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
61
Other ways of changing sensitivity
1. The T-filter 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: MPCMSc 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!
)(
)()(
;;
unchangedaDbNp
bQDaQaNbp
QaNN
bQDD
aDbNprp
aur
p
by
kkc
kkc
kk
kk
kkccc
ACS6012: MPCMSc 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: MPCMSc 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 anti-filter 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: MPCMSc 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: MPCMSc Department of Automatic Control and Systems
Engineering
66
Typical constraints
Systems often have limits on:1. Inputs2. Input rates3. Outputs4. StatesThese 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: MPCMSc 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
uuu
uuu
uuu
uunk
k
k
nk
k
k
1
1
1
1
0
0
1
1
0
0
0
1
0
010
001
ACS6012: MPCMSc 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
uuu
uuu
uuu
k
nk
k
k
nk
k
k
uu
1
1
1
1
1
1
1
1
1
1
0
0
1
1
0
1
1
1
1
011
001
ikkkkik uuuuu 11
ACS6012: MPCMSc 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
uL
uL
uL
uL
u
L
Lu
E
E
I
I
k
ACS6012: MPCMSc 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: MPCMSc 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
yx
P
Pu
H
H
or
yPxuHyy
ACS6012: MPCMSc 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.
,...),,(; uuxddduC
ACS6012: MPCMSc 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.
duCtsuPxuHrJu
..min2
2
2
2
ACS6012: MPCMSc 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: MPCMSc 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 closed-loop system be stable?
c. what happens when constraints are included?
ACS6012: MPCMSc 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: MPCMSc 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: MPCMSc 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: MPCMSc 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: MPCMSc Department of Automatic Control and Systems
Engineering
80
Summary
1. Infinite horizons and the inclusion of the tail guarantee closed-loop stability (nominal case).
2. There is no need to compute the closed-loop poles.
3. The proof applies even in the presence of constraints and therefore extends to nonlinear behaviour.
Proof given next.
ACS6012: MPCMSc 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
Tknkkkkk
Tknkkkkk yyyyuuuu ],,,,[;],,,,[ ||2|1||1|
Tknkkk
Tknkkk
Tknkkk
Tknkkk
yyyy
uuuu
],,,[],,,[
],,,[],,,[
||21|1|2
||11|1|1
1
22)(i oi ikikikk uyrJ
ACS6012: MPCMSc 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 steady-state. Moreover, one can always re-optimise at each sample to make K even smaller still.
1
2|1
2|11
1
2|
2|
i oi kikkikk
i oi kikkikk
ueJ
ueJ
2|
2|11 kkkkkk ueJJ
ACS6012: MPCMSc 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: MPCMSc 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: MPCMSc Department of Automatic Control and Systems
Engineering
85
Are infinite horizons impractical1. You need a Lyapunov equation to sum the
errors over an infinite horizon.
2. This is straightforward when the prediction dynamics are linear.
ISAASAA
AASSxxJ
xAAxxxJAxx
i
iTiT
i
iTik
Tk
kiTiT
kikTikkk
1
0
1
)(
)(;
)(;
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
86Different ways of implementing infinite horizons
1. People usually use dual-mode 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: MPCMSc Department of Automatic Control and Systems
Engineering
87
Dual mode paradigm (or closed-loop prediction)
Terminal region in which the control law u=-Kxsatisfies constraints.
Initial state
trajectory
nc moves maximum
Terminal State
In at most nc samples, predictedstate moves into the terminalregion while satisfying constraints.
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
88
Open and closed-loop prediction
ModelFuture inputs Future outputsOPEN LOOP
PREDICTION
Model
M
KFuture outputs
r
Decision variables
CLOSED LOOP PREDICTION
ACS6012: MPCMSc 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: MPCMSc 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: MPCMSc Department of Automatic Control and Systems
Engineering
91Feasible regions for nc=1,2,3
nc=3
nc=2
nc=1
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
92
Terminal region variation with different feedback gains
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
93What 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 (open-loop) as industrial practise has favoured large output horizons (effectively equivalent to infinity).
2. Will be less effective when open-loop behaviour is poor.
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
94
Closed-loop prediction
Current thinking is that, ordinarily, one should predict in the closed-loop.
1. Better conditioned predictions and embeds desired behaviour.
2. Predictions automatically close to desired behaviour, more robust optimisation.
3. Especially important for open-loop unstable plant.4. Makes tuning more straightforward.5. Handling feasibility can be easier.
NOTE: Differs from DMC which assumes default behaviour is open-loop dynamics.PFC partially meets this aim (uses open-loop predictions but matches to a desired dynamic).
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
95
Closed-loop MPC algorithm
Standard MPC objective
Decision variables are perturbations ck to control trajectory
J is equivalent to
0k
kTkk
Tk QuuQxxJ
1
0
0;cn
kk
Tk ccJ
ckk
ckkk
nkKxu
nkcKxu
1,,1,0
Nominal behaviour
Ideally c =0
ACS6012: MPCMSc 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
11 ;
cnk
k
k
k
nk
k
k
c
c
c
ccHPx
x
x
x
}:{ dcNMxxS kk
ACS6012: MPCMSc 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:
dcNMxtsccJ kDT
c ..min
ceccKxu Tkkkk 1;
More detail of these computations are in the handout.
ACS6012: MPCMSc 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 re-use old decisions, one can continue to ride on good policies to convergence.
Optimise around ‘good’ trajectories, therefore well conditionned.
No dead ends!
ACS6012: MPCMSc 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: MPCMSc 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: MPCMSc Department of Automatic Control and Systems
Engineering
101Illustration of regions
Each region has a different control law
iii pxKcSx
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
102
Illustration of regions (b)
ACS6012: MPCMSc 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 Look-up table]
ACS6012: MPCMSc Department of Automatic Control and Systems
Engineering
104
Conclusion1. 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: MPCMSc 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: MPCMSc 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 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.