lecture-h-infinity/index.html

2837 lines
100 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2020-12-02 mer. 11:00 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>A brief and practical introduction to \(\mathcal{H}_\infty\) Control</title>
<meta name="generator" content="Org mode" />
<meta name="author" content="Dehaeze Thomas" />
<link rel="stylesheet" type="text/css" href="https://research.tdehaeze.xyz/css/style.css"/>
<script type="text/javascript" src="https://research.tdehaeze.xyz/js/script.js"></script>
<script>MathJax = {
tex: {
tags: 'ams',
macros: {bm: ["\\boldsymbol{#1}",1],}
}
};
</script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
</head>
<body>
<div id="org-div-home-and-up">
<a accesskey="h" href="../index.html"> UP </a>
|
<a accesskey="H" href="../index.html"> HOME </a>
</div><div id="content">
<h1 class="title">A brief and practical introduction to \(\mathcal{H}_\infty\) Control</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org267ac69">1. Introduction to Model Based Control</a>
<ul>
<li><a href="#org2816731">1.1. Model Based Control - Methodology</a></li>
<li><a href="#org18d6909">1.2. From Classical Control to Robust Control</a></li>
<li><a href="#org4fde82b">1.3. Example System</a></li>
</ul>
</li>
<li><a href="#org1bfaa00">2. Classical Open Loop Shaping</a>
<ul>
<li><a href="#org4d52f02">2.1. Introduction to Loop Shaping</a></li>
<li><a href="#orgfefb3c0">2.2. Example of Open Loop Shaping</a></li>
<li><a href="#org6fdc1bc">2.3. \(\mathcal{H}_\infty\) Loop Shaping Synthesis</a></li>
<li><a href="#org1172944">2.4. Example of the \(\mathcal{H}_\infty\) Loop Shaping Synthesis</a></li>
</ul>
</li>
<li><a href="#orgde10b7a">3. A first Step into the \(\mathcal{H}_\infty\) world</a>
<ul>
<li><a href="#org5ae8918">3.1. The \(\mathcal{H}_\infty\) Norm</a></li>
<li><a href="#org91b1ae9">3.2. \(\mathcal{H}_\infty\) Synthesis</a></li>
<li><a href="#org9c4b033">3.3. The Generalized Plant</a></li>
<li><a href="#org0187c7b">3.4. The \(\mathcal{H}_\infty\) Synthesis applied on the Generalized plant</a></li>
<li><a href="#org822d770">3.5. From a Classical Feedback Architecture to a Generalized Plant</a></li>
</ul>
</li>
<li><a href="#orgba30a55">4. Modern Interpretation of Control Specifications</a>
<ul>
<li><a href="#orgb5fba6b">4.1. Closed Loop Transfer Functions</a></li>
<li><a href="#orgfccb95f">4.2. Sensitivity Function</a></li>
<li><a href="#org3a7b849">4.3. Robustness: Module Margin</a></li>
<li><a href="#orgd23fc15">4.4. Other Requirements</a></li>
</ul>
</li>
<li><a href="#org7a2a83d">5. \(\mathcal{H}_\infty\) Shaping of closed-loop transfer functions</a>
<ul>
<li><a href="#org41e6177">5.1. How to Shape closed-loop transfer function? Using Weighting Functions!</a></li>
<li><a href="#org48b9767">5.2. Design of Weighting Functions</a></li>
<li><a href="#org00bea7c">5.3. Shaping the Sensitivity Function</a></li>
<li><a href="#org5953b0e">5.4. Shaping multiple closed-loop transfer functions</a></li>
</ul>
</li>
<li><a href="#org4cfe210">6. Mixed-Sensitivity \(\mathcal{H}_\infty\) Control - Example</a>
<ul>
<li><a href="#orgbb9bd9a">6.1. Control Problem</a></li>
<li><a href="#org7f64534">6.2. Control Design Procedure</a></li>
<li><a href="#orga3ee604">6.3. Step 1 - Shaping of \(S\)</a></li>
<li><a href="#org238cd32">6.4. Step 2 - Shaping of \(KS\)</a></li>
<li><a href="#org98f0830">6.5. Step 3 - Shaping of \(T\)</a></li>
</ul>
</li>
<li><a href="#orgfd49210">7. Conclusion</a></li>
</ul>
</div>
</div>
<p>
The purpose of this document is to give a <i>practical introduction</i> to the wonderful world of \(\mathcal{H}_\infty\) Control.
</p>
<p>
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.
</p>
<p>
When possible, Matlab scripts used for the example/exercises are provided such that you can easily test them on your computer.
</p>
<p>
The general structure of this document is as follows:
</p>
<ul class="org-ul">
<li>A short introduction to <i>model based control</i> is given in Section <a href="#org0e42208">1</a></li>
<li>Classical <i>open</i> loop shaping method is presented in Section <a href="#org2b3b18e">2</a>.
It is also shown that \(\mathcal{H}_\infty\) synthesis can be used for <i>open</i> loop shaping</li>
<li>Important concepts indispensable for \(\mathcal{H}_\infty\) control such as the \(\mathcal{H}_\infty\) norm and the generalized plant are introduced in Section <a href="#org0f7ce95">3</a></li>
<li>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 <a href="#orgb088aa1">4</a></li>
<li>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 <a href="#orge201bfd">5</a></li>
<li>Finally, complete examples of the use of \(\mathcal{H}_\infty\) Control for practical problems are provided in Section <a href="#orgb0ce710">6</a>.</li>
</ul>
<div id="outline-container-org267ac69" class="outline-2">
<h2 id="org267ac69"><span class="section-number-2">1</span> Introduction to Model Based Control</h2>
<div class="outline-text-2" id="text-1">
<p>
<a id="org0e42208"></a>
</p>
<ul class="org-ul">
<li>Section <a href="#orgf2535d2">1.1</a></li>
<li>Section <a href="#org3add31e">1.2</a></li>
<li>Section <a href="#orga75776c">1.3</a></li>
</ul>
</div>
<div id="outline-container-org2816731" class="outline-3">
<h3 id="org2816731"><span class="section-number-3">1.1</span> Model Based Control - Methodology</h3>
<div class="outline-text-3" id="text-1-1">
<p>
<a id="orgf2535d2"></a>
</p>
<p>
The typical methodology when applying Model Based Control to a plant is schematically shown in Figure <a href="#org9cc8abf">1</a>.
It consists of three steps:
</p>
<ol class="org-ol">
<li><b>Identification or modeling</b>: \(\Longrightarrow\) mathematical model</li>
<li><b>Translate the specifications into mathematical criteria</b>:
<ul class="org-ul">
<li><span class="underline">Specifications</span>: Response Time, Noise Rejection, Maximum input amplitude, Robustness, &#x2026;</li>
<li><span class="underline">Mathematical Criteria</span>: Cost Function, Shape of TF</li>
</ul></li>
<li><b>Synthesis</b>: research of \(K\) that satisfies the specifications for the model of the system</li>
</ol>
<div id="org9cc8abf" class="figure">
<p><img src="figs/control-procedure.png" alt="control-procedure.png" />
</p>
<p><span class="figure-number">Figure 1: </span>Typical Methodoly for Model Based Control</p>
</div>
<p>
In this document, we will mainly focus on steps 2 and 3.
</p>
<p>
Step 2 will be discussed in Section <a href="#orgb088aa1">4</a>.
There are two main methods for the controller synthesis (step 3):
</p>
<ul class="org-ul">
<li><i>open</i> loop shaping discussed in Section <a href="#org2b3b18e">2</a></li>
<li><i>closed</i> loop shaping discussed in Sections <a href="#orgb088aa1">4</a> and <a href="#orgb0ce710">6</a></li>
</ul>
</div>
</div>
<div id="outline-container-org18d6909" class="outline-3">
<h3 id="org18d6909"><span class="section-number-3">1.2</span> From Classical Control to Robust Control</h3>
<div class="outline-text-3" id="text-1-2">
<p>
<a id="org3add31e"></a>
</p>
<table id="org621856b" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption class="t-above"><span class="table-number">Table 1:</span> Table summurazing the main differences between classical, modern and robust control</caption>
<colgroup>
<col class="org-left" />
<col class="org-center" />
<col class="org-center" />
<col class="org-center" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">&#xa0;</th>
<th scope="col" class="org-center"><b>Classical Control</b></th>
<th scope="col" class="org-center"><b>Modern Control</b></th>
<th scope="col" class="org-center"><b>Robust Control</b></th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left"><b>Date</b></td>
<td class="org-center">1930-</td>
<td class="org-center">1960-</td>
<td class="org-center">1980-</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left"><b>Tools</b></td>
<td class="org-center">Transfer Functions</td>
<td class="org-center">State Space formulation</td>
<td class="org-center">Systems and Signals Norms (\(\mathcal{H}_\infty\), \(\mathcal{H}_2\) Norms)</td>
</tr>
<tr>
<td class="org-left">&#xa0;</td>
<td class="org-center">Nyquist Plots</td>
<td class="org-center">Riccati Equations</td>
<td class="org-center">Closed Loop Transfer Functions</td>
</tr>
<tr>
<td class="org-left">&#xa0;</td>
<td class="org-center">Bode Plots</td>
<td class="org-center">&#xa0;</td>
<td class="org-center">Open/Closed Loop Shaping</td>
</tr>
<tr>
<td class="org-left">&#xa0;</td>
<td class="org-center">Phase and Gain margins</td>
<td class="org-center">&#xa0;</td>
<td class="org-center">Weighting Functions</td>
</tr>
<tr>
<td class="org-left">&#xa0;</td>
<td class="org-center">&#xa0;</td>
<td class="org-center">&#xa0;</td>
<td class="org-center">Disk margin</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left"><b>Control Architectures</b></td>
<td class="org-center">Proportional, Integral, Derivative</td>
<td class="org-center">Full State Feedback, LQR</td>
<td class="org-center">General Control Configuration</td>
</tr>
<tr>
<td class="org-left">&#xa0;</td>
<td class="org-center">Leads, Lags</td>
<td class="org-center">Kalman Filters, LQG</td>
<td class="org-center">Generalized Plant</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left"><b>Advantages</b></td>
<td class="org-center">Study Stability</td>
<td class="org-center">Automatic Synthesis</td>
<td class="org-center">Automatic Synthesis</td>
</tr>
<tr>
<td class="org-left">&#xa0;</td>
<td class="org-center">Simple</td>
<td class="org-center">MIMO</td>
<td class="org-center">MIMO</td>
</tr>
<tr>
<td class="org-left">&#xa0;</td>
<td class="org-center">Natural</td>
<td class="org-center">Optimization Problem</td>
<td class="org-center">Optimization Problem</td>
</tr>
<tr>
<td class="org-left">&#xa0;</td>
<td class="org-center">&#xa0;</td>
<td class="org-center">&#xa0;</td>
<td class="org-center">Guaranteed Robustness</td>
</tr>
<tr>
<td class="org-left">&#xa0;</td>
<td class="org-center">&#xa0;</td>
<td class="org-center">&#xa0;</td>
<td class="org-center">Easy specification of performances</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left"><b>Disadvantages</b></td>
<td class="org-center">Manual Method</td>
<td class="org-center">No Guaranteed Robustness</td>
<td class="org-center">Required knowledge of specific tools</td>
</tr>
<tr>
<td class="org-left">&#xa0;</td>
<td class="org-center">Only SISO</td>
<td class="org-center">Difficult Rejection of Perturbations</td>
<td class="org-center">Need a reasonably good model of the system</td>
</tr>
</tbody>
</table>
<div id="orgeef967b" class="figure">
<p><img src="figs/robustness_performance.png" alt="robustness_performance.png" />
</p>
<p><span class="figure-number">Figure 2: </span>Comparison of the performance and robustness of classical control methods, modern control methods and robust control methods. The required information on the plant to succesfuly apply each of the control methods are indicated by the colors.</p>
</div>
</div>
</div>
<div id="outline-container-org4fde82b" class="outline-3">
<h3 id="org4fde82b"><span class="section-number-3">1.3</span> Example System</h3>
<div class="outline-text-3" id="text-1-3">
<p>
<a id="orga75776c"></a>
</p>
<p>
Let&rsquo;s consider the model shown in Figure <a href="#orgd2f0d5a">3</a>.
It could represent a suspension system with a payload to position or isolate using an force actuator and an inertial sensor.
The notations used are listed in Table <a href="#orgbe269b4">2</a>.
</p>
<div id="orgd2f0d5a" class="figure">
<p><img src="figs/mech_sys_1dof_inertial_contr.png" alt="mech_sys_1dof_inertial_contr.png" />
</p>
<p><span class="figure-number">Figure 3: </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.</p>
</div>
<table id="orgbe269b4" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption class="t-above"><span class="table-number">Table 2:</span> Example system variables</caption>
<colgroup>
<col class="org-left" />
<col class="org-left" />
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left"><b>Notation</b></th>
<th scope="col" class="org-left"><b>Description</b></th>
<th scope="col" class="org-left"><b>Value</b></th>
<th scope="col" class="org-left"><b>Unit</b></th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">\(m\)</td>
<td class="org-left">Payload&rsquo;s mass to position / isolate</td>
<td class="org-left">\(10\)</td>
<td class="org-left">[kg]</td>
</tr>
<tr>
<td class="org-left">\(k\)</td>
<td class="org-left">Stiffness of the suspension system</td>
<td class="org-left">\(10^6\)</td>
<td class="org-left">[N/m]</td>
</tr>
<tr>
<td class="org-left">\(c\)</td>
<td class="org-left">Damping coefficient of the suspension system</td>
<td class="org-left">\(400\)</td>
<td class="org-left">[N/(m/s)]</td>
</tr>
<tr>
<td class="org-left">\(y\)</td>
<td class="org-left">Payload absolute displacement (measured by an inertial sensor)</td>
<td class="org-left">&#xa0;</td>
<td class="org-left">[m]</td>
</tr>
<tr>
<td class="org-left">\(d\)</td>
<td class="org-left">Ground displacement, it acts as a disturbance</td>
<td class="org-left">&#xa0;</td>
<td class="org-left">[m]</td>
</tr>
<tr>
<td class="org-left">\(u\)</td>
<td class="org-left">Actuator force</td>
<td class="org-left">&#xa0;</td>
<td class="org-left">[N]</td>
</tr>
<tr>
<td class="org-left">\(r\)</td>
<td class="org-left">Wanted position of the mass (the reference)</td>
<td class="org-left">&#xa0;</td>
<td class="org-left">[m]</td>
</tr>
<tr>
<td class="org-left">\(\epsilon = r - y\)</td>
<td class="org-left">Position error</td>
<td class="org-left">&#xa0;</td>
<td class="org-left">[m]</td>
</tr>
<tr>
<td class="org-left">\(K\)</td>
<td class="org-left">Feedback controller</td>
<td class="org-left">to be designed</td>
<td class="org-left">[N/m]</td>
</tr>
</tbody>
</table>
<div class="exercice" id="orgd5c0000">
<p>
Derive the following open-loop transfer functions:
</p>
\begin{align}
G(s) &= \frac{y}{u} \\
G_d(s) &= \frac{y}{d}
\end{align}
<details><summary>Hint</summary>
<p>
You can follow this generic procedure:
</p>
<ol class="org-ol">
<li>List all applied forces ot the mass: Actuator force, Stiffness force (Hooke&rsquo;s law), &#x2026;</li>
<li>Apply the Newton&rsquo;s Second Law on the payload
\[ m \ddot{y} = \Sigma F \]</li>
<li>Transform the differential equations into the Laplace domain:
\[ \frac{d\ \cdot}{dt} \Leftrightarrow \cdot \times s \]</li>
<li>Write \(y(s)\) as a function of \(u(s)\) and \(w(s)\)</li>
</ol>
</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>
<p>
Having obtained \(G(s)\) and \(G_d(s)\), we can transform the system shown in Figure <a href="#orgd2f0d5a">3</a> into a classical feedback form as shown in Figure <a href="#org7fab7e3">7</a>.
</p>
<div id="org30d0cfb" class="figure">
<p><img src="figs/classical_feedback_test_system.png" alt="classical_feedback_test_system.png" />
</p>
<p><span class="figure-number">Figure 4: </span>Block diagram corresponding to the example system</p>
</div>
<p>
Let&rsquo;s define the system parameters on Matlab.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="linenr">1: </span>k = 1e6; <span class="org-comment">% Stiffness [N/m]</span>
<span class="linenr">2: </span>c = 4e2; <span class="org-comment">% Damping [N/(m/s)]</span>
<span class="linenr">3: </span>m = 10; <span class="org-comment">% Mass [kg]</span>
</pre>
</div>
<p>
And now the system dynamics \(G(s)\) and \(G_d(s)\) (their bode plots are shown in Figures <a href="#org6d94662">5</a> and <a href="#org6752600">6</a>).
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="linenr">4: </span>G = 1<span class="org-type">/</span>(m<span class="org-type">*</span>s<span class="org-type">^</span>2 <span class="org-type">+</span> c<span class="org-type">*</span>s <span class="org-type">+</span> k); <span class="org-comment">% Plant</span>
<span class="linenr">5: </span>Gd = (c<span class="org-type">*</span>s <span class="org-type">+</span> k)<span class="org-type">/</span>(m<span class="org-type">*</span>s<span class="org-type">^</span>2 <span class="org-type">+</span> c<span class="org-type">*</span>s <span class="org-type">+</span> k); <span class="org-comment">% Disturbance</span>
</pre>
</div>
<div id="org6d94662" class="figure">
<p><img src="figs/bode_plot_example_afm.png" alt="bode_plot_example_afm.png" />
</p>
<p><span class="figure-number">Figure 5: </span>Bode plot of the plant \(G(s)\)</p>
</div>
<div id="org6752600" class="figure">
<p><img src="figs/bode_plot_example_Gd.png" alt="bode_plot_example_Gd.png" />
</p>
<p><span class="figure-number">Figure 6: </span>Magnitude of the disturbance transfer function \(G_d(s)\)</p>
</div>
</div>
</div>
</div>
<div id="outline-container-org1bfaa00" class="outline-2">
<h2 id="org1bfaa00"><span class="section-number-2">2</span> Classical Open Loop Shaping</h2>
<div class="outline-text-2" id="text-2">
<p>
<a id="org2b3b18e"></a>
</p>
<ul class="org-ul">
<li>Section <a href="#org2ee971f">2.1</a></li>
<li>Section <a href="#orgf72f718">2.2</a></li>
<li>Section <a href="#org0f2dc6c">2.3</a></li>
<li>Section <a href="#orgb02a40a">2.4</a></li>
</ul>
</div>
<div id="outline-container-org4d52f02" class="outline-3">
<h3 id="org4d52f02"><span class="section-number-3">2.1</span> Introduction to Loop Shaping</h3>
<div class="outline-text-3" id="text-2-1">
<p>
<a id="org2ee971f"></a>
</p>
<div class="definition" id="orgd605846">
<p>
<b>Loop Shaping</b> refers to a design procedure that involves explicitly shaping the magnitude of the <b>Loop Transfer Function</b> \(L(s)\).
</p>
</div>
<div class="definition" id="orgba76f81">
<p>
The <b>Loop Gain</b> \(L(s)\) usually refers to as the product of the controller and the plant (&ldquo;Gain around the loop&rdquo;, see Figure <a href="#org7fab7e3">7</a>):
</p>
\begin{equation}
L(s) = G(s) \cdot K(s) \label{eq:loop_gain}
\end{equation}
<div id="org7fab7e3" class="figure">
<p><img src="figs/open_loop_shaping.png" alt="open_loop_shaping.png" />
</p>
<p><span class="figure-number">Figure 7: </span>Classical Feedback Architecture</p>
</div>
</div>
<p>
This synthesis method is widely used as many characteristics of the closed-loop system depend on the shape of the open loop gain \(L(s)\) such as:
</p>
<ul class="org-ul">
<li><b>Performance</b>: \(L\) large</li>
<li><b>Good disturbance rejection</b>: \(L\) large</li>
<li><b>Limitation of measurement noise on plant output</b>: \(L\) small</li>
<li><b>Small magnitude of input signal</b>: \(K\) and \(L\) small</li>
<li><b>Nominal stability</b>: \(L\) small (RHP zeros and time delays)</li>
<li><b>Robust stability</b>: \(L\) small (neglected dynamics)</li>
</ul>
<p>
The Open Loop shape is usually done manually has the loop gain \(L(s)\) depends linearly on \(K(s)\) \eqref{eq:loop_gain}.
</p>
<p>
\(K(s)\) then consists of a combination of leads, lags, notches, etc. such that \(L(s)\) has the wanted shape (an example is shown in Figure <a href="#org6318e13">8</a>).
</p>
<div id="org6318e13" class="figure">
<p><img src="figs/open_loop_shaping_shape.png" alt="open_loop_shaping_shape.png" />
</p>
<p><span class="figure-number">Figure 8: </span>Typical Wanted Shape for the Loop Gain \(L(s)\)</p>
</div>
</div>
</div>
<div id="outline-container-orgfefb3c0" class="outline-3">
<h3 id="orgfefb3c0"><span class="section-number-3">2.2</span> Example of Open Loop Shaping</h3>
<div class="outline-text-3" id="text-2-2">
<p>
<a id="orgf72f718"></a>
</p>
<div class="exampl" id="org393716f">
<p>
Let&rsquo;s take our example system and try to apply the Open-Loop shaping strategy to design a controller that fulfils the following specifications:
</p>
<ul class="org-ul">
<li><b>Performance</b>: Bandwidth of approximately 10Hz</li>
<li><b>Noise Attenuation</b>: Roll-off of -40dB/decade past 30Hz</li>
<li><b>Robustness</b>: Gain margin &gt; 3dB and Phase margin &gt; 30 deg</li>
</ul>
</div>
<div class="exercice" id="orgebd2d6a">
<p>
Using <code>SISOTOOL</code>, design a controller that fulfill the specifications.
</p>
<div class="org-src-container">
<pre class="src src-matlab">sisotool(G)
</pre>
</div>
</div>
<p>
In order to have the wanted Roll-off, two integrators are used, a lead is also added to have sufficient phase margin.
</p>
<p>
The obtained controller is shown below, and the bode plot of the Loop Gain is shown in Figure <a href="#org6c9a891">9</a>.
</p>
<div class="org-src-container">
<pre class="src src-matlab">K = 14e8 <span class="org-type">*</span> ...<span class="org-comment"> % Gain</span>
1<span class="org-type">/</span>(s<span class="org-type">^</span>2) <span class="org-type">*</span> ...<span class="org-comment"> % Double Integrator</span>
1<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>40) <span class="org-type">*</span> ...<span class="org-comment"> % Low Pass Filter</span>
(1 <span class="org-type">+</span> s<span class="org-type">/</span>(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>10<span class="org-type">/</span>sqrt(8)))<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>10<span class="org-type">*</span>sqrt(8))); <span class="org-comment">% Lead</span>
</pre>
</div>
<div id="org6c9a891" class="figure">
<p><img src="figs/loop_gain_manual_afm.png" alt="loop_gain_manual_afm.png" />
</p>
<p><span class="figure-number">Figure 9: </span>Bode Plot of the obtained Loop Gain \(L(s) = G(s) K(s)\)</p>
</div>
<p>
And we can verify that we have the wanted stability margins:
</p>
<div class="org-src-container">
<pre class="src src-matlab">[Gm, Pm, <span class="org-type">~</span>, Wc] = margin(G<span class="org-type">*</span>K)
</pre>
</div>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="org-left" />
<col class="org-right" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">Requirements</th>
<th scope="col" class="org-right">Manual Method</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">Gain Margin \(> 3\) [dB]</td>
<td class="org-right">3.1</td>
</tr>
<tr>
<td class="org-left">Phase Margin \(> 30\) [deg]</td>
<td class="org-right">35.4</td>
</tr>
<tr>
<td class="org-left">Crossover \(\approx 10\) [Hz]</td>
<td class="org-right">10.1</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="outline-container-org6fdc1bc" class="outline-3">
<h3 id="org6fdc1bc"><span class="section-number-3">2.3</span> \(\mathcal{H}_\infty\) Loop Shaping Synthesis</h3>
<div class="outline-text-3" id="text-2-3">
<p>
<a id="org0f2dc6c"></a>
</p>
<p>
The Open Loop Shaping synthesis can be performed using the \(\mathcal{H}_\infty\) Synthesis.
</p>
<p>
Even though we will not go into details, we will provide one example.
</p>
<p>
Using Matlab, the \(\mathcal{H}_\infty\) Loop Shaping Synthesis can be performed using the <code>loopsyn</code> command:
</p>
<div class="org-src-container">
<pre class="src src-matlab">K = loopsyn(G, Gd);
</pre>
</div>
<p>
where:
</p>
<ul class="org-ul">
<li><code>G</code> is the (LTI) plant</li>
<li><code>Gd</code> is the wanted loop shape</li>
<li><code>K</code> is the synthesize controller</li>
</ul>
<div class="seealso" id="org7913b44">
<p>
Matlab documentation of <code>loopsyn</code> (<a href="https://www.mathworks.com/help/robust/ref/loopsyn.html">link</a>).
</p>
</div>
</div>
</div>
<div id="outline-container-org1172944" class="outline-3">
<h3 id="org1172944"><span class="section-number-3">2.4</span> Example of the \(\mathcal{H}_\infty\) Loop Shaping Synthesis</h3>
<div class="outline-text-3" id="text-2-4">
<p>
<a id="orgb02a40a"></a>
</p>
<p>
Let&rsquo;s reuse the previous plant.
</p>
<p>
Translate the specification into the wanted shape of the open loop gain.
</p>
<ul class="org-ul">
<li><b>Performance</b>: Bandwidth of approximately 10Hz: \(|L_w(j2 \pi 10)| = 1\)</li>
<li><b>Noise Attenuation</b>: Roll-off of -40dB/decade past 30Hz</li>
<li><b>Robustness</b>: Gain margin &gt; 3dB and Phase margin &gt; 30 deg</li>
</ul>
<div class="org-src-container">
<pre class="src src-matlab">Lw = 2.3e3 <span class="org-type">*</span> ...
1<span class="org-type">/</span>(s<span class="org-type">^</span>2) <span class="org-type">*</span> ...<span class="org-comment"> % Double Integrator</span>
(1 <span class="org-type">+</span> s<span class="org-type">/</span>(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>10<span class="org-type">/</span>sqrt(3)))<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>10<span class="org-type">*</span>sqrt(3))); <span class="org-comment">% Lead</span>
</pre>
</div>
<p>
The \(\mathcal{H}_\infty\) optimal open loop shaping synthesis is performed using the <code>loopsyn</code> command:
</p>
<div class="org-src-container">
<pre class="src src-matlab">[K, <span class="org-type">~</span>, GAM] = loopsyn(G, Lw);
</pre>
</div>
<div class="important" id="orgdea5110">
<p>
It is always important to analyze the controller after the synthesis is performed.
</p>
<p>
In the end, a synthesize controller is just a combination of low pass filters, high pass filters, notches, leads, etc.
</p>
</div>
<p>
Let&rsquo;s briefly analyze the obtained controller which bode plot is shown in Figure <a href="#orgd37b625">10</a>:
</p>
<ul class="org-ul">
<li>two integrators are used at low frequency to have the wanted low frequency high gain</li>
<li>a lead is added centered with the crossover frequency to increase the phase margin</li>
<li>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)</li>
</ul>
<div id="orgd37b625" class="figure">
<p><img src="figs/open_loop_shaping_hinf_K.png" alt="open_loop_shaping_hinf_K.png" />
</p>
<p><span class="figure-number">Figure 10: </span>Obtained controller \(K\) using the open-loop \(\mathcal{H}_\infty\) shaping</p>
</div>
<p>
The obtained Loop Gain is shown in Figure <a href="#orgc539656">11</a> and matches the specified one by a factor \(\gamma\).
</p>
<div id="orgc539656" class="figure">
<p><img src="figs/open_loop_shaping_hinf_L.png" alt="open_loop_shaping_hinf_L.png" />
</p>
<p><span class="figure-number">Figure 11: </span>Obtained Open Loop Gain \(L(s) = G(s) K(s)\) and comparison with the wanted Loop gain \(L_w\)</p>
</div>
<p>
Let&rsquo;s now compare the obtained stability margins of the \(\mathcal{H}_\infty\) controller and of the manually developed controller in Table <a href="#org125376e">3</a>.
</p>
<table id="org125376e" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption class="t-above"><span class="table-number">Table 3:</span> Comparison of the characteristics obtained with the two methods</caption>
<colgroup>
<col class="org-left" />
<col class="org-right" />
<col class="org-right" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">Specifications</th>
<th scope="col" class="org-right">Manual Method</th>
<th scope="col" class="org-right">\(\mathcal{H}_\infty\) Method</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">Gain Margin \(> 3\) [dB]</td>
<td class="org-right">3.1</td>
<td class="org-right">31.7</td>
</tr>
<tr>
<td class="org-left">Phase Margin \(> 30\) [deg]</td>
<td class="org-right">35.4</td>
<td class="org-right">54.7</td>
</tr>
<tr>
<td class="org-left">Crossover \(\approx 10\) [Hz]</td>
<td class="org-right">10.1</td>
<td class="org-right">9.9</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="outline-container-orgde10b7a" class="outline-2">
<h2 id="orgde10b7a"><span class="section-number-2">3</span> A first Step into the \(\mathcal{H}_\infty\) world</h2>
<div class="outline-text-2" id="text-3">
<p>
<a id="org0f7ce95"></a>
</p>
<ul class="org-ul">
<li>Section <a href="#orgac50119">3.1</a></li>
<li>Section <a href="#orgcee36df">3.2</a></li>
<li>Section <a href="#org0dd62f4">3.3</a></li>
<li>Section <a href="#org58e1225">3.4</a></li>
<li>Section <a href="#orga9839ce">3.5</a></li>
</ul>
</div>
<div id="outline-container-org5ae8918" class="outline-3">
<h3 id="org5ae8918"><span class="section-number-3">3.1</span> The \(\mathcal{H}_\infty\) Norm</h3>
<div class="outline-text-3" id="text-3-1">
<p>
<a id="orgac50119"></a>
</p>
<div class="definition" id="org05b3799">
<p>
The \(\mathcal{H}_\infty\) norm is defined as the peak of the maximum singular value of the frequency response
</p>
\begin{equation}
\|G(s)\|_\infty = \max_\omega \bar{\sigma}\big( G(j\omega) \big)
\end{equation}
<p>
For a SISO system \(G(s)\), it is simply the peak value of \(|G(j\omega)|\) as a function of frequency:
</p>
\begin{equation}
\|G(s)\|_\infty = \max_{\omega} |G(j\omega)| \label{eq:hinf_norm_siso}
\end{equation}
</div>
<div class="exampl" id="orgf6e57d9">
<p>
Let&rsquo;s compute the \(\mathcal{H}_\infty\) norm of our test plant \(G(s)\) using the <code>hinfnorm</code> function:
</p>
<div class="org-src-container">
<pre class="src src-matlab">hinfnorm(G)
</pre>
</div>
<pre class="example">
7.9216e-06
</pre>
<p>
We can see that the \(\mathcal{H}_\infty\) norm of \(G(s)\) does corresponds to the peak value of \(|G(j\omega)|\) as a function of frequency as shown in Figure <a href="#orgb535058">12</a>.
</p>
<div id="orgb535058" class="figure">
<p><img src="figs/hinfinity_norm_siso_bode.png" alt="hinfinity_norm_siso_bode.png" />
</p>
<p><span class="figure-number">Figure 12: </span>Example of the \(\mathcal{H}_\infty\) norm of a SISO system</p>
</div>
</div>
</div>
</div>
<div id="outline-container-org91b1ae9" class="outline-3">
<h3 id="org91b1ae9"><span class="section-number-3">3.2</span> \(\mathcal{H}_\infty\) Synthesis</h3>
<div class="outline-text-3" id="text-3-2">
<p>
<a id="orgcee36df"></a>
</p>
<div class="definition" id="org5b4c588">
<p>
\(\mathcal{H}_\infty\) synthesis is a method that uses an <b>algorithm</b> (LMI optimization, Riccati equation) to find a controller that stabilize the system and that <b>minimizes</b> the \(\mathcal{H}_\infty\) norms of defined transfer functions.
</p>
</div>
<p>
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.
</p>
<p>
Then applying the \(\mathcal{H}_\infty\) synthesis to a plant, the engineer work usually consists of the following steps
</p>
<ol class="org-ol">
<li>Write the problem as standard \(\mathcal{H}_\infty\) problem</li>
<li>Translate the specifications as \(\mathcal{H}_\infty\) norms of transfer functions</li>
<li>Make the synthesis and analyze the obtain controller</li>
<li>Reduce the order of the controller for implementation</li>
</ol>
<p>
Note that there are many ways to use the \(\mathcal{H}_\infty\) Synthesis:
</p>
<ul class="org-ul">
<li>Traditional \(\mathcal{H}_\infty\) Synthesis (<code>hinfsyn</code> <a href="https://www.mathworks.com/help/robust/ref/hinfsyn.html">doc</a>)</li>
<li>Open Loop Shaping \(\mathcal{H}_\infty\) Synthesis (<code>loopsyn</code> <a href="https://www.mathworks.com/help/robust/ref/loopsyn.html">doc</a>)</li>
<li>Mixed Sensitivity Loop Shaping (<code>mixsyn</code> <a href="https://www.mathworks.com/help/robust/ref/lti.mixsyn.html">doc</a>)</li>
<li>Fixed-Structure \(\mathcal{H}_\infty\) Synthesis (<code>hinfstruct</code> <a href="https://www.mathworks.com/help/robust/ref/lti.hinfstruct.html">doc</a>)</li>
<li>Signal Based \(\mathcal{H}_\infty\) Synthesis, and many more&#x2026;</li>
</ul>
</div>
</div>
<div id="outline-container-org9c4b033" class="outline-3">
<h3 id="org9c4b033"><span class="section-number-3">3.3</span> The Generalized Plant</h3>
<div class="outline-text-3" id="text-3-3">
<p>
<a id="org0dd62f4"></a>
</p>
<p>
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 <b>Generalized Plant</b> for the current problem.
It makes things much easier for the following steps.
</p>
<p>
The generalized plant, usually noted \(P(s)\), is shown in Figure <a href="#orga8dfa5c">13</a>.
It has two inputs and two outputs (both could contains many signals).
The meaning of the inputs and outputs are summarized in Table <a href="#org5801c5b">4</a>.
</p>
<p>
Note that this generalized plant is as its name implies, quite <i>general</i>.
It can indeed represent feedback as well as feedforward control architectures.
</p>
\begin{equation}
\begin{bmatrix} z \\ v \end{bmatrix} = P \begin{bmatrix} w \\ u \end{bmatrix} = \begin{bmatrix} P_{11} & P_{12} \\ P_{21} & P_{22} \end{bmatrix} \begin{bmatrix} w \\ u \end{bmatrix}
\end{equation}
<div id="orga8dfa5c" class="figure">
<p><img src="figs/general_plant.png" alt="general_plant.png" />
</p>
<p><span class="figure-number">Figure 13: </span>Inputs and Outputs of the generalized Plant</p>
</div>
<div class="important" id="org01ed6f0">
<table id="org5801c5b" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption class="t-above"><span class="table-number">Table 4:</span> Notations for the general configuration</caption>
<colgroup>
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">Notation</th>
<th scope="col" class="org-left">Meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">\(P\)</td>
<td class="org-left">Generalized plant model</td>
</tr>
<tr>
<td class="org-left">\(w\)</td>
<td class="org-left">Exogenous inputs: commands, disturbances, noise</td>
</tr>
<tr>
<td class="org-left">\(z\)</td>
<td class="org-left">Exogenous outputs: signals to be minimized</td>
</tr>
<tr>
<td class="org-left">\(v\)</td>
<td class="org-left">Controller inputs: measurements</td>
</tr>
<tr>
<td class="org-left">\(u\)</td>
<td class="org-left">Control signals</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="outline-container-org0187c7b" class="outline-3">
<h3 id="org0187c7b"><span class="section-number-3">3.4</span> The \(\mathcal{H}_\infty\) Synthesis applied on the Generalized plant</h3>
<div class="outline-text-3" id="text-3-4">
<p>
<a id="org58e1225"></a>
</p>
<p>
Once the generalized plant is obtained, the \(\mathcal{H}_\infty\) synthesis problem can be stated as follows:
</p>
<div class="important" id="org67a0e05">
<dl class="org-dl">
<dt>\(\mathcal{H}_\infty\) Synthesis applied on the generalized plant</dt><dd></dd>
</dl>
<p>
Find a stabilizing controller \(K\) that, using the sensed output \(v\), generates a control signal \(u\) such that the \(\mathcal{H}_\infty\) norm of the closed-loop transfer function from \(w\) to \(z\) is minimized.
</p>
<p>
After \(K\) is found, the system is <i>robustified</i> by adjusting the response around the unity gain frequency to increase stability margins.
</p>
</div>
<div id="orgc77ed12" class="figure">
<p><img src="figs/general_control_names.png" alt="general_control_names.png" />
</p>
<p><span class="figure-number">Figure 14: </span>General Control Configuration</p>
</div>
<p>
Note that the closed-loop transfer function from \(w\) to \(z\) is:
</p>
\begin{equation}
\frac{z}{w} = P_{11} + P_{12} K \big( I - P_{22} K \big)^{-1} P_{21} \triangleq F_l(P, K)
\end{equation}
<p>
Using Matlab, the \(\mathcal{H}_\infty\) Synthesis applied on a Generalized plant can be applied using the <code>hinfsyn</code> command (<a href="https://www.mathworks.com/help/robust/ref/hinfsyn.html">documentation</a>):
</p>
<div class="org-src-container">
<pre class="src src-matlab">K = hinfsyn(P, nmeas, ncont);
</pre>
</div>
<p>
where:
</p>
<ul class="org-ul">
<li><code>P</code> is the generalized plant transfer function matrix</li>
<li><code>nmeas</code> is the number of sensed output (size of \(v\))</li>
<li><code>ncont</code> is the number of control signals (size of \(u\))</li>
<li><code>K</code> obtained controller that minimized the \(\mathcal{H}_\infty\) norm from \(w\) to \(z\)</li>
</ul>
</div>
</div>
<div id="outline-container-org822d770" class="outline-3">
<h3 id="org822d770"><span class="section-number-3">3.5</span> From a Classical Feedback Architecture to a Generalized Plant</h3>
<div class="outline-text-3" id="text-3-5">
<p>
<a id="orga9839ce"></a>
</p>
<p>
The procedure to convert a typical control architecture as the one shown in Figure <a href="#orgb770b94">15</a> to a generalized Plant is as follows:
</p>
<ol class="org-ol">
<li>Define signals (\(w\), \(z\), \(u\) and \(v\)) of the generalized plant</li>
<li>Remove \(K\) and rearrange the inputs and outputs to match the generalized configuration shown in Figure <a href="#orga8dfa5c">13</a></li>
</ol>
<div class="exercice" id="org7736562">
<ol class="org-ol">
<li>Convert the tracking control architecture shown in Figure <a href="#orgb770b94">15</a> to a generalized configuration</li>
<li>Compute the transfer function matrix using Matlab as a function or \(K\) and \(G\)</li>
</ol>
<div id="orgb770b94" class="figure">
<p><img src="figs/classical_feedback_tracking.png" alt="classical_feedback_tracking.png" />
</p>
<p><span class="figure-number">Figure 15: </span>Classical Feedback Control Architecture (Tracking)</p>
</div>
<details><summary>Hint</summary>
<p>
First, define the signals of the generalized plant:
</p>
<ul class="org-ul">
<li>Exogenous inputs: \(w = r\)</li>
<li>Signals to be minimized:
Usually, we want to minimize the tracking errors \(\epsilon\) and the control signal \(u\): \(z = [\epsilon,\ u]\)</li>
<li>Controller inputs: this is the signal at the input of the controller: \(v = \epsilon\)</li>
<li>Control inputs: signal generated by the controller: \(u\)</li>
</ul>
<p>
Then, Remove \(K\) and rearrange the inputs and outputs as in Figure <a href="#orga8dfa5c">13</a>.
</p>
</details>
<details><summary>Answer</summary>
<p>
The obtained generalized plant shown in Figure <a href="#orgeae5848">16</a>.
</p>
<div id="orgeae5848" class="figure">
<p><img src="figs/mixed_sensitivity_ref_tracking.png" alt="mixed_sensitivity_ref_tracking.png" />
</p>
<p><span class="figure-number">Figure 16: </span>Generalized plant of the Classical Feedback Control Architecture (Tracking)</p>
</div>
<p>
Using Matlab, the generalized plant can be defined as follows:
</p>
<div class="org-src-container">
<pre class="src src-matlab">P = [1 <span class="org-type">-</span>G;
0 1;
1 <span class="org-type">-</span>G]
P.InputName = {<span class="org-string">'w'</span>, <span class="org-string">'u'</span>};
P.OutputName = {<span class="org-string">'e'</span>, <span class="org-string">'u'</span>, <span class="org-string">'v'</span>};
</pre>
</div>
</details>
</div>
</div>
</div>
</div>
<div id="outline-container-orgba30a55" class="outline-2">
<h2 id="orgba30a55"><span class="section-number-2">4</span> Modern Interpretation of Control Specifications</h2>
<div class="outline-text-2" id="text-4">
<p>
<a id="orgb088aa1"></a>
</p>
<ul class="org-ul">
<li>Section <a href="#org62393f7">4.1</a></li>
<li>Section <a href="#org031eafd">4.2</a></li>
<li>Section <a href="#org48eee4f">4.3</a></li>
<li>Section <a href="#org58a8ffb">4.4</a></li>
</ul>
<p>
As shown in Section <a href="#org2b3b18e">2</a>, 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 <i>linearly</i> 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)\).
</p>
<p>
However, the loop gain \(L(s)\) does <b>not</b> directly give the performances of the closed-loop system, which are determined by the <b>closed-loop</b> transfer functions.
</p>
<p>
If we consider the feedback system shown in Figure <a href="#org3b8b88c">17</a>, we can link to the following specifications to closed-loop transfer functions.
This is summarized in Table <a href="#org0b03397">5</a>.
</p>
<table id="org0b03397" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption class="t-above"><span class="table-number">Table 5:</span> Typical Specification and associated closed-loop transfer function</caption>
<colgroup>
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">Specification</th>
<th scope="col" class="org-left">Closed-Loop Transfer Function</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">Reference Tracking</td>
<td class="org-left">From \(r\) to \(\epsilon\)</td>
</tr>
<tr>
<td class="org-left">Disturbance Rejection</td>
<td class="org-left">From \(d\) to \(y\)</td>
</tr>
<tr>
<td class="org-left">Measurement Noise Filtering</td>
<td class="org-left">From \(n\) to \(y\)</td>
</tr>
<tr>
<td class="org-left">Small Command Amplitude</td>
<td class="org-left">From \(n,r,d\) to \(u\)</td>
</tr>
<tr>
<td class="org-left">Stability</td>
<td class="org-left">All closed-loop transfer function</td>
</tr>
<tr>
<td class="org-left">Robustness (stability margins)</td>
<td class="org-left">Module margin (see Section <a href="#org48eee4f">4.3</a>)</td>
</tr>
</tbody>
</table>
<div id="org3b8b88c" class="figure">
<p><img src="figs/gang_of_four_feedback.png" alt="gang_of_four_feedback.png" />
</p>
<p><span class="figure-number">Figure 17: </span>Simple Feedback Architecture</p>
</div>
</div>
<div id="outline-container-orgb5fba6b" class="outline-3">
<h3 id="orgb5fba6b"><span class="section-number-3">4.1</span> Closed Loop Transfer Functions</h3>
<div class="outline-text-3" id="text-4-1">
<p>
<a id="org62393f7"></a>
</p>
<p>
As the performances of a controlled system depend on the <b>closed</b> loop transfer functions, it is very important to derive these closed-loop transfer functions as a function of the plant \(G(s)\) and controller \(K(s)\).
</p>
<div class="exercice" id="org487a8a6">
<p>
Write the output signals \([\epsilon, u, y]\) as a function of the systems \(K(s), G(s)\) and of the input signals \([r, d, n]\) as shown in Figure <a href="#org3b8b88c">17</a>.
</p>
<details><summary>Hint</summary>
<p>
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:
</p>
\begin{aligned}
y &= G u \\
&= G (d + K \epsilon) \\
&= G \big(d + K (r - n - y) \big) \\
&= G d + GK r - GK n - GK y
\end{aligned}
<p>
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 \]
</p>
<p>
Do the same procedure for \(u\) and \(\epsilon\)
</p>
</details>
<details><summary>Answer</summary>
<p>
The following equations should be obtained:
</p>
\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" id="org608c9e5">
<p>
We can see that they are 4 different transfer functions describing the behavior of the system in Figure <a href="#org3b8b88c">17</a>.
These called the <b>Gang of Four</b>:
</p>
\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" id="orgb7ed2ba">
<p>
If a feedforward controller is included, a <b>Gang of Six</b> transfer functions can be defined.
More on that in this <a href="https://www.youtube.com/watch?v=b_8v8scghh8">short video</a>.
</p>
</div>
<p>
And we have:
</p>
\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}
<p>
Thus, for reference tracking, we have to shape the <i>closed-loop</i> 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)\).
</p>
</div>
</div>
<div id="outline-container-orgfccb95f" class="outline-3">
<h3 id="orgfccb95f"><span class="section-number-3">4.2</span> Sensitivity Function</h3>
<div class="outline-text-3" id="text-4-2">
<p>
<a id="org031eafd"></a>
</p>
<p>
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.
</p>
<p>
Suppose we have developed a &ldquo;<i>reference</i>&rdquo; controller \(K_r(s)\) and made three small changes to obtained three controllers \(K_1(s)\), \(K_2(s)\) and \(K_3(s)\).
The obtained sensitivity functions are shown in Figure <a href="#orge015436">18</a> and the corresponding step responses are shown in Figure <a href="#orgf89947c">19</a>.
</p>
<p>
The comparison of the sensitivity functions shapes and their effect on the step response is summarized in Table <a href="#org4e8e9ce">6</a>.
</p>
<table id="org4e8e9ce" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption class="t-above"><span class="table-number">Table 6:</span> Comparison of the sensitivity function shape and the corresponding step response for the three controller variations</caption>
<colgroup>
<col class="org-left" />
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">Controller</th>
<th scope="col" class="org-left">Sensitivity Function Shape</th>
<th scope="col" class="org-left">Change of the Step Response</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">\(K_1(s)\)</td>
<td class="org-left">Larger bandwidth \(\omega_b\)</td>
<td class="org-left">Faster rise time</td>
</tr>
<tr>
<td class="org-left">\(K_2(s)\)</td>
<td class="org-left">Larger peak value \(\Vert S\Vert_\infty\)</td>
<td class="org-left">Large overshoot and oscillations</td>
</tr>
<tr>
<td class="org-left">\(K_3(s)\)</td>
<td class="org-left">Larger low frequency gain \(\vert S(j\cdot 0)\vert\)</td>
<td class="org-left">Larger static error</td>
</tr>
</tbody>
</table>
<div id="orge015436" class="figure">
<p><img src="figs/sensitivity_shape_effect.png" alt="sensitivity_shape_effect.png" />
</p>
<p><span class="figure-number">Figure 18: </span>Sensitivity function magnitude \(|S(j\omega)|\) corresponding to the reference controller \(K_r(s)\) and the three modified controllers \(K_i(s)\)</p>
</div>
<div id="orgf89947c" class="figure">
<p><img src="figs/sensitivity_shape_effect_step.png" alt="sensitivity_shape_effect_step.png" />
</p>
<p><span class="figure-number">Figure 19: </span>Step response (response from \(r\) to \(y\)) for the different controllers</p>
</div>
<div class="definition" id="org1ac5204">
<dl class="org-dl">
<dt>Closed-Loop Bandwidth</dt><dd><p>
The closed-loop bandwidth \(\omega_b\) is the frequency where \(|S(j\omega)|\) first crosses \(1/\sqrt{2} = -3dB\) from below.
</p>
<p>
In general, a large bandwidth corresponds to a faster rise time.
</p></dd>
</dl>
</div>
<div class="important" id="org3d8422a">
<p>
From the simple analysis above, we can draw a first estimation of the wanted shape for the sensitivity function in Figure <a href="#org8b71a00">20</a>.
</p>
<p>
The wanted characteristics on the magnitude of the sensitivity function are then:
</p>
<ul class="org-ul">
<li>A small magnitude at low frequency to make the static errors small</li>
<li>A wanted minimum closed-loop bandwidth in order to have fast rise time and good rejection of perturbations</li>
<li>A small peak value in order to limit large overshoot and oscillations.
This generally means higher robustness.
This will become clear in the next section about the <b>module margin</b>.</li>
</ul>
<div id="org8b71a00" class="figure">
<p><img src="figs/h-infinity-spec-S.png" alt="h-infinity-spec-S.png" />
</p>
<p><span class="figure-number">Figure 20: </span>Typical wanted shape of the Sensitivity transfer function</p>
</div>
</div>
</div>
</div>
<div id="outline-container-org3a7b849" class="outline-3">
<h3 id="org3a7b849"><span class="section-number-3">4.3</span> Robustness: Module Margin</h3>
<div class="outline-text-3" id="text-4-3">
<p>
<a id="org48eee4f"></a>
</p>
<p>
Let&rsquo;s start by an example demonstrating why the phase and gain margins might not be good indicators of robustness.
</p>
<div class="exampl" id="org45b1a22">
<p>
Let&rsquo;s consider the following plant \(G_t(s)\):
</p>
<div class="org-src-container">
<pre class="src src-matlab">w0 = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>100;
xi = 0.1;
k = 1e7;
Gt = 1<span class="org-type">/</span>k<span class="org-type">*</span>(s<span class="org-type">/</span>w0<span class="org-type">/</span>4 <span class="org-type">+</span> 1)<span class="org-type">/</span>(s<span class="org-type">^</span>2<span class="org-type">/</span>w0<span class="org-type">^</span>2 <span class="org-type">+</span> 2<span class="org-type">*</span>xi<span class="org-type">*</span>s<span class="org-type">/</span>w0 <span class="org-type">+</span> 1);
</pre>
</div>
<p>
Let&rsquo;s say we have designed a controller \(K_t(s)\) that gives the loop gain shown in Figure <a href="#org1442363">21</a>.
</p>
<div class="org-src-container">
<pre class="src src-matlab">Kt = 1.2e6<span class="org-type">*</span>(s <span class="org-type">+</span> w0)<span class="org-type">/</span>s;
</pre>
</div>
<p>
The following characteristics can be determined from Figure <a href="#org1442363">21</a>:
</p>
<ul class="org-ul">
<li>bandwidth of \(\approx 10\, \text{Hz}\)</li>
<li>infinite gain margin (the phase of the loop-gain never reaches -180 degrees</li>
<li>more than 90 degrees of phase margin</li>
</ul>
<p>
This might indicate very good robustness properties of the closed-loop system.
</p>
<div id="org1442363" class="figure">
<p><img src="figs/phase_gain_margin_model_plant.png" alt="phase_gain_margin_model_plant.png" />
</p>
<p><span class="figure-number">Figure 21: </span>Bode plot of the obtained Loop Gain \(L(s)\)</p>
</div>
<p>
Now let&rsquo;s suppose the &ldquo;real&rdquo; plant \(G_r(s)\) as a slightly lower damping factor:
</p>
<div class="org-src-container">
<pre class="src src-matlab">xi = 0.03;
</pre>
</div>
<p>
The obtained &ldquo;real&rdquo; loop gain is shown in Figure <a href="#org85d0b3c">22</a>.
At a frequency little bit above 100Hz, the phase of the loop gain reaches -180 degrees while its magnitude is more than one which indicated instability.
</p>
<p>
It is confirmed by checking the stability of the closed loop system:
</p>
<div class="org-src-container">
<pre class="src src-matlab">isstable(feedback(Gr,K))
</pre>
</div>
<pre class="example">
0
</pre>
<div id="org85d0b3c" class="figure">
<p><img src="figs/phase_gain_margin_real_plant.png" alt="phase_gain_margin_real_plant.png" />
</p>
<p><span class="figure-number">Figure 22: </span>Bode plots of \(L(s)\) (loop gain corresponding the nominal plant) and \(L_r(s)\) (loop gain corresponding to the real plant)</p>
</div>
<p>
Therefore, even a small change of the plant parameter makes the system unstable even though both the gain margin and the phase margin for the nominal plant are excellent.
</p>
<p>
This is due to the fact that the gain and phase margin are robustness indicators for a <b>pure</b> change or gain or a <b>pure</b> change of phase but not a combination of both.
</p>
</div>
<p>
Let&rsquo;s now determine a new robustness indicator based on the Nyquist Stability Criteria.
</p>
<div class="definition" id="org4f95cb7">
<dl class="org-dl">
<dt>Nyquist Stability Criteria (for stable systems)</dt><dd>If the open-loop transfer function \(L(s)\) is stable, then the closed-loop system is unstable for any encirclement of the point \(1\) on the Nyquist plot.</dd>
<dt>Nyquist Plot</dt><dd>The Nyquist plot shows the evolution of \(L(j\omega)\) in the complex plane from \(\omega = 0 \to \infty\).</dd>
</dl>
</div>
<div class="seealso" id="org3426c8f">
<p>
For more information about the <i>general</i> Nyquist Stability Criteria, you may want to look at <a href="https://www.youtube.com/watch?v=sof3meN96MA">this</a> video.
</p>
</div>
<p>
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 <i>unstable point</i>) in the complex plane.
This minimum distance is called the <b>module margin</b>.
</p>
<div class="definition" id="orga17372e">
<dl class="org-dl">
<dt>Module Margin</dt><dd>The Module Margin \(\Delta M\) is defined as the <b>minimum distance</b> between the point \(-1\) and the loop gain \(L(j\omega)\) in the complex plane.</dd>
</dl>
</div>
<div class="exampl" id="org66221fa">
<p>
A typical Nyquist plot is shown in Figure <a href="#org11a616e">23</a>.
The gain, phase and module margins are graphically shown to have an idea of what they represent.
</p>
<div id="org11a616e" class="figure">
<p><img src="figs/module_margin_example.png" alt="module_margin_example.png" />
</p>
<p><span class="figure-number">Figure 23: </span>Nyquist plot with visual indication of the Gain margin \(\Delta G\), Phase margin \(\Delta \phi\) and Module margin \(\Delta M\)</p>
</div>
</div>
<p>
As expected from Figure <a href="#org11a616e">23</a>, 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:
</p>
\begin{equation}
\Delta G \ge \frac{\Delta M}{\Delta M - 1}; \quad \Delta \phi \ge \frac{1}{\Delta M}
\end{equation}
<p>
Let&rsquo;s now try to express the Module margin \(\Delta M\) as an \(\mathcal{H}_\infty\) norm of a closed-loop transfer function:
</p>
\begin{align*}
\Delta M &= \text{minimum distance between } L(j\omega) \text{ and point } (-1) \\
&= \min_\omega |L(j\omega) - (-1)| \\
&= \min_\omega |1 + L(j\omega)| \\
&= \frac{1}{\max_\omega \frac{1}{|1 + L(j\omega)|}} \\
&= \frac{1}{\|S\|_\infty}
\end{align*}
<div class="important" id="org84495d5">
<p>
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.
</p>
\begin{equation}
\Delta M = \frac{1}{\|S\|_\infty} \label{eq:module_margin_S}
\end{equation}
<p>
The wanted robustness of the closed-loop system can be specified by setting a maximum value on \(\|S\|_\infty\).
</p>
</div>
<p>
Note that this is why large peak value of \(|S(j\omega)|\) usually indicate robustness problems.
And we know understand why setting an upper bound on the magnitude of \(S\) is generally a good idea.
</p>
<div class="exampl" id="org0a89e20">
<p>
Typical, we require \(\|S\|_\infty < 2 (6dB)\) which implies \(\Delta G \ge 2\) and \(\Delta \phi \ge 29^o\)
</p>
</div>
<div class="seealso" id="org416271e">
<p>
To learn more about module/disk margin, you can check out <a href="https://www.youtube.com/watch?v=XazdN6eZF80">this</a> video.
</p>
</div>
</div>
</div>
<div id="outline-container-orgd23fc15" class="outline-3">
<h3 id="orgd23fc15"><span class="section-number-3">4.4</span> Other Requirements</h3>
<div class="outline-text-3" id="text-4-4">
<p>
<a id="org58a8ffb"></a>
</p>
<p>
Interpretation of the \(\mathcal{H}_\infty\) norm of systems:
</p>
<ul class="org-ul">
<li>frequency by frequency attenuation / amplification</li>
</ul>
<p>
Let&rsquo;s note \(G_t(s)\) the closed-loop transfer function from \(w\) to \(z\).
</p>
<p>
Consider an input sinusoidal signal \(w(t) = \sin\left( \omega_0 t \right)\), then the output signal \(z(t)\) will be equal to:
\[ z(t) = A \sin\left( \omega_0 t + \phi \right) \]
with:
</p>
<ul class="org-ul">
<li>\(A = |G_t(j\omega_0)|\) is the magnitude of \(G_t(s)\) at \(\omega_0\)</li>
<li>\(\phi = \angle G_t(j\omega_0)\) is the phase of \(G_t(s)\) at \(\omega_0\)</li>
</ul>
<p>
Noise Attenuation: typical wanted shape for \(T\)
</p>
<table id="org298b4d4" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption class="t-above"><span class="table-number">Table 7:</span> Typical Specifications and corresponding wanted norms of open and closed loop tansfer functions</caption>
<colgroup>
<col class="org-left" />
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">&#xa0;</th>
<th scope="col" class="org-left">Open-Loop Shaping</th>
<th scope="col" class="org-left">Closed-Loop Shaping</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">Reference Tracking</td>
<td class="org-left">\(L\) large</td>
<td class="org-left">\(S\) small</td>
</tr>
<tr>
<td class="org-left">Disturbance Rejection</td>
<td class="org-left">\(L\) large</td>
<td class="org-left">\(GS\) small</td>
</tr>
<tr>
<td class="org-left">Measurement Noise Filtering</td>
<td class="org-left">\(L\) small</td>
<td class="org-left">\(T\) small</td>
</tr>
<tr>
<td class="org-left">Small Command Amplitude</td>
<td class="org-left">\(K\) and \(L\) small</td>
<td class="org-left">\(KS\) small</td>
</tr>
<tr>
<td class="org-left">Robustness</td>
<td class="org-left">Phase/Gain margins</td>
<td class="org-left">Module margin: \(\Vert S\Vert_\infty\) small</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="outline-container-org7a2a83d" class="outline-2">
<h2 id="org7a2a83d"><span class="section-number-2">5</span> \(\mathcal{H}_\infty\) Shaping of closed-loop transfer functions</h2>
<div class="outline-text-2" id="text-5">
<p>
<a id="orge201bfd"></a>
</p>
<p>
In the previous sections, we have seen that the performances of the system depends on the <b>shape</b> of the closed-loop transfer function.
</p>
<p>
Therefore, the synthesis problem is to design \(K(s)\) such that closed-loop system is stable and such that various closed-loop transfer functions such as \(S\), \(KS\) and \(T\) are shaped as wanted.
This is clearly not simple as these closed-loop transfer functions does not depend linearly on \(K\).
</p>
<p>
But don&rsquo;t worry, the \(\mathcal{H}_\infty\) synthesis will do this job for us!
</p>
<p>
This
Section <a href="#org01843d4">5.1</a>
Section <a href="#orgb646bda">5.2</a>
Section <a href="#org0a34d87">5.3</a>
Section <a href="#org32ad878">5.4</a>
</p>
</div>
<div id="outline-container-org41e6177" class="outline-3">
<h3 id="org41e6177"><span class="section-number-3">5.1</span> How to Shape closed-loop transfer function? Using Weighting Functions!</h3>
<div class="outline-text-3" id="text-5-1">
<p>
<a id="org01843d4"></a>
</p>
<p>
If the \(\mathcal{H}_\infty\) synthesis is applied on the generalized plant \(P(s)\) shown in Figure <a href="#org2ce660a">24</a>, it will generate a controller \(K(s)\) such that the \(\mathcal{H}_\infty\) norm of closed-loop transfer function from \(r\) to \(\epsilon\) is minimized.
This closed-loop transfer function actually correspond to the sensitivity function.
Therefore, it will minimize the the \(\mathcal{H}_\infty\) norm of the sensitivity function: \(\|S\|_\infty\).
</p>
<p>
However, as the \(\mathcal{H}_\infty\) norm is the maximum peak value of the transfer function&rsquo;s magnitude, this synthesis is quite useless and clearly does not allow to <b>shape</b> the norm of \(S(j\omega)\) over all frequencies.
</p>
<div id="org2ce660a" class="figure">
<p><img src="figs/loop_shaping_S_without_W.png" alt="loop_shaping_S_without_W.png" />
</p>
<p><span class="figure-number">Figure 24: </span>Generalized Plant</p>
</div>
<div class="important" id="org39128d0">
<p>
The <i>trick</i> is to include a <b>weighting function</b> \(W_S(s)\) in the generalized plant as shown in Figure <a href="#org4b7c49f">25</a>.
</p>
<p>
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 <i>weighted</i> generalized plant \(\tilde{P}(s)\) will generate a controller \(K(s)\) such that \(\|W_s(s)S(s)\|_\infty\) is minimized.
</p>
</div>
<p>
Let&rsquo;s now show how this is equivalent as <b>shaping</b> the sensitivity function:
</p>
\begin{align}
& \left\| W_s(s) S(s) \right\|_\infty < 1\nonumber \\
\Leftrightarrow & \left| W_s(j\omega) S(j\omega) \right| < 1 \quad \forall \omega\nonumber \\
\Leftrightarrow & \left| S(j\omega) \right| < \frac{1}{\left| W_s(j\omega) \right|} \quad \forall \omega \label{eq:sensitivity_shaping}
\end{align}
<div class="important" id="orgb1eb251">
<p>
As shown in Equation \eqref{eq:sensitivity_shaping}, the \(\mathcal{H}_\infty\) synthesis applying on the <i>weighted</i> generalized plant allows to <b>shape</b> the magnitude of the sensitivity transfer function.
</p>
<p>
Therefore, the choice of the weighting function \(W_s(s)\) is very important: its inverse magnitude will define the wanted <b>upper bound</b> of the sensitivity function magnitude.
</p>
</div>
<div id="org4b7c49f" class="figure">
<p><img src="figs/loop_shaping_S_with_W.png" alt="loop_shaping_S_with_W.png" />
</p>
<p><span class="figure-number">Figure 25: </span>Weighted Generalized Plant</p>
</div>
<div class="exercice" id="org7d46e53">
<p>
Using matlab, compute the weighted generalized plant shown in Figure <a href="#org0dd0c0f">26</a> as a function of \(G(s)\) and \(W_S(s)\).
</p>
<details><summary>Hint</summary>
<p>
The weighted generalized plant can be defined in Matlab using two techniques:
</p>
<ul class="org-ul">
<li>by writing manually the 4 transfer functions from \([w, u]\) to \([\tilde{\epsilon}, v]\)</li>
<li>by pre-multiplying the (non-weighted) generalized plant by a block-diagonal transfer function matrix containing the weights for the outputs \(z\) and <code>1</code> for the outputs \(v\)</li>
</ul>
</details>
<details><summary>Answer</summary>
<p>
The two solutions below can be used.
</p>
<div class="org-src-container">
<pre class="src src-matlab">Pw = [Ws <span class="org-type">-</span>Ws<span class="org-type">*</span>G;
1 <span class="org-type">-</span>G];
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">Pw = blkdiag(Ws, 1)<span class="org-type">*</span>P;
</pre>
</div>
<p>
The second solution is however more general, and can also be used when weights are added at the inputs by post-multiplying instead of pre-multiplying.
</p>
</details>
</div>
</div>
</div>
<div id="outline-container-org48b9767" class="outline-3">
<h3 id="org48b9767"><span class="section-number-3">5.2</span> Design of Weighting Functions</h3>
<div class="outline-text-3" id="text-5-2">
<p>
<a id="orgb646bda"></a>
</p>
<p>
Weighting function included in the generalized plant must be <b>proper</b>, <b>stable</b> and <b>minimum phase</b> transfer functions.
</p>
<div class="definition" id="org3518a83">
<dl class="org-dl">
<dt>proper</dt><dd>more poles than zeros, this implies \(\lim_{\omega \to \infty} |W(j\omega)| < \infty\)</dd>
<dt>stable</dt><dd>no poles in the right half plane</dd>
<dt>minimum phase</dt><dd>no zeros in the right half plane</dd>
</dl>
</div>
<p>
Matlab is providing the <code>makeweight</code> function that allows to design first-order weights by specifying the low frequency gain, high frequency gain, and the gain at a specific frequency:
</p>
<div class="org-src-container">
<pre class="src src-matlab">W = makeweight(dcgain,[freq,mag],hfgain)
</pre>
</div>
<p>
with:
</p>
<ul class="org-ul">
<li><code>dcgain</code>: low frequency gain</li>
<li><code>[freq,mag]</code>: frequency <code>freq</code> at which the gain is <code>mag</code></li>
<li><code>hfgain</code>: high frequency gain</li>
</ul>
<div class="exampl" id="org7ac321e">
<p>
The Matlab code below produces a weighting function with the following characteristics (Figure <a href="#org0dd0c0f">26</a>):
</p>
<ul class="org-ul">
<li>Low frequency gain of 100</li>
<li>Gain of 1 at 10Hz</li>
<li>High frequency gain of 0.5</li>
</ul>
<div class="org-src-container">
<pre class="src src-matlab">Ws = makeweight(1e2, [2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>10, 1], 1<span class="org-type">/</span>2);
</pre>
</div>
<div id="org0dd0c0f" class="figure">
<p><img src="figs/first_order_weight.png" alt="first_order_weight.png" />
</p>
<p><span class="figure-number">Figure 26: </span>Obtained Magnitude of the Weighting Function</p>
</div>
</div>
<div class="seealso" id="org9e665ab">
<p>
Quite often, higher orders weights are required.
</p>
<p>
In such case, the following formula can be used:
</p>
\begin{equation}
W(s) = \left( \frac{
\frac{1}{\omega_0} \sqrt{\frac{1 - \left(\frac{G_0}{G_c}\right)^{\frac{2}{n}}}{1 - \left(\frac{G_c}{G_\infty}\right)^{\frac{2}{n}}}} s + \left(\frac{G_0}{G_c}\right)^{\frac{1}{n}}
}{
\left(\frac{1}{G_\infty}\right)^{\frac{1}{n}} \frac{1}{\omega_0} \sqrt{\frac{1 - \left(\frac{G_0}{G_c}\right)^{\frac{2}{n}}}{1 - \left(\frac{G_c}{G_\infty}\right)^{\frac{2}{n}}}} s + \left(\frac{1}{G_c}\right)^{\frac{1}{n}}
}\right)^n \label{eq:weight_formula_advanced}
\end{equation}
<p>
The parameters permit to specify:
</p>
<ul class="org-ul">
<li>the low frequency gain: \(G_0 = lim_{\omega \to 0} |W(j\omega)|\)</li>
<li>the high frequency gain: \(G_\infty = lim_{\omega \to \infty} |W(j\omega)|\)</li>
<li>the absolute gain at \(\omega_0\): \(G_c = |W(j\omega_0)|\)</li>
<li>the absolute slope between high and low frequency: \(n\)</li>
</ul>
<p>
A Matlab function implementing Equation \eqref{eq:weight_formula_advanced} is shown below:
</p>
<div class="org-src-container">
<label class="org-src-name"><span class="listing-number">Listing 1: </span>Matlab Function that can be used to generate Weighting functions</label><pre class="src src-matlab" id="org286a722"><span class="org-keyword">function</span> <span class="org-variable-name">[W]</span> = <span class="org-function-name">generateWeight</span>(<span class="org-variable-name">args</span>)
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<span class="org-type">*</span><span class="org-constant">pi</span>
args.n (1,1) double {mustBeInteger, mustBePositive} = 1
<span class="org-keyword">end</span>
<span class="org-keyword">if</span> (args.Gc <span class="org-type">&lt;=</span> args.G0 <span class="org-type">&amp;&amp;</span> args.Gc <span class="org-type">&lt;=</span> args.G1) <span class="org-type">||</span> (args.Gc <span class="org-type">&gt;=</span> args.G0 <span class="org-type">&amp;&amp;</span> args.Gc <span class="org-type">&gt;=</span> args.G1)
eid = <span class="org-string">'value:range'</span>;
msg = <span class="org-string">'Gc must be between G0 and G1'</span>;
throwAsCaller(MException(eid,msg))
<span class="org-keyword">end</span>
s = zpk(<span class="org-string">'s'</span>);
W = (((1<span class="org-type">/</span>args.wc)<span class="org-type">*</span>sqrt((1<span class="org-type">-</span>(args.G0<span class="org-type">/</span>args.Gc)<span class="org-type">^</span>(2<span class="org-type">/</span>args.n))<span class="org-type">/</span>(1<span class="org-type">-</span>(args.Gc<span class="org-type">/</span>args.G1)<span class="org-type">^</span>(2<span class="org-type">/</span>args.n)))<span class="org-type">*</span>s <span class="org-type">+</span> (args.G0<span class="org-type">/</span>args.Gc)<span class="org-type">^</span>(1<span class="org-type">/</span>args.n))<span class="org-type">/</span>((1<span class="org-type">/</span>args.G1)<span class="org-type">^</span>(1<span class="org-type">/</span>args.n)<span class="org-type">*</span>(1<span class="org-type">/</span>args.wc)<span class="org-type">*</span>sqrt((1<span class="org-type">-</span>(args.G0<span class="org-type">/</span>args.Gc)<span class="org-type">^</span>(2<span class="org-type">/</span>args.n))<span class="org-type">/</span>(1<span class="org-type">-</span>(args.Gc<span class="org-type">/</span>args.G1)<span class="org-type">^</span>(2<span class="org-type">/</span>args.n)))<span class="org-type">*</span>s <span class="org-type">+</span> (1<span class="org-type">/</span>args.Gc)<span class="org-type">^</span>(1<span class="org-type">/</span>args.n)))<span class="org-type">^</span>args.n;
<span class="org-keyword">end</span>
</pre>
</div>
<p>
Let&rsquo;s use this function to generate three weights with the same high and low frequency gains, but but different slopes.
</p>
<div class="org-src-container">
<pre class="src src-matlab">W1 = generateWeight(<span class="org-string">'G0'</span>, 1e2, <span class="org-string">'G1'</span>, 1<span class="org-type">/</span>2, <span class="org-string">'Gc'</span>, 1, <span class="org-string">'wc'</span>, 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>10, <span class="org-string">'n'</span>, 1);
W2 = generateWeight(<span class="org-string">'G0'</span>, 1e2, <span class="org-string">'G1'</span>, 1<span class="org-type">/</span>2, <span class="org-string">'Gc'</span>, 1, <span class="org-string">'wc'</span>, 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>10, <span class="org-string">'n'</span>, 2);
W3 = generateWeight(<span class="org-string">'G0'</span>, 1e2, <span class="org-string">'G1'</span>, 1<span class="org-type">/</span>2, <span class="org-string">'Gc'</span>, 1, <span class="org-string">'wc'</span>, 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>10, <span class="org-string">'n'</span>, 3);
</pre>
</div>
<p>
The obtained shapes are shown in Figure <a href="#org0b8a200">27</a>.
</p>
<div id="org0b8a200" class="figure">
<p><img src="figs/high_order_weight.png" alt="high_order_weight.png" />
</p>
<p><span class="figure-number">Figure 27: </span>Higher order weights using Equation \eqref{eq:weight_formula_advanced}</p>
</div>
</div>
</div>
</div>
<div id="outline-container-org00bea7c" class="outline-3">
<h3 id="org00bea7c"><span class="section-number-3">5.3</span> Shaping the Sensitivity Function</h3>
<div class="outline-text-3" id="text-5-3">
<p>
<a id="org0a34d87"></a>
</p>
<p>
Let&rsquo;s design a controller using the \(\mathcal{H}_\infty\) synthesis that fulfils the following requirements:
</p>
<ol class="org-ol">
<li>Bandwidth of at least 10Hz</li>
<li>Small static errors for step responses</li>
<li>Robustness: Large module margin \(\Delta M > 0.5\) (\(\Rightarrow \Delta G > 2\) and \(\Delta \phi > 29^o\))</li>
</ol>
<p>
As usual, the plant used is the one presented in Section <a href="#orga75776c">1.3</a>.
</p>
<div class="exercice" id="orga0248cc">
<p>
Translate the requirements as upper bounds on the Sensitivity function and design the corresponding Weight using Matlab.
</p>
<details><summary>Hint</summary>
<p>
The typical wanted upper bound of the sensitivity function is shown in Figure <a href="#orgb9e3a64">28</a>.
</p>
<p>
More precisely:
</p>
<ol class="org-ol">
<li>Recall that the closed-loop bandwidth is defined as the frequency \(|S(j\omega)|\) first crosses \(1/\sqrt{2} = -3dB\) from below</li>
<li>For the small static error, -60dB is usually enough as other factors (measurement noise, disturbances) will anyhow limit the performances</li>
<li>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} \]</li>
</ol>
<p>
Remember that the wanted upper bound of the sensitivity function is defined by the <b>inverse</b> magnitude of the weight.
</p>
<div id="orgb9e3a64" class="figure">
<p><img src="figs/h-infinity-spec-S.png" alt="h-infinity-spec-S.png" />
</p>
<p><span class="figure-number">Figure 28: </span>Typical wanted shape of the Sensitivity transfer function</p>
</div>
</details>
<details><summary>Answer</summary>
<ol class="org-ol">
<li>\(|W_s(j \cdot 2 \pi 10)| = \sqrt{2}\)</li>
<li>\(|W_s(j \cdot 0)| = 10^3\)</li>
<li>\(\|W_s\|_\infty = 0.5\)</li>
</ol>
<p>
Using Matlab, such weighting function can be generated using the <code>makeweight</code> function as shown below:
</p>
<div class="org-src-container">
<pre class="src src-matlab">Ws = makeweight(1e3, [2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>10, sqrt(2)], 1<span class="org-type">/</span>2);
</pre>
</div>
<p>
Or using the <code>generateWeight</code> function:
</p>
<div class="org-src-container">
<pre class="src src-matlab">Ws = generateWeight(<span class="org-string">'G0'</span>, 1e3, ...
<span class="org-string">'G1'</span>, 1<span class="org-type">/</span>2, ...
<span class="org-string">'Gc'</span>, sqrt(2), <span class="org-string">'wc'</span>, 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>10, ...
<span class="org-string">'n'</span>, 2);
</pre>
</div>
</details>
</div>
<p>
Let&rsquo;s say we came up with the following weighting function:
</p>
<div class="org-src-container">
<pre class="src src-matlab">Ws = generateWeight(<span class="org-string">'G0'</span>, 1e3, ...
<span class="org-string">'G1'</span>, 1<span class="org-type">/</span>2, ...
<span class="org-string">'Gc'</span>, sqrt(2), <span class="org-string">'wc'</span>, 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>10, ...
<span class="org-string">'n'</span>, 2);
</pre>
</div>
<p>
The weighting function is then added to the generalized plant.
</p>
<div class="org-src-container">
<pre class="src src-matlab">P = [1 <span class="org-type">-</span>G;
1 <span class="org-type">-</span>G];
Pw = blkdiag(Ws, 1)<span class="org-type">*</span>P;
</pre>
</div>
<p>
And the \(\mathcal{H}_\infty\) synthesis is performed on the <i>weighted</i> generalized plant.
</p>
<div class="org-src-container">
<pre class="src src-matlab">K = hinfsyn(Pw, 1, 1, <span class="org-string">'Display'</span>, <span class="org-string">'on'</span>);
</pre>
</div>
<pre class="example" id="org81ed00f">
Test bounds: 0.5 &lt;= gamma &lt;= 0.51
gamma X&gt;=0 Y&gt;=0 rho(XY)&lt;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
</pre>
<p>
\(\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:
</p>
\begin{aligned}
& \| W_s(s) S(s) \|_\infty \approx 0.5 \\
& \Leftrightarrow |S(j\omega)| < \frac{0.5}{|W_s(j\omega)|} \quad \forall \omega
\end{aligned}
<p>
This is indeed what we can see by comparing \(|S|\) and \(|W_S|\) in Figure <a href="#org4a1fd1a">29</a>.
</p>
<div class="important" id="org09b426c">
<p>
Having \(\gamma < 1\) means that the \(\mathcal{H}_\infty\) synthesis found a controller such that the specified closed-loop transfer functions are bellow the specified upper bounds.
</p>
<p>
Having \(\gamma\) slightly above one does not necessary means the obtained controller is not &ldquo;good&rdquo;.
It just means that at some frequency, one of the closed-loop transfer functions is above the specified upper bound by a factor \(\gamma\).
</p>
</div>
<div id="org4a1fd1a" class="figure">
<p><img src="figs/results_sensitivity_hinf.png" alt="results_sensitivity_hinf.png" />
</p>
<p><span class="figure-number">Figure 29: </span>Weighting function and obtained closed-loop sensitivity</p>
</div>
</div>
</div>
<div id="outline-container-org5953b0e" class="outline-3">
<h3 id="org5953b0e"><span class="section-number-3">5.4</span> Shaping multiple closed-loop transfer functions</h3>
<div class="outline-text-3" id="text-5-4">
<p>
<a id="org32ad878"></a>
</p>
<p>
As was shown in Section <a href="#orgb088aa1">4</a>, depending on the specifications, up to four closed-loop transfer function may be shaped (the Gang of four).
This was summarized in Table <a href="#org298b4d4">7</a>.
</p>
<p>
For instance to limit the control input \(u\), \(KS\) should be shaped while to filter measurement noise, \(T\) should be shaped.
</p>
<p>
When multiple closed-loop transfer function are shaped at the same time, it is refereed to as &ldquo;Mixed-Sensitivity \(\mathcal{H}_\infty\) Control&rdquo; and is the subject of Section <a href="#orgb0ce710">6</a>.
</p>
<p>
Depending on the closed-loop transfer function being shaped, different general control configuration are used and are described below.
</p>
<details><summary>Shaping of S and KS</summary>
<div id="org0e42d4c" class="figure">
<p><img src="figs/general_conf_shaping_S_KS.png" alt="general_conf_shaping_S_KS.png" />
</p>
<p><span class="figure-number">Figure 30: </span>Generalized Plant to shape \(S\) and \(KS\)</p>
</div>
<div class="org-src-container">
<label class="org-src-name"><span class="listing-number">Listing 2: </span>General Plant definition corresponding to Figure <a href="#org0e42d4c">30</a></label><pre class="src src-matlab" id="org65d94ea">P = [W1 <span class="org-type">-</span>G<span class="org-type">*</span>W1
0 W2
1 <span class="org-type">-</span>G];
</pre>
</div>
<ul class="org-ul">
<li>\(W_1(s)\) is used to shape \(S\)</li>
<li>\(W_2(s)\) is used to shape \(KS\)</li>
</ul>
</details>
<details><summary>Shaping of S and T</summary>
<div id="org05aace6" class="figure">
<p><img src="figs/general_conf_shaping_S_T.png" alt="general_conf_shaping_S_T.png" />
</p>
<p><span class="figure-number">Figure 31: </span>Generalized Plant to shape \(S\) and \(T\)</p>
</div>
<div class="org-src-container">
<label class="org-src-name"><span class="listing-number">Listing 3: </span>General Plant definition corresponding to Figure <a href="#org05aace6">31</a></label><pre class="src src-matlab" id="orgbf61789">P = [W1 <span class="org-type">-</span>G<span class="org-type">*</span>W1
0 G<span class="org-type">*</span>W2
1 <span class="org-type">-</span>G];
</pre>
</div>
<ul class="org-ul">
<li>\(W_1\) is used to shape \(S\)</li>
<li>\(W_2\) is used to shape \(T\)</li>
</ul>
</details>
<details><summary>Shaping of S and GS</summary>
<div id="org0b79570" class="figure">
<p><img src="figs/general_conf_shaping_S_GS.png" alt="general_conf_shaping_S_GS.png" />
</p>
<p><span class="figure-number">Figure 32: </span>Generalized Plant to shape \(S\) and \(GS\)</p>
</div>
<div class="org-src-container">
<label class="org-src-name"><span class="listing-number">Listing 4: </span>General Plant definition corresponding to Figure <a href="#org0b79570">32</a></label><pre class="src src-matlab" id="orgc317638">P = [W1 <span class="org-type">-</span>W1
G<span class="org-type">*</span>W2 <span class="org-type">-</span>G<span class="org-type">*</span>W2
G <span class="org-type">-</span>G];
</pre>
</div>
<ul class="org-ul">
<li>\(W_1\) is used to shape \(S\)</li>
<li>\(W_2\) is used to shape \(GS\)</li>
</ul>
</details>
<details><summary>Shaping of S, T and KS</summary>
<div id="org74761d9" class="figure">
<p><img src="figs/general_conf_shaping_S_T_KS.png" alt="general_conf_shaping_S_T_KS.png" />
</p>
<p><span class="figure-number">Figure 33: </span>Generalized Plant to shape \(S\), \(T\) and \(KS\)</p>
</div>
<div class="org-src-container">
<label class="org-src-name"><span class="listing-number">Listing 5: </span>General Plant definition corresponding to Figure <a href="#org74761d9">33</a></label><pre class="src src-matlab" id="orgbcec50a">P = [W1 <span class="org-type">-</span>G<span class="org-type">*</span>W1
0 W2
0 G<span class="org-type">*</span>W3
1 <span class="org-type">-</span>G];
</pre>
</div>
<ul class="org-ul">
<li>\(W_1\) is used to shape \(S\)</li>
<li>\(W_2\) is used to shape \(KS\)</li>
<li>\(W_3\) is used to shape \(T\)</li>
</ul>
</details>
<details><summary>Shaping of S, T and GS</summary>
<div id="org72a1c6c" class="figure">
<p><img src="figs/general_conf_shaping_S_T_GS.png" alt="general_conf_shaping_S_T_GS.png" />
</p>
<p><span class="figure-number">Figure 34: </span>Generalized Plant to shape \(S\), \(T\) and \(GS\)</p>
</div>
<div class="org-src-container">
<label class="org-src-name"><span class="listing-number">Listing 6: </span>General Plant definition corresponding to Figure <a href="#org72a1c6c">34</a></label><pre class="src src-matlab" id="org92a3e5d">P = [W1 <span class="org-type">-</span>W1
G<span class="org-type">*</span>W2 <span class="org-type">-</span>G<span class="org-type">*</span>W2
0 W3
G <span class="org-type">-</span>G];
</pre>
</div>
<ul class="org-ul">
<li>\(W_1\) is used to shape \(S\)</li>
<li>\(W_2\) is used to shape \(GS\)</li>
<li>\(W_3\) is used to shape \(T\)</li>
</ul>
</details>
<details><summary>Shaping of S, T, KS and GS</summary>
<div id="org053375d" class="figure">
<p><img src="figs/general_conf_shaping_S_T_KS_GS.png" alt="general_conf_shaping_S_T_KS_GS.png" />
</p>
<p><span class="figure-number">Figure 35: </span>Generalized Plant to shape \(S\), \(T\), \(KS\) and \(GS\)</p>
</div>
<div class="org-src-container">
<label class="org-src-name"><span class="listing-number">Listing 7: </span>General Plant definition corresponding to Figure <a href="#org053375d">35</a></label><pre class="src src-matlab" id="orgb33b0dc">P = [ W1 <span class="org-type">-</span>W1<span class="org-type">*</span>G<span class="org-type">*</span>W3 <span class="org-type">-</span>G<span class="org-type">*</span>W1
0 0 W2
1 <span class="org-type">-</span>G<span class="org-type">*</span>W3 <span class="org-type">-</span>G];
</pre>
</div>
<ul class="org-ul">
<li>\(W_1\) is used to shape \(S\)</li>
<li>\(W_2\) is used to shape \(KS\)</li>
<li>\(W_1W_3\) is used to shape \(GS\)</li>
<li>\(W_2W_3\) is used to shape \(T\)</li>
</ul>
</details>
<p>
When shaping multiple closed-loop transfer functions, one should be verify careful about the three following points that are further discussed:
</p>
<ul class="org-ul">
<li>The shaped closed-loop transfer functions are linked by mathematical relations and cannot be shaped</li>
<li>Closed-loop transfer function can only be shaped in certain frequency range.</li>
<li>The size of the obtained controller may be very large and not implementable in practice</li>
</ul>
<div class="warning" id="orgd60c6b6">
<p>
Mathematical relations are linking the closed-loop transfer functions.
For instance, the sensitivity function \(S(s)\) and the complementary sensitivity function \(T(s)\) as link by the following well known relation:
</p>
\begin{equation}
S(s) + T(s) = 1
\end{equation}
<p>
This means that \(|S(j\omega)|\) and \(|T(j\omega)|\) cannot be made small at the same time!
</p>
<p>
It is therefore <b>not</b> 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.
</p>
</div>
<p>
The control bandwidth is clearly limited by physical constrains such as sampling frequency, electronics bandwidth,
</p>
\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*}
<p>
Similar relationship can be found for \(T\), \(KS\) and \(GS\).
</p>
<div class="exercice" id="org1eea0f0">
<p>
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\)).
</p>
<details><summary>Hint</summary>
<p>
You can follows this procedure for \(T\), \(KS\) and \(GS\):
</p>
<ol class="org-ol">
<li>Write the closed-loop transfer function \(T(s)\) as a function of \(K(s)\) and \(G(s)\)</li>
<li>Take \(|K(j\omega)G(j\omega)| \gg 1\) and conclude on \(|T(j\omega)|\)</li>
<li>Take \(|K(j\omega)G(j\omega)| \ll 1\) and conclude on \(|T(j\omega)|\)</li>
</ol>
</details>
<details><summary>Answer</summary>
<p>
The obtained constrains are shown in Figure <a href="#org54a8a92">36</a>.
</p>
</details>
</div>
<p>
Depending on the frequency band, the norms of the closed-loop transfer functions depend on the controller \(K\) and therefore can be shaped.
However, in some frequency bands, the norms do not depend on the controller and therefore <b>cannot</b> be shaped.
</p>
<p>
Therefore the weighting functions should only focus on certainty frequency range depending on the transfer function being shaped.
These regions are summarized in Figure <a href="#org54a8a92">36</a>.
</p>
<div id="org54a8a92" class="figure">
<p><img src="figs/h-infinity-4-blocs-constrains.png" alt="h-infinity-4-blocs-constrains.png" />
</p>
<p><span class="figure-number">Figure 36: </span>Shaping the Gang of Four: Limitations</p>
</div>
<div class="warning" id="orgd1cf553">
<p>
The order (resp. number of state) of the controller given by the \(\mathcal{H}_\infty\) synthesis is equal to the order (resp. number of state) of the weighted generalized plant.
It is thus equal to the <b>sum</b> of the number of state of the non-weighted generalized plant and the number of state of all the weighting functions.
</p>
<p>
Two approaches can be used to obtain controllers with reasonable order:
</p>
<ol class="org-ol">
<li>use simple weights (usually first order)</li>
<li>perform a model reduction on the obtained high order controller</li>
</ol>
</div>
</div>
</div>
</div>
<div id="outline-container-org4cfe210" class="outline-2">
<h2 id="org4cfe210"><span class="section-number-2">6</span> Mixed-Sensitivity \(\mathcal{H}_\infty\) Control - Example</h2>
<div class="outline-text-2" id="text-6">
<p>
<a id="orgb0ce710"></a>
</p>
</div>
<div id="outline-container-orgbb9bd9a" class="outline-3">
<h3 id="orgbb9bd9a"><span class="section-number-3">6.1</span> Control Problem</h3>
<div class="outline-text-3" id="text-6-1">
<ul class="org-ul">
<li class="off"><code>[&#xa0;]</code> Control Diagram</li>
</ul>
<ul class="org-ul">
<li>Inputs Signals
<ul class="org-ul">
<li>Reference steps of 1mm</li>
<li>Measurement noise is considered to be a white noise with a power spectral density of &#x2026;</li>
</ul></li>
<li>Specifications
<ul class="org-ul">
<li>Follow reference steps with a response time of 0.1s and static error less than \(1 \mu m\)</li>
<li>Maximum control signal of 10N</li>
<li>Robustness</li>
<li>Reduce the effect of measurement noise on the position</li>
</ul></li>
</ul>
<div class="org-src-container">
<pre class="src src-matlab">k = 1e6; <span class="org-comment">% Stiffness [N/m]</span>
c = 4e2; <span class="org-comment">% Damping [N/(m/s)]</span>
m = 10; <span class="org-comment">% Mass [kg]</span>
G = 1<span class="org-type">/</span>(m<span class="org-type">*</span>s<span class="org-type">^</span>2 <span class="org-type">+</span> c<span class="org-type">*</span>s <span class="org-type">+</span> k); <span class="org-comment">% Plant</span>
Gd = (c<span class="org-type">*</span>s <span class="org-type">+</span> k)<span class="org-type">/</span>(m<span class="org-type">*</span>s<span class="org-type">^</span>2 <span class="org-type">+</span> c<span class="org-type">*</span>s <span class="org-type">+</span> k); <span class="org-comment">% Disturbance</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-comment">% Generate Input Signals</span>
t = 0<span class="org-type">:</span>1e<span class="org-type">-</span>3<span class="org-type">:</span>1;
r = zeros(size(t));
r(t<span class="org-type">&gt;</span>0.1) = 1e<span class="org-type">-</span>3;
Fs = 1e3; <span class="org-comment">% Sampling Frequency [Hz]</span>
Ts = 1<span class="org-type">/</span>Fs; <span class="org-comment">% Sampling Time [s]</span>
n = sqrt(Fs<span class="org-type">/</span>2)<span class="org-type">*</span>randn(1, length(t)); <span class="org-comment">% Signal with an ASD equal to one</span>
n = n<span class="org-type">*</span>1e<span class="org-type">-</span>6;
d = zeros(size(t));
d(t<span class="org-type">&gt;</span>0.5) = 5e<span class="org-type">-</span>4;
</pre>
</div>
</div>
</div>
<div id="outline-container-org7f64534" class="outline-3">
<h3 id="org7f64534"><span class="section-number-3">6.2</span> Control Design Procedure</h3>
<div class="outline-text-3" id="text-6-2">
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="org-left" />
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">&#xa0;</th>
<th scope="col" class="org-left">&#xa0;</th>
<th scope="col" class="org-left">&#xa0;</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">Response Time</td>
<td class="org-left">&#xa0;</td>
<td class="org-left">&#xa0;</td>
</tr>
<tr>
<td class="org-left">Robustness</td>
<td class="org-left">&#xa0;</td>
<td class="org-left">&#xa0;</td>
</tr>
<tr>
<td class="org-left">Limitation of the Command Amplitude</td>
<td class="org-left">&#xa0;</td>
<td class="org-left">&#xa0;</td>
</tr>
<tr>
<td class="org-left">Filtering of the measurement noise</td>
<td class="org-left">&#xa0;</td>
<td class="org-left">&#xa0;</td>
</tr>
</tbody>
</table>
<div id="org9b19a55" class="figure">
<p><img src="figs/mixed_sensitivity_control_schematic.png" alt="mixed_sensitivity_control_schematic.png" />
</p>
<p><span class="figure-number">Figure 37: </span>Generalized Plant used for the Mixed Sensitivity Synthesis</p>
</div>
<ul class="org-ul">
<li>\(W_1\) is used to shape \(S\)</li>
<li>\(W_2\) is used to shape \(KS\)</li>
<li>\(W_3\) is used to shape \(T\)</li>
</ul>
<div class="org-src-container">
<pre class="src src-matlab">P = [1 <span class="org-type">-</span>G
0 1
0 G
1 <span class="org-type">-</span>G];
</pre>
</div>
</div>
</div>
<div id="outline-container-orga3ee604" class="outline-3">
<h3 id="orga3ee604"><span class="section-number-3">6.3</span> Step 1 - Shaping of \(S\)</h3>
<div class="outline-text-3" id="text-6-3">
<p>
<a id="org4c8309d"></a>
</p>
<p>
We start with the shaping of \(S\) alone.
To not constrain \(KS\) and \(T\), we set small values for \(W_2\) and \(W_3\)
</p>
<div class="org-src-container">
<pre class="src src-matlab">W2 = tf(1e<span class="org-type">-</span>8);
W3 = tf(0.1);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">W1 = generateWeight(<span class="org-string">'G0'</span>, 1e3, ...
<span class="org-string">'G1'</span>, 1<span class="org-type">/</span>2, ...
<span class="org-string">'Gc'</span>, sqrt(2), <span class="org-string">'wc'</span>, 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>10, ...
<span class="org-string">'n'</span>, 1);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">Pw = blkdiag(W1, W2, W3, 1)<span class="org-type">*</span>P;
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">K1 = hinfsyn(Pw, 1, 1, <span class="org-string">'Display'</span>, <span class="org-string">'on'</span>);
</pre>
</div>
<pre class="example" id="org1a4a18c">
K1 = hinfsyn(Pw, 1, 1, 'Display', 'on');
Test bounds: 0.5 &lt;= gamma &lt;= 0.552
gamma X&gt;=0 Y&gt;=0 rho(XY)&lt;1 p/f
5.25e-01 0.0e+00 0.0e+00 6.061e-16 p
5.13e-01 0.0e+00 0.0e+00 0.000e+00 p
5.06e-01 -2.5e+00 # -6.4e-14 1.440e-15 f
5.09e-01 -5.5e+00 # -4.1e-14 9.510e-16 f
Limiting gains...
5.14e-01 0.0e+00 0.0e+00 1.039e-25 p
5.14e-01 0.0e+00 0.0e+00 1.040e-25 p
Best performance (actual): 0.514
'org_babel_eoe'
ans =
'org_babel_eoe'
</pre>
<div class="org-src-container">
<pre class="src src-matlab">Z1 = lft(P, K1);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-comment">% Create model with r and n as inputs and y and u as outputs</span>
Psim = [0 0 Gd G
0 0 0 1
1 <span class="org-type">-</span>1 <span class="org-type">-</span>Gd <span class="org-type">-</span>G];
Z1sim = lft(Psim, K1);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">z = lsim(Z1sim, [r;n;d], t);
y1 = z(<span class="org-type">:</span>,1);
u1 = z(<span class="org-type">:</span>,2);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-type">figure</span>;
tiledlayout(1, 2, <span class="org-string">'TileSpacing'</span>, <span class="org-string">'None'</span>, <span class="org-string">'Padding'</span>, <span class="org-string">'None'</span>);
nexttile;
hold on;
plot(t, y1);
hold off;
xlabel(<span class="org-string">'Time [s]'</span>); ylabel(<span class="org-string">'Output $y$ [m]'</span>);
nexttile;
hold on;
plot(t, u1);
hold off;
xlabel(<span class="org-string">'Time [s]'</span>); ylabel(<span class="org-string">'Control Input $u$ [N]'</span>);
</pre>
</div>
</div>
</div>
<div id="outline-container-org238cd32" class="outline-3">
<h3 id="org238cd32"><span class="section-number-3">6.4</span> Step 2 - Shaping of \(KS\)</h3>
<div class="outline-text-3" id="text-6-4">
<p>
<a id="orga5d1d24"></a>
</p>
<div class="org-src-container">
<pre class="src src-matlab">W2 = generateWeight(<span class="org-string">'G0'</span>, 5e<span class="org-type">-</span>7, ...
<span class="org-string">'G1'</span>, 1e<span class="org-type">-</span>3, ...
<span class="org-string">'Gc'</span>, 1e<span class="org-type">-</span>6, <span class="org-string">'wc'</span>, 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>100, ...
<span class="org-string">'n'</span>, 1);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">Pw = blkdiag(W1, W2, W3, 1)<span class="org-type">*</span>P;
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">K2 = hinfsyn(Pw, 1, 1, <span class="org-string">'Display'</span>, <span class="org-string">'on'</span>);
</pre>
</div>
<pre class="example" id="org245d1a9">
K1 = hinfsyn(Pw, 1, 1, 'Display', 'on');
Test bounds: 0.51 &lt;= gamma &lt;= 1.2
gamma X&gt;=0 Y&gt;=0 rho(XY)&lt;1 p/f
7.82e-01 0.0e+00 0.0e+00 0.000e+00 p
6.32e-01 -2.2e+00 # -3.0e-14 -1.136e-32 f
7.03e-01 -5.1e+00 # -2.9e-14 5.128e-17 f
7.41e-01 -1.1e+01 # -1.0e-14 1.431e-22 f
7.61e-01 -2.6e+01 # -9.1e-15 1.215e-21 f
7.72e-01 -6.9e+01 # -1.9e-14 2.828e-16 f
7.77e-01 -3.6e+02 # -1.2e-14 1.213e-15 f
Best performance (actual): 0.782
'org_babel_eoe'
ans =
'org_babel_eoe'
</pre>
<div class="org-src-container">
<pre class="src src-matlab">Z2 = lft(P, K2);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">Z2sim = lft(Psim, K2);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">z = lsim(Z2sim, [r;n;d], t);
y2 = z(<span class="org-type">:</span>,1);
u2 = z(<span class="org-type">:</span>,2);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-type">figure</span>;
tiledlayout(1, 2, <span class="org-string">'TileSpacing'</span>, <span class="org-string">'None'</span>, <span class="org-string">'Padding'</span>, <span class="org-string">'None'</span>);
nexttile;
hold on;
plot(t, y1);
plot(t, y2);
hold off;
xlabel(<span class="org-string">'Time [s]'</span>); ylabel(<span class="org-string">'Output $y$ [m]'</span>);
nexttile;
hold on;
plot(t, u1);
plot(t, u2);
hold off;
xlabel(<span class="org-string">'Time [s]'</span>); ylabel(<span class="org-string">'Control Input $u$ [N]'</span>);
</pre>
</div>
</div>
</div>
<div id="outline-container-org98f0830" class="outline-3">
<h3 id="org98f0830"><span class="section-number-3">6.5</span> Step 3 - Shaping of \(T\)</h3>
<div class="outline-text-3" id="text-6-5">
<p>
<a id="orge45b749"></a>
</p>
<div class="org-src-container">
<pre class="src src-matlab">W3 = generateWeight(<span class="org-string">'G0'</span>, 1e<span class="org-type">-</span>1, ...
<span class="org-string">'G1'</span>, 1e4, ...
<span class="org-string">'Gc'</span>, 1, <span class="org-string">'wc'</span>, 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>30, ...
<span class="org-string">'n'</span>, 3);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">Pw = blkdiag(W1, W2, W3, 1)<span class="org-type">*</span>P;
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">K3 = hinfsyn(Pw, 1, 1, <span class="org-string">'Display'</span>, <span class="org-string">'on'</span>);
</pre>
</div>
<pre class="example" id="org0c48d0d">
K3 = hinfsyn(Pw, 1, 1, 'Display', 'on');
Test bounds: 0.578 &lt;= gamma &lt;= 1.66
gamma X&gt;=0 Y&gt;=0 rho(XY)&lt;1 p/f
9.78e-01 -1.3e+01 # -6.2e-15 1.141e-18 f
1.27e+00 0.0e+00 0.0e+00 1.524e-15 p
1.12e+00 0.0e+00 0.0e+00 4.481e-15 p
1.04e+00 -4.0e+01 # -1.0e-13 1.102e-42 f
1.08e+00 -6.6e+02 # -4.4e-15 3.641e-18 f
1.10e+00 0.0e+00 0.0e+00 6.052e-21 p
1.09e+00 0.0e+00 0.0e+00 5.005e-15 p
Best performance (actual): 1.09
'org_babel_eoe'
ans =
'org_babel_eoe'
</pre>
<div class="org-src-container">
<pre class="src src-matlab">Z3 = lft(P, K3);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">Z3sim = lft(Psim, K3);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">z = lsim(Z3sim, [r;n;d], t);
y3 = z(<span class="org-type">:</span>,1);
u3 = z(<span class="org-type">:</span>,2);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-type">figure</span>;
tiledlayout(1, 2, <span class="org-string">'TileSpacing'</span>, <span class="org-string">'None'</span>, <span class="org-string">'Padding'</span>, <span class="org-string">'None'</span>);
nexttile;
hold on;
plot(t, y1);
plot(t, y2);
plot(t, y3);
hold off;
xlabel(<span class="org-string">'Time [s]'</span>); ylabel(<span class="org-string">'Output $y$ [m]'</span>);
nexttile;
hold on;
plot(t, u1);
plot(t, u2);
plot(t, u3);
hold off;
xlabel(<span class="org-string">'Time [s]'</span>); ylabel(<span class="org-string">'Control Input $u$ [N]'</span>);
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgfd49210" class="outline-2">
<h2 id="orgfd49210"><span class="section-number-2">7</span> Conclusion</h2>
<div class="outline-text-2" id="text-7">
<p>
<a id="org1b37b10"></a>
</p>
</div>
</div>
<div id="outline-container-org4803826" class="outline-2">
<h2 id="org4803826">Resources</h2>
<div class="outline-text-2" id="text-org4803826">
<p>
<div class="yt"><iframe width="100%" height="100%" src="https://www.youtube.com/embed/?listType=playlist&list=PLn8PRpmsu08qFLMfgTEzR8DxOPE7fBiin" frameborder="0" allowfullscreen></iframe></div>
</p>
<p>
<div class="yt"><iframe width="100%" height="100%" src="https://www.youtube.com/embed/?listType=playlist&list=PLsjPUqcL7ZIFHCObUU_9xPUImZ203gB4o" frameborder="0" allowfullscreen></iframe></div>
</p>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
<p class="date">Created: 2020-12-02 mer. 11:00</p>
</div>
</body>
</html>