1975 lines
92 KiB
Markdown
1975 lines
92 KiB
Markdown
+++
|
||
title = "A brief and practical introduction to $\\mathcal{H}_\\infty$ Control"
|
||
author = ["Dehaeze Thomas"]
|
||
draft = false
|
||
year = 2020
|
||
pubtype = "lecture"
|
||
pdf = "https://git.tdehaeze.xyz/tdehaeze/lecture-h-infinity/raw/branch/master/index.pdf"
|
||
video = "https://www.youtube.com/watch?v=KdJsm_X8uks"
|
||
code = "https://git.tdehaeze.xyz/tdehaeze/lecture-h-infinity"
|
||
+++
|
||
|
||
{{< youtube KdJsm_X8uks >}}
|
||
|
||
|
||
## Introduction {#introduction}
|
||
|
||
The purpose of this document is to give a _practical introduction_ to the wonderful world of \\(\mathcal{H}\_\infty\\) Control.
|
||
|
||
No attend is made to provide an exhaustive treatment of the subject.
|
||
\\(\mathcal{H}\_\infty\\) Control is a very broad topic and entire books are written on it.
|
||
Therefore, for more advanced discussion, please have a look at the recommended references at the bottom of this document.
|
||
|
||
When possible, Matlab scripts used for the example/exercises are provided such that you can easily test them on your computer.
|
||
|
||
The general structure of this document is as follows:
|
||
|
||
- A short introduction to _model based control_ is given in Section [Introduction to Model Based Control](#sec:model_based_control)
|
||
- Classical _open_ loop shaping method is presented in Section [Classical Open Loop Shaping](#sec:open_loop_shaping).
|
||
It is also shown that \\(\mathcal{H}\_\infty\\) synthesis can be used for _open_ loop shaping
|
||
- Important concepts indispensable for \\(\mathcal{H}\_\infty\\) control such as the \\(\mathcal{H}\_\infty\\) norm and the generalized plant are introduced in Section [A first Step into the \\(\mathcal{H}\_\infty\\) world](#sec:h_infinity_introduction)
|
||
- A very important step in \\(\mathcal{H}\_\infty\\) control is to express the control specifications (performances, robustness, etc.) as an \\(\mathcal{H}\_\infty\\) optimization problem. Such procedure is described in Section [Modern Interpretation of Control Specifications](#sec:modern_interpretation_specification)
|
||
- One of the most useful use of the \\(\mathcal{H}\_\infty\\) control is the shaping of closed-loop transfer functions.
|
||
Such technique is presented in Section [\\(\mathcal{H}\_\infty\\) Shaping of closed-loop transfer functions](#sec:closed-loop-shaping)
|
||
- Finally, complete examples of the use of \\(\mathcal{H}\_\infty\\) Control for practical problems are provided in Section [Mixed-Sensitivity \\(\mathcal{H}\_\infty\\) Control - Example](#sec:h_infinity_mixed_sensitivity)
|
||
|
||
|
||
## Introduction to Model Based Control {#sec:model_based_control}
|
||
|
||
|
||
### Model Based Control - Methodology {#sec:model_based_control_methodology}
|
||
|
||
The typical methodology for **Model Based Control** techniques is schematically shown in [Figure 1](#figure--fig:control-procedure).
|
||
|
||
It consists of three steps:
|
||
|
||
1. **Identification or modeling**: a mathematical model \\(G(s)\\) representing the plant dynamics is obtained
|
||
2. **Translate the specifications into mathematical criteria**:
|
||
- <span class="underline">Specifications</span>: Response Time, Noise Rejection, Maximum input amplitude, Robustness, ...
|
||
- <span class="underline">Mathematical Criteria</span>: Cost Function, Shape of transfer function, Phase/Gain margin, Roll-Off, ...
|
||
3. **Synthesis**: research of a controller \\(K(s)\\) that satisfies the specifications for the model of the system
|
||
|
||
<a id="figure--fig:control-procedure"></a>
|
||
|
||
{{< figure src="figs/control-procedure.png" caption="<span class='figure-number'>Figure 1: </span>Typical Methodoly for Model Based Control" >}}
|
||
|
||
In this document, we will suppose a model of the plant is available (step 1 already performed), and we will focus on steps 2 and 3.
|
||
|
||
In Section [Classical Open Loop Shaping](#sec:open_loop_shaping), 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 [Modern Interpretation of Control Specifications](#sec:modern_interpretation_specification), [\\(\mathcal{H}\_\infty\\) Shaping of closed-loop transfer functions](#sec:closed-loop-shaping) and [Mixed-Sensitivity \\(\mathcal{H}\_\infty\\) Control - Example](#sec:h_infinity_mixed_sensitivity).
|
||
|
||
|
||
### From Classical Control to Robust Control {#sec:comp_classical_modern_robust_control}
|
||
|
||
Many different model based control techniques have been developed since the birth of _classical control theory_ in the '30s.
|
||
|
||
**Classical control** methods were developed starting from 1930 based on tools such as the Laplace and Fourier transforms.
|
||
It was then natural to study systems in the frequency domain using tools such as the Bode and Nyquist plots.
|
||
Controllers were manually tuned to optimize criteria such as control bandwidth, gain and phase margins.
|
||
|
||
The '60s saw the development of control techniques based on a state-space.
|
||
Linear algebra and matrices were used instead of the frequency domain tool of the class control theory.
|
||
This allows multi-inputs multi-outputs systems to be easily treated.
|
||
Kalman introduced the well known _Kalman estimator_ as well the notion of optimality by minimizing quadratic cost functions.
|
||
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 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](#table--tab:comparison-control-methods).
|
||
|
||
Note that in parallel, there have been numerous other developments, including non-linear control, adaptive control, machine-learning control just to name a few.
|
||
|
||
<a id="table--tab:comparison-control-methods"></a>
|
||
<div class="table-caption">
|
||
<span class="table-number"><a href="#table--tab:comparison-control-methods">Table 1</a>:</span>
|
||
Table summurazing the main differences between classical, modern and robust control
|
||
</div>
|
||
|
||
| | **Classical Control** | **Modern Control** | **Robust Control** |
|
||
|:----------------|:---------------------:|:------------------------:|:-----------------------------:|
|
||
| **Date** | 1930- | 1960- | 1980- |
|
||
| **Tools** | Transfer Functions | State Space formulation | Systems/Signal Norms |
|
||
| | Nyquist, Bode Plots | Riccati Equations | Closed Loop TF |
|
||
| | Root Locus | Kalman Filters | Closed Loop Shaping |
|
||
| | Phase/Gain margins | | Weighting Functions |
|
||
| | Open Loop Shaping | | Disk margin |
|
||
| **Controllers** | P, PI, PID | Full State Feedback | General Control Conf. |
|
||
| | Leads, Lags | LQG, LQR | |
|
||
| **Advantages** | Study Stability | Automatic Synthesis | Automatic Synthesis |
|
||
| | Simple | MIMO | MIMO |
|
||
| | Natural | Optimization Problem | Optimization Problem |
|
||
| | | | Guaranteed Robustness |
|
||
| **Disadvant.** | Manual Method | No Guaranteed Robustness | Requires knowledge of tools |
|
||
| | Only SISO | Rejection of Pert. | Need good model of the system |
|
||
| | No input usage lim. | | |
|
||
|
||
|
||
### Example System {#sec:example_system}
|
||
|
||
Throughout this document, multiple examples and practical application of presented control strategies will be provided.
|
||
Most of them will be applied on a physical system presented in this section.
|
||
|
||
This system is shown in [Figure 2](#figure--fig:mech-sys-1dof-inertial-contr).
|
||
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](#figure--fig:mech-sys-1dof-inertial-contr) are listed and described in [Table 2](#table--tab:example-notations).
|
||
|
||
<a id="figure--fig:mech-sys-1dof-inertial-contr"></a>
|
||
|
||
{{< figure src="figs/mech_sys_1dof_inertial_contr.png" caption="<span class='figure-number'>Figure 2: </span>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." >}}
|
||
|
||
<a id="table--tab:example-notations"></a>
|
||
<div class="table-caption">
|
||
<span class="table-number"><a href="#table--tab:example-notations">Table 2</a>:</span>
|
||
Example system variables
|
||
</div>
|
||
|
||
| **Notation** | **Description** | **Value** | **Unit** |
|
||
|------------------------|----------------------------------------------------------------|----------------|-----------|
|
||
| \\(m\\) | Payload's mass to position / isolate | \\(10\\) | [kg] |
|
||
| \\(k\\) | Stiffness of the suspension system | \\(10^6\\) | [N/m] |
|
||
| \\(c\\) | Damping coefficient of the suspension system | \\(400\\) | [N/(m/s)] |
|
||
| \\(y\\) | Payload absolute displacement (measured by an inertial sensor) | | [m] |
|
||
| \\(d\\) | Ground displacement, it acts as a disturbance | | [m] |
|
||
| \\(u\\) | Actuator force | | [N] |
|
||
| \\(r\\) | Wanted position of the mass (the reference) | | [m] |
|
||
| \\(\epsilon = r - y\\) | Position error | | [m] |
|
||
| \\(K\\) | Feedback controller | to be designed | [N/m] |
|
||
|
||
<div class="exercice">
|
||
|
||
Derive the following open-loop transfer functions:
|
||
|
||
\begin{align}
|
||
G(s) &= \frac{y}{u} \\\\
|
||
G\_d(s) &= \frac{y}{d}
|
||
\end{align}
|
||
|
||
<details><summary>Hint</summary>
|
||
|
||
You can follow this generic procedure:
|
||
|
||
1. List all applied forces ot the mass: Actuator force, Stiffness force (Hooke's law), ...
|
||
2. Apply the Newton's Second Law on the payload
|
||
\\[ m \ddot{y} = \Sigma F \\]
|
||
3. Transform the differential equations into the Laplace domain:
|
||
\\[ \frac{d\ \cdot}{dt} \Leftrightarrow \cdot \times s \\]
|
||
4. Write \\(y(s)\\) as a function of \\(u(s)\\) and \\(w(s)\\)
|
||
|
||
</details>
|
||
|
||
<details><summary>Results</summary>
|
||
|
||
\begin{align}
|
||
G(s) &= \frac{1}{m s^2 + cs + k} \\\\
|
||
G\_d(s) &= \frac{cs + k}{m s^2 + cs + k}
|
||
\end{align}
|
||
|
||
</details>
|
||
|
||
</div>
|
||
|
||
Having obtained \\(G(s)\\) and \\(G\_d(s)\\), we can transform the system shown in [Figure 2](#figure--fig:mech-sys-1dof-inertial-contr) into a classical feedback architecture as shown in [Figure 6](#figure--fig:open-loop-shaping).
|
||
|
||
<a id="figure--fig:classical-feedback-test-system"></a>
|
||
|
||
{{< figure src="figs/classical_feedback_test_system.png" caption="<span class='figure-number'>Figure 3: </span>Block diagram corresponding to the example system of [Figure 2](#figure--fig:mech-sys-1dof-inertial-contr)" >}}
|
||
|
||
Let's define the system parameters on Matlab.
|
||
|
||
```matlab { linenos=true, linenostart=1 }
|
||
k = 1e6; % Stiffness [N/m]
|
||
c = 4e2; % Damping [N/(m/s)]
|
||
m = 10; % Mass [kg]
|
||
```
|
||
|
||
And now the system dynamics \\(G(s)\\) and \\(G\_d(s)\\).
|
||
|
||
```matlab { linenos=true, linenostart=4 }
|
||
G = 1/(m*s^2 + c*s + k); % Plant
|
||
Gd = (c*s + k)/(m*s^2 + c*s + k); % Disturbance
|
||
```
|
||
|
||
The Bode plots of \\(G(s)\\) and \\(G\_d(s)\\) are shown in Figures [Figure 4](#figure--fig:bode-plot-example-afm) and [Figure 5](#figure--fig:bode-plot-example-Gd).
|
||
|
||
<a id="figure--fig:bode-plot-example-afm"></a>
|
||
|
||
{{< figure src="figs/bode_plot_example_afm.png" caption="<span class='figure-number'>Figure 4: </span>Bode plot of the plant \\(G(s)\\)" >}}
|
||
|
||
<a id="figure--fig:bode-plot-example-Gd"></a>
|
||
|
||
{{< figure src="figs/bode_plot_example_Gd.png" caption="<span class='figure-number'>Figure 5: </span>Magnitude of the disturbance transfer function \\(G\_d(s)\\)" >}}
|
||
|
||
|
||
## Classical Open Loop Shaping {#sec:open_loop_shaping}
|
||
|
||
After an introduction to classical Loop Shaping in Section [Introduction to Loop Shaping](#sec:open_loop_shaping_introduction), a practical example is given in Section [Example of Manual Open Loop Shaping](#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 [\\(\mathcal{H}\_\infty\\) Loop Shaping Synthesis](#sec:h_infinity_open_loop_shaping) and applied on the same example in Section [Example of the \\(\mathcal{H}\_\infty\\) Loop Shaping Synthesis](#sec:h_infinity_open_loop_shaping_example).
|
||
|
||
|
||
### Introduction to Loop Shaping {#sec:open_loop_shaping_introduction}
|
||
|
||
<div class="definition">
|
||
|
||
**Loop Shaping** refers to a control design procedure that involves explicitly shaping the magnitude of the **Loop Transfer Function** \\(L(s)\\).
|
||
|
||
</div>
|
||
|
||
<div class="definition">
|
||
|
||
The **Loop Gain** (or Loop transfer function) \\(L(s)\\) usually refers to as the product of the controller and the plant (see [Figure 6](#figure--fig:open-loop-shaping)):
|
||
|
||
\begin{equation}
|
||
L(s) = G(s) \cdot K(s)
|
||
\end{equation}
|
||
|
||
Its name comes from the fact that this is actually the "gain around the loop".
|
||
|
||
<a id="figure--fig:open-loop-shaping"></a>
|
||
|
||
{{< figure src="figs/open_loop_shaping.png" caption="<span class='figure-number'>Figure 6: </span>Classical Feedback Architecture" >}}
|
||
|
||
</div>
|
||
|
||
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
|
||
- **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 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)\\) .
|
||
A typical wanted Loop Shape is shown in [Figure 7](#figure--fig:open-loop-shaping-shape).
|
||
Another interesting Loop shape called "Bode Step" is described in (<a href="#citeproc_bib_item_3">Lurie et al. 2002</a>).
|
||
|
||
<a id="figure--fig:open-loop-shaping-shape"></a>
|
||
|
||
{{< figure src="figs/open_loop_shaping_shape.png" caption="<span class='figure-number'>Figure 7: </span>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 [Modern Interpretation of Control Specifications](#sec:modern_interpretation_specification) and [\\(\mathcal{H}\_\infty\\) Shaping of closed-loop transfer functions](#sec:closed-loop-shaping).
|
||
|
||
|
||
### Example of Manual Open Loop Shaping {#sec:loop_shaping_example}
|
||
|
||
<div class="exampl">
|
||
|
||
Let's take our example system described in Section [Example System](#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
|
||
|
||
</div>
|
||
|
||
<div class="exercice">
|
||
|
||
Using `SISOTOOL`, design a controller that fulfills the specifications.
|
||
|
||
```matlab
|
||
sisotool(G)
|
||
```
|
||
|
||
<details><summary>Hint</summary>
|
||
|
||
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.
|
||
|
||
</details>
|
||
|
||
</div>
|
||
|
||
Let's say we came up with the following controller.
|
||
|
||
```matlab
|
||
K = 14e8 * ... % Gain
|
||
1/(s^2) * ... % Double Integrator
|
||
1/(1 + s/2/pi/40) * ... % Low Pass Filter
|
||
(1 + s/(2*pi*10/sqrt(8)))/(1 + s/(2*pi*10*sqrt(8))); % Lead
|
||
```
|
||
|
||
The bode plot of the Loop Gain is shown in [Figure 8](#figure--fig:loop-gain-manual-afm) and we can verify that we have the wanted stability margins using the `margin` command:
|
||
|
||
```matlab
|
||
[Gm, Pm, ~, Wc] = margin(G*K);
|
||
```
|
||
|
||
| Requirements | Manual Method |
|
||
|---------------------------------|---------------|
|
||
| Gain Margin \\(> 3\\) [dB] | 3.1 |
|
||
| Phase Margin \\(> 30\\) [deg] | 35.4 |
|
||
| Crossover \\(\approx 10\\) [Hz] | 10.1 |
|
||
|
||
<a id="figure--fig:loop-gain-manual-afm"></a>
|
||
|
||
{{< figure src="figs/loop_gain_manual_afm.png" caption="<span class='figure-number'>Figure 8: </span>Bode Plot of the obtained Loop Gain \\(L(s) = G(s) K(s)\\)" >}}
|
||
|
||
|
||
### \\(\mathcal{H}\_\infty\\) Loop Shaping Synthesis {#sec:h_infinity_open_loop_shaping}
|
||
|
||
The synthesis of controllers based on the Loop Shaping method can be automated using the \\(\mathcal{H}\_\infty\\) Synthesis.
|
||
|
||
Using Matlab, it can be easily performed using the `loopsyn` command:
|
||
|
||
```matlab
|
||
K = loopsyn(G, Lw);
|
||
```
|
||
|
||
where:
|
||
|
||
- `G` is the (LTI) plant
|
||
- `Lw` is the wanted loop shape
|
||
- `K` is the synthesize controller
|
||
|
||
<div class="seealso">
|
||
|
||
Matlab documentation of `loopsyn` ([link](https://www.mathworks.com/help/robust/ref/loopsyn.html)).
|
||
|
||
</div>
|
||
|
||
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 {#sec:h_infinity_open_loop_shaping_example}
|
||
|
||
To apply the \\(\mathcal{H}\_\infty\\) Loop Shaping Synthesis, the wanted shape of the loop gain should be determined from the specifications.
|
||
This is summarized in [Table 3](#table--tab:open-loop-shaping-specifications).
|
||
|
||
Such shape corresponds to the typical wanted Loop gain Shape shown in [Figure 7](#figure--fig:open-loop-shaping-shape).
|
||
|
||
<a id="table--tab:open-loop-shaping-specifications"></a>
|
||
<div class="table-caption">
|
||
<span class="table-number"><a href="#table--tab:open-loop-shaping-specifications">Table 3</a>:</span>
|
||
Wanted Loop Shape corresponding to each specification
|
||
</div>
|
||
|
||
| | **Specification** | **Corresponding Loop Shape** |
|
||
|----------------|------------------------------------------------|------------------------------------------|
|
||
| **Dist. Rej.** | Highest possible rejection below 1Hz | Slope of -40dB/dec at low frequency |
|
||
| **Pos. Speed** | Bandwidth of approximately 10Hz | \\(L\\) crosses 1 at 10Hz |
|
||
| **Noise Att.** | Roll-off of -40dB/decade past 30Hz | Roll-off of -40dB/decade past 30Hz |
|
||
| **Robustness** | \\(\Delta G > 3dB\\), \\(\Delta \phi > 30^o\\) | Slope of -20dB/decade near the crossover |
|
||
|
||
Then, a (stable, minimum phase) transfer function \\(L\_w(s)\\) should be created that has the same gain as the wanted shape of the Loop gain.
|
||
For this example, a double integrator and a lead centered on 10Hz are used.
|
||
Then the gain is adjusted such that the \\(|L\_w(j2 \pi 10)| = 1\\).
|
||
|
||
Using Matlab, we have:
|
||
|
||
```matlab
|
||
Lw = 2.3e3 * ...
|
||
1/(s^2) * ... % Double Integrator
|
||
(1 + s/(2*pi*10/sqrt(3)))/(1 + s/(2*pi*10*sqrt(3))); % Lead
|
||
```
|
||
|
||
The \\(\mathcal{H}\_\infty\\) open loop shaping synthesis is then performed using the `loopsyn` command:
|
||
|
||
```matlab
|
||
[K, ~, GAM] = loopsyn(G, Lw);
|
||
```
|
||
|
||
The obtained Loop Gain is shown in [Figure 9](#figure--fig:open-loop-shaping-hinf-L) and matches the specified one by a factor \\(\gamma \approx 2\\).
|
||
|
||
<a id="figure--fig:open-loop-shaping-hinf-L"></a>
|
||
|
||
{{< figure src="figs/open_loop_shaping_hinf_L.png" caption="<span class='figure-number'>Figure 9: </span>Obtained Open Loop Gain \\(L(s) = G(s) K(s)\\) and comparison with the wanted Loop gain \\(L\_w\\)" >}}
|
||
|
||
<div class="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.
|
||
|
||
</div>
|
||
|
||
Let's briefly analyze the obtained controller which bode plot is shown in [Figure 10](#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)
|
||
|
||
<a id="figure--fig:open-loop-shaping-hinf-K"></a>
|
||
|
||
{{< figure src="figs/open_loop_shaping_hinf_K.png" caption="<span class='figure-number'>Figure 10: </span>Obtained controller \\(K\\) using the open-loop \\(\mathcal{H}\_\infty\\) shaping" >}}
|
||
|
||
Let's finally compare the obtained stability margins of the \\(\mathcal{H}\_\infty\\) controller and of the manually developed controller in [Table 4](#table--tab:open-loop-shaping-compare).
|
||
|
||
<a id="table--tab:open-loop-shaping-compare"></a>
|
||
<div class="table-caption">
|
||
<span class="table-number"><a href="#table--tab:open-loop-shaping-compare">Table 4</a>:</span>
|
||
Comparison of the characteristics obtained with the two methods
|
||
</div>
|
||
|
||
| **Specifications** | **Manual Method** | **\\(\mathcal{H}\_\infty\\) Method** |
|
||
|---------------------------------|-------------------|--------------------------------------|
|
||
| Gain Margin \\(> 3\\) [dB] | 3.1 | 31.7 |
|
||
| Phase Margin \\(> 30\\) [deg] | 35.4 | 54.7 |
|
||
| Crossover \\(\approx 10\\) [Hz] | 10.1 | 9.9 |
|
||
|
||
|
||
## A first Step into the \\(\mathcal{H}\_\infty\\) world {#sec:h_infinity_introduction}
|
||
|
||
In this section, the \\(\mathcal{H}\_\infty\\) Synthesis method, which is based on the optimization of the \\(\mathcal{H}\_\infty\\) norm of transfer functions, is introduced.
|
||
|
||
After the \\(\mathcal{H}\_\infty\\) norm is defined in Section [The \\(\mathcal{H}\_\infty\\) Norm](#sec:h_infinity_norm), the \\(\mathcal{H}\_\infty\\) synthesis procedure is described in Section [\\(\mathcal{H}\_\infty\\) Synthesis](#sec:h_infinity_synthesis) .
|
||
|
||
The generalized plant, a very useful tool to describe a control problem, is presented in Section [The Generalized Plant](#sec:generalized_plant).
|
||
The \\(\mathcal{H}\_\infty\\) is then applied to this generalized plant in Section [The \\(\mathcal{H}\_\infty\\) Synthesis applied on the Generalized plant](#sec:h_infinity_general_synthesis).
|
||
|
||
Finally, an example showing how to convert a typical feedback control architecture into a generalized plant is given in Section [From a Classical Feedback Architecture to a Generalized Plant](#sec:generalized_plant_derivation).
|
||
|
||
|
||
### The \\(\mathcal{H}\_\infty\\) Norm {#sec:h_infinity_norm}
|
||
|
||
<div class="definition">
|
||
|
||
The \\(\mathcal{H}\_\infty\\) norm of a multi-input multi-output system \\(G(s)\\) is defined as the peak of the maximum singular value of its frequency response
|
||
|
||
\begin{equation}
|
||
\\|G(s)\\|\_\infty = \max\_\omega \bar{\sigma}\big( G(j\omega) \big)
|
||
\end{equation}
|
||
|
||
For a single-input single-output system \\(G(s)\\), it is simply the peak value of \\(|G(j\omega)|\\) as a function of frequency:
|
||
|
||
\begin{equation}
|
||
\\|G(s)\\|\_\infty = \max\_{\omega} |G(j\omega)| \label{eq:hinf\_norm\_siso}
|
||
\end{equation}
|
||
|
||
</div>
|
||
|
||
<div class="exampl">
|
||
|
||
Let's compute the \\(\mathcal{H}\_\infty\\) norm of our test plant \\(G(s)\\) using the `hinfnorm` function:
|
||
|
||
```matlab
|
||
hinfnorm(G)
|
||
```
|
||
|
||
```text
|
||
7.9216e-06
|
||
```
|
||
|
||
We can see in [Figure 11](#figure--fig:hinfinity-norm-siso-bode) that indeed, the \\(\mathcal{H}\_\infty\\) norm of \\(G(s)\\) does corresponds to the peak value of \\(|G(j\omega)|\\).
|
||
|
||
<a id="figure--fig:hinfinity-norm-siso-bode"></a>
|
||
|
||
{{< figure src="figs/hinfinity_norm_siso_bode.png" caption="<span class='figure-number'>Figure 11: </span>Example of the \\(\mathcal{H}\_\infty\\) norm of a SISO system" >}}
|
||
|
||
</div>
|
||
|
||
|
||
### \\(\mathcal{H}\_\infty\\) Synthesis {#sec:h_infinity_synthesis}
|
||
|
||
<div class="definition">
|
||
|
||
The \\(\mathcal{H}\_\infty\\) synthesis is a method that uses an **algorithm** (LMI optimization, Riccati equation) to find a controller that stabilizes the system and that **minimizes** the \\(\mathcal{H}\_\infty\\) norms of defined transfer functions.
|
||
|
||
</div>
|
||
|
||
Why optimizing the \\(\mathcal{H}\_\infty\\) norm of transfer functions is a pertinent choice will become clear when we will translate the typical control specifications into the \\(\mathcal{H}\_\infty\\) norm of transfer functions in Section [Modern Interpretation of Control Specifications](#sec:modern_interpretation_specification).
|
||
|
||
<div class="important">
|
||
|
||
Then applying the \\(\mathcal{H}\_\infty\\) synthesis to a plant, the engineer work usually consists of the following steps:
|
||
|
||
1. Write the problem as standard \\(\mathcal{H}\_\infty\\) problem using the generalized plant (described in the next section)
|
||
2. Translate the specifications as \\(\mathcal{H}\_\infty\\) norms of transfer functions (Section [Modern Interpretation of Control Specifications](#sec:modern_interpretation_specification))
|
||
3. Make the synthesis and analyze the obtained controller
|
||
|
||
As the \\(\mathcal{H}\_\infty\\) synthesis usually gives very high order controllers, an additional step that reduces the controller order is sometimes required for practical implementation.
|
||
|
||
</div>
|
||
|
||
Note that there are many ways to use the \\(\mathcal{H}\_\infty\\) Synthesis:
|
||
|
||
- Traditional \\(\mathcal{H}\_\infty\\) Synthesis (`hinfsyn` [doc](https://www.mathworks.com/help/robust/ref/hinfsyn.html))
|
||
- Open Loop Shaping \\(\mathcal{H}\_\infty\\) Synthesis (`loopsyn` [doc](https://www.mathworks.com/help/robust/ref/loopsyn.html))
|
||
- Mixed Sensitivity Loop Shaping (`mixsyn` [doc](https://www.mathworks.com/help/robust/ref/lti.mixsyn.html))
|
||
- Fixed-Structure \\(\mathcal{H}\_\infty\\) Synthesis (`hinfstruct` [doc](https://www.mathworks.com/help/robust/ref/lti.hinfstruct.html))
|
||
- Signal Based \\(\mathcal{H}\_\infty\\) Synthesis, and many more...
|
||
|
||
|
||
### The Generalized Plant {#sec:generalized_plant}
|
||
|
||
The first step when applying the \\(\mathcal{H}\_\infty\\) synthesis is usually to write the problem as a standard \\(\mathcal{H}\_\infty\\) problem.
|
||
This consist of deriving the **Generalized Plant** for the current problem.
|
||
|
||
The generalized plant, usually noted \\(P(s)\\), is shown in [Figure 12](#figure--fig:general-plant).
|
||
It has two _sets_ of inputs \\([w,\\,u]\\) and two _sets_ of outputs \\([z\\,v]\\) such that:
|
||
|
||
\begin{equation}
|
||
\begin{bmatrix} z \\\ v \end{bmatrix} = P \begin{bmatrix} w \\\ u \end{bmatrix}
|
||
\end{equation}
|
||
|
||
The meaning of these inputs and outputs are summarized in [Table 5](#table--tab:notation-general).
|
||
|
||
A practical example about how to derive the generalized plant for a classical control problem is given in Section [From a Classical Feedback Architecture to a Generalized Plant](#sec:generalized_plant_derivation).
|
||
|
||
<div class="important">
|
||
|
||
<a id="figure--fig:general-plant"></a>
|
||
|
||
{{< figure src="figs/general_plant.png" caption="<span class='figure-number'>Figure 12: </span>Inputs and Outputs of the generalized Plant" >}}
|
||
|
||
<a id="table--tab:notation-general"></a>
|
||
<div class="table-caption">
|
||
<span class="table-number"><a href="#table--tab:notation-general">Table 5</a>:</span>
|
||
Notations for the general configuration
|
||
</div>
|
||
|
||
| **Notation** | **Meaning** |
|
||
|--------------|----------------------------------------------------|
|
||
| \\(P\\) | Generalized plant model |
|
||
| \\(w\\) | Exogenous inputs: references, disturbances, noises |
|
||
| \\(z\\) | Exogenous outputs: signals to be minimized |
|
||
| \\(v\\) | Controller inputs: measurements |
|
||
| \\(u\\) | Control signals |
|
||
|
||
</div>
|
||
|
||
|
||
### The \\(\mathcal{H}\_\infty\\) Synthesis applied on the Generalized plant {#sec:h_infinity_general_synthesis}
|
||
|
||
Once the generalized plant is obtained, the \\(\mathcal{H}\_\infty\\) synthesis problem can be stated as follows:
|
||
|
||
<div class="important">
|
||
|
||
\\(\mathcal{H}\_\infty\\) Synthesis applied on the generalized plant
|
||
:
|
||
|
||
Find a stabilizing controller \\(K\\) that, using the sensed outputs \\(v\\), generates control signals \\(u\\) such that the \\(\mathcal{H}\_\infty\\) norm of the closed-loop transfer function from \\(w\\) to \\(z\\) is minimized.
|
||
|
||
After \\(K\\) is found, the system is _robustified_ by adjusting the response around the unity gain frequency to increase stability margins.
|
||
|
||
The obtained controller \\(K\\) and the generalized plant are connected as shown in [Figure 13](#figure--fig:general-control-names).
|
||
|
||
<a id="figure--fig:general-control-names"></a>
|
||
|
||
{{< figure src="figs/general_control_names.png" caption="<span class='figure-number'>Figure 13: </span>General Control Configuration" >}}
|
||
|
||
</div>
|
||
|
||
Using Matlab, the \\(\mathcal{H}\_\infty\\) Synthesis applied on a Generalized plant can be applied using the `hinfsyn` command ([documentation](https://www.mathworks.com/help/robust/ref/hinfsyn.html)):
|
||
|
||
```matlab
|
||
K = hinfsyn(P, nmeas, ncont);
|
||
```
|
||
|
||
where:
|
||
|
||
- `P` is the generalized plant transfer function matrix
|
||
- `nmeas` is the number of sensed output (size of \\(v\\))
|
||
- `ncont` is the number of control signals (size of \\(u\\))
|
||
- `K` obtained controller (of size `ncont x nmeas`) that minimizes the \\(\mathcal{H}\_\infty\\) norm from \\(w\\) to \\(z\\).
|
||
|
||
Note that the general control configure of [Figure 13](#figure--fig:general-control-names), as its name implies, is quite _general_ and can represent feedback control as well as feedforward control architectures.
|
||
|
||
|
||
### From a Classical Feedback Architecture to a Generalized Plant {#sec:generalized_plant_derivation}
|
||
|
||
The procedure to convert a typical control architecture as the one shown in [Figure 14](#figure--fig:classical-feedback-tracking) to a generalized Plant is as follows:
|
||
|
||
1. Define signals of the generalized plant: \\(w\\), \\(z\\), \\(u\\) and \\(v\\)
|
||
2. Remove \\(K\\) and rearrange the inputs and outputs to match the generalized configuration shown in [Figure 12](#figure--fig:general-plant)
|
||
|
||
<div class="exercice">
|
||
|
||
Consider the feedback control architecture shown in [Figure 14](#figure--fig:classical-feedback-tracking).
|
||
Suppose we want to design \\(K\\) using the general \\(\mathcal{H}\_\infty\\) synthesis, and suppose the signals to be minimized are the control input \\(u\\) and the tracking error \\(\epsilon\\).
|
||
|
||
1. Convert the control architecture to a generalized configuration
|
||
2. Compute the transfer function matrix of the generalized plant \\(P\\) using Matlab as a function or \\(K\\) and \\(G\\)
|
||
|
||
<a id="figure--fig:classical-feedback-tracking"></a>
|
||
|
||
{{< figure src="figs/classical_feedback_tracking.png" caption="<span class='figure-number'>Figure 14: </span>Classical Feedback Control Architecture (Tracking)" >}}
|
||
|
||
<details><summary>Hint</summary>
|
||
|
||
First, define the signals of the generalized plant:
|
||
|
||
- Exogenous inputs: \\(w = r\\)
|
||
- Signals to be minimized:
|
||
Usually, we want to minimize the tracking errors \\(\epsilon\\) and the control signal \\(u\\): \\(z = [\epsilon,\ u]\\)
|
||
- Controller inputs: this is the signal at the input of the controller: \\(v = \epsilon\\)
|
||
- Controller outputs: signal generated by the controller: \\(u\\)
|
||
|
||
Then, Remove \\(K\\) and rearrange the inputs and outputs as in [Figure 12](#figure--fig:general-plant).
|
||
|
||
</details>
|
||
|
||
<details><summary>Answer</summary>
|
||
|
||
The obtained generalized plant shown in [Figure 15](#figure--fig:mixed-sensitivity-ref-tracking).
|
||
|
||
<a id="figure--fig:mixed-sensitivity-ref-tracking"></a>
|
||
|
||
{{< figure src="figs/mixed_sensitivity_ref_tracking.png" caption="<span class='figure-number'>Figure 15: </span>Generalized plant of the Classical Feedback Control Architecture (Tracking)" >}}
|
||
|
||
Using Matlab, the generalized plant can be defined as follows:
|
||
|
||
```matlab
|
||
P = [1 -G;
|
||
0 1;
|
||
1 -G]
|
||
P.InputName = {'w', 'u'};
|
||
P.OutputName = {'e', 'u', 'v'};
|
||
```
|
||
|
||
</details>
|
||
|
||
</div>
|
||
|
||
|
||
## Modern Interpretation of Control Specifications {#sec:modern_interpretation_specification}
|
||
|
||
As shown in Section [Classical Open Loop Shaping](#sec:open_loop_shaping), the loop gain \\(L(s) = G(s) K(s)\\) is a useful and easy tool when manually designing controllers.
|
||
This is mainly due to the fact that \\(L(s)\\) is very easy to shape as it depends _linearly_ on \\(K(s)\\).
|
||
Moreover, important quantities such as the stability margins and the control bandwidth can be estimated from the shape/phase of \\(L(s)\\).
|
||
|
||
However, the loop gain \\(L(s)\\) does **not** directly give the performances of the closed-loop system.
|
||
As a matter of fact, the behavior of the closed-loop system by the **closed-loop** transfer functions.
|
||
These are derived of a typical feedback architecture functions in Section [Closed Loop Transfer Functions and the Gang of Four](#sec:closed_loop_tf).
|
||
|
||
The modern interpretation of control specifications then consists of determining the **required shape of the closed-loop transfer functions** such that the system behavior corresponds to the requirements.
|
||
Once this is done, the \\(\mathcal{H}\_\infty\\) synthesis can be used to generate a controller that will **shape** the closed-loop transfer function as specified..
|
||
This method is presented in Section [\\(\mathcal{H}\_\infty\\) Shaping of closed-loop transfer functions](#sec:closed-loop-shaping).
|
||
|
||
One of the most important closed-loop transfer function is called the **sensitivity function**.
|
||
Its link with the closed-loop behavior of the feedback system is studied in Section [The Sensitivity Function](#sec:sensitivity_transfer_functions).
|
||
|
||
The robustness (stability margins) of the system can also be linked to the shape of the sensitivity function with the use of the **module margin** (Section [Robustness: Module Margin](#sec:module_margin)).
|
||
|
||
Links between typical control specifications and shapes of the closed-loop transfer functions are summarized in Section [Summary of typical specification and associated wanted shaping](#sec:other_requirements).
|
||
|
||
|
||
### Closed Loop Transfer Functions and the Gang of Four {#sec:closed_loop_tf}
|
||
|
||
Consider the typical feedback system shown in [Figure 16](#figure--fig:gang-of-four-feedback).
|
||
|
||
The behavior (performances) of this feedback system is determined by the closed-loop transfer functions from the inputs (\\(r\\), \\(d\\) and \\(n\\)) to the important signals such as \\(\epsilon\\), \\(u\\) and \\(y\\).
|
||
|
||
Depending on the specification, different closed-loop transfer functions do matter.
|
||
These are summarized in [Table 6](#table--tab:spec-closed-loop-tf).
|
||
|
||
<a id="figure--fig:gang-of-four-feedback"></a>
|
||
|
||
{{< figure src="figs/gang_of_four_feedback.png" caption="<span class='figure-number'>Figure 16: </span>Simple Feedback Architecture with \\(r\\) the reference signal, \\(\epsilon\\) the tracking error, \\(d\\) a disturbance acting at the plant input \\(u\\), \\(y\\) is the output signal and \\(n\\) the measurement noise" >}}
|
||
|
||
<a id="table--tab:spec-closed-loop-tf"></a>
|
||
<div class="table-caption">
|
||
<span class="table-number"><a href="#table--tab:spec-closed-loop-tf">Table 6</a>:</span>
|
||
Typical Specification and associated closed-loop transfer function
|
||
</div>
|
||
|
||
| **Specification** | **CL Transfer Function** |
|
||
|--------------------------------|-----------------------------------------------------------------------------|
|
||
| Reference Tracking | From \\(r\\) to \\(\epsilon\\) |
|
||
| Disturbance Rejection | From \\(d\\) to \\(y\\) |
|
||
| Measurement Noise Filtering | From \\(n\\) to \\(y\\) |
|
||
| Small Command Amplitude | From \\(n,r,d\\) to \\(u\\) |
|
||
| Stability | All |
|
||
| Robustness (stability margins) | Module margin (see Section [Robustness: Module Margin](#sec:module_margin)) |
|
||
|
||
<div class="exercice">
|
||
|
||
For the feedback system in [Figure 16](#figure--fig:gang-of-four-feedback), write the output signals \\([\epsilon, u, y]\\) as a function of the systems \\(K(s), G(s)\\) and the input signals \\([r, d, n]\\).
|
||
|
||
<details><summary>Hint</summary>
|
||
|
||
Take one of the output (e.g. \\(y\\)), and write it as a function of the inputs \\([d, r, n]\\) going step by step around the loop:
|
||
|
||
\begin{align\*}
|
||
y &= G u \\\\
|
||
&= G (d + K \epsilon) \\\\
|
||
&= G \big(d + K (r - n - y) \big) \\\\
|
||
&= G d + GK r - GK n - GK y
|
||
\end{align\*}
|
||
|
||
Isolate \\(y\\) at the right hand side, and finally obtain:
|
||
\\[ y = \frac{GK}{1+ GK} r + \frac{G}{1 + GK} d - \frac{GK}{1 + GK} n \\]
|
||
|
||
Do the same procedure for \\(u\\) and \\(\epsilon\\)
|
||
|
||
</details>
|
||
|
||
<details><summary>Answer</summary>
|
||
|
||
The following equations should be obtained:
|
||
|
||
\begin{align}
|
||
y &= \frac{GK}{1 + GK} r + \frac{G}{1 + GK} d - \frac{GK}{1 + GK} n \\\\
|
||
\epsilon &= \frac{1 }{1 + GK} r - \frac{G}{1 + GK} d - \frac{G }{1 + GK} n \\\\
|
||
u &= \frac{K }{1 + GK} r - \frac{1}{1 + GK} d - \frac{K }{1 + GK} n
|
||
\end{align}
|
||
|
||
</details>
|
||
|
||
</div>
|
||
|
||
<div class="important">
|
||
|
||
We can see that they are 4 different closed-loop transfer functions describing the behavior of the feedback system in [Figure 16](#figure--fig:gang-of-four-feedback).
|
||
These called the **Gang of Four**:
|
||
|
||
\begin{align}
|
||
S &= \frac{1 }{1 + GK}, \quad \text{the sensitivity function} \\\\
|
||
T &= \frac{GK}{1 + GK}, \quad \text{the complementary sensitivity function} \\\\
|
||
GS &= \frac{G }{1 + GK}, \quad \text{the load disturbance sensitivity function} \\\\
|
||
KS &= \frac{K }{1 + GK}, \quad \text{the noise sensitivity function}
|
||
\end{align}
|
||
|
||
</div>
|
||
|
||
<div class="seealso">
|
||
|
||
If a feedforward controller is included, a **Gang of Six** transfer functions can be defined.
|
||
More on that in this [short video](https://www.youtube.com/watch?v=b_8v8scghh8).
|
||
|
||
</div>
|
||
|
||
The behavior of the feedback system in [Figure 16](#figure--fig:gang-of-four-feedback) is fully described by the following set of equations:
|
||
|
||
\begin{align}
|
||
\epsilon &= S r - GS d - GS n \\\\
|
||
y &= T r + GS d - T n \\\\
|
||
u &= KS r - S d - KS n
|
||
\end{align}
|
||
|
||
Thus, for reference tracking, we have to shape the _closed-loop_ transfer function from \\(r\\) to \\(\epsilon\\), that is the sensitivity function \\(S(s)\\).
|
||
Similarly, to reduce the effect of measurement noise \\(n\\) on the output \\(y\\), we have to act on the complementary sensitivity function \\(T(s)\\).
|
||
|
||
|
||
### The Sensitivity Function {#sec:sensitivity_transfer_functions}
|
||
|
||
The sensitivity function is indisputably the most important closed-loop transfer function of a feedback system.
|
||
In this section, we will see how the shape of the sensitivity function will impact the performances of the closed-loop system.
|
||
|
||
Suppose we have developed a "_reference_" controller \\(K\_r(s)\\) and made three small changes to obtained three controllers \\(K\_1(s)\\), \\(K\_2(s)\\) and \\(K\_3(s)\\).
|
||
The obtained sensitivity functions for these four controllers are shown in [Figure 17](#figure--fig:sensitivity-shape-effect) and the corresponding step responses are shown in [Figure 18](#figure--fig:sensitivity-shape-effect-step).
|
||
|
||
The comparison of the sensitivity functions shapes and their effect on the step response is summarized in [Table 7](#table--tab:compare-sensitivity-shapes).
|
||
|
||
<a id="table--tab:compare-sensitivity-shapes"></a>
|
||
<div class="table-caption">
|
||
<span class="table-number"><a href="#table--tab:compare-sensitivity-shapes">Table 7</a>:</span>
|
||
Comparison of the sensitivity function shape and the corresponding step response for the three controller variations
|
||
</div>
|
||
|
||
| **Controller** | **Sensitivity Function Shape** | **Change of the Step Response** |
|
||
|----------------|--------------------------------------------------------|----------------------------------|
|
||
| \\(K\_1(s)\\) | Larger bandwidth \\(\omega\_b\\) | Faster rise time |
|
||
| \\(K\_2(s)\\) | Larger peak value \\(\Vert S\Vert\_\infty\\) | Large overshoot and oscillations |
|
||
| \\(K\_3(s)\\) | Larger low frequency gain \\(\vert S(j\cdot 0)\vert\\) | Larger static error |
|
||
|
||
<a id="figure--fig:sensitivity-shape-effect"></a>
|
||
|
||
{{< figure src="figs/sensitivity_shape_effect.png" caption="<span class='figure-number'>Figure 17: </span>Sensitivity function magnitude \\(|S(j\omega)|\\) corresponding to the reference controller \\(K\_r(s)\\) and the three modified controllers \\(K\_i(s)\\)" >}}
|
||
|
||
<a id="figure--fig:sensitivity-shape-effect-step"></a>
|
||
|
||
{{< figure src="figs/sensitivity_shape_effect_step.png" caption="<span class='figure-number'>Figure 18: </span>Step response (response from \\(r\\) to \\(y\\)) for the different controllers" >}}
|
||
|
||
<div class="definition">
|
||
|
||
Closed-Loop Bandwidth
|
||
: The closed-loop bandwidth \\(\omega\_b\\) is the frequency where \\(|S(j\omega)|\\) first crosses \\(1/\sqrt{2} = -3dB\\) from below.
|
||
|
||
In general, a large bandwidth corresponds to a faster rise time.
|
||
|
||
</div>
|
||
|
||
<div class="important">
|
||
|
||
From the simple analysis above, we can draw a first estimation of the wanted shape for the sensitivity function ([Figure 19](#figure--fig:h-infinity-spec-S)):
|
||
|
||
- A small magnitude at low frequency to make the static errors small
|
||
- A wanted minimum closed-loop bandwidth in order to have fast rise time and good rejection of perturbations
|
||
- A small peak value (small \\(\mathcal{H}\_\infty\\) norm) in order to limit large overshoot and oscillations.
|
||
This generally means higher robustness.
|
||
This will become clear in the next section about the **module margin**.
|
||
|
||
<a id="figure--fig:h-infinity-spec-S"></a>
|
||
|
||
{{< figure src="figs/h-infinity-spec-S.png" caption="<span class='figure-number'>Figure 19: </span>Typical wanted shape of the Sensitivity transfer function" >}}
|
||
|
||
</div>
|
||
|
||
|
||
### Robustness: Module Margin {#sec:module_margin}
|
||
|
||
Let's start this section by an example demonstrating why the phase and gain margins might not be good indicators of robustness.
|
||
Will follow a discussion about the module margin, a robustness indicator that can be linked to the \\(\mathcal{H}\_\infty\\) norm of \\(S\\) and that will prove to be very useful.
|
||
|
||
<div class="exampl">
|
||
|
||
Consider the following plant \\(G\_t(s)\\):
|
||
|
||
```matlab
|
||
w0 = 2*pi*100;
|
||
xi = 0.1;
|
||
k = 1e7;
|
||
|
||
Gt = 1/k*(s/w0/4 + 1)/(s^2/w0^2 + 2*xi*s/w0 + 1);
|
||
```
|
||
|
||
Let's say we have designed a controller \\(K\_t(s)\\) that gives the loop gain shown in [Figure 20](#figure--fig:phase-gain-margin-model-plant).
|
||
|
||
```matlab
|
||
Kt = 1.2e6*(s + w0)/s;
|
||
```
|
||
|
||
The following characteristics can be determined from the Loop gain in [Figure 20](#figure--fig:phase-gain-margin-model-plant):
|
||
|
||
- Control bandwidth of \\(\approx 10\\, \text{Hz}\\)
|
||
- Infinite gain margin (the phase of the loop-gain never reaches \\(-180^o\\))
|
||
- More than \\(90^o\\) of phase margin
|
||
|
||
This clearly indicate very good robustness of the closed-loop system!
|
||
Or does it? Let's find out.
|
||
|
||
<a id="figure--fig:phase-gain-margin-model-plant"></a>
|
||
|
||
{{< figure src="figs/phase_gain_margin_model_plant.png" caption="<span class='figure-number'>Figure 20: </span>Bode plot of the obtained Loop Gain \\(L(s)\\)" >}}
|
||
|
||
Now let's suppose the controller is implemented in practice, and the "real" plant \\(G\_r(s)\\) as a slightly lower damping factor than the one estimated for the model:
|
||
|
||
```matlab
|
||
xi = 0.03;
|
||
```
|
||
|
||
The obtained "real" loop gain is shown in [Figure 21](#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 indicates instability.
|
||
|
||
It is confirmed by checking the stability of the closed loop system:
|
||
|
||
```matlab
|
||
isstable(feedback(Gr,Kt))
|
||
```
|
||
|
||
```text
|
||
0
|
||
```
|
||
|
||
<a id="figure--fig:phase-gain-margin-real-plant"></a>
|
||
|
||
{{< figure src="figs/phase_gain_margin_real_plant.png" caption="<span class='figure-number'>Figure 21: </span>Bode plots of \\(L(s)\\) (loop gain corresponding the nominal plant) and \\(L\_r(s)\\) (loop gain corresponding to the real plant)" >}}
|
||
|
||
Therefore, even a small change of the plant parameter renders the system unstable even though both the gain margin and the phase margin for the nominal plant are excellent.
|
||
|
||
This is due to the fact that the gain and phase margin are robustness indicators corresponding a **pure** change or gain or a **pure** change of phase but not a combination of both.
|
||
|
||
</div>
|
||
|
||
Let's now determine a new robustness indicator based on the Nyquist Stability Criteria.
|
||
|
||
<div class="definition">
|
||
|
||
Nyquist Stability Criteria (for stable systems)
|
||
: If the open-loop transfer function \\(L(s)\\) is stable, then the closed-loop system will be unstable for any encirclement of the point \\(-1\\) on the Nyquist plot.
|
||
|
||
|
||
Nyquist Plot
|
||
: The Nyquist plot shows the evolution of \\(L(j\omega)\\) in the complex plane from \\(\omega = 0 \to \infty\\).
|
||
|
||
</div>
|
||
|
||
<div class="seealso">
|
||
|
||
For more information about the _general_ Nyquist Stability Criteria, you may want to look at [this](https://www.youtube.com/watch?v=sof3meN96MA) video.
|
||
|
||
</div>
|
||
|
||
From the Nyquist stability criteria, it is clear that we want \\(L(j\omega)\\) to be as far as possible from the \\(-1\\) point (called the _unstable point_) in the complex plane.
|
||
This minimum distance is called the **module margin**.
|
||
|
||
<div class="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.
|
||
|
||
</div>
|
||
|
||
<div class="exampl">
|
||
|
||
A typical Nyquist plot is shown in [Figure 22](#figure--fig:module-margin-example).
|
||
The gain, phase and module margins are graphically shown to have an idea of what they represent.
|
||
|
||
<a id="figure--fig:module-margin-example"></a>
|
||
|
||
{{< figure src="figs/module_margin_example.png" caption="<span class='figure-number'>Figure 22: </span>Nyquist plot with visual indication of the Gain margin \\(\Delta G\\), Phase margin \\(\Delta \phi\\) and Module margin \\(\Delta M\\)" >}}
|
||
|
||
</div>
|
||
|
||
As expected from [Figure 22](#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{1}{1 - \Delta M}; \quad \Delta \phi \ge \Delta M
|
||
\end{equation}
|
||
|
||
Let's now try to express the Module margin \\(\Delta M\\) as an \\(\mathcal{H}\_\infty\\) norm of a closed-loop transfer function:
|
||
|
||
\begin{align\*}
|
||
\Delta M &= \text{minimum distance between } L(j\omega) \text{ and point } (-1) \\\\
|
||
&= \min\_\omega |L(j\omega) - (-1)| \\\\
|
||
&= \min\_\omega |1 + L(j\omega)| \\\\
|
||
&= \frac{1}{\max\_\omega \frac{1}{|1 + L(j\omega)|}} \\\\
|
||
&= \frac{1}{\max\_\omega \left| \frac{1}{1 + G(j\omega)K(j\omega)}\right|} \\\\
|
||
&= \frac{1}{\\|S\\|\_\infty}
|
||
\end{align\*}
|
||
|
||
Therefore, for a given \\(\mathcal{H}\_\infty\\) norm of \\(S\\) (\\(\\|S\\|\_\infty = M\_S\\)), we have:
|
||
|
||
\begin{equation}
|
||
\Delta G \ge \frac{M\_S}{M\_S - 1}; \quad \Delta \phi \ge \frac{1}{M\_S}
|
||
\end{equation}
|
||
|
||
<div class="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\\).
|
||
|
||
</div>
|
||
|
||
Note that this is why large peak value of \\(|S(j\omega)|\\) usually indicate robustness problems.
|
||
And we now understand why setting an upper bound on the magnitude of \\(S\\) is generally a good idea.
|
||
|
||
<div class="exampl">
|
||
|
||
Typical, we require \\(\\|S\\|\_\infty < 2 (6dB)\\) which implies \\(\Delta G \ge 2\\) and \\(\Delta \phi \ge 29^o\\)
|
||
|
||
</div>
|
||
|
||
<div class="seealso">
|
||
|
||
To learn more about module/disk margin, you can check out [this](https://www.youtube.com/watch?v=XazdN6eZF80) video.
|
||
|
||
</div>
|
||
|
||
|
||
### Summary of typical specification and associated wanted shaping {#sec:other_requirements}
|
||
|
||
<a id="table--tab:specification-modern"></a>
|
||
<div class="table-caption">
|
||
<span class="table-number"><a href="#table--tab:specification-modern">Table 8</a>:</span>
|
||
Typical Specifications and corresponding wanted norms of open and closed loop tansfer functions
|
||
</div>
|
||
|
||
| | **Open-Loop Shaping** | **Closed-Loop Shaping** |
|
||
|-----------------------------|---------------------------|-------------------------------------------------|
|
||
| Reference Tracking | \\(L\\) large | \\(S\\) small |
|
||
| Disturbance Rejection | \\(L\\) large | \\(GS\\) small |
|
||
| Measurement Noise Filtering | \\(L\\) small | \\(T\\) small |
|
||
| Small Command Amplitude | \\(K\\) and \\(L\\) small | \\(KS\\) small |
|
||
| Robustness | Phase/Gain margins | Module margin: \\(\Vert S\Vert\_\infty\\) small |
|
||
|
||
|
||
## \\(\mathcal{H}\_\infty\\) Shaping of closed-loop transfer functions {#sec:closed-loop-shaping}
|
||
|
||
In the previous sections, we have seen that the performances of the system depends on the **shape** of the closed-loop transfer function.
|
||
Therefore, the synthesis problem is to design \\(K(s)\\) such that closed-loop system is stable and such that the closed-loop transfer functions such as \\(S\\), \\(KS\\) and \\(T\\) are shaped as wanted.
|
||
This is clearly not simple as these closed-loop transfer functions does not depend linearly on \\(K\\).
|
||
But don't worry, the \\(\mathcal{H}\_\infty\\) synthesis will do this job for us!
|
||
|
||
To do so, **weighting functions** are included in the generalized plant and the \\(\mathcal{H}\_\infty\\) synthesis applied on the **weighted** generalized plant.
|
||
Such procedure is presented in Section [How to Shape closed-loop transfer function? Using Weighting Functions!](#sec:weighting_functions).
|
||
|
||
Some advice on the design of weighting functions are given in Section [Design of Weighting Functions](#sec:weighting_functions_design).
|
||
|
||
An example of the \\(\mathcal{H}\_\infty\\) shaping of the sensitivity function is studied in Section [Shaping the Sensitivity Function](#sec:sensitivity_shaping_example).
|
||
|
||
Multiple closed-loop transfer functions can be shaped at the same time.
|
||
Such synthesis is usually called **Mixed-sensitivity Loop Shaping** and is one of the most powerful tool of the robust control theory.
|
||
Some insight on the use and limitations of such techniques are given in Section [Shaping multiple closed-loop transfer functions - Limitations](#sec:shaping_multiple_tf).
|
||
|
||
|
||
### How to Shape closed-loop transfer function? Using Weighting Functions! {#sec:weighting_functions}
|
||
|
||
Suppose we apply the \\(\mathcal{H}\_\infty\\) synthesis on the generalized plant \\(P(s)\\) shown in [Figure 23](#figure--fig:loop-shaping-S-without-W).
|
||
It will generate a controller \\(K(s)\\) such that the \\(\mathcal{H}\_\infty\\) norm of closed-loop transfer function from \\(r\\) to \\(\epsilon\\) is minimized which is equal to the sensitivity function \\(S\\).
|
||
Therefore, the synthesis objective is to minimize the \\(\mathcal{H}\_\infty\\) norm of the sensitivity function: \\(\\|S\\|\_\infty\\).
|
||
|
||
However, as the \\(\mathcal{H}\_\infty\\) norm is the maximum peak value of the transfer function's magnitude, this synthesis is quite useless as it will just try to decrease of peak value of \\(S\\).
|
||
Clearly this does not allow to **shape** the norm of \\(S(j\omega)\\) over all frequencies nor specify the wanted low frequency gain of \\(S\\) or bandwidth requirements.
|
||
|
||
<a id="figure--fig:loop-shaping-S-without-W"></a>
|
||
|
||
{{< figure src="figs/loop_shaping_S_without_W.png" caption="<span class='figure-number'>Figure 23: </span>Generalized Plant" >}}
|
||
|
||
<div class="important">
|
||
|
||
The _trick_ is to include a **weighting function** \\(W\_S(s)\\) in the generalized plant as shown in [Figure 24](#figure--fig:loop-shaping-S-with-W).
|
||
|
||
Now, the closed-loop transfer function from \\(w\\) to \\(z\\) is equal to \\(W\_s(s)S(s)\\) and applying the \\(\mathcal{H}\_\infty\\) synthesis to the _weighted_ generalized plant \\(\tilde{P}(s)\\) will generate a controller \\(K(s)\\) such that \\(\\|W\_s(s)S(s)\\|\_\infty\\) is minimized.
|
||
|
||
</div>
|
||
|
||
Let's now show how this is equivalent as **shaping** the sensitivity function:
|
||
|
||
\begin{align}
|
||
& \left\\| W\_s(s) S(s) \right\\|\_\infty < 1\nonumber \\\\
|
||
\Leftrightarrow & \left| W\_s(j\omega) S(j\omega) \right| < 1 \quad \forall \omega\nonumber \\\\
|
||
\Leftrightarrow & \left| S(j\omega) \right| < \frac{1}{\left| W\_s(j\omega) \right|} \quad \forall \omega
|
||
\end{align}
|
||
|
||
<div class="important">
|
||
|
||
As shown in Equation , the objective of the \\(\mathcal{H}\_\infty\\) synthesis applied on the _weighted_ plant is to make the norm sensitivity function smaller than the inverse of the norm of the weighting function, and that at all frequencies.
|
||
|
||
Therefore, the choice of the weighting function \\(W\_s(s)\\) is very important: its inverse magnitude will define the wanted **upper bound** of the sensitivity function magnitude over all frequencies.
|
||
|
||
</div>
|
||
|
||
<a id="figure--fig:loop-shaping-S-with-W"></a>
|
||
|
||
{{< figure src="figs/loop_shaping_S_with_W.png" caption="<span class='figure-number'>Figure 24: </span>Weighted Generalized Plant" >}}
|
||
|
||
<div class="exercice">
|
||
|
||
Using matlab, compute the weighted generalized plant shown in [Figure 25](#figure--fig:first-order-weight) as a function of \\(G(s)\\) and \\(W\_S(s)\\).
|
||
|
||
<details><summary>Hint</summary>
|
||
|
||
The weighted generalized plant can be defined in Matlab using two techniques:
|
||
|
||
- by writing manually the 4 transfer functions from \\([w, u]\\) to \\([\tilde{\epsilon}, v]\\)
|
||
- by pre-multiplying the (non-weighted) generalized plant by a block-diagonal transfer function matrix containing the weights for the outputs \\(z\\) and `1` for the outputs \\(v\\)
|
||
|
||
</details>
|
||
|
||
<details><summary>Answer</summary>
|
||
|
||
The two solutions below can be used.
|
||
|
||
```matlab
|
||
Pw = [Ws -Ws*G;
|
||
1 -G];
|
||
```
|
||
|
||
The second solution is however more general, and can also be used when weights are added at the inputs by post-multiplying instead of pre-multiplying.
|
||
|
||
```matlab
|
||
P = [1 -G;
|
||
1 -G];
|
||
Pw = blkdiag(Ws, 1)*P;
|
||
```
|
||
|
||
</details>
|
||
|
||
</div>
|
||
|
||
|
||
### Design of Weighting Functions {#sec:weighting_functions_design}
|
||
|
||
Weighting function included in the generalized plant must be **proper**, **stable** and **minimum phase** transfer functions.
|
||
|
||
<div class="definition">
|
||
|
||
proper
|
||
: more poles than zeros, this implies \\(\lim\_{\omega \to \infty} |W(j\omega)| < \infty\\)
|
||
|
||
stable
|
||
: no poles in the right half plane
|
||
|
||
minimum phase
|
||
: no zeros in the right half plane
|
||
|
||
</div>
|
||
|
||
Good guidelines for design of weighting function are given in (<a href="#citeproc_bib_item_1">Bibel and Malyevac 1992</a>).
|
||
|
||
There is a Matlab function called `makeweight` that allows to design first-order weights by specifying the low frequency gain, high frequency gain, and the gain at a specific frequency:
|
||
|
||
```matlab
|
||
W = makeweight(dcgain,[freq,mag],hfgain)
|
||
```
|
||
|
||
with:
|
||
|
||
- `dcgain`: low frequency gain
|
||
- `[freq,mag]`: frequency `freq` at which the gain is `mag`
|
||
- `hfgain`: high frequency gain
|
||
|
||
<div class="exampl">
|
||
|
||
The Matlab code below produces a weighting function with the following characteristics ([Figure 25](#figure--fig:first-order-weight)):
|
||
|
||
- Low frequency gain of 100
|
||
- Gain of 1 at 10Hz
|
||
- High frequency gain of 0.5
|
||
|
||
<!--listend-->
|
||
|
||
```matlab
|
||
Ws = makeweight(1e2, [2*pi*10, 1], 1/2);
|
||
```
|
||
|
||
<a id="figure--fig:first-order-weight"></a>
|
||
|
||
{{< figure src="figs/first_order_weight.png" caption="<span class='figure-number'>Figure 25: </span>Obtained Magnitude of the Weighting Function" >}}
|
||
|
||
</div>
|
||
|
||
<div class="seealso">
|
||
|
||
Quite often, higher orders weights are required.
|
||
|
||
In such case, the following formula can be used:
|
||
|
||
\begin{equation}
|
||
W(s) = \left( \frac{
|
||
\frac{1}{\omega\_0} \sqrt{\frac{1 - \left(\frac{G\_0}{G\_c}\right)^{\frac{2}{n}}}{1 - \left(\frac{G\_c}{G\_\infty}\right)^{\frac{2}{n}}}} s + \left(\frac{G\_0}{G\_c}\right)^{\frac{1}{n}}
|
||
}{
|
||
\left(\frac{1}{G\_\infty}\right)^{\frac{1}{n}} \frac{1}{\omega\_0} \sqrt{\frac{1 - \left(\frac{G\_0}{G\_c}\right)^{\frac{2}{n}}}{1 - \left(\frac{G\_c}{G\_\infty}\right)^{\frac{2}{n}}}} s + \left(\frac{1}{G\_c}\right)^{\frac{1}{n}}
|
||
}\right)^n
|
||
\end{equation}
|
||
|
||
The parameters permit to specify:
|
||
|
||
- the low frequency gain: \\(G\_0 = lim\_{\omega \to 0} |W(j\omega)|\\)
|
||
- the high frequency gain: \\(G\_\infty = lim\_{\omega \to \infty} |W(j\omega)|\\)
|
||
- the absolute gain at \\(\omega\_0\\): \\(G\_c = |W(j\omega\_0)|\\)
|
||
- the absolute slope between high and low frequency: \\(n\\)
|
||
|
||
A Matlab function implementing Equation is shown below:
|
||
|
||
```matlab
|
||
function [W] = generateWeight(args)
|
||
arguments
|
||
args.G0 (1,1) double {mustBeNumeric, mustBePositive} = 0.1
|
||
args.G1 (1,1) double {mustBeNumeric, mustBePositive} = 10
|
||
args.Gc (1,1) double {mustBeNumeric, mustBePositive} = 1
|
||
args.wc (1,1) double {mustBeNumeric, mustBePositive} = 2*pi
|
||
args.n (1,1) double {mustBeInteger, mustBePositive} = 1
|
||
end
|
||
|
||
if (args.Gc <= args.G0 && args.Gc <= args.G1) || (args.Gc >= args.G0 && args.Gc >= args.G1)
|
||
eid = 'value:range';
|
||
msg = 'Gc must be between G0 and G1';
|
||
throwAsCaller(MException(eid,msg))
|
||
end
|
||
|
||
s = zpk('s');
|
||
|
||
W = (((1/args.wc) * sqrt((1-(args.G0/args.Gc)^(2/args.n))/(1-(args.Gc/args.G1)^(2/args.n)))*s + (args.G0/args.Gc)^(1/args.n)) / ((1/args.G1)^(1/args.n) * (1/args.wc) * sqrt((1-(args.G0/args.Gc)^(2/args.n))/(1-(args.Gc/args.G1)^(2/args.n)))*s + (1/args.Gc)^(1/args.n)))^args.n;
|
||
|
||
end
|
||
```
|
||
|
||
Let's use this function to generate three weights with the same high and low frequency gains, but but different slopes.
|
||
|
||
```matlab
|
||
W1 = generateWeight('G0', 1e2, 'G1', 1/2, 'Gc', 1, 'wc', 2*pi*10, 'n', 1);
|
||
W2 = generateWeight('G0', 1e2, 'G1', 1/2, 'Gc', 1, 'wc', 2*pi*10, 'n', 2);
|
||
W3 = generateWeight('G0', 1e2, 'G1', 1/2, 'Gc', 1, 'wc', 2*pi*10, 'n', 3);
|
||
```
|
||
|
||
The obtained shapes are shown in [Figure 26](#figure--fig:high-order-weight).
|
||
|
||
<a id="figure--fig:high-order-weight"></a>
|
||
|
||
{{< figure src="figs/high_order_weight.png" caption="<span class='figure-number'>Figure 26: </span>Higher order weights using Equation " >}}
|
||
|
||
</div>
|
||
|
||
|
||
### Shaping the Sensitivity Function {#sec:sensitivity_shaping_example}
|
||
|
||
Let's design a controller using the \\(\mathcal{H}\_\infty\\) shaping of the sensitivity function that fulfils the following requirements:
|
||
|
||
1. Bandwidth of at least 10Hz
|
||
2. Small static errors for step responses
|
||
3. Robustness: Large module margin \\(\Delta M > 0.5\\) (\\(\Rightarrow \Delta G > 2\\) and \\(\Delta \phi > 29^o\\))
|
||
|
||
As usual, the plant used is the one presented in Section [Example System](#sec:example_system).
|
||
|
||
<div class="exercice">
|
||
|
||
Translate the requirements as upper bounds on the Sensitivity function and design the corresponding weighting functions using Matlab.
|
||
|
||
<details><summary>Hint</summary>
|
||
|
||
The typical wanted upper bound of the sensitivity function is shown in [Figure 27](#figure--fig:h-infinity-spec-S-bis).
|
||
|
||
More precisely:
|
||
|
||
1. Recall that the closed-loop bandwidth is defined as the frequency \\(|S(j\omega)|\\) first crosses \\(1/\sqrt{2} = -3dB\\) from below
|
||
2. For the small static error, -60dB is usually enough as other factors (measurement noise, disturbances) will anyhow limit the performances
|
||
3. Recall that the module margin is equal to the inverse of the \\(\mathcal{H}\_\infty\\) norm of the sensitivity function:
|
||
\\[ \Delta M = \frac{1}{\\|S\\|\_\infty} \\]
|
||
|
||
Remember that the wanted upper bound of the sensitivity function is defined by the **inverse** magnitude of the weight.
|
||
|
||
<a id="figure--fig:h-infinity-spec-S-bis"></a>
|
||
|
||
{{< figure src="figs/h-infinity-spec-S.png" caption="<span class='figure-number'>Figure 27: </span>Typical wanted shape of the Sensitivity transfer function" >}}
|
||
|
||
</details>
|
||
|
||
<details><summary>Answer</summary>
|
||
|
||
We want to design the weighting function \\(W\_s(s)\\) such that:
|
||
|
||
1. \\(|W\_s(j \cdot 2 \pi 10)| = \sqrt{2}\\)
|
||
2. \\(|W\_s(j \cdot 0)| = 10^3\\)
|
||
3. \\(\\|W\_s\\|\_\infty = 0.5\\)
|
||
|
||
Using Matlab, such weighting function can be generated using the `makeweight` function as shown below:
|
||
|
||
```matlab
|
||
Ws = makeweight(1e3, [2*pi*10, sqrt(2)], 1/2);
|
||
```
|
||
|
||
Or using the `generateWeight` function:
|
||
|
||
```matlab
|
||
Ws = generateWeight('G0', 1e3, ...
|
||
'G1', 1/2, ...
|
||
'Gc', sqrt(2), 'wc', 2*pi*10, ...
|
||
'n', 2);
|
||
```
|
||
|
||
</details>
|
||
|
||
</div>
|
||
|
||
Let's say we came up with the following weighting function:
|
||
|
||
```matlab
|
||
Ws = generateWeight('G0', 1e3, ...
|
||
'G1', 1/2, ...
|
||
'Gc', sqrt(2), 'wc', 2*pi*10, ...
|
||
'n', 2);
|
||
```
|
||
|
||
The weighting function is then added to the generalized plant.
|
||
|
||
```matlab
|
||
P = [1 -G;
|
||
1 -G];
|
||
Pw = blkdiag(Ws, 1)*P;
|
||
```
|
||
|
||
And the \\(\mathcal{H}\_\infty\\) synthesis is performed on the _weighted_ generalized plant.
|
||
|
||
```matlab
|
||
K = hinfsyn(Pw, 1, 1, 'Display', 'on');
|
||
```
|
||
|
||
```text
|
||
Test bounds: 0.5 <= gamma <= 0.51
|
||
|
||
gamma X>=0 Y>=0 rho(XY)<1 p/f
|
||
5.05e-01 0.0e+00 0.0e+00 3.000e-16 p
|
||
Limiting gains...
|
||
5.05e-01 0.0e+00 0.0e+00 3.461e-16 p
|
||
5.05e-01 -3.5e+01 # -4.9e-14 1.732e-26 f
|
||
|
||
Best performance (actual): 0.503
|
||
```
|
||
|
||
\\(\gamma \approx 0.5\\) means that the \\(\mathcal{H}\_\infty\\) synthesis generated a controller \\(K(s)\\) that stabilizes the closed-loop system, and such that the \\(\mathcal{H}\_\infty\\) norm of the closed-loop transfer function from \\(w\\) to \\(z\\) is less than \\(\gamma\\):
|
||
|
||
\begin{align\*}
|
||
& \\| W\_s(s) S(s) \\|\_\infty \approx 0.5 \\\\
|
||
& \Leftrightarrow |S(j\omega)| < \frac{0.5}{|W\_s(j\omega)|} \quad \forall \omega
|
||
\end{align\*}
|
||
|
||
This is indeed what we can see by comparing \\(|S|\\) and \\(|W\_S|\\) in [Figure 28](#figure--fig:results-sensitivity-hinf).
|
||
|
||
<div class="important">
|
||
|
||
Obtaining \\(\gamma < 1\\) means that the \\(\mathcal{H}\_\infty\\) synthesis found a controller such that the specified closed-loop transfer functions are bellow the specified upper bounds.
|
||
|
||
Yet, obtaining a \\(\gamma\\) slightly above one does not necessary means the synthesis is unsuccessful.
|
||
It just means that at some frequency, one of the closed-loop transfer functions is above the specified upper bound by a factor \\(\gamma\\).
|
||
|
||
</div>
|
||
|
||
<a id="figure--fig:results-sensitivity-hinf"></a>
|
||
|
||
{{< figure src="figs/results_sensitivity_hinf.png" caption="<span class='figure-number'>Figure 28: </span>Weighting function and obtained closed-loop sensitivity" >}}
|
||
|
||
|
||
### Shaping multiple closed-loop transfer functions - Limitations {#sec:shaping_multiple_tf}
|
||
|
||
As was shown in Section [Modern Interpretation of Control Specifications](#sec:modern_interpretation_specification), each of the four main closed-loop transfer functions (called the _gang of four_) will impact different characteristics of the closed-loop system.
|
||
This is summarized in [Table 9](#table--tab:usual-shaping-gang-four).
|
||
|
||
Therefore, we might want to shape multiple closed-loop transfer functions at the same time.
|
||
For instance \\(S\\) could be shape to have good step responses, \\(KS\\) to limit the input usage and \\(T\\) to filter measurement noise.
|
||
When multiple closed-loop transfer function are shaped at the same time, it is refereed to as **Mixed-Sensitivity \\(\mathcal{H}\_\infty\\) Control** and is the subject of Section [Mixed-Sensitivity \\(\mathcal{H}\_\infty\\) Control - Example](#sec:h_infinity_mixed_sensitivity).
|
||
|
||
<a id="table--tab:usual-shaping-gang-four"></a>
|
||
<div class="table-caption">
|
||
<span class="table-number"><a href="#table--tab:usual-shaping-gang-four">Table 9</a>:</span>
|
||
Typical specifications and corresponding shaping of the <i>Gang of four</i>
|
||
</div>
|
||
|
||
| **Specifications** | **TF** | **Wanted shape** |
|
||
|:------------------------------|:--------:|:------------------------------------------------|
|
||
| Fast Reference Tracking | \\(S\\) | Set lower bound on the bandwidth |
|
||
| Small Steady State Errors | \\(S\\) | Small low frequency gain |
|
||
| Follow Step ref. inputs | \\(S\\) | Slope of +20dB/dec at low frequency |
|
||
| Follow Ramp ref. inputs | \\(S\\) | Slope of +40dB/dec at low frequency |
|
||
| Follow Sin. ref. inputs | \\(S\\) | Small magnitude centered on the sin. frequency |
|
||
| Output Disturbance Rejection | \\(S\\) | Small gain in the disturbance bandwidth |
|
||
| Input Disturbance Rejection | \\(GS\\) | Small gain in the disturbance bandwidth |
|
||
| Prevent notching resonances | \\(GS\\) | Limit gain around resonance |
|
||
| Small Command Amplitude | \\(KS\\) | Small at high frequency |
|
||
| Limitation of the Bandwidth | \\(T\\) | Set an upper bound on the bandwidth |
|
||
| Measurement Noise Filtering | \\(T\\) | Small high frequency gain |
|
||
| Stability margins | \\(S\\) | Module margin: \\(\Vert S\Vert\_\infty\\) small |
|
||
| Robust to unmodelled dynamics | \\(T\\) | Small at freq. where uncertainty is large |
|
||
|
||
Depending on which closed-loop transfer function are to be shaped, different weighted generalized plant can be used.
|
||
Some of them are described below for reference, it is a good exercise to try to re-design such weighted generalized plants.
|
||
|
||
<details><summary>Shaping of S and KS</summary>
|
||
|
||
<a id="figure--fig:general-conf-shaping-S-KS"></a>
|
||
|
||
{{< figure src="figs/general_conf_shaping_S_KS.png" caption="<span class='figure-number'>Figure 29: </span>Generalized Plant to shape \\(S\\) and \\(KS\\)" >}}
|
||
|
||
Weighting functions:
|
||
|
||
- \\(W\_1(s)\\) is used to shape \\(S\\)
|
||
- \\(W\_2(s)\\) is used to shape \\(KS\\)
|
||
|
||
<!--listend-->
|
||
|
||
```matlab
|
||
P = [1 -G
|
||
0 1
|
||
1 -G];
|
||
Pw = blkdiag(W1, W2, 1)*P;
|
||
```
|
||
|
||
</details>
|
||
|
||
<details><summary>Shaping of S and T</summary>
|
||
|
||
<a id="figure--fig:general-conf-shaping-S-T"></a>
|
||
|
||
{{< figure src="figs/general_conf_shaping_S_T.png" caption="<span class='figure-number'>Figure 30: </span>Generalized Plant to shape \\(S\\) and \\(T\\)" >}}
|
||
|
||
Weighting functions:
|
||
|
||
- \\(W\_1\\) is used to shape \\(S\\)
|
||
- \\(W\_2\\) is used to shape \\(T\\)
|
||
|
||
<!--listend-->
|
||
|
||
```matlab
|
||
P = [1 -G
|
||
0 G
|
||
1 -G];
|
||
Pw = blkdiag(W1, W2, 1)*P;
|
||
```
|
||
|
||
</details>
|
||
|
||
<details><summary>Shaping of S and GS</summary>
|
||
|
||
<a id="figure--fig:general-conf-shaping-S-GS"></a>
|
||
|
||
{{< figure src="figs/general_conf_shaping_S_GS.png" caption="<span class='figure-number'>Figure 31: </span>Generalized Plant to shape \\(S\\) and \\(GS\\)" >}}
|
||
|
||
Weighting functions:
|
||
|
||
- \\(W\_1\\) is used to shape \\(S\\)
|
||
- \\(W\_2\\) is used to shape \\(GS\\)
|
||
|
||
<!--listend-->
|
||
|
||
```matlab
|
||
P = [1 -1
|
||
G -G
|
||
G -G];
|
||
Pw = blkdiag(W1, W2, 1)*P;
|
||
```
|
||
|
||
</details>
|
||
|
||
<details><summary>Shaping of S, T and KS</summary>
|
||
|
||
<a id="figure--fig:general-conf-shaping-S-T-KS"></a>
|
||
|
||
{{< figure src="figs/general_conf_shaping_S_T_KS.png" caption="<span class='figure-number'>Figure 32: </span>Generalized Plant to shape \\(S\\), \\(T\\) and \\(KS\\)" >}}
|
||
|
||
Weighting functions:
|
||
|
||
- \\(W\_1\\) is used to shape \\(S\\)
|
||
- \\(W\_2\\) is used to shape \\(KS\\)
|
||
- \\(W\_3\\) is used to shape \\(T\\)
|
||
|
||
<!--listend-->
|
||
|
||
```matlab
|
||
P = [1 -G
|
||
0 1
|
||
0 G
|
||
1 -G];
|
||
Pw = blkdiag(W1, W2, W3, 1)*P;
|
||
```
|
||
|
||
</details>
|
||
|
||
<details><summary>Shaping of S, T and GS</summary>
|
||
|
||
<a id="figure--fig:general-conf-shaping-S-T-GS"></a>
|
||
|
||
{{< figure src="figs/general_conf_shaping_S_T_GS.png" caption="<span class='figure-number'>Figure 33: </span>Generalized Plant to shape \\(S\\), \\(T\\) and \\(GS\\)" >}}
|
||
|
||
Weighting functions:
|
||
|
||
- \\(W\_1\\) is used to shape \\(S\\)
|
||
- \\(W\_2\\) is used to shape \\(GS\\)
|
||
- \\(W\_3\\) is used to shape \\(T\\)
|
||
|
||
<!--listend-->
|
||
|
||
```matlab
|
||
P = [1 -1
|
||
G -G
|
||
0 1
|
||
G -G];
|
||
Pw = blkdiag(W1, W2, W3, 1)*P;
|
||
```
|
||
|
||
</details>
|
||
|
||
<details><summary>Shaping of S, T, KS and GS</summary>
|
||
|
||
<a id="figure--fig:general-conf-shaping-S-T-KS-GS"></a>
|
||
|
||
{{< figure src="figs/general_conf_shaping_S_T_KS_GS.png" caption="<span class='figure-number'>Figure 34: </span>Generalized Plant to shape \\(S\\), \\(T\\), \\(KS\\) and \\(GS\\)" >}}
|
||
|
||
Weighting functions:
|
||
|
||
- \\(W\_1\\) is used to shape \\(S\\)
|
||
- \\(W\_2\\) is used to shape \\(KS\\)
|
||
- \\(W\_1W\_3\\) is used to shape \\(GS\\)
|
||
- \\(W\_2W\_3\\) is used to shape \\(T\\)
|
||
|
||
<!--listend-->
|
||
|
||
```matlab
|
||
P = [ 1 -G -G
|
||
0 0 1
|
||
1 -G -G];
|
||
Pw = blkdiag(W1, W2, 1)*P*blkdiag(1, W3, 1);
|
||
```
|
||
|
||
</details>
|
||
|
||
<div class="important">
|
||
|
||
When shaping multiple closed-loop transfer functions, one should be very careful about the three following points that are further discussed:
|
||
|
||
- The shaped closed-loop transfer functions are linked by mathematical relations and cannot be shaped independently
|
||
- Closed-loop transfer function can only be shaped in certain frequency range
|
||
- The size of the obtained controller may be very large and not implementable in practice
|
||
|
||
</div>
|
||
|
||
<div class="warning">
|
||
|
||
Mathematical relations are linking the closed-loop transfer functions.
|
||
For instance, the sensitivity function \\(S(s)\\) and the complementary sensitivity function \\(T(s)\\) are linked by the following well known relation:
|
||
|
||
\begin{equation}
|
||
S(s) + T(s) = 1
|
||
\end{equation}
|
||
|
||
This means that \\(|S(j\omega)|\\) and \\(|T(j\omega)|\\) cannot be made small at the same time!
|
||
|
||
It is therefore **not** possible to shape the four closed-loop transfer functions independently.
|
||
The weighting function should be carefully design such as these fundamental relations are not violated.
|
||
|
||
</div>
|
||
|
||
For practical control systems, above some frequency (the control bandwidth), the loop gain is much smaller than 1.
|
||
On the other size, there is a frequency range where the loop gain is much larger than 1, this frequency range is called the bandwidth.
|
||
Let's see what does that means for the closed-loop transfer function.
|
||
First, take the case of the sensibility function:
|
||
|
||
\begin{align\*}
|
||
&|G(j\omega) K(j\omega)| \ll 1 \Longrightarrow |S(j\omega)| = \frac{1}{1 + |G(j\omega)K(j\omega)|} \approx 1 \\\\
|
||
&|G(j\omega) K(j\omega)| \gg 1 \Longrightarrow |S(j\omega)| = \frac{1}{1 + |G(j\omega)K(j\omega)|} \approx \frac{1}{|G(j\omega)K(j\omega)|}
|
||
\end{align\*}
|
||
|
||
This means that the Sensitivity function cannot be shaped at frequencies where the loop gain is small.
|
||
|
||
Similar relationship can be found for \\(T\\), \\(KS\\) and \\(GS\\).
|
||
|
||
<div class="exercice">
|
||
|
||
Determine the approximate norms of \\(T\\), \\(KS\\) and \\(GS\\) for large loop gains (\\(|G(j\omega) K(j\omega)| \gg 1\\)) and small loop gains (\\(|G(j\omega) K(j\omega)| \ll 1\\)).
|
||
|
||
<details><summary>Hint</summary>
|
||
|
||
You can follows this procedure for \\(T\\), \\(KS\\) and \\(GS\\):
|
||
|
||
1. Write the closed-loop transfer function as a function of \\(K(s)\\) and \\(G(s)\\)
|
||
2. Take \\(|K(j\omega)G(j\omega)| \gg 1\\) and conclude on the norm of the closed-loop transfer function
|
||
3. Take \\(|K(j\omega)G(j\omega)| \ll 1\\) and conclude
|
||
|
||
</details>
|
||
|
||
<details><summary>Answer</summary>
|
||
|
||
The obtained constrains are shown in [Figure 35](#figure--fig:h-infinity-4-blocs-constrains).
|
||
|
||
</details>
|
||
|
||
</div>
|
||
|
||
Depending on the frequency band, the norms of the closed-loop transfer functions are a function of the controller \\(K\\) and therefore can be shaped.
|
||
However, in some frequency band, the norms do not depend on the controller and therefore **cannot** be shaped.
|
||
|
||
Therefore the weighting functions should only focus on certainty frequency range depending on the transfer function being shaped.
|
||
These regions are summarized in [Figure 35](#figure--fig:h-infinity-4-blocs-constrains).
|
||
|
||
<a id="figure--fig:h-infinity-4-blocs-constrains"></a>
|
||
|
||
{{< figure src="figs/h-infinity-4-blocs-constrains.png" caption="<span class='figure-number'>Figure 35: </span>Shaping the Gang of Four. Blue regions indicate that the transfer function can be shaped using \\(K\\). Red regions indicate this is not the case" >}}
|
||
|
||
<div class="warning">
|
||
|
||
The order (e.g. number of state) of the controller given by the \\(\mathcal{H}\_\infty\\) synthesis is equal to the order (e.g. number of state) of the weighted generalized plant.
|
||
It is thus equal to the **sum** of the number of state of the non-weighted generalized plant and the number of state of all the weighting functions.
|
||
Then, the \\(\mathcal{H}\_\infty\\) synthesis usually generate a controller with a very high order that is not implementable in practice.
|
||
|
||
Two approaches can be used to obtain controllers with reasonable order:
|
||
|
||
1. use simple weights (usually first order)
|
||
2. perform a model reduction on the obtained high order controller
|
||
|
||
</div>
|
||
|
||
|
||
## Mixed-Sensitivity \\(\mathcal{H}\_\infty\\) Control - Example {#sec:h_infinity_mixed_sensitivity}
|
||
|
||
Let's now apply the \\(\mathcal{H}\_\infty\\) Shaping control procedure on a practical example.
|
||
|
||
In Section [Control Problem](#sec:ex_control_problem) the control problem is presented.
|
||
The design procedure used to apply the \\(\mathcal{H}\_\infty\\) Mixed Sensitivity synthesis is described in Section [Control Design Procedure](#sec:ex_control_procedure).
|
||
|
||
The important step of interpreting the specifications as wanted shape of closed-loop transfer functions is performed in Section [Modern Interpretation of control specifications](#sec:ex_specification_interpretation).
|
||
|
||
Finally, the shaping of closed-loop transfer functions is performed in Sections [Step 1 - Shaping of \\(S\\)](#sec:ex_shaping_S), [Step 2 - Shaping of \\(GS\\)](#sec:ex_shaping_GS) and [Step 3 - Shaping of \\(T\\)](#sec:ex_shaping_T).
|
||
|
||
|
||
### Control Problem {#sec:ex_control_problem}
|
||
|
||
Let's consider our usual _test system_ shown in [Figure 36](#figure--fig:ex-test-system).
|
||
|
||
<a id="figure--fig:ex-test-system"></a>
|
||
|
||
{{< figure src="figs/ex_test_system.png" caption="<span class='figure-number'>Figure 36: </span>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." >}}
|
||
|
||
<div class="important">
|
||
|
||
The control specifications are:
|
||
|
||
- The displacement \\(y\\) should follow reference inputs \\(r\\) with negligible static error after 0.1s
|
||
- Reject disturbances \\(d\\) in less than 0.1s
|
||
- Limit the effect of measurement noise \\(n\\) on the output displacement \\(y\\)
|
||
- Obtain a Robust System with good stability margins
|
||
|
||
</div>
|
||
|
||
The considered inputs are:
|
||
|
||
- disturbances \\(d\\) as step inputs with an amplitude of \\(5\\,\mu m\\)
|
||
- reference inputs with are ramp inputs with a slope of \\(100\\,\mu m/s\\) and a time duration of \\(0.2\\,s\\)
|
||
- measurement noise \\(n\\) with a large spectral density at high frequency (increasing starting from 100Hz)
|
||
|
||
|
||
### Control Design Procedure {#sec:ex_control_procedure}
|
||
|
||
Here is the general design procedure that will be followed:
|
||
|
||
1. Compute the model of the plant
|
||
2. Write the control system as a general control problem
|
||
3. Translate the specifications into the wanted shape of closed-loop transfer functions
|
||
4. Chose the suitable weighted general plant to shape the wanted quantities
|
||
5. Shape sequentially the chosen closed-loop transfer functions
|
||
|
||
Let's first convert the system of [Figure 36](#figure--fig:ex-test-system) into the classical feedback architecture of [Figure 37](#figure--fig:classical-feedback-test-system-bis).
|
||
|
||
<a id="figure--fig:classical-feedback-test-system-bis"></a>
|
||
|
||
{{< figure src="figs/ex_test_system_feedback.png" caption="<span class='figure-number'>Figure 37: </span>Block diagram corresponding to the example system" >}}
|
||
|
||
The two transfer functions present in the system are derived and defined below:
|
||
|
||
```matlab { linenos=true, linenostart=1 }
|
||
k = 1e6; % Stiffness [N/m]
|
||
c = 4e2; % Damping [N/(m/s)]
|
||
m = 10; % Mass [kg]
|
||
|
||
% Control Plant
|
||
G = 1/(m*s^2 + c*s + k);
|
||
% Disturbance dynamics
|
||
Gd = (c*s + k)/(m*s^2 + c*s + k);
|
||
```
|
||
|
||
We also define the inputs signals that will be used for time domain simulations.
|
||
They are graphically shown in [Figure 38](#figure--fig:ex-inputs-signals).
|
||
|
||
```matlab { linenos=true, linenostart=9 }
|
||
% Time Vector
|
||
t = 0:1e-4:0.5;
|
||
|
||
% Reference Input
|
||
r = zeros(size(t));
|
||
r(t>0.05 & t<=0.25) = 1e-4*(t(t>0.05 & t<=0.25)-0.05);
|
||
r(t>0.25) = 2e-5;
|
||
|
||
% Measurement Noise
|
||
Fs = 1e3; % Sampling Frequency [Hz]
|
||
Ts = 1/Fs; % Sampling Time [s]
|
||
n = sqrt(Fs/2)*randn(1, length(t)); % Signal with an ASD equal to one
|
||
n = lsim(1e-6*(s + 2*pi*1e2)^2/(s + 2*pi*1e3)^2/(1+s/2/pi/500), n, t)'; % Shaped noise
|
||
|
||
% Disturbance
|
||
d = zeros(size(t));
|
||
d(t>0.3) = 5e-6;
|
||
```
|
||
|
||
<a id="figure--fig:ex-inputs-signals"></a>
|
||
|
||
{{< figure src="figs/ex_inputs_signals.png" caption="<span class='figure-number'>Figure 38: </span>Time domain inputs signals" >}}
|
||
|
||
We also define the generalized plant corresponding to the system and that will be used for time domain simulations ([Figure 39](#figure--fig:ex-general-plant-sim)).
|
||
|
||
<a id="figure--fig:ex-general-plant-sim"></a>
|
||
|
||
{{< figure src="figs/ex_general_plant_sim.png" caption="<span class='figure-number'>Figure 39: </span>Generalized plant that will be used for simulations" >}}
|
||
|
||
The Generalized plant of [Figure 39](#figure--fig:ex-general-plant-sim) is defined on Matlab as follows:
|
||
|
||
```matlab { linenos=true, linenostart=26 }
|
||
Psim = [0 0 Gd G
|
||
0 0 0 1
|
||
1 -1 -Gd -G];
|
||
|
||
Psim.InputName = {'r', 'n', 'd', 'u'};
|
||
Psim.OutputName = {'y', 'u', 'e'};
|
||
```
|
||
|
||
Time domain simulations will be performed by first computing the closed-loop system using the `lft` command and then using the `lsim` command on the closed-loop system:
|
||
|
||
```matlab { linenos=true, linenostart=32 }
|
||
% Compute the closed-Loop System, K is the controller
|
||
P_CL = lft(Psim, K);
|
||
|
||
% Time simulation of the closed-loop system with specified inputs
|
||
z = lsim(P_CL, [r; n; d], t);
|
||
% The two outputs are
|
||
y = z(:,1); % Output Motion [m]
|
||
u = z(:,2); % Input usage [N]
|
||
```
|
||
|
||
|
||
### Modern Interpretation of control specifications {#sec:ex_specification_interpretation}
|
||
|
||
<div class="exercice">
|
||
|
||
1. Translate the control specifications into wanted shape of closed-loop transfer functions
|
||
2. Conclude and the closed-loop transfer functions to be shaped
|
||
3. Chose a general configuration architecture that allows to shape these transfer function
|
||
4. Using Matlab, define the generalized plant
|
||
|
||
<details><summary>Hint</summary>
|
||
|
||
1. Make use of [Table 9](#table--tab:usual-shaping-gang-four)
|
||
2. Make use of [Table 9](#table--tab:usual-shaping-gang-four)
|
||
3. See Section [Shaping multiple closed-loop transfer functions - Limitations](#sec:shaping_multiple_tf)
|
||
4. See Section [Shaping multiple closed-loop transfer functions - Limitations](#sec:shaping_multiple_tf)
|
||
|
||
</details>
|
||
|
||
</div>
|
||
|
||
After converting the control specifications into wanted shape of closed-loop transfer functions, we might come up with the [Table 10](#table--tab:ex-specification-shapes).
|
||
|
||
In such case, we want to shape \\(S\\), \\(GS\\) and \\(T\\).
|
||
|
||
<a id="table--tab:ex-specification-shapes"></a>
|
||
<div class="table-caption">
|
||
<span class="table-number"><a href="#table--tab:ex-specification-shapes">Table 10</a>:</span>
|
||
Control Specifications and associated wanted shape of the closed-loop transfer functions
|
||
</div>
|
||
|
||
| **Specification** | **TF** | **Wanted Shape** |
|
||
|:-------------------------|:-----------------:|:--------------------------------------|
|
||
| Follow Step Reference | \\(S\\) | +40dB of slope at low frequency |
|
||
| Reject Disturbances | \\(S\\), \\(GS\\) | Small gain |
|
||
| Reject measurement noise | \\(T\\) | Small high frequency (>100Hz) gain |
|
||
| Robust System | \\(S\\) | Small \\(\Vert S \Vert\_\infty\\) |
|
||
|
||
To do so, we use to generalized plant shown in [Figure 40](#figure--fig:ex-general-plant) for the synthesis where the three closed-loop tranfert functions from \\(w\\) to \\([z\_1\\,,z\_2\\,,z\_3]\\) are respectively \\(S\\), \\(GS\\) and \\(T\\).
|
||
|
||
This generalized plant is defined on Matlab as follows:
|
||
|
||
```matlab { linenos=true, linenostart=40 }
|
||
P = [1 -1
|
||
G -G
|
||
0 1
|
||
G -G];
|
||
```
|
||
|
||
<a id="figure--fig:ex-general-plant"></a>
|
||
|
||
{{< figure src="figs/ex_general_plant.png" caption="<span class='figure-number'>Figure 40: </span>Generalized plant chosen for the shaping of \\(S\\), \\(GS\\) \\(T\\)" >}}
|
||
|
||
However, to performed the \\(\mathcal{H}\_\infty\\) loop shaping, we have to include **weighting function** to the Generalized plant.
|
||
We obtain the **weighted generalized plant** in [Figure 41](#figure--fig:ex-general-weighted-plant), and that is computed using Matlab as follows:
|
||
|
||
```matlab { linenos=true, linenostart=44 }
|
||
Pw = blkdiag(W1, W2, W3, 1)*P;
|
||
```
|
||
|
||
<a id="figure--fig:ex-general-weighted-plant"></a>
|
||
|
||
{{< figure src="figs/ex_general_weighted_plant.png" caption="<span class='figure-number'>Figure 41: </span>Generalized weighted plant used for the \\(\mathcal{H}\_\infty\\) Synthesis" >}}
|
||
|
||
Finlay, performing the \\(\mathcal{H}\_\infty\\) Shaping of \\(S\\), \\(GS\\) and \\(T\\) is as simple as ruining the `hinfsyn` command:
|
||
|
||
```matlab { linenos=true, linenostart=45 }
|
||
K = hinfsyn(Pw, 1, 1);
|
||
```
|
||
|
||
Now let's shape the three closed-loop transfer functions sequentially:
|
||
|
||
- \\(S\\) is shaped in Section [Step 1 - Shaping of \\(S\\)](#sec:ex_shaping_S)
|
||
- \\(GS\\) is shaped in Section [Step 2 - Shaping of \\(GS\\)](#sec:ex_shaping_GS)
|
||
- \\(T\\) is shaped in Section [Step 3 - Shaping of \\(T\\)](#sec:ex_shaping_T)
|
||
|
||
|
||
### Step 1 - Shaping of \\(S\\) {#sec:ex_shaping_S}
|
||
|
||
Let's first shape the Sensitivity function as it is usually the most important of the _Gang of four_ closed-loop transfer functions.
|
||
To do so, we have to create a weight \\(W\_1(s)\\) that defines the wanted upper bound on \\(|S(j\omega)|\\):
|
||
|
||
- small low frequency gain: \\(|S(j\cdot 0)| = 10^{-3}\\)
|
||
- minimum crossover frequency of \\(\approx 10Hz\\): \\(|S(j2\pi 10)| < \frac{1}{\sqrt{2}}\\)
|
||
- small maximum peak magnitude for robustness properties: \\(\\|S\\|\_\infty < 2\\)
|
||
|
||
The weighting function is design using the `generateWeigh` function and its inverse shape can be seen in Figure
|
||
|
||
```matlab { linenos=true, linenostart=46 }
|
||
W1 = generateWeight('G0', 1e3, ...
|
||
'G1', 1/2, ...
|
||
'Gc', sqrt(2), 'wc', 2*pi*10, ...
|
||
'n', 1);
|
||
```
|
||
|
||
To not constrain \\(GS\\) and \\(T\\) for the shaping of \\(S\\), \\(W\_2\\) and \\(W\_3\\) are first taken as very small gains:
|
||
|
||
```matlab { linenos=true, linenostart=50 }
|
||
W2 = tf(1e-8);
|
||
W3 = tf(1e-8);
|
||
```
|
||
|
||
The \\(\mathcal{H}\_\infty\\) synthesis is performed and the obtained closed-loop transfer functions \\(S\\), \\(GS\\), and \\(T\\) and compared with the upper bounds set by the weighting functions in [Figure 42](#figure--fig:ex-results-1).
|
||
|
||
```matlab { linenos=true, linenostart=52 }
|
||
Pw = blkdiag(W1, W2, W3, 1)*P;
|
||
K1 = hinfsyn(Pw, 1, 1, 'Display', 'on');
|
||
```
|
||
|
||
```text
|
||
Test bounds: 0.5 <= gamma <= 0.51
|
||
|
||
gamma X>=0 Y>=0 rho(XY)<1 p/f
|
||
5.05e-01 0.0e+00 0.0e+00 5.511e-14 p
|
||
Limiting gains...
|
||
5.05e-01 0.0e+00 0.0e+00 1.867e-14 p
|
||
|
||
Best performance (actual): 0.502
|
||
```
|
||
|
||
<a id="figure--fig:ex-results-1"></a>
|
||
|
||
{{< figure src="figs/ex_results_1.png" caption="<span class='figure-number'>Figure 42: </span>Obtained Shape Closed-Loop transfer functions (dashed black lines indicate inverse magnitude of the weighting functions)" >}}
|
||
|
||
Time domain simulation is then performed and the obtained output displacement and control inputs are shown in [Figure 43](#figure--fig:ex-time-domain-1).
|
||
|
||
We can see:
|
||
|
||
- we are not able to follow the ramp input. This have to be solved by modifying the weighting function \\(W\_1(s)\\)
|
||
- we have poor rejection of disturbances. This we be solve by shaping \\(GS\\) in Section [Step 2 - Shaping of \\(GS\\)](#sec:ex_shaping_GS)
|
||
- we have quite large effect of the measurement noise. This will be solved by shaping \\(T\\) in Section [Step 3 - Shaping of \\(T\\)](#sec:ex_shaping_T)
|
||
|
||
<a id="figure--fig:ex-time-domain-1"></a>
|
||
|
||
{{< figure src="figs/ex_time_domain_1.png" caption="<span class='figure-number'>Figure 43: </span>Time domain simulation results" >}}
|
||
|
||
Remember that in order to follow ramp inputs, the sensitivity function should have a slope of +40dB/dec at low frequency ([Table 9](#table--tab:usual-shaping-gang-four)).
|
||
|
||
To do so, let's modify \\(W\_1\\) to impose a slope of +40dB/dec at low frequency.
|
||
This can simple be done by using a second order weight:
|
||
|
||
```matlab { linenos=true, linenostart=54 }
|
||
W1 = generateWeight('G0', 1e3, ...
|
||
'G1', 1/2, ...
|
||
'Gc', sqrt(2), 'wc', 2*pi*15, ...
|
||
'n', 2);
|
||
```
|
||
|
||
The \\(\mathcal{H}\_\infty\\) synthesis is performed using the new weights and the obtained closed-loop shaped are shown in [Figure 44](#figure--fig:ex-results-1b).
|
||
|
||
The time domain signals are shown in [Figure 45](#figure--fig:ex-time-domain-1b) and it is confirmed that the ramps are now follows without static errors.
|
||
|
||
<a id="figure--fig:ex-results-1b"></a>
|
||
|
||
{{< figure src="figs/ex_results_1b.png" caption="<span class='figure-number'>Figure 44: </span>Obtained Shape Closed-Loop transfer functions" >}}
|
||
|
||
<a id="figure--fig:ex-time-domain-1b"></a>
|
||
|
||
{{< figure src="figs/ex_time_domain_1b.png" caption="<span class='figure-number'>Figure 45: </span>Time domain simulation results" >}}
|
||
|
||
|
||
### Step 2 - Shaping of \\(GS\\) {#sec:ex_shaping_GS}
|
||
|
||
Looking at [Figure 46](#figure--fig:ex-results-2), it is clear that the rejection of disturbances is not satisfactory.
|
||
This can also be seen by the large peak of \\(GS\\) in [Figure 44](#figure--fig:ex-results-1b).
|
||
|
||
This poor rejection of disturbances is actually due to the fact that the obtain controller has at notch at the resonance frequency of the plant.
|
||
|
||
To overcome this issue, we can simply increase the magnitude of \\(W\_2\\) to limit the peak magnitude of \\(GS\\)
|
||
Let's take \\(W\_2\\) as a simple constant gain:
|
||
|
||
```matlab { linenos=true, linenostart=58 }
|
||
W2 = tf(4e5);
|
||
```
|
||
|
||
The \\(\mathcal{H}\_\infty\\) Synthesis is performed and the obtained closed-loop transfer functions are shown in [Figure 46](#figure--fig:ex-results-2).
|
||
|
||
<a id="figure--fig:ex-results-2"></a>
|
||
|
||
{{< figure src="figs/ex_results_2.png" caption="<span class='figure-number'>Figure 46: </span>Obtained Shape Closed-Loop transfer functions" >}}
|
||
|
||
Time domain simulation results are shown in [Figure 47](#figure--fig:ex-time-domain-2).
|
||
If is shown that indeed, the disturbance rejection performance are much better and only very small oscillation is obtained.
|
||
|
||
<a id="figure--fig:ex-time-domain-2"></a>
|
||
|
||
{{< figure src="figs/ex_time_domain_2.png" caption="<span class='figure-number'>Figure 47: </span>Time domain simulation results" >}}
|
||
|
||
|
||
### Step 3 - Shaping of \\(T\\) {#sec:ex_shaping_T}
|
||
|
||
Finally, we want to limit the effect of the noise on the displacement output.
|
||
|
||
To do so, \\(T\\) is shaped such that its high frequency gain is reduced.
|
||
|
||
This is done by increasing the high frequency gain of the weighting function \\(W\_3\\) until the \\(\mathcal{H}\_\infty\\) synthesis gives \\(\gamma \approx 1\\).
|
||
|
||
The final weighting function \\(W\_3\\) is defined as follows:
|
||
|
||
```matlab { linenos=true, linenostart=59 }
|
||
W3 = generateWeight('G0', 1e-1, ...
|
||
'G1', 1e4, ...
|
||
'Gc', 1, 'wc', 2*pi*70, ...
|
||
'n', 2);
|
||
```
|
||
|
||
The \\(\mathcal{H}\_\infty\\) synthesis is performed and \\(\gamma\\) is closed to one.
|
||
The obtained closed-loop transfer functions are shown in [Figure 48](#figure--fig:ex-results-3) and we can obverse that:
|
||
|
||
- The high frequency gain of \\(T\\) is indeed reduced
|
||
- This comes as the expense of a large magnitude both \\(GS\\) and \\(S\\).
|
||
This means we will probably have slightly less good disturbance rejection and tracking performances.
|
||
|
||
<a id="figure--fig:ex-results-3"></a>
|
||
|
||
{{< figure src="figs/ex_results_3.png" caption="<span class='figure-number'>Figure 48: </span>Obtained Shape Closed-Loop transfer functions" >}}
|
||
|
||
The time domain simulation signals are shown in [Figure 49](#figure--fig:ex-time-domain-3).
|
||
We can indeed see a slightly less good disturbance rejection.
|
||
However, the vibrations induced by the sensor noise is well reduced.
|
||
This can be seen when zooming on the output signal in [Figure 50](#figure--fig:ex-time-domaim-3-zoom).
|
||
|
||
<a id="figure--fig:ex-time-domain-3"></a>
|
||
|
||
{{< figure src="figs/ex_time_domain_3.png" caption="<span class='figure-number'>Figure 49: </span>Time domain simulation results" >}}
|
||
|
||
<a id="figure--fig:ex-time-domaim-3-zoom"></a>
|
||
|
||
{{< figure src="figs/ex_time_domaim_3_zoom.png" caption="<span class='figure-number'>Figure 50: </span>Zoom on the output signal" >}}
|
||
|
||
|
||
### Conclusion and Discussion {#conclusion-and-discussion}
|
||
|
||
Hopefully this practical example will help you apply the \\(\mathcal{H}\_\infty\\) Shaping synthesis on other control problems.
|
||
|
||
As an exercise, plot and analyze the evolution of the controller and loop gain transfer functions during the 3 synthesis steps.
|
||
|
||
If the large input usage is considered to be not acceptable, the shaping of \\(KS\\) could be included in the synthesis and all the _Gang of four_ closed-loop transfer function shapes.
|
||
|
||
|
||
## Conclusion {#sec:conclusion}
|
||
|
||
Hopefully, this document gave you a glimpse on how useful and powerful the \\(\mathcal{H}\_\infty\\) loop shaping synthesis can be.
|
||
One of the true power of \\(\mathcal{H}\_\infty\\) synthesis is that is can easily be applied to multi-input multi-output systems!
|
||
If you want to know more about the "\\(\mathcal{H}\_\infty\\) and robust control world" some resources are given below.
|
||
|
||
|
||
## Resources {#resources}
|
||
|
||
For a complete treatment of multivariable robust control, I would highly recommend this book (<a href="#citeproc_bib_item_4">Skogestad and Postlethwaite 2007</a>).
|
||
If you want to nice reference book in French, look at (<a href="#citeproc_bib_item_2">Duc and Font 1999</a>).
|
||
|
||
Here is a series of tech talks by Brian Douglas:
|
||
|
||
{{< youtube A7wHSr6GRnc >}}
|
||
|
||
Here is a Control Bootcamp by Steve Brunton:
|
||
|
||
{{< youtube Pi7l8mMjYVE >}}
|
||
|
||
|
||
## Bibliography {#bibliography}
|
||
|
||
<style>.csl-entry{text-indent: -1.5em; margin-left: 1.5em;}</style><div class="csl-bib-body">
|
||
<div class="csl-entry"><a id="citeproc_bib_item_1"></a>Bibel, John E, and D Stephen Malyevac. 1992. “Guidelines for the Selection of Weighting Functions for H-Infinity Control.” NAVAL SURFACE WARFARE CENTER DAHLGREN DIV VA.</div>
|
||
<div class="csl-entry"><a id="citeproc_bib_item_2"></a>Duc, G, and S Font. 1999. <i>Commande H Infinie et Mu-Analyse-Des Outils Pour La Robustesse</i>. <i>Hermes., Paris: Hermes</i>. Lavoisier.</div>
|
||
<div class="csl-entry"><a id="citeproc_bib_item_3"></a>Lurie, Boris J., Ali Ghavimi, Fred Y. Hadaegh, and Edward Mettler. 2002. “System Architecture Trades Using Bode-Step Control Design.” <i>Journal of Guidance, Control, and Dynamics</i> 25 (2): 309–15. doi:<a href="https://doi.org/10.2514/2.4883">10.2514/2.4883</a>.</div>
|
||
<div class="csl-entry"><a id="citeproc_bib_item_4"></a>Skogestad, Sigurd, and Ian Postlethwaite. 2007. <i>Multivariable Feedback Control: Analysis and Design</i>. John Wiley.</div>
|
||
</div>
|