diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..62a076b --- /dev/null +++ b/.gitignore @@ -0,0 +1,262 @@ +.auctex-auto/ +.log/ + +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 +.*.lb + +## Intermediate documents: +*.dvi +*.xdv +*-converted-to.* +# these rules might exclude image files for figures etc. +# *.ps +# *.eps +# *.pdf + +## Generated if empty string is given at "Please type another file name for output:" +.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex(busy) +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Build tool directories for auxiliary files +# latexrun +latex.out/ + +## Auxiliary and intermediate files from other packages: +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# beamer +*.nav +*.pre +*.snm +*.vrb + +# changes +*.soc + +# comment +*.cut + +# cprotect +*.cpt + +# elsarticle (documentclass of Elsevier journals) +*.spl + +# endnotes +*.ent + +# fixme +*.lox + +# feynmf/feynmp +*.mf +*.mp +*.t[1-9] +*.t[1-9][0-9] +*.tfm + +#(r)(e)ledmac/(r)(e)ledpar +*.end +*.?end +*.[1-9] +*.[1-9][0-9] +*.[1-9][0-9][0-9] +*.[1-9]R +*.[1-9][0-9]R +*.[1-9][0-9][0-9]R +*.eledsec[1-9] +*.eledsec[1-9]R +*.eledsec[1-9][0-9] +*.eledsec[1-9][0-9]R +*.eledsec[1-9][0-9][0-9] +*.eledsec[1-9][0-9][0-9]R + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls +*.glsdefs + +# gnuplottex +*-gnuplottex-* + +# gregoriotex +*.gaux +*.gtex + +# htlatex +*.4ct +*.4tc +*.idv +*.lg +*.trc +*.xref + +# hyperref +*.brf + +# knitr +*-concordance.tex +# TODO Comment the next line if you want to keep your tikz graphics files +*.tikz +*-tikzDictionary + +# listings +*.lol + +# makeidx +*.idx +*.ilg +*.ind +*.ist + +# minitoc +*.maf +*.mlf +*.mlt +*.mtc[0-9]* +*.slf[0-9]* +*.slt[0-9]* +*.stc[0-9]* + +# minted +_minted* +*.pyg + +# morewrites +*.mw + +# nomencl +*.nlg +*.nlo +*.nls + +# pax +*.pax + +# pdfpcnotes +*.pdfpc + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# scrwfile +*.wrt + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# pdfcomment +*.upa +*.upb + +# pythontex +*.pytxcode +pythontex-files-*/ + +# tcolorbox +*.listing + +# thmtools +*.loe + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# todonotes +*.tdo + +# vhistory +*.hst +*.ver + +# easy-todo +*.lod + +# xcolor +*.xcp + +# xmpincl +*.xmpi + +# xindy +*.xdy + +# xypic precompiled matrices +*.xyc + +# endfloat +*.ttt +*.fff + +# Latexian +TSWLatexianTemp* + +## Editors: +# WinEdt +*.bak +*.sav + +# Texpad +.texpadtmp + +# LyX +*.lyx~ + +# Kile +*.backup + +# KBibTeX +*~[0-9]* + +# auto folder when using emacs and auctex +./auto/* +*.el + +# expex forward references with \gathertags +*-tags.tex + +# standalone packages +*.sta diff --git a/figs/ex_general_weighted_plant b/figs/ex_general_weighted_plant.pdf similarity index 100% rename from figs/ex_general_weighted_plant rename to figs/ex_general_weighted_plant.pdf diff --git a/index.html b/index.html index f6e4d7c..78d6453 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + A brief and practical introduction to \(\mathcal{H}_\infty\) Control @@ -30,62 +30,66 @@

Table of Contents

+
+

Introduction

+

The purpose of this document is to give a practical introduction to the wonderful world of \(\mathcal{H}_\infty\) Control.

@@ -105,33 +109,35 @@ When possible, Matlab scripts used for the example/exercises are provided such t The general structure of this document is as follows:

+
+
-
-

1 Introduction to Model Based Control

+
+

1 Introduction to Model Based Control

- +

-
-

1.1 Model Based Control - Methodology

+
+

1.1 Model Based Control - Methodology

- +

-The typical methodology for Model Based Control techniques is schematically shown in Figure 1. +The typical methodology for Model Based Control techniques is schematically shown in Figure 1.

@@ -148,7 +154,7 @@ It consists of three steps: -

+

control-procedure.png

Figure 1: Typical Methodoly for Model Based Control

@@ -160,20 +166,20 @@ In this document, we will suppose a model of the plant is available (step 1 alre

-In Section 2, steps 2 and 3 will be described for a control techniques called classical (open-)loop shaping. +In Section 2, steps 2 and 3 will be described for a control techniques called classical (open-)loop shaping.

-Then, steps 2 and 3 for the \(\mathcal{H}_\infty\) Loop Shaping of closed-loop transfer functions will be discussed in Sections 4, 5 and 6. +Then, steps 2 and 3 for the \(\mathcal{H}_\infty\) Loop Shaping of closed-loop transfer functions will be discussed in Sections 4, 5 and 6.

-
-

1.2 From Classical Control to Robust Control

+
+

1.2 From Classical Control to Robust Control

- +

@@ -205,14 +211,15 @@ This robust control theory is the subject of this document.

-The three presented control methods are compared in Table 1. +The three presented control methods are compared in Table 1.

Note that in parallel, there have been numerous other developments, including non-linear control, adaptive control, machine-learning control just to name a few.

- + +
@@ -245,26 +252,26 @@ Note that in parallel, there have been numerous other developments, including no - + - + - + - + @@ -275,27 +282,20 @@ Note that in parallel, there have been numerous other developments, including no - - - - - - - - - - - + + + + - - + + @@ -326,32 +326,25 @@ Note that in parallel, there have been numerous other developments, including no - - - - - - - - + - + - - + + - + @@ -360,11 +353,11 @@ Note that in parallel, there have been numerous other developments, including no -
-

1.3 Example System

+
+

1.3 Example System

- +

@@ -373,24 +366,24 @@ Most of them will be applied on a physical system presented in this section.

-This system is shown in Figure 2. +This system is shown in Figure 2. It could represent an active suspension stage supporting a payload. The inertial motion of the payload is measured using an inertial sensor and this is feedback to a force actuator. Such system could be used to actively isolate the payload (disturbance rejection problem) or to make it follow a trajectory (tracking problem).

-The notations used on Figure 2 are listed and described in Table 2. +The notations used on Figure 2 are listed and described in Table 2.

-
+

mech_sys_1dof_inertial_contr.png

Figure 2: Test System consisting of a payload with a mass \(m\) on top of an active system with a stiffness \(k\), damping \(c\) and an actuator. A feedback controller \(K(s)\) is added to position / isolate the payload.

-
Table 1: Table summurazing the main differences between classical, modern and robust control
Tools Transfer Functions State Space formulationSystems and Signals NormsSystems/Signal Norms
  Nyquist, Bode Plots Riccati EquationsClosed Loop Transfer FunctionsClosed Loop TF
  Root Locus Kalman Filters Closed Loop Shaping
 Phase and Gain marginsPhase/Gain margins   Weighting Functions
  Disk margin
   Singular Value Decomposition
Control ArchitecturesProportional, Integral, DerivativeFull State Feedback, LQRGeneral Control ConfigurationControllersP, PI, PIDFull State FeedbackGeneral Control Conf.
  Leads, LagsKalman Filters, LQGGeneralized PlantLQG, LQR 
  Guaranteed Robustness
   Easy specification of performances
DisadvantagesDisadvant. Manual Method No Guaranteed RobustnessRequired knowledge of specific toolsRequires knowledge of tools
  Only SISODifficult Rejection of PerturbationsNeed a reasonably good model of the systemRejection of Pert.Need good model of the system
 No clear way to limit input usageNo input usage lim.    
+
@@ -476,7 +469,7 @@ The notations used on Figure 2 are listed and describe
Table 2: Example system variables
-
+

Derive the following open-loop transfer functions:

@@ -509,14 +502,14 @@ You can follow this generic procedure:

-Having obtained \(G(s)\) and \(G_d(s)\), we can transform the system shown in Figure 2 into a classical feedback architecture as shown in Figure 6. +Having obtained \(G(s)\) and \(G_d(s)\), we can transform the system shown in Figure 2 into a classical feedback architecture as shown in Figure 6.

-
+

classical_feedback_test_system.png

-

Figure 3: Block diagram corresponding to the example system of Figure 2

+

Figure 3: Block diagram corresponding to the example system of Figure 2

@@ -540,18 +533,18 @@ And now the system dynamics \(G(s)\) and \(G_d(s)\).

-The Bode plots of \(G(s)\) and \(G_d(s)\) are shown in Figures 4 and 5. +The Bode plots of \(G(s)\) and \(G_d(s)\) are shown in Figures 4 and 5.

-
+

bode_plot_example_afm.png

Figure 4: Bode plot of the plant \(G(s)\)

-
+

bode_plot_example_Gd.png

Figure 5: Magnitude of the disturbance transfer function \(G_d(s)\)

@@ -560,40 +553,40 @@ The Bode plots of \(G(s)\) and \(G_d(s)\) are shown in Figures -

2 Classical Open Loop Shaping

+
+

2 Classical Open Loop Shaping

- +

-After an introduction to classical Loop Shaping in Section 2.1, a practical example is given in Section 2.2. +After an introduction to classical Loop Shaping in Section 2.1, a practical example is given in Section 2.2. Such Loop Shaping is usually performed manually with tools coming from the classical control theory.

However, the \(\mathcal{H}_\infty\) synthesis can be used to automate the Loop Shaping process. -This is presented in Section 2.3 and applied on the same example in Section 2.4. +This is presented in Section 2.3 and applied on the same example in Section 2.4.

-
-

2.1 Introduction to Loop Shaping

+
+

2.1 Introduction to Loop Shaping

- +

-
+

Loop Shaping refers to a control design procedure that involves explicitly shaping the magnitude of the Loop Transfer Function \(L(s)\).

-
+

-The Loop Gain (or Loop transfer function) \(L(s)\) usually refers to as the product of the controller and the plant (see Figure 6): +The Loop Gain (or Loop transfer function) \(L(s)\) usually refers to as the product of the controller and the plant (see Figure 6):

\begin{equation} L(s) = G(s) \cdot K(s) \label{eq:loop_gain} @@ -604,7 +597,7 @@ Its name comes from the fact that this is actually the “gain around the lo

-
+

open_loop_shaping.png

Figure 6: Classical Feedback Architecture

@@ -628,12 +621,12 @@ It is widely used and generally successful as many characteristics of the closed

The shaping of the Loop Gain is done manually by combining several leads, lags, notches… This process is very much simplified by the fact that the loop gain \(L(s)\) depends linearly on \(K(s)\) \eqref{eq:loop_gain}. -A typical wanted Loop Shape is shown in Figure 7. +A typical wanted Loop Shape is shown in Figure 7. Another interesting Loop shape called “Bode Step” is described in [1].

-
+

open_loop_shaping_shape.png

Figure 7: Typical Wanted Shape for the Loop Gain \(L(s)\)

@@ -642,21 +635,21 @@ Another interesting Loop shape called “Bode Step” is described in The shaping of closed-loop transfer functions is obviously not as simple as they don’t depend linearly on \(K(s)\). But this is were the \(\mathcal{H}_\infty\) Synthesis will be useful! -More details on that in Sections 4 and 5. +More details on that in Sections 4 and 5.

-
-

2.2 Example of Manual Open Loop Shaping

+
+

2.2 Example of Manual Open Loop Shaping

- +

-
+

-Let’s take our example system described in Section 1.3 and design a controller using the Open-Loop shaping synthesis approach. +Let’s take our example system described in Section 1.3 and design a controller using the Open-Loop shaping synthesis approach. The specifications are:

    @@ -668,7 +661,7 @@ The specifications are:
-
+

Using SISOTOOL, design a controller that fulfills the specifications.

@@ -707,7 +700,7 @@ Let’s say we came up with the following controller.

-The bode plot of the Loop Gain is shown in Figure 8 and we can verify that we have the wanted stability margins using the margin command: +The bode plot of the Loop Gain is shown in Figure 8 and we can verify that we have the wanted stability margins using the margin command:

[Gm, Pm, ~, Wc] = margin(G*K)
@@ -747,7 +740,7 @@ The bode plot of the Loop Gain is shown in Figure 8 an
 
 
 
-
+

loop_gain_manual_afm.png

Figure 8: Bode Plot of the obtained Loop Gain \(L(s) = G(s) K(s)\)

@@ -755,11 +748,11 @@ The bode plot of the Loop Gain is shown in Figure 8 an
-
-

2.3 \(\mathcal{H}_\infty\) Loop Shaping Synthesis

+
+

2.3 \(\mathcal{H}_\infty\) Loop Shaping Synthesis

- +

@@ -782,7 +775,7 @@ where:

  • K is the synthesize controller
  • -
    +

    Matlab documentation of loopsyn (link).

    @@ -799,23 +792,23 @@ Even though we will not go into details and explain how such synthesis is workin
    -
    -

    2.4 Example of the \(\mathcal{H}_\infty\) Loop Shaping Synthesis

    +
    +

    2.4 Example of the \(\mathcal{H}_\infty\) Loop Shaping Synthesis

    - +

    To apply the \(\mathcal{H}_\infty\) Loop Shaping Synthesis, the wanted shape of the loop gain should be determined from the specifications. -This is summarized in Table 3. +This is summarized in Table 3.

    -Such shape corresponds to the typical wanted Loop gain Shape shown in Figure 7. +Such shape corresponds to the typical wanted Loop gain Shape shown in Figure 7.

    - +
    @@ -828,32 +821,32 @@ Such shape corresponds to the typical wanted Loop gain Shape shown in Figure - - + + - + - + - + - + - + - + @@ -884,18 +877,18 @@ The \(\mathcal{H}_\infty\) open loop shaping synthesis is then performed using t

    -The obtained Loop Gain is shown in Figure 9 and matches the specified one by a factor \(\gamma \approx 2\). +The obtained Loop Gain is shown in Figure 9 and matches the specified one by a factor \(\gamma \approx 2\).

    -
    +

    open_loop_shaping_hinf_L.png

    Figure 9: Obtained Open Loop Gain \(L(s) = G(s) K(s)\) and comparison with the wanted Loop gain \(L_w\)

    -
    +

    When using the \(\mathcal{H}_\infty\) Synthesis, it is usually recommended to analyze the obtained controller.

    @@ -907,7 +900,7 @@ This is usually done by breaking down the controller into simple elements such a

    -Let’s briefly analyze the obtained controller which bode plot is shown in Figure 10: +Let’s briefly analyze the obtained controller which bode plot is shown in Figure 10:

    • two integrators are used at low frequency to have the wanted low frequency high gain
    • @@ -916,7 +909,7 @@ Let’s briefly analyze the obtained controller which bode plot is shown in
    -
    +

    open_loop_shaping_hinf_K.png

    Figure 10: Obtained controller \(K\) using the open-loop \(\mathcal{H}_\infty\) shaping

    @@ -924,10 +917,10 @@ Let’s briefly analyze the obtained controller which bode plot is shown in

    -Let’s finally compare the obtained stability margins of the \(\mathcal{H}_\infty\) controller and of the manually developed controller in Table 4. +Let’s finally compare the obtained stability margins of the \(\mathcal{H}_\infty\) controller and of the manually developed controller in Table 4.

    -
    Table 3: Wanted Loop Shape corresponding to each specification
     SpecificationCorresponding Loop ShapeSpecificationCorresponding Loop Shape
    Disturbance RejectionDist. Rej. Highest possible rejection below 1HzSlope of -40dB/decade at low frequency to have a high loop gainSlope of -40dB/dec at low frequency
    Positioning SpeedPos. Speed Bandwidth of approximately 10Hz\(L\) crosses 1 at 10Hz: \(\vert L_w(j2 \pi 10)\vert = 1\)\(L\) crosses 1 at 10Hz
    Noise AttenuationNoise Att. Roll-off of -40dB/decade past 30Hz Roll-off of -40dB/decade past 30Hz
    RobustnessGain margin > 3dB and Phase margin > 30 deg\(\Delta G > 3dB\), \(\Delta \phi > 30^o\) Slope of -20dB/decade near the crossover
    +
    @@ -939,9 +932,9 @@ Let’s finally compare the obtained stability margins of the \(\mathcal{H}_ - - - + + + @@ -968,38 +961,38 @@ Let’s finally compare the obtained stability margins of the \(\mathcal{H}_ -
    -

    3 A first Step into the \(\mathcal{H}_\infty\) world

    +
    +

    3 A first Step into the \(\mathcal{H}_\infty\) world

    - +

    In this section, the \(\mathcal{H}_\infty\) Synthesis method, which is based on the optimization of the \(\mathcal{H}_\infty\) norm of transfer functions, is introduced.

    -After the \(\mathcal{H}_\infty\) norm is defined in Section 3.1, the \(\mathcal{H}_\infty\) synthesis procedure is described in Section 3.2 . +After the \(\mathcal{H}_\infty\) norm is defined in Section 3.1, the \(\mathcal{H}_\infty\) synthesis procedure is described in Section 3.2 .

    -The generalized plant, a very useful tool to describe a control problem, is presented in Section 3.3. -The \(\mathcal{H}_\infty\) is then applied to this generalized plant in Section 3.4. +The generalized plant, a very useful tool to describe a control problem, is presented in Section 3.3. +The \(\mathcal{H}_\infty\) is then applied to this generalized plant in Section 3.4.

    -Finally, an example showing how to convert a typical feedback control architecture into a generalized plant is given in Section 3.5. +Finally, an example showing how to convert a typical feedback control architecture into a generalized plant is given in Section 3.5.

    -
    -

    3.1 The \(\mathcal{H}_\infty\) Norm

    +
    +

    3.1 The \(\mathcal{H}_\infty\) Norm

    - +

    -
    +

    The \(\mathcal{H}_\infty\) norm of a multi-input multi-output system \(G(s)\) is defined as the peak of the maximum singular value of its frequency response

    @@ -1016,7 +1009,7 @@ For a single-input single-output system \(G(s)\), it is simply the peak value of
    -
    +

    Let’s compute the \(\mathcal{H}_\infty\) norm of our test plant \(G(s)\) using the hinfnorm function:

    @@ -1031,11 +1024,11 @@ Let’s compute the \(\mathcal{H}_\infty\) norm of our test plant \(G(s)\) u

    -We can see in Figure 11 that indeed, the \(\mathcal{H}_\infty\) norm of \(G(s)\) does corresponds to the peak value of \(|G(j\omega)|\). +We can see in Figure 11 that indeed, the \(\mathcal{H}_\infty\) norm of \(G(s)\) does corresponds to the peak value of \(|G(j\omega)|\).

    -
    +

    hinfinity_norm_siso_bode.png

    Figure 11: Example of the \(\mathcal{H}_\infty\) norm of a SISO system

    @@ -1045,14 +1038,14 @@ We can see in Figure 11 that indeed, the \(\mathcal{H}
    -
    -

    3.2 \(\mathcal{H}_\infty\) Synthesis

    +
    +

    3.2 \(\mathcal{H}_\infty\) Synthesis

    - +

    -
    +

    The \(\mathcal{H}_\infty\) synthesis is a method that uses an algorithm (LMI optimization, Riccati equation) to find a controller that stabilizes the system and that minimizes the \(\mathcal{H}_\infty\) norms of defined transfer functions.

    @@ -1060,16 +1053,16 @@ The \(\mathcal{H}_\infty\) synthesis is a method that uses an algorithm (

    -Why optimizing the \(\mathcal{H}_\infty\) norm of transfer functions is a pertinent choice will become clear when we will translate the typical control specifications into the \(\mathcal{H}_\infty\) norm of transfer functions in Section 4. +Why optimizing the \(\mathcal{H}_\infty\) norm of transfer functions is a pertinent choice will become clear when we will translate the typical control specifications into the \(\mathcal{H}_\infty\) norm of transfer functions in Section 4.

    -
    +

    Then applying the \(\mathcal{H}_\infty\) synthesis to a plant, the engineer work usually consists of the following steps:

    1. Write the problem as standard \(\mathcal{H}_\infty\) problem using the generalized plant (described in the next section)
    2. -
    3. Translate the specifications as \(\mathcal{H}_\infty\) norms of transfer functions (Section 4)
    4. +
    5. Translate the specifications as \(\mathcal{H}_\infty\) norms of transfer functions (Section 4)
    6. Make the synthesis and analyze the obtained controller
    @@ -1092,11 +1085,11 @@ Note that there are many ways to use the \(\mathcal{H}_\infty\) Synthesis:
    -
    -

    3.3 The Generalized Plant

    +
    +

    3.3 The Generalized Plant

    - +

    @@ -1105,7 +1098,7 @@ This consist of deriving the Generalized Plant for the current problem.

    -The generalized plant, usually noted \(P(s)\), is shown in Figure 12. +The generalized plant, usually noted \(P(s)\), is shown in Figure 12. It has two sets of inputs \([w,\,u]\) and two sets of outputs \([z\,v]\) such that:

    \begin{equation} @@ -1113,22 +1106,22 @@ It has two sets of inputs \([w,\,u]\) and two sets of outputs \([z \end{equation}

    -The meaning of these inputs and outputs are summarized in Table 5. +The meaning of these inputs and outputs are summarized in Table 5.

    -A practical example about how to derive the generalized plant for a classical control problem is given in Section 3.5. +A practical example about how to derive the generalized plant for a classical control problem is given in Section 3.5.

    -
    +
    -
    +

    general_plant.png

    Figure 12: Inputs and Outputs of the generalized Plant

    -
    Table 4: Comparison of the characteristics obtained with the two methods
    SpecificationsManual Method\(\mathcal{H}_\infty\) MethodSpecificationsManual Method\(\mathcal{H}_\infty\) Method
    +
    @@ -1138,8 +1131,8 @@ A practical example about how to derive the generalized plant for a classical co - - + + @@ -1174,18 +1167,18 @@ A practical example about how to derive the generalized plant for a classical co -
    -

    3.4 The \(\mathcal{H}_\infty\) Synthesis applied on the Generalized plant

    +
    +

    3.4 The \(\mathcal{H}_\infty\) Synthesis applied on the Generalized plant

    - +

    Once the generalized plant is obtained, the \(\mathcal{H}_\infty\) synthesis problem can be stated as follows:

    -
    +
    \(\mathcal{H}_\infty\) Synthesis applied on the generalized plant
    @@ -1198,11 +1191,11 @@ After \(K\) is found, the system is robustified by adjusting the response

    -The obtained controller \(K\) and the generalized plant are connected as shown in Figure 13. +The obtained controller \(K\) and the generalized plant are connected as shown in Figure 13.

    -
    +

    general_control_names.png

    Figure 13: General Control Configuration

    @@ -1228,29 +1221,29 @@ where:

    -Note that the general control configure of Figure 13, as its name implies, is quite general and can represent feedback control as well as feedforward control architectures. +Note that the general control configure of Figure 13, as its name implies, is quite general and can represent feedback control as well as feedforward control architectures.

    -
    -

    3.5 From a Classical Feedback Architecture to a Generalized Plant

    +
    +

    3.5 From a Classical Feedback Architecture to a Generalized Plant

    - +

    -The procedure to convert a typical control architecture as the one shown in Figure 14 to a generalized Plant is as follows: +The procedure to convert a typical control architecture as the one shown in Figure 14 to a generalized Plant is as follows:

    1. Define signals of the generalized plant: \(w\), \(z\), \(u\) and \(v\)
    2. -
    3. Remove \(K\) and rearrange the inputs and outputs to match the generalized configuration shown in Figure 12
    4. +
    5. Remove \(K\) and rearrange the inputs and outputs to match the generalized configuration shown in Figure 12
    -
    +

    -Consider the feedback control architecture shown in Figure 14. +Consider the feedback control architecture shown in Figure 14. Suppose we want to design \(K\) using the general \(\mathcal{H}_\infty\) synthesis, and suppose the signals to be minimized are the control input \(u\) and the tracking error \(\epsilon\).

      @@ -1259,7 +1252,7 @@ Suppose we want to design \(K\) using the general \(\mathcal{H}_\infty\) synthes
    -
    +

    classical_feedback_tracking.png

    Figure 14: Classical Feedback Control Architecture (Tracking)

    @@ -1274,21 +1267,21 @@ First, define the signals of the generalized plant:
  • Signals to be minimized: Usually, we want to minimize the tracking errors \(\epsilon\) and the control signal \(u\): \(z = [\epsilon,\ u]\)
  • Controller inputs: this is the signal at the input of the controller: \(v = \epsilon\)
  • -
  • Control inputs: signal generated by the controller: \(u\)
  • +
  • Controller outputs: signal generated by the controller: \(u\)
  • -Then, Remove \(K\) and rearrange the inputs and outputs as in Figure 12. +Then, Remove \(K\) and rearrange the inputs and outputs as in Figure 12.

    Answer

    -The obtained generalized plant shown in Figure 15. +The obtained generalized plant shown in Figure 15.

    -
    +

    mixed_sensitivity_ref_tracking.png

    Figure 15: Generalized plant of the Classical Feedback Control Architecture (Tracking)

    @@ -1312,14 +1305,14 @@ P.OutputName = {'e', 'u
    -
    -

    4 Modern Interpretation of Control Specifications

    +
    +

    4 Modern Interpretation of Control Specifications

    - +

    -As shown in Section 2, the loop gain \(L(s) = G(s) K(s)\) is a useful and easy tool when manually designing controllers. +As shown in Section 2, the loop gain \(L(s) = G(s) K(s)\) is a useful and easy tool when manually designing controllers. This is mainly due to the fact that \(L(s)\) is very easy to shape as it depends linearly on \(K(s)\). Moreover, important quantities such as the stability margins and the control bandwidth can be estimated from the shape/phase of \(L(s)\).

    @@ -1327,40 +1320,40 @@ Moreover, important quantities such as the stability margins and the control ban

    However, the loop gain \(L(s)\) does not directly give the performances of the closed-loop system. As a matter of fact, the behavior of the closed-loop system by the closed-loop transfer functions. -These are derived of a typical feedback architecture functions in Section 4.1. +These are derived of a typical feedback architecture functions in Section 4.1.

    The modern interpretation of control specifications then consists of determining the required shape of the closed-loop transfer functions such that the system behavior corresponds to the requirements. Once this is done, the \(\mathcal{H}_\infty\) synthesis can be used to generate a controller that will shape the closed-loop transfer function as specified.. -This method is presented in Section 5. +This method is presented in Section 5.

    One of the most important closed-loop transfer function is called the sensitivity function. -Its link with the closed-loop behavior of the feedback system is studied in Section 4.2. +Its link with the closed-loop behavior of the feedback system is studied in Section 4.2.

    -The robustness (stability margins) of the system can also be linked to the shape of the sensitivity function with the use of the module margin (Section 4.3). +The robustness (stability margins) of the system can also be linked to the shape of the sensitivity function with the use of the module margin (Section 4.3).

    -Links between typical control specifications and shapes of the closed-loop transfer functions are summarized in Section 4.4. +Links between typical control specifications and shapes of the closed-loop transfer functions are summarized in Section 4.4.

    -
    -

    4.1 Closed Loop Transfer Functions and the Gang of Four

    +
    +

    4.1 Closed Loop Transfer Functions and the Gang of Four

    - +

    -Consider the typical feedback system shown in Figure 16. +Consider the typical feedback system shown in Figure 16.

    @@ -1369,17 +1362,17 @@ The behavior (performances) of this feedback system is determined by the closed-

    Depending on the specification, different closed-loop transfer functions do matter. -These are summarized in Table 6. +These are summarized in Table 6.

    -
    +

    gang_of_four_feedback.png

    Figure 16: Simple Feedback Architecture with \(r\) the reference signal, \(\epsilon\) the tracking error, \(d\) a disturbance acting at the plant input \(u\), \(y\) is the output signal and \(n\) the measurement noise

    -
    Table 5: Notations for the general configuration
    NotationMeaningNotationMeaning
    +
    @@ -1389,8 +1382,8 @@ These are summarized in Table 6. - - + + @@ -1421,26 +1414,26 @@ These are summarized in Table 6. - +
    Table 6: Typical Specification and associated closed-loop transfer function
    SpecificationClosed-Loop Transfer FunctionSpecificationCL Transfer Function
    Robustness (stability margins)Module margin (see Section 4.3)Module margin (see Section 4.3)
    -
    +

    -For the feedback system in Figure 16, write the output signals \([\epsilon, u, y]\) as a function of the systems \(K(s), G(s)\) and the input signals \([r, d, n]\). +For the feedback system in Figure 16, write the output signals \([\epsilon, u, y]\) as a function of the systems \(K(s), G(s)\) and the input signals \([r, d, n]\).

    Hint

    Take one of the output (e.g. \(y\)), and write it as a function of the inputs \([d, r, n]\) going step by step around the loop:

    -\begin{aligned} +\begin{align*} y &= G u \\ &= G (d + K \epsilon) \\ &= G \big(d + K (r - n - y) \big) \\ &= G d + GK r - GK n - GK y -\end{aligned} +\end{align*}

    Isolate \(y\) at the right hand side, and finally obtain: @@ -1465,9 +1458,9 @@ The following equations should be obtained:

    -
    +

    -We can see that they are 4 different closed-loop transfer functions describing the behavior of the feedback system in Figure 16. +We can see that they are 4 different closed-loop transfer functions describing the behavior of the feedback system in Figure 16. These called the Gang of Four:

    \begin{align} @@ -1479,7 +1472,7 @@ These called the Gang of Four:
    -
    +

    If a feedforward controller is included, a Gang of Six transfer functions can be defined. More on that in this short video. @@ -1488,7 +1481,7 @@ More on that in this short

    -The behavior of the feedback system in Figure 16 is fully described by the following set of equations: +The behavior of the feedback system in Figure 16 is fully described by the following set of equations:

    \begin{align} \epsilon &= S r - GS d - GS n \\ @@ -1503,11 +1496,11 @@ Similarly, to reduce the effect of measurement noise \(n\) on the output \(y\),
    -
    -

    4.2 The Sensitivity Function

    +
    +

    4.2 The Sensitivity Function

    - +

    @@ -1518,14 +1511,14 @@ In this section, we will see how the shape of the sensitivity function will impa

    Suppose we have developed a “reference” controller \(K_r(s)\) and made three small changes to obtained three controllers \(K_1(s)\), \(K_2(s)\) and \(K_3(s)\). -The obtained sensitivity functions for these four controllers are shown in Figure 17 and the corresponding step responses are shown in Figure 18. +The obtained sensitivity functions for these four controllers are shown in Figure 17 and the corresponding step responses are shown in Figure 18.

    -The comparison of the sensitivity functions shapes and their effect on the step response is summarized in Table 7. +The comparison of the sensitivity functions shapes and their effect on the step response is summarized in Table 7.

    - +
    @@ -1537,9 +1530,9 @@ The comparison of the sensitivity functions shapes and their effect on the step - - - + + + @@ -1564,20 +1557,20 @@ The comparison of the sensitivity functions shapes and their effect on the step
    Table 7: Comparison of the sensitivity function shape and the corresponding step response for the three controller variations
    ControllerSensitivity Function ShapeChange of the Step ResponseControllerSensitivity Function ShapeChange of the Step Response
    -
    +

    sensitivity_shape_effect.png

    Figure 17: Sensitivity function magnitude \(|S(j\omega)|\) corresponding to the reference controller \(K_r(s)\) and the three modified controllers \(K_i(s)\)

    -
    +

    sensitivity_shape_effect_step.png

    Figure 18: Step response (response from \(r\) to \(y\)) for the different controllers

    -
    +
    Closed-Loop Bandwidth

    The closed-loop bandwidth \(\omega_b\) is the frequency where \(|S(j\omega)|\) first crosses \(1/\sqrt{2} = -3dB\) from below. @@ -1590,9 +1583,9 @@ In general, a large bandwidth corresponds to a faster rise time.

    -
    +

    -From the simple analysis above, we can draw a first estimation of the wanted shape for the sensitivity function (Figure 19): +From the simple analysis above, we can draw a first estimation of the wanted shape for the sensitivity function (Figure 19):

    • A small magnitude at low frequency to make the static errors small
    • @@ -1603,7 +1596,7 @@ This will become clear in the next section about the module margin.
    -
    +

    h-infinity-spec-S.png

    Figure 19: Typical wanted shape of the Sensitivity transfer function

    @@ -1613,11 +1606,11 @@ This will become clear in the next section about the module margin.
    -
    -

    4.3 Robustness: Module Margin

    +
    +

    4.3 Robustness: Module Margin

    - +

    @@ -1625,7 +1618,7 @@ Let’s start this section by an example demonstrating why the phase and gai Will follow a discussion about the module margin, a robustness indicator that can be linked to the \(\mathcal{H}_\infty\) norm of \(S\) and that will prove to be very useful.

    -
    +

    Consider the following plant \(G_t(s)\):

    @@ -1639,7 +1632,7 @@ Gt = 1/k*(s

    -Let’s say we have designed a controller \(K_t(s)\) that gives the loop gain shown in Figure 20. +Let’s say we have designed a controller \(K_t(s)\) that gives the loop gain shown in Figure 20.

    @@ -1648,7 +1641,7 @@ Let’s say we have designed a controller \(K_t(s)\) that gives the loop gai

    -The following characteristics can be determined from the Loop gain in Figure 20: +The following characteristics can be determined from the Loop gain in Figure 20:

    • Control bandwidth of \(\approx 10\, \text{Hz}\)
    • @@ -1662,13 +1655,12 @@ Or does it? Let’s find out.

      -
      +

      phase_gain_margin_model_plant.png

      Figure 20: Bode plot of the obtained Loop Gain \(L(s)\)

      -

      Now let’s suppose the controller is implemented in practice, and the “real” plant \(G_r(s)\) as a slightly lower damping factor than the one estimated for the model:

      @@ -1678,7 +1670,7 @@ Now let’s suppose the controller is implemented in practice, and the &ldqu

      -The obtained “real” loop gain is shown in Figure 21. +The obtained “real” loop gain is shown in Figure 21. At a frequency little bit above 100Hz, the phase of the loop gain reaches -180 degrees while its magnitude is more than one which indicates instability.

      @@ -1696,7 +1688,7 @@ It is confirmed by checking the stability of the closed loop system: -
      +

      phase_gain_margin_real_plant.png

      Figure 21: Bode plots of \(L(s)\) (loop gain corresponding the nominal plant) and \(L_r(s)\) (loop gain corresponding to the real plant)

      @@ -1716,16 +1708,16 @@ This is due to the fact that the gain and phase margin are robustness indicators Let’s now determine a new robustness indicator based on the Nyquist Stability Criteria.

      -
      +
      -
      Nyquist Stability Criteria (for stable systems)
      If the open-loop transfer function \(L(s)\) is stable, then the closed-loop system will be unstable for any encirclement of the point \(−1\) on the Nyquist plot.
      +
      Nyquist Stability Criteria (for stable systems)
      If the open-loop transfer function \(L(s)\) is stable, then the closed-loop system will be unstable for any encirclement of the point \(-1\) on the Nyquist plot.
      Nyquist Plot
      The Nyquist plot shows the evolution of \(L(j\omega)\) in the complex plane from \(\omega = 0 \to \infty\).
      -
      +

      For more information about the general Nyquist Stability Criteria, you may want to look at this video.

      @@ -1737,21 +1729,21 @@ From the Nyquist stability criteria, it is clear that we want \(L(j\omega)\) to This minimum distance is called the module margin.

      -
      +
      Module Margin
      The Module Margin \(\Delta M\) is defined as the minimum distance between the point \(-1\) and the loop gain \(L(j\omega)\) in the complex plane.
      -
      +

      -A typical Nyquist plot is shown in Figure 22. +A typical Nyquist plot is shown in Figure 22. The gain, phase and module margins are graphically shown to have an idea of what they represent.

      -
      +

      module_margin_example.png

      Figure 22: Nyquist plot with visual indication of the Gain margin \(\Delta G\), Phase margin \(\Delta \phi\) and Module margin \(\Delta M\)

      @@ -1760,7 +1752,7 @@ The gain, phase and module margins are graphically shown to have an idea of what

      -As expected from Figure 22, there is a close relationship between the module margin and the gain and phase margins. +As expected from Figure 22, there is a close relationship between the module margin and the gain and phase margins. We can indeed show that for a given value of the module margin \(\Delta M\), we have:

      \begin{equation} @@ -1786,7 +1778,7 @@ Therefore, for a given \(\mathcal{H}_\infty\) norm of \(S\) (\(\|S\|_\infty = M_ \Delta G \ge \frac{M_S}{M_S - 1}; \quad \Delta \phi \ge \frac{1}{M_S} \end{equation} -
      +

      The \(\mathcal{H}_\infty\) norm of the sensitivity function \(\|S\|_\infty\) is a measure of the Module margin \(\Delta M\) and therefore an indicator of the system robustness.

      @@ -1806,14 +1798,14 @@ Note that this is why large peak value of \(|S(j\omega)|\) usually indicate robu And we now understand why setting an upper bound on the magnitude of \(S\) is generally a good idea.

      -
      +

      Typical, we require \(\|S\|_\infty < 2 (6dB)\) which implies \(\Delta G \ge 2\) and \(\Delta \phi \ge 29^o\)

      -
      +

      To learn more about module/disk margin, you can check out this video.

      @@ -1822,14 +1814,14 @@ To learn more about module/disk margin, you can check out -

      4.4 Summary of typical specification and associated wanted shaping

      +
      +

      4.4 Summary of typical specification and associated wanted shaping

      - +

      - +
      @@ -1842,8 +1834,8 @@ To learn more about module/disk margin, you can check out   - - + + @@ -1882,11 +1874,11 @@ To learn more about module/disk margin, you can check out -

      5 \(\mathcal{H}_\infty\) Shaping of closed-loop transfer functions

      +
      +

      5 \(\mathcal{H}_\infty\) Shaping of closed-loop transfer functions

      - +

      In the previous sections, we have seen that the performances of the system depends on the shape of the closed-loop transfer function. @@ -1897,33 +1889,33 @@ But don’t worry, the \(\mathcal{H}_\infty\) synthesis will do this job for

      To do so, weighting functions are included in the generalized plant and the \(\mathcal{H}_\infty\) synthesis applied on the weighted generalized plant. -Such procedure is presented in Section 5.1. +Such procedure is presented in Section 5.1.

      -Some advice on the design of weighting functions are given in Section 5.2. +Some advice on the design of weighting functions are given in Section 5.2.

      -An example of the \(\mathcal{H}_\infty\) shaping of the sensitivity function is studied in Section 5.3. +An example of the \(\mathcal{H}_\infty\) shaping of the sensitivity function is studied in Section 5.3.

      Multiple closed-loop transfer functions can be shaped at the same time. Such synthesis is usually called Mixed-sensitivity Loop Shaping and is one of the most powerful tool of the robust control theory. -Some insight on the use and limitations of such techniques are given in Section 5.4. +Some insight on the use and limitations of such techniques are given in Section 5.4.

      -
      -

      5.1 How to Shape closed-loop transfer function? Using Weighting Functions!

      +
      +

      5.1 How to Shape closed-loop transfer function? Using Weighting Functions!

      - +

      -Suppose we apply the \(\mathcal{H}_\infty\) synthesis on the generalized plant \(P(s)\) shown in Figure 23. +Suppose we apply the \(\mathcal{H}_\infty\) synthesis on the generalized plant \(P(s)\) shown in Figure 23. It will generate a controller \(K(s)\) such that the \(\mathcal{H}_\infty\) norm of closed-loop transfer function from \(r\) to \(\epsilon\) is minimized which is equal to the sensitivity function \(S\). Therefore, the synthesis objective is to minimize the \(\mathcal{H}_\infty\) norm of the sensitivity function: \(\|S\|_\infty\).

      @@ -1934,16 +1926,16 @@ Clearly this does not allow to shape the norm of \(S(j\omega)\) over all

      -
      +

      loop_shaping_S_without_W.png

      Figure 23: Generalized Plant

      -
      +

      -The trick is to include a weighting function \(W_S(s)\) in the generalized plant as shown in Figure 24. +The trick is to include a weighting function \(W_S(s)\) in the generalized plant as shown in Figure 24.

      @@ -1961,7 +1953,7 @@ Let’s now show how this is equivalent as shaping the sensitivity fu \Leftrightarrow & \left| S(j\omega) \right| < \frac{1}{\left| W_s(j\omega) \right|} \quad \forall \omega \label{eq:sensitivity_shaping} \end{align} -

      +

      As shown in Equation \eqref{eq:sensitivity_shaping}, the objective of the \(\mathcal{H}_\infty\) synthesis applied on the weighted plant is to make the norm sensitivity function smaller than the inverse of the norm of the weighting function, and that at all frequencies.

      @@ -1973,15 +1965,15 @@ Therefore, the choice of the weighting function \(W_s(s)\) is very important: it
      -
      +

      loop_shaping_S_with_W.png

      Figure 24: Weighted Generalized Plant

      -
      +

      -Using matlab, compute the weighted generalized plant shown in Figure 25 as a function of \(G(s)\) and \(W_S(s)\). +Using matlab, compute the weighted generalized plant shown in Figure 25 as a function of \(G(s)\) and \(W_S(s)\).

      Hint @@ -2021,18 +2013,18 @@ Pw = blkdiag(Ws, 1)*P;
      -
      -

      5.2 Design of Weighting Functions

      +
      +

      5.2 Design of Weighting Functions

      - +

      Weighting function included in the generalized plant must be proper, stable and minimum phase transfer functions.

      -
      +
      proper
      more poles than zeros, this implies \(\lim_{\omega \to \infty} |W(j\omega)| < \infty\)
      stable
      no poles in the right half plane
      @@ -2061,9 +2053,9 @@ with:
    • hfgain: high frequency gain
    • -
      +

      -The Matlab code below produces a weighting function with the following characteristics (Figure 25): +The Matlab code below produces a weighting function with the following characteristics (Figure 25):

      • Low frequency gain of 100
      • @@ -2077,7 +2069,7 @@ The Matlab code below produces a weighting function with the following character
      -
      +

      first_order_weight.png

      Figure 25: Obtained Magnitude of the Weighting Function

      @@ -2085,7 +2077,7 @@ The Matlab code below produces a weighting function with the following character
      -
      +

      Quite often, higher orders weights are required.

      @@ -2117,7 +2109,7 @@ A Matlab function implementing Equation \eqref{eq:weight_formula_advanced} is sh

      -
      function [W] = generateWeight(args)
      +
      function [W] = generateWeight(args)
           arguments
               args.G0 (1,1) double {mustBeNumeric, mustBePositive} = 0.1
               args.G1 (1,1) double {mustBeNumeric, mustBePositive} = 10
      @@ -2152,11 +2144,11 @@ W3 = generateWeight('G0', 1e2, 26.
      +The obtained shapes are shown in Figure 26.
       

      -
      +

      high_order_weight.png

      Figure 26: Higher order weights using Equation \eqref{eq:weight_formula_advanced}

      @@ -2166,11 +2158,11 @@ The obtained shapes are shown in Figure 26.
      -
      -

      5.3 Shaping the Sensitivity Function

      +
      +

      5.3 Shaping the Sensitivity Function

      - +

      @@ -2183,17 +2175,17 @@ Let’s design a controller using the \(\mathcal{H}_\infty\) shaping of the

      -As usual, the plant used is the one presented in Section 1.3. +As usual, the plant used is the one presented in Section 1.3.

      -
      +

      Translate the requirements as upper bounds on the Sensitivity function and design the corresponding weighting functions using Matlab.

      Hint

      -The typical wanted upper bound of the sensitivity function is shown in Figure 27. +The typical wanted upper bound of the sensitivity function is shown in Figure 27.

      @@ -2211,7 +2203,7 @@ Remember that the wanted upper bound of the sensitivity function is defined by t

      -
      +

      h-infinity-spec-S.png

      Figure 27: Typical wanted shape of the Sensitivity transfer function

      @@ -2279,7 +2271,7 @@ And the \(\mathcal{H}_\infty\) synthesis is performed on the weighted gen
      -
      +
       Test bounds:  0.5 <=  gamma  <=  0.51
       
        gamma        X>=0        Y>=0       rho(XY)<1    p/f
      @@ -2294,16 +2286,16 @@ Best performance (actual): 0.503
       

      \(\gamma \approx 0.5\) means that the \(\mathcal{H}_\infty\) synthesis generated a controller \(K(s)\) that stabilizes the closed-loop system, and such that the \(\mathcal{H}_\infty\) norm of the closed-loop transfer function from \(w\) to \(z\) is less than \(\gamma\):

      -\begin{aligned} +\begin{align*} & \| W_s(s) S(s) \|_\infty \approx 0.5 \\ & \Leftrightarrow |S(j\omega)| < \frac{0.5}{|W_s(j\omega)|} \quad \forall \omega -\end{aligned} +\end{align*}

      -This is indeed what we can see by comparing \(|S|\) and \(|W_S|\) in Figure 28. +This is indeed what we can see by comparing \(|S|\) and \(|W_S|\) in Figure 28.

      -
      +

      Obtaining \(\gamma < 1\) means that the \(\mathcal{H}_\infty\) synthesis found a controller such that the specified closed-loop transfer functions are bellow the specified upper bounds.

      @@ -2316,7 +2308,7 @@ It just means that at some frequency, one of the closed-loop transfer functions
      -
      +

      results_sensitivity_hinf.png

      Figure 28: Weighting function and obtained closed-loop sensitivity

      @@ -2324,24 +2316,24 @@ It just means that at some frequency, one of the closed-loop transfer functions
      -
      -

      5.4 Shaping multiple closed-loop transfer functions - Limitations

      +
      +

      5.4 Shaping multiple closed-loop transfer functions - Limitations

      - +

      -As was shown in Section 4, each of the four main closed-loop transfer functions (called the gang of four) will impact different characteristics of the closed-loop system. -This is summarized in Table 9. +As was shown in Section 4, each of the four main closed-loop transfer functions (called the gang of four) will impact different characteristics of the closed-loop system. +This is summarized in Table 9.

      Therefore, we might want to shape multiple closed-loop transfer functions at the same time. For instance \(S\) could be shape to have good step responses, \(KS\) to limit the input usage and \(T\) to filter measurement noise. -When multiple closed-loop transfer function are shaped at the same time, it is refereed to as Mixed-Sensitivity \(\mathcal{H}_\infty\) Control and is the subject of Section 6. +When multiple closed-loop transfer function are shaped at the same time, it is refereed to as Mixed-Sensitivity \(\mathcal{H}_\infty\) Control and is the subject of Section 6.

      -
      Table 8: Typical Specifications and corresponding wanted norms of open and closed loop tansfer functions
      Open-Loop ShapingClosed-Loop ShapingOpen-Loop ShapingClosed-Loop Shaping
      +
      @@ -2353,9 +2345,9 @@ When multiple closed-loop transfer function are shaped at the same time, it is r - - - + + + @@ -2384,7 +2376,7 @@ When multiple closed-loop transfer function are shaped at the same time, it is r - + @@ -2403,7 +2395,7 @@ When multiple closed-loop transfer function are shaped at the same time, it is r - + @@ -2416,7 +2408,7 @@ When multiple closed-loop transfer function are shaped at the same time, it is r - + @@ -2435,9 +2427,9 @@ When multiple closed-loop transfer function are shaped at the same time, it is r - + - +
      Table 9: Typical specifications and corresponding shaping of the Gang of four
      SpecificationGang of FourWanted shapeSpecificationsTFWanted shape
      Follow Sinusoidal ref. inputsFollow Sin. ref. inputs \(S\) Small magnitude centered on the sin. frequency
      Prevent inversion of resonant plantsPrevent notching resonances \(GS\) Limit gain around resonance
      Limitation of the Control BandwidthLimitation of the Bandwidth \(T\) Set an upper bound on the bandwidth
      Robustness to un-modelled dynamicsRobust to unmodelled dynamics \(T\)Small at frequencies where the plant uncertainty is largeSmall at freq. where uncertainty is large
      @@ -2448,7 +2440,7 @@ Some of them are described below for reference, it is a good exercise to try to

      Shaping of S and KS -
      +

      general_conf_shaping_S_KS.png

      Figure 29: Generalized Plant to shape \(S\) and \(KS\)

      @@ -2463,7 +2455,7 @@ Weighting functions:
    -
    P = [W1 -G*W1
    +
    P = [W1 -G*W1
          0   W2
          1  -G];
     
    @@ -2471,7 +2463,7 @@ Weighting functions:
    Shaping of S and T -
    +

    general_conf_shaping_S_T.png

    Figure 30: Generalized Plant to shape \(S\) and \(T\)

    @@ -2486,7 +2478,7 @@ Weighting functions:
    -
    P = [W1 -G*W1
    +
    P = [W1 -G*W1
          0   G*W2
          1   -G];
     
    @@ -2494,7 +2486,7 @@ Weighting functions:
    Shaping of S and GS -
    +

    general_conf_shaping_S_GS.png

    Figure 31: Generalized Plant to shape \(S\) and \(GS\)

    @@ -2509,7 +2501,7 @@ Weighting functions:
    -
    P = [W1   -W1
    +
    P = [W1   -W1
          G*W2 -G*W2
          G    -G];
     
    @@ -2517,7 +2509,7 @@ Weighting functions:
    Shaping of S, T and KS -
    +

    general_conf_shaping_S_T_KS.png

    Figure 32: Generalized Plant to shape \(S\), \(T\) and \(KS\)

    @@ -2533,7 +2525,7 @@ Weighting functions:
    -
    P = [W1 -G*W1
    +
    P = [W1 -G*W1
          0   W2
          0   G*W3
          1   -G];
    @@ -2542,7 +2534,7 @@ Weighting functions:
     
    Shaping of S, T and GS -
    +

    general_conf_shaping_S_T_GS.png

    Figure 33: Generalized Plant to shape \(S\), \(T\) and \(GS\)

    @@ -2558,7 +2550,7 @@ Weighting functions:
    -
    P = [W1   -W1
    +
    P = [W1   -W1
          G*W2 -G*W2
          0     W3
          G    -G];
    @@ -2567,7 +2559,7 @@ Weighting functions:
     
    Shaping of S, T, KS and GS -
    +

    general_conf_shaping_S_T_KS_GS.png

    Figure 34: Generalized Plant to shape \(S\), \(T\), \(KS\) and \(GS\)

    @@ -2584,13 +2576,13 @@ Weighting functions:
    -
    P = [ W1  -W1*G*W3 -G*W1
    +
    P = [ W1  -W1*G*W3 -G*W1
           0    0        W2
           1   -G*W3    -G];
     
    -
    +

    When shaping multiple closed-loop transfer functions, one should be very careful about the three following points that are further discussed:

    @@ -2602,7 +2594,7 @@ When shaping multiple closed-loop transfer functions, one should be very careful
    -
    +

    Mathematical relations are linking the closed-loop transfer functions. For instance, the sensitivity function \(S(s)\) and the complementary sensitivity function \(T(s)\) are linked by the following well known relation: @@ -2641,7 +2633,7 @@ This means that the Sensitivity function cannot be shaped at frequencies where t Similar relationship can be found for \(T\), \(KS\) and \(GS\).

    -
    +

    Determine the approximate norms of \(T\), \(KS\) and \(GS\) for large loop gains (\(|G(j\omega) K(j\omega)| \gg 1\)) and small loop gains (\(|G(j\omega) K(j\omega)| \ll 1\)).

    @@ -2659,7 +2651,7 @@ You can follows this procedure for \(T\), \(KS\) and \(GS\):
    Answer

    -The obtained constrains are shown in Figure 35. +The obtained constrains are shown in Figure 35.

    @@ -2672,17 +2664,17 @@ However, in some frequency band, the norms do not depend on the controller and t

    Therefore the weighting functions should only focus on certainty frequency range depending on the transfer function being shaped. -These regions are summarized in Figure 35. +These regions are summarized in Figure 35.

    -
    +

    h-infinity-4-blocs-constrains.png

    Figure 35: Shaping the Gang of Four. Blue regions indicate that the transfer function can be shaped using \(K\). Red regions indicate this is not the case

    -
    +

    The order (e.g. number of state) of the controller given by the \(\mathcal{H}_\infty\) synthesis is equal to the order (e.g. number of state) of the weighted generalized plant. It is thus equal to the sum of the number of state of the non-weighted generalized plant and the number of state of all the weighting functions. @@ -2702,49 +2694,49 @@ Two approaches can be used to obtain controllers with reasonable order:

    -
    -

    6 Mixed-Sensitivity \(\mathcal{H}_\infty\) Control - Example

    +
    +

    6 Mixed-Sensitivity \(\mathcal{H}_\infty\) Control - Example

    - +

    Let’s now apply the \(\mathcal{H}_\infty\) Shaping control procedure on a practical example.

    -In Section 6.1 the control problem is presented. -The design procedure used to apply the \(\mathcal{H}_\infty\) Mixed Sensitivity synthesis is described in Section 6.2. +In Section 6.1 the control problem is presented. +The design procedure used to apply the \(\mathcal{H}_\infty\) Mixed Sensitivity synthesis is described in Section 6.2.

    -The important step of interpreting the specifications as wanted shape of closed-loop transfer functions is performed in Section 6.3. +The important step of interpreting the specifications as wanted shape of closed-loop transfer functions is performed in Section 6.3.

    -Finally, the shaping of closed-loop transfer functions is performed in Sections 6.4, 6.5 and 6.6. +Finally, the shaping of closed-loop transfer functions is performed in Sections 6.4, 6.5 and 6.6.

    -
    -

    6.1 Control Problem

    +
    +

    6.1 Control Problem

    - +

    -Let’s consider our usual test system shown in Figure 36. +Let’s consider our usual test system shown in Figure 36.

    -
    +

    ex_test_system.png

    Figure 36: Test System consisting of a payload with a mass \(m\) on top of an active system with a stiffness \(k\), damping \(c\) and an actuator. A feedback controller \(K(s)\) is added to position / isolate the payload.

    -
    +

    The control specifications are:

    @@ -2768,11 +2760,11 @@ The considered inputs are:
    -
    -

    6.2 Control Design Procedure

    +
    +

    6.2 Control Design Procedure

    - +

    @@ -2787,11 +2779,11 @@ Here is the general design procedure that will be followed:

    -Let’s first convert the system of Figure 36 into the classical feedback architecture of Figure 3. +Let’s first convert the system of Figure 36 into the classical feedback architecture of Figure 37.

    -
    +

    ex_test_system_feedback.png

    Figure 37: Block diagram corresponding to the example system

    @@ -2814,7 +2806,7 @@ The two transfer functions present in the system are derived and defined below:

    We also define the inputs signals that will be used for time domain simulations. -They are graphically shown in Figure 38. +They are graphically shown in Figure 38.

     9: % Time Vector
    @@ -2838,24 +2830,24 @@ They are graphically shown in Figure 38.
     
    -
    +

    ex_inputs_signals.png

    Figure 38: Time domain inputs signals

    -We also define the generalized plant corresponding to the system and that will be used for time domain simulations (Figure 39). +We also define the generalized plant corresponding to the system and that will be used for time domain simulations (Figure 39).

    -
    +

    ex_general_plant_sim.png

    Figure 39: Generalized plant that will be used for simulations

    -The Generalized plant of Figure 39 is defined on Matlab as follows: +The Generalized plant of Figure 39 is defined on Matlab as follows:

    26: Psim = [0  0  Gd  G
    @@ -2884,14 +2876,14 @@ Time domain simulations will be performed by first computing the closed-loop sys
     
    -
    -

    6.3 Modern Interpretation of control specifications

    +
    +

    6.3 Modern Interpretation of control specifications

    - +

    -
    +
    1. Translate the control specifications into wanted shape of closed-loop transfer functions
    2. Conclude and the closed-loop transfer functions to be shaped
    3. @@ -2901,24 +2893,24 @@ Time domain simulations will be performed by first computing the closed-loop sys
      Hint
        -
      1. Make use of Table 9
      2. -
      3. Make use of Table 9
      4. -
      5. See Section 5.4
      6. -
      7. See Section 5.4
      8. +
      9. Make use of Table 9
      10. +
      11. Make use of Table 9
      12. +
      13. See Section 5.4
      14. +
      15. See Section 5.4

    -After converting the control specifications into wanted shape of closed-loop transfer functions, we might come up with the Table 10. +After converting the control specifications into wanted shape of closed-loop transfer functions, we might come up with the Table 10.

    In such case, we want to shape \(S\), \(GS\) and \(T\).

    - +
    @@ -2930,9 +2922,9 @@ In such case, we want to shape \(S\), \(GS\) and \(T\). - - - + + + @@ -2963,7 +2955,7 @@ In such case, we want to shape \(S\), \(GS\) and \(T\).
    Table 10: Control Specifications and associated wanted shape of the closed-loop transfer functions
    SpecificationCorresponding Transfer FunctionWanted ShapeSpecificationTFWanted Shape

    -To do so, we use to generalized plant shown in Figure 40 for the synthesis where the three closed-loop tranfert functions from \(w\) to \([z_1\,,z_2\,,z_3]\) are respectively \(S\), \(GS\) and \(T\). +To do so, we use to generalized plant shown in Figure 40 for the synthesis where the three closed-loop tranfert functions from \(w\) to \([z_1\,,z_2\,,z_3]\) are respectively \(S\), \(GS\) and \(T\).

    @@ -2978,7 +2970,7 @@ This generalized plant is defined on Matlab as follows:

    -
    +

    ex_general_plant.png

    Figure 40: Generalized plant chosen for the shaping of \(S\), \(GS\) \(T\)

    @@ -2986,7 +2978,7 @@ This generalized plant is defined on Matlab as follows:

    However, to performed the \(\mathcal{H}_\infty\) loop shaping, we have to include weighting function to the Generalized plant. -We obtain the weighted generalized plant in Figure 41, and that is computed using Matlab as follows: +We obtain the weighted generalized plant in Figure 41, and that is computed using Matlab as follows:

    44: Pw = blkdiag(W1, W2, W3, 1)*P;
    @@ -2994,7 +2986,7 @@ We obtain the weighted generalized plant in Figure 
     
    - -
    -

    6.4 Step 1 - Shaping of \(S\)

    +
    +

    6.4 Step 1 - Shaping of \(S\)

    - +

    @@ -3058,7 +3050,7 @@ To not constrain \(GS\) and \(T\) for the shaping of \(S\), \(W_2\) and \(W_3\)

    -The \(\mathcal{H}_\infty\) synthesis is performed and the obtained closed-loop transfer functions \(S\), \(GS\), and \(T\) and compared with the upper bounds set by the weighting functions in Figure 42. +The \(\mathcal{H}_\infty\) synthesis is performed and the obtained closed-loop transfer functions \(S\), \(GS\), and \(T\) and compared with the upper bounds set by the weighting functions in Figure 42.

    @@ -3067,7 +3059,7 @@ The \(\mathcal{H}_\infty\) synthesis is performed and the obtained closed-loop t
    -
    +
     Test bounds:  0.5 <=  gamma  <=  0.51
     
      gamma        X>=0        Y>=0       rho(XY)<1    p/f
    @@ -3079,14 +3071,14 @@ Best performance (actual): 0.502
     
    -
    +

    ex_results_1.png

    Figure 42: Obtained Shape Closed-Loop transfer functions (dashed black lines indicate inverse magnitude of the weighting functions)

    -Time domain simulation is then performed and the obtained output displacement and control inputs are shown in Figure 43. +Time domain simulation is then performed and the obtained output displacement and control inputs are shown in Figure 43.

    @@ -3094,19 +3086,19 @@ We can see:

    • we are not able to follow the ramp input. This have to be solved by modifying the weighting function \(W_1(s)\)
    • -
    • we have poor rejection of disturbances. This we be solve by shaping \(GS\) in Section 6.5
    • -
    • we have quite large effect of the measurement noise. This will be solved by shaping \(T\) in Section 6.6
    • +
    • we have poor rejection of disturbances. This we be solve by shaping \(GS\) in Section 6.5
    • +
    • we have quite large effect of the measurement noise. This will be solved by shaping \(T\) in Section 6.6
    -
    +

    ex_time_domain_1.png

    Figure 43: Time domain simulation results

    -Remember that in order to follow ramp inputs, the sensitivity function should have a slope of +40dB/dec at low frequency (Table 9). +Remember that in order to follow ramp inputs, the sensitivity function should have a slope of +40dB/dec at low frequency (Table 9).

    @@ -3122,22 +3114,22 @@ This can simple be done by using a second order weight:

    -The \(\mathcal{H}_\infty\) synthesis is performed using the new weights and the obtained closed-loop shaped are shown in figure 44. +The \(\mathcal{H}_\infty\) synthesis is performed using the new weights and the obtained closed-loop shaped are shown in figure 44.

    -The time domain signals are shown in Figure 45 and it is confirmed that the ramps are now follows without static errors. +The time domain signals are shown in Figure 45 and it is confirmed that the ramps are now follows without static errors.

    -
    +

    ex_results_1b.png

    Figure 44: Obtained Shape Closed-Loop transfer functions

    -
    +

    ex_time_domain_1b.png

    Figure 45: Time domain simulation results

    @@ -3145,16 +3137,16 @@ The time domain signals are shown in Figure 45 and it
    -
    -

    6.5 Step 2 - Shaping of \(GS\)

    +
    +

    6.5 Step 2 - Shaping of \(GS\)

    - +

    -Looking at Figure 46, it is clear that the rejection of disturbances is not satisfactory. -This can also be seen by the large peak of \(GS\) in Figure 44. +Looking at Figure 46, it is clear that the rejection of disturbances is not satisfactory. +This can also be seen by the large peak of \(GS\) in Figure 44.

    @@ -3172,22 +3164,22 @@ Let’s take \(W_2\) as a simple constant gain:

    -The \(\mathcal{H}_\infty\) Synthesis is performed and the obtained closed-loop transfer functions are shown in Figure 46. +The \(\mathcal{H}_\infty\) Synthesis is performed and the obtained closed-loop transfer functions are shown in Figure 46.

    -
    +

    ex_results_2.png

    Figure 46: Obtained Shape Closed-Loop transfer functions

    -Time domain simulation results are shown in Figure 47. +Time domain simulation results are shown in Figure 47. If is shown that indeed, the disturbance rejection performance are much better and only very small oscillation is obtained.

    -
    +

    ex_time_domain_2.png

    Figure 47: Time domain simulation results

    @@ -3195,11 +3187,11 @@ If is shown that indeed, the disturbance rejection performance are much better a
    -
    -

    6.6 Step 3 - Shaping of \(T\)

    +
    +

    6.6 Step 3 - Shaping of \(T\)

    - +

    @@ -3227,7 +3219,7 @@ The final weighting function \(W_3\) is defined as follows:

    The \(\mathcal{H}_\infty\) synthesis is performed and \(\gamma\) is closed to one. -The obtained closed-loop transfer functions are shown in Figure 48 and we can obverse that: +The obtained closed-loop transfer functions are shown in Figure 48 and we can obverse that:

    • The high frequency gain of \(T\) is indeed reduced
    • @@ -3236,28 +3228,28 @@ This means we will probably have slightly less good disturbance rejection and tr
    -
    +

    ex_results_3.png

    Figure 48: Obtained Shape Closed-Loop transfer functions

    -The time domain simulation signals are shown in Figure 49. +The time domain simulation signals are shown in Figure 49. We can indeed see a slightly less good disturbance rejection. However, the vibrations induced by the sensor noise is well reduced. -This can be seen when zooming on the output signal in Figure 50. +This can be seen when zooming on the output signal in Figure 50.

    -
    +

    ex_time_domain_3.png

    Figure 49: Time domain simulation results

    -
    +

    ex_time_domaim_3_zoom.png

    Figure 50: Zoom on the output signal

    @@ -3265,8 +3257,8 @@ This can be seen when zooming on the output signal in Figure -

    6.7 Conclusion and Discussion

    +
    +

    6.7 Conclusion and Discussion

    Hopefully this practical example will help you apply the \(\mathcal{H}_\infty\) Shaping synthesis on other control problems. @@ -3283,11 +3275,11 @@ If the large input usage is considered to be not acceptable, the shaping of \(KS

    -
    -

    7 Conclusion

    +
    +

    7 Conclusion

    - +

    @@ -3298,9 +3290,9 @@ If you want to know more about the “\(\mathcal{H}_\infty\) and robust cont

    -
    -

    Resources

    -
    +
    +

    Resources

    +

    For a complete treatment of multivariable robust control, I would highly recommend this book [3]. If you want to nice reference book in French, look at [4]. @@ -3311,11 +3303,11 @@ You can also look at the very good lectures below.

    -

    +

    -

    +

    Bibliography

    @@ -3338,7 +3330,7 @@ You can also look at the very good lectures below.

    Author: Dehaeze Thomas

    -

    Created: 2020-12-03 jeu. 13:25

    +

    Created: 2020-12-04 ven. 23:00

    diff --git a/index.org b/index.org index 791c80c..65ef8bd 100644 --- a/index.org +++ b/index.org @@ -11,9 +11,15 @@ #+HTML_HEAD: #+HTML_HEAD: - #+HTML_MATHJAX: align: center tagside: right font: TeX +#+BIND: org-latex-image-default-option "scale=1" +#+BIND: org-latex-image-default-width "" + +#+LaTeX_CLASS: scrreprt +#+LaTeX_CLASS_OPTIONS: [a4paper, 10pt, DIV=12] +#+LaTeX_HEADER_EXTRA: \input{preamble.tex} + #+CSL_STYLE: ieee.csl #+PROPERTY: header-args:matlab :session *MATLAB* @@ -41,7 +47,160 @@ #+PROPERTY: header-args:latex+ :post pdf2svg(file=*this*, ext="png") :END: -* Introduction :ignore: +* LaTeX Config :noexport: +#+begin_src emacs-lisp :tangle no + (setq org-latex-default-table-environment "tabular") + (setq org-latex-tables-booktabs nil) +#+end_src + +#+begin_src latex :tangle preamble.tex + \usepackage{float} +#+end_src + +#+begin_src latex :tangle preamble.tex + \usepackage{caption,tabularx,booktabs} +#+end_src + +#+begin_src latex :tangle preamble.tex + \usepackage{biblatex} + \addbibresource{ref.bib} +#+end_src + +#+begin_src latex :tangle preamble.tex + \usepackage{fontawesome} +#+end_src + +#+begin_src latex :tangle preamble.tex + \usepackage{caption} + \usepackage{subcaption} + + \captionsetup[figure]{labelfont=bf} + \captionsetup[subfigure]{labelfont=bf} + \captionsetup[listing]{labelfont=bf} + \captionsetup[table]{labelfont=bf} +#+end_src + +#+begin_src latex :tangle preamble.tex + \usepackage{xcolor} + + \definecolor{my-blue}{HTML}{6b7adb} + \definecolor{my-pale-blue}{HTML}{e6e9f9} + \definecolor{my-red}{HTML}{db6b6b} + \definecolor{my-pale-red}{HTML}{f9e6e6} + \definecolor{my-green}{HTML}{6bdbb6} + \definecolor{my-pale-green}{HTML}{e6f9f3} + \definecolor{my-yellow}{HTML}{dbd26b} + \definecolor{my-pale-yellow}{HTML}{f9f7e6} + \definecolor{my-orange}{HTML}{dba76b} + \definecolor{my-pale-orange}{HTML}{f9f0e6} + \definecolor{my-grey}{HTML}{a3a3a3} + \definecolor{my-pale-grey}{HTML}{f0f0f0} + \definecolor{my-turq}{HTML}{6bc7db} + \definecolor{my-pale-turq}{HTML}{e6f6f9} +#+end_src + +#+begin_src latex :tangle preamble.tex + \usepackage{inconsolata} + + \usepackage[newfloat=true, chapter]{minted} + \usemintedstyle{autumn} + + \setminted{frame=lines,breaklines=true,tabsize=4,fontsize=\scriptsize,autogobble=true,labelposition=topline,bgcolor=my-pale-grey} + \setminted[matlab]{label=Matlab} + \setminted[latex]{label=LaTeX} + \setminted[bash]{label=Bash} + \setminted[python]{label=Python} + \setminted[text]{label=Results} + + \setmintedinline{fontsize=\normalsize,bgcolor=my-pale-grey} +#+end_src + +#+begin_src latex :tangle preamble.tex + \usepackage[most]{tcolorbox} + + \tcbuselibrary{minted} + + \newtcolorbox{seealso}[1][]{ enhanced,breakable,colback=my-pale-grey,colframe=my-grey,fonttitle=\bfseries,title=See Also,#1} + \newtcolorbox{hint}[1][]{ enhanced,breakable,colback=my-pale-grey,colframe=my-grey,fonttitle=\bfseries,title=Hint,#1} + \newtcolorbox{definition}[1][]{enhanced,breakable,colback=my-pale-red, colframe=my-red, fonttitle=\bfseries,title=Definition,#1} + \newtcolorbox{important}[1][]{ enhanced,breakable,colback=my-pale-red, colframe=my-red, fonttitle=\bfseries,title=Important,#1} + \newtcolorbox{exampl}[1][]{ enhanced,breakable,colback=my-pale-green,colframe=my-green,fonttitle=\bfseries,title=Example,#1} + \newtcolorbox{exercice}[1][]{ enhanced,breakable,colback=my-pale-yellow,colframe=my-yellow,fonttitle=\bfseries,title=Exercice,#1} + \newtcolorbox{question}[1][]{ enhanced,breakable,colback=my-pale-yellow,colframe=my-yellow,fonttitle=\bfseries,title=Question,#1} + \newtcolorbox{answer}[1][]{ enhanced,breakable,colback=my-pale-turq,colframe=my-turq,fonttitle=\bfseries,title=Answer,#1} + \newtcolorbox{summary}[1][]{ enhanced,breakable,colback=my-pale-blue,colframe=my-blue,fonttitle=\bfseries,title=Summary,#1} + \newtcolorbox{caution}[1][]{ enhanced,breakable,colback=my-pale-orange,colframe=my-orange,fonttitle=\bfseries,title=Caution,#1} + \newtcolorbox{warning}[1][]{ enhanced,breakable,colback=my-pale-orange,colframe=my-orange,fonttitle=\bfseries,title=Warning,#1} +#+end_src + +#+begin_src latex :tangle preamble.tex + \newtcolorbox{my-quote}[1]{% + colback=my-pale-grey, + grow to right by=-10mm, + grow to left by=-10mm, + boxrule=0pt, + boxsep=0pt, + breakable, + enhanced jigsaw, + borderline west={4pt}{0pt}{my-grey}} + + \renewenvironment{quote}{\begin{my-quote}}{\end{my-quote}} +#+end_src + +#+begin_src latex :tangle preamble.tex + \newtcolorbox{my-verse}[1]{% + colback=my-pale-grey, + grow to right by=-10mm, + grow to left by=-10mm, + boxrule=0pt, + boxsep=0pt, + breakable, + enhanced jigsaw, + borderline west={4pt}{0pt}{my-grey}} + + \renewenvironment{verse}{\begin{my-verse}}{\end{my-verse}} +#+end_src + +#+begin_src latex :tangle preamble.tex + \usepackage{environ}% http://ctan.org/pkg/environ + \NewEnviron{aside}{% + \marginpar{\BODY} + } +#+end_src + +#+begin_src latex :tangle preamble.tex + \renewenvironment{verbatim}{\VerbatimEnvironment\begin{minted}[]{text}}{\end{minted}} +#+end_src + +#+begin_src latex :tangle preamble.tex + \usepackage{soul} + \sethlcolor{my-pale-grey} + + \let\OldTexttt\texttt + \renewcommand{\texttt}[1]{{\ttfamily\hl{\mbox{\,#1\,}}}} +#+end_src + +#+begin_src latex :tangle preamble.tex + \makeatletter + \preto\Gin@extensions{png,} + \DeclareGraphicsRule{.png}{pdf}{.pdf}{\noexpand\Gin@base.pdf} + \makeatother +#+end_src + +#+begin_src latex :tangle preamble.tex + \usepackage{hyperref} + \hypersetup{ + colorlinks = true, + allcolors = my-blue + } + + \usepackage{hypcap} +#+end_src + +* Introduction +:PROPERTIES: +:UNNUMBERED: t +:END: The purpose of this document is to give a /practical introduction/ to the wonderful world of $\mathcal{H}_\infty$ Control. @@ -78,12 +237,6 @@ The general structure of this document is as follows: * Introduction to Model Based Control <> -** Introduction :ignore: - -# - Section [[sec:model_based_control_methodology]] -# - Section [[sec:comp_classical_modern_robust_control]] -# - Section [[sec:example_system]] - ** Model Based Control - Methodology <> @@ -160,32 +313,32 @@ The three presented control methods are compared in Table [[tab:comparison_contr Note that in parallel, there have been numerous other developments, including non-linear control, adaptive control, machine-learning control just to name a few. + #+name: tab:comparison_control_methods #+caption: Table summurazing the main differences between classical, modern and robust control -| | | | | -| | *Classical Control* | *Modern Control* | *Robust Control* | -|-------------------------+------------------------------------+--------------------------------------+--------------------------------------------| -| *Date* | 1930- | 1960- | 1980- | -|-------------------------+------------------------------------+--------------------------------------+--------------------------------------------| -| *Tools* | Transfer Functions | State Space formulation | Systems and Signals Norms | -| | Nyquist, Bode Plots | Riccati Equations | Closed Loop Transfer Functions | -| | Root Locus | | Closed Loop Shaping | -| | Phase and Gain margins | | Weighting Functions | -| | Open Loop Shaping | | Disk margin | -| | | | Singular Value Decomposition | -|-------------------------+------------------------------------+--------------------------------------+--------------------------------------------| -| *Control Architectures* | Proportional, Integral, Derivative | Full State Feedback, LQR | General Control Configuration | -| | Leads, Lags | Kalman Filters, LQG | Generalized Plant | -|-------------------------+------------------------------------+--------------------------------------+--------------------------------------------| -| *Advantages* | Study Stability | Automatic Synthesis | Automatic Synthesis | -| | Simple | MIMO | MIMO | -| | Natural | Optimization Problem | Optimization Problem | -| | | | Guaranteed Robustness | -| | | | Easy specification of performances | -|-------------------------+------------------------------------+--------------------------------------+--------------------------------------------| -| *Disadvantages* | Manual Method | No Guaranteed Robustness | Required knowledge of specific tools | -| | Only SISO | Difficult Rejection of Perturbations | Need a reasonably good model of the system | -| | No clear way to limit input usage | | | +#+attr_latex: :environment tabularx :booktabs t :width \linewidth :align lccc +| | | | | +| | *Classical Control* | *Modern Control* | *Robust Control* | +|---------------+---------------------+--------------------------+-------------------------------| +| *Date* | 1930- | 1960- | 1980- | +|---------------+---------------------+--------------------------+-------------------------------| +| *Tools* | Transfer Functions | State Space formulation | Systems/Signal Norms | +| | Nyquist, Bode Plots | Riccati Equations | Closed Loop TF | +| | Root Locus | Kalman Filters | Closed Loop Shaping | +| | Phase/Gain margins | | Weighting Functions | +| | Open Loop Shaping | | Disk margin | +|---------------+---------------------+--------------------------+-------------------------------| +| *Controllers* | P, PI, PID | Full State Feedback | General Control Conf. | +| | Leads, Lags | LQG, LQR | | +|---------------+---------------------+--------------------------+-------------------------------| +| *Advantages* | Study Stability | Automatic Synthesis | Automatic Synthesis | +| | Simple | MIMO | MIMO | +| | Natural | Optimization Problem | Optimization Problem | +| | | | Guaranteed Robustness | +|---------------+---------------------+--------------------------+-------------------------------| +| *Disadvant.* | Manual Method | No Guaranteed Robustness | Requires knowledge of tools | +| | Only SISO | Rejection of Pert. | Need good model of the system | +| | No input usage lim. | | | #+begin_src latex :file robustness_performance.pdf \begin{tikzpicture} @@ -315,6 +468,7 @@ The notations used on Figure [[fig:mech_sys_1dof_inertial_contr]] are listed and #+name: tab:example_notations #+caption: Example system variables +#+attr_latex: :environment tabularx :booktabs t :width \linewidth :align cXcc | *Notation* | *Description* | *Value* | *Unit* | |--------------------+----------------------------------------------------------------+----------------+-----------| | $m$ | Payload's mass to position / isolate | $10$ | [kg] | @@ -335,6 +489,7 @@ Derive the following open-loop transfer functions: \end{align} #+HTML:
    Hint +#+LATEX: \tcbsubtitle{Hint} You can follow this generic procedure: 1. List all applied forces ot the mass: Actuator force, Stiffness force (Hooke's law), ... 2. Apply the Newton's Second Law on the payload @@ -345,6 +500,7 @@ You can follow this generic procedure: #+HTML:
    #+HTML:
    Results +#+LATEX: \tcbsubtitle{Results} \begin{align} G(s) &= \frac{1}{m s^2 + cs + k} \\ G_d(s) &= \frac{cs + k}{m s^2 + cs + k} @@ -501,6 +657,7 @@ Its name comes from the fact that this is actually the "gain around the loop". #+name: fig:open_loop_shaping #+caption: Classical Feedback Architecture +#+attr_latex: :float nil [[file:figs/open_loop_shaping.png]] #+end_definition @@ -584,6 +741,7 @@ Using =SISOTOOL=, design a controller that fulfills the specifications. #+end_src #+HTML:
    Hint +#+LATEX: \tcbsubtitle{Hint} You can follow this procedure: 1. In order to have good disturbance rejection at low frequency, add a simple or double *integrator* 2. In terms of the loop gain, the *bandwidth* can be defined at the frequency $\omega_c$ where $|l(j\omega_c)|$ first crosses 1 from above. @@ -687,12 +845,13 @@ Such shape corresponds to the typical wanted Loop gain Shape shown in Figure [[f #+name: tab:open_loop_shaping_specifications #+caption: Wanted Loop Shape corresponding to each specification -| | Specification | Corresponding Loop Shape | -|-------------------------+---------------------------------------------+-----------------------------------------------------------------| -| *Disturbance Rejection* | Highest possible rejection below 1Hz | Slope of -40dB/decade at low frequency to have a high loop gain | -| *Positioning Speed* | Bandwidth of approximately 10Hz | $L$ crosses 1 at 10Hz: $\vert L_w(j2 \pi 10)\vert = 1$ | -| *Noise Attenuation* | Roll-off of -40dB/decade past 30Hz | Roll-off of -40dB/decade past 30Hz | -| *Robustness* | Gain margin > 3dB and Phase margin > 30 deg | Slope of -20dB/decade near the crossover | +#+attr_latex: :environment tabularx :booktabs t :width \linewidth :align lXX +| | *Specification* | *Corresponding Loop Shape* | +|--------------+----------------------------------------+------------------------------------------| +| *Dist. Rej.* | Highest possible rejection below 1Hz | Slope of -40dB/dec at low frequency | +| *Pos. Speed* | Bandwidth of approximately 10Hz | $L$ crosses 1 at 10Hz | +| *Noise Att.* | Roll-off of -40dB/decade past 30Hz | Roll-off of -40dB/decade past 30Hz | +| *Robustness* | $\Delta G > 3dB$, $\Delta \phi > 30^o$ | Slope of -20dB/decade near the crossover | Then, a (stable, minimum phase) transfer function $L_w(s)$ should be created that has the same gain as the wanted shape of the Loop gain. For this example, a double integrator and a lead centered on 10Hz are used. @@ -808,12 +967,13 @@ Let's finally compare the obtained stability margins of the $\mathcal{H}_\infty$ #+name: tab:open_loop_shaping_compare #+caption: Comparison of the characteristics obtained with the two methods +#+attr_latex: :environment tabularx :booktabs t :width \linewidth :align Xcc #+RESULTS: -| Specifications | Manual Method | $\mathcal{H}_\infty$ Method | -|-----------------------------+---------------+-----------------------------| -| Gain Margin $> 3$ [dB] | 3.1 | 31.7 | -| Phase Margin $> 30$ [deg] | 35.4 | 54.7 | -| Crossover $\approx 10$ [Hz] | 10.1 | 9.9 | +| *Specifications* | *Manual Method* | *$\mathcal{H}_\infty$ Method* | +|-----------------------------+-----------------+-------------------------------| +| Gain Margin $> 3$ [dB] | 3.1 | 31.7 | +| Phase Margin $> 30$ [deg] | 35.4 | 54.7 | +| Crossover $\approx 10$ [Hz] | 10.1 | 9.9 | * A first Step into the $\mathcal{H}_\infty$ world <> @@ -873,6 +1033,7 @@ We can see in Figure [[fig:hinfinity_norm_siso_bode]] that indeed, the $\mathcal #+name: fig:hinfinity_norm_siso_bode #+caption: Example of the $\mathcal{H}_\infty$ norm of a SISO system +#+attr_latex: :float nil #+RESULTS: [[file:figs/hinfinity_norm_siso_bode.png]] #+end_exampl @@ -941,18 +1102,20 @@ A practical example about how to derive the generalized plant for a classical co #+begin_important #+name: fig:general_plant #+caption: Inputs and Outputs of the generalized Plant +#+ATTR_LATEX: :float nil #+RESULTS: [[file:figs/general_plant.png]] #+name: tab:notation_general #+caption: Notations for the general configuration -| Notation | Meaning | -|----------+----------------------------------------------------| -| $P$ | Generalized plant model | -| $w$ | Exogenous inputs: references, disturbances, noises | -| $z$ | Exogenous outputs: signals to be minimized | -| $v$ | Controller inputs: measurements | -| $u$ | Control signals | +#+attr_latex: :environment tabularx :booktabs t :width 0.8\linewidth :align cX :float nil +| *Notation* | *Meaning* | +|------------+----------------------------------------------------| +| $P$ | Generalized plant model | +| $w$ | Exogenous inputs: references, disturbances, noises | +| $z$ | Exogenous outputs: signals to be minimized | +| $v$ | Controller inputs: measurements | +| $u$ | Control signals | #+end_important ** The $\mathcal{H}_\infty$ Synthesis applied on the Generalized plant @@ -992,6 +1155,7 @@ Once the generalized plant is obtained, the $\mathcal{H}_\infty$ synthesis probl #+name: fig:general_control_names #+caption: General Control Configuration +#+attr_latex: :float nil #+RESULTS: [[file:figs/general_control_names.png]] #+end_important @@ -1067,24 +1231,28 @@ The procedure to convert a typical control architecture as the one shown in Figu #+name: fig:classical_feedback_tracking #+caption: Classical Feedback Control Architecture (Tracking) + #+attr_latex: :float nil [[file:figs/classical_feedback_tracking.png]] #+HTML:
    Hint +#+LATEX: \tcbsubtitle{Hint} First, define the signals of the generalized plant: - Exogenous inputs: $w = r$ - Signals to be minimized: Usually, we want to minimize the tracking errors $\epsilon$ and the control signal $u$: $z = [\epsilon,\ u]$ - Controller inputs: this is the signal at the input of the controller: $v = \epsilon$ - - Control inputs: signal generated by the controller: $u$ + - Controller outputs: signal generated by the controller: $u$ Then, Remove $K$ and rearrange the inputs and outputs as in Figure [[fig:general_plant]]. #+HTML:
    #+HTML:
    Answer +#+LATEX: \tcbsubtitle{Anwser} The obtained generalized plant shown in Figure [[fig:mixed_sensitivity_ref_tracking]]. #+name: fig:mixed_sensitivity_ref_tracking #+caption: Generalized plant of the Classical Feedback Control Architecture (Tracking) + #+attr_latex: :float nil [[file:figs/mixed_sensitivity_ref_tracking.png]] Using Matlab, the generalized plant can be defined as follows: @@ -1161,7 +1329,8 @@ These are summarized in Table [[tab:spec_closed_loop_tf]]. #+name: tab:spec_closed_loop_tf #+caption: Typical Specification and associated closed-loop transfer function -| Specification | Closed-Loop Transfer Function | +#+attr_latex: :environment tabularx :booktabs t :width 0.8\linewidth :align Xl +| *Specification* | *CL Transfer Function* | |--------------------------------+-----------------------------------------------| | Reference Tracking | From $r$ to $\epsilon$ | | Disturbance Rejection | From $d$ to $y$ | @@ -1174,13 +1343,14 @@ These are summarized in Table [[tab:spec_closed_loop_tf]]. For the feedback system in Figure [[fig:gang_of_four_feedback]], write the output signals $[\epsilon, u, y]$ as a function of the systems $K(s), G(s)$ and the input signals $[r, d, n]$. #+HTML:
    Hint +#+LATEX: \tcbsubtitle{Hint} Take one of the output (e.g. $y$), and write it as a function of the inputs $[d, r, n]$ going step by step around the loop: -\begin{aligned} +\begin{align*} y &= G u \\ &= G (d + K \epsilon) \\ &= G \big(d + K (r - n - y) \big) \\ &= G d + GK r - GK n - GK y -\end{aligned} +\end{align*} Isolate $y$ at the right hand side, and finally obtain: \[ y = \frac{GK}{1+ GK} r + \frac{G}{1 + GK} d - \frac{GK}{1 + GK} n \] @@ -1189,6 +1359,7 @@ Do the same procedure for $u$ and $\epsilon$ #+HTML:
    #+HTML:
    Answer +#+LATEX: \tcbsubtitle{Answer} The following equations should be obtained: \begin{align} y &= \frac{GK}{1 + GK} r + \frac{G}{1 + GK} d - \frac{GK}{1 + GK} n \\ @@ -1238,11 +1409,12 @@ The comparison of the sensitivity functions shapes and their effect on the step #+name: tab:compare_sensitivity_shapes #+caption: Comparison of the sensitivity function shape and the corresponding step response for the three controller variations -| Controller | Sensitivity Function Shape | Change of the Step Response | -|------------+----------------------------------------------------+----------------------------------| -| $K_1(s)$ | Larger bandwidth $\omega_b$ | Faster rise time | -| $K_2(s)$ | Larger peak value $\Vert S\Vert_\infty$ | Large overshoot and oscillations | -| $K_3(s)$ | Larger low frequency gain $\vert S(j\cdot 0)\vert$ | Larger static error | +#+attr_latex: :environment tabularx :booktabs t :width 0.9\linewidth :align lXX +| *Controller* | *Sensitivity Function Shape* | *Change of the Step Response* | +|--------------+----------------------------------------------------+----------------------------------| +| $K_1(s)$ | Larger bandwidth $\omega_b$ | Faster rise time | +| $K_2(s)$ | Larger peak value $\Vert S\Vert_\infty$ | Large overshoot and oscillations | +| $K_3(s)$ | Larger low frequency gain $\vert S(j\cdot 0)\vert$ | Larger static error | #+begin_src matlab :exports none wc = 2*pi*1; L_w = 8; wi = 2*pi*0.02; @@ -1379,6 +1551,7 @@ From the simple analysis above, we can draw a first estimation of the wanted sha #+name: fig:h-infinity-spec-S #+caption: Typical wanted shape of the Sensitivity transfer function +#+attr_latex: :float nil [[file:figs/h-infinity-spec-S.png]] #+end_important @@ -1445,10 +1618,10 @@ Or does it? Let's find out. #+name: fig:phase_gain_margin_model_plant #+caption: Bode plot of the obtained Loop Gain $L(s)$ +#+attr_latex: :float nil #+RESULTS: [[file:figs/phase_gain_margin_model_plant.png]] - Now let's suppose the controller is implemented in practice, and the "real" plant $G_r(s)$ as a slightly lower damping factor than the one estimated for the model: #+begin_src matlab xi = 0.03; @@ -1504,6 +1677,7 @@ It is confirmed by checking the stability of the closed loop system: #+name: fig:phase_gain_margin_real_plant #+caption: Bode plots of $L(s)$ (loop gain corresponding the nominal plant) and $L_r(s)$ (loop gain corresponding to the real plant) +#+attr_latex: :float nil #+RESULTS: [[file:figs/phase_gain_margin_real_plant.png]] @@ -1516,7 +1690,7 @@ Let's now determine a new robustness indicator based on the Nyquist Stability Cr #+begin_definition - Nyquist Stability Criteria (for stable systems) :: - If the open-loop transfer function $L(s)$ is stable, then the closed-loop system will be unstable for any encirclement of the point $−1$ on the Nyquist plot. + If the open-loop transfer function $L(s)$ is stable, then the closed-loop system will be unstable for any encirclement of the point $-1$ on the Nyquist plot. - Nyquist Plot :: The Nyquist plot shows the evolution of $L(j\omega)$ in the complex plane from $\omega = 0 \to \infty$. @@ -1591,6 +1765,7 @@ The gain, phase and module margins are graphically shown to have an idea of what #+name: fig:module_margin_example #+caption: Nyquist plot with visual indication of the Gain margin $\Delta G$, Phase margin $\Delta \phi$ and Module margin $\Delta M$ +#+attr_latex: :float nil #+RESULTS: [[file:figs/module_margin_example.png]] #+end_exampl @@ -1642,13 +1817,14 @@ And we now understand why setting an upper bound on the magnitude of $S$ is gene #+name: tab:specification_modern #+caption: Typical Specifications and corresponding wanted norms of open and closed loop tansfer functions -| | Open-Loop Shaping | Closed-Loop Shaping | -|-----------------------------+--------------------+--------------------------------------------| -| Reference Tracking | $L$ large | $S$ small | -| Disturbance Rejection | $L$ large | $GS$ small | -| Measurement Noise Filtering | $L$ small | $T$ small | -| Small Command Amplitude | $K$ and $L$ small | $KS$ small | -| Robustness | Phase/Gain margins | Module margin: $\Vert S\Vert_\infty$ small | +#+attr_latex: :environment tabularx :booktabs t :width 0.9\linewidth :align lXX +| | *Open-Loop Shaping* | *Closed-Loop Shaping* | +|-----------------------------+---------------------+--------------------------------------------| +| Reference Tracking | $L$ large | $S$ small | +| Disturbance Rejection | $L$ large | $GS$ small | +| Measurement Noise Filtering | $L$ small | $T$ small | +| Small Command Amplitude | $K$ and $L$ small | $KS$ small | +| Robustness | Phase/Gain margins | Module margin: $\Vert S\Vert_\infty$ small | * $\mathcal{H}_\infty$ Shaping of closed-loop transfer functions <> @@ -1769,12 +1945,14 @@ Let's now show how this is equivalent as *shaping* the sensitivity function: Using matlab, compute the weighted generalized plant shown in Figure [[fig:first_order_weight]] as a function of $G(s)$ and $W_S(s)$. #+HTML:
    Hint +#+LATEX: \tcbsubtitle{Hint} The weighted generalized plant can be defined in Matlab using two techniques: - by writing manually the 4 transfer functions from $[w, u]$ to $[\tilde{\epsilon}, v]$ - by pre-multiplying the (non-weighted) generalized plant by a block-diagonal transfer function matrix containing the weights for the outputs $z$ and =1= for the outputs $v$ #+HTML:
    #+HTML:
    Answer +#+LATEX: \tcbsubtitle{Answer} The two solutions below can be used. #+begin_src matlab :tangle no :eval no @@ -1823,7 +2001,7 @@ The Matlab code below produces a weighting function with the following character - Gain of 1 at 10Hz - High frequency gain of 0.5 -#+begin_src matlab +#+begin_src matlab :float nil Ws = makeweight(1e2, [2*pi*10, 1], 1/2); #+end_src @@ -1845,6 +2023,7 @@ The Matlab code below produces a weighting function with the following character #+name: fig:first_order_weight #+caption: Obtained Magnitude of the Weighting Function +#+attr_latex: :float nil #+RESULTS: [[file:figs/first_order_weight.png]] #+end_exampl @@ -1870,8 +2049,6 @@ The parameters permit to specify: A Matlab function implementing Equation eqref:eq:weight_formula_advanced is shown below: -#+name: lst:generateWeight -#+caption: Matlab Function that can be used to generate Weighting functions #+begin_src matlab :tangle matlab/generateWeight.m :comments none :eval no function [W] = generateWeight(args) arguments @@ -1890,7 +2067,7 @@ A Matlab function implementing Equation eqref:eq:weight_formula_advanced is show s = zpk('s'); - W = (((1/args.wc)*sqrt((1-(args.G0/args.Gc)^(2/args.n))/(1-(args.Gc/args.G1)^(2/args.n)))*s + (args.G0/args.Gc)^(1/args.n))/((1/args.G1)^(1/args.n)*(1/args.wc)*sqrt((1-(args.G0/args.Gc)^(2/args.n))/(1-(args.Gc/args.G1)^(2/args.n)))*s + (1/args.Gc)^(1/args.n)))^args.n; + W = (((1/args.wc) * sqrt((1-(args.G0/args.Gc)^(2/args.n))/(1-(args.Gc/args.G1)^(2/args.n)))*s + (args.G0/args.Gc)^(1/args.n)) / ((1/args.G1)^(1/args.n) * (1/args.wc) * sqrt((1-(args.G0/args.Gc)^(2/args.n))/(1-(args.Gc/args.G1)^(2/args.n)))*s + (1/args.Gc)^(1/args.n)))^args.n; end #+end_src @@ -1928,6 +2105,7 @@ The obtained shapes are shown in Figure [[fig:high_order_weight]]. #+name: fig:high_order_weight #+caption: Higher order weights using Equation eqref:eq:weight_formula_advanced +#+attr_latex: :float nil #+RESULTS: [[file:figs/high_order_weight.png]] #+end_seealso @@ -1946,6 +2124,7 @@ As usual, the plant used is the one presented in Section [[sec:example_system]]. Translate the requirements as upper bounds on the Sensitivity function and design the corresponding weighting functions using Matlab. #+HTML:
    Hint +#+LATEX: \tcbsubtitle{Hint} The typical wanted upper bound of the sensitivity function is shown in Figure [[fig:h-infinity-spec-S-bis]]. More precisely: @@ -1958,10 +2137,12 @@ Remember that the wanted upper bound of the sensitivity function is defined by t #+name: fig:h-infinity-spec-S-bis #+caption: Typical wanted shape of the Sensitivity transfer function +#+attr_latex: :float nil [[file:figs/h-infinity-spec-S.png]] #+HTML:
    #+HTML:
    Answer +#+LATEX: \tcbsubtitle{Answer} We want to design the weighting function $W_s(s)$ such that: 1. $|W_s(j \cdot 2 \pi 10)| = \sqrt{2}$ 2. $|W_s(j \cdot 0)| = 10^3$ @@ -2016,10 +2197,10 @@ And the $\mathcal{H}_\infty$ synthesis is performed on the /weighted/ generalize #+end_example $\gamma \approx 0.5$ means that the $\mathcal{H}_\infty$ synthesis generated a controller $K(s)$ that stabilizes the closed-loop system, and such that the $\mathcal{H}_\infty$ norm of the closed-loop transfer function from $w$ to $z$ is less than $\gamma$: -\begin{aligned} +\begin{align*} & \| W_s(s) S(s) \|_\infty \approx 0.5 \\ & \Leftrightarrow |S(j\omega)| < \frac{0.5}{|W_s(j\omega)|} \quad \forall \omega -\end{aligned} +\end{align*} This is indeed what we can see by comparing $|S|$ and $|W_S|$ in Figure [[fig:results_sensitivity_hinf]]. @@ -2063,31 +2244,33 @@ When multiple closed-loop transfer function are shaped at the same time, it is r #+name: tab:usual_shaping_gang_four #+caption: Typical specifications and corresponding shaping of the /Gang of four/ -| | | | -| Specification | Gang of Four | Wanted shape | -|--------------------------------------+--------------+-----------------------------------------------------------| -| Fast Reference Tracking | $S$ | Set lower bound on the bandwidth | -| Small Steady State Errors | $S$ | Small low frequency gain | -| Follow Step ref. inputs | $S$ | Slope of +20dB/dec at low frequency | -| Follow Ramp ref. inputs | $S$ | Slope of +40dB/dec at low frequency | -| Follow Sinusoidal ref. inputs | $S$ | Small magnitude centered on the sin. frequency | -|--------------------------------------+--------------+-----------------------------------------------------------| -| Output Disturbance Rejection | $S$ | Small gain in the disturbance bandwidth | -| Input Disturbance Rejection | $GS$ | Small gain in the disturbance bandwidth | -| Prevent inversion of resonant plants | $GS$ | Limit gain around resonance | -|--------------------------------------+--------------+-----------------------------------------------------------| -| Small Command Amplitude | $KS$ | Small at high frequency | -| Limitation of the Control Bandwidth | $T$ | Set an upper bound on the bandwidth | -| Measurement Noise Filtering | $T$ | Small high frequency gain | -|--------------------------------------+--------------+-----------------------------------------------------------| -| Stability margins | $S$ | Module margin: $\Vert S\Vert_\infty$ small | -| Robustness to un-modelled dynamics | $T$ | Small at frequencies where the plant uncertainty is large | +#+attr_latex: :environment tabularx :booktabs t :width 0.9\linewidth :align llX +| | | | +| *Specifications* | *TF* | *Wanted shape* | +|-------------------------------+------+------------------------------------------------| +| Fast Reference Tracking | $S$ | Set lower bound on the bandwidth | +| Small Steady State Errors | $S$ | Small low frequency gain | +| Follow Step ref. inputs | $S$ | Slope of +20dB/dec at low frequency | +| Follow Ramp ref. inputs | $S$ | Slope of +40dB/dec at low frequency | +| Follow Sin. ref. inputs | $S$ | Small magnitude centered on the sin. frequency | +|-------------------------------+------+------------------------------------------------| +| Output Disturbance Rejection | $S$ | Small gain in the disturbance bandwidth | +| Input Disturbance Rejection | $GS$ | Small gain in the disturbance bandwidth | +| Prevent notching resonances | $GS$ | Limit gain around resonance | +|-------------------------------+------+------------------------------------------------| +| Small Command Amplitude | $KS$ | Small at high frequency | +| Limitation of the Bandwidth | $T$ | Set an upper bound on the bandwidth | +| Measurement Noise Filtering | $T$ | Small high frequency gain | +|-------------------------------+------+------------------------------------------------| +| Stability margins | $S$ | Module margin: $\Vert S\Vert_\infty$ small | +| Robust to unmodelled dynamics | $T$ | Small at freq. where uncertainty is large | Depending on which closed-loop transfer function are to be shaped, different weighted generalized plant can be used. Some of them are described below for reference, it is a good exercise to try to re-design such weighted generalized plants. *** S KS :ignore: #+HTML:
    Shaping of S and KS +#+latex: \begin{exampl}[after title={~- Shape $S$ and $KS$}] #+begin_src latex :file general_conf_shaping_S_KS.pdf \begin{tikzpicture} % Blocs @@ -2126,6 +2309,7 @@ Some of them are described below for reference, it is a good exercise to try to #+name: fig:general_conf_shaping_S_KS #+caption: Generalized Plant to shape $S$ and $KS$ +#+attr_latex: :float nil #+RESULTS: [[file:figs/general_conf_shaping_S_KS.png]] @@ -2133,17 +2317,18 @@ Weighting functions: - $W_1(s)$ is used to shape $S$ - $W_2(s)$ is used to shape $KS$ -#+name: lst:general_plant_S_KS -#+caption: General Plant definition corresponding to Figure [[fig:general_conf_shaping_S_KS]] #+begin_src matlab :eval no :tangle no - P = [W1 -G*W1 - 0 W2 - 1 -G]; + P = [1 -G + 0 1 + 1 -G]; + Pw = blkdiag(W1, W2, 1)*P; #+end_src +#+latex: \end{exampl} #+HTML:
    *** S T :ignore: #+HTML:
    Shaping of S and T +#+latex: \begin{exampl}[after title={~- Shape $S$ and $T$}] #+begin_src latex :file general_conf_shaping_S_T.pdf \begin{tikzpicture} % Blocs @@ -2180,6 +2365,7 @@ Weighting functions: #+name: fig:general_conf_shaping_S_T #+caption: Generalized Plant to shape $S$ and $T$ +#+attr_latex: :float nil #+RESULTS: [[file:figs/general_conf_shaping_S_T.png]] @@ -2187,17 +2373,18 @@ Weighting functions: - $W_1$ is used to shape $S$ - $W_2$ is used to shape $T$ -#+name: lst:general_plant_S_T -#+caption: General Plant definition corresponding to Figure [[fig:general_conf_shaping_S_T]] #+begin_src matlab :eval no :tangle no - P = [W1 -G*W1 - 0 G*W2 - 1 -G]; + P = [1 -G + 0 G + 1 -G]; + Pw = blkdiag(W1, W2, 1)*P; #+end_src +#+latex: \end{exampl} #+HTML:
    *** S GS :ignore: #+HTML:
    Shaping of S and GS +#+latex: \begin{exampl}[after title={~- Shape $S$ and $GS$}] #+begin_src latex :file general_conf_shaping_S_GS.pdf \begin{tikzpicture} % Blocs @@ -2234,6 +2421,7 @@ Weighting functions: #+name: fig:general_conf_shaping_S_GS #+caption: Generalized Plant to shape $S$ and $GS$ +#+attr_latex: :float nil #+RESULTS: [[file:figs/general_conf_shaping_S_GS.png]] @@ -2241,17 +2429,18 @@ Weighting functions: - $W_1$ is used to shape $S$ - $W_2$ is used to shape $GS$ -#+name: lst:general_plant_S_GS -#+caption: General Plant definition corresponding to Figure [[fig:general_conf_shaping_S_GS]] #+begin_src matlab :eval no :tangle no - P = [W1 -W1 - G*W2 -G*W2 - G -G]; + P = [1 -1 + G -G + G -G]; + Pw = blkdiag(W1, W2, 1)*P; #+end_src +#+latex: \end{exampl} #+HTML:
    *** S T KS :ignore: #+HTML:
    Shaping of S, T and KS +#+latex: \begin{exampl}[after title={~- Shape $S$, $T$ and $KS$}] #+begin_src latex :file general_conf_shaping_S_T_KS.pdf \begin{tikzpicture} % Blocs @@ -2293,6 +2482,7 @@ Weighting functions: #+name: fig:general_conf_shaping_S_T_KS #+caption: Generalized Plant to shape $S$, $T$ and $KS$ +#+attr_latex: :float nil #+RESULTS: [[file:figs/general_conf_shaping_S_T_KS.png]] @@ -2301,18 +2491,19 @@ Weighting functions: - $W_2$ is used to shape $KS$ - $W_3$ is used to shape $T$ -#+name: lst:general_plant_S_T_KS -#+caption: General Plant definition corresponding to Figure [[fig:general_conf_shaping_S_T_KS]] #+begin_src matlab :eval no :tangle no - P = [W1 -G*W1 - 0 W2 - 0 G*W3 - 1 -G]; + P = [1 -G + 0 1 + 0 G + 1 -G]; + Pw = blkdiag(W1, W2, W3, 1)*P; #+end_src +#+latex: \end{exampl} #+HTML:
    *** S T GS :ignore: #+HTML:
    Shaping of S, T and GS +#+latex: \begin{exampl}[after title={~- Shape $S$, $T$ and $GS$}] #+begin_src latex :file general_conf_shaping_S_T_GS.pdf \begin{tikzpicture} % Blocs @@ -2354,6 +2545,7 @@ Weighting functions: #+name: fig:general_conf_shaping_S_T_GS #+caption: Generalized Plant to shape $S$, $T$ and $GS$ +#+attr_latex: :float nil #+RESULTS: [[file:figs/general_conf_shaping_S_T_GS.png]] @@ -2362,18 +2554,19 @@ Weighting functions: - $W_2$ is used to shape $GS$ - $W_3$ is used to shape $T$ -#+name: lst:general_plant_S_T_GS -#+caption: General Plant definition corresponding to Figure [[fig:general_conf_shaping_S_T_GS]] #+begin_src matlab :eval no :tangle no - P = [W1 -W1 - G*W2 -G*W2 - 0 W3 - G -G]; + P = [1 -1 + G -G + 0 1 + G -G]; + Pw = blkdiag(W1, W2, W3, 1)*P; #+end_src +#+latex: \end{exampl} #+HTML:
    *** S T KS GS :ignore: #+HTML:
    Shaping of S, T, KS and GS +#+latex: \begin{exampl}[after title={~- Shape $S$, $T$, $KS$ and $GS$}] #+begin_src latex :file general_conf_shaping_S_T_KS_GS.pdf \begin{tikzpicture} % Blocs @@ -2419,6 +2612,7 @@ Weighting functions: #+name: fig:general_conf_shaping_S_T_KS_GS #+caption: Generalized Plant to shape $S$, $T$, $KS$ and $GS$ +#+attr_latex: :float nil #+RESULTS: [[file:figs/general_conf_shaping_S_T_KS_GS.png]] @@ -2428,13 +2622,13 @@ Weighting functions: - $W_1W_3$ is used to shape $GS$ - $W_2W_3$ is used to shape $T$ -#+name: lst:general_plant_S_T_KS_GS -#+caption: General Plant definition corresponding to Figure [[fig:general_conf_shaping_S_T_KS_GS]] #+begin_src matlab :eval no :tangle no - P = [ W1 -W1*G*W3 -G*W1 - 0 0 W2 - 1 -G*W3 -G]; + P = [ 1 -G -G + 0 0 1 + 1 -G -G]; + Pw = blkdiag(W1, W2, 1)*P*blkdiag(1, W3, 1); #+end_src +#+latex: \end{exampl} #+HTML:
    *** Limitation :ignore: @@ -2476,6 +2670,7 @@ Similar relationship can be found for $T$, $KS$ and $GS$. Determine the approximate norms of $T$, $KS$ and $GS$ for large loop gains ($|G(j\omega) K(j\omega)| \gg 1$) and small loop gains ($|G(j\omega) K(j\omega)| \ll 1$). #+HTML:
    Hint +#+LATEX: \tcbsubtitle{Hint} You can follows this procedure for $T$, $KS$ and $GS$: 1. Write the closed-loop transfer function as a function of $K(s)$ and $G(s)$ 2. Take $|K(j\omega)G(j\omega)| \gg 1$ and conclude on the norm of the closed-loop transfer function @@ -2483,6 +2678,7 @@ You can follows this procedure for $T$, $KS$ and $GS$: #+HTML:
    #+HTML:
    Answer +#+LATEX: \tcbsubtitle{Answer} The obtained constrains are shown in Figure [[fig:h-infinity-4-blocs-constrains]]. #+HTML:
    #+end_exercice @@ -2651,7 +2847,7 @@ Here is the general design procedure that will be followed: 4. Chose the suitable weighted general plant to shape the wanted quantities 5. Shape sequentially the chosen closed-loop transfer functions -Let's first convert the system of Figure [[fig:ex_test_system]] into the classical feedback architecture of Figure [[fig:classical_feedback_test_system]]. +Let's first convert the system of Figure [[fig:ex_test_system]] into the classical feedback architecture of Figure [[fig:classical_feedback_test_system_bis]]. #+begin_src latex :file ex_test_system_feedback.pdf \begin{tikzpicture} @@ -2675,7 +2871,7 @@ Let's first convert the system of Figure [[fig:ex_test_system]] into the classic \end{tikzpicture} #+end_src -#+name: fig:classical_feedback_test_system +#+name: fig:classical_feedback_test_system_bis #+caption: Block diagram corresponding to the example system #+RESULTS: [[file:figs/ex_test_system_feedback.png]] @@ -2819,6 +3015,7 @@ Time domain simulations will be performed by first computing the closed-loop sys 4. Using Matlab, define the generalized plant #+HTML:
    Hint +#+LATEX: \tcbsubtitle{Hint} 1. Make use of Table [[tab:usual_shaping_gang_four]] 2. Make use of Table [[tab:usual_shaping_gang_four]] 3. See Section [[sec:shaping_multiple_tf]] @@ -2832,13 +3029,14 @@ In such case, we want to shape $S$, $GS$ and $T$. #+name: tab:ex_specification_shapes #+caption: Control Specifications and associated wanted shape of the closed-loop transfer functions -| | | | -| Specification | Corresponding Transfer Function | Wanted Shape | -|--------------------------+---------------------------------+------------------------------------| -| Follow Step Reference | $S$ | +40dB of slope at low frequency | -| Reject Disturbances | $S$, $GS$ | Small gain | -| Reject measurement noise | $T$ | Small high frequency (>100Hz) gain | -| Robust System | $S$ | Small $\Vert S \Vert_\infty$ | +#+attr_latex: :environment tabularx :booktabs t :width 0.7\linewidth :align llX +| | | | +| *Specification* | *TF* | *Wanted Shape* | +|--------------------------+-----------+------------------------------------| +| Follow Step Reference | $S$ | +40dB of slope at low frequency | +| Reject Disturbances | $S$, $GS$ | Small gain | +| Reject measurement noise | $T$ | Small high frequency (>100Hz) gain | +| Robust System | $S$ | Small $\Vert S \Vert_\infty$ | To do so, we use to generalized plant shown in Figure [[fig:ex_general_plant]] for the synthesis where the three closed-loop tranfert functions from $w$ to $[z_1\,,z_2\,,z_3]$ are respectively $S$, $GS$ and $T$. @@ -3504,6 +3702,8 @@ If you want to nice reference book in French, look at cite:duc99_comman_h. You can also look at the very good lectures below. -yt:?listType=playlist&list=PLn8PRpmsu08qFLMfgTEzR8DxOPE7fBiin +[[yt:?listType=playlist&list=PLn8PRpmsu08qFLMfgTEzR8DxOPE7fBiin][Robust Control - Brian Douglas]] -yt:?listType=playlist&list=PLsjPUqcL7ZIFHCObUU_9xPUImZ203gB4o +[[yt:?listType=playlist&list=PLsjPUqcL7ZIFHCObUU_9xPUImZ203gB4o][Control Bootcamp - Steve Brunton]] + +#+latex: \printbibliography diff --git a/index.pdf b/index.pdf new file mode 100644 index 0000000..eeead88 Binary files /dev/null and b/index.pdf differ diff --git a/index.tex b/index.tex new file mode 100644 index 0000000..d068582 --- /dev/null +++ b/index.tex @@ -0,0 +1,1973 @@ +% Created 2020-12-04 ven. 23:35 +% Intended LaTeX compiler: pdflatex +\documentclass[a4paper, 10pt, DIV=12]{scrreprt} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{graphicx} +\usepackage{grffile} +\usepackage{longtable} +\usepackage{wrapfig} +\usepackage{rotating} +\usepackage[normalem]{ulem} +\usepackage{amsmath} +\usepackage{textcomp} +\usepackage{amssymb} +\usepackage{capt-of} +\usepackage{hyperref} +\usepackage[most]{tcolorbox} +\usepackage{bm} +\usepackage{booktabs} +\usepackage{tabularx} +\usepackage{array} +\usepackage{siunitx} +\input{preamble.tex} +\author{Dehaeze Thomas} +\date{\today} +\title{A brief and practical introduction to \(\mathcal{H}_\infty\) Control} +\hypersetup{ + pdfauthor={Dehaeze Thomas}, + pdftitle={A brief and practical introduction to \(\mathcal{H}_\infty\) Control}, + pdfkeywords={}, + pdfsubject={}, + pdfcreator={Emacs 27.1 (Org mode 9.5)}, + pdflang={English}} +\begin{document} + +\maketitle +\tableofcontents + + +\chapter*{Introduction} +\label{sec:orge367402} +The purpose of this document is to give a \emph{practical introduction} to the wonderful world of \(\mathcal{H}_\infty\) Control. + +No attend is made to provide an exhaustive treatment of the subject. +\(\mathcal{H}_\infty\) Control is a very broad topic and entire books are written on it. +Therefore, for more advanced discussion, please have a look at the recommended references at the bottom of this document. + +When possible, Matlab scripts used for the example/exercises are provided such that you can easily test them on your computer. + + +The general structure of this document is as follows: +\begin{itemize} +\item A short introduction to \emph{model based control} is given in Section \ref{sec:model_based_control} +\item Classical \emph{open} loop shaping method is presented in Section \ref{sec:open_loop_shaping}. +It is also shown that \(\mathcal{H}_\infty\) synthesis can be used for \emph{open} loop shaping +\item Important concepts indispensable for \(\mathcal{H}_\infty\) control such as the \(\mathcal{H}_\infty\) norm and the generalized plant are introduced in Section \ref{sec:h_infinity_introduction} +\item A very important step in \(\mathcal{H}_\infty\) control is to express the control specifications (performances, robustness, etc.) as an \(\mathcal{H}_\infty\) optimization problem. Such procedure is described in Section \ref{sec:modern_interpretation_specification} +\item One of the most useful use of the \(\mathcal{H}_\infty\) control is the shaping of closed-loop transfer functions. +Such technique is presented in Section \ref{sec:closed-loop-shaping} +\item Finally, complete examples of the use of \(\mathcal{H}_\infty\) Control for practical problems are provided in Section \ref{sec:h_infinity_mixed_sensitivity} +\end{itemize} + +\chapter{Introduction to Model Based Control} +\label{sec:orgef98240} +\label{sec:model_based_control} + +\section{Model Based Control - Methodology} +\label{sec:orge1fd1b8} +\label{sec:model_based_control_methodology} + +The typical methodology for \textbf{Model Based Control} techniques is schematically shown in Figure \ref{fig:control-procedure}. + +It consists of three steps: +\begin{enumerate} +\item \textbf{Identification or modeling}: a mathematical model \(G(s)\) representing the plant dynamics is obtained +\item \textbf{Translate the specifications into mathematical criteria}: +\begin{itemize} +\item \uline{Specifications}: Response Time, Noise Rejection, Maximum input amplitude, Robustness, \ldots{} +\item \uline{Mathematical Criteria}: Cost Function, Shape of transfer function, Phase/Gain margin, Roll-Off, \ldots{} +\end{itemize} +\item \textbf{Synthesis}: research of a controller \(K(s)\) that satisfies the specifications for the model of the system +\end{enumerate} + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/control-procedure.png} +\caption{\label{fig:control-procedure}Typical Methodoly for Model Based Control} +\end{figure} + +In this document, we will suppose a model of the plant is available (step 1 already performed), and we will focus on steps 2 and 3. + + +In Section \ref{sec:open_loop_shaping}, steps 2 and 3 will be described for a control techniques called \textbf{classical (open-)loop shaping}. + +Then, steps 2 and 3 for the \textbf{\(\mathcal{H}_\infty\) Loop Shaping} of closed-loop transfer functions will be discussed in Sections \ref{sec:modern_interpretation_specification}, \ref{sec:closed-loop-shaping} and \ref{sec:h_infinity_mixed_sensitivity}. + +\section{From Classical Control to Robust Control} +\label{sec:org80f6e15} +\label{sec:comp_classical_modern_robust_control} + +Many different model based control techniques have been developed since the birth of \emph{classical control theory} in the '30s. + + +\textbf{Classical control} methods were developed starting from 1930 based on tools such as the Laplace and Fourier transforms. +It was then natural to study systems in the frequency domain using tools such as the Bode and Nyquist plots. +Controllers were manually tuned to optimize criteria such as control bandwidth, gain and phase margins. + + +The '60s saw the development of control techniques based on a state-space. +Linear algebra and matrices were used instead of the frequency domain tool of the class control theory. +This allows multi-inputs multi-outputs systems to be easily treated. +Kalman introduced the well known \emph{Kalman estimator} as well the notion of optimality by minimizing quadratic cost functions. +This set of developments is loosely termed \textbf{Modern Control} theory. + + +By the 1980's, modern control theory was shown to have some robustness issues and to lack the intuitive tools that the classical control methods were offering. +This led to a new control theory called \textbf{Robust control} that blends the best features of classical and modern techniques. +This robust control theory is the subject of this document. + + +The three presented control methods are compared in Table \ref{tab:comparison_control_methods}. + +Note that in parallel, there have been numerous other developments, including non-linear control, adaptive control, machine-learning control just to name a few. + + +\begin{table}[htbp] +\caption{\label{tab:comparison_control_methods}Table summurazing the main differences between classical, modern and robust control} +\centering +\begin{tabularx}{\linewidth}{lccc} +\toprule + & \textbf{Classical Control} & \textbf{Modern Control} & \textbf{Robust Control}\\ +\midrule +\textbf{Date} & 1930- & 1960- & 1980-\\ +\midrule +\textbf{Tools} & Transfer Functions & State Space formulation & Systems/Signal Norms\\ + & Nyquist, Bode Plots & Riccati Equations & Closed Loop TF\\ + & Root Locus & Kalman Filters & Closed Loop Shaping\\ + & Phase/Gain margins & & Weighting Functions\\ + & Open Loop Shaping & & Disk margin\\ +\midrule +\textbf{Controllers} & P, PI, PID & Full State Feedback & General Control Conf.\\ + & Leads, Lags & LQG, LQR & \\ +\midrule +\textbf{Advantages} & Study Stability & Automatic Synthesis & Automatic Synthesis\\ + & Simple & MIMO & MIMO\\ + & Natural & Optimization Problem & Optimization Problem\\ + & & & Guaranteed Robustness\\ +\midrule +\textbf{Disadvant.} & Manual Method & No Guaranteed Robustness & Requires knowledge of tools\\ + & Only SISO & Rejection of Pert. & Need good model of the system\\ + & No input usage lim. & & \\ +\bottomrule +\end{tabularx} +\end{table} + +\section{Example System} +\label{sec:orgd6f2ecd} +\label{sec:example_system} + +Throughout this document, multiple examples and practical application of presented control strategies will be provided. +Most of them will be applied on a physical system presented in this section. + +This system is shown in Figure \ref{fig:mech_sys_1dof_inertial_contr}. +It could represent an active suspension stage supporting a payload. +The \emph{inertial} motion of the payload is measured using an inertial sensor and this is feedback to a force actuator. +Such system could be used to actively isolate the payload (disturbance rejection problem) or to make it follow a trajectory (tracking problem). + +The notations used on Figure \ref{fig:mech_sys_1dof_inertial_contr} are listed and described in Table \ref{tab:example_notations}. + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/mech_sys_1dof_inertial_contr.png} +\caption{\label{fig:mech_sys_1dof_inertial_contr}Test System consisting of a payload with a mass \(m\) on top of an active system with a stiffness \(k\), damping \(c\) and an actuator. A feedback controller \(K(s)\) is added to position / isolate the payload.} +\end{figure} + +\begin{table}[htbp] +\caption{\label{tab:example_notations}Example system variables} +\centering +\begin{tabularx}{\linewidth}{cXcc} +\toprule +\textbf{Notation} & \textbf{Description} & \textbf{Value} & \textbf{Unit}\\ +\midrule +\(m\) & Payload's mass to position / isolate & \(10\) & [kg]\\ +\(k\) & Stiffness of the suspension system & \(10^6\) & [N/m]\\ +\(c\) & Damping coefficient of the suspension system & \(400\) & [N/(m/s)]\\ +\(y\) & Payload absolute displacement (measured by an inertial sensor) & & [m]\\ +\(d\) & Ground displacement, it acts as a disturbance & & [m]\\ +\(u\) & Actuator force & & [N]\\ +\(r\) & Wanted position of the mass (the reference) & & [m]\\ +\(\epsilon = r - y\) & Position error & & [m]\\ +\(K\) & Feedback controller & to be designed & [N/m]\\ +\bottomrule +\end{tabularx} +\end{table} + +\begin{exercice} +Derive the following open-loop transfer functions: +\begin{align} + G(s) &= \frac{y}{u} \\ + G_d(s) &= \frac{y}{d} +\end{align} + +\tcbsubtitle{Hint} +You can follow this generic procedure: +\begin{enumerate} +\item List all applied forces ot the mass: Actuator force, Stiffness force (Hooke's law), \ldots{} +\item Apply the Newton's Second Law on the payload +\[ m \ddot{y} = \Sigma F \] +\item Transform the differential equations into the Laplace domain: +\[ \frac{d\ \cdot}{dt} \Leftrightarrow \cdot \times s \] +\item Write \(y(s)\) as a function of \(u(s)\) and \(w(s)\) +\end{enumerate} +\tcbsubtitle{Results} +\begin{align} + G(s) &= \frac{1}{m s^2 + cs + k} \\ + G_d(s) &= \frac{cs + k}{m s^2 + cs + k} +\end{align} +\end{exercice} + +Having obtained \(G(s)\) and \(G_d(s)\), we can transform the system shown in Figure \ref{fig:mech_sys_1dof_inertial_contr} into a classical feedback architecture as shown in Figure \ref{fig:open_loop_shaping}. + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/classical_feedback_test_system.png} +\caption{\label{fig:classical_feedback_test_system}Block diagram corresponding to the example system of Figure \ref{fig:mech_sys_1dof_inertial_contr}} +\end{figure} + + +Let's define the system parameters on Matlab. +\begin{minted}[linenos,firstnumber=1]{matlab} +k = 1e6; % Stiffness [N/m] +c = 4e2; % Damping [N/(m/s)] +m = 10; % Mass [kg] +\end{minted} + +And now the system dynamics \(G(s)\) and \(G_d(s)\). +\begin{minted}[linenos,firstnumber=4]{matlab} +G = 1/(m*s^2 + c*s + k); % Plant +Gd = (c*s + k)/(m*s^2 + c*s + k); % Disturbance +\end{minted} + +The Bode plots of \(G(s)\) and \(G_d(s)\) are shown in Figures \ref{fig:bode_plot_example_afm} and \ref{fig:bode_plot_example_Gd}. + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/bode_plot_example_afm.png} +\caption{\label{fig:bode_plot_example_afm}Bode plot of the plant \(G(s)\)} +\end{figure} + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/bode_plot_example_Gd.png} +\caption{\label{fig:bode_plot_example_Gd}Magnitude of the disturbance transfer function \(G_d(s)\)} +\end{figure} + +\chapter{Classical Open Loop Shaping} +\label{sec:org88c26ac} +\label{sec:open_loop_shaping} +After an introduction to classical Loop Shaping in Section \ref{sec:open_loop_shaping_introduction}, a practical example is given in Section \ref{sec:loop_shaping_example}. +Such Loop Shaping is usually performed manually with tools coming from the classical control theory. + +However, the \(\mathcal{H}_\infty\) synthesis can be used to automate the Loop Shaping process. +This is presented in Section \ref{sec:h_infinity_open_loop_shaping} and applied on the same example in Section \ref{sec:h_infinity_open_loop_shaping_example}. + +\section{Introduction to Loop Shaping} +\label{sec:orge3291a7} +\label{sec:open_loop_shaping_introduction} + +\begin{definition} +\textbf{Loop Shaping} refers to a control design procedure that involves explicitly shaping the magnitude of the \textbf{Loop Transfer Function} \(L(s)\). +\end{definition} + +\begin{definition} +The \textbf{Loop Gain} (or Loop transfer function) \(L(s)\) usually refers to as the product of the controller and the plant (see Figure \ref{fig:open_loop_shaping}): +\begin{equation} + L(s) = G(s) \cdot K(s) \label{eq:loop_gain} +\end{equation} + +Its name comes from the fact that this is actually the ``gain around the loop''. + +\begin{center} +\includegraphics[scale=1]{figs/open_loop_shaping.png} +\captionof{figure}{\label{fig:open_loop_shaping}Classical Feedback Architecture} +\end{center} +\end{definition} + +This synthesis method is one of main way controllers are design in the classical control theory. +It is widely used and generally successful as many characteristics of the closed-loop system depend on the shape of the open loop gain \(L(s)\) such as: +\begin{itemize} +\item \textbf{Good Tracking}: \(L\) large +\item \textbf{Good disturbance rejection}: \(L\) large +\item \textbf{Attenuation of measurement noise on plant output}: \(L\) small +\item \textbf{Small magnitude of input signal}: \(L\) small +\item \textbf{Nominal stability}: \(L\) small (RHP zeros and time delays) +\item \textbf{Robust stability}: \(L\) small (neglected dynamics) +\end{itemize} + +The shaping of the Loop Gain is done manually by combining several leads, lags, notches\ldots{} +This process is very much simplified by the fact that the loop gain \(L(s)\) depends \textbf{linearly} on \(K(s)\) \eqref{eq:loop_gain}. +A typical wanted Loop Shape is shown in Figure \ref{fig:open_loop_shaping_shape}. +Another interesting Loop shape called ``Bode Step'' is described in \cite{lurie02_system_archit_trades_using_bode}. + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/open_loop_shaping_shape.png} +\caption{\label{fig:open_loop_shaping_shape}Typical Wanted Shape for the Loop Gain \(L(s)\)} +\end{figure} + +The shaping of \textbf{closed-loop} transfer functions is obviously not as simple as they don't depend linearly on \(K(s)\). +But this is were the \(\mathcal{H}_\infty\) Synthesis will be useful! +More details on that in Sections \ref{sec:modern_interpretation_specification} and \ref{sec:closed-loop-shaping}. + +\section{Example of Manual Open Loop Shaping} +\label{sec:org06d32ed} +\label{sec:loop_shaping_example} + +\begin{exampl} +Let's take our example system described in Section \ref{sec:example_system} and design a controller using the Open-Loop shaping synthesis approach. +The specifications are: +\begin{enumerate} +\item \textbf{Disturbance rejection}: Highest possible rejection below 1Hz +\item \textbf{Positioning speed}: Bandwidth of approximately 10Hz +\item \textbf{Noise attenuation}: Roll-off of -40dB/decade past 30Hz +\item \textbf{Robustness}: Gain margin > 3dB and Phase margin > 30 deg +\end{enumerate} +\end{exampl} + +\begin{exercice} +Using \texttt{SISOTOOL}, design a controller that fulfills the specifications. + +\begin{minted}[]{matlab} +sisotool(G) +\end{minted} + +\tcbsubtitle{Hint} +You can follow this procedure: +\begin{enumerate} +\item In order to have good disturbance rejection at low frequency, add a simple or double \textbf{integrator} +\item In terms of the loop gain, the \textbf{bandwidth} can be defined at the frequency \(\omega_c\) where \(|l(j\omega_c)|\) first crosses 1 from above. +Therefore, adjust the \textbf{gain} such that \(L(j\omega)\) crosses 1 at around 10Hz +\item The roll-off at high frequency for noise attenuation should already be good enough. +If not, add a \textbf{low pass filter} +\item Add a \textbf{Lead} centered around the crossover frequency (10 Hz) and tune it such that sufficient phase margin is added. +Verify that the gain margin is good enough. +\end{enumerate} +\end{exercice} + +Let's say we came up with the following controller. +\begin{minted}[]{matlab} +K = 14e8 * ... % Gain + 1/(s^2) * ... % Double Integrator + 1/(1 + s/2/pi/40) * ... % Low Pass Filter + (1 + s/(2*pi*10/sqrt(8)))/(1 + s/(2*pi*10*sqrt(8))); % Lead +\end{minted} + +The bode plot of the Loop Gain is shown in Figure \ref{fig:loop_gain_manual_afm} and we can verify that we have the wanted stability margins using the \texttt{margin} command: +\begin{minted}[]{matlab} +[Gm, Pm, ~, Wc] = margin(G*K) +\end{minted} + +\begin{center} +\begin{tabular}{lr} +Requirements & Manual Method\\ +\hline +Gain Margin \(> 3\) [dB] & 3.1\\ +Phase Margin \(> 30\) [deg] & 35.4\\ +Crossover \(\approx 10\) [Hz] & 10.1\\ +\end{tabular} +\end{center} + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/loop_gain_manual_afm.png} +\caption{\label{fig:loop_gain_manual_afm}Bode Plot of the obtained Loop Gain \(L(s) = G(s) K(s)\)} +\end{figure} + +\section{\(\mathcal{H}_\infty\) Loop Shaping Synthesis} +\label{sec:org2bb176d} +\label{sec:h_infinity_open_loop_shaping} + +The synthesis of controllers based on the Loop Shaping method can be automated using the \(\mathcal{H}_\infty\) Synthesis. + +Using Matlab, it can be easily performed using the \texttt{loopsyn} command: +\begin{minted}[]{matlab} +K = loopsyn(G, Lw); +\end{minted} +where: +\begin{itemize} +\item \texttt{G} is the (LTI) plant +\item \texttt{Lw} is the wanted loop shape +\item \texttt{K} is the synthesize controller +\end{itemize} + +\begin{seealso} +Matlab documentation of \texttt{loopsyn} (\href{https://www.mathworks.com/help/robust/ref/loopsyn.html}{link}). +\end{seealso} + +Therefore, by just providing the wanted loop shape and the plant model, the \(\mathcal{H}_\infty\) Loop Shaping synthesis generates a \emph{stabilizing} controller such that the obtained loop gain \(L(s)\) matches the specified one with an accuracy \(\gamma\). + +Even though we will not go into details and explain how such synthesis is working, an example is provided in the next section. + +\section{Example of the \(\mathcal{H}_\infty\) Loop Shaping Synthesis} +\label{sec:org4ea69be} +\label{sec:h_infinity_open_loop_shaping_example} + +To apply the \(\mathcal{H}_\infty\) Loop Shaping Synthesis, the wanted shape of the loop gain should be determined from the specifications. +This is summarized in Table \ref{tab:open_loop_shaping_specifications}. + +Such shape corresponds to the typical wanted Loop gain Shape shown in Figure \ref{fig:open_loop_shaping_shape}. + +\begin{table}[htbp] +\caption{\label{tab:open_loop_shaping_specifications}Wanted Loop Shape corresponding to each specification} +\centering +\begin{tabularx}{\linewidth}{lXX} +\toprule + & \textbf{Specification} & \textbf{Corresponding Loop Shape}\\ +\midrule +\textbf{Dist. Rej.} & Highest possible rejection below 1Hz & Slope of -40dB/dec at low frequency\\ +\textbf{Pos. Speed} & Bandwidth of approximately 10Hz & \(L\) crosses 1 at 10Hz\\ +\textbf{Noise Att.} & Roll-off of -40dB/decade past 30Hz & Roll-off of -40dB/decade past 30Hz\\ +\textbf{Robustness} & \(\Delta G > 3dB\), \(\Delta \phi > 30^o\) & Slope of -20dB/decade near the crossover\\ +\bottomrule +\end{tabularx} +\end{table} + +Then, a (stable, minimum phase) transfer function \(L_w(s)\) should be created that has the same gain as the wanted shape of the Loop gain. +For this example, a double integrator and a lead centered on 10Hz are used. +Then the gain is adjusted such that the \(|L_w(j2 \pi 10)| = 1\). + +Using Matlab, we have: +\begin{minted}[]{matlab} +Lw = 2.3e3 * ... + 1/(s^2) * ... % Double Integrator + (1 + s/(2*pi*10/sqrt(3)))/(1 + s/(2*pi*10*sqrt(3))); % Lead +\end{minted} + +The \(\mathcal{H}_\infty\) open loop shaping synthesis is then performed using the \texttt{loopsyn} command: +\begin{minted}[]{matlab} +[K, ~, GAM] = loopsyn(G, Lw); +\end{minted} + +The obtained Loop Gain is shown in Figure \ref{fig:open_loop_shaping_hinf_L} and matches the specified one by a factor \(\gamma \approx 2\). + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/open_loop_shaping_hinf_L.png} +\caption{\label{fig:open_loop_shaping_hinf_L}Obtained Open Loop Gain \(L(s) = G(s) K(s)\) and comparison with the wanted Loop gain \(L_w\)} +\end{figure} + + +\begin{important} +When using the \(\mathcal{H}_\infty\) Synthesis, it is usually recommended to analyze the obtained controller. + +This is usually done by breaking down the controller into simple elements such as low pass filters, high pass filters, notches, leads, etc. +\end{important} + +Let's briefly analyze the obtained controller which bode plot is shown in Figure \ref{fig:open_loop_shaping_hinf_K}: +\begin{itemize} +\item two integrators are used at low frequency to have the wanted low frequency high gain +\item a lead is added centered with the crossover frequency to increase the phase margin +\item a notch is added at the resonance of the plant to increase the gain margin (this is very typical of \(\mathcal{H}_\infty\) controllers, and can be an issue, more info on that latter) +\end{itemize} + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/open_loop_shaping_hinf_K.png} +\caption{\label{fig:open_loop_shaping_hinf_K}Obtained controller \(K\) using the open-loop \(\mathcal{H}_\infty\) shaping} +\end{figure} + + +Let's finally compare the obtained stability margins of the \(\mathcal{H}_\infty\) controller and of the manually developed controller in Table \ref{tab:open_loop_shaping_compare}. + +\begin{table}[htbp] +\caption{\label{tab:open_loop_shaping_compare}Comparison of the characteristics obtained with the two methods} +\centering +\begin{tabularx}{\linewidth}{Xcc} +\toprule +\textbf{Specifications} & \textbf{Manual Method} & \textbf{\(\mathcal{H}_\infty\) Method}\\ +\midrule +Gain Margin \(> 3\) [dB] & 3.1 & 31.7\\ +Phase Margin \(> 30\) [deg] & 35.4 & 54.7\\ +Crossover \(\approx 10\) [Hz] & 10.1 & 9.9\\ +\bottomrule +\end{tabularx} +\end{table} + +\chapter{A first Step into the \(\mathcal{H}_\infty\) world} +\label{sec:org9957ebe} +\label{sec:h_infinity_introduction} +In this section, the \(\mathcal{H}_\infty\) Synthesis method, which is based on the optimization of the \(\mathcal{H}_\infty\) norm of transfer functions, is introduced. + +After the \(\mathcal{H}_\infty\) norm is defined in Section \ref{sec:h_infinity_norm}, the \(\mathcal{H}_\infty\) synthesis procedure is described in Section \ref{sec:h_infinity_synthesis} . + +The generalized plant, a very useful tool to describe a control problem, is presented in Section \ref{sec:generalized_plant}. +The \(\mathcal{H}_\infty\) is then applied to this generalized plant in Section \ref{sec:h_infinity_general_synthesis}. + +Finally, an example showing how to convert a typical feedback control architecture into a generalized plant is given in Section \ref{sec:generalized_plant_derivation}. + +\section{The \(\mathcal{H}_\infty\) Norm} +\label{sec:org4d1191c} +\label{sec:h_infinity_norm} + +\begin{definition} +The \(\mathcal{H}_\infty\) norm of a multi-input multi-output system \(G(s)\) is defined as the peak of the maximum singular value of its frequency response +\begin{equation} + \|G(s)\|_\infty = \max_\omega \bar{\sigma}\big( G(j\omega) \big) +\end{equation} + +For a single-input single-output system \(G(s)\), it is simply the peak value of \(|G(j\omega)|\) as a function of frequency: +\begin{equation} + \|G(s)\|_\infty = \max_{\omega} |G(j\omega)| \label{eq:hinf_norm_siso} +\end{equation} +\end{definition} + +\begin{exampl} +Let's compute the \(\mathcal{H}_\infty\) norm of our test plant \(G(s)\) using the \texttt{hinfnorm} function: +\begin{minted}[]{matlab} +hinfnorm(G) +\end{minted} + +\begin{verbatim} +7.9216e-06 +\end{verbatim} + + +We can see in Figure \ref{fig:hinfinity_norm_siso_bode} that indeed, the \(\mathcal{H}_\infty\) norm of \(G(s)\) does corresponds to the peak value of \(|G(j\omega)|\). + +\begin{center} +\includegraphics[scale=1]{figs/hinfinity_norm_siso_bode.png} +\captionof{figure}{\label{fig:hinfinity_norm_siso_bode}Example of the \(\mathcal{H}_\infty\) norm of a SISO system} +\end{center} +\end{exampl} + +\section{\(\mathcal{H}_\infty\) Synthesis} +\label{sec:org25f160e} +\label{sec:h_infinity_synthesis} + +\begin{definition} +The \(\mathcal{H}_\infty\) synthesis is a method that uses an \textbf{algorithm} (LMI optimization, Riccati equation) to find a controller that stabilizes the system and that \textbf{minimizes} the \(\mathcal{H}_\infty\) norms of defined transfer functions. +\end{definition} + +Why optimizing the \(\mathcal{H}_\infty\) norm of transfer functions is a pertinent choice will become clear when we will translate the typical control specifications into the \(\mathcal{H}_\infty\) norm of transfer functions in Section \ref{sec:modern_interpretation_specification}. + +\begin{important} +Then applying the \(\mathcal{H}_\infty\) synthesis to a plant, the engineer work usually consists of the following steps: +\begin{enumerate} +\item Write the problem as standard \(\mathcal{H}_\infty\) problem using the generalized plant (described in the next section) +\item Translate the specifications as \(\mathcal{H}_\infty\) norms of transfer functions (Section \ref{sec:modern_interpretation_specification}) +\item Make the synthesis and analyze the obtained controller +\end{enumerate} + +As the \(\mathcal{H}_\infty\) synthesis usually gives very high order controllers, an additional step that reduces the controller order is sometimes required for practical implementation. +\end{important} + +Note that there are many ways to use the \(\mathcal{H}_\infty\) Synthesis: +\begin{itemize} +\item Traditional \(\mathcal{H}_\infty\) Synthesis (\texttt{hinfsyn} \href{https://www.mathworks.com/help/robust/ref/hinfsyn.html}{doc}) +\item Open Loop Shaping \(\mathcal{H}_\infty\) Synthesis (\texttt{loopsyn} \href{https://www.mathworks.com/help/robust/ref/loopsyn.html}{doc}) +\item Mixed Sensitivity Loop Shaping (\texttt{mixsyn} \href{https://www.mathworks.com/help/robust/ref/lti.mixsyn.html}{doc}) +\item Fixed-Structure \(\mathcal{H}_\infty\) Synthesis (\texttt{hinfstruct} \href{https://www.mathworks.com/help/robust/ref/lti.hinfstruct.html}{doc}) +\item Signal Based \(\mathcal{H}_\infty\) Synthesis, and many more\ldots{} +\end{itemize} + +\section{The Generalized Plant} +\label{sec:org1d5b54d} +\label{sec:generalized_plant} + +The first step when applying the \(\mathcal{H}_\infty\) synthesis is usually to write the problem as a standard \(\mathcal{H}_\infty\) problem. +This consist of deriving the \textbf{Generalized Plant} for the current problem. + +The generalized plant, usually noted \(P(s)\), is shown in Figure \ref{fig:general_plant}. +It has two \emph{sets} of inputs \([w,\,u]\) and two \emph{sets} of outputs \([z\,v]\) such that: +\begin{equation} + \begin{bmatrix} z \\ v \end{bmatrix} = P \begin{bmatrix} w \\ u \end{bmatrix} +\end{equation} + +The meaning of these inputs and outputs are summarized in Table \ref{tab:notation_general}. + +A practical example about how to derive the generalized plant for a classical control problem is given in Section \ref{sec:generalized_plant_derivation}. + +\begin{important} +\begin{center} +\includegraphics[scale=1]{figs/general_plant.png} +\captionof{figure}{\label{fig:general_plant}Inputs and Outputs of the generalized Plant} +\end{center} + +\begin{center} +\captionof{table}{\label{tab:notation_general}Notations for the general configuration} +\begin{tabularx}{0.8\linewidth}{cX} +\toprule +\textbf{Notation} & \textbf{Meaning}\\ +\midrule +\(P\) & Generalized plant model\\ +\(w\) & Exogenous inputs: references, disturbances, noises\\ +\(z\) & Exogenous outputs: signals to be minimized\\ +\(v\) & Controller inputs: measurements\\ +\(u\) & Control signals\\ +\bottomrule +\end{tabularx} +\end{center} +\end{important} + +\section{The \(\mathcal{H}_\infty\) Synthesis applied on the Generalized plant} +\label{sec:orgd38e75b} +\label{sec:h_infinity_general_synthesis} + +Once the generalized plant is obtained, the \(\mathcal{H}_\infty\) synthesis problem can be stated as follows: + +\begin{important} +\begin{description} +\item[{\(\mathcal{H}_\infty\) Synthesis applied on the generalized plant}] +\end{description} +Find a stabilizing controller \(K\) that, using the sensed outputs \(v\), generates control signals \(u\) such that the \(\mathcal{H}_\infty\) norm of the closed-loop transfer function from \(w\) to \(z\) is minimized. + +After \(K\) is found, the system is \emph{robustified} by adjusting the response around the unity gain frequency to increase stability margins. + +The obtained controller \(K\) and the generalized plant are connected as shown in Figure \ref{fig:general_control_names}. + +\begin{center} +\includegraphics[scale=1]{figs/general_control_names.png} +\captionof{figure}{\label{fig:general_control_names}General Control Configuration} +\end{center} +\end{important} + +Using Matlab, the \(\mathcal{H}_\infty\) Synthesis applied on a Generalized plant can be applied using the \texttt{hinfsyn} command (\href{https://www.mathworks.com/help/robust/ref/hinfsyn.html}{documentation}): +\begin{minted}[]{matlab} +K = hinfsyn(P, nmeas, ncont); +\end{minted} +where: +\begin{itemize} +\item \texttt{P} is the generalized plant transfer function matrix +\item \texttt{nmeas} is the number of sensed output (size of \(v\)) +\item \texttt{ncont} is the number of control signals (size of \(u\)) +\item \texttt{K} obtained controller (of size \texttt{ncont x nmeas}) that minimizes the \(\mathcal{H}_\infty\) norm from \(w\) to \(z\). +\end{itemize} + +Note that the general control configure of Figure \ref{fig:general_control_names}, as its name implies, is quite \emph{general} and can represent feedback control as well as feedforward control architectures. + +\section{From a Classical Feedback Architecture to a Generalized Plant} +\label{sec:orgd8a0711} +\label{sec:generalized_plant_derivation} + +The procedure to convert a typical control architecture as the one shown in Figure \ref{fig:classical_feedback_tracking} to a generalized Plant is as follows: +\begin{enumerate} +\item Define signals of the generalized plant: \(w\), \(z\), \(u\) and \(v\) +\item Remove \(K\) and rearrange the inputs and outputs to match the generalized configuration shown in Figure \ref{fig:general_plant} +\end{enumerate} + +\begin{exercice} +Consider the feedback control architecture shown in Figure \ref{fig:classical_feedback_tracking}. +Suppose we want to design \(K\) using the general \(\mathcal{H}_\infty\) synthesis, and suppose the signals to be minimized are the control input \(u\) and the tracking error \(\epsilon\). +\begin{enumerate} +\item Convert the control architecture to a generalized configuration +\item Compute the transfer function matrix of the generalized plant \(P\) using Matlab as a function or \(K\) and \(G\) +\end{enumerate} + +\begin{center} +\includegraphics[scale=1]{figs/classical_feedback_tracking.png} +\captionof{figure}{\label{fig:classical_feedback_tracking}Classical Feedback Control Architecture (Tracking)} +\end{center} + +\tcbsubtitle{Hint} +First, define the signals of the generalized plant: +\begin{itemize} +\item Exogenous inputs: \(w = r\) +\item Signals to be minimized: +Usually, we want to minimize the tracking errors \(\epsilon\) and the control signal \(u\): \(z = [\epsilon,\ u]\) +\item Controller inputs: this is the signal at the input of the controller: \(v = \epsilon\) +\item Controller outputs: signal generated by the controller: \(u\) +\end{itemize} + +Then, Remove \(K\) and rearrange the inputs and outputs as in Figure \ref{fig:general_plant}. +\tcbsubtitle{Anwser} +The obtained generalized plant shown in Figure \ref{fig:mixed_sensitivity_ref_tracking}. + +\begin{center} +\includegraphics[scale=1]{figs/mixed_sensitivity_ref_tracking.png} +\captionof{figure}{\label{fig:mixed_sensitivity_ref_tracking}Generalized plant of the Classical Feedback Control Architecture (Tracking)} +\end{center} + +Using Matlab, the generalized plant can be defined as follows: +\begin{minted}[]{matlab} +P = [1 -G; + 0 1; + 1 -G] +P.InputName = {'w', 'u'}; +P.OutputName = {'e', 'u', 'v'}; +\end{minted} +\end{exercice} + +\chapter{Modern Interpretation of Control Specifications} +\label{sec:orgcd910fe} +\label{sec:modern_interpretation_specification} +As shown in Section \ref{sec:open_loop_shaping}, the loop gain \(L(s) = G(s) K(s)\) is a useful and easy tool when manually designing controllers. +This is mainly due to the fact that \(L(s)\) is very easy to shape as it depends \emph{linearly} on \(K(s)\). +Moreover, important quantities such as the stability margins and the control bandwidth can be estimated from the shape/phase of \(L(s)\). + +However, the loop gain \(L(s)\) does \textbf{not} directly give the performances of the closed-loop system. +As a matter of fact, the behavior of the closed-loop system by the \textbf{closed-loop} transfer functions. +These are derived of a typical feedback architecture functions in Section \ref{sec:closed_loop_tf}. + + +The modern interpretation of control specifications then consists of determining the \textbf{required shape of the closed-loop transfer functions} such that the system behavior corresponds to the requirements. +Once this is done, the \(\mathcal{H}_\infty\) synthesis can be used to generate a controller that will \textbf{shape} the closed-loop transfer function as specified.. +This method is presented in Section \ref{sec:closed-loop-shaping}. + + +One of the most important closed-loop transfer function is called the \textbf{sensitivity function}. +Its link with the closed-loop behavior of the feedback system is studied in Section \ref{sec:sensitivity_transfer_functions}. + +The robustness (stability margins) of the system can also be linked to the shape of the sensitivity function with the use of the \textbf{module margin} (Section \ref{sec:module_margin}). + +Links between typical control specifications and shapes of the closed-loop transfer functions are summarized in Section \ref{sec:other_requirements}. + +\section{Closed Loop Transfer Functions and the Gang of Four} +\label{sec:org6d77210} +\label{sec:closed_loop_tf} + +Consider the typical feedback system shown in Figure \ref{fig:gang_of_four_feedback}. + +The behavior (performances) of this feedback system is determined by the closed-loop transfer functions from the inputs (\(r\), \(d\) and \(n\)) to the important signals such as \(\epsilon\), \(u\) and \(y\). + +Depending on the specification, different closed-loop transfer functions do matter. +These are summarized in Table \ref{tab:spec_closed_loop_tf}. + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/gang_of_four_feedback.png} +\caption{\label{fig:gang_of_four_feedback}Simple Feedback Architecture with \(r\) the reference signal, \(\epsilon\) the tracking error, \(d\) a disturbance acting at the plant input \(u\), \(y\) is the output signal and \(n\) the measurement noise} +\end{figure} + +\begin{table}[htbp] +\caption{\label{tab:spec_closed_loop_tf}Typical Specification and associated closed-loop transfer function} +\centering +\begin{tabularx}{0.8\linewidth}{Xl} +\toprule +\textbf{Specification} & \textbf{CL Transfer Function}\\ +\midrule +Reference Tracking & From \(r\) to \(\epsilon\)\\ +Disturbance Rejection & From \(d\) to \(y\)\\ +Measurement Noise Filtering & From \(n\) to \(y\)\\ +Small Command Amplitude & From \(n,r,d\) to \(u\)\\ +Stability & All\\ +Robustness (stability margins) & Module margin (see Section \ref{sec:module_margin})\\ +\bottomrule +\end{tabularx} +\end{table} + +\begin{exercice} +For the feedback system in Figure \ref{fig:gang_of_four_feedback}, write the output signals \([\epsilon, u, y]\) as a function of the systems \(K(s), G(s)\) and the input signals \([r, d, n]\). + +\tcbsubtitle{Hint} +Take one of the output (e.g. \(y\)), and write it as a function of the inputs \([d, r, n]\) going step by step around the loop: +\begin{align*} + y &= G u \\ + &= G (d + K \epsilon) \\ + &= G \big(d + K (r - n - y) \big) \\ + &= G d + GK r - GK n - GK y +\end{align*} + +Isolate \(y\) at the right hand side, and finally obtain: +\[ y = \frac{GK}{1+ GK} r + \frac{G}{1 + GK} d - \frac{GK}{1 + GK} n \] + +Do the same procedure for \(u\) and \(\epsilon\) +\tcbsubtitle{Answer} +The following equations should be obtained: +\begin{align} + y &= \frac{GK}{1 + GK} r + \frac{G}{1 + GK} d - \frac{GK}{1 + GK} n \\ + \epsilon &= \frac{1 }{1 + GK} r - \frac{G}{1 + GK} d - \frac{G }{1 + GK} n \\ + u &= \frac{K }{1 + GK} r - \frac{1}{1 + GK} d - \frac{K }{1 + GK} n +\end{align} +\end{exercice} + +\begin{important} +We can see that they are 4 different closed-loop transfer functions describing the behavior of the feedback system in Figure \ref{fig:gang_of_four_feedback}. +These called the \textbf{Gang of Four}: +\begin{align} + S &= \frac{1 }{1 + GK}, \quad \text{the sensitivity function} \\ + T &= \frac{GK}{1 + GK}, \quad \text{the complementary sensitivity function} \\ + GS &= \frac{G }{1 + GK}, \quad \text{the load disturbance sensitivity function} \\ + KS &= \frac{K }{1 + GK}, \quad \text{the noise sensitivity function} +\end{align} +\end{important} + +\begin{seealso} +If a feedforward controller is included, a \textbf{Gang of Six} transfer functions can be defined. +More on that in this \href{https://www.youtube.com/watch?v=b\_8v8scghh8}{short video}. +\end{seealso} + +The behavior of the feedback system in Figure \ref{fig:gang_of_four_feedback} is fully described by the following set of equations: +\begin{align} + \epsilon &= S r - GS d - GS n \\ + y &= T r + GS d - T n \\ + u &= KS r - S d - KS n +\end{align} + +Thus, for reference tracking, we have to shape the \emph{closed-loop} transfer function from \(r\) to \(\epsilon\), that is the sensitivity function \(S(s)\). +Similarly, to reduce the effect of measurement noise \(n\) on the output \(y\), we have to act on the complementary sensitivity function \(T(s)\). + +\section{The Sensitivity Function} +\label{sec:org2c7250a} +\label{sec:sensitivity_transfer_functions} + +The sensitivity function is indisputably the most important closed-loop transfer function of a feedback system. +In this section, we will see how the shape of the sensitivity function will impact the performances of the closed-loop system. + + +Suppose we have developed a ``\emph{reference}'' controller \(K_r(s)\) and made three small changes to obtained three controllers \(K_1(s)\), \(K_2(s)\) and \(K_3(s)\). +The obtained sensitivity functions for these four controllers are shown in Figure \ref{fig:sensitivity_shape_effect} and the corresponding step responses are shown in Figure \ref{fig:sensitivity_shape_effect_step}. + +The comparison of the sensitivity functions shapes and their effect on the step response is summarized in Table \ref{tab:compare_sensitivity_shapes}. + +\begin{table}[htbp] +\caption{\label{tab:compare_sensitivity_shapes}Comparison of the sensitivity function shape and the corresponding step response for the three controller variations} +\centering +\begin{tabularx}{0.9\linewidth}{lXX} +\toprule +\textbf{Controller} & \textbf{Sensitivity Function Shape} & \textbf{Change of the Step Response}\\ +\midrule +\(K_1(s)\) & Larger bandwidth \(\omega_b\) & Faster rise time\\ +\(K_2(s)\) & Larger peak value \(\Vert S\Vert_\infty\) & Large overshoot and oscillations\\ +\(K_3(s)\) & Larger low frequency gain \(\vert S(j\cdot 0)\vert\) & Larger static error\\ +\bottomrule +\end{tabularx} +\end{table} + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/sensitivity_shape_effect.png} +\caption{\label{fig:sensitivity_shape_effect}Sensitivity function magnitude \(|S(j\omega)|\) corresponding to the reference controller \(K_r(s)\) and the three modified controllers \(K_i(s)\)} +\end{figure} + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/sensitivity_shape_effect_step.png} +\caption{\label{fig:sensitivity_shape_effect_step}Step response (response from \(r\) to \(y\)) for the different controllers} +\end{figure} + +\begin{definition} +\begin{description} +\item[{Closed-Loop Bandwidth}] The closed-loop bandwidth \(\omega_b\) is the frequency where \(|S(j\omega)|\) first crosses \(1/\sqrt{2} = -3dB\) from below. + +In general, a large bandwidth corresponds to a faster rise time. +\end{description} +\end{definition} + +\begin{important} +From the simple analysis above, we can draw a first estimation of the wanted shape for the sensitivity function (Figure \ref{fig:h-infinity-spec-S}): +\begin{itemize} +\item A small magnitude at low frequency to make the static errors small +\item A wanted minimum closed-loop bandwidth in order to have fast rise time and good rejection of perturbations +\item A small peak value (small \(\mathcal{H}_\infty\) norm) in order to limit large overshoot and oscillations. +This generally means higher robustness. +This will become clear in the next section about the \textbf{module margin}. +\end{itemize} + +\begin{center} +\includegraphics[scale=1]{figs/h-infinity-spec-S.png} +\captionof{figure}{\label{fig:h-infinity-spec-S}Typical wanted shape of the Sensitivity transfer function} +\end{center} +\end{important} + +\section{Robustness: Module Margin} +\label{sec:org30ae1f0} +\label{sec:module_margin} + +Let's start this section by an example demonstrating why the phase and gain margins might not be good indicators of robustness. +Will follow a discussion about the module margin, a robustness indicator that can be linked to the \(\mathcal{H}_\infty\) norm of \(S\) and that will prove to be very useful. + +\begin{exampl} +Consider the following plant \(G_t(s)\): +\begin{minted}[]{matlab} +w0 = 2*pi*100; +xi = 0.1; +k = 1e7; + +Gt = 1/k*(s/w0/4 + 1)/(s^2/w0^2 + 2*xi*s/w0 + 1); +\end{minted} + +Let's say we have designed a controller \(K_t(s)\) that gives the loop gain shown in Figure \ref{fig:phase_gain_margin_model_plant}. + +\begin{minted}[]{matlab} +Kt = 1.2e6*(s + w0)/s; +\end{minted} + +The following characteristics can be determined from the Loop gain in Figure \ref{fig:phase_gain_margin_model_plant}: +\begin{itemize} +\item Control bandwidth of \(\approx 10\, \text{Hz}\) +\item Infinite gain margin (the phase of the loop-gain never reaches \(-180^o\)) +\item More than \(90^o\) of phase margin +\end{itemize} + +This clearly indicate very good robustness of the closed-loop system! +Or does it? Let's find out. + +\begin{center} +\includegraphics[scale=1]{figs/phase_gain_margin_model_plant.png} +\captionof{figure}{\label{fig:phase_gain_margin_model_plant}Bode plot of the obtained Loop Gain \(L(s)\)} +\end{center} + +Now let's suppose the controller is implemented in practice, and the ``real'' plant \(G_r(s)\) as a slightly lower damping factor than the one estimated for the model: +\begin{minted}[]{matlab} +xi = 0.03; +\end{minted} + +The obtained ``real'' loop gain is shown in Figure \ref{fig:phase_gain_margin_real_plant}. +At a frequency little bit above 100Hz, the phase of the loop gain reaches -180 degrees while its magnitude is more than one which indicates instability. + +It is confirmed by checking the stability of the closed loop system: +\begin{minted}[]{matlab} +isstable(feedback(Gr,K)) +\end{minted} + +\begin{verbatim} +0 +\end{verbatim} + + +\begin{center} +\includegraphics[scale=1]{figs/phase_gain_margin_real_plant.png} +\captionof{figure}{\label{fig:phase_gain_margin_real_plant}Bode plots of \(L(s)\) (loop gain corresponding the nominal plant) and \(L_r(s)\) (loop gain corresponding to the real plant)} +\end{center} + +Therefore, even a small change of the plant parameter renders the system unstable even though both the gain margin and the phase margin for the nominal plant are excellent. + +This is due to the fact that the gain and phase margin are robustness indicators corresponding a \textbf{pure} change or gain or a \textbf{pure} change of phase but not a combination of both. +\end{exampl} + +Let's now determine a new robustness indicator based on the Nyquist Stability Criteria. + +\begin{definition} +\begin{description} +\item[{Nyquist Stability Criteria (for stable systems)}] If the open-loop transfer function \(L(s)\) is stable, then the closed-loop system will be unstable for any encirclement of the point \(-1\) on the Nyquist plot. + +\item[{Nyquist Plot}] The Nyquist plot shows the evolution of \(L(j\omega)\) in the complex plane from \(\omega = 0 \to \infty\). +\end{description} +\end{definition} + +\begin{seealso} +For more information about the \emph{general} Nyquist Stability Criteria, you may want to look at \href{https://www.youtube.com/watch?v=sof3meN96MA}{this} video. +\end{seealso} + +From the Nyquist stability criteria, it is clear that we want \(L(j\omega)\) to be as far as possible from the \(-1\) point (called the \emph{unstable point}) in the complex plane. +This minimum distance is called the \textbf{module margin}. + +\begin{definition} +\begin{description} +\item[{Module Margin}] The Module Margin \(\Delta M\) is defined as the \textbf{minimum distance} between the point \(-1\) and the loop gain \(L(j\omega)\) in the complex plane. +\end{description} +\end{definition} + +\begin{exampl} +A typical Nyquist plot is shown in Figure \ref{fig:module_margin_example}. +The gain, phase and module margins are graphically shown to have an idea of what they represent. + +\begin{center} +\includegraphics[scale=1]{figs/module_margin_example.png} +\captionof{figure}{\label{fig:module_margin_example}Nyquist plot with visual indication of the Gain margin \(\Delta G\), Phase margin \(\Delta \phi\) and Module margin \(\Delta M\)} +\end{center} +\end{exampl} + +As expected from Figure \ref{fig:module_margin_example}, there is a close relationship between the module margin and the gain and phase margins. +We can indeed show that for a given value of the module margin \(\Delta M\), we have: +\begin{equation} + \Delta G \ge \frac{1}{1 - \Delta M}; \quad \Delta \phi \ge \Delta M +\end{equation} + +Let's now try to express the Module margin \(\Delta M\) as an \(\mathcal{H}_\infty\) norm of a closed-loop transfer function: +\begin{align*} +\Delta M &= \text{minimum distance between } L(j\omega) \text{ and point } (-1) \\ + &= \min_\omega |L(j\omega) - (-1)| \\ + &= \min_\omega |1 + L(j\omega)| \\ + &= \frac{1}{\max_\omega \frac{1}{|1 + L(j\omega)|}} \\ + &= \frac{1}{\max_\omega \left| \frac{1}{1 + G(j\omega)K(j\omega)}\right|} \\ + &= \frac{1}{\|S\|_\infty} +\end{align*} + +Therefore, for a given \(\mathcal{H}_\infty\) norm of \(S\) (\(\|S\|_\infty = M_S\)), we have: +\begin{equation} + \Delta G \ge \frac{M_S}{M_S - 1}; \quad \Delta \phi \ge \frac{1}{M_S} +\end{equation} + +\begin{important} +The \(\mathcal{H}_\infty\) norm of the sensitivity function \(\|S\|_\infty\) is a measure of the Module margin \(\Delta M\) and therefore an indicator of the system robustness. + +\begin{equation} + \Delta M = \frac{1}{\|S\|_\infty} \label{eq:module_margin_S} +\end{equation} + +The wanted robustness of the closed-loop system can be specified by setting a maximum value on \(\|S\|_\infty\). +\end{important} + +Note that this is why large peak value of \(|S(j\omega)|\) usually indicate robustness problems. +And we now understand why setting an upper bound on the magnitude of \(S\) is generally a good idea. + +\begin{exampl} +Typical, we require \(\|S\|_\infty < 2 (6dB)\) which implies \(\Delta G \ge 2\) and \(\Delta \phi \ge 29^o\) +\end{exampl} + +\begin{seealso} +To learn more about module/disk margin, you can check out \href{https://www.youtube.com/watch?v=XazdN6eZF80}{this} video. +\end{seealso} + +\section{Summary of typical specification and associated wanted shaping} +\label{sec:org3eb7db2} +\label{sec:other_requirements} + +\begin{table}[htbp] +\caption{\label{tab:specification_modern}Typical Specifications and corresponding wanted norms of open and closed loop tansfer functions} +\centering +\begin{tabularx}{0.9\linewidth}{lXX} +\toprule + & \textbf{Open-Loop Shaping} & \textbf{Closed-Loop Shaping}\\ +\midrule +Reference Tracking & \(L\) large & \(S\) small\\ +Disturbance Rejection & \(L\) large & \(GS\) small\\ +Measurement Noise Filtering & \(L\) small & \(T\) small\\ +Small Command Amplitude & \(K\) and \(L\) small & \(KS\) small\\ +Robustness & Phase/Gain margins & Module margin: \(\Vert S\Vert_\infty\) small\\ +\bottomrule +\end{tabularx} +\end{table} + +\chapter{\(\mathcal{H}_\infty\) Shaping of closed-loop transfer functions} +\label{sec:org80e0308} +\label{sec:closed-loop-shaping} +In the previous sections, we have seen that the performances of the system depends on the \textbf{shape} of the closed-loop transfer function. +Therefore, the synthesis problem is to design \(K(s)\) such that closed-loop system is stable and such that the closed-loop transfer functions such as \(S\), \(KS\) and \(T\) are shaped as wanted. +This is clearly not simple as these closed-loop transfer functions does not depend linearly on \(K\). +But don't worry, the \(\mathcal{H}_\infty\) synthesis will do this job for us! + +To do so, \textbf{weighting functions} are included in the generalized plant and the \(\mathcal{H}_\infty\) synthesis applied on the \textbf{weighted} generalized plant. +Such procedure is presented in Section \ref{sec:weighting_functions}. + +Some advice on the design of weighting functions are given in Section \ref{sec:weighting_functions_design}. + +An example of the \(\mathcal{H}_\infty\) shaping of the sensitivity function is studied in Section \ref{sec:sensitivity_shaping_example}. + +Multiple closed-loop transfer functions can be shaped at the same time. +Such synthesis is usually called \textbf{Mixed-sensitivity Loop Shaping} and is one of the most powerful tool of the robust control theory. +Some insight on the use and limitations of such techniques are given in Section \ref{sec:shaping_multiple_tf}. + +\section{How to Shape closed-loop transfer function? Using Weighting Functions!} +\label{sec:orga64410a} +\label{sec:weighting_functions} + +Suppose we apply the \(\mathcal{H}_\infty\) synthesis on the generalized plant \(P(s)\) shown in Figure \ref{fig:loop_shaping_S_without_W}. +It will generate a controller \(K(s)\) such that the \(\mathcal{H}_\infty\) norm of closed-loop transfer function from \(r\) to \(\epsilon\) is minimized which is equal to the sensitivity function \(S\). +Therefore, the synthesis objective is to minimize the \(\mathcal{H}_\infty\) norm of the sensitivity function: \(\|S\|_\infty\). + +However, as the \(\mathcal{H}_\infty\) norm is the maximum peak value of the transfer function's magnitude, this synthesis is quite useless as it will just try to decrease of peak value of \(S\). +Clearly this does not allow to \textbf{shape} the norm of \(S(j\omega)\) over all frequencies nor specify the wanted low frequency gain of \(S\) or bandwidth requirements. + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/loop_shaping_S_without_W.png} +\caption{\label{fig:loop_shaping_S_without_W}Generalized Plant} +\end{figure} + + +\begin{important} +The \emph{trick} is to include a \textbf{weighting function} \(W_S(s)\) in the generalized plant as shown in Figure \ref{fig:loop_shaping_S_with_W}. + +Now, the closed-loop transfer function from \(w\) to \(z\) is equal to \(W_s(s)S(s)\) and applying the \(\mathcal{H}_\infty\) synthesis to the \emph{weighted} generalized plant \(\tilde{P}(s)\) will generate a controller \(K(s)\) such that \(\|W_s(s)S(s)\|_\infty\) is minimized. +\end{important} + +Let's now show how this is equivalent as \textbf{shaping} the sensitivity function: +\begin{align} + & \left\| W_s(s) S(s) \right\|_\infty < 1\nonumber \\ + \Leftrightarrow & \left| W_s(j\omega) S(j\omega) \right| < 1 \quad \forall \omega\nonumber \\ + \Leftrightarrow & \left| S(j\omega) \right| < \frac{1}{\left| W_s(j\omega) \right|} \quad \forall \omega \label{eq:sensitivity_shaping} +\end{align} + +\begin{important} +As shown in Equation \eqref{eq:sensitivity_shaping}, the objective of the \(\mathcal{H}_\infty\) synthesis applied on the \emph{weighted} plant is to make the norm sensitivity function smaller than the inverse of the norm of the weighting function, and that at all frequencies. + +Therefore, the choice of the weighting function \(W_s(s)\) is very important: its inverse magnitude will define the wanted \textbf{upper bound} of the sensitivity function magnitude over all frequencies. +\end{important} + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/loop_shaping_S_with_W.png} +\caption{\label{fig:loop_shaping_S_with_W}Weighted Generalized Plant} +\end{figure} + +\begin{exercice} +Using matlab, compute the weighted generalized plant shown in Figure \ref{fig:first_order_weight} as a function of \(G(s)\) and \(W_S(s)\). + +\tcbsubtitle{Hint} +The weighted generalized plant can be defined in Matlab using two techniques: +\begin{itemize} +\item by writing manually the 4 transfer functions from \([w, u]\) to \([\tilde{\epsilon}, v]\) +\item by pre-multiplying the (non-weighted) generalized plant by a block-diagonal transfer function matrix containing the weights for the outputs \(z\) and \texttt{1} for the outputs \(v\) +\end{itemize} +\tcbsubtitle{Answer} +The two solutions below can be used. + +\begin{minted}[]{matlab} +Pw = [Ws -Ws*G; + 1 -G]; +\end{minted} + +The second solution is however more general, and can also be used when weights are added at the inputs by post-multiplying instead of pre-multiplying. + +\begin{minted}[]{matlab} +P = [1 -G; + 1 -G]; +Pw = blkdiag(Ws, 1)*P; +\end{minted} +\end{exercice} + +\section{Design of Weighting Functions} +\label{sec:org0c721f2} +\label{sec:weighting_functions_design} + +Weighting function included in the generalized plant must be \textbf{proper}, \textbf{stable} and \textbf{minimum phase} transfer functions. + +\begin{definition} +\begin{description} +\item[{proper}] more poles than zeros, this implies \(\lim_{\omega \to \infty} |W(j\omega)| < \infty\) +\item[{stable}] no poles in the right half plane +\item[{minimum phase}] no zeros in the right half plane +\end{description} +\end{definition} + +Good guidelines for design of weighting function are given in \cite{bibel92_guidel_h}. + +There is a Matlab function called \texttt{makeweight} that allows to design first-order weights by specifying the low frequency gain, high frequency gain, and the gain at a specific frequency: +\begin{minted}[]{matlab} +W = makeweight(dcgain,[freq,mag],hfgain) +\end{minted} +with: +\begin{itemize} +\item \texttt{dcgain}: low frequency gain +\item \texttt{[freq,mag]}: frequency \texttt{freq} at which the gain is \texttt{mag} +\item \texttt{hfgain}: high frequency gain +\end{itemize} + +\begin{exampl} +The Matlab code below produces a weighting function with the following characteristics (Figure \ref{fig:first_order_weight}): +\begin{itemize} +\item Low frequency gain of 100 +\item Gain of 1 at 10Hz +\item High frequency gain of 0.5 +\end{itemize} + +\begin{minted}[]{matlab} +Ws = makeweight(1e2, [2*pi*10, 1], 1/2); +\end{minted} + +\begin{center} +\includegraphics[scale=1]{figs/first_order_weight.png} +\captionof{figure}{\label{fig:first_order_weight}Obtained Magnitude of the Weighting Function} +\end{center} +\end{exampl} + +\begin{seealso} +Quite often, higher orders weights are required. + +In such case, the following formula can be used: + +\begin{equation} + W(s) = \left( \frac{ + \frac{1}{\omega_0} \sqrt{\frac{1 - \left(\frac{G_0}{G_c}\right)^{\frac{2}{n}}}{1 - \left(\frac{G_c}{G_\infty}\right)^{\frac{2}{n}}}} s + \left(\frac{G_0}{G_c}\right)^{\frac{1}{n}} + }{ + \left(\frac{1}{G_\infty}\right)^{\frac{1}{n}} \frac{1}{\omega_0} \sqrt{\frac{1 - \left(\frac{G_0}{G_c}\right)^{\frac{2}{n}}}{1 - \left(\frac{G_c}{G_\infty}\right)^{\frac{2}{n}}}} s + \left(\frac{1}{G_c}\right)^{\frac{1}{n}} + }\right)^n \label{eq:weight_formula_advanced} +\end{equation} + +The parameters permit to specify: +\begin{itemize} +\item the low frequency gain: \(G_0 = lim_{\omega \to 0} |W(j\omega)|\) +\item the high frequency gain: \(G_\infty = lim_{\omega \to \infty} |W(j\omega)|\) +\item the absolute gain at \(\omega_0\): \(G_c = |W(j\omega_0)|\) +\item the absolute slope between high and low frequency: \(n\) +\end{itemize} + +A Matlab function implementing Equation \eqref{eq:weight_formula_advanced} is shown below: + +\begin{minted}[]{matlab} +function [W] = generateWeight(args) + arguments + args.G0 (1,1) double {mustBeNumeric, mustBePositive} = 0.1 + args.G1 (1,1) double {mustBeNumeric, mustBePositive} = 10 + args.Gc (1,1) double {mustBeNumeric, mustBePositive} = 1 + args.wc (1,1) double {mustBeNumeric, mustBePositive} = 2*pi + args.n (1,1) double {mustBeInteger, mustBePositive} = 1 + end + + if (args.Gc <= args.G0 && args.Gc <= args.G1) || (args.Gc >= args.G0 && args.Gc >= args.G1) + eid = 'value:range'; + msg = 'Gc must be between G0 and G1'; + throwAsCaller(MException(eid,msg)) + end + + s = zpk('s'); + + W = (((1/args.wc) * sqrt((1-(args.G0/args.Gc)^(2/args.n))/(1-(args.Gc/args.G1)^(2/args.n)))*s + (args.G0/args.Gc)^(1/args.n)) / ((1/args.G1)^(1/args.n) * (1/args.wc) * sqrt((1-(args.G0/args.Gc)^(2/args.n))/(1-(args.Gc/args.G1)^(2/args.n)))*s + (1/args.Gc)^(1/args.n)))^args.n; + +end +\end{minted} + +Let's use this function to generate three weights with the same high and low frequency gains, but but different slopes. + +\begin{minted}[]{matlab} +W1 = generateWeight('G0', 1e2, 'G1', 1/2, 'Gc', 1, 'wc', 2*pi*10, 'n', 1); +W2 = generateWeight('G0', 1e2, 'G1', 1/2, 'Gc', 1, 'wc', 2*pi*10, 'n', 2); +W3 = generateWeight('G0', 1e2, 'G1', 1/2, 'Gc', 1, 'wc', 2*pi*10, 'n', 3); +\end{minted} + +The obtained shapes are shown in Figure \ref{fig:high_order_weight}. + +\begin{center} +\includegraphics[scale=1]{figs/high_order_weight.png} +\captionof{figure}{\label{fig:high_order_weight}Higher order weights using Equation \eqref{eq:weight_formula_advanced}} +\end{center} +\end{seealso} + +\section{Shaping the Sensitivity Function} +\label{sec:org622981c} +\label{sec:sensitivity_shaping_example} + +Let's design a controller using the \(\mathcal{H}_\infty\) shaping of the sensitivity function that fulfils the following requirements: +\begin{enumerate} +\item Bandwidth of at least 10Hz +\item Small static errors for step responses +\item Robustness: Large module margin \(\Delta M > 0.5\) (\(\Rightarrow \Delta G > 2\) and \(\Delta \phi > 29^o\)) +\end{enumerate} + +As usual, the plant used is the one presented in Section \ref{sec:example_system}. + +\begin{exercice} +Translate the requirements as upper bounds on the Sensitivity function and design the corresponding weighting functions using Matlab. + +\tcbsubtitle{Hint} +The typical wanted upper bound of the sensitivity function is shown in Figure \ref{fig:h-infinity-spec-S-bis}. + +More precisely: +\begin{enumerate} +\item Recall that the closed-loop bandwidth is defined as the frequency \(|S(j\omega)|\) first crosses \(1/\sqrt{2} = -3dB\) from below +\item For the small static error, -60dB is usually enough as other factors (measurement noise, disturbances) will anyhow limit the performances +\item Recall that the module margin is equal to the inverse of the \(\mathcal{H}_\infty\) norm of the sensitivity function: +\[ \Delta M = \frac{1}{\|S\|_\infty} \] +\end{enumerate} + +Remember that the wanted upper bound of the sensitivity function is defined by the \textbf{inverse} magnitude of the weight. + +\begin{center} +\includegraphics[scale=1]{figs/h-infinity-spec-S.png} +\captionof{figure}{\label{fig:h-infinity-spec-S-bis}Typical wanted shape of the Sensitivity transfer function} +\end{center} +\tcbsubtitle{Answer} +We want to design the weighting function \(W_s(s)\) such that: +\begin{enumerate} +\item \(|W_s(j \cdot 2 \pi 10)| = \sqrt{2}\) +\item \(|W_s(j \cdot 0)| = 10^3\) +\item \(\|W_s\|_\infty = 0.5\) +\end{enumerate} + +Using Matlab, such weighting function can be generated using the \texttt{makeweight} function as shown below: +\begin{minted}[]{matlab} +Ws = makeweight(1e3, [2*pi*10, sqrt(2)], 1/2); +\end{minted} + +Or using the \texttt{generateWeight} function: +\begin{minted}[]{matlab} +Ws = generateWeight('G0', 1e3, ... + 'G1', 1/2, ... + 'Gc', sqrt(2), 'wc', 2*pi*10, ... + 'n', 2); +\end{minted} +\end{exercice} + +Let's say we came up with the following weighting function: +\begin{minted}[]{matlab} +Ws = generateWeight('G0', 1e3, ... + 'G1', 1/2, ... + 'Gc', sqrt(2), 'wc', 2*pi*10, ... + 'n', 2); +\end{minted} + +The weighting function is then added to the generalized plant. +\begin{minted}[]{matlab} +P = [1 -G; + 1 -G]; +Pw = blkdiag(Ws, 1)*P; +\end{minted} + +And the \(\mathcal{H}_\infty\) synthesis is performed on the \emph{weighted} generalized plant. +\begin{minted}[]{matlab} +K = hinfsyn(Pw, 1, 1, 'Display', 'on'); +\end{minted} + +\begin{verbatim} +Test bounds: 0.5 <= gamma <= 0.51 + + gamma X>=0 Y>=0 rho(XY)<1 p/f +5.05e-01 0.0e+00 0.0e+00 3.000e-16 p +Limiting gains... +5.05e-01 0.0e+00 0.0e+00 3.461e-16 p +5.05e-01 -3.5e+01 # -4.9e-14 1.732e-26 f + +Best performance (actual): 0.503 +\end{verbatim} + +\(\gamma \approx 0.5\) means that the \(\mathcal{H}_\infty\) synthesis generated a controller \(K(s)\) that stabilizes the closed-loop system, and such that the \(\mathcal{H}_\infty\) norm of the closed-loop transfer function from \(w\) to \(z\) is less than \(\gamma\): +\begin{align*} + & \| W_s(s) S(s) \|_\infty \approx 0.5 \\ + & \Leftrightarrow |S(j\omega)| < \frac{0.5}{|W_s(j\omega)|} \quad \forall \omega +\end{align*} + +This is indeed what we can see by comparing \(|S|\) and \(|W_S|\) in Figure \ref{fig:results_sensitivity_hinf}. + +\begin{important} +Obtaining \(\gamma < 1\) means that the \(\mathcal{H}_\infty\) synthesis found a controller such that the specified closed-loop transfer functions are bellow the specified upper bounds. + +Yet, obtaining a \(\gamma\) slightly above one does not necessary means the synthesis is unsuccessful. +It just means that at some frequency, one of the closed-loop transfer functions is above the specified upper bound by a factor \(\gamma\). +\end{important} + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/results_sensitivity_hinf.png} +\caption{\label{fig:results_sensitivity_hinf}Weighting function and obtained closed-loop sensitivity} +\end{figure} + +\section{Shaping multiple closed-loop transfer functions - Limitations} +\label{sec:org501a0b0} +\label{sec:shaping_multiple_tf} +As was shown in Section \ref{sec:modern_interpretation_specification}, each of the four main closed-loop transfer functions (called the \emph{gang of four}) will impact different characteristics of the closed-loop system. +This is summarized in Table \ref{tab:usual_shaping_gang_four}. + +Therefore, we might want to shape multiple closed-loop transfer functions at the same time. +For instance \(S\) could be shape to have good step responses, \(KS\) to limit the input usage and \(T\) to filter measurement noise. +When multiple closed-loop transfer function are shaped at the same time, it is refereed to as \textbf{Mixed-Sensitivity \(\mathcal{H}_\infty\) Control} and is the subject of Section \ref{sec:h_infinity_mixed_sensitivity}. + +\begin{table}[htbp] +\caption{\label{tab:usual_shaping_gang_four}Typical specifications and corresponding shaping of the \emph{Gang of four}} +\centering +\begin{tabularx}{0.9\linewidth}{llX} +\toprule +\textbf{Specifications} & \textbf{TF} & \textbf{Wanted shape}\\ +\midrule +Fast Reference Tracking & \(S\) & Set lower bound on the bandwidth\\ +Small Steady State Errors & \(S\) & Small low frequency gain\\ +Follow Step ref. inputs & \(S\) & Slope of +20dB/dec at low frequency\\ +Follow Ramp ref. inputs & \(S\) & Slope of +40dB/dec at low frequency\\ +Follow Sin. ref. inputs & \(S\) & Small magnitude centered on the sin. frequency\\ +\midrule +Output Disturbance Rejection & \(S\) & Small gain in the disturbance bandwidth\\ +Input Disturbance Rejection & \(GS\) & Small gain in the disturbance bandwidth\\ +Prevent notching resonances & \(GS\) & Limit gain around resonance\\ +\midrule +Small Command Amplitude & \(KS\) & Small at high frequency\\ +Limitation of the Bandwidth & \(T\) & Set an upper bound on the bandwidth\\ +Measurement Noise Filtering & \(T\) & Small high frequency gain\\ +\midrule +Stability margins & \(S\) & Module margin: \(\Vert S\Vert_\infty\) small\\ +Robust to unmodelled dynamics & \(T\) & Small at freq. where uncertainty is large\\ +\bottomrule +\end{tabularx} +\end{table} + +Depending on which closed-loop transfer function are to be shaped, different weighted generalized plant can be used. +Some of them are described below for reference, it is a good exercise to try to re-design such weighted generalized plants. +\begin{exampl}[after title={~- Shape $S$ and $KS$}] +\begin{center} +\includegraphics[scale=1]{figs/general_conf_shaping_S_KS.png} +\captionof{figure}{\label{fig:general_conf_shaping_S_KS}Generalized Plant to shape \(S\) and \(KS\)} +\end{center} + +Weighting functions: +\begin{itemize} +\item \(W_1(s)\) is used to shape \(S\) +\item \(W_2(s)\) is used to shape \(KS\) +\end{itemize} + +\begin{minted}[]{matlab} +P = [1 -G + 0 1 + 1 -G]; +Pw = blkdiag(W1, W2, 1)*P; +\end{minted} +\end{exampl} +\begin{exampl}[after title={~- Shape $S$ and $T$}] +\begin{center} +\includegraphics[scale=1]{figs/general_conf_shaping_S_T.png} +\captionof{figure}{\label{fig:general_conf_shaping_S_T}Generalized Plant to shape \(S\) and \(T\)} +\end{center} + +Weighting functions: +\begin{itemize} +\item \(W_1\) is used to shape \(S\) +\item \(W_2\) is used to shape \(T\) +\end{itemize} + +\begin{minted}[]{matlab} +P = [1 -G + 0 G + 1 -G]; +Pw = blkdiag(W1, W2, 1)*P; +\end{minted} +\end{exampl} +\begin{exampl}[after title={~- Shape $S$ and $GS$}] +\begin{center} +\includegraphics[scale=1]{figs/general_conf_shaping_S_GS.png} +\captionof{figure}{\label{fig:general_conf_shaping_S_GS}Generalized Plant to shape \(S\) and \(GS\)} +\end{center} + +Weighting functions: +\begin{itemize} +\item \(W_1\) is used to shape \(S\) +\item \(W_2\) is used to shape \(GS\) +\end{itemize} + +\begin{minted}[]{matlab} +P = [1 -1 + G -G + G -G]; +Pw = blkdiag(W1, W2, 1)*P; +\end{minted} +\end{exampl} +\begin{exampl}[after title={~- Shape $S$, $T$ and $KS$}] +\begin{center} +\includegraphics[scale=1]{figs/general_conf_shaping_S_T_KS.png} +\captionof{figure}{\label{fig:general_conf_shaping_S_T_KS}Generalized Plant to shape \(S\), \(T\) and \(KS\)} +\end{center} + +Weighting functions: +\begin{itemize} +\item \(W_1\) is used to shape \(S\) +\item \(W_2\) is used to shape \(KS\) +\item \(W_3\) is used to shape \(T\) +\end{itemize} + +\begin{minted}[]{matlab} +P = [1 -G + 0 1 + 0 G + 1 -G]; +Pw = blkdiag(W1, W2, W3, 1)*P; +\end{minted} +\end{exampl} +\begin{exampl}[after title={~- Shape $S$, $T$ and $GS$}] +\begin{center} +\includegraphics[scale=1]{figs/general_conf_shaping_S_T_GS.png} +\captionof{figure}{\label{fig:general_conf_shaping_S_T_GS}Generalized Plant to shape \(S\), \(T\) and \(GS\)} +\end{center} + +Weighting functions: +\begin{itemize} +\item \(W_1\) is used to shape \(S\) +\item \(W_2\) is used to shape \(GS\) +\item \(W_3\) is used to shape \(T\) +\end{itemize} + +\begin{minted}[]{matlab} +P = [1 -1 + G -G + 0 1 + G -G]; +Pw = blkdiag(W1, W2, W3, 1)*P; +\end{minted} +\end{exampl} +\begin{exampl}[after title={~- Shape $S$, $T$, $KS$ and $GS$}] +\begin{center} +\includegraphics[scale=1]{figs/general_conf_shaping_S_T_KS_GS.png} +\captionof{figure}{\label{fig:general_conf_shaping_S_T_KS_GS}Generalized Plant to shape \(S\), \(T\), \(KS\) and \(GS\)} +\end{center} + +Weighting functions: +\begin{itemize} +\item \(W_1\) is used to shape \(S\) +\item \(W_2\) is used to shape \(KS\) +\item \(W_1W_3\) is used to shape \(GS\) +\item \(W_2W_3\) is used to shape \(T\) +\end{itemize} + +\begin{minted}[]{matlab} +P = [ 1 -G -G + 0 0 1 + 1 -G -G]; +Pw = blkdiag(W1, W2, 1)*P*blkdiag(1, W3, 1); +\end{minted} +\end{exampl} +\begin{important} +When shaping multiple closed-loop transfer functions, one should be very careful about the three following points that are further discussed: +\begin{itemize} +\item The shaped closed-loop transfer functions are linked by mathematical relations and cannot be shaped independently +\item Closed-loop transfer function can only be shaped in certain frequency range +\item The size of the obtained controller may be very large and not implementable in practice +\end{itemize} +\end{important} + +\begin{warning} +Mathematical relations are linking the closed-loop transfer functions. +For instance, the sensitivity function \(S(s)\) and the complementary sensitivity function \(T(s)\) are linked by the following well known relation: +\begin{equation} + S(s) + T(s) = 1 +\end{equation} + +This means that \(|S(j\omega)|\) and \(|T(j\omega)|\) cannot be made small at the same time! + +It is therefore \textbf{not} possible to shape the four closed-loop transfer functions independently. +The weighting function should be carefully design such as these fundamental relations are not violated. +\end{warning} + +For practical control systems, above some frequency (the control bandwidth), the loop gain is much smaller than 1. +On the other size, there is a frequency range where the loop gain is much larger than 1, this frequency range is called the bandwidth. +Let's see what does that means for the closed-loop transfer function. +First, take the case of the sensibility function: +\begin{align*} + &|G(j\omega) K(j\omega)| \ll 1 \Longrightarrow |S(j\omega)| = \frac{1}{1 + |G(j\omega)K(j\omega)|} \approx 1 \\ + &|G(j\omega) K(j\omega)| \gg 1 \Longrightarrow |S(j\omega)| = \frac{1}{1 + |G(j\omega)K(j\omega)|} \approx \frac{1}{|G(j\omega)K(j\omega)|} +\end{align*} + +This means that the Sensitivity function cannot be shaped at frequencies where the loop gain is small. + +Similar relationship can be found for \(T\), \(KS\) and \(GS\). + +\begin{exercice} +Determine the approximate norms of \(T\), \(KS\) and \(GS\) for large loop gains (\(|G(j\omega) K(j\omega)| \gg 1\)) and small loop gains (\(|G(j\omega) K(j\omega)| \ll 1\)). + +\tcbsubtitle{Hint} +You can follows this procedure for \(T\), \(KS\) and \(GS\): +\begin{enumerate} +\item Write the closed-loop transfer function as a function of \(K(s)\) and \(G(s)\) +\item Take \(|K(j\omega)G(j\omega)| \gg 1\) and conclude on the norm of the closed-loop transfer function +\item Take \(|K(j\omega)G(j\omega)| \ll 1\) and conclude +\end{enumerate} +\tcbsubtitle{Answer} +The obtained constrains are shown in Figure \ref{fig:h-infinity-4-blocs-constrains}. +\end{exercice} + +Depending on the frequency band, the norms of the closed-loop transfer functions are a function of the controller \(K\) and therefore can be shaped. +However, in some frequency band, the norms do not depend on the controller and therefore \textbf{cannot} be shaped. + +Therefore the weighting functions should only focus on certainty frequency range depending on the transfer function being shaped. +These regions are summarized in Figure \ref{fig:h-infinity-4-blocs-constrains}. + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/h-infinity-4-blocs-constrains.png} +\caption{\label{fig:h-infinity-4-blocs-constrains}Shaping the Gang of Four. Blue regions indicate that the transfer function can be shaped using \(K\). Red regions indicate this is not the case} +\end{figure} + +\begin{warning} +The order (e.g. number of state) of the controller given by the \(\mathcal{H}_\infty\) synthesis is equal to the order (e.g. number of state) of the weighted generalized plant. +It is thus equal to the \textbf{sum} of the number of state of the non-weighted generalized plant and the number of state of all the weighting functions. +Then, the \(\mathcal{H}_\infty\) synthesis usually generate a controller with a very high order that is not implementable in practice. + +Two approaches can be used to obtain controllers with reasonable order: +\begin{enumerate} +\item use simple weights (usually first order) +\item perform a model reduction on the obtained high order controller +\end{enumerate} +\end{warning} + +\chapter{Mixed-Sensitivity \(\mathcal{H}_\infty\) Control - Example} +\label{sec:orgcbf596f} +\label{sec:h_infinity_mixed_sensitivity} +Let's now apply the \(\mathcal{H}_\infty\) Shaping control procedure on a practical example. + +In Section \ref{sec:ex_control_problem} the control problem is presented. +The design procedure used to apply the \(\mathcal{H}_\infty\) Mixed Sensitivity synthesis is described in Section \ref{sec:ex_control_procedure}. + +The important step of interpreting the specifications as wanted shape of closed-loop transfer functions is performed in Section \ref{sec:ex_specification_interpretation}. + +Finally, the shaping of closed-loop transfer functions is performed in Sections \ref{sec:ex_shaping_S}, \ref{sec:ex_shaping_GS} and \ref{sec:ex_shaping_T}. + +\section{Control Problem} +\label{sec:org0d0e2a9} +\label{sec:ex_control_problem} + +Let's consider our usual \emph{test system} shown in Figure \ref{fig:ex_test_system}. + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/ex_test_system.png} +\caption{\label{fig:ex_test_system}Test System consisting of a payload with a mass \(m\) on top of an active system with a stiffness \(k\), damping \(c\) and an actuator. A feedback controller \(K(s)\) is added to position / isolate the payload.} +\end{figure} + +\begin{important} +The control specifications are: +\begin{itemize} +\item The displacement \(y\) should follow reference inputs \(r\) with negligible static error after 0.1s +\item Reject disturbances \(d\) in less than 0.1s +\item Limit the effect of measurement noise \(n\) on the output displacement \(y\) +\item Obtain a Robust System with good stability margins +\end{itemize} +\end{important} + +The considered inputs are: +\begin{itemize} +\item disturbances \(d\) as step inputs with an amplitude of \(5\,\mu m\) +\item reference inputs with are ramp inputs with a slope of \(100\,\mu m/s\) and a time duration of \(0.2\,s\) +\item measurement noise \(n\) with a large spectral density at high frequency (increasing starting from 100Hz) +\end{itemize} + +\section{Control Design Procedure} +\label{sec:org0f986e4} +\label{sec:ex_control_procedure} + +Here is the general design procedure that will be followed: +\begin{enumerate} +\item Compute the model of the plant +\item Write the control system as a general control problem +\item Translate the specifications into the wanted shape of closed-loop transfer functions +\item Chose the suitable weighted general plant to shape the wanted quantities +\item Shape sequentially the chosen closed-loop transfer functions +\end{enumerate} + +Let's first convert the system of Figure \ref{fig:ex_test_system} into the classical feedback architecture of Figure \ref{fig:classical_feedback_test_system_bis}. + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/ex_test_system_feedback.png} +\caption{\label{fig:classical_feedback_test_system_bis}Block diagram corresponding to the example system} +\end{figure} + +The two transfer functions present in the system are derived and defined below: +\begin{minted}[linenos,firstnumber=1]{matlab} +k = 1e6; % Stiffness [N/m] +c = 4e2; % Damping [N/(m/s)] +m = 10; % Mass [kg] + +% Control Plant +G = 1/(m*s^2 + c*s + k); +% Disturbance dynamics +Gd = (c*s + k)/(m*s^2 + c*s + k); +\end{minted} + +We also define the inputs signals that will be used for time domain simulations. +They are graphically shown in Figure \ref{fig:ex_inputs_signals}. +\begin{minted}[linenos,firstnumber=9]{matlab} +% Time Vector +t = 0:1e-4:0.5; + +% Reference Input +r = zeros(size(t)); +r(t>0.05 & t<=0.25) = 1e-4*(t(t>0.05 & t<=0.25)-0.05); +r(t>0.25) = 2e-5; + +% Measurement Noise +Fs = 1e3; % Sampling Frequency [Hz] +Ts = 1/Fs; % Sampling Time [s] +n = sqrt(Fs/2)*randn(1, length(t)); % Signal with an ASD equal to one +n = lsim(1e-6*(s + 2*pi*1e2)^2/(s + 2*pi*1e3)^2/(1+s/2/pi/500), n, t)'; % Shaped noise + +% Disturbance +d = zeros(size(t)); +d(t>0.3) = 5e-6; +\end{minted} + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/ex_inputs_signals.png} +\caption{\label{fig:ex_inputs_signals}Time domain inputs signals} +\end{figure} + +We also define the generalized plant corresponding to the system and that will be used for time domain simulations (Figure \ref{fig:ex_general_plant_sim}). +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/ex_general_plant_sim.png} +\caption{\label{fig:ex_general_plant_sim}Generalized plant that will be used for simulations} +\end{figure} + +The Generalized plant of Figure \ref{fig:ex_general_plant_sim} is defined on Matlab as follows: +\begin{minted}[linenos,firstnumber=26]{matlab} +Psim = [0 0 Gd G + 0 0 0 1 + 1 -1 -Gd -G]; + +Psim.InputName = {'r', 'n', 'd', 'u'}; +Psim.OutputName = {'y', 'u', 'e'}; +\end{minted} + +Time domain simulations will be performed by first computing the closed-loop system using the \texttt{lft} command and then using the \texttt{lsim} command on the closed-loop system: +\begin{minted}[linenos,firstnumber=32]{matlab} +% Compute the closed-Loop System, K is the controller +P_CL = lft(Psim, K); + +% Time simulation of the closed-loop system with specified inputs +z = lsim(P_CL, [r; n; d], t); +% The two outputs are +y = z(:,1); % Output Motion [m] +u = z(:,2); % Input usage [N] +\end{minted} + +\section{Modern Interpretation of control specifications} +\label{sec:org1c39f44} +\label{sec:ex_specification_interpretation} + +\begin{exercice} +\begin{enumerate} +\item Translate the control specifications into wanted shape of closed-loop transfer functions +\item Conclude and the closed-loop transfer functions to be shaped +\item Chose a general configuration architecture that allows to shape these transfer function +\item Using Matlab, define the generalized plant +\end{enumerate} + +\tcbsubtitle{Hint} +\begin{enumerate} +\item Make use of Table \ref{tab:usual_shaping_gang_four} +\item Make use of Table \ref{tab:usual_shaping_gang_four} +\item See Section \ref{sec:shaping_multiple_tf} +\item See Section \ref{sec:shaping_multiple_tf} +\end{enumerate} +\end{exercice} + +After converting the control specifications into wanted shape of closed-loop transfer functions, we might come up with the Table \ref{tab:ex_specification_shapes}. + +In such case, we want to shape \(S\), \(GS\) and \(T\). + +\begin{table}[htbp] +\caption{\label{tab:ex_specification_shapes}Control Specifications and associated wanted shape of the closed-loop transfer functions} +\centering +\begin{tabularx}{0.7\linewidth}{llX} +\toprule +\textbf{Specification} & \textbf{TF} & \textbf{Wanted Shape}\\ +\midrule +Follow Step Reference & \(S\) & +40dB of slope at low frequency\\ +Reject Disturbances & \(S\), \(GS\) & Small gain\\ +Reject measurement noise & \(T\) & Small high frequency (>100Hz) gain\\ +Robust System & \(S\) & Small \(\Vert S \Vert_\infty\)\\ +\bottomrule +\end{tabularx} +\end{table} + +To do so, we use to generalized plant shown in Figure \ref{fig:ex_general_plant} for the synthesis where the three closed-loop tranfert functions from \(w\) to \([z_1\,,z_2\,,z_3]\) are respectively \(S\), \(GS\) and \(T\). + +This generalized plant is defined on Matlab as follows: +\begin{minted}[linenos,firstnumber=40]{matlab} +P = [1 -1 + G -G + 0 1 + G -G]; +\end{minted} + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/ex_general_plant.png} +\caption{\label{fig:ex_general_plant}Generalized plant chosen for the shaping of \(S\), \(GS\) \(T\)} +\end{figure} + +However, to performed the \(\mathcal{H}_\infty\) loop shaping, we have to include \textbf{weighting function} to the Generalized plant. +We obtain the \textbf{weighted generalized plant} in Figure \ref{fig:ex_general_weighted_plant}, and that is computed using Matlab as follows: +\begin{minted}[linenos,firstnumber=44]{matlab} +Pw = blkdiag(W1, W2, W3, 1)*P; +\end{minted} + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/ex_general_weighted_plant.png} +\caption{\label{fig:ex_general_weighted_plant}Generalized weighted plant used for the \(\mathcal{H}_\infty\) Synthesis} +\end{figure} + +Finlay, performing the \(\mathcal{H}_\infty\) Shaping of \(S\), \(GS\) and \(T\) is as simple as ruining the \texttt{hinfsyn} command: +\begin{minted}[linenos,firstnumber=45]{matlab} +K = hinfsyn(Pw, 1, 1); +\end{minted} + + +Now let's shape the three closed-loop transfer functions sequentially: +\begin{itemize} +\item \(S\) is shaped in Section \ref{sec:ex_shaping_S} +\item \(GS\) is shaped in Section \ref{sec:ex_shaping_GS} +\item \(T\) is shaped in Section \ref{sec:ex_shaping_T} +\end{itemize} + +\section{Step 1 - Shaping of \(S\)} +\label{sec:org2b353b4} +\label{sec:ex_shaping_S} + +Let's first shape the Sensitivity function as it is usually the most important of the \emph{Gang of four} closed-loop transfer functions. +To do so, we have to create a weight \(W_1(s)\) that defines the wanted upper bound on \(|S(j\omega)|\): +\begin{itemize} +\item small low frequency gain: \(|S(j\cdot 0)| = 10^{-3}\) +\item minimum crossover frequency of \(\approx 10Hz\): \(|S(j2\pi 10)| < \frac{1}{\sqrt{2}}\) +\item small maximum peak magnitude for robustness properties: \(\|S\|_\infty < 2\) +\end{itemize} + +The weighting function is design using the \texttt{generateWeigh} function and its inverse shape can be seen in Figure +\begin{minted}[linenos,firstnumber=46]{matlab} +W1 = generateWeight('G0', 1e3, ... + 'G1', 1/2, ... + 'Gc', sqrt(2), 'wc', 2*pi*10, ... + 'n', 1); +\end{minted} + +To not constrain \(GS\) and \(T\) for the shaping of \(S\), \(W_2\) and \(W_3\) are first taken as very small gains: +\begin{minted}[linenos,firstnumber=50]{matlab} +W2 = tf(1e-8); +W3 = tf(1e-8); +\end{minted} + +The \(\mathcal{H}_\infty\) synthesis is performed and the obtained closed-loop transfer functions \(S\), \(GS\), and \(T\) and compared with the upper bounds set by the weighting functions in Figure \ref{fig:ex_results_1}. + +\begin{minted}[linenos,firstnumber=52]{matlab} +Pw = blkdiag(W1, W2, W3, 1)*P; +K1 = hinfsyn(Pw, 1, 1, 'Display', 'on'); +\end{minted} + +\begin{verbatim} +Test bounds: 0.5 <= gamma <= 0.51 + + gamma X>=0 Y>=0 rho(XY)<1 p/f +5.05e-01 0.0e+00 0.0e+00 5.511e-14 p +Limiting gains... +5.05e-01 0.0e+00 0.0e+00 1.867e-14 p + +Best performance (actual): 0.502 +\end{verbatim} + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/ex_results_1.png} +\caption{\label{fig:ex_results_1}Obtained Shape Closed-Loop transfer functions (dashed black lines indicate inverse magnitude of the weighting functions)} +\end{figure} + +Time domain simulation is then performed and the obtained output displacement and control inputs are shown in Figure \ref{fig:ex_time_domain_1}. + +We can see: +\begin{itemize} +\item we are not able to follow the ramp input. This have to be solved by modifying the weighting function \(W_1(s)\) +\item we have poor rejection of disturbances. This we be solve by shaping \(GS\) in Section \ref{sec:ex_shaping_GS} +\item we have quite large effect of the measurement noise. This will be solved by shaping \(T\) in Section \ref{sec:ex_shaping_T} +\end{itemize} + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/ex_time_domain_1.png} +\caption{\label{fig:ex_time_domain_1}Time domain simulation results} +\end{figure} + +Remember that in order to follow ramp inputs, the sensitivity function should have a slope of +40dB/dec at low frequency (Table \ref{tab:usual_shaping_gang_four}). + +To do so, let's modify \(W_1\) to impose a slope of +40dB/dec at low frequency. +This can simple be done by using a second order weight: +\begin{minted}[linenos,firstnumber=54]{matlab} +W1 = generateWeight('G0', 1e3, ... + 'G1', 1/2, ... + 'Gc', sqrt(2), 'wc', 2*pi*15, ... + 'n', 2); +\end{minted} + +The \(\mathcal{H}_\infty\) synthesis is performed using the new weights and the obtained closed-loop shaped are shown in figure \ref{fig:ex_results_1b}. + +The time domain signals are shown in Figure \ref{fig:ex_time_domain_1b} and it is confirmed that the ramps are now follows without static errors. + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/ex_results_1b.png} +\caption{\label{fig:ex_results_1b}Obtained Shape Closed-Loop transfer functions} +\end{figure} + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/ex_time_domain_1b.png} +\caption{\label{fig:ex_time_domain_1b}Time domain simulation results} +\end{figure} + +\section{Step 2 - Shaping of \(GS\)} +\label{sec:org040835b} +\label{sec:ex_shaping_GS} + +Looking at Figure \ref{fig:ex_results_2}, it is clear that the rejection of disturbances is not satisfactory. +This can also be seen by the large peak of \(GS\) in Figure \ref{fig:ex_results_1b}. + +This poor rejection of disturbances is actually due to the fact that the obtain controller has at notch at the resonance frequency of the plant. + + +To overcome this issue, we can simply increase the magnitude of \(W_2\) to limit the peak magnitude of \(GS\) +Let's take \(W_2\) as a simple constant gain: +\begin{minted}[linenos,firstnumber=58]{matlab} +W2 = tf(4e5); +\end{minted} + +The \(\mathcal{H}_\infty\) Synthesis is performed and the obtained closed-loop transfer functions are shown in Figure \ref{fig:ex_results_2}. +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/ex_results_2.png} +\caption{\label{fig:ex_results_2}Obtained Shape Closed-Loop transfer functions} +\end{figure} + +Time domain simulation results are shown in Figure \ref{fig:ex_time_domain_2}. +If is shown that indeed, the disturbance rejection performance are much better and only very small oscillation is obtained. + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/ex_time_domain_2.png} +\caption{\label{fig:ex_time_domain_2}Time domain simulation results} +\end{figure} + +\section{Step 3 - Shaping of \(T\)} +\label{sec:orge27b967} +\label{sec:ex_shaping_T} + +Finally, we want to limit the effect of the noise on the displacement output. + +To do so, \(T\) is shaped such that its high frequency gain is reduced. + +This is done by increasing the high frequency gain of the weighting function \(W_3\) until the \(\mathcal{H}_\infty\) synthesis gives \(\gamma \approx 1\). + +The final weighting function \(W_3\) is defined as follows: +\begin{minted}[linenos,firstnumber=59]{matlab} +W3 = generateWeight('G0', 1e-1, ... + 'G1', 1e4, ... + 'Gc', 1, 'wc', 2*pi*70, ... + 'n', 2); +\end{minted} + +The \(\mathcal{H}_\infty\) synthesis is performed and \(\gamma\) is closed to one. +The obtained closed-loop transfer functions are shown in Figure \ref{fig:ex_results_3} and we can obverse that: +\begin{itemize} +\item The high frequency gain of \(T\) is indeed reduced +\item This comes as the expense of a large magnitude both \(GS\) and \(S\). +This means we will probably have slightly less good disturbance rejection and tracking performances. +\end{itemize} + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/ex_results_3.png} +\caption{\label{fig:ex_results_3}Obtained Shape Closed-Loop transfer functions} +\end{figure} + +The time domain simulation signals are shown in Figure \ref{fig:ex_time_domain_3}. +We can indeed see a slightly less good disturbance rejection. +However, the vibrations induced by the sensor noise is well reduced. +This can be seen when zooming on the output signal in Figure \ref{fig:ex_time_domaim_3_zoom}. + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/ex_time_domain_3.png} +\caption{\label{fig:ex_time_domain_3}Time domain simulation results} +\end{figure} + +\begin{figure}[htbp] +\centering +\includegraphics[scale=1]{figs/ex_time_domaim_3_zoom.png} +\caption{\label{fig:ex_time_domaim_3_zoom}Zoom on the output signal} +\end{figure} + +\section{Conclusion and Discussion} +\label{sec:org8ee7c81} + +Hopefully this practical example will help you apply the \(\mathcal{H}_\infty\) Shaping synthesis on other control problems. + +As an exercise, plot and analyze the evolution of the controller and loop gain transfer functions during the 3 synthesis steps. + +If the large input usage is considered to be not acceptable, the shaping of \(KS\) could be included in the synthesis and all the \emph{Gang of four} closed-loop transfer function shapes. + +\chapter{Conclusion} +\label{sec:org6c74b5a} +\label{sec:conclusion} + +Hopefully, this document gave you a glimpse on how useful and powerful the \(\mathcal{H}_\infty\) loop shaping synthesis can be. +One of the true power of \(\mathcal{H}_\infty\) synthesis is that is can easily be applied to multi-input multi-output systems! +If you want to know more about the ``\(\mathcal{H}_\infty\) and robust control world'' some resources are given below. + +\chapter*{Resources} +\label{sec:org17d3722} +For a complete treatment of multivariable robust control, I would highly recommend this book \cite{skogestad07_multiv_feedb_contr}. +If you want to nice reference book in French, look at \cite{duc99_comman_h}. + +You can also look at the very good lectures below. + +\href{https://www.youtube.com/embed/?listType=playlist&list=PLn8PRpmsu08qFLMfgTEzR8DxOPE7fBiin}{Robust Control - Brian Douglas} + +\href{https://www.youtube.com/embed/?listType=playlist&list=PLsjPUqcL7ZIFHCObUU_9xPUImZ203gB4o}{Control Bootcamp - Steve Brunton} + +\printbibliography +\end{document} diff --git a/preamble.tex b/preamble.tex new file mode 100644 index 0000000..2e79d6c --- /dev/null +++ b/preamble.tex @@ -0,0 +1,113 @@ +\usepackage{float} + +\usepackage{caption,tabularx,booktabs} + +\usepackage{biblatex} +\addbibresource{ref.bib} + +\usepackage{fontawesome} + +\usepackage{caption} +\usepackage{subcaption} + +\captionsetup[figure]{labelfont=bf} +\captionsetup[subfigure]{labelfont=bf} +\captionsetup[listing]{labelfont=bf} +\captionsetup[table]{labelfont=bf} + +\usepackage{xcolor} + +\definecolor{my-blue}{HTML}{6b7adb} +\definecolor{my-pale-blue}{HTML}{e6e9f9} +\definecolor{my-red}{HTML}{db6b6b} +\definecolor{my-pale-red}{HTML}{f9e6e6} +\definecolor{my-green}{HTML}{6bdbb6} +\definecolor{my-pale-green}{HTML}{e6f9f3} +\definecolor{my-yellow}{HTML}{dbd26b} +\definecolor{my-pale-yellow}{HTML}{f9f7e6} +\definecolor{my-orange}{HTML}{dba76b} +\definecolor{my-pale-orange}{HTML}{f9f0e6} +\definecolor{my-grey}{HTML}{a3a3a3} +\definecolor{my-pale-grey}{HTML}{f0f0f0} +\definecolor{my-turq}{HTML}{6bc7db} +\definecolor{my-pale-turq}{HTML}{e6f6f9} + +\usepackage{inconsolata} + +\usepackage[newfloat=true, chapter]{minted} +\usemintedstyle{autumn} + +\setminted{frame=lines,breaklines=true,tabsize=4,fontsize=\scriptsize,autogobble=true,labelposition=topline,bgcolor=my-pale-grey} +\setminted[matlab]{label=Matlab} +\setminted[latex]{label=LaTeX} +\setminted[bash]{label=Bash} +\setminted[python]{label=Python} +\setminted[text]{label=Results} + +\setmintedinline{fontsize=\normalsize,bgcolor=my-pale-grey} + +\usepackage[most]{tcolorbox} + +\tcbuselibrary{minted} + +\newtcolorbox{seealso}{ enhanced,breakable,colback=my-pale-grey,colframe=my-grey,fonttitle=\bfseries,title=See Also} +\newtcolorbox{hint}{ enhanced,breakable,colback=my-pale-grey,colframe=my-grey,fonttitle=\bfseries,title=Hint} +\newtcolorbox{definition}{enhanced,breakable,colback=my-pale-red, colframe=my-red, fonttitle=\bfseries,title=Definition} +\newtcolorbox{important}{ enhanced,breakable,colback=my-pale-red, colframe=my-red, fonttitle=\bfseries,title=Important} +\newtcolorbox{exampl}[1][]{ enhanced,breakable,colback=my-pale-green,colframe=my-green,fonttitle=\bfseries,title=Example,#1} +\newtcolorbox{exercice}{ enhanced,breakable,colback=my-pale-yellow,colframe=my-yellow,fonttitle=\bfseries,title=Exercice} +\newtcolorbox{question}{ enhanced,breakable,colback=my-pale-yellow,colframe=my-yellow,fonttitle=\bfseries,title=Question} +\newtcolorbox{answer}{ enhanced,breakable,colback=my-pale-turq,colframe=my-turq,fonttitle=\bfseries,title=Answer} +\newtcolorbox{summary}{ enhanced,breakable,colback=my-pale-blue,colframe=my-blue,fonttitle=\bfseries,title=Summary} +\newtcolorbox{caution}{ enhanced,breakable,colback=my-pale-orange,colframe=my-orange,fonttitle=\bfseries,title=Caution} +\newtcolorbox{warning}{ enhanced,breakable,colback=my-pale-orange,colframe=my-orange,fonttitle=\bfseries,title=Warning} + +\newtcolorbox{my-quote}[1]{% + colback=my-pale-grey, + grow to right by=-10mm, + grow to left by=-10mm, + boxrule=0pt, + boxsep=0pt, + breakable, + enhanced jigsaw, + borderline west={4pt}{0pt}{my-grey}} + +\renewenvironment{quote}{\begin{my-quote}}{\end{my-quote}} + +\newtcolorbox{my-verse}[1]{% + colback=my-pale-grey, + grow to right by=-10mm, + grow to left by=-10mm, + boxrule=0pt, + boxsep=0pt, + breakable, + enhanced jigsaw, + borderline west={4pt}{0pt}{my-grey}} + +\renewenvironment{verse}{\begin{my-verse}}{\end{my-verse}} + +\usepackage{environ}% http://ctan.org/pkg/environ +\NewEnviron{aside}{% + \marginpar{\BODY} +} + +\renewenvironment{verbatim}{\VerbatimEnvironment\begin{minted}[]{text}}{\end{minted}} + +\usepackage{soul} +\sethlcolor{my-pale-grey} + +\let\OldTexttt\texttt +\renewcommand{\texttt}[1]{{\ttfamily\hl{\mbox{\,#1\,}}}} + +\makeatletter +\preto\Gin@extensions{png,} +\DeclareGraphicsRule{.png}{pdf}{.pdf}{\noexpand\Gin@base.pdf} +\makeatother + +\usepackage{hyperref} +\hypersetup{ + colorlinks = true, + allcolors = my-blue +} + +\usepackage{hypcap} diff --git a/ref.bib b/ref.bib new file mode 100644 index 0000000..10a7950 --- /dev/null +++ b/ref.bib @@ -0,0 +1,33 @@ +@article{lurie02_system_archit_trades_using_bode, + author = {Boris J. Lurie and Ali Ghavimi and Fred Y. Hadaegh and Edward Mettler}, + title = {System Architecture Trades Using Bode-Step Control Design}, + journal = {Journal of Guidance, Control, and Dynamics}, + volume = {25}, + number = {2}, + pages = {309-315}, + year = {2002}, + doi = {10.2514/2.4883}, + url = {https://doi.org/10.2514/2.4883}, +} +@techreport{bibel92_guidel_h, + author = {Bibel, John E and Malyevac, D Stephen}, + institution = {NAVAL SURFACE WARFARE CENTER DAHLGREN DIV VA}, + keywords = {robust control}, + title = {Guidelines for the selection of weighting functions for H-infinity control}, + year = {1992}, +} +@book{skogestad07_multiv_feedb_contr, + author = {Skogestad, Sigurd and Postlethwaite, Ian}, + title = {Multivariable Feedback Control: Analysis and Design}, + year = {2007}, + publisher = {John Wiley}, + isbn = {9780470011683}, + keywords = {favorite}, +} +@book{duc99_comman_h, + author = {Duc, G and Font, S}, + title = {Commande H infinie et mu-analyse-des outils pour la robustesse}, + year = {1999}, + publisher = {Lavoisier}, + journal = {Hermes., Paris: Hermes}, +}