diff --git a/figs/open_loop_shaping_shape.pdf b/figs/open_loop_shaping_shape.pdf index 1ee3813..d9ba834 100644 Binary files a/figs/open_loop_shaping_shape.pdf and b/figs/open_loop_shaping_shape.pdf differ diff --git a/figs/open_loop_shaping_shape.png b/figs/open_loop_shaping_shape.png index c638274..200aa45 100644 Binary files a/figs/open_loop_shaping_shape.png and b/figs/open_loop_shaping_shape.png differ diff --git a/figs/open_loop_shaping_shape.svg b/figs/open_loop_shaping_shape.svg index 0cdbbfc..dff74d6 100644 --- a/figs/open_loop_shaping_shape.svg +++ b/figs/open_loop_shaping_shape.svg @@ -1,5 +1,5 @@ - + @@ -38,72 +38,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -117,198 +51,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - - + + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + + + - - - - - - - - - + + + + - + + + + - - - + + + + - - - - - - - - - - - - - + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + - + + + + + - + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + - - + + - - - - - + + + + + - - - - - - + + + + + + - + - + - + diff --git a/ieee.csl b/ieee.csl new file mode 100644 index 0000000..2089efb --- /dev/null +++ b/ieee.csl @@ -0,0 +1,400 @@ + + diff --git a/index.html b/index.html index 9f7e864..399c5a0 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,56 +30,56 @@

Table of Contents

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

-
-

1 Introduction to Model Based Control

+
+

1 Introduction to Model Based Control

- +

-
-

1.1 Model Based Control - Methodology

+
+

1.1 Model Based Control - Methodology

- +

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

@@ -146,7 +146,7 @@ It consists of three steps: -

+

control-procedure.png

Figure 1: Typical Methodoly for Model Based Control

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

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

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

-
-

1.2 From Classical Control to Robust Control

+
+

1.2 From Classical Control to Robust Control

- +

@@ -197,20 +197,20 @@ This set of developments is loosely termed Modern Control theory.

By the 1980’s, modern control theory was shown to have some robustness issues and to lack the intuitive tools that the classical control methods were offering. -This lead to a new control theory called Robust control that blends the best features of classical and modern techniques. +This led to a new control theory called Robust control that blends the best features of classical and modern techniques. This robust control theory is the subject of this document.

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

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

- +
@@ -355,37 +355,40 @@ Note that in parallel, there have been numerous other developments, including no
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.

-
-
-

1.3 Example System

+
+

1.3 Example System

- +

-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. +Throughout this document, multiple examples and practical application of presented control strategies will be provided. +Most of them will be applied on a physical system presented in this section. +

+ +

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

+ +

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

-
+

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.

+

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

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

Derive the following open-loop transfer functions:

@@ -504,14 +507,14 @@ You can follow this generic procedure:

-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 2 into a classical feedback architecture as shown in Figure 6.

-
+

classical_feedback_test_system.png

-

Figure 4: Block diagram corresponding to the example system

+

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

@@ -526,7 +529,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)\).

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

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

-
+ +

bode_plot_example_afm.png

-

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

+

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

-
+

bode_plot_example_Gd.png

-

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

+

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

-
-

2 Classical Open Loop Shaping

+
+

2 Classical Open Loop Shaping

- + +

+

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

+ +

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

-
-
-

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)\). +Loop Shaping refers to a control 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 (or Loop transfer function) \(L(s)\) usually refers to as the product of the controller and the plant (see Figure 6):

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

+Its name comes from the fact that this is actually the “gain around the loop”. +

-
+ +

open_loop_shaping.png

-

Figure 7: Classical Feedback Architecture

+

Figure 6: Classical Feedback Architecture

-This synthesis method is widely used as many characteristics of the closed-loop system depend on the shape of the open loop gain \(L(s)\) such as: +This synthesis method is one of main way controllers are design in the classical control theory. +It is widely used and generally successful as many characteristics of the closed-loop system depend on the shape of the open loop gain \(L(s)\) such as:

    -
  • Performance: \(L\) large
  • +
  • Good Tracking: \(L\) large
  • Good disturbance rejection: \(L\) large
  • -
  • Limitation of measurement noise on plant output: \(L\) small
  • -
  • Small magnitude of input signal: \(K\) and \(L\) small
  • +
  • Attenuation of measurement noise on plant output: \(L\) small
  • +
  • Small magnitude of input signal: \(L\) small
  • Nominal stability: \(L\) small (RHP zeros and time delays)
  • Robust stability: \(L\) small (neglected dynamics)

-The Open Loop shape is usually done manually has the loop gain \(L(s)\) depends linearly on \(K(s)\) \eqref{eq:loop_gain}. -

- -

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

-
+

open_loop_shaping_shape.png

-

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

+

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

+ +

+The shaping of closed-loop transfer functions is obviously not as simple as they don’t depend linearly on \(K(s)\). +But this is were the \(\mathcal{H}_\infty\) Synthesis will be useful! +More details on that in Sections 4 and 5. +

-
-

2.2 Example of Open Loop Shaping

+
+

2.2 Example of Manual 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: +Let’s take our example system described in Section 1.3 and design a controller using the Open-Loop shaping synthesis approach. +The specifications are:

-
    -
  • Performance: Bandwidth of approximately 10Hz
  • -
  • Noise Attenuation: Roll-off of -40dB/decade past 30Hz
  • +
      +
    1. Disturbance rejection: Highest possible rejection below 1Hz
    2. +
    3. Positioning speed: Bandwidth of approximately 10Hz
    4. +
    5. Noise attenuation: Roll-off of -40dB/decade past 30Hz
    6. Robustness: Gain margin > 3dB and Phase margin > 30 deg
    7. -
+
-
+

-Using SISOTOOL, design a controller that fulfill the specifications. +Using SISOTOOL, design a controller that fulfills the specifications.

@@ -654,32 +676,36 @@ Using SISOTOOL, design a controller that fulfill the specifications
+
Hint +

+You can follow this procedure: +

+
    +
  1. In order to have good disturbance rejection at low frequency, add a simple or double integrator
  2. +
  3. In terms of the loop gain, the bandwidth can be defined at the frequency \(\omega_c\) where \(|l(j\omega_c)|\) first crosses 1 from above. +Therefore, adjust the gain such that \(L(j\omega)\) crosses 1 at around 10Hz
  4. +
  5. The roll-off at high frequency for noise attenuation should already be good enough. +If not, add a low pass filter
  6. +
  7. Add a Lead centered around the crossover frequency (10 Hz) and tune it such that sufficient phase margin is added. +Verify that the gain margin is good enough.
  8. +
+
+

-In order to have the wanted Roll-off, two integrators are used, a lead is also added to have sufficient phase margin. -

- -

-The obtained controller is shown below, and the bode plot of the Loop Gain is shown in Figure 9. +Let’s say we came up with the following controller.

-
K = 14e8 * ... % Gain
-    1/(s^2) * ... % Double Integrator
+
K = 14e8 * ...              % Gain
+    1/(s^2) * ...           % Double Integrator
     1/(1 + s/2/pi/40) * ... % Low Pass Filter
     (1 + s/(2*pi*10/sqrt(8)))/(1 + s/(2*pi*10*sqrt(8))); % Lead
 
- -
-

loop_gain_manual_afm.png -

-

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

-
-

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

[Gm, Pm, ~, Wc] = margin(G*K)
@@ -717,29 +743,32 @@ And we can verify that we have the wanted stability margins:
 
 
 
+
+
+
+

loop_gain_manual_afm.png +

+

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

+
-
-

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

+
+

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

- +

-The Open Loop Shaping synthesis can be performed using the \(\mathcal{H}_\infty\) Synthesis. +The synthesis of controllers based on the Loop Shaping method can be automated using the \(\mathcal{H}_\infty\) Synthesis.

-Even though we will not go into details, we will provide one example. -

- -

-Using Matlab, the \(\mathcal{H}_\infty\) Loop Shaping Synthesis can be performed using the loopsyn command: +Using Matlab, it can be easily performed using the loopsyn command:

-
K = loopsyn(G, Gd);
+
K = loopsyn(G, Lw);
 

@@ -747,39 +776,96 @@ where:

  • G is the (LTI) plant
  • -
  • Gd is the wanted loop shape
  • +
  • Lw is the wanted loop shape
  • K is the synthesize controller
-
+

Matlab documentation of loopsyn (link).

+ +

+Therefore, by just providing the wanted loop shape and the plant model, the \(\mathcal{H}_\infty\) Loop Shaping synthesis generates a stabilizing controller such that the obtained loop gain \(L(s)\) matches the specified one with an accuracy \(\gamma\). +

+ +

+Even though we will not go into details and explain how such synthesis is working, an example is provided in the next section. +

-
-

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

+
+

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

- +

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

-Translate the specification into the wanted shape of the open loop gain. +Such shape corresponds to the typical wanted Loop gain Shape shown in Figure 7.

-
    -
  • Performance: Bandwidth of approximately 10Hz: \(|L_w(j2 \pi 10)| = 1\)
  • -
  • Noise Attenuation: Roll-off of -40dB/decade past 30Hz
  • -
  • Robustness: Gain margin > 3dB and Phase margin > 30 deg
  • -
+ + + +++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3: Wanted Loop Shape corresponding to each specification
 SpecificationCorresponding Loop Shape
Disturbance RejectionHighest possible rejection below 1HzSlope of -40dB/decade at low frequency to have a high loop gain
Positioning SpeedBandwidth of approximately 10Hz\(L\) crosses 1 at 10Hz: \(\vert L_w(j2 \pi 10)\vert = 1\)
Noise AttenuationRoll-off of -40dB/decade past 30HzRoll-off of -40dB/decade past 30Hz
RobustnessGain margin > 3dB and Phase margin > 30 degSlope of -20dB/decade near the crossover
+ +

+Then, a (stable, minimum phase) transfer function \(L_w(s)\) should be created that has the same gain as the wanted shape of the Loop gain. +For this example, a double integrator and a lead centered on 10Hz are used. +Then the gain is adjusted such that the \(|L_w(j2 \pi 10)| = 1\). +

+ +

+Using Matlab, we have: +

Lw = 2.3e3 * ...
      1/(s^2) * ... % Double Integrator
@@ -788,26 +874,38 @@ Translate the specification into the wanted shape of the open loop gain.
 

-The \(\mathcal{H}_\infty\) optimal open loop shaping synthesis is performed using the loopsyn command: +The \(\mathcal{H}_\infty\) open loop shaping synthesis is then performed using the loopsyn command:

[K, ~, GAM] = loopsyn(G, Lw);
 
-

-It is always important to analyze the controller after the synthesis is performed. +The obtained Loop Gain is shown in Figure 9 and matches the specified one by a factor \(\gamma \approx 2\). +

+ + +
+

open_loop_shaping_hinf_L.png +

+

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

+
+ + +
+

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

-In the end, a synthesize controller is just a combination of low pass filters, high pass filters, notches, leads, etc. +This is usually done by breaking down the controller into simple elements such as low pass filters, high pass filters, notches, leads, etc.

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

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

open_loop_shaping_hinf_K.png

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

-

-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 finally compare the obtained stability margins of the \(\mathcal{H}_\infty\) controller and of the manually developed controller in Table 4.

- - +
Table 3: Comparison of the characteristics obtained with the two methods
+@@ -878,29 +966,29 @@ Let’s now compare the obtained stability margins of the \(\mathcal{H}_\inf -
-

3 A first Step into 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

@@ -917,7 +1005,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:

@@ -932,28 +1020,28 @@ 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 11.

-
+

hinfinity_norm_siso_bode.png

-

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

+

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

-
-

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.

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

3.3 The Generalized Plant

+
+

3.3 The Generalized Plant

- +

@@ -1003,9 +1091,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 12. 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 5.

@@ -1018,15 +1106,15 @@ 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

+

Figure 12: Inputs and Outputs of the generalized Plant

-
-
Table 4: Comparison of the characteristics obtained with the two methods
- +
+
Table 4: Notations for the general configuration
+@@ -1071,18 +1159,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
@@ -1097,10 +1185,10 @@ After \(K\) is found, the system is robustified by adjusting the response
-
+

general_control_names.png

-

Figure 14: General Control Configuration

+

Figure 13: General Control Configuration

@@ -1129,32 +1217,32 @@ 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 14 to a generalized Plant is as follows:

  1. Define signals (\(w\), \(z\), \(u\) and \(v\)) of the generalized plant
  2. -
  3. Remove \(K\) and rearrange the inputs and outputs to match the generalized configuration shown in Figure 13
  4. +
  5. Remove \(K\) and rearrange the inputs and outputs to match the generalized configuration shown in Figure 12
-
+
    -
  1. Convert the tracking control architecture shown in Figure 15 to a generalized configuration
  2. +
  3. Convert the tracking control architecture shown in Figure 14 to a generalized configuration
  4. Compute the transfer function matrix using Matlab as a function or \(K\) and \(G\)
-
+

classical_feedback_tracking.png

-

Figure 15: Classical Feedback Control Architecture (Tracking)

+

Figure 14: Classical Feedback Control Architecture (Tracking)

Hint @@ -1170,20 +1258,20 @@ Usually, we want to minimize the tracking errors \(\epsilon\) and the control si

-Then, Remove \(K\) and rearrange the inputs and outputs as in Figure 13. +Then, Remove \(K\) and rearrange the inputs and outputs as in Figure 12.

Answer

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

-
+

mixed_sensitivity_ref_tracking.png

-

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

+

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

@@ -1204,21 +1292,21 @@ P.OutputName = {'e', 'u

-
-

4 Modern Interpretation of Control Specifications

+
+

4 Modern Interpretation of Control Specifications

- +

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

@@ -1228,12 +1316,12 @@ However, the loop gain \(L(s)\) does not directly give the performances o

-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 16, we can link to the following specifications to closed-loop transfer functions. +This is summarized in Table 6.

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

gang_of_four_feedback.png

-

Figure 17: Simple Feedback Architecture

+

Figure 16: Simple Feedback Architecture

-
-

4.1 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 16.

Hint @@ -1337,9 +1425,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 16. These called the Gang of Four:

\begin{align} @@ -1351,7 +1439,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. @@ -1375,11 +1463,11 @@ Similarly, to reduce the effect of measurement noise \(n\) on the output \(y\),

-
-

4.2 Sensitivity Function

+
+

4.2 Sensitivity Function

- +

@@ -1390,15 +1478,15 @@ In this section, we will see how the shape of the sensitivity function will impa

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

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

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

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

+

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

-
+

sensitivity_shape_effect_step.png

-

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

+

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

-
+
Closed-Loop Bandwidth

The closed-loop bandwidth \(\omega_b\) is the frequency where \(|S(j\omega)|\) first crosses \(1/\sqrt{2} = -3dB\) from below. @@ -1462,9 +1550,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 19.

@@ -1479,28 +1567,28 @@ 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

+

Figure 19: Typical wanted shape of the Sensitivity transfer function

-
-

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

@@ -1514,7 +1602,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 20.

@@ -1523,7 +1611,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 20:

  • bandwidth of \(\approx 10\, \text{Hz}\)
  • @@ -1536,10 +1624,10 @@ 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)\)

    +

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

    @@ -1552,7 +1640,7 @@ Now let’s suppose the “real” plant \(G_r(s)\) as a slightly lo

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

    @@ -1570,10 +1658,10 @@ 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)

    +

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

    @@ -1590,7 +1678,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.
    @@ -1599,7 +1687,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.

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

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

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

    -
    +

    module_margin_example.png

    -

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

    +

    Figure 22: 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 22, there is a close relationship between the module margin and the gain and phase margins. We can indeed show that for a given value of the module margin \(\Delta M\), we have:

    \begin{equation} @@ -1653,7 +1741,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.

    @@ -1673,14 +1761,14 @@ Note that this is why large peak value of \(|S(j\omega)|\) usually indicate robu 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.

    @@ -1689,11 +1777,11 @@ To learn more about module/disk margin, you can check out -

    4.4 Other Requirements

    +
    +

    4.4 Other Requirements

    - +

    @@ -1722,8 +1810,8 @@ with: Noise Attenuation: typical wanted shape for \(T\)

    - - +
    Table 7: Typical Specifications and corresponding wanted norms of open and closed loop tansfer functions
    +@@ -1775,11 +1863,11 @@ Noise Attenuation: typical wanted shape for \(T\) -
    -

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

    +
    +

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

    - +

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

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

    -
    -

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

    +
    +

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

    - +

    -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. +If the \(\mathcal{H}_\infty\) synthesis is applied on the generalized plant \(P(s)\) shown in Figure 23, it will generate a controller \(K(s)\) such that the \(\mathcal{H}_\infty\) norm of closed-loop transfer function from \(r\) to \(\epsilon\) is minimized. 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\).

    @@ -1821,16 +1909,16 @@ However, as the \(\mathcal{H}_\infty\) norm is the maximum peak value of the tra

    -
    +

    loop_shaping_S_without_W.png

    -

    Figure 24: Generalized Plant

    +

    Figure 23: Generalized Plant

    -
    +

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

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

    +

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

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

    loop_shaping_S_with_W.png

    -

    Figure 25: Weighted Generalized Plant

    +

    Figure 24: Weighted Generalized Plant

    -
    +

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

    Hint @@ -1906,18 +1994,18 @@ The second solution is however more general, and can also be used when weights a
    -
    -

    5.2 Design of Weighting Functions

    +
    +

    5.2 Design of Weighting Functions

    - +

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

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

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

    • Low frequency gain of 100
    • @@ -1958,15 +2046,15 @@ The Matlab code below produces a weighting function with the following character
    -
    +

    first_order_weight.png

    -

    Figure 26: Obtained Magnitude of the Weighting Function

    +

    Figure 25: Obtained Magnitude of the Weighting Function

    -
    +

    Quite often, higher orders weights are required.

    @@ -1998,7 +2086,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
    @@ -2033,25 +2121,25 @@ W3 = generateWeight('G0', 1e2, 27.
    +The obtained shapes are shown in Figure 26.
     

    -
    +

    high_order_weight.png

    -

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

    +

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

    -
    -

    5.3 Shaping the Sensitivity Function

    +
    +

    5.3 Shaping the Sensitivity Function

    - +

    @@ -2064,17 +2152,17 @@ Let’s design a controller using the \(\mathcal{H}_\infty\) synthesis that

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

    -
    +

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

    Hint

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

    @@ -2092,10 +2180,10 @@ Remember that the wanted upper bound of the sensitivity function is defined by t

    -
    +

    h-infinity-spec-S.png

    -

    Figure 28: Typical wanted shape of the Sensitivity transfer function

    +

    Figure 27: Typical wanted shape of the Sensitivity transfer function

    @@ -2157,7 +2245,7 @@ And the \(\mathcal{H}_\infty\) synthesis is performed on the weighted gen
    -
    +
     Test bounds:  0.5 <=  gamma  <=  0.51
     
      gamma        X>=0        Y>=0       rho(XY)<1    p/f
    @@ -2178,10 +2266,10 @@ Best performance (actual): 0.503
     \end{aligned}
     
     

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

    -
    +

    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.

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

    results_sensitivity_hinf.png

    -

    Figure 29: Weighting function and obtained closed-loop sensitivity

    +

    Figure 28: Weighting function and obtained closed-loop sensitivity

    -
    -

    5.4 Shaping multiple closed-loop transfer functions

    +
    +

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

    @@ -2219,7 +2307,7 @@ For instance to limit the control input \(u\), \(KS\) should be shaped while to

    -When multiple closed-loop transfer function are shaped at the same time, it is refereed to as “Mixed-Sensitivity \(\mathcal{H}_\infty\) Control” and is the subject of Section 6. +When multiple closed-loop transfer function are shaped at the same time, it is refereed to as “Mixed-Sensitivity \(\mathcal{H}_\infty\) Control” and is the subject of Section 6.

    @@ -2227,14 +2315,14 @@ Depending on the closed-loop transfer function being shaped, different general c

    Shaping of S and KS -
    +

    general_conf_shaping_S_KS.png

    -

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

    +

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

    -
    P = [W1 -G*W1
    +
    P = [W1 -G*W1
          0   W2
          1  -G];
     
    @@ -2247,14 +2335,14 @@ Depending on the closed-loop transfer function being shaped, different general c
    Shaping of S and T -
    +

    general_conf_shaping_S_T.png

    -

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

    +

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

    -
    P = [W1 -G*W1
    +
    P = [W1 -G*W1
          0   G*W2
          1   -G];
     
    @@ -2267,14 +2355,14 @@ Depending on the closed-loop transfer function being shaped, different general c
    Shaping of S and GS -
    +

    general_conf_shaping_S_GS.png

    -

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

    +

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

    -
    P = [W1   -W1
    +
    P = [W1   -W1
          G*W2 -G*W2
          G    -G];
     
    @@ -2286,14 +2374,14 @@ Depending on the closed-loop transfer function being shaped, different general c
    Shaping of S, T and KS -
    +

    general_conf_shaping_S_T_KS.png

    -

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

    +

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

    -
    P = [W1 -G*W1
    +
    P = [W1 -G*W1
          0   W2
          0   G*W3
          1   -G];
    @@ -2308,14 +2396,14 @@ Depending on the closed-loop transfer function being shaped, different general c
     
    Shaping of S, T and GS -
    +

    general_conf_shaping_S_T_GS.png

    -

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

    +

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

    -
    P = [W1   -W1
    +
    P = [W1   -W1
          G*W2 -G*W2
          0     W3
          G    -G];
    @@ -2330,14 +2418,14 @@ Depending on the closed-loop transfer function being shaped, different general c
     
    Shaping of S, T, KS and GS -
    +

    general_conf_shaping_S_T_KS_GS.png

    -

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

    +

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

    -
    P = [ W1  -W1*G*W3 -G*W1
    +
    P = [ W1  -W1*G*W3 -G*W1
           0    0        W2
           1   -G*W3    -G];
     
    @@ -2361,7 +2449,7 @@ When shaping multiple closed-loop transfer functions, one should be verify caref -
    +

    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: @@ -2394,7 +2482,7 @@ The control bandwidth is clearly limited by physical constrains such as sampling Similar relationship can be found for \(T\), \(KS\) and \(GS\).

    -
    +

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

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

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

    @@ -2425,17 +2513,17 @@ However, in some frequency bands, the norms do not depend on the controller and

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

    -
    +

    h-infinity-4-blocs-constrains.png

    -

    Figure 36: Shaping the Gang of Four: Limitations

    +

    Figure 35: 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. @@ -2454,16 +2542,16 @@ Two approaches can be used to obtain controllers with reasonable order:

    -
    -

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

    +
    +

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

    - +

    -
    -

    6.1 Control Problem

    +
    +

    6.1 Control Problem

    • [ ] Control Diagram
    • @@ -2516,8 +2604,8 @@ d(t>0.5) = 5e-4;
    -
    -

    6.2 Control Design Procedure

    +
    +

    6.2 Control Design Procedure

    Table 8: Typical Specifications and corresponding wanted norms of open and closed loop tansfer functions
    @@ -2564,10 +2652,10 @@ d(t>0.5) = 5e-4;
    -
    +

    mixed_sensitivity_control_schematic.png

    -

    Figure 37: Generalized Plant used for the Mixed Sensitivity Synthesis

    +

    Figure 36: Generalized Plant used for the Mixed Sensitivity Synthesis

      @@ -2586,11 +2674,11 @@ d(t>0.5) = 5e-4;
    -
    -

    6.3 Step 1 - Shaping of \(S\)

    +
    +

    6.3 Step 1 - Shaping of \(S\)

    - +

    @@ -2622,7 +2710,7 @@ W3 = tf(0.1);

    -
    +
     K1 = hinfsyn(Pw, 1, 1, 'Display', 'on');
     
       Test bounds:  0.5 <=  gamma  <=  0.552
    @@ -2683,11 +2771,11 @@ xlabel('Time [s]'); ylabel(
    -

    6.4 Step 2 - Shaping of \(KS\)

    +
    +

    6.4 Step 2 - Shaping of \(KS\)

    - +

    @@ -2708,7 +2796,7 @@ xlabel('Time [s]'); ylabel( +
     K1 = hinfsyn(Pw, 1, 1, 'Display', 'on');
     
       Test bounds:  0.51 <=  gamma  <=  1.2
    @@ -2767,11 +2855,11 @@ xlabel('Time [s]'); ylabel(
    -

    6.5 Step 3 - Shaping of \(T\)

    +
    +

    6.5 Step 3 - Shaping of \(T\)

    - +

    @@ -2792,7 +2880,7 @@ xlabel('Time [s]'); ylabel( +
     K3 = hinfsyn(Pw, 1, 1, 'Display', 'on');
     
       Test bounds:  0.578 <=  gamma  <=  1.66
    @@ -2854,18 +2942,18 @@ xlabel('Time [s]'); ylabel(
    -

    7 Conclusion

    +
    +

    7 Conclusion

    - +

    -
    -

    Resources

    -
    +
    +

    Resources

    +

    @@ -2873,12 +2961,19 @@ xlabel('Time [s]'); ylabel(

    + +

    Bibliography

    +
    +
    +
    [1]
    B. J. Lurie, A. Ghavimi, F. Y. Hadaegh, and E. Mettler, “System Architecture Trades Using Bode-Step Control Design,” Journal of Guidance, Control, and Dynamics, vol. 25, no. 2, pp. 309–315, 2002, [Online]. Available: https://doi.org/10.2514/2.4883.
    +
    +

    Author: Dehaeze Thomas

    -

    Created: 2020-12-02 mer. 16:46

    +

    Created: 2020-12-02 mer. 19:00

    diff --git a/index.org b/index.org index e259d64..89b3e5b 100644 --- a/index.org +++ b/index.org @@ -14,6 +14,8 @@ #+HTML_MATHJAX: align: center tagside: right font: TeX +#+CSL_STYLE: ieee.csl + #+PROPERTY: header-args:matlab :session *MATLAB* #+PROPERTY: header-args:matlab+ :comments org #+PROPERTY: header-args:matlab+ :results none @@ -455,24 +457,27 @@ The Bode plots of $G(s)$ and $G_d(s)$ are shown in Figures [[fig:bode_plot_examp ** 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]] +After an introduction to classical Loop Shaping in Section [[sec:open_loop_shaping_introduction]], a practical example is given in Section [[sec:loop_shaping_example]]. +Such Loop Shaping is usually performed manually with tools coming from the classical control theory. + +However, the $\mathcal{H}_\infty$ synthesis can be used to automate the Loop Shaping process. +This is presented in Section [[sec:h_infinity_open_loop_shaping]] and applied on the same example in Section [[sec:h_infinity_open_loop_shaping_example]]. ** Introduction to Loop Shaping <> #+begin_definition -*Loop Shaping* refers to a design procedure that involves explicitly shaping the magnitude of the *Loop Transfer Function* $L(s)$. +*Loop Shaping* refers to a control design procedure that involves explicitly shaping the magnitude of the *Loop Transfer Function* $L(s)$. #+end_definition #+begin_definition -The *Loop Gain* $L(s)$ usually refers to as the product of the controller and the plant ("Gain around the loop", see Figure [[fig:open_loop_shaping]]): +The *Loop Gain* (or Loop transfer function) $L(s)$ usually refers to as the product of the controller and the plant (see Figure [[fig:open_loop_shaping]]): \begin{equation} L(s) = G(s) \cdot K(s) \label{eq:loop_gain} \end{equation} +Its name comes from the fact that this is actually the "gain around the loop". + #+begin_src latex :file open_loop_shaping.pdf \begin{tikzpicture} \node[addb={+}{}{}{}{-}] (addsub) at (0, 0){}; @@ -499,17 +504,19 @@ The *Loop Gain* $L(s)$ usually refers to as the product of the controller and th [[file:figs/open_loop_shaping.png]] #+end_definition -This synthesis method is widely used as many characteristics of the closed-loop system depend on the shape of the open loop gain $L(s)$ such as: -- *Performance*: $L$ large +This synthesis method is one of main way controllers are design in the classical control theory. +It is widely used and generally successful as many characteristics of the closed-loop system depend on the shape of the open loop gain $L(s)$ such as: +- *Good Tracking*: $L$ large - *Good disturbance rejection*: $L$ large -- *Limitation of measurement noise on plant output*: $L$ small -- *Small magnitude of input signal*: $K$ and $L$ small +- *Attenuation of measurement noise on plant output*: $L$ small +- *Small magnitude of input signal*: $L$ small - *Nominal stability*: $L$ small (RHP zeros and time delays) - *Robust stability*: $L$ small (neglected dynamics) -The Open Loop shape is usually done manually has the loop gain $L(s)$ depends linearly on $K(s)$ eqref:eq:loop_gain. - -$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 [[fig:open_loop_shaping_shape]]). +The shaping of the Loop Gain is done manually by combining several leads, lags, notches... +This process is very much simplified by the fact that the loop gain $L(s)$ depends *linearly* on $K(s)$ eqref:eq:loop_gain. +A typical wanted Loop Shape is shown in Figure [[fig:open_loop_shaping_shape]]. +Another interesting Loop shape called "Bode Step" is described in cite:lurie02_system_archit_trades_using_bode. #+begin_src latex :file open_loop_shaping_shape.pdf \begin{tikzpicture} @@ -530,12 +537,12 @@ $K(s)$ then consists of a combination of leads, lags, notches, etc. such that $L \path[shift={(0,1.8)}, fill=red!50!white] (0.5, 1.25) -- (2, 0.5) -| coordinate[near start](lfshaping) cycle; \path[shift={(0,2.2)}, fill=red!50!white] (6, -0.5) -- (7.5, -1.25) |- coordinate[near end](hfshaping) cycle; - \draw[<-] (lfshaping) -- ++(0, -0.8) node[below, align=center]{Reference\\Tracking}; - \draw[<-] (hfshaping) -- ++(0, 0.8) node[above, align=center]{Noise\\Rejection}; + \draw[<-] (lfshaping) -- ++(0, -0.8) node[below, align=center]{{\scriptsize Ref. tracking}\\{\scriptsize Dist. rejection}}; + \draw[<-] (hfshaping) -- ++(0, 0.8) node[above, align=center]{{\scriptsize Noise attenuation}}; % Crossover frequency \node[below] (wc) at (4,2){$\omega_c$}; - \draw[<-] (wc.south) -- ++(0, -0.4) node[below, align=center]{Bandwidth}; + \draw[<-] (wc.south) -- ++(0, -0.4) node[below, align=center]{{\scriptsize Bandwidth}}; % Phase \draw[] (0.5, -2) -- (2, -2)[out=0, in=-180] to (4, -1.25)[out=0, in=-180] to @@ -543,7 +550,7 @@ $K(s)$ then consists of a combination of leads, lags, notches, etc. such that $L -1.25)[out=0, in=-180] to (6, -2) -- (7.5, -2); % Phase Margin - \draw[->, dashed] (4, -2) -- (4, -1.25) node[above]{Phase Margin}; + \draw[->, dashed] (4, -2) -- (4, -1.25) node[above]{{\scriptsize Phase Margin}}; \draw[dashed] (0, -2) node[left]{$-\pi$} -- (7.5, -2); \end{tikzpicture} #+end_src @@ -553,34 +560,65 @@ $K(s)$ then consists of a combination of leads, lags, notches, etc. such that $L #+RESULTS: [[file:figs/open_loop_shaping_shape.png]] -** Example of Open Loop Shaping +The shaping of *closed-loop* transfer functions is obviously not as simple as they don't depend linearly on $K(s)$. +But this is were the $\mathcal{H}_\infty$ Synthesis will be useful! +More details on that in Sections [[sec:modern_interpretation_specification]] and [[sec:closed-loop-shaping]]. + +** Example of Manual Open Loop Shaping <> #+begin_exampl -Let's take our example system and try to apply the Open-Loop shaping strategy to design a controller that fulfils the following specifications: -- *Performance*: Bandwidth of approximately 10Hz -- *Noise Attenuation*: Roll-off of -40dB/decade past 30Hz -- *Robustness*: Gain margin > 3dB and Phase margin > 30 deg +Let's take our example system described in Section [[sec:example_system]] and design a controller using the Open-Loop shaping synthesis approach. +The specifications are: +1. *Disturbance rejection*: Highest possible rejection below 1Hz +2. *Positioning speed*: Bandwidth of approximately 10Hz +3. *Noise attenuation*: Roll-off of -40dB/decade past 30Hz +4. *Robustness*: Gain margin > 3dB and Phase margin > 30 deg #+end_exampl #+begin_exercice -Using =SISOTOOL=, design a controller that fulfill the specifications. +Using =SISOTOOL=, design a controller that fulfills the specifications. #+begin_src matlab :eval no :tangle no sisotool(G) #+end_src + +#+HTML:
    Hint +You can follow this procedure: +1. In order to have good disturbance rejection at low frequency, add a simple or double *integrator* +2. In terms of the loop gain, the *bandwidth* can be defined at the frequency $\omega_c$ where $|l(j\omega_c)|$ first crosses 1 from above. + Therefore, adjust the *gain* such that $L(j\omega)$ crosses 1 at around 10Hz +3. The roll-off at high frequency for noise attenuation should already be good enough. + If not, add a *low pass filter* +4. Add a *Lead* centered around the crossover frequency (10 Hz) and tune it such that sufficient phase margin is added. + Verify that the gain margin is good enough. +#+HTML:
    #+end_exercice -In order to have the wanted Roll-off, two integrators are used, a lead is also added to have sufficient phase margin. - -The obtained controller is shown below, and the bode plot of the Loop Gain is shown in Figure [[fig:loop_gain_manual_afm]]. +Let's say we came up with the following controller. #+begin_src matlab - K = 14e8 * ... % Gain - 1/(s^2) * ... % Double Integrator + K = 14e8 * ... % Gain + 1/(s^2) * ... % Double Integrator 1/(1 + s/2/pi/40) * ... % Low Pass Filter (1 + s/(2*pi*10/sqrt(8)))/(1 + s/(2*pi*10*sqrt(8))); % Lead #+end_src +The bode plot of the Loop Gain is shown in Figure [[fig:loop_gain_manual_afm]] and we can verify that we have the wanted stability margins using the =margin= command: +#+begin_src matlab + [Gm, Pm, ~, Wc] = margin(G*K) +#+end_src + +#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*) + data2orgtable([Gm; Pm; Wc/2/pi], {'Gain Margin $> 3$ [dB]', 'Phase Margin $> 30$ [deg]', 'Crossover $\approx 10$ [Hz]'}, {'Requirements', 'Manual Method'}, ' %.1f '); +#+end_src + +#+RESULTS: +| Requirements | Manual Method | +|-----------------------------+---------------| +| Gain Margin $> 3$ [dB] | 3.1 | +| Phase Margin $> 30$ [deg] | 35.4 | +| Crossover $\approx 10$ [Hz] | 10.1 | + #+begin_src matlab :exports none freqs = logspace(0, 3, 1000); @@ -617,106 +655,62 @@ The obtained controller is shown below, and the bode plot of the Loop Gain is sh #+RESULTS: [[file:figs/loop_gain_manual_afm.png]] -And we can verify that we have the wanted stability margins: -#+begin_src matlab - [Gm, Pm, ~, Wc] = margin(G*K) -#+end_src - -#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*) - data2orgtable([Gm; Pm; Wc/2/pi], {'Gain Margin $> 3$ [dB]', 'Phase Margin $> 30$ [deg]', 'Crossover $\approx 10$ [Hz]'}, {'Requirements', 'Manual Method'}, ' %.1f '); -#+end_src - -#+RESULTS: -| Requirements | Manual Method | -|-----------------------------+---------------| -| Gain Margin $> 3$ [dB] | 3.1 | -| Phase Margin $> 30$ [deg] | 35.4 | -| Crossover $\approx 10$ [Hz] | 10.1 | - ** $\mathcal{H}_\infty$ Loop Shaping Synthesis <> -The Open Loop Shaping synthesis can be performed using the $\mathcal{H}_\infty$ Synthesis. +The synthesis of controllers based on the Loop Shaping method can be automated using the $\mathcal{H}_\infty$ Synthesis. -Even though we will not go into details, we will provide one example. - -Using Matlab, the $\mathcal{H}_\infty$ Loop Shaping Synthesis can be performed using the =loopsyn= command: +Using Matlab, it can be easily performed using the =loopsyn= command: #+begin_src matlab :eval no :tangle no - K = loopsyn(G, Gd); + K = loopsyn(G, Lw); #+end_src where: - =G= is the (LTI) plant -- =Gd= is the wanted loop shape +- =Lw= is the wanted loop shape - =K= is the synthesize controller #+begin_seealso Matlab documentation of =loopsyn= ([[https://www.mathworks.com/help/robust/ref/loopsyn.html][link]]). #+end_seealso +Therefore, by just providing the wanted loop shape and the plant model, the $\mathcal{H}_\infty$ Loop Shaping synthesis generates a /stabilizing/ controller such that the obtained loop gain $L(s)$ matches the specified one with an accuracy $\gamma$. + +Even though we will not go into details and explain how such synthesis is working, an example is provided in the next section. + ** Example of the $\mathcal{H}_\infty$ Loop Shaping Synthesis <> -Let's reuse the previous plant. +To apply the $\mathcal{H}_\infty$ Loop Shaping Synthesis, the wanted shape of the loop gain should be determined from the specifications. +This is summarized in Table [[tab:open_loop_shaping_specifications]]. -Translate the specification into the wanted shape of the open loop gain. -- *Performance*: Bandwidth of approximately 10Hz: $|L_w(j2 \pi 10)| = 1$ -- *Noise Attenuation*: Roll-off of -40dB/decade past 30Hz -- *Robustness*: Gain margin > 3dB and Phase margin > 30 deg +Such shape corresponds to the typical wanted Loop gain Shape shown in Figure [[fig:open_loop_shaping_shape]]. +#+name: tab:open_loop_shaping_specifications +#+caption: Wanted Loop Shape corresponding to each specification +| | Specification | Corresponding Loop Shape | +|-------------------------+---------------------------------------------+-----------------------------------------------------------------| +| *Disturbance Rejection* | Highest possible rejection below 1Hz | Slope of -40dB/decade at low frequency to have a high loop gain | +| *Positioning Speed* | Bandwidth of approximately 10Hz | $L$ crosses 1 at 10Hz: $\vert L_w(j2 \pi 10)\vert = 1$ | +| *Noise Attenuation* | Roll-off of -40dB/decade past 30Hz | Roll-off of -40dB/decade past 30Hz | +| *Robustness* | Gain margin > 3dB and Phase margin > 30 deg | Slope of -20dB/decade near the crossover | + +Then, a (stable, minimum phase) transfer function $L_w(s)$ should be created that has the same gain as the wanted shape of the Loop gain. +For this example, a double integrator and a lead centered on 10Hz are used. +Then the gain is adjusted such that the $|L_w(j2 \pi 10)| = 1$. + +Using Matlab, we have: #+begin_src matlab Lw = 2.3e3 * ... 1/(s^2) * ... % Double Integrator (1 + s/(2*pi*10/sqrt(3)))/(1 + s/(2*pi*10*sqrt(3))); % Lead #+end_src -The $\mathcal{H}_\infty$ optimal open loop shaping synthesis is performed using the =loopsyn= command: +The $\mathcal{H}_\infty$ open loop shaping synthesis is then performed using the =loopsyn= command: #+begin_src matlab [K, ~, GAM] = loopsyn(G, Lw); #+end_src -#+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 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) - -#+begin_src matlab :exports none - freqs = logspace(0, 3, 1000); - - figure; - tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); - - ax1 = nexttile([2,1]); - plot(freqs, abs(squeeze(freqresp(K, freqs, 'Hz')))); - set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); - ylabel('Magnitude'); set(gca, 'XTickLabel',[]); - hold off; - - ax2 = nexttile; - plot(freqs, 180/pi*angle(squeeze(freqresp(K, freqs, 'Hz')))); - set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); - yticks(-360:90:360); ylim([-180, 90]); - xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); - - linkaxes([ax1,ax2],'x'); - xlim([freqs(1), freqs(end)]); -#+end_src - -#+begin_src matlab :tangle no :exports results :results file replace - exportFig('figs/open_loop_shaping_hinf_K.pdf', 'width', 'wide', 'height', 'normal'); -#+end_src - -#+name: fig:open_loop_shaping_hinf_K -#+caption: Obtained controller $K$ using the open-loop $\mathcal{H}_\infty$ shaping -#+RESULTS: -[[file:figs/open_loop_shaping_hinf_K.png]] - -The obtained Loop Gain is shown in Figure [[fig:open_loop_shaping_hinf_L]] and matches the specified one by a factor $\gamma$. +The obtained Loop Gain is shown in Figure [[fig:open_loop_shaping_hinf_L]] and matches the specified one by a factor $\gamma \approx 2$. #+begin_src matlab :exports none freqs = logspace(0, 3, 1000); @@ -758,7 +752,51 @@ The obtained Loop Gain is shown in Figure [[fig:open_loop_shaping_hinf_L]] and m #+RESULTS: [[file:figs/open_loop_shaping_hinf_L.png]] -Let's now compare the obtained stability margins of the $\mathcal{H}_\infty$ controller and of the manually developed controller in Table [[tab:open_loop_shaping_compare]]. + +#+begin_important +When using the $\mathcal{H}_\infty$ Synthesis, it is usually recommended to analyze the obtained controller. + +This is usually done by breaking down the controller into simple elements such as low pass filters, high pass filters, notches, leads, etc. +#+end_important + +Let's briefly analyze the obtained controller which bode plot is shown in Figure [[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) + +#+begin_src matlab :exports none + freqs = logspace(0, 3, 1000); + + figure; + tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + + ax1 = nexttile([2,1]); + plot(freqs, abs(squeeze(freqresp(K, freqs, 'Hz')))); + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); + ylabel('Magnitude'); set(gca, 'XTickLabel',[]); + hold off; + + ax2 = nexttile; + plot(freqs, 180/pi*angle(squeeze(freqresp(K, freqs, 'Hz')))); + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); + yticks(-360:90:360); ylim([-180, 90]); + xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); + + linkaxes([ax1,ax2],'x'); + xlim([freqs(1), freqs(end)]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace + exportFig('figs/open_loop_shaping_hinf_K.pdf', 'width', 'wide', 'height', 'normal'); +#+end_src + +#+name: fig:open_loop_shaping_hinf_K +#+caption: Obtained controller $K$ using the open-loop $\mathcal{H}_\infty$ shaping +#+RESULTS: +[[file:figs/open_loop_shaping_hinf_K.png]] + + +Let's finally compare the obtained stability margins of the $\mathcal{H}_\infty$ controller and of the manually developed controller in Table [[tab:open_loop_shaping_compare]]. #+begin_src matlab :exports none [Gm_2, Pm_2, ~, Wc_2] = margin(G*K)