main content

code generation -凯发k8网页登录

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 .

functions

linear mpc

create data structures for mpcmovecodegeneration
compute optimal control moves with code generation support

nonlinear mpc

create data structures for nlmpcmovecodegeneration
compute nonlinear mpc control moves with code generation support

generate mex file

build mex file that solves an mpc control problem
solve quadratic programming problem using active-set algorithm
create default option set for mpcactivesetsolver
solve a quadratic programming problem using an interior-point algorithm
create default option set for mpcinteriorpointsolver
configures an mpc object to use the qp solver from optimization toolbox as a custom solver

blocks

simulate model predictive controller
simulate adaptive and time-varying model predictive controllers
explicit model predictive controller
simulate switching between multiple implicit mpc controllers
multiple explicit mpc controllers
simulate nonlinear model predictive controllers
simulate adaptive cruise control using model predictive controller
simulate lane-keeping assistance using adaptive model predictive controller
simulate path-following control using adaptive model predictive controller

topics

code generation basics


  • model predictive control toolbox™ software provides code generation functionality for controllers designed in simulink and matlab.
  • qp solvers
    the model predictive controller qp solvers convert 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-precision or single-precision signals.

  • simulate your mpc controller in simulink and generate structured text for programmable logic controllers.

  • to ensure that an mpc controller works properly inside a function-call or triggered subsystem, configure the mpc controller block to use inherited sample time and invoke the subsystem periodically with the same sample time defined in the mpc controller object.

matlab code generation


  • generate c code to compute manipulated variable moves for real-time applications.

  • you can implement a custom mpc control algorithm that supports c code generation in matlab using the built-in qp solver, mpcqpsolver.

cuda code generation


  • simulate your mpc controller in matlab using the gpu.

  • simulate your mpc controller in simulink using the gpu.

using custom solvers


  • generate code for a model predictive controller that uses a custom quadratic programming solver.

  • use embotech forcespro solvers with the model predictive control toolbox to solve mpc problems and deploy controllers to real-time targets.

opc simulation


  • implement an online model predictive controller application using the opc client supplied with the industrial communication toolbox™.
网站地图