Main Content

explicitmpc

显式模型预测控制器

Description

显式模型预测控制使用离线计算来确定通过评估线性函数确定最佳控制移动的所有操作区域。与传统(隐式)模型预测控制器相比,显式MPC控制器所需的运行时间计算较少,因此对于需要少量样品时间的应用程序很有用。

To implement explicit MPC, first design a traditional (implicit) model predictive controller for your application, and then use this controller to generate an explicit MPC controller for use in real-time control. For more information, seeDesign Workflow for Explicit MPC

创建

创建一个explicitmpc目的:

  1. Create an implicit MPC controller using anmpc目的。

  2. Define the operating range for the explicit MPC controller by creating a range structure using the生成解释性功能并使用点表示法指定边界。

  3. Define the optimization options for converting the implicit controller into an explicit controller using the生成解释性功能。

  4. 根据隐式控制器,操作范围和优化选项创建明确的MPC控制器generateExplicitMPC功能。

特性

expand all

隐式MPC控制器,指定为mpc目的。

参数边界that define the controller operating range, specified as a structure with the following fields.

场地 Description
状态 控制器状态值的界限
Reference 控制器参考信号值的界限
MeasuredDisturbance 测得的干扰值的界限
ManipulatedVariable Bounds on manipulated variable values

Define this property using therange输入参数generateExplicitMPCfunction, which you create using the生成解释性function and modify using dot notation. For detailed descriptions of the range parameters, see生成解释性

转换计算的优化选项,指定为具有以下字段的结构。

场地 Description
zerotol Zero-detection tolerance
去除 冗余 - 质量约束检测耐受性
flattol Flat region detection tolerance
normalizetol 约束归一化公差
Maxiternnls Maximum number of NNLS solver iterations
MaxIterQP QP求解器迭代的最大数量
Maxiterbs Maximum number of bisection method iterations
多还原 Method for removing redundant inequalities

Define this property using the选择输入参数generateExplicitMPCfunction, which you create using the生成解释性功能。有关这些选项的详细说明,请参阅生成解释性

针对不同操作区域的分段仿射解决方案,指定为结构数组nr元素,哪里nr是操作区域的数量。

Each structure element contains fields defining the inequality constraints and control law for each region. For more information on the control law and constraints, seeDesign Workflow for Explicit MPC

场地 方面
F Row vector of lengthnX-by-nmv
G 长度向量nmv
H nC-by-nXarray
k 长度向量nC

这里:

  • nX是自变量的数量。

  • nmv是操纵变量的数量。

  • nC是该地区的不平等约束数量。

标志指示是否已使用明确控制定律简化了SIMplifyCommand. If the control law is simplified, it approximates the implicit MPC controller behavior. If the control law is not simplified, it should reproduce the implicit controller behavior exactly, provided both operate within the bounds described by theRange财产。

对象功能

SIMplify 减少明确的MPC控制器的复杂性和内存要求
plotSection 将显式MPC控制法视为2-D分段图
mpcmoveExplicit 使用显式MPC计算最佳控制
SIM Simulate an MPC controller in closed loop with a linear plant
mpcstate MPC控制器状态
getCodeGenerationData 创建数据结构mpcmoveCodeGeneration

Examples

Collapse all

基于传统的MPC控制器为双积体厂生成显式MPC控制器。

Define the double-integrator plant.

植物= tf(1,[1 0 0]);

Create a traditional (implicit) MPC controller for this plant, with sample time 0.1, a prediction horizon of 10, and a control horizon of 3.

Ts = 0.1; p = 10; m = 3; MPCobj = mpc(plant,Ts,p,m);
- >“ MPC”对象的“权重”属性是空的。假设默认为0.00000。- >“ weights.manipulationVariablesrate”属性“ MPC”对象是空的。假设默认为0.10000。- >“ MPC”对象的“ weight.outputvariables”属性为空。假设默认为1.00000。

To generate an explicit MPC controller, you must specify the ranges of parameters such as state values and manipulated variables. To do so, generate a range structure. Then, modify values within the structure to the desired parameter ranges.

range = generateExplicitRange(MPCobj);
-->Converting the "Model.Plant" property of "mpc" object to state-space. -->Converting model to discrete time. Assuming no disturbance added to measured output channel #1. -->The "Model.Noise" property of the "mpc" object is empty. Assuming white noise on each measured output channel.
range.State.Min(:) = [-10;-10]; range.State.Max(:) = [10;10]; range.Reference.Min = -2; range.Reference.Max = 2; range.ManipulatedVariable.Min = -1.1; range.ManipulatedVariable.Max = 1.1;

Use the more robust reduction method for the computation. Use生成解释性要创建默认选项集,然后修改多还原选择ion.

选择= generateExplicitOptions(MPCobj); opt.polyreduction = 1;

生成显式MPC控制器。

empcobj = generateExpliticmpc(mpcobj,range,opt)
显式MPC控制器--------------------------------------------------------------------------------------------------------------------》时间:0.1(秒)多面体区域:1个参数数:4是解决方案:无状态估计:默认Kalman增益---------------------------------------------------------------------------键入原始隐式MPC设计的'empcobj.mpc'。为有效的参数范围键入'empcobj.range'。为多参数QP计算中使用的选项键入“ empcobj.optimizeptions”。键入“ empcobj.piecewiseaffinesolution”以获取每个溶液中的区域和增益。
Introduced in R2014b