Add IFF Closed loop test figures

This commit is contained in:
Thomas Dehaeze 2020-08-21 15:26:45 +02:00
parent a4f91c68e1
commit 3859eca154
8 changed files with 326 additions and 133 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -3,7 +3,7 @@
"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-08-20 jeu. 23:08 -->
<!-- 2020-08-21 ven. 15:26 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Test Bench APA95ML</title>
<meta name="generator" content="Org mode" />
@ -27,49 +27,50 @@
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orgd70d66f">1. Setup</a>
<li><a href="#org6c2cfcc">1. Setup</a>
<ul>
<li><a href="#org07d3c47">1.1. Parameters</a></li>
<li><a href="#orgbd4b8f3">1.2. Filter White Noise</a></li>
<li><a href="#org9e42c6d">1.1. Parameters</a></li>
<li><a href="#org8bb3ebf">1.2. Filter White Noise</a></li>
</ul>
</li>
<li><a href="#orgebffd67">2. Run Experiment and Save Data</a>
<li><a href="#org229c57e">2. Run Experiment and Save Data</a>
<ul>
<li><a href="#org9db9f37">2.1. Load Data</a></li>
<li><a href="#org5b3c786">2.2. Save Data</a></li>
<li><a href="#org79522ee">2.1. Load Data</a></li>
<li><a href="#org050454c">2.2. Save Data</a></li>
</ul>
</li>
<li><a href="#orge25b163">3. Huddle Test</a>
<li><a href="#org178348e">3. Huddle Test</a>
<ul>
<li><a href="#orgbc09977">3.1. Time Domain Data</a></li>
<li><a href="#org7e6bc47">3.2. PSD of Measurement Noise</a></li>
<li><a href="#org7eb915d">3.1. Time Domain Data</a></li>
<li><a href="#org959048f">3.2. PSD of Measurement Noise</a></li>
</ul>
</li>
<li><a href="#org0348c7c">4. Transfer Function Estimation using the DAC as the driver</a>
<li><a href="#org4742221">4. Transfer Function Estimation using the DAC as the driver</a>
<ul>
<li><a href="#orgf0f7314">4.1. Time Domain Data</a></li>
<li><a href="#orge50aef7">4.2. Comparison of the PSD with Huddle Test</a></li>
<li><a href="#org870e2ef">4.3. Compute TF estimate and Coherence</a></li>
<li><a href="#orgb06d21d">4.4. Comparison with the FEM model</a></li>
<li><a href="#org3d81de2">4.1. Time Domain Data</a></li>
<li><a href="#org39e0140">4.2. Comparison of the PSD with Huddle Test</a></li>
<li><a href="#org8b00bfb">4.3. Compute TF estimate and Coherence</a></li>
<li><a href="#orgbf49872">4.4. Comparison with the FEM model</a></li>
</ul>
</li>
<li><a href="#org563fed9">5. Transfer Function Estimation using the PI Amplifier</a>
<li><a href="#orga133ef0">5. Transfer Function Estimation using the PI Amplifier</a>
<ul>
<li><a href="#org9c121df">5.1. Load Data</a></li>
<li><a href="#org990c144">5.2. Comparison of the PSD with Huddle Test</a></li>
<li><a href="#org323b9c5">5.3. Compute TF estimate and Coherence</a></li>
<li><a href="#org6045724">5.4. Comparison with the FEM model</a></li>
<li><a href="#orgb86aac7">5.1. Load Data</a></li>
<li><a href="#orgf221216">5.2. Comparison of the PSD with Huddle Test</a></li>
<li><a href="#orgeb0ef60">5.3. Compute TF estimate and Coherence</a></li>
<li><a href="#orgc786d54">5.4. Comparison with the FEM model</a></li>
</ul>
</li>
<li><a href="#org5ef5f65">6. Transfer function from force actuator to force sensor</a>
<li><a href="#org7363765">6. Transfer function from force actuator to force sensor</a>
<ul>
<li><a href="#org098bbb0">6.1. System Identification</a></li>
<li><a href="#orge0e4f46">6.2. Integral Force Feedback</a></li>
<li><a href="#org5ad8bf1">6.1. System Identification</a></li>
<li><a href="#orgf1d7d77">6.2. Integral Force Feedback</a></li>
</ul>
</li>
<li><a href="#org102cc6a">7. IFF Tests</a>
<li><a href="#orgabc1447">7. IFF Tests</a>
<ul>
<li><a href="#org9e16daf">7.1. Load Data</a></li>
<li><a href="#org8a1d06a">7.1. First tests with few gains</a></li>
<li><a href="#org1241f3d">7.2. Second test with many Gains</a></li>
</ul>
</li>
</ul>
@ -77,26 +78,26 @@
</div>
<div id="org5c42466" class="figure">
<div id="org0b2119e" class="figure">
<p><img src="figs/setup_picture.png" alt="setup_picture.png" />
</p>
<p><span class="figure-number">Figure 1: </span>Picture of the Setup</p>
</div>
<div id="orgc98a0fb" class="figure">
<div id="org0256fb0" class="figure">
<p><img src="figs/setup_zoom.png" alt="setup_zoom.png" />
</p>
<p><span class="figure-number">Figure 2: </span>Zoom on the APA</p>
</div>
<div id="outline-container-orgd70d66f" class="outline-2">
<h2 id="orgd70d66f"><span class="section-number-2">1</span> Setup</h2>
<div id="outline-container-org6c2cfcc" class="outline-2">
<h2 id="org6c2cfcc"><span class="section-number-2">1</span> Setup</h2>
<div class="outline-text-2" id="text-1">
</div>
<div id="outline-container-org07d3c47" class="outline-3">
<h3 id="org07d3c47"><span class="section-number-3">1.1</span> Parameters</h3>
<div id="outline-container-org9e42c6d" class="outline-3">
<h3 id="org9e42c6d"><span class="section-number-3">1.1</span> Parameters</h3>
<div class="outline-text-3" id="text-1-1">
<div class="org-src-container">
<pre class="src src-matlab">Ts = 1e-4;
@ -105,8 +106,8 @@
</div>
</div>
<div id="outline-container-orgbd4b8f3" class="outline-3">
<h3 id="orgbd4b8f3"><span class="section-number-3">1.2</span> Filter White Noise</h3>
<div id="outline-container-org8bb3ebf" class="outline-3">
<h3 id="org8bb3ebf"><span class="section-number-3">1.2</span> Filter White Noise</h3>
<div class="outline-text-3" id="text-1-2">
<div class="org-src-container">
<pre class="src src-matlab">Glpf = 1/(1 + s/2/pi/500);
@ -118,13 +119,13 @@ Gz = c2d(Glpf, Ts, 'tustin');
</div>
</div>
<div id="outline-container-orgebffd67" class="outline-2">
<h2 id="orgebffd67"><span class="section-number-2">2</span> Run Experiment and Save Data</h2>
<div id="outline-container-org229c57e" class="outline-2">
<h2 id="org229c57e"><span class="section-number-2">2</span> Run Experiment and Save Data</h2>
<div class="outline-text-2" id="text-2">
</div>
<div id="outline-container-org9db9f37" class="outline-3">
<h3 id="org9db9f37"><span class="section-number-3">2.1</span> Load Data</h3>
<div id="outline-container-org79522ee" class="outline-3">
<h3 id="org79522ee"><span class="section-number-3">2.1</span> Load Data</h3>
<div class="outline-text-3" id="text-2-1">
<div class="org-src-container">
<pre class="src src-matlab">data = SimulinkRealTime.utils.getFileScopeData('data/apa95ml.dat').data;
@ -133,8 +134,8 @@ Gz = c2d(Glpf, Ts, 'tustin');
</div>
</div>
<div id="outline-container-org5b3c786" class="outline-3">
<h3 id="org5b3c786"><span class="section-number-3">2.2</span> Save Data</h3>
<div id="outline-container-org050454c" class="outline-3">
<h3 id="org050454c"><span class="section-number-3">2.2</span> Save Data</h3>
<div class="outline-text-3" id="text-2-2">
<div class="org-src-container">
<pre class="src src-matlab">u = data(:, 1); % Input Voltage [V]
@ -151,16 +152,16 @@ t = data(:, 3); % Time [s]
</div>
</div>
<div id="outline-container-orge25b163" class="outline-2">
<h2 id="orge25b163"><span class="section-number-2">3</span> Huddle Test</h2>
<div id="outline-container-org178348e" class="outline-2">
<h2 id="org178348e"><span class="section-number-2">3</span> Huddle Test</h2>
<div class="outline-text-2" id="text-3">
</div>
<div id="outline-container-orgbc09977" class="outline-3">
<h3 id="orgbc09977"><span class="section-number-3">3.1</span> Time Domain Data</h3>
<div id="outline-container-org7eb915d" class="outline-3">
<h3 id="org7eb915d"><span class="section-number-3">3.1</span> Time Domain Data</h3>
<div class="outline-text-3" id="text-3-1">
<div id="orgfbf5913" class="figure">
<div id="orgedb79ed" class="figure">
<p><img src="figs/huddle_test_time_domain.png" alt="huddle_test_time_domain.png" />
</p>
<p><span class="figure-number">Figure 3: </span>Measurement of the Mass displacement during Huddle Test</p>
@ -168,8 +169,8 @@ t = data(:, 3); % Time [s]
</div>
</div>
<div id="outline-container-org7e6bc47" class="outline-3">
<h3 id="org7e6bc47"><span class="section-number-3">3.2</span> PSD of Measurement Noise</h3>
<div id="outline-container-org959048f" class="outline-3">
<h3 id="org959048f"><span class="section-number-3">3.2</span> PSD of Measurement Noise</h3>
<div class="outline-text-3" id="text-3-2">
<div class="org-src-container">
<pre class="src src-matlab">Ts = t(end)/(length(t)-1);
@ -185,7 +186,7 @@ win = hanning(ceil(1*Fs));
</div>
<div id="orgaf72ca6" class="figure">
<div id="org4ad69f0" class="figure">
<p><img src="figs/huddle_test_pdf.png" alt="huddle_test_pdf.png" />
</p>
<p><span class="figure-number">Figure 4: </span>Amplitude Spectral Density of the Displacement during Huddle Test</p>
@ -194,8 +195,8 @@ win = hanning(ceil(1*Fs));
</div>
</div>
<div id="outline-container-org0348c7c" class="outline-2">
<h2 id="org0348c7c"><span class="section-number-2">4</span> Transfer Function Estimation using the DAC as the driver</h2>
<div id="outline-container-org4742221" class="outline-2">
<h2 id="org4742221"><span class="section-number-2">4</span> Transfer Function Estimation using the DAC as the driver</h2>
<div class="outline-text-2" id="text-4">
<div class="important">
<p>
@ -205,11 +206,11 @@ Results presented in this sections are wrong as the ADC cannot deliver enought c
</div>
</div>
<div id="outline-container-orgf0f7314" class="outline-3">
<h3 id="orgf0f7314"><span class="section-number-3">4.1</span> Time Domain Data</h3>
<div id="outline-container-org3d81de2" class="outline-3">
<h3 id="org3d81de2"><span class="section-number-3">4.1</span> Time Domain Data</h3>
<div class="outline-text-3" id="text-4-1">
<div id="org60f734d" class="figure">
<div id="orgdf6c7aa" class="figure">
<p><img src="figs/apa95ml_5kg_10V_time_domain.png" alt="apa95ml_5kg_10V_time_domain.png" />
</p>
<p><span class="figure-number">Figure 5: </span>Time domain signals during the test</p>
@ -217,8 +218,8 @@ Results presented in this sections are wrong as the ADC cannot deliver enought c
</div>
</div>
<div id="outline-container-orge50aef7" class="outline-3">
<h3 id="orge50aef7"><span class="section-number-3">4.2</span> Comparison of the PSD with Huddle Test</h3>
<div id="outline-container-org39e0140" class="outline-3">
<h3 id="org39e0140"><span class="section-number-3">4.2</span> Comparison of the PSD with Huddle Test</h3>
<div class="outline-text-3" id="text-4-2">
<div class="org-src-container">
<pre class="src src-matlab">Ts = t(end)/(length(t)-1);
@ -235,7 +236,7 @@ win = hanning(ceil(1*Fs));
</div>
<div id="orga45d905" class="figure">
<div id="org6c52ffe" class="figure">
<p><img src="figs/apa95ml_5kg_10V_pdf_comp_huddle.png" alt="apa95ml_5kg_10V_pdf_comp_huddle.png" />
</p>
<p><span class="figure-number">Figure 6: </span>Comparison of the ASD for the identification test and the huddle test</p>
@ -243,8 +244,8 @@ win = hanning(ceil(1*Fs));
</div>
</div>
<div id="outline-container-org870e2ef" class="outline-3">
<h3 id="org870e2ef"><span class="section-number-3">4.3</span> Compute TF estimate and Coherence</h3>
<div id="outline-container-org8b00bfb" class="outline-3">
<h3 id="org8b00bfb"><span class="section-number-3">4.3</span> Compute TF estimate and Coherence</h3>
<div class="outline-text-3" id="text-4-3">
<div class="org-src-container">
<pre class="src src-matlab">Ts = t(end)/(length(t)-1);
@ -261,14 +262,14 @@ Fs = 1/Ts;
</div>
<div id="org6abff24" class="figure">
<div id="org8bed71a" class="figure">
<p><img src="figs/apa95ml_5kg_10V_coh.png" alt="apa95ml_5kg_10V_coh.png" />
</p>
<p><span class="figure-number">Figure 7: </span>Coherence</p>
</div>
<div id="org8e6794a" class="figure">
<div id="org80b2e97" class="figure">
<p><img src="figs/apa95ml_5kg_10V_tf.png" alt="apa95ml_5kg_10V_tf.png" />
</p>
<p><span class="figure-number">Figure 8: </span>Estimation of the transfer function from input voltage to displacement</p>
@ -276,8 +277,8 @@ Fs = 1/Ts;
</div>
</div>
<div id="outline-container-orgb06d21d" class="outline-3">
<h3 id="orgb06d21d"><span class="section-number-3">4.4</span> Comparison with the FEM model</h3>
<div id="outline-container-orgbf49872" class="outline-3">
<h3 id="orgbf49872"><span class="section-number-3">4.4</span> Comparison with the FEM model</h3>
<div class="outline-text-3" id="text-4-4">
<div class="org-src-container">
<pre class="src src-matlab">load('mat/fem_model_5kg.mat', 'Ghm');
@ -285,7 +286,7 @@ Fs = 1/Ts;
</div>
<div id="org4563de9" class="figure">
<div id="orgc255f7f" class="figure">
<p><img src="figs/apa95ml_5kg_comp_fem.png" alt="apa95ml_5kg_comp_fem.png" />
</p>
<p><span class="figure-number">Figure 9: </span>Comparison of the identified transfer function and the one estimated from the FE model</p>
@ -304,12 +305,12 @@ In the next section, a current amplifier is used.
</div>
</div>
<div id="outline-container-org563fed9" class="outline-2">
<h2 id="org563fed9"><span class="section-number-2">5</span> Transfer Function Estimation using the PI Amplifier</h2>
<div id="outline-container-orga133ef0" class="outline-2">
<h2 id="orga133ef0"><span class="section-number-2">5</span> Transfer Function Estimation using the PI Amplifier</h2>
<div class="outline-text-2" id="text-5">
</div>
<div id="outline-container-org9c121df" class="outline-3">
<h3 id="org9c121df"><span class="section-number-3">5.1</span> Load Data</h3>
<div id="outline-container-orgb86aac7" class="outline-3">
<h3 id="orgb86aac7"><span class="section-number-3">5.1</span> Load Data</h3>
<div class="outline-text-3" id="text-5-1">
<div class="org-src-container">
<pre class="src src-matlab">ht = load('./mat/huddle_test.mat', 't', 'u', 'y');
@ -329,8 +330,8 @@ ht.y = ht.y - mean(ht.y);
</div>
</div>
<div id="outline-container-org990c144" class="outline-3">
<h3 id="org990c144"><span class="section-number-3">5.2</span> Comparison of the PSD with Huddle Test</h3>
<div id="outline-container-orgf221216" class="outline-3">
<h3 id="orgf221216"><span class="section-number-3">5.2</span> Comparison of the PSD with Huddle Test</h3>
<div class="outline-text-3" id="text-5-2">
<div class="org-src-container">
<pre class="src src-matlab">Ts = t(end)/(length(t)-1);
@ -347,7 +348,7 @@ win = hanning(ceil(1*Fs));
</div>
<div id="orgf6222d7" class="figure">
<div id="orgc3cf37d" class="figure">
<p><img src="figs/apa95ml_5kg_PI_pdf_comp_huddle.png" alt="apa95ml_5kg_PI_pdf_comp_huddle.png" />
</p>
<p><span class="figure-number">Figure 10: </span>Comparison of the ASD for the identification test and the huddle test</p>
@ -355,8 +356,8 @@ win = hanning(ceil(1*Fs));
</div>
</div>
<div id="outline-container-org323b9c5" class="outline-3">
<h3 id="org323b9c5"><span class="section-number-3">5.3</span> Compute TF estimate and Coherence</h3>
<div id="outline-container-orgeb0ef60" class="outline-3">
<h3 id="orgeb0ef60"><span class="section-number-3">5.3</span> Compute TF estimate and Coherence</h3>
<div class="outline-text-3" id="text-5-3">
<div class="org-src-container">
<pre class="src src-matlab">Ts = t(end)/(length(t)-1);
@ -374,14 +375,14 @@ Fs = 1/Ts;
</div>
<div id="org751008e" class="figure">
<div id="orgbf0faa3" class="figure">
<p><img src="figs/apa95ml_5kg_PI_coh.png" alt="apa95ml_5kg_PI_coh.png" />
</p>
<p><span class="figure-number">Figure 11: </span>Coherence</p>
</div>
<div id="orgaed957e" class="figure">
<div id="org408425b" class="figure">
<p><img src="figs/apa95ml_5kg_PI_tf.png" alt="apa95ml_5kg_PI_tf.png" />
</p>
<p><span class="figure-number">Figure 12: </span>Estimation of the transfer function from input voltage to displacement</p>
@ -389,8 +390,8 @@ Fs = 1/Ts;
</div>
</div>
<div id="outline-container-org6045724" class="outline-3">
<h3 id="org6045724"><span class="section-number-3">5.4</span> Comparison with the FEM model</h3>
<div id="outline-container-orgc786d54" class="outline-3">
<h3 id="orgc786d54"><span class="section-number-3">5.4</span> Comparison with the FEM model</h3>
<div class="outline-text-3" id="text-5-4">
<div class="org-src-container">
<pre class="src src-matlab">load('mat/fem_model_5kg.mat', 'G');
@ -398,7 +399,7 @@ Fs = 1/Ts;
</div>
<div id="org693de8c" class="figure">
<div id="org5c02e5d" class="figure">
<p><img src="figs/apa95ml_5kg_pi_comp_fem.png" alt="apa95ml_5kg_pi_comp_fem.png" />
</p>
<p><span class="figure-number">Figure 13: </span>Comparison of the identified transfer function and the one estimated from the FE model</p>
@ -407,8 +408,8 @@ Fs = 1/Ts;
</div>
</div>
<div id="outline-container-org5ef5f65" class="outline-2">
<h2 id="org5ef5f65"><span class="section-number-2">6</span> Transfer function from force actuator to force sensor</h2>
<div id="outline-container-org7363765" class="outline-2">
<h2 id="org7363765"><span class="section-number-2">6</span> Transfer function from force actuator to force sensor</h2>
<div class="outline-text-2" id="text-6">
<p>
Two measurements are performed:
@ -455,7 +456,7 @@ Gfem_a_ss = exp(-s/1e4)*20*( d33*n*ka)*(G(3,1)+G(2,1))*d33/(eT*sD*n);
</pre>
</div>
<p>
The transfer function from input voltage to output voltage are computed and shown in Figure <a href="#orge80e7b7">14</a>.
The transfer function from input voltage to output voltage are computed and shown in Figure <a href="#org819df41">14</a>.
</p>
<div class="org-src-container">
<pre class="src src-matlab">Ts = a_ss.t(end)/(length(a_ss.t)-1);
@ -472,15 +473,15 @@ win = hann(ceil(10/Ts));
</div>
<div id="orge80e7b7" class="figure">
<div id="org819df41" class="figure">
<p><img src="figs/bode_plot_force_sensor_voltage_comp_fem.png" alt="bode_plot_force_sensor_voltage_comp_fem.png" />
</p>
<p><span class="figure-number">Figure 14: </span>Comparison of the identified dynamics from voltage output to voltage input and the FEM</p>
</div>
</div>
<div id="outline-container-org098bbb0" class="outline-3">
<h3 id="org098bbb0"><span class="section-number-3">6.1</span> System Identification</h3>
<div id="outline-container-org5ad8bf1" class="outline-3">
<h3 id="org5ad8bf1"><span class="section-number-3">6.1</span> System Identification</h3>
<div class="outline-text-3" id="text-6-1">
<div class="org-src-container">
<pre class="src src-matlab">w_z = 2*pi*111; % Zeros frequency [rad/s]
@ -494,7 +495,7 @@ Gi = G_inf*(s^2 - 2*xi_z*w_z*s + w_z^2)/(s^2 + 2*xi_p*w_p*s + w_p^2);
</div>
<div id="org76af419" class="figure">
<div id="orgc283618" class="figure">
<p><img src="figs/iff_plant_identification_apa95ml.png" alt="iff_plant_identification_apa95ml.png" />
</p>
<p><span class="figure-number">Figure 15: </span>Identification of the IFF plant</p>
@ -503,11 +504,11 @@ Gi = G_inf*(s^2 - 2*xi_z*w_z*s + w_z^2)/(s^2 + 2*xi_p*w_p*s + w_p^2);
</div>
<div id="outline-container-orge0e4f46" class="outline-3">
<h3 id="orge0e4f46"><span class="section-number-3">6.2</span> Integral Force Feedback</h3>
<div id="outline-container-orgf1d7d77" class="outline-3">
<h3 id="orgf1d7d77"><span class="section-number-3">6.2</span> Integral Force Feedback</h3>
<div class="outline-text-3" id="text-6-2">
<div id="org114ceb2" class="figure">
<div id="org6524816" class="figure">
<p><img src="figs/root_locus_iff_apa95ml_identification.png" alt="root_locus_iff_apa95ml_identification.png" />
</p>
<p><span class="figure-number">Figure 16: </span>Root Locus for IFF</p>
@ -516,12 +517,12 @@ Gi = G_inf*(s^2 - 2*xi_z*w_z*s + w_z^2)/(s^2 + 2*xi_p*w_p*s + w_p^2);
</div>
</div>
<div id="outline-container-org102cc6a" class="outline-2">
<h2 id="org102cc6a"><span class="section-number-2">7</span> IFF Tests</h2>
<div id="outline-container-orgabc1447" class="outline-2">
<h2 id="orgabc1447"><span class="section-number-2">7</span> IFF Tests</h2>
<div class="outline-text-2" id="text-7">
</div>
<div id="outline-container-org9e16daf" class="outline-3">
<h3 id="org9e16daf"><span class="section-number-3">7.1</span> Load Data</h3>
<div id="outline-container-org8a1d06a" class="outline-3">
<h3 id="org8a1d06a"><span class="section-number-3">7.1</span> First tests with few gains</h3>
<div class="outline-text-3" id="text-7-1">
<div class="org-src-container">
<pre class="src src-matlab">iff_g10 = load('./mat/apa95ml_iff_g10_res.mat', 'u', 't', 'y', 'v');
@ -545,60 +546,84 @@ win = hann(ceil(10/Ts));
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">figure;
hold on;
plot(f, co_iff_of, '-', 'DisplayName', 'g=0')
plot(f, co_iff_g10, '-', 'DisplayName', 'g=10')
plot(f, co_iff_g100, '-', 'DisplayName', 'g=100')
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
ylabel('Coherence'); xlabel('Frequency [Hz]');
hold off;
legend();
xlim([60, 600])
</pre>
</div>
<div id="org3768cef" class="figure">
<div id="orgbc64698" class="figure">
<p><img src="figs/iff_first_test_coherence.png" alt="iff_first_test_coherence.png" />
</p>
<p><span class="figure-number">Figure 17: </span>Coherence</p>
</div>
<div id="org16a4139" class="figure">
<p><img src="figs/iff_first_test_bode_plot.png" alt="iff_first_test_bode_plot.png" />
</p>
<p><span class="figure-number">Figure 18: </span>Bode plot for different values of IFF gain</p>
</div>
</div>
</div>
<div id="outline-container-org1241f3d" class="outline-3">
<h3 id="org1241f3d"><span class="section-number-3">7.2</span> Second test with many Gains</h3>
<div class="outline-text-3" id="text-7-2">
<div class="org-src-container">
<pre class="src src-matlab">figure;
ax1 = subplot(2, 1, 1);
hold on;
plot(f, abs(tf_iff_of), '-', 'DisplayName', 'g=0')
plot(f, abs(tf_iff_g10), '-', 'DisplayName', 'g=10')
plot(f, abs(tf_iff_g100), '-', 'DisplayName', 'g=100')
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
ylabel('Amplitude'); xlabel('Frequency [Hz]');
hold off;
legend();
<pre class="src src-matlab">load('./mat/apa95ml_iff_test.mat', 'results');
</pre>
</div>
ax2 = subplot(2, 1, 2);
hold on;
plot(f, 180/pi*angle(-tf_iff_of), '-')
plot(f, 180/pi*angle(-tf_iff_g10), '-')
plot(f, 180/pi*angle(-tf_iff_g100), '-')
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
ylabel('Phase'); xlabel('Frequency [Hz]');
hold off;
<div class="org-src-container">
<pre class="src src-matlab">Ts = 1e-4;
win = hann(ceil(10/Ts));
</pre>
</div>
linkaxes([ax1,ax2], 'x');
xlim([60, 600]);
<div class="org-src-container">
<pre class="src src-matlab">tf_iff = {zeros(1, length(results))};
co_iff = {zeros(1, length(results))};
g_iff = [0, 1, 5, 10, 50, 100];
for i=1:length(results)
[tf_est, f] = tfestimate(results{i}.u, results{i}.y, win, [], [], 1/Ts);
[co_est, ~] = mscohere(results{i}.u, results{i}.y, win, [], [], 1/Ts);
tf_iff(i) = {tf_est};
co_iff(i) = {co_est};
end
</pre>
</div>
<div id="orgf1ca4d4" class="figure">
<p><img src="figs/iff_first_test_bode_plot.png" alt="iff_first_test_bode_plot.png" />
<div id="orgcc7302c" class="figure">
<p><img src="figs/iff_results_bode_plots.png" alt="iff_results_bode_plots.png" />
</p>
</div>
<div class="org-src-container">
<pre class="src src-matlab">G_id = {zeros(1,length(results))};
f_start = 70; % [Hz]
f_end = 500; % [Hz]
for i = 1:length(results)
tf_id = tf_iff{i}(sum(f&lt;f_start):length(f)-sum(f&gt;f_end));
f_id = f(sum(f&lt;f_start):length(f)-sum(f&gt;f_end));
gfr = idfrd(tf_id, 2*pi*f_id, Ts);
G_id(i) = {procest(gfr,'P2UDZ')};
end
</pre>
</div>
<div id="org435aaa6" class="figure">
<p><img src="figs/iff_results_bode_plots_identification.png" alt="iff_results_bode_plots_identification.png" />
</p>
</div>
<div id="org9db1293" class="figure">
<p><img src="figs/iff_results_root_locus.png" alt="iff_results_root_locus.png" />
</p>
<p><span class="figure-number">Figure 18: </span>Bode plot for different values of IFF gain</p>
</div>
</div>
</div>
@ -606,7 +631,7 @@ xlim([60, 600]);
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
<p class="date">Created: 2020-08-20 jeu. 23:08</p>
<p class="date">Created: 2020-08-21 ven. 15:26</p>
</div>
</body>
</html>

174
index.org
View File

@ -709,7 +709,7 @@ The transfer function from input voltage to output voltage are computed and show
<<matlab-init>>
#+end_src
** Load Data
** First tests with few gains
#+begin_src matlab
iff_g10 = load('./mat/apa95ml_iff_g10_res.mat', 'u', 't', 'y', 'v');
iff_g100 = load('./mat/apa95ml_iff_g100_res.mat', 'u', 't', 'y', 'v');
@ -730,7 +730,7 @@ The transfer function from input voltage to output voltage are computed and show
[co_iff_of, ~] = mscohere(iff_of.u, iff_of.y, win, [], [], 1/Ts);
#+end_src
#+begin_src matlab
#+begin_src matlab :exports none
figure;
hold on;
@ -754,7 +754,7 @@ The transfer function from input voltage to output voltage are computed and show
[[file:figs/iff_first_test_coherence.png]]
#+begin_src matlab
#+begin_src matlab :exports none
figure;
ax1 = subplot(2, 1, 1);
hold on;
@ -787,3 +787,171 @@ The transfer function from input voltage to output voltage are computed and show
#+caption: Bode plot for different values of IFF gain
#+RESULTS:
[[file:figs/iff_first_test_bode_plot.png]]
** Second test with many Gains
#+begin_src matlab
load('./mat/apa95ml_iff_test.mat', 'results');
#+end_src
#+begin_src matlab
Ts = 1e-4;
win = hann(ceil(10/Ts));
#+end_src
#+begin_src matlab
tf_iff = {zeros(1, length(results))};
co_iff = {zeros(1, length(results))};
g_iff = [0, 1, 5, 10, 50, 100];
for i=1:length(results)
[tf_est, f] = tfestimate(results{i}.u, results{i}.y, win, [], [], 1/Ts);
[co_est, ~] = mscohere(results{i}.u, results{i}.y, win, [], [], 1/Ts);
tf_iff(i) = {tf_est};
co_iff(i) = {co_est};
end
#+end_src
#+begin_src matlab :exports none
figure;
hold on;
for i = 1:length(results)
plot(f, co_iff{i}, '-', 'DisplayName', sprintf('g = %0.f', g_iff(i)))
end
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
ylabel('Coherence'); xlabel('Frequency [Hz]');
hold off;
legend();
xlim([60, 600])
#+end_src
#+begin_src matlab :exports none
figure;
ax1 = subplot(2, 1, 1);
hold on;
for i = 1:length(results)
plot(f, abs(tf_iff{i}), '-', 'DisplayName', sprintf('g = %0.f', g_iff(i)))
end
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
ylabel('Amplitude'); xlabel('Frequency [Hz]');
hold off;
legend();
ax2 = subplot(2, 1, 2);
hold on;
for i = 1:length(results)
plot(f, 180/pi*angle(-tf_iff{i}), '-')
end
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
ylabel('Phase'); xlabel('Frequency [Hz]');
hold off;
linkaxes([ax1,ax2], 'x');
xlim([60, 600]);
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/iff_results_bode_plots.pdf', 'width', 'full', 'height', 'full');
#+end_src
#+name: fig:iff_results_bode_plots
#+caption:
#+RESULTS:
[[file:figs/iff_results_bode_plots.png]]
#+begin_src matlab
G_id = {zeros(1,length(results))};
f_start = 70; % [Hz]
f_end = 500; % [Hz]
for i = 1:length(results)
tf_id = tf_iff{i}(sum(f<f_start):length(f)-sum(f>f_end));
f_id = f(sum(f<f_start):length(f)-sum(f>f_end));
gfr = idfrd(tf_id, 2*pi*f_id, Ts);
G_id(i) = {procest(gfr,'P2UDZ')};
end
#+end_src
#+begin_src matlab :exports none
figure;
ax1 = subplot(2, 1, 1);
hold on;
for i = 1:length(results)
set(gca,'ColorOrderIndex',i)
plot(f, abs(tf_iff{i}), '-', 'DisplayName', sprintf('g = %0.f', g_iff(i)))
set(gca,'ColorOrderIndex',i)
plot(f, abs(squeeze(freqresp(G_id{i}, f, 'Hz'))), '--', 'HandleVisibility', 'off')
end
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
ylabel('Amplitude'); xlabel('Frequency [Hz]');
hold off;
legend();
ax2 = subplot(2, 1, 2);
hold on;
for i = 1:length(results)
set(gca,'ColorOrderIndex',i)
plot(f, 180/pi*angle(tf_iff{i}), '-')
set(gca,'ColorOrderIndex',i)
plot(f, 180/pi*angle(squeeze(freqresp(G_id{i}, f, 'Hz'))), '--')
end
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
ylabel('Phase'); xlabel('Frequency [Hz]');
hold off;
linkaxes([ax1,ax2], 'x');
xlim([60, 600]);
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/iff_results_bode_plots_identification.pdf', 'width', 'full', 'height', 'full');
#+end_src
#+name: fig:iff_results_bode_plots_identification
#+caption:
#+RESULTS:
[[file:figs/iff_results_bode_plots_identification.png]]
#+begin_src matlab :exports none
w_z = 2*pi*111; % Zeros frequency [rad/s]
w_p = 2*pi*255; % Pole frequency [rad/s]
xi_z = 0.05;
xi_p = 0.015;
G_inf = 2;
Gi = G_inf*(s^2 - 2*xi_z*w_z*s + w_z^2)/(s^2 + 2*xi_p*w_p*s + w_p^2);
gains = logspace(0, 5, 1000);
figure;
hold on;
plot(real(pole(Gi)), imag(pole(Gi)), 'kx', 'HandleVisibility', 'off');
plot(real(tzero(Gi)), imag(tzero(Gi)), 'ko', 'HandleVisibility', 'off');
for i = 1:length(results)
set(gca,'ColorOrderIndex',i)
plot(real(pole(G_id{i})), imag(pole(G_id{i})), 'o', 'DisplayName', sprintf('g = %0.f', g_iff(i)));
end
for i = 1:length(gains)
cl_poles = pole(feedback(Gi, (gains(i)/(s + 2*pi*2))));
plot(real(cl_poles), imag(cl_poles), 'k.', 'HandleVisibility', 'off');
end
ylim([0, 1800]);
xlim([-1600,200]);
xlabel('Real Part')
ylabel('Imaginary Part')
axis square
legend('location', 'northwest');
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/iff_results_root_locus.pdf', 'width', 'wide', 'height', 'tall');
#+end_src
#+name: fig:iff_results_root_locus
#+caption:
#+RESULTS:
[[file:figs/iff_results_root_locus.png]]