Products & Services Solutions Academia Support User Community Company

MPC Controller

Purpose

Compute MPC control law

Library

MPC Simulink Library

Description

The MPC Controller block receives the current measured output, reference signal, and measured disturbance signal, and outputs the optimal manipulated variables by solving a quadratic program. The block is based on an MPC object, which provides performance and constraint specifications, as well as the sampling time of the block.

Dialog Box

MPC controller
You must supply an MPC object that defines your controller. There are two ways to do this. One is to enter the name of an existing MPC object in the MPC Controller edit box. (The object must be in your base workspace.)
The other is to leave the MPC controller edit box empty and, with the controller block connected to the plant, click the Design button. This constructs a default MPC controller by obtaining a linearized model from the Simulink diagram. It also opens the design tool so you can modify the default settings.
If you are designing a controller in the design tool, you can see how well it works by running a closed-loop Simulink® simulation without exiting the tool. This makes it easier to tune controller parameters.
Initial controller state
Initial state of the MPC controller. This must be a valid mpcstate object. If none is supplied, the block uses the default steady-state initial condition.
Reference signal
If you select the check box, the edit box to the right must contain the name of a variable in your workspace that defines the reference signal. This also enables the Look Ahead check box. Selecting the Look Ahead check box anticipates reference variations and usually improves reference tracking (see Look Ahead and Signals from the Workspace). If you do not select the Reference signal check box, the signal connected to the block ref inport supplies the reference values.
Measured disturbance
Provides options for the measured disturbances (for feedforward compensation) in the same way as for the reference signals, above. If you don't supply the measured disturbance here, the signal connected to the block's md inport supplies the measured disturbance values.
Enable input port for measured disturbance
This option adds an inport (labeled md) to which you can connect measured disturbances and for which the controller will provide feedforward compensation.
Enable input port for externally supplied manipulated variables to plant
This check box lets you switch between MPC control and another type of control (e.g., manual control) during a simulation. It adds an inport (labeled ext.mv) to which you can connect the actual manipulated variables the plant is receiving. The block uses these in its internal state estimates. The following example shows possible connections. See also the mpcbumpless demo.
If the inport is disabled, or it is enabled with no connected signal, the MPC controller assumes that its output is adjusting the plant input. If this is incorrect, the controller's internal state estimate will become inaccurate.

Bumpless Switching Between MPC and Another Controller

Enable input port for input and output limits
This check box adds inports to which you can connect time-varying constraint specifications. Otherwise, the block uses the constant constraint values stored within its MPC object. Example connections appear below. See also the mpcvarbounds demo.
When you enable this option, the block interprets an unconnected limit inport, such as ymin in the example below, as an unconstrained variable. Also, to prevent numerical difficulties the block enforces a minimum separation of 1e-5 between lower and upper bounds. Further, if a signal connected to a lower-bound port exceeds that connected to the corresponding upper-bound port, the block automatically uses the smaller signal as the lower bound and vice versa.

Enable input port for switching optimization off
This check box adds an inport labeled QP Switch. If this input signal is zero, the controller behaves normally. If this input becomes nonzero, it turns off the controller's optimization calculations and sets the controller output to zero. This saves computational effort when the controller output is not needed, e.g., the system has been placed in manual operation or another controller has taken over. The controller continues to update its internal state estimate in the usual way, however, so it is ready to resume optimization calculations whenever the QP Switch signal returns to zero.

See Also
mpc, mpcstate


 Provide feedback about this page 

Previous page Block Reference Multiple MPC Controllers Next page

Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS