主要内容

Specify Constraints

Input and Output Constraints

By default, when you create a controller object using theMPC.命令,不存在约束。要包含约束,请设置相应的控制器属性。下表总结了用于定义大多数MPC约束的控制器属性。(MV =工厂操纵变量; OV =工厂输出变量; MV递增=u(k) -u(k- 1)。

Constraint 控制器属性 制约柔软
下限ith MV mv(i).min> -inf mv(i).minecr> 0
Upper bound onith MV mv(i).max MV(i).MaxECR > 0
下限iov. ov(i).min> -inf ov(i).minecr> 0
Upper bound oniov. OV(i).Max < Inf ov(i).maxecr> 0
下限iMV增量 mv(i).ratemin> -inf mv(i).rateminecor> 0
Upper bound oniMV增量 MV(i).RateMax < Inf MV(i).RATEMAXECR> 0

To set the controller constraint properties using theMPC设计er应用程序,在调整tab, click约束。在“约束”对话框中,指定约束值。

约束for the equations describing the corresponding constraints.

尖端

For MV bounds:

  • 包括植物MVS的已知物理限制作为硬MV限制。

  • 当有更改速率存在已知的物理限制时,包括MV增量界限,或者您的应用程序要求您防止其他原因的大量增量。

  • 不要在同一MV上包含两个硬MV限制和硬MV增量界限,因为它们可以冲突。如果两种类型的界限都很重要,则软化一个。

对于OV边界:

  • 除非它们对您的申请至关重要,否则请勿包含OV界限。作为设置OV绑定的替代方案,您可以定义OV参考并设置其成本函数重量以使OV保持接近其设定值。

  • 所有OV约束应该软化。

  • Consider leaving the OV unconstrained for some prediction horizon steps. SeeSetting Time-Varying Weights and Constraints with MPC Designer

  • Consider a time-varying OV constraint that is easy to satisfy early in the horizon, gradually tapering to a more strict constraint. SeeSetting Time-Varying Weights and Constraints with MPC Designer

  • Do not include OV constraints that are impossible to satisfy. Even if soft, such constraints can cause unexpected controller behavior. For example, consider a SISO plant with five sampling periods of delay. An OV constraint before the sixth prediction horizon step is, in general, impossible to satisfy. You can use the审查command to check for such impossible constraints, and use a time-varying OV bound instead. SeeSetting Time-Varying Weights and Constraints with MPC Designer

制约柔软

难的constraints are constraints that the quadratic programming (QP) solution must satisfy. If it is mathematically impossible to satisfy a hard constraint at a given control interval,k, the QP is不可行。In this case, the controller returns an error status, and sets the manipulated variables (MVs) tou(k) =u(k-1),也就是说,没有变化。如果没有解决不可行性的条件,则无法无限期地继续使用,导致控制丧失。

Disturbances and prediction errors are inevitable in practice. Therefore, a constraint violation could occur in the plant even though the controller predicts otherwise. A feasible QP solution does not guarantee that all hard constraints will be satisfied when the optimal MV is used in the plant.

如果应用程序中唯一的约束是MV的界限,则MV边界可能是硬约束,因为它们是默认值。单独的MV限制不能引起可行性。当唯一的约束是在MV增量时,相同就是如此。

然而,具有硬MV增量约束的硬MV限制可能导致不可行。例如,手动控制下的镦粗或操作可能导致工厂中使用的实际MV超过间隔期间的指定绑定k-1。如果控制器在间隔期间是自动的k, it must return the MV to a value within the hard bound. If the MV exceeds the bound by too much, the hard increment constraint can make correcting the bound violation in the next interval impossible.

如果工厂受干扰,并且存在硬度输出约束或硬混合输入 - 输出约束,则QP的不可行结构是一种独特的可能性。

All Model Predictive Control Toolbox™ constraints (except slack variable nonnegativity) can besoft。When a constraint is soft, the controller can deem an MV optimal even though it predicts a violation of that constraint. If all plant output, MV increment, and custom constraints are soft (as they are by default), QP infeasibility does not occur. However, controller performance can be substandard.

为了软化约束,将放松(ECR)值设置为正值(ZERO意味着硬约束)。ECR值越大,控制器越可能认为最佳违反约束,以满足您的其他性能目标。模型预测控制工具箱软件提供默认的ECR值,但对于成本函数权重,您可能需要调整ECR值以实现可接受的性能。

To understand how constraint softening works, suppose that your cost function uses w i , j u = w i , j δ. u = 0 ,在成本函数中给出MV和MV的零重量。只有输出参考跟踪和约束违规术语都是非零的。在这种情况下,成本函数是:

J ( z k ) = j = 1 n y i = 1 p { w i , j y s j y [ r j ( k + i | k ) y j ( k + i | k ) ] } 2 + ρ ε. ε. k 2

假设您还指定了硬质MV限制 V j , m i n u ( i ) = 0 V j , m a x u ( i ) = 0 。然后这些约束简化为:

u j , m i n ( i ) s j u u j ( k + i 1 | k ) s j u u j , m a x ( i ) s j u , i = 1 : p , j = 1 : n u

因此,松弛变量,ε.k, no longer appears in the above equations. You have also specified soft constraints on plant outputs with V j , m i n y ( i ) > 0 V j , m a x y ( i ) > 0

y j , m i n ( i ) s j y ε. k V j , m i n y ( i ) y j ( k + i | k ) s j y y j , m a x ( i ) s j y + ε. k V j , m a x y ( i ) , i = 1 : p , j = 1 : n y

Now, suppose that a disturbance has pushed a plant output above its specified upper bound, but the QP with hard output constraints would be feasible, that is, all constraint violations could be avoided in the QP solution. The QP involves a trade-off between output reference tracking and constraint violation. The slack variable,ε.k, must be nonnegative. Its appearance in the cost function discourages, but does not prevent, an optimalε.k> 0.更大ρε.weight, however, increases the likelihood that the optimalε.kwill be small or zero.

If the optimalε.k> 0,至少一个绑定的不等式必须是有效的(在平等时)。相对较大 V j , m a x y ( i ) makes it easier to satisfy the constraint with a smallε.k。在这种情况下,

y j ( k + i | k ) s j y

can be larger, without exceeding

y j , m a x ( i ) s j y + ε. k V j , m a x y ( i )

注意 V j , m a x y ( i ) 没有设置约束违规的上限。相反,它是确定软限制是否容易或难以满足的调谐因子。

尖端

  • 使用无量纲变量简化了约束调整。为每个工厂输入和输出变量定义适当的比例因子。看指定比例因子

  • 为了指示可容受违规的相对幅度,请使用与每个约束相关联的ECR参数。粗略的指导方针如下:

    • 0 — No violation allowed (hard constraint)

    • 0.05 — Very small violation allowed (nearly hard)

    • 0.2 - 允许小的违规行为(相当硬)

    • 1 — average softness

    • 5 — greater-than-average violation allowed (quite soft)

    • 20 - 允许大量违规(非常柔软)

  • Use the overall constraint softening parameter of the controller (controller object property:权重..) to penalize a tolerable soft constraint violation relative to the other cost function terms. Set the权重..属性,使得相应的罚款比其他三个成本函数术语的典型总和大于1-2的数量级。如果在仿真测试期间约束违规似乎太大,请尝试增加权重..by a factor of 2–5.

    Be aware, however, that an excessively large权重..扭曲MV优化,导致约束违规时的不合适的MV调整。要检查此项,请在仿真期间显示成本函数值。如果当发生约束违规时,如果其幅度增加超过2个数量级,请考虑降低权重..

  • 干扰和预测会导致一个错误xpected constraint violations in a real system. Attempting to prevent these violations by making constraints harder often degrades controller performance.

看Also

相关话题