mpt_demo_deployment_onlineMPC

Purpose

Application of online MPC controller with the help of Simulink interface

Syntax

mpt_demo_deployment_onlineMPC

Description

Demonstration of real-time control using online MPC controller. The demo relies on standalone LCP solver that solves the optimization problem given as linear-complementarity problem (LCP). The LCP solver must be present in the installation path including the extended version lcprtw that contains pre-compiled libraries for linking with OpenWatcom compiler. The demo has been tested under Real-Time Windows target and XPC target on Windows 32-bit platform.

Note that this demo can be compiled and run on Windows 32-bit platform for Matlab r2012a!

Deployment steps:
  1. Generate the online controller that has the desired properties.
  2. Export the online controller to YALMIP using toYalmip method of MPCController class.
  3. Formulate a parametric optimization problem and specify the feedback variables that are used as parameters.
  4. Create an instance of Opt class and transform the optimization problem to LCP using qp2lcp method.
  5. Create a Simulink scheme with the S-Function block that links to LCP solver.
  6. In the Simulink scheme, choose code generation options and pick rtwin.tlc as the system target file that corresponds to Real-Time Windows target or xpctarget.tlc for XPC target.
  7. Press "CTRL+B" that executes the code generation and compiles the code.
  8. In the Simulink scheme choose "Simulation->External" option and press "Connect To Target".
  9. Start the simulation to verify the controller in real-time.

See Also

mpt_demo_deployment_explicitmpc


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