diff --git a/figs/apa95ml_5kg_PI_coh.pdf b/figs/apa95ml_5kg_PI_coh.pdf index aa70e5b..53e8ff1 100644 Binary files a/figs/apa95ml_5kg_PI_coh.pdf and b/figs/apa95ml_5kg_PI_coh.pdf differ diff --git a/figs/apa95ml_5kg_PI_coh.png b/figs/apa95ml_5kg_PI_coh.png index 0f01857..49f0b05 100644 Binary files a/figs/apa95ml_5kg_PI_coh.png and b/figs/apa95ml_5kg_PI_coh.png differ diff --git a/figs/apa95ml_5kg_PI_tf.pdf b/figs/apa95ml_5kg_PI_tf.pdf index 94ddad9..9841f66 100644 Binary files a/figs/apa95ml_5kg_PI_tf.pdf and b/figs/apa95ml_5kg_PI_tf.pdf differ diff --git a/figs/apa95ml_5kg_PI_tf.png b/figs/apa95ml_5kg_PI_tf.png index 1476271..226ab54 100644 Binary files a/figs/apa95ml_5kg_PI_tf.png and b/figs/apa95ml_5kg_PI_tf.png differ diff --git a/figs/apa95ml_5kg_pi_comp_fem.pdf b/figs/apa95ml_5kg_pi_comp_fem.pdf index 73cfd12..a7aeefc 100644 Binary files a/figs/apa95ml_5kg_pi_comp_fem.pdf and b/figs/apa95ml_5kg_pi_comp_fem.pdf differ diff --git a/figs/apa95ml_5kg_pi_comp_fem.png b/figs/apa95ml_5kg_pi_comp_fem.png index ed17f6c..4e92574 100644 Binary files a/figs/apa95ml_5kg_pi_comp_fem.png and b/figs/apa95ml_5kg_pi_comp_fem.png differ diff --git a/index.html b/index.html index bde09d9..50e9865 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Test Bench APA95ML @@ -15,14 +15,6 @@ - -
@@ -35,42 +27,42 @@

Table of Contents

@@ -78,26 +70,26 @@
-
+

setup_picture.png

Figure 1: Picture of the Setup

-
+

setup_zoom.png

Figure 2: Zoom on the APA

-
-

1 Setup

+
+

1 Setup

-
-

1.1 Parameters

+
+

1.1 Parameters

Ts = 1e-4;
@@ -106,8 +98,8 @@
 
-
-

1.2 Filter White Noise

+
+

1.2 Filter White Noise

Glpf = 1/(1 + s/2/pi/500);
@@ -119,13 +111,13 @@ Gz = c2d(Glpf, Ts, 'tustin');
 
-
-

2 Run Experiment and Save Data

+
+

2 Run Experiment and Save Data

-
-

2.1 Load Data

+
+

2.1 Load Data

data = SimulinkRealTime.utils.getFileScopeData('data/apa95ml.dat').data;
@@ -134,8 +126,8 @@ Gz = c2d(Glpf, Ts, 'tustin');
 
-
-

2.2 Save Data

+
+

2.2 Save Data

u = data(:, 1); % Input Voltage [V]
@@ -152,16 +144,16 @@ t = data(:, 3); % Time [s]
 
-
-

3 Huddle Test

+
+

3 Huddle Test

-
-

3.1 Time Domain Data

+
+

3.1 Time Domain Data

-
+

huddle_test_time_domain.png

Figure 3: Measurement of the Mass displacement during Huddle Test

@@ -169,8 +161,8 @@ t = data(:, 3); % Time [s]
-
-

3.2 PSD of Measurement Noise

+
+

3.2 PSD of Measurement Noise

Ts = t(end)/(length(t)-1);
@@ -186,7 +178,7 @@ win = hanning(ceil(1*Fs));
 
-
+

huddle_test_pdf.png

Figure 4: Amplitude Spectral Density of the Displacement during Huddle Test

@@ -195,16 +187,16 @@ win = hanning(ceil(1*Fs));
-
-

4 Transfer Function Estimation with \(m=5kg\)

+
+

4 Transfer Function Estimation using the DAC as the driver

-
-

4.1 Time Domain Data

+
+

4.1 Time Domain Data

-
+

apa95ml_5kg_10V_time_domain.png

Figure 5: Time domain signals during the test

@@ -212,8 +204,8 @@ win = hanning(ceil(1*Fs));
-
-

4.2 Comparison of the PSD with Huddle Test

+
+

4.2 Comparison of the PSD with Huddle Test

Ts = t(end)/(length(t)-1);
@@ -230,7 +222,7 @@ win = hanning(ceil(1*Fs));
 
-
+

apa95ml_5kg_10V_pdf_comp_huddle.png

Figure 6: Comparison of the ASD for the identification test and the huddle test

@@ -238,8 +230,8 @@ win = hanning(ceil(1*Fs));
-
-

4.3 Compute TF estimate and Coherence

+
+

4.3 Compute TF estimate and Coherence

Ts = t(end)/(length(t)-1);
@@ -256,14 +248,14 @@ Fs = 1/Ts;
 
-
+

apa95ml_5kg_10V_coh.png

Figure 7: Coherence

-
+

apa95ml_5kg_10V_tf.png

Figure 8: Estimation of the transfer function from input voltage to displacement

@@ -271,8 +263,8 @@ Fs = 1/Ts;
-
-

4.4 Comparison with the FEM model

+
+

4.4 Comparison with the FEM model

load('mat/fem_model_5kg.mat', 'Ghm');
@@ -280,7 +272,7 @@ Fs = 1/Ts;
 
-
+

apa95ml_5kg_comp_fem.png

Figure 9: Comparison of the identified transfer function and the one estimated from the FE model

@@ -299,16 +291,97 @@ In the next section, a current amplifier is used.
-
-

5 Transfer function of the PI Amplifier

+
+

5 Transfer Function Estimation using the PI Amplifier

-
-

5.1 Compute TF estimate and Coherence

+
+

5.1 Comparison of the PSD with Huddle Test

Ts = t(end)/(length(t)-1);
 Fs = 1/Ts;
+
+win = hanning(ceil(1*Fs));
+
+
+ +
+
[pxx, f] = pwelch(y, win, [], [], Fs);
+[pht, ~] = pwelch(ht.y, win, [], [], Fs);
+
+
+ + +
+

apa95ml_5kg_PI_pdf_comp_huddle.png +

+

Figure 10: Comparison of the ASD for the identification test and the huddle test

+
+
+
+ +
+

5.2 Compute TF estimate and Coherence

+
+
+
Ts = t(end)/(length(t)-1);
+Fs = 1/Ts;
+
+
+ +
+
win = hann(ceil(1/Ts));
+
+[tf_est, f] = tfestimate(u,  -y, win, [], [], 1/Ts);
+[tf_um , ~] = tfestimate(um, -y, win, [], [], 1/Ts);
+[co_est, ~] = mscohere(  um, -y, win, [], [], 1/Ts);
+
+
+ + +
+

apa95ml_5kg_PI_coh.png +

+

Figure 11: Coherence

+
+ + +
+

apa95ml_5kg_PI_tf.png +

+

Figure 12: Estimation of the transfer function from input voltage to displacement

+
+
+
+ +
+

5.3 Comparison with the FEM model

+
+
+
load('mat/fem_model_5kg.mat', 'Ghm');
+
+
+ + +
+

apa95ml_5kg_pi_comp_fem.png +

+

Figure 13: Comparison of the identified transfer function and the one estimated from the FE model

+
+
+
+
+
+

6 Transfer function of the PI Amplifier

+
+
+
+

6.1 Compute TF estimate and Coherence

+
+
+
Ts = t(end)/(length(t)-1);
+Fs = 1/Ts;
 
@@ -317,11 +390,11 @@ The coherence and the transfer function are estimate from the voltage input of t

-The coherence is very good as expected (Figure 10). +The coherence is very good as expected (Figure 14).

-The transfer function show a low pass filter behavior with a lot of phase drop (Figure 11). +The transfer function show a low pass filter behavior with a lot of phase drop (Figure 15).

@@ -333,17 +406,17 @@ The transfer function show a low pass filter behavior with a lot of phase drop (
-
+

PI_E505_coh.png

-

Figure 10: Coherence

+

Figure 14: Coherence

-
+

PI_E505_tf.png

-

Figure 11: Estimation of the transfer function from input voltage to displacement

+

Figure 15: Estimation of the transfer function from input voltage to displacement

@@ -360,91 +433,10 @@ The delay can be estimated as follow:

- -
-

6 PI Amplifier

-
-
-
-

6.1 Comparison of the PSD with Huddle Test

-
-
-
Ts = t(end)/(length(t)-1);
-Fs = 1/Ts;
-
-win = hanning(ceil(1*Fs));
-
-
- -
-
[pxx, f] = pwelch(y, win, [], [], Fs);
-[pht, ~] = pwelch(ht.y, win, [], [], Fs);
-
-
- - -
-

apa95ml_5kg_PI_pdf_comp_huddle.png -

-

Figure 12: Comparison of the ASD for the identification test and the huddle test

-
-
-
- -
-

6.2 Compute TF estimate and Coherence

-
-
-
Ts = t(end)/(length(t)-1);
-Fs = 1/Ts;
-
-
- -
-
win = hann(ceil(10/Ts));
-
-[tf_est, f] = tfestimate(u, -y, win, [], [], 1/Ts);
-[co_est, ~] = mscohere(  u, -y, win, [], [], 1/Ts);
-
-
- - -
-

apa95ml_5kg_PI_coh.png -

-

Figure 13: Coherence

-
- - -
-

apa95ml_5kg_PI_tf.png -

-

Figure 14: Estimation of the transfer function from input voltage to displacement

-
-
-
- -
-

6.3 Comparison with the FEM model

-
-
-
load('mat/fem_model_5kg.mat', 'Ghm');
-
-
- - -
-

apa95ml_5kg_pi_comp_fem.png -

-

Figure 15: Comparison of the identified transfer function and the one estimated from the FE model

-
-
-
-

Author: Dehaeze Thomas

-

Created: 2020-07-24 ven. 13:06

+

Created: 2020-07-24 ven. 13:16

diff --git a/index.org b/index.org index 08e0fd3..6e249b5 100644 --- a/index.org +++ b/index.org @@ -156,7 +156,7 @@ #+RESULTS: [[file:figs/huddle_test_pdf.png]] -* Transfer Function Estimation with $m=5kg$ +* Transfer Function Estimation using the DAC as the driver :PROPERTIES: :header-args:matlab+: :tangle matlab/tf_estimation.m :header-args:matlab+: :comments org :mkdirp yes @@ -339,6 +339,172 @@ 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 Estimation using 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) + <> +#+end_src + +#+begin_src matlab :exports none :results silent :noweb yes + <> +#+end_src + +** Load Data :noexport: +#+begin_src matlab + ht = load('./mat/huddle_test.mat', 't', 'u', 'y'); + load('./mat/apa95ml_5kg_Amp_E505.mat', 't', 'u', 'um', 'y'); +#+end_src + +#+begin_src matlab + u = u - mean(u); + um = um - mean(um); + y = y - mean(y); + + ht.u = ht.u - mean(ht.u); + ht.y = ht.y - mean(ht.y); +#+end_src + +** Comparison of the PSD with Huddle Test +#+begin_src matlab + Ts = t(end)/(length(t)-1); + Fs = 1/Ts; + + win = hanning(ceil(1*Fs)); +#+end_src + +#+begin_src matlab + [pxx, f] = pwelch(y, win, [], [], Fs); + [pht, ~] = pwelch(ht.y, win, [], [], Fs); +#+end_src + +#+begin_src matlab :exports none + figure; + hold on; + plot(f, sqrt(pxx), 'DisplayName', '5kg'); + plot(f, sqrt(pht), 'DisplayName', 'Huddle Test'); + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); + xlabel('Frequency [Hz]'); ylabel('ASD [$m/\sqrt{Hz}$]'); + legend('location', 'northeast'); + xlim([1, Fs/2]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace + exportFig('figs/apa95ml_5kg_PI_pdf_comp_huddle.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:apa95ml_5kg_PI_pdf_comp_huddle +#+caption: Comparison of the ASD for the identification test and the huddle test +#+RESULTS: +[[file:figs/apa95ml_5kg_PI_pdf_comp_huddle.png]] + +** Compute TF estimate and Coherence +#+begin_src matlab + Ts = t(end)/(length(t)-1); + Fs = 1/Ts; +#+end_src + +#+begin_src matlab + win = hann(ceil(1/Ts)); + + [tf_est, f] = tfestimate(u, -y, win, [], [], 1/Ts); + [tf_um , ~] = tfestimate(um, -y, win, [], [], 1/Ts); + [co_est, ~] = mscohere( um, -y, 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/apa95ml_5kg_PI_coh.pdf', 'width', 'wide', 'height', 'normal'); +#+end_src + +#+name: fig:apa95ml_5kg_PI_coh +#+caption: Coherence +#+RESULTS: +[[file:figs/apa95ml_5kg_PI_coh.png]] + +#+begin_src matlab :exports none + figure; + ax1 = subplot(2, 1, 1); + hold on; + plot(f, abs(tf_est), 'DisplayName', 'Input Voltage') + plot(f, abs(tf_um), 'DisplayName', 'Monitor Voltage') + set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log'); + ylabel('Amplitude'); xlabel('Frequency [Hz]'); + hold off; + legend('location', 'southwest') + + ax2 = subplot(2, 1, 2); + hold on; + plot(f, 180/pi*unwrap(angle(tf_est))) + plot(f, 180/pi*unwrap(angle(tf_um))) + set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin'); + ylabel('Phase'); xlabel('Frequency [Hz]'); + hold off; + ylim([-540, 0]); + yticks(-540:90:0); + + linkaxes([ax1,ax2], 'x'); + xlim([10, 5e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace + exportFig('figs/apa95ml_5kg_PI_tf.pdf', 'width', 'full', 'height', 'full'); +#+end_src + +#+name: fig:apa95ml_5kg_PI_tf +#+caption: Estimation of the transfer function from input voltage to displacement +#+RESULTS: +[[file:figs/apa95ml_5kg_PI_tf.png]] + +** Comparison with the FEM model +#+begin_src matlab + load('mat/fem_model_5kg.mat', 'Ghm'); +#+end_src + +#+begin_src matlab :exports none + freqs = logspace(0, 4, 1000); + figure; + ax1 = subplot(2, 1, 1); + hold on; + plot(f, 1/10*170/1400*abs(tf_um), 'DisplayName', 'Identification') + plot(freqs, abs(squeeze(freqresp(Ghm, freqs, 'Hz'))), 'DisplayName', 'FEM') + set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log'); + ylabel('Amplitude'); xlabel('Frequency [Hz]'); + legend('location', 'northeast') + hold off; + + ax2 = subplot(2, 1, 2); + hold on; + plot(f, 180/pi*unwrap(angle(tf_um))) + plot(freqs, 180/pi*unwrap(angle(squeeze(freqresp(Ghm, freqs, 'Hz'))))) + set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin'); + ylabel('Phase'); xlabel('Frequency [Hz]'); + hold off; + ylim([-540, 0]); + yticks(-540:90:0); + + linkaxes([ax1,ax2], 'x'); + xlim([10, 5e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace + exportFig('figs/apa95ml_5kg_pi_comp_fem.pdf', 'width', 'full', 'height', 'full'); +#+end_src + +#+name: fig:apa95ml_5kg_pi_comp_fem +#+caption: Comparison of the identified transfer function and the one estimated from the FE model +#+RESULTS: +[[file:figs/apa95ml_5kg_pi_comp_fem.png]] * 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) @@ -432,153 +598,3 @@ The delay can be estimated as follow: #+RESULTS: : 0.0004 -* 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) - <> -#+end_src - -#+begin_src matlab :exports none :results silent :noweb yes - <> -#+end_src - -** Load Data :noexport: -#+begin_src matlab - ht = load('./mat/huddle_test.mat', 't', 'u', 'y'); - load('./mat/apa95ml_5kg_Amp_E505.mat', 't', 'u', 'y'); -#+end_src - -** Comparison of the PSD with Huddle Test -#+begin_src matlab - Ts = t(end)/(length(t)-1); - Fs = 1/Ts; - - win = hanning(ceil(1*Fs)); -#+end_src - -#+begin_src matlab - [pxx, f] = pwelch(y, win, [], [], Fs); - [pht, ~] = pwelch(ht.y, win, [], [], Fs); -#+end_src - -#+begin_src matlab :exports none - figure; - hold on; - plot(f, sqrt(pxx), 'DisplayName', '5kg'); - plot(f, sqrt(pht), 'DisplayName', 'Huddle Test'); - hold off; - set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); - xlabel('Frequency [Hz]'); ylabel('ASD [$m/\sqrt{Hz}$]'); - legend('location', 'northeast'); - xlim([1, Fs/2]); -#+end_src - -#+begin_src matlab :tangle no :exports results :results file replace - exportFig('figs/apa95ml_5kg_PI_pdf_comp_huddle.pdf', 'width', 'wide', 'height', 'tall'); -#+end_src - -#+name: fig:apa95ml_5kg_PI_pdf_comp_huddle -#+caption: Comparison of the ASD for the identification test and the huddle test -#+RESULTS: -[[file:figs/apa95ml_5kg_PI_pdf_comp_huddle.png]] - -** Compute TF estimate and Coherence -#+begin_src matlab - Ts = t(end)/(length(t)-1); - Fs = 1/Ts; -#+end_src - -#+begin_src matlab - win = hann(ceil(10/Ts)); - - [tf_est, f] = tfestimate(u, -y, win, [], [], 1/Ts); - [co_est, ~] = mscohere( u, -y, 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/apa95ml_5kg_PI_coh.pdf', 'width', 'wide', 'height', 'normal'); -#+end_src - -#+name: fig:apa95ml_5kg_PI_coh -#+caption: Coherence -#+RESULTS: -[[file:figs/apa95ml_5kg_PI_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; - - linkaxes([ax1,ax2], 'x'); - xlim([10, 5e3]); -#+end_src - -#+begin_src matlab :tangle no :exports results :results file replace - exportFig('figs/apa95ml_5kg_PI_tf.pdf', 'width', 'full', 'height', 'full'); -#+end_src - -#+name: fig:apa95ml_5kg_PI_tf -#+caption: Estimation of the transfer function from input voltage to displacement -#+RESULTS: -[[file:figs/apa95ml_5kg_PI_tf.png]] - -** Comparison with the FEM model -#+begin_src matlab - load('mat/fem_model_5kg.mat', 'Ghm'); -#+end_src - -#+begin_src matlab :exports none - freqs = logspace(0, 4, 1000); - figure; - ax1 = subplot(2, 1, 1); - hold on; - plot(f, 1/10*170/1400*abs(tf_est), 'DisplayName', 'Identification') - plot(freqs, abs(squeeze(freqresp(Ghm, freqs, 'Hz'))), 'DisplayName', 'FEM') - set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log'); - ylabel('Amplitude'); xlabel('Frequency [Hz]'); - legend('location', 'northeast') - hold off; - - ax2 = subplot(2, 1, 2); - hold on; - plot(f, 180/pi*angle(tf_est)) - plot(freqs, 180/pi*angle(squeeze(freqresp(Ghm, freqs, 'Hz')))) - set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin'); - ylabel('Phase'); xlabel('Frequency [Hz]'); - hold off; - ylim([-180, 180]); - - linkaxes([ax1,ax2], 'x'); - xlim([10, 5e3]); -#+end_src - -#+begin_src matlab :tangle no :exports results :results file replace - exportFig('figs/apa95ml_5kg_pi_comp_fem.pdf', 'width', 'full', 'height', 'full'); -#+end_src - -#+name: fig:apa95ml_5kg_pi_comp_fem -#+caption: Comparison of the identified transfer function and the one estimated from the FE model -#+RESULTS: -[[file:figs/apa95ml_5kg_pi_comp_fem.png]]