2020-03-17 11:23:39 +01:00
#+TITLE : Simulation of Scientific Experiments
2019-12-04 10:43:38 +01:00
:DRAWER:
#+STARTUP : overview
#+LANGUAGE : en
#+EMAIL : dehaeze.thomas@gmail.com
#+AUTHOR : Dehaeze Thomas
2020-02-25 18:21:17 +01:00
#+HTML_LINK_HOME : ./index.html
#+HTML_LINK_UP : ./index.html
2019-12-04 10:43:38 +01:00
2020-02-25 18:21:17 +01:00
#+HTML_HEAD : <link rel="stylesheet" type="text/css" href="./css/htmlize.css"/>
#+HTML_HEAD : <link rel="stylesheet" type="text/css" href="./css/readtheorg.css"/>
#+HTML_HEAD : <link rel="stylesheet" type="text/css" href="./css/zenburn.css"/>
#+HTML_HEAD : <script type="text/javascript" src="./js/jquery.min.js"></script>
#+HTML_HEAD : <script type="text/javascript" src="./js/bootstrap.min.js"></script>
#+HTML_HEAD : <script type="text/javascript" src="./js/jquery.stickytableheaders.min.js"></script>
#+HTML_HEAD : <script type="text/javascript" src="./js/readtheorg.js"></script>
2019-12-04 10:43:38 +01:00
#+HTML_MATHJAX : align: center tagside: right font: TeX
#+PROPERTY : header-args:matlab :session *MATLAB*
#+PROPERTY : header-args:matlab+ :comments org
#+PROPERTY : header-args:matlab+ :results none
#+PROPERTY : header-args:matlab+ :exports both
#+PROPERTY : header-args:matlab+ :eval no-export
#+PROPERTY : header-args:matlab+ :output-dir figs
2020-02-25 18:27:39 +01:00
#+PROPERTY : header-args:matlab+ :tangle no
2019-12-04 10:43:38 +01:00
#+PROPERTY : header-args:matlab+ :mkdirp yes
#+PROPERTY : header-args:shell :eval no-export
2020-03-13 17:40:22 +01:00
#+PROPERTY : header-args:latex :headers '("\\usepackage{tikz}" "\\usepackage{import}" "\\import{$HOME/Cloud/thesis/latex/org/}{config.tex}")
2019-12-04 10:43:38 +01:00
#+PROPERTY : header-args:latex+ :imagemagick t :fit yes
#+PROPERTY : header-args:latex+ :iminoptions -scale 100% -density 150
#+PROPERTY : header-args:latex+ :imoutoptions -quality 100
#+PROPERTY : header-args:latex+ :results raw replace :buffer no
#+PROPERTY : header-args:latex+ :eval no-export
#+PROPERTY : header-args:latex+ :exports both
#+PROPERTY : header-args:latex+ :mkdirp yes
#+PROPERTY : header-args:latex+ :output-dir figs
:END:
2019-12-13 19:07:54 +01:00
* Introduction :ignore:
2020-03-17 11:23:39 +01:00
The goal here is to simulate some scientific experiments with the Simscape model when no control is applied to the nano-hexapod.
2019-12-17 18:03:21 +01:00
This has several goals:
- Validate the model
- Estimate the expected error motion for the experiments
- Estimate the stroke that we may need for the nano-hexapod
2020-03-17 11:23:39 +01:00
- Compare with experiments when control is applied
2019-12-17 18:03:21 +01:00
The document in organized as follow:
- In section [[sec:simscape_model ]] the Simscape model is initialized
- In section [[sec:tomo_no_dist ]] a tomography experiment is performed where the sample is aligned with the rotation axis. No disturbance is included
- In section [[sec:tomo_dist ]], the same is done but with disturbance included
- In section [[sec:tomo_hexa_trans ]] the micro-hexapod translate the sample such that its center of mass is no longer aligned with the rotation axis. No disturbance is included
- In section [[sec:ty_scans ]], scans with the translation stage are simulated with no perturbation included
2019-12-04 10:43:38 +01:00
* Matlab Init :noexport:ignore:
#+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name)
<<matlab-dir >>
#+end_src
#+begin_src matlab :exports none :results silent :noweb yes
<<matlab-init >>
#+end_src
#+begin_src matlab :tangle no
simulinkproject('../');
#+end_src
#+begin_src matlab
2020-02-18 13:58:27 +01:00
open('nass_model.slx');
2019-12-04 10:43:38 +01:00
#+end_src
2020-03-17 11:23:39 +01:00
* Simscape Model
<<sec:simscape_model >>
2019-12-17 08:28:20 +01:00
We load the shared simulink configuration and we set the =StopTime= .
2019-12-13 19:07:54 +01:00
#+begin_src matlab
2020-02-18 11:33:04 +01:00
load('mat/conf_simulink.mat');
2020-03-17 11:23:39 +01:00
set_param(conf_simulink, 'StopTime', '2');
2019-12-13 19:07:54 +01:00
#+end_src
2019-12-06 12:03:16 +01:00
We first initialize all the stages.
2020-03-17 11:23:39 +01:00
The nano-hexapod is considered to be a rigid body.
2019-12-04 10:43:38 +01:00
#+begin_src matlab
initializeGround();
initializeGranite();
initializeTy();
initializeRy();
initializeRz();
initializeMicroHexapod();
initializeAxisc();
initializeMirror();
2020-03-17 11:23:39 +01:00
initializeNanoHexapod('type', 'rigid');
2020-01-13 11:42:31 +01:00
initializeSample('mass', 1);
2019-12-04 10:43:38 +01:00
#+end_src
2019-12-06 12:03:16 +01:00
We initialize the reference path for all the stages.
2019-12-13 19:07:54 +01:00
All stage is set to its zero position except the Spindle which is rotating at 60rpm.
2019-12-04 10:43:38 +01:00
#+begin_src matlab
2020-01-13 11:42:31 +01:00
initializeReferences('Rz_type', 'rotating', 'Rz_period', 1);
2019-12-04 10:43:38 +01:00
#+end_src
2020-03-17 11:23:39 +01:00
No controller is used (Open Loop).
#+begin_src matlab
initializeController('type', 'open-loop');
#+end_src
And we put some gravity.
#+begin_src matlab
initializeSimscapeConfiguration('gravity', true);
#+end_src
We log the signals for further analysis.
#+begin_src matlab
initializeLoggingConfiguration('log', 'all');
#+end_src
2019-12-17 18:03:21 +01:00
* Tomography Experiment with no disturbances
<<sec:tomo_no_dist >>
** Introduction :ignore:
2020-03-17 11:23:39 +01:00
In this section, a tomography experiment is performed with the sample aligned with the rotation axis.
No disturbance is included.
2019-12-17 18:03:21 +01:00
** Simulation Setup
2019-12-17 08:28:20 +01:00
And we initialize the disturbances to be equal to zero.
2019-12-04 10:43:38 +01:00
#+begin_src matlab
2020-01-21 15:49:02 +01:00
initializeDisturbances(...
2019-12-13 19:07:54 +01:00
'Dwx', false, ... % Ground Motion - X direction
'Dwy', false, ... % Ground Motion - Y direction
'Dwz', false, ... % Ground Motion - Z direction
'Fty_x', false, ... % Translation Stage - X direction
'Fty_z', false, ... % Translation Stage - Z direction
'Frz_z', false ... % Spindle - Z direction
2020-01-13 11:42:31 +01:00
);
2019-12-04 10:43:38 +01:00
#+end_src
2019-12-17 08:28:20 +01:00
We simulate the model.
2019-12-04 10:43:38 +01:00
#+begin_src matlab
2020-02-18 13:58:27 +01:00
sim('nass_model');
2019-12-13 19:07:54 +01:00
#+end_src
2019-12-17 08:28:20 +01:00
And we save the obtained data.
2019-12-13 19:07:54 +01:00
#+begin_src matlab
2020-03-17 11:23:39 +01:00
tomo_align_no_dist = simout;
2020-03-13 17:40:22 +01:00
save('./mat/experiment_tomography.mat', 'tomo_align_no_dist', '-append');
2019-12-13 19:07:54 +01:00
#+end_src
2019-12-17 08:28:20 +01:00
** Analysis
2019-12-17 18:03:21 +01:00
#+begin_src matlab
2020-03-13 17:40:22 +01:00
load('./mat/experiment_tomography.mat', 'tomo_align_no_dist');
2019-12-17 18:03:21 +01:00
t = tomo_align_no_dist.t;
MTr = tomo_align_no_dist.MTr;
#+end_src
2019-12-13 19:07:54 +01:00
#+begin_src matlab
2019-12-17 08:28:20 +01:00
Edx = squeeze(MTr(1, 4, :));
Edy = squeeze(MTr(2, 4, :));
Edz = squeeze(MTr(3, 4, :));
% The angles obtained are u-v-w Euler angles (rotations in the moving frame)
Ery = atan2( squeeze(MTr(1, 3, :)), squeeze(sqrt(MTr(1, 1, :).^2 + MTr(1, 2, :).^2)));
Erx = atan2(-squeeze(MTr(2, 3, :))./cos(Ery), squeeze(MTr(3, 3, :))./cos(Ery));
Erz = atan2(-squeeze(MTr(1, 2, :))./cos(Ery), squeeze(MTr(1, 1, :))./cos(Ery));
#+end_src
#+begin_src matlab :exports none
2019-12-13 19:07:54 +01:00
figure;
2019-12-17 18:03:21 +01:00
ax1 = subplot(1, 3, 1);
2019-12-17 08:28:20 +01:00
plot(t, Edx, 'DisplayName', '$\epsilon_{x}$')
2019-12-17 18:03:21 +01:00
ylabel('Displacement [m]');
legend('location', 'northeast');
ax2 = subplot(1, 3, 2);
2019-12-17 08:28:20 +01:00
plot(t, Edy, 'DisplayName', '$\epsilon_{y}$')
2019-12-17 18:03:21 +01:00
xlabel('Time [s]');
legend('location', 'northeast');
ax3 = subplot(1, 3, 3);
2019-12-17 08:28:20 +01:00
plot(t, Edz, 'DisplayName', '$\epsilon_{z}$')
2019-12-13 19:07:54 +01:00
legend('location', 'northeast');
2019-12-17 18:03:21 +01:00
linkaxes([ax1,ax2,ax3],'x');
2019-12-19 12:48:12 +01:00
xlim([2, inf]);
2019-12-04 10:43:38 +01:00
#+end_src
2019-12-13 19:07:54 +01:00
#+HEADER : :tangle no :exports results :results none :noweb yes
2019-12-17 18:03:21 +01:00
#+begin_src matlab :var filepath="figs/exp_tomo_without_dist_trans.pdf" :var figsize= "full-normal" :post pdf2svg(file=*this*, ext= "png")
2019-12-13 19:07:54 +01:00
<<plt-matlab >>
#+end_src
#+NAME : fig:exp_tomo_without_dist_trans
#+CAPTION : X-Y-Z translation of the sample w.r.t. granite when performing tomography experiment with no disturbances ([[./figs/exp_tomo_without_dist_trans.png][png]], [[./figs/exp_tomo_without_dist_trans.pdf][pdf]])
[[file:figs/exp_tomo_without_dist_trans.png ]]
2019-12-17 08:28:20 +01:00
#+begin_src matlab :exports none
figure;
2019-12-17 18:03:21 +01:00
ax1 = subplot(1, 3, 1);
2019-12-17 08:28:20 +01:00
plot(t, Erx, 'DisplayName', '$\epsilon_{\theta x}$')
2019-12-17 18:03:21 +01:00
ylabel('Rotation [rad]');
legend('location', 'northeast');
ax2 = subplot(1, 3, 2);
2019-12-17 08:28:20 +01:00
plot(t, Ery, 'DisplayName', '$\epsilon_{\theta y}$')
2019-12-17 18:03:21 +01:00
xlabel('Time [s]');
legend('location', 'northeast');
ax3 = subplot(1, 3, 3);
2019-12-17 08:28:20 +01:00
plot(t, Erz, 'DisplayName', '$\epsilon_{\theta z}$')
legend('location', 'northeast');
2019-12-17 18:03:21 +01:00
linkaxes([ax1,ax2,ax3],'x');
2019-12-19 12:48:12 +01:00
xlim([2, inf]);
2019-12-17 08:28:20 +01:00
#+end_src
#+HEADER : :tangle no :exports results :results none :noweb yes
2019-12-17 18:03:21 +01:00
#+begin_src matlab :var filepath="figs/exp_tomo_without_dist_rot.pdf" :var figsize= "full-tall" :post pdf2svg(file=*this*, ext= "png")
2019-12-17 08:28:20 +01:00
<<plt-matlab >>
#+end_src
2019-12-13 19:07:54 +01:00
2019-12-17 08:28:20 +01:00
#+NAME : fig:exp_tomo_without_dist_rot
#+CAPTION : X-Y-Z rotations of the sample w.r.t. granite when performing tomography experiment with no disturbances ([[./figs/exp_tomo_without_dist_rot.png][png]], [[./figs/exp_tomo_without_dist_rot.pdf][pdf]])
[[file:figs/exp_tomo_without_dist_rot.png ]]
2019-12-13 19:07:54 +01:00
2019-12-17 18:03:21 +01:00
** Conclusion
#+begin_important
When everything is aligned, the resulting error motion is very small (nm range) and is quite negligible with respect to the error when disturbances are included.
This residual error motion probably comes from a small misalignment somewhere.
#+end_important
* Tomography Experiment with included perturbations
<<sec:tomo_dist >>
** Introduction :ignore:
2020-03-17 11:23:39 +01:00
In this section, we also perform a tomography experiment with the sample's center of mass aligned with the rotation axis.
However this time, we include perturbations such as ground motion and stage vibrations.
2019-12-17 18:03:21 +01:00
2019-12-17 08:28:20 +01:00
** Simulation Setup
We now activate the disturbances.
2019-12-04 10:43:38 +01:00
#+begin_src matlab
2020-01-21 15:49:02 +01:00
initializeDisturbances(...
2019-12-13 19:07:54 +01:00
'Dwx', true, ... % Ground Motion - X direction
'Dwy', true, ... % Ground Motion - Y direction
'Dwz', true, ... % Ground Motion - Z direction
'Fty_x', true, ... % Translation Stage - X direction
'Fty_z', true, ... % Translation Stage - Z direction
'Frz_z', true ... % Spindle - Z direction
2020-01-13 11:42:31 +01:00
);
2019-12-04 10:43:38 +01:00
#+end_src
2019-12-17 08:28:20 +01:00
We simulate the model.
2019-12-04 10:43:38 +01:00
#+begin_src matlab
2020-02-18 13:58:27 +01:00
sim('nass_model');
2019-12-04 10:43:38 +01:00
#+end_src
2019-12-17 08:28:20 +01:00
And we save the obtained data.
2019-12-13 19:07:54 +01:00
#+begin_src matlab
2019-12-17 18:03:21 +01:00
tomo_align_dist = struct('t', t, 'MTr', MTr);
2020-03-13 17:40:22 +01:00
save('./mat/experiment_tomography.mat', 'tomo_align_dist', '-append');
2019-12-17 08:28:20 +01:00
#+end_src
** Analysis
2019-12-17 18:03:21 +01:00
#+begin_src matlab
2020-03-13 17:40:22 +01:00
load('./mat/experiment_tomography.mat', 'tomo_align_dist');
2019-12-17 18:03:21 +01:00
t = tomo_align_dist.t;
MTr = tomo_align_dist.MTr;
#+end_src
2019-12-17 08:28:20 +01:00
#+begin_src matlab
Edx = squeeze(MTr(1, 4, :));
Edy = squeeze(MTr(2, 4, :));
Edz = squeeze(MTr(3, 4, :));
% The angles obtained are u-v-w Euler angles (rotations in the moving frame)
Ery = atan2( squeeze(MTr(1, 3, :)), squeeze(sqrt(MTr(1, 1, :).^2 + MTr(1, 2, :).^2)));
Erx = atan2(-squeeze(MTr(2, 3, :))./cos(Ery), squeeze(MTr(3, 3, :))./cos(Ery));
Erz = atan2(-squeeze(MTr(1, 2, :))./cos(Ery), squeeze(MTr(1, 1, :))./cos(Ery));
#+end_src
#+begin_src matlab :exports none
2019-12-13 19:07:54 +01:00
figure;
2019-12-17 18:03:21 +01:00
ax1 = subplot(1, 3, 1);
2019-12-17 08:28:20 +01:00
plot(t, Edx, 'DisplayName', '$\epsilon_{x}$')
2019-12-17 18:03:21 +01:00
ylabel('Displacement [m]');
legend('location', 'northeast');
ax2 = subplot(1, 3, 2);
2019-12-17 08:28:20 +01:00
plot(t, Edy, 'DisplayName', '$\epsilon_{y}$')
2019-12-17 18:03:21 +01:00
xlabel('Time [s]');
legend('location', 'northeast');
ax3 = subplot(1, 3, 3);
2019-12-17 08:28:20 +01:00
plot(t, Edz, 'DisplayName', '$\epsilon_{z}$')
2019-12-13 19:07:54 +01:00
legend('location', 'northeast');
2019-12-17 18:03:21 +01:00
linkaxes([ax1,ax2,ax3],'x');
2019-12-19 12:48:12 +01:00
xlim([2, inf]);
2019-12-13 19:07:54 +01:00
#+end_src
#+HEADER : :tangle no :exports results :results none :noweb yes
2019-12-17 18:03:21 +01:00
#+begin_src matlab :var filepath="figs/exp_tomo_dist_trans.pdf" :var figsize= "full-normal" :post pdf2svg(file=*this*, ext= "png")
2019-12-13 19:07:54 +01:00
<<plt-matlab >>
#+end_src
2019-12-04 10:43:38 +01:00
2019-12-13 19:07:54 +01:00
#+NAME : fig:exp_tomo_dist_trans
#+CAPTION : X-Y-Z translation of the sample w.r.t. the granite when performing tomography experiment with disturbances ([[./figs/exp_tomo_dist_trans.png][png]], [[./figs/exp_tomo_dist_trans.pdf][pdf]])
[[file:figs/exp_tomo_dist_trans.png ]]
2019-12-17 08:28:20 +01:00
#+begin_src matlab :exports none
figure;
2019-12-17 18:03:21 +01:00
ax1 = subplot(1, 3, 1);
2019-12-17 08:28:20 +01:00
plot(t, Erx, 'DisplayName', '$\epsilon_{\theta x}$')
2019-12-17 18:03:21 +01:00
ylabel('Rotation [rad]');
legend('location', 'northeast');
ax2 = subplot(1, 3, 2);
2019-12-17 08:28:20 +01:00
plot(t, Ery, 'DisplayName', '$\epsilon_{\theta y}$')
2019-12-17 18:03:21 +01:00
xlabel('Time [s]');
legend('location', 'northeast');
ax3 = subplot(1, 3, 3);
2019-12-17 08:28:20 +01:00
plot(t, Erz, 'DisplayName', '$\epsilon_{\theta z}$')
legend('location', 'northeast');
2019-12-17 18:03:21 +01:00
linkaxes([ax1,ax2,ax3],'x');
2019-12-19 12:48:12 +01:00
xlim([2, inf]);
2019-12-17 08:28:20 +01:00
#+end_src
#+HEADER : :tangle no :exports results :results none :noweb yes
2019-12-17 18:03:21 +01:00
#+begin_src matlab :var filepath="figs/exp_tomo_dist_rot.pdf" :var figsize= "full-normal" :post pdf2svg(file=*this*, ext= "png")
2019-12-17 08:28:20 +01:00
<<plt-matlab >>
#+end_src
#+NAME : fig:exp_tomo_dist_rot
#+CAPTION : X-Y-Z rotations of the sample w.r.t. the granite when performing tomography experiment with disturbances ([[./figs/exp_tomo_dist_rot.png][png]], [[./figs/exp_tomo_dist_rot.pdf][pdf]])
[[file:figs/exp_tomo_dist_rot.png ]]
2019-12-17 18:03:21 +01:00
** Conclusion
#+begin_important
Error motion is what expected from the disturbance measurements.
#+end_important
* Tomography when the micro-hexapod is not centered
<<sec:tomo_hexa_trans >>
** Introduction :ignore:
2020-03-17 11:23:39 +01:00
In this section, the sample's center of mass is not aligned with the rotation axis anymore.
This is due to the fact that the micro-hexapod has performed some displacement.
No disturbances are included.
2019-12-17 18:03:21 +01:00
2019-12-17 08:28:20 +01:00
** Simulation Setup
We first set the wanted translation of the Micro Hexapod.
#+begin_src matlab
P_micro_hexapod = [0.01; 0; 0]; % [m]
#+end_src
We initialize the reference path.
#+begin_src matlab
2020-01-13 11:42:31 +01:00
initializeReferences('Dh_pos', [P_micro_hexapod; 0; 0; 0], 'Rz_type', 'rotating', 'Rz_period', 1);
2019-12-17 08:28:20 +01:00
#+end_src
We initialize the stages.
#+begin_src matlab
2020-01-13 11:42:31 +01:00
initializeMicroHexapod('AP', P_micro_hexapod);
2019-12-17 08:28:20 +01:00
#+end_src
And we initialize the disturbances to zero.
#+begin_src matlab
2020-01-21 15:49:02 +01:00
initializeDisturbances(...
2019-12-17 08:28:20 +01:00
'Dwx', false, ... % Ground Motion - X direction
'Dwy', false, ... % Ground Motion - Y direction
'Dwz', false, ... % Ground Motion - Z direction
'Fty_x', false, ... % Translation Stage - X direction
'Fty_z', false, ... % Translation Stage - Z direction
'Frz_z', false ... % Spindle - Z direction
2020-01-13 11:42:31 +01:00
);
2019-12-17 08:28:20 +01:00
#+end_src
We simulate the model.
#+begin_src matlab
2020-02-18 13:58:27 +01:00
sim('nass_model');
2019-12-17 08:28:20 +01:00
#+end_src
And we save the obtained data.
#+begin_src matlab
2019-12-17 18:03:21 +01:00
tomo_not_align = struct('t', t, 'MTr', MTr);
2020-03-13 17:40:22 +01:00
save('./mat/experiment_tomography.mat', 'tomo_not_align', '-append');
2019-12-17 08:28:20 +01:00
#+end_src
** Analysis
2019-12-17 18:03:21 +01:00
#+begin_src matlab
2020-03-13 17:40:22 +01:00
load('./mat/experiment_tomography.mat', 'tomo_not_align');
2019-12-17 18:03:21 +01:00
t = tomo_not_align.t;
MTr = tomo_not_align.MTr;
#+end_src
2019-12-17 08:28:20 +01:00
#+begin_src matlab
Edx = squeeze(MTr(1, 4, :));
Edy = squeeze(MTr(2, 4, :));
Edz = squeeze(MTr(3, 4, :));
% The angles obtained are u-v-w Euler angles (rotations in the moving frame)
Ery = atan2( squeeze(MTr(1, 3, :)), squeeze(sqrt(MTr(1, 1, :).^2 + MTr(1, 2, :).^2)));
Erx = atan2(-squeeze(MTr(2, 3, :))./cos(Ery), squeeze(MTr(3, 3, :))./cos(Ery));
Erz = atan2(-squeeze(MTr(1, 2, :))./cos(Ery), squeeze(MTr(1, 1, :))./cos(Ery));
#+end_src
#+begin_src matlab :exports none
figure;
2019-12-17 18:03:21 +01:00
ax1 = subplot(1, 3, 1);
2019-12-17 08:28:20 +01:00
plot(t, Edx, 'DisplayName', '$\epsilon_{x}$')
2019-12-17 18:03:21 +01:00
ylabel('Displacement [m]');
legend('location', 'northeast');
ax2 = subplot(1, 3, 2);
2019-12-17 08:28:20 +01:00
plot(t, Edy, 'DisplayName', '$\epsilon_{y}$')
2019-12-17 18:03:21 +01:00
xlabel('Time [s]');
legend('location', 'northeast');
ax3 = subplot(1, 3, 3);
2019-12-17 08:28:20 +01:00
plot(t, Edz, 'DisplayName', '$\epsilon_{z}$')
legend('location', 'northeast');
2019-12-17 18:03:21 +01:00
linkaxes([ax1,ax2,ax3],'x');
2019-12-19 12:48:12 +01:00
xlim([2, inf]);
2019-12-17 08:28:20 +01:00
#+end_src
#+HEADER : :tangle no :exports results :results none :noweb yes
2019-12-17 18:03:21 +01:00
#+begin_src matlab :var filepath="figs/exp_tomo_offset_trans.pdf" :var figsize= "full-normal" :post pdf2svg(file=*this*, ext= "png")
2019-12-17 08:28:20 +01:00
<<plt-matlab >>
#+end_src
#+NAME : fig:exp_tomo_offset_trans
#+CAPTION : X-Y-Z translation of the sample w.r.t. granite when performing tomography experiment with no disturbances ([[./figs/exp_tomo_offset_trans.png][png]], [[./figs/exp_tomo_offset_trans.pdf][pdf]])
[[file:figs/exp_tomo_offset_trans.png ]]
#+begin_src matlab :exports none
figure;
2019-12-17 18:03:21 +01:00
ax1 = subplot(1, 3, 1);
2019-12-17 08:28:20 +01:00
plot(t, Erx, 'DisplayName', '$\epsilon_{\theta x}$')
2019-12-17 18:03:21 +01:00
ylabel('Rotation [rad]');
legend('location', 'northeast');
ax2 = subplot(1, 3, 2);
2019-12-17 08:28:20 +01:00
plot(t, Ery, 'DisplayName', '$\epsilon_{\theta y}$')
2019-12-17 18:03:21 +01:00
xlabel('Time [s]');
legend('location', 'northeast');
ax3 = subplot(1, 3, 3);
2019-12-17 08:28:20 +01:00
plot(t, Erz, 'DisplayName', '$\epsilon_{\theta z}$')
legend('location', 'northeast');
2019-12-17 18:03:21 +01:00
linkaxes([ax1,ax2,ax3],'x');
2019-12-19 12:48:12 +01:00
xlim([2, inf]);
2019-12-17 08:28:20 +01:00
#+end_src
#+HEADER : :tangle no :exports results :results none :noweb yes
2019-12-17 18:03:21 +01:00
#+begin_src matlab :var filepath="figs/exp_tomo_offset_rot.pdf" :var figsize= "full-normal" :post pdf2svg(file=*this*, ext= "png")
2019-12-17 08:28:20 +01:00
<<plt-matlab >>
#+end_src
#+NAME : fig:exp_tomo_offset_rot
#+CAPTION : X-Y-Z rotations of the sample w.r.t. granite when performing tomography experiment with no disturbances ([[./figs/exp_tomo_offset_rot.png][png]], [[./figs/exp_tomo_offset_rot.pdf][pdf]])
[[file:figs/exp_tomo_offset_rot.png ]]
2019-12-17 18:03:21 +01:00
** Conclusion
2019-12-04 10:43:38 +01:00
2019-12-17 18:03:21 +01:00
#+begin_important
The main motions are translations in the X direction of the mobile platform (corresponds to the eccentricity of the micro-hexapod) and rotations along the rotating Y axis.
#+end_important
2019-12-04 10:43:38 +01:00
2019-12-17 18:03:21 +01:00
* Raster Scans with the translation stage
<<sec:ty_scans >>
** Introduction :ignore:
2020-03-17 11:23:39 +01:00
In this section, scans with the translation stage are performed.
2019-12-04 10:43:38 +01:00
2019-12-17 18:03:21 +01:00
** Simulation Setup
We set the reference path.
2019-12-04 10:43:38 +01:00
#+begin_src matlab
2020-01-13 11:42:31 +01:00
initializeReferences('Dy_type', 'triangular', 'Dy_amplitude', 10e-3, 'Dy_period', 1);
2019-12-04 10:43:38 +01:00
#+end_src
2019-12-17 18:03:21 +01:00
We initialize the stages.
2019-12-04 10:43:38 +01:00
#+begin_src matlab
2019-12-17 18:03:21 +01:00
initializeGround();
initializeGranite();
initializeTy();
initializeRy();
initializeRz();
initializeMicroHexapod();
initializeAxisc();
initializeMirror();
2020-01-13 11:42:31 +01:00
initializeNanoHexapod('actuator', 'piezo');
initializeSample('mass', 1);
2019-12-04 10:43:38 +01:00
#+end_src
2019-12-17 18:03:21 +01:00
And we initialize the disturbances to zero.
2019-12-04 10:43:38 +01:00
#+begin_src matlab
2020-01-21 15:49:02 +01:00
initializeDisturbances(...
2019-12-17 18:03:21 +01:00
'Dwx', false, ... % Ground Motion - X direction
'Dwy', false, ... % Ground Motion - Y direction
'Dwz', false, ... % Ground Motion - Z direction
'Fty_x', false, ... % Translation Stage - X direction
'Fty_z', false, ... % Translation Stage - Z direction
'Frz_z', false ... % Spindle - Z direction
2020-01-13 11:42:31 +01:00
);
2019-12-04 10:43:38 +01:00
#+end_src
2019-12-17 18:03:21 +01:00
We simulate the model.
2019-12-04 10:43:38 +01:00
#+begin_src matlab
2020-02-18 13:58:27 +01:00
sim('nass_model');
2019-12-04 10:43:38 +01:00
#+end_src
2019-12-17 18:03:21 +01:00
And we save the obtained data.
2019-12-04 10:43:38 +01:00
#+begin_src matlab
2019-12-17 18:03:21 +01:00
ty_scan = struct('t', t, 'MTr', MTr);
2020-03-13 17:40:22 +01:00
save('./mat/experiment_tomography.mat', 'ty_scan', '-append');
2019-12-04 10:43:38 +01:00
#+end_src
2019-12-17 18:03:21 +01:00
** Analysis
2019-12-04 10:43:38 +01:00
#+begin_src matlab
2020-03-13 17:40:22 +01:00
load('./mat/experiment_tomography.mat', 'ty_scan');
2019-12-17 18:03:21 +01:00
t = ty_scan.t;
MTr = ty_scan.MTr;
2019-12-04 10:43:38 +01:00
#+end_src
#+begin_src matlab
2019-12-17 18:03:21 +01:00
Edx = squeeze(MTr(1, 4, :));
Edy = squeeze(MTr(2, 4, :));
Edz = squeeze(MTr(3, 4, :));
% The angles obtained are u-v-w Euler angles (rotations in the moving frame)
Ery = atan2( squeeze(MTr(1, 3, :)), squeeze(sqrt(MTr(1, 1, :).^2 + MTr(1, 2, :).^2)));
Erx = atan2(-squeeze(MTr(2, 3, :))./cos(Ery), squeeze(MTr(3, 3, :))./cos(Ery));
Erz = atan2(-squeeze(MTr(1, 2, :))./cos(Ery), squeeze(MTr(1, 1, :))./cos(Ery));
2019-12-04 10:43:38 +01:00
#+end_src
2019-12-17 18:03:21 +01:00
#+begin_src matlab :exports none
figure;
ax1 = subplot(1, 3, 1);
plot(t, Edx, 'DisplayName', '$\epsilon_{x}$')
ylabel('Displacement [m]');
legend('location', 'northeast');
2019-12-04 10:43:38 +01:00
2019-12-17 18:03:21 +01:00
ax2 = subplot(1, 3, 2);
plot(t, Edy, 'DisplayName', '$\epsilon_{y}$')
xlabel('Time [s]');
legend('location', 'northeast');
2019-12-04 10:43:38 +01:00
2019-12-17 18:03:21 +01:00
ax3 = subplot(1, 3, 3);
plot(t, Edz, 'DisplayName', '$\epsilon_{z}$')
legend('location', 'northeast');
2019-12-04 10:43:38 +01:00
2019-12-17 18:03:21 +01:00
linkaxes([ax1,ax2,ax3],'x');
2019-12-19 12:48:12 +01:00
xlim([2, inf]);
2019-12-04 10:43:38 +01:00
#+end_src
2019-12-17 18:03:21 +01:00
#+HEADER : :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/exp_ty_scan_trans.pdf" :var figsize= "full-normal" :post pdf2svg(file=*this*, ext= "png")
<<plt-matlab >>
2019-12-04 10:43:38 +01:00
#+end_src
2019-12-17 18:03:21 +01:00
#+NAME : fig:exp_ty_scan_trans
#+CAPTION : X-Y-Z translation of the sample w.r.t. granite when performing tomography experiment with no disturbances ([[./figs/exp_ty_scan_trans.png][png]], [[./figs/exp_ty_scan_trans.pdf][pdf]])
[[file:figs/exp_ty_scan_trans.png ]]
2019-12-04 10:43:38 +01:00
2019-12-17 18:03:21 +01:00
#+begin_src matlab :exports none
figure;
ax1 = subplot(1, 3, 1);
plot(t, Erx, 'DisplayName', '$\epsilon_{\theta x}$')
ylabel('Rotation [rad]');
legend('location', 'northeast');
2019-12-04 10:43:38 +01:00
2019-12-17 18:03:21 +01:00
ax2 = subplot(1, 3, 2);
plot(t, Ery, 'DisplayName', '$\epsilon_{\theta y}$')
xlabel('Time [s]');
legend('location', 'northeast');
2019-12-04 10:43:38 +01:00
2019-12-17 18:03:21 +01:00
ax3 = subplot(1, 3, 3);
plot(t, Erz, 'DisplayName', '$\epsilon_{\theta z}$')
legend('location', 'northeast');
2019-12-04 10:43:38 +01:00
2019-12-17 18:03:21 +01:00
linkaxes([ax1,ax2,ax3],'x');
2019-12-19 12:48:12 +01:00
xlim([2, inf]);
2019-12-04 10:43:38 +01:00
#+end_src
2019-12-17 18:03:21 +01:00
#+HEADER : :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/exp_ty_scan_rot.pdf" :var figsize= "full-normal" :post pdf2svg(file=*this*, ext= "png")
<<plt-matlab >>
2019-12-04 10:43:38 +01:00
#+end_src
2019-12-17 18:03:21 +01:00
#+NAME : fig:exp_ty_scan_rot
#+CAPTION : X-Y-Z rotations of the sample w.r.t. granite when performing tomography experiment with no disturbances ([[./figs/exp_ty_scan_rot.png][png]], [[./figs/exp_ty_scan_rot.pdf][pdf]])
[[file:figs/exp_ty_scan_rot.png ]]
** Conclusion
2019-12-06 12:03:16 +01:00
2019-12-17 18:03:21 +01:00
#+begin_important
This is logic that the main error moving is translation along the Y axis and rotation along the X axis.
In order to reduce the errors, we can make a smoother reference path for the translation stage.
#+end_important