Specifications

Design Controller at the Command Line
4-5
You can also specify time-varying weights and constraints. The time-varying weights and
constraints are defined for the prediction horizon, which shifts at each time step. This
implies that as long as the property is not changed, the set of time-varying parameters is
the same at each time step. To learn how to specify time-varying constraints and weights
in the GUI, see “Constraints Tab” and “Weight Tuning Tab”.
The time-varying weights modify the tuning of the unconstrained controller response.
To specify a different weight for each step in the prediction horizon, modify the
Weightproperty. For example,
MPCobj.W.OutputVariables = [0.1 0;0.2 0;0.5 0;1 0];
deemphasizes setpoint tracking errors early in the prediction horizon. The default weight
of 1 is used for the fourth step and beyond.
Constraints can also be time varying. The time-varying constraints have a nonlinear
effect when they are active. For example,
MPCobj.MV.RateMin = [-4;-3.5;-3;-2.5];
MPCobj.MV.RateMax = [4;3.5;3;2.5];
forces MV to change more and more slowly along the prediction horizon. The constraint of
-2.5 and 2.5 is used for the fourth step and beyond.
You could also alter the controller's disturbance rejection characteristics using functions
that parallel the design tool's disturbance modeling options (described in “Disturbance
Modeling and Estimation” on page 3-34). See the reference pages for the setEstimator,
setindist, and setoutdist functions.
Review Controller Design
Use the review command to examine the potential controller stability and performance
issues at runtime. review generates a report on the results of the tests it performs.
review(MPCobj)