Model Predictive Control (MPC) is a receding-horizon optimal control strategy that computes control inputs by solving a finite-horizon optimization problem at each time step. Unlike LQR, which applies a fixed gain computed offline, MPC re-solves the optimization online, enabling it to handle constraints on control inputs directly.
At each sample instant, MPC predicts the future system trajectory over a prediction horizon
Key advantages over LQR:
- Explicit handling of input constraints (actuator limits)
- Preview and anticipation of future reference changes
- Tunable trade-off between horizon length and computational cost
When to use MPC:
- Systems with actuator saturation or operational limits
- Multi-input multi-output (MIMO) systems requiring coordinated control
- Applications where the computational budget allows online optimization (typically
$N_c \cdot m \leq 20$ )
- Discrete-time linear state-space model:
$x_{k+1} = Ax_k + Bu_k$ - Quadratic cost weighting matrices
$Q \succeq 0$ (state),$R \succ 0$ (control) - Optional terminal cost matrix
$P \succeq 0$ (typically from DARE)
Cost function over prediction horizon
For
The future state trajectory can be expressed as:
where
State propagation matrix
Control-to-state matrix
Substituting predictions into the cost yields a quadratic program in
where:
Setting
Solved via Gaussian elimination (
For control input constraints
| Phase | Time | Space | Notes |
|---|---|---|---|
| Offline | Prediction matrices, Hessian, gradient precomputed | ||
| Online | Gaussian elimination to solve |
||
| Per step | Matrix-vector product |
For typical embedded use (
System: Double integrator with
Step 1 — Build
Step 2 — Build
Step 3 — Compute
Step 4 — Online solve for
Solve
Apply first element
-
Horizon too short: If
$N_p$ is too small, the controller is myopic and may produce oscillatory or unstable behavior. Use DARE terminal cost$P$ to mitigate. -
Ill-conditioned Hessian: Very large
$Q/R$ ratios create poorly conditioned$H$ . Keep$Q$ and$R$ within 3–4 orders of magnitude of each other. - Constraint infeasibility: Box constraints that are too tight for the required control effort will clamp every step, degrading performance. Monitor constraint activity.
-
Fixed-point overflow: For Q15/Q31 types, the Hessian elements grow with horizon length. Keep
$N_c \cdot m$ small and scale weights carefully. -
Stack usage: All matrices are stack-allocated. A system with
$n=3, m=2, N_c=10$ creates a$20 \times 20$ Hessian (1600 bytes for float). Monitor stack budget. -
Terminal cost omission: Without terminal cost
$P$ , the controller ignores cost-to-go beyond the horizon, leading to suboptimal or unstable behavior for short horizons.
| Variant | Key Difference | Use Case |
|---|---|---|
| Nonlinear MPC (NMPC) | Nonlinear prediction model, requires iterative optimization | Nonlinear plants, high-accuracy |
| Explicit MPC | Precomputes control law as piecewise affine function | Very fast online evaluation |
| Move-Blocking MPC | Constrains control moves to change only at specific steps | Reduces QP size |
| Adaptive MPC | Updates plant model online | Time-varying or uncertain systems |
| Distributed MPC | Decomposes problem across subsystems | Large-scale multi-agent systems |
| Robust MPC | Accounts for bounded disturbances in constraints | Safety-critical applications |
- Autonomous vehicles: Path tracking with steering and acceleration limits
- Process control: Chemical reactor temperature/pressure regulation with valve constraints
- Robotics: Joint torque-constrained trajectory tracking
- Power electronics: Voltage/current regulation in converters with switching constraints
- HVAC systems: Energy-efficient building climate control with comfort bounds
- Quadrotor control: Attitude and position control with thrust limits
graph LR
DARE["Discrete Algebraic<br/>Riccati Equation"] -->|terminal cost P| MPC["Model Predictive<br/>Controller"]
GE["Gaussian<br/>Elimination"] -->|solves H·U = -F·x| MPC
LQR["LQR Controller"] -.->|special case<br/>N→∞, no constraints| MPC
MPC -->|first control move| Plant["Plant Model"]
Plant -->|state measurement| MPC
-
LQR is the infinite-horizon, unconstrained special case of MPC. As
$N_p \to \infty$ with DARE terminal cost, the MPC gain converges to the LQR gain. -
DARE computes the terminal cost matrix
$P$ , ensuring the finite-horizon problem approximates the infinite-horizon solution. -
Gaussian Elimination solves the dense linear system
$H\mathbf{U} = -Fx$ at each step. For constrained problems, iterative QP solvers could replace this. - Kalman Filter provides state estimates when full state measurement is unavailable (MPC + KF = output-feedback MPC).
- Maciejowski, J.M., Predictive Control with Constraints, Prentice Hall, 2002.
- Rawlings, J.B. and Mayne, D.Q., Model Predictive Control: Theory and Design, Nob Hill Publishing, 2009.
- Camacho, E.F. and Bordons, C., Model Predictive Control, 2nd ed., Springer, 2007.
- Borrelli, F., Bemporad, A., and Morari, M., Predictive Control for Linear and Hybrid Systems, Cambridge University Press, 2017.
- Wang, L., Model Predictive Control System Design and Implementation Using MATLAB, Springer, 2009.