0% found this document useful (0 votes)
16 views

Topic 4 Notes - Model Predictive Control (MPC)

DUT Process Control Systems Note - Model Predictive Control
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Topic 4 Notes - Model Predictive Control (MPC)

DUT Process Control Systems Note - Model Predictive Control
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

PROCESS CONTROL SYSTEMS 3B (PCSB301)

TOPIC 4 NOTES – MODEL PREDICTIVE CONTROL (MPC)


N.B Prescribed/Recommended Books
Instrument Engineers Handbook (Vol 2): Process Control and Optimization
Programmable Logic Controllers W. Bolton
Programmable Logic Controllers F. Petruzella
Control Guru - Practical Process Control
PCSB NOTES

TOPIC 2 - PID CONTROLLER TUNING


• Refer to Chapter 2.25
TOPIC 4: MODEL PREDICTIVE CONTROL (MPC)
➢ Refer to Chapter 2,17 (MPC) & related reference material.
➢ Developed in the 1980’s for the petrochemical industry.
➢ Found its way in other fields, motor vehicle control, aerospace, electric motor, etc.
➢ Also known as Receding Horizon Control.
➢ Rich literature. Well researched.
➢ MPC relies on discrete calculations.
Benefits of MPCs
Can be applied to Multiple Input, Multiple Output (MIMO) systems, distillation column is an example of
MIMO system; it has multiple inputs such as feed, temperature regulation, pressure regulation, the reflux
rate and the outputs such as tops products, bottoms products concentrations.
Can be applied in systems with Single Input, Single Output (SISO).
Used in highly interactive process or coupled process for example boiler’s FD and ID fans, which interact
with one another to give a balanced pressure control; if FD fan slows down, pressure in the furnace will
be affected, ID fan on the furnace has to be increased or decreased to negate that effect.
Used in process with large deadtime, like PID control.
Used in systems with higher order dynamics and systems with inverse dynamics.
➢ Linear / Non-Linear Models – Can be applied to linear and non-linear models depending on the non-
linearity; the models can be broken down into several linear models to capture the non-linear behavior.
➢ Anticipate Future Process Behaviors – MPC looks at what the future process will look like, it forecasts
using the algorithm then a corrective action can be taken in the present.

MPC FRAMEWORK
➢ Time is denoted by k, k+1 is the discrete time step ahead; k + p is the furthest and the prediction horizon.
➢ Based on the past the model of the system can be future values can be anticipated by the calculating
future control moves.
➢ The green line represents the future control moves, it is valve movement calculated by the MPC up to
the prediction horizon.

Page | 1
MODEL PREDICTIVE CONTROL (MPC)
➢ Calculated measurement output is what is being controlled, if it was a temperature and it has to be
brought up to the reference trajectory or the set point.
➢ MPC calculates the control moves (green line) for the border prediction horizon such that the error
between the predicted output and the reference trajectory is minimized.
➢ MPC needs a model-, needs to work out moves such that the errors are reduced.
➢ The output will be the first from k to k+1, the rest are disregarded then they are implemented on the
next pulse from k+1 to k+2.
Chess Example
➢ The controller makes moves based on what it anticipates, and the plant will move in the future.
➢ The controller works out all the possible scenarios or moves of the plant.
➢ With a highly complex model, more moves can be made.

Speeding Vehicle
➢ The accelerator pedal and the steering column are the variables.
➢ Assuming the vehicle is moving at a constant speed, accelerator pedal is not needed.
➢ The reference goes to the MPC controller, if the model has errors, the errors can be eliminated by
disturbance vectors, which are factored in the MPC algorithm.
➢ The ideal scenario is to get a linear model that gives good representation of the vehicle dynamics.
➢ The output is the relative angular displacement of the steering wheel, whether it is going to the right or
left, and how far left or right.
➢ Feedback in needed to give the MPC past values.
➢ The plant model computes all the scenarios and computes all the control moves so that the vehicle starts
from one position and end up to the reference input.

Reference
Vehicle

Page | 2
MODEL PREDICTIVE CONTROL (MPC)
MPC COMPONENTS
➢ In MPC different scenarios are solved in real time and implement control moves to control the plant.
1. Prediction horizon & Control horizon.
2. Modeling.
3. Performance index.
4. Degrees of freedom (DOF).
5. Constraint handling.
6. Multivariable control (MIMO)
1. Prediction Horizon – always predict beyond the process setting time, this is done to account for the overall
process dynamics.
Analogy of Car Breaking distance
• if there is a short prediction horizon and the speed is controlled this will create a scenario where the
driver will not be able to stop or take corrective action quick enough because the driver cannot see the
road.
• Prediction horizon is the time the optimizer needs to make a computation, viable for the capture of the
full process dynamics.
▪ Receding Horizon – the horizon is constantly moving away however it is still the same.

▪ Control Horizon – it is the control moves made, the moves that the controller needs to make.
2. Modelling – Modelling is the core part of MPC, it must be ideally linear, good enough to capture the
essence of the dynamic characteristics. Parameters are easily identifiable such that if there is a step input to
the plant there should be an appropriate response.
• Must give accurate long-range predictions.
• If the model is poorly designed, this can lead to calculation errors.

▪ These are the model input in different points in time, the actual system is the red line
(it is used for long range predictions, the predictions should be close enough to the
actual system.)
▪ Modelling is important when it comes to determining process parameters.
Page | 3
MODEL PREDICTIVE CONTROL (MPC)
3. Performance Index (J)
➢ The performance index is minimized using MPC.

3
4 1. Slow.
2
2. Oscillatory.

1 3. Unstable.
4. Ideal

▪ Trade-off between optimal and robust performance.


▪ Gives numeric value to the “best” system.
▪ Use quadratic performance index (PI).
▪ Poor model (use simple PI), good model (complex PI)
3. Degrees Of Freedom (DOF)
➢ Relates to the complexity of input predictions.
➢ DOF is linked to the prediction model.

➢ First order system will not capture all the dynamics of the process output.
➢ DOF linked to how complex the process is.
➢ Higher model, capturing all the dynamics can give a good prediction.
➢ Also relates to the order of the model that is being implemented to the MPC scheme.
4. Constraint Handling
➢ Control valve limits (0-100%).
➢ Vehicle throttle & steering limits.
➢ Critical to get robust control
➢ FCE limits (constraints) must be part of the prediction.
➢ There are two types of constraints
Page | 4
MODEL PREDICTIVE CONTROL (MPC)
▪ Hard Constraints – These are strict limits that the system must always adhere to. Violating a hard
constraint is not permissible. A control move cannot move beyond this constraint.
▪ Soft Constraints - These constraints are more flexible and can be violated, if necessary, but with a
penalty. They are often used when it’s acceptable to exceed the limit slightly under certain
conditions. For example, this constraint allows some degree of valve travel just outside of it.
5. Multivariable Control (MIMO)
➢ The system can be handled by MPC, e.g. 2 Inputs and 2 Outputs; an example of 2 inputs and 2 outputs
is a car.
➢ Distillation column is another example of a practical process environment; it has 4 inputs (Feed going
in, Temperature, Pressure and Reflux) and 2 outputs (Distillate, Concentrations (bottom & top)).

➢ With MPC there can be one framework, where all the inputs are fed into it, it will have models for
distillation column, temperature, pressure built into the MPC scheme; and it works out control moves
and implement the output to each valve and output signals.
➢ MPC can handle complex schemes.

MPC DRAWBACKS
➢ This technique has found great success in industry where conventional PID fails.
1. Requires a simple model (Identification, linearization, nonlinear systems, time variations).
2. Needs a “real-time” optimization to solve the control problem (quadratic equation).
3. If system is not well designed, it will lead to ill-opposed solutions and therefore result in poor control.

MPC MODELLING
➢ Use of mathematics to make models for predictions.
➢ Linear models are ideal and generally good enough. State models are used because they are simple to
implement in matrix.
Linear Models
➢ Transfer functions (not good for MIMO systems).
➢ Laplace transfer functions are not used because they are done in continuous time, and MPC is done in
discrete time.
➢ State space is used to show derivation of the prediction of the output.

Page | 5
MODEL PREDICTIVE CONTROL (MPC)
Continuous Versus Discrete Models
➢ Continuous algorithms need time to make control move decisions.
➢ Mathematical discrete is needed so that in between the sampling intervals calculations can be
implemented to determine the next prediction and then make a decision.
Sampling Rate
The prediction window must capture essence of the dynamics, capturing the principal dynamics used to
calculate and determine the prediction window.

Prediction Using State Space

➢ 𝒙𝒌+𝟏 is the one step ahead; k is the current point in time


➢ K+1 is the future state in time.
➢ 𝒚𝒌 is the output state, which is the output from the process model or output for the system.
➢ 𝒖𝒌 is the input to the model.
➢ A, B, C and D are the model parameters.
➢ 𝒅𝒌 is the disturbance variable, which relates to the modelling errors or any disturbance affecting the
plant.
❖ In most systems D = 0, therefore.
𝒚𝒌 = 𝑪𝒙𝒌 + 𝒅𝒌
To work out the next prediction
➢ 𝒅𝒌+𝟏 = 𝒅𝒌 , assuming that the next disturbance will not be very large.

Page | 6
MODEL PREDICTIVE CONTROL (MPC)
N-Step Ahead Predictions

➢ n is the number of values to get to the prediction horizon.


States
One step ahead predictor

Two steps ahead predictor.

Three steps ahead predictor

Four steps ahead predictor

➢ To work out the steps ahead in time, this is done.

➢ The previous time frame is used to work out the next ahead.
➢ A pattern is formed if the brackets are multiplied out.

The step for n- step ahead predictor is given by

Page | 7
MODEL PREDICTIVE CONTROL (MPC)
Output

Notations

This is a 4-step ahead predictor starting at time k

This is a 6-step ahead predictor starting at time k+2

Split into Known and Unknown

Known Unknown

Known Unknown

Vector Notation
➢ Vector gives direction.

▪ 𝒙𝒌+𝟏 up to 𝒙𝒌+𝒏|𝒌 which is the prediction horizon, can be compactly


written as 𝒙𝒌+𝟏

▪ Predictive state is moving ahead in time, this is indicated by the arrow.

Page | 8
MODEL PREDICTIVE CONTROL (MPC)
Vector Notation (State)

Vector Notation Separated Into Past And Prediction Variables (State)

➢ 𝒖𝒌 are all pulled out MPC has to work out decision variables to work out the output.

Compact Notation. (State)


➢ This is used to work out state in terms of prediction ahead at k+1 time.

Vector Notation Separated into Past And Prediction Variables. (Output)

➢ Output ahead in step (𝒚𝒌+𝟏 ) relies on the measurement state.



➢ Output also relies on the disturbance vector (𝒅𝑘 ).

Compact Notation. (Output)

Page | 9
MODEL PREDICTIVE CONTROL (MPC)
➢ 𝒚𝒌+𝟏 is the predicted output

➢ 𝑷𝒙 are the model parameters, 1st matrix.
Performance Index Formulation
▪ MPC is based on optimal performance; Optimal Performance means that the control system is designed
to predict future behavior and make decisions that minimize a cost function, such as energy consumption
or deviation from a desired trajectory. This ensures that the system operates in the most efficient and
effective manner possible.
▪ Performance measure is formatted, so that the system can work out the best possible moves in terms of
the future which is the goal of an MPC.
▪ This is done by minimizing performance index (J).
▪ No easy analytical expressions for fastest settling time, smallest actuation energy, fastest rise time and
minimum error when there is a disturbance.
A Quadratic Function of The PI Is The Solution
➢ Quadratic functions are the best solution when state space models are determined.
➢ Performance measure is determined such that the minimum value is obtained so that the optimal
solution can be found for control move for 𝒖𝒌 .

➢ The error is squared.


➢ The valve will move too radically (too much FCE movement), leading to wear and tear therefore this
cannot be used (diagram below).

Page | 10
MODEL PREDICTIVE CONTROL (MPC)
➢ The valve be implemented (𝒖𝒌 𝟐 ) as shown below.
➢ Lambda (𝜆) is the tunable parameter.
➢ How much the signal to the valve is moving can be chosen because too much of movement to the valve
can be penalized depending on the weighting factor lambda.
➢ Solution does not converge because it will try to minimize the error and the movement if the controller
output which is the signal to the valve. If the error and movement to the valve are zero, it will not be
possible.
➢ Then the performance measure will not be good enough.

➢ The equation below shows the proper performance index.


➢ The error is taken from the reference minus the output.
➢ Any future errors are predicted by using the output prediction model.
➢ 𝑾𝒖 is the weighting parameter; 𝒖𝒌 is the decision variable being worked out.
➢ 𝒖𝒔𝒔 is the steady state value.

➢ There is a system trajectory or set point, the output is worked out and modelled based on the equations
in the previous pages.
➢ The system will come rest at a certain time, whatever time will come to rest at will be the system steady
state as shown below.

Steady State

Page | 11
MODEL PREDICTIVE CONTROL (MPC)
MPC CONTROLLER DESIGN PROCEDURE
1. Determine the relevant CV’s, MV’s, and DV’s.
2. Conduct plant test: Vary MV’s and DV’s & record the response of CV’s.
3. Derive a dynamic model from the plant test data.
4. Configure the MPC controller and enter initial tuning parameters.
5. Test the controller off-line using closed loop simulation.
6. Download the configured controller to the destination machine (embedded system) and test the model
predictions in open-loop mode.
7. Commission the controller and refine the tuning as needed.

MATLAB IMPLEMENTATION
Model Predictive Control MATLAB Examples (Link)
MPC MATLAB FILES (Link)

Page | 12
MODEL PREDICTIVE CONTROL (MPC)

You might also like