Update matlab file

This commit is contained in:
Thomas Dehaeze 2019-08-21 16:34:47 +02:00
parent 05bd05cd45
commit 5cfb7b8de1
2 changed files with 163 additions and 158 deletions

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2019-08-14 mer. 12:13 --> <!-- 2019-08-21 mer. 13:17 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>On the Design of Complementary Filters for Control - Computation with Matlab</title> <title>On the Design of Complementary Filters for Control - Computation with Matlab</title>
@ -279,52 +279,52 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<div id="text-table-of-contents"> <div id="text-table-of-contents">
<ul> <ul>
<li><a href="#org8101fe3">1. Optimal Sensor Fusion for noise characteristics</a> <li><a href="#orga1a1b9d">1. Optimal Sensor Fusion for noise characteristics</a>
<ul> <ul>
<li><a href="#orgda648ce">1.1. Architecture</a></li> <li><a href="#orga3597f6">1.1. Architecture</a></li>
<li><a href="#org7737a79">1.2. Noise of the sensors</a></li> <li><a href="#orgcac1aa3">1.2. Noise of the sensors</a></li>
<li><a href="#orgf85a7f2">1.3. H-Two Synthesis</a></li> <li><a href="#orgdb1ca76">1.3. H-Two Synthesis</a></li>
<li><a href="#org9fcdb98">1.4. Analysis</a></li> <li><a href="#org375cb3a">1.4. Analysis</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org7d49713">2. Robustness to sensor dynamics uncertainty</a> <li><a href="#org2ebd870">2. Robustness to sensor dynamics uncertainty</a>
<ul> <ul>
<li><a href="#orgc1b9515">2.1. Unknown sensor dynamics dynamics</a></li> <li><a href="#orgf63dc07">2.1. Unknown sensor dynamics dynamics</a></li>
<li><a href="#org5df7619">2.2. Design the complementary filters in order to limit the phase and gain uncertainty of the super sensor</a></li> <li><a href="#org3244858">2.2. Design the complementary filters in order to limit the phase and gain uncertainty of the super sensor</a></li>
<li><a href="#org0328fd7">2.3. First Basic Example with gain mismatch</a></li> <li><a href="#org20ae980">2.3. First Basic Example with gain mismatch</a></li>
<li><a href="#org81e622c">2.4. <span class="todo TODO">TODO</span> More Complete example with model uncertainty</a></li> <li><a href="#org41f2b11">2.4. <span class="todo TODO">TODO</span> More Complete example with model uncertainty</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org6d8c8af">3. Complementary filters using analytical formula</a> <li><a href="#orgf04a9a4">3. Complementary filters using analytical formula</a>
<ul> <ul>
<li><a href="#orgb288402">3.1. Analytical 1st order complementary filters</a></li> <li><a href="#org7d339a9">3.1. Analytical 1st order complementary filters</a></li>
<li><a href="#orgefd1169">3.2. Second Order Complementary Filters</a></li> <li><a href="#org8edbedb">3.2. Second Order Complementary Filters</a></li>
<li><a href="#org32c14e8">3.3. Third Order Complementary Filters</a></li> <li><a href="#org5fd0c3c">3.3. Third Order Complementary Filters</a></li>
</ul> </ul>
</li> </li>
<li><a href="#orgc86d54b">4. H-Infinity synthesis of complementary filters</a> <li><a href="#org88004e2">4. H-Infinity synthesis of complementary filters</a>
<ul> <ul>
<li><a href="#org2288026">4.1. Synthesis Architecture</a></li> <li><a href="#orgc51b2bd">4.1. Synthesis Architecture</a></li>
<li><a href="#orga9b0474">4.2. Weights</a></li> <li><a href="#orga135818">4.2. Weights</a></li>
<li><a href="#org17ecd06">4.3. H-Infinity Synthesis</a></li> <li><a href="#orgbd3b8d8">4.3. H-Infinity Synthesis</a></li>
<li><a href="#org844c90a">4.4. Obtained Complementary Filters</a></li> <li><a href="#org0d62ef6">4.4. Obtained Complementary Filters</a></li>
</ul> </ul>
</li> </li>
<li><a href="#orgd76dc0a">5. Feedback Control Architecture to generate Complementary Filters</a> <li><a href="#orga65dbb6">5. Feedback Control Architecture to generate Complementary Filters</a>
<ul> <ul>
<li><a href="#org2b0a54f">5.1. Architecture</a></li> <li><a href="#orgec7fc24">5.1. Architecture</a></li>
<li><a href="#org023d478">5.2. Loop Gain Design</a></li> <li><a href="#org448cd20">5.2. Loop Gain Design</a></li>
<li><a href="#orgef15574">5.3. Complementary Filters Obtained</a></li> <li><a href="#org1ec0e07">5.3. Complementary Filters Obtained</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org9a4e0ed">6. Analytical Formula found in the literature</a> <li><a href="#org3b324a8">6. Analytical Formula found in the literature</a>
<ul> <ul>
<li><a href="#orgfa54829">6.1. Analytical Formula</a></li> <li><a href="#org8d499d4">6.1. Analytical Formula</a></li>
<li><a href="#org5286b79">6.2. Matlab</a></li> <li><a href="#org60e2ce0">6.2. Matlab</a></li>
<li><a href="#org6092cef">6.3. Discussion</a></li> <li><a href="#org1038fe9">6.3. Discussion</a></li>
</ul> </ul>
</li> </li>
<li><a href="#orgbbfeb6f">7. Comparison of the different methods of synthesis</a></li> <li><a href="#org647d1a0">7. Comparison of the different methods of synthesis</a></li>
</ul> </ul>
</div> </div>
</div> </div>
@ -344,31 +344,31 @@ To achieve this, the sensors included in the filter should complement one anothe
</blockquote> </blockquote>
<ul class="org-ul"> <ul class="org-ul">
<li>in section <a href="#orgc9381ca">1</a>, the optimal design of the complementary filters in order to obtain the lowest resulting "super sensor" noise is studied</li> <li>in section <a href="#orge83d075">1</a>, the optimal design of the complementary filters in order to obtain the lowest resulting "super sensor" noise is studied</li>
</ul> </ul>
<p> <p>
When blending two sensors using complementary filters with unknown dynamics, phase lag may be introduced that renders the close-loop system unstable. When blending two sensors using complementary filters with unknown dynamics, phase lag may be introduced that renders the close-loop system unstable.
</p> </p>
<ul class="org-ul"> <ul class="org-ul">
<li>in section <a href="#orgc67c206">2</a>, the blending robustness to sensor dynamic uncertainty is studied.</li> <li>in section <a href="#orgb2ab616">2</a>, the blending robustness to sensor dynamic uncertainty is studied.</li>
</ul> </ul>
<p> <p>
Then, three design methods for generating two complementary filters are proposed: Then, three design methods for generating two complementary filters are proposed:
</p> </p>
<ul class="org-ul"> <ul class="org-ul">
<li>in section <a href="#org91a8313">3</a>, analytical formulas are proposed</li> <li>in section <a href="#org654b360">3</a>, analytical formulas are proposed</li>
<li>in section <a href="#org2358787">4</a>, the \(\mathcal{H}_\infty\) synthesis is used</li> <li>in section <a href="#org924f36f">4</a>, the \(\mathcal{H}_\infty\) synthesis is used</li>
<li>in section <a href="#org94d0d5f">5</a>, the classical feedback architecture is used</li> <li>in section <a href="#org3e654dc">5</a>, the classical feedback architecture is used</li>
<li>in section <a href="#orga144d76">6</a>, analytical formulas found in the literature are listed</li> <li>in section <a href="#org22f6020">6</a>, analytical formulas found in the literature are listed</li>
</ul> </ul>
<div id="outline-container-org8101fe3" class="outline-2"> <div id="outline-container-orga1a1b9d" class="outline-2">
<h2 id="org8101fe3"><span class="section-number-2">1</span> Optimal Sensor Fusion for noise characteristics</h2> <h2 id="orga1a1b9d"><span class="section-number-2">1</span> Optimal Sensor Fusion for noise characteristics</h2>
<div class="outline-text-2" id="text-1"> <div class="outline-text-2" id="text-1">
<p> <p>
<a id="orgc9381ca"></a> <a id="orge83d075"></a>
</p> </p>
<p> <p>
The idea is to combine sensors that works in different frequency range using complementary filters. The idea is to combine sensors that works in different frequency range using complementary filters.
@ -389,11 +389,11 @@ All the files (data and Matlab scripts) are accessible <a href="data/optimal_com
</div> </div>
</div> </div>
<div id="outline-container-orgda648ce" class="outline-3"> <div id="outline-container-orga3597f6" class="outline-3">
<h3 id="orgda648ce"><span class="section-number-3">1.1</span> Architecture</h3> <h3 id="orga3597f6"><span class="section-number-3">1.1</span> Architecture</h3>
<div class="outline-text-3" id="text-1-1"> <div class="outline-text-3" id="text-1-1">
<p> <p>
Let's consider the sensor fusion architecture shown on figure <a href="#org0214c79">1</a> where two sensors 1 and 2 are measuring the same quantity \(x\) with different noise characteristics determined by \(W_1\) and \(W_2\). Let's consider the sensor fusion architecture shown on figure <a href="#org80c1b07">1</a> where two sensors 1 and 2 are measuring the same quantity \(x\) with different noise characteristics determined by \(W_1\) and \(W_2\).
</p> </p>
<p> <p>
@ -401,19 +401,20 @@ Let's consider the sensor fusion architecture shown on figure <a href="#org0214c
</p> </p>
<div id="org0214c79" class="figure"> <div id="org80c1b07" class="figure">
<p><img src="figs/fusion_two_noisy_sensors_with_dyn.png" alt="fusion_two_noisy_sensors_with_dyn.png" /> <p><object type="image/svg+xml" data="figs-tikz/fusion_two_noisy_sensors_with_dyn.svg" class="org-svg">
Sorry, your browser does not support SVG.</object>
</p> </p>
<p><span class="figure-number">Figure 1: </span>Fusion of two sensors</p> <p><span class="figure-number">Figure 1: </span>Fusion of two sensors</p>
</div> </div>
<p> <p>
We consider that the two sensor dynamics \(G_1\) and \(G_2\) are ideal (\(G_1 = G_2 = 1\)). We obtain the architecture of figure <a href="#org8edd1ad">2</a>. We consider that the two sensor dynamics \(G_1\) and \(G_2\) are ideal (\(G_1 = G_2 = 1\)). We obtain the architecture of figure <a href="#org442f9da">2</a>.
</p> </p>
<div id="org8edd1ad" class="figure"> <div id="org442f9da" class="figure">
<p><img src="figs/fusion_two_noisy_sensors.png" alt="fusion_two_noisy_sensors.png" /> <p><img src="figs-tikz/fusion_two_noisy_sensors.png" alt="fusion_two_noisy_sensors.png" />
</p> </p>
<p><span class="figure-number">Figure 2: </span>Fusion of two sensors with ideal dynamics</p> <p><span class="figure-number">Figure 2: </span>Fusion of two sensors with ideal dynamics</p>
</div> </div>
@ -447,8 +448,8 @@ For that, we will use the \(\mathcal{H}_2\) Synthesis.
</div> </div>
</div> </div>
<div id="outline-container-org7737a79" class="outline-3"> <div id="outline-container-orgcac1aa3" class="outline-3">
<h3 id="org7737a79"><span class="section-number-3">1.2</span> Noise of the sensors</h3> <h3 id="orgcac1aa3"><span class="section-number-3">1.2</span> Noise of the sensors</h3>
<div class="outline-text-3" id="text-1-2"> <div class="outline-text-3" id="text-1-2">
<p> <p>
Let's define the noise characteristics of the two sensors by choosing \(W_1\) and \(W_2\): Let's define the noise characteristics of the two sensors by choosing \(W_1\) and \(W_2\):
@ -468,7 +469,7 @@ W2 = <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainb
</div> </div>
<div id="org535b437" class="figure"> <div id="org8380e17" class="figure">
<p><img src="figs/nosie_characteristics_sensors.png" alt="nosie_characteristics_sensors.png" /> <p><img src="figs/nosie_characteristics_sensors.png" alt="nosie_characteristics_sensors.png" />
</p> </p>
<p><span class="figure-number">Figure 3: </span>Noise Characteristics of the two sensors (<a href="./figs/nosie_characteristics_sensors.png">png</a>, <a href="./figs/nosie_characteristics_sensors.pdf">pdf</a>)</p> <p><span class="figure-number">Figure 3: </span>Noise Characteristics of the two sensors (<a href="./figs/nosie_characteristics_sensors.png">png</a>, <a href="./figs/nosie_characteristics_sensors.pdf">pdf</a>)</p>
@ -476,16 +477,16 @@ W2 = <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainb
</div> </div>
</div> </div>
<div id="outline-container-orgf85a7f2" class="outline-3"> <div id="outline-container-orgdb1ca76" class="outline-3">
<h3 id="orgf85a7f2"><span class="section-number-3">1.3</span> H-Two Synthesis</h3> <h3 id="orgdb1ca76"><span class="section-number-3">1.3</span> H-Two Synthesis</h3>
<div class="outline-text-3" id="text-1-3"> <div class="outline-text-3" id="text-1-3">
<p> <p>
We use the generalized plant architecture shown on figure <a href="#org178bd58">4</a>. We use the generalized plant architecture shown on figure <a href="#orgfd9fdc8">4</a>.
</p> </p>
<div id="org178bd58" class="figure"> <div id="orgfd9fdc8" class="figure">
<p><img src="figs/h_infinity_optimal_comp_filters.png" alt="h_infinity_optimal_comp_filters.png" /> <p><img src="figs-tikz/h_infinity_optimal_comp_filters.png" alt="h_infinity_optimal_comp_filters.png" />
</p> </p>
<p><span class="figure-number">Figure 4: </span>\(\mathcal{H}_2\) Synthesis - Generalized plant used for the optimal generation of complementary filters</p> <p><span class="figure-number">Figure 4: </span>\(\mathcal{H}_2\) Synthesis - Generalized plant used for the optimal generation of complementary filters</p>
</div> </div>
@ -502,7 +503,7 @@ Thus, if we minimize the \(\mathcal{H}_2\) norm of this transfer function, we mi
</p> </p>
<p> <p>
We define the generalized plant \(P\) on matlab as shown on figure <a href="#org178bd58">4</a>. We define the generalized plant \(P\) on matlab as shown on figure <a href="#orgfd9fdc8">4</a>.
</p> </p>
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-matlab">P = <span class="org-rainbow-delimiters-depth-1">[</span><span class="org-highlight-numbers-number">0</span> W2 <span class="org-highlight-numbers-number">1</span>; <pre class="src src-matlab">P = <span class="org-rainbow-delimiters-depth-1">[</span><span class="org-highlight-numbers-number">0</span> W2 <span class="org-highlight-numbers-number">1</span>;
@ -532,30 +533,30 @@ Finally, we define \(H_2 = 1 - H_1\).
</div> </div>
</div> </div>
<div id="outline-container-org9fcdb98" class="outline-3"> <div id="outline-container-org375cb3a" class="outline-3">
<h3 id="org9fcdb98"><span class="section-number-3">1.4</span> Analysis</h3> <h3 id="org375cb3a"><span class="section-number-3">1.4</span> Analysis</h3>
<div class="outline-text-3" id="text-1-4"> <div class="outline-text-3" id="text-1-4">
<p> <p>
The complementary filters obtained are shown on figure <a href="#org3f036f9">5</a>. The PSD of the <a href="#org272e8f4">6</a>. The complementary filters obtained are shown on figure <a href="#org4addc9f">5</a>. The PSD of the <a href="#org52b2e97">6</a>.
Finally, the RMS value of \(\hat{x}\) is shown on table <a href="#orgf88e62b">1</a>. Finally, the RMS value of \(\hat{x}\) is shown on table <a href="#orgccc886e">1</a>.
The optimal sensor fusion has permitted to reduced the RMS value of the estimation error by a factor 8 compare to when using only one sensor. The optimal sensor fusion has permitted to reduced the RMS value of the estimation error by a factor 8 compare to when using only one sensor.
</p> </p>
<div id="org3f036f9" class="figure"> <div id="org4addc9f" class="figure">
<p><img src="figs/htwo_comp_filters.png" alt="htwo_comp_filters.png" /> <p><img src="figs/htwo_comp_filters.png" alt="htwo_comp_filters.png" />
</p> </p>
<p><span class="figure-number">Figure 5: </span>Obtained complementary filters using the \(\mathcal{H}_2\) Synthesis (<a href="./figs/htwo_comp_filters.png">png</a>, <a href="./figs/htwo_comp_filters.pdf">pdf</a>)</p> <p><span class="figure-number">Figure 5: </span>Obtained complementary filters using the \(\mathcal{H}_2\) Synthesis (<a href="./figs/htwo_comp_filters.png">png</a>, <a href="./figs/htwo_comp_filters.pdf">pdf</a>)</p>
</div> </div>
<div id="org272e8f4" class="figure"> <div id="org52b2e97" class="figure">
<p><img src="figs/psd_sensors_htwo_synthesis.png" alt="psd_sensors_htwo_synthesis.png" /> <p><img src="figs/psd_sensors_htwo_synthesis.png" alt="psd_sensors_htwo_synthesis.png" />
</p> </p>
<p><span class="figure-number">Figure 6: </span>Power Spectral Density of the estimated \(\hat{x}\) using the two sensors alone and using the optimally fused signal (<a href="./figs/psd_sensors_htwo_synthesis.png">png</a>, <a href="./figs/psd_sensors_htwo_synthesis.pdf">pdf</a>)</p> <p><span class="figure-number">Figure 6: </span>Power Spectral Density of the estimated \(\hat{x}\) using the two sensors alone and using the optimally fused signal (<a href="./figs/psd_sensors_htwo_synthesis.png">png</a>, <a href="./figs/psd_sensors_htwo_synthesis.pdf">pdf</a>)</p>
</div> </div>
<table id="orgf88e62b" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="orgccc886e" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption class="t-above"><span class="table-number">Table 1:</span> RMS value of the estimation error when using the sensor individually and when using the two sensor merged using the optimal complementary filters</caption> <caption class="t-above"><span class="table-number">Table 1:</span> RMS value of the estimation error when using the sensor individually and when using the two sensor merged using the optimal complementary filters</caption>
<colgroup> <colgroup>
@ -589,18 +590,19 @@ The optimal sensor fusion has permitted to reduced the RMS value of the estimati
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-org7d49713" class="outline-2">
<h2 id="org7d49713"><span class="section-number-2">2</span> Robustness to sensor dynamics uncertainty</h2> <div id="outline-container-org2ebd870" class="outline-2">
<h2 id="org2ebd870"><span class="section-number-2">2</span> Robustness to sensor dynamics uncertainty</h2>
<div class="outline-text-2" id="text-2"> <div class="outline-text-2" id="text-2">
<p> <p>
<a id="orgc67c206"></a> <a id="orgb2ab616"></a>
</p> </p>
<p> <p>
Let's first consider ideal sensors where \(G_1 = 1\) and \(G_2 = 1\) (figure <a href="#orgd65643e">7</a>). Let's first consider ideal sensors where \(G_1 = 1\) and \(G_2 = 1\) (figure <a href="#orgd0780c6">7</a>).
</p> </p>
<div id="orgd65643e" class="figure"> <div id="orgd0780c6" class="figure">
<p><img src="figs/fusion_two_noisy_sensors_with_dyn_bis.png" alt="fusion_two_noisy_sensors_with_dyn_bis.png" /> <p><img src="figs/fusion_two_noisy_sensors_with_dyn_bis.png" alt="fusion_two_noisy_sensors_with_dyn_bis.png" />
</p> </p>
<p><span class="figure-number">Figure 7: </span>Fusion of two sensors</p> <p><span class="figure-number">Figure 7: </span>Fusion of two sensors</p>
@ -630,17 +632,17 @@ All the files (data and Matlab scripts) are accessible <a href="data/comp_filter
</div> </div>
</div> </div>
<div id="outline-container-orgc1b9515" class="outline-3"> <div id="outline-container-orgf63dc07" class="outline-3">
<h3 id="orgc1b9515"><span class="section-number-3">2.1</span> Unknown sensor dynamics dynamics</h3> <h3 id="orgf63dc07"><span class="section-number-3">2.1</span> Unknown sensor dynamics dynamics</h3>
<div class="outline-text-3" id="text-2-1"> <div class="outline-text-3" id="text-2-1">
<p> <p>
In practical systems, the sensor dynamics has always some level of uncertainty. In practical systems, the sensor dynamics has always some level of uncertainty.
Let's represent that with multiplicative input uncertainty as shown on figure <a href="#org0cb23aa">8</a>. Let's represent that with multiplicative input uncertainty as shown on figure <a href="#orga6c7451">8</a>.
</p> </p>
<div id="org0cb23aa" class="figure"> <div id="orga6c7451" class="figure">
<p><img src="figs/fusion_gain_mismatch.png" alt="fusion_gain_mismatch.png" /> <p><img src="figs-tikz/fusion_gain_mismatch.png" alt="fusion_gain_mismatch.png" />
</p> </p>
<p><span class="figure-number">Figure 8: </span>Fusion of two sensors with input multiplicative uncertainty</p> <p><span class="figure-number">Figure 8: </span>Fusion of two sensors with input multiplicative uncertainty</p>
</div> </div>
@ -684,7 +686,7 @@ Which is approximately the same as requiring
</p> </p>
<p> <p>
The uncertainty set of the transfer function from \(\hat{x}\) to \(x\) is bounded in the complex plane by a circle centered on 1 and with a radius equal to \(\epsilon\) (figure <a href="#orge9b44f9">9</a>). The uncertainty set of the transfer function from \(\hat{x}\) to \(x\) is bounded in the complex plane by a circle centered on 1 and with a radius equal to \(\epsilon\) (figure <a href="#org5dfc170">9</a>).
</p> </p>
<p> <p>
@ -693,8 +695,8 @@ We then have that the angle introduced by the super sensor is bounded by \(\arcs
</p> </p>
<div id="orge9b44f9" class="figure"> <div id="org5dfc170" class="figure">
<p><img src="figs/uncertainty_gain_phase_variation.png" alt="uncertainty_gain_phase_variation.png" /> <p><img src="figs-tikz/uncertainty_gain_phase_variation.png" alt="uncertainty_gain_phase_variation.png" />
</p> </p>
<p><span class="figure-number">Figure 9: </span>Maximum phase variation</p> <p><span class="figure-number">Figure 9: </span>Maximum phase variation</p>
</div> </div>
@ -705,8 +707,8 @@ Thus, we choose should choose \(\epsilon\) so that the maximum phase uncertainty
</div> </div>
</div> </div>
<div id="outline-container-org5df7619" class="outline-3"> <div id="outline-container-org3244858" class="outline-3">
<h3 id="org5df7619"><span class="section-number-3">2.2</span> Design the complementary filters in order to limit the phase and gain uncertainty of the super sensor</h3> <h3 id="org3244858"><span class="section-number-3">2.2</span> Design the complementary filters in order to limit the phase and gain uncertainty of the super sensor</h3>
<div class="outline-text-3" id="text-2-2"> <div class="outline-text-3" id="text-2-2">
<p> <p>
Let's say the two sensors dynamics \(H_1\) and \(H_2\) have been identified with the associated uncertainty weights \(W_1\) and \(W_2\). Let's say the two sensors dynamics \(H_1\) and \(H_2\) have been identified with the associated uncertainty weights \(W_1\) and \(W_2\).
@ -739,8 +741,8 @@ This is of primary importance in order to ensure the stability of the feedback l
</div> </div>
</div> </div>
<div id="outline-container-org0328fd7" class="outline-3"> <div id="outline-container-org20ae980" class="outline-3">
<h3 id="org0328fd7"><span class="section-number-3">2.3</span> First Basic Example with gain mismatch</h3> <h3 id="org20ae980"><span class="section-number-3">2.3</span> First Basic Example with gain mismatch</h3>
<div class="outline-text-3" id="text-2-3"> <div class="outline-text-3" id="text-2-3">
<p> <p>
Let's consider two ideal sensors except one sensor has not an expected gain of one but a gain of \(0.6\). Let's consider two ideal sensors except one sensor has not an expected gain of one but a gain of \(0.6\).
@ -752,19 +754,19 @@ G2 = <span class="org-highlight-numbers-number">0</span>.<span class="org-highli
</div> </div>
<p> <p>
Let's design two complementary filters as shown on figure <a href="#orgba6e31e">10</a>. Let's design two complementary filters as shown on figure <a href="#orgc3e7049">10</a>.
The complementary filters shown in blue does not present a bump as the red ones but provides less sensor separation at high and low frequencies. The complementary filters shown in blue does not present a bump as the red ones but provides less sensor separation at high and low frequencies.
</p> </p>
<div id="orgba6e31e" class="figure"> <div id="orgc3e7049" class="figure">
<p><img src="figs/comp_filters_robustness_test.png" alt="comp_filters_robustness_test.png" /> <p><img src="figs/comp_filters_robustness_test.png" alt="comp_filters_robustness_test.png" />
</p> </p>
<p><span class="figure-number">Figure 10: </span>The two complementary filters designed for the robustness test (<a href="./figs/comp_filters_robustness_test.png">png</a>, <a href="./figs/comp_filters_robustness_test.pdf">pdf</a>)</p> <p><span class="figure-number">Figure 10: </span>The two complementary filters designed for the robustness test (<a href="./figs/comp_filters_robustness_test.png">png</a>, <a href="./figs/comp_filters_robustness_test.pdf">pdf</a>)</p>
</div> </div>
<p> <p>
We then compute the bode plot of the super sensor transfer function \(H_1*G_1 + H_2*G_2\) for both complementary filters pair (figure <a href="#orgd412a5a">11</a>). We then compute the bode plot of the super sensor transfer function \(H_1*G_1 + H_2*G_2\) for both complementary filters pair (figure <a href="#org124e3b5">11</a>).
</p> </p>
<p> <p>
@ -772,7 +774,7 @@ We see that the blue complementary filters with a lower maximum norm permits to
</p> </p>
<div id="orgd412a5a" class="figure"> <div id="org124e3b5" class="figure">
<p><img src="figs/tf_super_sensor_comp.png" alt="tf_super_sensor_comp.png" /> <p><img src="figs/tf_super_sensor_comp.png" alt="tf_super_sensor_comp.png" />
</p> </p>
<p><span class="figure-number">Figure 11: </span>Comparison of the obtained super sensor transfer functions (<a href="./figs/tf_super_sensor_comp.png">png</a>, <a href="./figs/tf_super_sensor_comp.pdf">pdf</a>)</p> <p><span class="figure-number">Figure 11: </span>Comparison of the obtained super sensor transfer functions (<a href="./figs/tf_super_sensor_comp.png">png</a>, <a href="./figs/tf_super_sensor_comp.pdf">pdf</a>)</p>
@ -780,15 +782,15 @@ We see that the blue complementary filters with a lower maximum norm permits to
</div> </div>
</div> </div>
<div id="outline-container-org81e622c" class="outline-3"> <div id="outline-container-org41f2b11" class="outline-3">
<h3 id="org81e622c"><span class="section-number-3">2.4</span> <span class="todo TODO">TODO</span> More Complete example with model uncertainty</h3> <h3 id="org41f2b11"><span class="section-number-3">2.4</span> <span class="todo TODO">TODO</span> More Complete example with model uncertainty</h3>
</div> </div>
</div> </div>
<div id="outline-container-org6d8c8af" class="outline-2"> <div id="outline-container-orgf04a9a4" class="outline-2">
<h2 id="org6d8c8af"><span class="section-number-2">3</span> Complementary filters using analytical formula</h2> <h2 id="orgf04a9a4"><span class="section-number-2">3</span> Complementary filters using analytical formula</h2>
<div class="outline-text-2" id="text-3"> <div class="outline-text-2" id="text-3">
<p> <p>
<a id="org91a8313"></a> <a id="org654b360"></a>
</p> </p>
<div class="note"> <div class="note">
<p> <p>
@ -798,8 +800,8 @@ All the files (data and Matlab scripts) are accessible <a href="data/comp_filter
</div> </div>
</div> </div>
<div id="outline-container-orgb288402" class="outline-3"> <div id="outline-container-org7d339a9" class="outline-3">
<h3 id="orgb288402"><span class="section-number-3">3.1</span> Analytical 1st order complementary filters</h3> <h3 id="org7d339a9"><span class="section-number-3">3.1</span> Analytical 1st order complementary filters</h3>
<div class="outline-text-3" id="text-3-1"> <div class="outline-text-3" id="text-3-1">
<p> <p>
First order complementary filters are defined with following equations: First order complementary filters are defined with following equations:
@ -810,7 +812,7 @@ First order complementary filters are defined with following equations:
\end{align} \end{align}
<p> <p>
Their bode plot is shown figure <a href="#orga970e88">12</a>. Their bode plot is shown figure <a href="#orgd35e336">12</a>.
</p> </p>
<div class="org-src-container"> <div class="org-src-container">
@ -822,7 +824,7 @@ Hl1 = <span class="org-highlight-numbers-number">1</span><span class="org-type">
</div> </div>
<div id="orga970e88" class="figure"> <div id="orgd35e336" class="figure">
<p><img src="figs/comp_filter_1st_order.png" alt="comp_filter_1st_order.png" /> <p><img src="figs/comp_filter_1st_order.png" alt="comp_filter_1st_order.png" />
</p> </p>
<p><span class="figure-number">Figure 12: </span>Bode plot of first order complementary filter (<a href="./figs/comp_filter_1st_order.png">png</a>, <a href="./figs/comp_filter_1st_order.pdf">pdf</a>)</p> <p><span class="figure-number">Figure 12: </span>Bode plot of first order complementary filter (<a href="./figs/comp_filter_1st_order.png">png</a>, <a href="./figs/comp_filter_1st_order.pdf">pdf</a>)</p>
@ -830,8 +832,8 @@ Hl1 = <span class="org-highlight-numbers-number">1</span><span class="org-type">
</div> </div>
</div> </div>
<div id="outline-container-orgefd1169" class="outline-3"> <div id="outline-container-org8edbedb" class="outline-3">
<h3 id="orgefd1169"><span class="section-number-3">3.2</span> Second Order Complementary Filters</h3> <h3 id="org8edbedb"><span class="section-number-3">3.2</span> Second Order Complementary Filters</h3>
<div class="outline-text-3" id="text-3-2"> <div class="outline-text-3" id="text-3-2">
<p> <p>
We here use analytical formula for the complementary filters \(H_L\) and \(H_H\). We here use analytical formula for the complementary filters \(H_L\) and \(H_H\).
@ -857,12 +859,12 @@ where:
</ul> </ul>
<p> <p>
This is illustrated on figure <a href="#orga420ceb">13</a>. This is illustrated on figure <a href="#org551e9a2">13</a>.
The slope of those filters at high and low frequencies is \(-2\) and \(2\) respectively for \(H_L\) and \(H_H\). The slope of those filters at high and low frequencies is \(-2\) and \(2\) respectively for \(H_L\) and \(H_H\).
</p> </p>
<div id="orga420ceb" class="figure"> <div id="org551e9a2" class="figure">
<p><img src="figs/comp_filters_param_alpha.png" alt="comp_filters_param_alpha.png" /> <p><img src="figs/comp_filters_param_alpha.png" alt="comp_filters_param_alpha.png" />
</p> </p>
<p><span class="figure-number">Figure 13: </span>Effect of the parameter \(\alpha\) on the shape of the generated second order complementary filters (<a href="./figs/comp_filters_param_alpha.png">png</a>, <a href="./figs/comp_filters_param_alpha.pdf">pdf</a>)</p> <p><span class="figure-number">Figure 13: </span>Effect of the parameter \(\alpha\) on the shape of the generated second order complementary filters (<a href="./figs/comp_filters_param_alpha.png">png</a>, <a href="./figs/comp_filters_param_alpha.pdf">pdf</a>)</p>
@ -880,7 +882,7 @@ xlabel<span class="org-rainbow-delimiters-depth-1">(</span>'$<span class="org-ty
</div> </div>
<div id="orgf07fa17" class="figure"> <div id="org9c950bd" class="figure">
<p><img src="figs/param_alpha_hinf_norm.png" alt="param_alpha_hinf_norm.png" /> <p><img src="figs/param_alpha_hinf_norm.png" alt="param_alpha_hinf_norm.png" />
</p> </p>
<p><span class="figure-number">Figure 14: </span>Evolution of the H-Infinity norm of the complementary filters with the parameter \(\alpha\) (<a href="./figs/param_alpha_hinf_norm.png">png</a>, <a href="./figs/param_alpha_hinf_norm.pdf">pdf</a>)</p> <p><span class="figure-number">Figure 14: </span>Evolution of the H-Infinity norm of the complementary filters with the parameter \(\alpha\) (<a href="./figs/param_alpha_hinf_norm.png">png</a>, <a href="./figs/param_alpha_hinf_norm.pdf">pdf</a>)</p>
@ -888,8 +890,8 @@ xlabel<span class="org-rainbow-delimiters-depth-1">(</span>'$<span class="org-ty
</div> </div>
</div> </div>
<div id="outline-container-org32c14e8" class="outline-3"> <div id="outline-container-org5fd0c3c" class="outline-3">
<h3 id="org32c14e8"><span class="section-number-3">3.3</span> Third Order Complementary Filters</h3> <h3 id="org5fd0c3c"><span class="section-number-3">3.3</span> Third Order Complementary Filters</h3>
<div class="outline-text-3" id="text-3-3"> <div class="outline-text-3" id="text-3-3">
<p> <p>
The following formula gives complementary filters with slopes of \(-3\) and \(3\): The following formula gives complementary filters with slopes of \(-3\) and \(3\):
@ -908,7 +910,7 @@ The parameters are:
</ul> </ul>
<p> <p>
The filters are defined below and the result is shown on figure <a href="#orgbe15178">15</a>. The filters are defined below and the result is shown on figure <a href="#org8791569">15</a>.
</p> </p>
<div class="org-src-container"> <div class="org-src-container">
@ -922,7 +924,7 @@ Hl3_ana = <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-
</div> </div>
<div id="orgbe15178" class="figure"> <div id="org8791569" class="figure">
<p><img src="figs/complementary_filters_third_order.png" alt="complementary_filters_third_order.png" /> <p><img src="figs/complementary_filters_third_order.png" alt="complementary_filters_third_order.png" />
</p> </p>
<p><span class="figure-number">Figure 15: </span>Third order complementary filters using the analytical formula (<a href="./figs/complementary_filters_third_order.png">png</a>, <a href="./figs/complementary_filters_third_order.pdf">pdf</a>)</p> <p><span class="figure-number">Figure 15: </span>Third order complementary filters using the analytical formula (<a href="./figs/complementary_filters_third_order.png">png</a>, <a href="./figs/complementary_filters_third_order.pdf">pdf</a>)</p>
@ -931,11 +933,11 @@ Hl3_ana = <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-
</div> </div>
</div> </div>
<div id="outline-container-orgc86d54b" class="outline-2"> <div id="outline-container-org88004e2" class="outline-2">
<h2 id="orgc86d54b"><span class="section-number-2">4</span> H-Infinity synthesis of complementary filters</h2> <h2 id="org88004e2"><span class="section-number-2">4</span> H-Infinity synthesis of complementary filters</h2>
<div class="outline-text-2" id="text-4"> <div class="outline-text-2" id="text-4">
<p> <p>
<a id="org2358787"></a> <a id="org924f36f"></a>
</p> </p>
<div class="note"> <div class="note">
<p> <p>
@ -945,8 +947,8 @@ All the files (data and Matlab scripts) are accessible <a href="data/h_inf_synth
</div> </div>
</div> </div>
<div id="outline-container-org2288026" class="outline-3"> <div id="outline-container-orgc51b2bd" class="outline-3">
<h3 id="org2288026"><span class="section-number-3">4.1</span> Synthesis Architecture</h3> <h3 id="orgc51b2bd"><span class="section-number-3">4.1</span> Synthesis Architecture</h3>
<div class="outline-text-3" id="text-4-1"> <div class="outline-text-3" id="text-4-1">
<p> <p>
We here synthesize the complementary filters using the \(\mathcal{H}_\infty\) synthesis. We here synthesize the complementary filters using the \(\mathcal{H}_\infty\) synthesis.
@ -954,18 +956,18 @@ The goal is to specify upper bounds on the norms of \(H_L\) and \(H_H\) while en
</p> </p>
<p> <p>
In order to do so, we use the generalized plant shown on figure <a href="#org4764d16">16</a> where \(w_L\) and \(w_H\) weighting transfer functions that will be used to shape \(H_L\) and \(H_H\) respectively. In order to do so, we use the generalized plant shown on figure <a href="#orge2545fd">16</a> where \(w_L\) and \(w_H\) weighting transfer functions that will be used to shape \(H_L\) and \(H_H\) respectively.
</p> </p>
<div id="org4764d16" class="figure"> <div id="orge2545fd" class="figure">
<p><img src="figs/sf_hinf_filters_plant_b.png" alt="sf_hinf_filters_plant_b.png" /> <p><img src="figs-tikz/sf_hinf_filters_plant_b.png" alt="sf_hinf_filters_plant_b.png" />
</p> </p>
<p><span class="figure-number">Figure 16: </span>Generalized plant used for the \(\mathcal{H}_\infty\) synthesis of the complementary filters</p> <p><span class="figure-number">Figure 16: </span>Generalized plant used for the \(\mathcal{H}_\infty\) synthesis of the complementary filters</p>
</div> </div>
<p> <p>
The \(\mathcal{H}_\infty\) synthesis applied on this generalized plant will give a transfer function \(H_L\) (figure <a href="#orgd665b69">17</a>) such that the \(\mathcal{H}_\infty\) norm of the transfer function from \(w\) to \([z_H,\ z_L]\) is less than one: The \(\mathcal{H}_\infty\) synthesis applied on this generalized plant will give a transfer function \(H_L\) (figure <a href="#org130d2c0">17</a>) such that the \(\mathcal{H}_\infty\) norm of the transfer function from \(w\) to \([z_H,\ z_L]\) is less than one:
\[ \left\| \begin{array}{c} H_L w_L \\ (1 - H_L) w_H \end{array} \right\|_\infty < 1 \] \[ \left\| \begin{array}{c} H_L w_L \\ (1 - H_L) w_H \end{array} \right\|_\infty < 1 \]
</p> </p>
@ -984,16 +986,16 @@ We then see that \(w_L\) and \(w_H\) can be used to shape both \(H_L\) and \(H_H
</p> </p>
<div id="orgd665b69" class="figure"> <div id="org130d2c0" class="figure">
<p><img src="figs/sf_hinf_filters_b.png" alt="sf_hinf_filters_b.png" /> <p><img src="figs-tikz/sf_hinf_filters_b.png" alt="sf_hinf_filters_b.png" />
</p> </p>
<p><span class="figure-number">Figure 17: </span>\(\mathcal{H}_\infty\) synthesis of the complementary filters</p> <p><span class="figure-number">Figure 17: </span>\(\mathcal{H}_\infty\) synthesis of the complementary filters</p>
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-orga9b0474" class="outline-3"> <div id="outline-container-orga135818" class="outline-3">
<h3 id="orga9b0474"><span class="section-number-3">4.2</span> Weights</h3> <h3 id="orga135818"><span class="section-number-3">4.2</span> Weights</h3>
<div class="outline-text-3" id="text-4-2"> <div class="outline-text-3" id="text-4-2">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-matlab">omegab = <span class="org-highlight-numbers-number">2</span><span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span><span class="org-highlight-numbers-number">9</span>; <pre class="src src-matlab">omegab = <span class="org-highlight-numbers-number">2</span><span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span><span class="org-highlight-numbers-number">9</span>;
@ -1004,7 +1006,7 @@ wL = <span class="org-rainbow-delimiters-depth-1">(</span>s <span class="org-typ
</div> </div>
<div id="org9dc1a51" class="figure"> <div id="org3cb0b70" class="figure">
<p><img src="figs/weights_wl_wh.png" alt="weights_wl_wh.png" /> <p><img src="figs/weights_wl_wh.png" alt="weights_wl_wh.png" />
</p> </p>
<p><span class="figure-number">Figure 18: </span>Weights on the complementary filters \(w_L\) and \(w_H\) and the associated performance weights (<a href="./figs/weights_wl_wh.png">png</a>, <a href="./figs/weights_wl_wh.pdf">pdf</a>)</p> <p><span class="figure-number">Figure 18: </span>Weights on the complementary filters \(w_L\) and \(w_H\) and the associated performance weights (<a href="./figs/weights_wl_wh.png">png</a>, <a href="./figs/weights_wl_wh.pdf">pdf</a>)</p>
@ -1012,8 +1014,8 @@ wL = <span class="org-rainbow-delimiters-depth-1">(</span>s <span class="org-typ
</div> </div>
</div> </div>
<div id="outline-container-org17ecd06" class="outline-3"> <div id="outline-container-orgbd3b8d8" class="outline-3">
<h3 id="org17ecd06"><span class="section-number-3">4.3</span> H-Infinity Synthesis</h3> <h3 id="orgbd3b8d8"><span class="section-number-3">4.3</span> H-Infinity Synthesis</h3>
<div class="outline-text-3" id="text-4-3"> <div class="outline-text-3" id="text-4-3">
<p> <p>
We define the generalized plant \(P\) on matlab. We define the generalized plant \(P\) on matlab.
@ -1055,7 +1057,7 @@ Test bounds: 0.0000 &lt; gamma &lt;= 1.7285
</pre> </pre>
<p> <p>
We then define the high pass filter \(H_H = 1 - H_L\). The bode plot of both \(H_L\) and \(H_H\) is shown on figure <a href="#orge5933cc">19</a>. We then define the high pass filter \(H_H = 1 - H_L\). The bode plot of both \(H_L\) and \(H_H\) is shown on figure <a href="#orgc1ec9ab">19</a>.
</p> </p>
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-matlab">Hh_hinf = <span class="org-highlight-numbers-number">1</span> <span class="org-type">-</span> Hl_hinf; <pre class="src src-matlab">Hh_hinf = <span class="org-highlight-numbers-number">1</span> <span class="org-type">-</span> Hl_hinf;
@ -1064,15 +1066,15 @@ We then define the high pass filter \(H_H = 1 - H_L\). The bode plot of both \(H
</div> </div>
</div> </div>
<div id="outline-container-org844c90a" class="outline-3"> <div id="outline-container-org0d62ef6" class="outline-3">
<h3 id="org844c90a"><span class="section-number-3">4.4</span> Obtained Complementary Filters</h3> <h3 id="org0d62ef6"><span class="section-number-3">4.4</span> Obtained Complementary Filters</h3>
<div class="outline-text-3" id="text-4-4"> <div class="outline-text-3" id="text-4-4">
<p> <p>
The obtained complementary filters are shown on figure <a href="#orge5933cc">19</a>. The obtained complementary filters are shown on figure <a href="#orgc1ec9ab">19</a>.
</p> </p>
<div id="orge5933cc" class="figure"> <div id="orgc1ec9ab" class="figure">
<p><img src="figs/hinf_filters_results.png" alt="hinf_filters_results.png" /> <p><img src="figs/hinf_filters_results.png" alt="hinf_filters_results.png" />
</p> </p>
<p><span class="figure-number">Figure 19: </span>Obtained complementary filters using \(\mathcal{H}_\infty\) synthesis (<a href="./figs/hinf_filters_results.png">png</a>, <a href="./figs/hinf_filters_results.pdf">pdf</a>)</p> <p><span class="figure-number">Figure 19: </span>Obtained complementary filters using \(\mathcal{H}_\infty\) synthesis (<a href="./figs/hinf_filters_results.png">png</a>, <a href="./figs/hinf_filters_results.pdf">pdf</a>)</p>
@ -1081,11 +1083,11 @@ The obtained complementary filters are shown on figure <a href="#orge5933cc">19<
</div> </div>
</div> </div>
<div id="outline-container-orgd76dc0a" class="outline-2"> <div id="outline-container-orga65dbb6" class="outline-2">
<h2 id="orgd76dc0a"><span class="section-number-2">5</span> Feedback Control Architecture to generate Complementary Filters</h2> <h2 id="orga65dbb6"><span class="section-number-2">5</span> Feedback Control Architecture to generate Complementary Filters</h2>
<div class="outline-text-2" id="text-5"> <div class="outline-text-2" id="text-5">
<p> <p>
<a id="org94d0d5f"></a> <a id="org3e654dc"></a>
</p> </p>
<p> <p>
The idea is here to use the fact that in a classical feedback architecture, \(S + T = 1\), in order to design complementary filters. The idea is here to use the fact that in a classical feedback architecture, \(S + T = 1\), in order to design complementary filters.
@ -1102,12 +1104,12 @@ All the files (data and Matlab scripts) are accessible <a href="data/feedback_ge
</div> </div>
</div> </div>
<div id="outline-container-org2b0a54f" class="outline-3"> <div id="outline-container-orgec7fc24" class="outline-3">
<h3 id="org2b0a54f"><span class="section-number-3">5.1</span> Architecture</h3> <h3 id="orgec7fc24"><span class="section-number-3">5.1</span> Architecture</h3>
<div class="outline-text-3" id="text-5-1"> <div class="outline-text-3" id="text-5-1">
<div id="orgb7d4dd2" class="figure"> <div id="orgf3202e6" class="figure">
<p><img src="figs/complementary_filters_feedback_architecture.png" alt="complementary_filters_feedback_architecture.png" /> <p><img src="figs-tikz/complementary_filters_feedback_architecture.png" alt="complementary_filters_feedback_architecture.png" />
</p> </p>
<p><span class="figure-number">Figure 20: </span>Architecture used to generate the complementary filters</p> <p><span class="figure-number">Figure 20: </span>Architecture used to generate the complementary filters</p>
</div> </div>
@ -1133,8 +1135,8 @@ Which contains two integrator and a lead. \(\omega_c\) is used to tune the cross
</div> </div>
</div> </div>
<div id="outline-container-org023d478" class="outline-3"> <div id="outline-container-org448cd20" class="outline-3">
<h3 id="org023d478"><span class="section-number-3">5.2</span> Loop Gain Design</h3> <h3 id="org448cd20"><span class="section-number-3">5.2</span> Loop Gain Design</h3>
<div class="outline-text-3" id="text-5-2"> <div class="outline-text-3" id="text-5-2">
<p> <p>
Let's first define the loop gain \(L\). Let's first define the loop gain \(L\).
@ -1148,7 +1150,7 @@ L = <span class="org-rainbow-delimiters-depth-1">(</span>wc<span class="org-type
</div> </div>
<div id="org5563034" class="figure"> <div id="orgc090be3" class="figure">
<p><img src="figs/loop_gain_bode_plot.png" alt="loop_gain_bode_plot.png" /> <p><img src="figs/loop_gain_bode_plot.png" alt="loop_gain_bode_plot.png" />
</p> </p>
<p><span class="figure-number">Figure 21: </span>Bode plot of the loop gain \(L\) (<a href="./figs/loop_gain_bode_plot.png">png</a>, <a href="./figs/loop_gain_bode_plot.pdf">pdf</a>)</p> <p><span class="figure-number">Figure 21: </span>Bode plot of the loop gain \(L\) (<a href="./figs/loop_gain_bode_plot.png">png</a>, <a href="./figs/loop_gain_bode_plot.pdf">pdf</a>)</p>
@ -1156,8 +1158,8 @@ L = <span class="org-rainbow-delimiters-depth-1">(</span>wc<span class="org-type
</div> </div>
</div> </div>
<div id="outline-container-orgef15574" class="outline-3"> <div id="outline-container-org1ec0e07" class="outline-3">
<h3 id="orgef15574"><span class="section-number-3">5.3</span> Complementary Filters Obtained</h3> <h3 id="org1ec0e07"><span class="section-number-3">5.3</span> Complementary Filters Obtained</h3>
<div class="outline-text-3" id="text-5-3"> <div class="outline-text-3" id="text-5-3">
<p> <p>
We then compute the resulting low pass and high pass filters. We then compute the resulting low pass and high pass filters.
@ -1169,7 +1171,7 @@ Hh = <span class="org-highlight-numbers-number">1</span><span class="org-type">/
</div> </div>
<div id="org7a3c2de" class="figure"> <div id="org84c20e0" class="figure">
<p><img src="figs/low_pass_high_pass_filters.png" alt="low_pass_high_pass_filters.png" /> <p><img src="figs/low_pass_high_pass_filters.png" alt="low_pass_high_pass_filters.png" />
</p> </p>
<p><span class="figure-number">Figure 22: </span>Low pass and High pass filters \(H_L\) and \(H_H\) for different values of \(\alpha\) (<a href="./figs/low_pass_high_pass_filters.png">png</a>, <a href="./figs/low_pass_high_pass_filters.pdf">pdf</a>)</p> <p><span class="figure-number">Figure 22: </span>Low pass and High pass filters \(H_L\) and \(H_H\) for different values of \(\alpha\) (<a href="./figs/low_pass_high_pass_filters.png">png</a>, <a href="./figs/low_pass_high_pass_filters.pdf">pdf</a>)</p>
@ -1178,16 +1180,16 @@ Hh = <span class="org-highlight-numbers-number">1</span><span class="org-type">/
</div> </div>
</div> </div>
<div id="outline-container-org9a4e0ed" class="outline-2"> <div id="outline-container-org3b324a8" class="outline-2">
<h2 id="org9a4e0ed"><span class="section-number-2">6</span> Analytical Formula found in the literature</h2> <h2 id="org3b324a8"><span class="section-number-2">6</span> Analytical Formula found in the literature</h2>
<div class="outline-text-2" id="text-6"> <div class="outline-text-2" id="text-6">
<p> <p>
<a id="orga144d76"></a> <a id="org22f6020"></a>
</p> </p>
</div> </div>
<div id="outline-container-orgfa54829" class="outline-3"> <div id="outline-container-org8d499d4" class="outline-3">
<h3 id="orgfa54829"><span class="section-number-3">6.1</span> Analytical Formula</h3> <h3 id="org8d499d4"><span class="section-number-3">6.1</span> Analytical Formula</h3>
<div class="outline-text-3" id="text-6-1"> <div class="outline-text-3" id="text-6-1">
<p> <p>
<a class='org-ref-reference' href="#min15_compl_filter_desig_angle_estim">min15_compl_filter_desig_angle_estim</a> <a class='org-ref-reference' href="#min15_compl_filter_desig_angle_estim">min15_compl_filter_desig_angle_estim</a>
@ -1236,8 +1238,8 @@ Hh = <span class="org-highlight-numbers-number">1</span><span class="org-type">/
</div> </div>
</div> </div>
<div id="outline-container-org5286b79" class="outline-3"> <div id="outline-container-org60e2ce0" class="outline-3">
<h3 id="org5286b79"><span class="section-number-3">6.2</span> Matlab</h3> <h3 id="org60e2ce0"><span class="section-number-3">6.2</span> Matlab</h3>
<div class="outline-text-3" id="text-6-2"> <div class="outline-text-3" id="text-6-2">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-matlab">omega0 = <span class="org-highlight-numbers-number">1</span><span class="org-type">*</span><span class="org-highlight-numbers-number">2</span><span class="org-type">*</span><span class="org-constant">pi</span>; <span class="org-comment">% [rad/s]</span> <pre class="src src-matlab">omega0 = <span class="org-highlight-numbers-number">1</span><span class="org-type">*</span><span class="org-highlight-numbers-number">2</span><span class="org-type">*</span><span class="org-constant">pi</span>; <span class="org-comment">% [rad/s]</span>
@ -1255,7 +1257,7 @@ HL3 = <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-high
</div> </div>
<div id="orge38d4ce" class="figure"> <div id="org5dd1179" class="figure">
<p><img src="figs/comp_filters_literature.png" alt="comp_filters_literature.png" /> <p><img src="figs/comp_filters_literature.png" alt="comp_filters_literature.png" />
</p> </p>
<p><span class="figure-number">Figure 23: </span>Comparison of some complementary filters found in the literature (<a href="./figs/comp_filters_literature.png">png</a>, <a href="./figs/comp_filters_literature.pdf">pdf</a>)</p> <p><span class="figure-number">Figure 23: </span>Comparison of some complementary filters found in the literature (<a href="./figs/comp_filters_literature.png">png</a>, <a href="./figs/comp_filters_literature.pdf">pdf</a>)</p>
@ -1263,8 +1265,8 @@ HL3 = <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-high
</div> </div>
</div> </div>
<div id="outline-container-org6092cef" class="outline-3"> <div id="outline-container-org1038fe9" class="outline-3">
<h3 id="org6092cef"><span class="section-number-3">6.3</span> Discussion</h3> <h3 id="org1038fe9"><span class="section-number-3">6.3</span> Discussion</h3>
<div class="outline-text-3" id="text-6-3"> <div class="outline-text-3" id="text-6-3">
<p> <p>
Analytical Formula found in the literature provides either no parameter for tuning the robustness / performance trade-off. Analytical Formula found in the literature provides either no parameter for tuning the robustness / performance trade-off.
@ -1273,11 +1275,11 @@ Analytical Formula found in the literature provides either no parameter for tuni
</div> </div>
</div> </div>
<div id="outline-container-orgbbfeb6f" class="outline-2"> <div id="outline-container-org647d1a0" class="outline-2">
<h2 id="orgbbfeb6f"><span class="section-number-2">7</span> Comparison of the different methods of synthesis</h2> <h2 id="org647d1a0"><span class="section-number-2">7</span> Comparison of the different methods of synthesis</h2>
<div class="outline-text-2" id="text-7"> <div class="outline-text-2" id="text-7">
<p> <p>
<a id="orgfee2d57"></a> <a id="orgcbb346f"></a>
The generated complementary filters using \(\mathcal{H}_\infty\) and the analytical formulas are very close to each other. However there is some difference to note here: The generated complementary filters using \(\mathcal{H}_\infty\) and the analytical formulas are very close to each other. However there is some difference to note here:
</p> </p>
<ul class="org-ul"> <ul class="org-ul">
@ -1286,6 +1288,7 @@ The generated complementary filters using \(\mathcal{H}_\infty\) and the analyti
</ul> </ul>
</div> </div>
</div> </div>
<p> <p>
<h1 class='org-ref-bib-h1'>Bibliography</h1> <h1 class='org-ref-bib-h1'>Bibliography</h1>
@ -1300,7 +1303,7 @@ The generated complementary filters using \(\mathcal{H}_\infty\) and the analyti
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: Thomas Dehaeze</p> <p class="author">Author: Thomas Dehaeze</p>
<p class="date">Created: 2019-08-14 mer. 12:13</p> <p class="date">Created: 2019-08-21 mer. 13:17</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

View File

@ -1,4 +1,4 @@
#+TITLE: On the Design of Complementary Filters for Control - Computation with Matlab #+TITLE: Robust and Optimal Sensor Fusion - Matlab Computation
:DRAWER: :DRAWER:
#+HTML_LINK_HOME: ../index.html #+HTML_LINK_HOME: ../index.html
#+HTML_LINK_UP: ../index.html #+HTML_LINK_UP: ../index.html
@ -92,13 +92,13 @@ $n_1$ and $n_2$ are white noise (constant power spectral density over all freque
#+name: fig:fusion_two_noisy_sensors_with_dyn #+name: fig:fusion_two_noisy_sensors_with_dyn
#+caption: Fusion of two sensors #+caption: Fusion of two sensors
[[file:figs/fusion_two_noisy_sensors_with_dyn.png]] [[file:figs-tikz/fusion_two_noisy_sensors_with_dyn.png]]
We consider that the two sensor dynamics $G_1$ and $G_2$ are ideal ($G_1 = G_2 = 1$). We obtain the architecture of figure [[fig:fusion_two_noisy_sensors]]. We consider that the two sensor dynamics $G_1$ and $G_2$ are ideal ($G_1 = G_2 = 1$). We obtain the architecture of figure [[fig:fusion_two_noisy_sensors]].
#+name: fig:fusion_two_noisy_sensors #+name: fig:fusion_two_noisy_sensors
#+caption: Fusion of two sensors with ideal dynamics #+caption: Fusion of two sensors with ideal dynamics
[[file:figs/fusion_two_noisy_sensors.png]] [[file:figs-tikz/fusion_two_noisy_sensors.png]]
$H_1$ and $H_2$ are complementary filters ($H_1 + H_2 = 1$). The goal is to design $H_1$ and $H_2$ such that the effect of the noise sources $n_1$ and $n_2$ has the smallest possible effect on the estimation $\hat{x}$. $H_1$ and $H_2$ are complementary filters ($H_1 + H_2 = 1$). The goal is to design $H_1$ and $H_2$ such that the effect of the noise sources $n_1$ and $n_2$ has the smallest possible effect on the estimation $\hat{x}$.
@ -162,7 +162,7 @@ We use the generalized plant architecture shown on figure [[fig:h_infinity_optim
#+name: fig:h_infinity_optimal_comp_filters #+name: fig:h_infinity_optimal_comp_filters
#+caption: $\mathcal{H}_2$ Synthesis - Generalized plant used for the optimal generation of complementary filters #+caption: $\mathcal{H}_2$ Synthesis - Generalized plant used for the optimal generation of complementary filters
[[file:figs/h_infinity_optimal_comp_filters.png]] [[file:figs-tikz/h_infinity_optimal_comp_filters.png]]
The transfer function from $[n_1, n_2]$ to $\hat{x}$ is: The transfer function from $[n_1, n_2]$ to $\hat{x}$ is:
\[ \begin{bmatrix} W_1 H_1 \\ W_2 (1 - H_1) \end{bmatrix} \] \[ \begin{bmatrix} W_1 H_1 \\ W_2 (1 - H_1) \end{bmatrix} \]
@ -249,6 +249,7 @@ The optimal sensor fusion has permitted to reduced the RMS value of the estimati
| Sensor 1 | 1.1e-02 | | Sensor 1 | 1.1e-02 |
| Sensor 2 | 1.3e-03 | | Sensor 2 | 1.3e-03 |
| Optimal Sensor Fusion | 1.5e-04 | | Optimal Sensor Fusion | 1.5e-04 |
* Robustness to sensor dynamics uncertainty * Robustness to sensor dynamics uncertainty
:PROPERTIES: :PROPERTIES:
:header-args:matlab+: :tangle matlab/comp_filter_robustness.m :header-args:matlab+: :tangle matlab/comp_filter_robustness.m
@ -327,7 +328,7 @@ Let's represent that with multiplicative input uncertainty as shown on figure [[
#+name: fig:fusion_gain_mismatch #+name: fig:fusion_gain_mismatch
#+caption: Fusion of two sensors with input multiplicative uncertainty #+caption: Fusion of two sensors with input multiplicative uncertainty
[[file:figs/fusion_gain_mismatch.png]] [[file:figs-tikz/fusion_gain_mismatch.png]]
We have: We have:
\begin{align*} \begin{align*}
@ -360,7 +361,7 @@ We then have that the angle introduced by the super sensor is bounded by $\arcsi
#+name: fig:uncertainty_gain_phase_variation #+name: fig:uncertainty_gain_phase_variation
#+caption: Maximum phase variation #+caption: Maximum phase variation
[[file:figs/uncertainty_gain_phase_variation.png]] [[file:figs-tikz/uncertainty_gain_phase_variation.png]]
Thus, we choose should choose $\epsilon$ so that the maximum phase uncertainty introduced by the sensors is of an acceptable value. Thus, we choose should choose $\epsilon$ so that the maximum phase uncertainty introduced by the sensors is of an acceptable value.
@ -765,7 +766,7 @@ In order to do so, we use the generalized plant shown on figure [[fig:sf_hinf_fi
#+name: fig:sf_hinf_filters_plant_b #+name: fig:sf_hinf_filters_plant_b
#+caption: Generalized plant used for the $\mathcal{H}_\infty$ synthesis of the complementary filters #+caption: Generalized plant used for the $\mathcal{H}_\infty$ synthesis of the complementary filters
[[file:figs/sf_hinf_filters_plant_b.png]] [[file:figs-tikz/sf_hinf_filters_plant_b.png]]
The $\mathcal{H}_\infty$ synthesis applied on this generalized plant will give a transfer function $H_L$ (figure [[fig:sf_hinf_filters_b]]) such that the $\mathcal{H}_\infty$ norm of the transfer function from $w$ to $[z_H,\ z_L]$ is less than one: The $\mathcal{H}_\infty$ synthesis applied on this generalized plant will give a transfer function $H_L$ (figure [[fig:sf_hinf_filters_b]]) such that the $\mathcal{H}_\infty$ norm of the transfer function from $w$ to $[z_H,\ z_L]$ is less than one:
\[ \left\| \begin{array}{c} H_L w_L \\ (1 - H_L) w_H \end{array} \right\|_\infty < 1 \] \[ \left\| \begin{array}{c} H_L w_L \\ (1 - H_L) w_H \end{array} \right\|_\infty < 1 \]
@ -782,7 +783,7 @@ We then see that $w_L$ and $w_H$ can be used to shape both $H_L$ and $H_H$ while
#+name: fig:sf_hinf_filters_b #+name: fig:sf_hinf_filters_b
#+caption: $\mathcal{H}_\infty$ synthesis of the complementary filters #+caption: $\mathcal{H}_\infty$ synthesis of the complementary filters
[[file:figs/sf_hinf_filters_b.png]] [[file:figs-tikz/sf_hinf_filters_b.png]]
** Weights ** Weights
@ -934,7 +935,7 @@ Thus, all the tools that has been developed for classical feedback control can b
** Architecture ** Architecture
#+name: fig:complementary_filters_feedback_architecture #+name: fig:complementary_filters_feedback_architecture
#+caption: Architecture used to generate the complementary filters #+caption: Architecture used to generate the complementary filters
[[file:figs/complementary_filters_feedback_architecture.png]] [[file:figs-tikz/complementary_filters_feedback_architecture.png]]
We have: We have:
\[ y = \underbrace{\frac{L}{L + 1}}_{H_L} y_1 + \underbrace{\frac{1}{L + 1}}_{H_H} y_2 \] \[ y = \underbrace{\frac{L}{L + 1}}_{H_L} y_1 + \underbrace{\frac{1}{L + 1}}_{H_H} y_2 \]
@ -1138,6 +1139,7 @@ Analytical Formula found in the literature provides either no parameter for tuni
The generated complementary filters using $\mathcal{H}_\infty$ and the analytical formulas are very close to each other. However there is some difference to note here: The generated complementary filters using $\mathcal{H}_\infty$ and the analytical formulas are very close to each other. However there is some difference to note here:
- the analytical formula provides a very simple way to generate the complementary filters (and thus the controller), they could even be used to tune the controller online using the parameters $\alpha$ and $\omega_0$. However, these formula have the property that $|H_H|$ and $|H_L|$ are symmetrical with the frequency $\omega_0$ which may not be desirable. - the analytical formula provides a very simple way to generate the complementary filters (and thus the controller), they could even be used to tune the controller online using the parameters $\alpha$ and $\omega_0$. However, these formula have the property that $|H_H|$ and $|H_L|$ are symmetrical with the frequency $\omega_0$ which may not be desirable.
- while the $\mathcal{H}_\infty$ synthesis of the complementary filters is not as straightforward as using the analytical formula, it provides a more optimized procedure to obtain the complementary filters - while the $\mathcal{H}_\infty$ synthesis of the complementary filters is not as straightforward as using the analytical formula, it provides a more optimized procedure to obtain the complementary filters
* Bibliography :ignore: * Bibliography :ignore:
bibliographystyle:unsrt bibliographystyle:unsrt
bibliography:ref.bib bibliography:ref.bib