Tangle Matlab files without comments

This commit is contained in:
2025-03-28 16:45:40 +01:00
parent b75f5cbfbd
commit c9c6438a63
8 changed files with 4 additions and 634 deletions

View File

@@ -1,5 +1,3 @@
% Matlab Init :noexport:ignore:
%% test_id31_2_open_loop_plant.m
%% Clear Workspace and Close figures
@@ -37,21 +35,6 @@ specs_dz_rms = 15; % [nm RMS]
specs_dy_rms = 30; % [nm RMS]
specs_ry_rms = 0.25; % [urad RMS]
% Open-Loop Plant Identification
% <<ssec:test_id31_open_loop_plant_first_id>>
% The dynamics of the plant is first identified for a fixed spindle angle (at $0\,\text{deg}$) and without any payload.
% The model dynamics is also identified under the same conditions.
% A comparison between the model and the measured dynamics is presented in Figure ref:fig:test_id31_first_id.
% A good match can be observed for the diagonal dynamics (except the high frequency modes which are not modeled).
% However, the coupling of the transfer function from command signals $\bm{u}$ to the estimated strut motion from the external metrology $\bm{\epsilon\mathcal{L}}$ is larger than expected (Figure ref:fig:test_id31_first_id_int).
% The experimental time delay estimated from the FRF (Figure ref:fig:test_id31_first_id_int) is larger than expected.
% After investigation, it was found that the additional delay was due to a digital processing unit[fn:test_id31_3] that was used to get the interferometers' signals in the Speedgoat.
% This issue was later solved.
%% Identify the plant dynamics using the Simscape model
% Initialize each Simscape model elements
@@ -214,19 +197,6 @@ ylim([-90, 180])
linkaxes([ax1,ax2],'x');
xlim([1, 1e3]);
% Better Angular Alignment
% <<ssec:test_id31_open_loop_plant_rz_alignment>>
% One possible explanation of the increased coupling observed in Figure ref:fig:test_id31_first_id_int is the poor alignment between the external metrology axes (i.e. the interferometer supports) and the nano-hexapod axes.
% To estimate this alignment, a decentralized low-bandwidth feedback controller based on the nano-hexapod encoders was implemented.
% This allowed to perform two straight movements of the nano-hexapod along its $x$ and $y$ axes.
% During these two movements, external metrology measurements were recorded and the results are shown in Figure ref:fig:test_id31_Rz_align_error_and_correct.
% It was found that there was a misalignment of 2.7 degrees (rotation along the vertical axis) between the interferometer axes and nano-hexapod axes.
% This was corrected by adding an offset to the spindle angle.
% After alignment, the same movement was performed using the nano-hexapod while recording the signal of the external metrology.
% Results shown in Figure ref:fig:test_id31_Rz_align_correct are indeed indicating much better alignment.
%% Load Data
data_1_dx = h5scan(data_dir, 'align_int_enc_Rz', 'tx_first_scan', 2);
data_1_dy = h5scan(data_dir, 'align_int_enc_Rz', 'tx_first_scan', 3);
@@ -277,33 +247,6 @@ xticks([-10:5:10]); yticks([-10:5:10]);
leg = legend('location', 'southeast', 'FontSize', 8, 'NumColumns', 1);
leg.ItemTokenSize(1) = 15;
% #+name: fig:test_id31_Rz_align_error_and_correct
% #+caption: Measurement of the Nano-Hexapod axes in the frame of the external metrology. Before alignment (\subref{fig:test_id31_Rz_align_error}) and after alignment (\subref{fig:test_id31_Rz_align_correct}).
% #+attr_latex: :options [htbp]
% #+begin_figure
% #+attr_latex: :caption \subcaption{\label{fig:test_id31_Rz_align_error}Before alignment}
% #+attr_latex: :options {0.49\textwidth}
% #+begin_subfigure
% #+attr_latex: :scale 1
% [[file:figs/test_id31_Rz_align_error.png]]
% #+end_subfigure
% #+attr_latex: :caption \subcaption{\label{fig:test_id31_Rz_align_correct}After alignment}
% #+attr_latex: :options {0.49\textwidth}
% #+begin_subfigure
% #+attr_latex: :scale 1
% [[file:figs/test_id31_Rz_align_correct.png]]
% #+end_subfigure
% #+end_figure
% The dynamics of the plant was identified again after fine alignment and compared with the model dynamics in Figure ref:fig:test_id31_first_id_int_better_rz_align.
% Compared to the initial identification shown in Figure ref:fig:test_id31_first_id_int, the obtained coupling was decreased and was close to the coupling obtained with the multi-body model.
% At low frequency (below $10\,\text{Hz}$), all off-diagonal elements have an amplitude $\approx 100$ times lower than the diagonal elements, indicating that a low bandwidth feedback controller can be implemented in a decentralized manner (i.e. $6$ SISO controllers).
% Between $650\,\text{Hz}$ and $1000\,\text{Hz}$, several modes can be observed, which are due to flexible modes of the top platform and the modes of the two spheres adjustment mechanism.
% The flexible modes of the top platform can be passively damped, whereas the modes of the two reference spheres should not be present in the final application.
%% Identification of the plant after Rz alignment
data_align = load('2023-08-17_17-37_ol_plant_m0_Wz0_new_Rz_align.mat');
@@ -349,47 +292,6 @@ xlim([1, 1e3]); ylim([2e-9, 2e-4]);
leg = legend('location', 'southeast', 'FontSize', 8, 'NumColumns', 2);
leg.ItemTokenSize(1) = 15;
% Effect of Payload Mass
% <<ssec:test_id31_open_loop_plant_mass>>
% To determine how the system dynamics changes with the payload, open-loop identification was performed for four payload conditions shown in Figure ref:fig:test_id31_picture_masses.
% The obtained direct terms are compared with the model dynamics in Figure ref:fig:test_id31_comp_simscape_diag_masses.
% It was found that the model well predicts the measured dynamics under all payload conditions.
% Therefore, the model can be used for model-based control is necessary.
% It is interesting to note that the anti-resonances in the force sensor plant now appear as minimum-phase, as the model predicts (Figure ref:fig:test_id31_comp_simscape_iff_diag_masses).
% #+name: fig:test_id31_picture_masses
% #+caption: The four tested payload conditions. (\subref{fig:test_id31_picture_mass_m0}) without payload. (\subref{fig:test_id31_picture_mass_m1}) with $13\,\text{kg}$ payload. (\subref{fig:test_id31_picture_mass_m2}) with $26\,\text{kg}$ payload. (\subref{fig:test_id31_picture_mass_m3}) with $39\,\text{kg}$ payload.
% #+attr_latex: :options [htbp]
% #+begin_figure
% #+attr_latex: :caption \subcaption{\label{fig:test_id31_picture_mass_m0}$m=0\,\text{kg}$}
% #+attr_latex: :options {0.24\textwidth}
% #+begin_subfigure
% #+attr_latex: :width 0.99\linewidth
% [[file:figs/test_id31_picture_mass_m0.jpg]]
% #+end_subfigure
% #+attr_latex: :caption \subcaption{\label{fig:test_id31_picture_mass_m1}$m=13\,\text{kg}$}
% #+attr_latex: :options {0.24\textwidth}
% #+begin_subfigure
% #+attr_latex: :width 0.99\linewidth
% [[file:figs/test_id31_picture_mass_m1.jpg]]
% #+end_subfigure
% #+attr_latex: :caption \subcaption{\label{fig:test_id31_picture_mass_m2}$m=26\,\text{kg}$}
% #+attr_latex: :options {0.24\textwidth}
% #+begin_subfigure
% #+attr_latex: :width 0.99\linewidth
% [[file:figs/test_id31_picture_mass_m2.jpg]]
% #+end_subfigure
% #+attr_latex: :caption \subcaption{\label{fig:test_id31_picture_mass_m3}$m=39\,\text{kg}$}
% #+attr_latex: :options {0.24\textwidth}
% #+begin_subfigure
% #+attr_latex: :width 0.99\linewidth
% [[file:figs/test_id31_picture_mass_m3.jpg]]
% #+end_subfigure
% #+end_figure
%% Identify the model dynamics for all payload conditions
% Initialize each Simscape model elements
initializeGround();
@@ -667,18 +569,6 @@ linkaxes([ax1,ax2],'x');
xlim([10, 5e2]);
xticks([10, 20, 50, 100, 200, 500])
% Effect of Spindle Rotation
% <<ssec:test_id31_open_loop_plant_rotation>>
% To verify that all the kinematics in Figure ref:fig:test_id31_block_schematic_plant are correct and to check whether the system dynamics is affected by Spindle rotation of not, three identification experiments were performed: no spindle rotation, spindle rotation at $36\,\text{deg}/s$ and at $180\,\text{deg}/s$.
% The obtained dynamics from command signal $u$ to estimated strut error $\epsilon\mathcal{L}$ are displayed in Figure ref:fig:test_id31_effect_rotation.
% Both direct terms (Figure ref:fig:test_id31_effect_rotation_direct) and coupling terms (Figure ref:fig:test_id31_effect_rotation_coupling) are unaffected by the rotation.
% The same can be observed for the dynamics from command signal to encoders and to force sensors.
% This confirms that spindle's rotation has no significant effect on plant dynamics.
% This also indicates that the metrology kinematics is correct and is working in real time.
%% Identify the model dynamics with Spindle rotation
initializeSample('type', '0');
initializeReferences(...