Académique Documents
Professionnel Documents
Culture Documents
In the previous step you expressed your design requirements as a constraint on the H norm of a closed-loop
transfer function H(s).
The next step is to create a Generalized LTI model of H(s) that includes all of the fixed and tunable elements
of the control system. The model also includes any weighting functions that represent your design
requirements. There are two ways to obtain this tunable model of your control system:
1. Use commands such as tf, zpk, and ss to create numeric linear models that represent the fixed elements
of your control system and any weighting functions that represent your design requirements.
2. Use tunable models (either Control Design Blocks or Generalized LTI models) to model the tunable
elements of your control system. For more information about tunable models, see Models with Tunable
Coefficients in the Control System Toolbox User's Guide.
3. Use model-interconnection commands such as series, parallel, and connect to construct your closed-
loop system from the numeric and tunable models.
Example: Modeling a Control System With a Tunable PI Controller and Tunable Filter
This example shows how to construct a tunable generalized linear model of the following control system for
tuning with hinfstruct.
This block diagram represents a head-disk assembly (HDA) in a hard disk drive. The architecture includes the
plant G in a feedback loop with a PI controller C and a low-pass filter, F = a/(s+a). The tunable parameters
are the PI gains of C and the filter parameter a.
The block diagram also includes the weighting functions LS and 1/LS, which express the loop-shaping
requirements. Let T(s) denote the closed-loop transfer function from inputs (r,nw) to outputs (y,ew). Then, the
H constraint:
approximately enforces the target open-loop response shape LS. For this example, the target loop shape is
This value of LS corresponds to the following open-loop response shape.
To tune the HDA control system with hinfstruct, construct a tunable model of the closed-loop system T(s),
including the weighting functions, as follows.
load hinfstruct_demo G
C = ltiblock.pid('C','pi');
a = realp('a',1);
F = tf(a,[1 a]);
wc = 1000;
s = tf('s');
LS = (1+0.001*s/wc)/(0.001+s/wc);
5. Label the inputs and outputs of all the components of the control system.
Labeling the I/Os allows you to connect the elements to build the closed-loop system T(s).
6. Specify the summing junctions in terms of the I/O labels of the other components of the control system.
7. Use connect to combine all the elements into a complete model of the closed-loop system T(s).
T0 = connect(G,Wn,We,C,F,Sum1,Sum2,{'r','nw'},{'y','ew'});
T0 is a genss object, which is a Generalized LTI model representing the closed-loop control system with
weighting functions. The Blocks property of T0 contains the tunable blocks C and a.
T0.Blocks
ans =
C: [1x1 ltiblock.pid]
a: [1x1 realp]
For more information about generalized models of control systems that include both numeric and tunable
components, see Models with Tunable Coefficients in the Control System Toolbox documentation.
You can now use hinfstruct to tune the parameters of this control system. See Tune the Controller
Parameters.
Example: Creating a Weighted Tunable Model of Control System Starting From a Simulink Model
This example shows how to construct a tunable generalized linear model of the control system in the Simulink
model rct_diskdrive.
To create a generalized linear model of this control system (including loop-shaping weighting functions):
open('rct_diskdrive');
2. Create an slTuner interface to the model. The interface allows you to specify the tunable blocks and
extract linearized open-loop and closed-loop responses. (For more information about the interface, see
the slTuner reference page.)
ST0 = slTuner('rct_diskdrive',{'C','F'});
This command specifies that C and F are the tunable blocks in the model. The slTuner interface
automatically parametrizes these blocks. The default parametrization of the transfer function block F is a
transfer function with two free parameters. Because F is a low-pass filter, you must constrain its
coefficients. To do so, specify a custom parameterization of F.
3. Extract a tunable model of the closed-loop transfer function you want to tune.
T0 = getIOTransfer(ST0,{'r','n'},{'y','e'});
This command returns a genss model of the linearized closed-loop transfer function from the reference
and noise inputs r,n to the measurement and error outputs y,e. The error output is needed for the loop-
shaping weighting function.
4. Define the loop-shaping weighting functions and append them to T0.
wc = 1000;
s = tf('s');
LS = (1+0.001*s/wc)/(0.001+s/wc);
T0 = blkdiag(1,LS) * T0 * blkdiag(1,1/LS);
The generalized linear model T0 is a tunable model of the closed-loop transfer function T(s), discussed in
Example: Modeling a Control System With a Tunable PI Controller and Tunable Filter. T(s) is a weighted
closed-loop model of the control system of rct_diskdrive. Tuning T0 to enforce the H constraint
You can now use hinfstruct to tune the parameters of this control system. See Tune the Controller
Parameters.