26
EE392m - Spring 2005 Gorinevsky Control Engineering 14-1 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

Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

Embed Size (px)

Citation preview

Page 1: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-1

Lecture 14 - Model Predictive ControlPart 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

Page 2: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-2

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

Page 3: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-3

Receding Horizon Control

• 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

future input trajectory predicted future output

Plant Model

prediction horizon

prediction horizon

• Receding Horizon Control concept

current dynamic system statesPlant

RHC

Page 4: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-4

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

Page 5: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-5

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

Page 6: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-6

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

Page 7: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-7

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

Page 8: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-8

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

Page 9: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-9

Emerging MPC applications

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

Page 10: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-10

Emerging MPC applications

• Spacecraft rendezvous with space station– visibility cone constraint– fuel optimality

• Underwater vehicle guidance

• Missile guidance

From Richards & How, MIT

Page 11: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-11

State-based control synthesis

• Infinite horizon optimal control

( ) ( )

0

1

22

)( :subject to

min)1()()(

uu

uuryt

→−−+∑∞

+=

τ

ττττ

)()()1( tButAxtx +=+• Consider single input system for better clarity

• Solution = Optimal Control Synthesis

)()( tCxty =

Page 12: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-12

State-based MPC – concept

• 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

x1

x2

t > N

Optimal control trajectories

Page 13: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-13

State-based MPC

• Receding horizon control; N-step optimal

( ) ( )

)()()()()1(,)( :subject to

min)1()()(

0

1

22

tCxtytButAxtx

uu

uuryJNt

t

=+=+

→−−+= ∑+

+=

τ

ττττ

• Solution ≈ Optimal Control Synthesis

[ ] )(Solver ProblemMPC)( tutx →→

Page 14: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-14

Predictive Model• Predictive system model

⎥⎥⎥

⎢⎢⎢

+

+=

)(

)1(

Nty

tyY M

• Model matrices⎥⎥⎥

⎢⎢⎢

+

+=

)(

)1(

Ntu

tuU M

FuHUGxY ++= initial condition response + control response

)(txx =

Predicted output Future control input Current state(initial condition)

⎥⎥⎥

⎢⎢⎢

⎡=

nCA

CAG M

⎥⎥⎥⎥

⎢⎢⎢⎢

=

⎥⎥⎥⎥

⎢⎢⎢⎢

=

−− )1()1()(

0)1()2(00)1(

0

00000

32 hNhNh

hhh

BCABCA

CBH

NN K

MOMM

K

K

K

MOMM

K

K

)(tuu = computed at the previous step

⎥⎥⎥⎥

⎢⎢⎢⎢

+

=

)1(

)3()2(

Nh

hh

FM

Page 15: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-15

Computations Timeline

• 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

x(t)

t

x(t+1)

t+1

Compute control based on x(t). Apply it

u(t+1)

time

u(t)

Computed at the previous step

Page 16: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-16

MPC Optimization Problem Setup

• MPC optimization problem

FuHUGxYuUDUDrUYYJ TTT

++=≤

→+=, :subject to

min

0

• Solution

[ ] )1()1(Solver QP Problem,MPC)( UtuUtx =+→→→

• This is a QP problem

⎥⎥⎥⎥

⎢⎢⎢⎢

⎡ −

=

000

010011

K

MOMM

K

K

D

1st difference matrix

Page 17: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-17

QP solution

• QP Problem:

min21 →+=

UfQUUJ

bAU

TT

• Standard QP codes can be used

)(tUU = Predicted control sequence

HHDrDQ TT +=

( )FuGxHf T +=⎥⎦

⎤⎢⎣

⎡−

=I

IA 0

1

1ub ⋅

⎥⎥⎥

⎢⎢⎢

⎡= M

Page 18: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-18

Linear MPC

• Nonlinearity is caused by the constraints • If constraints are inactive, the QP problem solution is

fQU 1−=

( ) ( ))()()1( 1 tFutGxHHHDrDltu TTTT ++=+ −

⎥⎥⎥⎥

⎢⎢⎢⎢

=

0

01

Ml

SuzKxzu 11 −− +=

KxSz

zu 1

1

1 −

−=

( ) GHHHDrDlK TTTT 1−+= ( ) FHHHDrDlS TTTT 1−+=

• This is linear state feedback

BuAxzx +=

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

Ulu T=

Page 19: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-19

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.

Page 20: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-20

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

Page 21: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-21

Example: Lateral Control of a Car

• Preview Control – MacAdam’s driver model (1980) • Consider predictive control design• Simple kinematical model of a car driving at speed V

Lane direction

lateral displacement

y

x

V

u

Preview horizon

uaaVyaVx

===

&

&

&

sincos

lateral displacementsteering

Page 22: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-22

Lateral Control of a Car - Model

• Assume a straight lane – tracking a straight line • Linearized system: assume a << 1

sin a ≈ a cos a ≈ 1

• Sampled-time equations (sampling time Ts)

Lateral displacement

y

x

V

a(t) u(t) y(t)

25.0)()()()1(

)()()1(

ss

s

VTtuVTtatyty

Ttutata

⋅++=+

+=+

uaVay

==

&

&

Page 23: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-23

Lateral Control of a Car - MPC

• Formulate predictive model

• MPC optimization problem FuHUGxY ++=

⎥⎦

⎤⎢⎣

⎡=)()(

)(tyta

tx

)()()1( tButAxtx +=+

⎥⎦

⎤⎢⎣

⎡=⎥

⎤⎢⎣

⎡= 25.0

,101

s

s

s VTT

BVT

A

State-space system:

Observation: )()( tCxty = [ ]10=C

( ) ( ), :subject to

min

0uUDUDrUFuHUGxFuHUGxJ TTT

≤→+++++=

[ ] )1()1(QP MPC)( UtuUtx =+→→→• Solution:

Page 24: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-24

Impulse Responses

0 2 4 6 8 10 12 14 16 18 200

5

10

15

20IMPULSE RESPONSE FOR LATERAL ERROR

0 2 4 6 8 10 12 14 16 18 200

1

2

3

4

5IMPULSE RESPONSE FOR HEADING ANGLE

Page 25: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-25

Lateral Control of a Car - Simulation Simulation

Results:

• V = 50 mph• Sample time

of 200ms• N = 20• All variables

in SI units• r = 1

0 1 2 3 4 5 6 7 80

0.5

1LATERAL ERROR

0 1 2 3 4 5 6 7 8-2

-1.5

-1

-0.5

0HEADING ANGLE (deg)

0 1 2 3 4 5 6 7 8-1

-0.5

0

0.5

1STEERING CONTROL (deg/s)

TIME (sec)

Page 26: Lecture 14 - Model Predictive Control Part 1: The Concept · PDF fileLecture 14 - Model Predictive Control Part 1: ... Plant Model prediction horizon ... • Consider predictive control

EE392m - Spring 2005Gorinevsky

Control Engineering 14-26

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