Add time domain disturbances plots and comparisons

This commit is contained in:
Thomas Dehaeze 2020-03-17 17:33:43 +01:00
parent 1c342403c2
commit 7b36f0129a
6 changed files with 342 additions and 2 deletions

View File

@ -4,7 +4,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2020-03-17 mar. 11:21 -->
<!-- 2020-03-17 mar. 17:31 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Identification of the disturbances</title>
@ -254,6 +254,14 @@
<li><a href="#Compute-the-Power-Spectral-Density-of-the-disturbance-force">5. Compute the Power Spectral Density of the disturbance force</a></li>
<li><a href="#Noise-Budget">6. Noise Budget</a></li>
<li><a href="#Save">7. Save</a></li>
<li><a href="#orgd564a58">8. Time Domain Disturbances</a></li>
<li><a href="#org8212830">9. Time Domain Effect of Disturbances</a>
<ul>
<li><a href="#org76c96f4">9.1. Initialization of the Experiment</a></li>
<li><a href="#orgf9c1ad9">9.2. Simulations</a></li>
<li><a href="#org8107e0b">9.3. Comparison</a></li>
</ul>
</li>
</ul>
</div>
</div>
@ -623,10 +631,144 @@ save(<span class="org-string">'./mat/dist_psd.mat'</span>, <span class="org-stri
</div>
</div>
</div>
<div id="outline-container-orgd564a58" class="outline-2">
<h2 id="orgd564a58"><span class="section-number-2">8</span> Time Domain Disturbances</h2>
<div class="outline-text-2" id="text-8">
<p>
Let&rsquo;s initialize the time domain disturbances and load them.
</p>
<div class="org-src-container">
<pre class="src src-matlab">initializeDisturbances();
dist = load(<span class="org-string">'nass_disturbances.mat'</span>);
</pre>
</div>
<p>
The time domain disturbance signals are shown in Figure <a href="#org3ff859b">10</a>.
</p>
<div id="org3ff859b" class="figure">
<p><img src="figs/disturbances_time_domain.png" alt="disturbances_time_domain.png" />
</p>
<p><span class="figure-number">Figure 10: </span>Disturbances in the Time Domain (<a href="./figs/disturbances_time_domain.png">png</a>, <a href="./figs/disturbances_time_domain.pdf">pdf</a>)</p>
</div>
</div>
</div>
<div id="outline-container-org8212830" class="outline-2">
<h2 id="org8212830"><span class="section-number-2">9</span> Time Domain Effect of Disturbances</h2>
<div class="outline-text-2" id="text-9">
</div>
<div id="outline-container-org76c96f4" class="outline-3">
<h3 id="org76c96f4"><span class="section-number-3">9.1</span> Initialization of the Experiment</h3>
<div class="outline-text-3" id="text-9-1">
<p>
We initialize all the stages with the default parameters.
</p>
<div class="org-src-container">
<pre class="src src-matlab">initializeGround();
initializeGranite();
initializeTy();
initializeRy();
initializeRz();
initializeMicroHexapod();
initializeAxisc();
initializeMirror();
</pre>
</div>
<p>
The nano-hexapod is a piezoelectric hexapod and the sample has a mass of 50kg.
</p>
<div class="org-src-container">
<pre class="src src-matlab">initializeNanoHexapod(<span class="org-string">'type'</span>, <span class="org-string">'rigid'</span>);
initializeSample(<span class="org-string">'mass'</span>, 1);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">initializeReferences();
initializeController(<span class="org-string">'type'</span>, <span class="org-string">'open-loop'</span>);
initializeSimscapeConfiguration(<span class="org-string">'gravity'</span>, <span class="org-constant">false</span>);
initializeLoggingConfiguration(<span class="org-string">'log'</span>, <span class="org-string">'all'</span>);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">load(<span class="org-string">'mat/conf_simulink.mat'</span>);
<span class="org-matlab-simulink-keyword">set_param</span>(<span class="org-variable-name">conf_simulink</span>, <span class="org-string">'StopTime'</span>, <span class="org-string">'2'</span>);
</pre>
</div>
</div>
</div>
<div id="outline-container-orgf9c1ad9" class="outline-3">
<h3 id="orgf9c1ad9"><span class="section-number-3">9.2</span> Simulations</h3>
<div class="outline-text-3" id="text-9-2">
<p>
No disturbances:
</p>
<div class="org-src-container">
<pre class="src src-matlab">initializeDisturbances(<span class="org-string">'enable'</span>, <span class="org-constant">false</span>);
<span class="org-matlab-simulink-keyword">sim</span>(<span class="org-string">'nass_model'</span>);
sim_no = simout;
</pre>
</div>
<p>
Ground Motion:
</p>
<div class="org-src-container">
<pre class="src src-matlab">initializeDisturbances(<span class="org-string">'Fty_x'</span>, <span class="org-constant">false</span>, <span class="org-string">'Fty_z'</span>, <span class="org-constant">false</span>, <span class="org-string">'Frz_z'</span>, <span class="org-constant">false</span>);
<span class="org-matlab-simulink-keyword">sim</span>(<span class="org-string">'nass_model'</span>);
sim_gm = simout;
</pre>
</div>
<p>
Translation Stage Vibrations:
</p>
<div class="org-src-container">
<pre class="src src-matlab">initializeDisturbances(<span class="org-string">'Dwx'</span>, <span class="org-constant">false</span>, <span class="org-string">'Dwy'</span>, <span class="org-constant">false</span>, <span class="org-string">'Dwz'</span>, <span class="org-constant">false</span>, <span class="org-string">'Frz_z'</span>, <span class="org-constant">false</span>);
<span class="org-matlab-simulink-keyword">sim</span>(<span class="org-string">'nass_model'</span>);
sim_ty = simout;
</pre>
</div>
<p>
Rotation Stage Vibrations:
</p>
<div class="org-src-container">
<pre class="src src-matlab">initializeDisturbances(<span class="org-string">'Dwx'</span>, <span class="org-constant">false</span>, <span class="org-string">'Dwy'</span>, <span class="org-constant">false</span>, <span class="org-string">'Dwz'</span>, <span class="org-constant">false</span>, <span class="org-string">'Fty_x'</span>, <span class="org-constant">false</span>, <span class="org-string">'Fty_z'</span>, <span class="org-constant">false</span>);
<span class="org-matlab-simulink-keyword">sim</span>(<span class="org-string">'nass_model'</span>);
sim_rz = simout;
</pre>
</div>
</div>
</div>
<div id="outline-container-org8107e0b" class="outline-3">
<h3 id="org8107e0b"><span class="section-number-3">9.3</span> Comparison</h3>
<div class="outline-text-3" id="text-9-3">
<p>
Let&rsquo;s now compare the effect of those perturbations on the position error of the sample (Figure <a href="#orgee898d4">11</a>)
</p>
<div id="orgee898d4" class="figure">
<p><img src="figs/effect_disturbances_position_error.png" alt="effect_disturbances_position_error.png" />
</p>
<p><span class="figure-number">Figure 11: </span>Effect of Perturbations on the position error (<a href="./figs/effect_disturbances_position_error.png">png</a>, <a href="./figs/effect_disturbances_position_error.pdf">pdf</a>)</p>
</div>
</div>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
<p class="date">Created: 2020-03-17 mar. 11:21</p>
<p class="date">Created: 2020-03-17 mar. 17:31</p>
</div>
</body>
</html>

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

View File

@ -568,3 +568,201 @@ The PSD of the disturbance force are now saved for further analysis.
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]]