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.
这种限制的一般形式是:
在这里:
is the QP slack variable used for constraint softening. For more information, seeConstraint Softening.
是manipulated variable values, in engineering units.
是predicted plant outputs, in engineering units.
是measured plant disturbance inputs, in engineering units.
,,,, 和是恒定的矩阵和矢量。有关更多信息,请参阅
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:
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:
To impose this combined (mixed) I/O constraint, formulate it as a set of inequality constraints involving和.
使用该约束定义这些约束setconstraint
函数,设置约束常量如下:
setconstraint(mpcobj,[1;-1],[1;-1],[1.2;0]);
Simulate Controller
Simulate closed-loop control of the linear plant model in Simulink. The controllermpcobj
is 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 sumbetween 0 and 1.2 while tracking the reference signal,.
bdclose(mdl)