主要内容

Constraints on Linear Combinations of Inputs and Outputs

你可以约束线性combinations of plant input and output variables. For example, you can constrain a particular manipulated variable (MV) to be greater than a linear combination of two other MVs.

这种限制的一般形式是:

$$Eu\left( {k + i} \right) + Fy\left( {k + i} \right) +
Sv\left( {k + i} \right) \le G + {\varepsilon _k}V$$

在这里:

  • ${\varepsilon _k}$is the QP slack variable used for constraint softening. For more information, seeConstraint Softening.

  • $u\left( {k + i} \right)$${N_{mv}}$manipulated variable values, in engineering units.

  • $y\left( {k + i} \right)$$N_y$predicted plant outputs, in engineering units.

  • $v\left( {k + i} \right)$${N_{md}}$measured plant disturbance inputs, in engineering units.

  • $ e $,$ f $,$S$,$ g $, 和$ v $是恒定的矩阵和矢量。有关更多信息,请参阅setconstraint.

As with the QP cost function, output prediction using the state observer makes these constraints a function of the QP decision variables.

要设置MPC控制器的混合输入/输出约束,请使用setconstraint功能。要从控制器获取现有约束,请使用GetConstraint..

When using mixed input/output constraints, consider the following:

  • 默认情况下,混合输入/输出约束是维数。

  • Run-time updating of mixed input/output constraints is supported at the command line and in Simulink®. For more information, see在运行时更新约束.

  • Using mixed input/output constraints is not supported inMPC Designer.

例如,考虑具有混合输入/输出约束的双积分器设备的MPC控制器。

创建初始MPC控制器

The basic setup of the MPC controller includes:

  • 双积分器作为预测模型

  • Prediction horizon of 20

  • Control horizon of 20

  • Input constraints:$  - 左(t \右)\ le 1 $

plant = tf(1,[1 0 0]); Ts = 0.1; p = 20; m = 20; mpcobj = mpc(plant,Ts,p,m); mpcobj.MV = struct('Min',-1,'Max',1);
-->The "Weights.ManipulatedVariables" property is empty. Assuming default 0.00000. -->The "Weights.ManipulatedVariablesRate" property is empty. Assuming default 0.10000. -->The "Weights.OutputVariables" property is empty. Assuming default 1.00000.

定义混合输入/输出约束

Constrain the sum of the input你(t)和outputy(t)must be nonnegative and smaller than 1.2:

$$0 \le u\left( t \right) + y\left( t \right) \le 1.2$$

To impose this combined (mixed) I/O constraint, formulate it as a set of inequality constraints involving$ U \ left(t \右)$$y\left( t \right)$.

$$\begin{array}{l}
u\left( t \right) + y\left( t \right) \le 1.2\\
 - u\left( t \right) - y\left( t \right) \le 0
\end{array}$$

使用该约束定义这些约束setconstraint函数,设置约束常量如下:

$$E = \left[ {\begin{array}{*{20}{c}}
1\\
{ - 1}
\end{array}} \right],\;F = \left[ {\begin{array}{*{20}{c}}
1\\
{ - 1}
\end{array}} \right],\;G = \left[ {\begin{array}{*{20}{c}}
{1.2}\\
0
\end{array}} \right]$$

setconstraint(mpcobj,[1;-1],[1;-1],[1.2;0]);

Simulate Controller

Simulate closed-loop control of the linear plant model in Simulink. The controllermpcobjis specified in the MPC Controller block.

mdl ='mpc_mixedconstraints'; open_system(mdl) sim(mdl)
-->Converting the "Model.Plant" property to state-space. -->Converting model to discrete time. Assuming no disturbance added to measured output channel #1. -->The "Model.Noise" property is empty. Assuming white noise on each measured output.

The MPC controller keeps the sum$ u + y $between 0 and 1.2 while tracking the reference signal,$r = 1$.

bdclose(mdl)

See Also

|

相关话题