Specifications

3 Designing Controllers Using the Design Tool GUI
3-44
In general, you'll have to experiment to determine the settings that provide appropriate
trade-offs for your application. In particular, the relaxation band settings interact with
those on the controller's Weight Tuning tab (see “Weight Tuning” on page 3-24).
Another important factor is the expected numerical range for each variable. For example,
if a particular variable stays within ±0.1 of its nominal value, it should have a small
relaxation band relative to another variable having a range of ±100.
For details on the Model Predictive Control Toolbox constraint softening formulation, see
“Optimization Problem”.
Save Your Work
You'll usually want to save your design so you can reuse or revise it. You can save
individual controllers or an entire project.
When you close the design tool, you'll be prompted to save new or modified designs. You
can also save manually to preserve an intermediate state or guard against an unexpected
shutdown.
This section covers the following topics:
“Exporting a Controller” on page 3-44
“Saving a Project” on page 3-45
Exporting a Controller
To save a controller, export it to your MATLAB workspace or to a MAT-file. The former
allows you to use the exported controller in command-line functions or a Simulink block.
Note Your workspace disappears when you exit MATLAB. A MAT-file is permanent, and
you can reload it in a subsequent MATLAB session.
The following example assumes that the design tool is open and in the state described
in the previous section. Suppose you want to export the controller to your workspace.
Expand the tree if necessary, right-click MPC2, and select Export Controller from the
resulting menu. The following dialog box appears.