Rework the disturbance file

This commit is contained in:
2020-03-17 11:23:17 +01:00
parent f69edd6dce
commit c7207b96cb
9 changed files with 149 additions and 278 deletions

View File

@@ -54,7 +54,6 @@ The sources of perturbations are (schematically shown in figure [[fig:uniaxial-m
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}
% ====================
@@ -212,7 +211,8 @@ We load the configuration and we set a small =StopTime=.
set_param(conf_simulink, 'StopTime', '0.5');
#+end_src
We initialize all the stages.
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');
@@ -226,6 +226,21 @@ We initialize all the stages.
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
@@ -234,38 +249,34 @@ We initialize all the stages.
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
%% Options for Linearized
options = linearizeOptions;
options.SampleTime = 0;
%% Name of the Simulink File
mdl = 'nass_model';
#+end_src
#+begin_src matlab
%% Micro-Hexapod
%% 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
#+end_src
#+begin_src matlab
% Run the linearization
G = linearize(mdl, io, 0);
#+end_src
% We Take only the outputs corresponding to the vertical acceleration
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
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
@@ -279,6 +290,10 @@ The transfer functions from the disturbance forces to the relative velocity of t
: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);
@@ -349,8 +364,9 @@ The transfer functions from the disturbance forces to the relative velocity of t
:CUSTOM_ID: Power-Spectral-Density-of-the-effect-of-the-disturbances
:END:
<<sec:psd_dist>>
The PSD 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
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.
@@ -369,7 +385,6 @@ Also, the Ground Motion is measured.
tyx.f = tyx.f(2:end);
gm.psd_gm = gm.psd_gm(2:end); % PSD of Ground Motion [m^2/Hz]
gm.psd_gv = gm.psd_gv(2:end); % PSD of Ground Velocity [(m/s)^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]
@@ -380,7 +395,7 @@ We now compute the relative velocity between the hexapod and the granite due to
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/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 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]].
@@ -451,19 +466,27 @@ The Cumulative Amplitude Spectrum of the relative motion is shown in figure [[fi
#+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>>
Now, from 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 from the measured PSD of the relative motion (section [[sec:psd_dist]]), we can compute the PSD of the disturbance force.
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;
@@ -492,11 +515,14 @@ Now, from the extracted transfer functions from the disturbance force to the rel
:END:
<<sec:noise_budget>>
Now, from the compute spectral density of the disturbance sources, we can compute the resulting relative motion of the Hexapod with respect to the granite using the model.
We should verify that this is coherent with the measurements.
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.
#+begin_src matlab :exports none
% Power Spectral Density of the relative Displacement
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;
@@ -508,7 +534,6 @@ We should verify that this is coherent with the measurements.
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');
plot(rz.f, sqrt(psd_gm_d + psd_ty_d + psd_rz_d), 'k--', 'DisplayName', 'tot');
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]$')
@@ -525,30 +550,6 @@ We should verify that this is coherent with the measurements.
#+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]]
#+begin_src matlab :exports none
figure;
hold on;
plot(gm.f, flip(sqrt(-cumtrapz(flip(gm.f), flip(psd_gm_d)))), 'DisplayName', 'Ground Motion');
plot(gm.f, flip(sqrt(-cumtrapz(flip(gm.f), flip(psd_ty_d)))), 'DisplayName', 'Ty');
plot(gm.f, flip(sqrt(-cumtrapz(flip(gm.f), flip(psd_rz_d)))), 'DisplayName', 'Rz');
plot(gm.f, flip(sqrt(-cumtrapz(flip(gm.f), flip(psd_gm_d + psd_ty_d + psd_rz_d)))), 'k-', 'DisplayName', 'tot');
hold off;
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('Cumulative Amplitude Spectrum [m]')
legend('location', 'northeast');
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/cas_computed_relative_displacement.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:cas_computed_relative_displacement
#+CAPTION: CAS of the total Relative Displacement due to all considered sources of perturbation ([[./figs/cas_computed_relative_displacement.png][png]], [[./figs/cas_computed_relative_displacement.pdf][pdf]])
[[file:figs/cas_computed_relative_displacement.png]]
* Save
:PROPERTIES:
:CUSTOM_ID: Save
@@ -567,82 +568,3 @@ The PSD of the disturbance force are now saved for further analysis.
save('./mat/dist_psd.mat', 'dist_f');
#+end_src
* Error motion of the Sample without Control
#+begin_src matlab
initializeGround();
initializeGranite('Foffset', false);
initializeTy('Foffset', false);
initializeRy('Foffset', false);
initializeRz('Foffset', false);
initializeMicroHexapod('Foffset', false);
initializeAxisc('type', 'rigid');
initializeMirror('type', 'rigid');
#+end_src
The nano-hexapod is a piezoelectric hexapod and the sample has a mass of 50kg.
#+begin_src matlab
initializeNanoHexapod('type', 'rigid');
initializeSample('type', 'rigid', 'mass', 50);
#+end_src
We set the references and disturbances to zero.
#+begin_src matlab
initializeReferences();
initializeDisturbances();
#+end_src
We set the controller type to Open-Loop.
#+begin_src matlab
initializeController('type', 'open-loop');
#+end_src
And we put some gravity.
#+begin_src matlab
initializeSimscapeConfiguration('gravity', false);
#+end_src
We do not need to log any signal.
#+begin_src matlab
initializeLoggingConfiguration('log', 'all');
#+end_src
#+begin_src matlab
initializePosError('error', false);
#+end_src
#+begin_src matlab
load('mat/conf_simulink.mat');
set_param(conf_simulink, 'StopTime', '1');
#+end_src
We simulate the model.
#+begin_src matlab
sim('nass_model');
#+end_src
#+begin_src matlab
figure;
subplot(1, 2, 1);
hold on;
plot(simout.Em.Eg.Time, simout.Em.Eg.Data(:, 1), 'DisplayName', 'X');
plot(simout.Em.Eg.Time, simout.Em.Eg.Data(:, 2), 'DisplayName', 'Y');
plot(simout.Em.Eg.Time, simout.Em.Eg.Data(:, 3), 'DisplayName', 'Z');
hold off;
xlabel('Time [s]');
ylabel('Position error [m]');
legend();
subplot(1, 2, 2);
hold on;
plot(simout.Em.Eg.Time, simout.Em.Eg.Data(:, 4));
plot(simout.Em.Eg.Time, simout.Em.Eg.Data(:, 5));
plot(simout.Em.Eg.Time, simout.Em.Eg.Data(:, 6));
hold off;
xlabel('Time [s]');
ylabel('Orientation error [rad]');
#+end_src
#+begin_src matlab
Eg = simout.Em.Eg;
save('./mat/motion_error_ol.mat', 'Eg');
#+end_src