Add figure about the PI amplifier

This commit is contained in:
Thomas Dehaeze 2020-07-24 11:34:18 +02:00
parent 63bb2cf11b
commit 16465e1f08
6 changed files with 225 additions and 75 deletions

BIN
figs/PI_E505_coh.pdf Normal file

Binary file not shown.

BIN
figs/PI_E505_coh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
figs/PI_E505_tf.pdf Normal file

Binary file not shown.

BIN
figs/PI_E505_tf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 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-07-23 jeu. 09:33 -->
<!-- 2020-07-24 ven. 11:34 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Test Bench APA95ML</title>
<meta name="generator" content="Org mode" />
@ -35,37 +35,42 @@
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org6d01a62">1. Setup</a>
<li><a href="#orgfe82cc3">1. Setup</a>
<ul>
<li><a href="#org7f6c52e">1.1. Parameters</a></li>
<li><a href="#orgf78bcf3">1.2. Filter White Noise</a></li>
<li><a href="#org1c0f5ab">1.1. Parameters</a></li>
<li><a href="#orgaa4583f">1.2. Filter White Noise</a></li>
</ul>
</li>
<li><a href="#org3920c8f">2. Run Experiment and Save Data</a>
<li><a href="#org14fbfb3">2. Run Experiment and Save Data</a>
<ul>
<li><a href="#org48afa54">2.1. Load Data</a></li>
<li><a href="#org6dd5e8b">2.2. Save Data</a></li>
<li><a href="#orgad744cf">2.1. Load Data</a></li>
<li><a href="#orgecaca8d">2.2. Save Data</a></li>
</ul>
</li>
<li><a href="#orgb856102">3. Huddle Test</a>
<li><a href="#org6882b50">3. Huddle Test</a>
<ul>
<li><a href="#orgbdccf6c">3.1. Time Domain Data</a></li>
<li><a href="#org555147e">3.2. PSD of Measurement Noise</a></li>
<li><a href="#orgb5af256">3.1. Time Domain Data</a></li>
<li><a href="#org40d323a">3.2. PSD of Measurement Noise</a></li>
</ul>
</li>
<li><a href="#orgb67c277">4. Transfer Function Estimation with \(m=5kg\)</a>
<li><a href="#orgbd5d691">4. Transfer Function Estimation with \(m=5kg\)</a>
<ul>
<li><a href="#org3f71fa1">4.1. Time Domain Data</a></li>
<li><a href="#org8e6db12">4.2. Comparison of the PSD with Huddle Test</a></li>
<li><a href="#org4ac16d4">4.3. Compute TF estimate and Coherence</a></li>
<li><a href="#org6938b52">4.4. Comparison with the FEM model</a></li>
<li><a href="#org227c117">4.1. Time Domain Data</a></li>
<li><a href="#org6113f77">4.2. Comparison of the PSD with Huddle Test</a></li>
<li><a href="#orgd0a66e9">4.3. Compute TF estimate and Coherence</a></li>
<li><a href="#org0a09881">4.4. Comparison with the FEM model</a></li>
</ul>
</li>
<li><a href="#org98add36">5. PI Amplifier</a>
<li><a href="#org67f151f">5. Transfer function of the PI Amplifier</a>
<ul>
<li><a href="#org68ab283">5.1. Comparison of the PSD with Huddle Test</a></li>
<li><a href="#orga8db91a">5.2. Compute TF estimate and Coherence</a></li>
<li><a href="#org7272539">5.3. Comparison with the FEM model</a></li>
<li><a href="#orgf5e228d">5.1. Compute TF estimate and Coherence</a></li>
</ul>
</li>
<li><a href="#org1290d70">6. PI Amplifier</a>
<ul>
<li><a href="#orgd4ba330">6.1. Comparison of the PSD with Huddle Test</a></li>
<li><a href="#org16df457">6.2. Compute TF estimate and Coherence</a></li>
<li><a href="#orgb02981d">6.3. Comparison with the FEM model</a></li>
</ul>
</li>
</ul>
@ -73,26 +78,26 @@
</div>
<div id="orgfe6ddf9" class="figure">
<div id="org06e99b8" 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="orgde5ae22" class="figure">
<div id="orgdb17066" 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-org6d01a62" class="outline-2">
<h2 id="org6d01a62"><span class="section-number-2">1</span> Setup</h2>
<div id="outline-container-orgfe82cc3" class="outline-2">
<h2 id="orgfe82cc3"><span class="section-number-2">1</span> Setup</h2>
<div class="outline-text-2" id="text-1">
</div>
<div id="outline-container-org7f6c52e" class="outline-3">
<h3 id="org7f6c52e"><span class="section-number-3">1.1</span> Parameters</h3>
<div id="outline-container-org1c0f5ab" class="outline-3">
<h3 id="org1c0f5ab"><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;
@ -101,8 +106,8 @@
</div>
</div>
<div id="outline-container-orgf78bcf3" class="outline-3">
<h3 id="orgf78bcf3"><span class="section-number-3">1.2</span> Filter White Noise</h3>
<div id="outline-container-orgaa4583f" class="outline-3">
<h3 id="orgaa4583f"><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);
@ -114,13 +119,13 @@ Gz = c2d(Glpf, Ts, 'tustin');
</div>
</div>
<div id="outline-container-org3920c8f" class="outline-2">
<h2 id="org3920c8f"><span class="section-number-2">2</span> Run Experiment and Save Data</h2>
<div id="outline-container-org14fbfb3" class="outline-2">
<h2 id="org14fbfb3"><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-org48afa54" class="outline-3">
<h3 id="org48afa54"><span class="section-number-3">2.1</span> Load Data</h3>
<div id="outline-container-orgad744cf" class="outline-3">
<h3 id="orgad744cf"><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;
@ -129,8 +134,8 @@ Gz = c2d(Glpf, Ts, 'tustin');
</div>
</div>
<div id="outline-container-org6dd5e8b" class="outline-3">
<h3 id="org6dd5e8b"><span class="section-number-3">2.2</span> Save Data</h3>
<div id="outline-container-orgecaca8d" class="outline-3">
<h3 id="orgecaca8d"><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]
@ -147,16 +152,16 @@ t = data(:, 3); % Time [s]
</div>
</div>
<div id="outline-container-orgb856102" class="outline-2">
<h2 id="orgb856102"><span class="section-number-2">3</span> Huddle Test</h2>
<div id="outline-container-org6882b50" class="outline-2">
<h2 id="org6882b50"><span class="section-number-2">3</span> Huddle Test</h2>
<div class="outline-text-2" id="text-3">
</div>
<div id="outline-container-orgbdccf6c" class="outline-3">
<h3 id="orgbdccf6c"><span class="section-number-3">3.1</span> Time Domain Data</h3>
<div id="outline-container-orgb5af256" class="outline-3">
<h3 id="orgb5af256"><span class="section-number-3">3.1</span> Time Domain Data</h3>
<div class="outline-text-3" id="text-3-1">
<div id="orgfef1212" class="figure">
<div id="orgbd7db15" 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>
@ -164,8 +169,8 @@ t = data(:, 3); % Time [s]
</div>
</div>
<div id="outline-container-org555147e" class="outline-3">
<h3 id="org555147e"><span class="section-number-3">3.2</span> PSD of Measurement Noise</h3>
<div id="outline-container-org40d323a" class="outline-3">
<h3 id="org40d323a"><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);
@ -181,7 +186,7 @@ win = hanning(ceil(1*Fs));
</div>
<div id="orgd17271b" class="figure">
<div id="orgd39e732" 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>
@ -190,16 +195,16 @@ win = hanning(ceil(1*Fs));
</div>
</div>
<div id="outline-container-orgb67c277" class="outline-2">
<h2 id="orgb67c277"><span class="section-number-2">4</span> Transfer Function Estimation with \(m=5kg\)</h2>
<div id="outline-container-orgbd5d691" class="outline-2">
<h2 id="orgbd5d691"><span class="section-number-2">4</span> Transfer Function Estimation with \(m=5kg\)</h2>
<div class="outline-text-2" id="text-4">
</div>
<div id="outline-container-org3f71fa1" class="outline-3">
<h3 id="org3f71fa1"><span class="section-number-3">4.1</span> Time Domain Data</h3>
<div id="outline-container-org227c117" class="outline-3">
<h3 id="org227c117"><span class="section-number-3">4.1</span> Time Domain Data</h3>
<div class="outline-text-3" id="text-4-1">
<div id="orga603410" class="figure">
<div id="org71839ef" 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>
@ -207,8 +212,8 @@ win = hanning(ceil(1*Fs));
</div>
</div>
<div id="outline-container-org8e6db12" class="outline-3">
<h3 id="org8e6db12"><span class="section-number-3">4.2</span> Comparison of the PSD with Huddle Test</h3>
<div id="outline-container-org6113f77" class="outline-3">
<h3 id="org6113f77"><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);
@ -225,7 +230,7 @@ win = hanning(ceil(1*Fs));
</div>
<div id="orgf16dfcd" class="figure">
<div id="orgb5f4391" 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>
@ -233,8 +238,8 @@ win = hanning(ceil(1*Fs));
</div>
</div>
<div id="outline-container-org4ac16d4" class="outline-3">
<h3 id="org4ac16d4"><span class="section-number-3">4.3</span> Compute TF estimate and Coherence</h3>
<div id="outline-container-orgd0a66e9" class="outline-3">
<h3 id="orgd0a66e9"><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);
@ -251,14 +256,14 @@ Fs = 1/Ts;
</div>
<div id="org93041d8" class="figure">
<div id="org24bac83" 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="orgf2a7b3e" class="figure">
<div id="orgb21f9f8" 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>
@ -266,8 +271,8 @@ Fs = 1/Ts;
</div>
</div>
<div id="outline-container-org6938b52" class="outline-3">
<h3 id="org6938b52"><span class="section-number-3">4.4</span> Comparison with the FEM model</h3>
<div id="outline-container-org0a09881" class="outline-3">
<h3 id="org0a09881"><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');
@ -275,25 +280,85 @@ Fs = 1/Ts;
</div>
<div id="orgfcc57fa" class="figure">
<div id="org780d0cb" 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>
</div>
</div>
</div>
<div class="outline-text-2" id="text-4">
<div class="important">
<p>
The problem comes from the fact that the piezo is driven directly by the DAC that cannot deliver enought current.
In the next section, a current amplifier is used.
</p>
</div>
</div>
</div>
<div id="outline-container-org98add36" class="outline-2">
<h2 id="org98add36"><span class="section-number-2">5</span> PI Amplifier</h2>
<div id="outline-container-org67f151f" class="outline-2">
<h2 id="org67f151f"><span class="section-number-2">5</span> Transfer function of the PI Amplifier</h2>
<div class="outline-text-2" id="text-5">
</div>
<div id="outline-container-org68ab283" class="outline-3">
<h3 id="org68ab283"><span class="section-number-3">5.1</span> Comparison of the PSD with Huddle Test</h3>
<div id="outline-container-orgf5e228d" class="outline-3">
<h3 id="orgf5e228d"><span class="section-number-3">5.1</span> Compute TF estimate and Coherence</h3>
<div class="outline-text-3" id="text-5-1">
<div class="org-src-container">
<pre class="src src-matlab">Ts = t(end)/(length(t)-1);
Fs = 1/Ts;
</pre>
</div>
<p>
The coherence and the transfer function are estimate from the voltage input of the PI amplifier to its voltage inputs.
</p>
<p>
The coherence is very good as expected (Figure <a href="#orgf66ca3c">10</a>).
</p>
<p>
The transfer function show a low pass filter behavior with a lot of phase drop (Figure <a href="#org0f454bc">11</a>).
</p>
<div class="org-src-container">
<pre class="src src-matlab">win = hann(ceil(10/Ts));
[tf_est, f] = tfestimate(u, um, win, [], [], 1/Ts);
[co_est, ~] = mscohere( u, um, win, [], [], 1/Ts);
</pre>
</div>
<div id="orgf66ca3c" class="figure">
<p><img src="figs/PI_E505_coh.png" alt="PI_E505_coh.png" />
</p>
<p><span class="figure-number">Figure 10: </span>Coherence</p>
</div>
<div id="org0f454bc" class="figure">
<p><img src="figs/PI_E505_tf.png" alt="PI_E505_tf.png" />
</p>
<p><span class="figure-number">Figure 11: </span>Estimation of the transfer function from input voltage to displacement</p>
</div>
</div>
</div>
</div>
<div id="outline-container-org1290d70" class="outline-2">
<h2 id="org1290d70"><span class="section-number-2">6</span> PI Amplifier</h2>
<div class="outline-text-2" id="text-6">
</div>
<div id="outline-container-orgd4ba330" class="outline-3">
<h3 id="orgd4ba330"><span class="section-number-3">6.1</span> Comparison of the PSD with Huddle Test</h3>
<div class="outline-text-3" id="text-6-1">
<div class="org-src-container">
<pre class="src src-matlab">Ts = t(end)/(length(t)-1);
Fs = 1/Ts;
win = hanning(ceil(1*Fs));
</pre>
@ -306,17 +371,17 @@ win = hanning(ceil(1*Fs));
</div>
<div id="org5dff36b" class="figure">
<div id="orgee44531" 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>
<p><span class="figure-number">Figure 12: </span>Comparison of the ASD for the identification test and the huddle test</p>
</div>
</div>
</div>
<div id="outline-container-orga8db91a" class="outline-3">
<h3 id="orga8db91a"><span class="section-number-3">5.2</span> Compute TF estimate and Coherence</h3>
<div class="outline-text-3" id="text-5-2">
<div id="outline-container-org16df457" class="outline-3">
<h3 id="org16df457"><span class="section-number-3">6.2</span> Compute TF estimate and Coherence</h3>
<div class="outline-text-3" id="text-6-2">
<div class="org-src-container">
<pre class="src src-matlab">Ts = t(end)/(length(t)-1);
Fs = 1/Ts;
@ -332,34 +397,34 @@ Fs = 1/Ts;
</div>
<div id="org6e49e56" class="figure">
<div id="org1b63f2b" 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>
<p><span class="figure-number">Figure 13: </span>Coherence</p>
</div>
<div id="org34f3b6c" class="figure">
<div id="orgd6c6bfa" 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>
<p><span class="figure-number">Figure 14: </span>Estimation of the transfer function from input voltage to displacement</p>
</div>
</div>
</div>
<div id="outline-container-org7272539" class="outline-3">
<h3 id="org7272539"><span class="section-number-3">5.3</span> Comparison with the FEM model</h3>
<div class="outline-text-3" id="text-5-3">
<div id="outline-container-orgb02981d" class="outline-3">
<h3 id="orgb02981d"><span class="section-number-3">6.3</span> Comparison with the FEM model</h3>
<div class="outline-text-3" id="text-6-3">
<div class="org-src-container">
<pre class="src src-matlab">load('mat/fem_model_5kg.mat', 'Ghm');
</pre>
</div>
<div id="orga88c7dc" class="figure">
<div id="org44c4863" 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>
<p><span class="figure-number">Figure 15: </span>Comparison of the identified transfer function and the one estimated from the FE model</p>
</div>
</div>
</div>
@ -367,7 +432,7 @@ Fs = 1/Ts;
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
<p class="date">Created: 2020-07-23 jeu. 09:33</p>
<p class="date">Created: 2020-07-24 ven. 11:34</p>
</div>
</body>
</html>

View File

@ -339,6 +339,91 @@ The problem comes from the fact that the piezo is driven directly by the DAC tha
In the next section, a current amplifier is used.
#+end_important
* Transfer function of the PI Amplifier
** Matlab Init :noexport:ignore:
#+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name)
<<matlab-dir>>
#+end_src
#+begin_src matlab :exports none :results silent :noweb yes
<<matlab-init>>
#+end_src
** Load Data :noexport:
#+begin_src matlab
load('./mat/apa95ml_5kg_Amp_E505.mat', 't', 'u', 'um');
#+end_src
** Compute TF estimate and Coherence
#+begin_src matlab
Ts = t(end)/(length(t)-1);
Fs = 1/Ts;
#+end_src
The coherence and the transfer function are estimate from the voltage input of the PI amplifier to its voltage inputs.
The coherence is very good as expected (Figure [[fig:PI_E505_coh]]).
The transfer function show a low pass filter behavior with a lot of phase drop (Figure [[fig:PI_E505_tf]]).
#+begin_src matlab
win = hann(ceil(10/Ts));
[tf_est, f] = tfestimate(u, um, win, [], [], 1/Ts);
[co_est, ~] = mscohere( u, um, win, [], [], 1/Ts);
#+end_src
#+begin_src matlab :exports none
figure;
hold on;
plot(f, co_est, 'k-')
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
ylabel('Coherence'); xlabel('Frequency [Hz]');
hold off;
xlim([10, 5e3]);
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/PI_E505_coh.pdf', 'width', 'wide', 'height', 'normal');
#+end_src
#+name: fig:PI_E505_coh
#+caption: Coherence
#+RESULTS:
[[file:figs/PI_E505_coh.png]]
#+begin_src matlab :exports none
figure;
ax1 = subplot(2, 1, 1);
hold on;
plot(f, abs(tf_est), 'k-')
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
ylabel('Amplitude'); xlabel('Frequency [Hz]');
hold off;
ax2 = subplot(2, 1, 2);
hold on;
plot(f, 180/pi*angle(tf_est), 'k-')
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
ylabel('Phase'); xlabel('Frequency [Hz]');
hold off;
ylim([-180, 180]);
yticks(-180:90:180);
linkaxes([ax1,ax2], 'x');
xlim([10, 5e3]);
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/PI_E505_tf.pdf', 'width', 'full', 'height', 'full');
#+end_src
#+name: fig:PI_E505_tf
#+caption: Estimation of the transfer function from input voltage to displacement
#+RESULTS:
[[file:figs/PI_E505_tf.png]]
* PI Amplifier
** Matlab Init :noexport:ignore:
#+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name)