Specifications
5 Designing and Testing Controllers in Simulink
5-12
Alternatively, delete MPC open loop plant 1, the model computed at default operating
point. Deleting this plant forces the controller to use the new model and eliminates the
potential for confusion. In the tree, click Plant models. Then, in the Plant models
imported for this project list box, select MPC open loop plant 1. Click Delete.
Generally, the next step is to configure the controller, including specifying the control
and prediction horizons, constraints, weights, and noise/disturbance models. For such
configuration, select the controller in the Controllers node. However, for this example,
use the default controller settings.
(Optional) You can validate the controller design by performing linear simulations. To do
so, use the Scenarios node.
Export Controller and Operating Point to MATLAB Workspace
By default, the software creates a controller, MPC1, based on the model obtained by
automatic linearization. The software automatically exports MPC1 to the MATLAB
workspace. Also, in the Simulink model, the software updates the MPC Controller block.
It sets the MPC Controller parameter to MPC1. So, when you run the Simulink model,
you use MPC1.
Because the initial linearization was unsuitable, you must export the controller with
the new plant model. In the Controllers node, right-click MPC1 and select Export
Controller. The MPC Controller Exporter dialog box opens. Use the default values
specified in this dialog box. Click Export and confirm that you want to replace the
existing MPC1 in the MATLAB workspace. Optionally, close this dialog box by clicking
Close.