Tuning Controller Weights

This example shows how to vary the weights on outputs, inputs, and ECR slack variable for soft constraints in real-time.

The weights specified in the MPC object are overridden by the weights supplied to the MPC Controller block. If a weight signal is not connected to the MPC Controller block, then the corresponding weight is the one specified in the MPC object.

Define Plant Model

Define a multivariable discrete-time linear system with no direct I/O feedthrough, and assume input #4 is a measured disturbance and output #4 is unmeasured.