You are on page 1of 26

Lecture 14 - Model Predictive Control

Part 1: The Concept


History and industrial application resource:
Joe Qin, survey of industrial MPC algorithms
http://www.che.utexas.edu/~qin/cpcv/cpcv14.html

Emerging applications
State-based MPC
Conceptual idea of MPC
Optimal control synthesis

Example
Lateral control of a car

Stability
Lecture 15: Industrial MPC
EE392m - Spring 2005
Gorinevsky

Control Engineering

14-1

MPC concept
MPC = Model Predictive Control
Also known as
DMC = Dynamical Matrix Control
GPC = Generalized Predictive Control
RHC = Receding Horizon Control

Control algorithms based on


Numerically solving an optimization problem at each step
Constrained optimization typically QP or LP
Receding horizon control

More details need to be worked out for implementation

EE392m - Spring 2005


Gorinevsky

Control Engineering

14-2

Receding Horizon Control


Receding Horizon Control concept
future input trajectory

prediction horizon

Plant

RHC

predicted future output

Plant
Model
current dynamic
system states

prediction horizon

At each time step, compute control by solving an openloop optimization problem for the prediction horizon
Apply the first value of the computed control sequence
At the next time step, get the system state and re-compute
EE392m - Spring 2005
Gorinevsky

Control Engineering

14-3

Current MPC Use


Used in a majority of existing multivariable control
applications
Technology of choice for many new advanced multivariable
control application
Success rides on the computing power increase
Has many important practical advantages

EE392m - Spring 2005


Gorinevsky

Control Engineering

14-4

MPC Advantages
Straightforward formulation, based on well understood
concepts
Explicitly handles constraints
Explicit use of a model
Well understood tuning parameters
Prediction horizon
Optimization problem setup

Development time much shorter than for competing


advanced control methods
Easier to maintain: changing model or specs does not require
complete redesign, sometimes can be done on the fly
EE392m - Spring 2005
Gorinevsky

Control Engineering

14-5

History
First practical application:
DMC Dynamic Matrix Control, early 1970s at Shell Oil
Cutler later started Dynamic Matrix Control Corp.

Many successful industrial applications


Theory (stability proofs etc) lagging behind 10-20 years.
See an excellent resource on industrial MPC
Joe Qin, Survey of industrial MPC algorithms
history and formulations
http://www.che.utexas.edu/~qin/cpcv/cpcv14.html

EE392m - Spring 2005


Gorinevsky

Control Engineering

14-6

Some Major Applications

From Joe Qin, http://www.che.utexas.edu/~qin/cpcv/cpcv14.html


1995 data, probably 1-2 order of magnitude growth by now
EE392m - Spring 2005
Gorinevsky

Control Engineering

14-7

Emerging MPC applications


Nonlinear MPC
just need a computable model (simulation)
NLP optimization

Hybrid MPC
discrete and parametric variables
combination of dynamics and discrete mode change
mixed-integer optimization (MILP, MIQP)

Engine control
Large scale operation control problems
Operations management (control of supply chain)
Campaign control

EE392m - Spring 2005


Gorinevsky

Control Engineering

14-8

Emerging MPC applications


Vehicle path planning and control
nonlinear vehicle models
world models
receding horizon preview

EE392m - Spring 2005


Gorinevsky

Control Engineering

14-9

Emerging MPC applications


Spacecraft rendezvous with space station
visibility cone constraint
fuel optimality

Underwater vehicle guidance

From Richards & How, MIT

Missile guidance

EE392m - Spring 2005


Gorinevsky

Control Engineering

14-10

State-based control synthesis


Consider single input system for better clarity
x (t + 1) = Ax (t ) + Bu(t )
y (t ) = Cx(t )
Infinite horizon optimal control

( y ( ) )

=t +1

+ r (u ( ) u( 1) ) min
2

subject to : u( ) u0
Solution = Optimal Control Synthesis

EE392m - Spring 2005


Gorinevsky

Control Engineering

14-11

State-based MPC concept


x2

Optimal
control
trajectories

x1
t>N
Optimal control trajectories converge to (0,0)
If N is large, the part of the problem for t > N can be neglected
Infinite-horizon optimal control horizon-N optimal control
EE392m - Spring 2005
Gorinevsky

Control Engineering

14-12

State-based MPC
Receding horizon control; N-step optimal

J =

t+N

( y ( ) )

=t +1

+ r (u ( ) u ( 1) ) min
2

subject to : u( ) u0 ,
x (t + 1) = Ax (t ) + Bu (t )
y (t ) = Cx (t )
Solution Optimal Control Synthesis

x (t ) [MPC Problem Solver] u(t )


EE392m - Spring 2005
Gorinevsky

Control Engineering

14-13

Predictive Model
Predictive system model

Y = Gx + HU + Fu

initial condition response + control response

Predicted output

Future control input

y (t + 1)
u (t + 1)

Y =
M
U
=
M

y (t + N )
u(t + N )
Model matrices
CA
G= M

n
CA

0
0
CB
0
H =
M
M
N 2
N 3
CA B CA B

EE392m - Spring 2005


Gorinevsky

x = x (t )
u = u (t ) computed at

0
K 0 h (1)
h (1)
K 0 h ( 2 )
=
M
O M M

K 0 h( N ) h( N 1)
Control Engineering

Current state
(initial condition)

the previous step

0
0

O M

K h(1)
K
K

h ( 2)
h (3)

F=
M

(
+
1
)
h
N

14-14

Computations Timeline
Computed at the previous step
u(t) x(t)

u(t+1) x(t+1)
Compute control based
on x(t). Apply it

t+1

time

Assume that control u is applied and the state x is


sampled at the same instant t
Entire sampling interval is available for computing u

EE392m - Spring 2005


Gorinevsky

Control Engineering

14-15

MPC Optimization Problem Setup


MPC optimization problem

J = Y T Y + rU T D T DU min
subject to : U u0 ,
Y = Gx + HU + Fu

1st difference matrix


1 1
0 1
D=
M M

0 0

K 0
K 0

O M

K 0

This is a QP problem
Solution

x (t ) [MPC Problem, QP Solver] U u(t + 1) = U (1)


EE392m - Spring 2005
Gorinevsky

Control Engineering

14-16

QP solution
QP Problem:
AU b
1
J = U T QU + f T U min
2
T

Q = rD D + H H
f = H T (Gx + Fu )

I
A=
I

U = U (t ) Predicted
control
sequence

1
b = M u0

Standard QP codes can be used

EE392m - Spring 2005


Gorinevsky

Control Engineering

14-17

Linear MPC
Nonlinearity is caused by the constraints
If constraints are inactive, the QP problem solution is
U = Q 1 f

u = l TU

This is linear state feedback


1
T
T
T
u (t + 1) = l (rD D + H H ) H T (Gx (t ) + Fu (t ) )

1
0
l=
M

0

u = z 1 Kx + z 1 Su

K = l T (rD T D + H T H ) H T G
1

S = l T (rD T D + H T H ) H T F
1

Can be analyzed as a linear system, e.g., check eigenvalues


z 1
u=
Kx
zx = Ax + Bu
1
1 Sz
EE392m - Spring 2005
Gorinevsky

Control Engineering

14-18

Nonlinear MPC Stability


Theorem - from Bemporad et al (1994)
Consider a MPC algorithm for a linear plan with constraints. Assume
that there is a terminal constraint
x(t + N) = 0 for predicted state x and
u(t + N) = 0 for computed future control u
If the optimization problem is feasible at time t,
then the coordinate origin is stable.

Proof.
Use the performance index J as a Lyapunov function. It decreases
along the finite feasible trajectory computed at time t. This
trajectory is suboptimal for the MPC algorithm, hence J decreases
even faster.
EE392m - Spring 2005
Gorinevsky

Control Engineering

14-19

MPC Stability
The analysis could be useful in practice
Theory says a terminal constraint is good

MPC stability formulations


(Mayne et al, Automatica, 2000)
Terminal equality constraint
Terminal cost function
Dual mode control infinite horizon

Terminal constraint set


Increase feasibility region

Terminal cost and constraint set


EE392m - Spring 2005
Gorinevsky

Control Engineering

14-20

Example: Lateral Control of a Car


y
lateral
displacement

u
V
Lane direction
Preview horizon

Preview Control MacAdams driver model (1980)


Consider predictive control design
Simple kinematical model of a car driving at speed V
x& = V cos a
y& = V sin a
lateral displacement
a& = u
steering
EE392m - Spring 2005
Gorinevsky

Control Engineering

14-21

Lateral Control of a Car - Model


y

Lateral displacement

a(t)

u(t)

y(t)
x

Assume a straight lane tracking a straight line


Linearized system: assume a << 1
sin a a
y& = Va
cos a 1
a& = u
Sampled-time equations (sampling time Ts)

a (t + 1) = a (t ) + u(t )Ts
y (t + 1) = y (t ) + a (t )VTs + u(t ) 0.5VTs
EE392m - Spring 2005
Gorinevsky

Control Engineering

2
14-22

Lateral Control of a Car - MPC


State-space system:

x (t + 1) = Ax (t ) + Bu(t )

a (t )
1
x (t ) =
A=

y (t )
VTs
Observation: y (t ) = Cx(t )
Formulate predictive model

0
,

Ts
B=
2
0
.
5
VT
s

C = [0 1]

Y = Gx + HU + Fu
MPC optimization problem
T
J = (Gx + HU + Fu ) (Gx + HU + Fu ) + rU T D T DU min
subject to : U u0 ,
Solution:
EE392m - Spring 2005
Gorinevsky

x (t ) [MPC QP] U u(t + 1) = U (1)


Control Engineering

14-23

Impulse Responses
IMPULSE RESPONSE FOR LATERAL ERROR

20

15

10

10

12

14

16

18

20

16

18

20

IMPULSE RESPONSE FOR HEADING ANGLE

5
4
3
2
1
0

EE392m - Spring 2005


Gorinevsky

10

12

Control Engineering

14

14-24

Lateral Control of a Car - Simulation


Simulation
Results:

HEADING ANGLE (deg)

0
-0.5
-1
-1.5
-2

V = 50 mph
Sample time
of 200ms
N = 20
All variables
in SI units
r=1

LATERAL ERROR

0.5

STEERING CONTROL (deg/s)

1
0.5
0
-0.5
-1

EE392m - Spring 2005


Gorinevsky

Control Engineering

4
TIME (sec)

14-25

Control Design Issues


Several important issues remain
They are not visible in this simulation
Will be discussed in Lecture 15 (MPC, Part 2)

All states might not be available


Steady state error
Need integrator feedback

Large angle deviation


linearized model deficiency
introduce soft constraint

EE392m - Spring 2005


Gorinevsky

Control Engineering

14-26

You might also like