Finish exporting all the matlab figures

This commit is contained in:
Thomas Dehaeze 2024-03-27 17:53:04 +01:00
parent 06b8db47f9
commit 741aab6dc7
12 changed files with 671 additions and 1066 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

View File

@ -11,8 +11,8 @@ addpath('./src/'); % Path for functions
%% Colors for the figures
colors = colororder;
% Without Encoder
% When the encoder is not fixed to the strut, the obtained FRF are shown in Figure ref:fig:test_struts_spur_res_frf.
% Measured results
% The obtained frequency response functions are shown in Figure ref:fig:test_struts_spur_res_frf.
%% Load Data (without the encoder)
@ -20,6 +20,11 @@ bending_X = load('strut_spur_res_x_bending.mat');
bending_Y = load('strut_spur_res_y_bending.mat');
torsion_Z = load('strut_spur_res_z_torsion.mat');
%% Load Data (with the encoder)
bending_X_enc = load('strut_spur_res_x_bending_enc.mat');
bending_Y_enc = load('strut_spur_res_y_bending_enc.mat');
torsion_Z_enc = load('strut_spur_res_z_torsion_enc.mat');
%% Plot the responses (without the encoder)
figure;
hold on;
@ -30,21 +35,13 @@ plot(bending_Y.FFT1_AvSpc_1_RMS_X_Val, bending_Y.FFT1_AvSpc_1_RMS_Y_Val, ...
plot(torsion_Z.FFT1_AvSpc_1_RMS_X_Val, torsion_Z.FFT1_AvSpc_1_RMS_Y_Val, ...
'DisplayName', 'Z-torsion');
text(226, 1.5e-4,{'226Hz'}, 'VerticalAlignment', 'bottom','HorizontalAlignment','center')
text(337, 6e-5,{'337Hz'}, 'VerticalAlignment', 'bottom','HorizontalAlignment','center')
text(310, 6e-5,{'337Hz'}, 'VerticalAlignment', 'bottom','HorizontalAlignment','center')
text(398, 1.5e-4,{'398Hz'}, 'VerticalAlignment', 'bottom','HorizontalAlignment','center')
hold off;
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('Amplitude');
xlim([50, 8e2]); ylim([5e-7, 3e-4])
legend('location', 'northwest');
% With Encoder
% Then, one encoder is fixed to the strut and the FRF are measured again and shown in Figure ref:fig:test_struts_spur_res_frf_enc.
%% Load Data (with the encoder)
bending_X_enc = load('strut_spur_res_x_bending_enc.mat');
bending_Y_enc = load('strut_spur_res_y_bending_enc.mat');
torsion_Z_enc = load('strut_spur_res_z_torsion_enc.mat');
legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 1);
%% Plot the responses (with the encoder)
figure;
@ -61,5 +58,5 @@ text(381, 1e-4,{'381Hz'}, 'VerticalAlignment', 'bottom','HorizontalAlignment','c
hold off;
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('Amplitude');
xlim([50, 8e2]); ylim([5e-7, 2e-4])
legend('location', 'northwest');
xlim([50, 8e2]); ylim([5e-7, 3e-4])
legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 1);

View File

@ -12,6 +12,8 @@ addpath('./src/'); % Path for functions
colors = colororder;
% Effect of the Encoder on the measured dynamics
% <<ssec:test_struts_effect_encoder>>
%% Parameters for Frequency Analysis
Ts = 1e-4; % Sampling Time [s]
@ -61,18 +63,18 @@ enc_frf = [frf_sweep(i_lf); frf_noise_hf(i_hf)]; % Combine the FRF
% Figure ref:fig:test_struts_effect_encoder_int
% Same goes for the transfer function from excitation voltage $u$ to the axial motion of the strut $d_a$ as measured by the interferometer ().
% #+begin_important
% The transfer function from the excitation voltage $u$ to the generated voltage $V_s$ by the sensor stack is not influence by the fixation of the encoder.
% The transfer function from the excitation voltage $u$ to the generated voltage $V_s$ by the sensor stack is not influence by the fixation of the encoder (Figure ref:fig:test_struts_effect_encoder_iff).
% This means that the IFF control strategy should be as effective whether or not the encoders are fixed to the struts.
% #+end_important
%% Plot the FRF from u to da with and without the encoder
figure;
tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
ax1 = nexttile([2,1]);
ax1 = nexttile([]);
hold on;
plot(f, abs(int_with_enc_frf), '-', 'DisplayName', 'With encoder');
plot(f, abs(int_frf), '-', 'DisplayName', 'Without encoder');
@ -81,7 +83,7 @@ set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude $d_a/u$ [m/V]'); set(gca, 'XTickLabel',[]);
hold off;
ylim([1e-7, 1e-3]);
legend('location', 'northeast')
legend('location', 'northeast', 'FontSize', 8, 'NumColumns', 1);
ax2 = nexttile;
hold on;
@ -108,7 +110,7 @@ hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude $V_s/u$ [V/V]'); set(gca, 'XTickLabel',[]);
hold off;
legend('location', 'northeast', 'FontSize', 8);
legend('location', 'northeast', 'FontSize', 8, 'NumColumns', 1);
ylim([1e-2, 1e2]);
ax2 = nexttile;
@ -125,6 +127,21 @@ linkaxes([ax1,ax2],'x');
xlim([10, 2e3]);
% Comparison of the encoder and interferometer
% <<ssec:test_struts_comp_enc_int>>
% The dynamics as measured by the encoder and by the interferometers are compared in Figure ref:fig:test_struts_comp_enc_int.
% The dynamics from the excitation voltage $u$ to the measured displacement by the encoder $d_e$ presents much more complicated behavior than the transfer function to the displacement as measured by the Interferometer (compared in Figure ref:fig:test_struts_comp_enc_int).
% It will be further investigated why the two dynamics as so different and what are causing all these resonances.
% As shown in Figure ref:fig:test_struts_comp_enc_int, we can clearly see three spurious resonances at 197Hz, 290Hz and 376Hz.
% These resonances correspond to parasitic resonances of the strut itself that was estimated using a finite element model of the strut (Figure ref:fig:test_struts_mode_shapes):
% - Mode in X-bending at 189Hz
% - Mode in Y-bending at 285Hz
% - Mode in Z-torsion at 400Hz
% The good news is that these resonances are not seen on the interferometer (they are therefore not impacting the axial motion of the strut).
% But these resonances are making the use of encoder fixed to the strut difficult.
figure;
@ -159,7 +176,7 @@ linkaxes([ax1,ax2],'x');
xlim([10, 2e3]);
% Comparison of all the Struts
% <<ssec:test_struts_meas_all_struts>>
% <<ssec:test_struts_comp_all_struts>>
%% Numbers of the measured legs
@ -275,6 +292,7 @@ xlim([10, 2e3]);
% #+name: fig:test_struts_comp_plants
% #+caption: Comparison of the measured plants
% #+attr_latex: :options [htbp]
% #+begin_figure
% #+attr_latex: :caption \subcaption{\label{fig:test_struts_comp_interf_plants}$u$ to $d_a$}
% #+attr_latex: :options {0.49\textwidth}
@ -290,6 +308,12 @@ xlim([10, 2e3]);
% #+end_subfigure
% #+end_figure
% There is a very large variability of the dynamics as measured by the encoder as shown in Figure ref:fig:test_struts_comp_enc_plants.
% Even-though the same peaks are seen for all of the struts (95Hz, 200Hz, 300Hz, 400Hz), the amplitude of the peaks are not the same.
% Moreover, the location or even the presence of complex conjugate zeros is changing from one strut to the other.
% All of this will be studied in Section ref:sec:test_struts_simscape using the Simscape model.
%% Bode plot of the FRF from u to de
figure;

File diff suppressed because it is too large Load Diff

View File

@ -591,7 +591,7 @@ set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude $d_a/u$ [m/V]'); set(gca, 'XTickLabel',[]);
hold off;
ylim([1e-7, 1e-3]);
legend('location', 'northeast')
legend('location', 'northeast', 'FontSize', 8, 'NumColumns', 1);
ax2 = nexttile;
hold on;
@ -624,7 +624,7 @@ hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude $V_s/u$ [V/V]'); set(gca, 'XTickLabel',[]);
hold off;
legend('location', 'northeast', 'FontSize', 8);
legend('location', 'northeast', 'FontSize', 8, 'NumColumns', 1);
ylim([1e-2, 1e2]);
ax2 = nexttile;
@ -1501,7 +1501,7 @@ plot(freqs, abs(squeeze(freqresp(Gs_xy_align{1}('de', 'u'), freqs, 'Hz'))), ...
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
xlabel('Frequency [Hz]'); ylabel('Amplitude [m/V]');
leg = legend('location', 'southwest', 'FontSize', 8);
leg = legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 1);
leg.ItemTokenSize(1) = 15;
title('Strut 1');
xticks([1e1, 1e2, 1e3]);
@ -1516,7 +1516,7 @@ plot(freqs, abs(squeeze(freqresp(Gs_xy_align{2}('de', 'u'), freqs, 'Hz'))), ...
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
xlabel('Frequency [Hz]'); set(gca, 'YTickLabel',[]);
leg = legend('location', 'southwest', 'FontSize', 8);
leg = legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 1);
leg.ItemTokenSize(1) = 15;
title('Strut 2');
xticks([1e1, 1e2, 1e3]);
@ -1531,7 +1531,7 @@ plot(freqs, abs(squeeze(freqresp(Gs_xy_align{3}('de', 'u'), freqs, 'Hz'))), ...
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
xlabel('Frequency [Hz]'); set(gca, 'YTickLabel',[]);
leg = legend('location', 'southwest', 'FontSize', 8);
leg = legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 1);
leg.ItemTokenSize(1) = 15;
title('Strut 3');
xticks([1e1, 1e2, 1e3]);
@ -1552,13 +1552,20 @@ exportFig('figs/test_struts_comp_dy_tuned_model_frf_enc.pdf', 'width', 'full', '
** Proper struts alignment
<<sec:test_struts_meas_all_aligned_struts>>
The struts are re-aligned and measured using the same test bench.
After the positioning pins had been received, the struts were mounted again with the positioning pins.
This should make the APA better aligned with the two flexible joints.
The misalignment between the APA and the flexible joints are measured.
The results are defined below and summarized in Table ref:tab:meas_misalignment_struts_new_raw.
This alignment is then estimated using a length gauge as in the previous sections.
Measured $y$ alignments are summarized in Table ref:tab:test_struts_meas_y_misalignment_with_pin and are found to be bellow $55\mu m$ for all the struts which is much better than better (see Table ref:tab:test_struts_meas_y_misalignment).
#+begin_src matlab
%% Measurement of the y misalignment between the APA and the flexible joints after strut better alignment
% Numbers of the measured legs
strut_align_nums = [1 2 3 4 5 6];
% Measured height differences in [mm]
% R ("red" side), B ("black" side)
% R Top B Top R Bot B Bot
strut_align = [[-0.54, -0.50, -0.50, -0.52] % strut 1
[-0.44, -0.55, -0.49, -0.49] % strut 2
@ -1566,121 +1573,68 @@ strut_align = [[-0.54, -0.50, -0.50, -0.52] % strut 1
[-0.45, -0.51, -0.51, -0.45] % strut 4
[-0.50, -0.50, -0.50, -0.50] % strut 5
[-0.50, -0.49, -0.43, -0.54]]; % strut 6
% Verification that the thickness difference between the APA shell and the flexible joints is 1mm
thichness_diff_top = strut_align(:,1) + strut_align(:,2); % [mm]
thichness_diff_bot = strut_align(:,1) + strut_align(:,2); % [mm]
% Estimation of the dy misalignment
dy_bot = (strut_align(:,1) - strut_align(:,2))/2; % [mm]
dy_top = (strut_align(:,3) - strut_align(:,4))/2; % [mm]
#+end_src
#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)
data2orgtable(strut_align, {'1', '2', '3', '4', '5', '6'}, {'*Strut*', '*R Top*', '*B Top*', '*R Bot*', '*B Bot*'}, ' %.2f ');
data2orgtable([dy_bot, dy_top] , {'1', '2', '3', '4', '5', '6'}, {'*Strut*', '*Bot*', '*Top*'}, ' %.3f ');
#+end_src
#+name: tab:meas_misalignment_struts_new_raw
#+caption: Measured misalignment of the struts (=R= means "red" side, and =B= means "black side") in [mm]
#+attr_latex: :environment tabularx :width 0.45\linewidth :align cllll
#+attr_latex: :center t :booktabs t :float t
#+name: tab:test_struts_meas_y_misalignment_with_pin
#+caption: Measured $y$ misalignment at the top and bottom of the APA after realigning the struts using a positioning pin. Measurements are in $mm$.
#+attr_latex: :environment tabularx :width 0.25\linewidth :align ccc
#+attr_latex: :center t :booktabs t
#+RESULTS:
| *Strut* | *R Top* | *B Top* | *R Bot* | *B Bot* |
|---------+---------+---------+---------+---------|
| 1 | -0.54 | -0.5 | -0.5 | -0.52 |
| 2 | -0.44 | -0.55 | -0.49 | -0.49 |
| 3 | -0.48 | -0.5 | -0.5 | -0.46 |
| 4 | -0.45 | -0.51 | -0.51 | -0.45 |
| 5 | -0.5 | -0.5 | -0.5 | -0.5 |
| 6 | -0.5 | -0.49 | -0.43 | -0.54 |
Also, the sum of the measured distances on each side should be 1mm (equal to the thickness difference between the flexible joint and the APA).
This is verified in Table ref:tab:meas_misalignment_struts_new_thickness.
#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)
data2orgtable([strut_align(:,1) + strut_align(:,2), strut_align(:,3) + strut_align(:,4)], {'1', '2', '4', '5', '6', '8'}, {'*APA*', '*Top*', '*Bot*'}, ' %.2f ');
#+end_src
#+name: tab:meas_misalignment_struts_new_thickness
#+caption: Measured thickness difference between the flexible joints and the APA in [mm]
#+attr_latex: :environment tabularx :width 0.2\linewidth :align cll
#+attr_latex: :center t :booktabs t :float t
#+RESULTS:
| *APA* | *Top* | *Bot* |
|-------+-------+-------|
| 1 | -1.04 | -1.02 |
| 2 | -0.99 | -0.98 |
| 4 | -0.98 | -0.96 |
| 5 | -0.96 | -0.96 |
| 6 | -1.0 | -1.0 |
| 8 | -0.99 | -0.97 |
The differences of the measured distances on each side corresponds to the misalignment on that same side (Table ref:tab:meas_misalignment_struts_new_results).
#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)
data2orgtable([(strut_align(:,1) - strut_align(:,2))/2, (strut_align(:,3) - strut_align(:,4))/2], {'1', '2', '4', '5', '6', '8'}, {'*APA*', '*Top*', '*Bot*'}, ' %.3f ');
#+end_src
#+name: tab:meas_misalignment_struts_new_results
#+caption: Measured thickness difference between the flexible joints and the APA in [mm]
#+attr_latex: :environment tabularx :width 0.25\linewidth :align cll
#+attr_latex: :center t :booktabs t :float t
#+RESULTS:
| *APA* | *Top* | *Bot* |
|-------+--------+-------|
| *Strut* | *Bot* | *Top* |
|---------+--------+-------|
| 1 | -0.02 | 0.01 |
| 2 | 0.055 | 0.0 |
| 4 | 0.01 | -0.02 |
| 5 | 0.03 | -0.03 |
| 6 | 0.0 | 0.0 |
| 8 | -0.005 | 0.055 |
| 3 | 0.01 | -0.02 |
| 4 | 0.03 | -0.03 |
| 5 | 0.0 | 0.0 |
| 6 | -0.005 | 0.055 |
#+begin_important
After using the alignment pins, the misalignment of the APA and flexible joints are much smaller ($< 50\,\mu m$ for all the struts).
#+end_important
The dynamics of the re-aligned struts are then measured using the same test bench (Figure ref:fig:test_struts_bench_leg).
The comparison of the initial strut dynamics and the dynamics of the re-aligned struts (i.e. with the positioning pin) is made in Figure ref:fig:test_struts_comp_enc_frf_realign.
The excitation signal is a low pass filtered white noise.
Both the encoder and the force sensor voltage are measured.
Even though the struts are now much better aligned, not much improvement can be observed.
The dynamics of the six aligned struts are quite different from one another.
Here are the leg numbers that have been measured.
#+begin_src matlab
%% Numnbers of the measured legs
strut_nums = [1 2 3 4 5 6];
#+end_src
Having the encoders fixed to the struts may prove to be difficult to use.
Therefore, the encoders may be fixed to the nano-hexapod plates instead.
#+begin_src matlab
%% First identification (low frequency noise)
%% New dynamical identified with re-aligned struts
% Load the identification data
leg_noise = {};
for i = 1:length(strut_nums)
leg_noise(i) = {load(sprintf('frf_struts_align_%i_noise.mat', strut_nums(i)), 'u', 'Vs', 'de')};
for i = 1:length(strut_align_nums)
leg_noise(i) = {load(sprintf('frf_struts_align_%i_noise.mat', strut_align_nums(i)), 'u', 'Vs', 'de')};
end
#+end_src
#+begin_src matlab
% Parameters for Frequency Analysis
Ts = 1e-4; % Sampling Time [s]
Nfft = floor(1/Ts);
win = hanning(Nfft);
Noverlap = floor(Nfft/2);
#+end_src
Nfft = floor(1/Ts); % Number of points for the FFT computation
win = hanning(Nfft); % Hanning window
Noverlap = floor(Nfft/2); % Overlap between frequency analysis
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}.u, leg_noise{1}.de, win, Noverlap, Nfft, 1/Ts);
#+end_src
In this section, the dynamics from $u$ to $d_e$ (encoder) is identified.
% Transfer function from u to de (encoder)
enc_frf_aligned = zeros(length(f), length(strut_align_nums));
Then, the transfer function from the DAC output voltage $u$ to the measured displacement by the encoder $d_e$ is computed:
#+begin_src matlab
%% Transfer function estimation
enc_frf = zeros(length(f), length(strut_nums));
for i = 1:length(strut_nums)
enc_frf(:, i) = tfestimate(leg_noise{i}.u, leg_noise{i}.de, win, Noverlap, Nfft, 1/Ts);
end
%% Transfer function estimation
iff_frf = zeros(length(f), length(strut_nums));
for i = 1:length(strut_nums)
iff_frf(:, i) = tfestimate(leg_noise{i}.u, leg_noise{i}.Vs, win, Noverlap, Nfft, 1/Ts);
for i = 1:length(strut_align_nums)
enc_frf_aligned(:, i) = tfestimate(leg_noise{i}.u, leg_noise{i}.de, win, Noverlap, Nfft, 1/Ts);
end
#+end_src
The obtained transfer functions are shown in Figure ref:fig:struts_align_frf_dvf_plant_tf.
#+begin_src matlab :exports none
%% Bode plot of the FRF from u to de
figure;
@ -1688,21 +1642,32 @@ tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
ax1 = nexttile([2,1]);
hold on;
plot(f, abs(enc_frf(:, 1)), 'color', [colors(1,:), 0.5], ...
'DisplayName', 'Initial alignment');
for i = 1:length(strut_nums)
plot(f, abs(enc_frf(:, i)), ...
'DisplayName', sprintf('Leg %i', strut_nums(i)));
plot(f, abs(enc_frf(:, i)), 'color', [colors(1,:), 0.5], ...
'HandleVisibility', 'off');
end
plot(f, abs(enc_frf_aligned(:, 1)), 'color', [colors(2,:), 0.5], ...
'DisplayName', 'With positioning pin');
for i = 1:length(strut_align_nums)
plot(f, abs(enc_frf_aligned(:, i)), 'color', [colors(2,:), 0.5], ...
'HandleVisibility', 'off');
end
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude $d_e/u$ [m/V]'); set(gca, 'XTickLabel',[]);
hold off;
legend('location', 'northeast', 'FontSize', 8, 'NumColumns', 2);
legend('location', 'northeast', 'FontSize', 8, 'NumColumns', 1);
ylim([1e-8, 1e-3]);
ax2 = nexttile;
hold on;
for i = 1:length(strut_nums)
plot(f, 180/pi*angle(enc_frf(:, i)));
plot(f, 180/pi*angle(enc_frf(:, i)), 'color', [colors(1,:), 0.5]);
end
for i = 1:length(strut_align_nums)
plot(f, 180/pi*angle(enc_frf_aligned(:, i)), 'color', [colors(2,:), 0.5]);
end
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
@ -1715,56 +1680,33 @@ xlim([10, 2e3]);
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/struts_align_frf_dvf_plant_tf.pdf', 'width', 'wide', 'height', 'tall');
exportFig('figs/test_struts_comp_enc_frf_realign.pdf', 'width', 'wide', 'height', 'tall');
#+end_src
#+name: fig:struts_align_frf_dvf_plant_tf
#+caption: Estimated FRF for the DVF plant (transfer function from $u$ to the encoder $d_e$)
#+name: fig:test_struts_comp_enc_frf_realign
#+caption:
#+RESULTS:
[[file:figs/struts_align_frf_dvf_plant_tf.png]]
[[file:figs/test_struts_comp_enc_frf_realign.png]]
#+begin_important
Even though the struts are much better aligned, we still observe high variability between the struts for the transfer function from $u$ to $d_e$.
#+end_important
#+begin_important
Having the struts well aligned does not change significantly the obtained dynamics.
#+end_important
The measured FRF are now saved for further use.
** Effect of flexible joint's characteristics
** Effect of the flexible joint
<<ssec:test_struts_effect_joint_stiffness>>
*** Introduction :ignore:
As the struts are composed of one APA and two flexible joints, it is obvious that the flexible joint characteristics will change the dynamic behavior of the struts.
Using the Simscape model, the effect of the flexible joint's characteristics on the dynamics as measured on the test bench are studied:
- Section ref:sec:struts_effect_bending_stiff_joints: the effects of a change of bending stiffness is studied
- Section ref:sec:struts_effect_axial_stiff_joints: the effects of a change of axial stiffness is studied
- Section ref:sec:struts_effect_bending_damping_joints: the effects of a change of bending damping is studied
As the struts are composed of one APA and two flexible joints, it is expected that the flexible joint characteristics will change the dynamic behavior of the struts.
Using the Simscape model, the effect of the flexible joint's characteristics on the dynamics as measured on the test bench are studied.
The studied dynamics is between $u$ and the encoder displacement $d_e$.
*** Effect of bending stiffness of the flexible joints
<<sec:struts_effect_bending_stiff_joints>>
Let's initialize an APA which is a little bit misaligned.
#+begin_src matlab
%% APA Initialization
% APA Initialization
n_hexapod.actuator = initializeAPA('type', 'flexible', 'd_align_bot', [0.1e-3; 0.5e-3; 0], 'd_align_top', [0.1e-3; 0.5e-3; 0]);
#+end_src
The bending stiffnesses for which the dynamics is identified are defined below.
#+begin_src matlab
%% Tested bending stiffnesses [Nm/rad]
%% Study the effect of the bending stiffness of the Flexible joints
% Tested bending stiffnesses [Nm/rad]
kRs = [3, 4, 5, 6, 7];
#+end_src
Then the identification is performed for all the values of the bending stiffnesses.
#+begin_src matlab
%% Idenfity the transfer function from actuator to encoder for all bending stiffnesses
Gs = {zeros(length(kRs), 1)};
% Idenfity the transfer function from actuator to encoder for all bending stiffnesses
Gs_kRs = {zeros(length(kRs), 1)};
for i = 1:length(kRs)
n_hexapod.flex_bot = initializeBotFlexibleJoint(...
@ -1780,70 +1722,15 @@ for i = 1:length(kRs)
G.InputName = {'u'};
G.OutputName = {'Vs', 'de', 'da'};
Gs(i) = {G};
Gs_kRs(i) = {G};
end
#+end_src
The obtained dynamics from DAC voltage to encoder measurements are compared in Figure ref:fig:effect_enc_bending_stiff.
#+begin_src matlab :exports none
%% Plot the obtained transfer functions for all the bending stiffnesses
figure;
tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
ax1 = nexttile([2,1]);
hold on;
for i = 1:length(kRs)
plot(freqs, abs(squeeze(freqresp(Gs{i}('de', 'u'), freqs, 'Hz'))), ...
'DisplayName', sprintf('$k_R = %.0f$ [Nm/rad]', kRs(i)));
end
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude $d_e/u$ [m/V]'); set(gca, 'XTickLabel',[]);
hold off;
ylim([1e-8, 1e-3]);
legend('location', 'northeast');
ax2 = nexttile;
hold on;
for i = 1:length(kRs)
plot(freqs, 180/pi*angle(squeeze(freqresp(Gs{i}('de', 'u'), freqs, 'Hz'))));
end
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]);
linkaxes([ax1,ax2],'x');
xlim([20, 2e3]);
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/effect_enc_bending_stiff.pdf', 'width', 'wide', 'height', 'tall');
#+end_src
#+name: fig:effect_enc_bending_stiff
#+caption: Dynamics from DAC output to encoder for several bending stiffnesses
#+RESULTS:
[[file:figs/effect_enc_bending_stiff.png]]
#+begin_important
The bending stiffness of the joints has little impact on the transfer function from $u$ to $d_e$.
#+end_important
*** Effect of axial stiffness of the flexible joints
<<sec:struts_effect_axial_stiff_joints>>
The axial stiffnesses for which the dynamics is identified are defined below.
#+begin_src matlab
%% Tested axial stiffnesses [N/m]
%% Study the effect of the axial stiffness of the Flexible joints
% Tested axial stiffnesses [N/m]
kzs = [5e7 7.5e7 1e8 2.5e8];
#+end_src
Then the identification is performed for all the values of the bending stiffnesses.
#+begin_src matlab
%% Idenfity the transfer function from actuator to encoder for all bending stiffnesses
Gs = {zeros(length(kzs), 1)};
% Idenfity the transfer function from actuator to encoder for all bending stiffnesses
Gs_kzs = {zeros(length(kzs), 1)};
for i = 1:length(kzs)
n_hexapod.flex_bot = initializeBotFlexibleJoint(...
@ -1857,11 +1744,47 @@ for i = 1:length(kzs)
G.InputName = {'u'};
G.OutputName = {'Vs', 'de', 'da'};
Gs(i) = {G};
Gs_kzs(i) = {G};
end
#+end_src
The obtained dynamics from DAC voltage to encoder measurements are compared in Figure ref:fig:effect_enc_axial_stiff.
#+begin_src matlab :exports none
%% Plot the obtained transfer functions for all the bending stiffnesses
figure;
tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
ax1 = nexttile([2,1]);
hold on;
for i = 1:length(kRs)
plot(freqs, abs(squeeze(freqresp(Gs_kRs{i}('de', 'u'), freqs, 'Hz'))), ...
'DisplayName', sprintf('$k_R = %.0f$ [Nm/rad]', kRs(i)));
end
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude $d_e/u$ [m/V]'); set(gca, 'XTickLabel',[]);
hold off;
ylim([1e-8, 1e-3]);
legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 1);
ax2 = nexttile;
hold on;
for i = 1:length(kRs)
plot(freqs, 180/pi*angle(squeeze(freqresp(Gs_kRs{i}('de', 'u'), freqs, 'Hz'))));
end
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]);
linkaxes([ax1,ax2],'x');
xlim([20, 2e3]);
#+end_src
#+begin_src matlab :tangle no :exports results :results file none
exportFig('figs/test_struts_effect_flex_bending_stiffness_enc.pdf', 'width', 'half', 'height', 'tall');
#+end_src
#+begin_src matlab :exports none
%% Plot the obtained transfer functions for all the axial stiffnesses
figure;
@ -1870,7 +1793,7 @@ tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
ax1 = nexttile([2,1]);
hold on;
for i = 1:length(kzs)
plot(freqs, abs(squeeze(freqresp(Gs{i}('de', 'u'), freqs, 'Hz'))), ...
plot(freqs, abs(squeeze(freqresp(Gs_kzs{i}('de', 'u'), freqs, 'Hz'))), ...
'DisplayName', sprintf('$k_z = %.1e$ [N/m]', kzs(i)));
end
hold off;
@ -1878,12 +1801,12 @@ set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude $d_e/u$ [m/V]'); set(gca, 'XTickLabel',[]);
hold off;
ylim([1e-8, 1e-3]);
legend('location', 'northeast');
legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 1);
ax2 = nexttile;
hold on;
for i = 1:length(kzs)
plot(freqs, 180/pi*angle(squeeze(freqresp(Gs{i}('de', 'u'), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(Gs_kzs{i}('de', 'u'), freqs, 'Hz'))));
end
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
@ -1895,99 +1818,36 @@ linkaxes([ax1,ax2],'x');
xlim([20, 2e3]);
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/effect_enc_axial_stiff.pdf', 'width', 'wide', 'height', 'tall');
#+begin_src matlab :tangle no :exports results :results file none
exportFig('figs/test_struts_effect_flex_axial_stiffness_enc.pdf', 'width', 'half', 'height', 'tall');
#+end_src
#+name: fig:effect_enc_axial_stiff
#+caption: Dynamics from DAC output to encoder for several axial stiffnesses
#+RESULTS:
[[file:figs/effect_enc_axial_stiff.png]]
#+name: fig:test_struts_effect_flex_stiffness_enc
#+caption: Effect of the flexible joints' bending (\subref{fig:test_struts_effect_flex_bending_stiffness_enc}) and axial (\subref{fig:test_struts_effect_flex_axial_stiffness_enc}) stiffnesses on the strut dynamics from $u$ to $d_e$
#+attr_latex: :options [htbp]
#+begin_figure
#+attr_latex: :caption \subcaption{\label{fig:test_struts_effect_flex_bending_stiffness_enc}Effect of bending stiffness}
#+attr_latex: :options {0.49\textwidth}
#+begin_subfigure
#+attr_latex: :width 0.95\linewidth
[[file:figs/test_struts_effect_flex_bending_stiffness_enc.png]]
#+end_subfigure
#+attr_latex: :caption \subcaption{\label{fig:test_struts_effect_flex_axial_stiffness_enc}Effect of axial stiffness}
#+attr_latex: :options {0.49\textwidth}
#+begin_subfigure
#+attr_latex: :width 0.95\linewidth
[[file:figs/test_struts_effect_flex_axial_stiffness_enc.png]]
#+end_subfigure
#+end_figure
The bending stiffness of the joints has little impact on the transfer function from $u$ to $d_e$.
#+begin_important
The axial stiffness of the flexible joint has a large impact on the frequency of the complex conjugate zero.
Using the measured FRF on the test-bench, if is therefore possible to estimate the axial stiffness of the flexible joints from the location of the zero.
This method gives nice match between the measured FRF and the one extracted from the simscape model, however it could give not so accurate values of the joint's axial stiffness as other factors are also influencing the location of the zero.
Using this method, an axial stiffness of $70 N/\mu m$ is found to give good results (and is reasonable based on the finite element models).
#+end_important
*** Effect of bending damping
<<sec:struts_effect_bending_damping_joints>>
Now let's study the effect of the bending damping of the flexible joints.
The tested bending damping are defined below:
#+begin_src matlab
%% Tested bending dampings [Nm/(rad/s)]
cRs = [1e-3, 5e-3, 1e-2, 5e-2, 1e-1];
#+end_src
Then the identification is performed for all the values of the bending damping.
#+begin_src matlab
%% Idenfity the transfer function from actuator to encoder for all bending dampins
Gs = {zeros(length(cRs), 1)};
for i = 1:length(cRs)
n_hexapod.flex_bot = initializeBotFlexibleJoint(...
'type', '4dof', ...
'cRx', cRs(i), ...
'cRy', cRs(i));
n_hexapod.flex_top = initializeTopFlexibleJoint(...
'type', '4dof', ...
'cRx', cRs(i), ...
'cRy', cRs(i));
G = exp(-s*1e-4)*linearize(mdl, io, 0.0, opts);
G.InputName = {'u'};
G.OutputName = {'Vs', 'de', 'da'};
Gs(i) = {G};
end
#+end_src
The results are shown in Figure ref:fig:effect_enc_bending_damp.
#+begin_src matlab :exports none
%% Plot the obtained transfer functions for all the bending stiffnesses
figure;
tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
ax1 = nexttile([2,1]);
hold on;
for i = 1:length(cRs)
plot(freqs, abs(squeeze(freqresp(Gs{i}('de', 'u'), freqs, 'Hz'))), ...
'DisplayName', sprintf('$c_R = %.3f\\,[\\frac{Nm}{rad/s}]$', cRs(i)));
end
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude $d_e/u$ [m/V]'); set(gca, 'XTickLabel',[]);
hold off;
ylim([1e-8, 1e-3]);
legend('location', 'southwest');
ax2 = nexttile;
hold on;
for i = 1:length(cRs)
plot(freqs, 180/pi*angle(squeeze(freqresp(Gs{i}('de', 'u'), freqs, 'Hz'))));
end
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]);
linkaxes([ax1,ax2],'x');
xlim([20, 2e3]);
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/effect_enc_bending_damp.pdf', 'width', 'wide', 'height', 'tall');
#+end_src
#+name: fig:effect_enc_bending_damp
#+caption: Dynamics from DAC output to encoder for several bending damping
#+RESULTS:
[[file:figs/effect_enc_bending_damp.png]]
** Conclusion :ignore:

Binary file not shown.

View File

@ -1,4 +1,4 @@
% Created 2024-03-27 Wed 16:59
% Created 2024-03-27 Wed 17:52
% Intended LaTeX compiler: pdflatex
\documentclass[a4paper, 10pt, DIV=12, parskip=full, bibliography=totoc]{scrreprt}
@ -552,166 +552,81 @@ With a better alignment, the amplitude of the spurious resonances are expected t
\begin{figure}[htbp]
\centering
\includegraphics[scale=1]{figs/test_struts_comp_dy_tuned_model_frf_enc.png}
\caption{\label{fig:test_struts_comp_dy_tuned_model_frf_enc}Comparison of the frequency response functions from DAC voltage \(u\) to measured displacement \(d_e\) by the encoders for three struts. The \(y\) misalignment between the APA and the flexible joints have been estimated}
\caption{\label{fig:test_struts_comp_dy_tuned_model_frf_enc}Comparison of the frequency response functions from DAC voltage \(u\) to measured displacement \(d_e\) by the encoders for three struts. In blue the measured dynamics, in red the dynamics extracted from the model with the \(y\) misalignment estimated from measurements, in yellow the dynamics extracted from the model when both the \(x\) and \(y\) misalignments are tuned}
\end{figure}
\section{Comparison of all the (re-aligned) Struts}
\section{Proper struts alignment}
\label{sec:test_struts_meas_all_aligned_struts}
\begin{itemize}
\item[{$\square$}] Should this be included here?
\end{itemize}
The struts are re-aligned and measured using the same test bench.
\subsection{Measured misalignment of the APA and flexible joints}
The misalignment between the APA and the flexible joints are measured.
After the positioning pins had been received, the struts were mounted again with the positioning pins.
This should make the APA better aligned with the two flexible joints.
The results are defined below and summarized in Table \ref{tab:meas_misalignment_struts_new_raw}.
This alignment is then estimated using a length gauge as in the previous sections.
Measured \(y\) alignments are summarized in Table \ref{tab:test_struts_meas_y_misalignment_with_pin} and are found to be bellow \(55\mu m\) for all the struts which is much better than better (see Table \ref{tab:test_struts_meas_y_misalignment}).
\begin{table}[htbp]
\caption{\label{tab:meas_misalignment_struts_new_raw}Measured misalignment of the struts (\texttt{R} means ``red'' side, and \texttt{B} means ``black side'') in [mm]}
\caption{\label{tab:test_struts_meas_y_misalignment_with_pin}Measured \(y\) misalignment at the top and bottom of the APA after realigning the struts using a positioning pin. Measurements are in \(mm\).}
\centering
\begin{tabularx}{0.45\linewidth}{cllll}
\begin{tabularx}{0.25\linewidth}{ccc}
\toprule
\textbf{Strut} & \textbf{R Top} & \textbf{B Top} & \textbf{R Bot} & \textbf{B Bot}\\
\midrule
1 & -0.54 & -0.5 & -0.5 & -0.52\\
2 & -0.44 & -0.55 & -0.49 & -0.49\\
3 & -0.48 & -0.5 & -0.5 & -0.46\\
4 & -0.45 & -0.51 & -0.51 & -0.45\\
5 & -0.5 & -0.5 & -0.5 & -0.5\\
6 & -0.5 & -0.49 & -0.43 & -0.54\\
\bottomrule
\end{tabularx}
\end{table}
Also, the sum of the measured distances on each side should be 1mm (equal to the thickness difference between the flexible joint and the APA).
This is verified in Table \ref{tab:meas_misalignment_struts_new_thickness}.
\begin{table}[htbp]
\caption{\label{tab:meas_misalignment_struts_new_thickness}Measured thickness difference between the flexible joints and the APA in [mm]}
\centering
\begin{tabularx}{0.2\linewidth}{cll}
\toprule
\textbf{APA} & \textbf{Top} & \textbf{Bot}\\
\midrule
1 & -1.04 & -1.02\\
2 & -0.99 & -0.98\\
4 & -0.98 & -0.96\\
5 & -0.96 & -0.96\\
6 & -1.0 & -1.0\\
8 & -0.99 & -0.97\\
\bottomrule
\end{tabularx}
\end{table}
The differences of the measured distances on each side corresponds to the misalignment on that same side (Table \ref{tab:meas_misalignment_struts_new_results}).
\begin{table}[htbp]
\caption{\label{tab:meas_misalignment_struts_new_results}Measured thickness difference between the flexible joints and the APA in [mm]}
\centering
\begin{tabularx}{0.25\linewidth}{cll}
\toprule
\textbf{APA} & \textbf{Top} & \textbf{Bot}\\
\textbf{Strut} & \textbf{Bot} & \textbf{Top}\\
\midrule
1 & -0.02 & 0.01\\
2 & 0.055 & 0.0\\
4 & 0.01 & -0.02\\
5 & 0.03 & -0.03\\
6 & 0.0 & 0.0\\
8 & -0.005 & 0.055\\
3 & 0.01 & -0.02\\
4 & 0.03 & -0.03\\
5 & 0.0 & 0.0\\
6 & -0.005 & 0.055\\
\bottomrule
\end{tabularx}
\end{table}
\begin{important}
After using the alignment pins, the misalignment of the APA and flexible joints are much smaller (\(< 50\,\mu m\) for all the struts).
\end{important}
\subsection{FRF Identification - Setup}
The excitation signal is a low pass filtered white noise.
Both the encoder and the force sensor voltage are measured.
The dynamics of the re-aligned struts are then measured using the same test bench (Figure \ref{fig:test_struts_bench_leg}).
The comparison of the initial strut dynamics and the dynamics of the re-aligned struts (i.e. with the positioning pin) is made in Figure \ref{fig:test_struts_comp_enc_frf_realign}.
Here are the leg numbers that have been measured.
We get the frequency vector that will be the same for all the frequency domain analysis.
\subsection{FRF Identification - Encoder}
In this section, the dynamics from \(u\) to \(d_e\) (encoder) is identified.
Even though the struts are now much better aligned, not much improvement can be observed.
The dynamics of the six aligned struts are quite different from one another.
Having the encoders fixed to the struts may prove to be difficult to use.
Therefore, the encoders may be fixed to the nano-hexapod plates instead.
Then, the transfer function from the DAC output voltage \(u\) to the measured displacement by the encoder \(d_e\) is computed:
The obtained transfer functions are shown in Figure \ref{fig:struts_align_frf_dvf_plant_tf}.
\begin{figure}[htbp]
\centering
\includegraphics[scale=1]{figs/struts_align_frf_dvf_plant_tf.png}
\caption{\label{fig:struts_align_frf_dvf_plant_tf}Estimated FRF for the DVF plant (transfer function from \(u\) to the encoder \(d_e\))}
\includegraphics[scale=1]{figs/test_struts_comp_enc_frf_realign.png}
\label{fig:test_struts_comp_enc_frf_realign}
\end{figure}
\begin{important}
Even though the struts are much better aligned, we still observe high variability between the struts for the transfer function from \(u\) to \(d_e\).
\end{important}
\subsection{Conclusion}
\begin{important}
Having the struts well aligned does not change significantly the obtained dynamics.
\end{important}
The measured FRF are now saved for further use.
\section{Effect of flexible joint's characteristics}
\section{Effect of the flexible joint}
\label{ssec:test_struts_effect_joint_stiffness}
As the struts are composed of one APA and two flexible joints, it is obvious that the flexible joint characteristics will change the dynamic behavior of the struts.
Using the Simscape model, the effect of the flexible joint's characteristics on the dynamics as measured on the test bench are studied:
\begin{itemize}
\item Section \ref{sec:struts_effect_bending_stiff_joints}: the effects of a change of bending stiffness is studied
\item Section \ref{sec:struts_effect_axial_stiff_joints}: the effects of a change of axial stiffness is studied
\item Section \ref{sec:struts_effect_bending_damping_joints}: the effects of a change of bending damping is studied
\end{itemize}
As the struts are composed of one APA and two flexible joints, it is expected that the flexible joint characteristics will change the dynamic behavior of the struts.
Using the Simscape model, the effect of the flexible joint's characteristics on the dynamics as measured on the test bench are studied.
The studied dynamics is between \(u\) and the encoder displacement \(d_e\).
\subsection{Effect of bending stiffness of the flexible joints}
\label{sec:struts_effect_bending_stiff_joints}
Let's initialize an APA which is a little bit misaligned.
The bending stiffnesses for which the dynamics is identified are defined below.
Then the identification is performed for all the values of the bending stiffnesses.
The obtained dynamics from DAC voltage to encoder measurements are compared in Figure \ref{fig:effect_enc_bending_stiff}.
\begin{figure}[htbp]
\centering
\includegraphics[scale=1]{figs/effect_enc_bending_stiff.png}
\caption{\label{fig:effect_enc_bending_stiff}Dynamics from DAC output to encoder for several bending stiffnesses}
\begin{subfigure}{0.49\textwidth}
\begin{center}
\includegraphics[scale=1,width=0.95\linewidth]{figs/test_struts_effect_flex_bending_stiffness_enc.png}
\end{center}
\subcaption{\label{fig:test_struts_effect_flex_bending_stiffness_enc}Effect of bending stiffness}
\end{subfigure}
\begin{subfigure}{0.49\textwidth}
\begin{center}
\includegraphics[scale=1,width=0.95\linewidth]{figs/test_struts_effect_flex_axial_stiffness_enc.png}
\end{center}
\subcaption{\label{fig:test_struts_effect_flex_axial_stiffness_enc}Effect of axial stiffness}
\end{subfigure}
\caption{\label{fig:test_struts_effect_flex_stiffness_enc}Effect of the flexible joints' bending (\subref{fig:test_struts_effect_flex_bending_stiffness_enc}) and axial (\subref{fig:test_struts_effect_flex_axial_stiffness_enc}) stiffnesses on the strut dynamics from \(u\) to \(d_e\)}
\end{figure}
\begin{important}
The bending stiffness of the joints has little impact on the transfer function from \(u\) to \(d_e\).
\end{important}
\subsection{Effect of axial stiffness of the flexible joints}
\label{sec:struts_effect_axial_stiff_joints}
The axial stiffnesses for which the dynamics is identified are defined below.
Then the identification is performed for all the values of the bending stiffnesses.
The obtained dynamics from DAC voltage to encoder measurements are compared in Figure \ref{fig:effect_enc_axial_stiff}.
\begin{figure}[htbp]
\centering
\includegraphics[scale=1]{figs/effect_enc_axial_stiff.png}
\caption{\label{fig:effect_enc_axial_stiff}Dynamics from DAC output to encoder for several axial stiffnesses}
\end{figure}
\begin{important}
The axial stiffness of the flexible joint has a large impact on the frequency of the complex conjugate zero.
Using the measured FRF on the test-bench, if is therefore possible to estimate the axial stiffness of the flexible joints from the location of the zero.
This method gives nice match between the measured FRF and the one extracted from the simscape model, however it could give not so accurate values of the joint's axial stiffness as other factors are also influencing the location of the zero.
Using this method, an axial stiffness of \(70 N/\mu m\) is found to give good results (and is reasonable based on the finite element models).
\end{important}
\subsection{Effect of bending damping}
\label{sec:struts_effect_bending_damping_joints}
Now let's study the effect of the bending damping of the flexible joints.
The tested bending damping are defined below:
Then the identification is performed for all the values of the bending damping.
The results are shown in Figure \ref{fig:effect_enc_bending_damp}.
\begin{figure}[htbp]
\centering
\includegraphics[scale=1]{figs/effect_enc_bending_damp.png}
\caption{\label{fig:effect_enc_bending_damp}Dynamics from DAC output to encoder for several bending damping}
\end{figure}
\chapter{Conclusion}
\label{sec:test_struts_conclusion}
\printbibliography[heading=bibintoc,title={Bibliography}]