Skip to main content
QUICK REVIEW

[Paper Review] Implementation of Linear Model Predictive Control -- Tutorial

Michael Fink|arXiv (Cornell University)|Sep 24, 2021
Advanced Control Systems OptimizationEngineering6 references6 citations
TL;DR

This tutorial presents a practical implementation of linear Model Predictive Control (MPC) for discrete-time systems with state and input constraints, emphasizing recursive feasibility and stability through terminal constraints and terminal cost. It demonstrates how to reformulate the MPC optimization as a quadratic program for efficient MATLAB computation, validated through simulation examples with and without terminal sets to illustrate loss and recovery of recursive feasibility.

ABSTRACT

This tutorial shows an overview of Model Predictive Control with a linear discrete-time system and constrained states and inputs. The focus is on the implementation of the method under consideration of stability and recursive feasibility. The MATLAB code for the examples and plots is available online.

Motivation & Objective

  • To provide a comprehensive, step-by-step tutorial on implementing linear Model Predictive Control (MPC) for discrete-time systems with state and input constraints.
  • To ensure recursive feasibility and stability in MPC by incorporating a terminal constraint set and terminal cost function.
  • To demonstrate the reformulation of the MPC optimization problem into a quadratic program (QP) for efficient numerical solution in MATLAB.
  • To illustrate the consequences of omitting terminal constraints through simulations showing loss of recursive feasibility.
  • To provide open-source MATLAB code for all examples and plots to support reproducibility and practical learning.

Proposed method

  • Formulate the linear discrete-time system model as $ \boldsymbol{x}_{k+1} = \boldsymbol{A}\boldsymbol{x}_k + \boldsymbol{B}\boldsymbol{u}_k $ with constraints on states $ \boldsymbol{x}_k \in \mathcal{X} $ and inputs $ \boldsymbol{u}_k \in \mathcal{U} $.
  • Define the finite-horizon optimal control problem with a quadratic cost function involving state and input weights $ \boldsymbol{Q} \succeq 0 $, $ \boldsymbol{R} \succ 0 $, and a terminal cost $ \boldsymbol{Q}_f $.
  • Reformulate the MPC problem into a lifted system representation to express all predicted states and inputs as a single optimization vector over the prediction horizon.
  • Impose lifted constraints on the state and input sequences, including terminal constraints $ \boldsymbol{x}_{k+N|k} \in \mathcal{X}_f $ to ensure recursive feasibility.
  • Construct the quadratic program (QP) by expressing the cost and constraints in standard QP form, enabling efficient solution using standard QP solvers in MATLAB.
  • Compute the terminal constraint set $ \mathcal{X}_f $ as the maximum stabilizing set using the MPT3 toolbox to guarantee stability and recursive feasibility.

Experimental results

Research questions

  • RQ1How can linear Model Predictive Control be implemented efficiently while ensuring recursive feasibility and stability under state and input constraints?
  • RQ2What is the role of the terminal cost and terminal constraint set in guaranteeing recursive feasibility and stability in MPC?
  • RQ3How does the omission of a terminal constraint lead to loss of recursive feasibility in MPC simulations?
  • RQ4What is the impact of input and state constraints on the MPC optimization and its solution in practice?
  • RQ5How can the MPC optimization problem be reformulated as a standard quadratic program for fast and reliable numerical solution in MATLAB?

Key findings

  • Without a terminal constraint set $ \mathcal{X}_f $, the MPC optimization can become infeasible after a few iterations, as demonstrated by a simulation with initial state $ \boldsymbol{x}_0 = [7.3\ 10]^\top $, where the last predicted state violated the state constraint.
  • The inclusion of a properly computed terminal constraint set $ \mathcal{X}_f $, derived as the maximum stabilizing set via the MPT3 toolbox, restores recursive feasibility and allows stable, long-term MPC operation.
  • The terminal set $ \mathcal{X}_f $ coincides with the set of feasible initial states $ \mathcal{X}_N $, and the initial state $ \boldsymbol{x}_0 = [7.3\ 10]^\top $ lies on its boundary, indicating sensitivity to perturbations.
  • The applied input $ u $ initially reaches the input constraint limit of $ -20 $, indicating active constraints, before transitioning to a non-active regime as the system evolves toward the origin.
  • The simulation results confirm that recursive feasibility is maintained when the terminal set is used, as the last predicted state remains within $ \mathcal{X}_f $ at each time step.
  • The MATLAB code for all examples and plots is publicly available at https://github.com/placebovitamin/MPC-Tutorial, enabling reproducibility and practical implementation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.