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 Control Engineering 14-1
Gorinevsky
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 Control Engineering 14-2


Gorinevsky
Receding Horizon Control
• Receding Horizon Control concept
future input trajectory RHC predicted future output

Plant
Model
prediction horizon
prediction horizon
current dynamic
Plant system states

• At each time step, compute control by solving an open-


loop 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 Control Engineering 14-3
Gorinevsky
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 Control Engineering 14-4


Gorinevsky
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 Control Engineering 14-5
Gorinevsky
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 Control Engineering 14-6


Gorinevsky
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 Control Engineering 14-7
Gorinevsky
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 Control Engineering 14-8


Gorinevsky
Emerging MPC applications
• Vehicle path planning and control
– nonlinear vehicle models
– world models
– receding horizon preview

EE392m - Spring 2005 Control Engineering 14-9


Gorinevsky
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 Control Engineering 14-10


Gorinevsky
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
2
+ r (u (τ ) − u(τ − 1) ) → min
2

subject to : u(τ ) ≤ u0

• Solution = Optimal Control Synthesis

EE392m - Spring 2005 Control Engineering 14-11


Gorinevsky
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 Control Engineering 14-12
Gorinevsky
State-based MPC
• Receding horizon control; N-step optimal
t+N
J =
τ
∑ ( y (τ ) )
=t +1
2
+ 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 Control Engineering 14-13


Gorinevsky
Predictive Model
• Predictive system model

Y = Gx + HU + Fu initial condition response + control response


Predicted output Future control input Current state
⎡ y (t + 1) ⎤ ⎡ u (t + 1) ⎤ (initial condition)
Y =⎢ M ⎥
U = ⎢ M ⎥ x = x (t )
⎢ ⎥ ⎢ ⎥
⎢⎣ y (t + N )⎥⎦ ⎢⎣u(t + N )⎥⎦ u = u (t ) Æcomputed at
the previous step
• Model matrices
⎡ 0 0 K 0⎤ ⎡ h (1) 0 K 0 ⎤ ⎡ h ( 2) ⎤
⎡ CA ⎤ ⎢ CB 0 K 0⎥ ⎢ h ( 2 ) h (1) 0 ⎥ ⎢ h (3) ⎥
G=⎢ M ⎥
K
⎢ ⎥ H =⎢ ⎥=⎢ ⎥ F=⎢ ⎥
⎢ M M O M⎥ ⎢ M M O M ⎥ ⎢ M ⎥
⎢⎣CA ⎥⎦
n
⎢ N −2 N −3 ⎥ ⎢ ⎥ ⎢ ⎥
⎣CA B CA B K 0⎦ ⎣h( N ) h( N − 1) K h(1)⎦ ⎣ h ( N + 1) ⎦
EE392m - Spring 2005 Control Engineering 14-14
Gorinevsky
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 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 Control Engineering 14-15


Gorinevsky
MPC Optimization Problem Setup
• MPC optimization problem 1st difference matrix
⎡1 − 1 K 0⎤
J = Y T Y + rU T D T DU → min ⎢0 1 K 0⎥
D=⎢ ⎥
subject to : U ≤ u0 , ⎢M M O M⎥
⎢ ⎥
Y = Gx + HU + Fu ⎣0 0 K 0⎦

• This is a QP problem

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

EE392m - Spring 2005 Control Engineering 14-16


Gorinevsky
QP solution
• QP Problem:
U = U (t ) Predicted
AU ≤ b
control
1 sequence
J = U T QU + f T U → min
2
⎡1⎤
T
Q = rD D + H H T
⎡ I ⎤
A=⎢ ⎥ b = ⎢M ⎥ ⋅ u0
⎣− I ⎦ ⎢⎥
f = H T (Gx + Fu ) ⎢⎣1⎥⎦

• Standard QP codes can be used

EE392m - Spring 2005 Control Engineering 14-17


Gorinevsky
Linear MPC
• Nonlinearity is caused by the constraints
• If constraints are inactive, the QP problem solution is ⎡1⎤
⎢ 0⎥
U = Q −1 f l=⎢ ⎥
u = l TU ⎢M⎥
⎢ ⎥
• This is linear state feedback ⎣ 0⎦

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

u = z −1 Kx + z −1 Su
K = l T (rD T D + H T H ) H T G S = l T (rD T D + H T H ) H T F
−1 −1

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


z −1
u= −1
Kx zx = Ax + Bu
1 − Sz
EE392m - Spring 2005 Control Engineering 14-18
Gorinevsky
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 Control Engineering 14-19


Gorinevsky
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 Control Engineering 14-20


Gorinevsky
Example: Lateral Control of a Car
y
lateral u
displacement
V

Lane direction

Preview horizon
x

• Preview Control – MacAdam’s 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 Control Engineering 14-21
Gorinevsky
Lateral Control of a Car - Model
y
V
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
2
y (t + 1) = y (t ) + a (t )VTs + u(t ) ⋅ 0.5VTs
EE392m - Spring 2005 Control Engineering 14-22
Gorinevsky
Lateral Control of a Car - MPC
State-space system: x (t + 1) = Ax (t ) + Bu(t )
⎡ a (t ) ⎤ ⎡ 1 0⎤ ⎡ Ts ⎤
x (t ) = ⎢ ⎥ A=⎢ ⎥ , B=⎢ 2⎥
⎣ y (t )⎦ ⎣VTs 1⎦ ⎣ 0.5VTs ⎦

Observation: y (t ) = Cx(t ) C = [0 1]
• Formulate predictive model
Y = Gx + HU + Fu
• MPC optimization problem
J = (Gx + HU + Fu ) (Gx + HU + Fu ) + rU T D T DU → min
T

subject to : U ≤ u0 ,
• Solution: x (t ) → [MPC QP] → U → u(t + 1) = U (1)
EE392m - Spring 2005 Control Engineering 14-23
Gorinevsky
Impulse Responses
IMPULSE RESPONSE FOR LATERAL ERROR
20

15

10

0
0 2 4 6 8 10 12 14 16 18 20

IMPULSE RESPONSE FOR HEADING ANGLE


5

0
0 2 4 6 8 10 12 14 16 18 20

EE392m - Spring 2005 Control Engineering 14-24


Gorinevsky
Lateral Control of a Car - Simulation
HEADING ANGLE (deg)
0
Simulation -0.5

Results: -1

-1.5

-2
0 1 2 3 4 5 6 7 8
• V = 50 mph LATERAL ERROR
1

• Sample time
of 200ms 0.5

• N = 20 0
0 1 2 3 4 5 6 7 8

• All variables 1
STEERING CONTROL (deg/s)

in SI units 0.5

• r=1 0

-0.5

-1
0 1 2 3 4 5 6 7 8
TIME (sec)

EE392m - Spring 2005 Control Engineering 14-25


Gorinevsky
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 Control Engineering 14-26


Gorinevsky

You might also like