Model Predictive Control Toolbox

Designing and Simulating Model Predictive Controllers

Model predictive controllers can be used to optimize closed-loop system performance of MIMO plants subject to input and output constraints. Because they base their actions on an internal plant model, model predictive controllers can forecast future process behavior and adjust control actions accordingly. The ability to model process interactions often enables model predictive controllers to outperform multiple PID control loops, which require individual tuning and other techniques to reduce loop coupling.

Model Predictive Control Toolbox provide functions, an app, and Simulink blocks for designing and simulating model predictive controllers in MATLAB and Simulink.

You can iteratively improve your controller design by defining an internal plant model, adjusting controller parameters such as weights and constraints, and simulating closed-loop system response to evaluate controller performance.

Getting Started with Model Predictive Control Toolbox 10:07
Use Model Predictive Control Toolbox™ to design and simulate model predictive controllers.

Defining Internal Plant Models

When designing a model predictive controller in Simulink, you can use Simulink Control Design to extract a linearized form of the Simulink model and automatically import it into the controller as the internal plant model.

Alternatively, you can use linear time-invariant (LTI) systems from Control System Toolbox, such as a transfer function or a state-space model, to specify the internal plant model. You can import LTI models from the MATLAB workspace or from MAT-files into the toolbox. The toolbox also lets you directly import models created from measured input-output data using System Identification Toolbox.

Designing Controllers

Once you have defined the internal plant model you can complete the design of your model predictive controller by specifying the following controller parameters:

  • Prediction and control horizons
  • Hard and soft constraints on manipulated variables and output variables
  • Weights on manipulated variables and output variables
  • Models for measurement noise and for unmeasured input and output disturbances
Dialog box for selecting a plant model and specifying the control interval, prediction horizon, and control horizon in Model Predictive Control Toolbox.
Dialog box for selecting a plant model and specifying the control interval, prediction horizon, and control horizon in Model Predictive Control Toolbox.
Dialog box for setting constraints on manipulated variables and output variables in Model Predictive Control Toolbox.
Dialog box for setting constraints on manipulated variables and output variables in Model Predictive Control Toolbox.

In addition to constant constraints and weights, the toolbox supports time-varying constraints and weights, constraints on linear combinations of manipulated variables and output variables, terminal constraints and weights, and constraints in the form of linear off-diagonal weights. The toolbox also supports constraint softening.

Running Closed-Loop Simulations

You can use functions or the MPC Design app to run closed-loop simulations of your model predictive controller against linear plant models. The app lets you set up multiple simulation scenarios. For each scenario you can specify controller set points and disturbances by choosing from common signal profiles, such as step, ramp, sine wave, or random signal.

Graphical tool for configuring and running a simulation to test a controller against a linear plant model.
Configuring and running a simulation to test a controller against a linear plant model in the MPC Design app.

To assess the effects of model mismatch, you can simulate a controller against a linear plant model that is different from the internal plant model used by the controller. You can also simulate multiple controller designs against the same plant model to see how different weight and constraint settings affect controller performance. The toolbox lets you disable constraints to evaluate characteristics of the closed-loop dynamics, such as stability and damping.

Using Simulink blocks provided with Model Predictive Control Toolbox, you can run closed-loop simulations of your model predictive controller against a nonlinear Simulink model. You can configure the blocks to accept time-varying constraint signals that are generated by other Simulink blocks.

Simulink model for running closed-loop simulations of a model predictive controller and a nonlinear plant model, with controller constraints calculated by other Simulink blocks.
Simulink model for running closed-loop simulations of a model predictive controller and a nonlinear plant model, with controller constraints calculated by other Simulink blocks.
Next: Customize Constraints and Weights

Try Model Predictive Control Toolbox

Get trial software

モデル予測制御(MPC)入門

View webinar