diff --git a/figs/IMG_20210601_134417.jpg b/figs/IMG_20210601_134417.jpg
new file mode 100644
index 0000000..f1af3be
Binary files /dev/null and b/figs/IMG_20210601_134417.jpg differ
diff --git a/figs/IMG_20210601_134431.jpg b/figs/IMG_20210601_134431.jpg
new file mode 100644
index 0000000..fca947f
Binary files /dev/null and b/figs/IMG_20210601_134431.jpg differ
diff --git a/figs/IMG_20210601_134456.jpg b/figs/IMG_20210601_134456.jpg
new file mode 100644
index 0000000..8c6bfba
Binary files /dev/null and b/figs/IMG_20210601_134456.jpg differ
diff --git a/figs/IMG_20210601_134513.jpg b/figs/IMG_20210601_134513.jpg
new file mode 100644
index 0000000..a5604e9
Binary files /dev/null and b/figs/IMG_20210601_134513.jpg differ
diff --git a/figs/IMG_20210602_162708.jpg b/figs/IMG_20210602_162708.jpg
new file mode 100644
index 0000000..c037b15
Binary files /dev/null and b/figs/IMG_20210602_162708.jpg differ
diff --git a/figs/IMG_20210602_162719.jpg b/figs/IMG_20210602_162719.jpg
new file mode 100644
index 0000000..4a4910d
Binary files /dev/null and b/figs/IMG_20210602_162719.jpg differ
diff --git a/figs/IMG_20210602_162731.jpg b/figs/IMG_20210602_162731.jpg
new file mode 100644
index 0000000..bb9d90f
Binary files /dev/null and b/figs/IMG_20210602_162731.jpg differ
diff --git a/figs/IMG_20210602_165015.jpg b/figs/IMG_20210602_165015.jpg
new file mode 100644
index 0000000..44a9ff5
Binary files /dev/null and b/figs/IMG_20210602_165015.jpg differ
diff --git a/figs/apa300ML.pdf b/figs/apa300ML.pdf
index 7d81395..2e5fbc0 100644
Binary files a/figs/apa300ML.pdf and b/figs/apa300ML.pdf differ
diff --git a/figs/apa300ML.png b/figs/apa300ML.png
index 1c73b61..a8213f5 100644
Binary files a/figs/apa300ML.png and b/figs/apa300ML.png differ
diff --git a/figs/apa_1_coh_dvf.pdf b/figs/apa_1_coh_dvf.pdf
new file mode 100644
index 0000000..eb63aa2
Binary files /dev/null and b/figs/apa_1_coh_dvf.pdf differ
diff --git a/figs/apa_1_coh_dvf.png b/figs/apa_1_coh_dvf.png
new file mode 100644
index 0000000..6032107
Binary files /dev/null and b/figs/apa_1_coh_dvf.png differ
diff --git a/figs/apa_1_coh_iff.pdf b/figs/apa_1_coh_iff.pdf
new file mode 100644
index 0000000..2a08646
Binary files /dev/null and b/figs/apa_1_coh_iff.pdf differ
diff --git a/figs/apa_1_coh_iff.png b/figs/apa_1_coh_iff.png
new file mode 100644
index 0000000..df19aa1
Binary files /dev/null and b/figs/apa_1_coh_iff.png differ
diff --git a/figs/apa_1_frf_dvf.pdf b/figs/apa_1_frf_dvf.pdf
new file mode 100644
index 0000000..daef219
Binary files /dev/null and b/figs/apa_1_frf_dvf.pdf differ
diff --git a/figs/apa_1_frf_dvf.png b/figs/apa_1_frf_dvf.png
new file mode 100644
index 0000000..daf5ee7
Binary files /dev/null and b/figs/apa_1_frf_dvf.png differ
diff --git a/figs/apa_1_frf_iff.pdf b/figs/apa_1_frf_iff.pdf
new file mode 100644
index 0000000..ca268d9
Binary files /dev/null and b/figs/apa_1_frf_iff.pdf differ
diff --git a/figs/apa_1_frf_iff.png b/figs/apa_1_frf_iff.png
new file mode 100644
index 0000000..eb9ffbe
Binary files /dev/null and b/figs/apa_1_frf_iff.png differ
diff --git a/figs/apa_1_meas_stiffness.pdf b/figs/apa_1_meas_stiffness.pdf
new file mode 100644
index 0000000..d585049
Binary files /dev/null and b/figs/apa_1_meas_stiffness.pdf differ
diff --git a/figs/apa_1_meas_stiffness.png b/figs/apa_1_meas_stiffness.png
new file mode 100644
index 0000000..bb38a48
Binary files /dev/null and b/figs/apa_1_meas_stiffness.png differ
diff --git a/figs/apa_bench_exc_sweep.pdf b/figs/apa_bench_exc_sweep.pdf
new file mode 100644
index 0000000..bcbd549
Binary files /dev/null and b/figs/apa_bench_exc_sweep.pdf differ
diff --git a/figs/apa_bench_exc_sweep.png b/figs/apa_bench_exc_sweep.png
new file mode 100644
index 0000000..7c14d6c
Binary files /dev/null and b/figs/apa_bench_exc_sweep.png differ
diff --git a/figs/apa_meas_k_time.pdf b/figs/apa_meas_k_time.pdf
index aaf83cd..335a9f3 100644
Binary files a/figs/apa_meas_k_time.pdf and b/figs/apa_meas_k_time.pdf differ
diff --git a/figs/frf_dvf_plant_tf.pdf b/figs/frf_dvf_plant_tf.pdf
index 089415a..666c11f 100644
Binary files a/figs/frf_dvf_plant_tf.pdf and b/figs/frf_dvf_plant_tf.pdf differ
diff --git a/figs/frf_dvf_plant_tf.png b/figs/frf_dvf_plant_tf.png
index 12044f9..ba48718 100644
Binary files a/figs/frf_dvf_plant_tf.png and b/figs/frf_dvf_plant_tf.png differ
diff --git a/figs/frf_dvf_zoom_res_plant_tf.pdf b/figs/frf_dvf_zoom_res_plant_tf.pdf
new file mode 100644
index 0000000..2dd2d57
Binary files /dev/null and b/figs/frf_dvf_zoom_res_plant_tf.pdf differ
diff --git a/figs/frf_dvf_zoom_res_plant_tf.png b/figs/frf_dvf_zoom_res_plant_tf.png
new file mode 100644
index 0000000..7efce63
Binary files /dev/null and b/figs/frf_dvf_zoom_res_plant_tf.png differ
diff --git a/figs/frf_iff_effect_R.pdf b/figs/frf_iff_effect_R.pdf
index ac5e4bf..09348fb 100644
Binary files a/figs/frf_iff_effect_R.pdf and b/figs/frf_iff_effect_R.pdf differ
diff --git a/figs/frf_iff_effect_R.png b/figs/frf_iff_effect_R.png
index c4585cf..194b7cd 100644
Binary files a/figs/frf_iff_effect_R.png and b/figs/frf_iff_effect_R.png differ
diff --git a/figs/frf_meas_noise_excitation.pdf b/figs/frf_meas_noise_excitation.pdf
index 939bb1f..7b76195 100644
Binary files a/figs/frf_meas_noise_excitation.pdf and b/figs/frf_meas_noise_excitation.pdf differ
diff --git a/figs/frf_meas_noise_excitation.png b/figs/frf_meas_noise_excitation.png
index 838cae4..d8147d1 100644
Binary files a/figs/frf_meas_noise_excitation.png and b/figs/frf_meas_noise_excitation.png differ
diff --git a/figs/frf_meas_noise_hf_exc.pdf b/figs/frf_meas_noise_hf_exc.pdf
new file mode 100644
index 0000000..14a7484
Binary files /dev/null and b/figs/frf_meas_noise_hf_exc.pdf differ
diff --git a/figs/frf_meas_noise_hf_exc.png b/figs/frf_meas_noise_hf_exc.png
new file mode 100644
index 0000000..991393c
Binary files /dev/null and b/figs/frf_meas_noise_hf_exc.png differ
diff --git a/figs/frf_meas_sweep_excitation.pdf b/figs/frf_meas_sweep_excitation.pdf
index 96f9019..0dc0cdf 100644
Binary files a/figs/frf_meas_sweep_excitation.pdf and b/figs/frf_meas_sweep_excitation.pdf differ
diff --git a/figs/frf_meas_sweep_excitation.png b/figs/frf_meas_sweep_excitation.png
index c705a59..a9f6ad9 100644
Binary files a/figs/frf_meas_sweep_excitation.png and b/figs/frf_meas_sweep_excitation.png differ
diff --git a/figs/hyst_exc_signal_time.pdf b/figs/hyst_exc_signal_time.pdf
index 05afd57..50f4c45 100644
Binary files a/figs/hyst_exc_signal_time.pdf and b/figs/hyst_exc_signal_time.pdf differ
diff --git a/figs/hyst_results_multi_ampl.pdf b/figs/hyst_results_multi_ampl.pdf
index 6b76dae..7a80ebc 100644
Binary files a/figs/hyst_results_multi_ampl.pdf and b/figs/hyst_results_multi_ampl.pdf differ
diff --git a/figs/picture_apa_bench.pdf b/figs/picture_apa_bench.pdf
new file mode 100644
index 0000000..c3adf4c
Binary files /dev/null and b/figs/picture_apa_bench.pdf differ
diff --git a/figs/picture_apa_bench.png b/figs/picture_apa_bench.png
new file mode 100644
index 0000000..efe5673
Binary files /dev/null and b/figs/picture_apa_bench.png differ
diff --git a/figs/picture_apa_bench_encoder.pdf b/figs/picture_apa_bench_encoder.pdf
new file mode 100644
index 0000000..a86d03d
Binary files /dev/null and b/figs/picture_apa_bench_encoder.pdf differ
diff --git a/figs/picture_apa_bench_encoder.png b/figs/picture_apa_bench_encoder.png
new file mode 100644
index 0000000..bb639b4
Binary files /dev/null and b/figs/picture_apa_bench_encoder.png differ
diff --git a/figs/picture_apa_bench_front.pdf b/figs/picture_apa_bench_front.pdf
new file mode 100644
index 0000000..88309e1
Binary files /dev/null and b/figs/picture_apa_bench_front.pdf differ
diff --git a/figs/picture_apa_bench_front.png b/figs/picture_apa_bench_front.png
new file mode 100644
index 0000000..60dd02a
Binary files /dev/null and b/figs/picture_apa_bench_front.png differ
diff --git a/figs/picture_apa_bench_side.pdf b/figs/picture_apa_bench_side.pdf
new file mode 100644
index 0000000..764ca5e
Binary files /dev/null and b/figs/picture_apa_bench_side.pdf differ
diff --git a/figs/picture_apa_bench_side.png b/figs/picture_apa_bench_side.png
new file mode 100644
index 0000000..2fc39df
Binary files /dev/null and b/figs/picture_apa_bench_side.png differ
diff --git a/figs/test_bench_apa_alone.pdf b/figs/test_bench_apa_alone.pdf
index dcf57a6..cc7f2fb 100644
Binary files a/figs/test_bench_apa_alone.pdf and b/figs/test_bench_apa_alone.pdf differ
diff --git a/figs/test_bench_apa_alone.png b/figs/test_bench_apa_alone.png
index e2d4b87..15c398b 100644
Binary files a/figs/test_bench_apa_alone.png and b/figs/test_bench_apa_alone.png differ
diff --git a/figs/test_bench_apa_alone.svg b/figs/test_bench_apa_alone.svg
index 7578308..a5a93ef 100644
--- a/figs/test_bench_apa_alone.svg
+++ b/figs/test_bench_apa_alone.svg
@@ -14,7 +14,7 @@
height="285.13144"
viewBox="0 0 449.72563 285.13143"
sodipodi:docname="test_bench_apa_alone.svg"
- inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
+ inkscape:version="1.0.2 (e86c870879, 2021-01-15, custom)"
inkscape:export-filename="/home/thomas/Cloud/thesis/matlab/test-bench-apa/figs/test_bench_apa_schematic_iff.png"
inkscape:export-xdpi="252"
inkscape:export-ydpi="252">
@@ -2789,15 +2789,85 @@
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
id="path1989-7" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
DAC
+ inkscape:label=""
+ transform="translate(-358.26663,139.27034)"
+ id="g2777">
+ id="g6873">
-
-
-
-
-
-
+ style="fill:#000000;fill-opacity:1"
+ id="g6118">
+
+
+
+
+
+
+ id="g4069">
-
-
-
-
-
-
+ style="fill:#000000;fill-opacity:1"
+ id="g4739">
+
+
+
+
@@ -3594,29 +3660,29 @@
inkscape:groupmode="layer">
+ transform="translate(-149.90838,-34.486356)"
+ id="g2793">
+ id="g6996">
+ id="g6162">
+ id="g8963">
@@ -3624,21 +3690,31 @@
+ transform="translate(-149.31989,222.97044)"
+ id="g3633">
+ id="g4091">
+ style="fill:#000000;fill-opacity:1"
+ id="g4732">
+ height="100%" />
+
+
+
@@ -3797,7 +3873,7 @@
sodipodi:nodetypes="cc" />
diff --git a/figs/test_bench_leg_coder.pdf b/figs/test_bench_leg_coder.pdf
new file mode 100644
index 0000000..445353a
Binary files /dev/null and b/figs/test_bench_leg_coder.pdf differ
diff --git a/figs/test_bench_leg_coder.png b/figs/test_bench_leg_coder.png
new file mode 100644
index 0000000..f455fc5
Binary files /dev/null and b/figs/test_bench_leg_coder.png differ
diff --git a/figs/test_bench_leg_front.pdf b/figs/test_bench_leg_front.pdf
new file mode 100644
index 0000000..1a0f8d7
Binary files /dev/null and b/figs/test_bench_leg_front.pdf differ
diff --git a/figs/test_bench_leg_front.png b/figs/test_bench_leg_front.png
new file mode 100644
index 0000000..77ea5e5
Binary files /dev/null and b/figs/test_bench_leg_front.png differ
diff --git a/figs/test_bench_leg_overview.pdf b/figs/test_bench_leg_overview.pdf
new file mode 100644
index 0000000..bb74c86
Binary files /dev/null and b/figs/test_bench_leg_overview.pdf differ
diff --git a/figs/test_bench_leg_overview.png b/figs/test_bench_leg_overview.png
new file mode 100644
index 0000000..430a09d
Binary files /dev/null and b/figs/test_bench_leg_overview.png differ
diff --git a/figs/test_bench_leg_side.pdf b/figs/test_bench_leg_side.pdf
new file mode 100644
index 0000000..4a7ec62
Binary files /dev/null and b/figs/test_bench_leg_side.pdf differ
diff --git a/figs/test_bench_leg_side.png b/figs/test_bench_leg_side.png
new file mode 100644
index 0000000..6c134ef
Binary files /dev/null and b/figs/test_bench_leg_side.png differ
diff --git a/matlab/mat/frf_data_2_sweep_lf.mat b/matlab/mat/frf_data_1_sweep_lf.mat
similarity index 100%
rename from matlab/mat/frf_data_2_sweep_lf.mat
rename to matlab/mat/frf_data_1_sweep_lf.mat
diff --git a/matlab/mat/frf_data_2_sweep_lf_with_R.mat b/matlab/mat/frf_data_1_sweep_lf_with_R.mat
similarity index 100%
rename from matlab/mat/frf_data_2_sweep_lf_with_R.mat
rename to matlab/mat/frf_data_1_sweep_lf_with_R.mat
diff --git a/test-bench-apa300ml.org b/test-bench-apa300ml.org
index 1652ac5..907ae21 100644
--- a/test-bench-apa300ml.org
+++ b/test-bench-apa300ml.org
@@ -106,9 +106,19 @@ The block-diagram model of the piezoelectric actuator is then as shown in Figure
#+RESULTS:
[[file:figs/apa-model-simscape-schematic.png]]
-* Geometrical Measurements
+* First Basic Measurements
+<>
** Introduction :ignore:
+- Section [[sec:geometrical_measurements]]:
+- Section [[sec:electrical_measurements]]:
+- Section [[sec:stroke_measurements]]:
+- Section [[sec:spurious_resonances]]:
+
+** Geometrical Measurements
+<>
+*** Introduction :ignore:
+
The received APA are shown in Figure [[fig:received_apa]].
#+name: fig:received_apa
@@ -116,7 +126,7 @@ The received APA are shown in Figure [[fig:received_apa]].
#+attr_latex: :width 0.6\linewidth
[[file:figs/IMG_20210224_143500.jpg]]
-** Matlab Init :noexport:ignore:
+*** 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
@@ -134,7 +144,7 @@ addpath('./matlab/');
addpath('./mat/');
#+end_src
-** Measurement Setup
+*** Measurement Setup
The flatness corresponding to the two interface planes are measured as shown in Figure [[fig:flatness_meas_setup]].
@@ -143,7 +153,7 @@ The flatness corresponding to the two interface planes are measured as shown in
#+attr_latex: :width 0.6\linewidth
[[file:figs/IMG_20210224_143809.jpg]]
-** Measurement Results
+*** Measurement Results
The height (Z) measurements at the 8 locations (4 points by plane) are defined below.
#+begin_src matlab
@@ -200,7 +210,8 @@ data2orgtable(1e6*apa_d', {'APA 1', 'APA 2', 'APA 3', 'APA 4', 'APA 5', 'APA 6',
| APA 6 | 7.1 |
| APA 7 | 18.7 |
-* Electrical Measurements
+** Electrical Measurements
+<>
#+begin_note
The capacitance of the stacks is measure with the [[https://www.gwinstek.com/en-global/products/detail/LCR-800][LCR-800 Meter]] ([[file:doc/DS_LCR-800_Series_V2_E.pdf][doc]])
@@ -231,8 +242,11 @@ The excitation frequency is set to be 1kHz.
There is clearly a problem with APA300ML number 3
#+end_warning
-* Stroke measurement
-** Introduction :ignore:
+The APA number 3 has ben sent back to Cedrat, and a new APA300ML has been shipped back.
+
+** Stroke measurement
+<>
+*** Introduction :ignore:
We here wish to estimate the stroke of the APA.
@@ -252,7 +266,7 @@ Here are the documentation of the equipment used for this test bench:
#+attr_latex: :width 0.9\linewidth
[[file:figs/CE0EF55E-07B7-461B-8CDB-98590F68D15B.jpeg]]
-** Matlab Init :noexport:ignore:
+*** 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
@@ -270,7 +284,7 @@ addpath('./matlab/');
addpath('./mat/');
#+end_src
-** Voltage applied on one stack
+*** Voltage applied on one stack
Let's first look at the relation between the voltage applied to *one* stack to the displacement of the APA as measured by the displacement probe.
@@ -361,7 +375,7 @@ exportFig('figs/apa_d_vs_V_1s.pdf', 'width', 'wide', 'height', 'tall');
We can clearly see from Figure [[fig:apa_d_vs_V_1s]] that there is a problem with the APA number 3.
#+end_important
-** Voltage applied on two stacks
+*** Voltage applied on two stacks
Now look at the relation between the voltage applied to the *two* other stacks to the displacement of the APA as measured by the displacement probe.
@@ -431,7 +445,7 @@ exportFig('figs/apa_d_vs_V_2s.pdf', 'width', 'wide', 'height', 'tall');
#+RESULTS:
[[file:figs/apa_d_vs_V_2s.png]]
-** Voltage applied on all three stacks
+*** Voltage applied on all three stacks
Finally, we can combine the two measurements to estimate the relation between the displacement and the voltage applied to the *three* stacks (Figure [[fig:apa_d_vs_V_3s]]).
@@ -492,8 +506,35 @@ data2orgtable(1e6*apa300ml_stroke', {'APA 1', 'APA 2', 'APA 3', 'APA 4', 'APA 5'
| APA 6 | 363.9 |
| APA 7 | 358.4 |
-* TODO Stiffness measurement
-** Matlab Init :noexport:ignore:
+** Spurious resonances
+<>
+*** Introduction
+
+Three main resonances are foreseen to be problematic for the control of the APA300ML:
+- Mode in X-bending at 189Hz (Figure [[fig:mode_bending_x]])
+- Mode in Y-bending at 285Hz (Figure [[fig:mode_bending_y]])
+- Mode in Z-torsion at 400Hz (Figure [[fig:mode_torsion_z]])
+
+#+name: fig:mode_bending_x
+#+caption: X-bending mode (189Hz)
+#+attr_latex: :width 0.9\linewidth
+[[file:figs/mode_bending_x.gif]]
+
+#+name: fig:mode_bending_y
+#+caption: Y-bending mode (285Hz)
+#+attr_latex: :width 0.9\linewidth
+[[file:figs/mode_bending_y.gif]]
+
+#+name: fig:mode_torsion_z
+#+caption: Z-torsion mode (400Hz)
+#+attr_latex: :width 0.9\linewidth
+[[file:figs/mode_torsion_z.gif]]
+
+These modes are present when flexible joints are fixed to the ends of the APA300ML.
+
+In this section, we try to find the resonance frequency of these modes when one end of the APA is fixed and the other is free.
+
+*** 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
@@ -503,69 +544,258 @@ data2orgtable(1e6*apa300ml_stroke', {'APA 1', 'APA 2', 'APA 3', 'APA 4', 'APA 5'
#+end_src
#+begin_src matlab :tangle no
-addpath('./matlab/mat/');
-addpath('./matlab/');
+addpath('matlab/');
+addpath('matlab/mat/');
#+end_src
#+begin_src matlab :eval no
-addpath('./mat/');
+addpath('mat/');
#+end_src
-** APA test
+*** Setup
+
+The measurement setup is shown in Figure [[fig:measurement_setup_torsion]].
+A Laser vibrometer is measuring the difference of motion of two points.
+The APA is excited with an instrumented hammer and the transfer function from the hammer to the measured rotation is computed.
+
+#+begin_note
+- Laser Doppler Vibrometer Polytec OFV512
+- Instrumented hammer
+#+end_note
+
+#+name: fig:measurement_setup_torsion
+#+caption: Measurement setup with a Laser Doppler Vibrometer and one instrumental hammer
+#+attr_latex: :width 0.7\linewidth
+[[file:figs/measurement_setup_torsion.jpg]]
+
+*** Bending - X
+
+The setup to measure the X-bending motion is shown in Figure [[fig:measurement_setup_X_bending]].
+The APA is excited with an instrumented hammer having a solid metallic tip.
+The impact point is on the back-side of the APA aligned with the top measurement point.
+
+#+name: fig:measurement_setup_X_bending
+#+caption: X-Bending measurement setup
+#+attr_latex: :width 0.7\linewidth
+[[file:figs/measurement_setup_X_bending.jpg]]
+
+The data is loaded.
#+begin_src matlab
-load('meas_stiff_apa_1_x.mat', 't', 'F', 'd');
+bending_X = load('apa300ml_bending_X_top.mat');
#+end_src
+The config for =tfestimate= is performed:
#+begin_src matlab
-figure;
-plot(t, F)
+Ts = bending_X.Track1_X_Resolution; % Sampling frequency [Hz]
+win = hann(ceil(1/Ts));
#+end_src
+The transfer function from the input force to the output "rotation" (difference between the two measured distances).
#+begin_src matlab
-%% Automatic Zero of the force
-F = F - mean(F(t > 0.1 & t < 0.3));
-
-%% Start measurement at t = 0.2 s
-d = d(t > 0.2);
-F = F(t > 0.2);
-t = t(t > 0.2); t = t - t(1);
+[G_bending_X, f] = tfestimate(bending_X.Track1, bending_X.Track2, win, [], [], 1/Ts);
#+end_src
-#+begin_src matlab
-i_l_start = find(F > 0.3, 1, 'first');
-[~, i_l_stop] = max(F);
-#+end_src
+The result is shown in Figure [[fig:apa300ml_meas_freq_bending_x]].
-#+begin_src matlab
-F_l = F(i_l_start:i_l_stop);
-d_l = d(i_l_start:i_l_stop);
-#+end_src
-
-#+begin_src matlab
-fit_l = polyfit(F_l, d_l, 1);
-
-% %% Reset displacement based on fit
-% d = d - fit_l(2);
-% fit_s(2) = fit_s(2) - fit_l(2);
-% fit_l(2) = 0;
-
-% %% Estimated Stroke
-% F_max = fit_s(2)/(fit_l(1) - fit_s(1));
-% d_max = fit_l(1)*F_max;
-#+end_src
-
-#+begin_src matlab
-h^2/fit_l(1)
-#+end_src
-
-#+begin_src matlab
+The can clearly observe a nice peak at 280Hz, and then peaks at the odd "harmonics" (third "harmonic" at 840Hz, and fifth "harmonic" at 1400Hz).
+#+begin_src matlab :exports none
figure;
hold on;
-plot(F,d,'k')
-plot(F_l, d_l)
-plot(F_l, F_l*fit_l(1) + fit_l(2), '--')
+plot(f, abs(G_bending_X), 'k-');
+hold off;
+set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
+xlabel('Frequency [Hz]'); ylabel('Amplitude');
+xlim([50, 2e3]); ylim([1e-5, 2e-1]);
+text(280, 5.5e-2,{'280Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
+text(840, 2.0e-3,{'840Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
+text(1400, 7.0e-3,{'1400Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
#+end_src
-* Test-Bench Description
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/apa300ml_meas_freq_bending_x.pdf', 'width', 'wide', 'height', 'normal');
+#+end_src
+
+#+name: fig:apa300ml_meas_freq_bending_x
+#+caption: Obtained FRF for the X-bending
+#+RESULTS:
+[[file:figs/apa300ml_meas_freq_bending_x.png]]
+
+*** Bending - Y
+
+The setup to measure the Y-bending is shown in Figure [[fig:measurement_setup_Y_bending]].
+
+The impact point of the instrumented hammer is located on the back surface of the top interface (on the back of the 2 measurements points).
+
+#+name: fig:measurement_setup_Y_bending
+#+caption: Y-Bending measurement setup
+#+attr_latex: :width 0.7\linewidth
+[[file:figs/measurement_setup_Y_bending.jpg]]
+
+The data is loaded, and the transfer function from the force to the measured rotation is computed.
+#+begin_src matlab
+bending_Y = load('apa300ml_bending_Y_top.mat');
+[G_bending_Y, ~] = tfestimate(bending_Y.Track1, bending_Y.Track2, win, [], [], 1/Ts);
+#+end_src
+
+The results are shown in Figure [[fig:apa300ml_meas_freq_bending_y]].
+The main resonance is at 412Hz, and we also see the third "harmonic" at 1220Hz.
+
+#+begin_src matlab :exports none
+figure;
+hold on;
+plot(f, abs(G_bending_Y), 'k-');
+hold off;
+set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
+xlabel('Frequency [Hz]'); ylabel('Amplitude');
+xlim([50, 2e3]); ylim([1e-5, 3e-2])
+text(412, 1.5e-2,{'412Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
+text(1218, 1.5e-2,{'1220Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/apa300ml_meas_freq_bending_y.pdf', 'width', 'wide', 'height', 'normal');
+#+end_src
+
+#+name: fig:apa300ml_meas_freq_bending_y
+#+caption: Obtained FRF for the Y-bending
+#+RESULTS:
+[[file:figs/apa300ml_meas_freq_bending_y.png]]
+
+*** Torsion - Z
+
+Finally, we measure the Z-torsion resonance as shown in Figure [[fig:measurement_setup_torsion_bis]].
+
+The excitation is shown on the other side of the APA, on the side to excite the torsion motion.
+
+#+name: fig:measurement_setup_torsion_bis
+#+caption: Z-Torsion measurement setup
+#+attr_latex: :width 0.7\linewidth
+[[file:figs/measurement_setup_torsion_bis.jpg]]
+
+The data is loaded, and the transfer function computed.
+#+begin_src matlab
+torsion = load('apa300ml_torsion_left.mat');
+[G_torsion, ~] = tfestimate(torsion.Track1, torsion.Track2, win, [], [], 1/Ts);
+#+end_src
+
+The results are shown in Figure [[fig:apa300ml_meas_freq_torsion_z]].
+We observe a first peak at 267Hz, which corresponds to the X-bending mode that was measured at 280Hz.
+And then a second peak at 415Hz, which corresponds to the X-bending mode that was measured at 412Hz.
+The mode in pure torsion is probably at higher frequency (peak around 1kHz?).
+#+begin_src matlab :exports none
+figure;
+hold on;
+plot(f, abs(G_torsion), 'k-');
+hold off;
+set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
+xlabel('Frequency [Hz]'); ylabel('Amplitude');
+xlim([50, 2e3]); ylim([1e-5, 2e-2])
+text(415, 4.3e-3,{'415Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
+text(267, 8e-4,{'267Hz'}, 'VerticalAlignment', 'bottom','HorizontalAlignment','center')
+text(800, 6e-4,{'800Hz'}, 'VerticalAlignment', 'bottom','HorizontalAlignment','center')
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/apa300ml_meas_freq_torsion_z.pdf', 'width', 'wide', 'height', 'normal');
+#+end_src
+
+#+name: fig:apa300ml_meas_freq_torsion_z
+#+caption: Obtained FRF for the Z-torsion
+#+RESULTS:
+[[file:figs/apa300ml_meas_freq_torsion_z.png]]
+
+In order to verify that, the APA is excited on the top part such that the torsion mode should not be excited.
+#+begin_src matlab
+torsion = load('apa300ml_torsion_top.mat');
+[G_torsion_top, ~] = tfestimate(torsion.Track1, torsion.Track2, win, [], [], 1/Ts);
+#+end_src
+
+The two FRF are compared in Figure [[fig:apa300ml_meas_freq_torsion_z_comp]].
+It is clear that the first two modes does not correspond to the torsional mode.
+Maybe the resonance at 800Hz, or even higher resonances. It is difficult to conclude here.
+#+begin_src matlab :exports none
+figure;
+hold on;
+plot(f, abs(G_torsion), 'k-', 'DisplayName', 'Left excitation');
+plot(f, abs(G_torsion_top), '-', 'DisplayName', 'Top excitation');
+hold off;
+set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
+xlabel('Frequency [Hz]'); ylabel('Amplitude');
+xlim([50, 2e3]); ylim([1e-5, 2e-2])
+text(415, 4.3e-3,{'415Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
+text(267, 8e-4,{'267Hz'}, 'VerticalAlignment', 'bottom','HorizontalAlignment','center')
+text(800, 2e-3,{'800Hz'}, 'VerticalAlignment', 'bottom','HorizontalAlignment','center')
+legend('location', 'northwest');
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/apa300ml_meas_freq_torsion_z_comp.pdf', 'width', 'wide', 'height', 'normal');
+#+end_src
+
+#+name: fig:apa300ml_meas_freq_torsion_z_comp
+#+caption: Obtained FRF for the Z-torsion
+#+RESULTS:
+[[file:figs/apa300ml_meas_freq_torsion_z_comp.png]]
+
+*** Compare
+The three measurements are shown in Figure [[fig:apa300ml_meas_freq_compare]].
+#+begin_src matlab :exports none
+figure;
+hold on;
+plot(f, abs(G_torsion), 'DisplayName', 'Torsion');
+plot(f, abs(G_bending_X), 'DisplayName', 'Bending - X');
+plot(f, abs(G_bending_Y), 'DisplayName', 'Bending - Y');
+hold off;
+set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
+xlabel('Frequency [Hz]'); ylabel('Amplitude');
+xlim([50, 2e3]); ylim([1e-5, 1e-1]);
+legend('location', 'southeast');
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/apa300ml_meas_freq_compare.pdf', 'width', 'full', 'height', 'tall');
+#+end_src
+
+#+name: fig:apa300ml_meas_freq_compare
+#+caption: Obtained FRF - Comparison
+#+RESULTS:
+[[file:figs/apa300ml_meas_freq_compare.png]]
+
+*** Conclusion
+
+When two flexible joints are fixed at each ends of the APA, the APA is mostly in a free/free condition in terms of bending/torsion (the bending/torsional stiffness of the joints being very small).
+
+In the current tests, the APA are in a fixed/free condition.
+Therefore, it is quite obvious that we measured higher resonance frequencies than what is foreseen for the struts.
+It is however quite interesting that there is a factor $\approx \sqrt{2}$ between the two (increased of the stiffness by a factor 2?).
+
+#+name: tab:apa300ml_measured_modes_freq
+#+caption: Measured frequency of the modes
+#+attr_latex: :environment tabularx :width 0.6\linewidth :align ccc
+#+attr_latex: :center t :booktabs t :float t
+| Mode | Strut Mode | Measured Frequency |
+|-----------+------------+--------------------|
+| X-Bending | 189Hz | 280Hz |
+| Y-Bending | 285Hz | 410Hz |
+| Z-Torsion | 400Hz | ? |
+
+* Dynamical measurements - APA
+<>
+** Introduction :ignore:
+
+In this section, a measurement test bench is used to identify the dynamics of the APA.
+
+The bench is shown in Figure [[fig:picture_apa_bench]], and a zoom picture on the APA and encoder is shown in Figure [[fig:picture_apa_bench_encoder]].
+
+#+name: fig:picture_apa_bench
+#+caption: Picture of the test bench
+#+attr_latex: :width 0.5\linewidth
+[[file:figs/picture_apa_bench.png]]
+
+#+name: fig:picture_apa_bench_encoder
+#+caption: Zoom on the APA with the encoder
+#+attr_latex: :width 0.5\linewidth
+[[file:figs/picture_apa_bench_encoder.png]]
#+begin_note
Here are the documentation of the equipment used for this test bench:
@@ -576,123 +806,18 @@ Here are the documentation of the equipment used for this test bench:
- Interferometer: [[https://www.attocube.com/en/products/laser-displacement-sensor/displacement-measuring-interferometer][Attocube IDS3010]]
#+end_note
+The bench is schematically shown in Figure [[fig:test_bench_apa_alone]] and the signal used are summarized in Table [[tab:test_bench_apa_variables]].
+
#+name: fig:test_bench_apa_alone
#+caption: Schematic of the Test Bench
+#+attr_latex: :width 0.8\linewidth
[[file:figs/test_bench_apa_alone.png]]
-* Measurement Procedure
-<>
-** Introduction :ignore:
-
-** Stroke Measurement
-
-Using the PD200 amplifier, output a voltage:
-\[ V_a = 65 + 85 \sin(2\pi \cdot t) \]
-To have a quasi-static excitation between -20 and 150V.
-
-As the gain of the PD200 amplifier is 20, the DAC output voltage should be:
-\[ V_{dac}(t) = 3.25 + 4.25\sin(2\pi \cdot t) \]
-
-Verify that the voltage offset of the PD200 is zero!
-
-Measure the output vertical displacement $d$ using the interferometer.
-
-Then, plot $d$ as a function of $V_a$, and perform a linear regression.
-Conclude on the obtained stroke.
-
-** Stiffness Measurement
-
-Add some (known) weight $\delta m g$ on the suspended mass and measure the deflection $\delta d$.
-This can be tested when the piezoelectric stacks are open-circuit.
-
-As the stiffness will be around $k \approx 10^6 N/m$, an added mass of $m \approx 100g$ will induce a static deflection of $\approx 1\mu m$ which should be large enough for a precise measurement using the interferometer.
-
-Then the obtained stiffness is:
-\begin{equation}
- k = \frac{\delta m g}{\delta d}
-\end{equation}
-
-** Hysteresis measurement
-
-Supply a quasi static sinusoidal excitation $V_a$ at different voltages.
-
-The offset should be 65V, and the sin amplitude can range from 1V up to 85V.
-
-For each excitation amplitude, the vertical displacement $d$ of the mass is measured.
-
-Then, $d$ is plotted as a function of $V_a$ for all the amplitudes.
-
-#+name: fig:expected_hysteresis
-#+caption: Expected Hysteresis cite:poel10_explor_activ_hard_mount_vibrat
-#+attr_latex: :width 0.8\linewidth
-[[file:figs/expected_hysteresis.png]]
-
-** Piezoelectric Actuator Constant
-
-Using the measurement test-bench, it is rather easy the determine the static gain between the applied voltage $V_a$ to the induced displacement $d$.
-Use a quasi static (1Hz) excitation signal $V_a$ on the piezoelectric stack and measure the vertical displacement $d$.
-Perform a linear regression to obtain:
-\begin{equation}
- d = g_{d/V_a} \cdot V_a
-\end{equation}
-
-Using the Simscape model of the APA, it is possible to determine the static gain between the actuator force $F_a$ to the induced displacement $d$:
-\begin{equation}
- d = g_{d/F_a} \cdot F_a
-\end{equation}
-
-From the two gains, it is then easy to determine $g_a$:
-\begin{equation}
- g_a = \frac{F_a}{V_a} = \frac{F_a}{d} \cdot \frac{d}{V_a} = \frac{g_{d/V_a}}{g_{d/F_a}}
-\end{equation}
-
-** Piezoelectric Sensor Constant
-
-From a quasi static excitation of the piezoelectric stack, measure the gain from $V_a$ to $V_s$:
-\begin{equation}
- V_s = g_{V_s/V_a} V_a
-\end{equation}
-
-Note here that there is an high pass filter formed by the piezo capacitor and parallel resistor.
-The excitation frequency should then be in between the cut-off frequency of this high pass filter and the first resonance.
-
-Alternatively, the gain can be computed from the dynamical identification and taking the gain at the wanted frequency.
-
-Using the simscape model, compute the static gain from the actuator force $F_a$ to the strain of the sensor stack $dl$:
-\begin{equation}
- dl = g_{dl/F_a} F_a
-\end{equation}
-
-Then, the static gain from the sensor stack strain $dl$ to the general voltage $V_s$ is:
-\begin{equation}
- g_s = \frac{V_s}{dl} = \frac{V_s}{V_a} \cdot \frac{V_a}{F_a} \cdot \frac{F_a}{dl} = \frac{g_{V_s/V_a}}{g_a \cdot g_{dl/F_a}}
-\end{equation}
-
-Alternatively, we could impose an external force to add strain in the APA that should be equally present in all the 3 stacks and equal to 1/5 of the vertical strain.
-This external force can be some weight added, or a piezo in parallel.
-
-** Capacitance Measurement
-
-Measure the capacitance of the 3 stacks individually using a precise multi-meter.
-
-** Dynamical Behavior
-
-Perform a system identification from $V_a$ to the measured displacement $d$ by the interferometer and by the encoder, and to the generated voltage $V_s$.
-
-This can be performed using different excitation signals.
-
-This can also be performed with and without the encoder fixed to the APA.
-
-** Compare the results obtained for all 7 APA300ML
-
-Compare all the obtained parameters for all the test APA.
-
-* FRF measurement
-** Introduction :ignore:
-
-- [ ] Schematic of the measurement
-
-| Variable | | Unit | Hardware |
+#+name: tab:test_bench_apa_variables
+#+caption: Variables used during the measurements
+#+attr_latex: :environment tabularx :width 0.8\linewidth :align lXXX
+#+attr_latex: :center t :booktabs t :float t
+| Variable | Description | Unit | Hardware |
|----------+------------------------------+------+-------------------------------|
| =Va= | Output DAC voltage | [V] | DAC - Ch. 1 => PD200 => APA |
| =Vs= | Measured stack voltage (ADC) | [V] | APA => ADC - Ch. 1 |
@@ -700,7 +825,15 @@ Compare all the obtained parameters for all the test APA.
| =da= | Attocube Measurement | [m] | PEPU Ch. 2 - IO318(1) - Ch. 2 |
| =t= | Time | [s] | |
-** Matlab Init :noexport:ignore:
+This section is structured as follows:
+- Section [[sec:meas_apa_speedgoat_setup]]: the Speedgoat setup is described (excitation signals, saved signals, etc.)
+- Section [[sec:meas_one_apa]]: the measurements are first performed on one APA.
+- Section [[sec:meas_all_apa]]: the same measurements are performed on all the APA and are compared.
+
+** Speedgoat Setup
+<>
+*** Introduction :ignore:
+*** 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
@@ -718,7 +851,7 @@ addpath('./matlab/');
addpath('./src/');
#+end_src
-** =frf_setup.m= - Measurement Setup
+*** =frf_setup.m= - Measurement Setup
:PROPERTIES:
:header-args:matlab: :tangle matlab/frf_setup.m
:header-args:matlab+: :comments no
@@ -752,53 +885,6 @@ Trec_dur = 100; % Recording Duration [s]
Tsim = 2*Trec_start + Trec_dur; % Simulation Time [s]
#+end_src
-The maximum excitation voltage at resonance is 9Vrms, therefore corresponding to 0.6V of output DAC voltage.
-#+begin_src matlab
-%% Sweep Sine
-gc = 0.1;
-xi = 0.5;
-wn = 2*pi*94.3;
-
-% Notch filter at the resonance of the APA
-G_sweep = 0.2*(s^2 + 2*gc*xi*wn*s + wn^2)/(s^2 + 2*xi*wn*s + wn^2);
-
-V_sweep = generateSweepExc('Ts', Ts, ...
- 'f_start', 10, ...
- 'f_end', 1e3, ...
- 'V_mean', 3.25, ...
- 't_start', Trec_start, ...
- 'exc_duration', Trec_dur, ...
- 'sweep_type', 'log', ...
- 'V_exc', G_sweep*1/(1 + s/2/pi/500));
-#+end_src
-
-#+begin_src matlab :exports none :tangle no
-figure;
-tiledlayout(1, 2, 'TileSpacing', 'Normal', 'Padding', 'None');
-
-ax1 = nexttile;
-plot(V_sweep(1,:), V_sweep(2,:));
-xlabel('Time [s]'); ylabel('Amplitude [V]');
-
-ax2 = nexttile;
-win = hanning(floor(length(V_sweep(2,:))/80));
-[pxx, f] = pwelch(V_sweep(2,:), win, 0, [], Fs);
-plot(f, pxx)
-xlabel('Frequency [Hz]'); ylabel('Power Spectral Density [$V^2/Hz$]');
-set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
-xlim([1, Fs/2]); ylim([1e-10, 1e0]);
-#+end_src
-
-#+begin_src matlab :tangle no :exports results :results file replace
-exportFig('figs/frf_meas_sweep_excitation.pdf', 'width', 'full', 'height', 'normal');
-#+end_src
-
-#+name: fig:frf_meas_sweep_excitation
-#+caption: Example of Sweep Sin excitation signal
-#+RESULTS:
-[[file:figs/frf_meas_sweep_excitation.png]]
-
-
A white noise excitation signal can be very useful in order to obtain a first idea of the plant FRF.
The gain can be gradually increased until satisfactory output is obtained.
#+begin_src matlab
@@ -837,15 +923,104 @@ exportFig('figs/frf_meas_noise_excitation.pdf', 'width', 'full', 'height', 'norm
#+RESULTS:
[[file:figs/frf_meas_noise_excitation.png]]
+The maximum excitation voltage at resonance is 9Vrms, therefore corresponding to 0.6V of output DAC voltage.
+#+begin_src matlab
+%% Sweep Sine
+gc = 0.1;
+xi = 0.5;
+wn = 2*pi*94.3;
+
+% Notch filter at the resonance of the APA
+G_sweep = 0.2*(s^2 + 2*gc*xi*wn*s + wn^2)/(s^2 + 2*xi*wn*s + wn^2);
+
+V_sweep = generateSweepExc('Ts', Ts, ...
+ 'f_start', 10, ...
+ 'f_end', 400, ...
+ 'V_mean', 3.25, ...
+ 't_start', Trec_start, ...
+ 'exc_duration', Trec_dur, ...
+ 'sweep_type', 'log', ...
+ 'V_exc', G_sweep*1/(1 + s/2/pi/500));
+#+end_src
+
+#+begin_src matlab :exports none :tangle no
+figure;
+tiledlayout(1, 2, 'TileSpacing', 'Normal', 'Padding', 'None');
+
+ax1 = nexttile;
+plot(V_sweep(1,:), V_sweep(2,:));
+xlabel('Time [s]'); ylabel('Amplitude [V]');
+
+ax2 = nexttile;
+win = hanning(floor(length(V_sweep(2,:))/80));
+[pxx, f] = pwelch(V_sweep(2,:), win, 0, [], Fs);
+plot(f, pxx)
+xlabel('Frequency [Hz]'); ylabel('Power Spectral Density [$V^2/Hz$]');
+set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
+xlim([1, Fs/2]); ylim([1e-10, 1e0]);
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/frf_meas_sweep_excitation.pdf', 'width', 'full', 'height', 'normal');
+#+end_src
+
+#+name: fig:frf_meas_sweep_excitation
+#+caption: Example of Sweep Sin excitation signal
+#+RESULTS:
+[[file:figs/frf_meas_sweep_excitation.png]]
+
+In order to better estimate the high frequency dynamics, a band-limited noise can be used (Figure [[fig:frf_meas_noise_hf_exc]]).
+The frequency content of the noise can be precisely controlled.
+#+begin_src matlab
+%% High Frequency Shaped Noise
+[b,a] = cheby1(10, 2, 2*pi*[300 2e3], 'bandpass', 's');
+wL = 0.005*tf(b, a);
+
+V_noise_hf = generateShapedNoise('Ts', 1/Fs, ...
+ 'V_mean', 3.25, ...
+ 't_start', Trec_start, ...
+ 'exc_duration', Trec_dur, ...
+ 'smooth_ends', true, ...
+ 'V_exc', wL);
+#+end_src
+
+#+begin_src matlab :exports none :tangle no
+figure;
+tiledlayout(1, 2, 'TileSpacing', 'Normal', 'Padding', 'None');
+
+ax1 = nexttile;
+plot(V_noise_hf(1,:), V_noise_hf(2,:));
+xlabel('Time [s]'); ylabel('Amplitude [V]');
+
+ax2 = nexttile;
+win = hanning(floor(length(V_noise_hf(2,:))/80));
+[pxx, f] = pwelch(V_noise_hf(2,:), win, 0, [], Fs);
+plot(f, pxx)
+xlabel('Frequency [Hz]'); ylabel('Power Spectral Density [$V^2/Hz$]');
+set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
+xlim([1, Fs/2]); ylim([1e-10, 1e0]);
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/frf_meas_noise_hf_exc.pdf', 'width', 'wide', 'height', 'normal');
+#+end_src
+
+#+name: fig:frf_meas_noise_hf_exc
+#+caption: Example of band-limited noise excitation signal
+#+RESULTS:
+[[file:figs/frf_meas_noise_hf_exc.png]]
+
+
+Then a sinus excitation can be used to estimate the hysteresis.
#+begin_src matlab
%% Sinus excitation with increasing amplitude
V_sin = generateSinIncreasingAmpl('Ts', 1/Fs, ...
- 'V_mean', 3.25, ...
- 'sin_ampls', [0.1, 0.2, 0.4, 1, 2, 4], ...
- 'sin_period', 1, ...
- 'sin_num', 5, ...
- 't_start', 10, ...
- 'smooth_ends', true);
+ 'V_mean', 3.25, ...
+ 'sin_ampls', [0.1, 0.2, 0.4, 1, 2, 4], ...
+ 'sin_period', 1, ...
+ 'sin_num', 5, ...
+ 't_start', Trec_start, ...
+ 'smooth_ends', true);
#+end_src
#+begin_src matlab :exports none :tangle no
@@ -870,6 +1045,7 @@ V_exc = timeseries(V_noise(2,:), V_noise(1,:));
#+end_src
#+begin_src matlab :exports none :eval no
+%% Plot
figure;
tiledlayout(1, 2, 'TileSpacing', 'Normal', 'Padding', 'None');
@@ -891,7 +1067,7 @@ xlim([1, Fs/2]); ylim([1e-10, 1e0]);
save('./frf_data.mat', 'Fs', 'Ts', 'Tsim', 'Trec_start', 'Trec_dur', 'V_exc');
#+end_src
-** =frf_save.m= - Save Data
+*** =frf_save.m= - Save Data
:PROPERTIES:
:header-args: :tangle matlab/frf_save.m
:header-args:matlab+: :comments no
@@ -925,8 +1101,10 @@ save(sprintf('mat/frf_data_%i_huddle.mat', apa_number), 't', 'Va', 'Vs', 'de', '
#+end_src
** Measurements on APA 1
+<>
*** Introduction :ignore:
-Measurements are first performed on the APA number 1.
+Measurements are first performed on only *one* APA.
+Once the measurement procedure is validated, it is performed on all the other APA.
*** Matlab Init :noexport:ignore:
#+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name)
@@ -937,6 +1115,10 @@ Measurements are first performed on the APA number 1.
<>
#+end_src
+#+begin_src matlab
+colors = get(gca,'colororder');
+#+end_src
+
#+begin_src matlab :tangle no
addpath('./matlab/mat/');
addpath('./matlab/src/');
@@ -948,150 +1130,115 @@ addpath('./mat/');
addpath('./src/');
#+end_src
-*** Huddle Test
+*** Excitation Signal
+For this first measurement, a basic logarithmic sweep is used between 10Hz and 2kHz.
+
+The data are loaded.
#+begin_src matlab
-load(sprintf('frf_data_%i_huddle.mat', 1), 't', 'Va', 'Vs', 'de', 'da');
+apa_sweep = load(sprintf('mat/frf_data_%i_sweep.mat', 1), 't', 'Va', 'Vs', 'da', 'de');
+#+end_src
+
+The initial time is set to zero.
+#+begin_src matlab
+%% Time vector
+t = apa_sweep.t - apa_sweep.t(1) ; % Time vector [s]
+#+end_src
+
+The excitation signal is shown in Figure [[fig:apa_bench_exc_sweep]].
+It is a sweep sine from 10Hz up to 2kHz filtered with a notch centered with the main resonance of the system and a low pass filter.
+#+begin_src matlab :exports none
+figure;
+plot(t, apa_sweep.Va)
+xlabel('Time [s]'); ylabel('Excitation Voltage $V_a$ [V]');
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/apa_bench_exc_sweep.pdf', 'width', 'wide', 'height', 'normal');
+#+end_src
+
+#+name: fig:apa_bench_exc_sweep
+#+caption: Excitation voltage
+#+RESULTS:
+[[file:figs/apa_bench_exc_sweep.png]]
+
+*** FRF Identification - Setup
+Let's define the sampling time/frequency.
+#+begin_src matlab
+%% Sampling
+Ts = (t(end) - t(1))/(length(t)-1); % Sampling Time [s]
+Fs = 1/Ts; % Sampling Frequency [Hz]
+#+end_src
+
+Then we defined a "Hanning" windows that will be used for the spectral analysis:
+#+begin_src matlab
+win = hanning(ceil(1*Fs)); % Hannning Windows
+#+end_src
+
+We get the frequency vector that will be the same for all the frequency domain analysis.
+#+begin_src matlab
+% Only used to have the frequency vector "f"
+[~, f] = tfestimate(apa_sweep.Va, apa_sweep.de, win, [], [], 1/Ts);
+#+end_src
+
+*** FRF Identification - Displacement
+In this section, the transfer function from the excitation voltage $V_a$ to the encoder measured displacement $d_e$ and interferometer measurement $d_a$.
+
+The coherence from $V_a$ to $d_e$ is computed and shown in Figure [[fig:apa_1_coh_dvf]].
+It is quite good from 10Hz up to 500Hz.
+#+begin_src matlab
+%% TF - Encoder
+[coh_sweep, ~] = mscohere(apa_sweep.Va, apa_sweep.de, win, [], [], 1/Ts);
#+end_src
#+begin_src matlab :exports none
figure;
-tiledlayout(1, 2, 'TileSpacing', 'None', 'Padding', 'None');
-
-ax1 = nexttile;
hold on;
-plot(t, da, 'DisplayName', '$d_a$ - Attocube')
-plot(t, de, 'DisplayName', '$d_e$ - Encoder')
-hold off;
-xlabel('Time [s]');
-ylabel('Displacement [m]');
-legend('location', 'northeast')
-
-ax2 = nexttile;
-hold on;
-plot(t, Vs, 'DisplayName', '$V_s$ - Force Sensor')
-hold off;
-xlabel('Time [s]');
-ylabel('Voltage [V]');
-legend('location', 'northeast')
-#+end_src
-
-#+begin_src matlab
-%% Parameter for Spectral analysis
-Ts = (t(end) - t(1))/(length(t)-1);
-Fs = 1/Ts;
-
-win = hanning(ceil(10*Fs)); % Hannning Windows
-#+end_src
-
-#+begin_src matlab
-[phh_da, f] = pwelch(da - mean(da), win, [], [], 1/Ts);
-[phh_de, ~] = pwelch(de - mean(de), win, [], [], 1/Ts);
-[phh_Vs, ~] = pwelch(Vs - mean(Vs), win, [], [], 1/Ts);
-#+end_src
-
-#+begin_src matlab :exports none
-figure;
-tiledlayout(1, 2, 'TileSpacing', 'None', 'Padding', 'None');
-
-ax1 = nexttile;
-hold on;
-plot(f, phh_da, 'DisplayName', '$d_a$ - Attocube')
-plot(f, phh_de, 'DisplayName', '$d_e$ - Encoder')
-hold off;
-xlabel('Time [s]'); ylabel('ASD [$m/\sqrt{Hz}$]');
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-legend('location', 'northeast')
-xlim([5e-1, 5e3]);
-
-ax2 = nexttile;
-hold on;
-plot(f, phh_Vs, 'DisplayName', '$V_s$ - Force Sensor')
-hold off;
-xlabel('Time [s]'); ylabel('ASD [$V/\sqrt{Hz}$]');
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-legend('location', 'northeast')
-xlim([5e-1, 5e3]);
-#+end_src
-
-*** First identification with Noise
-#+begin_src matlab
-load(sprintf('mat/frf_data_%i_noise.mat', 1), 't', 'Va', 'Vs', 'da', 'de')
-#+end_src
-
-#+begin_src matlab
-[pxx_da, f] = pwelch(da, win, [], [], 1/Ts);
-[pxx_de, ~] = pwelch(de, win, [], [], 1/Ts);
-[pxx_Vs, ~] = pwelch(Vs, win, [], [], 1/Ts);
-#+end_src
-
-#+begin_src matlab :exports none
-figure;
-tiledlayout(1, 2, 'TileSpacing', 'None', 'Padding', 'None');
-
-ax1 = nexttile;
-hold on;
-plot(f, sqrt(phh_da), 'DisplayName', 'Huddle')
-plot(f, sqrt(pxx_da), 'DisplayName', 'Noise')
-hold off;
-xlabel('Time [s]'); ylabel('ASD Attocube [$m/\sqrt{Hz}$]');
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-legend('location', 'northeast')
-
-ax2 = nexttile;
-hold on;
-plot(f, sqrt(phh_Vs), 'DisplayName', 'Huddle')
-plot(f, sqrt(pxx_Vs), 'DisplayName', 'Noise')
-hold off;
-xlabel('Time [s]'); ylabel('ASD [$V/\sqrt{Hz}$]');
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-legend('location', 'northeast')
-
-linkaxes([ax1,ax2],'x');
-xlim([5e-1, 5e3]);
-#+end_src
-
-#+begin_src matlab
-[G_dvf, f] = tfestimate(Va, de, win, [], [], 1/Ts);
-[G_d, ~] = tfestimate(Va, da, win, [], [], 1/Ts);
-[G_iff, ~] = tfestimate(Va, Vs, win, [], [], 1/Ts);
-
-[coh_dvf, ~] = mscohere(Va, de, win, [], [], 1/Ts);
-[coh_d, ~] = mscohere(Va, da, win, [], [], 1/Ts);
-[coh_iff, ~] = mscohere(Va, Vs, win, [], [], 1/Ts);
-#+end_src
-
-#+begin_src matlab :exports none
-%%
-figure;
-hold on;
-plot(f, coh_dvf);
-plot(f, coh_d);
-plot(f, coh_iff);
+plot(f, coh_sweep, 'k-');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
-xlim([1, 5e3]); ylim([0, 1]);
+xlabel('Frequency [Hz]'); ylabel('Coherence [-]');
+xlim([5, 5e3]); ylim([0, 1]);
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/apa_1_coh_dvf.pdf', 'width', 'normal', 'height', 'normal');
+#+end_src
+
+#+name: fig:apa_1_coh_dvf
+#+caption: Coherence for the identification from $V_a$ to $d_e$
+#+RESULTS:
+[[file:figs/apa_1_coh_dvf.png]]
+
+The transfer functions are then estimated and shown in Figure [[fig:apa_1_frf_dvf]].
+#+begin_src matlab
+%% TF - Encoder
+[dvf_sweep, ~] = tfestimate(apa_sweep.Va, apa_sweep.de, win, [], [], 1/Ts);
+
+%% TF - Interferometer
+[int_sweep, ~] = tfestimate(apa_sweep.Va, apa_sweep.da, win, [], [], 1/Ts);
#+end_src
#+begin_src matlab :exports none
-%%
figure;
-tiledlayout(2, 1, 'TileSpacing', 'None', 'Padding', 'None');
+tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None');
-ax1 = nexttile;
+ax1 = nexttile([2,1]);
hold on;
-plot(f, abs(G_d), 'DisplayName', 'Attocube');
-plot(f, abs(G_dvf), 'DisplayName', 'Encoder');
+plot(f, abs(dvf_sweep), 'color', colors(1, :), ...
+ 'DisplayName', 'Encoder');
+plot(f, abs(int_sweep), 'color', colors(2, :), ...
+ 'DisplayName', 'Interferometer');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude $d/V_a$ [m/V]'); set(gca, 'XTickLabel',[]);
hold off;
-ylim([1e-8, 1e-3]);
legend('location', 'northeast');
+ylim([1e-9, 1e-3]);
ax2 = nexttile;
hold on;
-plot(f, 180/pi*angle(G_d));
-plot(f, 180/pi*angle(G_dvf));
+plot(f, 180/pi*angle(dvf_sweep), 'color', colors(1, :));
+plot(f, 180/pi*angle(int_sweep), 'color', colors(2, :));
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
@@ -1099,130 +1246,68 @@ hold off;
yticks(-360:90:360);
linkaxes([ax1,ax2],'x');
-xlim([5e-1, 5e3]);
+xlim([10, 2e3]);
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/apa_1_frf_dvf.pdf', 'width', 'wide', 'height', 'tall');
+#+end_src
+
+#+name: fig:apa_1_frf_dvf
+#+caption: Obtained transfer functions from $V_a$ to both $d_e$ and $d_a$
+#+RESULTS:
+[[file:figs/apa_1_frf_dvf.png]]
+
+*** FRF Identification - Force Sensor
+Now the dynamics from excitation voltage $V_a$ to the force sensor stack voltage $V_s$ is identified.
+
+The coherence is computed and shown in Figure [[fig:apa_1_coh_iff]] and found very good from 10Hz up to 2kHz.
+#+begin_src matlab
+%% TF - Encoder
+[coh_sweep, ~] = mscohere(apa_sweep.Va, apa_sweep.Vs, win, [], [], 1/Ts);
#+end_src
#+begin_src matlab :exports none
-%%
figure;
-tiledlayout(2, 1, 'TileSpacing', 'None', 'Padding', 'None');
+hold on;
+plot(f, coh_sweep, 'k-');
+hold off;
+set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
+xlabel('Frequency [Hz]'); ylabel('Coherence [-]');
+xlim([5, 5e3]); ylim([0, 1]);
+#+end_src
-ax1 = nexttile;
-plot(f, abs(G_iff));
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/apa_1_coh_iff.pdf', 'width', 'normal', 'height', 'normal');
+#+end_src
+
+#+name: fig:apa_1_coh_iff
+#+caption: Coherence for the identification from $V_a$ to $V_s$
+#+RESULTS:
+[[file:figs/apa_1_coh_iff.png]]
+
+The transfer function is estimated and shown in Figure [[fig:apa_1_frf_iff]].
+#+begin_src matlab
+%% Transfer function estimation
+[iff_sweep, ~] = tfestimate(apa_sweep.Va, apa_sweep.Vs, win, [], [], 1/Ts);
+#+end_src
+
+#+begin_src matlab :exports none
+figure;
+tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None');
+
+ax1 = nexttile([2,1]);
+hold on;
+plot(f, abs(iff_sweep), 'k-');
+hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude $V_s/V_a$ [V/V]'); set(gca, 'XTickLabel',[]);
hold off;
-
-ax2 = nexttile;
-plot(f, 180/pi*angle(G_iff));
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
-xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
-hold off;
-yticks(-360:90:360);
-
-linkaxes([ax1,ax2],'x');
-xlim([1, 2e3]);
-#+end_src
-
-*** Second identification with Sweep and high frequency noise
-#+begin_src matlab
-load(sprintf('mat/frf_data_%i_sweep.mat', 1), 't', 'Va', 'Vs', 'da', 'de')
-#+end_src
-
-#+begin_src matlab
-[pxx_da, f] = pwelch(da, win, [], [], 1/Ts);
-[pxx_de, ~] = pwelch(de, win, [], [], 1/Ts);
-[pxx_Vs, ~] = pwelch(Vs, win, [], [], 1/Ts);
-#+end_src
-
-#+begin_src matlab :exports none
-figure;
-tiledlayout(1, 2, 'TileSpacing', 'None', 'Padding', 'None');
-
-ax1 = nexttile;
-hold on;
-plot(f, sqrt(phh_da), 'DisplayName', 'Huddle')
-plot(f, sqrt(pxx_da), 'DisplayName', 'Noise')
-hold off;
-xlabel('Time [s]'); ylabel('ASD Attocube [$m/\sqrt{Hz}$]');
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-legend('location', 'northeast')
+ylim([1e-2, 1e2]);
ax2 = nexttile;
hold on;
-plot(f, sqrt(phh_Vs), 'DisplayName', 'Huddle')
-plot(f, sqrt(pxx_Vs), 'DisplayName', 'Noise')
-hold off;
-xlabel('Time [s]'); ylabel('ASD [$V/\sqrt{Hz}$]');
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-legend('location', 'northeast')
-
-linkaxes([ax1,ax2],'x');
-xlim([1e1, 2e3]);
-#+end_src
-
-#+begin_src matlab
-[G_dvf, f] = tfestimate(Va, de, win, [], [], 1/Ts);
-[G_d, ~] = tfestimate(Va, da, win, [], [], 1/Ts);
-[G_iff, ~] = tfestimate(Va, Vs, win, [], [], 1/Ts);
-
-[coh_dvf, ~] = mscohere(Va, de, win, [], [], 1/Ts);
-[coh_d, ~] = mscohere(Va, da, win, [], [], 1/Ts);
-[coh_iff, ~] = mscohere(Va, Vs, win, [], [], 1/Ts);
-#+end_src
-
-#+begin_src matlab
-load(sprintf('mat/frf_data_%i_noise_high_freq.mat', 1), 't', 'Va', 'Vs', 'da', 'de')
-#+end_src
-
-#+begin_src matlab
-[phf_da, f] = pwelch(da, win, [], [], 1/Ts);
-[phf_de, ~] = pwelch(de, win, [], [], 1/Ts);
-[phf_Vs, ~] = pwelch(Vs, win, [], [], 1/Ts);
-#+end_src
-
-#+begin_src matlab
-[cohhf_dvf, ~] = mscohere(Va, de, win, [], [], 1/Ts);
-[cohhf_d, ~] = mscohere(Va, da, win, [], [], 1/Ts);
-[cohhf_iff, ~] = mscohere(Va, Vs, win, [], [], 1/Ts);
-
-[Ghf_dvf, f] = tfestimate(Va, de, win, [], [], 1/Ts);
-[Ghf_d, ~] = tfestimate(Va, da, win, [], [], 1/Ts);
-[Ghf_iff, ~] = tfestimate(Va, Vs, win, [], [], 1/Ts);
-#+end_src
-
-#+begin_src matlab :exports none
-%%
-figure;
-hold on;
-plot(f, coh_dvf);
-plot(f, cohhf_dvf);
-hold off;
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
-xlim([10, 2e3]); ylim([0, 1]);
-#+end_src
-
-
-#+begin_src matlab :exports none
-%%
-figure;
-tiledlayout(2, 1, 'TileSpacing', 'None', 'Padding', 'None');
-
-ax1 = nexttile;
-hold on;
-plot(f(f<350), abs(G_dvf( f<350)), 'DisplayName', 'Attocube');
-plot(f(f>350), abs(Ghf_dvf(f>350)), 'DisplayName', 'Encoder');
-hold off;
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-ylabel('Amplitude $d/V_a$ [m/V]'); set(gca, 'XTickLabel',[]);
-hold off;
-ylim([1e-8, 1e-3]);
-legend('location', 'northeast');
-
-ax2 = nexttile;
-hold on;
-plot(f(f<350), 180/pi*angle(G_dvf( f<350)));
-plot(f(f>350), 180/pi*angle(Ghf_dvf(f>350)));
+plot(f, 180/pi*angle(iff_sweep), 'k-');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
@@ -1233,75 +1318,65 @@ linkaxes([ax1,ax2],'x');
xlim([10, 2e3]);
#+end_src
-#+begin_src matlab :exports none
-%%
-figure;
-hold on;
-plot(f, coh_dvf);
-plot(f, coh_d);
-plot(f, coh_iff);
-hold off;
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
-xlim([10, 2e3]); ylim([0, 1]);
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/apa_1_frf_iff.pdf', 'width', 'wide', 'height', 'tall');
#+end_src
-#+begin_src matlab :exports none
-%%
-figure;
-tiledlayout(2, 1, 'TileSpacing', 'None', 'Padding', 'None');
+#+name: fig:apa_1_frf_iff
+#+caption: Obtained transfer functions from $V_a$ to $V_s$
+#+RESULTS:
+[[file:figs/apa_1_frf_iff.png]]
-ax1 = nexttile;
-hold on;
-plot(f, abs(G_d), 'DisplayName', 'Attocube');
-plot(f, abs(G_dvf), 'DisplayName', 'Encoder');
-hold off;
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-ylabel('Amplitude $d/V_a$ [m/V]'); set(gca, 'XTickLabel',[]);
-hold off;
-ylim([1e-8, 1e-3]);
-legend('location', 'northeast');
+*** TODO Extract Parameters (Actuator/Sensor constants)
+**** Piezoelectric Actuator Constant
-ax2 = nexttile;
-hold on;
-plot(f, 180/pi*angle(G_d));
-plot(f, 180/pi*angle(G_dvf));
-hold off;
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
-xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
-hold off;
-yticks(-360:90:360);
+Using the measurement test-bench, it is rather easy the determine the static gain between the applied voltage $V_a$ to the induced displacement $d$.
+Use a quasi static (1Hz) excitation signal $V_a$ on the piezoelectric stack and measure the vertical displacement $d$.
+Perform a linear regression to obtain:
+\begin{equation}
+ d = g_{d/V_a} \cdot V_a
+\end{equation}
-linkaxes([ax1,ax2],'x');
-xlim([10, 2e3]);
-#+end_src
+Using the Simscape model of the APA, it is possible to determine the static gain between the actuator force $F_a$ to the induced displacement $d$:
+\begin{equation}
+ d = g_{d/F_a} \cdot F_a
+\end{equation}
-#+begin_src matlab :exports none
-%%
-figure;
-tiledlayout(2, 1, 'TileSpacing', 'None', 'Padding', 'None');
+From the two gains, it is then easy to determine $g_a$:
+\begin{equation}
+ g_a = \frac{F_a}{V_a} = \frac{F_a}{d} \cdot \frac{d}{V_a} = \frac{g_{d/V_a}}{g_{d/F_a}}
+\end{equation}
-ax1 = nexttile;
-plot(f, abs(G_iff));
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-ylabel('Amplitude $V_s/V_a$ [V/V]'); set(gca, 'XTickLabel',[]);
-hold off;
+**** Piezoelectric Sensor Constant
-ax2 = nexttile;
-plot(f, 180/pi*angle(G_iff));
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
-xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
-hold off;
-yticks(-360:90:360);
+From a quasi static excitation of the piezoelectric stack, measure the gain from $V_a$ to $V_s$:
+\begin{equation}
+ V_s = g_{V_s/V_a} V_a
+\end{equation}
-linkaxes([ax1,ax2],'x');
-xlim([10, 2e3]);
-#+end_src
+Note here that there is an high pass filter formed by the piezo capacitor and parallel resistor.
+The excitation frequency should then be in between the cut-off frequency of this high pass filter and the first resonance.
-*** Extract Parameters (Actuator/Sensor constants)
+Alternatively, the gain can be computed from the dynamical identification and taking the gain at the wanted frequency.
+
+Using the simscape model, compute the static gain from the actuator force $F_a$ to the strain of the sensor stack $dl$:
+\begin{equation}
+ dl = g_{dl/F_a} F_a
+\end{equation}
+
+Then, the static gain from the sensor stack strain $dl$ to the general voltage $V_s$ is:
+\begin{equation}
+ g_s = \frac{V_s}{dl} = \frac{V_s}{V_a} \cdot \frac{V_a}{F_a} \cdot \frac{F_a}{dl} = \frac{g_{V_s/V_a}}{g_a \cdot g_{dl/F_a}}
+\end{equation}
+
+Alternatively, we could impose an external force to add strain in the APA that should be equally present in all the 3 stacks and equal to 1/5 of the vertical strain.
+This external force can be some weight added, or a piezo in parallel.
+
+**** Results
Quasi static gain between $d$ and $V_a$:
#+begin_src matlab
-g_d_Va = mean(abs(G_dvf(f > 10 & f < 15)));
+g_d_Va = mean(abs(dvf_sweep(f > 10 & f < 15)));
#+end_src
#+begin_src matlab :results value replace :exports results
@@ -1313,7 +1388,7 @@ sprintf('g_d_Va = %.1e [m/V]', g_d_Va)
Quasi static gain between $V_s$ and $V_a$:
#+begin_src matlab
-g_Vs_Va = mean(abs(G_iff(f > 10 & f < 15)));
+g_Vs_Va = mean(abs(iff_sweep(f > 10 & f < 15)));
#+end_src
#+begin_src matlab :results value replace :exports results
@@ -1323,182 +1398,24 @@ sprintf('g_Vs_Va = %.1e [V/V]', g_Vs_Va)
#+RESULTS:
: g_Vs_Va = 5.7e-01 [V/V]
-** Comparison of all the APA
-*** Introduction :ignore:
-
-*** 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
-
-#+begin_src matlab :tangle no
-addpath('./matlab/mat/');
-addpath('./matlab/src/');
-addpath('./matlab/');
-#+end_src
-
-#+begin_src matlab :eval no
-addpath('./mat/');
-addpath('./src/');
-#+end_src
-
-*** Stiffness - Comparison of the APA
-In order to estimate the stiffness of the APA, a weight with known mass $m_a$ is added on top of the suspended granite and the deflection $d_e$ is measured using an encoder.
-The APA stiffness is then:
-\begin{equation}
- k_{\text{apa}} = \frac{m_a g}{d}
-\end{equation}
-
-Here are the number of the APA that have been measured:
-#+begin_src matlab
-apa_nums = [1 2 4 5 6 7 8];
-#+end_src
-
-The data are loaded.
-#+begin_src matlab
-apa_mass = {};
-for i = 1:length(apa_nums)
- apa_mass(i) = {load(sprintf('frf_data_%i_add_mass_closed_circuit.mat', apa_nums(i)), 't', 'de')};
- % The initial displacement is set to zero
- apa_mass{i}.de = apa_mass{i}.de - mean(apa_mass{i}.de(apa_mass{i}.t<11));
-end
-#+end_src
-
-The raw measurements are shown in Figure [[fig:apa_meas_k_time]].
-All the APA seems to have similar stiffness except the APA 7 which should have an higher stiffness.
-
-#+begin_question
-It is however strange that the displacement $d_e$ when the mass is removed is higher for the APA 7 than for the other APA.
-What could cause that?
-#+end_question
-
-#+begin_src matlab :exports none
-figure;
-hold on;
-for i = 1:length(apa_nums)
- plot(apa_mass{i}.t, apa_mass{i}.de, 'DisplayName', sprintf('APA %i', apa_nums(i)));
-end
-hold off;
-xlabel('Time [s]'); ylabel('Displacement $d_e$ [m]');
-legend('location', 'northeast', 'FontSize', 8, 'NumColumns', 2);
-#+end_src
-
-#+begin_src matlab :tangle no :exports results :results file replace
-exportFig('figs/apa_meas_k_time.pdf', 'width', 'wide', 'height', 'normal');
-#+end_src
-
-#+name: fig:apa_meas_k_time
-#+caption: Raw measurements for all the APA. A mass of 6.4kg is added at arround 15s and removed at arround 22s
-#+RESULTS:
-[[file:figs/apa_meas_k_time.png]]
-
-#+begin_src matlab
-added_mass = 6.4; % Added mass [kg]
-#+end_src
-
-The stiffnesses are computed for all the APA and are summarized in Table [[tab:APA_measured_k]].
-
-#+begin_src matlab :exports none
-apa_k = zeros(length(apa_nums), 1);
-for i = 1:length(apa_nums)
- apa_k(i) = 9.8 * added_mass / (mean(apa_mass{i}.de(apa_mass{i}.t > 12 & apa_mass{i}.t < 12.5)) - mean(apa_mass{i}.de(apa_mass{i}.t > 20 & apa_mass{i}.t < 20.5)));
-end
-#+end_src
-
-#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)
- data2orgtable(1e-6*apa_k, cellstr(num2str(apa_nums')), {'APA Num', '$k [N/\mu m]$'}, ' %.2f ');
-#+end_src
-
-#+name: tab:APA_measured_k
-#+caption: Measured stiffnesses
-#+attr_latex: :environment tabularx :width 0.3\linewidth :align cc
-#+attr_latex: :center t :booktabs t :float t
-#+RESULTS:
-| APA Num | $k [N/\mu m]$ |
-|---------+---------------|
-| 1 | 1.68 |
-| 2 | 1.69 |
-| 4 | 1.7 |
-| 5 | 1.7 |
-| 6 | 1.7 |
-| 7 | 1.93 |
-| 8 | 1.73 |
-
-#+begin_important
-The APA300ML manual specifies the nominal stiffness to be $1.8\,[N/\mu m]$ which is very close to what have been measured.
-Only the APA number 7 is a little bit off.
-#+end_important
-
-*** Stiffness - Effect of connecting the actuator stack to the amplifier and the sensor stack to the ADC
-We wish here to see if the stiffness changes when the actuator stacks are not connected to the amplifier and the sensor stacks are not connected to the ADC.
-
-Note here that the resistor in parallel to the sensor stack is present in both cases.
-
-First, the data are loaded.
-#+begin_src matlab
-add_mass_oc = load(sprintf('frf_data_%i_add_mass_open_circuit.mat', 1), 't', 'de');
-add_mass_cc = load(sprintf('frf_data_%i_add_mass_closed_circuit.mat', 1), 't', 'de');
-#+end_src
-
-And the initial displacement is set to zero.
-#+begin_src matlab
-add_mass_oc.de = add_mass_oc.de - mean(add_mass_oc.de(add_mass_oc.t<11));
-add_mass_cc.de = add_mass_cc.de - mean(add_mass_cc.de(add_mass_cc.t<11));
-#+end_src
-
-#+begin_src matlab :exports none
-figure;
-hold on;
-plot(add_mass_oc.t, add_mass_oc.de, 'DisplayName', 'Not connected');
-plot(add_mass_cc.t, add_mass_cc.de, 'DisplayName', 'Connected');
-hold off;
-xlabel('Time [s]'); ylabel('Displacement $d_e$ [m]');
-legend('location', 'northeast');
-#+end_src
-
-#+begin_src matlab :tangle no :exports results :results file replace
-exportFig('figs/apa_meas_k_time_oc_cc.pdf', 'width', 'wide', 'height', 'normal');
-#+end_src
-
-#+name: fig:apa_meas_k_time_oc_cc
-#+caption: Measured displacement
-#+RESULTS:
-[[file:figs/apa_meas_k_time_oc_cc.png]]
-
-
-And the stiffness is estimated in both case.
-The results are shown in Table [[tab:APA_measured_k_oc_cc]].
-
-#+begin_src matlab
-apa_k_oc = 9.8 * added_mass / (mean(add_mass_oc.de(add_mass_oc.t > 12 & add_mass_oc.t < 12.5)) - mean(add_mass_oc.de(add_mass_oc.t > 20 & add_mass_oc.t < 20.5)));
-apa_k_cc = 9.8 * added_mass / (mean(add_mass_cc.de(add_mass_cc.t > 12 & add_mass_cc.t < 12.5)) - mean(add_mass_cc.de(add_mass_cc.t > 20 & add_mass_cc.t < 20.5)));
-#+end_src
-
-#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)
-data2orgtable(1e-6*[apa_k_oc; apa_k_cc], {'Not connected', 'Connected'}, {'$k [N/\mu m]$'}, ' %.1f ');
-#+end_src
-
-#+name: tab:APA_measured_k_oc_cc
-#+caption: Measured stiffnesses on "open" and "closed" circuits
-#+attr_latex: :environment tabularx :width 0.3\linewidth :align cc
-#+attr_latex: :center t :booktabs t :float t
-#+RESULTS:
-| | $k [N/\mu m]$ |
-|---------------+---------------|
-| Not connected | 2.3 |
-| Connected | 1.7 |
-
-#+begin_important
-Clearly, connecting the actuator stacks to the amplified (basically equivalent as to short circuiting them) lowers the stiffness.
-#+end_important
-
*** Hysteresis
We here wish to visually see the amount of hysteresis present in the APA.
+To do so, a quasi static sinusoidal excitation $V_a$ at different voltages is used.
+
+The offset is 65V, and the sin amplitude is ranging from 1V up to 80V.
+
+For each excitation amplitude, the vertical displacement $d$ of the mass is measured.
+
+Then, $d$ is plotted as a function of $V_a$ for all the amplitudes.
+
+We expect to obtained something like the hysteresis shown in Figure [[fig:expected_hysteresis]].
+
+#+name: fig:expected_hysteresis
+#+caption: Expected Hysteresis cite:poel10_explor_activ_hard_mount_vibrat
+#+attr_latex: :width 0.8\linewidth
+[[file:figs/expected_hysteresis.png]]
+
The data is loaded.
#+begin_src matlab
apa_hyst = load('frf_data_1_hysteresis.mat', 't', 'Va', 'de');
@@ -1579,6 +1496,320 @@ It is quite clear that hysteresis is increasing with the excitation amplitude.
Also, no hysteresis is found on the sensor stack voltage.
#+end_important
+*** Estimation of the APA axial stiffness
+In order to estimate the stiffness of the APA, a weight with known mass $m_a$ is added on top of the suspended granite and the deflection $d_e$ is measured using the encoder.
+The APA stiffness is then:
+\begin{equation}
+ k_{\text{apa}} = \frac{m_a g}{d}
+\end{equation}
+
+Here, a mass of 6.4 kg is used:
+#+begin_src matlab
+added_mass = 6.4; % Added mass [kg]
+#+end_src
+
+The data is loaded, and the measured displacement is shown in Figure [[fig:apa_1_meas_stiffness]].
+#+begin_src matlab
+apa_mass = load(sprintf('frf_data_%i_add_mass_closed_circuit.mat', 1), 't', 'de');
+apa_mass.de = apa_mass.de - mean(apa_mass.de(apa_mass.t<11));
+#+end_src
+
+#+begin_src matlab :exports none
+figure;
+plot(apa_mass.t, apa_mass.de, 'k-');
+xlabel('Time [s]'); ylabel('Displacement $d_e$ [m]');
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/apa_1_meas_stiffness.pdf', 'width', 'wide', 'height', 'normal');
+#+end_src
+
+#+name: fig:apa_1_meas_stiffness
+#+caption: Measured displacement when adding the mass and removing the mass
+#+RESULTS:
+[[file:figs/apa_1_meas_stiffness.png]]
+
+There is some imprecision in the measurement as there are some drifts that are probably due to some creep.
+
+The stiffness is then computed as follows:
+#+begin_src matlab
+k = 9.8 * added_mass / (mean(apa_mass.de(apa_mass.t > 12 & apa_mass.t < 12.5)) - mean(apa_mass.de(apa_mass.t > 20 & apa_mass.t < 20.5)));
+#+end_src
+
+And the stiffness obtained is very close to the one specified in the documentation ($k = 1.794\,[N/\mu m]$).
+#+begin_src matlab :results value replace :exports results :tangle no
+sprintf('k = %.2f [N/um]', 1e-6*k);
+#+end_src
+
+#+RESULTS:
+: k = 1.68 [N/um]
+
+*** Stiffness change due to electrical connections
+We wish here to see if the stiffness changes when the actuator stacks are not connected to the amplifier and the sensor stacks are not connected to the ADC.
+
+Note here that the resistor in parallel to the sensor stack is present in both cases.
+
+First, the data are loaded.
+#+begin_src matlab
+add_mass_oc = load(sprintf('frf_data_%i_add_mass_open_circuit.mat', 1), 't', 'de');
+add_mass_cc = load(sprintf('frf_data_%i_add_mass_closed_circuit.mat', 1), 't', 'de');
+#+end_src
+
+And the initial displacement is set to zero.
+#+begin_src matlab
+add_mass_oc.de = add_mass_oc.de - mean(add_mass_oc.de(add_mass_oc.t<11));
+add_mass_cc.de = add_mass_cc.de - mean(add_mass_cc.de(add_mass_cc.t<11));
+#+end_src
+
+The measured displacements are shown in Figure [[fig:apa_meas_k_time_oc_cc]].
+#+begin_src matlab :exports none
+figure;
+hold on;
+plot(add_mass_oc.t, add_mass_oc.de, 'DisplayName', 'Not connected');
+plot(add_mass_cc.t, add_mass_cc.de, 'DisplayName', 'Connected');
+hold off;
+xlabel('Time [s]'); ylabel('Displacement $d_e$ [m]');
+legend('location', 'northeast');
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/apa_meas_k_time_oc_cc.pdf', 'width', 'wide', 'height', 'normal');
+#+end_src
+
+#+name: fig:apa_meas_k_time_oc_cc
+#+caption: Measured displacement
+#+RESULTS:
+[[file:figs/apa_meas_k_time_oc_cc.png]]
+
+
+And the stiffness is estimated in both case.
+The results are shown in Table [[tab:APA_measured_k_oc_cc]].
+#+begin_src matlab
+apa_k_oc = 9.8 * added_mass / (mean(add_mass_oc.de(add_mass_oc.t > 12 & add_mass_oc.t < 12.5)) - mean(add_mass_oc.de(add_mass_oc.t > 20 & add_mass_oc.t < 20.5)));
+apa_k_cc = 9.8 * added_mass / (mean(add_mass_cc.de(add_mass_cc.t > 12 & add_mass_cc.t < 12.5)) - mean(add_mass_cc.de(add_mass_cc.t > 20 & add_mass_cc.t < 20.5)));
+#+end_src
+
+#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)
+data2orgtable(1e-6*[apa_k_oc; apa_k_cc], {'Not connected', 'Connected'}, {'$k [N/\mu m]$'}, ' %.1f ');
+#+end_src
+
+#+name: tab:APA_measured_k_oc_cc
+#+caption: Measured stiffnesses on "open" and "closed" circuits
+#+attr_latex: :environment tabularx :width 0.3\linewidth :align cc
+#+attr_latex: :center t :booktabs t :float t
+#+RESULTS:
+| | $k [N/\mu m]$ |
+|---------------+---------------|
+| Not connected | 2.3 |
+| Connected | 1.7 |
+
+#+begin_important
+Clearly, connecting the actuator stacks to the amplified (basically equivalent as to short circuiting them) lowers the stiffness.
+#+end_important
+
+*** Effect of the resistor on the IFF Plant
+A resistor $R \approx 80.6\,k\Omega$ is added in parallel with the sensor stack.
+This has the effect to form a high pass filter with the capacitance of the stack.
+
+We here measured the low frequency transfer function from $V_a$ to $V_s$ with and without this resistor.
+
+#+begin_src matlab
+% With the resistor
+wi_k = load('frf_data_1_sweep_lf_with_R.mat', 't', 'Vs', 'Va');
+
+% Without the resistor
+wo_k = load('frf_data_1_sweep_lf.mat', 't', 'Vs', 'Va');
+#+end_src
+
+We use a very long "Hanning" window for the spectral analysis in order to estimate the low frequency behavior.
+#+begin_src matlab
+win = hanning(ceil(50*Fs)); % Hannning Windows
+#+end_src
+
+And we estimate the transfer function from $V_a$ to $V_s$ in both cases:
+#+begin_src matlab
+[frf_wo_k, f] = tfestimate(wo_k.Va, wo_k.Vs, win, [], [], 1/Ts);
+[frf_wi_k, ~] = tfestimate(wi_k.Va, wi_k.Vs, win, [], [], 1/Ts);
+#+end_src
+
+With the following values of the resistor and capacitance, we obtain a first order high pass filter with a crossover frequency equal to:
+#+begin_src matlab
+C = 5.1e-6; % Sensor Stack capacitance [F]
+R = 80.6e3; % Parallel Resistor [Ohm]
+
+f0 = 1/(2*pi*R*C); % Crossover frequency of RC HPF [Hz]
+#+end_src
+
+#+begin_src matlab :results value replace :exports results :tangle no
+sprintf('f0 = %.2f [Hz]', f0)
+#+end_src
+
+#+RESULTS:
+: f0 = 0.39 [Hz]
+
+The transfer function of the corresponding high pass filter is:
+#+begin_src matlab
+G_hpf = 0.6*(s/2*pi*f0)/(1 + s/2*pi*f0);
+#+end_src
+
+Let's compare the transfer function from actuator stack to sensor stack with and without the added resistor in Figure [[fig:frf_iff_effect_R]].
+#+begin_src matlab :exports none
+figure;
+tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None');
+
+ax1 = nexttile([2,1]);
+hold on;
+plot(f, abs(frf_wo_k), 'DisplayName', 'Without $k$');
+plot(f, abs(frf_wi_k), 'DisplayName', 'With $k$');
+plot(f, abs(squeeze(freqresp(G_hpf, f, 'Hz'))), 'k--', 'DisplayName', sprintf('HPF $f_o = %.2f [Hz]$', f0));
+hold off;
+set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
+ylabel('Amplitude $V_{out}/V_{in}$ [V/V]'); set(gca, 'XTickLabel',[]);
+hold off;
+ylim([1e-1, 1e0]);
+legend('location', 'southeast')
+
+ax2 = nexttile;
+hold on;
+plot(f, 180/pi*angle(frf_wo_k));
+plot(f, 180/pi*angle(frf_wi_k));
+plot(f, 180/pi*angle(squeeze(freqresp(G_hpf, f, 'Hz'))), 'k--');
+hold off;
+set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
+xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
+hold off;
+yticks(-360:45:360); ylim([-45, 90]);
+
+linkaxes([ax1,ax2],'x');
+xlim([0.2, 8]);
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/frf_iff_effect_R.pdf', 'width', 'wide', 'height', 'tall');
+#+end_src
+
+#+name: fig:frf_iff_effect_R
+#+caption: Transfer function from $V_a$ to $V_s$ with and without the resistor $k$
+#+RESULTS:
+[[file:figs/frf_iff_effect_R.png]]
+
+#+begin_important
+The added resistor has indeed the expected effect.
+#+end_important
+
+** Comparison of all the APA
+<>
+*** Introduction :ignore:
+The same measurements that was performed in Section [[sec:meas_one_apa]] are now performed on all the APA and then compared.
+
+*** 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
+
+#+begin_src matlab
+colors = get(gca,'colororder');
+#+end_src
+
+#+begin_src matlab :tangle no
+addpath('./matlab/mat/');
+addpath('./matlab/src/');
+addpath('./matlab/');
+#+end_src
+
+#+begin_src matlab :eval no
+addpath('./mat/');
+addpath('./src/');
+#+end_src
+
+*** Axial Stiffnesses - Comparison
+Let's first compare the APA axial stiffnesses.
+
+The added mass is:
+#+begin_src matlab
+added_mass = 6.4; % Added mass [kg]
+#+end_src
+
+Here are the number of the APA that have been measured:
+#+begin_src matlab
+apa_nums = [1 2 4 5 6 7 8];
+#+end_src
+
+The data are loaded.
+#+begin_src matlab
+apa_mass = {};
+for i = 1:length(apa_nums)
+ apa_mass(i) = {load(sprintf('frf_data_%i_add_mass_closed_circuit.mat', apa_nums(i)), 't', 'de')};
+ % The initial displacement is set to zero
+ apa_mass{i}.de = apa_mass{i}.de - mean(apa_mass{i}.de(apa_mass{i}.t<11));
+end
+#+end_src
+
+The raw measurements are shown in Figure [[fig:apa_meas_k_time]].
+All the APA seems to have similar stiffness except the APA 7 which should have an higher stiffness.
+
+#+begin_question
+It is however strange that the displacement $d_e$ when the mass is removed is higher for the APA 7 than for the other APA.
+What could cause that?
+#+end_question
+
+#+begin_src matlab :exports none
+figure;
+hold on;
+for i = 1:length(apa_nums)
+ plot(apa_mass{i}.t, apa_mass{i}.de, 'DisplayName', sprintf('APA %i', apa_nums(i)));
+end
+hold off;
+xlabel('Time [s]'); ylabel('Displacement $d_e$ [m]');
+legend('location', 'northeast', 'FontSize', 8, 'NumColumns', 2);
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/apa_meas_k_time.pdf', 'width', 'wide', 'height', 'normal');
+#+end_src
+
+#+name: fig:apa_meas_k_time
+#+caption: Raw measurements for all the APA. A mass of 6.4kg is added at arround 15s and removed at arround 22s
+#+RESULTS:
+[[file:figs/apa_meas_k_time.png]]
+
+The stiffnesses are computed for all the APA and are summarized in Table [[tab:APA_measured_k]].
+
+#+begin_src matlab :exports none
+apa_k = zeros(length(apa_nums), 1);
+for i = 1:length(apa_nums)
+ apa_k(i) = 9.8 * added_mass / (mean(apa_mass{i}.de(apa_mass{i}.t > 12 & apa_mass{i}.t < 12.5)) - mean(apa_mass{i}.de(apa_mass{i}.t > 20 & apa_mass{i}.t < 20.5)));
+end
+#+end_src
+
+#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)
+ data2orgtable(1e-6*apa_k, cellstr(num2str(apa_nums')), {'APA Num', '$k [N/\mu m]$'}, ' %.2f ');
+#+end_src
+
+#+name: tab:APA_measured_k
+#+caption: Measured stiffnesses
+#+attr_latex: :environment tabularx :width 0.3\linewidth :align cc
+#+attr_latex: :center t :booktabs t :float t
+#+RESULTS:
+| APA Num | $k [N/\mu m]$ |
+|---------+---------------|
+| 1 | 1.68 |
+| 2 | 1.69 |
+| 4 | 1.7 |
+| 5 | 1.7 |
+| 6 | 1.7 |
+| 7 | 1.93 |
+| 8 | 1.73 |
+
+#+begin_important
+The APA300ML manual specifies the nominal stiffness to be $1.8\,[N/\mu m]$ which is very close to what have been measured.
+Only the APA number 7 is a little bit off.
+#+end_important
+
*** FRF Identification - Setup
The identification is performed in three steps:
1. White noise excitation with small amplitude.
@@ -1654,8 +1885,6 @@ The coherence is shown in Figure [[fig:frf_dvf_plant_coh]].
It is clear that the Sweep sine gives good coherence up to 400Hz and that the high frequency noise excitation signal helps increasing a little bit the coherence at high frequency.
#+begin_src matlab :exports none
-colors = get(gca,'colororder');
-
figure;
hold on;
plot(f, coh_noise_hf(:, 1), 'color', [colors(1, :), 0.5], ...
@@ -1720,9 +1949,9 @@ Why is there a double resonance at around 94Hz?
#+begin_src matlab :exports none
figure;
-tiledlayout(2, 1, 'TileSpacing', 'None', 'Padding', 'None');
+tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None');
-ax1 = nexttile;
+ax1 = nexttile([2,1]);
hold on;
for i = 1:length(apa_nums)
plot(f(f> 350), abs(dvf_noise_hf(f> 350, i)), 'color', colors(i, :), ...
@@ -1762,6 +1991,46 @@ exportFig('figs/frf_dvf_plant_tf.pdf', 'width', 'wide', 'height', 'tall');
#+RESULTS:
[[file:figs/frf_dvf_plant_tf.png]]
+#+begin_src matlab :exports none
+figure;
+tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None');
+
+ax1 = nexttile([2,1]);
+hold on;
+for i = 1:length(apa_nums)
+ plot(f(f<=350), abs(dvf_sweep( f<=350, i)), 'color', colors(i, :), ...
+ 'DisplayName', sprintf('APA %i', apa_nums(i)));
+end
+hold off;
+set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
+ylabel('Amplitude $d_e/V_a$ [m/V]'); set(gca, 'XTickLabel',[]);
+hold off;
+legend('location', 'northeast', 'FontSize', 8, 'NumColumns', 2);
+ylim([2e-5, 4e-4]);
+
+ax2 = nexttile;
+hold on;
+for i = 1:length(apa_nums)
+ plot(f(f<=350), 180/pi*angle(dvf_sweep( f<=350, i)), 'color', colors(i, :));
+end
+hold off;
+set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
+xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
+hold off;
+yticks(-360:90:360);
+
+linkaxes([ax1,ax2],'x');
+xlim([80, 120]);
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/frf_dvf_zoom_res_plant_tf.pdf', 'width', 'wide', 'height', 'tall');
+#+end_src
+
+#+name: fig:frf_dvf_zoom_res_plant_tf
+#+caption: Estimated FRF for the DVF plant (transfer function from $V_a$ to the encoder $d_e$) - Zoom on the main resonance
+#+RESULTS:
+[[file:figs/frf_dvf_zoom_res_plant_tf.png]]
*** FRF Identification - IFF
In this section, the dynamics from $V_a$ to $V_s$ is identified.
@@ -1853,7 +2122,7 @@ ax2 = nexttile;
hold on;
for i = 1:length(apa_nums)
plot(f(f> 350), 180/pi*angle(iff_noise_hf(f> 350, i)), 'color', colors(i, :));
- plot(ff<=350), 180/pi*angle(iff_sweep( f<=350, i)), 'color', colors(i, :));
+ plot(f(f<=350), 180/pi*angle(iff_sweep( f<=350, i)), 'color', colors(i, :));
end
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
@@ -1874,86 +2143,32 @@ exportFig('figs/frf_iff_plant_tf.pdf', 'width', 'wide', 'height', 'tall');
#+RESULTS:
[[file:figs/frf_iff_plant_tf.png]]
-*** Effect of the resistor on the IFF Plant
-A resistor is added in parallel with the sensor stack.
-This has the effect to form a high pass filter with the capacitance of the stack.
+* Dynamical measurements - Struts
+<>
+** Introduction :ignore:
-We here measured the low frequency transfer function from $V_a$ to $V_s$ with and without this resistor.
+#+name: fig:test_bench_leg_overview
+#+caption: Test Bench with Strut - Overview
+[[file:figs/test_bench_leg_overview.png]]
-#+begin_src matlab
-% With the resistor
-wi_k = load('frf_data_2_sweep_lf_with_R.mat', 't', 'Vs', 'Va');
+#+name: fig:test_bench_leg_front
+#+caption: Test Bench with Strut - Zoom on the strut
+[[file:figs/test_bench_leg_front.png]]
-% Without the resistor
-wo_k = load('frf_data_2_sweep_lf.mat', 't', 'Vs', 'Va');
-#+end_src
-
-#+begin_src matlab
-t = wo_k.t; % Time vector [s]
-
-Ts = (t(end) - t(1))/(length(t)-1); % Sampling Time [s]
-Fs = 1/Ts; % Sampling Frequency [Hz]
-#+end_src
-
-We use a very long "Hanning" window for the spectral analysis in order to estimate the low frequency behavior.
-#+begin_src matlab
-win = hanning(ceil(50*Fs)); % Hannning Windows
-#+end_src
-
-And we estimate the transfer function from $V_a$ to $V_s$ in both cases:
-#+begin_src matlab
-[frf_wo_k, f] = tfestimate(wo_k.Va, wo_k.Vs, win, [], [], 1/Ts);
-[frf_wi_k, ~] = tfestimate(wi_k.Va, wi_k.Vs, win, [], [], 1/Ts);
-#+end_src
+#+name: fig:test_bench_leg_overview
+#+caption: Test Bench with Strut - Zoom on the strut with the encoder
+[[file:figs/test_bench_leg_coder.png]]
-#+begin_src matlab
-f0 = 0.35;
-G_hpf = 0.6*(s/2*pi*f0)/(1 + s/2*pi*f0);
-#+end_src
+| Variable | | Unit | Hardware |
+|----------+------------------------------+------+-------------------------------|
+| =Va= | Output DAC voltage | [V] | DAC - Ch. 1 => PD200 => APA |
+| =Vs= | Measured stack voltage (ADC) | [V] | APA => ADC - Ch. 1 |
+| =de= | Encoder Measurement | [m] | PEPU Ch. 1 - IO318(1) - Ch. 1 |
+| =da= | Attocube Measurement | [m] | PEPU Ch. 2 - IO318(1) - Ch. 2 |
+| =t= | Time | [s] | |
-#+begin_src matlab :exports none
-figure;
-tiledlayout(2, 1, 'TileSpacing', 'None', 'Padding', 'None');
-
-ax1 = nexttile;
-hold on;
-plot(f, abs(frf_wo_k));
-plot(f, abs(frf_wi_k));
-plot(f, abs(squeeze(freqresp(G_hpf, f, 'Hz'))), 'k--');
-hold off;
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-ylabel('Amplitude $V_{out}/V_{in}$ [V/V]'); set(gca, 'XTickLabel',[]);
-hold off;
-ylim([1e-3, 1e1]);
-
-ax2 = nexttile;
-hold on;
-plot(f, 180/pi*angle(frf_wo_k), 'DisplayName', 'Without $k$');
-plot(f, 180/pi*angle(frf_wi_k), 'DisplayName', 'With $k$');
-plot(f, 180/pi*angle(squeeze(freqresp(G_hpf, f, 'Hz'))), 'k--', 'DisplayName', sprintf('HPF $f_o = %.2f [Hz]$', f0));
-hold off;
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
-xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
-hold off;
-yticks(-360:90:360); ylim([-180, 180]);
-legend('location', 'northeast')
-
-linkaxes([ax1,ax2],'x');
-xlim([0.1, 10]);
-#+end_src
-
-#+begin_src matlab :tangle no :exports results :results file replace
-exportFig('figs/frf_iff_effect_R.pdf', 'width', 'wide', 'height', 'tall');
-#+end_src
-
-#+name: fig:frf_iff_effect_R
-#+caption: Transfer function from $V_a$ to $V_s$ with and without the resistor $k$
-#+RESULTS:
-[[file:figs/frf_iff_effect_R.png]]
-
-
-** TODO Measurement on Strut 1
+** Measurement on Strut 1
*** Introduction :ignore:
Measurements are first performed on the strut number 1 with:
- APA 1
@@ -1968,6 +2183,10 @@ Measurements are first performed on the strut number 1 with:
<>
#+end_src
+#+begin_src matlab
+colors = get(gca,'colororder');
+#+end_src
+
#+begin_src matlab :tangle no
addpath('./matlab/mat/');
addpath('./matlab/src/');
@@ -2027,8 +2246,6 @@ We compute the coherence for 2nd and 3rd identification:
#+end_src
#+begin_src matlab :exports none
-colors = get(gca,'colororder');
-
figure;
hold on;
plot(f, coh_noise_hf(:, 1), 'color', [colors(1, :), 0.5], ...
@@ -2086,7 +2303,6 @@ hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude $d_e/V_a$ [m/V]'); set(gca, 'XTickLabel',[]);
hold off;
-legend('location', 'northeast', 'FontSize', 8, 'NumColumns', 2);
ylim([1e-9, 1e-3]);
ax2 = nexttile;
@@ -2129,8 +2345,8 @@ colors = get(gca,'colororder');
figure;
hold on;
-plot(f, coh_noise_hf, 'color', [colors(1, :), 0.5], 'DisplayName', 'HF Noise');
-plot(f, coh_sweep, 'color', [colors(2, :), 0.5], 'DisplayName', 'Sweep');
+plot(f, coh_noise_hf, 'DisplayName', 'HF Noise');
+plot(f, coh_sweep, 'DisplayName', 'Sweep');
hold off;
xlabel('Frequency [Hz]'); ylabel('Coherence [-]');
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
@@ -2204,8 +2420,8 @@ The identification is performed in three steps:
Then, the result of the second identification is used between 10Hz and 350Hz and the result of the third identification if used between 350Hz and 2kHz.
#+begin_src matlab
-leg_enc_sweep = load(sprintf('frf_data_leg_coder_%i_noise.mat', 1), 't', 'Va', 'Vs', 'de', 'da');
-leg_enc_noise_hf = load(sprintf('frf_data_leg_coder_%i_noise_hf.mat', 1), 't', 'Va', 'Vs', 'de', 'da');
+leg_enc_sweep = load(sprintf('frf_data_leg_coder_badly_align_%i_noise.mat', 1), 't', 'Va', 'Vs', 'de', 'da');
+leg_enc_noise_hf = load(sprintf('frf_data_leg_coder_badly_align_%i_noise_hf.mat', 1), 't', 'Va', 'Vs', 'de', 'da');
#+end_src
**** TODO FRF Identification - DVF
@@ -2277,7 +2493,6 @@ hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude $d_e/V_a$ [m/V]'); set(gca, 'XTickLabel',[]);
hold off;
-legend('location', 'northeast', 'FontSize', 8, 'NumColumns', 2);
ylim([1e-9, 1e-3]);
ax2 = nexttile;
@@ -2335,8 +2550,8 @@ ax2 = nexttile;
hold on;
plot(f(f> 350), 180/pi*angle(dvf_enc_noise_hf(f> 350)), 'color', colors(1, :));
plot(f(f<=350), 180/pi*angle(dvf_enc_sweep( f<=350)), 'color', colors(1, :));
-plot(f(f> 350), 180/pi*angle(dvf_int_noise_hf(f> 350)), 'color', colors(1, :));
-plot(f(f<=350), 180/pi*angle(dvf_int_sweep( f<=350)), 'color', colors(1, :));
+plot(f(f> 350), 180/pi*angle(dvf_int_noise_hf(f> 350)), 'color', colors(2, :));
+plot(f(f<=350), 180/pi*angle(dvf_int_sweep( f<=350)), 'color', colors(2, :));
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
@@ -2520,7 +2735,432 @@ xlim([10, 2e3]);
We can see that the IFF does not change whether of not the encoder are fixed to the struts.
#+end_important
-* Measurement Results
+** Comparison of all the Struts
+*** Introduction :ignore:
+
+*** 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
+
+#+begin_src matlab
+colors = get(gca,'colororder');
+#+end_src
+
+#+begin_src matlab :tangle no
+addpath('./matlab/mat/');
+addpath('./matlab/src/');
+addpath('./matlab/');
+#+end_src
+
+#+begin_src matlab :eval no
+addpath('./mat/');
+addpath('./src/');
+#+end_src
+
+*** FRF Identification - Setup
+The identification is performed in three steps:
+1. White noise excitation with small amplitude.
+ This is used to determine the main resonance of the system.
+2. Noise sine excitation with the amplitude lowered around the resonance.
+ The noise sine is from 10Hz to 400Hz.
+3. High frequency noise.
+ The noise is band-passed between 300Hz and 2kHz.
+
+Then, the result of the second identification is used between 10Hz and 350Hz and the result of the third identification if used between 350Hz and 2kHz.
+
+Here are the LEG numbers that have been measured.
+#+begin_src matlab
+leg_nums = [1 2 3 4 5];
+#+end_src
+
+The data are loaded for both the second and third identification:
+#+begin_src matlab
+%% Second identification
+leg_noise = {};
+for i = 1:length(leg_nums)
+ leg_noise(i) = {load(sprintf('frf_data_leg_coder_%i_noise.mat', leg_nums(i)), 't', 'Va', 'Vs', 'de', 'da')};
+end
+
+%% Third identification
+leg_noise_hf = {};
+for i = 1:length(leg_nums)
+ leg_noise_hf(i) = {load(sprintf('frf_data_leg_coder_%i_noise_hf.mat', leg_nums(i)), 't', 'Va', 'Vs', 'de', 'da')};
+end
+#+end_src
+
+The time is the same for all measurements.
+#+begin_src matlab
+%% Time vector
+t = leg_noise{1}.t - leg_noise{1}.t(1) ; % Time vector [s]
+
+%% Sampling
+Ts = (t(end) - t(1))/(length(t)-1); % Sampling Time [s]
+Fs = 1/Ts; % Sampling Frequency [Hz]
+#+end_src
+
+Then we defined a "Hanning" windows that will be used for the spectral analysis:
+#+begin_src matlab
+win = hanning(ceil(0.5*Fs)); % Hannning Windows
+#+end_src
+
+We get the frequency vector that will be the same for all the frequency domain analysis.
+#+begin_src matlab
+% Only used to have the frequency vector "f"
+[~, f] = tfestimate(leg_noise{1}.Va, leg_noise{1}.de, win, [], [], 1/Ts);
+#+end_src
+
+*** FRF Identification - DVF
+In this section, the dynamics from $V_a$ to $d_e$ is identified.
+
+We compute the coherence for 2nd and 3rd identification:
+#+begin_src matlab
+%% Coherence computation
+coh_noise = zeros(length(f), length(leg_nums));
+for i = 1:length(leg_nums)
+ [coh, ~] = mscohere(leg_noise{i}.Va, leg_noise{i}.de, win, [], [], 1/Ts);
+ coh_noise(:, i) = coh;
+end
+
+coh_noise_hf = zeros(length(f), length(leg_nums));
+for i = 1:length(leg_nums)
+ [coh, ~] = mscohere(leg_noise_hf{i}.Va, leg_noise_hf{i}.de, win, [], [], 1/Ts);
+ coh_noise_hf(:, i) = coh;
+end
+#+end_src
+
+The coherence is shown in Figure [[fig:frf_dvf_plant_coh]].
+It is clear that the Noise sine gives good coherence up to 400Hz and that the high frequency noise excitation signal helps increasing a little bit the coherence at high frequency.
+
+#+begin_src matlab :exports none
+colors = get(gca,'colororder');
+
+figure;
+hold on;
+plot(f, coh_noise_hf(:, 1), 'color', [colors(1, :), 0.5], ...
+ 'DisplayName', 'HF Noise');
+plot(f, coh_noise(:, 1), 'color', [colors(2, :), 0.5], ...
+ 'DisplayName', 'Noise');
+for i = 2:length(leg_nums)
+ plot(f, coh_noise_hf(:, i), 'color', [colors(1, :), 0.5], ...
+ 'HandleVisibility', 'off');
+ plot(f, coh_noise(:, i), 'color', [colors(2, :), 0.5], ...
+ 'HandleVisibility', 'off');
+end;
+hold off;
+set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
+xlabel('Frequency [Hz]'); ylabel('Coherence [-]');
+xlim([5, 5e3]); ylim([0, 1]);
+legend('location', 'southeast');
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/frf_dvf_plant_coh.pdf', 'width', 'wide', 'height', 'normal');
+#+end_src
+
+#+name: fig:frf_dvf_plant_coh
+#+caption: Obtained coherence for the plant from $V_a$ to $d_e$
+#+RESULTS:
+[[file:figs/frf_dvf_plant_coh.png]]
+
+
+Then, the transfer function from the DAC output voltage $V_a$ to the measured displacement by the encoders is computed:
+#+begin_src matlab
+%% Transfer function estimation
+dvf_noise = zeros(length(f), length(leg_nums));
+for i = 1:length(leg_nums)
+ [frf, ~] = tfestimate(leg_noise{i}.Va, leg_noise{i}.de, win, [], [], 1/Ts);
+ dvf_noise(:, i) = frf;
+end
+
+dvf_noise_hf = zeros(length(f), length(leg_nums));
+for i = 1:length(leg_nums)
+ [frf, ~] = tfestimate(leg_noise_hf{i}.Va, leg_noise_hf{i}.de, win, [], [], 1/Ts);
+ dvf_noise_hf(:, i) = frf;
+end
+#+end_src
+
+The obtained transfer functions are shown in Figure [[fig:frf_dvf_plant_tf]].
+
+They are all superimposed except for the LEG7.
+
+#+begin_src matlab :exports none
+figure;
+tiledlayout(2, 1, 'TileSpacing', 'None', 'Padding', 'None');
+
+ax1 = nexttile;
+hold on;
+for i = 1:length(leg_nums)
+ plot(f(f> 350), abs(dvf_noise_hf(f> 350, i)), 'color', colors(i, :), ...
+ 'DisplayName', sprintf('Leg %i', leg_nums(i)));
+ plot(f(f<=350), abs(dvf_noise( f<=350, i)), 'color', colors(i, :), ...
+ 'HandleVisibility', 'off');
+end
+hold off;
+set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
+ylabel('Amplitude $d_e/V_a$ [m/V]'); set(gca, 'XTickLabel',[]);
+hold off;
+legend('location', 'northeast', 'FontSize', 8, 'NumColumns', 2);
+ylim([1e-9, 1e-3]);
+
+ax2 = nexttile;
+hold on;
+for i = 1:length(leg_nums)
+ plot(f(f> 350), 180/pi*angle(dvf_noise_hf(f> 350, i)), 'color', colors(i, :));
+ plot(f(f<=350), 180/pi*angle(dvf_noise( f<=350, i)), 'color', colors(i, :));
+end
+hold off;
+set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
+xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
+hold off;
+yticks(-360:90:360);
+
+linkaxes([ax1,ax2],'x');
+xlim([10, 2e3]);
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/frf_dvf_plant_tf.pdf', 'width', 'wide', 'height', 'tall');
+#+end_src
+
+#+name: fig:frf_dvf_plant_tf
+#+caption: Estimated FRF for the DVF plant (transfer function from $V_a$ to the encoder $d_e$)
+#+RESULTS:
+[[file:figs/frf_dvf_plant_tf.png]]
+
+
+
+*** FRF Identification - DVF with interferometer
+In this section, the dynamics from $V_a$ to $d_a$ is identified.
+
+We compute the coherence for 2nd and 3rd identification:
+#+begin_src matlab
+%% Coherence computation
+coh_noise = zeros(length(f), length(leg_nums));
+for i = 1:length(leg_nums)
+ [coh, ~] = mscohere(leg_noise{i}.Va, leg_noise{i}.da, win, [], [], 1/Ts);
+ coh_noise(:, i) = coh;
+end
+
+coh_noise_hf = zeros(length(f), length(leg_nums));
+for i = 1:length(leg_nums)
+ [coh, ~] = mscohere(leg_noise_hf{i}.Va, leg_noise_hf{i}.da, win, [], [], 1/Ts);
+ coh_noise_hf(:, i) = coh;
+end
+#+end_src
+
+The coherence is shown in Figure [[fig:frf_dvf_plant_coh]].
+It is clear that the Noise sine gives good coherence up to 400Hz and that the high frequency noise excitation signal helps increasing a little bit the coherence at high frequency.
+
+#+begin_src matlab :exports none
+colors = get(gca,'colororder');
+
+figure;
+hold on;
+plot(f, coh_noise_hf(:, 1), 'color', [colors(1, :), 0.5], ...
+ 'DisplayName', 'HF Noise');
+plot(f, coh_noise(:, 1), 'color', [colors(2, :), 0.5], ...
+ 'DisplayName', 'Noise');
+for i = 2:length(leg_nums)
+ plot(f, coh_noise_hf(:, i), 'color', [colors(1, :), 0.5], ...
+ 'HandleVisibility', 'off');
+ plot(f, coh_noise(:, i), 'color', [colors(2, :), 0.5], ...
+ 'HandleVisibility', 'off');
+end;
+hold off;
+set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
+xlabel('Frequency [Hz]'); ylabel('Coherence [-]');
+xlim([5, 5e3]); ylim([0, 1]);
+legend('location', 'southeast');
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/frf_dvf_plant_coh.pdf', 'width', 'wide', 'height', 'normal');
+#+end_src
+
+#+name: fig:frf_dvf_plant_coh
+#+caption: Obtained coherence for the plant from $V_a$ to $d_e$
+#+RESULTS:
+[[file:figs/frf_dvf_plant_coh.png]]
+
+Then, the transfer function from the DAC output voltage $V_a$ to the measured displacement by the Attocube is computed:
+#+begin_src matlab
+%% Transfer function estimation
+dvf_a_noise = zeros(length(f), length(leg_nums));
+for i = 1:length(leg_nums)
+ [frf, ~] = tfestimate(leg_noise{i}.Va, leg_noise{i}.da, win, [], [], 1/Ts);
+ dvf_a_noise(:, i) = frf;
+end
+
+dvf_a_noise_hf = zeros(length(f), length(leg_nums));
+for i = 1:length(leg_nums)
+ [frf, ~] = tfestimate(leg_noise_hf{i}.Va, leg_noise_hf{i}.da, win, [], [], 1/Ts);
+ dvf_a_noise_hf(:, i) = frf;
+end
+#+end_src
+
+The obtained transfer functions are shown in Figure [[fig:frf_dvf_a_plant_tf]].
+
+They are all superimposed except for the LEG7.
+
+#+begin_src matlab :exports none
+figure;
+tiledlayout(2, 1, 'TileSpacing', 'None', 'Padding', 'None');
+
+ax1 = nexttile;
+hold on;
+for i = 1:length(leg_nums)
+ plot(f(f> 350), abs(dvf_a_noise_hf(f> 350, i)), 'color', colors(i, :), ...
+ 'DisplayName', sprintf('Leg %i', leg_nums(i)));
+ plot(f(f<=350), abs(dvf_a_noise( f<=350, i)), 'color', colors(i, :), ...
+ 'HandleVisibility', 'off');
+end
+hold off;
+set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
+ylabel('Amplitude $d_e/V_a$ [m/V]'); set(gca, 'XTickLabel',[]);
+hold off;
+legend('location', 'northeast', 'FontSize', 8, 'NumColumns', 2);
+ylim([1e-9, 1e-3]);
+
+ax2 = nexttile;
+hold on;
+for i = 1:length(leg_nums)
+ plot(f(f> 350), 180/pi*angle(dvf_a_noise_hf(f> 350, i)), 'color', colors(i, :));
+ plot(f(f<=350), 180/pi*angle(dvf_a_noise( f<=350, i)), 'color', colors(i, :));
+end
+hold off;
+set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
+xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
+hold off;
+yticks(-360:90:360);
+
+linkaxes([ax1,ax2],'x');
+xlim([10, 2e3]);
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/frf_dvf_plant_tf.pdf', 'width', 'wide', 'height', 'tall');
+#+end_src
+
+#+name: fig:frf_dvf_plant_tf
+#+caption: Estimated FRF for the DVF plant (transfer function from $V_a$ to the encoder $d_e$)
+#+RESULTS:
+[[file:figs/frf_dvf_plant_tf.png]]
+
+*** FRF Identification - IFF
+In this section, the dynamics from $V_a$ to $V_s$ is identified.
+
+First the coherence is computed and shown in Figure [[fig:frf_iff_plant_coh]].
+The coherence is very nice from 10Hz to 2kHz.
+It is only dropping near a zeros at 40Hz, and near the resonance at 95Hz (the excitation amplitude being lowered).
+
+#+begin_src matlab
+%% Coherence
+coh_noise = zeros(length(f), length(leg_nums));
+for i = 1:length(leg_nums)
+ [coh, ~] = mscohere(leg_noise{i}.Va, leg_noise{i}.Vs, win, [], [], 1/Ts);
+ coh_noise(:, i) = coh;
+end
+
+coh_noise_hf = zeros(length(f), length(leg_nums));
+for i = 1:length(leg_nums)
+ [coh, ~] = mscohere(leg_noise_hf{i}.Va, leg_noise_hf{i}.Vs, win, [], [], 1/Ts);
+ coh_noise_hf(:, i) = coh;
+end
+#+end_src
+
+#+begin_src matlab :exports none
+colors = get(gca,'colororder');
+
+figure;
+hold on;
+plot(f, coh_noise_hf(:, 1), 'color', [colors(1, :), 0.5], 'DisplayName', 'HF Noise');
+plot(f, coh_noise( :, 1), 'color', [colors(2, :), 0.5], 'DisplayName', 'Noise');
+for i = 2:length(leg_nums)
+ plot(f, coh_noise_hf(:, i), 'color', [colors(1, :), 0.5], ...
+ 'HandleVisibility', 'off');
+ plot(f, coh_noise( :, i), 'color', [colors(2, :), 0.5], ...
+ 'HandleVisibility', 'off');
+end;
+hold off;
+xlabel('Frequency [Hz]'); ylabel('Coherence [-]');
+set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
+xlim([5, 5e3]); ylim([0, 1]);
+legend('location', 'southeast');
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/frf_iff_plant_coh.pdf', 'width', 'wide', 'height', 'normal');
+#+end_src
+
+#+name: fig:frf_iff_plant_coh
+#+caption: Obtained coherence for the IFF plant
+#+RESULTS:
+[[file:figs/frf_iff_plant_coh.png]]
+
+Then the FRF are estimated and shown in Figure [[fig:frf_iff_plant_tf]]
+#+begin_src matlab
+%% FRF estimation of the transfer function from Va to Vs
+iff_noise = zeros(length(f), length(leg_nums));
+for i = 1:length(leg_nums)
+ [frf, ~] = tfestimate(leg_noise{i}.Va, leg_noise{i}.Vs, win, [], [], 1/Ts);
+ iff_noise(:, i) = frf;
+end
+
+iff_noise_hf = zeros(length(f), length(leg_nums));
+for i = 1:length(leg_nums)
+ [frf, ~] = tfestimate(leg_noise_hf{i}.Va, leg_noise_hf{i}.Vs, win, [], [], 1/Ts);
+ iff_noise_hf(:, i) = frf;
+end
+#+end_src
+
+#+begin_src matlab :exports none
+figure;
+tiledlayout(2, 1, 'TileSpacing', 'None', 'Padding', 'None');
+
+ax1 = nexttile;
+hold on;
+for i = 1:length(leg_nums)
+ plot(f(f> 350), abs(iff_noise_hf(f> 350, i)), 'color', colors(i, :), ...
+ 'DisplayName', sprintf('Leg %i', leg_nums(i)));
+ plot(f(f<=350), abs(iff_noise( f<=350, i)), 'color', colors(i, :), ...
+ 'HandleVisibility', 'off');
+end
+hold off;
+set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
+ylabel('Amplitude $V_s/V_a$ [V/V]'); set(gca, 'XTickLabel',[]);
+hold off;
+ylim([1e-2, 1e2]);
+legend('location', 'southeast', 'FontSize', 8, 'NumColumns', 2);
+
+ax2 = nexttile;
+hold on;
+for i = 1:length(leg_nums)
+ plot(f(f> 350), 180/pi*angle(iff_noise_hf(f> 350, i)), 'color', colors(i, :));
+ plot(f(f<=350), 180/pi*angle(iff_noise( f<=350, i)), 'color', colors(i, :));
+end
+hold off;
+set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
+xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
+hold off;
+yticks(-360:90:360);
+
+linkaxes([ax1,ax2],'x');
+xlim([10, 2e3]);
+#+end_src
+
+#+begin_src matlab :tangle no :exports results :results file replace
+exportFig('figs/frf_iff_plant_tf.pdf', 'width', 'wide', 'height', 'tall');
+#+end_src
+
+#+name: fig:frf_iff_plant_tf
+#+caption:Identified IFF Plant
+#+RESULTS:
+[[file:figs/frf_iff_plant_tf.png]]
* TODO Compare with the FEM/Simscape Model :noexport:
:PROPERTIES:
@@ -4083,278 +4723,6 @@ ylim([-180, 180])
linkaxes([ax1,ax2],'x');
#+end_src
-* Resonance frequencies - APA300ML
-** Introduction
-
-Three main resonances are foreseen to be problematic for the control of the APA300ML:
-- Mode in X-bending at 189Hz (Figure [[fig:mode_bending_x]])
-- Mode in Y-bending at 285Hz (Figure [[fig:mode_bending_y]])
-- Mode in Z-torsion at 400Hz (Figure [[fig:mode_torsion_z]])
-
-#+name: fig:mode_bending_x
-#+caption: X-bending mode (189Hz)
-#+attr_latex: :width 0.9\linewidth
-[[file:figs/mode_bending_x.gif]]
-
-#+name: fig:mode_bending_y
-#+caption: Y-bending mode (285Hz)
-#+attr_latex: :width 0.9\linewidth
-[[file:figs/mode_bending_y.gif]]
-
-#+name: fig:mode_torsion_z
-#+caption: Z-torsion mode (400Hz)
-#+attr_latex: :width 0.9\linewidth
-[[file:figs/mode_torsion_z.gif]]
-
-These modes are present when flexible joints are fixed to the ends of the APA300ML.
-
-In this section, we try to find the resonance frequency of these modes when one end of the APA is fixed and the other is free.
-
-** 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
-
-#+begin_src matlab :tangle no
-addpath('matlab/');
-addpath('matlab/mat/');
-#+end_src
-
-#+begin_src matlab :eval no
-addpath('mat/');
-#+end_src
-
-** Setup
-
-The measurement setup is shown in Figure [[fig:measurement_setup_torsion]].
-A Laser vibrometer is measuring the difference of motion of two points.
-The APA is excited with an instrumented hammer and the transfer function from the hammer to the measured rotation is computed.
-
-#+begin_note
-- Laser Doppler Vibrometer Polytec OFV512
-- Instrumented hammer
-#+end_note
-
-#+name: fig:measurement_setup_torsion
-#+caption: Measurement setup with a Laser Doppler Vibrometer and one instrumental hammer
-#+attr_latex: :width 0.7\linewidth
-[[file:figs/measurement_setup_torsion.jpg]]
-
-** Bending - X
-
-The setup to measure the X-bending motion is shown in Figure [[fig:measurement_setup_X_bending]].
-The APA is excited with an instrumented hammer having a solid metallic tip.
-The impact point is on the back-side of the APA aligned with the top measurement point.
-
-#+name: fig:measurement_setup_X_bending
-#+caption: X-Bending measurement setup
-#+attr_latex: :width 0.7\linewidth
-[[file:figs/measurement_setup_X_bending.jpg]]
-
-The data is loaded.
-#+begin_src matlab
-bending_X = load('apa300ml_bending_X_top.mat');
-#+end_src
-
-The config for =tfestimate= is performed:
-#+begin_src matlab
-Ts = bending_X.Track1_X_Resolution; % Sampling frequency [Hz]
-win = hann(ceil(1/Ts));
-#+end_src
-
-The transfer function from the input force to the output "rotation" (difference between the two measured distances).
-#+begin_src matlab
-[G_bending_X, f] = tfestimate(bending_X.Track1, bending_X.Track2, win, [], [], 1/Ts);
-#+end_src
-
-The result is shown in Figure [[fig:apa300ml_meas_freq_bending_x]].
-
-The can clearly observe a nice peak at 280Hz, and then peaks at the odd "harmonics" (third "harmonic" at 840Hz, and fifth "harmonic" at 1400Hz).
-#+begin_src matlab :exports none
-figure;
-hold on;
-plot(f, abs(G_bending_X), 'k-');
-hold off;
-set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
-xlabel('Frequency [Hz]'); ylabel('Amplitude');
-xlim([50, 2e3]); ylim([1e-5, 2e-1]);
-text(280, 5.5e-2,{'280Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
-text(840, 2.0e-3,{'840Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
-text(1400, 7.0e-3,{'1400Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
-#+end_src
-
-#+begin_src matlab :tangle no :exports results :results file replace
-exportFig('figs/apa300ml_meas_freq_bending_x.pdf', 'width', 'wide', 'height', 'normal');
-#+end_src
-
-#+name: fig:apa300ml_meas_freq_bending_x
-#+caption: Obtained FRF for the X-bending
-#+RESULTS:
-[[file:figs/apa300ml_meas_freq_bending_x.png]]
-
-** Bending - Y
-
-The setup to measure the Y-bending is shown in Figure [[fig:measurement_setup_Y_bending]].
-
-The impact point of the instrumented hammer is located on the back surface of the top interface (on the back of the 2 measurements points).
-
-#+name: fig:measurement_setup_Y_bending
-#+caption: Y-Bending measurement setup
-#+attr_latex: :width 0.7\linewidth
-[[file:figs/measurement_setup_Y_bending.jpg]]
-
-The data is loaded, and the transfer function from the force to the measured rotation is computed.
-#+begin_src matlab
-bending_Y = load('apa300ml_bending_Y_top.mat');
-[G_bending_Y, ~] = tfestimate(bending_Y.Track1, bending_Y.Track2, win, [], [], 1/Ts);
-#+end_src
-
-The results are shown in Figure [[fig:apa300ml_meas_freq_bending_y]].
-The main resonance is at 412Hz, and we also see the third "harmonic" at 1220Hz.
-
-#+begin_src matlab :exports none
-figure;
-hold on;
-plot(f, abs(G_bending_Y), 'k-');
-hold off;
-set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
-xlabel('Frequency [Hz]'); ylabel('Amplitude');
-xlim([50, 2e3]); ylim([1e-5, 3e-2])
-text(412, 1.5e-2,{'412Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
-text(1218, 1.5e-2,{'1220Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
-#+end_src
-
-#+begin_src matlab :tangle no :exports results :results file replace
-exportFig('figs/apa300ml_meas_freq_bending_y.pdf', 'width', 'wide', 'height', 'normal');
-#+end_src
-
-#+name: fig:apa300ml_meas_freq_bending_y
-#+caption: Obtained FRF for the Y-bending
-#+RESULTS:
-[[file:figs/apa300ml_meas_freq_bending_y.png]]
-
-** Torsion - Z
-
-Finally, we measure the Z-torsion resonance as shown in Figure [[fig:measurement_setup_torsion_bis]].
-
-The excitation is shown on the other side of the APA, on the side to excite the torsion motion.
-
-#+name: fig:measurement_setup_torsion_bis
-#+caption: Z-Torsion measurement setup
-#+attr_latex: :width 0.7\linewidth
-[[file:figs/measurement_setup_torsion_bis.jpg]]
-
-The data is loaded, and the transfer function computed.
-#+begin_src matlab
-torsion = load('apa300ml_torsion_left.mat');
-[G_torsion, ~] = tfestimate(torsion.Track1, torsion.Track2, win, [], [], 1/Ts);
-#+end_src
-
-The results are shown in Figure [[fig:apa300ml_meas_freq_torsion_z]].
-We observe a first peak at 267Hz, which corresponds to the X-bending mode that was measured at 280Hz.
-And then a second peak at 415Hz, which corresponds to the X-bending mode that was measured at 412Hz.
-The mode in pure torsion is probably at higher frequency (peak around 1kHz?).
-#+begin_src matlab :exports none
-figure;
-hold on;
-plot(f, abs(G_torsion), 'k-');
-hold off;
-set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
-xlabel('Frequency [Hz]'); ylabel('Amplitude');
-xlim([50, 2e3]); ylim([1e-5, 2e-2])
-text(415, 4.3e-3,{'415Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
-text(267, 8e-4,{'267Hz'}, 'VerticalAlignment', 'bottom','HorizontalAlignment','center')
-text(800, 6e-4,{'800Hz'}, 'VerticalAlignment', 'bottom','HorizontalAlignment','center')
-#+end_src
-
-#+begin_src matlab :tangle no :exports results :results file replace
-exportFig('figs/apa300ml_meas_freq_torsion_z.pdf', 'width', 'wide', 'height', 'normal');
-#+end_src
-
-#+name: fig:apa300ml_meas_freq_torsion_z
-#+caption: Obtained FRF for the Z-torsion
-#+RESULTS:
-[[file:figs/apa300ml_meas_freq_torsion_z.png]]
-
-In order to verify that, the APA is excited on the top part such that the torsion mode should not be excited.
-#+begin_src matlab
-torsion = load('apa300ml_torsion_top.mat');
-[G_torsion_top, ~] = tfestimate(torsion.Track1, torsion.Track2, win, [], [], 1/Ts);
-#+end_src
-
-The two FRF are compared in Figure [[fig:apa300ml_meas_freq_torsion_z_comp]].
-It is clear that the first two modes does not correspond to the torsional mode.
-Maybe the resonance at 800Hz, or even higher resonances. It is difficult to conclude here.
-#+begin_src matlab :exports none
-figure;
-hold on;
-plot(f, abs(G_torsion), 'k-', 'DisplayName', 'Left excitation');
-plot(f, abs(G_torsion_top), '-', 'DisplayName', 'Top excitation');
-hold off;
-set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
-xlabel('Frequency [Hz]'); ylabel('Amplitude');
-xlim([50, 2e3]); ylim([1e-5, 2e-2])
-text(415, 4.3e-3,{'415Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
-text(267, 8e-4,{'267Hz'}, 'VerticalAlignment', 'bottom','HorizontalAlignment','center')
-text(800, 2e-3,{'800Hz'}, 'VerticalAlignment', 'bottom','HorizontalAlignment','center')
-legend('location', 'northwest');
-#+end_src
-
-#+begin_src matlab :tangle no :exports results :results file replace
-exportFig('figs/apa300ml_meas_freq_torsion_z_comp.pdf', 'width', 'wide', 'height', 'normal');
-#+end_src
-
-#+name: fig:apa300ml_meas_freq_torsion_z_comp
-#+caption: Obtained FRF for the Z-torsion
-#+RESULTS:
-[[file:figs/apa300ml_meas_freq_torsion_z_comp.png]]
-
-** Compare
-The three measurements are shown in Figure [[fig:apa300ml_meas_freq_compare]].
-#+begin_src matlab :exports none
-figure;
-hold on;
-plot(f, abs(G_torsion), 'DisplayName', 'Torsion');
-plot(f, abs(G_bending_X), 'DisplayName', 'Bending - X');
-plot(f, abs(G_bending_Y), 'DisplayName', 'Bending - Y');
-hold off;
-set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
-xlabel('Frequency [Hz]'); ylabel('Amplitude');
-xlim([50, 2e3]); ylim([1e-5, 1e-1]);
-legend('location', 'southeast');
-#+end_src
-
-#+begin_src matlab :tangle no :exports results :results file replace
-exportFig('figs/apa300ml_meas_freq_compare.pdf', 'width', 'full', 'height', 'tall');
-#+end_src
-
-#+name: fig:apa300ml_meas_freq_compare
-#+caption: Obtained FRF - Comparison
-#+RESULTS:
-[[file:figs/apa300ml_meas_freq_compare.png]]
-
-** Conclusion
-
-When two flexible joints are fixed at each ends of the APA, the APA is mostly in a free/free condition in terms of bending/torsion (the bending/torsional stiffness of the joints being very small).
-
-In the current tests, the APA are in a fixed/free condition.
-Therefore, it is quite obvious that we measured higher resonance frequencies than what is foreseen for the struts.
-It is however quite interesting that there is a factor $\approx \sqrt{2}$ between the two (increased of the stiffness by a factor 2?).
-
-#+name: tab:apa300ml_measured_modes_freq
-#+caption: Measured frequency of the modes
-#+attr_latex: :environment tabularx :width 0.6\linewidth :align ccc
-#+attr_latex: :center t :booktabs t :float t
-| Mode | Strut Mode | Measured Frequency |
-|-----------+------------+--------------------|
-| X-Bending | 189Hz | 280Hz |
-| Y-Bending | 285Hz | 410Hz |
-| Z-Torsion | 400Hz | ? |
-
* Function
** =generateSweepExc=: Generate sweep sinus excitation
:PROPERTIES: