Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

Code Generation

Generate code and deploy controllers on real-time targets

Once you have validated a model predictive controller in Simulink® or MATLAB®, you can generate code and deploy it for real-time control applications. For more information, see Generate Code and Deploy Controller to Real-Time Targets.

Functions

review Examine MPC controller for design errors and stability problems at run time
mpcmoveCodeGeneration Compute optimal control moves with code generation support
getCodeGenerationData Create data structures for mpcmoveCodeGeneration
mpcqpsolver Solve a quadratic programming problem using the KWIK algorithm
mpcqpsolverOptions Create default option set for mpcqpsolver

Blocks

MPC Controller Compute MPC control law
Adaptive MPC Controller Design and simulate adaptive and time-varying model predictive controllers
Explicit MPC Controller Design and simulate explicit model predictive controller
Multiple MPC Controllers Simulate switching between multiple implicit MPC controllers
Multiple Explicit MPC Controllers Simulate switching between multiple explicit MPC controllers

Topics

Getting Started

Generate Code and Deploy Controller to Real-Time Targets

Model Predictive Control Toolbox™ software provides code generation functionality for controllers designed in Simulink and MATLAB.

QP Solver

The model predictive controller QP solver converts an MPC optimization problem to a general form quadratic programming problem.

Simulink Code Generation

Simulation and Code Generation Using Simulink Coder

Simulate your MPC controller in Simulink and generate real-time code that uses either double or single precision signals.

Simulation and Structured Text Generation Using PLC Coder

Simulate your MPC controller in Simulink and generate structured text for programmable logic controllers.

MATLAB Code Generation

Generate Code To Compute Optimal MPC Moves in MATLAB

Generate C code to compute manipulated variable moves for real-time applications.

OPC Simulation

Real-Time Control with OPC Toolbox

Implement an online model predictive controller application using the OPC client supplied with the OPC Toolbox™.

Was this topic helpful?