nass-simscape/org/disturbances.org

769 lines
29 KiB
Org Mode

#+TITLE: Identification of the disturbances
:DRAWER:
#+STARTUP: overview
#+LANGUAGE: en
#+EMAIL: dehaeze.thomas@gmail.com
#+AUTHOR: Dehaeze Thomas
#+HTML_LINK_HOME: ./index.html
#+HTML_LINK_UP: ./index.html
#+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>
#+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
#+PROPERTY: header-args:matlab+ :tangle no
#+PROPERTY: header-args:matlab+ :mkdirp yes
#+PROPERTY: header-args:shell :eval no-export
#+PROPERTY: header-args:latex :headers '("\\usepackage{tikz}" "\\usepackage{import}" "\\import{$HOME/Cloud/thesis/latex/org/}{config.tex}")
#+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:
* Introduction :ignore:
:PROPERTIES:
:CUSTOM_ID: Introduction
:END:
The goal here is to extract the Power Spectral Density of the sources of perturbation.
The sources of perturbations are (schematically shown in figure [[fig:uniaxial-model-micro-station]]):
- $D_w$: Ground Motion
- Parasitic forces applied in the system when scanning with the Translation Stage and the Spindle ($F_{rz}$ and $F_{ty}$).
These forces can be due to imperfect guiding for instance.
Because we cannot measure directly the perturbation forces, we have the measure the effect of those perturbations on the system (in terms of velocity for instance using geophones, $D$ on figure [[fig:uniaxial-model-micro-station]]) and then, using a model, compute the forces that induced such velocity.
#+begin_src latex :file uniaxial-model-micro-station.pdf :post pdf2svg(file=*this*, ext="png") :exports results
\begin{tikzpicture}
% ====================
% Parameters
% ====================
\def\massw{2.2} % Width of the masses
\def\massh{0.8} % Height of the masses
\def\spaceh{1.2} % Height of the springs/dampers
\def\dispw{0.4} % Width of the dashed line for the displacement
\def\disph{0.3} % Height of the arrow for the displacements
\def\bracs{0.05} % Brace spacing vertically
\def\brach{-12pt} % Brace shift horizontaly
\def\fsensh{0.2} % Height of the force sensor
\def\velsize{0.2} % Size of the velocity sensor
% ====================
% ====================
% Ground
% ====================
\draw (-0.5*\massw, 0) -- (0.5*\massw, 0);
\draw[dashed] (0.5*\massw, 0) -- ++(1, 0);
\draw[->, dasehd] (0.5*\massw+0.8, 0) -- ++(0, 0.5) node[right]{$D_{w}$};
% ====================
% ====================
% Marble
\begin{scope}[shift={(0, 0)}]
% Mass
\draw[fill=white] (-0.5*\massw, \spaceh) rectangle (0.5*\massw, \spaceh+\massh) node[pos=0.5]{$m_{m}$};
% Spring, Damper, and Actuator
\draw[spring] (-0.4*\massw, 0) -- (-0.4*\massw, \spaceh) node[midway, left=0.1]{$k_{m}$};
\draw[damper] (0, 0) -- ( 0, \spaceh) node[midway, left=0.2]{$c_{m}$};
% Legend
\draw[decorate, decoration={brace, amplitude=8pt}, xshift=\brach] %
(-0.5*\massw, \bracs) -- (-0.5*\massw, \spaceh+\massh-\bracs) node[midway,rotate=90,anchor=south,yshift=10pt]{Marble};
% Displacements
\draw[dashed] (0.5*\massw, \spaceh+\massh) -- ++(2*\dispw, 0) coordinate(xm) -- ++(2.2*\dispw, 0) coordinate(dbot);
\end{scope}
% ====================
% ====================
% Ty
\begin{scope}[shift={(0, \spaceh+\massh)}]
% Mass
\draw[fill=white] (-0.5*\massw, \spaceh) rectangle (0.5*\massw, \spaceh+\massh) node[pos=0.5]{$m_{t}$};
% Spring, Damper, and Actuator
\draw[spring] (-0.4*\massw, 0) -- (-0.4*\massw, \spaceh) node[midway, left=0.1]{$k_{t}$};
\draw[damper] (0, 0) -- ( 0, \spaceh) node[midway, left=0.2]{$c_{t}$};
\draw[actuator={0.45}{0.2}] ( 0.4*\massw, 0) -- ( 0.4*\massw, \spaceh) node[midway, right=0.1](ft){$F_{ty}$};
% Legend
\draw[decorate, decoration={brace, amplitude=8pt}, xshift=\brach] %
(-0.5*\massw, \bracs) -- (-0.5*\massw, \spaceh+\massh-\bracs) node[midway,rotate=90,anchor=south,yshift=10pt]{Ty};
\end{scope}
% ====================
% ====================
% Rz
\begin{scope}[shift={(0, 2*(\spaceh+\massh))}]
% Mass
\draw[fill=white] (-0.5*\massw, \spaceh) rectangle (0.5*\massw, \spaceh+\massh) node[pos=0.5]{$m_{z}$};
% Spring, Damper, and Actuator
\draw[spring] (-0.4*\massw, 0) -- (-0.4*\massw, \spaceh) node[midway, left=0.1]{$k_{z}$};
\draw[damper] (0, 0) -- ( 0, \spaceh) node[midway, left=0.2]{$c_{z}$};
\draw[actuator] ( 0.4*\massw, 0) -- ( 0.4*\massw, \spaceh) node[midway, right=0.1](F){$F_{rz}$};
% Legend
\draw[decorate, decoration={brace, amplitude=8pt}, xshift=\brach] %
(-0.5*\massw, \bracs) -- (-0.5*\massw, \spaceh+\massh-\bracs) node[midway,rotate=90,anchor=south,yshift=10pt]{Rz};
\end{scope}
% ====================
% ====================
% Hexapod
\begin{scope}[shift={(0, 3*(\spaceh+\massh))}]
% Mass
\draw[fill=white] (-0.5*\massw, \spaceh) rectangle (0.5*\massw, \spaceh+\massh) node[pos=0.5]{$m_{h}$};
% Spring, Damper, and Actuator
\draw[spring] (-0.4*\massw, 0) -- (-0.4*\massw, \spaceh) node[midway, left=0.1]{$k_{h}$};
\draw[damper] (0, 0) -- ( 0, \spaceh) node[midway, left=0.2]{$c_{h}$};
% Displacements
\draw[dashed] (0.5*\massw, \spaceh+\massh) -- ++(2*\dispw, 0) coordinate(xs) -- ++(2.2*\dispw, 0) coordinate(dtop);
% Legend
\draw[decorate, decoration={brace, amplitude=8pt}, xshift=\brach] %
(-0.5*\massw, \bracs) -- (-0.5*\massw, \spaceh+\massh-\bracs) node[midway,rotate=90,anchor=south,yshift=10pt]{Hexapod};
\end{scope}
% ====================
\draw[<->] ($(dbot)+(-0.3,0)$) --node[midway, right]{$D$} ($(dtop)+(-0.3,0)$);
\end{tikzpicture}
#+end_src
#+name: fig:uniaxial-model-micro-station
#+caption: Schematic of the Micro Station and the sources of disturbance
#+RESULTS:
[[file:figs/uniaxial-model-micro-station.png]]
This file is divided in the following sections:
- Section [[sec:simscape_model]]: the simscape model used here is presented
- Section [[sec:identification]]: transfer functions from the disturbance forces to the relative velocity of the hexapod with respect to the granite are computed using the Simscape Model representing the experimental setup
- Section [[sec:sensitivity_disturbances]]: the bode plot of those transfer functions are shown
- Section [[sec:psd_dist]]: the measured PSD of the effect of the disturbances are shown
- Section [[sec:psd_force_dist]]: from the model and the measured PSD, the PSD of the disturbance forces are computed
- Section [[sec:noise_budget]]: with the computed PSD, the noise budget of the system is done
* Matlab Init :noexport:ignore:
:PROPERTIES:
:CUSTOM_ID: Matlab-Init
:END:
#+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
open('nass_model.slx')
#+end_src
* Simscape Model
:PROPERTIES:
:CUSTOM_ID: Simscape-Model
:END:
<<sec:simscape_model>>
The following Simscape model of the micro-station is the same model used for the dynamical analysis.
However, we here constrain all the stage to only move in the vertical direction.
We add disturbances forces in the vertical direction for the Translation Stage and the Spindle.
Also, we measure the absolute displacement of the granite and of the top platform of the Hexapod.
We load the configuration and we set a small =StopTime=.
#+begin_src matlab
load('mat/conf_simulink.mat');
set_param(conf_simulink, 'StopTime', '0.5');
#+end_src
We initialize all the stages without the sample nor the nano-hexapod.
The obtained system corresponds to the status micro-station when the vibration measurements were conducted.
#+begin_src matlab
initializeGround();
initializeGranite('type', 'modal-analysis');
initializeTy();
initializeRy();
initializeRz();
initializeMicroHexapod('type', 'modal-analysis');
initializeAxisc('type', 'none');
initializeMirror('type', 'none');
initializeNanoHexapod('type', 'none');
initializeSample('type', 'none');
#+end_src
Open Loop Control.
#+begin_src matlab
initializeController('type', 'open-loop');
#+end_src
We don't need gravity here.
#+begin_src matlab
initializeSimscapeConfiguration('gravity', false);
#+end_src
We log the signals.
#+begin_src matlab
initializeLoggingConfiguration('log', 'all');
#+end_src
* Identification
:PROPERTIES:
:CUSTOM_ID: Identification
:END:
<<sec:identification>>
The transfer functions from the disturbance forces to the relative velocity of the hexapod with respect to the granite are computed using the Simscape Model representing the experimental setup with the code below.
#+begin_src matlab
%% Name of the Simulink File
mdl = 'nass_model';
%% Micro-Hexapod
clear io; io_i = 1;
io(io_i) = linio([mdl, '/Disturbances'], 1, 'openinput', [], 'Dwz'); io_i = io_i + 1; % Vertical Ground Motion
io(io_i) = linio([mdl, '/Disturbances'], 1, 'openinput', [], 'Fty_z'); io_i = io_i + 1; % Parasitic force Ty
io(io_i) = linio([mdl, '/Disturbances'], 1, 'openinput', [], 'Frz_z'); io_i = io_i + 1; % Parasitic force Rz
io(io_i) = linio([mdl, '/Micro-Station/Granite/Modal Analysis/accelerometer'], 1, 'openoutput'); io_i = io_i + 1; % Absolute motion - Granite
io(io_i) = linio([mdl, '/Micro-Station/Micro Hexapod/Modal Analysis/accelerometer'], 1, 'openoutput'); io_i = io_i + 1; % Absolute Motion - Hexapod
% io(io_i) = linio([mdl, '/Vm'], 1, 'openoutput'); io_i = io_i + 1; % Relative Velocity hexapod/granite
% Run the linearization
G = linearize(mdl, io, 0);
#+end_src
We Take only the outputs corresponding to the vertical acceleration.
#+begin_src matlab
G = G([3,9], :);
% Input/Output names
G.InputName = {'Dw', 'Fty', 'Frz'};
G.OutputName = {'Agm', 'Ahm'};
#+end_src
We integrate 1 time the output to have the velocity and we substract the absolute velocities to have the relative velocity.
#+begin_src matlab
G = (1/s)*tf([-1, 1])*G;
% Input/Output names
G.InputName = {'Dw', 'Fty', 'Frz'};
G.OutputName = {'Vm'};
#+end_src
* Sensitivity to Disturbances
:PROPERTIES:
:CUSTOM_ID: Sensitivity-to-Disturbances
:END:
<<sec:sensitivity_disturbances>>
The obtained sensitivity to disturbances are shown bellow:
- The transfer function from vertical ground motion $D_w$ to the vertical relative displacement from the micro-hexapod to the granite $D$ is shown in Figure [[fig:sensitivity_dist_gm]]
- The sensitive from vertical forces applied in the Translation stage is shown in Figure [[fig:sensitivity_dist_fty]]
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
title('$D_w$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('Vm', 'Dw')/s, freqs, 'Hz'))), 'k-');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/m]'); xlabel('Frequency [Hz]');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/sensitivity_dist_gm.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:sensitivity_dist_gm
#+CAPTION: Sensitivity to Ground Motion ([[./figs/sensitivity_dist_gm.png][png]], [[./figs/sensitivity_dist_gm.pdf][pdf]])
[[file:figs/sensitivity_dist_gm.png]]
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
title('$F_{ty}$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('Vm', 'Fty')/s, freqs, 'Hz'))), 'k-');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/sensitivity_dist_fty.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:sensitivity_dist_fty
#+CAPTION: Sensitivity to vertical forces applied by the Ty stage ([[./figs/sensitivity_dist_fty.png][png]], [[./figs/sensitivity_dist_fty.pdf][pdf]])
[[file:figs/sensitivity_dist_fty.png]]
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
title('$F_{rz}$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('Vm', 'Frz')/s, freqs, 'Hz'))), 'k-');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/sensitivity_dist_frz.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:sensitivity_dist_frz
#+CAPTION: Sensitivity to vertical forces applied by the Rz stage ([[./figs/sensitivity_dist_frz.png][png]], [[./figs/sensitivity_dist_frz.pdf][pdf]])
[[file:figs/sensitivity_dist_frz.png]]
* Power Spectral Density of the effect of the disturbances
:PROPERTIES:
:CUSTOM_ID: Power-Spectral-Density-of-the-effect-of-the-disturbances
:END:
<<sec:psd_dist>>
The Power Spectral Densities of the relative velocity between the hexapod and the marble in $[(m/s)^2/Hz]$ are loaded for the following sources of disturbance:
- Slip Ring Rotation ($F_{r_z}$)
- Scan of the translation stage (effect in the vertical direction and in the horizontal direction)
Also, the Ground Motion is measured.
#+begin_src matlab
gm = load('./mat/psd_gm.mat', 'f', 'psd_gm');
rz = load('./mat/pxsp_r.mat', 'f', 'pxsp_r');
tyz = load('./mat/pxz_ty_r.mat', 'f', 'pxz_ty_r');
tyx = load('./mat/pxe_ty_r.mat', 'f', 'pxe_ty_r');
#+end_src
#+begin_src matlab :exports none
gm.f = gm.f(2:end);
rz.f = rz.f(2:end);
tyz.f = tyz.f(2:end);
tyx.f = tyx.f(2:end);
gm.psd_gm = gm.psd_gm(2:end); % PSD of Ground Motion [m^2/Hz]
rz.pxsp_r = rz.pxsp_r(2:end); % PSD of Relative Velocity [(m/s)^2/Hz]
tyz.pxz_ty_r = tyz.pxz_ty_r(2:end); % PSD of Relative Velocity [(m/s)^2/Hz]
tyx.pxe_ty_r = tyx.pxe_ty_r(2:end); % PSD of Relative Velocity [(m/s)^2/Hz]
#+end_src
We now compute the relative velocity between the hexapod and the granite due to ground motion.
#+begin_src matlab
gm.psd_rv = gm.psd_gm.*abs(squeeze(freqresp(G('Vm', 'Dw'), gm.f, 'Hz'))).^2;
#+end_src
The Power Spectral Density of the relative motion and velocity of the hexapod with respect to the granite are shown in figures [[fig:dist_effect_relative_velocity]] and [[fig:dist_effect_relative_motion]].
The Cumulative Amplitude Spectrum of the relative motion is shown in figure [[fig:dist_effect_relative_motion_cas]].
#+begin_src matlab :exports none
figure;
hold on;
plot(gm.f, sqrt(gm.psd_rv), 'DisplayName', 'Ground Motion');
plot(tyz.f, sqrt(tyz.pxz_ty_r), 'DisplayName', 'Ty');
plot(rz.f, sqrt(rz.pxsp_r), 'DisplayName', 'Rz');
hold off;
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('ASD of the measured velocity $\left[\frac{m/s}{\sqrt{Hz}}\right]$')
legend('Location', 'southwest');
xlim([2, 500]);
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/dist_effect_relative_velocity.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:dist_effect_relative_velocity
#+CAPTION: Amplitude Spectral Density of the relative velocity of the hexapod with respect to the granite due to different sources of perturbation ([[./figs/dist_effect_relative_velocity.png][png]], [[./figs/dist_effect_relative_velocity.pdf][pdf]])
[[file:figs/dist_effect_relative_velocity.png]]
#+begin_src matlab :exports none
figure;
hold on;
plot(gm.f, sqrt(gm.psd_rv)./(2*pi*gm.f), 'DisplayName', 'Ground Motion');
plot(tyz.f, sqrt(tyz.pxz_ty_r)./(2*pi*tyz.f), 'DisplayName', 'Ty');
plot(rz.f, sqrt(rz.pxsp_r)./(2*pi*rz.f), 'DisplayName', 'Rz');
hold off;
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('ASD of the displacement $\left[\frac{m}{\sqrt{Hz}}\right]$')
legend('Location', 'southwest');
xlim([2, 500]);
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/dist_effect_relative_motion.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:dist_effect_relative_motion
#+CAPTION: Amplitude Spectral Density of the relative displacement of the hexapod with respect to the granite due to different sources of perturbation ([[./figs/dist_effect_relative_motion.png][png]], [[./figs/dist_effect_relative_motion.pdf][pdf]])
[[file:figs/dist_effect_relative_motion.png]]
#+begin_src matlab :exports none
figure;
hold on;
plot(gm.f, flip(sqrt(-cumtrapz(flip(gm.f), flip(gm.psd_rv./((2*pi*gm.f).^2))))), 'DisplayName', 'Ground Motion');
plot(tyz.f, flip(sqrt(-cumtrapz(flip(tyz.f), flip(tyz.pxz_ty_r./((2*pi*tyz.f).^2))))), 'DisplayName', 'Ty');
plot(rz.f, flip(sqrt(-cumtrapz(flip(rz.f), flip(rz.pxsp_r./((2*pi*rz.f).^2))))), 'DisplayName', 'Rz');
hold off;
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('CAS of the relative displacement $[m]$')
legend('Location', 'southwest');
xlim([2, 500]); ylim([1e-11, 1e-6]);
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/dist_effect_relative_motion_cas.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:dist_effect_relative_motion_cas
#+CAPTION: Cumulative Amplitude Spectrum of the relative motion due to different sources of perturbation ([[./figs/dist_effect_relative_motion_cas.png][png]], [[./figs/dist_effect_relative_motion_cas.pdf][pdf]])
[[file:figs/dist_effect_relative_motion_cas.png]]
#+begin_important
From Figure [[fig:dist_effect_relative_motion_cas]], we can see that the translation stage and the rotation stage have almost the same effect on the position error.
Also, the ground motion has a relatively negligible effect on the position error.
#+end_important
* Compute the Power Spectral Density of the disturbance force
:PROPERTIES:
:CUSTOM_ID: Compute-the-Power-Spectral-Density-of-the-disturbance-force
:END:
<<sec:psd_force_dist>>
Using the extracted transfer functions from the disturbance force to the relative motion of the hexapod with respect to the granite (section [[sec:sensitivity_disturbances]]) and using the measured PSD of the relative motion (section [[sec:psd_dist]]), we can compute the PSD of the disturbance force.
This is done below.
#+begin_src matlab
rz.psd_f = rz.pxsp_r./abs(squeeze(freqresp(G('Vm', 'Frz'), rz.f, 'Hz'))).^2;
tyz.psd_f = tyz.pxz_ty_r./abs(squeeze(freqresp(G('Vm', 'Fty'), tyz.f, 'Hz'))).^2;
#+end_src
The obtained amplitude spectral densities of the disturbance forces are shown in Figure [[fig:dist_force_psd]].
#+begin_src matlab :exports none
figure;
hold on;
set(gca,'ColorOrderIndex',2);
plot(tyz.f, sqrt(tyz.psd_f), 'DisplayName', 'F - Ty');
plot(rz.f, sqrt(rz.psd_f), 'DisplayName', 'F - Rz');
hold off;
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('ASD of the disturbance force $\left[\frac{F}{\sqrt{Hz}}\right]$')
legend('Location', 'southwest');
xlim([2, 500]);
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/dist_force_psd.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:dist_force_psd
#+CAPTION: Amplitude Spectral Density of the disturbance force ([[./figs/dist_force_psd.png][png]], [[./figs/dist_force_psd.pdf][pdf]])
[[file:figs/dist_force_psd.png]]
* Noise Budget
:PROPERTIES:
:CUSTOM_ID: Noise-Budget
:END:
<<sec:noise_budget>>
From the obtained spectral density of the disturbance sources, we can compute the resulting relative motion of the Hexapod with respect to the granite using the model.
This is equivalent as doing the inverse that was done in the previous section.
This is done in order to verify that this is coherent with the measurements.
The power spectral density of the relative motion is computed below and the result is shown in Figure [[fig:psd_effect_dist_verif]].
We can see that this is exactly the same as the Figure [[fig:dist_effect_relative_motion]].
#+begin_src matlab
psd_gm_d = gm.psd_gm.*abs(squeeze(freqresp(G('Vm', 'Dw')/s, gm.f, 'Hz'))).^2;
psd_ty_d = tyz.psd_f.*abs(squeeze(freqresp(G('Vm', 'Fty')/s, tyz.f, 'Hz'))).^2;
psd_rz_d = rz.psd_f.*abs(squeeze(freqresp(G('Vm', 'Frz')/s, rz.f, 'Hz'))).^2;
#+end_src
#+begin_src matlab :exports none
figure;
hold on;
plot(gm.f, sqrt(psd_gm_d), 'DisplayName', 'Ground Motion');
plot(tyz.f, sqrt(psd_ty_d), 'DisplayName', 'Ty');
plot(rz.f, sqrt(psd_rz_d), 'DisplayName', 'Rz');
hold off;
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('ASD of the relative motion $\left[\frac{m}{\sqrt{Hz}}\right]$')
legend('Location', 'southwest');
xlim([2, 500]);
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/psd_effect_dist_verif.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:psd_effect_dist_verif
#+CAPTION: Computed Effect of the disturbances on the relative displacement hexapod/granite ([[./figs/psd_effect_dist_verif.png][png]], [[./figs/psd_effect_dist_verif.pdf][pdf]])
[[file:figs/psd_effect_dist_verif.png]]
* Save
:PROPERTIES:
:CUSTOM_ID: Save
:END:
The PSD of the disturbance force are now saved for further analysis.
#+begin_src matlab
dist_f = struct();
dist_f.f = gm.f; % Frequency Vector [Hz]
dist_f.psd_gm = gm.psd_gm; % Power Spectral Density of the Ground Motion [m^2/Hz]
dist_f.psd_ty = tyz.psd_f; % Power Spectral Density of the force induced by the Ty stage in the Z direction [N^2/Hz]
dist_f.psd_rz = rz.psd_f; % Power Spectral Density of the force induced by the Rz stage in the Z direction [N^2/Hz]
save('./mat/dist_psd.mat', 'dist_f');
#+end_src
* Time Domain Disturbances
Let's initialize the time domain disturbances and load them.
#+begin_src matlab
initializeDisturbances();
dist = load('nass_disturbances.mat');
#+end_src
The time domain disturbance signals are shown in Figure [[fig:disturbances_time_domain]].
#+begin_src matlab :exports none
figure;
ax1 = subplot(2, 2, 1);
hold on;
plot(dist.t, dist.Dwx, 'DisplayName', '$D_{w,x}$')
plot(dist.t, dist.Dwy, 'DisplayName', '$D_{w,y}$')
plot(dist.t, dist.Dwz, 'DisplayName', '$D_{w,z}$')
hold off;
xlabel('Time [s]');
ylabel('Ground Motion [m]');
legend();
ax2 = subplot(2, 2, 2);
hold on;
plot(dist.t, dist.Fty_x, 'DisplayName', '$F_{ty,x}$')
hold off;
xlabel('Time [s]');
ylabel('Ty Forces [N]');
legend();
ax3 = subplot(2, 2, 3);
hold on;
plot(dist.t, dist.Fty_z, 'DisplayName', '$F_{ty,z}$')
hold off;
xlabel('Time [s]');
ylabel('Ty Forces [N]');
legend();
ax4 = subplot(2, 2, 4);
hold on;
plot(dist.t, dist.Frz_z, 'DisplayName', '$F_{rz,z}$')
hold off;
xlabel('Time [s]');
ylabel('Rz Forces [N]');
legend();
linkaxes([ax1,ax2,ax3,ax4], 'x');
xlim([0, dist.t(end)]);
#+end_src
#+header: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/disturbances_time_domain.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+name: fig:disturbances_time_domain
#+caption: Disturbances in the Time Domain ([[./figs/disturbances_time_domain.png][png]], [[./figs/disturbances_time_domain.pdf][pdf]])
[[file:figs/disturbances_time_domain.png]]
* Time Domain Effect of Disturbances
** Initialization of the Experiment
We initialize all the stages with the default parameters.
#+begin_src matlab
initializeGround();
initializeGranite();
initializeTy();
initializeRy();
initializeRz();
initializeMicroHexapod();
initializeAxisc();
initializeMirror();
#+end_src
The nano-hexapod is a piezoelectric hexapod and the sample has a mass of 50kg.
#+begin_src matlab
initializeNanoHexapod('type', 'rigid');
initializeSample('mass', 1);
#+end_src
#+begin_src matlab
initializeReferences();
initializeController('type', 'open-loop');
initializeSimscapeConfiguration('gravity', false);
initializeLoggingConfiguration('log', 'all');
#+end_src
#+begin_src matlab
load('mat/conf_simulink.mat');
set_param(conf_simulink, 'StopTime', '2');
#+end_src
** Simulations
No disturbances:
#+begin_src matlab
initializeDisturbances('enable', false);
sim('nass_model');
sim_no = simout;
#+end_src
Ground Motion:
#+begin_src matlab
initializeDisturbances('Fty_x', false, 'Fty_z', false, 'Frz_z', false);
sim('nass_model');
sim_gm = simout;
#+end_src
Translation Stage Vibrations:
#+begin_src matlab
initializeDisturbances('Dwx', false, 'Dwy', false, 'Dwz', false, 'Frz_z', false);
sim('nass_model');
sim_ty = simout;
#+end_src
Rotation Stage Vibrations:
#+begin_src matlab
initializeDisturbances('Dwx', false, 'Dwy', false, 'Dwz', false, 'Fty_x', false, 'Fty_z', false);
sim('nass_model');
sim_rz = simout;
#+end_src
** Comparison
Let's now compare the effect of those perturbations on the position error of the sample (Figure [[fig:effect_disturbances_position_error]])
#+begin_src matlab :exports none
figure;
ax1 = subplot(2, 3, 1);
hold on;
plot(sim_no.Em.En.Time, sim_no.Em.En.Data(:, 1))
plot(sim_gm.Em.En.Time, sim_gm.Em.En.Data(:, 1))
plot(sim_ty.Em.En.Time, sim_ty.Em.En.Data(:, 1))
plot(sim_rz.Em.En.Time, sim_rz.Em.En.Data(:, 1))
hold off;
xlabel('Time [s]');
ylabel('Dx [m]');
ax2 = subplot(2, 3, 2);
hold on;
plot(sim_no.Em.En.Time, sim_no.Em.En.Data(:, 2))
plot(sim_gm.Em.En.Time, sim_gm.Em.En.Data(:, 2))
plot(sim_ty.Em.En.Time, sim_ty.Em.En.Data(:, 2))
plot(sim_rz.Em.En.Time, sim_rz.Em.En.Data(:, 2))
hold off;
xlabel('Time [s]');
ylabel('Dy [m]');
ax3 = subplot(2, 3, 3);
hold on;
plot(sim_no.Em.En.Time, sim_no.Em.En.Data(:, 3))
plot(sim_gm.Em.En.Time, sim_gm.Em.En.Data(:, 3))
plot(sim_ty.Em.En.Time, sim_ty.Em.En.Data(:, 3))
plot(sim_rz.Em.En.Time, sim_rz.Em.En.Data(:, 3))
hold off;
xlabel('Time [s]');
ylabel('Dz [m]');
ax4 = subplot(2, 3, 4);
hold on;
plot(sim_no.Em.En.Time, sim_no.Em.En.Data(:, 4))
plot(sim_gm.Em.En.Time, sim_gm.Em.En.Data(:, 4))
plot(sim_ty.Em.En.Time, sim_ty.Em.En.Data(:, 4))
plot(sim_rz.Em.En.Time, sim_rz.Em.En.Data(:, 4))
hold off;
xlabel('Time [s]');
ylabel('Rx [rad]');
ax5 = subplot(2, 3, 5);
hold on;
plot(sim_no.Em.En.Time, sim_no.Em.En.Data(:, 5))
plot(sim_gm.Em.En.Time, sim_gm.Em.En.Data(:, 5))
plot(sim_ty.Em.En.Time, sim_ty.Em.En.Data(:, 5))
plot(sim_rz.Em.En.Time, sim_rz.Em.En.Data(:, 5))
hold off;
xlabel('Time [s]');
ylabel('Ry [rad]');
ax6 = subplot(2, 3, 6);
hold on;
plot(sim_no.Em.En.Time, sim_no.Em.En.Data(:, 6), 'DisplayName', 'No')
plot(sim_gm.Em.En.Time, sim_gm.Em.En.Data(:, 6), 'DisplayName', 'Dw')
plot(sim_ty.Em.En.Time, sim_ty.Em.En.Data(:, 6), 'DisplayName', 'Ty')
plot(sim_rz.Em.En.Time, sim_rz.Em.En.Data(:, 6), 'DisplayName', 'Rz')
hold off;
xlabel('Time [s]');
ylabel('Rz [rad]');
legend();
linkaxes([ax1,ax2,ax3,ax4,ax5,ax6],'x');
#+end_src
#+header: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/effect_disturbances_position_error.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+name: fig:effect_disturbances_position_error
#+caption: Effect of Perturbations on the position error ([[./figs/effect_disturbances_position_error.png][png]], [[./figs/effect_disturbances_position_error.pdf][pdf]])
[[file:figs/effect_disturbances_position_error.png]]