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:
- Generate the online controller that has the desired properties.
- Export the online controller to YALMIP using toYalmip method of MPCController class.
- Formulate a parametric optimization problem and specify the feedback variables that are used as parameters.
- Create an instance of Opt class and transform the optimization problem to LCP using qp2lcp method.
- Create a Simulink scheme with the S-Function block that links to LCP solver.
- 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.
- Press "CTRL+B" that executes the code generation and compiles the code.
- In the Simulink scheme choose "Simulation->External" option and press "Connect To Target".
- Start the simulation to verify the controller in real-time.
See Also
mpt_demo_deployment_explicitmpc
◀ |
mpt_demo_functions1 |
|
mpt_demo_deployment_explicitmpctracking |
▶ |
© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch