Controller Creation

Create model predictive controllers

You can create an MPC controller with a linear plant model using the MPC Designer app or at the command line. To design a controller, first select the controller sample time and horizons, and specify any required constraints. For more information, see Choose Sample Time and Horizons and Specify Constraints. You can then adjust the controller weights to achieve your desired performance, see Tune Weights for more information.

Functions

mpcModel predictive controller
mpcpropsProvide help on MPC controller properties
gpc2mpcGenerate MPC controller using generalized predictive controller (GPC) settings
mpcverbosityChange toolbox verbosity level

Apps

MPC DesignerDesign and simulate model predictive controllers

Topics

MPC Parameters

Choose Sample Time and Horizons

Choose your MPC controller sample time, prediction horizon, and control horizon early in your design, and hold them constant as you tune other controller parameters.

Specify Constraints

You can specify upper and lower bounds for the values of plant outputs and manipulated variables, and also for the rate of change of manipulated variables.

Specify Scale Factors

When designing an MPC controller, it is good practice to define scale factors for each plant input and output, especially when variables have large differences in magnitude.

Tune Weights

To tune your MPC controller performance, adjust the cost function penalty weights for plant outputs and manipulated variables, and also for the rate of change of manipulated variables.

Design Model Predictive Controller at Equilibrium Operating Point

To design an MPC controller at an equilibrium point with nonzero operating conditions, you can specify the corresponding nominal conditions in the controller object.

Design Environment

Design Controller Using MPC Designer

Design a model predictive controller for a continuous stirred-tank reactor (CSTR) using MPC Designer.

Design MPC Controller at the Command Line

Design and simulate a model predictive controller at the MATLAB® command line.

Design MPC Controller in Simulink

Design and simulate a model predictive controller for a Simulink® model using MPC Designer.

Design for Specialized Plants

Design MPC Controller for Plant with Delays

Design a model predictive controller for a plant with delays using MPC Designer.

Design MPC Controller for Nonsquare Plant

Configure an MPC controller for a nonsquare plant with unequal numbers of manipulated variables and outputs.

Design MPC Controller for Identified Plant Model

Design a model predictive controller using a linear System Identification Toolbox™ plant model.

Code Generation

Generate MATLAB Code from MPC Designer

To programmatically reproduce controller designs that you obtained interactively using MPC Designer, you can automatically generate MATLAB scripts.

Case Studies

Design MPC Controller for Position Servomechanism

Design a model predictive controller for a position servomechanism using MPC Designer.

Design MPC Controller for Paper Machine Process

Design a model predictive controller for a nonlinear paper machine process using MPC Designer.

Control of an Inverted Pendulum on a Cart

Control an inverted pendulum in an unstable equilibrium position using a model predictive controller.

Thermo-Mechanical Pulping Process with Multiple Control Objectives

Design a model predictive controller for a MIMO system with multiple control objectives.

Aircraft with Unstable Poles

Design a model predictive controller to control an aircraft with saturating actuators.