| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Model Predictive Control Toolbox |
| Contents | Index |
Controller Specifications View
This view appears whenever you select one of your controller nodes (see Tree View). It allows you to review and edit controller settings. It consists of four tabs, each devoted to a particular design aspect. All settings have default values.
The following sections describe the view's main features:
Model and Horizons Tab
Plant Model
This combo box allows you to specify the plant model the controller uses for its predictions. You can choose any of the plant models you've imported. (See Importing a Plant Model.)
Horizons
The Control interval option sets the elapsed time between successive controller moves. It must be a positive, finite real number. The calculations assume a zero-order hold on the manipulated variables (the signals adjusted by the controller). Thus, these signals are constant between moves.
The Prediction horizon option sets the number of control intervals over which the controller predicts its outputs when computing controller moves. It must be a positive, finite integer.
The Control horizon option sets the number of moves computed. It must be a positive, finite integer, and must not exceed the prediction horizon. If less than the prediction horizon, the final computed move fills the remainder of the prediction horizon.
For more discussion, see Typical Sampling Instant, and Prediction and Control Horizons.
Blocking
By default, the Blocking option is cleared (off). When selected as shown above, the design tool replaces the Control horizon specification (see Horizons) with a move pattern determined by the following settings:
Beginning - Successive moves at the beginning of the prediction horizon, each with a duration of one control interval.
Uniform - The prediction horizon is divided by the number of moves and rounded to obtain an integer duration, and each computed move has this duration (the last move extends to fill the prediction horizon).
End - Successive moves at the end of the prediction horizon, each with a duration of one control interval.
The sum of the vector elements should equal the prediction horizon (15 in this case). If not, the last move is extended or truncated automatically.
| Note When Blocking is off, the controller uses the Beginning allocation with Number of moves computed per step equal to the Control horizon. |
For more discussion, see Blocking.
Constraints Tab
This tab allows you to specify constraints (bounds) on manipulated variables and outputs. Constraints can be hard or soft. By default, all variables are unconstrained, as shown in the view below.
| Note If you specify constraints, manipulated variable constraints are hard by default, whereas output variable constraints are soft by default. You can customize this behavior, as discussed in the following sections. For additional information on constraints, see Optimization and Constraints, and Optimization Problem. |
Each table entry may be a scalar or a vector. A scalar entry defines a constraint that is constant for the entire prediction horizon. A vector entry defines a time-varying constraint. See Entering Vectors in Table Cells for the required format.
An entry may also be any valid MATLAB expression provided that it evaluates to yield an appropriate scalar or vector quantity.
Constraints on Manipulated Variables
The example below is for an application with two manipulated variables (MVs), each represented by a table row.
The Name and Units columns are noneditable. To change them, use the signal definition view. (See Signal Definition View. Any changes there apply to the entire design.)
The remaining entries are editable. If you leave a cell blank, the controller ignores that constraint. You can achieve the same effect by entering -Inf or Inf (for a minimum or maximum, respectively).
The Minimum and Maximum values set each MV's range.
The Max down rate and Max up rate values set the amount the MV can change in a single control interval. The Max down rate must be negative or zero. The Max up rate must be positive or zero.
Constraint values must be consistent with your nominal values (see Input Signal Properties). In other words, each MV's nominal value must satisfy the constraints.
Constraint values must also be self-consistent. For example, an MV's lower bound must not exceed its upper bound.
Constraints on Output Variables
The example below is for an application with two output variables, each represented by a table row.
The Name and Units columns are noneditable. To change them, use the signal definition view. (See Signal Definition View. Any changes there apply to the entire design.)
The remaining entries are editable. If you leave a cell blank (as above), the controller ignores that constraint. You can achieve the same effect by entering -Inf (for a Minimum) or Inf (for a Maximum).
Constraint values must be consistent with your nominal values (see Output Signal Properties). In other words, each output's nominal value must satisfy the constraints.
Constraint values must also be self-consistent. For example, an output's lower bound must not exceed its upper bound.
| Note Don't constrain outputs unless this is an essential aspect of your application. It is usually better to define output setpoints (reference values) rather than constraints. |
Constraint Softening
A hard constraint cannot be violated. Hard constraints are risky, especially for outputs, because the controller will ignore its other objectives in order to satisfy them. Also, the constraints might be impossible to satisfy in certain situations, in which case the calculations are mathematically infeasible.
Model Predictive Control Toolbox™ software allows you to specify soft constraints. These can be violated, but you specify a violation tolerance for each (the relaxation band). See the example specifications below.
To open this dialog box, click the Constraint softening button at the bottom of the Contraints tab in the Controller Specification view (see Constraints Tab).
As for the constraints themselves, an entry can be a scalar or a vector. The latter defines a time-varying relaxation band. See Entering Vectors in Table Cells for the required format.
Input Constraints
An example input constraint softening specification appears below.
The Name and Units columns are noneditable. To change them, use the signal definition view. (See Signal Definition View. Any changes there apply to the entire design.)
The Minimum, Maximum, Max down rate, and Max up rate columns are editable. Their values are the same as on the main Constraints tab (see Constraints on Manipulated Variables). You can specify them in either location.
The remaining columns specify the relaxation band for each constraint. An empty cell is equivalent to a zero, i.e., a hard constraint.
Entries must be zero or positive real numbers. To soften a constraint, increase its relaxation band.
The example above shows a relaxation band of 2 moles/min for the steam flow rate's lower and upper bounds. The lack of a relaxation band setting for the reflux flow rate's constraints means that these will be hard.
| Note The relaxation band is a relative tolerance, not a strict bound. In other words, the actual constraint violation can exceed the relaxation band. |
Output Constraints
An example output constraint specification appears below.
The Name and Units columns are noneditable. To change them, use the signal definition view. (See Signal Definition View. Any changes there apply to the entire design.)
The Minimum and Maximum columns are editable. Their values are the same as on the main Constraints tab (see Constraints on Output Variables). You can specify them in either location.
The remaining columns specify the relaxation band for each constraint. An empty cell is equivalent to 1.0, i.e., a soft constraint.
Entries must be zero or positive real numbers. To soften a constraint, increase its relaxation band.
The example above shows a relaxation band of 0.5 mole % for the distillate purity lower bound, and a relaxation band of 2 mole % for the bottoms purity lower bound (the softer of the two constraints).
| Note The relaxation band is a relative tolerance, not a strict bound. In other words, the actual constraint violation can exceed the relaxation band. |
Overall Constraint Softness
The relaxation band settings allow you to adjust the hardness/softness of each constraint. You can also soften/harden all constraints simultaneously using the slider at the bottom of the dialog box pane.
You can move the slider or edit the value in the edit box, which must be between 0 and 1.
Buttons
OK - Closes the constraint softening dialog box, implementing changes to the tabular entries or the slider setting.
Cancel - Closes the constraint softening dialog box without changing anything.
Weight Tuning Tab
The example below shows the Model Predictive Control Toolbox default tuning weights for an application with two manipulated variables and two outputs.
The following sections discuss the three tab areas in more detail. For additional information, see Optimization Problem.
Each table entry may be a scalar or a vector. A scalar entry defines a weight that is constant for the entire prediction horizon. A vector entry defines a time-varying weight. See Entering Vectors in Table Cells for the required format.
Input Weights
The Name, Description, and Units columns are noneditable. To change them, use the signal definition view. (See Signal Definition View. Any changes there apply to the entire design.)
The Weight column sets a penalty on deviations of each manipulated variable (MV) from its nominal value. The weight must be zero or a positive real number. The default is zero, meaning that the corresponding MV can vary freely provided that it satisfies its constraints (see Constraints on Manipulated Variables).
A large Weight discourages the corresponding MV from moving away from its nominal value. This can cause steady state error (offset) in the output variables unless you have extra MVs at your disposal.
| Note To set the nominal values, use the signal definition view. (See Signal Definition View. Any changes there apply to the entire design.) |
The Rate Weight value sets a penalty on MV changes, i.e., on the magnitude of each MV move. Increasing the penalty on a particular MV causes the controller to change it more slowly. The table entries must be zero or positive real numbers. These values have no effect in steady state.
Output Weights
The Name, Description, and Units columns are noneditable. To change them, use the signal definition view. (See Signal Definition View. Any changes there apply to the entire design.)
The Weight column sets a penalty on deviations of each output variable from its setpoint (or reference) value. The weight must be zero or a positive real number.
A large Weight discourages the corresponding output from moving away from its setpoint.
If you don't need to hold a particular output at a setpoint, set its Weight to zero. This may be the case, for example, when an output doesn't have a target value and is being used as an indicator variable only.
Overall (Slider Control)
The slider adjusts the weights on all variables simultaneously. Moving the slider to the left increases rate penalties relative to setpoint penalties, which often (but not always!) increases controller robustness. The disadvantage is that disturbance rejection and setpoint tracking become more sluggish.
You can also change the value in the edit box. It must be a real number between 0 and 1. The actual effect is nonlinear. You will generally need to run trials to determine the best setting.
Entering Vectors in Table Cells
In the above examples all constraints and weights were entered as scalars. A scalar entry defines a value that is constant for the entire prediction horizon.
You can also define a constraint or weight that varies with time by entering a vector. For the rationale and theoretical basis, see Viewing and Altering Controller Properties and Optimization Problem.
Enter vectors using the standard MATLAB syntax. For example, [1, 2, 3] defines a vector containing three elements, the values 1, 2, and 3.
Entries can be either row or column vectors. A MATLAB expression that produces a vector works too. For example, 4*ones(3,1) would be a valid entry.
If a vector contains fewer than P elements, where P is the horizon length, the controller automatically extends the vector using its last element. For example, if you entered [1, 2, 3] and P = 5, the vector used in controller calculations would be [1, 2, 3, 3, 3].
Estimation Tab
Use these specifications to shape the controller's response to unmeasured disturbances and measurement noise.
The example below shows Model Predictive Control Toolbox default settings for an application with two output variables and no unmeasured disturbance inputs.
The following sections cover each estimation feature in detail. For additional information, see Estimating States from Measured Data for an introduction, and State Estimation for detailed information.
Button (MPC Default Settings)
If you edit any of the Estimation tab settings, the display near the top will appear as follows.
To return the settings to the default state, click the Use MPC Defaults button, causing the display to revert to the default condition shown below.
Overall Estimator Gain
This slider determines the controller's overall disturbance response. As you move the slider to the left, the controller responds less aggressively to unexpected changes in the outputs, i.e., it assumes that such changes are more likely to be caused by measurement noise rather than a real disturbance.
You can also change the value in the edit box. It must be between zero and 1. The effect is nonlinear, and you might need to run trial simulations to achieve the desired result.
Output Disturbances
Use these settings to model unmeasured disturbances adding to the plant outputs.
The example below shows the tab's appearance with the Signal-by-signal option selected for an application having two plant outputs.
The graphic shows the disturbance location.
Use the table to specify the disturbance character for each output.
The Name and Units columns are noneditable. To change them, use the signal definition view. (See Signal Definition View. Any changes there apply to the entire design.)
The Type column sets the disturbance character. To edit this, click the cell and select from the resulting menu. You have the following options:
The Magnitude column specifies the standard deviation of the white noise assumed to create the disturbance. Set it to zero if you want to turn off a particular disturbance.
For example, if Type is Steps and Magnitude is 2, the disturbance model is integrated white noise, where the white noise has a standard deviation of 2.
If these options are too restrictive, select the LTI model in workspace option. The tab appearance changes to the view shown below.
You must specify an LTI output disturbance model residing in your workspace. The Browse button opens a dialog box listing all LTI models in your workspace, and allows you to choose one. You can also type the model name in the edit box, as shown above.
The model must have the same number of outputs as the plant.
The white noise entering the model is assumed to have unity standard deviation.
Input Disturbances
Use these settings to model disturbances affecting the plant's unmeasured disturbance inputs.
The example below shows the tab's appearance with the Signal-by-signal option selected for a plant having one unmeasured disturbance input. The graphic shows the disturbance location.
Use the table to specify the character of each unmeasured disturbance input.
The Name and Units columns are noneditable. To change them, use the signal definition view. (See Signal Definition View. Any changes there apply to the entire design.)
The Type column sets the disturbance character. To edit this, click the cell and select from the resulting menu. You have the following options:
The Magnitude column specifies the standard deviation of the white noise assumed to create the disturbance. Set it to zero if you want to turn off a particular disturbance.
For example, if Type is Steps and Magnitude is 2, the disturbance model is integrated white noise, where the white noise has a standard deviation of 2.
If the above options are too restrictive, select the LTI model in workspace option. The tab appearance changes to the view shown below.
You must specify an LTI disturbance model residing in your workspace. The Browse button opens a dialog box listing all LTI models in your workspace, and allows you to choose one. You can also type the model name in the edit box, as shown above.
The number of model outputs must equal the number of plant unmeasured disturbance inputs. The white noise entering the model is assumed to have unity standard deviation.
Noise
Use these settings to model noise in the plant's measured outputs.
The example below shows the tab's appearance with the Signal-by-signal option selected for a plant having two measured outputs. The graphic shows the noise location.
Use the table to specify the character of each noise input.
The Name and Units columns are noneditable. To change them, use the signal definition view. (See Signal Definition View. Any changes there apply to the entire design.)
The Type column sets the noise character. To edit this, click the cell and select from the resulting menu. You have the following options:
The Magnitude column specifies the standard deviation of the white noise assumed to create the noise. Set it to zero if you want to specify that an output is noise-free.
For example, if Type is Steps and Magnitude is 2, the noise model is integrated white noise, where the white noise has a standard deviation of 2.
If the above options are too restrictive, select the LTI model in workspace option. The tab appearance changes as follows.
You must specify an LTI model residing in your workspace. The Browse button opens a dialog box listing all LTI models in your workspace, and allows you to choose one. You can also type the model name in the edit box, as shown above.
The number of noise model outputs must equal the number of plant measured outputs.
The white noise entering the model is assumed to have unity standard deviation.
Copy Controller
Creates a new controller having the same settings and a default name.
Delete Controller
Deletes the controller. If the controller is being used in a simulation scenario, the design tool replaces it with the first controller in your list, and displays a warning message.
Rename Controller
Opens a dialog box allowing you to rename the controller.
Export Controller
Opens the MPC Controller Exporter dialog box (see Exporting a Controller).
| Provide feedback about this page |
![]() | Simulation Scenarios List | Simulation Scenario View | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |