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-21 16:34:47 +02:00
<!-- 2019 - 08 - 21 mer. 13:17 -->
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 >
2019-08-21 16:34:47 +02:00
< li > < a href = "#orga1a1b9d" > 1. Optimal Sensor Fusion for noise characteristics< / a >
2019-08-14 12:08:30 +02:00
< ul >
2019-08-21 16:34:47 +02:00
< li > < a href = "#orga3597f6" > 1.1. Architecture< / a > < / li >
< li > < a href = "#orgcac1aa3" > 1.2. Noise of the sensors< / a > < / li >
< li > < a href = "#orgdb1ca76" > 1.3. H-Two Synthesis< / a > < / li >
< li > < a href = "#org375cb3a" > 1.4. Analysis< / a > < / li >
2019-08-14 12:08:30 +02:00
< / ul >
< / li >
2019-08-21 16:34:47 +02:00
< li > < a href = "#org2ebd870" > 2. Robustness to sensor dynamics uncertainty< / a >
2019-08-14 12:08:30 +02:00
< ul >
2019-08-21 16:34:47 +02:00
< li > < a href = "#orgf63dc07" > 2.1. Unknown sensor dynamics dynamics< / 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 = "#org20ae980" > 2.3. First Basic Example with gain mismatch< / a > < / li >
< li > < a href = "#org41f2b11" > 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 >
2019-08-21 16:34:47 +02:00
< li > < a href = "#orgf04a9a4" > 3. Complementary filters using analytical formula< / a >
2019-08-14 12:08:30 +02:00
< ul >
2019-08-21 16:34:47 +02:00
< li > < a href = "#org7d339a9" > 3.1. Analytical 1st order complementary filters< / a > < / li >
< li > < a href = "#org8edbedb" > 3.2. Second Order Complementary Filters< / a > < / li >
< li > < a href = "#org5fd0c3c" > 3.3. Third Order Complementary Filters< / a > < / li >
2019-08-14 12:08:30 +02:00
< / ul >
< / li >
2019-08-21 16:34:47 +02:00
< li > < a href = "#org88004e2" > 4. H-Infinity synthesis of complementary filters< / a >
2019-08-14 12:08:30 +02:00
< ul >
2019-08-21 16:34:47 +02:00
< li > < a href = "#orgc51b2bd" > 4.1. Synthesis Architecture< / a > < / li >
< li > < a href = "#orga135818" > 4.2. Weights< / a > < / li >
< li > < a href = "#orgbd3b8d8" > 4.3. H-Infinity Synthesis< / a > < / li >
< li > < a href = "#org0d62ef6" > 4.4. Obtained Complementary Filters< / a > < / li >
2019-08-14 12:08:30 +02:00
< / ul >
< / li >
2019-08-21 16:34:47 +02:00
< li > < a href = "#orga65dbb6" > 5. Feedback Control Architecture to generate Complementary Filters< / a >
2019-08-14 12:08:30 +02:00
< ul >
2019-08-21 16:34:47 +02:00
< li > < a href = "#orgec7fc24" > 5.1. Architecture< / a > < / li >
< li > < a href = "#org448cd20" > 5.2. Loop Gain Design< / a > < / li >
< li > < a href = "#org1ec0e07" > 5.3. Complementary Filters Obtained< / a > < / li >
2019-08-14 12:08:30 +02:00
< / ul >
< / li >
2019-08-21 16:34:47 +02:00
< li > < a href = "#org3b324a8" > 6. Analytical Formula found in the literature< / a >
2019-08-14 12:14:10 +02:00
< ul >
2019-08-21 16:34:47 +02:00
< li > < a href = "#org8d499d4" > 6.1. Analytical Formula< / a > < / li >
< li > < a href = "#org60e2ce0" > 6.2. Matlab< / a > < / li >
< li > < a href = "#org1038fe9" > 6.3. Discussion< / a > < / li >
2019-08-14 12:14:10 +02:00
< / ul >
< / li >
2019-08-21 16:34:47 +02:00
< li > < a href = "#org647d1a0" > 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" >
2019-08-21 16:34:47 +02:00
< 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 >
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" >
2019-08-21 16:34:47 +02:00
< li > in section < a href = "#orgb2ab616" > 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" >
2019-08-21 16:34:47 +02:00
< li > in section < a href = "#org654b360" > 3< / a > , analytical formulas are proposed< / li >
< li > in section < a href = "#org924f36f" > 4< / a > , the \(\mathcal{H}_\infty\) synthesis is used< / li >
< li > in section < a href = "#org3e654dc" > 5< / a > , the classical feedback architecture is used< / li >
< li > in section < a href = "#org22f6020" > 6< / a > , analytical formulas found in the literature are listed< / li >
2019-08-14 12:08:30 +02:00
< / ul >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-orga1a1b9d" class = "outline-2" >
< h2 id = "orga1a1b9d" > < 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 >
2019-08-21 16:34:47 +02:00
< a id = "orge83d075" > < / 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-orga3597f6" class = "outline-3" >
< h3 id = "orga3597f6" > < 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 >
2019-08-21 16:34:47 +02:00
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\).
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 >
2019-08-21 16:34:47 +02:00
< div id = "org80c1b07" class = "figure" >
< 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 >
2019-08-14 12:08:30 +02:00
< / p >
< p > < span class = "figure-number" > Figure 1: < / span > Fusion of two sensors< / p >
< / div >
< p >
2019-08-21 16:34:47 +02:00
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 > .
2019-08-14 12:08:30 +02:00
< / p >
2019-08-21 16:34:47 +02:00
< div id = "org442f9da" class = "figure" >
< p > < img src = "figs-tikz/fusion_two_noisy_sensors.png" alt = "fusion_two_noisy_sensors.png" / >
2019-08-14 12:08:30 +02:00
< / 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-orgcac1aa3" class = "outline-3" >
< h3 id = "orgcac1aa3" > < 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 >
2019-08-21 16:34:47 +02:00
< div id = "org8380e17" 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-orgdb1ca76" class = "outline-3" >
< h3 id = "orgdb1ca76" > < 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 >
2019-08-21 16:34:47 +02:00
We use the generalized plant architecture shown on figure < a href = "#orgfd9fdc8" > 4< / a > .
2019-08-14 12:08:30 +02:00
< / p >
2019-08-21 16:34:47 +02:00
< div id = "orgfd9fdc8" class = "figure" >
< p > < img src = "figs-tikz/h_infinity_optimal_comp_filters.png" alt = "h_infinity_optimal_comp_filters.png" / >
2019-08-14 12:08:30 +02:00
< / 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 >
2019-08-21 16:34:47 +02:00
We define the generalized plant \(P\) on matlab as shown on figure < a href = "#orgfd9fdc8" > 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-org375cb3a" class = "outline-3" >
< h3 id = "org375cb3a" > < 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 >
2019-08-21 16:34:47 +02:00
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 = "#orgccc886e" > 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 >
2019-08-21 16:34:47 +02:00
< div id = "org4addc9f" 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 >
2019-08-21 16:34:47 +02:00
< div id = "org52b2e97" 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 >
2019-08-21 16:34:47 +02:00
< table id = "orgccc886e" 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" >   < / 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-org2ebd870" class = "outline-2" >
< h2 id = "org2ebd870" > < 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 >
2019-08-21 16:34:47 +02:00
< a id = "orgb2ab616" > < / a >
2019-08-14 12:08:30 +02:00
< / p >
< p >
2019-08-21 16:34:47 +02:00
Let's first consider ideal sensors where \(G_1 = 1\) and \(G_2 = 1\) (figure < a href = "#orgd0780c6" > 7< / a > ).
2019-08-14 12:08:30 +02:00
< / p >
2019-08-21 16:34:47 +02:00
< div id = "orgd0780c6" 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-orgf63dc07" class = "outline-3" >
< h3 id = "orgf63dc07" > < 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.
2019-08-21 16:34:47 +02:00
Let's represent that with multiplicative input uncertainty as shown on figure < a href = "#orga6c7451" > 8< / a > .
2019-08-14 12:08:30 +02:00
< / p >
2019-08-21 16:34:47 +02:00
< div id = "orga6c7451" class = "figure" >
< p > < img src = "figs-tikz/fusion_gain_mismatch.png" alt = "fusion_gain_mismatch.png" / >
2019-08-14 12:08:30 +02:00
< / 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 >
2019-08-21 16:34:47 +02:00
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 > ).
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 >
2019-08-21 16:34:47 +02:00
< div id = "org5dfc170" class = "figure" >
< p > < img src = "figs-tikz/uncertainty_gain_phase_variation.png" alt = "uncertainty_gain_phase_variation.png" / >
2019-08-14 12:08:30 +02:00
< / 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-org3244858" class = "outline-3" >
< 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 >
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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-org20ae980" class = "outline-3" >
< h3 id = "org20ae980" > < 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 >
2019-08-21 16:34:47 +02:00
Let's design two complementary filters as shown on figure < a href = "#orgc3e7049" > 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 >
2019-08-21 16:34:47 +02:00
< div id = "orgc3e7049" 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 >
2019-08-21 16:34:47 +02:00
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 > ).
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 >
2019-08-21 16:34:47 +02:00
< div id = "org124e3b5" 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-org41f2b11" class = "outline-3" >
< h3 id = "org41f2b11" > < 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-orgf04a9a4" class = "outline-2" >
< h2 id = "orgf04a9a4" > < 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 >
2019-08-21 16:34:47 +02:00
< a id = "org654b360" > < / 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-org7d339a9" class = "outline-3" >
< h3 id = "org7d339a9" > < 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 >
2019-08-21 16:34:47 +02:00
Their bode plot is shown figure < a href = "#orgd35e336" > 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 >
2019-08-21 16:34:47 +02:00
< div id = "orgd35e336" 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-org8edbedb" class = "outline-3" >
< h3 id = "org8edbedb" > < 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 >
2019-08-21 16:34:47 +02:00
This is illustrated on figure < a href = "#org551e9a2" > 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 >
2019-08-21 16:34:47 +02:00
< div id = "org551e9a2" 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 >
2019-08-21 16:34:47 +02:00
< div id = "org9c950bd" 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-org5fd0c3c" class = "outline-3" >
< h3 id = "org5fd0c3c" > < 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 >
2019-08-21 16:34:47 +02:00
The filters are defined below and the result is shown on figure < a href = "#org8791569" > 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 >
2019-08-21 16:34:47 +02:00
< div id = "org8791569" 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-org88004e2" class = "outline-2" >
< h2 id = "org88004e2" > < 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 >
2019-08-21 16:34:47 +02:00
< a id = "org924f36f" > < / 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-orgc51b2bd" class = "outline-3" >
< h3 id = "orgc51b2bd" > < 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 >
2019-08-21 16:34:47 +02:00
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.
2019-08-14 12:08:30 +02:00
< / p >
2019-08-21 16:34:47 +02:00
< div id = "orge2545fd" class = "figure" >
< p > < img src = "figs-tikz/sf_hinf_filters_plant_b.png" alt = "sf_hinf_filters_plant_b.png" / >
2019-08-14 12:08:30 +02:00
< / 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 >
2019-08-21 16:34:47 +02:00
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:
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 >
2019-08-21 16:34:47 +02:00
< div id = "org130d2c0" class = "figure" >
< p > < img src = "figs-tikz/sf_hinf_filters_b.png" alt = "sf_hinf_filters_b.png" / >
2019-08-14 12:08:30 +02:00
< / p >
< p > < span class = "figure-number" > Figure 17: < / span > \(\mathcal{H}_\infty\) synthesis of the complementary filters< / p >
< / div >
< / div >
< / div >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-orga135818" class = "outline-3" >
< h3 id = "orga135818" > < 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 >
2019-08-21 16:34:47 +02:00
< div id = "org3cb0b70" 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-orgbd3b8d8" class = "outline-3" >
< h3 id = "orgbd3b8d8" > < 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 < gamma < = 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 >
2019-08-21 16:34:47 +02:00
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 > .
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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-org0d62ef6" class = "outline-3" >
< h3 id = "org0d62ef6" > < 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 >
2019-08-21 16:34:47 +02:00
The obtained complementary filters are shown on figure < a href = "#orgc1ec9ab" > 19< / a > .
2019-08-14 12:08:30 +02:00
< / p >
2019-08-21 16:34:47 +02:00
< div id = "orgc1ec9ab" 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-orga65dbb6" class = "outline-2" >
< h2 id = "orga65dbb6" > < 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 >
2019-08-21 16:34:47 +02:00
< a id = "org3e654dc" > < / 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-orgec7fc24" class = "outline-3" >
< h3 id = "orgec7fc24" > < 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" >
2019-08-21 16:34:47 +02:00
< div id = "orgf3202e6" class = "figure" >
< p > < img src = "figs-tikz/complementary_filters_feedback_architecture.png" alt = "complementary_filters_feedback_architecture.png" / >
2019-08-14 12:08:30 +02:00
< / 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-org448cd20" class = "outline-3" >
< h3 id = "org448cd20" > < 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 >
2019-08-21 16:34:47 +02:00
< div id = "orgc090be3" 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-org1ec0e07" class = "outline-3" >
< h3 id = "org1ec0e07" > < 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 >
2019-08-21 16:34:47 +02:00
< div id = "org84c20e0" 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-org3b324a8" class = "outline-2" >
< h2 id = "org3b324a8" > < span class = "section-number-2" > 6< / span > Analytical Formula found in the literature< / h2 >
2019-08-14 12:14:10 +02:00
< div class = "outline-text-2" id = "text-6" >
< p >
2019-08-21 16:34:47 +02:00
< a id = "org22f6020" > < / a >
2019-08-14 12:14:10 +02:00
< / p >
< / div >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-org8d499d4" class = "outline-3" >
< h3 id = "org8d499d4" > < span class = "section-number-3" > 6.1< / span > Analytical Formula< / h3 >
2019-08-14 12:14:10 +02:00
< 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 >
2019-08-14 12:14:10 +02:00
< 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
2019-08-14 12:14:10 +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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-org60e2ce0" class = "outline-3" >
< h3 id = "org60e2ce0" > < span class = "section-number-3" > 6.2< / span > Matlab< / h3 >
2019-08-14 12:14:10 +02:00
< 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 >
2019-08-21 16:34:47 +02:00
< div id = "org5dd1179" class = "figure" >
2019-08-14 12:14:10 +02:00
< 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-org1038fe9" class = "outline-3" >
< h3 id = "org1038fe9" > < span class = "section-number-3" > 6.3< / span > Discussion< / h3 >
2019-08-14 12:14:10 +02:00
< 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 >
2019-08-21 16:34:47 +02:00
< div id = "outline-container-org647d1a0" class = "outline-2" >
< h2 id = "org647d1a0" > < span class = "section-number-2" > 7< / span > Comparison of the different methods of synthesis< / h2 >
2019-08-14 12:14:10 +02:00
< div class = "outline-text-2" id = "text-7" >
< p >
2019-08-21 16:34:47 +02:00
< a id = "orgcbb346f" > < / a >
2019-08-14 12:14:10 +02:00
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 >
2019-08-21 16:34:47 +02:00
2019-08-14 12:14:10 +02:00
< 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 >
2019-08-21 16:34:47 +02:00
< p class = "date" > Created: 2019-08-21 mer. 13:17< / 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 >