diff --git a/figs/module_margin_example.pdf b/figs/module_margin_example.pdf new file mode 100644 index 0000000..ee17ac5 Binary files /dev/null and b/figs/module_margin_example.pdf differ diff --git a/figs/module_margin_example.png b/figs/module_margin_example.png new file mode 100644 index 0000000..29e0b68 Binary files /dev/null and b/figs/module_margin_example.png differ diff --git a/index.html b/index.html index ac78730..39f6fb5 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,54 @@

Table of Contents

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

-
-

1 Introduction to Model Based Control

+
+

1 Introduction to Model Based Control

- +

-
-

1.1 Model Based Control - Methodology

+
+

1.1 Model Based Control - Methodology

- +

-The typical methodology 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 +126,7 @@ It consists of three steps:
-
+

control-procedure.png

Figure 1: Typical Methodoly for Model Based Control

@@ -137,24 +137,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 5
-
-

1.2 From Classical Control to Robust Control

+
+

1.2 From Classical Control to Robust Control

- +

- +
@@ -287,7 +287,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 +295,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 +401,7 @@ The notations used are listed in Table 2.
Table 2: Example system variables
-
+

Derive the following open-loop transfer functions:

@@ -458,11 +458,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 +480,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 +489,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 +505,38 @@ 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 +561,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 +573,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 +592,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 +609,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 +620,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 +668,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 +699,7 @@ where:

  • K is the synthesize controller
  • -
    +

    Matlab documentation of loopsyn (link).

    @@ -708,11 +708,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

    - +

    @@ -744,10 +744,10 @@ The \(\mathcal{H}_\infty\) optimal open loop shaping synthesis is performed usin

    -The Bode plot of the obtained controller is shown in Figure 10. +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.

    @@ -768,28 +768,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.

    -
    +

    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 +830,22 @@ Let’s now compare the obtained stability margins of the \(\mathcal{H}_\inf -
    -

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

    +
    +

    3 First Steps in 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 +862,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 +877,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 +891,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.

    @@ -934,11 +934,11 @@ Note that there are many ways to use the \(\mathcal{H}_\infty\) Synthesis:
    -
    -

    3.3 The Generalized Plant

    +
    +

    3.3 The Generalized Plant

    - +

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

    general_control_names.png

    Figure 14: General Control Configuration

    @@ -1074,28 +1074,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 +1119,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,19 +1147,19 @@ P.OutputName = {'e', 'u
    -
    -

    4 Modern Interpretation of the Control Specifications

    +
    +

    4 Modern Interpretation of the Control Specifications

    - +

    -
    -

    4.1 Introduction

    +
    +

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

    @@ -1173,11 +1173,11 @@ The closed loop system behavior is indeed determined by the closed-loop t

    -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,13 +1219,13 @@ 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.4)
    -
    +

    gang_of_four_feedback.png

    Figure 17: Simple Feedback Architecture

    @@ -1233,20 +1233,20 @@ This is summarized in Table 5.
    -
    -

    4.2 Closed Loop Transfer Functions

    +
    +

    4.2 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 @@ -1283,9 +1283,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 +1297,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. @@ -1321,11 +1321,11 @@ Similarly, to reduce the effect of measurement noise \(n\) on the output \(y\),

    -
    -

    4.3 Sensitivity Function

    +
    +

    4.3 Sensitivity Function

    - +

    @@ -1382,30 +1382,23 @@ hold off xlabel('Time [s]'); ylabel('Step Response');
    - - -
    -

    h-infinity-spec-S.png -

    -

    Figure 18: Typical wanted shape of the Sensitivity transfer function

    -
    -
    -

    4.4 Robustness: Module Margin

    +
    +

    4.4 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: +Let’s consider the following plant \(G_t(s)\):

    w0 = 2*pi*100;
    @@ -1417,7 +1410,16 @@ Gt = 1/k*(s
     
     

    -Let’s say we have designed a controller that gives the loop gain shown in Figure 19 where the following characteristics can be determined: +Let’s say we have designed a controller \(K_t(s)\) that gives the loop gain shown in Figure 18. +

    + +
    +
    Kt = 1.2e6*(s + w0)/s;
    +
    +
    + +

    +The following characteristics can be determined from Figure 18:

    • bandwidth of \(\approx 10\, \text{Hz}\)
    • @@ -1429,21 +1431,16 @@ Let’s say we have designed a controller that gives the loop gain shown in This might indicate very good robustness properties of the closed-loop system.

      -
      -
      Kt = 1.2e6*(s + w0)/s;
      -
      -
      - -
      +

      phase_gain_margin_model_plant.png

      -

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

      +

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

      -Now let’s suppose the “real” plant Gr as a slightly lower damping factor: +Now let’s suppose the “real” plant \(G_r(s)\) as a slightly lower damping factor:

      xi = 0.03;
      @@ -1452,8 +1449,8 @@ Gr = 1/k*(s
       
       

      -The obtained loop gain is in Figure 20. -It is shown that 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 unstability. +The obtained “real” loop gain is shown in Figure 19. +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.

      @@ -1470,10 +1467,10 @@ It is confirmed by checking the stability of the closed loop system: -

      +

      phase_gain_margin_real_plant.png

      -

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

      +

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

      @@ -1481,63 +1478,114 @@ Therefore, even a small change of the plant parameter makes the system unstable

      -This is due to the fact that the gain and phase margin are indicators to the robustness of the system to a pure change or gain or a pure change of phase but not a combination of both. -

      - -
      - -
      -

      -To learn more about module (or disk) margin, you can check out this video. -

      - -
      - -
        -
      • [ ] Example why the module margin might be a good alternative
      • -
      • [ ] Stability => L does not does at the left of point -1
      • -
      • [ ] => …
      • -
      - - -
      -

      -The module margin \(\Delta M\) is defined as the minimum distance between the point \(-1\) and \(L(j\omega) = G(j\omega) K(j\omega)\) in the complex plane. +This is due to the fact that the gain and phase margin are robustness indicators for a pure change or gain or a pure change of phase but not a combination of both.

      -The module margin can be visually determined on the Nyquist plot (\(L(j\omega)\) from \(\omega = -\infty\) to \(\infty\) in the complex plane). +Let’s now determine a new robustness indicator based on the Nyquist Stability Criteria.

      -
        -
      • [ ] Example of Nyquist plot and module margin
      • -
      • [ ] Express the module margin as a function of \(\|S\|_\infty\)
      • -
      +
      +
      +
      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.
      +
      Nyquist Plot
      The Nyquist plot shows the evolution of \(L(j\omega)\) in the complex plane from \(\omega = 0 \to \infty\).
      +
      + +
      + +

      -\[ M_S < 2 \Rightarrow \text{GM} > 2 \text{ and } \text{PM} > 29^o \] +For more information about the general Nyquist Stability Criteria, you may want to look at this video.

      -
      +
      +

      -Large peak value of \(S\) indicate robustness problems. +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. +

      + +
      +
      +
      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 20. +The gain, phase and module margins are graphically shown to have an idea of what they represent.

      -The wanted robustness of the closed-loop system can there be specified by setting a maximum value on \(\|S\|_\infty\). +As expected from Figure 20, 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} + + +
      +

      module_margin_example.png +

      +

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

      +\begin{align*} +\Delta M &= \text{minimum distance between } L(j\omega) \text{ and point } (-1) \\ + &= \min_\omega |L(j\omega) - (-1)| \\ + &= \min_\omega |1 + L(j\omega)| \\ + &= \frac{1}{\max_\omega \frac{1}{|1 + L(j\omega)|}} \\ + &= \frac{1}{\|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. +

      + +\begin{equation} + \Delta M = \frac{1}{\|S\|_\infty} \label{eq:module_margin_S} +\end{equation} + +

      +The wanted robustness of the closed-loop system can be specified by setting a maximum value on \(\|S\|_\infty\). +

      + +
      + +

      +Note that this is why large peak value of \(|S(j\omega)|\) usually indicate robustness problems. +

      + +
      +

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

      -
      -

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

      +
      +

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

      - +

        @@ -1545,18 +1593,18 @@ The wanted robustness of the closed-loop system can there be specified by settin

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

      -
      +

      loop_shaping_S_without_W.png

      Figure 21: Generalized Plant

      -If the \(\mathcal{H}_\infty\) synthesis is directly applied on the generalized plant \(P(s)\) shown in Figure 21, if will minimize the \(\mathcal{H}_\infty\) norm of transfer function from \(r\) to \(\epsilon\) (the sensitivity transfer function). +If the \(\mathcal{H}_\infty\) synthesis is directly applied on the generalized plant \(P(s)\) shown in Figure 21, if will minimize the \(\mathcal{H}_\infty\) norm of transfer function from \(r\) to \(\epsilon\) (the sensitivity transfer function).

      @@ -1566,8 +1614,8 @@ However, as the \(\mathcal{H}_\infty\) norm is the maximum peak value of the tra

      -A trick is to include a weighting function in the generalized plant as shown in Figure 22. -Applying the \(\mathcal{H}_\infty\) synthesis to the weighted generalized plant \(\tilde{P}(s)\) (Figure 22) will generate a controller \(K(s)\) that minimizes the \(\mathcal{H}_\infty\) norm between \(r\) and \(\tilde{\epsilon}\): +A trick is to include a weighting function in the generalized plant as shown in Figure 22. +Applying the \(\mathcal{H}_\infty\) synthesis to the weighted generalized plant \(\tilde{P}(s)\) (Figure 22) 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 \\ @@ -1576,7 +1624,7 @@ Applying the \(\mathcal{H}_\infty\) synthesis to the weighted generalized \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. @@ -1586,14 +1634,14 @@ Its inverse magnitude will define the frequency dependent upper bound of the sen

      -
      +

      loop_shaping_S_with_W.png

      Figure 22: Weighted Generalized Plant

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

      @@ -1611,11 +1659,11 @@ Pw = blkdiag(Ws, 1)*P;

      -
      -

      4.6 Design of Weighting Functions

      +
      +

      4.6 Design of Weighting Functions

      - +

      @@ -1644,9 +1692,9 @@ with:

    • hfgain
    -
    +

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

    @@ -1655,7 +1703,7 @@ The Matlab code below produces a weighting function with a magnitude shape shown
    -
    +

    first_order_weight.png

    Figure 23: Obtained Magnitude of the Weighting Function

    @@ -1663,7 +1711,7 @@ The Matlab code below produces a weighting function with a magnitude shape shown
    -
    +

    Quite often, higher orders weights are required.

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

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

    -
    +

    high_order_weight.png

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

    @@ -1744,13 +1792,21 @@ The obtained shapes are shown in Figure 24.
    -
    -

    4.7 Sensitivity Function Shaping - Example

    +
    +

    4.7 Sensitivity Function Shaping - Example

    - +

    + +
    +

    h-infinity-spec-S.png +

    +

    Figure 25: Typical wanted shape of the Sensitivity transfer function

    +
    + +
    • Robustness: Module margin > 2 (\(\Rightarrow \text{GM} > 2 \text{ and } \text{PM} > 29^o\))
    • Bandwidth:
    • @@ -1781,7 +1837,7 @@ And the \(\mathcal{H}_\infty\) synthesis is performed.
    -
    +
     K = hinfsyn(Pw, 1, 1, 'Display', 'on');
     
       Test bounds:  0.5 <=  gamma  <=  0.51
    @@ -1804,27 +1860,27 @@ The obtained \(\gamma \approx 0.5\) means that it found a controller \(K(s)\) th
     \end{aligned}
     
     

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

    -
    +

    results_sensitivity_hinf.png

    -

    Figure 25: Weighting function and obtained closed-loop sensitivity

    +

    Figure 26: Weighting function and obtained closed-loop sensitivity

    -
    -

    4.8 Complementary Sensitivity Function

    +
    +

    4.8 Complementary Sensitivity Function

    -
    -

    4.9 Summary

    +
    +

    4.9 Summary

    - +
    @@ -1875,53 +1931,53 @@ This is indeed what we can see by comparing \(|S|\) and \(|W_S|\) in Figure -
    +

    h-infinity-4-blocs-constrains.png

    -

    Figure 26: Shaping the Gang of Four: Limitations

    +

    Figure 27: Shaping the Gang of Four: Limitations

    -
    -

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

    +
    +

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

    - +

    -
    -

    5.1 Problem

    +
    +

    5.1 Problem

    -
    -

    5.2 Typical Procedure

    +
    +

    5.2 Typical Procedure

    -
    -

    5.3 Step 1 - Shaping of the Sensitivity Function

    +
    +

    5.3 Step 1 - Shaping of the Sensitivity Function

    -
    -

    5.4 Step 2 - Shaping of

    +
    +

    5.4 Step 2 - Shaping of

    -
    -

    5.5 General Configuration for various shaping

    +
    +

    5.5 General Configuration for various shaping

    Shaping of S and KS -
    +

    general_conf_shaping_S_KS.png

    -

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

    +

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

    -
    P = [W1 -G*W1
    +
    P = [W1 -G*W1
          0   W2
          1  -G];
     
    @@ -1934,14 +1990,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 28: Generalized Plant to shape \(S\) and \(T\)

    +

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

    -28
    P = [W1 -G*W1
    +
    P = [W1 -G*W1
          0   G*W2
          1   -G];
     
    @@ -1954,14 +2010,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 29: Generalized Plant to shape \(S\), \(T\) and \(KS\)

    +

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

    -29
    P = [W1 -G*W1
    +
    P = [W1 -G*W1
          0   W2
          0   G*W3
          1   -G];
    @@ -1976,14 +2032,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 30: Generalized Plant to shape \(S\), \(T\), \(KS\) and \(GS\)

    +

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

    -30
    P = [ W1  -W1*G*W3 -G*W1
    +
    P = [ W1  -W1*G*W3 -G*W1
           0    0        W2
           1   -G*W3    -G];
     
    @@ -2000,17 +2056,17 @@ This is indeed what we can see by comparing \(|S|\) and \(|W_S|\) in Figure
    -
    -

    6 Conclusion

    +
    -
    -

    7 Resources

    +
    +

    7 Resources

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

    Author: Dehaeze Thomas

    -

    Created: 2020-12-01 mar. 00:23

    +

    Created: 2020-12-01 mar. 10:54

    diff --git a/index.org b/index.org index e1fceda..740f115 100644 --- a/index.org +++ b/index.org @@ -1174,53 +1174,13 @@ Similarly, to reduce the effect of measurement noise $n$ on the output $y$, we w xlabel('Time [s]'); ylabel('Step Response'); #+end_src -#+begin_src latex :file h-infinity-spec-S.pdf - \begin{tikzpicture} - \begin{axis}[% - width=8cm, - height=4cm, - at={(0,0)}, - xmode=log, - xmin=0.01, - xmax=10000, - ymin=-80, - ymax=40, - ylabel={Magnitude [dB]}, - xlabel={Frequency [Hz]}, - ytick={40, 20, 0, -20, -40, -60, -80}, - xminorgrids, - yminorgrids - ] - \addplot [thick, color=black, forget plot] - table[row sep=crcr]{% - 0.01 -60\\ - 0.1 -60\\ - 190 6\\ - 10000 6\\ - }; - \draw[<-] (0.05, -60) -- (0.1, -70); - \draw (0.1, -70) -- (2, -70) node[right, fill=white, draw]{$\SI{-60}{\decibel} \rightarrow$ \footnotesize{Static error}}; - \draw[<-] (1, -40) -- (10, -40) node[right, fill=white, draw]{$\SI{20}{\decibel/dec} \rightarrow$ \footnotesize{Ref. track.}}; - \draw[<-] (100, 0) -- (3, 0) node[left, fill=white, draw]{$\omega_c \rightarrow$ \footnotesize{Speed}}; - - \draw[<-] (300, 6) -- (200, 20); - \draw (200, 20) -- (10, 20) node[left, fill=white, draw]{$\SI{6}{\decibel} \rightarrow$ \footnotesize{Module margin}}; - \end{axis} - \end{tikzpicture} -#+end_src - -#+name: fig:h-infinity-spec-S -#+caption: Typical wanted shape of the Sensitivity transfer function -#+RESULTS: -[[file:figs/h-infinity-spec-S.png]] - ** Robustness: Module Margin <> Let's start by an example demonstrating why the phase and gain margins might not be good indicators of robustness. #+begin_exampl -Let's consider the following plant: +Let's consider the following plant $G_t(s)$: #+begin_src matlab w0 = 2*pi*100; xi = 0.1; @@ -1229,17 +1189,19 @@ Let's consider the following plant: Gt = 1/k*(s/w0/4 + 1)/(s^2/w0^2 + 2*xi*s/w0 + 1); #+end_src -Let's say we have designed a controller that gives the loop gain shown in Figure [[fig:phase_gain_margin_model_plant]] where the following characteristics can be determined: +Let's say we have designed a controller $K_t(s)$ that gives the loop gain shown in Figure [[fig:phase_gain_margin_model_plant]]. + +#+begin_src matlab + Kt = 1.2e6*(s + w0)/s; +#+end_src + +The following characteristics can be determined from Figure [[fig:phase_gain_margin_model_plant]]: - bandwidth of $\approx 10\, \text{Hz}$ - infinite gain margin (the phase of the loop-gain never reaches -180 degrees - more than 90 degrees of phase margin This might indicate very good robustness properties of the closed-loop system. -#+begin_src matlab - Kt = 1.2e6*(s + w0)/s; -#+end_src - #+begin_src matlab :exports none freqs = logspace(0, 3, 1000); @@ -1277,14 +1239,14 @@ This might indicate very good robustness properties of the closed-loop system. [[file:figs/phase_gain_margin_model_plant.png]] -Now let's suppose the "real" plant =Gr= as a slightly lower damping factor: +Now let's suppose the "real" plant $G_r(s)$ as a slightly lower damping factor: #+begin_src matlab xi = 0.03; Gr = 1/k*(s/w0/4 + 1)/(s^2/w0^2 + 2*xi*s/w0 + 1); #+end_src -The obtained loop gain is in Figure [[fig:phase_gain_margin_real_plant]]. -It is shown that 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 unstability. +The obtained "real" loop gain is shown in Figure [[fig:phase_gain_margin_real_plant]]. +At a frequency little bit above 100Hz, the phase of the loop gain reaches -180 degrees while its magnitude is more than one which indicated instability. It is confirmed by checking the stability of the closed loop system: #+begin_src matlab :results value replace @@ -1334,35 +1296,125 @@ It is confirmed by checking the stability of the closed loop system: Therefore, even a small change of the plant parameter makes the system unstable even though both the gain margin and the phase margin for the nominal plant are excellent. -This is due to the fact that the gain and phase margin are indicators to the robustness of the system to a *pure* change or gain or a *pure* change of phase but not a combination of both. +This is due to the fact that the gain and phase margin are robustness indicators for a *pure* change or gain or a *pure* change of phase but not a combination of both. +#+end_exampl + +Let's now determine a new robustness indicator based on the Nyquist Stability Criteria. + +#+begin_definition +- 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. + +- Nyquist Plot :: + The Nyquist plot shows the evolution of $L(j\omega)$ in the complex plane from $\omega = 0 \to \infty$. +#+end_definition + +#+begin_seealso +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*. + +#+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 + +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] + c = 4e2; % Damping [N/(m/s)] + m = 10; % Mass [kg] + G = 1/(m*s^2 + c*s + k); % Plant + + % Example Controller + K = 14e8 * ... % Gain + 1/(s^2) * ... % Double Integrator + (1 + s/(2*pi*10/sqrt(8)))/(1 + s/(2*pi*10*sqrt(8))); % Lead + + L = G*K; + L_resp = squeeze(freqresp(L, freqs, 'Hz')); + + % Module Margin + Dm = min(abs(1 + L_resp)); + + % Phase Gain Margin + [Gm, Pm, Wcg, Wcp] = margin(L); + + freqs = logspace(0, 3, 1000); + figure; + hold on; + % Gain Margin + plot([-1, -1/Gm], [0, 0], '-', 'DisplayName', sprintf('$\\Delta G = %.1f$', Gm)) + + % Phase Margin + theta = -pi:0.01:-pi+Pm*pi/180; + plot(cos(theta), sin(theta), '-', 'DisplayName', sprintf('$\\Delta \\phi = %.1f^o$', Pm)); + + % Module Margin + theta = 0 : 0.01 : 2*pi; + plot(Dm*cos(theta)-1, Dm*sin(theta), '-', 'DisplayName', sprintf('$\\Delta M = %.1f$', Dm)); + + % Nyquist Plot + plot(real(L_resp), imag(L_resp), 'k-', 'DisplayName', '$L(j\omega)$') + + plot(-1, 0, 'k*', 'HandleVisibility', 'off'); + + hold off; + xlabel('Real Axis'); ylabel('Imaginary Axis'); + xlim([-1.5, 0.5]); ylim([-1, 1]); + axis equal; + legend('location', 'southeast'); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace + exportFig('figs/module_margin_example.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:module_margin_example +#+caption: Nyquist plot with visual indication of the Gain margin $\Delta G$, Phase margin $\Delta \phi$ and Module margin $\Delta M$ +#+RESULTS: +[[file:figs/module_margin_example.png]] + +Let's now try to express the Module margin $\Delta M$ as an $\mathcal{H}_\infty$ norm of a closed-loop transfer function: +\begin{align*} +\Delta M &= \text{minimum distance between } L(j\omega) \text{ and point } (-1) \\ + &= \min_\omega |L(j\omega) - (-1)| \\ + &= \min_\omega |1 + L(j\omega)| \\ + &= \frac{1}{\max_\omega \frac{1}{|1 + L(j\omega)|}} \\ + &= \frac{1}{\|S\|_\infty} +\end{align*} + +#+begin_important +The $\mathcal{H}_\infty$ norm of the sensitivity function $\|S\|_\infty$ is a measure of the Module margin $\Delta M$ and therefore an indicator of the system robustness. + +\begin{equation} + \Delta M = \frac{1}{\|S\|_\infty} \label{eq:module_margin_S} +\end{equation} + +The wanted robustness of the closed-loop system can be specified by setting a maximum value on $\|S\|_\infty$. +#+end_important + +Note that this is why large peak value of $|S(j\omega)|$ usually indicate robustness problems. + +#+begin_exampl + Typical, we require $\|S\|_\infty < 2 (6dB)$ which implies $\Delta G \ge 2$ and $\Delta \phi \ge 29^o$ #+end_exampl #+begin_seealso - To learn more about module (or disk) margin, you can check out [[https://www.youtube.com/watch?v=XazdN6eZF80][this]] video. + To learn more about module/disk margin, you can check out [[https://www.youtube.com/watch?v=XazdN6eZF80][this]] video. #+end_seealso -- [ ] Example why the module margin might be a good alternative -- [ ] Stability => L does not does at the left of point -1 -- [ ] => ... - - -#+begin_definition - The *module margin* $\Delta M$ is defined as the *minimum distance* between the point $-1$ and $L(j\omega) = G(j\omega) K(j\omega)$ in the complex plane. -#+end_definition - -The module margin can be visually determined on the Nyquist plot ($L(j\omega)$ from $\omega = -\infty$ to $\infty$ in the complex plane). - -- [ ] Example of Nyquist plot and module margin -- [ ] Express the module margin as a function of $\|S\|_\infty$ - -\[ M_S < 2 \Rightarrow \text{GM} > 2 \text{ and } \text{PM} > 29^o \] - -#+begin_important - Large peak value of $S$ indicate robustness problems. - - The wanted robustness of the closed-loop system can there be specified by setting a maximum value on $\|S\|_\infty$. -#+end_important - ** How to *Shape* transfer function? Using of Weighting Functions! <> @@ -1603,6 +1655,47 @@ The obtained shapes are shown in Figure [[fig:high_order_weight]]. ** Sensitivity Function Shaping - Example <> +#+begin_src latex :file h-infinity-spec-S.pdf + \begin{tikzpicture} + \begin{axis}[% + width=8cm, + height=4cm, + at={(0,0)}, + xmode=log, + xmin=0.01, + xmax=10000, + ymin=-80, + ymax=40, + ylabel={Magnitude [dB]}, + xlabel={Frequency [Hz]}, + ytick={40, 20, 0, -20, -40, -60, -80}, + xminorgrids, + yminorgrids + ] + \addplot [thick, color=black, forget plot] + table[row sep=crcr]{% + 0.01 -60\\ + 0.1 -60\\ + 190 6\\ + 10000 6\\ + }; + \draw[<-] (0.05, -60) -- (0.1, -70); + \draw (0.1, -70) -- (2, -70) node[right, fill=white, draw]{$\SI{-60}{\decibel} \rightarrow$ \footnotesize{Static error}}; + \draw[<-] (1, -40) -- (10, -40) node[right, fill=white, draw]{$\SI{20}{\decibel/dec} \rightarrow$ \footnotesize{Ref. track.}}; + \draw[<-] (100, 0) -- (3, 0) node[left, fill=white, draw]{$\omega_c \rightarrow$ \footnotesize{Speed}}; + + \draw[<-] (300, 6) -- (200, 20); + \draw (200, 20) -- (10, 20) node[left, fill=white, draw]{$\SI{6}{\decibel} \rightarrow$ \footnotesize{Module margin}}; + \end{axis} + \end{tikzpicture} +#+end_src + +#+name: fig:h-infinity-spec-S +#+caption: Typical wanted shape of the Sensitivity transfer function +#+RESULTS: +[[file:figs/h-infinity-spec-S.png]] + + - Robustness: Module margin > 2 ($\Rightarrow \text{GM} > 2 \text{ and } \text{PM} > 29^o$) - Bandwidth: - Slope of -2
    Table 6: Table caption