mpt_demo_deployment_explicitMPC

Purpose

Application of explicit MPC controller with the help of Simulink interface

Syntax

mpt_demo_deployment_explicitMPC

Description

Demonstration of real-time control using explicit MPC controller. This demo shows how to design an explicit controller for usage in real-time control in Real-Time Workshop. The code generation and compilation for real-time has been tested under Real-Time Windows target on Windows 32-bit and 64-bit platforms.

Deployment steps:
  1. Generate the explicit controller that has the desired properties.
  2. Export the explicit controller to C-code using mpt_exportToC function.
  3. Create a Simulink scheme with the S-Function block that represents generated controller.
  4. In the Simulink scheme, choose code generation options and pick rtwin.tlc as the system target file (e.g. for Real-Time Windows target).
  5. In the code generation options, go to "Custom Code" tab and put in "Source files" the absolute path to generated files.
  6. Press "CTRL+B" that executes the code generation and compiles the code.
  7. In the Simulink scheme choose "Simulation->External" option and press "Connect To Target".
  8. Start the simulation to verify the controller.

See Also

mpt_demo_deployment_onlinempc


© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch