Beruflich Dokumente
Kultur Dokumente
This example uses the hinfstruct command to tune a fixed-structure controller subject to
constraints.
On this page
Introduction
Plant Model
Tunable Elements
Loop Shaping Design
Specifying the Control Structure in MATLAB
Tuning the Controller Gains
Tuning the Controller Gains from Simulink
Introduction
The hinfstruct command extends classical
synthesis (see hinfsyn) to fixed-structure control systems.
This command is meant for users already comfortable with the hinfsyn workflow. If you are unfamiliar with
synthesis or find augmented plants and weighting functions intimidating, use systune and looptune
instead. See "Tuning Control Systems with SYSTUNE" for the systune counterpart of this example.
Plant Model
This example uses a 9th-order model of the head-disk assembly (HDA) in a hard-disk drive. This model
captures the first few flexible modes in the HDA.
load hinfstruct_demo G
bode(G), grid
We use the feedback loop shown below to position the head on the correct track. This control structure
consists of a PI controller and a low-pass filter in the return path. The head position y should track a step
change r with a response time of about one millisecond, little or no overshoot, and no steady-state error.
Use the ltiblock.pid class to parameterize the PI block and specify the filter
depending on a tunable real parameter .
C0 = ltiblock.pid('C','pi');
a = realp('a',1);
F0 = tf(a,[1 a]);
% tunable PI
% filter coefficient
% filter parameterized by a
as a transfer function
Note that we chose a bi-proper, bi-stable realization to avoid technical difficulties with marginally stable poles
and improper inverses. In order to tune
and
with hinfstruct, we must turn this target loop shape
into constraints on the closed-loop gains. A systematic way to go about this is to instrument the feedback loop
as follows:
Add a measurement noise signal n
Use the target loop shape LS and its reciprocal to filter the error signal e and the white noise source nw.
denotes the closed-loop transfer function from (r,nw) to (y,ew), the gain constraint
and
to enforce
T0.Blocks
ans =
C: [1x1 ltiblock.pid]
a: [1x1 realp]
Note that T0 captures the following "Standard Form" of the block diagram of Figure 2 where the tunable
components
are separated from the fixed dynamics.
rng('default')
opt = hinfstructOptions('Display','final','RandomStart',5);
T = hinfstruct(T0,opt);
Final: Peak gain = 3.88, Iterations = 103
Final: Peak gain = 1.56, Iterations = 115
Final: Peak gain = 597, Iterations = 188
Some closed-loop poles are marginally stable (decay rate
near 1e-07)
Final: Peak gain = 1.56, Iterations = 128
Final: Peak gain = 1.56, Iterations = 92
Final: Peak gain = 3.88, Iterations = 56
The best closed-loop gain is 1.56, so the constraint
returns the tuned closed-loop transfer
coefficient :
showTunable(T)
C =
1
Kp + Ki * --s
with Kp = 0.000846, Ki = 0.0103
Name: C
Continuous-time PI controller in parallel form.
----------------------------------a = 5.49e+03
Use getBlockValue to get the tuned value of
value of :
C = getBlockValue(T,'C');
F = getValue(F0,T.Blocks);
to F
tf(F)
ans =
From input "yn" to output "yf":
5486
-------s + 5486
Continuous-time transfer function.
To validate the design, plot the open-loop response L=F*G*C and compare with the target loop shape LS:
bode(LS,'r--',G*C*F,'b',{1e1,1e6}), grid,
title('Open-loop response'), legend('Target','Actual')
The 0dB crossover frequency and overall loop shape are as expected. The stability margins can be read off
the plot by right-clicking and selecting the Characteristics menu. This design has 24dB gain margin and 81
degrees phase margin. Plot the closed-loop step response from reference r to position y:
While the response has no overshoot, there is some residual wobble due to the first resonant peaks in G. You
might consider adding a notch filter in the forward path to remove the influence of these modes.
Tuning the Controller Gains from Simulink
Suppose you used this Simulink model to represent the control structure. If you have Simulink Control Design
installed, you can tune the controller gains from this Simulink model as follows. First mark the signals r,e,y,n
as Linear Analysis points in the Simulink model.
Then create an instance of the slTuner interface and mark the Simulink blocks C and F as tunable:
ST0 = slTuner('rct_diskdrive',{'C','F'});
Since the filter
a = realp('a',1);
% filter coefficient
setBlockParam(ST0,'F',tf(a,[1 a]));
Finally, use getIOTransfer to derive a tunable model of the closed-loop transfer function
(see Figure 2)
rng(0)
opt = hinfstructOptions('Display','final','RandomStart',5);
T = hinfstruct(T0,opt);
Final: Peak gain = 3.93, Iterations = 120
showTunable(T)
C =
1
Kp + Ki * --s
with Kp = 0.000846, Ki = 0.0103
Name: C
Continuous-time PI controller in parallel form.
----------------------------------a = 5.49e+03