49
1 Model Predictive Control Model Predictive Control (MPC) Overview of Model Predictive Control Impulse/Step Response Model Identification Predictions for SISO and MIMO Models Model Predictive Control Calculations Selection of Design and Tuning Parameters

Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

  • Upload
    lyhanh

  • View
    228

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

1

Mo

del

Pre

dic

tive

Co

ntr

ol Model Predictive Control

(MPC)

� Overview of Model Predictive Control� Impulse/Step Response Model Identification� Predictions for SISO and MIMO Models� Model Predictive Control Calculations� Selection of Design and Tuning Parameters

Page 2: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

2

Mo

del

Pre

dic

tive

Co

ntr

ol

MPC - Motivation

• Practical Problems– multivariable– difficult dynamic behavior – nonlinear– constraints (input, output)

• Overall Objectives of MPC– Prevent violations of input and output constraints.– Drive some output variables to their optimal set points,

while maintaining other outputs within specified ranges.– Prevent excessive movement of the input variables.

Page 3: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

3

Mo

del

Pre

dic

tive

Co

ntr

ol

MPC - Basic Concepts

1. Future values of output variables are predicted using a dynamic model of the process and current measurements.

• Unlike time delay compensation methods, the predictions are made for more than one time delay ahead.

2. The control calculations are based on both future predictions and current measurements.

3. The manipulated variables, u(k), at the k-th sampling instant are calculated so that they minimize an objective function, J.

• Example: Minimize the sum of the squares of the deviations between predicted future outputs and specific reference trajectory.

4. Inequality & equality constraints, and measured disturbances are included in the control calculations.

5. The calculated manipulated variables are implemented as set point for lower level control loops. (cf. cascade control).

Page 4: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

4

Mo

del

Pre

dic

tive

Co

ntr

ol

MPC Block Diagram

� Basic Elements of MPC

� Reference Trajectory Specification� Process Output Prediction (using Model)

� Control Action Sequence Computation (programming problem)

� Error Prediction Update (feedback)

Page 5: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

5

Mo

del

Pre

dic

tive

Co

ntr

ol

Control Hierarchy

Page 6: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

6

Mo

del

Pre

dic

tive

Co

ntr

ol

MPC - Calculations1. At the k-th sampling instant, the values of the manipulated

variables, u, at the next M sampling instants, {u(k), u(k+1), …, u(k+M -1)} are calculated.

• This set of M “control moves” is calculated so as to minimize the predicted deviations from the reference trajectory over the next P sampling instants while satisfying the constraints.

• Typically, an LP or QP problem is solved at each sampling instant.

• Terminology: M = control horizon, P = prediction horizon

2. Then the first “control move”, u(k), is implemented.

3. At the next sampling instant, k+1, the M-step control policy is re-calculated for the next M sampling instants, k+1 to k+M, and implement the first control move, u(k+1).

4. Then Steps 1 and 2 are repeated for subsequent sampling instants.

Note: This approach is an example of a receding horizon approach.

Page 7: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

7

Mo

del

Pre

dic

tive

Co

ntr

ol

Figure 20.2 Basic concept for Model Predictive Control

Page 8: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

8

Mo

del

Pre

dic

tive

Co

ntr

ol

Moving Horizon Concept of MPC

Page 9: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

9

Mo

del

Pre

dic

tive

Co

ntr

ol

When Should MPC be Used?

1. Processes are difficult to control with standard PID algorithm (e.g., large time constants, substantial time delays, inverse response, etc.)

2. There is significant process interactions between uand y.

• i.e., more than one manipulated variable has a significant effect on an important process variable.

3. Constraints (limits) on process variables and manipulated variables are important for normal control.

Terminology:

• y ↔ CV, u ↔ MV, d ↔ DV

Page 10: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

10

Mo

del

Pre

dic

tive

Co

ntr

ol

MPC History• Model Algorithmic Control (MAC) (1978)

– Finite impulse response model

• Dynamic Matrix Control (DMC) (1980)– Step response model

– Control calculation by least-squares method (no constraints)

• Quadratic Dynamic Matrix Control (QDMC) (1984)– Step response model

– Control calculation by quadratic programming (with constraints)

• Generalized Predictive Control (GPC) (1987)– Transfer function model

• Nonlinear Model Predictive Control (NMPC)

• Over 5000 applications of MPC since 1980 (Qin and Badgwell, 2003)

Page 11: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

11

Mo

del

Pre

dic

tive

Co

ntr

ol

Dynamic Models for MPC• Could be either:

1. Physical or empirical (but usually empirical)2. Linear or nonlinear (but usually linear)3. Parametric or non-parametric

• Typical linear models used in MPC:1. Impulse response models2. Step response models3. Transfer function models4. State-space models

Note: Can convert one type of linear model to the other types

• Discrete-time models are more convenient for prediction

Page 12: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

12

Mo

del

Pre

dic

tive

Co

ntr

ol

Discrete Impulse Response ModelsConsider a single input, single output process:

where u and y are deviation variables, u(k) and y(k) are their measurements at k-th sampling instant.

• Definition: impulse response is the response of a relaxed process to a unit pulse (impulse) excitation at t = 0

• Process input-output relationship

{ } 0 1 2 3= ⋯ih i , , , ,

( ) ( )0

ii

y k h u k i∞

== −∑ (convolution summation)

u yProcessu (k) y (k)

Page 13: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

13

Mo

del

Pre

dic

tive

Co

ntr

ol

• For a stable process: for i > N

� Finite Impulse response (FIR)

• For a multivariable process with r inputs and m outputs, the representation becomes a impulse response matrix

hij,k : the FIR between the j-th input and the i-th output

0≈ih

( ) ( )0

N

ii

y k h u k i=

= −∑

11 1

1

0 1 2 3

r

m mr

,k ,k

k

,k ,k

h h

k , , , ,

h h

= =

H

⋮ ⋱ ⋮ ⋯

( ) ( )0

N

ii

k k i=

= −∑y H u

(h0 = 0)

Page 14: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

14

Mo

del

Pre

dic

tive

Co

ntr

ol

• Identification problem: given input u(k) and output measurement y(k) � find the FIR, hi

• Assumptions:– The input u(k) is a continuing driving function of the process.

We observe u(k) for where n > N.

– The output sequence y(k) for is also observed.

– The noise e(k) is a random sequence with zero mean and is uncorrelated with u(k).

FIR Identification

0 k n N≤ ≤ +N k n N≤ ≤ +

Process

(FIR, hi)

e(k)

u(k) y(k)+

(noise)

w(k)

Page 15: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

15

Mo

del

Pre

dic

tive

Co

ntr

ol

• Using the input-output relationship, we have n+1 eqs.

• Written in vector form

( ) ( ) ( ) ( ) ( )( ) ( ) ( ) ( ) ( )

( ) ( ) ( ) ( ) ( )

0 1

0 1

0 1

1 0

1 1 1 1 1

1

N

N

N

k N , y N h u N h u N h u e N

k N , y N h u N h u N h u e N

k N n, y N n h u N n h u N n h u n e N n

= = + − + + +

= + + = + + + + + +

= + + = + + + − + + + +

⋮ ⋮

y = Uh + e

( )( )

( )

( )( )

( )

( ) ( ) ( )( ) ( ) ( )

( ) ( ) ( )

0

1

1 0

1 1 1 1; ; ;

1N

hy N e N u N u N u

hy N e N u N u N u

y N n e N n u N n u N n u nh

− + + + = = = =

+ + + + −

y e h U

⋮ ⋮ ⋮ ⋮ ⋱ ⋮⋮

n+1 equations, N+1 unknowns (n > N)� No exact solution

Page 16: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

16

Mo

del

Pre

dic

tive

Co

ntr

ol

Least-Squares Estimation• Estimate the unknown parameter vector h by the

method of least-squares (minimize the error criterion J = eTe with respect to hwhere )

• Accuracy of– is an unbiased estimate of h, i.e.

– is a consistent estimate of h if

• Potential problems– The selection of settling time parameter N (unknown a priori)– Usually needs to repeat the computation with progressively

increasing N values– A large N value may cause computational difficulty

( ) 1h U U U y

−= T Tˆ

h

h n → ∞

h

(Least-squares estimator)

( )h h=ˆE

e y Uh= −

Solution :

Page 17: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

17

Mo

del

Pre

dic

tive

Co

ntr

ol

Multivariable FIR Identification• Input-output relationship for the i-th output

• Least-squares estimation

( ) ( )

[ ]1 0

1 2

r N

i ij , jj

i r i i i i

y k h u k= =

= −

⇒ = + = +

∑∑

y U U U h e Uh e

ℓℓ

( )( )

( )

( )( )

( )

( ) ( ) ( )( ) ( ) ( )

( ) ( ) ( )0

11 2

1 0

1 11 1; ; ;

1

;

j j ji i

j j ji ii i j

i i j j j

ij ,

Tij , T T Tij i i i ir

ij ,N

u N u N uy N e N

u N u N uy N e N

y N n e N n u N n u N n u n

h

h

h

− ++ + = = =

+ + + + −

= =

y e U

h h h h h

⋮ ⋮ ⋮ ⋮ ⋱ ⋮

⋯⋮

( ) 1T Ti i

ˆ −=h U U U y

Page 18: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

18

Mo

del

Pre

dic

tive

Co

ntr

ol

Discrete Step Response Models

• The step response Si is related to the impulse response hi

( ) ( )0

0

N

k ii

k

k ii

S y k h u k i

S h

=

=

= = −

⇒ =

For unit step input, u(k)=1

1i i ih S S−= −or

(S0 = 0)

Page 19: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

19

Mo

del

Pre

dic

tive

Co

ntr

ol

• The step response model of a stable SISO process

• Let k denote the current sampling instant and denote the prediction of y(k+1) at time k

Prediction for SISO Step Response Models

( ) ( ) ( )1

1

1 1 1N

i Ni

y k + S u k i S u k N−

=⇒ = ∆ − + + − +∑

Si = the i-th step response coefficient

N = an integer (the model horizon)

= change in the input from one sampling instant to the next

( ) ( ) ( ) ( )11 1

1 1 1N N

i i ii i

y k h u k i S S u k i−= =

+ = − + = − − +∑ ∑

( ) ( ) ( )1−−=∆ kukuku

( ) ( ) ( )1

1

1 1 1N

i Ni

y k + S u k i S u k N−

== ∆ − + + − +∑

( )1y k +

One-step-ahead prediction

Page 20: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

20

Mo

del

Pre

dic

tive

Co

ntr

ol

• Rearrange as

• Two-step-ahead prediction (k = k+1)

• j -step ahead prediction

1

12Effect of current

control action Effect of past control actions

ˆ( 1) ( ) ( 1) ( 1)N

i Ni

y k S u k S u k i S u k N−

=+ = ∆ + ∆ − + + − +∑�����

���������������

1

1 23Effect of future Effect of current

control action control action Effect of past control actions

ˆ( 2) ( 1) ( ) ( 2) ( 2)N

i Ni

y k S u k S u k S u k i S u k N−

=+ = ∆ + + ∆ + ∆ − + + − +∑����� �����

���������������

1

1 1

ˆ( ) ( ) ( ) ( )j N

i i Ni i j

Effects of current and Effects of pastfuture control actions control actions

y k j S u k j i S u k j i S u k j N−

= = ++ = ∆ + − + ∆ + − + + −∑ ∑

��������� �����������������

1

ˆ ˆ( ) ( ) ( )j

oi

i

y k j S u k j i y k j=

+ = ∆ + − + +∑Predicted unforced response (no current or future control actions, )( ) ( )1 for 0u k i u k i+ = − ≥

Page 21: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

21

Mo

del

Pre

dic

tive

Co

ntr

ol

• Example : Derive a predictive control law based on the following concept. A single control move, , is calculated so that the J-step-ahead prediction is equal to the set-point. Assume for i > 0.

( )u k∆

( ) 0u k i∆ + =

ˆ ˆ( ) ( ) ( )oJy k J S u k y k J+ = ∆ + +

Setting and rearranging gives the desired predictive controller

ˆ( ) spy k J y+ =

ˆ ( )( )

osp

J

y y k Ju k

S

− +∆ =

A single prediction for J step ahead

Solution:

Apply the predictive control law to the process

( )5

( ) 1

( ) 5 1

Y s

U s s=

+

Large J � sluggish response

Page 22: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

22

Mo

del

Pre

dic

tive

Co

ntr

ol

Vector Notation for Multiple Predictions

Define vectors:

: predicted response for the next P sampling instants

: predicted unforced response

: control actions for the next M sampling instants

( )

( )( )

( )

1

21

y k+

y k+ˆ k +

y k+P

≜⋮

Y

( )1ˆ k +Y

( )1ˆ k +oY

( )k∆U

( )

( )( )

( )

1

21

o

o

o

y k+

y k+ˆ k +

y k+P

≜⋮

oY

( )

( )( )

( )

1

1

u k

u k+k

u k+M -

∆ ∆ ∆ ∆

≜⋮

U

Page 23: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

23

Mo

del

Pre

dic

tive

Co

ntr

ol

• The MPC control calculations are based on calculating so that the predicted outputs move optimally to the

new set-point• The model predictions can be written as

where S is the dynamic matrix

Dynamic Matrix Model

( ) ( ) ( )1 1ˆ ˆk + = k k +∆ + oY S U Y

0 0

0

0

1

2 1

M M -1 1

M+1 M 2

P P-1 P-M+1

S

S S

S S S

S S S

S S S

⋮ ⋮ ⋱

≜ ⋯

⋮ ⋮ ⋱ ⋮

S

P M×

( )k∆U

Page 24: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

24

Mo

del

Pre

dic

tive

Co

ntr

ol

Output feedback: Bias Correction• Sources of inaccurate prediction:

– model inaccuracy and unmeasured disturbance

• The model predictions can be corrected by utilizing the latest measurement, y(k).

• The corrected prediction is defined to be:

• Adding this bias correction to each prediction gives

( ) ( ) ( )( ) ( ) ( )

ˆˆy k + j y k + j +d k + j

ˆ ˆy k + j + y k y k−

ɶ ≜

( ) ( ) ( )ˆ ˆd k + j y k y k= −Estimated disturbance(Residual)

( ) ( ) ( ) ( ) ( )1 1ˆ ˆk + = k k + y k y k∆ + + − 1ɶ oY S U Y

Process

d(k)

u y(k)+

(disturbance)

( )y k

(Assume process disturbance is constant for j=1,2,…,P)

Page 25: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

25

Mo

del

Pre

dic

tive

Co

ntr

ol

EXAMPLEThe benefits of using corrected predictions will be illustrated by a simple example, the first-order plus-time-delay model:

Assume that the disturbance transfer function is identical to the process transfer function, Gd(s)=Gp(s). A unit step change in uoccurs at time t=2 min and a step disturbance,d=0.15, occurs at t=8 min. The sampling period is ∆t = 1 min.

(a) Compare the process response y(k) with the predictions that were made 15 steps earlier based on a step response model with N=80.

(b) Repeat part (a) for the situation where the step response coefficients are calculated using an incorrect model:

-24

20 1

sY(s) e=

U(s) s+

25

15 1

- sY(s) e=

U(s) s+

Page 26: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

26

Mo

del

Pre

dic

tive

Co

ntr

ol

(a) Without model error. (b) With model error.

( ) ( ) ( )( ) ( ) ( )

15 15 15

15

ˆˆy k + y k + +d k +

ˆ ˆy k + + y k y k−

ɶ ≜

Bias correction beginsafter t = 25 (k = 10)

Bias correction beginsafter t = 19 (k = 4)

Page 27: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

27

Mo

del

Pre

dic

tive

Co

ntr

ol

• By the Principle of Superposition

• Let the output vector be and the input vector be

• The MIMO model for the corrected predictions

Prediction for MIMO Step Response Models

( ) ( ) ( ) ( ) ( )1

12 2 12 21

1

11 1 11 11

1

N

,i ,

N

,i ,Ni

Ni

S u k j i S u k j S u ky k + j i S u k Nj jN−

=

=∆ + − ∆ + − +−= −++ ++∑ ∑

( ) ( ) ( ) ( ) ( )1

22 2 22 21

1

21 1 21 11

2

N

,i ,

N

,i ,Ni

Ni

S u k j i S u k j S u ky k + j i S u k Nj jN−

=

=∆ + − ∆ + − +−= −++ ++∑ ∑

( ) ( ) ( ) ( ) ( )1 1ˆ ˆk + = k k + k k∆ + + − Φ y yɶ oY S U Y

[ ]1 2

T

my y y=y ⋯

[ ]1 2

T

ru u u=u ⋯

( )

( )( )

( )1

1

21

k+

k+k +

k+P×

y

y

y

ɶ

ɶɶ ≜⋮

ɶmP

Y ( )

( )( )

( )1

1

21

ˆ k+

ˆ k+ˆ k +

ˆ k+P×

o

o

o

y

y

y

≜⋮

o

mP

Y ( )

( )( )

( )1

1

1

k

k+k

k+M -×

∆ ∆ ∆ ∆

u

u

u

≜⋮

rM

U

Page 28: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

28

Mo

del

Pre

dic

tive

Co

ntr

ol

• The matrix is defined as

where denotes the identity matrix

• The dynamic matrix is defined as

where Si is the matrix of step response coefficients for the i-th time step

[ ]times

T

P

= m m mΦ I I I⋯���������

mP m× Φ

m m×mI

0 0

0

0

1

2 1

M M -1 1

M+1 M 2

P P-1 P-M+1 mP rM×

⋮ ⋮ ⋱

≜ ⋯

⋮ ⋮ ⋱ ⋮

S

S S

S S S S

S S S

S S S

11 1

1

r

m mr

,i ,i

i

,i ,i

S S

S S

=

⋮ ⋱ ⋮

S

m r×

Page 29: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

29

Mo

del

Pre

dic

tive

Co

ntr

ol

Example: Individual step-response models for a distillation column with three inputs and four outputs. Each model represents the step response for 120 minutes. Reference: Hokanson and Gerstle (1992).

Page 30: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

30

Mo

del

Pre

dic

tive

Co

ntr

ol

Exponential Trajectory from y(k) to ysp(k)

A reasonable approach for thei-th output is to use:

for i= 1,2,…, m and j= 1, 2, …, P.

MPC Calculations

Reference Trajectory• A reference trajectory can be used to make a gradual

transition to the desired set point.• Let the reference trajectory over the prediction horizon P

be denoted as:

• The control objective is to calculate a set of control moves (input changes) that make the corrected predictions as close to a reference trajectory as possible.

( )

( )( )

( )1

1

21

k+

k+k +

k+P×

≜⋮

r

rr

r mP

y

yY

y

( ) ( ) ( ) ( ) ( ), ,1j j

i r i i i i spy k j y k y kα α + = + − ( )( )0

j

i r spα = ⇒ =y y

Page 31: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

31

Mo

del

Pre

dic

tive

Co

ntr

ol

Unconstrained MPC• The control calculations are based on minimizing the predicted

deviations between the reference trajectory.• The predicted error vector is defined as:

Similarly, the predicted unforced error, , is defined as ( ) ( ) ( )o o1 1 1ˆ k + k + k +− ɶ≜ rE Y Y

• The objective of the control calculations is to determine the control moves, , for the next M time intervals.

• The rM-dimensional vector is calculated so that an objective function (also called a performance index) is minimized.

( ) ( ) ( )1 1 1ˆ k + k + k +− ɶ≜ rE Y Y

( ) ( ) ( ) ( )1 1ˆ ˆk + k + k k+ − Φ y yɶ ≜o oY Y

( )o 1ˆ k +E

where the corrected prediction for unforced case is defined as

Note that all of the above vectors are of dimension, mP.

( )k∆U

( )k∆U

( ) ( ) ( )o1 1ˆ ˆk + k + k⇒ = − ∆E E S U

Page 32: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

32

Mo

del

Pre

dic

tive

Co

ntr

ol

MPC Performance Index• The rM-dimensional vector ∆U(k) is calculated so as to minimize:

a. The predicted errors over the prediction horizon, P.

b. The size of the control move over the control horizon, M.

• Example: Consider a quadratic performance index:

( ) ( ) ( ) ( )1 1T T

( k )

ˆ ˆmin k k k k∆

= + + + ∆ ∆U

QE E RJ U U

where Q and R are weighting matrices used to weight the most important outputs and inputs.

Both Q and R are usually diagonal matrices with positive diagonal elements.

Page 33: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

33

Mo

del

Pre

dic

tive

Co

ntr

ol

MPC Control Law: Unconstrained Case• The MPC control law that minimizes the quadratic objective

function can be calculated analytically

( ) ( ) ( )o 1

where is the dynamic matrix.

-1T T ˆk = k + ∆ +U S Q S R S Q E

S

• This control law can be written in a more compact form

( ) ( )o 1cˆk = k +∆U K E

where controller gain matrix Kc is defined to be:

( )-1T Tc +≜K S Q S R S Q rM mP×

• Note that Kc can be evaluated off-line, rather than on-line, provided that the dynamic matrix S and weighting matrices, Q and R, are constant.

Dimension:

(a multivariable, proportional control law based on the predicted error)

( )0=

k

∂∂∆

JU

Page 34: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

34

Mo

del

Pre

dic

tive

Co

ntr

ol

MPC Control Law:Receding Horizon Approach

• Note that the controller gain matrix, Kc, is an matrix.

where:

• In the receding horizon control approach, only the first step of the M-step control policy, , is implemented.

• MPC control law:

where matrix Kc1 is defined to be the first r rows of Kc. Thus, Kc1 has dimensions of .r mP×

.

( ) ( )11ˆk = k +∆ o

cu K E

( ) ( )o 1cˆk = k +∆U K E

( )

( )( )

( )1

1

1

k

k+k

k+M -×

∆ ∆ ∆ ∆

u

u

u

≜⋮

rM

U

( )k∆u

rM mP×

Advantage: new information in the form of the most recent measurement y(k) is utilized immediately

Page 35: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

35

Mo

del

Pre

dic

tive

Co

ntr

ol

Unconstrained MPC (DMC) Algorithm

• The process output, y(k), is measured, and used to estimate the disturbance.

• The predicted unforced error, , is updated (accounting for changes in set-point and effect of previous controller moves).

• Solve for control move.

• (first step only) is implemented.

• Counter is updated: k = k + 1.

( ) ( ) ( )ˆ ˆd k + j y k y k= −

( ) ( ) ( ) ( ) ( )o 1 1 1ˆ ˆ ˆk + k + k + k k= − − − Φ y yorE Y Y

( )o 1ˆ k +E

( ) ( ) ( )o 1-1T T ˆk = k +∆ +U S Q S R S Q E

( )k∆u

Page 36: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

36

Mo

del

Pre

dic

tive

Co

ntr

ol

MPC with Inequality Constraints• Inequality constraints on input and output variables are

important characteristics for MPC applications– Input constraint: physical limitations on plant equipments

such as limits on input value and rate-of-change– Output constraint: related to plant operating strategy such

as constraint on product quality

• MPC inequality constraints

• The introduction of inequality constraints results in a constrained optimization problem– Can be solved numerically using linear or quadratic

programming techniques

( ) ( ) ( )( ) ( ) ( )

0,1, , 1

0,1, , 1

k k j k j M

k k j k j M

− +

− +

≤ + ≤ = −

∆ ≤ ∆ + ≤ ∆ = −

u u u

u u u

( ) ( ) ( ) 1,2, ,k j k j k j j P− ++ ≤ + ≤ + =y y yɶ ⋯

Page 37: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

37

Mo

del

Pre

dic

tive

Co

ntr

ol

Selection of Design ParametersModel predictive control techniques include a number of design parameters:

N : model horizon

∆t : sampling period

P : prediction horizon (number of predictions)

M : control horizon (number of control moves)

Q : weighting matrix for predicted errors (Q > 0)

R : weighting matrix for control moves (R > 0)

Page 38: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

38

Mo

del

Pre

dic

tive

Co

ntr

ol

Selection of Design Parameters1. N and ∆∆∆∆t

These parameters should be selected so that N ∆t > open-loop settling time. Typical values of N:

30 <N < 120

2. Prediction Horizon, PIncreasing P results in less aggressive control action

Set P = N + M

3. Control Horizon, MIncreasing M makes the controller more aggressive and increases computational effort, typically:

5 < M < 20 or N/3 < M < N/2

4. Weighting matrices Q and RDiagonal matrices with largest elements corresponding to most important variables

– output weighting matrix Q : the most important variables having the largest weights

– input weighting matrix (move suppression matrix) R : increasing the values of weights tends to make the MPC controller more conservative by reducing the magnitudes of the input moves

Page 39: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

39

Mo

del

Pre

dic

tive

Co

ntr

ol

Example: SISO system

( )( )10 1 5 1

-

( )

=+ +

seG s

s s1=70, t =∆NAssume

The controller gain matrix, Kc, for two cases (Qii = 1, Rii = 0):

Set-point response [MPC vs. PID (ITAE set-point tuning)]

MPC: small settling time

Page 40: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

40

Mo

del

Pre

dic

tive

Co

ntr

ol

Disturbance response [MPC vs. PID (ITAE disturbance tuning)]

MPC: small maximum deviations and non-oscillatory

Page 41: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

41

Mo

del

Pre

dic

tive

Co

ntr

ol

• Wood and Berry process

–– Saturation limits of were imposed on each input

– +1% set-point change in XB at t=0, followed by two feed flow rate disturbances: +30% increase at t=50 and a return to the originalvalue at t=100 (Fs = 2.45)

– Compare a variety of MPC controllers and a multi-loop control system (Lee et al., 1998)

MIMO Example: Effects of MPC design parameters (M, P, Q, R)

1 mint =∆0 15.±

8.86-0.089XB – S

7.210.85XD – R

KcControl loop τ I

Page 42: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

42

Mo

del

Pre

dic

tive

Co

ntr

ol

Unconstrained MPC vs. Multi-loop Control

MPC is superior to the multi-loop control system (faster responses, less oscillation).

Page 43: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

43

Mo

del

Pre

dic

tive

Co

ntr

ol

Effect of input weighting matrix R

When Rii are increased, the MPC inputs become smoother and the output responses have larger deviations and longer settling times.

Page 44: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

44

Mo

del

Pre

dic

tive

Co

ntr

ol

Effect of output weighting matrix Q

Control of the more heavily weighted output improves at the expense of the other output.

Page 45: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

45

Mo

del

Pre

dic

tive

Co

ntr

ol

Effect of control horizon M

The y responses are similar, but the u responses are smoother for M = 5.

Page 46: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

46

Mo

del

Pre

dic

tive

Co

ntr

ol

MATLAB Tools for MPC• Unconstrained MPC (DMC)

– Kmpc = mpccon(model,ywt,uwt,M,P)• Calculate MPC controller gains for unconstrained case.• Inputs:

– model : Step response coefficient matrix of model.– ywt,uwt : output and input weighting matrices.– M : control horizons.– P : prediction horizon.

• Output:– Kmpc : Controller gain matrix

– model = tfd2step(tfinal,delt,nout,g1,...,g25)• Determines the step response model of a transfer function model.• Inputs:

– tfinal: truncation time for step response model.– delt: sampling interval for step response model.– nout: number of outputs, ny.– g1, g2,...: SISO transfer function ordered to be read in columnwise

(by input). The number of transfer functions required is ny*nu. (nu=number of inputs). Limited to ny*nu <= 25.

• Output:– model: step response coefficient matrix in MPC step format.

Page 47: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

47

Mo

del

Pre

dic

tive

Co

ntr

ol

– g = poly2tfd(num,den,delt,delay)• Create transfer functions for MPC toolbox• Inputs:

– num : Coefficients of the transfer function numerator.– den : Coefficients of the transfer function denominator.– delt : Sampling time. Can be 0 (for continuous-time system)

or > 0 (for discrete-time system).– delay : Pure time delay (dead time). Can be >= 0.

• Output:– g: transfer function.

Page 48: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

48

Mo

del

Pre

dic

tive

Co

ntr

ol

• Unconstrained MPC (DMC)– [yp,u,ym] = mpcsim(plant,model,Kmpc,tend,r,usat,...

tfilter,dplant,dmodel,dstep)• Simulation of the unconstrained Model Predictive Controller.• REQUIRED INPUTS:

– plant(model): the step response coefficient matrix of the plant(model) generated by the function tfd2step.

– Kmpc: the constant matrix computed by the function mpccon.– tend: final time of simulation.– r: reference trajectory (set-point).

• OPTIONAL INPUTS:– usat: the matrix of manipulated variable constraints.It is a vector

of the lower limits (Ulow), upper limits (Uhigh) and rate ofchange limits (DelU) on the manipulated variables.

– tfilter: time constants for noise filter and unmeasureddisturbance lags.

– dplant: step response coefficient matrix for the disturbancegenerated by the function tfd2step.

– dmodel: step response coefficient matrix for the measureddisturbance effect on the model output generated by the function tfd2step.

– dstep: matrix of disturbances to the plant. • OUTPUT:

– y (system response), u (manipulated variable) and ym (model response)

Page 49: Model Predictive Control - ntut.edu.tjcjeng/Model Predictive Control.pdf · 3 Model Predictive Control MPC - Basic Concepts 1. Future values of output variables are predicted using

49

Mo

del

Pre

dic

tive

Co

ntr

ol

• Constrained MPC (QDMC)– [yp,u,ym] = cmpc(plant,model,ywt,uwt,M,P,tend,r,ulim,ylim...

tfilter,dplant,dmodel,dstep)• Simulation of the constrained Model Predictive Controller.

• REQUIRED INPUTS:– plant, model, ywt, uwt, M, P, tend, r

• OPTIONAL INPUTS:– ulim: matrix of manipulated variable constraints. It is a trajectory

of lower limits (Ulow), upper limits (Uhigh) and rate of change (DelU).

– ylim: matrix of output variable constraints. It is a trajectory of lower (Ylow) and upper limits (Yhigh) on the output variables.

– tfilter, dplant, dmodel, dstep

• OUTPUT: – y (system response), u (manipulated variable) and ym (model

response)