diff --git a/figs/bode_plot_example_Gd.pdf b/figs/bode_plot_example_Gd.pdf index 5cb3402..2c94cb9 100644 Binary files a/figs/bode_plot_example_Gd.pdf and b/figs/bode_plot_example_Gd.pdf differ diff --git a/figs/bode_plot_example_Gd.png b/figs/bode_plot_example_Gd.png index 0c8cac2..5f83cc1 100644 Binary files a/figs/bode_plot_example_Gd.png and b/figs/bode_plot_example_Gd.png differ diff --git a/figs/h-infinity-4-blocs-constrains.pdf b/figs/h-infinity-4-blocs-constrains.pdf index 7927662..62f98fd 100644 Binary files a/figs/h-infinity-4-blocs-constrains.pdf and b/figs/h-infinity-4-blocs-constrains.pdf differ diff --git a/figs/h-infinity-4-blocs-constrains.png b/figs/h-infinity-4-blocs-constrains.png index 0c178fd..1b275d2 100644 Binary files a/figs/h-infinity-4-blocs-constrains.png and b/figs/h-infinity-4-blocs-constrains.png differ diff --git a/figs/h-infinity-4-blocs-constrains.svg b/figs/h-infinity-4-blocs-constrains.svg index 818d833..f4fcb68 100644 --- a/figs/h-infinity-4-blocs-constrains.svg +++ b/figs/h-infinity-4-blocs-constrains.svg @@ -56,8 +56,37 @@ + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -83,13 +112,7 @@ - - - - - - - + @@ -112,15 +135,6 @@ - - - - - - - - - @@ -143,12 +157,6 @@ - - - - - - @@ -167,8 +175,5 @@ - - - diff --git a/figs/loop_shaping_S_with_W.pdf b/figs/loop_shaping_S_with_W.pdf index 07039c9..18d8a5e 100644 Binary files a/figs/loop_shaping_S_with_W.pdf and b/figs/loop_shaping_S_with_W.pdf differ diff --git a/figs/loop_shaping_S_with_W.png b/figs/loop_shaping_S_with_W.png index 02eddc3..3212c2b 100644 Binary files a/figs/loop_shaping_S_with_W.png and b/figs/loop_shaping_S_with_W.png differ diff --git a/figs/loop_shaping_S_with_W.svg b/figs/loop_shaping_S_with_W.svg index bec365a..f305823 100644 --- a/figs/loop_shaping_S_with_W.svg +++ b/figs/loop_shaping_S_with_W.svg @@ -1,5 +1,5 @@ - + @@ -81,15 +81,18 @@ - + - + - + + + + @@ -115,159 +118,159 @@ - - - - + - + - - - - + + + + - - - + + + - - - - - - - - - - - + + + + + + + + + + + - - - - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - + - - + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + - - - - - - + - - - - - - - - - - - - - - - - - + diff --git a/figs/loop_shaping_S_without_W.pdf b/figs/loop_shaping_S_without_W.pdf index 7a735d9..ef2e2d5 100644 Binary files a/figs/loop_shaping_S_without_W.pdf and b/figs/loop_shaping_S_without_W.pdf differ diff --git a/figs/loop_shaping_S_without_W.png b/figs/loop_shaping_S_without_W.png index 5c2371d..720b38f 100644 Binary files a/figs/loop_shaping_S_without_W.png and b/figs/loop_shaping_S_without_W.png differ diff --git a/figs/loop_shaping_S_without_W.svg b/figs/loop_shaping_S_without_W.svg index 9adafd7..749b523 100644 --- a/figs/loop_shaping_S_without_W.svg +++ b/figs/loop_shaping_S_without_W.svg @@ -1,5 +1,5 @@ - + @@ -63,18 +63,21 @@ - + - + - + - + + + + @@ -91,127 +94,127 @@ - + - + - - - - + - + - + - - - - - - - - - - - + + + + + + + + + + + - - - - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - + - + - - + + - + - - + + - + - + - + diff --git a/figs/results_sensitivity_hinf.pdf b/figs/results_sensitivity_hinf.pdf index 7a1e52d..784fcf4 100644 Binary files a/figs/results_sensitivity_hinf.pdf and b/figs/results_sensitivity_hinf.pdf differ diff --git a/figs/results_sensitivity_hinf.png b/figs/results_sensitivity_hinf.png index 073bbba..8bcc3ed 100644 Binary files a/figs/results_sensitivity_hinf.png and b/figs/results_sensitivity_hinf.png differ diff --git a/index.html b/index.html index 25ed039..1d02428 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,54 +30,55 @@

Table of Contents

@@ -86,33 +87,38 @@ This document is structured as follows:

    -
  • As \(\mathcal{H}_\infty\) Control is a model based control technique, a short introduction to model based control is given in Section 1
  • -
  • Classical open loop shaping method is presented in Section 2. +
  • As \(\mathcal{H}_\infty\) Control is a model based control technique, a short introduction to model based control is given in Section 1
  • +
  • Classical open loop shaping method is presented in Section 2. It is also shown that \(\mathcal{H}_\infty\) synthesis can be used for open loop shaping.
  • \(\mathcal{H}_\infty\) Important concepts such as the \(\mathcal{H}_\infty\) norm and the generalized plant are introduced.
  • A
  • Finally, an complete example of the -is performed in Section 5.
  • +is performed in Section 6.
-
-

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 when applying Model Based Control to a plant is schematically shown in Figure 1. +The typical methodology when applying Model Based Control to a plant is schematically shown in Figure 1. It consists of three steps:

    @@ -126,7 +132,7 @@ It consists of three steps:
-
+

control-procedure.png

Figure 1: Typical Methodoly for Model Based Control

@@ -137,24 +143,24 @@ In this document, we will mainly focus on steps 2 and 3.

-Step 2 will be discussed in Section 4. +Step 2 will be discussed in Section 4. There are two main methods for the controller synthesis (step 3):

    -
  • open loop shaping discussed in Section 2
  • -
  • closed loop shaping discussed in Sections 4 and 5
  • +
  • open loop shaping discussed in Section 2
  • +
  • closed loop shaping discussed in Sections 4 and 6
-
-

1.2 From Classical Control to Robust Control

+
+

1.2 From Classical Control to Robust Control

- +

- +
@@ -287,7 +293,7 @@ There are two main methods for the controller synthesis (step 3):
Table 1: Table summurazing the main differences between classical, modern and robust control
-
+

robustness_performance.png

Figure 2: Comparison of the performance and robustness of classical control methods, modern control methods and robust control methods. The required information on the plant to succesfuly apply each of the control methods are indicated by the colors.

@@ -295,27 +301,27 @@ There are two main methods for the controller synthesis (step 3):
-
-

1.3 Example System

+
+

1.3 Example System

- +

-Let’s consider the model shown in Figure 3. +Let’s consider the model shown in Figure 3. It could represent a suspension system with a payload to position or isolate using an force actuator and an inertial sensor. -The notations used are listed in Table 2. +The notations used are listed in Table 2.

-
+

mech_sys_1dof_inertial_contr.png

Figure 3: 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.

- +
@@ -401,7 +407,7 @@ The notations used are listed in Table 2.
Table 2: Example system variables
-
+

Derive the following open-loop transfer functions:

@@ -458,11 +464,11 @@ Thanks in advance

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

-
+

classical_feedback_test_system.png

Figure 4: Block diagram corresponding to the example system

@@ -480,7 +486,7 @@ Let’s define the system parameters on Matlab.

-And now the system dynamics \(G(s)\) and \(G_d(s)\) (their bode plots are shown in Figures 5 and 6). +And now the system dynamics \(G(s)\) and \(G_d(s)\) (their bode plots are shown in Figures 5 and 6).

4: G = 1/(m*s^2 + c*s + k); % Plant
@@ -489,14 +495,14 @@ And now the system dynamics \(G(s)\) and \(G_d(s)\) (their bode plots are shown
 
-
+

bode_plot_example_afm.png

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

-
+

bode_plot_example_Gd.png

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

@@ -505,38 +511,44 @@ And now the system dynamics \(G(s)\) and \(G_d(s)\) (their bode plots are shown
-
-

2 Classical Open Loop Shaping

+
+

2 Classical Open Loop Shaping

- +

+
-
-

2.1 Introduction to Loop Shaping

+
+

2.1 Introduction to Loop Shaping

- +

-
+

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

-
+

-The Loop Gain \(L(s)\) usually refers to as the product of the controller and the plant (“Gain around the loop”, see Figure 7): +The Loop Gain \(L(s)\) usually refers to as the product of the controller and the plant (“Gain around the loop”, see Figure 7):

\begin{equation} L(s) = G(s) \cdot K(s) \label{eq:loop_gain} \end{equation} -
+

open_loop_shaping.png

Figure 7: Classical Feedback Architecture

@@ -561,11 +573,11 @@ The Open Loop shape is usually done manually has the loop gain \(L(s)\) depends

-\(K(s)\) then consists of a combination of leads, lags, notches, etc. such that \(L(s)\) has the wanted shape (an example is shown in Figure 8). +\(K(s)\) then consists of a combination of leads, lags, notches, etc. such that \(L(s)\) has the wanted shape (an example is shown in Figure 8).

-
+

open_loop_shaping_shape.png

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

@@ -573,14 +585,14 @@ The Open Loop shape is usually done manually has the loop gain \(L(s)\) depends
-
-

2.2 Example of Open Loop Shaping

+
+

2.2 Example of Open Loop Shaping

- +

-
+

Let’s take our example system and try to apply the Open-Loop shaping strategy to design a controller that fulfils the following specifications:

@@ -592,7 +604,7 @@ Let’s take our example system and try to apply the Open-Loop shaping strat
-
+

Using SISOTOOL, design a controller that fulfill the specifications.

@@ -609,7 +621,7 @@ In order to have the wanted Roll-off, two integrators are used, a lead is also a

-The obtained controller is shown below, and the bode plot of the Loop Gain is shown in Figure 9. +The obtained controller is shown below, and the bode plot of the Loop Gain is shown in Figure 9.

K = 14e8 * ... % Gain
@@ -620,7 +632,7 @@ The obtained controller is shown below, and the bode plot of the Loop Gain is sh
 
-
+

loop_gain_manual_afm.png

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

@@ -668,11 +680,11 @@ And we can verify that we have the wanted stability margins:
-
-

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

+
+

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

- +

@@ -699,7 +711,7 @@ where:

  • K is the synthesize controller
  • -
    +

    Matlab documentation of loopsyn (link).

    @@ -708,11 +720,11 @@ Matlab documentation of loopsyn ( -

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

    +
    +

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

    - +

    @@ -743,11 +755,7 @@ The \(\mathcal{H}_\infty\) optimal open loop shaping synthesis is performed usin

    -

    -The Bode plot of the obtained controller is shown in Figure 10. -

    - -
    +

    It is always important to analyze the controller after the synthesis is performed.

    @@ -759,7 +767,7 @@ In the end, a synthesize controller is just a combination of low pass filters, h

    -Let’s briefly analyze this controller: +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
    • @@ -768,28 +776,28 @@ Let’s briefly analyze this controller:
    -
    +

    open_loop_shaping_hinf_K.png

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

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

    -
    +

    open_loop_shaping_hinf_L.png

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

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

    - +
    @@ -830,22 +838,29 @@ Let’s now compare the obtained stability margins of the \(\mathcal{H}_\inf -
    -

    3 First Steps in the \(\mathcal{H}_\infty\) world

    +
    +

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

    - +

    +
    -
    -

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

    +
    +

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

    - +

    -
    +

    The \(\mathcal{H}_\infty\) norm is defined as the peak of the maximum singular value of the frequency response

    @@ -862,7 +877,7 @@ For a SISO system \(G(s)\), it is simply the peak value of \(|G(j\omega)|\) as a
    -
    +

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

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

    -We can see that the \(\mathcal{H}_\infty\) norm of \(G(s)\) does corresponds to the peak value of \(|G(j\omega)|\) as a function of frequency as shown in Figure 12. +We can see that the \(\mathcal{H}_\infty\) norm of \(G(s)\) does corresponds to the peak value of \(|G(j\omega)|\) as a function of frequency as shown in Figure 12.

    -
    +

    hinfinity_norm_siso_bode.png

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

    @@ -891,14 +906,14 @@ We can see that the \(\mathcal{H}_\infty\) norm of \(G(s)\) does corresponds to
    -
    -

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

    +
    +

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

    - +

    -
    +

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

    @@ -929,16 +944,16 @@ Note that there are many ways to use the \(\mathcal{H}_\infty\) Synthesis:
  • Open Loop Shaping \(\mathcal{H}_\infty\) Synthesis (loopsyn doc)
  • Mixed Sensitivity Loop Shaping (mixsyn doc)
  • Fixed-Structure \(\mathcal{H}_\infty\) Synthesis (hinfstruct doc)
  • -
  • Signal Based \(\mathcal{H}_\infty\) Synthesis
  • +
  • Signal Based \(\mathcal{H}_\infty\) Synthesis, and many more…
  • -
    -

    3.3 The Generalized Plant

    +
    +

    3.3 The Generalized Plant

    - +

    @@ -948,9 +963,9 @@ It makes things much easier for the following steps.

    -The generalized plant, usually noted \(P(s)\), is shown in Figure 13. +The generalized plant, usually noted \(P(s)\), is shown in Figure 13. It has two inputs and two outputs (both could contains many signals). -The meaning of the inputs and outputs are summarized in Table 4. +The meaning of the inputs and outputs are summarized in Table 4.

    @@ -963,14 +978,14 @@ It can indeed represent feedback as well as feedforward control architectures. \end{equation} -

    +

    general_plant.png

    Figure 13: Inputs and Outputs of the generalized Plant

    -
    -
    Table 3: Comparison of the characteristics obtained with the two methods
    +
    +
    @@ -1016,18 +1031,18 @@ It can indeed represent feedback as well as feedforward control architectures. -
    -

    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
    @@ -1042,7 +1057,7 @@ After \(K\) is found, the system is robustified by adjusting the response
    -
    +

    general_control_names.png

    Figure 14: General Control Configuration

    @@ -1074,28 +1089,28 @@ where:
    -
    -

    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 15 to a generalized Plant is as follows: +The procedure to convert a typical control architecture as the one shown in Figure 15 to a generalized Plant is as follows:

    1. Define signals (\(w\), \(z\), \(u\) and \(v\)) of the generalized plant
    2. Remove \(K\) and rearrange the inputs and outputs to match the generalized configuration
    -
    +

    -Compute the Generalized plant of corresponding to the tracking control architecture shown in Figure 15 +Compute the Generalized plant of corresponding to the tracking control architecture shown in Figure 15

    -
    +

    classical_feedback_tracking.png

    Figure 15: Classical Feedback Control Architecture (Tracking)

    @@ -1119,11 +1134,11 @@ Then, Remove \(K\) and rearrange the inputs and outputs.
    Answer

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

    -
    +

    mixed_sensitivity_ref_tracking.png

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

    @@ -1147,37 +1162,35 @@ P.OutputName = {'e', 'u
    -
    -

    4 Modern Interpretation of the Control Specifications

    +
    +

    4 Modern Interpretation of Control Specifications

    - -

    -
    - -
    -

    4.1 Introduction

    -
    -

    -As shown in Section 2, the loop gain \(L(s) = G(s) K(s)\) is a useful and easy tool for the manual design of controllers. +

    +

    -\(L(s)\) is very easy to shape as it depends linearly on \(K(s)\). +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)\).

    -However, the loop gain \(L(s)\) does not directly give the performances of the closed-loop system. -The closed loop system behavior is indeed determined by the closed-loop transfer functions. +However, the loop gain \(L(s)\) does not directly give the performances of the closed-loop system, which are determined by the closed-loop transfer functions.

    -If we consider the feedback system shown in Figure 17, we can link to the following specifications to closed-loop transfer functions. -This is summarized in Table 5. +If we consider the feedback system shown in Figure 17, we can link to the following specifications to closed-loop transfer functions. +This is summarized in Table 5.

    -
    Table 4: Notations for the general configuration
    +
    @@ -1219,34 +1232,33 @@ This is summarized in Table 5. - +
    Table 5: Typical Specification and associated closed-loop transfer function
    Robustness (stability margins)Module margin (see Section 4.4)Module margin (see Section 4.3)
    -
    +

    gang_of_four_feedback.png

    Figure 17: Simple Feedback Architecture

    -
    -
    -

    4.2 Closed Loop Transfer Functions

    -
    +
    +

    4.1 Closed Loop Transfer Functions

    +

    - +

    As the performances of a controlled system depend on the closed loop transfer functions, it is very important to derive these closed-loop transfer functions as a function of the plant \(G(s)\) and controller \(K(s)\).

    -
    +

    -Write the output signals \([\epsilon, u, y]\) as a function of the systems \(K(s), G(s)\) and of the input signals \([r, d, n]\) as shown in Figure 17. +Write the output signals \([\epsilon, u, y]\) as a function of the systems \(K(s), G(s)\) and of the input signals \([r, d, n]\) as shown in Figure 17.

    Hint @@ -1270,7 +1282,7 @@ Do the same procedure for \(u\) and \(\epsilon\)

    -
    Anwser +
    Answer

    The following equations should be obtained:

    @@ -1283,9 +1295,9 @@ The following equations should be obtained:
    -
    +

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

    \begin{align} @@ -1297,7 +1309,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. @@ -1315,29 +1327,35 @@ And we have: \end{align}

    -Thus, for reference tracking, we want to shape the 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 want to act on the complementary sensitivity function \(T(s)\). +Thus, for reference tracking, we have to shape the 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)\).

    -
    -

    4.3 Sensitivity Function

    -
    +
    +

    4.2 Sensitivity Function

    +

    - +

    +

    +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 “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 are shown in Figure 18 and the corresponding step responses are shown in Figure 19. +The obtained sensitivity functions are shown in Figure 18 and the corresponding step responses are shown in Figure 19.

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

    - +
    @@ -1376,20 +1394,20 @@ The comparison of the sensitivity functions shapes and their effect on the step
    Table 6: Comparison of the sensitivity function shape and the corresponding step response for the three controller variations
    -
    +

    sensitivity_shape_effect.png

    Figure 18: 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 19: 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. @@ -1402,9 +1420,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 in Figure 20. +From the simple analysis above, we can draw a first estimation of the wanted shape for the sensitivity function in Figure 20.

    @@ -1419,7 +1437,7 @@ This will become clear in the next section about the module margin. -

    +

    h-infinity-spec-S.png

    Figure 20: Typical wanted shape of the Sensitivity transfer function

    @@ -1429,18 +1447,18 @@ This will become clear in the next section about the module margin.
    -
    -

    4.4 Robustness: Module Margin

    -
    +
    +

    4.3 Robustness: Module Margin

    +

    - +

    Let’s start by an example demonstrating why the phase and gain margins might not be good indicators of robustness.

    -
    +

    Let’s consider the following plant \(G_t(s)\):

    @@ -1454,7 +1472,7 @@ Gt = 1/k*(s

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

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

    -The following characteristics can be determined from Figure 21: +The following characteristics can be determined from Figure 21:

    • bandwidth of \(\approx 10\, \text{Hz}\)
    • @@ -1476,7 +1494,7 @@ This might indicate very good robustness properties of the closed-loop system.

      -
      +

      phase_gain_margin_model_plant.png

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

      @@ -1488,12 +1506,11 @@ Now let’s suppose the “real” plant \(G_r(s)\) as a slightly lo

      xi = 0.03;
      -Gr = 1/k*(s/w0/4 + 1)/(s^2/w0^2 + 2*xi*s/w0 + 1);
       

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

      @@ -1501,7 +1518,7 @@ At a frequency little bit above 100Hz, the phase of the loop gain reaches -180 d It is confirmed by checking the stability of the closed loop system:

      -
      isstable(feedback(Gp,K))
      +
      isstable(feedback(Gr,K))
       
      @@ -1511,7 +1528,7 @@ It is confirmed by checking the stability of the closed loop system: -
      +

      phase_gain_margin_real_plant.png

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

      @@ -1531,7 +1548,7 @@ 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 is unstable for any encirclement of the point \(−1\) on the Nyquist plot.
      @@ -1540,7 +1557,7 @@ Let’s now determine a new robustness indicator based on the Nyquist Stabil
      -
      +

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

      @@ -1548,24 +1565,34 @@ For more information about the general Nyquist Stability Criteria, you ma

      -From the Nyquist stability criteria, it is clear that we want \(L(j\omega)\) to be as far away from the \(-1\) point (called the unstable point) in the complex plane. -From this, we define the module margin. +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 unstable point) in the complex plane. +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 23. +A typical Nyquist plot is shown in Figure 23. The gain, phase and module margins are graphically shown to have an idea of what they represent.

      + +
      +

      module_margin_example.png +

      +

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

      +
      + +
      +

      -As expected from Figure 23, there is a close relationship between the module margin and the gain and phase margins. +As expected from Figure 23, 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} @@ -1573,12 +1600,6 @@ We can indeed show that for a given value of the module margin \(\Delta M\), we \end{equation} -
      -

      module_margin_example.png -

      -

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

      -
      -

      Let’s now try to express the Module margin \(\Delta M\) as an \(\mathcal{H}_\infty\) norm of a closed-loop transfer function:

      @@ -1590,7 +1611,7 @@ Let’s now try to express the Module margin \(\Delta M\) as an \(\mathcal{H &= \frac{1}{\|S\|_\infty} \end{align*} -
      +

      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.

      @@ -1607,16 +1628,17 @@ The wanted robustness of the closed-loop system can be specified by setting a ma

      Note that this is why large peak value of \(|S(j\omega)|\) usually indicate robustness problems. +And we know 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.

      @@ -1625,300 +1647,41 @@ To learn more about module/disk margin, you can check out -

      4.5 How to Shape transfer function? Using of Weighting Functions!

      -
      +
      +

      4.4 Other Requirements

      +

      - +

      +

      +Interpretation of the \(\mathcal{H}_\infty\) norm of systems: +

        -
      • [ ] Maybe put this section in Previous chapter
      • +
      • frequency by frequency attenuation / amplification

      -Let’s say we want to shape the sensitivity transfer function corresponding to the transfer function from \(r\) to \(\epsilon\) of the control architecture shown in Figure 24. -

      - - -
      -

      loop_shaping_S_without_W.png -

      -

      Figure 24: Generalized Plant

      -
      - -

      -If the \(\mathcal{H}_\infty\) synthesis is directly applied on the generalized plant \(P(s)\) shown in Figure 24, if will minimize the \(\mathcal{H}_\infty\) norm of transfer function from \(r\) to \(\epsilon\) (the sensitivity transfer function). +Let’s note \(G_t(s)\) the closed-loop transfer function from \(w\) to \(z\).

      -However, as the \(\mathcal{H}_\infty\) norm is the maximum peak value of the transfer function’s magnitude, it does not allow to shape the norm over all frequencies. -

      - - - -

      -A trick is to include a weighting function in the generalized plant as shown in Figure 25. -Applying the \(\mathcal{H}_\infty\) synthesis to the weighted generalized plant \(\tilde{P}(s)\) (Figure 25) will generate a controller \(K(s)\) that minimizes the \(\mathcal{H}_\infty\) norm between \(r\) and \(\tilde{\epsilon}\): -

      -\begin{align} - & \left\| \frac{\tilde{\epsilon}}{r} \right\|_\infty < \gamma (=1)\nonumber \\ - \Leftrightarrow & \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} - -
      -

      -As shown in Equation \eqref{eq:sensitivity_shaping}, the \(\mathcal{H}_\infty\) synthesis allows to shape the magnitude of the sensitivity transfer function. -Therefore, the choice of the weighting function \(W_s(s)\) is very important. -Its inverse magnitude will define the frequency dependent upper bound of the sensitivity transfer function magnitude. -

      - -
      - - -
      -

      loop_shaping_S_with_W.png -

      -

      Figure 25: Weighted Generalized Plant

      -
      - -

      -Once the weighting function is designed, it should be added to the generalized plant as shown in Figure 25. -

      - -

      -The weighted generalized plant can be defined in Matlab by either re-defining all the inputs or by pre-multiplying the (non-weighted) generalized plant by a block-diagonal MIMO transfer function containing the weights for the outputs \(z\) and 1 for the outputs \(v\). -

      - -
      -
      Pw = [Ws -Ws*G;
      -      1  -G]
      -
      -% Alternative
      -Pw = blkdiag(Ws, 1)*P;
      -
      -
      -
      -
      - -
      -

      4.6 Design of Weighting Functions

      -
      -

      - -

      - -

      -Weighting function used 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
      -
      minimum phase
      no zeros in the right half plane
      -
      - -

      -Matlab is providing the makeweight function that creates a first-order weights by specifying the low frequency gain, high frequency gain, and a gain at a specific frequency: -

      -
      -
      W = makeweight(dcgain,[freq,mag],hfgain)
      -
      -
      -

      +Consider an input sinusoidal signal \(w(t) = \sin\left( \omega_0 t \right)\), then the output signal \(z(t)\) will be equal to: +\[ z(t) = A \sin\left( \omega_0 t + \phi \right) \] with:

        -
      • dcgain
      • -
      • freq
      • -
      • mag
      • -
      • hfgain
      • +
      • \(A = |G_t(j\omega_0)|\) is the magnitude of \(G_t(s)\) at \(\omega_0\)
      • +
      • \(\phi = \angle G_t(j\omega_0)\) is the phase of \(G_t(s)\) at \(\omega_0\)
      -
      -

      -The Matlab code below produces a weighting function with a magnitude shape shown in Figure 26. -

      - -
      -
      Ws = makeweight(1e2, [2*pi*10, 1], 1/2);
      -
      -
      - - -
      -

      first_order_weight.png -

      -

      Figure 26: Obtained Magnitude of the Weighting Function

      -
      - -
      - -
      -

      -Quite often, higher orders weights are required. -

      -In such case, the following formula can be used the design of these weights: +Noise Attenuation: typical wanted shape for \(T\)

      -\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: -

      -
        -
      • the low frequency gain: \(G_0 = lim_{\omega \to 0} |W(j\omega)|\)
      • -
      • the high frequency gain: \(G_\infty = lim_{\omega \to \infty} |W(j\omega)|\)
      • -
      • the absolute gain at \(\omega_0\): \(G_c = |W(j\omega_0)|\)
      • -
      • the absolute slope between high and low frequency: \(n\)
      • -
      - -

      -A Matlab function implementing Equation \eqref{eq:weight_formula_advanced} is shown below: -

      - -
      -
      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
      -
      -
      - -

      -Let’s use this function to generate three weights with the same high and low frequency gains, but but different slopes. -

      - -
      -
      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);
      -
      -
      - -

      -The obtained shapes are shown in Figure 27. -

      - - -
      -

      high_order_weight.png -

      -

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

      -
      - -
      -
      -
      - -
      -

      4.7 Sensitivity Function Shaping - Example

      -
      -

      - -

      - - -
        -
      • Robustness: Module margin > 2 (\(\Rightarrow \text{GM} > 2 \text{ and } \text{PM} > 29^o\))
      • -
      • Bandwidth:
      • -
      • Slope of -2
      • -
      - -

      -First, the weighting functions is generated. -

      -
      -
      Ws = generateWeight('G0', 1e3, 'G1', 1/2, 'Gc', 1, 'wc', 2*pi*10, 'n', 2);
      -
      -
      - -

      -It is then added to the generalized plant. -

      -
      -
      Pw = blkdiag(Ws, 1)*P;
      -
      -
      - -

      -And the \(\mathcal{H}_\infty\) synthesis is performed. -

      -
      -
      K = hinfsyn(Pw, 1, 1, 'Display', 'on');
      -
      -
      - -
      -K = hinfsyn(Pw, 1, 1, 'Display', 'on');
      -
      -  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     4.497e-28     p
      -  Limiting gains...
      -  5.05e-01     0.0e+00     0.0e+00     0.000e+00     p
      -  5.05e-01    -1.8e+01 #  -2.9e-15     1.514e-15     f
      -
      -  Best performance (actual): 0.504
      -
      - -

      -The obtained \(\gamma \approx 0.5\) means that it found a controller \(K(s)\) that stabilize the closed-loop system, and such that: -

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

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

      - - -
      -

      results_sensitivity_hinf.png -

      -

      Figure 28: Weighting function and obtained closed-loop sensitivity

      -
      -
      -
      - -
      -

      4.8 Complementary Sensitivity Function

      -
      - - -
      -

      4.9 Summary

      -
      - - +
      Table 7: Table caption
      +@@ -1966,55 +1729,470 @@ This is indeed what we can see by comparing \(|S|\) and \(|W_S|\) in Figure
      Table 7: Typical Specifications and corresponding wanted norms of open and closed loop tansfer functions
      - - -
      -

      h-infinity-4-blocs-constrains.png -

      -

      Figure 29: Shaping the Gang of Four: Limitations

      -
      - -
      -

      5 \(\mathcal{H}_\infty\) Mixed-Sensitivity Synthesis

      +
      +

      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. +

      + +

      +Therefore, the synthesis problem is to design \(K(s)\) such that closed-loop system is stable and such that various 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! +

      + +

      +This +Section 5.1 +Section 5.2 +Section 5.3 +Section 5.4

      -
      -

      5.1 Problem

      +
      +

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

      +
      +

      + +

      + +

      +If the \(\mathcal{H}_\infty\) synthesis is applied on the generalized plant \(P(s)\) shown in Figure 24, 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. +This closed-loop transfer function actually correspond to the sensitivity function. +Therefore, it will minimize the 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 and clearly does not allow to shape the norm of \(S(j\omega)\) over all frequencies. +

      + + +
      +

      loop_shaping_S_without_W.png +

      +

      Figure 24: Generalized Plant

      -
      -

      5.2 Typical Procedure

      + +
      +

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

      + +

      +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 weighted generalized plant \(\tilde{P}(s)\) will generate a controller \(K(s)\) such that \(\|W_s(s)S(s)\|_\infty\) is minimized. +

      +
      -
      -

      5.3 Step 1 - Shaping of the Sensitivity Function

      +

      +Let’s now show how this is equivalent as 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} + +
      +

      +As shown in Equation \eqref{eq:sensitivity_shaping}, the \(\mathcal{H}_\infty\) synthesis applying on the weighted generalized plant allows to shape the magnitude of the sensitivity transfer function. +

      + +

      +Therefore, the choice of the weighting function \(W_s(s)\) is very important: its inverse magnitude will define the wanted upper bound of the sensitivity function magnitude. +

      +
      -
      -

      5.4 Step 2 - Shaping of

      + +
      +

      loop_shaping_S_with_W.png +

      +

      Figure 25: Weighted Generalized Plant

      -
      -

      5.5 General Configuration for various shaping

      -
      +
      +

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

      + +
      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\)
      • +
      +
      + +
      Answer +

      +The two solutions below can be used. +

      + +
      +
      Pw = [Ws -Ws*G;
      +      1  -G];
      +
      +
      + +
      +
      Pw = blkdiag(Ws, 1)*P;
      +
      +
      + +

      +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. +

      +
      + +
      +
      +
      + +
      +

      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
      +
      minimum phase
      no zeros in the right half plane
      +
      + +
      + +

      +Matlab is providing the makeweight function that allows to design first-order weights by specifying the low frequency gain, high frequency gain, and the gain at a specific frequency: +

      +
      +
      W = makeweight(dcgain,[freq,mag],hfgain)
      +
      +
      +

      +with: +

      +
        +
      • dcgain: low frequency gain
      • +
      • [freq,mag]: frequency freq at which the gain is mag
      • +
      • hfgain: high frequency gain
      • +
      + +
      +

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

      +
        +
      • Low frequency gain of 100
      • +
      • Gain of 1 at 10Hz
      • +
      • High frequency gain of 0.5
      • +
      + +
      +
      Ws = makeweight(1e2, [2*pi*10, 1], 1/2);
      +
      +
      + + +
      +

      first_order_weight.png +

      +

      Figure 26: Obtained Magnitude of the Weighting Function

      +
      + +
      + +
      +

      +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: +

      +
        +
      • the low frequency gain: \(G_0 = lim_{\omega \to 0} |W(j\omega)|\)
      • +
      • the high frequency gain: \(G_\infty = lim_{\omega \to \infty} |W(j\omega)|\)
      • +
      • the absolute gain at \(\omega_0\): \(G_c = |W(j\omega_0)|\)
      • +
      • the absolute slope between high and low frequency: \(n\)
      • +
      + +

      +A Matlab function implementing Equation \eqref{eq:weight_formula_advanced} is shown below: +

      + +
      +
      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
      +
      +
      + +

      +Let’s use this function to generate three weights with the same high and low frequency gains, but but different slopes. +

      + +
      +
      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);
      +
      +
      + +

      +The obtained shapes are shown in Figure 27. +

      + + +
      +

      high_order_weight.png +

      +

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

      +
      + +
      +
      +
      + +
      +

      5.3 Shaping the Sensitivity Function

      +
      +

      + +

      + +

      +Let’s design a controller using the \(\mathcal{H}_\infty\) synthesis that fulfils the following requirements: +

      +
        +
      1. Bandwidth of at least 10Hz
      2. +
      3. Small static errors for step responses
      4. +
      5. Robustness: Large module margin \(\Delta M > 0.5\) (\(\Rightarrow \Delta G > 2\) and \(\Delta \phi > 29^o\))
      6. +
      + +

      +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 Weight using Matlab. +

      + +
      Hint +

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

      + +

      +More precisely: +

      +
        +
      1. Recall that the closed-loop bandwidth is defined as the frequency \(|S(j\omega)|\) first crosses \(1/\sqrt{2} = -3dB\) from below
      2. +
      3. For the small static error, -60dB is usually enough as other factors (measurement noise, disturbances) will anyhow limit the performances
      4. +
      5. 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} \]
      6. +
      + +

      +Remember that the wanted upper bound of the sensitivity function is defined by the inverse magnitude of the weight. +

      + + +
      +

      h-infinity-spec-S.png +

      +

      Figure 28: Typical wanted shape of the Sensitivity transfer function

      +
      +
      + +
      Answer +
        +
      1. \(|W_s(j \cdot 2 \pi 10)| = \sqrt{2}\)
      2. +
      3. \(|W_s(j \cdot 0)| = 10^3\)
      4. +
      5. \(\|W_s\|_\infty = 0.5\)
      6. +
      + +

      +Using Matlab, such weighting function can be generated using the makeweight function as shown below: +

      +
      +
      Ws = makeweight(1e3, [2*pi*10, sqrt(2)], 1/2);
      +
      +
      + +

      +Or using the generateWeight function: +

      +
      +
      Ws = generateWeight('G0', 1e3, ...
      +                    'G1', 1/2, ...
      +                    'Gc', sqrt(2), 'wc', 2*pi*10, ...
      +                    'n', 2);
      +
      +
      +
      + +
      + +

      +Let’s say we came up with the following weighting function: +

      +
      +
      Ws = generateWeight('G0', 1e3, ...
      +                    'G1', 1/2, ...
      +                    'Gc', sqrt(2), 'wc', 2*pi*10, ...
      +                    'n', 2);
      +
      +
      + +

      +The weighting function is then added to the generalized plant. +

      +
      +
      P = [1 -G;
      +     1 -G];
      +Pw = blkdiag(Ws, 1)*P;
      +
      +
      + +

      +And the \(\mathcal{H}_\infty\) synthesis is performed on the weighted generalized plant. +

      +
      +
      K = hinfsyn(Pw, 1, 1, 'Display', 'on');
      +
      +
      + +
      +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
      +
      + +

      +\(\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: +

      +\begin{aligned} + & \| 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} + +

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

      + +
      +

      +Having \(\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. +

      + +

      +Having \(\gamma\) slightly above one does not necessary means the obtained controller is not “good”. +It just means that at some frequency, one of the closed-loop transfer functions is above the specified upper bound by a factor \(\gamma\). +

      + +
      + + +
      +

      results_sensitivity_hinf.png +

      +

      Figure 29: Weighting function and obtained closed-loop sensitivity

      +
      +
      +
      + +
      +

      5.4 Shaping multiple closed-loop transfer functions

      +
      +

      + +

      + +

      +As was shown in Section 4, depending on the specifications, up to four closed-loop transfer function may be shaped (the Gang of four). +This was summarized in Table 7. +

      + +

      +For instance to limit the control input \(u\), \(KS\) should be shaped while to filter measurement noise, \(T\) should be shaped. +

      + +

      +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. +

      + +

      +Depending on the closed-loop transfer function being shaped, different general control configuration are used and are described below. +

      Shaping of S and KS -
      +

      general_conf_shaping_S_KS.png

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

      -
      P = [W1 -G*W1
      +
      P = [W1 -G*W1
            0   W2
            1  -G];
       
      @@ -2027,14 +2205,14 @@ This is indeed what we can see by comparing \(|S|\) and \(|W_S|\) in Figure
      Shaping of S and T -
      +

      general_conf_shaping_S_T.png

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

      -31
      P = [W1 -G*W1
      +
      P = [W1 -G*W1
            0   G*W2
            1   -G];
       
      @@ -2047,14 +2225,14 @@ This is indeed what we can see by comparing \(|S|\) and \(|W_S|\) in Figure
      Shaping of S, T and KS -
      +

      general_conf_shaping_S_T_KS.png

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

      -32
      P = [W1 -G*W1
      +
      P = [W1 -G*W1
            0   W2
            0   G*W3
            1   -G];
      @@ -2069,14 +2247,14 @@ This is indeed what we can see by comparing \(|S|\) and \(|W_S|\) in Figure 
       
      Shaping of S, T, KS and GS -
      +

      general_conf_shaping_S_T_KS_GS.png

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

      -33
      P = [ W1  -W1*G*W3 -G*W1
      +
      P = [ W1  -W1*G*W3 -G*W1
             0    0        W2
             1   -G*W3    -G];
       
      @@ -2089,22 +2267,147 @@ This is indeed what we can see by comparing \(|S|\) and \(|W_S|\) in Figure \(W_2W_3\) is used to shape \(T\)
    +

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

    +
      +
    • The shaped closed-loop transfer functions are linked by mathematical relations and cannot be shaped
    • +
    • Closed-loop transfer function can only be shaped in certain frequency range.
    • +
    • The size of the obtained controller may be very large and not implementable in practice
    • +
    + + + +
    +

    +Mathematical relations are linking the closed-loop transfer functions. +For instance, the sensitivity function \(S(s)\) and the complementary sensitivity function \(T(s)\) as link 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 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. +

    + +
    + +

    +The control bandwidth is clearly limited by physical constrains such as sampling frequency, electronics bandwidth, +

    + +\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*} + +

    +Similar relationship can be found for \(T\), \(KS\) and \(GS\). +

    + +
    + +

    +Depending on the frequency band, the norms of the closed-loop transfer functions depend on the controller \(K\) and therefore can be shaped. +However, in some frequency bands, the norms do not depend on the controller and therefore 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 34. +

    + + +
    +

    h-infinity-4-blocs-constrains.png +

    +

    Figure 34: Shaping the Gang of Four: Limitations

    +
    + +
    +

    +The order (resp. number of state) of the controller given by the \(\mathcal{H}_\infty\) synthesis is equal to the order (resp. 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. +

    + +

    +Two approaches can be used to obtain controllers with reasonable order: +

    +
      +
    1. use simple weights (usually first order)
    2. +
    3. perform a model reduction on the obtained high order controller
    4. +
    + +
    -
    -

    6 Conclusion

    +
    +

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

    - + +

    +
    + +
    +

    6.1 Problem

    +
    + +
    +

    6.2 Typical Procedure

    +
    + +
    +

    6.3 Step 1 - Shaping of the Sensitivity Function

    +
    + +
    +

    6.4 Step 2 - Shaping of

    +
    +
    + +
    +

    7 Conclusion

    +
    +

    +

    -
    -

    7 Resources

    -
    +
    +

    Resources

    +

    @@ -2117,7 +2420,7 @@ This is indeed what we can see by comparing \(|S|\) and \(|W_S|\) in Figure

    Author: Dehaeze Thomas

    -

    Created: 2020-12-01 mar. 13:40

    +

    Created: 2020-12-01 mar. 18:49

    diff --git a/index.org b/index.org index c857212..9b37339 100644 --- a/index.org +++ b/index.org @@ -67,6 +67,12 @@ This document is structured 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 <> @@ -396,6 +402,8 @@ And now the system dynamics $G(s)$ and $G_d(s)$ (their bode plots are shown in F freqs = logspace(0, 3, 1000); figure; + tiledlayout(1, 1, 'TileSpacing', 'None', 'Padding', 'None'); + nexttile; hold on; plot(freqs, abs(squeeze(freqresp(Gd, freqs, 'Hz')))); hold off; @@ -417,6 +425,13 @@ And now the system dynamics $G(s)$ and $G_d(s)$ (their bode plots are shown in F * Classical Open Loop Shaping <> +** Introduction :ignore: + +- Section [[sec:open_loop_shaping_introduction]] +- Section [[sec:loop_shaping_example]] +- Section [[sec:h_infinity_open_loop_shaping]] +- Section [[sec:h_infinity_open_loop_shaping_example]] + ** Introduction to Loop Shaping <> @@ -631,15 +646,13 @@ The $\mathcal{H}_\infty$ optimal open loop shaping synthesis is performed using [K, ~, GAM] = loopsyn(G, Lw); #+end_src -The Bode plot of the obtained controller is shown in Figure [[fig:open_loop_shaping_hinf_K]]. - #+begin_important It is always important to analyze the controller after the synthesis is performed. In the end, a synthesize controller is just a combination of low pass filters, high pass filters, notches, leads, etc. #+end_important -Let's briefly analyze this controller: +Let's briefly analyze the obtained controller which bode plot is shown in Figure [[fig:open_loop_shaping_hinf_K]]: - two integrators are used at low frequency to have the wanted low frequency high gain - a lead is added centered with the crossover frequency to increase the phase margin - 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) @@ -675,7 +688,7 @@ Let's briefly analyze this controller: #+RESULTS: [[file:figs/open_loop_shaping_hinf_K.png]] -The obtained Loop Gain is shown in Figure [[fig:open_loop_shaping_hinf_L]]. +The obtained Loop Gain is shown in Figure [[fig:open_loop_shaping_hinf_L]] and matches the specified one by a factor $\gamma$. #+begin_src matlab :exports none freqs = logspace(0, 3, 1000); @@ -736,9 +749,17 @@ Let's now compare the obtained stability margins of the $\mathcal{H}_\infty$ con | Phase Margin $> 30$ [deg] | 35.4 | 54.7 | | Crossover $\approx 10$ [Hz] | 10.1 | 9.9 | -* First Steps in the $\mathcal{H}_\infty$ world +* A first Step into the $\mathcal{H}_\infty$ world <> +** Introduction :ignore: + +- Section [[sec:h_infinity_norm]] +- Section [[sec:h_infinity_synthesis]] +- Section [[sec:generalized_plant]] +- Section [[sec:h_infinity_general_synthesis]] +- Section [[sec:generalized_plant_derivation]] + ** The $\mathcal{H}_\infty$ Norm <> @@ -810,7 +831,7 @@ Note that there are many ways to use the $\mathcal{H}_\infty$ Synthesis: - Open Loop Shaping $\mathcal{H}_\infty$ Synthesis (=loopsyn= [[https://www.mathworks.com/help/robust/ref/loopsyn.html][doc]]) - Mixed Sensitivity Loop Shaping (=mixsyn= [[https://www.mathworks.com/help/robust/ref/lti.mixsyn.html][doc]]) - Fixed-Structure $\mathcal{H}_\infty$ Synthesis (=hinfstruct= [[https://www.mathworks.com/help/robust/ref/lti.hinfstruct.html][doc]]) -- Signal Based $\mathcal{H}_\infty$ Synthesis +- Signal Based $\mathcal{H}_\infty$ Synthesis, and many more... ** The Generalized Plant <> @@ -1007,18 +1028,21 @@ Using Matlab, the generalized plant can be defined as follows: P.OutputName = {'e', 'u', 'v'}; #+end_src -* Modern Interpretation of the Control Specifications +* Modern Interpretation of Control Specifications <> -** Introduction +** Introduction :ignore: -As shown in Section [[sec:open_loop_shaping]], the loop gain $L(s) = G(s) K(s)$ is a useful and easy tool for the manual design of controllers. +- Section [[sec:closed_loop_tf]] +- Section [[sec:sensitivity_transfer_functions]] +- Section [[sec:module_margin]] +- Section [[sec:other_requirements]] -$L(s)$ is very easy to shape as it depends linearly on $K(s)$. +As shown in Section [[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 /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 *not* directly give the performances of the closed-loop system. -The closed loop system behavior is indeed determined by the *closed-loop* transfer functions. +However, the loop gain $L(s)$ does *not* directly give the performances of the closed-loop system, which are determined by the *closed-loop* transfer functions. If we consider the feedback system shown in Figure [[fig:gang_of_four_feedback]], we can link to the following specifications to closed-loop transfer functions. This is summarized in Table [[tab:spec_closed_loop_tf]]. @@ -1082,7 +1106,7 @@ Isolate $y$ at the right hand side, and finally obtain: Do the same procedure for $u$ and $\epsilon$ #+HTML: -#+HTML:
    Anwser +#+HTML:
    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 \\ @@ -1115,12 +1139,16 @@ And we have: u &= KS r - S d - KS n \end{align} -Thus, for reference tracking, we want to shape the /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 want to act on the complementary sensitivity function $T(s)$. +Thus, for reference tracking, we have to shape the /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)$. ** Sensitivity Function <> +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 "/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 are shown in Figure [[fig:sensitivity_shape_effect]] and the corresponding step responses are shown in Figure [[fig:sensitivity_shape_effect_step]]. @@ -1342,6 +1370,9 @@ This might indicate very good robustness properties of the closed-loop system. Now let's suppose the "real" plant $G_r(s)$ as a slightly lower damping factor: #+begin_src matlab xi = 0.03; +#+end_src + +#+begin_src matlab :exports none Gr = 1/k*(s/w0/4 + 1)/(s^2/w0^2 + 2*xi*s/w0 + 1); #+end_src @@ -1350,7 +1381,7 @@ At a frequency little bit above 100Hz, the phase of the loop gain reaches -180 d It is confirmed by checking the stability of the closed loop system: #+begin_src matlab :results value replace - isstable(feedback(Gp,K)) + isstable(feedback(Gr,K)) #+end_src #+RESULTS: @@ -1413,23 +1444,18 @@ Let's now determine a new robustness indicator based on the Nyquist Stability Cr For more information about the /general/ Nyquist Stability Criteria, you may want to look at [[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 away from the $-1$ point (called the /unstable point/) in the complex plane. -From this, we define the *module margin*. +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 /unstable point/) in the complex plane. +This minimum distance is called the *module margin*. #+begin_definition - 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. #+end_definition +#+begin_exampl A typical Nyquist plot is shown in Figure [[fig:module_margin_example]]. The gain, phase and module margins are graphically shown to have an idea of what they represent. -As expected from Figure [[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{\Delta M}{\Delta M - 1}; \quad \Delta \phi \ge \frac{1}{\Delta M} -\end{equation} - #+begin_src matlab :exports none % Example Plant k = 1e6; % Stiffness [N/m] @@ -1485,6 +1511,14 @@ We can indeed show that for a given value of the module margin $\Delta M$, we ha #+caption: Nyquist plot with visual indication of the Gain margin $\Delta G$, Phase margin $\Delta \phi$ and Module margin $\Delta M$ #+RESULTS: [[file:figs/module_margin_example.png]] +#+end_exampl + +As expected from Figure [[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{\Delta M}{\Delta M - 1}; \quad \Delta \phi \ge \frac{1}{\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*} @@ -1506,6 +1540,7 @@ The wanted robustness of the closed-loop system can be specified by setting a ma #+end_important Note that this is why large peak value of $|S(j\omega)|$ usually indicate robustness problems. +And we know 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$ @@ -1515,12 +1550,59 @@ Note that this is why large peak value of $|S(j\omega)|$ usually indicate robust To learn more about module/disk margin, you can check out [[https://www.youtube.com/watch?v=XazdN6eZF80][this]] video. #+end_seealso -** How to *Shape* transfer function? Using of Weighting Functions! +** TODO Other Requirements +<> + +Interpretation of the $\mathcal{H}_\infty$ norm of systems: +- frequency by frequency attenuation / amplification + +Let's note $G_t(s)$ the closed-loop transfer function from $w$ to $z$. + +Consider an input sinusoidal signal $w(t) = \sin\left( \omega_0 t \right)$, then the output signal $z(t)$ will be equal to: +\[ z(t) = A \sin\left( \omega_0 t + \phi \right) \] +with: +- $A = |G_t(j\omega_0)|$ is the magnitude of $G_t(s)$ at $\omega_0$ +- $\phi = \angle G_t(j\omega_0)$ is the phase of $G_t(s)$ at $\omega_0$ + + +Noise Attenuation: typical wanted shape for $T$ + +#+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 | + +* $\mathcal{H}_\infty$ Shaping of closed-loop transfer functions +<> + +** Introduction :ignore: + +In the previous sections, we have seen that the performances of the system depends on the *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 various 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! + +This +Section [[sec:weighting_functions]] +Section [[sec:weighting_functions_design]] +Section [[sec:sensitivity_shaping_example]] +Section [[sec:shaping_multiple_tf]] + +** How to Shape closed-loop transfer function? Using Weighting Functions! <> -- [ ] Maybe put this section in Previous chapter +If the $\mathcal{H}_\infty$ synthesis is applied on the generalized plant $P(s)$ shown in Figure [[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. +This closed-loop transfer function actually correspond to the sensitivity function. +Therefore, it will minimize the the $\mathcal{H}_\infty$ norm of the sensitivity function: $\|S\|_\infty$. -Let's say we want to shape the sensitivity transfer function corresponding to the transfer function from $r$ to $\epsilon$ of the control architecture shown in Figure [[fig:loop_shaping_S_without_W]]. +However, as the $\mathcal{H}_\infty$ norm is the maximum peak value of the transfer function's magnitude, this synthesis is quite useless and clearly does not allow to *shape* the norm of $S(j\omega)$ over all frequencies. #+begin_src latex :file loop_shaping_S_without_W.pdf \begin{tikzpicture} @@ -1534,10 +1616,10 @@ Let's say we want to shape the sensitivity transfer function corresponding to th % Connections \draw[->] (G.east) -- (addw.west); - \draw[->] ($(addw.east)+(0.4, 0)$)node[branch]{} |- (epsilon) node[above left](z1){$\epsilon$}; + \draw[->] ($(addw.east)+(0.4, 0)$)node[branch]{} |- (epsilon) node[above](z1){$z = \epsilon$}; \draw[->] (addw.east) -- (addw-|z1) |- node[near start, right]{$v$} (K.east); - \draw[->] (K.west) -| node[near end, left]{$u$} ($(G-|w)+(0.4, 0)$) -- (G.west); + \draw[->] (K.west) -| node[near end, left]{$u$} ($(G-|w)+(0.1, 0)$) -- (G.west); \draw[->] (w) node[above]{$w = r$} -| (addw.north); @@ -1553,25 +1635,24 @@ Let's say we want to shape the sensitivity transfer function corresponding to th #+RESULTS: [[file:figs/loop_shaping_S_without_W.png]] -If the $\mathcal{H}_\infty$ synthesis is directly applied on the generalized plant $P(s)$ shown in Figure [[fig:loop_shaping_S_without_W]], if will minimize the $\mathcal{H}_\infty$ norm of transfer function from $r$ to $\epsilon$ (the sensitivity transfer function). -However, as the $\mathcal{H}_\infty$ norm is the maximum peak value of the transfer function's magnitude, it does not allow to *shape* the norm over all frequencies. +#+begin_important +The /trick/ is to include a *weighting function* $W_S(s)$ in the generalized plant as shown in Figure [[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 /weighted/ generalized plant $\tilde{P}(s)$ will generate a controller $K(s)$ such that $\|W_s(s)S(s)\|_\infty$ is minimized. +#+end_important - -A /trick/ is to include a *weighting function* in the generalized plant as shown in Figure [[fig:loop_shaping_S_with_W]]. -Applying the $\mathcal{H}_\infty$ synthesis to the /weighted/ generalized plant $\tilde{P}(s)$ (Figure [[fig:loop_shaping_S_with_W]]) will generate a controller $K(s)$ that minimizes the $\mathcal{H}_\infty$ norm between $r$ and $\tilde{\epsilon}$: +Let's now show how this is equivalent as *shaping* the sensitivity function: \begin{align} - & \left\| \frac{\tilde{\epsilon}}{r} \right\|_\infty < \gamma (=1)\nonumber \\ - \Leftrightarrow & \left\| W_s(s) S(s) \right\|_\infty < 1\nonumber \\ + & \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 $\mathcal{H}_\infty$ synthesis allows to *shape* the magnitude of the sensitivity transfer function. - Therefore, the choice of the weighting function $W_s(s)$ is very important. - Its inverse magnitude will define the frequency dependent upper bound of the sensitivity transfer function magnitude. + As shown in Equation eqref:eq:sensitivity_shaping, the $\mathcal{H}_\infty$ synthesis applying on the /weighted/ generalized plant allows to *shape* the magnitude of the sensitivity transfer function. + + Therefore, the choice of the weighting function $W_s(s)$ is very important: its inverse magnitude will define the wanted *upper bound* of the sensitivity function magnitude. #+end_important #+begin_src latex :file loop_shaping_S_with_W.pdf @@ -1593,10 +1674,10 @@ Applying the $\mathcal{H}_\infty$ synthesis to the /weighted/ generalized plant % Connections \draw[->] (G.east) -- (addw.west); \draw[->] ($(addw.east)+(0.4, 0)$)node[branch]{} |- (Ws.west)node[above left]{$\epsilon$}; - \draw[->] (Ws.east) -- (epsilon) node[above left](z1){$\tilde{\epsilon}$}; + \draw[->] (Ws.east) -- (epsilon) node[above](z1){$z = \tilde{\epsilon}$}; \draw[->] (addw.east) -- (addw-|z1) |- node[near start, right]{$v$} (K.east); - \draw[->] (K.west) -| node[near end, left]{$u$} ($(G-|w)+(0.4, 0)$) -- (G.west); + \draw[->] (K.west) -| node[near end, left]{$u$} ($(G-|w)+(0.2, 0)$) -- (G.west); \draw[->] (w) node[above]{$w = r$} -| (addw.north); \end{tikzpicture} @@ -1607,41 +1688,59 @@ Applying the $\mathcal{H}_\infty$ synthesis to the /weighted/ generalized plant #+RESULTS: [[file:figs/loop_shaping_S_with_W.png]] -Once the weighting function is designed, it should be added to the generalized plant as shown in Figure [[fig:loop_shaping_S_with_W]]. +#+begin_exercice +Using matlab, compute the weighted generalized plant shown in Figure [[fig:first_order_weight]] as a function of $G(s)$ and $W_S(s)$. -The weighted generalized plant can be defined in Matlab by either re-defining all the inputs or by pre-multiplying the (non-weighted) generalized plant by a block-diagonal MIMO transfer function containing the weights for the outputs $z$ and =1= for the outputs $v$. +#+HTML:
    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 +The two solutions below can be used. #+begin_src matlab :tangle no :eval no Pw = [Ws -Ws*G; - 1 -G] + 1 -G]; +#+end_src - % Alternative +#+begin_src matlab :tangle no :eval no Pw = blkdiag(Ws, 1)*P; #+end_src +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. +#+HTML:
    +#+end_exercice + ** Design of Weighting Functions <> -Weighting function used must be *proper*, *stable* and *minimum phase* transfer functions. +Weighting function included in the generalized plant must be *proper*, *stable* and *minimum phase* transfer functions. + +#+begin_definition - proper :: more poles than zeros, this implies $\lim_{\omega \to \infty} |W(j\omega)| < \infty$ - stable :: no poles in the right half plane - minimum phase :: no zeros in the right half plane +#+end_definition -Matlab is providing the =makeweight= function that creates a first-order weights by specifying the low frequency gain, high frequency gain, and a gain at a specific frequency: +Matlab is providing the =makeweight= function that allows to design first-order weights by specifying the low frequency gain, high frequency gain, and the gain at a specific frequency: #+begin_src matlab :tangle no :eval no W = makeweight(dcgain,[freq,mag],hfgain) #+end_src with: -- =dcgain= -- =freq= -- =mag= -- =hfgain= +- =dcgain=: low frequency gain +- =[freq,mag]=: frequency =freq= at which the gain is =mag= +- =hfgain=: high frequency gain #+begin_exampl -The Matlab code below produces a weighting function with a magnitude shape shown in Figure [[fig:first_order_weight]]. +The Matlab code below produces a weighting function with the following characteristics (Figure [[fig:first_order_weight]]): +- Low frequency gain of 100 +- Gain of 1 at 10Hz +- High frequency gain of 0.5 #+begin_src matlab Ws = makeweight(1e2, [2*pi*10, 1], 1/2); @@ -1672,7 +1771,7 @@ The Matlab code below produces a weighting function with a magnitude shape shown #+begin_seealso Quite often, higher orders weights are required. -In such case, the following formula can be used the design of these weights: +In such case, the following formula can be used: \begin{equation} W(s) = \left( \frac{ @@ -1752,52 +1851,103 @@ The obtained shapes are shown in Figure [[fig:high_order_weight]]. [[file:figs/high_order_weight.png]] #+end_seealso -** Sensitivity Function Shaping - Example +** Shaping the Sensitivity Function <> +Let's design a controller using the $\mathcal{H}_\infty$ synthesis that fulfils the following requirements: +1. Bandwidth of at least 10Hz +2. Small static errors for step responses +3. Robustness: Large module margin $\Delta M > 0.5$ ($\Rightarrow \Delta G > 2$ and $\Delta \phi > 29^o$) -- Robustness: Module margin > 2 ($\Rightarrow \text{GM} > 2 \text{ and } \text{PM} > 29^o$) -- Bandwidth: -- Slope of -2 +As usual, the plant used is the one presented in Section [[sec:example_system]]. -First, the weighting functions is generated. -#+begin_src matlab - Ws = generateWeight('G0', 1e3, 'G1', 1/2, 'Gc', 1, 'wc', 2*pi*10, 'n', 2); +#+begin_exercice +Translate the requirements as upper bounds on the Sensitivity function and design the corresponding Weight using Matlab. + +#+HTML:
    Hint +The typical wanted upper bound of the sensitivity function is shown in Figure [[fig:h-infinity-spec-S-bis]]. + +More precisely: +1. Recall that the closed-loop bandwidth is defined as the frequency $|S(j\omega)|$ first crosses $1/\sqrt{2} = -3dB$ from below +2. For the small static error, -60dB is usually enough as other factors (measurement noise, disturbances) will anyhow limit the performances +3. 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} \] + +Remember that the wanted upper bound of the sensitivity function is defined by the *inverse* magnitude of the weight. + +#+name: fig:h-infinity-spec-S-bis +#+caption: Typical wanted shape of the Sensitivity transfer function +[[file:figs/h-infinity-spec-S.png]] +#+HTML:
    + +#+HTML:
    Answer +1. $|W_s(j \cdot 2 \pi 10)| = \sqrt{2}$ +2. $|W_s(j \cdot 0)| = 10^3$ +3. $\|W_s\|_\infty = 0.5$ + +Using Matlab, such weighting function can be generated using the =makeweight= function as shown below: +#+begin_src matlab :eval no :tangle no + Ws = makeweight(1e3, [2*pi*10, sqrt(2)], 1/2); #+end_src -It is then added to the generalized plant. +Or using the =generateWeight= function: +#+begin_src matlab :eval no :tangle no + Ws = generateWeight('G0', 1e3, ... + 'G1', 1/2, ... + 'Gc', sqrt(2), 'wc', 2*pi*10, ... + 'n', 2); +#+end_src +#+HTML:
    +#+end_exercice + +Let's say we came up with the following weighting function: #+begin_src matlab + Ws = generateWeight('G0', 1e3, ... + 'G1', 1/2, ... + 'Gc', sqrt(2), 'wc', 2*pi*10, ... + 'n', 2); +#+end_src + +The weighting function is then added to the generalized plant. +#+begin_src matlab + P = [1 -G; + 1 -G]; Pw = blkdiag(Ws, 1)*P; #+end_src -And the $\mathcal{H}_\infty$ synthesis is performed. +And the $\mathcal{H}_\infty$ synthesis is performed on the /weighted/ generalized plant. #+begin_src matlab :results output replace K = hinfsyn(Pw, 1, 1, 'Display', 'on'); #+end_src #+RESULTS: #+begin_example -K = hinfsyn(Pw, 1, 1, 'Display', 'on'); - 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 4.497e-28 p + 5.05e-01 0.0e+00 0.0e+00 3.000e-16 p Limiting gains... - 5.05e-01 0.0e+00 0.0e+00 0.000e+00 p - 5.05e-01 -1.8e+01 # -2.9e-15 1.514e-15 f + 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.504 + Best performance (actual): 0.503 #+end_example -The obtained $\gamma \approx 0.5$ means that it found a controller $K(s)$ that stabilize the closed-loop system, and such that: +$\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: \begin{aligned} - & \| W_s(s) S(s) \|_\infty < 0.5 \\ + & \| 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} This is indeed what we can see by comparing $|S|$ and $|W_S|$ in Figure [[fig:results_sensitivity_hinf]]. +#+begin_important +Having $\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. + +Having $\gamma$ slightly above one does not necessary means the obtained controller is not "good". +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_src matlab :exports none figure; hold on; @@ -1817,89 +1967,18 @@ This is indeed what we can see by comparing $|S|$ and $|W_S|$ in Figure [[fig:re #+RESULTS: [[file:figs/results_sensitivity_hinf.png]] -** Complementary Sensitivity Function +** Shaping multiple closed-loop transfer functions +<> +As was shown in Section [[sec:modern_interpretation_specification]], depending on the specifications, up to four closed-loop transfer function may be shaped (the Gang of four). +This was summarized in Table [[tab:specification_modern]]. -** Summary +For instance to limit the control input $u$, $KS$ should be shaped while to filter measurement noise, $T$ should be shaped. -#+name: tab:specification_modern -#+caption: Table caption -| | 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 | +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 [[sec:h_infinity_mixed_sensitivity]]. -#+begin_src latex :file h-infinity-4-blocs-constrains.pdf - \begin{tikzpicture} - \begin{scope}[shift={(0, 0)}] - \draw[] (2.5, 1.0) node[]{$S$}; - \draw[fill=blue!20] (-0.2, -2.5) rectangle (1.4, 0.5); - \draw[] (0.6, -0.5) node[]{$\sim GK^{-1}$}; - \draw[fill=red!20] (3.6, -2.5) rectangle (5.2, 0.5); - \draw[] (4.5, -0.5) node[]{$\sim 1$}; - \draw[fill=red!20] (2.5, 0.15) circle (0.15); - \draw[dashed] (-0.4, 0) -- (5.4, 0); - \draw [] (0,-2) to[out=45,in=180+45] (2,0) to[out=45,in=180] (2.5,0.3) to[out=0,in=180] (3.5,0) to[out=0,in=180] (5, 0); - \draw[dashed] (-0.5, -2.7) rectangle (5.5, 1.4); - \end{scope} +Depending on the closed-loop transfer function being shaped, different general control configuration are used and are described below. - \begin{scope}[shift={(6.4, 0)}] - \draw[] (2.5, 1.0) node[]{$GS$}; - \draw[fill=blue!20] (-0.2, -2.5) rectangle (1.4, 0.5); - \draw[] (0.6, -0.5) node[]{$\sim K^{-1}$}; - \draw[fill=red!20] (3.6, -2.5) rectangle (5.2, 0.5); - \draw[] (4.5, -0.5) node[]{$\sim G$}; - \draw[dashed] (-0.4, 0) -- (5.4, 0); - \draw [] (0,-2) to[out=45,in=180+45] (1, -1) to[out=45, in=180] (2.5,-0.2) to[out=0,in=180-45] (4,-1) to[out=-45,in=180-45] (5, -2); - \draw[dashed] (-0.5, -2.7) rectangle (5.5, 1.4); - \end{scope} - - \begin{scope}[shift={(0, -4.4)}] - \draw[] (2.5, 1.0) node[]{$KS$}; - \draw[fill=red!20] (-0.2, -2.5) rectangle (1.4, 0.5); - \draw[] (0.6, -1.8) node[]{$\sim G^{-1}$}; - \draw[fill=blue!20] (3.6, -2.5) rectangle (5.2, 0.5); - \draw[] (4.5, -0.3) node[]{$\sim K$}; - \draw[dashed] (-0.4, 0) -- (5.4, 0); - \draw [] (0,-1.5) to[out=45,in=180+45] (1, -0.5) to[out=45, in=180] (2.5,0.3) to[out=0,in=180-45] (4,-0.5) to[out=-45,in=180-45] (5, -1.5); - \draw[dashed] (-0.5, -2.7) rectangle (5.5, 1.4); - \end{scope} - - \begin{scope}[shift={(6.4, -4.4)}] - \draw[] (2.5, 1.0) node[]{$T$}; - \draw[fill=red!20] (-0.2, -2.5) rectangle (1.4, 0.5); - \draw[] (0.6, -0.5) node[]{$\sim 1$}; - \draw[fill=blue!20] (3.6, -2.5) rectangle (5.2, 0.5); - \draw[] (4.5, -0.5) node[]{$\sim GK$}; - \draw[fill=red!20] (2.5, 0.15) circle (0.15); - \draw[dashed] (-0.4, 0) -- (5.4, 0); - \draw [] (0,0) to[out=0,in=180] (1.5,0) to[out=0,in=180] (2.5,0.3) to[out=0,in=-45] (3,0) to[out=-45,in=180-45] (5, -2); - \draw[dashed] (-0.5, -2.7) rectangle (5.5, 1.4); - \end{scope} - \end{tikzpicture} -#+end_src - -#+name: fig:h-infinity-4-blocs-constrains -#+caption: Shaping the Gang of Four: Limitations -#+RESULTS: -[[file:figs/h-infinity-4-blocs-constrains.png]] - - -* $\mathcal{H}_\infty$ Mixed-Sensitivity Synthesis -<> - -** Problem - -** Typical Procedure - -** Step 1 - Shaping of the Sensitivity Function - -** Step 2 - Shaping of - -** General Configuration for various shaping *** S KS :ignore: #+HTML:
    Shaping of S and KS #+begin_src latex :file general_conf_shaping_S_KS.pdf @@ -2132,15 +2211,63 @@ This is indeed what we can see by comparing $|S|$ and $|W_S|$ in Figure [[fig:re - $W_2W_3$ is used to shape $T$ #+HTML:
    -* Conclusion -<> -* Things to add :noexport: -** 2 blocs criterion - constrains -#+begin_src latex :file h-infinity-2-blocs-constrains.pdf + +*** Limitation :ignore: + +When shaping multiple closed-loop transfer functions, one should be verify careful about the three following points that are further discussed: +- The shaped closed-loop transfer functions are linked by mathematical relations and cannot be shaped +- Closed-loop transfer function can only be shaped in certain frequency range. +- The size of the obtained controller may be very large and not implementable in practice + + + +#+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)$ as link 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 *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 + +The control bandwidth is clearly limited by physical constrains such as sampling frequency, electronics bandwidth, + +\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*} + +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$). + +#+HTML:
    Hint +You can follows this procedure for $T$, $KS$ and $GS$: +1. Write the closed-loop transfer function $T(s)$ as a function of $K(s)$ and $G(s)$ +2. Take $|K(j\omega)G(j\omega)| \gg 1$ and conclude on $|T(j\omega)|$ +3. Take $|K(j\omega)G(j\omega)| \ll 1$ and conclude on $|T(j\omega)|$ +#+HTML:
    + +#+HTML:
    Answer +The obtained constrains are shown in Figure [[fig:h-infinity-4-blocs-constrains]]. +#+HTML:
    +#+end_exercice + +Depending on the frequency band, the norms of the closed-loop transfer functions depend on the controller $K$ and therefore can be shaped. +However, in some frequency bands, the norms do not depend on the controller and therefore *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 [[fig:h-infinity-4-blocs-constrains]]. + +#+begin_src latex :file h-infinity-4-blocs-constrains.pdf \begin{tikzpicture} \begin{scope}[shift={(0, 0)}] - \draw[] (2.5, 1.0) node[]{$S$}; \draw[fill=blue!20] (-0.2, -2.5) rectangle (1.4, 0.5); \draw[] (0.6, -0.5) node[]{$\sim GK^{-1}$}; \draw[fill=red!20] (3.6, -2.5) rectangle (5.2, 0.5); @@ -2148,11 +2275,40 @@ This is indeed what we can see by comparing $|S|$ and $|W_S|$ in Figure [[fig:re \draw[fill=red!20] (2.5, 0.15) circle (0.15); \draw[dashed] (-0.4, 0) -- (5.4, 0); \draw [] (0,-2) to[out=45,in=180+45] (2,0) to[out=45,in=180] (2.5,0.3) to[out=0,in=180] (3.5,0) to[out=0,in=180] (5, 0); - \draw[dashed] (-0.5, -2.7) rectangle (5.5, 1.4); + \draw[dashed] rectangle ; + \begin{scope}[on background layer] + \node[fit={(-0.5, -2.7) (5.5, 1.4)}, inner sep=0pt, draw, dashed, fill=black!20!white] (S) {}; + \node[below] at (S.north) {$S$}; + \end{scope} \end{scope} \begin{scope}[shift={(6.4, 0)}] - \draw[] (2.5, 1.0) node[]{$T$}; + \draw[fill=blue!20] (-0.2, -2.5) rectangle (1.4, 0.5); + \draw[] (0.6, -0.5) node[]{$\sim K^{-1}$}; + \draw[fill=red!20] (3.6, -2.5) rectangle (5.2, 0.5); + \draw[] (4.5, -0.5) node[]{$\sim G$}; + \draw[dashed] (-0.4, 0) -- (5.4, 0); + \draw [] (0,-2) to[out=45,in=180+45] (1, -1) to[out=45, in=180] (2.5,-0.2) to[out=0,in=180-45] (4,-1) to[out=-45,in=180-45] (5, -2); + \begin{scope}[on background layer] + \node[fit={(-0.5, -2.7) (5.5, 1.4)}, inner sep=0pt, draw, dashed, fill=black!20!white] (GS) {}; + \node[below] at (GS.north) {$GS$}; + \end{scope} + \end{scope} + + \begin{scope}[shift={(0, -4.4)}] + \draw[fill=red!20] (-0.2, -2.5) rectangle (1.4, 0.5); + \draw[] (0.6, -1.8) node[]{$\sim G^{-1}$}; + \draw[fill=blue!20] (3.6, -2.5) rectangle (5.2, 0.5); + \draw[] (4.5, -0.3) node[]{$\sim K$}; + \draw[dashed] (-0.4, 0) -- (5.4, 0); + \draw [] (0,-1.5) to[out=45,in=180+45] (1, -0.5) to[out=45, in=180] (2.5,0.3) to[out=0,in=180-45] (4,-0.5) to[out=-45,in=180-45] (5, -1.5); + \begin{scope}[on background layer] + \node[fit={(-0.5, -2.7) (5.5, 1.4)}, inner sep=0pt, draw, dashed, fill=black!20!white] (KS) {}; + \node[below] at (KS.north) {$KS$}; + \end{scope} + \end{scope} + + \begin{scope}[shift={(6.4, -4.4)}] \draw[fill=red!20] (-0.2, -2.5) rectangle (1.4, 0.5); \draw[] (0.6, -0.5) node[]{$\sim 1$}; \draw[fill=blue!20] (3.6, -2.5) rectangle (5.2, 0.5); @@ -2160,16 +2316,46 @@ This is indeed what we can see by comparing $|S|$ and $|W_S|$ in Figure [[fig:re \draw[fill=red!20] (2.5, 0.15) circle (0.15); \draw[dashed] (-0.4, 0) -- (5.4, 0); \draw [] (0,0) to[out=0,in=180] (1.5,0) to[out=0,in=180] (2.5,0.3) to[out=0,in=-45] (3,0) to[out=-45,in=180-45] (5, -2); - \draw[dashed] (-0.5, -2.7) rectangle (5.5, 1.4); + \begin{scope}[on background layer] + \node[fit={(-0.5, -2.7) (5.5, 1.4)}, inner sep=0pt, draw, dashed, fill=black!20!white] (T) {}; + \node[below] at (T.north) {$T$}; + \end{scope} \end{scope} \end{tikzpicture} #+end_src +#+name: fig:h-infinity-4-blocs-constrains +#+caption: Shaping the Gang of Four: Limitations #+RESULTS: -[[file:figs/h-infinity-2-blocs-constrains.png]] +[[file:figs/h-infinity-4-blocs-constrains.png]] +#+begin_warning + The order (resp. number of state) of the controller given by the $\mathcal{H}_\infty$ synthesis is equal to the order (resp. 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. + + Two approaches can be used to obtain controllers with reasonable order: + 1. use simple weights (usually first order) + 2. perform a model reduction on the obtained high order controller +#+end_warning + +* Mixed-Sensitivity $\mathcal{H}_\infty$ Control - Example +<> + +** Problem + +** Typical Procedure + +** Step 1 - Shaping of the Sensitivity Function + +** Step 2 - Shaping of + +* Conclusion +<> * Resources +:PROPERTIES: +:UNNUMBERED: notoc +:END: yt:?listType=playlist&list=PLn8PRpmsu08qFLMfgTEzR8DxOPE7fBiin