3-1
3-2
1
X
i=0
optimization variables
i = 0, . . . , N
1,
mode 1
Kxi|k
i = N, N + 1, . . .
3
mode 2
u0|k
6
7
uk = 4 ... 5
uN 1|k
mode 1:
mode 2:
ui|k = Kxi|k
uk optimized online
K chosen oine
3-3
1
X
i=N
(A + BK)T P (A + BK) = Q + K T RK
3-4
N
X1
i=0
uTk Huk
Fx
uT Hu + 2xT F T u
subject to Ac u bc + Bc x
=) nonlinear controller: uk = KMPC (xk )
3-5
1.1
A=
0
yk = Cxk
2
0
1
, B=
, C=
0.95
0.0787
1 uk 1
Constraints:
subject to
N
X1
i=0
1 ui|k 1, i = 0, . . . , N
Q = C T C, R = 0.01, N = 2
. . . performance? stability?
3-6
0
0.5
1
0
20
40
20
40
60
80
100
60
80
100
60
80
100
60
80
100
50
0
y
50
100
150
200
sample, k
unstable
3-7
0
0.5
1
0
20
40
20
40
4
2
0
2
sample, k
stable, but . . .
3-8
70
60
50
40
30
20
10
0
20
40
60
80
100
sample, k
Stability analysis
How can we guarantee the closed loop stability of MPC?
(a). Show that a Lyapunov function exists demonstrating stability
(b). Ensure that optimization feasible is at each time k = 0, 1, . . .
B For Lyapunov stability analysis:
? consider first the unconstrained problem
? use predicted cost as a trial Lyapunov function
B Guarantee feasibility of the MPC optimization recursively
by ensuring that feasibility at time k =) feasibility at k + 1
3 - 10
3 - 11
3 - 12
Lyapunov stability
Trial Lyapunov function:
J (xk ) = J(xk , uk )
where J(xk , uk ) =
1
X
i=0
3 - 13
Lyapunov stability
Construct a bound on J (xk+1 )
0 1
tail at k + 1
optimal at k
uk = 6
xk = 6 7
7
6uN 1|k 7
6 xN |k 7
6
7
6 7
6 KxN |k 7
6 xN |k 7
i
4
5
4
5
..
..
.
.
(
3 - 14
= A + BK)
Lyapunov stability
Construct a bound on J (xk+1 )
tail at k + 1
0 1
optimal at k
optimal at k :
tail at k + 1 :
J (xk ) =
J(xk , uk )
k+1 ) = J(xk+1 , u
k+1 )
J(x
1
X
i=0
1
X
i=1
= A + BK)
3 - 14
Lyapunov stability
Construct a bound on J (xk+1 )
kxk k2Q
kuk k2R
3 - 15
kxk k2Q
kuk k2R
Lyapunov stability
The bound J (xk+1 )
1
J (xk )
the closed loop cost cannot exceed the initial predicted cost,
since summing both sides over all k 0 gives
1
X
k=0
kxk k2Q
x = 0 is asymptotically stable
? if R 0 and Q
? if R
(a). stability of x = 0
(b).
lim
k!1
(kxk k2Q
kuk k2R )
3 - 16
Stability analysis
How can we guarantee the closed loop stability of MPC?
3 - 17
Terminal constraint
The basic idea
@
@
?
@
R
@
terminal set
origin
OCC
C
stabilizing linear controller satisfies constraints
3 - 18
Terminal constraint
Terminal constraint: xN |k 2 , where = terminal set
xk
x1|k
safe region
for mode 2
control law
xN |k
xN
Choose so that:
(a). x 2
=)
(b). x 2
=)
1|k
xN +1|k
u Kx u
xxx
(A + BK)x 2
u ui|k u
xN |k 2 =)
for i = N, N + 1, . . .
x xi|k x
i.e. constraints are satisfied over
the infinite mode 2 prediction horizon
3 - 19
s.t. u ui|k u, i = 0, . . . , N
x xi|k x, i = 1, . . . , N
xN |k 2
9
1>
=
>
;
3 - 20
Terminal constraints
Make as large as possible so that the feasible set FN is maximized, i.e.
= X1 = lim Xj
j!1
where
? Xj = initial conditions for which constraints are satisfied for j steps
with u = Kx
i
u K(A + BK) x u
= x:
i = 0, . . . , j
x (A + BK)i x x
? X1 = X for some finite if |eig(A + BK)| < 1
+
x 2 X1 if constraints are satisfied on a finite constraint checking horizon
3 - 21
Plant model:
1.1
2
0
A=
B=
C= 1
0 0.95
0.0787
input constraints:
mode 2 feedback law:
1 uk 1
K = 1.19
7.88
= KLQ for Q = C T C, R = 1
3 - 22
Constraints:
0.8
0.6
Kx = 1
0.4
K x=1
x2
0.2
x=1
x=
X2
0.2
K x=
0.4
Kx =
0.6
0.8
5
3 - 23
0
x1
1u1
0.8
0.6
0.4
x2
0.2
0
X1
0.2
0.4
0.6
0.8
5
0
x1
u
kK(A + BK)i k2
! 1 as i ! 1
) X1 is bounded because x0 2
/ X1 if x0 is sufficiently large
Here {x :
3 - 24
Terminal constraints
General case
Xj = {x : F
Let
then:
x 1, i = 0, . . . j} with
strictly stable
( , F ) observable
Proof of (ii)
(a). for any j, Xj+1 = Xj \ x : F
j+1
x1
so Xj Xj+1 limj!1 Xj = X1
(b). if x 2 X+1 whenever x 2 X , then
x 2 X whenever x 2 X
3 - 28
N := N + 1
no
umax ! u ?
and
umin " u ?
yes
N c := N
3 - 26
2 linear programs
solved at each step
Constrained MPC
Define the terminal set as XNc
MPC algorithm
At each time k = 0, 1, . . .
(i). solve
s.t. u ui|k u, i = 0, . . . , N + Nc
x xi|k x, i = 1, . . . , N + Nc
xi|k = (A + BK)i
xN |k
N
xN |k
6
7
8
11 > 11
364.2 357.0 356.3 356.0 356.0
356.0 356.0 356.0 356.0 356.0
P
2
2
Closed loop cost: Jcl (x0 ) := 1
k=0 kxk kQ + kuk kR
3 - 28
predicted
closedloop
1
0.8
0.6
0.4
input, u
0.2
0
0.2
0.4
0.6
0.8
1
0
10
15
time step, k
20
25
30
3 - 29
0.7
0.6
x6|0 -
0.5
0.4
x2
0.3
F6
0.2
0.1
0
0.1
3 - 29
x1
0.7
0.6
0.5
0.4
x2
0.3
x11|0
F6
0.2
0.1
0
-0.1
-8
-7
-6
-5
-4
x1
-3
-2
-1
3 - 29
N1
3 - 30
x2
0.5
F12
0.5
F8
F4
1.5
10
0
x1
10
3 - 31
Summary
? Terminal constraints
3 - 32