ECE5590 MPC Problem Formulation
ECE5590 MPC Problem Formulation
An Application Example
– This sequence will always decay to zero for the stable case.
! The first N values of the infinite series give a finite impulse response
which will capture the main process dynamics.
! A FIR model can be viewed as a representation of the discrete-time
pulse response (expected value of the output y in response to a
single unit pulse u).
! This model generalizes easily to the multi-input-multi-output (MIMO)
case by use of appropriate matrices.
Step Response
! Integrating the unit pulse response will give the unit step response,
c 2010-2015, M. Scott Trimboli
Lecture notes prepared by M. Scott Trimboli. Copyright "
ECE5590, Model Predictive Control Problem Formulation 4–4
X
1
h.z/ D hi z #1
i D1
where
g.z/
h.z/ D
4.z/
and 4.z/ is the one-step difference operator, 1 # z #1.
! The following plot shows the relationship between the impulse and
step response.
h4 = h3 + g 4
h3 g4
Transfer Function
N OTE: Performing the long division b.z/=a.z/ will yield the corresponding
unit pulse response g.z/.
State-Space
x.0/ D 0
c 2010-2015, M. Scott Trimboli
Lecture notes prepared by M. Scott Trimboli. Copyright "
ECE5590, Model Predictive Control Problem Formulation 4–6
x.1/ D B
x.2/ D AB
x.3/ D A2B
:::
x.n/ D An#1B
S OLUTION .
h i
! We have n D 2 and 0m D 0 0 .
c 2010-2015, M. Scott Trimboli
Lecture notes prepared by M. Scott Trimboli. Copyright "
ECE5590, Model Predictive Control Problem Formulation 4–9
! Then,
x.k C 1/ D Ax.k/ C B4u.k/
y.k/ D C x.k/
where
2 3
" 1 1 0 #
6
Am 0Tm 7
AD D40 1 05
CmAm I
1 1 1
2 3
" # 0:5
Bm 6 7
BD D4 1 5
CmBm
0:5
h i h i
C D 0m 1 D 0 0 1
! We will first develop the case for a simple SISO system for which the
states are directly measureable.
P REDICTION .
! Future state variables:
x.ki C 1jki / D Ax.ki / C B4u.ki /
x.ki C 2jki / D Ax.ki C 1jki / C B4u.ki C 1/
D A2x.ki / C AB4u.ki / C B4u.ki C 1/
:::
x.ki C Np jki / D ANp x.ki / C ANp #1B4u.ki / C ANp #2B4u.ki C 1/
C : : : C ANp #Nc B4u.ki C Nc # 1/
! Predicted outputs:
y.ki C 1/ D CAx.ki / C CB4u.ki /
y.ki C 2/ D CA2x.ki / C CAB4u.ki / C CB4u.ki C 1/
y.ki C 3/ D CA3x.ki / C CA2B4u.ki / C CAB4u.ki C 1/
C CB4u.ki C 2/
:::
y.ki C Np jki / D CANp x.ki / C CANp #1B4u.ki / C CANp #2B4u.ki C 1/
C : : : C CANp #Nc B4u.ki C Nc # 1/
2 3
y.ki C 1/ j ki
6 7
6 y.ki C 2/ j ki 7
6 7
Y D6
6 y.ki C 3/ j ki
7
7
6 ::: 7
4 5
y.ki C Np / j ki
! Gather future input increments into the vector
2 3
4u.ki /
6 7
6 4u.ki C 1/ 7
6 7
4U D 6 4u.ki C 2/ 7
6
7I
6 ::: 7
4 5
4u.ki C Nc # 1/
! Now we can write
Y D F x.ki / C ˆ4U
where
2 3 2 3
CA CB 0 0 $$$ 0
6 7 6 7
6 CA2 7 6 CAB CB 0 $$$ 0 7
6 7 6 7
6 3 7
F D 6 CA 7 I ˆD6 CA2B $$$ 7
6 CAB CB 0 7
6 :: 7 6 ::: 7
4 : 5 4 5
CANp CANp #1B CANp #2B CANp #3B $ $ $ CANp #Nc B
O PTIMIZATION .
! For a given set-point signal r.ki / at sample time ki , the objective is to
find the best control parameter 4U such that an error function is
minimized.
! Define
2 3
1
6 7
617
Rs D 6 7
6 ::: 7 r.ki /
4 5
1
! Then we can define a cost function J as
J D .Rs ! Y /t .Rs ! Y / C 4U tR4U
J D .Rs #F x.ki //t .Rs #F x.ki //#24U t ˆT .Rs #F x.ki //C4U t .ˆT ˆCR/4U
to give
@J
D #2ˆT .Rs # F x.ki // C 2.ˆT ˆ C R/4U D 0
@4U
! Solving,
Example
! Determine the optimal solution 4U ' for the cases: 1) R D Œ0" and 2)
R D 10 $ I , where R is the weighting on the control input.
S OLUTION .
! Form the augmented state-space system:
" # " #" # " #
4x m.k C 1/ a 0 4x m.k/ b
D C 4u.k/
y.k C 1/ a 1 y.k/ b
" #
h i 4x .k/
m
y.k/ D 0 1
y.k/
! Therefore, F and ˆ take the following form:
2 3 2 3
CA CB 0 0 0
6 7 6 7
6 CA2 7 6 CAB CB 0 0 7
6 7 6 7
6 CA3 7 6 CA2B CAB 7
6 7 6 CB 0 7
6 CA4 7 6 CA3B CA2B 7
6 7 6 CAB CB 7
6 7 6 7
6 CA5 7 6 CA4B CA3B CA2B CAB 7
F D6 7 6
6 CA6 7 I ˆ D 6 CA5B CA4B
7
7
6 7 6 CA3B CA2B 7
6 7 6 7
6 CA 7
7 6 CA6B CA5B CA4B CA3B 7
6 7 6 7
6 CA8 7 6 CA7B CA6B CA5B CA4B 7
6 7 6 7
6 9 7 6 7
4 CA 5 4 CA8B CA7B CA6B CA5B 5
CA10 CA9B CA8B CA7B CA6B
! Note that the elements of ˆ comprise the discrete pulse response of
the system arranged in the form of a Toeplitz matrix.
! Substituting values we obtain:
2 3
1:1541 1:0407 0:91160:7726
6 7
6 1:0407 0:9549 0:84750:7259 7
ˆT ˆ D 6
6 0:9116 0:8475
7
4 0:76750:6674 7
5
0:7726 0:7259 0:66740:5943
2 3 2 3
9:2325 3:2147 3:2147
6 7 6 7
6 8:3259 2:7684 7 6 2:7684 7
T
ˆ F D66 7I T 6
ˆ Rs D 6 7
7 7
4 7:2927 2:3355 5 4 2:3355 5
6:1811 1:9194 1:9194
! For case 1) where R D Œ0", the optimal input sequence is
2 3
7:2
6 7
6 #6:4 7
4U D .ˆT ˆ/#1.ˆT Rs # ˆT F x.ki // D 6 6 0 7
7
4 5
0
2 3
#0:96
6 7
6 0 7
4U D .ˆT ˆ/#1.ˆT Rs # ˆT F x.12// D 6
6
7
4 0 7 5
0
! Continuing,
x m.13/ D ax m.12/ C bu.12/ D 1:0
y.13/ D 1:0
! We’ve shown that at a given time ki , the optimal control input vector
4U is solved from
4U D .ˆT ˆ C R/ N #1.ˆT Rs # ˆT F x.ki //
f .k C 1/ D A x
x m m fm .k/ # Kob Cm x
f .k/
m
D .Am # Kob Cm/x
f .k/
m
– Let’s set the observer poles at 0:1 and 0:2 for good convergence
speed.
– Equating the above expression to the desired closed cloop
characteristic equation for the observer, namely
.! # 0:9801/.! C $2 # :9801/ # :3973 ( .$1 # :0993/ D .! # 0:1/.! # 0:2/
where
Q
x.k/ D x.k/ # x.k/
O
Example
c 2010-2015, M. Scott Trimboli
Lecture notes prepared by M. Scott Trimboli. Copyright "
ECE5590, Model Predictive Control Problem Formulation 4–28
! Place the observer poles at: 0:01, 0:0105, 0:011 to give fast dynamic
response.
! The open-loop plant has three eigenvalues at one (by inspection), two
from the double-integrator and one from the embedded integrator
structure. Using the Matlab function place, we find the observer gains
from:
h i
Pole D 0:01 0:0105 0:011 I
! "
Kob D place A C Pole 0I
0 0
which gives,
2 3
1:9685
6 7
Kob D 4 0:9688 5
2:9685
! Using the given performance parameters, the state feedback
controller gain is computed to be,
h i
Kmpc D 0:8984 1:3521 0:4039