Create tunable gain surface for gain scheduling
tunableSurface
lets you parameterize
and tune gain schedules, which are gains that
vary as a function of one or more scheduling variables.
For tuning purposes, it is convenient to parameterize a variable gain as a smooth gain surface of the form:
where
σ is a vector of scheduling variables.
n(σ) is a normalization function (see
the Normalization
property of the output argument
K
).
γ is a scaling factor (see the
Normalization
property of the output argument
K
).
F1,...,FM are user-selected basis functions.
K0,...,KM are the coefficients to be tuned
You can use terms in a generic polynomial expansion as basis functions. Or, when the
expected shape of K(σ) is known, you can use more
specific functions. You can then use systune
to tune the
coefficients
K0,...,KM,
subject to your design requirements, over the range of scheduling-variable
values.
creates
the tunable gain surface: K
= tunableSurface(name
,K0init
,domain
,shapefcn
)
The tunable surface K
stores the basis
functions specified by shapefcn
and a discrete
set of σ values (the design points)
given by domain
. The tunable gain surface has
tunable coefficients K0,...,KM.
The gain value is initialized to the constant gain K0init
.
You can combine K
with other static or dynamic
elements to construct a closed-loop model of your gain-scheduled control
system. Or, use K
to parameterize a lookup table
in an slTuner
interface to a Simulink® model.
Then, use systune
to tune K0,...,KM so
that the closed-loop system meets your design requirements at the
selected design points.
To tune a gain surface in a control system modeled
in MATLAB®: Connect the gain surface with an array of plant models
corresponding to the design points in domain
.
For example, suppose G
is such an array, and K
represents
a variable integration time. The following command builds a closed-loop
model that you can tune with the systune
command.
C0 = tf(K,[1 0]); T0 = feedback(C0*G,1);
To tune a gain surface in a control system modeled in Simulink: Use the gain surface to parameterize a lookup-table, matrix
interpolation, or MATLAB function block in the Simulink model. For example, suppose ST0
is an
slTuner
interface to a Simulink model, and GainTable
is the name of a tuned
block in the interface. The following command sets the parameterization of
GainTable
to the tunable gain surface.
ST0 = setBlockParam(ST0,'GainTable',K);
See Parameterize Gain Schedules for more information.
When you use writeBlockValue
(Simulink Control Design) to write a
tuned gain surface back to a Simulink model, the software uses codegen
to generate MATLAB code for the gain surface. You can use
codegen
yourself to examine this code.