Discrete-Time MPC
1. Introduction
1.1 Background Info
This is a simple Single-Input Single-Output (SISO) feedback control system

with the parameters
Reference Signal Control Input Signal Output Signal Defined Error Function
We want the Output Signal

What can we do to optimize this system?
-
In terms of Output Result
The smaller the
is, the better the performance -
In terms of Energy Consumption
The smaller the
is, the less energy consumed in control -
If we want to optimize both
We could minimize the following Optimization Objective under the constraints you set
Notice that
and are weights of regulation
We could extend function to express the optimization objective of a Multi-Input Multi-Output (MIMO) system
-
State-Space Representation of MIMO System
with the parameters
State Matrix Control Input Matrix Output Matrix Weight Matrices
-
Optimization Objective in Matrix Form
with the parameters
Error Matrix Control Input Matrix Diagonal Weight Matrices
1.2 What is Model Predictive Control
Also known as Receding Horizon Control
Using models to predict the performance of system within a period of time in the future for optimal control
Generally, MPC uses discrete state-space expressions
-
System state at time step
depends on state and input at time step
[Workflow at Time Step

-
Step 1
Measure / Estimate current system state
-
Step 2
Predict based on what we have at time step
-
Plan the moves
Control Horizon -
Predict the state
Predictive Horizon -
Optimization Objective
(Of course, add some constraints if you want to)
with one extra term
Terminal Cost Diagonal Weight Matrix-
Error Matrix
-
-
Step 3
Only Apply
Then move one step further
2. Basic Mathematical Model
A common solution to optimize MPC is Quadratic Programming (QP), the goal is to write the problem in the form of QP
2.1 Quadratic Programming
Basic form of quatratic program is below
where
Quadratic Term Linear Term
For the Quadratic Term
Then we could expand it as below
Minimizing this equation is a least square problem and we've had a lot of mature solutions with MATLAB or Python...
Active Set
qpOASESAugmented Lagrangian
OSQPInterior Point
CVXOPT-
Generic Quadratic Programming Solver Library
qpsolvers
Yeah, this is good ()
2.2 Basic Optimization Objective
Given the following MIMO System
The state matrix
For this system, at time step
Assume having
future time steps
Assume Reference Signal
With the above information, the Optimization Objective Function (see eq.1) is defined as below
Since
So we need to somehow get rid of it
2.3 Equation of Predicted Future States
We use eq.2 to expand all future states predicted at time step
(Assume
Rewrite the above expansion into matrix form using eq.4 definitions
2.4 Reduced Optimization Objective
We can rewrite all terms in eq.5 into matrix form
-
Weighted Sum of Error & Weighted Sum of Terminal Cost
We can rewrite the above two terms together into Matrix Form, again, using eq.4 definitions
-
Weighted Sum of Input
-
Reduced Optimization Objective
Plugin eq.7 eq.8 & eq.9 back to eq.5
[Final Form] Optimization Objective with only
TermsYou'll also find that eq.10 perfectly fits the basic form of Quadratic Program in 2.1