HINFSTRUCTSynth Matlab Ifac
HINFSTRUCTSynth Matlab Ifac
HINFSTRUCTSynth Matlab Ifac
P. Gahinet ∗ P. Apkarian ∗∗
∗
MathWorks, 3 Apple Hill, Natick, MA 01760, USA (Tel: +1 508-647-7368;
e-mail: pascal@mathworks.com).
∗∗
ONERA-CERT, Centre d’études et de recherches de Toulouse, Control System
Department, 2 av. Edouard Belin, 31055 Toulouse, France - and - Institut de
Mathématiques, Université Paul Sabatier, Toulouse, France (Tel: +33
5.62.25.27.84 ; e-mail: apkarian@cert.fr)
Abstract: This paper presents new MATLAB-based tools for tuning fixed-structure linear
control systems using the H∞ methodology. Unlike traditional H∞ synthesis, these tools can
directly tune arbitrary control architectures consisting of one or more feedback loops and one or
more fixed-order, fixed-structure control elements. This makes them ideally suited for deploying
H∞ techniques in real-world applications.
P(s) M M
21 22
u y
.. . . 0.
a ...
u C (s) ... 0 y
..
1
..
. . ..
.
..
. .
0 ... a
0 . . . CN(s)
Now that we have a framework for describing arbitrary In other words, the H∞ constraint kH(s)k∞ < 1 + δ
control architectures and linear control elements, we turn enforces the desired loop shape along with good stability
to the question of recasting the design requirements as margins.
H∞ constraints. At the heart of H∞ synthesis is the H∞ In general, this procedure leads to one or more normalized
norm, which measured the peak input/output gain of a H∞ constraints kHj (s)k∞ < 1 on frequency-weighted
given transfer function: closed-loop transfer functions H1 (s), . . . , HM (s). Introduc-
kH(s)k∞ := max σ(H(jω)). (7) ing
ω
H(s) := Diag(H1 (s), . . . , HM (s)), (8)
In the SISO case, this norm is just the peak gain over
frequency. In the MIMO case, it measures the peak 2-norm we can consolidate all requirements into the single con-
of the frequency response H(jω) over frequency. straint kH(s)k∞ < 1. Consequently, the tuning of a par-
ticular control architecture can be recast as the following
From classical control, we know that most control design program:
requirements are equivalent to gain constraints on the
open- or closed-loop response. For example, good tracking Structured H∞ Program: Tune the free parameters
in a particular frequency band is equivalent to small gain of C(s) := Diag(C1 (s), . . . , CN (s)) to enforce closed-loop
from reference to error signals in this band. Similarly, (internal) stability and kH(s)k∞ < 1.
bandwidth and roll-off requirements can be enforced by
Note that structured H∞ synthesis can handle constraints
shaping the open-loop response gain. For example, con-
on several independent transfers H1 (s), . . . , HM (s). To
sider the elementary feedback loop of Figure 3 and sup-
see this, observe that for Hj (s) := Fl (Pj (s), C(s)), the
pose we want integral action with bandwidth ωc . Then
Standard Form for H(s) looks like
λ(s) = ωc /s is a suitable shape for the open-loop response
L(s) = G(s)C(s) as depicted in Figure 4. The zero dB H(s) = Fl (P (s), Diag(C(s), . . . , C(s))) (9)
crossover frequency ωc dictates how fast the system re-
sponds and is limited by factors such as stability, delays, where P (s) is some rearrangement of the input and output
actuator bandwidth, and modeling errors. channels of Diag(P1 (s), . . . , PM (s)). So constraining two
or more closed-loop transfer functions Hj (s) leads to re-
ew peating the controller C(s) multiple times in the Standard
Form. The resulting block-diagonal controller structure is
l(s) beyond the scope of standard H∞ algorithms but poses
+ e no problem in our framework since this merely amounts
r C(s) G(s) y
- to repeating the tunable blocks along the diagonal (see
Section 2 for a discussion of repeated blocks). This is an
+
n nw
important difference with traditional H∞ synthesis where
1/l(s)
+ all requirements must be expressed in terms of a single
closed-loop transfer function, and this additional capabil-
Fig. 3. Loop Shaping Configuration ity greatly simplifies the H∞ formulation as illustrated in
Section 6.
Target loop shape
20
15
4. NONSMOOTH H∞ SOLVERS
10 ω
c
5
The Structured H∞ Program of Section 3 can be solved
Magnitude (dB)
0
using specialized nonsmooth optimization techniques. This
−5
section gives a high-level overview of the structured H∞
−10
solver at the heart of our software tools. The full details
−15
can be found in Apkarian and Noll [2006a, 2007] and a
−20
10
0
10
1 2
10
variety problem studies as well as applications can be
Frequency (rad/sec)
found in Apkarian [2010]. Note that related nonsmooth
techniques and software for control applications are dis-
Fig. 4. Target Loop Shape |λ(jω)| = ωc /ω cussed in Burke et al. [2006], Michiels and Niculescu [2007]
and references therein.
Once we express requirements in terms of open- or closed- Structured H∞ synthesis requires solving semi-infinite,
loop gains, there are well-established procedures for de- nonconvex, and nonsmooth programs of the form
riving the corresponding H∞ constraints Skogestad and
Postlethwaite [1996]. For example, if the closed-loop trans- minimize kFl (P (s), C(s))k∞ ⇐⇒
C(s)
fer function H(s) from (r, nw ) to (y, ew ) in Figure 3 satis-
(10)
minimize max σ Fl (Pb(jω), x) ,
fies kH(s)k∞ < 1 + δ, then for small δ: x∈Rk ω∈[0, ∞]
where C(s) is the structured controller of Section 2 and the σ(Fl (P
b(jω), x)
vector x gathers all low-level tunable parameters in C(s). Hamiltonian
method
While this is a challenging mathematical programming kFl (P
b(s), x)k∞
f (ωb , x) := 0.9kFl (Pb(s), x)k∞ ** * *
problem, it is important to note that the right-hand-side bracketing frequencies ωb
Clarke regularity ensures that critical points x∗ (typically This section gives a brief overview of new software tools to
local minima) are characterized by the condition 0 ∈ formulate and solve structured H∞ problems for arbitrary
∂f (x). linear control architectures. These tools are available in
Robust Control Toolbox [2011]. Note that some functional-
To solve (11), we construct a tangent model around the ity discussed here is only available in the R2011a version.
current iterate x that constitutes a ”quadratic first-order”
local approximation of the original problem. An adequate As discussed in Section 2, the structure of individual
descent direction h is then computed by solving a convex tunable elements is described in terms of parameterization.
quadratic program of the form: The software provides pre-defined parameterizations for
gains, PIDs, fixed-order transfer functions, and state-space
minimize fˆ∞ (x + h) := models. For example
h∈Rk
1 (12) C1=ltiblock.tf('C1',2,3) % 2 zeros, 3 poles
max f (ω, x) − f∞ (x) + ΦTω h + hT Qh
ω∈Ωf 2 parameterizes C1 (s) as a strictly proper third-order trans-
fer function. In addition, users can create their own pa-
where Ωf is some finite set of frequencies and Φω ∈ rameterization using the realp building block (real pa-
∂f (ω, x) is a subgradient of f (ω, x). There are many rameter) and standard arithmetic operations, see Section
possible implementations of this scheme Apkarian and Noll 2 for examples.
[2006a], but a minimal requirement is that Ωf contain the The H∞ formulation of design requirements remains a
active frequencies ωa achieving the peak value in (11): manual process. This is the same process as for standard
f∞ (x) = f (ωa , x) . H∞ synthesis, somewhat simplified by the fact that we
can independently constrain several closed-loop transfer
This simple requirement is enough for the algorithm to functions (see Section 3). Tools are available to derive
converge. Yet by adding a few extra well-chosen frequen- the Standard Form of Figure 1 in both MATLAB and
cies, we can often improve the quality of the tangent model Simulink. Note that the objects used to parameterize
(12) and take longer steps at each iteration. In particu- C1 (s), . . . , CN (s) can be combined with regular LTI ob-
lar, including frequencies bracketing the active peaks can jects to build ”parametric” models of the relevant closed-
dramatically accelerate convergence Apkarian and Noll loop transfer functions. For example, consider the simple
[2006b,a]. See Figure 5 for an illustration of this strategy. scenario where the requirements for the feedback loop of
Note that multiple active frequencies typically arise as the Figure 3 can be expressed as
optimization progresses due to the ”waterbed effect”. The
corresponding loss of differentiability can often spell trou- kwS Sk∞ < 1, kwT T k∞ < 1 (13)
ble for smooth nonlinear programming algorithms Bert-
sekas [1995] which may fail to find a joint descent direction where S = 1/(1 + L), T = L/(1 + L), and wS , wT
for all active peaks. are suitable frequency-weighting functions. Assuming the
tunable block C(s) is a PID controller, the aggregate
The resulting algorithm is guaranteed to converge to a transfer function H(s) = Diag(wS S, wT T ) is obtained by:
critical point (a local minimum in practice) and has proved
very effective on a wide range of test problems including G = tf([1 2],[1 5 10]); % plant model
large scale systems Simoes et al. [2009]. Arguably, the C = ltiblock.pid('C','pid'); % define PID
function f∞ (.) is non convex and there is no guarantee of S = feedback(1,G*C);
reaching the global optimum. But ”convex” formulations T = feedback(G*C,1);
(e.g., in terms of LMIs Boyd et al. [1994]) often rely on H0 = blkdiag(wS * S, wT * T);
conservative and expensive relaxations or resort to bi- The variable H0 contains a MATLAB representation of the
convex schemes like BMIs Safonov et al. [1994] and D-K (untuned) Standard Form for H(s) and depends on the
iterations [Zhou and Doyle, 1998, p. 381]. As a result, our tunable PID block C.
approach is very competitive with such formulations and
has the advantage of tuning the original control structure Once the Standard Form is available, the hinfstruct
and controller parameters. command invokes the solver outlined in Section 4 to
reference model
optimize the free parameters of C1 , . . . , CN . For example, tracking error
the PID gains in the simple example above are tuned by Gref (s)
−
feedforward
H = hinfstruct(H0);
Kf
The output H contains the tuned Standard Form of H(s)
w
and you can access the tuned PID controller C with roll−off filter aircraft
Nz
Nzc Ki + δm
s+ Fro(s) G(s) q
H.Blocks.C − −
Feedback 40
1.2
0 20
1 −0.005 0
−0.01 −20
0.8
δm
Nz
−40
−0.015 180
0.6
−0.02 90
Phase (deg)
0.4 −0.025 0
−0.03 −90
0.2
−0.035 −180
0 −0.04 −270
−3 −2 −1 0 1
0 1 2 3 4 5 6 0 1 2 3 4 5 6 10 10 10 10 10
Time (sec) Time (sec) Frequency (rad/sec)