To set up such a model for tuning, create a grid of parameter values. For this example, let
Ks vary from 1 – 5, and let Bs vary from 0.6 – 0.9.
Ks = 1:5;
Bs = [0.6:0.1:0.9];
[Ksgrid,Bsgrid] = ndgrid(Ks,Bs);
These values are the design points at which to sample and tune the system. For example,
create an slTuner interface to the model, assuming one tunable block, a Lookup Table
block named K that models the parameter-dependent gain.
params(1) = struct('Name','Ks','Value',Ksgrid);
params(2) = struct('Name','Bs','Value',Bsgrid);
STO = slTuner('suspension_gs','K',params);
slTuner samples the model at all (Ksgrid,Bsgrid) values specified in params.
Next, use the same design points to create a tunable gain surface for parameterizing K.
design = struct('Ks',Ksgrid,'Bs',Bsgrid);
shapefcn = @(Ks,Bs)[Ks,Bs,Ks*Bs];
K = tunableSurface('K',1,design,shapefcn);
setBlockParam(ST0,'K',K);
After you parameterize all the scheduled gains, you can create your tuning goals and tune
the system with systune.
Eliminate Samples at Unneeded Design Points
Sometimes, your sampling grid includes points that represent irrelevant or unphysical
design points. You can eliminate such design points from the model grid entirely, so that
they do not contribute to any stage of tuning or analysis. To do so, use voidModel, which
replaces specified models in a model array with NaN. voidModel replaces specified
models in a model array with NaN. Using voidModel lets your design over a grid of
design points that is almost regular.
There are other tools for controlling which models contribute to design and analysis. For
instance, you might want to:
- Keep a model in the grid for analysis, but exclude it from tuning.
- Keep a model in the grid for tuning, but exclude it from a particular design goal.
11 Gain-Scheduled Controllers