dehaeze20_optim_robus_compl.../matlab/index.html

1308 lines
70 KiB
HTML
Raw Normal View History

2019-08-14 12:08:30 +02:00
<?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>
<!-- 2019-08-14 mer. 12:13 -->
2019-08-14 12:08:30 +02:00
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>On the Design of Complementary Filters for Control - Computation with Matlab</title>
<meta name="generator" content="Org mode" />
<meta name="author" content="Thomas Dehaeze" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}
pre.src {
position: relative;
overflow: visible;
padding-top: 1.2em;
}
pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}
pre.src:hover:before { display: inline;}
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.equation-container {
display: table;
text-align: center;
width: 100%;
}
.equation {
vertical-align: middle;
}
.equation-label {
display: table-cell;
text-align: right;
vertical-align: middle;
}
.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}
#org-div-home-and-up
{ text-align: right; font-size: 70%; white-space: nowrap; }
textarea { overflow-x: auto; }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00; }
.org-info-js_info-navigation { border-style: none; }
#org-info-js_console-label
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }
/*]]>*/-->
</style>
<link rel="stylesheet" type="text/css" href="../css/htmlize.css"/>
<link rel="stylesheet" type="text/css" href="../css/readtheorg.css"/>
<script src="../js/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.stickytableheaders.min.js"></script>
<script src="../js/readtheorg.js"></script>
<script type="text/javascript">
/*
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2019 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
@licend The above is the entire license notice
for the JavaScript code in this tag.
*/
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
displayAlign: "center",
displayIndent: "0em",
"HTML-CSS": { scale: 100,
linebreaks: { automatic: "false" },
webFont: "TeX"
},
SVG: {scale: 100,
linebreaks: { automatic: "false" },
font: "TeX"},
NativeMML: {scale: 100},
TeX: { equationNumbers: {autoNumber: "AMS"},
MultLineWidth: "85%",
TagSide: "right",
TagIndent: ".8em"
}
});
</script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"></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">On the Design of Complementary Filters for Control - Computation with Matlab</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org8101fe3">1. Optimal Sensor Fusion for noise characteristics</a>
2019-08-14 12:08:30 +02:00
<ul>
<li><a href="#orgda648ce">1.1. Architecture</a></li>
<li><a href="#org7737a79">1.2. Noise of the sensors</a></li>
<li><a href="#orgf85a7f2">1.3. H-Two Synthesis</a></li>
<li><a href="#org9fcdb98">1.4. Analysis</a></li>
2019-08-14 12:08:30 +02:00
</ul>
</li>
<li><a href="#org7d49713">2. Robustness to sensor dynamics uncertainty</a>
2019-08-14 12:08:30 +02:00
<ul>
<li><a href="#orgc1b9515">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="#org0328fd7">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>
2019-08-14 12:08:30 +02:00
</ul>
</li>
<li><a href="#org6d8c8af">3. Complementary filters using analytical formula</a>
2019-08-14 12:08:30 +02:00
<ul>
<li><a href="#orgb288402">3.1. Analytical 1st order complementary filters</a></li>
<li><a href="#orgefd1169">3.2. Second Order Complementary Filters</a></li>
<li><a href="#org32c14e8">3.3. Third Order Complementary Filters</a></li>
2019-08-14 12:08:30 +02:00
</ul>
</li>
<li><a href="#orgc86d54b">4. H-Infinity synthesis of complementary filters</a>
2019-08-14 12:08:30 +02:00
<ul>
<li><a href="#org2288026">4.1. Synthesis Architecture</a></li>
<li><a href="#orga9b0474">4.2. Weights</a></li>
<li><a href="#org17ecd06">4.3. H-Infinity Synthesis</a></li>
<li><a href="#org844c90a">4.4. Obtained Complementary Filters</a></li>
2019-08-14 12:08:30 +02:00
</ul>
</li>
<li><a href="#orgd76dc0a">5. Feedback Control Architecture to generate Complementary Filters</a>
2019-08-14 12:08:30 +02:00
<ul>
<li><a href="#org2b0a54f">5.1. Architecture</a></li>
<li><a href="#org023d478">5.2. Loop Gain Design</a></li>
<li><a href="#orgef15574">5.3. Complementary Filters Obtained</a></li>
2019-08-14 12:08:30 +02:00
</ul>
</li>
<li><a href="#org9a4e0ed">6. Analytical Formula found in the literature</a>
<ul>
<li><a href="#orgfa54829">6.1. Analytical Formula</a></li>
<li><a href="#org5286b79">6.2. Matlab</a></li>
<li><a href="#org6092cef">6.3. Discussion</a></li>
</ul>
</li>
<li><a href="#orgbbfeb6f">7. Comparison of the different methods of synthesis</a></li>
2019-08-14 12:08:30 +02:00
</ul>
</div>
</div>
<p>
In this document, the design of complementary filters is studied.
</p>
<p>
One use of complementary filter is described below:
</p>
<blockquote>
<p>
The basic idea of a complementary filter involves taking two or more sensors, filtering out unreliable frequencies for each sensor, and combining the filtered outputs to get a better estimate throughout the entire bandwidth of the system.
To achieve this, the sensors included in the filter should complement one another by performing better over specific parts of the system bandwidth.
</p>
</blockquote>
<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>
2019-08-14 12:08:30 +02:00
</ul>
<p>
When blending two sensors using complementary filters with unknown dynamics, phase lag may be introduced that renders the close-loop system unstable.
</p>
<ul class="org-ul">
<li>in section <a href="#orgc67c206">2</a>, the blending robustness to sensor dynamic uncertainty is studied.</li>
2019-08-14 12:08:30 +02:00
</ul>
<p>
Then, three design methods for generating two complementary filters are proposed:
</p>
<ul class="org-ul">
<li>in section <a href="#org91a8313">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="#org94d0d5f">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>
2019-08-14 12:08:30 +02:00
</ul>
<div id="outline-container-org8101fe3" class="outline-2">
<h2 id="org8101fe3"><span class="section-number-2">1</span> Optimal Sensor Fusion for noise characteristics</h2>
2019-08-14 12:08:30 +02:00
<div class="outline-text-2" id="text-1">
<p>
<a id="orgc9381ca"></a>
2019-08-14 12:08:30 +02:00
</p>
<p>
The idea is to combine sensors that works in different frequency range using complementary filters.
</p>
<p>
Doing so, one "super sensor" is obtained that can have better noise characteristics than the individual sensors over a large frequency range.
</p>
<p>
The complementary filters have to be designed in order to minimize the effect noise of each sensor on the super sensor noise.
</p>
<div class="note">
<p>
All the files (data and Matlab scripts) are accessible <a href="data/optimal_comp_filters.zip">here</a>.
</p>
</div>
</div>
<div id="outline-container-orgda648ce" class="outline-3">
<h3 id="orgda648ce"><span class="section-number-3">1.1</span> Architecture</h3>
2019-08-14 12:08:30 +02:00
<div class="outline-text-3" id="text-1-1">
<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\).
2019-08-14 12:08:30 +02:00
</p>
<p>
\(n_1\) and \(n_2\) are white noise (constant power spectral density over all frequencies).
</p>
<div id="org0214c79" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/fusion_two_noisy_sensors_with_dyn.png" alt="fusion_two_noisy_sensors_with_dyn.png" />
</p>
<p><span class="figure-number">Figure 1: </span>Fusion of two sensors</p>
</div>
<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>.
2019-08-14 12:08:30 +02:00
</p>
<div id="org8edd1ad" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/fusion_two_noisy_sensors.png" alt="fusion_two_noisy_sensors.png" />
</p>
<p><span class="figure-number">Figure 2: </span>Fusion of two sensors with ideal dynamics</p>
</div>
<p>
\(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}\).
</p>
<p>
We have that the Power Spectral Density (PSD) of \(\hat{x}\) is:
\[ \Gamma_{\hat{x}} = |H_1 W_1|^2 \Gamma_{n_1} + |H_2 W_2|^2 \Gamma_{n_2} \]
</p>
<p>
And the goal is the minimize the Root Mean Square (RMS) value of \(\hat{x}\):
\[ \sigma_{\hat{x}} = \sqrt{\int_0^\infty \Gamma_{\hat{x}}(\omega) d\omega} \]
</p>
<p>
As \(n_1\) and \(n_2\) are white noise: \(\Gamma_{n_1} = \Gamma_{n_2} = 1\) and we have:
\[ \sigma_{\hat{x}} = \sqrt{\int_0^\infty |H_1 W_1|^2(\omega) + |H_2 W_2|^2(\omega) d\omega} = \left\| \begin{matrix} H_1 W_1 \\ H_2 W_2 \end{matrix} \right\|_2 \]
</p>
<p>
Thus, the goal is to design \(H_1\) and \(H_2\) such that \(H_1 + H_2 = 1\) and such that \(\left\| \begin{matrix} H_1 W_1 \\ H_2 W_2 \end{matrix} \right\|_2\) is minimized.
</p>
<p>
For that, we will use the \(\mathcal{H}_2\) Synthesis.
</p>
</div>
</div>
<div id="outline-container-org7737a79" class="outline-3">
<h3 id="org7737a79"><span class="section-number-3">1.2</span> Noise of the sensors</h3>
2019-08-14 12:08:30 +02:00
<div class="outline-text-3" id="text-1-2">
<p>
Let's define the noise characteristics of the two sensors by choosing \(W_1\) and \(W_2\):
</p>
<ul class="org-ul">
<li>Sensor 1 characterized by \(W_1\) has low noise at low frequency (for instance a geophone)</li>
<li>Sensor 2 characterized by \(W_2\) has low noise at high frequency (for instance an accelerometer)</li>
</ul>
<div class="org-src-container">
<pre class="src src-matlab">omegac = <span class="org-highlight-numbers-number">100</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>; G0 = <span class="org-highlight-numbers-number">1e</span><span class="org-type">-</span><span class="org-highlight-numbers-number">5</span>; Ginf = <span class="org-highlight-numbers-number">1e</span><span class="org-type">-</span><span class="org-highlight-numbers-number">4</span>;
W1 = <span class="org-rainbow-delimiters-depth-1">(</span>Ginf<span class="org-type">*</span>s<span class="org-type">/</span>omegac <span class="org-type">+</span> G0<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">/</span><span class="org-rainbow-delimiters-depth-1">(</span>s<span class="org-type">/</span>omegac <span class="org-type">+</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">/</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-highlight-numbers-number">1</span> <span class="org-type">+</span> s<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-type">/</span><span class="org-highlight-numbers-number">4000</span><span class="org-rainbow-delimiters-depth-1">)</span>;
omegac = <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>; G0 = <span class="org-highlight-numbers-number">1e</span><span class="org-type">-</span><span class="org-highlight-numbers-number">3</span>; Ginf = <span class="org-highlight-numbers-number">1e</span><span class="org-type">-</span><span class="org-highlight-numbers-number">8</span>;
W2 = <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>sqrt<span class="org-rainbow-delimiters-depth-3">(</span>Ginf<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-type">*</span>s<span class="org-type">/</span>omegac <span class="org-type">+</span> sqrt<span class="org-rainbow-delimiters-depth-3">(</span>G0<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">/</span><span class="org-rainbow-delimiters-depth-2">(</span>s<span class="org-type">/</span>omegac <span class="org-type">+</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">^</span><span class="org-highlight-numbers-number">2</span><span class="org-type">/</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-highlight-numbers-number">1</span> <span class="org-type">+</span> s<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-type">/</span><span class="org-highlight-numbers-number">4000</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">^</span><span class="org-highlight-numbers-number">2</span>;
</pre>
</div>
<div id="org535b437" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/nosie_characteristics_sensors.png" alt="nosie_characteristics_sensors.png" />
</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>
</div>
</div>
</div>
<div id="outline-container-orgf85a7f2" class="outline-3">
<h3 id="orgf85a7f2"><span class="section-number-3">1.3</span> H-Two Synthesis</h3>
2019-08-14 12:08:30 +02:00
<div class="outline-text-3" id="text-1-3">
<p>
We use the generalized plant architecture shown on figure <a href="#org178bd58">4</a>.
2019-08-14 12:08:30 +02:00
</p>
<div id="org178bd58" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/h_infinity_optimal_comp_filters.png" alt="h_infinity_optimal_comp_filters.png" />
</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>
<p>
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} \]
If we define \(H_2 = 1 - H_1\), we obtain:
\[ \begin{bmatrix} W_1 H_1 \\ W_2 H_2 \end{bmatrix} \]
</p>
<p>
Thus, if we minimize the \(\mathcal{H}_2\) norm of this transfer function, we minimize the RMS value of \(\hat{x}\).
</p>
<p>
We define the generalized plant \(P\) on matlab as shown on figure <a href="#org178bd58">4</a>.
2019-08-14 12:08:30 +02:00
</p>
<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>;
W1 <span class="org-type">-</span>W2 <span class="org-highlight-numbers-number">0</span><span class="org-rainbow-delimiters-depth-1">]</span>;
</pre>
</div>
<p>
And we do the \(\mathcal{H}_2\) synthesis using the <code>h2syn</code> command.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-rainbow-delimiters-depth-1">[</span>H1, <span class="org-type">~</span>, gamma<span class="org-rainbow-delimiters-depth-1">]</span> = h2syn<span class="org-rainbow-delimiters-depth-1">(</span>P, <span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<p>
What is minimized is <code>norm([W1*H1,W2*H2], 2)</code>.
</p>
<p>
Finally, we define \(H_2 = 1 - H_1\).
</p>
<div class="org-src-container">
<pre class="src src-matlab">H2 = <span class="org-highlight-numbers-number">1</span> <span class="org-type">-</span> H1;
</pre>
</div>
</div>
</div>
<div id="outline-container-org9fcdb98" class="outline-3">
<h3 id="org9fcdb98"><span class="section-number-3">1.4</span> Analysis</h3>
2019-08-14 12:08:30 +02:00
<div class="outline-text-3" id="text-1-4">
<p>
The complementary filters obtained are shown on figure <a href="#org3f036f9">5</a>. The PSD of the <a href="#org272e8f4">6</a>.
Finally, the RMS value of \(\hat{x}\) is shown on table <a href="#orgf88e62b">1</a>.
2019-08-14 12:08:30 +02:00
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>
<div id="org3f036f9" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/htwo_comp_filters.png" alt="htwo_comp_filters.png" />
</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 id="org272e8f4" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/psd_sensors_htwo_synthesis.png" alt="psd_sensors_htwo_synthesis.png" />
</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>
<table id="orgf88e62b" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
2019-08-14 12:08:30 +02:00
<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>
<col class="org-left" />
<col class="org-right" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">&#xa0;</th>
<th scope="col" class="org-right">rms value</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">Sensor 1</td>
<td class="org-right">1.1e-02</td>
</tr>
<tr>
<td class="org-left">Sensor 2</td>
<td class="org-right">1.3e-03</td>
</tr>
<tr>
<td class="org-left">Optimal Sensor Fusion</td>
<td class="org-right">1.5e-04</td>
</tr>
</tbody>
</table>
</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>
2019-08-14 12:08:30 +02:00
<div class="outline-text-2" id="text-2">
<p>
<a id="orgc67c206"></a>
2019-08-14 12:08:30 +02:00
</p>
<p>
Let's first consider ideal sensors where \(G_1 = 1\) and \(G_2 = 1\) (figure <a href="#orgd65643e">7</a>).
2019-08-14 12:08:30 +02:00
</p>
<div id="orgd65643e" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/fusion_two_noisy_sensors_with_dyn_bis.png" alt="fusion_two_noisy_sensors_with_dyn_bis.png" />
</p>
<p><span class="figure-number">Figure 7: </span>Fusion of two sensors</p>
</div>
<p>
We then have:
</p>
\begin{align*}
\hat{x} &= (x + n_1) H_1 + (x + n_2) H_2 \\
&= x + n_1 H_1 + n_2 H_2
\end{align*}
<p>
So the estimation error is
\[ \delta_x = \hat{x} - x = n_1 H_1 + n_2 H_2 \]
</p>
<p>
And we see that the complementary filters are only shaping the noise and that they do not impact the transfer function from \(x\) to \(\hat{x}\) that is in the feedback path.
</p>
<div class="note">
<p>
All the files (data and Matlab scripts) are accessible <a href="data/comp_filter_robustness.zip">here</a>.
</p>
</div>
</div>
<div id="outline-container-orgc1b9515" class="outline-3">
<h3 id="orgc1b9515"><span class="section-number-3">2.1</span> Unknown sensor dynamics dynamics</h3>
2019-08-14 12:08:30 +02:00
<div class="outline-text-3" id="text-2-1">
<p>
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>.
2019-08-14 12:08:30 +02:00
</p>
<div id="org0cb23aa" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/fusion_gain_mismatch.png" alt="fusion_gain_mismatch.png" />
</p>
<p><span class="figure-number">Figure 8: </span>Fusion of two sensors with input multiplicative uncertainty</p>
</div>
<p>
We have:
</p>
\begin{align*}
\frac{\hat{x}}{x} &= (1 + W_1 \Delta_1) H_1 + (1 + W_2 \Delta_2) H_2 \\
&= 1 + W_1 H_1 \Delta_1 + W_2 H_2 \Delta_2
\end{align*}
<p>
With \(\Delta_i\) is any transfer function satisfying \(\| \Delta_i \|_\infty < 1\).
</p>
<p>
We see that as soon as we have some uncertainty in the sensor dynamics, we have that the complementary filters have some effect on the transfer function from \(x\) to \(\hat{x}\).
</p>
<p>
We want that the super sensor transfer function has a gain of 1 and no phase variation over all the frequencies:
\[ \frac{\hat{x}}{x} \approx 1 \]
</p>
<p>
Thus, we want that
</p>
\begin{align*}
& |W_1 H_1 \Delta_1 + W_2 H_2 \Delta_2| < \epsilon \quad \forall \omega, \forall \Delta_i, \|\Delta_i\|_\infty < 1 \\
\Longleftrightarrow & |W_1 H_1| + |W_2 H_2| < \epsilon \quad \forall \omega
\end{align*}
<p>
Which is approximately the same as requiring
\[ \left\| \begin{matrix} W_1 H_1 \\ W_2 H_2 \end{matrix} \right\|_\infty < \epsilon \]
</p>
<p>
<b>How small should we choose \(\epsilon\)?</b>
</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>).
2019-08-14 12:08:30 +02:00
</p>
<p>
We then have that the angle introduced by the super sensor is bounded by \(\arcsin(\epsilon)\):
\[ \angle \frac{\hat{x}}{x} \le \arcsin (\epsilon) \quad \forall \omega \]
</p>
<div id="orge9b44f9" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/uncertainty_gain_phase_variation.png" alt="uncertainty_gain_phase_variation.png" />
</p>
<p><span class="figure-number">Figure 9: </span>Maximum phase variation</p>
</div>
<p>
Thus, we choose should choose \(\epsilon\) so that the maximum phase uncertainty introduced by the sensors is of an acceptable value.
</p>
</div>
</div>
<div id="outline-container-org5df7619" 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>
2019-08-14 12:08:30 +02:00
<div class="outline-text-3" id="text-2-2">
<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\).
</p>
<p>
If we want to have a maximum phase introduced by the sensors of 20 degrees, we have to design \(H_1\) and \(H_2\) such that:
</p>
\begin{align*}
& arcsin(|H_1 W_1| + |H_2 W_2|) < 20 \text{ deg} \\
\Longleftrightarrow & |H_1 W_1| + |H_2 W_2| < 0.34
\end{align*}
<p>
We can do that with the \(\mathcal{H}_\infty\) synthesis by setting upper bounds on the complementary filters using weights that corresponds to the sensor dynamics uncertainty.
</p>
<p>
For simplicity, let's suppose \(W_1(s) = W_2(s) = 0.1\) (\(10\%\) uncertainty in the sensor gain).
\[ |H_1 W_1| + |H_2 W_2| < 3.4 \]
</p>
<p>
Thus, by limiting the norm of the complementary filters, we can limit the maximum unwanted phase introduced by the uncertainty on the sensors dynamics.
</p>
<p>
This is of primary importance in order to ensure the stability of the feedback loop using the super sensor signal.
</p>
</div>
</div>
<div id="outline-container-org0328fd7" class="outline-3">
<h3 id="org0328fd7"><span class="section-number-3">2.3</span> First Basic Example with gain mismatch</h3>
2019-08-14 12:08:30 +02:00
<div class="outline-text-3" id="text-2-3">
<p>
Let's consider two ideal sensors except one sensor has not an expected gain of one but a gain of \(0.6\).
</p>
<div class="org-src-container">
<pre class="src src-matlab">G1 = <span class="org-highlight-numbers-number">1</span>;
G2 = <span class="org-highlight-numbers-number">0</span>.<span class="org-highlight-numbers-number">6</span>;
</pre>
</div>
<p>
Let's design two complementary filters as shown on figure <a href="#orgba6e31e">10</a>.
2019-08-14 12:08:30 +02:00
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>
<div id="orgba6e31e" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/comp_filters_robustness_test.png" alt="comp_filters_robustness_test.png" />
</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>
<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>).
2019-08-14 12:08:30 +02:00
</p>
<p>
We see that the blue complementary filters with a lower maximum norm permits to limit the phase lag introduced by the gain mismatch.
</p>
<div id="orgd412a5a" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/tf_super_sensor_comp.png" alt="tf_super_sensor_comp.png" />
</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>
</div>
</div>
</div>
<div id="outline-container-org81e622c" 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>
2019-08-14 12:08:30 +02:00
</div>
</div>
<div id="outline-container-org6d8c8af" class="outline-2">
<h2 id="org6d8c8af"><span class="section-number-2">3</span> Complementary filters using analytical formula</h2>
2019-08-14 12:08:30 +02:00
<div class="outline-text-2" id="text-3">
<p>
<a id="org91a8313"></a>
2019-08-14 12:08:30 +02:00
</p>
<div class="note">
<p>
All the files (data and Matlab scripts) are accessible <a href="data/comp_filters_analytical.zip">here</a>.
</p>
</div>
</div>
<div id="outline-container-orgb288402" class="outline-3">
<h3 id="orgb288402"><span class="section-number-3">3.1</span> Analytical 1st order complementary filters</h3>
2019-08-14 12:08:30 +02:00
<div class="outline-text-3" id="text-3-1">
<p>
First order complementary filters are defined with following equations:
</p>
\begin{align}
H_L(s) = \frac{1}{1 + \frac{s}{\omega_0}}\\
H_H(s) = \frac{\frac{s}{\omega_0}}{1 + \frac{s}{\omega_0}}
\end{align}
<p>
Their bode plot is shown figure <a href="#orga970e88">12</a>.
2019-08-14 12:08:30 +02:00
</p>
<div class="org-src-container">
<pre class="src src-matlab">w0 = <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>
Hh1 = <span class="org-rainbow-delimiters-depth-1">(</span>s<span class="org-type">/</span>w0<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">/</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>s<span class="org-type">/</span>w0<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">+</span><span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</span>;
Hl1 = <span class="org-highlight-numbers-number">1</span><span class="org-type">/</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>s<span class="org-type">/</span>w0<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">+</span><span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<div id="orga970e88" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/comp_filter_1st_order.png" alt="comp_filter_1st_order.png" />
</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>
</div>
</div>
</div>
<div id="outline-container-orgefd1169" class="outline-3">
<h3 id="orgefd1169"><span class="section-number-3">3.2</span> Second Order Complementary Filters</h3>
2019-08-14 12:08:30 +02:00
<div class="outline-text-3" id="text-3-2">
<p>
We here use analytical formula for the complementary filters \(H_L\) and \(H_H\).
</p>
<p>
The first two formulas that are used to generate complementary filters are:
</p>
\begin{align*}
H_L(s) &= \frac{(1+\alpha) (\frac{s}{\omega_0})+1}{\left((\frac{s}{\omega_0})+1\right) \left((\frac{s}{\omega_0})^2 + \alpha (\frac{s}{\omega_0}) + 1\right)}\\
H_H(s) &= \frac{(\frac{s}{\omega_0})^2 \left((\frac{s}{\omega_0})+1+\alpha\right)}{\left((\frac{s}{\omega_0})+1\right) \left((\frac{s}{\omega_0})^2 + \alpha (\frac{s}{\omega_0}) + 1\right)}
\end{align*}
<p>
where:
</p>
<ul class="org-ul">
<li>\(\omega_0\) is the blending frequency in rad/s.</li>
<li>\(\alpha\) is used to change the shape of the filters:
<ul class="org-ul">
<li>Small values for \(\alpha\) will produce high magnitude of the filters \(|H_L(j\omega)|\) and \(|H_H(j\omega)|\) near \(\omega_0\) but smaller value for \(|H_L(j\omega)|\) above \(\approx 1.5 \omega_0\) and for \(|H_H(j\omega)|\) below \(\approx 0.7 \omega_0\)</li>
<li>A large \(\alpha\) will do the opposite</li>
</ul></li>
</ul>
<p>
This is illustrated on figure <a href="#orga420ceb">13</a>.
2019-08-14 12:08:30 +02:00
The slope of those filters at high and low frequencies is \(-2\) and \(2\) respectively for \(H_L\) and \(H_H\).
</p>
<div id="orga420ceb" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/comp_filters_param_alpha.png" alt="comp_filters_param_alpha.png" />
</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>
</div>
<p>
We now study the maximum norm of the filters function of the parameter \(\alpha\). As we saw that the maximum norm of the filters is important for the robust merging of filters.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-type">figure</span>;
plot<span class="org-rainbow-delimiters-depth-1">(</span>alphas, infnorms<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-type">set</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">gca</span>, <span class="org-string">'xscale', 'log'</span><span class="org-string"><span class="org-rainbow-delimiters-depth-1">)</span></span><span class="org-string">; set</span><span class="org-string"><span class="org-rainbow-delimiters-depth-1">(</span></span><span class="org-string">gca, 'yscale', 'log'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
xlabel<span class="org-rainbow-delimiters-depth-1">(</span>'$<span class="org-type">\</span>alpha$'<span class="org-rainbow-delimiters-depth-1">)</span>; ylabel<span class="org-rainbow-delimiters-depth-1">(</span>'$<span class="org-type">\|</span>H_1<span class="org-type">\|</span>_<span class="org-type">\</span>infty$'<span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<div id="orgf07fa17" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/param_alpha_hinf_norm.png" alt="param_alpha_hinf_norm.png" />
</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>
</div>
</div>
</div>
<div id="outline-container-org32c14e8" class="outline-3">
<h3 id="org32c14e8"><span class="section-number-3">3.3</span> Third Order Complementary Filters</h3>
2019-08-14 12:08:30 +02:00
<div class="outline-text-3" id="text-3-3">
<p>
The following formula gives complementary filters with slopes of \(-3\) and \(3\):
</p>
\begin{align*}
H_L(s) &= \frac{\left(1+(\alpha+1)(\beta+1)\right) (\frac{s}{\omega_0})^2 + (1+\alpha+\beta)(\frac{s}{\omega_0}) + 1}{\left(\frac{s}{\omega_0} + 1\right) \left( (\frac{s}{\omega_0})^2 + \alpha (\frac{s}{\omega_0}) + 1 \right) \left( (\frac{s}{\omega_0})^2 + \beta (\frac{s}{\omega_0}) + 1 \right)}\\
H_H(s) &= \frac{(\frac{s}{\omega_0})^3 \left( (\frac{s}{\omega_0})^2 + (1+\alpha+\beta) (\frac{s}{\omega_0}) + (1+(\alpha+1)(\beta+1)) \right)}{\left(\frac{s}{\omega_0} + 1\right) \left( (\frac{s}{\omega_0})^2 + \alpha (\frac{s}{\omega_0}) + 1 \right) \left( (\frac{s}{\omega_0})^2 + \beta (\frac{s}{\omega_0}) + 1 \right)}
\end{align*}
<p>
The parameters are:
</p>
<ul class="org-ul">
<li>\(\omega_0\) is the blending frequency in rad/s</li>
<li>\(\alpha\) and \(\beta\) that are used to change the shape of the filters similarly to the parameter \(\alpha\) for the second order complementary filters</li>
</ul>
<p>
The filters are defined below and the result is shown on figure <a href="#orgbe15178">15</a>.
2019-08-14 12:08:30 +02:00
</p>
<div class="org-src-container">
<pre class="src src-matlab">alpha = <span class="org-highlight-numbers-number">1</span>;
beta = <span class="org-highlight-numbers-number">10</span>;
w0 = <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">14</span>;
Hh3_ana = <span class="org-rainbow-delimiters-depth-1">(</span>s<span class="org-type">/</span>w0<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">^</span><span class="org-highlight-numbers-number">3</span> <span class="org-type">*</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>s<span class="org-type">/</span>w0<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">^</span><span class="org-highlight-numbers-number">2</span> <span class="org-type">+</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">1</span><span class="org-type">+</span>alpha<span class="org-type">+</span>beta<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">*</span><span class="org-rainbow-delimiters-depth-2">(</span>s<span class="org-type">/</span>w0<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-type">+</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">1</span><span class="org-type">+</span><span class="org-rainbow-delimiters-depth-3">(</span>alpha<span class="org-type">+</span><span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-type">*</span><span class="org-rainbow-delimiters-depth-3">(</span>beta<span class="org-type">+</span><span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">/</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>s<span class="org-type">/</span>w0 <span class="org-type">+</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">*</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>s<span class="org-type">/</span>w0<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-type">^</span><span class="org-highlight-numbers-number">2</span><span class="org-type">+</span>alpha<span class="org-type">*</span><span class="org-rainbow-delimiters-depth-3">(</span>s<span class="org-type">/</span>w0<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-type">+</span><span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">*</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>s<span class="org-type">/</span>w0<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-type">^</span><span class="org-highlight-numbers-number">2</span><span class="org-type">+</span>beta<span class="org-type">*</span><span class="org-rainbow-delimiters-depth-3">(</span>s<span class="org-type">/</span>w0<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-type">+</span><span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
Hl3_ana = <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">1</span><span class="org-type">+</span><span class="org-rainbow-delimiters-depth-3">(</span>alpha<span class="org-type">+</span><span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-type">*</span><span class="org-rainbow-delimiters-depth-3">(</span>beta<span class="org-type">+</span><span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">*</span><span class="org-rainbow-delimiters-depth-2">(</span>s<span class="org-type">/</span>w0<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">^</span><span class="org-highlight-numbers-number">2</span> <span class="org-type">+</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">1</span><span class="org-type">+</span>alpha<span class="org-type">+</span>beta<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">*</span><span class="org-rainbow-delimiters-depth-2">(</span>s<span class="org-type">/</span>w0<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-type">+</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">/</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>s<span class="org-type">/</span>w0 <span class="org-type">+</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">*</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>s<span class="org-type">/</span>w0<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-type">^</span><span class="org-highlight-numbers-number">2</span><span class="org-type">+</span>alpha<span class="org-type">*</span><span class="org-rainbow-delimiters-depth-3">(</span>s<span class="org-type">/</span>w0<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-type">+</span><span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">*</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>s<span class="org-type">/</span>w0<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-type">^</span><span class="org-highlight-numbers-number">2</span><span class="org-type">+</span>beta<span class="org-type">*</span><span class="org-rainbow-delimiters-depth-3">(</span>s<span class="org-type">/</span>w0<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-type">+</span><span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<div id="orgbe15178" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/complementary_filters_third_order.png" alt="complementary_filters_third_order.png" />
</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>
</div>
</div>
</div>
</div>
<div id="outline-container-orgc86d54b" class="outline-2">
<h2 id="orgc86d54b"><span class="section-number-2">4</span> H-Infinity synthesis of complementary filters</h2>
2019-08-14 12:08:30 +02:00
<div class="outline-text-2" id="text-4">
<p>
<a id="org2358787"></a>
2019-08-14 12:08:30 +02:00
</p>
<div class="note">
<p>
All the files (data and Matlab scripts) are accessible <a href="data/h_inf_synthesis_complementary_filters.zip">here</a>.
</p>
</div>
</div>
<div id="outline-container-org2288026" class="outline-3">
<h3 id="org2288026"><span class="section-number-3">4.1</span> Synthesis Architecture</h3>
2019-08-14 12:08:30 +02:00
<div class="outline-text-3" id="text-4-1">
<p>
We here synthesize the complementary filters using the \(\mathcal{H}_\infty\) synthesis.
The goal is to specify upper bounds on the norms of \(H_L\) and \(H_H\) while ensuring their complementary property (\(H_L + H_H = 1\)).
</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.
2019-08-14 12:08:30 +02:00
</p>
<div id="org4764d16" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/sf_hinf_filters_plant_b.png" alt="sf_hinf_filters_plant_b.png" />
</p>
<p><span class="figure-number">Figure 16: </span>Generalized plant used for the \(\mathcal{H}_\infty\) synthesis of the complementary filters</p>
</div>
<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:
2019-08-14 12:08:30 +02:00
\[ \left\| \begin{array}{c} H_L w_L \\ (1 - H_L) w_H \end{array} \right\|_\infty < 1 \]
</p>
<p>
Thus, if the above condition is verified, we can define \(H_H = 1 - H_L\) and we have that:
\[ \left\| \begin{array}{c} H_L w_L \\ H_H w_H \end{array} \right\|_\infty < 1 \]
Which is almost (with an maximum error of \(\sqrt{2}\)) equivalent to:
</p>
\begin{align*}
|H_L| &< \frac{1}{|w_L|}, \quad \forall \omega \\
|H_H| &< \frac{1}{|w_H|}, \quad \forall \omega
\end{align*}
<p>
We then see that \(w_L\) and \(w_H\) can be used to shape both \(H_L\) and \(H_H\) while ensuring (by definition of \(H_H = 1 - H_L\)) their complementary property.
</p>
<div id="orgd665b69" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/sf_hinf_filters_b.png" alt="sf_hinf_filters_b.png" />
</p>
<p><span class="figure-number">Figure 17: </span>\(\mathcal{H}_\infty\) synthesis of the complementary filters</p>
</div>
</div>
</div>
<div id="outline-container-orga9b0474" class="outline-3">
<h3 id="orga9b0474"><span class="section-number-3">4.2</span> Weights</h3>
2019-08-14 12:08:30 +02:00
<div class="outline-text-3" id="text-4-2">
<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>;
wH = <span class="org-rainbow-delimiters-depth-1">(</span>omegab<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">^</span><span class="org-highlight-numbers-number">2</span><span class="org-type">/</span><span class="org-rainbow-delimiters-depth-1">(</span>s <span class="org-type">+</span> omegab<span class="org-type">*</span>sqrt<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">1e</span><span class="org-type">-</span><span class="org-highlight-numbers-number">5</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">^</span><span class="org-highlight-numbers-number">2</span>;
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">28</span>;
wL = <span class="org-rainbow-delimiters-depth-1">(</span>s <span class="org-type">+</span> omegab<span class="org-type">/</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">4</span>.<span class="org-highlight-numbers-number">5</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">^</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">1</span><span class="org-type">/</span><span class="org-highlight-numbers-number">3</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">^</span><span class="org-highlight-numbers-number">3</span><span class="org-type">/</span><span class="org-rainbow-delimiters-depth-1">(</span>s<span class="org-type">*</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">1e</span><span class="org-type">-</span><span class="org-highlight-numbers-number">4</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">^</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">1</span><span class="org-type">/</span><span class="org-highlight-numbers-number">3</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-type">+</span> omegab<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">^</span><span class="org-highlight-numbers-number">3</span>;
</pre>
</div>
<div id="org9dc1a51" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/weights_wl_wh.png" alt="weights_wl_wh.png" />
</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>
</div>
</div>
</div>
<div id="outline-container-org17ecd06" class="outline-3">
<h3 id="org17ecd06"><span class="section-number-3">4.3</span> H-Infinity Synthesis</h3>
2019-08-14 12:08:30 +02:00
<div class="outline-text-3" id="text-4-3">
<p>
We define the generalized plant \(P\) on matlab.
</p>
<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> wL;
wH <span class="org-type">-</span>wH;
<span class="org-highlight-numbers-number">1</span> <span class="org-highlight-numbers-number">0</span><span class="org-rainbow-delimiters-depth-1">]</span>;
</pre>
</div>
<p>
And we do the \(\mathcal{H}_\infty\) synthesis using the <code>hinfsyn</code> command.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-rainbow-delimiters-depth-1">[</span>Hl_hinf, <span class="org-type">~</span>, gamma, <span class="org-type">~</span><span class="org-rainbow-delimiters-depth-1">]</span> = hinfsyn<span class="org-rainbow-delimiters-depth-1">(</span>P, <span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">1</span>,'TOLGAM', <span class="org-highlight-numbers-number">0</span>.<span class="org-highlight-numbers-number">001</span>, 'METHOD', 'ric', 'DISPLAY', 'on'<span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<pre class="example">
[Hl_hinf, ~, gamma, ~] = hinfsyn(P, 1, 1,'TOLGAM', 0.001, 'METHOD', 'ric', 'DISPLAY', 'on');
Test bounds: 0.0000 &lt; gamma &lt;= 1.7285
gamma hamx_eig xinf_eig hamy_eig yinf_eig nrho_xy p/f
1.729 4.1e+01 8.4e-12 1.8e-01 0.0e+00 0.0000 p
0.864 3.9e+01 -5.8e-02# 1.8e-01 0.0e+00 0.0000 f
1.296 4.0e+01 8.4e-12 1.8e-01 0.0e+00 0.0000 p
1.080 4.0e+01 8.5e-12 1.8e-01 0.0e+00 0.0000 p
0.972 3.9e+01 -4.2e-01# 1.8e-01 0.0e+00 0.0000 f
1.026 4.0e+01 8.5e-12 1.8e-01 0.0e+00 0.0000 p
0.999 3.9e+01 8.5e-12 1.8e-01 0.0e+00 0.0000 p
0.986 3.9e+01 -1.2e+00# 1.8e-01 0.0e+00 0.0000 f
0.993 3.9e+01 -8.2e+00# 1.8e-01 0.0e+00 0.0000 f
0.996 3.9e+01 8.5e-12 1.8e-01 0.0e+00 0.0000 p
0.994 3.9e+01 8.5e-12 1.8e-01 0.0e+00 0.0000 p
0.993 3.9e+01 -3.2e+01# 1.8e-01 0.0e+00 0.0000 f
Gamma value achieved: 0.9942
</pre>
<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>.
2019-08-14 12:08:30 +02:00
</p>
<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>
</div>
</div>
</div>
<div id="outline-container-org844c90a" class="outline-3">
<h3 id="org844c90a"><span class="section-number-3">4.4</span> Obtained Complementary Filters</h3>
2019-08-14 12:08:30 +02:00
<div class="outline-text-3" id="text-4-4">
<p>
The obtained complementary filters are shown on figure <a href="#orge5933cc">19</a>.
2019-08-14 12:08:30 +02:00
</p>
<div id="orge5933cc" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/hinf_filters_results.png" alt="hinf_filters_results.png" />
</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>
</div>
</div>
</div>
</div>
<div id="outline-container-orgd76dc0a" class="outline-2">
<h2 id="orgd76dc0a"><span class="section-number-2">5</span> Feedback Control Architecture to generate Complementary Filters</h2>
2019-08-14 12:08:30 +02:00
<div class="outline-text-2" id="text-5">
<p>
<a id="org94d0d5f"></a>
2019-08-14 12:08:30 +02:00
</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.
</p>
<p>
Thus, all the tools that has been developed for classical feedback control can be used for complementary filter design.
</p>
<div class="note">
<p>
All the files (data and Matlab scripts) are accessible <a href="data/feedback_generate_comp_filters.zip">here</a>.
</p>
</div>
</div>
<div id="outline-container-org2b0a54f" class="outline-3">
<h3 id="org2b0a54f"><span class="section-number-3">5.1</span> Architecture</h3>
2019-08-14 12:08:30 +02:00
<div class="outline-text-3" id="text-5-1">
<div id="orgb7d4dd2" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/complementary_filters_feedback_architecture.png" alt="complementary_filters_feedback_architecture.png" />
</p>
<p><span class="figure-number">Figure 20: </span>Architecture used to generate the complementary filters</p>
</div>
<p>
We have:
\[ y = \underbrace{\frac{L}{L + 1}}_{H_L} y_1 + \underbrace{\frac{1}{L + 1}}_{H_H} y_2 \]
with \(H_L + H_H = 1\).
</p>
<p>
The only thing to design is \(L\) such that the complementary filters are stable with the wanted shape.
</p>
<p>
A simple choice is:
\[ L = \left(\frac{\omega_c}{s}\right)^2 \frac{\frac{s}{\omega_c / \alpha} + 1}{\frac{s}{\omega_c} + \alpha} \]
</p>
<p>
Which contains two integrator and a lead. \(\omega_c\) is used to tune the crossover frequency and \(\alpha\) the trade-off "bump" around blending frequency and filtering away from blending frequency.
</p>
</div>
</div>
<div id="outline-container-org023d478" class="outline-3">
<h3 id="org023d478"><span class="section-number-3">5.2</span> Loop Gain Design</h3>
2019-08-14 12:08:30 +02:00
<div class="outline-text-3" id="text-5-2">
<p>
Let's first define the loop gain \(L\).
</p>
<div class="org-src-container">
<pre class="src src-matlab">wc = <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">1</span>;
alpha = <span class="org-highlight-numbers-number">2</span>;
L = <span class="org-rainbow-delimiters-depth-1">(</span>wc<span class="org-type">/</span>s<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">^</span><span class="org-highlight-numbers-number">2</span> <span class="org-type">*</span> <span class="org-rainbow-delimiters-depth-1">(</span>s<span class="org-type">/</span><span class="org-rainbow-delimiters-depth-2">(</span>wc<span class="org-type">/</span>alpha<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-type">+</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">/</span><span class="org-rainbow-delimiters-depth-1">(</span>s<span class="org-type">/</span>wc <span class="org-type">+</span> alpha<span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<div id="org5563034" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/loop_gain_bode_plot.png" alt="loop_gain_bode_plot.png" />
</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>
</div>
</div>
</div>
<div id="outline-container-orgef15574" class="outline-3">
<h3 id="orgef15574"><span class="section-number-3">5.3</span> Complementary Filters Obtained</h3>
2019-08-14 12:08:30 +02:00
<div class="outline-text-3" id="text-5-3">
<p>
We then compute the resulting low pass and high pass filters.
</p>
<div class="org-src-container">
<pre class="src src-matlab">Hl = L<span class="org-type">/</span><span class="org-rainbow-delimiters-depth-1">(</span>L <span class="org-type">+</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</span>;
Hh = <span class="org-highlight-numbers-number">1</span><span class="org-type">/</span><span class="org-rainbow-delimiters-depth-1">(</span>L <span class="org-type">+</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<div id="org7a3c2de" class="figure">
2019-08-14 12:08:30 +02:00
<p><img src="figs/low_pass_high_pass_filters.png" alt="low_pass_high_pass_filters.png" />
</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>
</div>
</div>
</div>
</div>
<div id="outline-container-org9a4e0ed" class="outline-2">
<h2 id="org9a4e0ed"><span class="section-number-2">6</span> Analytical Formula found in the literature</h2>
<div class="outline-text-2" id="text-6">
<p>
<a id="orga144d76"></a>
</p>
</div>
<div id="outline-container-orgfa54829" class="outline-3">
<h3 id="orgfa54829"><span class="section-number-3">6.1</span> Analytical Formula</h3>
<div class="outline-text-3" id="text-6-1">
<p>
<a class='org-ref-reference' href="#min15_compl_filter_desig_angle_estim">min15_compl_filter_desig_angle_estim</a>
</p>
\begin{align*}
H_L(s) = \frac{K_p s + K_i}{s^2 + K_p s + K_i} \\
H_H(s) = \frac{s^2}{s^2 + K_p s + K_i}
\end{align*}
<p>
<a class='org-ref-reference' href="#corke04_inert_visual_sensin_system_small_auton_helic">corke04_inert_visual_sensin_system_small_auton_helic</a>
</p>
\begin{align*}
H_L(s) = \frac{1}{s/p + 1} \\
H_H(s) = \frac{s/p}{s/p + 1}
\end{align*}
<p>
<a class='org-ref-reference' href="#jensen13_basic_uas">jensen13_basic_uas</a>
</p>
\begin{align*}
H_L(s) = \frac{2 \omega_0 s + \omega_0^2}{(s + \omega_0)^2} \\
H_H(s) = \frac{s^2}{(s + \omega_0)^2}
\end{align*}
\begin{align*}
H_L(s) = \frac{C(s)}{C(s) + s} \\
H_H(s) = \frac{s}{C(s) + s}
\end{align*}
2019-08-14 12:08:30 +02:00
<p>
<a class='org-ref-reference' href="#shaw90_bandw_enhan_posit_measur_using_measur_accel">shaw90_bandw_enhan_posit_measur_using_measur_accel</a>
</p>
\begin{align*}
H_L(s) = \frac{3 \tau s + 1}{(\tau s + 1)^3} \\
H_H(s) = \frac{\tau^3 s^3 + 3 \tau^2 s^2}{(\tau s + 1)^3}
\end{align*}
2019-08-14 12:08:30 +02:00
<p>
<a class='org-ref-reference' href="#baerveldt97_low_cost_low_weigh_attit">baerveldt97_low_cost_low_weigh_attit</a>
</p>
\begin{align*}
H_L(s) = \frac{2 \tau s + 1}{(\tau s + 1)^2} \\
H_H(s) = \frac{\tau^2 s^2}{(\tau s + 1)^2}
\end{align*}
</div>
</div>
<div id="outline-container-org5286b79" class="outline-3">
<h3 id="org5286b79"><span class="section-number-3">6.2</span> Matlab</h3>
<div class="outline-text-3" id="text-6-2">
<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>
tau = <span class="org-highlight-numbers-number">1</span><span class="org-type">/</span>omega0; <span class="org-comment">% [s]</span>
<span class="org-comment">% From cite:corke04_inert_visual_sensin_system_small_auton_helic</span>
HL1 = <span class="org-highlight-numbers-number">1</span><span class="org-type">/</span><span class="org-rainbow-delimiters-depth-1">(</span>s<span class="org-type">/</span>omega0 <span class="org-type">+</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</span>; HH1 = s<span class="org-type">/</span>omega0<span class="org-type">/</span><span class="org-rainbow-delimiters-depth-1">(</span>s<span class="org-type">/</span>omega0 <span class="org-type">+</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</span>;
<span class="org-comment">% From cite:jensen13_basic_uas</span>
HL2 = <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-highlight-numbers-number">2</span><span class="org-type">*</span>omega0<span class="org-type">*</span>s <span class="org-type">+</span> omega0<span class="org-type">^</span><span class="org-highlight-numbers-number">2</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">/</span><span class="org-rainbow-delimiters-depth-1">(</span>s<span class="org-type">+</span>omega0<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">^</span><span class="org-highlight-numbers-number">2</span>; HH2 = s<span class="org-type">^</span><span class="org-highlight-numbers-number">2</span><span class="org-type">/</span><span class="org-rainbow-delimiters-depth-1">(</span>s<span class="org-type">+</span>omega0<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">^</span><span class="org-highlight-numbers-number">2</span>;
<span class="org-comment">% From cite:shaw90_bandw_enhan_posit_measur_using_measur_accel</span>
HL3 = <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-highlight-numbers-number">3</span><span class="org-type">*</span>tau<span class="org-type">*</span>s <span class="org-type">+</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">/</span><span class="org-rainbow-delimiters-depth-1">(</span>tau<span class="org-type">*</span>s <span class="org-type">+</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">^</span><span class="org-highlight-numbers-number">3</span>; HH3 = <span class="org-rainbow-delimiters-depth-1">(</span>tau<span class="org-type">^</span><span class="org-highlight-numbers-number">3</span><span class="org-type">*</span>s<span class="org-type">^</span><span class="org-highlight-numbers-number">3</span> <span class="org-type">+</span> <span class="org-highlight-numbers-number">3</span><span class="org-type">*</span>tau<span class="org-type">^</span><span class="org-highlight-numbers-number">2</span><span class="org-type">*</span>s<span class="org-type">^</span><span class="org-highlight-numbers-number">2</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">/</span><span class="org-rainbow-delimiters-depth-1">(</span>tau<span class="org-type">*</span>s <span class="org-type">+</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">^</span><span class="org-highlight-numbers-number">3</span>;
</pre>
</div>
<div id="orge38d4ce" class="figure">
<p><img src="figs/comp_filters_literature.png" alt="comp_filters_literature.png" />
</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>
</div>
</div>
</div>
<div id="outline-container-org6092cef" class="outline-3">
<h3 id="org6092cef"><span class="section-number-3">6.3</span> Discussion</h3>
<div class="outline-text-3" id="text-6-3">
<p>
Analytical Formula found in the literature provides either no parameter for tuning the robustness / performance trade-off.
</p>
</div>
</div>
</div>
<div id="outline-container-orgbbfeb6f" class="outline-2">
<h2 id="orgbbfeb6f"><span class="section-number-2">7</span> Comparison of the different methods of synthesis</h2>
<div class="outline-text-2" id="text-7">
<p>
<a id="orgfee2d57"></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:
</p>
<ul class="org-ul">
<li>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.</li>
<li>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</li>
</ul>
</div>
</div>
<p>
<h1 class='org-ref-bib-h1'>Bibliography</h1>
<ul class='org-ref-bib'><li><a id="min15_compl_filter_desig_angle_estim">[min15_compl_filter_desig_angle_estim]</a> <a name="min15_compl_filter_desig_angle_estim"></a>Min & Jeung, Complementary Filter Design for Angle Estimation Using Mems Accelerometer and Gyroscope, <i>Department of Control and Instrumentation, Changwon National University, Changwon, Korea</i>, 641-773 (2015).</li>
<li><a id="corke04_inert_visual_sensin_system_small_auton_helic">[corke04_inert_visual_sensin_system_small_auton_helic]</a> <a name="corke04_inert_visual_sensin_system_small_auton_helic"></a>Peter Corke, An Inertial and Visual Sensing System for a Small Autonomous Helicopter, <i>Journal of Robotic Systems</i>, <b>21(2)</b>, 43-51 (2004). <a href="https://doi.org/10.1002/rob.10127">link</a>. <a href="http://dx.doi.org/10.1002/rob.10127">doi</a>.</li>
<li><a id="jensen13_basic_uas">[jensen13_basic_uas]</a> <a name="jensen13_basic_uas"></a>Austin Jensen, Cal Coopmans & YangQuan Chen, Basics and guidelines of complementary filters for small UAS navigation, nil, in in: 2013 International Conference on Unmanned Aircraft Systems
(ICUAS), edited by (2013)</li>
<li><a id="shaw90_bandw_enhan_posit_measur_using_measur_accel">[shaw90_bandw_enhan_posit_measur_using_measur_accel]</a> <a name="shaw90_bandw_enhan_posit_measur_using_measur_accel"></a>Shaw & Srinivasan, Bandwidth Enhancement of Position Measurements Using Measured Acceleration, <i>Mechanical Systems and Signal Processing</i>, <b>4(1)</b>, 23-38 (1990). <a href="https://doi.org/10.1016/0888-3270(90)90038-m">link</a>. <a href="http://dx.doi.org/10.1016/0888-3270(90)90038-m">doi</a>.</li>
<li><a id="baerveldt97_low_cost_low_weigh_attit">[baerveldt97_low_cost_low_weigh_attit]</a> <a name="baerveldt97_low_cost_low_weigh_attit"></a>Baerveldt & Klang, A Low-Cost and Low-Weight Attitude Estimation System for an Autonomous Helicopter, nil, in in: Proceedings of IEEE International Conference on Intelligent Engineering Systems, edited by (1997)</li>
</ul>
2019-08-14 12:08:30 +02:00
</p>
</div>
<div id="postamble" class="status">
<p class="author">Author: Thomas Dehaeze</p>
<p class="date">Created: 2019-08-14 mer. 12:13</p>
2019-08-14 12:08:30 +02:00
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>
</html>