Model Predictive Control Toolbox

Design and simulate model predictive controllers

 

Model Predictive Control Toolbox™ provides functions, an app, and Simulink® blocks for designing and simulating model predictive controllers (MPCs). The toolbox lets you specify plant and disturbance models, horizons, constraints, and weights. By running closed-loop simulations, you can evaluate controller performance.

You can adjust the behavior of the controller by varying its weights and constraints at run time. To control a nonlinear plant, you can implement adaptive and gain-scheduled MPCs. For applications with fast sample rates, you can generate an explicit model predictive controller from a regular controller or implement an approximate solution.

For rapid prototyping and embedded system implementation, the toolbox supports C code and IEC 61131-3 Structured Text generation.

Get Started:

Designing Model Predictive Controllers

Design MPC controllers to control MIMO systems subject to input and output constraints. Run closed-loop simulations to evaluate controller performance.

MPC Design in MATLAB

Use command-line functions to design MPC controllers. Define an internal plant model, adjust weights, constraints, and other controller parameters, and simulate closed-loop system response to evaluate controller performance.

Designing MPC controllers at the command line.

MPC Design in Simulink

Model and simulate MPC controllers in Simulink using MPC Controller block and other blocks provided by the toolbox. Trim and linearize a Simulink model to compute an internal linear time-invariant plant model for your MPC controller and compute nominal values for plant inputs and outputs using Simulink Control Design™.

MPC Designer App

Interactively design MPC controllers by defining an internal plant model and adjusting horizons, weights and constraints. Validate controller performance using simulation scenarios. Compare responses for multiple MPC controllers.

Automated Driving Applications

Accelerate development of your ADAS systems using prebuilt Simulink blocks. Use the reference examples to quickly design ADAS controllers. Generate code from the Simulink blocks for deploying MPC controllers in the vehicle.

Prebuilt Blocks

Use the Adaptive Cruise Control System, Lane Keeping Assist System, and Path Following Control System blocks as a starting point for your ADAS application and customize the design as needed. Generate code from the prebuilt blocks for deploying MPC controllers.

Using the prebuilt Simulink block for designing adaptive cruise control systems.

Reference Applications

Leverage reference applications that walk you through a workflow for designing and deploying MPC controllers for your automated driving systems. Reference applications also show you how different parts of your system can be modeled at various levels of fidelity.

Linear Model Predictive Controllers

Design MPC controllers for systems with linear dynamics. Design adaptive and gain-scheduled MPC controllers for plants with dynamics that change with operating conditions.

Linear MPC

Design a linear MPC controller by specifying an internal plant model as a linear time-invariant (LTI) system from Control System Toolbox™, or by linearizing a Simulink model with Simulink Control Design. Alternatively, import a model created from measured input-output data using System Identification Toolbox™.

Specifying an internal plant model for a linear MPC design.

Adaptive MPC

Design and simulate adaptive MPC controllers by using command line functions and the Adaptive MPC Controller block. Update your plant model at each compute step and provide it as an input to the controller. Use a built-in linear time-varying (LTV) Kalman filter with asymptotic stability guarantee for state estimation in adaptive model predictive controllers.

Gain-Scheduled MPC

Control nonlinear plants over a wide range of operating conditions with the Multiple MPC Controllers block. Design an MPC controller for each operating point and switch between the controllers at run time.

Using the Multiple MPC Controller block for designing gain-scheduled MPC controllers.

MPC Design Parameters, State Estimation, and Design Review

Iteratively improve your controller design by defining an internal plant model, adjusting controller parameters, and simulating closed-loop system response to evaluate controller performance. Review your controller for potential design issues.

Controller Parameters

After defining the internal plant model, complete the design of your MPC controller by specifying the sample time, prediction and control horizons, scale factors, input and output constraints, and weights. The toolbox also supports constraint softening and time-varying constraints and weights.

Specifying controller parameters in the MPC Designer app.

State Estimation

Estimate controller states from measured outputs using the built-in state estimator. Alternatively, use the custom state estimation option when you need to provide values estimated with your custom algorithm to the controller.

Custom state estimation.

Design Review

Detect potential stability and robustness issues with your MPC controller using the diagnostic function provided by the toolbox. Use this diagnostic tool to adjust controller weights and constraints during controller design to avoid run-time failures.

Improving controller design using recommendations from the design review report.

Run-Time Parameter Tuning and Performance Monitoring

Improve controller performance by tuning weights and constraints at run time. Analyze the controller’s run-time performance.

Run-Time Parameter Tuning

Adjust the run-time weights and constraints of your MPC controller to optimize its performance at run time without redesigning or reimplementing it. Perform run-time controller tuning in both MATLAB and Simulink.

Adjusting weights and constraints at run time.

Run-Time Performance Monitoring

Access the optimization status signal to detect rare occasions when an optimization may fail to converge and then decide if a backup control strategy should be used.

Detecting controller failures in real time. 

Implementing Fast Model Predictive Controllers

Design, simulate, and deploy MPC controllers in applications with limited computational throughput budget.

Explicit MPC

Generate an explicit MPC controller from an implicit MPC design. Simplify a generated explicit MPC controller for a reduced memory footprint.

Generating an explicit MPC controller from a previously designed implicit controller.

Approximate (Suboptimal) Solution

Design, simulate, and deploy MPC controllers with guaranteed worst-case execution time using an approximate (suboptimal) solution.

Comparison of execution times of optimal and approximate (suboptimal) solutions.

Nonlinear Model Predictive Controllers

Design nonlinear MPC controllers to control plants using nonlinear prediction models, cost functions, or constraints.

Optimal Planning

Use nonlinear MPC controllers for optimal planning applications that require a nonlinear model with nonlinear costs or constraints.

Trajectory optimization and control of flying robot using nonlinear MPC.

Feedback Control

Simulate closed-loop control of nonlinear plants under nonlinear costs and constraints. By default, nonlinear MPC controllers use Optimization Toolbox™ to solve the nonlinear programming problem. You can also specify your own custom nonlinear solver.

Nonlinear model predictive control of an exothermic chemical reactor.

Economic MPC

Design economic MPC controllers to optimize the controller for an arbitrary cost function under arbitrary nonlinear constraints. You can use a linear or nonlinear prediction model, a custom nonlinear cost function, and custom nonlinear constraints.

Economic MPC control of ethylene oxide production.

Code Generation

Generate code for model predictive controllers designed in Simulink and MATLAB and deploy it for real-time control applications.

Code Generation with MATLAB and Simulink

Design an MPC controller in Simulink and generate C code and IEC 61131-3 Structured Text using Simulink Coder™ or Simulink PLC Coder™, respectively. Use MATLAB Coder™ to generate C code in MATLAB and deploy it for real-time control. Alternatively, use MATLAB CompilerTM to deploy MPC controllers.

Generating C code from the MPC Controller block.

Embedded Solver

Generate code from provided quadratic programming (QP) solver for efficient implementation on an embedded processor. Deploy the generated code to an arbitrary number of processors. Use provided QP solver with standard MPC formulation or use it for solving custom MPC problems.

Custom MPC controller.

Custom QP Solver

Use a custom quadratic programming (QP) solver of your choice for simulation and code generation.

Custom QP solver for simulation and code generation.

Get a Free Trial

30 days of exploration at your fingertips.

Download now

Ready to Buy?

Get pricing information and explore related products.

Are You a Student?

Get MATLAB and Simulink student software.

Learn more