Important change for the implementation of motion input

Now we provide the first and second derivatives.
This permits to not have any motion error.

Also, many experiments (tomography, ty-scans) are simulated
This commit is contained in:
Thomas Dehaeze 2019-12-17 18:03:21 +01:00
parent 65e246ff4c
commit c6a4e5343e
21 changed files with 876 additions and 396 deletions

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2019-12-13 ven. 19:06 --> <!-- 2019-12-17 mar. 18:01 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Tomography Experiment</title> <title>Tomography Experiment</title>
@ -258,16 +258,70 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<div id="text-table-of-contents"> <div id="text-table-of-contents">
<ul> <ul>
<li><a href="#org84a12d1">1. Simscape Model</a></li> <li><a href="#org9876dd1">1. Simscape Model</a></li>
<li><a href="#orgcb251b3">2. Tomography Experiment with no disturbances</a></li> <li><a href="#orge5e5b16">2. Tomography Experiment with no disturbances</a>
<li><a href="#orgcc1bc22">3. With Perturbations</a></li> <ul>
<li><a href="#org5e4ce3d">2.1. Simulation Setup</a></li>
<li><a href="#org8ae8a5d">2.2. Analysis</a></li>
<li><a href="#orgc99de70">2.3. Conclusion</a></li>
</ul>
</li>
<li><a href="#org236226d">3. Tomography Experiment with included perturbations</a>
<ul>
<li><a href="#org8aa359d">3.1. Simulation Setup</a></li>
<li><a href="#orgd63048b">3.2. Analysis</a></li>
<li><a href="#org5328197">3.3. Conclusion</a></li>
</ul>
</li>
<li><a href="#orgbcf3187">4. Tomography when the micro-hexapod is not centered</a>
<ul>
<li><a href="#orgb8fc603">4.1. Simulation Setup</a></li>
<li><a href="#org22f9788">4.2. Analysis</a></li>
<li><a href="#orga8287ac">4.3. Conclusion</a></li>
</ul>
</li>
<li><a href="#org9e0e5be">5. Raster Scans with the translation stage</a>
<ul>
<li><a href="#org0b48fba">5.1. Simulation Setup</a></li>
<li><a href="#orge9df7a3">5.2. Analysis</a></li>
<li><a href="#orgbdb4d14">5.3. Conclusion</a></li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
<div id="outline-container-org84a12d1" class="outline-2"> <p>
<h2 id="org84a12d1"><span class="section-number-2">1</span> Simscape Model</h2> The goal here is to simulate some scientific experiments with the tuned Simscape model when no control is applied to the nano-hexapod.
</p>
<p>
This has several goals:
</p>
<ul class="org-ul">
<li>Validate the model</li>
<li>Estimate the expected error motion for the experiments</li>
<li>Estimate the stroke that we may need for the nano-hexapod</li>
</ul>
<p>
The document in organized as follow:
</p>
<ul class="org-ul">
<li>In section <a href="#orga91d1df">1</a> the Simscape model is initialized</li>
<li>In section <a href="#org1018b85">2</a> a tomography experiment is performed where the sample is aligned with the rotation axis. No disturbance is included</li>
<li>In section <a href="#org8c019e4">3</a>, the same is done but with disturbance included</li>
<li>In section <a href="#org395e7ec">4</a> the micro-hexapod translate the sample such that its center of mass is no longer aligned with the rotation axis. No disturbance is included</li>
<li>In section <a href="#orga1dc368">5</a>, scans with the translation stage are simulated with no perturbation included</li>
</ul>
<div id="outline-container-org9876dd1" class="outline-2">
<h2 id="org9876dd1"><span class="section-number-2">1</span> Simscape Model</h2>
<div class="outline-text-2" id="text-1"> <div class="outline-text-2" id="text-1">
<p>
<a id="orga91d1df"></a>
</p>
<p> <p>
The simulink file to do tomography experiments is <code>sim_nano_station_tomo.slx</code>. The simulink file to do tomography experiments is <code>sim_nano_station_tomo.slx</code>.
</p> </p>
@ -277,11 +331,11 @@ The simulink file to do tomography experiments is <code>sim_nano_station_tomo.sl
</div> </div>
<p> <p>
We load the shared simulink configuration and we set a small <code>StopTime</code>. We load the shared simulink configuration and we set the <code>StopTime</code>.
</p> </p>
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-matlab">load<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'mat/conf_simscape.mat'</span><span class="org-rainbow-delimiters-depth-1">)</span>; <pre class="src src-matlab">load<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'mat/conf_simscape.mat'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
<span class="org-matlab-simulink-keyword">set_param</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">conf_simscape</span>, <span class="org-string">'StopTime'</span>, '<span class="org-highlight-numbers-number">10</span><span class="org-type">'</span><span class="org-rainbow-delimiters-depth-1">)</span>; <span class="org-matlab-simulink-keyword">set_param</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">conf_simscape</span>, <span class="org-string">'StopTime'</span>, '<span class="org-highlight-numbers-number">5</span><span class="org-type">'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre> </pre>
</div> </div>
@ -313,9 +367,231 @@ All stage is set to its zero position except the Spindle which is rotating at 60
</div> </div>
</div> </div>
<div id="outline-container-orgcb251b3" class="outline-2"> <div id="outline-container-orge5e5b16" class="outline-2">
<h2 id="orgcb251b3"><span class="section-number-2">2</span> Tomography Experiment with no disturbances</h2> <h2 id="orge5e5b16"><span class="section-number-2">2</span> Tomography Experiment with no disturbances</h2>
<div class="outline-text-2" id="text-2"> <div class="outline-text-2" id="text-2">
<p>
<a id="org1018b85"></a>
</p>
</div>
<div id="outline-container-org5e4ce3d" class="outline-3">
<h3 id="org5e4ce3d"><span class="section-number-3">2.1</span> Simulation Setup</h3>
<div class="outline-text-3" id="text-2-1">
<p>
And we initialize the disturbances to be equal to zero.
</p>
<div class="org-src-container">
<pre class="src src-matlab">opts = struct<span class="org-rainbow-delimiters-depth-1">(</span>...
<span class="org-string">'Dwx'</span>, <span class="org-constant">false</span>, ...<span class="org-comment"> % Ground Motion - X direction</span>
<span class="org-string">'Dwy'</span>, <span class="org-constant">false</span>, ...<span class="org-comment"> % Ground Motion - Y direction</span>
<span class="org-string">'Dwz'</span>, <span class="org-constant">false</span>, ...<span class="org-comment"> % Ground Motion - Z direction</span>
<span class="org-string">'Fty_x'</span>, <span class="org-constant">false</span>, ...<span class="org-comment"> % Translation Stage - X direction</span>
<span class="org-string">'Fty_z'</span>, <span class="org-constant">false</span>, ...<span class="org-comment"> % Translation Stage - Z direction</span>
<span class="org-string">'Frz_z'</span>, <span class="org-constant">false</span> ...<span class="org-comment"> % Spindle - Z direction</span>
<span class="org-rainbow-delimiters-depth-1">)</span>;
initDisturbances<span class="org-rainbow-delimiters-depth-1">(</span>opts<span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<p>
We simulate the model.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-simulink-keyword">sim</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'sim_nano_station_tomo'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<p>
And we save the obtained data.
</p>
<div class="org-src-container">
<pre class="src src-matlab">tomo_align_no_dist = struct<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'t'</span>, t, <span class="org-string">'MTr'</span>, MTr<span class="org-rainbow-delimiters-depth-1">)</span>;
save<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'experiment_tomography/mat/experiment.mat'</span>, <span class="org-string">'tomo_align_no_dist'</span>, <span class="org-string">'-append'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
</div>
</div>
<div id="outline-container-org8ae8a5d" class="outline-3">
<h3 id="org8ae8a5d"><span class="section-number-3">2.2</span> Analysis</h3>
<div class="outline-text-3" id="text-2-2">
<div class="org-src-container">
<pre class="src src-matlab">load<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'experiment_tomography/mat/experiment.mat'</span>, <span class="org-string">'tomo_align_no_dist'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
t = tomo_align_no_dist.t;
MTr = tomo_align_no_dist.MTr;
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">Edx = squeeze<span class="org-rainbow-delimiters-depth-1">(</span>MTr<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">4</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
Edy = squeeze<span class="org-rainbow-delimiters-depth-1">(</span>MTr<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">2</span>, <span class="org-highlight-numbers-number">4</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
Edz = squeeze<span class="org-rainbow-delimiters-depth-1">(</span>MTr<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">3</span>, <span class="org-highlight-numbers-number">4</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
<span class="org-comment">% The angles obtained are u-v-w Euler angles (rotations in the moving frame)</span>
Ery = atan2<span class="org-rainbow-delimiters-depth-1">(</span> squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">3</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>, squeeze<span class="org-rainbow-delimiters-depth-2">(</span>sqrt<span class="org-rainbow-delimiters-depth-3">(</span>MTr<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">1</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-type">.^</span><span class="org-highlight-numbers-number">2</span> <span class="org-type">+</span> MTr<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">2</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-type">.^</span><span class="org-highlight-numbers-number">2</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
Erx = atan2<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-type">-</span>squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">2</span>, <span class="org-highlight-numbers-number">3</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">./</span>cos<span class="org-rainbow-delimiters-depth-2">(</span>Ery<span class="org-rainbow-delimiters-depth-2">)</span>, squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">3</span>, <span class="org-highlight-numbers-number">3</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">./</span>cos<span class="org-rainbow-delimiters-depth-2">(</span>Ery<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
Erz = atan2<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-type">-</span>squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">2</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">./</span>cos<span class="org-rainbow-delimiters-depth-2">(</span>Ery<span class="org-rainbow-delimiters-depth-2">)</span>, squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">1</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">./</span>cos<span class="org-rainbow-delimiters-depth-2">(</span>Ery<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<div id="orgda4d10e" class="figure">
<p><img src="figs/exp_tomo_without_dist_trans.png" alt="exp_tomo_without_dist_trans.png" />
</p>
<p><span class="figure-number">Figure 1: </span>X-Y-Z translation of the sample w.r.t. granite when performing tomography experiment with no disturbances (<a href="./figs/exp_tomo_without_dist_trans.png">png</a>, <a href="./figs/exp_tomo_without_dist_trans.pdf">pdf</a>)</p>
</div>
<div id="orgf194db1" class="figure">
<p><img src="figs/exp_tomo_without_dist_rot.png" alt="exp_tomo_without_dist_rot.png" />
</p>
<p><span class="figure-number">Figure 2: </span>X-Y-Z rotations of the sample w.r.t. granite when performing tomography experiment with no disturbances (<a href="./figs/exp_tomo_without_dist_rot.png">png</a>, <a href="./figs/exp_tomo_without_dist_rot.pdf">pdf</a>)</p>
</div>
</div>
</div>
<div id="outline-container-orgc99de70" class="outline-3">
<h3 id="orgc99de70"><span class="section-number-3">2.3</span> Conclusion</h3>
<div class="outline-text-3" id="text-2-3">
<div class="important">
<p>
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.
</p>
</div>
</div>
</div>
</div>
<div id="outline-container-org236226d" class="outline-2">
<h2 id="org236226d"><span class="section-number-2">3</span> Tomography Experiment with included perturbations</h2>
<div class="outline-text-2" id="text-3">
<p>
<a id="org8c019e4"></a>
</p>
</div>
<div id="outline-container-org8aa359d" class="outline-3">
<h3 id="org8aa359d"><span class="section-number-3">3.1</span> Simulation Setup</h3>
<div class="outline-text-3" id="text-3-1">
<p>
We now activate the disturbances.
</p>
<div class="org-src-container">
<pre class="src src-matlab">opts = struct<span class="org-rainbow-delimiters-depth-1">(</span>...
<span class="org-string">'Dwx'</span>, <span class="org-constant">true</span>, ...<span class="org-comment"> % Ground Motion - X direction</span>
<span class="org-string">'Dwy'</span>, <span class="org-constant">true</span>, ...<span class="org-comment"> % Ground Motion - Y direction</span>
<span class="org-string">'Dwz'</span>, <span class="org-constant">true</span>, ...<span class="org-comment"> % Ground Motion - Z direction</span>
<span class="org-string">'Fty_x'</span>, <span class="org-constant">true</span>, ...<span class="org-comment"> % Translation Stage - X direction</span>
<span class="org-string">'Fty_z'</span>, <span class="org-constant">true</span>, ...<span class="org-comment"> % Translation Stage - Z direction</span>
<span class="org-string">'Frz_z'</span>, <span class="org-constant">true</span> ...<span class="org-comment"> % Spindle - Z direction</span>
<span class="org-rainbow-delimiters-depth-1">)</span>;
initDisturbances<span class="org-rainbow-delimiters-depth-1">(</span>opts<span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<p>
We simulate the model.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-simulink-keyword">sim</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'sim_nano_station_tomo'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<p>
And we save the obtained data.
</p>
<div class="org-src-container">
<pre class="src src-matlab">tomo_align_dist = struct<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'t'</span>, t, <span class="org-string">'MTr'</span>, MTr<span class="org-rainbow-delimiters-depth-1">)</span>;
save<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'experiment_tomography/mat/experiment.mat'</span>, <span class="org-string">'tomo_align_dist'</span>, <span class="org-string">'-append'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
</div>
</div>
<div id="outline-container-orgd63048b" class="outline-3">
<h3 id="orgd63048b"><span class="section-number-3">3.2</span> Analysis</h3>
<div class="outline-text-3" id="text-3-2">
<div class="org-src-container">
<pre class="src src-matlab">load<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'experiment_tomography/mat/experiment.mat'</span>, <span class="org-string">'tomo_align_dist'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
t = tomo_align_dist.t;
MTr = tomo_align_dist.MTr;
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">Edx = squeeze<span class="org-rainbow-delimiters-depth-1">(</span>MTr<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">4</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
Edy = squeeze<span class="org-rainbow-delimiters-depth-1">(</span>MTr<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">2</span>, <span class="org-highlight-numbers-number">4</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
Edz = squeeze<span class="org-rainbow-delimiters-depth-1">(</span>MTr<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">3</span>, <span class="org-highlight-numbers-number">4</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
<span class="org-comment">% The angles obtained are u-v-w Euler angles (rotations in the moving frame)</span>
Ery = atan2<span class="org-rainbow-delimiters-depth-1">(</span> squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">3</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>, squeeze<span class="org-rainbow-delimiters-depth-2">(</span>sqrt<span class="org-rainbow-delimiters-depth-3">(</span>MTr<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">1</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-type">.^</span><span class="org-highlight-numbers-number">2</span> <span class="org-type">+</span> MTr<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">2</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-type">.^</span><span class="org-highlight-numbers-number">2</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
Erx = atan2<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-type">-</span>squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">2</span>, <span class="org-highlight-numbers-number">3</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">./</span>cos<span class="org-rainbow-delimiters-depth-2">(</span>Ery<span class="org-rainbow-delimiters-depth-2">)</span>, squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">3</span>, <span class="org-highlight-numbers-number">3</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">./</span>cos<span class="org-rainbow-delimiters-depth-2">(</span>Ery<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
Erz = atan2<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-type">-</span>squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">2</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">./</span>cos<span class="org-rainbow-delimiters-depth-2">(</span>Ery<span class="org-rainbow-delimiters-depth-2">)</span>, squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">1</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">./</span>cos<span class="org-rainbow-delimiters-depth-2">(</span>Ery<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<div id="orge9cec44" class="figure">
<p><img src="figs/exp_tomo_dist_trans.png" alt="exp_tomo_dist_trans.png" />
</p>
<p><span class="figure-number">Figure 3: </span>X-Y-Z translation of the sample w.r.t. the granite when performing tomography experiment with disturbances (<a href="./figs/exp_tomo_dist_trans.png">png</a>, <a href="./figs/exp_tomo_dist_trans.pdf">pdf</a>)</p>
</div>
<div id="org98cbd3c" class="figure">
<p><img src="figs/exp_tomo_dist_rot.png" alt="exp_tomo_dist_rot.png" />
</p>
<p><span class="figure-number">Figure 4: </span>X-Y-Z rotations of the sample w.r.t. the granite when performing tomography experiment with disturbances (<a href="./figs/exp_tomo_dist_rot.png">png</a>, <a href="./figs/exp_tomo_dist_rot.pdf">pdf</a>)</p>
</div>
</div>
</div>
<div id="outline-container-org5328197" class="outline-3">
<h3 id="org5328197"><span class="section-number-3">3.3</span> Conclusion</h3>
<div class="outline-text-3" id="text-3-3">
<div class="important">
<p>
Error motion is what expected from the disturbance measurements.
</p>
</div>
</div>
</div>
</div>
<div id="outline-container-orgbcf3187" class="outline-2">
<h2 id="orgbcf3187"><span class="section-number-2">4</span> Tomography when the micro-hexapod is not centered</h2>
<div class="outline-text-2" id="text-4">
<p>
<a id="org395e7ec"></a>
</p>
</div>
<div id="outline-container-orgb8fc603" class="outline-3">
<h3 id="orgb8fc603"><span class="section-number-3">4.1</span> Simulation Setup</h3>
<div class="outline-text-3" id="text-4-1">
<p>
We first set the wanted translation of the Micro Hexapod.
</p>
<div class="org-src-container">
<pre class="src src-matlab">P_micro_hexapod = <span class="org-rainbow-delimiters-depth-1">[</span><span class="org-highlight-numbers-number">0</span>.<span class="org-highlight-numbers-number">01</span>; <span class="org-highlight-numbers-number">0</span>; <span class="org-highlight-numbers-number">0</span><span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-comment">% [m]</span>
</pre>
</div>
<p>
We initialize the reference path.
</p>
<div class="org-src-container">
<pre class="src src-matlab">initializeReferences<span class="org-rainbow-delimiters-depth-1">(</span>struct<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">'Dh_pos'</span>, <span class="org-rainbow-delimiters-depth-3">[</span>P_micro_hexapod; <span class="org-highlight-numbers-number">0</span>; <span class="org-highlight-numbers-number">0</span>; <span class="org-highlight-numbers-number">0</span><span class="org-rainbow-delimiters-depth-3">]</span>, <span class="org-string">'Rz_type'</span>, <span class="org-string">'rotating'</span>, <span class="org-string">'Rz_period'</span>, <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<p>
We initialize the stages.
</p>
<div class="org-src-container">
<pre class="src src-matlab">initializeMicroHexapod<span class="org-rainbow-delimiters-depth-1">(</span>struct<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">'AP'</span>, P_micro_hexapod<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<p> <p>
And we initialize the disturbances to zero. And we initialize the disturbances to zero.
</p> </p>
@ -332,88 +608,199 @@ initDisturbances<span class="org-rainbow-delimiters-depth-1">(</span>opts<span c
</pre> </pre>
</div> </div>
<div class="org-src-container"> <p>
<pre class="src src-matlab"><span class="org-matlab-simulink-keyword">sim</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'sim_nano_station_tomo'</span><span class="org-rainbow-delimiters-depth-1">)</span> We simulate the model.
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">Dsm_without_dist = Dsm;
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-type">figure</span>;
hold on;
plot<span class="org-rainbow-delimiters-depth-1">(</span>Dsm_without_dist.x.Time, Dsm_without_dist.x.Data, <span class="org-string">'DisplayName'</span>, <span class="org-string">'x'</span><span class="org-rainbow-delimiters-depth-1">)</span>
plot<span class="org-rainbow-delimiters-depth-1">(</span>Dsm_without_dist.y.Time, Dsm_without_dist.y.Data, <span class="org-string">'DisplayName'</span>, <span class="org-string">'y'</span><span class="org-rainbow-delimiters-depth-1">)</span>
plot<span class="org-rainbow-delimiters-depth-1">(</span>Dsm_without_dist.z.Time, Dsm_without_dist.z.Data, <span class="org-string">'DisplayName'</span>, <span class="org-string">'z'</span><span class="org-rainbow-delimiters-depth-1">)</span>
hold off;
xlim<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">[</span><span class="org-highlight-numbers-number">2</span>, <span class="org-constant">inf</span><span class="org-rainbow-delimiters-depth-2">]</span><span class="org-rainbow-delimiters-depth-1">)</span>;
legend<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'location'</span>, <span class="org-string">'northeast'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<div id="org8e9717d" class="figure">
<p><img src="figs/exp_tomo_without_dist_trans.png" alt="exp_tomo_without_dist_trans.png" />
</p> </p>
<p><span class="figure-number">Figure 1: </span>X-Y-Z translation of the sample w.r.t. granite when performing tomography experiment with no disturbances (<a href="./figs/exp_tomo_without_dist_trans.png">png</a>, <a href="./figs/exp_tomo_without_dist_trans.pdf">pdf</a>)</p> <div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-simulink-keyword">sim</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'sim_nano_station_tomo'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div> </div>
<p> <p>
Rotations. And we save the obtained data.
Think of the good way to plot these rotations with respect to time.
</p> </p>
<div class="org-src-container">
<pre class="src src-matlab">tomo_not_align = struct<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'t'</span>, t, <span class="org-string">'MTr'</span>, MTr<span class="org-rainbow-delimiters-depth-1">)</span>;
save<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'experiment_tomography/mat/experiment.mat'</span>, <span class="org-string">'tomo_not_align'</span>, <span class="org-string">'-append'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
</div> </div>
</div> </div>
<div id="outline-container-orgcc1bc22" class="outline-2"> <div id="outline-container-org22f9788" class="outline-3">
<h2 id="orgcc1bc22"><span class="section-number-2">3</span> With Perturbations</h2> <h3 id="org22f9788"><span class="section-number-3">4.2</span> Analysis</h3>
<div class="outline-text-2" id="text-3"> <div class="outline-text-3" id="text-4-2">
<div class="org-src-container">
<pre class="src src-matlab">load<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'experiment_tomography/mat/experiment.mat'</span>, <span class="org-string">'tomo_not_align'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
t = tomo_not_align.t;
MTr = tomo_not_align.MTr;
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">Edx = squeeze<span class="org-rainbow-delimiters-depth-1">(</span>MTr<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">4</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
Edy = squeeze<span class="org-rainbow-delimiters-depth-1">(</span>MTr<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">2</span>, <span class="org-highlight-numbers-number">4</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
Edz = squeeze<span class="org-rainbow-delimiters-depth-1">(</span>MTr<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">3</span>, <span class="org-highlight-numbers-number">4</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
<span class="org-comment">% The angles obtained are u-v-w Euler angles (rotations in the moving frame)</span>
Ery = atan2<span class="org-rainbow-delimiters-depth-1">(</span> squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">3</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>, squeeze<span class="org-rainbow-delimiters-depth-2">(</span>sqrt<span class="org-rainbow-delimiters-depth-3">(</span>MTr<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">1</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-type">.^</span><span class="org-highlight-numbers-number">2</span> <span class="org-type">+</span> MTr<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">2</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-type">.^</span><span class="org-highlight-numbers-number">2</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
Erx = atan2<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-type">-</span>squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">2</span>, <span class="org-highlight-numbers-number">3</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">./</span>cos<span class="org-rainbow-delimiters-depth-2">(</span>Ery<span class="org-rainbow-delimiters-depth-2">)</span>, squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">3</span>, <span class="org-highlight-numbers-number">3</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">./</span>cos<span class="org-rainbow-delimiters-depth-2">(</span>Ery<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
Erz = atan2<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-type">-</span>squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">2</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">./</span>cos<span class="org-rainbow-delimiters-depth-2">(</span>Ery<span class="org-rainbow-delimiters-depth-2">)</span>, squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">1</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">./</span>cos<span class="org-rainbow-delimiters-depth-2">(</span>Ery<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<div id="org7fb9a86" class="figure">
<p><img src="figs/exp_tomo_offset_trans.png" alt="exp_tomo_offset_trans.png" />
</p>
<p><span class="figure-number">Figure 5: </span>X-Y-Z translation of the sample w.r.t. granite when performing tomography experiment with no disturbances (<a href="./figs/exp_tomo_offset_trans.png">png</a>, <a href="./figs/exp_tomo_offset_trans.pdf">pdf</a>)</p>
</div>
<div id="orgbe8a23e" class="figure">
<p><img src="figs/exp_tomo_offset_rot.png" alt="exp_tomo_offset_rot.png" />
</p>
<p><span class="figure-number">Figure 6: </span>X-Y-Z rotations of the sample w.r.t. granite when performing tomography experiment with no disturbances (<a href="./figs/exp_tomo_offset_rot.png">png</a>, <a href="./figs/exp_tomo_offset_rot.pdf">pdf</a>)</p>
</div>
</div>
</div>
<div id="outline-container-orga8287ac" class="outline-3">
<h3 id="orga8287ac"><span class="section-number-3">4.3</span> Conclusion</h3>
<div class="outline-text-3" id="text-4-3">
<div class="important">
<p>
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.
</p>
</div>
</div>
</div>
</div>
<div id="outline-container-org9e0e5be" class="outline-2">
<h2 id="org9e0e5be"><span class="section-number-2">5</span> Raster Scans with the translation stage</h2>
<div class="outline-text-2" id="text-5">
<p>
<a id="orga1dc368"></a>
</p>
</div>
<div id="outline-container-org0b48fba" class="outline-3">
<h3 id="org0b48fba"><span class="section-number-3">5.1</span> Simulation Setup</h3>
<div class="outline-text-3" id="text-5-1">
<p>
We set the reference path.
</p>
<div class="org-src-container">
<pre class="src src-matlab">initializeReferences<span class="org-rainbow-delimiters-depth-1">(</span>struct<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">'Dy_type'</span>, <span class="org-string">'triangular'</span>, <span class="org-string">'Dy_amplitude'</span>, <span class="org-highlight-numbers-number">10e</span><span class="org-type">-</span><span class="org-highlight-numbers-number">3</span>, <span class="org-string">'Dy_period'</span>, <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<p>
We initialize the stages.
</p>
<div class="org-src-container">
<pre class="src src-matlab">initializeGround<span class="org-rainbow-delimiters-depth-1">()</span>;
initializeGranite<span class="org-rainbow-delimiters-depth-1">()</span>;
initializeTy<span class="org-rainbow-delimiters-depth-1">()</span>;
initializeRy<span class="org-rainbow-delimiters-depth-1">()</span>;
initializeRz<span class="org-rainbow-delimiters-depth-1">()</span>;
initializeMicroHexapod<span class="org-rainbow-delimiters-depth-1">()</span>;
initializeAxisc<span class="org-rainbow-delimiters-depth-1">()</span>;
initializeMirror<span class="org-rainbow-delimiters-depth-1">()</span>;
initializeNanoHexapod<span class="org-rainbow-delimiters-depth-1">(</span>struct<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">'actuator'</span>, <span class="org-string">'piezo'</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
initializeSample<span class="org-rainbow-delimiters-depth-1">(</span>struct<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">'mass'</span>, <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<p>
And we initialize the disturbances to zero.
</p>
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-matlab">opts = struct<span class="org-rainbow-delimiters-depth-1">(</span>... <pre class="src src-matlab">opts = struct<span class="org-rainbow-delimiters-depth-1">(</span>...
<span class="org-string">'Dwx'</span>, <span class="org-constant">true</span>, ...<span class="org-comment"> % Ground Motion - X direction</span> <span class="org-string">'Dwx'</span>, <span class="org-constant">false</span>, ...<span class="org-comment"> % Ground Motion - X direction</span>
<span class="org-string">'Dwy'</span>, <span class="org-constant">true</span>, ...<span class="org-comment"> % Ground Motion - Y direction</span> <span class="org-string">'Dwy'</span>, <span class="org-constant">false</span>, ...<span class="org-comment"> % Ground Motion - Y direction</span>
<span class="org-string">'Dwz'</span>, <span class="org-constant">true</span>, ...<span class="org-comment"> % Ground Motion - Z direction</span> <span class="org-string">'Dwz'</span>, <span class="org-constant">false</span>, ...<span class="org-comment"> % Ground Motion - Z direction</span>
<span class="org-string">'Fty_x'</span>, <span class="org-constant">true</span>, ...<span class="org-comment"> % Translation Stage - X direction</span> <span class="org-string">'Fty_x'</span>, <span class="org-constant">false</span>, ...<span class="org-comment"> % Translation Stage - X direction</span>
<span class="org-string">'Fty_z'</span>, <span class="org-constant">true</span>, ...<span class="org-comment"> % Translation Stage - Z direction</span> <span class="org-string">'Fty_z'</span>, <span class="org-constant">false</span>, ...<span class="org-comment"> % Translation Stage - Z direction</span>
<span class="org-string">'Frz_z'</span>, <span class="org-constant">true</span> ...<span class="org-comment"> % Spindle - Z direction</span> <span class="org-string">'Frz_z'</span>, <span class="org-constant">false</span> ...<span class="org-comment"> % Spindle - Z direction</span>
<span class="org-rainbow-delimiters-depth-1">)</span>; <span class="org-rainbow-delimiters-depth-1">)</span>;
initDisturbances<span class="org-rainbow-delimiters-depth-1">(</span>opts<span class="org-rainbow-delimiters-depth-1">)</span>; initDisturbances<span class="org-rainbow-delimiters-depth-1">(</span>opts<span class="org-rainbow-delimiters-depth-1">)</span>;
</pre> </pre>
</div> </div>
<div class="org-src-container"> <p>
<pre class="src src-matlab"><span class="org-matlab-simulink-keyword">sim</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'sim_nano_station_tomo'</span><span class="org-rainbow-delimiters-depth-1">)</span> We simulate the model.
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-type">figure</span>;
hold on;
plot<span class="org-rainbow-delimiters-depth-1">(</span>Dsm.x.Time, Dsm.x.Data, <span class="org-string">'DisplayName'</span>, <span class="org-string">'x'</span><span class="org-rainbow-delimiters-depth-1">)</span>
plot<span class="org-rainbow-delimiters-depth-1">(</span>Dsm.y.Time, Dsm.y.Data, <span class="org-string">'DisplayName'</span>, <span class="org-string">'y'</span><span class="org-rainbow-delimiters-depth-1">)</span>
plot<span class="org-rainbow-delimiters-depth-1">(</span>Dsm.z.Time, Dsm.z.Data, <span class="org-string">'DisplayName'</span>, <span class="org-string">'z'</span><span class="org-rainbow-delimiters-depth-1">)</span>
hold off;
xlim<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">[</span><span class="org-highlight-numbers-number">2</span>, <span class="org-constant">inf</span><span class="org-rainbow-delimiters-depth-2">]</span><span class="org-rainbow-delimiters-depth-1">)</span>;
legend<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'location'</span>, <span class="org-string">'northeast'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<div id="org230990b" class="figure">
<p><img src="figs/exp_tomo_dist_trans.png" alt="exp_tomo_dist_trans.png" />
</p> </p>
<p><span class="figure-number">Figure 2: </span>X-Y-Z translation of the sample w.r.t. the granite when performing tomography experiment with disturbances (<a href="./figs/exp_tomo_dist_trans.png">png</a>, <a href="./figs/exp_tomo_dist_trans.pdf">pdf</a>)</p> <div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-simulink-keyword">sim</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'sim_nano_station_tomo'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<p>
And we save the obtained data.
</p>
<div class="org-src-container">
<pre class="src src-matlab">ty_scan = struct<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'t'</span>, t, <span class="org-string">'MTr'</span>, MTr<span class="org-rainbow-delimiters-depth-1">)</span>;
save<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'experiment_tomography/mat/experiment.mat'</span>, <span class="org-string">'ty_scan'</span>, <span class="org-string">'-append'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
</div>
</div>
<div id="outline-container-orge9df7a3" class="outline-3">
<h3 id="orge9df7a3"><span class="section-number-3">5.2</span> Analysis</h3>
<div class="outline-text-3" id="text-5-2">
<div class="org-src-container">
<pre class="src src-matlab">load<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'experiment_tomography/mat/experiment.mat'</span>, <span class="org-string">'ty_scan'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
t = ty_scan.t;
MTr = ty_scan.MTr;
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">Edx = squeeze<span class="org-rainbow-delimiters-depth-1">(</span>MTr<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">4</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
Edy = squeeze<span class="org-rainbow-delimiters-depth-1">(</span>MTr<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">2</span>, <span class="org-highlight-numbers-number">4</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
Edz = squeeze<span class="org-rainbow-delimiters-depth-1">(</span>MTr<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">3</span>, <span class="org-highlight-numbers-number">4</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
<span class="org-comment">% The angles obtained are u-v-w Euler angles (rotations in the moving frame)</span>
Ery = atan2<span class="org-rainbow-delimiters-depth-1">(</span> squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">3</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>, squeeze<span class="org-rainbow-delimiters-depth-2">(</span>sqrt<span class="org-rainbow-delimiters-depth-3">(</span>MTr<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">1</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-type">.^</span><span class="org-highlight-numbers-number">2</span> <span class="org-type">+</span> MTr<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">2</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-type">.^</span><span class="org-highlight-numbers-number">2</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
Erx = atan2<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-type">-</span>squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">2</span>, <span class="org-highlight-numbers-number">3</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">./</span>cos<span class="org-rainbow-delimiters-depth-2">(</span>Ery<span class="org-rainbow-delimiters-depth-2">)</span>, squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">3</span>, <span class="org-highlight-numbers-number">3</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">./</span>cos<span class="org-rainbow-delimiters-depth-2">(</span>Ery<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
Erz = atan2<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-type">-</span>squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">2</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">./</span>cos<span class="org-rainbow-delimiters-depth-2">(</span>Ery<span class="org-rainbow-delimiters-depth-2">)</span>, squeeze<span class="org-rainbow-delimiters-depth-2">(</span>MTr<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">1</span>, <span class="org-highlight-numbers-number">1</span>, <span class="org-type">:</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">./</span>cos<span class="org-rainbow-delimiters-depth-2">(</span>Ery<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<div id="org3533d00" class="figure">
<p><img src="figs/exp_ty_scan_trans.png" alt="exp_ty_scan_trans.png" />
</p>
<p><span class="figure-number">Figure 7: </span>X-Y-Z translation of the sample w.r.t. granite when performing tomography experiment with no disturbances (<a href="./figs/exp_ty_scan_trans.png">png</a>, <a href="./figs/exp_ty_scan_trans.pdf">pdf</a>)</p>
</div>
<div id="orgcf32c40" class="figure">
<p><img src="figs/exp_ty_scan_rot.png" alt="exp_ty_scan_rot.png" />
</p>
<p><span class="figure-number">Figure 8: </span>X-Y-Z rotations of the sample w.r.t. granite when performing tomography experiment with no disturbances (<a href="./figs/exp_ty_scan_rot.png">png</a>, <a href="./figs/exp_ty_scan_rot.pdf">pdf</a>)</p>
</div>
</div>
</div>
<div id="outline-container-orgbdb4d14" class="outline-3">
<h3 id="orgbdb4d14"><span class="section-number-3">5.3</span> Conclusion</h3>
<div class="outline-text-3" id="text-5-3">
<div class="important">
<p>
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.
</p>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p> <p class="author">Author: Dehaeze Thomas</p>
<p class="date">Created: 2019-12-13 ven. 19:06</p> <p class="date">Created: 2019-12-17 mar. 18:01</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

View File

@ -42,6 +42,20 @@
:END: :END:
* Introduction :ignore: * Introduction :ignore:
The goal here is to simulate some scientific experiments with the tuned Simscape model when no control is applied to the nano-hexapod.
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
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
* Matlab Init :noexport:ignore: * Matlab Init :noexport:ignore:
#+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name) #+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name)
<<matlab-dir>> <<matlab-dir>>
@ -56,6 +70,8 @@
#+end_src #+end_src
* Simscape Model * Simscape Model
<<sec:simscape_model>>
The simulink file to do tomography experiments is =sim_nano_station_tomo.slx=. The simulink file to do tomography experiments is =sim_nano_station_tomo.slx=.
#+begin_src matlab #+begin_src matlab
open('experiment_tomography/matlab/sim_nano_station_tomo.slx') open('experiment_tomography/matlab/sim_nano_station_tomo.slx')
@ -81,14 +97,17 @@ We first initialize all the stages.
initializeSample(struct('mass', 1)); initializeSample(struct('mass', 1));
#+end_src #+end_src
* Tomography Experiment with no disturbances
** Simulation Setup
We initialize the reference path for all the stages. We initialize the reference path for all the stages.
All stage is set to its zero position except the Spindle which is rotating at 60rpm. All stage is set to its zero position except the Spindle which is rotating at 60rpm.
#+begin_src matlab #+begin_src matlab
initializeReferences(struct('Rz_type', 'rotating', 'Rz_period', 1)); initializeReferences(struct('Rz_type', 'rotating', 'Rz_period', 1));
#+end_src #+end_src
* Tomography Experiment with no disturbances
<<sec:tomo_no_dist>>
** Introduction :ignore:
** Simulation Setup
And we initialize the disturbances to be equal to zero. And we initialize the disturbances to be equal to zero.
#+begin_src matlab #+begin_src matlab
opts = struct(... opts = struct(...
@ -109,11 +128,17 @@ We simulate the model.
And we save the obtained data. And we save the obtained data.
#+begin_src matlab #+begin_src matlab
MTr_alig_no_dist = MTr; tomo_align_no_dist = struct('t', t, 'MTr', MTr);
save('experiment_tomography/mat/experiment.mat', 'MTr_alig_no_dist', '-append'); save('experiment_tomography/mat/experiment.mat', 'tomo_align_no_dist', '-append');
#+end_src #+end_src
** Analysis ** Analysis
#+begin_src matlab
load('experiment_tomography/mat/experiment.mat', 'tomo_align_no_dist');
t = tomo_align_no_dist.t;
MTr = tomo_align_no_dist.MTr;
#+end_src
#+begin_src matlab #+begin_src matlab
Edx = squeeze(MTr(1, 4, :)); Edx = squeeze(MTr(1, 4, :));
Edy = squeeze(MTr(2, 4, :)); Edy = squeeze(MTr(2, 4, :));
@ -126,18 +151,26 @@ And we save the obtained data.
#+begin_src matlab :exports none #+begin_src matlab :exports none
figure; figure;
hold on; ax1 = subplot(1, 3, 1);
plot(t, Edx, 'DisplayName', '$\epsilon_{x}$') plot(t, Edx, 'DisplayName', '$\epsilon_{x}$')
plot(t, Edy, 'DisplayName', '$\epsilon_{y}$') ylabel('Displacement [m]');
plot(t, Edz, 'DisplayName', '$\epsilon_{z}$')
hold off;
xlabel('Time [s]'); ylabel('Displacement [m]');
xlim([2, inf]);
legend('location', 'northeast'); legend('location', 'northeast');
ax2 = subplot(1, 3, 2);
plot(t, Edy, 'DisplayName', '$\epsilon_{y}$')
xlabel('Time [s]');
legend('location', 'northeast');
ax3 = subplot(1, 3, 3);
plot(t, Edz, 'DisplayName', '$\epsilon_{z}$')
legend('location', 'northeast');
linkaxes([ax1,ax2,ax3],'x');
xlim([1, inf]);
#+end_src #+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes #+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/exp_tomo_without_dist_trans.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png") #+begin_src matlab :var filepath="figs/exp_tomo_without_dist_trans.pdf" :var figsize="full-normal" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>> <<plt-matlab>>
#+end_src #+end_src
@ -147,18 +180,26 @@ And we save the obtained data.
#+begin_src matlab :exports none #+begin_src matlab :exports none
figure; figure;
hold on; ax1 = subplot(1, 3, 1);
plot(t, Erx, 'DisplayName', '$\epsilon_{\theta x}$') plot(t, Erx, 'DisplayName', '$\epsilon_{\theta x}$')
plot(t, Ery, 'DisplayName', '$\epsilon_{\theta y}$') ylabel('Rotation [rad]');
plot(t, Erz, 'DisplayName', '$\epsilon_{\theta z}$')
hold off;
xlabel('Time [s]'); ylabel('Rotation [rad]');
xlim([2, inf]);
legend('location', 'northeast'); legend('location', 'northeast');
ax2 = subplot(1, 3, 2);
plot(t, Ery, 'DisplayName', '$\epsilon_{\theta y}$')
xlabel('Time [s]');
legend('location', 'northeast');
ax3 = subplot(1, 3, 3);
plot(t, Erz, 'DisplayName', '$\epsilon_{\theta z}$')
legend('location', 'northeast');
linkaxes([ax1,ax2,ax3],'x');
xlim([1, inf]);
#+end_src #+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes #+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/exp_tomo_without_dist_rot.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png") #+begin_src matlab :var filepath="figs/exp_tomo_without_dist_rot.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>> <<plt-matlab>>
#+end_src #+end_src
@ -166,7 +207,17 @@ And we save the obtained data.
#+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]]) #+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]] [[file:figs/exp_tomo_without_dist_rot.png]]
* With Perturbations ** 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:
** Simulation Setup ** Simulation Setup
We now activate the disturbances. We now activate the disturbances.
#+begin_src matlab #+begin_src matlab
@ -188,11 +239,17 @@ We simulate the model.
And we save the obtained data. And we save the obtained data.
#+begin_src matlab #+begin_src matlab
MTr_alig_dist = MTr; tomo_align_dist = struct('t', t, 'MTr', MTr);
save('experiment_tomography/mat/experiment.mat', 'MTr_alig_dist', '-append'); save('experiment_tomography/mat/experiment.mat', 'tomo_align_dist', '-append');
#+end_src #+end_src
** Analysis ** Analysis
#+begin_src matlab
load('experiment_tomography/mat/experiment.mat', 'tomo_align_dist');
t = tomo_align_dist.t;
MTr = tomo_align_dist.MTr;
#+end_src
#+begin_src matlab #+begin_src matlab
Edx = squeeze(MTr(1, 4, :)); Edx = squeeze(MTr(1, 4, :));
Edy = squeeze(MTr(2, 4, :)); Edy = squeeze(MTr(2, 4, :));
@ -205,18 +262,26 @@ And we save the obtained data.
#+begin_src matlab :exports none #+begin_src matlab :exports none
figure; figure;
hold on; ax1 = subplot(1, 3, 1);
plot(t, Edx, 'DisplayName', '$\epsilon_{x}$') plot(t, Edx, 'DisplayName', '$\epsilon_{x}$')
plot(t, Edy, 'DisplayName', '$\epsilon_{y}$') ylabel('Displacement [m]');
plot(t, Edz, 'DisplayName', '$\epsilon_{z}$')
hold off;
xlabel('Time [s]'); ylabel('Displacement [m]');
xlim([2, inf]);
legend('location', 'northeast'); legend('location', 'northeast');
ax2 = subplot(1, 3, 2);
plot(t, Edy, 'DisplayName', '$\epsilon_{y}$')
xlabel('Time [s]');
legend('location', 'northeast');
ax3 = subplot(1, 3, 3);
plot(t, Edz, 'DisplayName', '$\epsilon_{z}$')
legend('location', 'northeast');
linkaxes([ax1,ax2,ax3],'x');
xlim([1, inf]);
#+end_src #+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes #+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/exp_tomo_dist_trans.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png") #+begin_src matlab :var filepath="figs/exp_tomo_dist_trans.pdf" :var figsize="full-normal" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>> <<plt-matlab>>
#+end_src #+end_src
@ -226,18 +291,26 @@ And we save the obtained data.
#+begin_src matlab :exports none #+begin_src matlab :exports none
figure; figure;
hold on; ax1 = subplot(1, 3, 1);
plot(t, Erx, 'DisplayName', '$\epsilon_{\theta x}$') plot(t, Erx, 'DisplayName', '$\epsilon_{\theta x}$')
plot(t, Ery, 'DisplayName', '$\epsilon_{\theta y}$') ylabel('Rotation [rad]');
plot(t, Erz, 'DisplayName', '$\epsilon_{\theta z}$')
hold off;
xlabel('Time [s]'); ylabel('Rotation [rad]');
xlim([2, inf]);
legend('location', 'northeast'); legend('location', 'northeast');
ax2 = subplot(1, 3, 2);
plot(t, Ery, 'DisplayName', '$\epsilon_{\theta y}$')
xlabel('Time [s]');
legend('location', 'northeast');
ax3 = subplot(1, 3, 3);
plot(t, Erz, 'DisplayName', '$\epsilon_{\theta z}$')
legend('location', 'northeast');
linkaxes([ax1,ax2,ax3],'x');
xlim([1, inf]);
#+end_src #+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes #+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/exp_tomo_dist_rot.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png") #+begin_src matlab :var filepath="figs/exp_tomo_dist_rot.pdf" :var figsize="full-normal" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>> <<plt-matlab>>
#+end_src #+end_src
@ -245,7 +318,16 @@ And we save the obtained data.
#+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]]) #+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]] [[file:figs/exp_tomo_dist_rot.png]]
* Tomography ** 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:
** Simulation Setup ** Simulation Setup
We first set the wanted translation of the Micro Hexapod. We first set the wanted translation of the Micro Hexapod.
#+begin_src matlab #+begin_src matlab
@ -282,11 +364,17 @@ We simulate the model.
And we save the obtained data. And we save the obtained data.
#+begin_src matlab #+begin_src matlab
MTr_not_alig = MTr; tomo_not_align = struct('t', t, 'MTr', MTr);
save('experiment_tomography/mat/experiment.mat', 'MTr_not_alig', '-append'); save('experiment_tomography/mat/experiment.mat', 'tomo_not_align', '-append');
#+end_src #+end_src
** Analysis ** Analysis
#+begin_src matlab
load('experiment_tomography/mat/experiment.mat', 'tomo_not_align');
t = tomo_not_align.t;
MTr = tomo_not_align.MTr;
#+end_src
#+begin_src matlab #+begin_src matlab
Edx = squeeze(MTr(1, 4, :)); Edx = squeeze(MTr(1, 4, :));
Edy = squeeze(MTr(2, 4, :)); Edy = squeeze(MTr(2, 4, :));
@ -299,18 +387,26 @@ And we save the obtained data.
#+begin_src matlab :exports none #+begin_src matlab :exports none
figure; figure;
hold on; ax1 = subplot(1, 3, 1);
plot(t, Edx, 'DisplayName', '$\epsilon_{x}$') plot(t, Edx, 'DisplayName', '$\epsilon_{x}$')
plot(t, Edy, 'DisplayName', '$\epsilon_{y}$') ylabel('Displacement [m]');
plot(t, Edz, 'DisplayName', '$\epsilon_{z}$')
hold off;
xlabel('Time [s]'); ylabel('Displacement [m]');
xlim([2, inf]);
legend('location', 'northeast'); legend('location', 'northeast');
ax2 = subplot(1, 3, 2);
plot(t, Edy, 'DisplayName', '$\epsilon_{y}$')
xlabel('Time [s]');
legend('location', 'northeast');
ax3 = subplot(1, 3, 3);
plot(t, Edz, 'DisplayName', '$\epsilon_{z}$')
legend('location', 'northeast');
linkaxes([ax1,ax2,ax3],'x');
xlim([1, inf]);
#+end_src #+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes #+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/exp_tomo_offset_trans.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png") #+begin_src matlab :var filepath="figs/exp_tomo_offset_trans.pdf" :var figsize="full-normal" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>> <<plt-matlab>>
#+end_src #+end_src
@ -320,18 +416,26 @@ And we save the obtained data.
#+begin_src matlab :exports none #+begin_src matlab :exports none
figure; figure;
hold on; ax1 = subplot(1, 3, 1);
plot(t, Erx, 'DisplayName', '$\epsilon_{\theta x}$') plot(t, Erx, 'DisplayName', '$\epsilon_{\theta x}$')
plot(t, Ery, 'DisplayName', '$\epsilon_{\theta y}$') ylabel('Rotation [rad]');
plot(t, Erz, 'DisplayName', '$\epsilon_{\theta z}$')
hold off;
xlabel('Time [s]'); ylabel('Rotation [rad]');
xlim([2, inf]);
legend('location', 'northeast'); legend('location', 'northeast');
ax2 = subplot(1, 3, 2);
plot(t, Ery, 'DisplayName', '$\epsilon_{\theta y}$')
xlabel('Time [s]');
legend('location', 'northeast');
ax3 = subplot(1, 3, 3);
plot(t, Erz, 'DisplayName', '$\epsilon_{\theta z}$')
legend('location', 'northeast');
linkaxes([ax1,ax2,ax3],'x');
xlim([1, inf]);
#+end_src #+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes #+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/exp_tomo_offset_rot.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png") #+begin_src matlab :var filepath="figs/exp_tomo_offset_rot.pdf" :var figsize="full-normal" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>> <<plt-matlab>>
#+end_src #+end_src
@ -339,245 +443,138 @@ And we save the obtained data.
#+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]]) #+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]] [[file:figs/exp_tomo_offset_rot.png]]
* TODO Tests on the transformation from reference to wanted position :noexport: ** Conclusion
:PROPERTIES:
:header-args:matlab+: :eval no #+begin_important
:END: 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
* Raster Scans with the translation stage
<<sec:ty_scans>>
** Introduction :ignore: ** Introduction :ignore:
#+begin_quote
Rx = [1 0 0;
0 cos(t) -sin(t);
0 sin(t) cos(t)];
Ry = [ cos(t) 0 sin(t); ** Simulation Setup
0 1 0; We set the reference path.
-sin(t) 0 cos(t)];
Rz = [cos(t) -sin(t) 0;
sin(t) cos(t) 0;
0 0 1];
#+end_quote
Let's define the following frames:
- $\{W\}$ the frame that is *fixed to the granite* and its origin at the theoretical meeting point between the X-ray and the spindle axis.
- $\{S\}$ the frame *attached to the sample* (in reality attached to the top platform of the nano-hexapod) with its origin at 175mm above the top platform of the nano-hexapod.
Its origin is $O_S$.
- $\{T\}$ the theoretical wanted frame that correspond to the wanted pose of the frame $\{S\}$.
$\{T\}$ is computed from the wanted position of each stage. It is thus theoretical and does not correspond to a real position.
The origin of $T$ is $O_T$ and is the wanted position of the sample.
Thus:
- the *measurement* of the position of the sample corresponds to ${}^W O_S = \begin{bmatrix} {}^WP_{x,m} & {}^WP_{y,m} & {}^WP_{z,m} \end{bmatrix}^T$ in translation and to $\theta_m {}^W\bm{s}_m = \theta_m \cdot \begin{bmatrix} {}^Ws_{x,m} & {}^Ws_{y,m} & {}^Ws_{z,m} \end{bmatrix}^T$ in rotations
- the *wanted position* of the sample expressed w.r.t. the granite is ${}^W O_T = \begin{bmatrix} {}^WP_{x,r} & {}^WP_{y,r} & {}^WP_{z,r} \end{bmatrix}^T$ in translation and to $\theta_r {}^W\bm{s}_r = \theta_r \cdot \begin{bmatrix} {}^Ws_{x,r} & {}^Ws_{y,r} & {}^Ws_{z,r} \end{bmatrix}^T$ in rotations
** Wanted Position of the Sample with respect to the Granite
Let's define the wanted position of each stage.
#+begin_src matlab #+begin_src matlab
Ty = 0; % [m] initializeReferences(struct('Dy_type', 'triangular', 'Dy_amplitude', 10e-3, 'Dy_period', 1));
Ry = 3*pi/180; % [rad]
Rz = 180*pi/180; % [rad]
% Hexapod (first consider only translations)
Thx = 0; % [m]
Thy = 0; % [m]
Thz = 0; % [m]
#+end_src #+end_src
Now, we compute the corresponding wanted translation and rotation of the sample with respect to the granite frame $\{W\}$. We initialize the stages.
This corresponds to ${}^WO_T$ and $\theta_m {}^Ws_m$.
To do so, we have to define the homogeneous transformation for each stage.
#+begin_src matlab #+begin_src matlab
% Translation Stage initializeGround();
Rty = [1 0 0 0; initializeGranite();
0 1 0 Ty; initializeTy();
0 0 1 0; initializeRy();
0 0 0 1]; initializeRz();
initializeMicroHexapod();
% Tilt Stage - Pure rotating aligned with Ob initializeAxisc();
Rry = [ cos(Ry) 0 sin(Ry) 0; initializeMirror();
0 1 0 0; initializeNanoHexapod(struct('actuator', 'piezo'));
-sin(Ry) 0 cos(Ry) 0; initializeSample(struct('mass', 1));
0 0 0 1];
% Spindle - Rotation along the Z axis
Rrz = [cos(Rz) -sin(Rz) 0 0 ;
sin(Rz) cos(Rz) 0 0 ;
0 0 1 0 ;
0 0 0 1 ];
% Micro-Hexapod (only rotations first)
Rh = [1 0 0 Thx ;
0 1 0 Thy ;
0 0 1 Thz ;
0 0 0 1 ];
#+end_src #+end_src
We combine the individual homogeneous transformations into one homogeneous transformation for all the station. And we initialize the disturbances to zero.
#+begin_src matlab #+begin_src matlab
Ttot = Rty*Rry*Rrz*Rh; opts = struct(...
'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
);
initDisturbances(opts);
#+end_src #+end_src
Using this homogeneous transformation, we can compute the wanted position and orientation of the sample with respect to the granite. We simulate the model.
Translation.
#+begin_src matlab #+begin_src matlab
WOr = Ttot*[0;0;0;1]; sim('sim_nano_station_tomo');
WOr = WOr(1:3);
#+end_src #+end_src
Rotation. And we save the obtained data.
#+begin_src matlab #+begin_src matlab
thetar = acos((trace(Ttot(1:3, 1:3))-1)/2) ty_scan = struct('t', t, 'MTr', MTr);
if thetar == 0 save('experiment_tomography/mat/experiment.mat', 'ty_scan', '-append');
WSr = [0; 0; 0]; #+end_src
else
[V, D] = eig(Ttot(1:3, 1:3)); ** Analysis
WSr = thetar*V(:, abs(diag(D) - 1) < eps(1)); #+begin_src matlab
end load('experiment_tomography/mat/experiment.mat', 'ty_scan');
t = ty_scan.t;
MTr = ty_scan.MTr;
#+end_src #+end_src
#+begin_src matlab #+begin_src matlab
WPr = [WOr ; WSr]; 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 #+end_src
** Measured Position of the Sample with respect to the Granite #+begin_src matlab :exports none
The measurement of the position of the sample using the metrology system gives the position and orientation of the sample with respect to the granite. figure;
#+begin_src matlab ax1 = subplot(1, 3, 1);
% Measurements: Xm, Ym, Zm, Rx, Ry, Rz plot(t, Edx, 'DisplayName', '$\epsilon_{x}$')
Dxm = 0; % [m] ylabel('Displacement [m]');
Dym = 0; % [m] legend('location', 'northeast');
Dzm = 0; % [m]
Rxm = 0*pi/180; % [rad] ax2 = subplot(1, 3, 2);
Rym = 0*pi/180; % [rad] plot(t, Edy, 'DisplayName', '$\epsilon_{y}$')
Rzm = 180*pi/180; % [rad] xlabel('Time [s]');
legend('location', 'northeast');
ax3 = subplot(1, 3, 3);
plot(t, Edz, 'DisplayName', '$\epsilon_{z}$')
legend('location', 'northeast');
linkaxes([ax1,ax2,ax3],'x');
xlim([1, inf]);
#+end_src #+end_src
Let's compute the corresponding orientation using screw axis. #+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab #+begin_src matlab :var filepath="figs/exp_ty_scan_trans.pdf" :var figsize="full-normal" :post pdf2svg(file=*this*, ext="png")
Trxm = [1 0 0; <<plt-matlab>>
0 cos(Rxm) -sin(Rxm);
0 sin(Rxm) cos(Rxm)];
Trym = [ cos(Rym) 0 sin(Rym);
0 1 0;
-sin(Rym) 0 cos(Rym)];
Trzm = [cos(Rzm) -sin(Rzm) 0;
sin(Rzm) cos(Rzm) 0;
0 0 1];
STw = [[ Trym*Trxm*Trzm , [Dxm; Dym; Dzm]]; 0 0 0 1];
#+end_src #+end_src
We then obtain the orientation measurement in the form of screw coordinate $\theta_m ({}^Ws_{x,m},\ {}^Ws_{y,m},\ {}^Ws_{z,m})^T$ where: #+NAME: fig:exp_ty_scan_trans
- $\theta_m = \cos^{-1} \frac{\text{Tr}(R) - 1}{2}$ #+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]])
- ${}^W\bm{s}_m$ is the eigen vector of the rotation matrix $R$ corresponding to the eigen value $\lambda = 1$ [[file:figs/exp_ty_scan_trans.png]]
#+begin_src matlab #+begin_src matlab :exports none
thetam = acos((trace(STw(1:3, 1:3))-1)/2); % [rad] figure;
if thetam == 0 ax1 = subplot(1, 3, 1);
WSm = [0; 0; 0]; plot(t, Erx, 'DisplayName', '$\epsilon_{\theta x}$')
else ylabel('Rotation [rad]');
[V, D] = eig(STw(1:3, 1:3)); legend('location', 'northeast');
WSm = thetam*V(:, abs(diag(D) - 1) < eps(1));
end ax2 = subplot(1, 3, 2);
plot(t, Ery, 'DisplayName', '$\epsilon_{\theta y}$')
xlabel('Time [s]');
legend('location', 'northeast');
ax3 = subplot(1, 3, 3);
plot(t, Erz, 'DisplayName', '$\epsilon_{\theta z}$')
legend('location', 'northeast');
linkaxes([ax1,ax2,ax3],'x');
xlim([1, inf]);
#+end_src #+end_src
#+begin_src matlab #+HEADER: :tangle no :exports results :results none :noweb yes
WPm = [Dxm ; Dym ; Dzm ; WSm]; #+begin_src matlab :var filepath="figs/exp_ty_scan_rot.pdf" :var figsize="full-normal" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src #+end_src
** Positioning Error with respect to the Granite #+NAME: fig:exp_ty_scan_rot
The wanted position expressed with respect to the granite is ${}^WO_T$ and the measured position with respect to the granite is ${}^WO_S$, thus the *position error* expressed in $\{W\}$ is #+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]])
\[ {}^W E = {}^W O_T - {}^W O_S \] [[file:figs/exp_ty_scan_rot.png]]
The same is true for rotations:
\[ \theta_\epsilon {}^W\bm{s}_\epsilon = \theta_r {}^W\bm{s}_r - \theta_m {}^W\bm{s}_m \]
#+begin_src matlab ** Conclusion
WPe = WPr - WPm;
#+end_src
#+begin_quote #+begin_important
Now we want to express this error in a frame attached to the *base of the nano-hexapod* with its origin at the same point where the Jacobian of the nano-hexapod is computed (175mm above the top platform + 90mm of total height of the nano-hexapod). 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.
Or maybe should we want to express this error with respect to the *top platform of the nano-hexapod*? #+end_important
We are measuring the position of the top-platform, and we don't know exactly the position of the bottom platform.
We could compute the position of the bottom platform in two ways:
- from the encoders of each stage
- from the measurement of the nano-hexapod top platform + the internal metrology in the nano-hexapod (capacitive sensors e.g)
A third option is to say that the maximum stroke of the nano-hexapod is so small that the error should no change to much by the change of base.
#+end_quote
** Position Error Expressed in the Nano-Hexapod Frame
We now want the position error to be expressed in $\{S\}$ (the frame attach to the sample) for control:
\[ {}^S E = {}^S T_W \cdot {}^W E \]
Thus we need to compute the homogeneous transformation ${}^ST_W$.
Fortunately, this homogeneous transformation can be computed from the measurement of the sample position and orientation with respect to the granite.
#+begin_src matlab
Trxm = [1 0 0;
0 cos(Rxm) -sin(Rxm);
0 sin(Rxm) cos(Rxm)];
Trym = [ cos(Rym) 0 sin(Rym);
0 1 0;
-sin(Rym) 0 cos(Rym)];
Trzm = [cos(Rzm) -sin(Rzm) 0;
sin(Rzm) cos(Rzm) 0;
0 0 1];
STw = [[ Trym*Trxm*Trzm , [Dxm; Dym; Dzm]]; 0 0 0 1];
#+end_src
Translation Error.
#+begin_src matlab
SEm = STw * [WPe(1:3); 0];
SEm = SEm(1:3);
#+end_src
Rotation Error.
#+begin_src matlab
SEr = STw * [WPe(4:6); 0];
SEr = SEr(1:3);
#+end_src
#+begin_src matlab
Etot = [SEm ; SEr]
#+end_src
** Another try
Let's denote:
- $\{W\}$ the initial fixed frame
- $\{R\}$ the reference frame corresponding to the wanted pose of the sample
- $\{M\}$ the frame corresponding to the measured pose of the sample
We have then computed:
- ${}^WT_R$
- ${}^WT_M$
We have:
\begin{align}
{}^MT_R &= {}^MT_W {}^WT_R \\
&= {}^WT_M^t {}^WT_R
\end{align}
#+begin_src matlab
MTr = STw'*Ttot;
#+end_src
Position error:
#+begin_src matlab
MTr(1:3, 1:4)*[0; 0; 0; 1]
#+end_src
Orientation error:
#+begin_src matlab
MTr(1:3, 1:3)
#+end_src
** Verification
How can we verify that the computation is correct?
Options:
- Test with simscape multi-body
- Impose motion on each stage
- Measure the position error w.r.t. the NASS
- Compare with the computation

BIN
figs/exp_tomo_dist_rot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 40 KiB

BIN
figs/exp_ty_scan_rot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
figs/exp_ty_scan_trans.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -57,22 +57,23 @@ This Matlab function is accessible [[file:../src/initializeInputs.m][here]].
function [ref] = initializeReferences(opts_param) function [ref] = initializeReferences(opts_param)
%% Default values for opts %% Default values for opts
opts = struct( ... opts = struct( ...
'Ts', 1e-3, ... % Sampling Frequency [s] 'Ts', 1e-3, ... % Sampling Frequency [s]
'Dy_type', 'constant', ... % Either "constant" / "triangular" / "sinusoidal" 'Tmax', 100, ... % Maximum simulation time [s]
'Dy_amplitude', 0, ... % Amplitude of the displacement [m] 'Dy_type', 'constant', ... % Either "constant" / "triangular" / "sinusoidal"
'Dy_period', 1, ... % Period of the displacement [s] 'Dy_amplitude', 0, ... % Amplitude of the displacement [m]
'Ry_type', 'constant', ... % Either "constant" / "triangular" / "sinusoidal" 'Dy_period', 1, ... % Period of the displacement [s]
'Ry_amplitude', 0, ... % Amplitude [rad] 'Ry_type', 'constant', ... % Either "constant" / "triangular" / "sinusoidal"
'Ry_period', 10, ... % Period of the displacement [s] 'Ry_amplitude', 0, ... % Amplitude [rad]
'Rz_type', 'constant', ... % Either "constant" / "rotating" 'Ry_period', 1, ... % Period of the displacement [s]
'Rz_amplitude', 0, ... % Initial angle [rad] 'Rz_type', 'constant', ... % Either "constant" / "rotating"
'Rz_period', 1, ... % Period of the rotating [s] 'Rz_amplitude', 0, ... % Initial angle [rad]
'Dh_type', 'constant', ... % For now, only constant is implemented 'Rz_period', 1, ... % Period of the rotating [s]
'Dh_pos', [0; 0; 0; 0; 0; 0], ... % Initial position [m,m,m,rad,rad,rad] of the top platform (Pitch-Roll-Yaw Euler angles) 'Dh_type', 'constant', ... % For now, only constant is implemented
'Rm_type', 'constant', ... % For now, only constant is implemented 'Dh_pos', zeros(6, 1), ... % Initial position [m,m,m,rad,rad,rad] of the top platform (Pitch-Roll-Yaw Euler angles)
'Rm_pos', [0; pi], ... % Initial position of the two masses 'Rm_type', 'constant', ... % For now, only constant is implemented
'Dn_type', 'constant', ... % For now, only constant is implemented 'Rm_pos', [0; pi], ... % Initial position of the two masses
'Dn_pos', [0; 0; 0; 0; 0; 0] ... % Initial position [m,m,m,rad,rad,rad] of the top platform 'Dn_type', 'constant', ... % For now, only constant is implemented
'Dn_pos', zeros(6,1) ... % Initial position [m,m,m,rad,rad,rad] of the top platform
); );
%% Populate opts with input parameters %% Populate opts with input parameters
@ -84,56 +85,100 @@ This Matlab function is accessible [[file:../src/initializeInputs.m][here]].
%% Set Sampling Time %% Set Sampling Time
Ts = opts.Ts; Ts = opts.Ts;
Tmax = opts.Tmax;
%% Low Pass Filter to filter out the references
s = zpk('s');
w0 = 2*pi*100;
xi = 1;
H_lpf = 1/(1 + 2*xi/w0*s + s^2/w0^2);
%% Translation stage - Dy %% Translation stage - Dy
t = 0:Ts:opts.Dy_period-Ts; % Time Vector [s] t = 0:Ts:Tmax; % Time Vector [s]
Dy = zeros(length(t), 1); Dy = zeros(length(t), 1);
Dyd = zeros(length(t), 1);
Dydd = zeros(length(t), 1);
switch opts.Dy_type switch opts.Dy_type
case 'constant' case 'constant'
Dy(:) = opts.Dy_amplitude; Dy(:) = opts.Dy_amplitude;
Dyd(:) = 0;
Dydd(:) = 0;
case 'triangular' case 'triangular'
Dy(:) = -4*opts.Dy_amplitude + 4*opts.Dy_amplitude/opts.Dy_period*t; % This is done to unsure that we start with no displacement
Dy(t<0.75*opts.Dy_period) = 2*opts.Dy_amplitude - 4*opts.Dy_amplitude/opts.Dy_period*t(t<0.75*opts.Dy_period); Dy_raw = opts.Dy_amplitude*sawtooth(2*pi*t/opts.Dy_period,1/2);
Dy(t<0.25*opts.Dy_period) = 4*opts.Dy_amplitude/opts.Dy_period*t(t<0.25*opts.Dy_period); i0 = find(t>=opts.Dy_period/4,1);
Dy(1:end-i0+1) = Dy_raw(i0:end);
Dy(end-i0+2:end) = Dy_raw(end); % we fix the last value
% The signal is filtered out
Dy = lsim(H_lpf, Dy, t);
Dyd = lsim(H_lpf*s, Dy, t);
Dydd = lsim(H_lpf*s^2, Dy, t);
case 'sinusoidal' case 'sinusoidal'
Dy(:) = opts.Dy_amplitude*sin(2*pi/opts.Dy_period*t); Dy(:) = opts.Dy_amplitude*sin(2*pi/opts.Dy_period*t);
Dyd = opts.Dy_amplitude*2*pi/opts.Dy_period*cos(2*pi/opts.Dy_period*t);
Dydd = -opts.Dy_amplitude*(2*pi/opts.Dy_period)^2*sin(2*pi/opts.Dy_period*t);
otherwise otherwise
warning('Dy_type is not set correctly'); warning('Dy_type is not set correctly');
end end
Dy = struct('time', t, 'signals', struct('values', Dy));
Dy = struct('time', t, 'signals', struct('values', Dy), 'deriv', Dyd, 'dderiv', Dydd);
%% Tilt Stage - Ry %% Tilt Stage - Ry
t = 0:Ts:opts.Ry_period-Ts; t = 0:Ts:Tmax; % Time Vector [s]
Ry = zeros(length(t), 1); Ry = zeros(length(t), 1);
Ryd = zeros(length(t), 1);
Rydd = zeros(length(t), 1);
switch opts.Ry_type switch opts.Ry_type
case 'constant' case 'constant'
Ry(:) = opts.Ry_amplitude; Ry(:) = opts.Ry_amplitude;
Ryd(:) = 0;
Rydd(:) = 0;
case 'triangular' case 'triangular'
Ry(:) = -4*opts.Ry_amplitude + 4*opts.Ry_amplitude/opts.Ry_period*t; Ry_raw = opts.Ry_amplitude*sawtooth(2*pi*t/opts.Ry_period,1/2);
Ry(t<0.75*opts.Ry_period) = 2*opts.Ry_amplitude - 4*opts.Ry_amplitude/opts.Ry_period*t(t<0.75*opts.Ry_period); i0 = find(t>=opts.Ry_period/4,1);
Ry(t<0.25*opts.Ry_period) = 4*opts.Ry_amplitude/opts.Ry_period*t(t<0.25*opts.Ry_period); Ry(1:end-i0+1) = Ry_raw(i0:end);
case 'sinusoidal' Ry(end-i0+2:end) = Ry_raw(end); % we fix the last value
% The signal is filtered out
Ry = lsim(H_lpf, Ry, t);
Ryd = lsim(H_lpf*s, Ry, t);
Rydd = lsim(H_lpf*s^2, Ry, t);
case 'sinusoidal'
Ry(:) = opts.Ry_amplitude*sin(2*pi/opts.Ry_period*t);
Ryd = opts.Ry_amplitude*2*pi/opts.Ry_period*cos(2*pi/opts.Ry_period*t);
Rydd = -opts.Ry_amplitude*(2*pi/opts.Ry_period)^2*sin(2*pi/opts.Ry_period*t);
otherwise otherwise
warning('Ry_type is not set correctly'); warning('Ry_type is not set correctly');
end end
Ry = struct('time', t, 'signals', struct('values', Ry));
Ry = struct('time', t, 'signals', struct('values', Ry), 'deriv', Ryd, 'dderiv', Rydd);
%% Spindle - Rz %% Spindle - Rz
t = 0:Ts:100*opts.Rz_period-Ts; t = 0:Ts:Tmax; % Time Vector [s]
Rz = zeros(length(t), 1); Rz = zeros(length(t), 1);
Rzd = zeros(length(t), 1);
Rzdd = zeros(length(t), 1);
switch opts.Rz_type switch opts.Rz_type
case 'constant' case 'constant'
Rz(:) = opts.Rz_amplitude; Rz(:) = opts.Rz_amplitude;
Rzd(:) = 0;
Rzdd(:) = 0;
case 'rotating' case 'rotating'
Rz(:) = opts.Rz_amplitude+2*pi/opts.Rz_period*t; Rz(:) = opts.Rz_amplitude+2*pi/opts.Rz_period*t;
% The signal is filtered out
Rz = lsim(H_lpf, Rz, t);
Rzd = lsim(H_lpf*s, Rz, t);
Rzdd = lsim(H_lpf*s^2, Rz, t);
otherwise otherwise
warning('Rz_type is not set correctly'); warning('Rz_type is not set correctly');
end end
Rz = struct('time', t, 'signals', struct('values', Rz));
Rz = struct('time', t, 'signals', struct('values', Rz), 'deriv', Rzd, 'dderiv', Rzdd);
%% Micro-Hexapod %% Micro-Hexapod
t = [0, Ts]; t = [0, Ts];
@ -167,11 +212,13 @@ This Matlab function is accessible [[file:../src/initializeInputs.m][here]].
otherwise otherwise
warning('Dh_type is not set correctly'); warning('Dh_type is not set correctly');
end end
Dh = struct('time', t, 'signals', struct('values', Dh)); Dh = struct('time', t, 'signals', struct('values', Dh));
Dhl = struct('time', t, 'signals', struct('values', Dhl)); Dhl = struct('time', t, 'signals', struct('values', Dhl));
%% Axis Compensation - Rm %% Axis Compensation - Rm
t = [0, Ts]; t = [0, Ts];
Rm = [opts.Rm_pos, opts.Rm_pos]; Rm = [opts.Rm_pos, opts.Rm_pos];
Rm = struct('time', t, 'signals', struct('values', Rm)); Rm = struct('time', t, 'signals', struct('values', Rm));
@ -185,6 +232,7 @@ This Matlab function is accessible [[file:../src/initializeInputs.m][here]].
otherwise otherwise
warning('Dn_type is not set correctly'); warning('Dn_type is not set correctly');
end end
Dn = struct('time', t, 'signals', struct('values', Dn)); Dn = struct('time', t, 'signals', struct('values', Dn));
%% Save %% Save

Binary file not shown.

Binary file not shown.

View File

@ -1,22 +1,23 @@
function [ref] = initializeReferences(opts_param) function [ref] = initializeReferences(opts_param)
%% Default values for opts %% Default values for opts
opts = struct( ... opts = struct( ...
'Ts', 1e-3, ... % Sampling Frequency [s] 'Ts', 1e-3, ... % Sampling Frequency [s]
'Dy_type', 'constant', ... % Either "constant" / "triangular" / "sinusoidal" 'Tmax', 100, ... % Maximum simulation time [s]
'Dy_amplitude', 0, ... % Amplitude of the displacement [m] 'Dy_type', 'constant', ... % Either "constant" / "triangular" / "sinusoidal"
'Dy_period', 1, ... % Period of the displacement [s] 'Dy_amplitude', 0, ... % Amplitude of the displacement [m]
'Ry_type', 'constant', ... % Either "constant" / "triangular" / "sinusoidal" 'Dy_period', 1, ... % Period of the displacement [s]
'Ry_amplitude', 0, ... % Amplitude [rad] 'Ry_type', 'constant', ... % Either "constant" / "triangular" / "sinusoidal"
'Ry_period', 10, ... % Period of the displacement [s] 'Ry_amplitude', 0, ... % Amplitude [rad]
'Rz_type', 'constant', ... % Either "constant" / "rotating" 'Ry_period', 1, ... % Period of the displacement [s]
'Rz_amplitude', 0, ... % Initial angle [rad] 'Rz_type', 'constant', ... % Either "constant" / "rotating"
'Rz_period', 1, ... % Period of the rotating [s] 'Rz_amplitude', 0, ... % Initial angle [rad]
'Dh_type', 'constant', ... % For now, only constant is implemented 'Rz_period', 1, ... % Period of the rotating [s]
'Dh_pos', [0; 0; 0; 0; 0; 0], ... % Initial position [m,m,m,rad,rad,rad] of the top platform (Pitch-Roll-Yaw Euler angles) 'Dh_type', 'constant', ... % For now, only constant is implemented
'Rm_type', 'constant', ... % For now, only constant is implemented 'Dh_pos', zeros(6, 1), ... % Initial position [m,m,m,rad,rad,rad] of the top platform (Pitch-Roll-Yaw Euler angles)
'Rm_pos', [0; pi], ... % Initial position of the two masses 'Rm_type', 'constant', ... % For now, only constant is implemented
'Dn_type', 'constant', ... % For now, only constant is implemented 'Rm_pos', [0; pi], ... % Initial position of the two masses
'Dn_pos', [0; 0; 0; 0; 0; 0] ... % Initial position [m,m,m,rad,rad,rad] of the top platform 'Dn_type', 'constant', ... % For now, only constant is implemented
'Dn_pos', zeros(6,1) ... % Initial position [m,m,m,rad,rad,rad] of the top platform
); );
%% Populate opts with input parameters %% Populate opts with input parameters
@ -28,56 +29,100 @@ function [ref] = initializeReferences(opts_param)
%% Set Sampling Time %% Set Sampling Time
Ts = opts.Ts; Ts = opts.Ts;
Tmax = opts.Tmax;
%% Low Pass Filter to filter out the references
s = zpk('s');
w0 = 2*pi*100;
xi = 1;
H_lpf = 1/(1 + 2*xi/w0*s + s^2/w0^2);
%% Translation stage - Dy %% Translation stage - Dy
t = 0:Ts:opts.Dy_period-Ts; % Time Vector [s] t = 0:Ts:Tmax; % Time Vector [s]
Dy = zeros(length(t), 1); Dy = zeros(length(t), 1);
Dyd = zeros(length(t), 1);
Dydd = zeros(length(t), 1);
switch opts.Dy_type switch opts.Dy_type
case 'constant' case 'constant'
Dy(:) = opts.Dy_amplitude; Dy(:) = opts.Dy_amplitude;
Dyd(:) = 0;
Dydd(:) = 0;
case 'triangular' case 'triangular'
Dy(:) = -4*opts.Dy_amplitude + 4*opts.Dy_amplitude/opts.Dy_period*t; % This is done to unsure that we start with no displacement
Dy(t<0.75*opts.Dy_period) = 2*opts.Dy_amplitude - 4*opts.Dy_amplitude/opts.Dy_period*t(t<0.75*opts.Dy_period); Dy_raw = opts.Dy_amplitude*sawtooth(2*pi*t/opts.Dy_period,1/2);
Dy(t<0.25*opts.Dy_period) = 4*opts.Dy_amplitude/opts.Dy_period*t(t<0.25*opts.Dy_period); i0 = find(t>=opts.Dy_period/4,1);
Dy(1:end-i0+1) = Dy_raw(i0:end);
Dy(end-i0+2:end) = Dy_raw(end); % we fix the last value
% The signal is filtered out
Dy = lsim(H_lpf, Dy, t);
Dyd = lsim(H_lpf*s, Dy, t);
Dydd = lsim(H_lpf*s^2, Dy, t);
case 'sinusoidal' case 'sinusoidal'
Dy(:) = opts.Dy_amplitude*sin(2*pi/opts.Dy_period*t); Dy(:) = opts.Dy_amplitude*sin(2*pi/opts.Dy_period*t);
Dyd = opts.Dy_amplitude*2*pi/opts.Dy_period*cos(2*pi/opts.Dy_period*t);
Dydd = -opts.Dy_amplitude*(2*pi/opts.Dy_period)^2*sin(2*pi/opts.Dy_period*t);
otherwise otherwise
warning('Dy_type is not set correctly'); warning('Dy_type is not set correctly');
end end
Dy = struct('time', t, 'signals', struct('values', Dy));
Dy = struct('time', t, 'signals', struct('values', Dy), 'deriv', Dyd, 'dderiv', Dydd);
%% Tilt Stage - Ry %% Tilt Stage - Ry
t = 0:Ts:opts.Ry_period-Ts; t = 0:Ts:Tmax; % Time Vector [s]
Ry = zeros(length(t), 1); Ry = zeros(length(t), 1);
Ryd = zeros(length(t), 1);
Rydd = zeros(length(t), 1);
switch opts.Ry_type switch opts.Ry_type
case 'constant' case 'constant'
Ry(:) = opts.Ry_amplitude; Ry(:) = opts.Ry_amplitude;
Ryd(:) = 0;
Rydd(:) = 0;
case 'triangular' case 'triangular'
Ry(:) = -4*opts.Ry_amplitude + 4*opts.Ry_amplitude/opts.Ry_period*t; Ry_raw = opts.Ry_amplitude*sawtooth(2*pi*t/opts.Ry_period,1/2);
Ry(t<0.75*opts.Ry_period) = 2*opts.Ry_amplitude - 4*opts.Ry_amplitude/opts.Ry_period*t(t<0.75*opts.Ry_period); i0 = find(t>=opts.Ry_period/4,1);
Ry(t<0.25*opts.Ry_period) = 4*opts.Ry_amplitude/opts.Ry_period*t(t<0.25*opts.Ry_period); Ry(1:end-i0+1) = Ry_raw(i0:end);
case 'sinusoidal' Ry(end-i0+2:end) = Ry_raw(end); % we fix the last value
% The signal is filtered out
Ry = lsim(H_lpf, Ry, t);
Ryd = lsim(H_lpf*s, Ry, t);
Rydd = lsim(H_lpf*s^2, Ry, t);
case 'sinusoidal'
Ry(:) = opts.Ry_amplitude*sin(2*pi/opts.Ry_period*t);
Ryd = opts.Ry_amplitude*2*pi/opts.Ry_period*cos(2*pi/opts.Ry_period*t);
Rydd = -opts.Ry_amplitude*(2*pi/opts.Ry_period)^2*sin(2*pi/opts.Ry_period*t);
otherwise otherwise
warning('Ry_type is not set correctly'); warning('Ry_type is not set correctly');
end end
Ry = struct('time', t, 'signals', struct('values', Ry));
Ry = struct('time', t, 'signals', struct('values', Ry), 'deriv', Ryd, 'dderiv', Rydd);
%% Spindle - Rz %% Spindle - Rz
t = 0:Ts:100*opts.Rz_period-Ts; t = 0:Ts:Tmax; % Time Vector [s]
Rz = zeros(length(t), 1); Rz = zeros(length(t), 1);
Rzd = zeros(length(t), 1);
Rzdd = zeros(length(t), 1);
switch opts.Rz_type switch opts.Rz_type
case 'constant' case 'constant'
Rz(:) = opts.Rz_amplitude; Rz(:) = opts.Rz_amplitude;
Rzd(:) = 0;
Rzdd(:) = 0;
case 'rotating' case 'rotating'
Rz(:) = opts.Rz_amplitude+2*pi/opts.Rz_period*t; Rz(:) = opts.Rz_amplitude+2*pi/opts.Rz_period*t;
% The signal is filtered out
Rz = lsim(H_lpf, Rz, t);
Rzd = lsim(H_lpf*s, Rz, t);
Rzdd = lsim(H_lpf*s^2, Rz, t);
otherwise otherwise
warning('Rz_type is not set correctly'); warning('Rz_type is not set correctly');
end end
Rz = struct('time', t, 'signals', struct('values', Rz));
Rz = struct('time', t, 'signals', struct('values', Rz), 'deriv', Rzd, 'dderiv', Rzdd);
%% Micro-Hexapod %% Micro-Hexapod
t = [0, Ts]; t = [0, Ts];
@ -111,11 +156,13 @@ function [ref] = initializeReferences(opts_param)
otherwise otherwise
warning('Dh_type is not set correctly'); warning('Dh_type is not set correctly');
end end
Dh = struct('time', t, 'signals', struct('values', Dh)); Dh = struct('time', t, 'signals', struct('values', Dh));
Dhl = struct('time', t, 'signals', struct('values', Dhl)); Dhl = struct('time', t, 'signals', struct('values', Dhl));
%% Axis Compensation - Rm %% Axis Compensation - Rm
t = [0, Ts]; t = [0, Ts];
Rm = [opts.Rm_pos, opts.Rm_pos]; Rm = [opts.Rm_pos, opts.Rm_pos];
Rm = struct('time', t, 'signals', struct('values', Rm)); Rm = struct('time', t, 'signals', struct('values', Rm));
@ -129,6 +176,7 @@ function [ref] = initializeReferences(opts_param)
otherwise otherwise
warning('Dn_type is not set correctly'); warning('Dn_type is not set correctly');
end end
Dn = struct('time', t, 'signals', struct('values', Dn)); Dn = struct('time', t, 'signals', struct('values', Dn));
%% Save %% Save