sensor-fusion-test-bench/index.html

1824 lines
90 KiB
HTML
Raw Normal View History

2020-08-31 16:10:13 +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>
<!-- 2020-11-11 mer. 16:50 -->
2020-08-31 16:10:13 +02:00
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Sensor Fusion - Test Bench</title>
<meta name="generator" content="Org mode" />
<meta name="author" content="Dehaeze Thomas" />
<link rel="stylesheet" type="text/css" href="./css/htmlize.css"/>
<link rel="stylesheet" type="text/css" href="./css/readtheorg.css"/>
<link rel="stylesheet" type="text/css" href="./css/custom.css"/>
2020-08-31 16:10:13 +02:00
<script type="text/javascript" src="./js/jquery.min.js"></script>
<script type="text/javascript" src="./js/bootstrap.min.js"></script>
<script type="text/javascript" src="./js/readtheorg.js"></script>
2020-09-09 21:13:39 +02:00
<script>MathJax = {
tex: {
tags: 'ams',
macros: {bm: ["\\boldsymbol{#1}",1],}
}
};
</script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
2020-08-31 16:10:13 +02:00
</head>
<body>
<div id="content">
<h1 class="title">Sensor Fusion - Test Bench</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org361d712">1. Experimental Setup</a></li>
<li><a href="#org4484129">2. First identification of the system</a>
2020-08-31 16:10:13 +02:00
<ul>
<li><a href="#org8374efd">2.1. Load Data</a></li>
<li><a href="#org5a7da22">2.2. Excitation Signal</a></li>
<li><a href="#org9a6f0a8">2.3. Identified Plant</a></li>
<li><a href="#org387281e">2.4. Simscape Model - Comparison</a></li>
<li><a href="#orgd7d25ef">2.5. Integral Force Feedback</a></li>
<li><a href="#org569bac8">2.6. Inertial Sensors</a></li>
2020-09-09 21:13:39 +02:00
</ul>
</li>
<li><a href="#orge69e7cd">3. Optimal IFF Development</a>
2020-09-09 21:13:39 +02:00
<ul>
<li><a href="#orgd67a48a">3.1. Load Data</a></li>
<li><a href="#org1c61362">3.2. Experimental Data</a></li>
<li><a href="#orgf5e8e41">3.3. Model of the IFF Plant</a></li>
<li><a href="#org7e5153a">3.4. Root Locus and optimal Controller</a></li>
<li><a href="#org172a1db">3.5. Verification of the achievable damping</a></li>
2020-09-09 21:13:39 +02:00
</ul>
</li>
<li><a href="#org774b735">4. Generate the excitation signal</a>
2020-09-09 21:13:39 +02:00
<ul>
<li><a href="#orgbf6a102">4.1. Transfer function from excitation signal to displacement</a></li>
<li><a href="#orgf66eb55">4.2. Motion measured during Huddle test</a></li>
2020-11-03 10:53:34 +01:00
</ul>
</li>
<li><a href="#orgf37c81c">5. Identification of the Inertial Sensors Dynamics</a>
2020-11-03 10:53:34 +01:00
<ul>
<li><a href="#org5baba78">5.1. Load Data</a></li>
<li><a href="#orgb75bc2a">5.2. Compare PSD during Huddle and and during identification</a></li>
<li><a href="#org11186e9">5.3. Compute transfer functions</a></li>
2020-11-03 10:53:34 +01:00
</ul>
</li>
<li><a href="#org60d0c43">6. Inertial Sensor Noise and the \(\mathcal{H}_2\) Synthesis of complementary filters</a>
2020-09-09 21:13:39 +02:00
<ul>
<li><a href="#org5ff33e6">6.1. Load Data</a></li>
<li><a href="#orgabd9a81">6.2. ASD of the Measured displacement</a></li>
<li><a href="#org0189d1d">6.3. ASD of the Sensor Noise</a></li>
<li><a href="#org19f21e7">6.4. Noise Model</a></li>
<li><a href="#org58d6224">6.5. \(\mathcal{H}_2\) Synthesis of the Complementary Filters</a></li>
<li><a href="#org31ad32f">6.6. Results</a></li>
2020-09-09 21:13:39 +02:00
</ul>
</li>
<li><a href="#orgcc8b51c">7. Inertial Sensor Dynamics Uncertainty and the \(\mathcal{H}_\infty\) Synthesis of complementary filters</a>
2020-11-03 10:53:34 +01:00
<ul>
<li><a href="#org3253278">7.1. Load Data</a></li>
<li><a href="#org90882eb">7.2. Compute the dynamics of both sensors</a></li>
<li><a href="#org8741d7c">7.3. Dynamics uncertainty estimation</a></li>
<li><a href="#orgd1ee4ba">7.4. \(\mathcal{H}_\infty\) Synthesis of Complementary Filters</a></li>
<li><a href="#org9086721">7.5. Obtained Super Sensor Dynamical Uncertainty</a></li>
2020-09-09 21:13:39 +02:00
</ul>
</li>
<li><a href="#org47ef83f">8. Optimal and Robust sensor fusion using the \(\mathcal{H}_2/\mathcal{H}_\infty\) synthesis</a>
2020-09-09 21:13:39 +02:00
<ul>
<li><a href="#org9333089">8.1. Noise and Dynamical uncertainty weights</a></li>
<li><a href="#org8d3eab1">8.2. Obtained Super Sensor Noise</a></li>
<li><a href="#orgf71fc02">8.3. Obtained Super Sensor Dynamical Uncertainty</a></li>
<li><a href="#orga7373db">8.4. Experimental Super Sensor Dynamical Uncertainty</a></li>
<li><a href="#org808581c">8.5. Experimental Super Sensor Noise</a></li>
2020-09-09 21:13:39 +02:00
</ul>
</li>
<li><a href="#org03d48a9">9. Matlab Functions</a>
2020-09-09 21:13:39 +02:00
<ul>
<li><a href="#org2a1488e">9.1. <code>createWeight</code></a></li>
<li><a href="#org5f0f3d6">9.2. <code>plotMagUncertainty</code></a></li>
<li><a href="#orgbd75cba">9.3. <code>plotPhaseUncertainty</code></a></li>
2020-08-31 16:10:13 +02:00
</ul>
</li>
</ul>
</div>
</div>
<hr>
<p>This report is also available as a <a href="./index.pdf">pdf</a>.</p>
<hr>
<p>
In this document, we wish the experimentally validate sensor fusion of inertial sensors.
</p>
2020-08-31 16:10:13 +02:00
<p>
This document is divided into the following sections:
</p>
<ul class="org-ul">
<li>Section <a href="#orgb65029b">1</a>: the experimental setup is described</li>
<li>Section <a href="#org1ddaa3b">2</a>: a first identification of the system dynamics is performed</li>
<li>Section <a href="#orgeec9c41">3</a>: the integral force feedback active damping technique is applied on the system</li>
<li>Section <a href="#orgca443b9">4</a>: the optimal excitation signal is determine in order to have the best possible system dynamics estimation</li>
<li>Section <a href="#orgd2b810f">5</a>: the inertial sensor dynamics are experimentally estimated</li>
<li>Section <a href="#org27b212a">6</a>: the inertial sensor noises are estimated and the \(\mathcal{H}_2\) synthesis of complementary filters is performed in order to yield a super sensor with minimal noise</li>
<li>Section <a href="#org7c37ebd">7</a>: the dynamical uncertainty of the inertial sensors is estimated. Then the \(\mathcal{H}_\infty\) synthesis of complementary filters is performed in order to minimize the super sensor dynamical uncertainty</li>
<li>Section <a href="#orga87e391">8</a>: Optimal sensor fusion is performed using the \(\mathcal{H}_2/\mathcal{H}_\infty\) synthesis</li>
</ul>
<div id="outline-container-org361d712" class="outline-2">
<h2 id="org361d712"><span class="section-number-2">1</span> Experimental Setup</h2>
2020-08-31 16:10:13 +02:00
<div class="outline-text-2" id="text-1">
2020-09-09 21:13:39 +02:00
<p>
<a id="orgb65029b"></a>
2020-09-09 21:13:39 +02:00
</p>
2020-08-31 16:10:13 +02:00
2020-09-09 21:13:39 +02:00
<p>
The goal of this experimental setup is to experimentally merge inertial sensors.
2020-09-09 21:13:39 +02:00
To merge the sensors, optimal and robust complementary filters are designed.
</p>
<p>
A schematic of the test-bench used is shown in Figure <a href="#orge734249">1</a> and a picture of it is shown in Figure <a href="#org4b03d0c">2</a>.
2020-09-09 21:13:39 +02:00
</p>
2020-08-31 16:10:13 +02:00
<div id="orge734249" class="figure">
<p><img src="figs/exp_setup_sensor_fusion.png" alt="exp_setup_sensor_fusion.png" />
</p>
<p><span class="figure-number">Figure 1: </span>Schematic of the test-bench</p>
</div>
2020-08-31 16:10:13 +02:00
<div id="org4b03d0c" class="figure">
<p><img src="figs/test-bench-sensor-fusion-picture.png" alt="test-bench-sensor-fusion-picture.png" />
</p>
<p><span class="figure-number">Figure 2: </span>Picture of the test-bench</p>
</div>
<p>
Two inertial sensors are used:
</p>
<ul class="org-ul">
<li>An vertical accelerometer <i>PCB 393B05</i> (<a href="doc/TM-VIB-Seismic_Lowres.pdf">doc</a>)</li>
<li>A vertical geophone <i>Mark Product L-22</i></li>
</ul>
2020-09-09 21:13:39 +02:00
<p>
Basic characteristics of both sensors are shown in Tables <a href="#org737e3a2">1</a> and <a href="#org3844864">2</a>.
</p>
2020-09-09 21:13:39 +02:00
<table id="org737e3a2" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption class="t-above"><span class="table-number">Table 1:</span> Accelerometer (393B05) Specifications</caption>
2020-09-09 21:13:39 +02:00
<colgroup>
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left"><b>Specification</b></th>
<th scope="col" class="org-left"><b>Value</b></th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">Sensitivity</td>
<td class="org-left">1.02 [V/(m/s2)]</td>
</tr>
<tr>
<td class="org-left">Resonant Frequency</td>
<td class="org-left">&gt; 2.5 [kHz]</td>
</tr>
<tr>
<td class="org-left">Resolution (1 to 10kHz)</td>
<td class="org-left">0.00004 [m/s2 rms]</td>
</tr>
</tbody>
</table>
<table id="org3844864" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption class="t-above"><span class="table-number">Table 2:</span> Geophone (L22) Specifications</caption>
2020-09-09 21:13:39 +02:00
<colgroup>
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left"><b>Specification</b></th>
<th scope="col" class="org-left"><b>Value</b></th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">Sensitivity</td>
<td class="org-left">To be measured [V/(m/s)]</td>
</tr>
<tr>
<td class="org-left">Resonant Frequency</td>
<td class="org-left">2 [Hz]</td>
</tr>
</tbody>
</table>
<p>
The ADC used are the IO131 Speedgoat module (<a href="https://www.speedgoat.com/products/io-connectivity-analog-io131">link</a>) with a 16bit resolution over +/- 10V.
</p>
<p>
The geophone signals are amplified using a DLPVA-100-B-D voltage amplified from Femto (<a href="doc/de-dlpva-100-b.pdf">doc</a>).
The force sensor signal is amplified using a Low Noise Voltage Preamplifier from Ametek (<a href="doc/model_5113.pdf">doc</a>).
</p>
<p>
The excitation signal is amplified by a linear amplified from Cedrat (LA75B) with a gain equals to 20 (<a href="doc/LA75B.pdf">doc</a>).
2020-09-09 21:13:39 +02:00
</p>
<p>
Geophone electronics:
</p>
<ul class="org-ul">
<li>gain: 10 (20dB)</li>
<li>low pass filter: 1.5Hz</li>
<li>hifh pass filter: 100kHz (2nd order)</li>
</ul>
<p>
Force Sensor electronics:
</p>
<ul class="org-ul">
<li>gain: 10 (20dB)</li>
<li>low pass filter: 1st order at 3Hz</li>
<li>high pass filter: 1st order at 30kHz</li>
</ul>
2020-08-31 16:10:13 +02:00
</div>
</div>
<div id="outline-container-org4484129" class="outline-2">
<h2 id="org4484129"><span class="section-number-2">2</span> First identification of the system</h2>
2020-08-31 16:10:13 +02:00
<div class="outline-text-2" id="text-2">
<p>
<a id="org1ddaa3b"></a>
</p>
<p>
In this section, a first identification of each elements of the system is performed.
This include the dynamics from the actuator to the force sensor, interferometer and inertial sensors.
</p>
<p>
Each of the dynamics is compared with the dynamics identified form a Simscape model.
</p>
2020-08-31 16:10:13 +02:00
</div>
<div id="outline-container-org8374efd" class="outline-3">
<h3 id="org8374efd"><span class="section-number-3">2.1</span> Load Data</h3>
2020-08-31 16:10:13 +02:00
<div class="outline-text-3" id="text-2-1">
<p>
The data is loaded in the Matlab workspace.
</p>
<div class="org-src-container">
<pre class="src src-matlab">id_ol = load(<span class="org-string">'identification_noise_bis.mat'</span>, <span class="org-string">'d'</span>, <span class="org-string">'acc_1'</span>, <span class="org-string">'acc_2'</span>, <span class="org-string">'geo_1'</span>, <span class="org-string">'geo_2'</span>, <span class="org-string">'f_meas'</span>, <span class="org-string">'u'</span>, <span class="org-string">'t'</span>);
</pre>
</div>
<p>
Then, any offset is removed.
</p>
<div class="org-src-container">
<pre class="src src-matlab">id_ol.d = detrend(id_ol.d, 0);
id_ol.acc_1 = detrend(id_ol.acc_1, 0);
id_ol.acc_2 = detrend(id_ol.acc_2, 0);
id_ol.geo_1 = detrend(id_ol.geo_1, 0);
id_ol.geo_2 = detrend(id_ol.geo_2, 0);
id_ol.f_meas = detrend(id_ol.f_meas, 0);
id_ol.u = detrend(id_ol.u, 0);
</pre>
</div>
</div>
</div>
<div id="outline-container-org5a7da22" class="outline-3">
<h3 id="org5a7da22"><span class="section-number-3">2.2</span> Excitation Signal</h3>
<div class="outline-text-3" id="text-2-2">
<p>
The generated voltage used to excite the system is a white noise and can be seen in Figure <a href="#org76befde">3</a>.
</p>
<div id="org76befde" class="figure">
<p><img src="figs/excitation_signal_first_identification.png" alt="excitation_signal_first_identification.png" />
</p>
<p><span class="figure-number">Figure 3: </span>Voltage excitation signal</p>
</div>
</div>
</div>
<div id="outline-container-org9a6f0a8" class="outline-3">
<h3 id="org9a6f0a8"><span class="section-number-3">2.3</span> Identified Plant</h3>
<div class="outline-text-3" id="text-2-3">
<p>
The transfer function from the excitation voltage to the mass displacement and to the force sensor stack voltage are identified using the <code>tfestimate</code> command.
</p>
<div class="org-src-container">
<pre class="src src-matlab">Ts = id_ol.t(2) <span class="org-type">-</span> id_ol.t(1);
win = hann(ceil(10<span class="org-type">/</span>Ts));
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">[tf_fmeas_est, f] = tfestimate(id_ol.u, id_ol.f_meas, win, [], [], 1<span class="org-type">/</span>Ts); <span class="org-comment">% [V/V]</span>
[tf_G_ol_est, <span class="org-type">~</span>] = tfestimate(id_ol.u, id_ol.d, win, [], [], 1<span class="org-type">/</span>Ts); <span class="org-comment">% [m/V]</span>
</pre>
</div>
<p>
The bode plots of the obtained dynamics are shown in Figures <a href="#orgc8ea9f5">4</a> and <a href="#org3581882">5</a>.
</p>
<div id="orgc8ea9f5" class="figure">
<p><img src="figs/force_sensor_bode_plot.png" alt="force_sensor_bode_plot.png" />
</p>
<p><span class="figure-number">Figure 4: </span>Bode plot of the dynamics from excitation voltage to measured force sensor stack voltage</p>
</div>
<div id="org3581882" class="figure">
<p><img src="figs/displacement_sensor_bode_plot.png" alt="displacement_sensor_bode_plot.png" />
</p>
<p><span class="figure-number">Figure 5: </span>Bode plot of the dynamics from excitation voltage to displacement of the mass as measured by the interferometer</p>
</div>
</div>
</div>
<div id="outline-container-org387281e" class="outline-3">
<h3 id="org387281e"><span class="section-number-3">2.4</span> Simscape Model - Comparison</h3>
<div class="outline-text-3" id="text-2-4">
<p>
A simscape model representing the test-bench has been developed.
The same transfer functions as the one identified using the test-bench can be obtained thanks to the simscape model.
</p>
<p>
They are compared in Figure <a href="#org3aa17a4">6</a> and <a href="#org823f457">7</a>.
It is shown that there is a good agreement between the model and the experiment.
</p>
<div class="org-src-container">
<pre class="src src-matlab">load(<span class="org-string">'piezo_amplified_3d.mat'</span>, <span class="org-string">'int_xyz'</span>, <span class="org-string">'int_i'</span>, <span class="org-string">'n_xyz'</span>, <span class="org-string">'n_i'</span>, <span class="org-string">'nodes'</span>, <span class="org-string">'M'</span>, <span class="org-string">'K'</span>);
</pre>
</div>
<div id="org3aa17a4" class="figure">
<p><img src="figs/simscape_comp_iff_plant.png" alt="simscape_comp_iff_plant.png" />
</p>
<p><span class="figure-number">Figure 6: </span>Comparison of the dynamics from excitation voltage to measured force sensor stack voltage - Identified dynamics and Simscape Model</p>
</div>
<div id="org823f457" class="figure">
<p><img src="figs/simscape_comp_disp_plant.png" alt="simscape_comp_disp_plant.png" />
</p>
<p><span class="figure-number">Figure 7: </span>Comparison of the dynamics from excitation voltage to measured mass displacement - Identified dynamics and Simscape Model</p>
</div>
</div>
</div>
<div id="outline-container-orgd7d25ef" class="outline-3">
<h3 id="orgd7d25ef"><span class="section-number-3">2.5</span> Integral Force Feedback</h3>
<div class="outline-text-3" id="text-2-5">
<p>
The force sensor stack can be used to damp the system.
This makes the system easier to excite properly without too much amplification near resonances.
</p>
<p>
This is done thanks to the integral force feedback control architecture.
</p>
<p>
The force sensor stack signal is integrated (or rather low pass filtered) and fed back to the force sensor stacks.
</p>
<p>
The low pass filter used as the controller is defined below:
</p>
<div class="org-src-container">
<pre class="src src-matlab">Kiff = 102<span class="org-type">/</span>(s <span class="org-type">+</span> 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>2);
</pre>
</div>
<p>
The integral force feedback control strategy is applied to the simscape model as well as to the real test bench.
</p>
<p>
The damped system is then identified again using a noise excitation.
</p>
<p>
The data is loaded into Matlab and any offset is removed.
</p>
<div class="org-src-container">
<pre class="src src-matlab">id_cl = load(<span class="org-string">'identification_noise_iff_bis.mat'</span>, <span class="org-string">'d'</span>, <span class="org-string">'acc_1'</span>, <span class="org-string">'acc_2'</span>, <span class="org-string">'geo_1'</span>, <span class="org-string">'geo_2'</span>, <span class="org-string">'f_meas'</span>, <span class="org-string">'u'</span>, <span class="org-string">'t'</span>);
id_cl.d = detrend(id_cl.d, 0);
id_cl.acc_1 = detrend(id_cl.acc_1, 0);
id_cl.acc_2 = detrend(id_cl.acc_2, 0);
id_cl.geo_1 = detrend(id_cl.geo_1, 0);
id_cl.geo_2 = detrend(id_cl.geo_2, 0);
id_cl.f_meas = detrend(id_cl.f_meas, 0);
id_cl.u = detrend(id_cl.u, 0);
</pre>
</div>
<p>
The transfer functions are estimated using <code>tfestimate</code>.
</p>
<div class="org-src-container">
<pre class="src src-matlab">[tf_G_cl_est, <span class="org-type">~</span>] = tfestimate(id_cl.u, id_cl.d, win, [], [], 1<span class="org-type">/</span>Ts);
[co_G_cl_est, <span class="org-type">~</span>] = mscohere( id_cl.u, id_cl.d, win, [], [], 1<span class="org-type">/</span>Ts);
</pre>
</div>
<p>
The dynamics from driving voltage to the measured displacement are compared both in the open-loop and IFF case, and for the test-bench experimental identification and for the Simscape model in Figure <a href="#orgeb32921">8</a>.
This shows that the Integral Force Feedback architecture effectively damps the first resonance of the system.
</p>
<div id="orgeb32921" class="figure">
<p><img src="figs/iff_ol_cl_identified_simscape_comp.png" alt="iff_ol_cl_identified_simscape_comp.png" />
</p>
<p><span class="figure-number">Figure 8: </span>Comparison of the open-loop and closed-loop (IFF) dynamics for both the real identification and the Simscape one</p>
</div>
</div>
</div>
<div id="outline-container-org569bac8" class="outline-3">
<h3 id="org569bac8"><span class="section-number-3">2.6</span> Inertial Sensors</h3>
<div class="outline-text-3" id="text-2-6">
<p>
In order to estimate the dynamics of the inertial sensor (the transfer function from the &ldquo;absolute&rdquo; displacement to the measured voltage), the following experiment can be performed:
</p>
<ul class="org-ul">
<li>The mass is excited such that is relative displacement as measured by the interferometer is much larger that the ground &ldquo;absolute&rdquo; motion.</li>
<li>The transfer function from the measured displacement by the interferometer to the measured voltage generated by the inertial sensors can be estimated.</li>
</ul>
<p>
The first point is quite important in order to have a good coherence between the interferometer measurement and the inertial sensor measurement.
</p>
<p>
Here, a first identification is performed were the excitation signal is a white noise.
</p>
<p>
As usual, the data is loaded and any offset is removed.
</p>
2020-08-31 16:10:13 +02:00
<div class="org-src-container">
<pre class="src src-matlab">id = load(<span class="org-string">'identification_noise_opt_iff.mat'</span>, <span class="org-string">'d'</span>, <span class="org-string">'acc_1'</span>, <span class="org-string">'acc_2'</span>, <span class="org-string">'geo_1'</span>, <span class="org-string">'geo_2'</span>, <span class="org-string">'f_meas'</span>, <span class="org-string">'u'</span>, <span class="org-string">'t'</span>);
id.d = detrend(id.d, 0);
id.acc_1 = detrend(id.acc_1, 0);
id.acc_2 = detrend(id.acc_2, 0);
id.geo_1 = detrend(id.geo_1, 0);
id.geo_2 = detrend(id.geo_2, 0);
id.f_meas = detrend(id.f_meas, 0);
</pre>
</div>
<p>
Then the transfer functions from the measured displacement by the interferometer to the generated voltage of the inertial sensors are computed..
</p>
<div class="org-src-container">
<pre class="src src-matlab">Ts = id.t(2) <span class="org-type">-</span> id.t(1);
win = hann(ceil(10<span class="org-type">/</span>Ts));
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">[tf_acc1_est, f] = tfestimate(id.d, id.acc_1, win, [], [], 1<span class="org-type">/</span>Ts);
[co_acc1_est, <span class="org-type">~</span>] = mscohere( id.d, id.acc_1, win, [], [], 1<span class="org-type">/</span>Ts);
[tf_acc2_est, <span class="org-type">~</span>] = tfestimate(id.d, id.acc_2, win, [], [], 1<span class="org-type">/</span>Ts);
[co_acc2_est, <span class="org-type">~</span>] = mscohere( id.d, id.acc_2, win, [], [], 1<span class="org-type">/</span>Ts);
[tf_geo1_est, <span class="org-type">~</span>] = tfestimate(id.d, id.geo_1, win, [], [], 1<span class="org-type">/</span>Ts);
[co_geo1_est, <span class="org-type">~</span>] = mscohere( id.d, id.geo_1, win, [], [], 1<span class="org-type">/</span>Ts);
[tf_geo2_est, <span class="org-type">~</span>] = tfestimate(id.d, id.geo_2, win, [], [], 1<span class="org-type">/</span>Ts);
[co_geo2_est, <span class="org-type">~</span>] = mscohere( id.d, id.geo_2, win, [], [], 1<span class="org-type">/</span>Ts);
</pre>
</div>
<p>
The same transfer functions are estimated using the Simscape model.
</p>
<p>
The obtained dynamics of the accelerometer are compared in Figure <a href="#orga598431">9</a> while the one of the geophones are compared in Figure <a href="#org93e33f1">10</a>.
</p>
<div id="orga598431" class="figure">
<p><img src="figs/comp_dynamics_accelerometer.png" alt="comp_dynamics_accelerometer.png" />
</p>
<p><span class="figure-number">Figure 9: </span>Comparison of the measured accelerometer dynamics</p>
</div>
<div id="org93e33f1" class="figure">
<p><img src="figs/comp_dynamics_geophone.png" alt="comp_dynamics_geophone.png" />
</p>
<p><span class="figure-number">Figure 10: </span>Comparison of the measured geophone dynamics</p>
</div>
</div>
</div>
</div>
<div id="outline-container-orge69e7cd" class="outline-2">
<h2 id="orge69e7cd"><span class="section-number-2">3</span> Optimal IFF Development</h2>
<div class="outline-text-2" id="text-3">
<p>
<a id="orgeec9c41"></a>
</p>
<p>
In this section, a proper identification of the transfer function from the force actuator to the force sensor is performed.
Then, an optimal IFF controller is developed and applied experimentally.
</p>
<p>
The damped system is identified to verified the effectiveness of the added method.
</p>
</div>
<div id="outline-container-orgd67a48a" class="outline-3">
<h3 id="orgd67a48a"><span class="section-number-3">3.1</span> Load Data</h3>
<div class="outline-text-3" id="text-3-1">
<p>
The experimental data is loaded and any offset is removed.
</p>
<div class="org-src-container">
<pre class="src src-matlab">id_ol = load(<span class="org-string">'identification_noise_bis.mat'</span>, <span class="org-string">'d'</span>, <span class="org-string">'acc_1'</span>, <span class="org-string">'acc_2'</span>, <span class="org-string">'geo_1'</span>, <span class="org-string">'geo_2'</span>, <span class="org-string">'f_meas'</span>, <span class="org-string">'u'</span>, <span class="org-string">'t'</span>);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">id_ol.d = detrend(id_ol.d, 0);
2020-11-03 10:53:34 +01:00
id_ol.acc_1 = detrend(id_ol.acc_1, 0);
id_ol.acc_2 = detrend(id_ol.acc_2, 0);
id_ol.geo_1 = detrend(id_ol.geo_1, 0);
id_ol.geo_2 = detrend(id_ol.geo_2, 0);
id_ol.f_meas = detrend(id_ol.f_meas, 0);
id_ol.u = detrend(id_ol.u, 0);
2020-08-31 16:10:13 +02:00
</pre>
</div>
</div>
</div>
<div id="outline-container-org1c61362" class="outline-3">
<h3 id="org1c61362"><span class="section-number-3">3.2</span> Experimental Data</h3>
<div class="outline-text-3" id="text-3-2">
<p>
The transfer function from force actuator to force sensors is estimated.
</p>
<p>
The coherence shown in Figure <a href="#orgdb3345a">11</a> shows that the excitation signal is good enough.
</p>
2020-08-31 16:10:13 +02:00
<div class="org-src-container">
<pre class="src src-matlab">Ts = id_ol.t(2) <span class="org-type">-</span> id_ol.t(1);
win = hann(ceil(10<span class="org-type">/</span>Ts));
2020-09-09 21:13:39 +02:00
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">[tf_fmeas_est, f] = tfestimate(id_ol.u, id_ol.f_meas, win, [], [], 1<span class="org-type">/</span>Ts); <span class="org-comment">% [V/m]</span>
[co_fmeas_est, <span class="org-type">~</span>] = mscohere( id_ol.u, id_ol.f_meas, win, [], [], 1<span class="org-type">/</span>Ts);
2020-09-09 21:13:39 +02:00
</pre>
</div>
<div id="orgdb3345a" class="figure">
2020-09-09 21:13:39 +02:00
<p><img src="figs/iff_identification_coh.png" alt="iff_identification_coh.png" />
</p>
<p><span class="figure-number">Figure 11: </span>Coherence for the identification of the IFF plant</p>
2020-09-09 21:13:39 +02:00
</div>
<p>
The obtained dynamics is shown in Figure <a href="#orgb267136">12</a>.
</p>
2020-09-09 21:13:39 +02:00
<div id="orgb267136" class="figure">
2020-09-09 21:13:39 +02:00
<p><img src="figs/iff_identification_bode_plot.png" alt="iff_identification_bode_plot.png" />
</p>
<p><span class="figure-number">Figure 12: </span>Bode plot of the identified IFF plant</p>
2020-09-09 21:13:39 +02:00
</div>
</div>
</div>
<div id="outline-container-orgf5e8e41" class="outline-3">
<h3 id="orgf5e8e41"><span class="section-number-3">3.3</span> Model of the IFF Plant</h3>
<div class="outline-text-3" id="text-3-3">
<p>
In order to plot the root locus for the IFF control strategy, a model of the identified plant is developed.
</p>
<p>
It consists of several poles and zeros are shown below.
</p>
2020-09-09 21:13:39 +02:00
<div class="org-src-container">
<pre class="src src-matlab">wz = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>102;
2020-09-09 21:13:39 +02:00
xi_z = 0.01;
wp = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>239.4;
2020-09-09 21:13:39 +02:00
xi_p = 0.015;
Giff = 2.2<span class="org-type">*</span>(s<span class="org-type">^</span>2 <span class="org-type">+</span> 2<span class="org-type">*</span>xi_z<span class="org-type">*</span>s<span class="org-type">*</span>wz <span class="org-type">+</span> wz<span class="org-type">^</span>2)<span class="org-type">/</span>(s<span class="org-type">^</span>2 <span class="org-type">+</span> 2<span class="org-type">*</span>xi_p<span class="org-type">*</span>s<span class="org-type">*</span>wp <span class="org-type">+</span> wp<span class="org-type">^</span>2) <span class="org-type">*</span> ...<span class="org-comment"> % Dynamics</span>
10<span class="org-type">*</span>(s<span class="org-type">/</span>3<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>3<span class="org-type">/</span><span class="org-constant">pi</span>)) <span class="org-type">*</span> ...<span class="org-comment"> % Low pass filter and gain of the voltage amplifier</span>
exp(<span class="org-type">-</span>Ts<span class="org-type">*</span>s); <span class="org-comment">% Time delay induced by ADC/DAC</span>
2020-09-09 21:13:39 +02:00
</pre>
</div>
<p>
The comparison of the identified dynamics and the developed model is done in Figure <a href="#orgbcf01eb">13</a>.
</p>
2020-09-09 21:13:39 +02:00
<div id="orgbcf01eb" class="figure">
2020-09-09 21:13:39 +02:00
<p><img src="figs/iff_plant_model.png" alt="iff_plant_model.png" />
</p>
<p><span class="figure-number">Figure 13: </span>IFF Plant + Model</p>
2020-09-09 21:13:39 +02:00
</div>
</div>
</div>
<div id="outline-container-org7e5153a" class="outline-3">
<h3 id="org7e5153a"><span class="section-number-3">3.4</span> Root Locus and optimal Controller</h3>
<div class="outline-text-3" id="text-3-4">
<p>
Now, the root locus for the Integral Force Feedback strategy is computed and shown in Figure <a href="#orgde2d43b">14</a>.
</p>
<p>
Note that the controller used is not a pure integrator but rather a first order low pass filter with a cut-off frequency set at 2Hz.
</p>
2020-09-09 21:13:39 +02:00
<div id="orgde2d43b" class="figure">
2020-09-09 21:13:39 +02:00
<p><img src="figs/iff_root_locus.png" alt="iff_root_locus.png" />
</p>
<p><span class="figure-number">Figure 14: </span>Root Locus for the IFF control</p>
2020-09-09 21:13:39 +02:00
</div>
<p>
The controller that yield maximum damping (shown by the red cross in Figure <a href="#orgde2d43b">14</a>) is:
2020-09-09 21:13:39 +02:00
</p>
<div class="org-src-container">
<pre class="src src-matlab">Kiff_opt = 102<span class="org-type">/</span>(s <span class="org-type">+</span> 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>2);
2020-09-09 21:13:39 +02:00
</pre>
</div>
</div>
</div>
<div id="outline-container-org172a1db" class="outline-3">
<h3 id="org172a1db"><span class="section-number-3">3.5</span> Verification of the achievable damping</h3>
<div class="outline-text-3" id="text-3-5">
<p>
A new identification is performed with the IFF control strategy applied to the system.
</p>
2020-09-09 21:13:39 +02:00
<p>
Data is loaded and offset removed.
2020-09-09 21:13:39 +02:00
</p>
<div class="org-src-container">
<pre class="src src-matlab">id_cl = load(<span class="org-string">'identification_noise_iff_bis.mat'</span>, <span class="org-string">'d'</span>, <span class="org-string">'acc_1'</span>, <span class="org-string">'acc_2'</span>, <span class="org-string">'geo_1'</span>, <span class="org-string">'geo_2'</span>, <span class="org-string">'f_meas'</span>, <span class="org-string">'u'</span>, <span class="org-string">'t'</span>);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">id_cl.d = detrend(id_cl.d, 0);
2020-11-03 10:53:34 +01:00
id_cl.acc_1 = detrend(id_cl.acc_1, 0);
id_cl.acc_2 = detrend(id_cl.acc_2, 0);
id_cl.geo_1 = detrend(id_cl.geo_1, 0);
id_cl.geo_2 = detrend(id_cl.geo_2, 0);
id_cl.f_meas = detrend(id_cl.f_meas, 0);
id_cl.u = detrend(id_cl.u, 0);
2020-09-09 21:13:39 +02:00
</pre>
</div>
<p>
The open-loop and closed-loop dynamics are estimated.
</p>
2020-09-09 21:13:39 +02:00
<div class="org-src-container">
<pre class="src src-matlab">[tf_G_ol_est, f] = tfestimate(id_ol.u, id_ol.d, win, [], [], 1<span class="org-type">/</span>Ts);
[co_G_ol_est, <span class="org-type">~</span>] = mscohere( id_ol.u, id_ol.d, win, [], [], 1<span class="org-type">/</span>Ts);
[tf_G_cl_est, <span class="org-type">~</span>] = tfestimate(id_cl.u, id_cl.d, win, [], [], 1<span class="org-type">/</span>Ts);
[co_G_cl_est, <span class="org-type">~</span>] = mscohere( id_cl.u, id_cl.d, win, [], [], 1<span class="org-type">/</span>Ts);
2020-09-09 21:13:39 +02:00
</pre>
</div>
<p>
The obtained coherence is shown in Figure <a href="#org0e4c03a">15</a> and the dynamics in Figure <a href="#org412a9a5">16</a>.
</p>
2020-09-09 21:13:39 +02:00
<div id="org0e4c03a" class="figure">
2020-09-09 21:13:39 +02:00
<p><img src="figs/Gd_identification_iff_coherence.png" alt="Gd_identification_iff_coherence.png" />
</p>
<p><span class="figure-number">Figure 15: </span>Coherence for the transfer function from F to d, with and without IFF</p>
2020-09-09 21:13:39 +02:00
</div>
<div id="org412a9a5" class="figure">
2020-09-09 21:13:39 +02:00
<p><img src="figs/Gd_identification_iff_bode_plot.png" alt="Gd_identification_iff_bode_plot.png" />
</p>
<p><span class="figure-number">Figure 16: </span>Coherence for the transfer function from F to d, with and without IFF</p>
2020-09-09 21:13:39 +02:00
</div>
</div>
</div>
</div>
<div id="outline-container-org774b735" class="outline-2">
<h2 id="org774b735"><span class="section-number-2">4</span> Generate the excitation signal</h2>
<div class="outline-text-2" id="text-4">
<p>
<a id="orgca443b9"></a>
</p>
<p>
In order to properly estimate the dynamics of the inertial sensor, the excitation signal must be properly chosen.
</p>
2020-09-09 21:13:39 +02:00
<p>
The requirements on the excitation signal is:
</p>
<ul class="org-ul">
<li>General much larger motion that the measured motion during the huddle test</li>
<li>Don&rsquo;t damage the actuator</li>
</ul>
<p>
To determine the perfect voltage signal to be generated, we need two things:
</p>
<ul class="org-ul">
<li>the transfer function from voltage to mass displacement</li>
<li>the PSD of the measured motion by the inertial sensors</li>
<li>not saturate the sensor signals</li>
<li>provide enough signal/noise ratio (good coherence) in the frequency band of interest (~0.5Hz to 3kHz)</li>
</ul>
</div>
<div id="outline-container-orgbf6a102" class="outline-3">
<h3 id="orgbf6a102"><span class="section-number-3">4.1</span> Transfer function from excitation signal to displacement</h3>
<div class="outline-text-3" id="text-4-1">
2020-09-09 21:13:39 +02:00
<p>
Let&rsquo;s first estimate the transfer function from the excitation signal in [V] to the generated displacement in [m] as measured by the inteferometer.
</p>
<div class="org-src-container">
<pre class="src src-matlab">id_cl = load(<span class="org-string">'identification_noise_iff_bis.mat'</span>, <span class="org-string">'d'</span>, <span class="org-string">'acc_1'</span>, <span class="org-string">'acc_2'</span>, <span class="org-string">'geo_1'</span>, <span class="org-string">'geo_2'</span>, <span class="org-string">'f_meas'</span>, <span class="org-string">'u'</span>, <span class="org-string">'t'</span>);
2020-09-09 21:13:39 +02:00
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">Ts = id_cl.t(2) <span class="org-type">-</span> id_cl.t(1);
win = hann(ceil(10<span class="org-type">/</span>Ts));
2020-11-03 10:53:34 +01:00
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">[tf_G_cl_est, f] = tfestimate(id_cl.u, id_cl.d, win, [], [], 1<span class="org-type">/</span>Ts);
[co_G_cl_est, <span class="org-type">~</span>] = mscohere( id_cl.u, id_cl.d, win, [], [], 1<span class="org-type">/</span>Ts);
2020-09-09 21:13:39 +02:00
</pre>
</div>
<p>
Approximate transfer function from voltage output to generated displacement when IFF is used, in [m/V].
</p>
<div class="org-src-container">
<pre class="src src-matlab">G_d_est = <span class="org-type">-</span>5e<span class="org-type">-</span>6<span class="org-type">*</span>(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>230)<span class="org-type">^</span>2<span class="org-type">/</span>(s<span class="org-type">^</span>2 <span class="org-type">+</span> 2<span class="org-type">*</span>0.3<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>240<span class="org-type">*</span>s <span class="org-type">+</span> (2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>240)<span class="org-type">^</span>2);
2020-09-09 21:13:39 +02:00
</pre>
</div>
<div id="org5a89f84" class="figure">
2020-09-09 21:13:39 +02:00
<p><img src="figs/Gd_plant_estimation.png" alt="Gd_plant_estimation.png" />
</p>
<p><span class="figure-number">Figure 17: </span>Estimation of the transfer function from the excitation signal to the generated displacement</p>
2020-09-09 21:13:39 +02:00
</div>
</div>
</div>
<div id="outline-container-orgf66eb55" class="outline-3">
<h3 id="orgf66eb55"><span class="section-number-3">4.2</span> Motion measured during Huddle test</h3>
<div class="outline-text-3" id="text-4-2">
2020-09-09 21:13:39 +02:00
<p>
We now compute the PSD of the measured motion by the inertial sensors during the huddle test.
</p>
<div class="org-src-container">
<pre class="src src-matlab">ht = load(<span class="org-string">'huddle_test.mat'</span>, <span class="org-string">'d'</span>, <span class="org-string">'acc_1'</span>, <span class="org-string">'acc_2'</span>, <span class="org-string">'geo_1'</span>, <span class="org-string">'geo_2'</span>, <span class="org-string">'f_meas'</span>, <span class="org-string">'u'</span>, <span class="org-string">'t'</span>);
2020-11-03 10:53:34 +01:00
ht.d = detrend(ht.d, 0);
ht.acc_1 = detrend(ht.acc_1, 0);
ht.acc_2 = detrend(ht.acc_2, 0);
ht.geo_1 = detrend(ht.geo_1, 0);
ht.geo_2 = detrend(ht.geo_2, 0);
2020-09-09 21:13:39 +02:00
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">[p_d, f] = pwelch(ht.d, win, [], [], 1<span class="org-type">/</span>Ts);
[p_acc1, <span class="org-type">~</span>] = pwelch(ht.acc_1, win, [], [], 1<span class="org-type">/</span>Ts);
[p_acc2, <span class="org-type">~</span>] = pwelch(ht.acc_2, win, [], [], 1<span class="org-type">/</span>Ts);
[p_geo1, <span class="org-type">~</span>] = pwelch(ht.geo_1, win, [], [], 1<span class="org-type">/</span>Ts);
[p_geo2, <span class="org-type">~</span>] = pwelch(ht.geo_2, win, [], [], 1<span class="org-type">/</span>Ts);
2020-09-09 21:13:39 +02:00
</pre>
</div>
<p>
Using an estimated model of the sensor dynamics from the documentation of the sensors, we can compute the ASD of the motion in \(m/\sqrt{Hz}\) measured by the sensors.
</p>
<div class="org-src-container">
<pre class="src src-matlab">G_acc = 1<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>2500); <span class="org-comment">% [V/(m/s2)]</span>
G_geo = <span class="org-type">-</span>120<span class="org-type">*</span>s<span class="org-type">^</span>2<span class="org-type">/</span>(s<span class="org-type">^</span>2 <span class="org-type">+</span> 2<span class="org-type">*</span>0.7<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>2<span class="org-type">*</span>s <span class="org-type">+</span> (2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>2)<span class="org-type">^</span>2); <span class="org-comment">% [V/(m/s)]</span>
2020-09-09 21:13:39 +02:00
</pre>
</div>
<div id="orgf65c98a" class="figure">
2020-09-09 21:13:39 +02:00
<p><img src="figs/huddle_test_psd_motion.png" alt="huddle_test_psd_motion.png" />
</p>
<p><span class="figure-number">Figure 18: </span>ASD of the motion measured by the sensors</p>
2020-09-09 21:13:39 +02:00
</div>
<p>
From the ASD of the motion measured by the sensors, we can create an excitation signal that will generate much motion motion that the motion under no excitation.
</p>
<p>
We create <code>G_exc</code> that corresponds to the wanted generated motion.
</p>
<div class="org-src-container">
<pre class="src src-matlab">G_exc = 0.2e<span class="org-type">-</span>6<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>2)<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>50);
2020-09-09 21:13:39 +02:00
</pre>
</div>
<p>
And we create a time domain signal <code>y_d</code> that have the spectral density described by <code>G_exc</code>.
</p>
<div class="org-src-container">
<pre class="src src-matlab">Fs = 1<span class="org-type">/</span>Ts;
t = 0<span class="org-type">:</span>Ts<span class="org-type">:</span>180; <span class="org-comment">% Time Vector [s]</span>
u = sqrt(Fs<span class="org-type">/</span>2)<span class="org-type">*</span>randn(length(t), 1); <span class="org-comment">% Signal with an ASD equal to one</span>
2020-09-09 21:13:39 +02:00
y_d = lsim(G_exc, u, t);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">[pxx, <span class="org-type">~</span>] = pwelch(y_d, win, 0, [], Fs);
2020-09-09 21:13:39 +02:00
</pre>
</div>
<div id="org1a1787d" class="figure">
2020-09-09 21:13:39 +02:00
<p><img src="figs/comp_huddle_test_excited_motion_psd.png" alt="comp_huddle_test_excited_motion_psd.png" />
</p>
<p><span class="figure-number">Figure 19: </span>Comparison of the ASD of the motion during Huddle and the wanted generated motion</p>
2020-09-09 21:13:39 +02:00
</div>
<p>
We can now generate the voltage signal that will generate the wanted motion.
</p>
<div class="org-src-container">
<pre class="src src-matlab">y_v = lsim(G_exc <span class="org-type">*</span> ...<span class="org-comment"> % from unit PSD to shaped PSD</span>
(1 <span class="org-type">+</span> s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>50) <span class="org-type">*</span> ...<span class="org-comment"> % Inverse of pre-filter included in the Simulink file</span>
1<span class="org-type">/</span>G_d_est <span class="org-type">*</span> ...<span class="org-comment"> % Wanted displacement =&gt; required voltage</span>
1<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>5e3), ...<span class="org-comment"> % Add some high frequency filtering</span>
2020-09-09 21:13:39 +02:00
u, t);
</pre>
</div>
<div id="org4253b0b" class="figure">
2020-09-09 21:13:39 +02:00
<p><img src="figs/optimal_exc_signal_time.png" alt="optimal_exc_signal_time.png" />
</p>
<p><span class="figure-number">Figure 20: </span>Generated excitation signal</p>
2020-09-09 21:13:39 +02:00
</div>
</div>
</div>
</div>
<div id="outline-container-orgf37c81c" class="outline-2">
<h2 id="orgf37c81c"><span class="section-number-2">5</span> Identification of the Inertial Sensors Dynamics</h2>
<div class="outline-text-2" id="text-5">
<p>
<a id="orgd2b810f"></a>
</p>
<p>
Using the excitation signal generated in Section <a href="#orgca443b9">4</a>, the dynamics of the inertial sensors are identified.
</p>
2020-09-09 21:13:39 +02:00
</div>
<div id="outline-container-org5baba78" class="outline-3">
<h3 id="org5baba78"><span class="section-number-3">5.1</span> Load Data</h3>
<div class="outline-text-3" id="text-5-1">
<p>
Both the measurement data during the identification test and during an &ldquo;huddle test&rdquo; are loaded.
</p>
2020-09-09 21:13:39 +02:00
<div class="org-src-container">
<pre class="src src-matlab">id = load(<span class="org-string">'identification_noise_opt_iff.mat'</span>, <span class="org-string">'d'</span>, <span class="org-string">'acc_1'</span>, <span class="org-string">'acc_2'</span>, <span class="org-string">'geo_1'</span>, <span class="org-string">'geo_2'</span>, <span class="org-string">'f_meas'</span>, <span class="org-string">'u'</span>, <span class="org-string">'t'</span>);
ht = load(<span class="org-string">'huddle_test.mat'</span>, <span class="org-string">'d'</span>, <span class="org-string">'acc_1'</span>, <span class="org-string">'acc_2'</span>, <span class="org-string">'geo_1'</span>, <span class="org-string">'geo_2'</span>, <span class="org-string">'f_meas'</span>, <span class="org-string">'u'</span>, <span class="org-string">'t'</span>);
2020-09-09 21:13:39 +02:00
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">ht.d = detrend(ht.d, 0);
ht.acc_1 = detrend(ht.acc_1, 0);
ht.acc_2 = detrend(ht.acc_2, 0);
ht.geo_1 = detrend(ht.geo_1, 0);
ht.geo_2 = detrend(ht.geo_2, 0);
ht.f_meas = detrend(ht.f_meas, 0);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">id.d = detrend(id.d, 0);
id.acc_1 = detrend(id.acc_1, 0);
id.acc_2 = detrend(id.acc_2, 0);
id.geo_1 = detrend(id.geo_1, 0);
id.geo_2 = detrend(id.geo_2, 0);
id.f_meas = detrend(id.f_meas, 0);
</pre>
</div>
</div>
</div>
<div id="outline-container-orgb75bc2a" class="outline-3">
<h3 id="orgb75bc2a"><span class="section-number-3">5.2</span> Compare PSD during Huddle and and during identification</h3>
<div class="outline-text-3" id="text-5-2">
<p>
The Power Spectral Density of the measured motion during the huddle test and during the identification test are compared in Figures <a href="#orgcfe2f37">21</a> and <a href="#orgfa98f1f">22</a>.
</p>
2020-09-09 21:13:39 +02:00
<div class="org-src-container">
<pre class="src src-matlab">Ts = ht.t(2) <span class="org-type">-</span> ht.t(1);
win = hann(ceil(10<span class="org-type">/</span>Ts));
2020-09-09 21:13:39 +02:00
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">[p_id_d, f] = pwelch(id.d, win, [], [], 1<span class="org-type">/</span>Ts);
[p_id_acc1, <span class="org-type">~</span>] = pwelch(id.acc_1, win, [], [], 1<span class="org-type">/</span>Ts);
[p_id_acc2, <span class="org-type">~</span>] = pwelch(id.acc_2, win, [], [], 1<span class="org-type">/</span>Ts);
[p_id_geo1, <span class="org-type">~</span>] = pwelch(id.geo_1, win, [], [], 1<span class="org-type">/</span>Ts);
[p_id_geo2, <span class="org-type">~</span>] = pwelch(id.geo_2, win, [], [], 1<span class="org-type">/</span>Ts);
2020-09-09 21:13:39 +02:00
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">[p_ht_d, <span class="org-type">~</span>] = pwelch(ht.d, win, [], [], 1<span class="org-type">/</span>Ts);
[p_ht_acc1, <span class="org-type">~</span>] = pwelch(ht.acc_1, win, [], [], 1<span class="org-type">/</span>Ts);
[p_ht_acc2, <span class="org-type">~</span>] = pwelch(ht.acc_2, win, [], [], 1<span class="org-type">/</span>Ts);
[p_ht_geo1, <span class="org-type">~</span>] = pwelch(ht.geo_1, win, [], [], 1<span class="org-type">/</span>Ts);
[p_ht_geo2, <span class="org-type">~</span>] = pwelch(ht.geo_2, win, [], [], 1<span class="org-type">/</span>Ts);
[p_ht_fmeas, <span class="org-type">~</span>] = pwelch(ht.f_meas, win, [], [], 1<span class="org-type">/</span>Ts);
2020-09-09 21:13:39 +02:00
</pre>
</div>
<div id="orgcfe2f37" class="figure">
<p><img src="figs/comp_psd_huddle_test_identification_acc.png" alt="comp_psd_huddle_test_identification_acc.png" />
</p>
<p><span class="figure-number">Figure 21: </span>Comparison of the PSD of the measured motion during the Huddle test and during the identification</p>
</div>
<div id="orgfa98f1f" class="figure">
<p><img src="figs/comp_psd_huddle_test_identification_geo.png" alt="comp_psd_huddle_test_identification_geo.png" />
2020-09-09 21:13:39 +02:00
</p>
<p><span class="figure-number">Figure 22: </span>Comparison of the PSD of the measured motion during the Huddle test and during the identification</p>
2020-09-09 21:13:39 +02:00
</div>
</div>
</div>
<div id="outline-container-org11186e9" class="outline-3">
<h3 id="org11186e9"><span class="section-number-3">5.3</span> Compute transfer functions</h3>
<div class="outline-text-3" id="text-5-3">
<p>
The transfer functions from the motion as measured by the interferometer (and that should represent the absolute motion of the mass) to the inertial sensors are estimated:
</p>
2020-09-09 21:13:39 +02:00
<div class="org-src-container">
<pre class="src src-matlab">[tf_acc1_est, f] = tfestimate(id.d, id.acc_1, win, [], [], 1<span class="org-type">/</span>Ts);
[co_acc1_est, <span class="org-type">~</span>] = mscohere( id.d, id.acc_1, win, [], [], 1<span class="org-type">/</span>Ts);
[tf_acc2_est, <span class="org-type">~</span>] = tfestimate(id.d, id.acc_2, win, [], [], 1<span class="org-type">/</span>Ts);
[co_acc2_est, <span class="org-type">~</span>] = mscohere( id.d, id.acc_2, win, [], [], 1<span class="org-type">/</span>Ts);
2020-09-09 21:13:39 +02:00
[tf_geo1_est, <span class="org-type">~</span>] = tfestimate(id.d, id.geo_1, win, [], [], 1<span class="org-type">/</span>Ts);
[co_geo1_est, <span class="org-type">~</span>] = mscohere( id.d, id.geo_1, win, [], [], 1<span class="org-type">/</span>Ts);
[tf_geo2_est, <span class="org-type">~</span>] = tfestimate(id.d, id.geo_2, win, [], [], 1<span class="org-type">/</span>Ts);
[co_geo2_est, <span class="org-type">~</span>] = mscohere( id.d, id.geo_2, win, [], [], 1<span class="org-type">/</span>Ts);
2020-09-09 21:13:39 +02:00
</pre>
</div>
<p>
The obtained coherence are shown in Figure <a href="#orge5741e6">23</a>.
</p>
2020-09-09 21:13:39 +02:00
<div id="orge5741e6" class="figure">
2020-09-09 21:13:39 +02:00
<p><img src="figs/id_sensor_dynamics_coherence.png" alt="id_sensor_dynamics_coherence.png" />
</p>
<p><span class="figure-number">Figure 23: </span>Coherence for the estimation of the sensor dynamics</p>
2020-09-09 21:13:39 +02:00
</div>
<p>
We also make a simplified model of the inertial sensors to be compared with the identified dynamics.
2020-09-09 21:13:39 +02:00
</p>
<div class="org-src-container">
<pre class="src src-matlab">G_acc = 1<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>2500); <span class="org-comment">% [V/(m/s2)]</span>
G_geo = <span class="org-type">-</span>1200<span class="org-type">*</span>s<span class="org-type">^</span>2<span class="org-type">/</span>(s<span class="org-type">^</span>2 <span class="org-type">+</span> 2<span class="org-type">*</span>0.7<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>2<span class="org-type">*</span>s <span class="org-type">+</span> (2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>2)<span class="org-type">^</span>2); <span class="org-comment">% [[V/(m/s)]</span>
2020-09-09 21:13:39 +02:00
</pre>
</div>
<p>
The model and identified dynamics show good agreement (Figures <a href="#org743beb6">24</a> and <a href="#org4b1e13a">25</a>.)
</p>
2020-09-09 21:13:39 +02:00
<div id="org743beb6" class="figure">
2020-09-09 21:13:39 +02:00
<p><img src="figs/id_sensor_dynamics_accelerometers.png" alt="id_sensor_dynamics_accelerometers.png" />
</p>
<p><span class="figure-number">Figure 24: </span>Identified dynamics of the accelerometers</p>
2020-09-09 21:13:39 +02:00
</div>
<div id="org4b1e13a" class="figure">
2020-09-09 21:13:39 +02:00
<p><img src="figs/id_sensor_dynamics_geophones.png" alt="id_sensor_dynamics_geophones.png" />
</p>
<p><span class="figure-number">Figure 25: </span>Identified dynamics of the geophones</p>
2020-11-03 10:53:34 +01:00
</div>
</div>
</div>
</div>
<div id="outline-container-org60d0c43" class="outline-2">
<h2 id="org60d0c43"><span class="section-number-2">6</span> Inertial Sensor Noise and the \(\mathcal{H}_2\) Synthesis of complementary filters</h2>
<div class="outline-text-2" id="text-6">
<p>
<a id="org27b212a"></a>
</p>
<p>
In this section, the noise of the inertial sensors (geophones and accelerometers) is estimated.
</p>
2020-11-03 10:53:34 +01:00
</div>
<div id="outline-container-org5ff33e6" class="outline-3">
<h3 id="org5ff33e6"><span class="section-number-3">6.1</span> Load Data</h3>
<div class="outline-text-3" id="text-6-1">
<p>
As before, the identification data is loaded and any offset if removed.
</p>
2020-11-03 10:53:34 +01:00
<div class="org-src-container">
<pre class="src src-matlab">id = load(<span class="org-string">'identification_noise_opt_iff.mat'</span>, <span class="org-string">'d'</span>, <span class="org-string">'acc_1'</span>, <span class="org-string">'acc_2'</span>, <span class="org-string">'geo_1'</span>, <span class="org-string">'geo_2'</span>, <span class="org-string">'f_meas'</span>, <span class="org-string">'u'</span>, <span class="org-string">'t'</span>);
2020-11-03 10:53:34 +01:00
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">id.d = detrend(id.d, 0);
id.acc_1 = detrend(id.acc_1, 0);
id.acc_2 = detrend(id.acc_2, 0);
id.geo_1 = detrend(id.geo_1, 0);
id.geo_2 = detrend(id.geo_2, 0);
id.f_meas = detrend(id.f_meas, 0);
</pre>
</div>
</div>
</div>
<div id="outline-container-orgabd9a81" class="outline-3">
<h3 id="orgabd9a81"><span class="section-number-3">6.2</span> ASD of the Measured displacement</h3>
<div class="outline-text-3" id="text-6-2">
<p>
The Power Spectral Density of the displacement as measured by the interferometer and the inertial sensors is computed.
</p>
2020-11-03 10:53:34 +01:00
<div class="org-src-container">
<pre class="src src-matlab">Ts = id.t(2) <span class="org-type">-</span> id.t(1);
win = hann(ceil(10<span class="org-type">/</span>Ts));
2020-11-03 10:53:34 +01:00
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">[p_id_d, f] = pwelch(id.d, win, [], [], 1<span class="org-type">/</span>Ts);
[p_id_acc1, <span class="org-type">~</span>] = pwelch(id.acc_1, win, [], [], 1<span class="org-type">/</span>Ts);
[p_id_acc2, <span class="org-type">~</span>] = pwelch(id.acc_2, win, [], [], 1<span class="org-type">/</span>Ts);
[p_id_geo1, <span class="org-type">~</span>] = pwelch(id.geo_1, win, [], [], 1<span class="org-type">/</span>Ts);
[p_id_geo2, <span class="org-type">~</span>] = pwelch(id.geo_2, win, [], [], 1<span class="org-type">/</span>Ts);
2020-11-03 10:53:34 +01:00
</pre>
</div>
<p>
Let&rsquo;s use a model of the accelerometer and geophone to compute the motion from the measured voltage.
</p>
<div class="org-src-container">
<pre class="src src-matlab">G_acc = 1<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>2500); <span class="org-comment">% [V/(m/s2)]</span>
G_geo = <span class="org-type">-</span>1200<span class="org-type">*</span>s<span class="org-type">^</span>2<span class="org-type">/</span>(s<span class="org-type">^</span>2 <span class="org-type">+</span> 2<span class="org-type">*</span>0.7<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>2<span class="org-type">*</span>s <span class="org-type">+</span> (2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>2)<span class="org-type">^</span>2); <span class="org-comment">% [[V/(m/s)]</span>
2020-11-03 10:53:34 +01:00
</pre>
</div>
<p>
The obtained ASD in \(m/\sqrt{Hz}\) is shown in Figure <a href="#org6ed4146">26</a>.
</p>
2020-11-03 10:53:34 +01:00
<div id="org6ed4146" class="figure">
2020-11-03 10:53:34 +01:00
<p><img src="figs/measure_displacement_all_sensors.png" alt="measure_displacement_all_sensors.png" />
</p>
<p><span class="figure-number">Figure 26: </span>ASD of the measured displacement as measured by all the sensors</p>
2020-11-03 10:53:34 +01:00
</div>
</div>
</div>
<div id="outline-container-org0189d1d" class="outline-3">
<h3 id="org0189d1d"><span class="section-number-3">6.3</span> ASD of the Sensor Noise</h3>
<div class="outline-text-3" id="text-6-3">
<p>
The noise of a sensor can be estimated using two identical sensors by computing:
</p>
2020-11-03 10:53:34 +01:00
<ul class="org-ul">
<li>the Power Spectral Density of the measured motion by the two sensors</li>
<li>the Cross Spectral Density between the two sensors (coherence)</li>
2020-11-03 10:53:34 +01:00
</ul>
<p>
This technique to estimate the sensor noise is described in (<a href="#citeproc_bib_item_1">Barzilai, VanZandt, and Kenny 1998</a>).
</p>
<p>
The Power Spectral Density of the sensor noise can be estimated using the following equation:
</p>
\begin{equation}
|S_n(\omega)| = |S_{x_1}(\omega)| \Big( 1 - \gamma_{x_1 x_2}(\omega) \Big)
\end{equation}
<p>
with \(S_{x_1}\) the PSD of one of the sensor and \(\gamma_{x_1 x_2}\) the coherence between the two sensors.
</p>
2020-11-03 10:53:34 +01:00
<p>
The coherence between the two accelerometers and between the two geophones is computed.
</p>
2020-11-03 10:53:34 +01:00
<div class="org-src-container">
<pre class="src src-matlab">[coh_acc, <span class="org-type">~</span>] = mscohere(id.acc_1, id.acc_2, win, [], [], 1<span class="org-type">/</span>Ts);
[coh_geo, <span class="org-type">~</span>] = mscohere(id.geo_1, id.geo_2, win, [], [], 1<span class="org-type">/</span>Ts);
2020-11-03 10:53:34 +01:00
</pre>
</div>
<p>
Finally, the Power Spectral Density of the sensors is computed and converted in \([m^2/Hz]\).
</p>
2020-11-03 10:53:34 +01:00
<div class="org-src-container">
<pre class="src src-matlab">pN_acc = p_id_acc1<span class="org-type">.*</span>(1 <span class="org-type">-</span> coh_acc) <span class="org-type">.*</span> ...<span class="org-comment"> % [V^2/Hz]</span>
1<span class="org-type">./</span>abs(squeeze(freqresp(G_acc<span class="org-type">*</span>s<span class="org-type">^</span>2, f, <span class="org-string">'Hz'</span>)))<span class="org-type">.^</span>2; <span class="org-comment">% [(m/V)^2]</span>
pN_geo = p_id_geo1<span class="org-type">.*</span>(1 <span class="org-type">-</span> coh_geo) <span class="org-type">.*</span> ...<span class="org-comment"> % [V^2/Hz]</span>
1<span class="org-type">./</span>abs(squeeze(freqresp(G_geo<span class="org-type">*</span>s, f, <span class="org-string">'Hz'</span>)))<span class="org-type">.^</span>2; <span class="org-comment">% [(m/V)^2]</span>
2020-11-03 10:53:34 +01:00
</pre>
</div>
<p>
The ASD of obtained noises are compared with the ASD of the measured signals in Figure <a href="#org5636ea2">27</a>.
</p>
2020-11-03 10:53:34 +01:00
<div id="org5636ea2" class="figure">
2020-11-03 10:53:34 +01:00
<p><img src="figs/noise_inertial_sensors_comparison.png" alt="noise_inertial_sensors_comparison.png" />
</p>
<p><span class="figure-number">Figure 27: </span>Comparison of the computed ASD of the noise of the two inertial sensors</p>
2020-11-03 10:53:34 +01:00
</div>
</div>
</div>
<div id="outline-container-org19f21e7" class="outline-3">
<h3 id="org19f21e7"><span class="section-number-3">6.4</span> Noise Model</h3>
<div class="outline-text-3" id="text-6-4">
<p>
Transfer functions are adjusted in order to fit the ASD of the sensor noises (expressed in \([m/s/\sqrt{Hz}]\) for more easy fitting).
</p>
2020-11-03 10:53:34 +01:00
<p>
These transfer functions are defined below and compared with the measured ASD in Figure <a href="#org9d425bc">28</a>.
</p>
2020-11-03 10:53:34 +01:00
<div class="org-src-container">
<pre class="src src-matlab">N_acc = 1<span class="org-type">*</span>(s<span class="org-type">/</span>(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>2000) <span class="org-type">+</span> 1)<span class="org-type">^</span>2<span class="org-type">/</span>(s <span class="org-type">+</span> 0.1<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span>)<span class="org-type">/</span>(s <span class="org-type">+</span> 1e3<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span>); <span class="org-comment">% [m/sqrt(Hz)]</span>
N_geo = 4e<span class="org-type">-</span>4<span class="org-type">*</span>(s<span class="org-type">/</span>(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>200) <span class="org-type">+</span> 1)<span class="org-type">/</span>(s <span class="org-type">+</span> 1e3<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span>); <span class="org-comment">% [m/sqrt(Hz)]</span>
2020-11-03 10:53:34 +01:00
</pre>
</div>
<div id="org9d425bc" class="figure">
2020-11-03 10:53:34 +01:00
<p><img src="figs/noise_models_velocity.png" alt="noise_models_velocity.png" />
</p>
<p><span class="figure-number">Figure 28: </span>ASD of the velocity noise measured by the sensors and the noise models</p>
2020-11-03 10:53:34 +01:00
</div>
</div>
</div>
<div id="outline-container-org58d6224" class="outline-3">
<h3 id="org58d6224"><span class="section-number-3">6.5</span> \(\mathcal{H}_2\) Synthesis of the Complementary Filters</h3>
<div class="outline-text-3" id="text-6-5">
<p>
We now wish to synthesize two complementary filters to merge the geophone and the accelerometer signal in such a way that the fused signal has the lowest possible RMS noise.
</p>
<p>
To do so, we use the \(\mathcal{H}_2\) synthesis where the transfer functions representing the noise density of both sensors are used as weights.
</p>
2020-11-03 10:53:34 +01:00
<p>
The generalized plant used for the synthesis is defined below.
2020-11-03 10:53:34 +01:00
</p>
<div class="org-src-container">
<pre class="src src-matlab">P = [0 N_acc 1;
N_geo <span class="org-type">-</span>N_acc 0];
2020-11-03 10:53:34 +01:00
</pre>
</div>
<p>
And the \(\mathcal{H}_2\) synthesis is done using the <code>h2syn</code> command.
2020-11-03 10:53:34 +01:00
</p>
<div class="org-src-container">
<pre class="src src-matlab">[H_geo, <span class="org-type">~</span>, gamma] = h2syn(P, 1, 1);
H_acc = 1 <span class="org-type">-</span> H_geo;
2020-11-03 10:53:34 +01:00
</pre>
</div>
<p>
The obtained complementary filters are shown in Figure <a href="#org58489ea">29</a>.
</p>
2020-11-03 10:53:34 +01:00
<div id="org58489ea" class="figure">
2020-11-03 10:53:34 +01:00
<p><img src="figs/complementary_filters_velocity_H2.png" alt="complementary_filters_velocity_H2.png" />
</p>
<p><span class="figure-number">Figure 29: </span>Obtained Complementary Filters</p>
2020-11-03 10:53:34 +01:00
</div>
</div>
</div>
<div id="outline-container-org31ad32f" class="outline-3">
<h3 id="org31ad32f"><span class="section-number-3">6.6</span> Results</h3>
<div class="outline-text-3" id="text-6-6">
<p>
Finally, the signals of both sensors are merged using the complementary filters and the super sensor noise is estimated and compared with the individual sensor noises in Figure <a href="#org39a39f6">30</a>.
</p>
2020-11-03 10:53:34 +01:00
<div id="org39a39f6" class="figure">
2020-11-03 10:53:34 +01:00
<p><img src="figs/super_sensor_noise_asd_velocity.png" alt="super_sensor_noise_asd_velocity.png" />
</p>
<p><span class="figure-number">Figure 30: </span>ASD of the super sensor noise (velocity)</p>
2020-11-03 10:53:34 +01:00
</div>
<p>
Finally, the Cumulative Power Spectrum is computed and compared in Figure <a href="#org1fbee72">31</a>.
2020-11-03 10:53:34 +01:00
</p>
<div class="org-src-container">
<pre class="src src-matlab">[<span class="org-type">~</span>, i_1Hz] = min(abs(f <span class="org-type">-</span> 1));
2020-11-03 10:53:34 +01:00
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">CPS_acc = 1<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">*</span>flip(<span class="org-type">-</span>cumtrapz(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>flip(f), flip((pN_acc<span class="org-type">.*</span>(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>f))<span class="org-type">.^</span>2)));
CPS_geo = 1<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">*</span>flip(<span class="org-type">-</span>cumtrapz(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>flip(f), flip((pN_geo<span class="org-type">.*</span>(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>f))<span class="org-type">.^</span>2)));
CPS_SS = 1<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">*</span>flip(<span class="org-type">-</span>cumtrapz(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>flip(f), flip((pN_acc<span class="org-type">.*</span>(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>f))<span class="org-type">.^</span>2<span class="org-type">.*</span>abs(squeeze(freqresp(H_acc, f, <span class="org-string">'Hz'</span>)))<span class="org-type">.^</span>2 <span class="org-type">+</span> (pN_geo<span class="org-type">.*</span>(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>f))<span class="org-type">.^</span>2<span class="org-type">.*</span>abs(squeeze(freqresp(H_geo, f, <span class="org-string">'Hz'</span>)))<span class="org-type">.^</span>2)));
2020-11-03 10:53:34 +01:00
</pre>
</div>
<div id="org1fbee72" class="figure">
2020-11-03 10:53:34 +01:00
<p><img src="figs/super_sensor_noise_cas_velocity.png" alt="super_sensor_noise_cas_velocity.png" />
</p>
<p><span class="figure-number">Figure 31: </span>Cumulative Power Spectrum of the Sensor Noise (velocity)</p>
2020-11-03 10:53:34 +01:00
</div>
</div>
</div>
</div>
<div id="outline-container-orgcc8b51c" class="outline-2">
<h2 id="orgcc8b51c"><span class="section-number-2">7</span> Inertial Sensor Dynamics Uncertainty and the \(\mathcal{H}_\infty\) Synthesis of complementary filters</h2>
<div class="outline-text-2" id="text-7">
<p>
<a id="org7c37ebd"></a>
</p>
<p>
When merging two sensors, it is important to be sure that we correctly know the sensor dynamics near the merging frequency.
Thus, identifying the uncertainty on the sensor dynamics is quite important to perform a robust merging.
</p>
2020-11-03 10:53:34 +01:00
</div>
<div id="outline-container-org3253278" class="outline-3">
<h3 id="org3253278"><span class="section-number-3">7.1</span> Load Data</h3>
<div class="outline-text-3" id="text-7-1">
<p>
Data is loaded and offset is removed.
</p>
2020-11-03 10:53:34 +01:00
<div class="org-src-container">
<pre class="src src-matlab">id = load(<span class="org-string">'identification_noise_opt_iff.mat'</span>, <span class="org-string">'d'</span>, <span class="org-string">'acc_1'</span>, <span class="org-string">'acc_2'</span>, <span class="org-string">'geo_1'</span>, <span class="org-string">'geo_2'</span>, <span class="org-string">'f_meas'</span>, <span class="org-string">'u'</span>, <span class="org-string">'t'</span>);
2020-11-03 10:53:34 +01:00
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">id.d = detrend(id.d, 0);
id.acc_1 = detrend(id.acc_1, 0);
id.acc_2 = detrend(id.acc_2, 0);
id.geo_1 = detrend(id.geo_1, 0);
id.geo_2 = detrend(id.geo_2, 0);
id.f_meas = detrend(id.f_meas, 0);
</pre>
</div>
</div>
</div>
<div id="outline-container-org90882eb" class="outline-3">
<h3 id="org90882eb"><span class="section-number-3">7.2</span> Compute the dynamics of both sensors</h3>
<div class="outline-text-3" id="text-7-2">
<p>
The dynamics of inertial sensors are estimated (in \([V/m]\)).
</p>
2020-11-03 10:53:34 +01:00
<div class="org-src-container">
<pre class="src src-matlab">Ts = id.t(2) <span class="org-type">-</span> id.t(1);
win = hann(ceil(10<span class="org-type">/</span>Ts));
2020-11-03 10:53:34 +01:00
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">[tf_acc1_est, f] = tfestimate(id.d, id.acc_1, win, [], [], 1<span class="org-type">/</span>Ts);
[co_acc1_est, <span class="org-type">~</span>] = mscohere( id.d, id.acc_1, win, [], [], 1<span class="org-type">/</span>Ts);
[tf_acc2_est, <span class="org-type">~</span>] = tfestimate(id.d, id.acc_2, win, [], [], 1<span class="org-type">/</span>Ts);
[co_acc2_est, <span class="org-type">~</span>] = mscohere( id.d, id.acc_2, win, [], [], 1<span class="org-type">/</span>Ts);
2020-11-03 10:53:34 +01:00
[tf_geo1_est, <span class="org-type">~</span>] = tfestimate(id.d, id.geo_1, win, [], [], 1<span class="org-type">/</span>Ts);
[co_geo1_est, <span class="org-type">~</span>] = mscohere( id.d, id.geo_1, win, [], [], 1<span class="org-type">/</span>Ts);
[tf_geo2_est, <span class="org-type">~</span>] = tfestimate(id.d, id.geo_2, win, [], [], 1<span class="org-type">/</span>Ts);
[co_geo2_est, <span class="org-type">~</span>] = mscohere( id.d, id.geo_2, win, [], [], 1<span class="org-type">/</span>Ts);
2020-11-03 10:53:34 +01:00
</pre>
</div>
<p>
The (nominal) models of the inertial sensors from the absolute displacement to the generated voltage are defined below:
2020-11-03 10:53:34 +01:00
</p>
<div class="org-src-container">
<pre class="src src-matlab">G_acc = 1<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>2000)
G_geo = <span class="org-type">-</span>1200<span class="org-type">*</span>s<span class="org-type">^</span>2<span class="org-type">/</span>(s<span class="org-type">^</span>2 <span class="org-type">+</span> 2<span class="org-type">*</span>0.7<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>2<span class="org-type">*</span>s <span class="org-type">+</span> (2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>2)<span class="org-type">^</span>2);
2020-11-03 10:53:34 +01:00
</pre>
</div>
<p>
These models are very simplistic models, and we then take into account the un-modelled dynamics with dynamical uncertainty.
</p>
2020-11-03 10:53:34 +01:00
</div>
</div>
<div id="outline-container-org8741d7c" class="outline-3">
<h3 id="org8741d7c"><span class="section-number-3">7.3</span> Dynamics uncertainty estimation</h3>
<div class="outline-text-3" id="text-7-3">
<p>
Weights representing the dynamical uncertainty of the sensors are defined below.
</p>
2020-11-03 10:53:34 +01:00
<div class="org-src-container">
<pre class="src src-matlab">w_acc = createWeight(<span class="org-string">'n'</span>, 2, <span class="org-string">'G0'</span>, 10, <span class="org-string">'G1'</span>, 0.2, <span class="org-string">'Gc'</span>, 1, <span class="org-string">'w0'</span>, 6<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span>) <span class="org-type">*</span> ...
createWeight(<span class="org-string">'n'</span>, 2, <span class="org-string">'G0'</span>, 1, <span class="org-string">'G1'</span>, 5<span class="org-type">/</span>0.2, <span class="org-string">'Gc'</span>, 1<span class="org-type">/</span>0.2, <span class="org-string">'w0'</span>, 1300<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span>);
w_geo = createWeight(<span class="org-string">'n'</span>, 2, <span class="org-string">'G0'</span>, 0.6, <span class="org-string">'G1'</span>, 0.2, <span class="org-string">'Gc'</span>, 0.3, <span class="org-string">'w0'</span>, 3<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span>) <span class="org-type">*</span> ...
createWeight(<span class="org-string">'n'</span>, 2, <span class="org-string">'G0'</span>, 1, <span class="org-string">'G1'</span>, 10<span class="org-type">/</span>0.2, <span class="org-string">'Gc'</span>, 1<span class="org-type">/</span>0.2, <span class="org-string">'w0'</span>, 800<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span>);
2020-11-03 10:53:34 +01:00
</pre>
</div>
<p>
The measured dynamics are compared with the modelled one as well as the modelled uncertainty in Figure <a href="#org4661e9f">32</a> for the accelerometers and in Figure <a href="#org4776f11">33</a> for the geophones.
</p>
<div id="org4661e9f" class="figure">
<p><img src="figs/dyn_uncertainty_acc.png" alt="dyn_uncertainty_acc.png" />
2020-11-03 10:53:34 +01:00
</p>
<p><span class="figure-number">Figure 32: </span>Modeled dynamical uncertainty and meaured dynamics of the accelerometers</p>
2020-11-03 10:53:34 +01:00
</div>
<div id="org4776f11" class="figure">
<p><img src="figs/dyn_uncertainty_geo.png" alt="dyn_uncertainty_geo.png" />
</p>
<p><span class="figure-number">Figure 33: </span>Modeled dynamical uncertainty and meaured dynamics of the geophones</p>
2020-11-03 10:53:34 +01:00
</div>
</div>
</div>
<div id="outline-container-orgd1ee4ba" class="outline-3">
<h3 id="orgd1ee4ba"><span class="section-number-3">7.4</span> \(\mathcal{H}_\infty\) Synthesis of Complementary Filters</h3>
<div class="outline-text-3" id="text-7-4">
<p>
A last weight is now defined that represents the maximum dynamical uncertainty that is allowed for the super sensor.
</p>
2020-11-03 10:53:34 +01:00
<div class="org-src-container">
<pre class="src src-matlab">wu = inv(createWeight(<span class="org-string">'n'</span>, 2, <span class="org-string">'G0'</span>, 0.7, <span class="org-string">'G1'</span>, 0.3, <span class="org-string">'Gc'</span>, 0.4, <span class="org-string">'w0'</span>, 3<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span>) <span class="org-type">*</span> ...
createWeight(<span class="org-string">'n'</span>, 2, <span class="org-string">'G0'</span>, 1, <span class="org-string">'G1'</span>, 6<span class="org-type">/</span>0.3, <span class="org-string">'Gc'</span>, 1<span class="org-type">/</span>0.3, <span class="org-string">'w0'</span>, 1200<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span>));
2020-11-03 10:53:34 +01:00
</pre>
</div>
<p>
This dynamical uncertainty is compared with the two sensor uncertainties in Figure <a href="#orgab2b086">34</a>.
2020-11-03 10:53:34 +01:00
</p>
<div id="orgab2b086" class="figure">
<p><img src="figs/uncertainty_weight_and_sensor_uncertainties.png" alt="uncertainty_weight_and_sensor_uncertainties.png" />
</p>
<p><span class="figure-number">Figure 34: </span>Individual sensor uncertainty (normalized by their dynamics) and the wanted maximum super sensor noise uncertainty</p>
2020-11-03 10:53:34 +01:00
</div>
<p>
The generalized plant used for the synthesis is defined:
2020-11-03 10:53:34 +01:00
</p>
<div class="org-src-container">
<pre class="src src-matlab">P = [wu<span class="org-type">*</span>w_acc <span class="org-type">-</span>wu<span class="org-type">*</span>w_acc;
0 wu<span class="org-type">*</span>w_geo;
1 0];
2020-11-03 10:53:34 +01:00
</pre>
</div>
<p>
And the \(\mathcal{H}_\infty\) synthesis using the <code>hinfsyn</code> command is performed.
2020-11-03 10:53:34 +01:00
</p>
<div class="org-src-container">
<pre class="src src-matlab">[H_geo, <span class="org-type">~</span>, gamma, <span class="org-type">~</span>] = hinfsyn(P, 1, 1,<span class="org-string">'TOLGAM'</span>, 0.001, <span class="org-string">'METHOD'</span>, <span class="org-string">'ric'</span>, <span class="org-string">'DISPLAY'</span>, <span class="org-string">'on'</span>);
2020-11-03 10:53:34 +01:00
</pre>
</div>
<pre class="example" id="org941d807">
Test bounds: 0.8556 &lt;= gamma &lt;= 1.34
gamma X&gt;=0 Y&gt;=0 rho(XY)&lt;1 p/f
1.071e+00 0.0e+00 0.0e+00 0.000e+00 p
9.571e-01 0.0e+00 0.0e+00 9.436e-16 p
9.049e-01 0.0e+00 0.0e+00 1.084e-15 p
8.799e-01 0.0e+00 0.0e+00 1.191e-16 p
8.677e-01 0.0e+00 0.0e+00 6.905e-15 p
8.616e-01 0.0e+00 0.0e+00 0.000e+00 p
8.586e-01 1.1e-17 0.0e+00 6.917e-16 p
8.571e-01 0.0e+00 0.0e+00 6.991e-17 p
8.564e-01 0.0e+00 0.0e+00 1.492e-16 p
Best performance (actual): 0.8563
2020-11-03 10:53:34 +01:00
</pre>
<p>
The complementary filter is defined as follows:
2020-11-03 10:53:34 +01:00
</p>
<div class="org-src-container">
<pre class="src src-matlab">H_acc = 1 <span class="org-type">-</span> H_geo;
2020-11-03 10:53:34 +01:00
</pre>
</div>
<p>
The bode plot of the obtained complementary filters is shown in Figure
</p>
<div id="org7d39753" class="figure">
<p><img src="figs/h_infinity_obtained_complementary_filters.png" alt="h_infinity_obtained_complementary_filters.png" />
2020-11-03 10:53:34 +01:00
</p>
<p><span class="figure-number">Figure 35: </span>Bode plot of the obtained complementary filters using the \(\mathcal{H}_\infty\) synthesis</p>
</div>
</div>
2020-11-03 10:53:34 +01:00
</div>
<div id="outline-container-org9086721" class="outline-3">
<h3 id="org9086721"><span class="section-number-3">7.5</span> Obtained Super Sensor Dynamical Uncertainty</h3>
<div class="outline-text-3" id="text-7-5">
2020-11-03 10:53:34 +01:00
<p>
The obtained super sensor dynamical uncertainty is shown in Figure <a href="#org0f23776">36</a>.
2020-11-03 10:53:34 +01:00
</p>
<div id="org0f23776" class="figure">
<p><img src="figs/super_sensor_uncertainty_h_infinity.png" alt="super_sensor_uncertainty_h_infinity.png" />
2020-11-03 10:53:34 +01:00
</p>
<p><span class="figure-number">Figure 36: </span>Obtained Super sensor dynamics uncertainty</p>
2020-11-03 10:53:34 +01:00
</div>
</div>
</div>
</div>
<div id="outline-container-org47ef83f" class="outline-2">
<h2 id="org47ef83f"><span class="section-number-2">8</span> Optimal and Robust sensor fusion using the \(\mathcal{H}_2/\mathcal{H}_\infty\) synthesis</h2>
<div class="outline-text-2" id="text-8">
<p>
<a id="orga87e391"></a>
</p>
2020-11-03 10:53:34 +01:00
</div>
<div id="outline-container-org9333089" class="outline-3">
<h3 id="org9333089"><span class="section-number-3">8.1</span> Noise and Dynamical uncertainty weights</h3>
<div class="outline-text-3" id="text-8-1">
2020-11-03 10:53:34 +01:00
<div class="org-src-container">
<pre class="src src-matlab">N_acc = (s<span class="org-type">/</span>(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>2000) <span class="org-type">+</span> 1)<span class="org-type">^</span>2<span class="org-type">/</span>(s <span class="org-type">+</span> 0.1<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span>)<span class="org-type">/</span>(s <span class="org-type">+</span> 1e3<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span>)<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>1e3); <span class="org-comment">% [m/sqrt(Hz)]</span>
N_geo = 4e<span class="org-type">-</span>4<span class="org-type">*</span>((s <span class="org-type">+</span> 2<span class="org-type">*</span><span class="org-constant">pi</span>)<span class="org-type">/</span>(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>200) <span class="org-type">+</span> 1)<span class="org-type">/</span>(s <span class="org-type">+</span> 1e3<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span>)<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>1e3); <span class="org-comment">% [m/sqrt(Hz)]</span>
2020-11-03 10:53:34 +01:00
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">w_acc = createWeight(<span class="org-string">'n'</span>, 2, <span class="org-string">'G0'</span>, 10, <span class="org-string">'G1'</span>, 0.2, <span class="org-string">'Gc'</span>, 1, <span class="org-string">'w0'</span>, 6<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span>) <span class="org-type">*</span> ...
createWeight(<span class="org-string">'n'</span>, 2, <span class="org-string">'G0'</span>, 1, <span class="org-string">'G1'</span>, 5<span class="org-type">/</span>0.2, <span class="org-string">'Gc'</span>, 1<span class="org-type">/</span>0.2, <span class="org-string">'w0'</span>, 1300<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span>);
2020-11-03 10:53:34 +01:00
w_geo = createWeight(<span class="org-string">'n'</span>, 2, <span class="org-string">'G0'</span>, 0.6, <span class="org-string">'G1'</span>, 0.2, <span class="org-string">'Gc'</span>, 0.3, <span class="org-string">'w0'</span>, 3<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span>) <span class="org-type">*</span> ...
createWeight(<span class="org-string">'n'</span>, 2, <span class="org-string">'G0'</span>, 1, <span class="org-string">'G1'</span>, 10<span class="org-type">/</span>0.2, <span class="org-string">'Gc'</span>, 1<span class="org-type">/</span>0.2, <span class="org-string">'w0'</span>, 800<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span>);
2020-11-03 10:53:34 +01:00
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">wu = inv(createWeight(<span class="org-string">'n'</span>, 2, <span class="org-string">'G0'</span>, 0.7, <span class="org-string">'G1'</span>, 0.3, <span class="org-string">'Gc'</span>, 0.4, <span class="org-string">'w0'</span>, 3<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span>) <span class="org-type">*</span> ...
createWeight(<span class="org-string">'n'</span>, 2, <span class="org-string">'G0'</span>, 1, <span class="org-string">'G1'</span>, 6<span class="org-type">/</span>0.3, <span class="org-string">'Gc'</span>, 1<span class="org-type">/</span>0.3, <span class="org-string">'w0'</span>, 1200<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span>));
</pre>
2020-11-03 10:53:34 +01:00
</div>
<div class="org-src-container">
<pre class="src src-matlab">P = [wu<span class="org-type">*</span>w_acc <span class="org-type">-</span>wu<span class="org-type">*</span>w_acc;
0 wu<span class="org-type">*</span>w_geo;
N_acc <span class="org-type">-</span>N_acc;
0 N_geo;
1 0];
2020-11-03 10:53:34 +01:00
</pre>
</div>
<p>
And the mixed \(\mathcal{H}_2/\mathcal{H}_\infty\) synthesis is performed.
2020-11-03 10:53:34 +01:00
</p>
<div class="org-src-container">
<pre class="src src-matlab">[H_geo, <span class="org-type">~</span>] = h2hinfsyn(ss(P), 1, 1, 2, [0, 1], <span class="org-string">'HINFMAX'</span>, 1, <span class="org-string">'H2MAX'</span>, <span class="org-constant">Inf</span>, <span class="org-string">'DKMAX'</span>, 100, <span class="org-string">'TOL'</span>, 1e<span class="org-type">-</span>3, <span class="org-string">'DISPLAY'</span>, <span class="org-string">'on'</span>);
2020-11-03 10:53:34 +01:00
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">H_acc = 1 <span class="org-type">-</span> H_geo;
</pre>
2020-11-03 10:53:34 +01:00
</div>
</div>
</div>
<div id="outline-container-org8d3eab1" class="outline-3">
<h3 id="org8d3eab1"><span class="section-number-3">8.2</span> Obtained Super Sensor Noise</h3>
<div class="outline-text-3" id="text-8-2">
2020-11-03 10:53:34 +01:00
<div class="org-src-container">
<pre class="src src-matlab">freqs = logspace(0, 4, 1000);
PSD_Sgeo = abs(squeeze(freqresp(N_geo, freqs, <span class="org-string">'Hz'</span>)))<span class="org-type">.^</span>2;
PSD_Sacc = abs(squeeze(freqresp(N_acc, freqs, <span class="org-string">'Hz'</span>)))<span class="org-type">.^</span>2;
PSD_Hss = abs(squeeze(freqresp(N_acc<span class="org-type">*</span>H_acc, freqs, <span class="org-string">'Hz'</span>)))<span class="org-type">.^</span>2 <span class="org-type">+</span> ...
abs(squeeze(freqresp(N_geo<span class="org-type">*</span>H_geo, freqs, <span class="org-string">'Hz'</span>)))<span class="org-type">.^</span>2;
2020-11-03 10:53:34 +01:00
</pre>
</div>
<div id="orga257915" class="figure">
<p><img src="figs/psd_sensors_htwo_hinf_synthesis.png" alt="psd_sensors_htwo_hinf_synthesis.png" />
2020-11-03 10:53:34 +01:00
</p>
<p><span class="figure-number">Figure 37: </span>Power Spectral Density of the Super Sensor obtained with the mixed \(\mathcal{H}_2/\mathcal{H}_\infty\) synthesis</p>
</div>
</div>
2020-11-03 10:53:34 +01:00
</div>
<div id="outline-container-orgf71fc02" class="outline-3">
<h3 id="orgf71fc02"><span class="section-number-3">8.3</span> Obtained Super Sensor Dynamical Uncertainty</h3>
<div class="outline-text-3" id="text-8-3">
<div id="org556905d" class="figure">
<p><img src="figs/super_sensor_dynamical_uncertainty_Htwo_Hinf.png" alt="super_sensor_dynamical_uncertainty_Htwo_Hinf.png" />
</p>
<p><span class="figure-number">Figure 38: </span>Super sensor dynamical uncertainty (solid curve) when using the mixed \(\mathcal{H}_2/\mathcal{H}_\infty\) Synthesis</p>
2020-09-09 21:13:39 +02:00
</div>
</div>
</div>
<div id="outline-container-orga7373db" class="outline-3">
<h3 id="orga7373db"><span class="section-number-3">8.4</span> Experimental Super Sensor Dynamical Uncertainty</h3>
<div class="outline-text-3" id="text-8-4">
<p>
The super sensor dynamics is shown in Figure <a href="#orgd21aa29">39</a>.
</p>
<div id="orgd21aa29" class="figure">
<p><img src="figs/super_sensor_optimal_uncertainty.png" alt="super_sensor_optimal_uncertainty.png" />
</p>
<p><span class="figure-number">Figure 39: </span>Inertial Sensor dynamics as well as the super sensor dynamics</p>
</div>
</div>
2020-09-09 21:13:39 +02:00
</div>
<div id="outline-container-org808581c" class="outline-3">
<h3 id="org808581c"><span class="section-number-3">8.5</span> Experimental Super Sensor Noise</h3>
<div class="outline-text-3" id="text-8-5">
2020-09-09 21:13:39 +02:00
<p>
The obtained super sensor noise is shown in Figure <a href="#org4d6851a">40</a>.
2020-09-09 21:13:39 +02:00
</p>
<div id="org4d6851a" class="figure">
<p><img src="figs/super_sensor_optimal_noise.png" alt="super_sensor_optimal_noise.png" />
</p>
<p><span class="figure-number">Figure 40: </span>ASD of the super sensor obtained using the \(\mathcal{H}_2/\mathcal{H}_\infty\) synthesis</p>
2020-09-09 21:13:39 +02:00
</div>
</div>
</div>
</div>
<div id="outline-container-org03d48a9" class="outline-2">
<h2 id="org03d48a9"><span class="section-number-2">9</span> Matlab Functions</h2>
<div class="outline-text-2" id="text-9">
<p>
<a id="org81b8b04"></a>
</p>
</div>
<div id="outline-container-org2a1488e" class="outline-3">
<h3 id="org2a1488e"><span class="section-number-3">9.1</span> <code>createWeight</code></h3>
<div class="outline-text-3" id="text-9-1">
<p>
<a id="org841b264"></a>
</p>
<p>
This Matlab function is accessible <a href="src/createWeight.m">here</a>.
</p>
2020-09-09 21:13:39 +02:00
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[W]</span> = <span class="org-function-name">createWeight</span>(<span class="org-variable-name">args</span>)
<span class="org-comment">% createWeight -</span>
<span class="org-comment">%</span>
<span class="org-comment">% Syntax: [in_data] = createWeight(in_data)</span>
<span class="org-comment">%</span>
<span class="org-comment">% Inputs:</span>
<span class="org-comment">% - n - Weight Order</span>
<span class="org-comment">% - G0 - Low frequency Gain</span>
<span class="org-comment">% - G1 - High frequency Gain</span>
<span class="org-comment">% - Gc - Gain of W at frequency w0</span>
<span class="org-comment">% - w0 - Frequency at which |W(j w0)| = Gc</span>
<span class="org-comment">%</span>
<span class="org-comment">% Outputs:</span>
<span class="org-comment">% - W - Generated Weight</span>
arguments
args.n (1,1) double {mustBeInteger, mustBePositive} = 1
args.G0 (1,1) double {mustBeNumeric, mustBePositive} = 0.1
args.G1 (1,1) double {mustBeNumeric, mustBePositive} = 10
args.Gc (1,1) double {mustBeNumeric, mustBePositive} = 1
args.w0 (1,1) double {mustBeNumeric, mustBePositive} = 1
<span class="org-keyword">end</span>
mustBeBetween(args.G0, args.Gc, args.G1);
s = tf(<span class="org-string">'s'</span>);
W = (((1<span class="org-type">/</span>args.w0)<span class="org-type">*</span>sqrt((1<span class="org-type">-</span>(args.G0<span class="org-type">/</span>args.Gc)<span class="org-type">^</span>(2<span class="org-type">/</span>args.n))<span class="org-type">/</span>(1<span class="org-type">-</span>(args.Gc<span class="org-type">/</span>args.G1)<span class="org-type">^</span>(2<span class="org-type">/</span>args.n)))<span class="org-type">*</span>s <span class="org-type">+</span> (args.G0<span class="org-type">/</span>args.Gc)<span class="org-type">^</span>(1<span class="org-type">/</span>args.n))<span class="org-type">/</span>((1<span class="org-type">/</span>args.G1)<span class="org-type">^</span>(1<span class="org-type">/</span>args.n)<span class="org-type">*</span>(1<span class="org-type">/</span>args.w0)<span class="org-type">*</span>sqrt((1<span class="org-type">-</span>(args.G0<span class="org-type">/</span>args.Gc)<span class="org-type">^</span>(2<span class="org-type">/</span>args.n))<span class="org-type">/</span>(1<span class="org-type">-</span>(args.Gc<span class="org-type">/</span>args.G1)<span class="org-type">^</span>(2<span class="org-type">/</span>args.n)))<span class="org-type">*</span>s <span class="org-type">+</span> (1<span class="org-type">/</span>args.Gc)<span class="org-type">^</span>(1<span class="org-type">/</span>args.n)))<span class="org-type">^</span>args.n;
<span class="org-keyword">end</span>
<span class="org-comment">% Custom validation function</span>
<span class="org-keyword">function</span> <span class="org-function-name">mustBeBetween</span>(<span class="org-variable-name">a</span>,<span class="org-variable-name">b</span>,<span class="org-variable-name">c</span>)
<span class="org-keyword">if</span> <span class="org-type">~</span>((a <span class="org-type">&gt;</span> b <span class="org-type">&amp;&amp;</span> b <span class="org-type">&gt;</span> c) <span class="org-type">||</span> (c <span class="org-type">&gt;</span> b <span class="org-type">&amp;&amp;</span> b <span class="org-type">&gt;</span> a))
eid = <span class="org-string">'createWeight:inputError'</span>;
msg = <span class="org-string">'Gc should be between G0 and G1.'</span>;
throwAsCaller(MException(eid,msg))
<span class="org-keyword">end</span>
<span class="org-keyword">end</span>
2020-09-09 21:13:39 +02:00
</pre>
</div>
</div>
</div>
<div id="outline-container-org5f0f3d6" class="outline-3">
<h3 id="org5f0f3d6"><span class="section-number-3">9.2</span> <code>plotMagUncertainty</code></h3>
<div class="outline-text-3" id="text-9-2">
<p>
<a id="org68abc99"></a>
</p>
<p>
This Matlab function is accessible <a href="src/plotMagUncertainty.m">here</a>.
</p>
2020-09-09 21:13:39 +02:00
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[p]</span> = <span class="org-function-name">plotMagUncertainty</span>(<span class="org-variable-name">W</span>, <span class="org-variable-name">freqs</span>, <span class="org-variable-name">args</span>)
<span class="org-comment">% plotMagUncertainty -</span>
<span class="org-comment">%</span>
<span class="org-comment">% Syntax: [p] = plotMagUncertainty(W, freqs, args)</span>
<span class="org-comment">%</span>
<span class="org-comment">% Inputs:</span>
<span class="org-comment">% - W - Multiplicative Uncertainty Weight</span>
<span class="org-comment">% - freqs - Frequency Vector [Hz]</span>
<span class="org-comment">% - args - Optional Arguments:</span>
<span class="org-comment">% - G</span>
<span class="org-comment">% - color_i</span>
<span class="org-comment">% - opacity</span>
<span class="org-comment">%</span>
<span class="org-comment">% Outputs:</span>
<span class="org-comment">% - p - Plot Handle</span>
arguments
W
freqs double {mustBeNumeric, mustBeNonnegative}
args.G = tf(1)
args.color_i (1,1) double {mustBeInteger, mustBePositive} = 1
args.opacity (1,1) double {mustBeNumeric, mustBeNonnegative} = 0.3
args.DisplayName char = <span class="org-string">''</span>
<span class="org-keyword">end</span>
<span class="org-comment">% Get defaults colors</span>
colors = <span class="org-type">get</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'defaultAxesColorOrder'</span>);
p = <span class="org-type">patch</span>([freqs flip(freqs)], ...
[abs(squeeze(freqresp(args.G, freqs, <span class="org-string">'Hz'</span>)))<span class="org-type">.*</span>(1 <span class="org-type">+</span> abs(squeeze(freqresp(W, freqs, <span class="org-string">'Hz'</span>)))); ...
flip(abs(squeeze(freqresp(args.G, freqs, <span class="org-string">'Hz'</span>)))<span class="org-type">.*</span>max(1 <span class="org-type">-</span> abs(squeeze(freqresp(W, freqs, <span class="org-string">'Hz'</span>))), 1e<span class="org-type">-</span>6))], <span class="org-string">'w'</span>, ...
<span class="org-string">'DisplayName'</span>, args.DisplayName);
p.FaceColor = colors(args.color_i, <span class="org-type">:</span>);
p.EdgeColor = <span class="org-string">'none'</span>;
p.FaceAlpha = args.opacity;
<span class="org-keyword">end</span>
2020-09-09 21:13:39 +02:00
</pre>
</div>
</div>
</div>
<div id="outline-container-orgbd75cba" class="outline-3">
<h3 id="orgbd75cba"><span class="section-number-3">9.3</span> <code>plotPhaseUncertainty</code></h3>
<div class="outline-text-3" id="text-9-3">
<p>
<a id="orga0d37c7"></a>
</p>
<p>
This Matlab function is accessible <a href="src/plotPhaseUncertainty.m">here</a>.
</p>
2020-09-09 21:13:39 +02:00
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[p]</span> = <span class="org-function-name">plotPhaseUncertainty</span>(<span class="org-variable-name">W</span>, <span class="org-variable-name">freqs</span>, <span class="org-variable-name">args</span>)
<span class="org-comment">% plotPhaseUncertainty -</span>
<span class="org-comment">%</span>
<span class="org-comment">% Syntax: [p] = plotPhaseUncertainty(W, freqs, args)</span>
<span class="org-comment">%</span>
<span class="org-comment">% Inputs:</span>
<span class="org-comment">% - W - Multiplicative Uncertainty Weight</span>
<span class="org-comment">% - freqs - Frequency Vector [Hz]</span>
<span class="org-comment">% - args - Optional Arguments:</span>
<span class="org-comment">% - G</span>
<span class="org-comment">% - color_i</span>
<span class="org-comment">% - opacity</span>
<span class="org-comment">%</span>
<span class="org-comment">% Outputs:</span>
<span class="org-comment">% - p - Plot Handle</span>
arguments
W
freqs double {mustBeNumeric, mustBeNonnegative}
args.G = tf(1)
args.color_i (1,1) double {mustBeInteger, mustBePositive} = 1
args.opacity (1,1) double {mustBeNumeric, mustBePositive} = 0.3
args.DisplayName char = <span class="org-string">''</span>
<span class="org-keyword">end</span>
<span class="org-comment">% Get defaults colors</span>
colors = <span class="org-type">get</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'defaultAxesColorOrder'</span>);
<span class="org-comment">% Compute Phase Uncertainty</span>
Dphi = 180<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">*</span>asin(abs(squeeze(freqresp(W, freqs, <span class="org-string">'Hz'</span>))));
Dphi(abs(squeeze(freqresp(W, freqs, <span class="org-string">'Hz'</span>))) <span class="org-type">&gt;</span> 1) = 360;
<span class="org-comment">% Compute Plant Phase</span>
G_ang = 180<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">*</span>angle(squeeze(freqresp(args.G, freqs, <span class="org-string">'Hz'</span>)));
p = <span class="org-type">patch</span>([freqs flip(freqs)], [G_ang<span class="org-type">+</span>Dphi; flip(G_ang<span class="org-type">-</span>Dphi)], <span class="org-string">'w'</span>, ...
<span class="org-string">'DisplayName'</span>, args.DisplayName);
p.FaceColor = colors(args.color_i, <span class="org-type">:</span>);
p.EdgeColor = <span class="org-string">'none'</span>;
p.FaceAlpha = args.opacity;
<span class="org-keyword">end</span>
2020-09-09 21:13:39 +02:00
</pre>
</div>
</div>
</div>
</div>
<style>.csl-entry{text-indent: -1.5em; margin-left: 1.5em;}</style><h2 class='citeproc-org-bib-h2'>Bibliography</h2>
<div class="csl-bib-body">
<div class="csl-entry"><a name="citeproc_bib_item_1"></a>Barzilai, Aaron, Tom VanZandt, and Tom Kenny. 1998. “Technique for Measurement of the Noise of a Sensor in the Presence of Large Background Signals.” <i>Review of Scientific Instruments</i> 69 (7):276772. <a href="https://doi.org/10.1063/1.1149013">https://doi.org/10.1063/1.1149013</a>.</div>
</div>
2020-08-31 16:10:13 +02:00
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
<p class="date">Created: 2020-11-11 mer. 16:50</p>
2020-08-31 16:10:13 +02:00
</div>
</body>
</html>