Main Content

Generate Simulink Model from MPC Designer

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:

  1. In the MPC Designer app, interactively design and tune your model predictive controller.

  2. 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.

  3. Under Export Controller, click Generate Simulink Model .

    Simulink model generated by the MPC Designer app, containing the plant model in feedback with the designed MPC controller.

    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.

See Also




Related Examples

More About