This topic shows how to generate a Simulink® model that uses the current model predictive controller to control its internal plant model.
To create a Simulink model:
In the MPC Designer app, interactively design and tune your model predictive controller.
On the Tuning tab, in the Analysis section, click the Export Controller arrow .
Alternatively, on the MPC Designer tab, in the Result section, click Export Controller.
Under Export Controller, click
The app exports the current MPC controller and its internal plant model to the MATLAB® workspace and creates a Simulink model that contains an MPC Controller block and a Plant block
Also, default step changes in the output setpoints are added to the References block.
Use the generated model to validate your controller design. The generated model serves as a template for moving easily from the MATLAB design environment to the Simulink environment.
You can also use the Simulink model to generate code and deploy it for real-time control applications. For more information, see Generate Code and Deploy Controller to Real-Time Targets.