Create slTuner Interface with Block Substitution
To tune the control system rct_CSTR, create an slTuner interface that linearizes the
system at those design points. Use block substitution to replace the plant in rct_CSTR
with the linearized plant-model array G.
blocksub.Name = 'rct_CSTR/CSTR';
blocksub.Value = G;
tunedblocks = {'Kp','Ki'};
ST0 = slTuner(mdl,tunedblocks,blocksub);
For this example, only the PI coefficients in the Concentration controller are
designated as tuned blocks. In general, however, tunedblocks lists all the blocks to
tune.
For more information about using block substitution to configure an slTuner interface
for gain-scheduled controller tuning, see “Multiple Design Points in slTuner Interface”
(Control System Toolbox).
For another example that illustrates using trimming and linearization to generate a family
of linear models for gain-scheduled controller tuning, see “Trimming and Linearization of
the HL-20 Airframe” (Control System Toolbox).
Sample System at Simulation Snapshots
If you are controlling the system around a reference trajectory (x(σ),u(σ)), use snapshot
linearization to sample the system at various points along the σ trajectory. Use this
approach for time-varying systems where the scheduling variable is time.
To linearize a system at a set of simulation snapshots, use a vector of positive scalars as
the op input argument of linearize, slLinearizer, or slTuner. These scalars are the
simulation times at which to linearize the model. Use the same set of time values as the
design points in tunable surfaces for the system.
Sample System at Varying Parameter Values
If the scheduling variable is a parameter in the Simulink model, you can use parameter
variation to sample the control system over a parameter grid. For example, suppose that
you want to tune a model named suspension_gs that contains two parameters, Ks and
Bs. These parameters each can vary over some known range, and a controller gain in the
model varies as a function of both parameters.
Plant Models for Gain-Scheduled Controller Tuning