diff --git a/figs/iff_results_bode_plots.pdf b/figs/iff_results_bode_plots.pdf new file mode 100644 index 0000000..0ccf0f5 Binary files /dev/null and b/figs/iff_results_bode_plots.pdf differ diff --git a/figs/iff_results_bode_plots.png b/figs/iff_results_bode_plots.png new file mode 100644 index 0000000..9ea9aaa Binary files /dev/null and b/figs/iff_results_bode_plots.png differ diff --git a/figs/iff_results_bode_plots_identification.pdf b/figs/iff_results_bode_plots_identification.pdf new file mode 100644 index 0000000..5b3597c Binary files /dev/null and b/figs/iff_results_bode_plots_identification.pdf differ diff --git a/figs/iff_results_bode_plots_identification.png b/figs/iff_results_bode_plots_identification.png new file mode 100644 index 0000000..99f8655 Binary files /dev/null and b/figs/iff_results_bode_plots_identification.png differ diff --git a/figs/iff_results_root_locus.pdf b/figs/iff_results_root_locus.pdf new file mode 100644 index 0000000..ec91f4f Binary files /dev/null and b/figs/iff_results_root_locus.pdf differ diff --git a/figs/iff_results_root_locus.png b/figs/iff_results_root_locus.png new file mode 100644 index 0000000..aecd31e Binary files /dev/null and b/figs/iff_results_root_locus.png differ diff --git a/index.html b/index.html index 17c5f2b..40e37ce 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Test Bench APA95ML @@ -27,49 +27,50 @@

Table of Contents

@@ -77,26 +78,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;
@@ -105,8 +106,8 @@
 
-
-

1.2 Filter White Noise

+
+

1.2 Filter White Noise

Glpf = 1/(1 + s/2/pi/500);
@@ -118,13 +119,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;
@@ -133,8 +134,8 @@ Gz = c2d(Glpf, Ts, 'tustin');
 
-
-

2.2 Save Data

+
+

2.2 Save Data

u = data(:, 1); % Input Voltage [V]
@@ -151,16 +152,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

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

3.2 PSD of Measurement Noise

+
+

3.2 PSD of Measurement Noise

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

huddle_test_pdf.png

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

@@ -194,8 +195,8 @@ win = hanning(ceil(1*Fs));
-
-

4 Transfer Function Estimation using the DAC as the driver

+
+

4 Transfer Function Estimation using the DAC as the driver

@@ -205,11 +206,11 @@ Results presented in this sections are wrong as the ADC cannot deliver enought c

-
-

4.1 Time Domain Data

+
+

4.1 Time Domain Data

-
+

apa95ml_5kg_10V_time_domain.png

Figure 5: Time domain signals during the test

@@ -217,8 +218,8 @@ Results presented in this sections are wrong as the ADC cannot deliver enought c
-
-

4.2 Comparison of the PSD with Huddle Test

+
+

4.2 Comparison of the PSD with Huddle Test

Ts = t(end)/(length(t)-1);
@@ -235,7 +236,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

@@ -243,8 +244,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);
@@ -261,14 +262,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

@@ -276,8 +277,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');
@@ -285,7 +286,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

@@ -304,12 +305,12 @@ In the next section, a current amplifier is used.
-
-

5 Transfer Function Estimation using the PI Amplifier

+
+

5 Transfer Function Estimation using the PI Amplifier

-
-

5.1 Load Data

+
+

5.1 Load Data

ht = load('./mat/huddle_test.mat', 't', 'u', 'y');
@@ -329,8 +330,8 @@ ht.y  = ht.y  - mean(ht.y);
 
-
-

5.2 Comparison of the PSD with Huddle Test

+
+

5.2 Comparison of the PSD with Huddle Test

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

apa95ml_5kg_PI_pdf_comp_huddle.png

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

@@ -355,8 +356,8 @@ win = hanning(ceil(1*Fs));
-
-

5.3 Compute TF estimate and Coherence

+
+

5.3 Compute TF estimate and Coherence

Ts = t(end)/(length(t)-1);
@@ -374,14 +375,14 @@ Fs = 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

@@ -389,8 +390,8 @@ Fs = 1/Ts;
-
-

5.4 Comparison with the FEM model

+
+

5.4 Comparison with the FEM model

load('mat/fem_model_5kg.mat', 'G');
@@ -398,7 +399,7 @@ Fs = 1/Ts;
 
-
+

apa95ml_5kg_pi_comp_fem.png

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

@@ -407,8 +408,8 @@ Fs = 1/Ts;
-
-

6 Transfer function from force actuator to force sensor

+
+

6 Transfer function from force actuator to force sensor

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);

-The transfer function from input voltage to output voltage are computed and shown in Figure 14. +The transfer function from input voltage to output voltage are computed and shown in Figure 14.

Ts = a_ss.t(end)/(length(a_ss.t)-1);
@@ -472,15 +473,15 @@ win = hann(ceil(10/Ts));
 
-
+

bode_plot_force_sensor_voltage_comp_fem.png

Figure 14: Comparison of the identified dynamics from voltage output to voltage input and the FEM

-
-

6.1 System Identification

+
+

6.1 System Identification

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);
 
-
+

iff_plant_identification_apa95ml.png

Figure 15: Identification of the IFF plant

@@ -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);
-
-

6.2 Integral Force Feedback

+
+

6.2 Integral Force Feedback

-
+

root_locus_iff_apa95ml_identification.png

Figure 16: Root Locus for IFF

@@ -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);
-
-

7 IFF Tests

+
+

7 IFF Tests

-
-

7.1 Load Data

+
+

7.1 First tests with few gains

iff_g10 = load('./mat/apa95ml_iff_g10_res.mat', 'u', 't', 'y', 'v');
@@ -545,60 +546,84 @@ win = hann(ceil(10/Ts));
 
-
-
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])
-
-
- - -
+

iff_first_test_coherence.png

Figure 17: Coherence

+ +
+

iff_first_test_bode_plot.png +

+

Figure 18: Bode plot for different values of IFF gain

+
+
+
+ +
+

7.2 Second test with many Gains

+
-
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();
+
load('./mat/apa95ml_iff_test.mat', 'results');
+
+
-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; +
+
Ts = 1e-4;
+win = hann(ceil(10/Ts));
+
+
-linkaxes([ax1,ax2], 'x'); -xlim([60, 600]); +
+
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
 
-
-

iff_first_test_bode_plot.png +

+

iff_results_bode_plots.png +

+
+ +
+
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
+
+
+ + +
+

iff_results_bode_plots_identification.png +

+
+ + +
+

iff_results_root_locus.png

-

Figure 18: Bode plot for different values of IFF gain

@@ -606,7 +631,7 @@ xlim([60, 600]);

Author: Dehaeze Thomas

-

Created: 2020-08-20 jeu. 23:08

+

Created: 2020-08-21 ven. 15:26

diff --git a/index.org b/index.org index 9486ad1..cb64c74 100644 --- a/index.org +++ b/index.org @@ -709,7 +709,7 @@ The transfer function from input voltage to output voltage are computed and show <> #+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(ff_end)); + f_id = f(sum(ff_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]]