You are on page 1of 51

Short Introduction to

Model based Predictive Control

Jaroslav Peka
May, 2010

e-mail: Jaroslav.Pekar@Honeywell.com

Agenda

Introduction and motivation


Linear Model Predictive Control (MPC)
Linear MPC analysis (receding horizon, stability, robustness)
Numerical optimization for MPC
Nonlinear Model Predictive Control

Jaroslav Peka, 2010

Introduction and motivation

Advanced control technologies in the process control

Jaroslav Peka, 2010

Introduction and motivation

Instrumentation layer

Interface to the controlled technology


Actuators and sensors
Number of I/O points may be large more than several thousands
Periodical reading\writing, the measured values are marked by time
stamp and are organized in a process history database

Jaroslav Peka, 2010

Introduction and motivation

Basic control layer

Core control system


Ensures basic functionality and safe operation
Provides backup solution for the advanced control
Basic monitoring and visualization tools
Provides basic control modes for the operators man/aut/cas

Used as a gate for the advanced control technologies


System prestabilization
Nonlinearity reduction

Jaroslav Peka, 2010

Introduction and motivation

Advanced control layer

Advanced functionalities, optimization and coordination


Interaction with the basic control layer
Coordination of basic control loops by manipulating their set-points
Slower sampling periodes than in the basic control layer
Static/dynamic optimization

The main goal is to ensure the optimal operation of the plant under the
given conditions which are driven namely by actual technological and
economical conditions and by resource restrictions.
Basic requirements on advanced control layer
Multivariable control
Various constraints handling
Optimal silution

Jaroslav Peka, 2010

MPC is a candidate

Introduction and motivation

Planning layer
Top supervisory layer
Entry points for the plant technologists and managers
Based on economic-related information and provides complex overview
of the plant performance
Main tools are namely databases, visualization tools and specialized
computation routines
Specification of goals for the advanced control layer, i.e. set-point,
constraints, optimality conditions, resource availability, etc.

Jaroslav Peka, 2010

Introduction and motivation


Model Predictive Control
A control technology that enables to delivery the decided goals specified for the
controlled process
NOT a technology that could replace all the control techniques.

Success of applications depends namely on the skills of the application


engineers responsible for MPC implementation to particular process
Transformation of MPC problem to an optimization problem is relatively simple
The difficult part is formulation of the control problem as a MPC problem

Jaroslav Peka, 2010

Agenda

Introduction and motivation


Linear Model Predictive Control (MPC)
Linear MPC analysis (receding horizon, stability, robustness)
Numerical optimization for MPC
Nonlinear Model Predictive Control

Jaroslav Peka, 2010

Linear Model Predictive Control

MPC has gained in popularity because it provides a systematic


approach to control the multivariable dynamical systems with
constraints.
MPC refers to class of computer algorithms that use a system
model to predict the future responses of a plant. The prediction is
then used for calculation of the optimal control action.

Jaroslav Peka, 2010

10

Linear Model Predictive Control

Jaroslav Peka, 2010

11

Linear Model Predictive Control


PID Controller

MPC Controller

process output

proces s output
60

60
setpoint
process output

40

am plitude [-]

am plitude [-]

40
20
0
-20

setpoint
process output

20
0
-20

20

40

60

80

100

20

40

20

40

am plitude [-]

am plitude [-]

time [s]
process input

0
-2
-4

60
tim e [s]
proc ess input

80

100

80

100

2
0
-2
-4

-6
0

20

40

60
time [s]

Jaroslav Peka, 2010

80

100

-6
60
tim e [s]

12

Linear Model Predictive Control


Main parts of the MPC controller
System model and predictions
The modeling stage in MPC design is one of the most important activities.
The quality of the resulting controller is proportional to the model quality
and therefore, the model should describe the system as accurate as
possible.

Control problem and MPC formulation


This is an important part which usually requires practical experiences.
Sometimes, it is difficult even to identify what should be controlled and
optimized. We have to know all the basic properties and limitations of MPC
at this stage.

Optimization problem
The last step is translation of the MPC control problem to a numerical
optimization problem. Usually this is relatively easy part.

Jaroslav Peka, 2010

13

System model and predictions

Impulse response

y (t ) = hi u (t i )
i =1

The prediction will be:


N

y (t + k | t ) = hi u (t + k i | t )
i =1

This model has been accepted in industrial practice because it is


very intuitive and clearly reflects the influence of each
manipulated variable on a determined output.
Jaroslav Peka, 2010

14

System model and predictions

Step response

y (t ) = y0 + g i u (t i )
i =1

The prediction will be

y (t + k | t ) = g i u (t + k i | t )
i =1

This model has the same advantages and disadvantages as the


impulse response.

Jaroslav Peka, 2010

15

System model and predictions

ARX based models

The resulting prediction model is given by

Jaroslav Peka, 2010

16

System model and predictions


State space models (ideal candidate for MPC)

Prediction of the system output trajectory is given by

Jaroslav Peka, 2010

17

System model and predictions


Summary

Jaroslav Peka, 2010

18

Cost function
The cost function is used to formulate goals for the MPC
controller. It has usually additive form where the individual terms
express various control requirements. The terms are multiplied by
factors defining the relative importance of the control goals. Basic
cost function has the form
2
2

2
2

or

2
2

Jaroslav Peka, 2010

2
2

19

Cost function
Different norms in the cost function

Jaroslav Peka, 2010

20

Cost function

Jaroslav Peka, 2010

21

Constraints
A real differentiator for the MPC controllers is the fact that they
can handle the system constraints in a straightforward manner.
All processes have some constraints, e.g. actuator position and
rate of change constraints or constraints for the system output or
any internal state

HARD CONSTRAINTS
physical limitations of real process, e.g. actuator extreme positions
and this type of constraints must not be violated

SOFT CONSTRAINTS
these can be violated though at some penalty, for example a loss of
product quality.

Jaroslav Peka, 2010

22

Constraints
The soft constraints are used whenever there are some
disturbances acting directly on the constrained variable, typically
all the system states and outputs. They are very important for all
practical implementations because the soft constraints ensure the
feasibility of the MPC optimization problem. The soft constraints
can be formulated by introducing a slack optimization variable or
vector. Assume, for example, an upper limit for the system
output, then

Jaroslav Peka, 2010

23

Optimization problem
The basic MPC control problem can be formulated as an
optimization problem

subject to

Jaroslav Peka, 2010

24

Optimization problem
The MPC problem for a linear system with the linear constraints
can be transformed to a mathematical programming problem of
the form

which is well known Quadratic Programming problem

Jaroslav Peka, 2010

25

Receding Horizon Control

It has been shown that the MPC control problem can be


transformed to an optimization problem, which is parameterized
by a parameter vector.
The result of the optimization problem at time t0 is the optimal
future trajectory of the system input
An immediate idea would be to apply the whole sequence and to
compute the new trajectories at the end of prediction horizon, i.e.
at time tN. Such MPC control strategy corresponds to the open
loop control, without any feedback during the prediction horizon.

not a good idea


Jaroslav Peka, 2010

26

Receding Horizon Control

The standard feedback, as we know it for the classical control


methods, is introduced by using so called Receding Horizon
Control.
In the Receding Horizon Control, the optimization problem is
computed at each sampling period after having new system
measurements or estimates and we apply only the first control
action from the optimal input vector. This strategy ensures the
standard feedback control in the MPC.

much better
Note that MPC is sometime called directly as receding horizon control

Jaroslav Peka, 2010

27

Offset-free tracking

In the classical control methods, the offset-free tracking control is


achieved by intruding the integral action to the controller.
It is clear that if the MPC controller uses a perfect model and
there are no disturbances acting on the system, we will not need
to use any additional mechanism to achieve the offset-free
tracking, but this is not a realistic assumption.
The integral action usually acts on the tracking error. The
question is, how to achieve the offset-free tracking property in the
model predictive control?

Jaroslav Peka, 2010

28

Offset-free tracking
There are several possibilities but we will mention only the two
most important from the practical point of view:
The first option is to introduce the integral term acting on the tracking
error into the cost function. This approach copies strategy from the
standard PID control and requires implementation of an anti-windup
mechanism which may be impractical.
The second approach is based on assumption that there are virtual
disturbance variables acting on the system. These virtual
disturbances covers the real disturbances, but also model
inaccuracy. This approach has been utilized successfully by many
industrial MPC applications. The disturbances can be estimated by
using the augmented system state observer, These techniques are
known as Unknown Input Observer.

Jaroslav Peka, 2010

29

Offset-free tracking

The virtual disturbances can be connected to the system in a


number of ways. Consider a linear model of a controlled process

Assume a disturbance model

Jaroslav Peka, 2010

30

Offset-free tracking

Disturbance acting on the system output

Disturbance acting on the system input

Jaroslav Peka, 2010

31

Linear MPC analysis


The classical feedback controllers (PID) can be analyzed in a
number of ways. The most important properties are the nominal
performance, stability and robustness.
Similar analysis can be done for the MPC controller.
Difference between the classical control and MPC is that the
MPC computes directly the sequence of the control actions
instead of using a control law.
In fact, the optimization problem could be seen as a control law.
Why the MPC controller cannot be simple analyzed as a classical
controller, e.g. PID? - the answer is - due to presence of
constraints. It can be shown, that we can find a control law for
each combination of feasible active constraints in the form

Jaroslav Peka, 2010

32

Unconstrained linear MPC

Assume that the system can be described by a state space


model, then the prediction is given by

Assume a quadratic cost function defining the tracking MPC


problem

Jaroslav Peka, 2010

33

Unconstrained linear MPC

Then the optimal control problem is

with solution

By applying the receding horizon strategy, we can define control


law in the form

Jaroslav Peka, 2010

34

Unconstrained linear MPC - example

System defined by

Cost function

Control law

Jaroslav Peka, 2010

35

Unconstrained linear MPC - example

Jaroslav Peka, 2010

36

Stability

Extension of finite prediction horizon to infinite

Jaroslav Peka, 2010

37

Stability

The quasi-infinite cost function can be written as

where

We can show that

Jaroslav Peka, 2010

38

Stability
Stability constraints
Terminal equality constraints
Terminal cost function
Terminal constraint set

Positively invariant sets

Jaroslav Peka, 2010

39

Stability

MPC formulation

Constraints

Stability constraints

Jaroslav Peka, 2010

40

Stability

Positively invariant sets - examples

Jaroslav Peka, 2010

41

Stability - proof

Lyapunov function

Shifted control sequence due to RH control

Jaroslav Peka, 2010

42

Stability - proof

From definition

Then

It holds that

Jaroslav Peka, 2010

43

Stability - proof

Finally

The Lyapunov function must satisfy

and therefore

Jaroslav Peka, 2010

44

Stability - proof

Jaroslav Peka, 2010

45

Nonlinear MPC

The modeling phase in the NMPC is the most difficult part

The cost function has an integral part

Jaroslav Peka, 2010

46

Nonlinear MPC

Finite cost function

Jaroslav Peka, 2010

47

Nonlinear MPC

Optimization problem

Jaroslav Peka, 2010

48

Nonlinear MPC - stability

Lyapunov function

Jaroslav Peka, 2010

49

Numerical methods in NMPC

Jaroslav Peka, 2010

50

Numerical methods in NMPC

Jaroslav Peka, 2010

51

You might also like