MATLAB Examples

Control of a Single-Input-Single-Output Plant

This example shows how to control a double integrator plant under input saturation in Simulink®.


Define Plant Model

The linear open-loop dynamic model is a double integrator:

plant = tf(1,[1 0 0]);

Design MPC Controller

Create the controller object with sampling period, prediction and control horizons:

Ts = 0.1;
p = 10;
m = 3;
mpcobj = mpc(plant, Ts, p, m);

Specify actuator saturation limits as MV constraints.


Simulate Using Simulink®

To run this example, Simulink® is required.

if ~mpcchecktoolboxinstalled('simulink')

Simulate closed-loop control of the linear plant model in Simulink. Controller "mpcobj" is specified in the block dialog.

mdl = 'mpc_doubleint';
-->Converting model to discrete time.
   Assuming no disturbance added to measured output channel #1.

The closed-loop response shows good setpoint tracking performance.