Model Predictive Control

Published on January 2017 | Categories: Documents | Downloads: 24 | Comments: 0 | Views: 346
of 49
Download PDF   Embed   Report

Comments

Content


1
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
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
2
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
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.
3
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
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).
4
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
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)
5
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
Control Hierarchy
6
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
MPC - Calculations
1. 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.
7
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
Figure 20.2 Basic concept for Model Predictive Control
8
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
Moving Horizon Concept of MPC
9
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
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 u
and 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
10
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
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)
11
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
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 models
2. Step response models
3. Transfer function models
4. State-space models
Note: Can convert one type of linear model to the
other types
• Discrete-time models are more convenient for
prediction
12
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
Discrete Impulse Response Models
Consider 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 =
i
h i , , , ,
( ) ( )
0
i
i
y k h u k i
·
=
= ÷
¿
(convolution summation)
u y
Process
u (k)
y (k)
13
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
• 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
h
ij,k
: the FIR between the j-th input and the i-th output
0 ~
i
h
( ) ( )
0
N
i
i
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
i
i
k k i
=
= ÷
¿
y H u
(h
0

= 0)
14
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
• Identification problem: given input u(k) and output
measurement y(k) find the FIR, h
i
• 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 s s +
N k n N s s +
Process
(FIR, h
i
)
e(k)
u(k)
y(k)
+
(noise)
w(k)
15
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
• 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
; ; ;
1
N
h
y N e N u N u N u
h
y N e N u N u N u
y N n e N n u N n u N n u n
h
(
÷ ( ( (
(
( ( (
+ + +
(
( ( (
= = = =
(
( ( (
(
( ( (
+ + + + ÷
(
( ( (
¸ ¸ ¸ ¸ ¸ ¸
¸ ¸
y e h U


. . . . .
.

n+1 equations, N+1 unknowns (n > N)
No exact solution
16
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
Least-Squares Estimation
• Estimate the unknown parameter vector h by the
method of least-squares
(minimize the error criterion J = e
T
e

with respect to h
where )
• 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
( )
1
h U U U y
÷
=
T T
ˆ
h
ˆ
h
ˆ
n ÷·
h
ˆ
(Least-squares estimator)
( )
h h =
ˆ
E
e y Uh = ÷
Solution :
17
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
Multivariable FIR Identification
• Input-output relationship for the i-th output
• Least-squares estimation
( ) ( )
| |
1 0
1 2
r N
i ij , j
j
i r i i i i
y k h u k
= =
= ÷
¬ = + = +
¿¿
y U U U h e Uh e
/
/
/

( )
( )
( )
( )
( )
( )
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
0
1
1 2
1 0
1 1 1 1
; ; ;
1
;
j j j
i i
j j j i i
i i j
i i
j j j
ij ,
T
ij ,
T T T
ij i i i ir
ij ,N
u N u N u
y N e N
u N u N u y 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


. .
. . .


.
( )
1
T T
i i
ˆ
÷
= h U U U y
18
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
Discrete Step Response Models
• The step response S
i
is related to the impulse response h
i
( ) ( )
0
0
N
k i
i
k
k i
i
S y k h u k i
S h
=
=
= = ÷
¬ =
¿
¿
For unit step input, u(k)=1
1 i i i
h S S
÷
= ÷ or
(S
0

= 0)
19
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
• 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 1
N
i N
i
y k + S u k i S u k N
÷
=
¬ = A ÷ + + ÷ +
¿
S
i
= the i-th

step response coefficient
N = an integer (the model horizon)
= change in the input from one sampling instant to the next
( ) ( )
( )
( )
1
1 1
1 1 1
N N
i i i
i i
y k h u k i S S u k i
÷
= =
+ = ÷ + = ÷ ÷ +
¿ ¿
( ) ( ) ( ) 1 ÷ ÷ = A k u k u k u
( ) ( ) ( )
1
1
1 1 1
N
i N
i
ˆ
y k + S u k i S u k N
÷
=
= A ÷ + + ÷ +
¿
( )
1
ˆ
y k +
One-step-ahead prediction
20
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
• Rearrange as
• Two-step-ahead prediction (k = k+1)
• j -step ahead prediction
1
1
2
Effect of current
control action
Effect of past control actions
ˆ
( 1) ( ) ( 1) ( 1)
N
i N
i
y k S u k S u k i S u k N
÷
=
+ = A + A ÷ + + ÷ +
¿
¸¸_¸¸
¸¸¸¸¸¸¸_¸¸¸¸¸¸¸
1
1 2
3
Effect of future Effect of current
control action control action
Effect of past control actions
ˆ( 2) ( 1) ( ) ( 2) ( 2)
N
i N
i
y k S u k S u k S u k i S u k N
÷
=
+ = A + + A + A ÷ + + ÷ +
¿
¸¸_¸¸ ¸¸_¸¸
¸¸¸¸¸¸¸_¸¸¸¸¸¸¸
1
1 1
ˆ
( ) ( ) ( ) ( )
j N
i i N
i i j
Effects of current and
Effects of past
future control actions
control actions
y k j S u k j i S u k j i S u k j N
÷
= = +
+ = A + ÷ + A + ÷ + + ÷
¿ ¿
¸¸¸¸_¸¸¸¸
¸¸¸¸¸¸¸¸_¸¸¸¸¸¸¸¸
1
ˆ ˆ
( ) ( ) ( )
j
o
i
i
y k j S u k j i y k j
=
+ = A + ÷ + +
¿
Predicted unforced response (no current or future
control actions, )
( ) ( )
1 for 0 u k i u k i + = ÷ >
21
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
• 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 A
( ) 0 u k i A + =
ˆ ˆ
( ) ( ) ( )
o
J
y k J S u k y k J + = A + +
Setting and rearranging gives the desired predictive
controller
ˆ
( )
sp
y k J y + =
ˆ
( )
( )
o
sp
J
y y k J
u k
S
÷ +
A =
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
22
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
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
2
1
ˆ
y k+
ˆ
y k+
ˆ
k +
ˆ
y k+P
(
(
(
(
(
(
¸ ¸
=
.
Y
( )
1
ˆ
k + Y
( )
1
ˆ
k +
o
Y
( )
k AU
( )
( )
( )
( )
1
2
1
o
o
o
ˆ
y k+
ˆ
y k+
ˆ
k +
ˆ
y k+P
(
(
(
(
(
(
(
¸ ¸
=
.
o
Y
( )
( )
( )
( )
1
1
u k
u k+
k
u k+M-
A (
(
A
(
A
(
(
A
(
¸ ¸
=
.
U
23
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
• 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 + A +
o
Y 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 AU
24
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
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 A + + ÷ (
¸ ¸
1
¯
o
Y S U Y
Process
d(k)
u
y(k) +
(disturbance)
( )
ˆ
y k
(Assume process disturbance is constant for j=1,2,…,P)
25
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
EXAMPLE
The 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, G
d
(s)=G
p
(s). A unit step change in u
occurs at time t=2 min and a step disturbance,

d=0.15,

occurs at
t=8 min. The sampling period is At = 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:
-2
4
20 1
s
Y(s) e
=
U(s) s +
2
5
15 1
- s
Y(s) e
=
U(s) s +
26
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
(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 begins
after t = 25 (k = 10)
Bias correction begins
after t = 19 (k = 4)
27
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
• 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 2
1
1
11 1 11 1
1
1
N
,i ,
N
,i ,N
i
N
i
S u k j i S u k j S u k
ˆ
y k + j i S u k N j j N
÷
=
÷
=
A + ÷ A + ÷ + ÷ = ÷ + + + +
¿ ¿
( ) ( ) ( ) ( ) ( )
1
22 2 22 2
1
1
21 1 21 1
1
2
N
,i ,
N
,i ,N
i
N
i
S u k j i S u k j S u k
ˆ
y k + j i S u k N j j N
÷
=
÷
=
A + ÷ A + ÷ + ÷ = ÷ + + + +
¿ ¿
( ) ( ) ( ) ( ) ( )
1 1
ˆ
ˆ
k + = k k + k k A + + ÷ (
¸ ¸
Φ y y
¯
o
Y S U Y
| |
1 2
T
m
y y y = y
| |
1 2
T
r
u u u = u
( )
( )
( )
( )
1
1
2
1
k+
k+
k +
k+P
×
(
(
(
(
(
(
¸ ¸
y
y
y
¯
¯
¯
=
.
¯
mP
Y
( )
( )
( )
( )
1
1
2
1
ˆ
k+
ˆ
k+
ˆ
k +
ˆ
k+P
×
(
(
(
(
(
(
(
¸ ¸
o
o
o
y
y
y
=
.
o
mP
Y
( )
( )
( )
( )
1
1
1
k
k+
k
k+M-
×
A (
(
A
(
A
(
(
A
(
¸ ¸
u
u
u
=
.
rM
U
28
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
• The matrix is defined as
where denotes the identity matrix
• The dynamic matrix is defined as
where S
i
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 ×
m
I
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 ×
29
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
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).
30
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
Exponential Trajectory from y(k) to y
sp
(k)
A reasonable approach for the

i-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
2
1
k+
k+
k +
k+P
×
(
(
(
(
(
(
¸ ¸
=
.
r
r
r
r
mP
y
y
Y
y
( ) ( ) ( ) ( ) ( )
, ,
1
j j
i r i i i i sp
y k j y k y k o o
(
+ = + ÷
¸ ¸
( )
( )
0
j
i r sp
o = ¬ = y y
31
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
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 o
1 1 1
ˆ
k + k + k + ÷
¯
=
r
E 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 + ÷
¯
=
r
E Y Y
( ) ( ) ( ) ( )
1 1
ˆ
ˆ
k + k + k k + ÷ (
¸ ¸
Φ y y
¯
=
o o
Y 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 AU
( )
k AU
( ) ( ) ( )
o
1 1
ˆ ˆ
k + k + k ¬ = ÷ A E E S U
32
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
MPC Performance Index
• The rM-dimensional vector AU(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 1
T T
( k )
ˆ ˆ
min k k k k
A
= + + + A A
U
Q E E R J 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.
33
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
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.
-1
T T
ˆ
k = k + A + U S Q S R S Q E
S
• This control law can be written in a more compact form
( ) ( )
o
1
c
ˆ
k = k + AU K E
where controller gain matrix K
c

is defined to be:
( )
-1
T T
c
+ = K S Q S R S Q
rM mP ×
• Note that K
c
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
c
cA
J
U
34
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
MPC Control Law:
Receding Horizon Approach
• Note that the controller gain matrix, K
c

, 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 K
c1
is defined to be the first r rows of K
c
.
Thus, K
c1
has dimensions of . r mP ×
.
( ) ( )
1
1
ˆ
k = k + A
o
c
u K E
( ) ( )
o
1
c
ˆ
k = k + AU K E
( )
( )
( )
( )
1
1
1
k
k+
k
k+M-
×
A (
(
A
(
A
(
(
A
(
¸ ¸
u
u
u
=
.
rM
U
( )
k Au
rM mP ×
Advantage: new information in the form of the most recent
measurement y(k)

is utilized immediately
35
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
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 y
o
r
E Y Y
( )
o
1
ˆ
k + E
( )
( )
( )
o
1
-1
T T
ˆ
k = k + A + U S Q S R S Q E
( )
k Au
36
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
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
÷ +
÷ +
s + s = ÷
A s A + s A = ÷
u u u
u u u


( ) ( ) ( )
1, 2, , k j k j k j j P
÷ +
+ s + s + = y y y
¯

37
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
Selection of Design Parameters
Model predictive control techniques include a number
of design parameters:
N :

model horizon
At :

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)
38
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
Selection of Design Parameters
1.

N and At
These parameters should be selected so that N At >

open-loop
settling time. Typical values of N:
30 <

N <

120
2.

Prediction Horizon, P
Increasing P results in less aggressive control action
Set P = N + M
3.

Control Horizon, M
Increasing Mmakes the controller more aggressive and increases
computational effort, typically:
5 <

M<

20 or N/3 <

M<

N/2
4.

Weighting matrices Q and R
Diagonal 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
39
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
Example: SISO system
( )( )
10 1 5 1
-
( )

=
+ +
s
e
G s
s s
1 =70, t = A N
Assume
The controller gain matrix, Kc, for two cases (Q
ii
= 1, R
ii
= 0):
Set-point response [MPC vs. PID (ITAE set-point tuning)]
MPC: small settling time
40
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
Disturbance response [MPC vs. PID (ITAE disturbance tuning)]
MPC: small maximum deviations and non-oscillatory
41
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
• Wood and Berry process

– Saturation limits of were imposed on each input
– +1% set-point change in X
B
at t=0, followed by two feed flow rate
disturbances: +30% increase at t=50 and a return to the original
value at t=100 (F
s
= 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)
1min t = A
0 15 . ±
Control loop Kc
X
D
– R 0.85 7.21
X
B
– S -0.089 8.86
t
I
42
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
Unconstrained MPC vs. Multi-loop Control
MPC is superior to the multi-loop control system (faster responses, less oscillation).
43
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
Effect of input weighting matrix R
When R
ii
are increased, the MPC inputs become smoother and the output
responses have larger deviations and longer settling times.
44
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
Effect of output weighting matrix Q
Control of the more heavily weighted output improves at the expense of
the other output.
45
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
Effect of control horizon M
The y responses are similar, but the u responses are smoother for M = 5.
46
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
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:
– plant: step response coefficient matrix in MPC step format.
47
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
– 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.
48
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
• 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 of
change limits (DelU) on the manipulated variables.
– tfilter: time constants for noise filter and unmeasured
disturbance lags.
– dplant: step response coefficient matrix for the disturbance
generated by the function tfd2step.
– dmodel: step response coefficient matrix for the measured
disturbance 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)
49
M
o
d
e
l

P
r
e
d
i
c
t
i
v
e

C
o
n
t
r
o
l
• 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)

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close