test-bench-nano-hexapod/test-bench-nano-hexapod.html

3465 lines
166 KiB
HTML
Raw Normal View History

2021-06-07 19:00:29 +02:00
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-07-02 ven. 18:25 -->
2021-06-07 19:00:29 +02:00
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Nano-Hexapod - Test Bench</title>
<meta name="author" content="Dehaeze Thomas" />
<meta name="generator" content="Org Mode" />
<link rel="stylesheet" type="text/css" href="https://research.tdehaeze.xyz/css/style.css"/>
<script type="text/javascript" src="https://research.tdehaeze.xyz/js/script.js"></script>
2021-06-08 22:39:35 +02:00
<script>
MathJax = {
svg: {
scale: 1,
fontCache: "global"
},
tex: {
tags: "ams",
multlineWidth: "%MULTLINEWIDTH",
tagSide: "right",
macros: {bm: ["\\boldsymbol{#1}",1],},
tagIndent: ".8em"
}
};
</script>
<script id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>
2021-06-07 19:00:29 +02:00
</head>
<body>
<div id="org-div-home-and-up">
<a accesskey="h" href="../index.html"> UP </a>
|
<a accesskey="H" href="../index.html"> HOME </a>
</div><div id="content">
<h1 class="title">Nano-Hexapod - Test Bench</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org8bec936">1. Encoders fixed to the Struts - Dynamics</a>
2021-06-08 22:14:48 +02:00
<ul>
<li><a href="#orgbc3c211">1.1. Identification of the dynamics</a>
2021-06-08 22:15:02 +02:00
<ul>
<li><a href="#orga0e59f2">1.1.1. Load Measurement Data</a></li>
<li><a href="#orgcffeedd">1.1.2. Spectral Analysis - Setup</a></li>
<li><a href="#orgbd95958">1.1.3. Transfer function from Actuator to Encoder</a></li>
<li><a href="#org237f23a">1.1.4. Transfer function from Actuator to Force Sensor</a></li>
<li><a href="#org39a18aa">1.1.5. Save Identified Plants</a></li>
2021-06-09 18:14:45 +02:00
</ul>
</li>
<li><a href="#org7da5f96">1.2. Comparison with the Simscape Model</a>
2021-06-09 18:14:45 +02:00
<ul>
<li><a href="#org498faff">1.2.1. Load measured FRF</a></li>
<li><a href="#org550914e">1.2.2. Dynamics from Actuator to Force Sensors</a></li>
<li><a href="#orgd372f94">1.2.3. Dynamics from Actuator to Encoder</a></li>
<li><a href="#org3db32d5">1.2.4. Effect of a change in bending damping of the joints</a></li>
<li><a href="#orgc4bd67f">1.2.5. Effect of a change in damping factor of the APA</a></li>
<li><a href="#orgadcd3f3">1.2.6. Effect of a change in stiffness damping coef of the APA</a></li>
<li><a href="#org2b45a12">1.2.7. Effect of a change in mass damping coef of the APA</a></li>
<li><a href="#org12e7bf0">1.2.8. Using Flexible model</a></li>
<li><a href="#org37a3a34">1.2.9. Flexible model + encoders fixed to the plates</a></li>
2021-06-09 18:14:45 +02:00
</ul>
</li>
<li><a href="#orgbacab67">1.3. Integral Force Feedback</a>
2021-06-09 18:14:45 +02:00
<ul>
<li><a href="#orgb5e8cf6">1.3.1. IFF Control Law and Optimal Gain</a></li>
<li><a href="#org4f1d4c8">1.3.2. Effect of IFF on the plant - Simulations</a></li>
<li><a href="#org090d56a">1.3.3. Effect of IFF on the plant - Experimental Results</a>
<ul>
<li><a href="#org74e4c1b">1.3.3.1. Load Data</a></li>
<li><a href="#org7c042ed">1.3.3.2. Spectral Analysis - Setup</a></li>
<li><a href="#org1bc2703">1.3.3.3. DVF Plant</a></li>
<li><a href="#orgec2d996">1.3.3.4. Experimental Results - Comparison of the un-damped and fully damped system</a></li>
</ul>
</li>
<li><a href="#org2bad745">1.3.4. Experimental Results - Damped Plant with Optimal gain</a>
<ul>
<li><a href="#orge7e73bf">1.3.4.1. Load Data</a></li>
<li><a href="#org1f0f88d">1.3.4.2. Spectral Analysis - Setup</a></li>
<li><a href="#org565433d">1.3.4.3. DVF Plant</a></li>
2021-06-08 22:15:02 +02:00
</ul>
</li>
<li><a href="#orgd163a25">1.3.5. Comparison with the Flexible model</a></li>
<li><a href="#orgb2cbcb7">1.3.6. Conclusion</a></li>
2021-06-08 22:14:48 +02:00
</ul>
</li>
<li><a href="#org586ff2f">1.4. Modal Analysis</a>
<ul>
<li><a href="#orgf7a3206">1.4.1. Obtained Mode Shapes</a></li>
<li><a href="#orgff9895e">1.4.2. Nano-Hexapod Compliance - Effect of IFF</a></li>
<li><a href="#org5b92fbe">1.4.3. Comparison with the Simscape Model</a></li>
</ul>
</li>
<li><a href="#org9339bb2">1.5. Conclusion</a></li>
</ul>
</li>
<li><a href="#org0b4dd6c">2. Encoders fixed to the plates - Dynamics</a>
<ul>
<li><a href="#org22434c2">2.1. Identification of the dynamics</a>
<ul>
<li><a href="#org09b4ab4">2.1.1. Data Loading and Spectral Analysis Setup</a></li>
<li><a href="#orgf56fae0">2.1.2. Transfer function from Actuator to Encoder</a></li>
<li><a href="#org5d6e9ab">2.1.3. Transfer function from Actuator to Force Sensor</a></li>
<li><a href="#orgda420de">2.1.4. Save Identified Plants</a></li>
</ul>
</li>
<li><a href="#org42eff57">2.2. Comparison with the Simscape Model</a>
<ul>
<li><a href="#org21aca8b">2.2.1. Identification Setup</a></li>
<li><a href="#org27466ed">2.2.2. Dynamics from Actuator to Force Sensors</a></li>
<li><a href="#org8a65375">2.2.3. Dynamics from Actuator to Encoder</a></li>
<li><a href="#orgae011ec">2.2.4. Conclusion</a></li>
</ul>
</li>
<li><a href="#org1a3e12c">2.3. Integral Force Feedback</a>
<ul>
<li><a href="#org6a4edf2">2.3.1. Effect of IFF on the plant - Simscape Model</a></li>
<li><a href="#orgfe2d8fa">2.3.2. Effect of IFF on the plant - FRF</a></li>
<li><a href="#org051609d">2.3.3. Comparison of the measured FRF and the Simscape model</a></li>
<li><a href="#org5c1d983">2.3.4. Save Damped Plant</a></li>
</ul>
</li>
<li><a href="#org81c7b46">2.4. Conclusion</a></li>
</ul>
</li>
<li><a href="#org550b3cf">3. Decentralized High Authority Control with Integral Force Feedback</a>
<ul>
<li><a href="#orgc35ef9f">3.1. High Authority Controller</a>
<ul>
<li><a href="#orgff066a2">3.1.1. Simscape Model</a></li>
<li><a href="#orgf928e84">3.1.2. HAC Controller</a></li>
<li><a href="#orgdbe1e4e">3.1.3. Verification of the Stability using the Simscape model</a></li>
<li><a href="#orgd9f7778">3.1.4. Experimental Loop Gain</a></li>
</ul>
</li>
<li><a href="#orgf630708">3.2. Reference Tracking - Trajectories</a>
<ul>
<li><a href="#orga2d3693">3.2.1. Y-Z Scans</a>
<ul>
<li><a href="#org2a4bd93">3.2.1.1. Generate the Scan</a></li>
<li><a href="#orge120b27">3.2.1.2. Reference Signal for the Strut lengths</a></li>
<li><a href="#orgc95d0c0">3.2.1.3. Time domain simulation with 2DoF model</a></li>
</ul>
</li>
<li><a href="#org685944b">3.2.2. Tilt Scans</a></li>
<li><a href="#org94ade03">3.2.3. &ldquo;NASS&rdquo; reference path</a></li>
</ul>
</li>
<li><a href="#org3ab486a">3.3. First Experimental Tests with the HAC</a>
<ul>
<li><a href="#orgf916df0">3.3.1. Initial Controller</a></li>
<li><a href="#org9fb3bde">3.3.2. Controller with increased stability margins</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#orgd43e917">4. Functions</a>
<ul>
<li><a href="#orga4d4cf8">4.1. <code>generateXYZTrajectory</code></a>
<ul>
<li><a href="#org6cfda6f">Function description</a></li>
<li><a href="#org9800be6">Optional Parameters</a></li>
<li><a href="#orgf3b578b">Initialize Time Vectors</a></li>
<li><a href="#orgb851e15">XYZ Trajectory</a></li>
<li><a href="#org2bb47be">Reference Signal</a></li>
</ul>
</li>
<li><a href="#org0ee8065">4.2. <code>generateYZScanTrajectory</code></a>
<ul>
<li><a href="#orgc8448d7">Function description</a></li>
<li><a href="#org0528208">Optional Parameters</a></li>
<li><a href="#orgbf0d54b">Initialize Time Vectors</a></li>
<li><a href="#org67d0409">Y and Z vectors</a></li>
<li><a href="#org19a085f">Reference Signal</a></li>
</ul>
</li>
<li><a href="#org9a74f9f">4.3. <code>getTransformationMatrixAcc</code></a>
<ul>
<li><a href="#orgd53237f">Function description</a></li>
<li><a href="#orge58d78e">Transformation matrix from motion of the solid body to accelerometer measurements</a></li>
</ul>
</li>
<li><a href="#orgcc3967c">4.4. <code>getJacobianNanoHexapod</code></a>
<ul>
<li><a href="#org29eb7ca">Function description</a></li>
<li><a href="#org2bef4b2">Transformation matrix from motion of the solid body to accelerometer measurements</a></li>
</ul>
</li>
</ul>
</li>
2021-06-07 19:00:29 +02:00
</ul>
</div>
</div>
<hr>
<p>This report is also available as a <a href="./test-bench-nano-hexapod.pdf">pdf</a>.</p>
<hr>
2021-06-09 18:14:45 +02:00
<p>
This document is dedicated to the experimental study of the nano-hexapod shown in Figure <a href="#org812f214">1</a>.
2021-06-09 18:14:45 +02:00
</p>
2021-06-14 18:08:46 +02:00
<div id="org812f214" class="figure">
2021-06-14 18:08:46 +02:00
<p><img src="figs/IMG_20210608_152917.jpg" alt="IMG_20210608_152917.jpg" />
</p>
<p><span class="figure-number">Figure 1: </span>Nano-Hexapod</p>
</div>
<div class="note" id="org0880fc8">
2021-06-07 19:00:29 +02:00
<p>
Here are the documentation of the equipment used for this test bench (lots of them are shwon in Figure <a href="#org51ef7a3">2</a>):
2021-06-07 19:00:29 +02:00
</p>
<ul class="org-ul">
<li>Voltage Amplifier: PiezoDrive <a href="doc/PD200-V7-R1.pdf">PD200</a></li>
<li>Amplified Piezoelectric Actuator: Cedrat <a href="doc/APA300ML.pdf">APA300ML</a></li>
<li>DAC/ADC: Speedgoat <a href="doc/IO131-OEM-Datasheet.pdf">IO313</a></li>
<li>Encoder: Renishaw <a href="doc/L-9517-9678-05-A_Data_sheet_VIONiC_series_en.pdf">Vionic</a> and used <a href="doc/L-9517-9862-01-C_Data_sheet_RKLC_EN.pdf">Ruler</a></li>
<li>Interferometers: Attocube</li>
</ul>
</div>
2021-06-08 22:14:48 +02:00
<div id="org51ef7a3" class="figure">
2021-06-08 22:14:48 +02:00
<p><img src="figs/IMG_20210608_154722.jpg" alt="IMG_20210608_154722.jpg" />
</p>
<p><span class="figure-number">Figure 2: </span>Nano-Hexapod and the control electronics</p>
</div>
2021-06-14 18:08:46 +02:00
<p>
In Figure <a href="#orgb9b87eb">3</a> is shown a block diagram of the experimental setup.
When possible, the notations are consistent with this diagram and summarized in Table <a href="#orga07f96d">1</a>.
2021-06-14 18:08:46 +02:00
</p>
2021-06-09 18:14:45 +02:00
<div id="orgb9b87eb" class="figure">
2021-06-09 18:14:45 +02:00
<p><img src="figs/nano_hexapod_signals.png" alt="nano_hexapod_signals.png" />
</p>
<p><span class="figure-number">Figure 3: </span>Block diagram of the system with named signals</p>
</div>
<table id="orga07f96d" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
2021-06-09 18:14:45 +02:00
<caption class="t-above"><span class="table-number">Table 1:</span> List of signals</caption>
<colgroup>
<col class="org-left" />
<col class="org-left" />
<col class="org-left" />
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">&#xa0;</th>
<th scope="col" class="org-left"><b>Unit</b></th>
<th scope="col" class="org-left"><b>Matlab</b></th>
<th scope="col" class="org-left"><b>Vector</b></th>
<th scope="col" class="org-left"><b>Elements</b></th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">Control Input (wanted DAC voltage)</td>
<td class="org-left"><code>[V]</code></td>
<td class="org-left"><code>u</code></td>
<td class="org-left">\(\bm{u}\)</td>
<td class="org-left">\(u_i\)</td>
</tr>
<tr>
<td class="org-left">DAC Output Voltage</td>
<td class="org-left"><code>[V]</code></td>
<td class="org-left"><code>u</code></td>
<td class="org-left">\(\tilde{\bm{u}}\)</td>
<td class="org-left">\(\tilde{u}_i\)</td>
</tr>
<tr>
<td class="org-left">PD200 Output Voltage</td>
<td class="org-left"><code>[V]</code></td>
<td class="org-left"><code>ua</code></td>
<td class="org-left">\(\bm{u}_a\)</td>
<td class="org-left">\(u_{a,i}\)</td>
</tr>
<tr>
<td class="org-left">Actuator applied force</td>
<td class="org-left"><code>[N]</code></td>
<td class="org-left"><code>tau</code></td>
<td class="org-left">\(\bm{\tau}\)</td>
<td class="org-left">\(\tau_i\)</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left">Strut motion</td>
<td class="org-left"><code>[m]</code></td>
<td class="org-left"><code>dL</code></td>
<td class="org-left">\(d\bm{\mathcal{L}}\)</td>
<td class="org-left">\(d\mathcal{L}_i\)</td>
</tr>
<tr>
<td class="org-left">Encoder measured displacement</td>
<td class="org-left"><code>[m]</code></td>
<td class="org-left"><code>dLm</code></td>
<td class="org-left">\(d\bm{\mathcal{L}}_m\)</td>
<td class="org-left">\(d\mathcal{L}_{m,i}\)</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left">Force Sensor strain</td>
<td class="org-left"><code>[m]</code></td>
<td class="org-left"><code>epsilon</code></td>
<td class="org-left">\(\bm{\epsilon}\)</td>
<td class="org-left">\(\epsilon_i\)</td>
</tr>
<tr>
<td class="org-left">Force Sensor Generated Voltage</td>
<td class="org-left"><code>[V]</code></td>
<td class="org-left"><code>taum</code></td>
<td class="org-left">\(\tilde{\bm{\tau}}_m\)</td>
<td class="org-left">\(\tilde{\tau}_{m,i}\)</td>
</tr>
<tr>
<td class="org-left">Measured Generated Voltage</td>
<td class="org-left"><code>[V]</code></td>
<td class="org-left"><code>taum</code></td>
<td class="org-left">\(\bm{\tau}_m\)</td>
<td class="org-left">\(\tau_{m,i}\)</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left">Motion of the top platform</td>
<td class="org-left"><code>[m,rad]</code></td>
<td class="org-left"><code>dX</code></td>
<td class="org-left">\(d\bm{\mathcal{X}}\)</td>
<td class="org-left">\(d\mathcal{X}_i\)</td>
</tr>
<tr>
<td class="org-left">Metrology measured displacement</td>
<td class="org-left"><code>[m,rad]</code></td>
<td class="org-left"><code>dXm</code></td>
<td class="org-left">\(d\bm{\mathcal{X}}_m\)</td>
<td class="org-left">\(d\mathcal{X}_{m,i}\)</td>
</tr>
</tbody>
</table>
2021-06-14 18:08:46 +02:00
<p>
This document is divided in the following sections:
</p>
<ul class="org-ul">
<li>Section <a href="#org5668282">1</a>: the dynamics of the nano-hexapod when the encoders are fixed to the struts is studied.</li>
<li>Section <a href="#org78f0482">2</a>: the same is done when the encoders are fixed to the plates.</li>
<li>Section <a href="#org5933b35">3</a>: a decentralized HAC-LAC strategy is studied and implemented.</li>
2021-06-14 18:08:46 +02:00
</ul>
<div id="outline-container-org8bec936" class="outline-2">
<h2 id="org8bec936"><span class="section-number-2">1</span> Encoders fixed to the Struts - Dynamics</h2>
2021-06-08 22:15:02 +02:00
<div class="outline-text-2" id="text-1">
2021-06-14 18:08:46 +02:00
<p>
<a id="org5668282"></a>
2021-06-14 18:08:46 +02:00
</p>
2021-06-08 22:39:35 +02:00
<p>
In this section, the encoders are fixed to the struts.
</p>
2021-06-14 18:08:46 +02:00
<p>
It is divided in the following sections:
</p>
<ul class="org-ul">
<li>Section <a href="#org57c6dcf">1.1</a>: the transfer function matrix from the actuators to the force sensors and to the encoders is experimentally identified.</li>
<li>Section <a href="#orgad627b9">1.2</a>: the obtained FRF matrix is compared with the dynamics of the simscape model</li>
<li>Section <a href="#orge466954">1.3</a>: decentralized Integral Force Feedback (IFF) is applied and its performances are evaluated.</li>
<li>Section <a href="#orgbfbcca9">1.4</a>: a modal analysis of the nano-hexapod is performed</li>
2021-06-14 18:08:46 +02:00
</ul>
2021-06-08 22:39:35 +02:00
</div>
2021-06-08 22:14:48 +02:00
<div id="outline-container-orgbc3c211" class="outline-3">
<h3 id="orgbc3c211"><span class="section-number-3">1.1</span> Identification of the dynamics</h3>
<div class="outline-text-3" id="text-1-1">
2021-06-14 18:08:46 +02:00
<p>
<a id="org57c6dcf"></a>
2021-06-14 18:08:46 +02:00
</p>
2021-06-09 18:14:45 +02:00
</div>
<div id="outline-container-orga0e59f2" class="outline-4">
<h4 id="orga0e59f2"><span class="section-number-4">1.1.1</span> Load Measurement Data</h4>
<div class="outline-text-4" id="text-1-1-1">
2021-06-08 22:14:48 +02:00
<div class="org-src-container">
2021-06-09 18:14:45 +02:00
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Load Identification Data</span></span>
meas_data_lf = {};
2021-06-08 22:14:48 +02:00
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:6</span>
meas_data_lf(<span class="org-constant">i</span>) = {load(sprintf(<span class="org-string">'mat/frf_data_exc_strut_%i_noise_lf.mat'</span>, <span class="org-constant">i</span>), <span class="org-string">'t'</span>, <span class="org-string">'Va'</span>, <span class="org-string">'Vs'</span>, <span class="org-string">'de'</span>)};
meas_data_hf(<span class="org-constant">i</span>) = {load(sprintf(<span class="org-string">'mat/frf_data_exc_strut_%i_noise_hf.mat'</span>, <span class="org-constant">i</span>), <span class="org-string">'t'</span>, <span class="org-string">'Va'</span>, <span class="org-string">'Vs'</span>, <span class="org-string">'de'</span>)};
<span class="org-keyword">end</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgcffeedd" class="outline-4">
<h4 id="orgcffeedd"><span class="section-number-4">1.1.2</span> Spectral Analysis - Setup</h4>
<div class="outline-text-4" id="text-1-1-2">
2021-06-08 22:14:48 +02:00
<div class="org-src-container">
2021-06-09 18:14:45 +02:00
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Setup useful variables</span></span>
<span class="org-comment">% Sampling Time [s]</span>
2021-06-08 22:14:48 +02:00
Ts = (meas_data_lf{1}.t(end) <span class="org-type">-</span> (meas_data_lf{1}.t(1)))<span class="org-type">/</span>(length(meas_data_lf{1}.t)<span class="org-type">-</span>1);
<span class="org-comment">% Sampling Frequency [Hz]</span>
Fs = 1<span class="org-type">/</span>Ts;
<span class="org-comment">% Hannning Windows</span>
win = hanning(ceil(1<span class="org-type">*</span>Fs));
2021-06-09 18:14:45 +02:00
<span class="org-comment">% And we get the frequency vector</span>
[<span class="org-type">~</span>, f] = tfestimate(meas_data_lf{1}.Va, meas_data_lf{1}.de, win, [], [], 1<span class="org-type">/</span>Ts);
2021-06-08 22:14:48 +02:00
2021-06-09 18:14:45 +02:00
i_lf = f <span class="org-type">&lt;</span> 250; <span class="org-comment">% Points for low frequency excitation</span>
2021-06-08 22:14:48 +02:00
i_hf = f <span class="org-type">&gt;</span> 250; <span class="org-comment">% Points for high frequency excitation</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgbd95958" class="outline-4">
<h4 id="orgbd95958"><span class="section-number-4">1.1.3</span> Transfer function from Actuator to Encoder</h4>
<div class="outline-text-4" id="text-1-1-3">
2021-06-08 22:14:48 +02:00
<p>
First, let&rsquo;s compute the coherence from the excitation voltage and the displacement as measured by the encoders (Figure <a href="#orgf2208ee">4</a>).
2021-06-08 22:14:48 +02:00
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Coherence</span></span>
coh_dvf = zeros(length(f), 6, 6);
2021-06-08 22:14:48 +02:00
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:6</span>
coh_dvf_lf = mscohere(meas_data_lf{<span class="org-constant">i</span>}.Va, meas_data_lf{<span class="org-constant">i</span>}.de, win, [], [], 1<span class="org-type">/</span>Ts);
coh_dvf_hf = mscohere(meas_data_hf{<span class="org-constant">i</span>}.Va, meas_data_hf{<span class="org-constant">i</span>}.de, win, [], [], 1<span class="org-type">/</span>Ts);
coh_dvf(<span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span>) = [coh_dvf_lf(i_lf, <span class="org-type">:</span>); coh_dvf_hf(i_hf, <span class="org-type">:</span>)];
2021-06-08 22:14:48 +02:00
<span class="org-keyword">end</span>
</pre>
</div>
<div id="orgf2208ee" class="figure">
2021-06-08 22:14:48 +02:00
<p><img src="figs/enc_struts_dvf_coh.png" alt="enc_struts_dvf_coh.png" />
</p>
2021-06-09 18:14:45 +02:00
<p><span class="figure-number">Figure 4: </span>Obtained coherence for the DVF plant</p>
2021-06-08 22:14:48 +02:00
</div>
<p>
Then the 6x6 transfer function matrix is estimated (Figure <a href="#org3221a6d">5</a>).
2021-06-08 22:14:48 +02:00
</p>
<div class="org-src-container">
2021-06-09 18:14:45 +02:00
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% DVF Plant (transfer function from u to dLm)</span></span>
G_dvf = zeros(length(f), 6, 6);
2021-06-08 22:14:48 +02:00
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:6</span>
G_dvf_lf = tfestimate(meas_data_lf{<span class="org-constant">i</span>}.Va, meas_data_lf{<span class="org-constant">i</span>}.de, win, [], [], 1<span class="org-type">/</span>Ts);
G_dvf_hf = tfestimate(meas_data_hf{<span class="org-constant">i</span>}.Va, meas_data_hf{<span class="org-constant">i</span>}.de, win, [], [], 1<span class="org-type">/</span>Ts);
G_dvf(<span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span>) = [G_dvf_lf(i_lf, <span class="org-type">:</span>); G_dvf_hf(i_hf, <span class="org-type">:</span>)];
2021-06-08 22:14:48 +02:00
<span class="org-keyword">end</span>
</pre>
</div>
<div id="org3221a6d" class="figure">
2021-06-08 22:14:48 +02:00
<p><img src="figs/enc_struts_dvf_frf.png" alt="enc_struts_dvf_frf.png" />
</p>
2021-06-09 18:14:45 +02:00
<p><span class="figure-number">Figure 5: </span>Measured FRF for the DVF plant</p>
2021-06-08 22:14:48 +02:00
</div>
</div>
</div>
<div id="outline-container-org237f23a" class="outline-4">
<h4 id="org237f23a"><span class="section-number-4">1.1.4</span> Transfer function from Actuator to Force Sensor</h4>
<div class="outline-text-4" id="text-1-1-4">
2021-06-08 22:14:48 +02:00
<p>
First, let&rsquo;s compute the coherence from the excitation voltage and the displacement as measured by the encoders (Figure <a href="#org4748c87">6</a>).
2021-06-08 22:14:48 +02:00
</p>
<div class="org-src-container">
2021-06-09 18:14:45 +02:00
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Coherence for the IFF plant</span></span>
coh_iff = zeros(length(f), 6, 6);
2021-06-08 22:14:48 +02:00
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:6</span>
coh_iff_lf = mscohere(meas_data_lf{<span class="org-constant">i</span>}.Va, meas_data_lf{<span class="org-constant">i</span>}.Vs, win, [], [], 1<span class="org-type">/</span>Ts);
coh_iff_hf = mscohere(meas_data_hf{<span class="org-constant">i</span>}.Va, meas_data_hf{<span class="org-constant">i</span>}.Vs, win, [], [], 1<span class="org-type">/</span>Ts);
coh_iff(<span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span>) = [coh_iff_lf(i_lf, <span class="org-type">:</span>); coh_iff_hf(i_hf, <span class="org-type">:</span>)];
2021-06-08 22:14:48 +02:00
<span class="org-keyword">end</span>
</pre>
</div>
<div id="org4748c87" class="figure">
2021-06-08 22:14:48 +02:00
<p><img src="figs/enc_struts_iff_coh.png" alt="enc_struts_iff_coh.png" />
</p>
2021-06-09 18:14:45 +02:00
<p><span class="figure-number">Figure 6: </span>Obtained coherence for the IFF plant</p>
2021-06-08 22:14:48 +02:00
</div>
<p>
Then the 6x6 transfer function matrix is estimated (Figure <a href="#org4ec9821">7</a>).
2021-06-08 22:14:48 +02:00
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% IFF Plant</span></span>
G_iff = zeros(length(f), 6, 6);
2021-06-08 22:14:48 +02:00
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:6</span>
G_iff_lf = tfestimate(meas_data_lf{<span class="org-constant">i</span>}.Va, meas_data_lf{<span class="org-constant">i</span>}.Vs, win, [], [], 1<span class="org-type">/</span>Ts);
G_iff_hf = tfestimate(meas_data_hf{<span class="org-constant">i</span>}.Va, meas_data_hf{<span class="org-constant">i</span>}.Vs, win, [], [], 1<span class="org-type">/</span>Ts);
G_iff(<span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span>) = [G_iff_lf(i_lf, <span class="org-type">:</span>); G_iff_hf(i_hf, <span class="org-type">:</span>)];
2021-06-08 22:14:48 +02:00
<span class="org-keyword">end</span>
</pre>
</div>
<div id="org4ec9821" class="figure">
2021-06-08 22:14:48 +02:00
<p><img src="figs/enc_struts_iff_frf.png" alt="enc_struts_iff_frf.png" />
</p>
2021-06-09 18:14:45 +02:00
<p><span class="figure-number">Figure 7: </span>Measured FRF for the IFF plant</p>
</div>
2021-06-08 22:14:48 +02:00
</div>
</div>
<div id="outline-container-org39a18aa" class="outline-4">
<h4 id="org39a18aa"><span class="section-number-4">1.1.5</span> Save Identified Plants</h4>
<div class="outline-text-4" id="text-1-1-5">
<div class="org-src-container">
<pre class="src src-matlab">save(<span class="org-string">'matlab/mat/identified_plants_enc_struts.mat'</span>, <span class="org-string">'f'</span>, <span class="org-string">'Ts'</span>, <span class="org-string">'G_iff'</span>, <span class="org-string">'G_dvf'</span>)
</pre>
</div>
</div>
</div>
2021-06-08 22:14:48 +02:00
</div>
<div id="outline-container-org7da5f96" class="outline-3">
<h3 id="org7da5f96"><span class="section-number-3">1.2</span> Comparison with the Simscape Model</h3>
<div class="outline-text-3" id="text-1-2">
2021-06-08 22:39:35 +02:00
<p>
<a id="orgad627b9"></a>
2021-06-14 18:08:46 +02:00
</p>
<p>
2021-06-09 18:14:45 +02:00
In this section, the measured dynamics is compared with the dynamics estimated from the Simscape model.
2021-06-08 22:39:35 +02:00
</p>
2021-06-09 18:14:45 +02:00
</div>
<div id="outline-container-org498faff" class="outline-4">
<h4 id="org498faff"><span class="section-number-4">1.2.1</span> Load measured FRF</h4>
<div class="outline-text-4" id="text-1-2-1">
2021-06-09 18:14:45 +02:00
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Load data</span></span>
load(<span class="org-string">'identified_plants_enc_struts.mat'</span>, <span class="org-string">'f'</span>, <span class="org-string">'Ts'</span>, <span class="org-string">'G_iff'</span>, <span class="org-string">'G_dvf'</span>)
</pre>
</div>
</div>
</div>
<div id="outline-container-org550914e" class="outline-4">
<h4 id="org550914e"><span class="section-number-4">1.2.2</span> Dynamics from Actuator to Force Sensors</h4>
<div class="outline-text-4" id="text-1-2-2">
<div class="org-src-container">
2021-06-09 18:14:45 +02:00
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Initialize Nano-Hexapod</span></span>
n_hexapod = initializeNanoHexapodFinal(<span class="org-string">'flex_bot_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'flex_top_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'motion_sensor_type'</span>, <span class="org-string">'struts'</span>, ...
<span class="org-string">'actuator_type'</span>, <span class="org-string">'2dof'</span>);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Identify the IFF Plant (transfer function from u to taum)</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/du'</span>], 1, <span class="org-string">'openinput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Inputs</span>
io(io_i) = linio([mdl, <span class="org-string">'/dum'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Force Sensors</span>
2021-06-09 18:14:45 +02:00
Giff = exp(<span class="org-type">-</span>s<span class="org-type">*</span>Ts)<span class="org-type">*</span>linearize(mdl, io, 0.0, options);
</pre>
</div>
<div id="org97b944e" class="figure">
2021-06-09 18:14:45 +02:00
<p><img src="figs/enc_struts_iff_comp_simscape.png" alt="enc_struts_iff_comp_simscape.png" />
2021-06-08 22:39:35 +02:00
</p>
2021-06-09 18:14:45 +02:00
<p><span class="figure-number">Figure 8: </span>Diagonal elements of the IFF Plant</p>
</div>
<div id="org0e44a91" class="figure">
2021-06-09 18:14:45 +02:00
<p><img src="figs/enc_struts_iff_comp_offdiag_simscape.png" alt="enc_struts_iff_comp_offdiag_simscape.png" />
</p>
<p><span class="figure-number">Figure 9: </span>Off diagonal elements of the IFF Plant</p>
</div>
</div>
</div>
<div id="outline-container-orgd372f94" class="outline-4">
<h4 id="orgd372f94"><span class="section-number-4">1.2.3</span> Dynamics from Actuator to Encoder</h4>
<div class="outline-text-4" id="text-1-2-3">
2021-06-09 18:14:45 +02:00
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Initialization of the Nano-Hexapod</span></span>
n_hexapod = initializeNanoHexapodFinal(<span class="org-string">'flex_bot_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'flex_top_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'motion_sensor_type'</span>, <span class="org-string">'struts'</span>, ...
<span class="org-string">'actuator_type'</span>, <span class="org-string">'flexible'</span>);
2021-06-09 18:14:45 +02:00
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Identify the DVF Plant (transfer function from u to dLm)</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/du'</span>], 1, <span class="org-string">'openinput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Inputs</span>
2021-06-09 18:14:45 +02:00
io(io_i) = linio([mdl, <span class="org-string">'/D'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Encoders</span>
Gdvf = exp(<span class="org-type">-</span>s<span class="org-type">*</span>Ts)<span class="org-type">*</span>linearize(mdl, io, 0.0, options);
</pre>
</div>
2021-06-08 22:39:35 +02:00
<div id="org4b3342c" class="figure">
2021-06-09 18:14:45 +02:00
<p><img src="figs/enc_struts_dvf_comp_simscape.png" alt="enc_struts_dvf_comp_simscape.png" />
2021-06-08 22:39:35 +02:00
</p>
2021-06-09 18:14:45 +02:00
<p><span class="figure-number">Figure 10: </span>Diagonal elements of the DVF Plant</p>
2021-06-08 22:39:35 +02:00
</div>
2021-06-09 18:14:45 +02:00
<div id="org8b570cb" class="figure">
2021-06-09 18:14:45 +02:00
<p><img src="figs/enc_struts_dvf_comp_offdiag_simscape.png" alt="enc_struts_dvf_comp_offdiag_simscape.png" />
2021-06-08 22:39:35 +02:00
</p>
2021-06-09 18:14:45 +02:00
<p><span class="figure-number">Figure 11: </span>Off diagonal elements of the DVF Plant</p>
</div>
</div>
</div>
<div id="outline-container-org3db32d5" class="outline-4">
<h4 id="org3db32d5"><span class="section-number-4">1.2.4</span> Effect of a change in bending damping of the joints</h4>
<div class="outline-text-4" id="text-1-2-4">
2021-06-08 22:14:48 +02:00
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Tested bending dampings [Nm/(rad/s)]</span></span>
cRs = [1e<span class="org-type">-</span>3, 5e<span class="org-type">-</span>3, 1e<span class="org-type">-</span>2, 5e<span class="org-type">-</span>2, 1e<span class="org-type">-</span>1];
2021-06-08 22:14:48 +02:00
</pre>
</div>
2021-06-09 18:14:45 +02:00
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Identify the DVF Plant (transfer function from u to dLm)</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/du'</span>], 1, <span class="org-string">'openinput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Inputs</span>
io(io_i) = linio([mdl, <span class="org-string">'/D'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Encoders</span>
</pre>
2021-06-08 22:15:02 +02:00
</div>
2021-06-08 22:39:35 +02:00
<p>
Then the identification is performed for all the values of the bending damping.
2021-06-08 22:39:35 +02:00
</p>
2021-06-08 22:14:48 +02:00
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Idenfity the transfer function from actuator to encoder for all bending dampins</span></span>
Gs = {zeros(length(cRs), 1)};
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:length(cRs)</span>
n_hexapod = initializeNanoHexapodFinal(<span class="org-string">'flex_bot_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'flex_top_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'motion_sensor_type'</span>, <span class="org-string">'struts'</span>, ...
<span class="org-string">'actuator_type'</span>, <span class="org-string">'flexible'</span>, ...
<span class="org-string">'flex_bot_cRx'</span>, cRs(<span class="org-constant">i</span>), ...
<span class="org-string">'flex_bot_cRy'</span>, cRs(<span class="org-constant">i</span>), ...
<span class="org-string">'flex_top_cRx'</span>, cRs(<span class="org-constant">i</span>), ...
<span class="org-string">'flex_top_cRy'</span>, cRs(<span class="org-constant">i</span>));
G = exp(<span class="org-type">-</span>s<span class="org-type">*</span>Ts)<span class="org-type">*</span>linearize(mdl, io, 0.0, options);
G.InputName = {<span class="org-string">'Va1'</span>, <span class="org-string">'Va2'</span>, <span class="org-string">'Va3'</span>, <span class="org-string">'Va4'</span>, <span class="org-string">'Va5'</span>, <span class="org-string">'Va6'</span>};
G.OutputName = {<span class="org-string">'dL1'</span>, <span class="org-string">'dL2'</span>, <span class="org-string">'dL3'</span>, <span class="org-string">'dL4'</span>, <span class="org-string">'dL5'</span>, <span class="org-string">'dL6'</span>};
Gs(<span class="org-constant">i</span>) = {G};
<span class="org-keyword">end</span>
2021-06-08 22:14:48 +02:00
</pre>
</div>
2021-06-08 22:39:35 +02:00
<ul class="org-ul">
<li>Could be nice</li>
<li>Actual damping is very small</li>
</ul>
2021-06-08 22:15:02 +02:00
</div>
</div>
2021-06-08 22:14:48 +02:00
<div id="outline-container-orgc4bd67f" class="outline-4">
<h4 id="orgc4bd67f"><span class="section-number-4">1.2.5</span> Effect of a change in damping factor of the APA</h4>
<div class="outline-text-4" id="text-1-2-5">
2021-06-09 18:14:45 +02:00
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Tested bending dampings [Nm/(rad/s)]</span></span>
xis = [1e<span class="org-type">-</span>3, 5e<span class="org-type">-</span>3, 1e<span class="org-type">-</span>2, 5e<span class="org-type">-</span>2, 1e<span class="org-type">-</span>1];
2021-06-09 18:14:45 +02:00
</pre>
</div>
2021-06-08 22:39:35 +02:00
2021-06-08 22:15:02 +02:00
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Identify the DVF Plant (transfer function from u to dLm)</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/du'</span>], 1, <span class="org-string">'openinput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Inputs</span>
io(io_i) = linio([mdl, <span class="org-string">'/D'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Encoders</span>
2021-06-08 22:15:02 +02:00
</pre>
</div>
2021-06-08 22:39:35 +02:00
2021-06-09 18:14:45 +02:00
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Idenfity the transfer function from actuator to encoder for all bending dampins</span></span>
Gs = {zeros(length(xis), 1)};
2021-06-09 18:14:45 +02:00
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:length(xis)</span>
n_hexapod = initializeNanoHexapodFinal(<span class="org-string">'flex_bot_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'flex_top_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'motion_sensor_type'</span>, <span class="org-string">'struts'</span>, ...
<span class="org-string">'actuator_type'</span>, <span class="org-string">'flexible'</span>, ...
<span class="org-string">'actuator_xi'</span>, xis(<span class="org-constant">i</span>));
2021-06-08 22:39:35 +02:00
G = exp(<span class="org-type">-</span>s<span class="org-type">*</span>Ts)<span class="org-type">*</span>linearize(mdl, io, 0.0, options);
G.InputName = {<span class="org-string">'Va1'</span>, <span class="org-string">'Va2'</span>, <span class="org-string">'Va3'</span>, <span class="org-string">'Va4'</span>, <span class="org-string">'Va5'</span>, <span class="org-string">'Va6'</span>};
G.OutputName = {<span class="org-string">'dL1'</span>, <span class="org-string">'dL2'</span>, <span class="org-string">'dL3'</span>, <span class="org-string">'dL4'</span>, <span class="org-string">'dL5'</span>, <span class="org-string">'dL6'</span>};
2021-06-09 18:14:45 +02:00
Gs(<span class="org-constant">i</span>) = {G};
2021-06-09 18:14:45 +02:00
<span class="org-keyword">end</span>
</pre>
</div>
<div id="org123a506" class="figure">
<p><img src="figs/bode_Va_dL_effect_xi_damp.png" alt="bode_Va_dL_effect_xi_damp.png" />
2021-06-08 22:39:35 +02:00
</p>
<p><span class="figure-number">Figure 12: </span>Effect of the APA damping factor \(\xi\) on the dynamics from \(u\) to \(d\mathcal{L}\)</p>
2021-06-08 22:15:02 +02:00
</div>
2021-06-09 18:14:45 +02:00
<div class="important" id="org5008eb5">
<p>
Damping factor \(\xi\) has a large impact on the damping of the &ldquo;spurious resonances&rdquo; at 200Hz and 300Hz.
</p>
</div>
<div class="question" id="orga9589fd">
<p>
Why is the damping factor does not change the damping of the first peak?
</p>
</div>
</div>
</div>
<div id="outline-container-orgadcd3f3" class="outline-4">
<h4 id="orgadcd3f3"><span class="section-number-4">1.2.6</span> Effect of a change in stiffness damping coef of the APA</h4>
<div class="outline-text-4" id="text-1-2-6">
<div class="org-src-container">
<pre class="src src-matlab">m_coef = 1e1;
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Tested bending dampings [Nm/(rad/s)]</span></span>
k_coefs = [1e<span class="org-type">-</span>6, 5e<span class="org-type">-</span>6, 1e<span class="org-type">-</span>5, 5e<span class="org-type">-</span>5, 1e<span class="org-type">-</span>4];
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Identify the DVF Plant (transfer function from u to dLm)</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/du'</span>], 1, <span class="org-string">'openinput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Inputs</span>
io(io_i) = linio([mdl, <span class="org-string">'/D'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Encoders</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Idenfity the transfer function from actuator to encoder for all bending dampins</span></span>
Gs = {zeros(length(k_coefs), 1)};
n_hexapod = initializeNanoHexapodFinal(<span class="org-string">'flex_bot_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'flex_top_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'motion_sensor_type'</span>, <span class="org-string">'struts'</span>, ...
<span class="org-string">'actuator_type'</span>, <span class="org-string">'flexible'</span>);
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:length(k_coefs)</span>
k_coef = k_coefs(<span class="org-constant">i</span>);
G = exp(<span class="org-type">-</span>s<span class="org-type">*</span>Ts)<span class="org-type">*</span>linearize(mdl, io, 0.0, options);
G.InputName = {<span class="org-string">'Va1'</span>, <span class="org-string">'Va2'</span>, <span class="org-string">'Va3'</span>, <span class="org-string">'Va4'</span>, <span class="org-string">'Va5'</span>, <span class="org-string">'Va6'</span>};
G.OutputName = {<span class="org-string">'dL1'</span>, <span class="org-string">'dL2'</span>, <span class="org-string">'dL3'</span>, <span class="org-string">'dL4'</span>, <span class="org-string">'dL5'</span>, <span class="org-string">'dL6'</span>};
Gs(<span class="org-constant">i</span>) = {G};
<span class="org-keyword">end</span>
</pre>
</div>
<div id="org24507ec" class="figure">
<p><img src="figs/bode_Va_dL_effect_k_coef.png" alt="bode_Va_dL_effect_k_coef.png" />
</p>
<p><span class="figure-number">Figure 13: </span>Effect of a change of the damping &ldquo;stiffness coeficient&rdquo; on the transfer function from \(u\) to \(d\mathcal{L}\)</p>
</div>
</div>
</div>
<div id="outline-container-org2b45a12" class="outline-4">
<h4 id="org2b45a12"><span class="section-number-4">1.2.7</span> Effect of a change in mass damping coef of the APA</h4>
<div class="outline-text-4" id="text-1-2-7">
<div class="org-src-container">
<pre class="src src-matlab">k_coef = 1e<span class="org-type">-</span>6;
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Tested bending dampings [Nm/(rad/s)]</span></span>
m_coefs = [1e1, 5e1, 1e2, 5e2, 1e3];
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Identify the DVF Plant (transfer function from u to dLm)</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/du'</span>], 1, <span class="org-string">'openinput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Inputs</span>
io(io_i) = linio([mdl, <span class="org-string">'/D'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Encoders</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Idenfity the transfer function from actuator to encoder for all bending dampins</span></span>
Gs = {zeros(length(m_coefs), 1)};
n_hexapod = initializeNanoHexapodFinal(<span class="org-string">'flex_bot_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'flex_top_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'motion_sensor_type'</span>, <span class="org-string">'struts'</span>, ...
<span class="org-string">'actuator_type'</span>, <span class="org-string">'flexible'</span>);
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:length(m_coefs)</span>
m_coef = m_coefs(<span class="org-constant">i</span>);
G = exp(<span class="org-type">-</span>s<span class="org-type">*</span>Ts)<span class="org-type">*</span>linearize(mdl, io, 0.0, options);
G.InputName = {<span class="org-string">'Va1'</span>, <span class="org-string">'Va2'</span>, <span class="org-string">'Va3'</span>, <span class="org-string">'Va4'</span>, <span class="org-string">'Va5'</span>, <span class="org-string">'Va6'</span>};
G.OutputName = {<span class="org-string">'dL1'</span>, <span class="org-string">'dL2'</span>, <span class="org-string">'dL3'</span>, <span class="org-string">'dL4'</span>, <span class="org-string">'dL5'</span>, <span class="org-string">'dL6'</span>};
Gs(<span class="org-constant">i</span>) = {G};
<span class="org-keyword">end</span>
</pre>
2021-06-14 18:08:46 +02:00
</div>
<div id="orgd7affd9" class="figure">
<p><img src="figs/bode_Va_dL_effect_m_coef.png" alt="bode_Va_dL_effect_m_coef.png" />
2021-06-14 18:08:46 +02:00
</p>
<p><span class="figure-number">Figure 14: </span>Effect of a change of the damping &ldquo;mass coeficient&rdquo; on the transfer function from \(u\) to \(d\mathcal{L}\)</p>
</div>
</div>
</div>
<div id="outline-container-org12e7bf0" class="outline-4">
<h4 id="org12e7bf0"><span class="section-number-4">1.2.8</span> Using Flexible model</h4>
<div class="outline-text-4" id="text-1-2-8">
<div class="org-src-container">
<pre class="src src-matlab">d_aligns = [[<span class="org-type">-</span>0.05, <span class="org-type">-</span>0.3, 0];
[ 0, 0.5, 0];
[<span class="org-type">-</span>0.1, <span class="org-type">-</span>0.3, 0];
[ 0, 0.3, 0];
[<span class="org-type">-</span>0.05, 0.05, 0];
[0, 0, 0]]<span class="org-type">*</span>1e<span class="org-type">-</span>3;
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">d_aligns = zeros(6,3);
<span class="org-comment">% d_aligns(1,:) = [-0.05, -0.3, 0]*1e-3;</span>
d_aligns<span class="org-type">(2,:) </span>= [ 0, 0.3, 0]<span class="org-type">*</span>1e<span class="org-type">-</span>3;
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Initialize Nano-Hexapod</span></span>
n_hexapod = initializeNanoHexapodFinal(<span class="org-string">'flex_bot_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'flex_top_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'motion_sensor_type'</span>, <span class="org-string">'struts'</span>, ...
<span class="org-string">'actuator_type'</span>, <span class="org-string">'flexible'</span>, ...
<span class="org-string">'actuator_d_align'</span>, d_aligns);
</pre>
</div>
<div class="question" id="orgcdfbc02">
<p>
Why do we have smaller resonances when using flexible APA?
On the test bench we have the same resonance as the 2DoF model.
Could it be due to the compliance in other dof of the flexible model?
</p>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Identify the DVF Plant (transfer function from u to dLm)</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/du'</span>], 1, <span class="org-string">'openinput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Inputs</span>
io(io_i) = linio([mdl, <span class="org-string">'/D'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Encoders</span>
Gdvf = exp(<span class="org-type">-</span>s<span class="org-type">*</span>Ts)<span class="org-type">*</span>linearize(mdl, io, 0.0, options);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Identify the IFF Plant (transfer function from u to taum)</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/du'</span>], 1, <span class="org-string">'openinput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Inputs</span>
io(io_i) = linio([mdl, <span class="org-string">'/dum'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Force Sensors</span>
Giff = exp(<span class="org-type">-</span>s<span class="org-type">*</span>Ts)<span class="org-type">*</span>linearize(mdl, io, 0.0, options);
</pre>
</div>
</div>
</div>
<div id="outline-container-org37a3a34" class="outline-4">
<h4 id="org37a3a34"><span class="section-number-4">1.2.9</span> Flexible model + encoders fixed to the plates</h4>
<div class="outline-text-4" id="text-1-2-9">
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Identify the IFF Plant (transfer function from u to taum)</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/du'</span>], 1, <span class="org-string">'openinput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Inputs</span>
io(io_i) = linio([mdl, <span class="org-string">'/D'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Force Sensors</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">d_aligns = [[<span class="org-type">-</span>0.05, <span class="org-type">-</span>0.3, 0];
[ 0, 0.5, 0];
[<span class="org-type">-</span>0.1, <span class="org-type">-</span>0.3, 0];
[ 0, 0.3, 0];
[<span class="org-type">-</span>0.05, 0.05, 0];
[0, 0, 0]]<span class="org-type">*</span>1e<span class="org-type">-</span>3;
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Initialize Nano-Hexapod</span></span>
n_hexapod = initializeNanoHexapodFinal(<span class="org-string">'flex_bot_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'flex_top_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'motion_sensor_type'</span>, <span class="org-string">'struts'</span>, ...
<span class="org-string">'actuator_type'</span>, <span class="org-string">'flexible'</span>, ...
<span class="org-string">'actuator_d_align'</span>, d_aligns);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">Gdvf_struts = exp(<span class="org-type">-</span>s<span class="org-type">*</span>Ts)<span class="org-type">*</span>linearize(mdl, io, 0.0, options);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Initialize Nano-Hexapod</span></span>
n_hexapod = initializeNanoHexapodFinal(<span class="org-string">'flex_bot_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'flex_top_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'motion_sensor_type'</span>, <span class="org-string">'plates'</span>, ...
<span class="org-string">'actuator_type'</span>, <span class="org-string">'flexible'</span>, ...
<span class="org-string">'actuator_d_align'</span>, d_aligns);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">Gdvf_plates = exp(<span class="org-type">-</span>s<span class="org-type">*</span>Ts)<span class="org-type">*</span>linearize(mdl, io, 0.0, options);
</pre>
</div>
<div id="orgae75507" class="figure">
<p><img src="figs/dvf_plant_comp_struts_plates.png" alt="dvf_plant_comp_struts_plates.png" />
</p>
<p><span class="figure-number">Figure 15: </span>Comparison of the dynamics from \(V_a\) to \(d_L\) when the encoders are fixed to the struts (blue) and to the plates (red). APA are modeled as a flexible element.</p>
</div>
</div>
</div>
</div>
<div id="outline-container-orgbacab67" class="outline-3">
<h3 id="orgbacab67"><span class="section-number-3">1.3</span> Integral Force Feedback</h3>
<div class="outline-text-3" id="text-1-3">
<p>
<a id="orge466954"></a>
</p>
<p>
In this section, the Integral Force Feedback (IFF) control strategy is applied to the nano-hexapod.
The main goal of this to add damping to the nano-hexapod&rsquo;s modes.
</p>
<p>
The control architecture is shown in Figure <a href="#orgd5d720a">16</a> where \(\bm{K}_\text{IFF}\) is a diagonal \(6 \times 6\) controller.
</p>
<p>
The system as then a new input \(\bm{u}^\prime\), and the transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) should be easier to control than the initial transfer function from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\).
</p>
<div id="orgd5d720a" class="figure">
<p><img src="figs/control_architecture_iff_struts.png" alt="control_architecture_iff_struts.png" />
</p>
<p><span class="figure-number">Figure 16: </span>Integral Force Feedback Strategy</p>
</div>
<p>
This section is structured as follow:
</p>
<ul class="org-ul">
<li>Section <a href="#org19035c3">1.3.1</a>: Using the Simscape model (APA taken as 2DoF model), the transfer function from \(\bm{u}\) to \(\bm{\tau}_m\) is identified. Based on the obtained dynamics, the control law is developed and the optimal gain is estimated using the Root Locus.</li>
<li>Section <a href="#org2960905">1.3.2</a>: Still using the Simscape model, the effect of the IFF gain on the the transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) is studied.</li>
<li>Section <a href="#org09cdbf0">1.3.3</a>: The same is performed experimentally: several IFF gains are used and the damped plant is identified each time.</li>
<li>Section <a href="#org83edaf1">1.3.4</a>: The damped model and the identified damped system are compared for the optimal IFF gain. It is found that IFF indeed adds a lot of damping into the system. However it is not efficient in damping the spurious struts modes.</li>
<li>Section <a href="#org866a83c">1.3.5</a>: Finally, a &ldquo;flexible&rdquo; model of the APA is used in the Simscape model and the optimally damped model is compared with the measurements.</li>
</ul>
</div>
<div id="outline-container-orgb5e8cf6" class="outline-4">
<h4 id="orgb5e8cf6"><span class="section-number-4">1.3.1</span> IFF Control Law and Optimal Gain</h4>
<div class="outline-text-4" id="text-1-3-1">
<p>
<a id="org19035c3"></a>
</p>
<p>
Let&rsquo;s use a model of the Nano-Hexapod with the encoders fixed to the struts and the APA taken as 2DoF model.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Initialize Nano-Hexapod</span></span>
n_hexapod = initializeNanoHexapodFinal(<span class="org-string">'flex_bot_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'flex_top_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'motion_sensor_type'</span>, <span class="org-string">'struts'</span>, ...
<span class="org-string">'actuator_type'</span>, <span class="org-string">'2dof'</span>);
</pre>
</div>
<p>
The transfer function from \(\bm{u}\) to \(\bm{\tau}_m\) is identified.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Identify the IFF Plant (transfer function from u to taum)</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/du'</span>], 1, <span class="org-string">'openinput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Inputs</span>
io(io_i) = linio([mdl, <span class="org-string">'/dum'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Force Sensors</span>
Giff = exp(<span class="org-type">-</span>s<span class="org-type">*</span>Ts)<span class="org-type">*</span>linearize(mdl, io, 0.0, options);
</pre>
</div>
<p>
The IFF controller is defined as shown below:
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% IFF Controller</span></span>
Kiff_g1 = <span class="org-type">-</span>(1<span class="org-type">/</span>(s <span class="org-type">+</span> 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>40))<span class="org-type">*</span>...<span class="org-comment"> % LPF: provides integral action above 40Hz</span>
(s<span class="org-type">/</span>(s <span class="org-type">+</span> 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>30))<span class="org-type">*</span>...<span class="org-comment"> % HPF: limit low frequency gain</span>
(1<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>500))<span class="org-type">*</span>...<span class="org-comment"> % LPF: more robust to high frequency resonances</span>
eye(6); <span class="org-comment">% Diagonal 6x6 controller</span>
</pre>
</div>
<p>
Then, the poles of the system are shown in the complex plane as a function of the controller gain (i.e. Root Locus plot) in Figure <a href="#orge3edf2a">17</a>.
A gain of \(400\) is chosen as the &ldquo;optimal&rdquo; gain as it visually seems to be the gain that adds the maximum damping to all the suspension modes simultaneously.
</p>
<div id="orge3edf2a" class="figure">
<p><img src="figs/enc_struts_iff_root_locus.png" alt="enc_struts_iff_root_locus.png" />
</p>
<p><span class="figure-number">Figure 17: </span>Root Locus for the IFF control strategy</p>
</div>
<p>
Then the &ldquo;optimal&rdquo; IFF controller is:
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% IFF controller with Optimal gain</span></span>
Kiff = 400<span class="org-type">*</span>Kiff_g1;
</pre>
</div>
<p>
And it is saved for further use.
</p>
<div class="org-src-container">
<pre class="src src-matlab">save(<span class="org-string">'mat/Kiff.mat'</span>, <span class="org-string">'Kiff'</span>)
</pre>
</div>
<p>
The bode plots of the &ldquo;diagonal&rdquo; elements of the loop gain are shown in Figure <a href="#orge9e29b8">18</a>.
It is shown that the phase and gain margins are quite high and the loop gain is large arround the resonances.
</p>
<div id="orge9e29b8" class="figure">
<p><img src="figs/enc_struts_iff_opt_loop_gain.png" alt="enc_struts_iff_opt_loop_gain.png" />
</p>
<p><span class="figure-number">Figure 18: </span>Bode plot of the &ldquo;decentralized loop gain&rdquo; \(G_\text{iff}(i,i) \times K_\text{iff}(i,i)\)</p>
</div>
</div>
</div>
<div id="outline-container-org4f1d4c8" class="outline-4">
<h4 id="org4f1d4c8"><span class="section-number-4">1.3.2</span> Effect of IFF on the plant - Simulations</h4>
<div class="outline-text-4" id="text-1-3-2">
<p>
<a id="org2960905"></a>
</p>
<p>
Still using the Simscape model with encoders fixed to the struts and 2DoF APA, the IFF strategy is tested.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Initialize the Simscape model in closed loop</span></span>
n_hexapod = initializeNanoHexapodFinal(<span class="org-string">'flex_bot_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'flex_top_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'motion_sensor_type'</span>, <span class="org-string">'struts'</span>, ...
<span class="org-string">'actuator_type'</span>, <span class="org-string">'2dof'</span>, ...
<span class="org-string">'controller_type'</span>, <span class="org-string">'iff'</span>);
</pre>
</div>
<p>
The following IFF gains are tried:
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Tested IFF gains</span></span>
iff_gains = [4, 10, 20, 40, 100, 200, 400];
</pre>
</div>
<p>
And the transfer functions from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) are identified for all the IFF gains.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Identify the (damped) transfer function from u to dLm for different values of the IFF gain</span></span>
Gd_iff = {zeros(1, length(iff_gains))};
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/du'</span>], 1, <span class="org-string">'openinput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Inputs</span>
io(io_i) = linio([mdl, <span class="org-string">'/dL'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Strut Displacement (encoder)</span>
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:length(iff_gains)</span>
Kiff = iff_gains(<span class="org-constant">i</span>)<span class="org-type">*</span>Kiff_g1<span class="org-type">*</span>eye(6); <span class="org-comment">% IFF Controller</span>
Gd_iff(<span class="org-constant">i</span>) = {exp(<span class="org-type">-</span>s<span class="org-type">*</span>Ts)<span class="org-type">*</span>linearize(mdl, io, 0.0, options)};
isstable(Gd_iff{<span class="org-constant">i</span>})
<span class="org-keyword">end</span>
</pre>
</div>
<p>
The obtained dynamics are shown in Figure <a href="#orgd4555f8">19</a>.
</p>
<div id="orgd4555f8" class="figure">
<p><img src="figs/enc_struts_iff_gains_effect_dvf_plant.png" alt="enc_struts_iff_gains_effect_dvf_plant.png" />
</p>
<p><span class="figure-number">Figure 19: </span>Effect of the IFF gain \(g\) on the transfer function from \(\bm{\tau}\) to \(d\bm{\mathcal{L}}_m\)</p>
</div>
</div>
</div>
<div id="outline-container-org090d56a" class="outline-4">
<h4 id="org090d56a"><span class="section-number-4">1.3.3</span> Effect of IFF on the plant - Experimental Results</h4>
<div class="outline-text-4" id="text-1-3-3">
<p>
<a id="org09cdbf0"></a>
</p>
<p>
The IFF strategy is applied experimentally and the transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) is identified for all the defined values of the gain.
</p>
</div>
<div id="outline-container-org74e4c1b" class="outline-5">
<h5 id="org74e4c1b"><span class="section-number-5">1.3.3.1</span> Load Data</h5>
<div class="outline-text-5" id="text-1-3-3-1">
<p>
First load the identification data.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Load Identification Data</span></span>
meas_iff_gains = {};
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:length(iff_gains)</span>
meas_iff_gains(<span class="org-constant">i</span>) = {load(sprintf(<span class="org-string">'mat/iff_strut_1_noise_g_%i.mat'</span>, iff_gains(<span class="org-constant">i</span>)), <span class="org-string">'t'</span>, <span class="org-string">'Vexc'</span>, <span class="org-string">'Vs'</span>, <span class="org-string">'de'</span>, <span class="org-string">'u'</span>)};
<span class="org-keyword">end</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org7c042ed" class="outline-5">
<h5 id="org7c042ed"><span class="section-number-5">1.3.3.2</span> Spectral Analysis - Setup</h5>
<div class="outline-text-5" id="text-1-3-3-2">
<p>
And define the useful variables that will be used for the identification using the <code>tfestimate</code> function.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Setup useful variables</span></span>
<span class="org-comment">% Sampling Time [s]</span>
Ts = (meas_iff_gains{1}.t(end) <span class="org-type">-</span> (meas_iff_gains{1}.t(1)))<span class="org-type">/</span>(length(meas_iff_gains{1}.t)<span class="org-type">-</span>1);
<span class="org-comment">% Sampling Frequency [Hz]</span>
Fs = 1<span class="org-type">/</span>Ts;
<span class="org-comment">% Hannning Windows</span>
win = hanning(ceil(1<span class="org-type">*</span>Fs));
<span class="org-comment">% And we get the frequency vector</span>
[<span class="org-type">~</span>, f] = tfestimate(meas_iff_gains{1}.Vexc, meas_iff_gains{1}.de, win, [], [], 1<span class="org-type">/</span>Ts);
</pre>
</div>
</div>
</div>
<div id="outline-container-org1bc2703" class="outline-5">
<h5 id="org1bc2703"><span class="section-number-5">1.3.3.3</span> DVF Plant</h5>
<div class="outline-text-5" id="text-1-3-3-3">
<p>
The transfer functions are estimated for all the values of the gain.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% DVF Plant (transfer function from u to dLm)</span></span>
G_iff_gains = {};
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:length(iff_gains)</span>
G_iff_gains{<span class="org-constant">i</span>} = tfestimate(meas_iff_gains{<span class="org-constant">i</span>}.Vexc, meas_iff_gains{<span class="org-constant">i</span>}.de(<span class="org-type">:</span>,1), win, [], [], 1<span class="org-type">/</span>Ts);
<span class="org-keyword">end</span>
</pre>
</div>
<p>
The obtained dynamics as shown in the bode plot in Figure <a href="#org8af6866">20</a>.
The dashed curves are the results obtained using the model, and the solid curves the results from the experimental identification.
</p>
<div id="org8af6866" class="figure">
<p><img src="figs/comp_iff_gains_dvf_plant.png" alt="comp_iff_gains_dvf_plant.png" />
</p>
<p><span class="figure-number">Figure 20: </span>Transfer function from \(u\) to \(d\mathcal{L}_m\) for multiple values of the IFF gain</p>
</div>
<p>
The bode plot is then zoomed on the suspension modes of the nano-hexapod in Figure <a href="#org66382e0">21</a>.
</p>
<div id="org66382e0" class="figure">
<p><img src="figs/comp_iff_gains_dvf_plant_zoom.png" alt="comp_iff_gains_dvf_plant_zoom.png" />
</p>
<p><span class="figure-number">Figure 21: </span>Transfer function from \(u\) to \(d\mathcal{L}_m\) for multiple values of the IFF gain (Zoom)</p>
</div>
<div class="important" id="orgc00670a">
<p>
The IFF control strategy is very effective for the damping of the suspension modes.
It however does not damp the modes at 200Hz, 300Hz and 400Hz (flexible modes of the APA).
</p>
<p>
Also, the experimental results and the models obtained from the Simscape model are in agreement concerning the damped system (up to the flexible modes).
</p>
</div>
</div>
</div>
<div id="outline-container-orgec2d996" class="outline-5">
<h5 id="orgec2d996"><span class="section-number-5">1.3.3.4</span> Experimental Results - Comparison of the un-damped and fully damped system</h5>
<div class="outline-text-5" id="text-1-3-3-4">
<p>
The un-damped and damped experimental plants are compared in Figure <a href="#org75235a1">22</a> (diagonal terms).
</p>
<p>
It is very clear that all the suspension modes are very well damped thanks to IFF.
However, there is little to no effect on the flexible modes of the struts and of the plate.
</p>
<div id="org75235a1" class="figure">
<p><img src="figs/comp_undamped_opt_iff_gain_diagonal.png" alt="comp_undamped_opt_iff_gain_diagonal.png" />
</p>
<p><span class="figure-number">Figure 22: </span>Comparison of the diagonal elements of the tranfer function from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\) without active damping and with optimal IFF gain</p>
</div>
</div>
</div>
</div>
<div id="outline-container-org2bad745" class="outline-4">
<h4 id="org2bad745"><span class="section-number-4">1.3.4</span> Experimental Results - Damped Plant with Optimal gain</h4>
<div class="outline-text-4" id="text-1-3-4">
<p>
<a id="org83edaf1"></a>
</p>
<p>
Let&rsquo;s now look at the \(6 \times 6\) damped plant with the optimal gain \(g = 400\).
</p>
</div>
<div id="outline-container-orge7e73bf" class="outline-5">
<h5 id="orge7e73bf"><span class="section-number-5">1.3.4.1</span> Load Data</h5>
<div class="outline-text-5" id="text-1-3-4-1">
<p>
The experimental data are loaded.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Load Identification Data</span></span>
meas_iff_struts = {};
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:6</span>
meas_iff_struts(<span class="org-constant">i</span>) = {load(sprintf(<span class="org-string">'mat/iff_strut_%i_noise_g_400.mat'</span>, <span class="org-constant">i</span>), <span class="org-string">'t'</span>, <span class="org-string">'Vexc'</span>, <span class="org-string">'Vs'</span>, <span class="org-string">'de'</span>, <span class="org-string">'u'</span>)};
<span class="org-keyword">end</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org1f0f88d" class="outline-5">
<h5 id="org1f0f88d"><span class="section-number-5">1.3.4.2</span> Spectral Analysis - Setup</h5>
<div class="outline-text-5" id="text-1-3-4-2">
<p>
And the parameters useful for the spectral analysis are defined.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Setup useful variables</span></span>
<span class="org-comment">% Sampling Time [s]</span>
Ts = (meas_iff_struts{1}.t(end) <span class="org-type">-</span> (meas_iff_struts{1}.t(1)))<span class="org-type">/</span>(length(meas_iff_struts{1}.t)<span class="org-type">-</span>1);
<span class="org-comment">% Sampling Frequency [Hz]</span>
Fs = 1<span class="org-type">/</span>Ts;
<span class="org-comment">% Hannning Windows</span>
win = hanning(ceil(1<span class="org-type">*</span>Fs));
<span class="org-comment">% And we get the frequency vector</span>
[<span class="org-type">~</span>, f] = tfestimate(meas_iff_struts{1}.Vexc, meas_iff_struts{1}.de, win, [], [], 1<span class="org-type">/</span>Ts);
</pre>
</div>
</div>
</div>
<div id="outline-container-org565433d" class="outline-5">
<h5 id="org565433d"><span class="section-number-5">1.3.4.3</span> DVF Plant</h5>
<div class="outline-text-5" id="text-1-3-4-3">
<p>
Finally, the \(6 \times 6\) plant is identified using the <code>tfestimate</code> function.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% DVF Plant (transfer function from u to dLm)</span></span>
G_iff_opt = {};
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:6</span>
G_iff_opt{<span class="org-constant">i</span>} = tfestimate(meas_iff_struts{<span class="org-constant">i</span>}.Vexc, meas_iff_struts{<span class="org-constant">i</span>}.de, win, [], [], 1<span class="org-type">/</span>Ts);
<span class="org-keyword">end</span>
</pre>
</div>
<p>
The obtained diagonal elements are compared with the model in Figure <a href="#org3f27dde">23</a>.
</p>
<div id="org3f27dde" class="figure">
<p><img src="figs/damped_iff_plant_comp_diagonal.png" alt="damped_iff_plant_comp_diagonal.png" />
</p>
<p><span class="figure-number">Figure 23: </span>Comparison of the diagonal elements of the transfer functions from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\) with active damping (IFF) applied with an optimal gain \(g = 400\)</p>
</div>
<p>
And all the off-diagonal elements are compared with the model in Figure <a href="#org0e5e86e">24</a>.
</p>
<div id="org0e5e86e" class="figure">
<p><img src="figs/damped_iff_plant_comp_off_diagonal.png" alt="damped_iff_plant_comp_off_diagonal.png" />
</p>
<p><span class="figure-number">Figure 24: </span>Comparison of the off-diagonal elements of the transfer functions from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\) with active damping (IFF) applied with an optimal gain \(g = 400\)</p>
</div>
<div class="important" id="org13daadd">
<p>
With the IFF control strategy applied and the optimal gain used, the suspension modes are very well damped.
Remains the un-damped flexible modes of the APA (200Hz, 300Hz, 400Hz), and the modes of the plates (700Hz).
</p>
<p>
The Simscape model and the experimental results are in very good agreement.
</p>
</div>
</div>
</div>
</div>
<div id="outline-container-orgd163a25" class="outline-4">
<h4 id="orgd163a25"><span class="section-number-4">1.3.5</span> Comparison with the Flexible model</h4>
<div class="outline-text-4" id="text-1-3-5">
<p>
<a id="org866a83c"></a>
</p>
<p>
When using the 2-DoF model for the APA, the flexible modes of the struts were not modelled, and it was the main limitation of the model.
Now, let&rsquo;s use a flexible model for the APA, and see if the obtained damped plant using the model is similar to the measured dynamics.
</p>
<p>
First, the nano-hexapod is initialized.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Estimated misalignement of the struts</span></span>
d_aligns = [[<span class="org-type">-</span>0.05, <span class="org-type">-</span>0.3, 0];
[ 0, 0.5, 0];
[<span class="org-type">-</span>0.1, <span class="org-type">-</span>0.3, 0];
[ 0, 0.3, 0];
[<span class="org-type">-</span>0.05, 0.05, 0];
[0, 0, 0]]<span class="org-type">*</span>1e<span class="org-type">-</span>3;
<span class="org-matlab-cellbreak"><span class="org-comment">%% Initialize Nano-Hexapod</span></span>
n_hexapod = initializeNanoHexapodFinal(<span class="org-string">'flex_bot_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'flex_top_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'motion_sensor_type'</span>, <span class="org-string">'struts'</span>, ...
<span class="org-string">'actuator_type'</span>, <span class="org-string">'flexible'</span>, ...
<span class="org-string">'actuator_d_align'</span>, d_aligns, ...
<span class="org-string">'controller_type'</span>, <span class="org-string">'iff'</span>);
</pre>
</div>
<p>
And the &ldquo;optimal&rdquo; controller is loaded.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Optimal IFF controller</span></span>
load(<span class="org-string">'Kiff.mat'</span>, <span class="org-string">'Kiff'</span>);
</pre>
</div>
<p>
The transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) is identified using the Simscape model.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Linearized inputs/outputs</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/du'</span>], 1, <span class="org-string">'openinput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Inputs</span>
io(io_i) = linio([mdl, <span class="org-string">'/dL'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Strut Displacement (encoder)</span>
<span class="org-matlab-cellbreak"><span class="org-comment">%% Identification of the plant</span></span>
Gd_iff = exp(<span class="org-type">-</span>s<span class="org-type">*</span>Ts)<span class="org-type">*</span>linearize(mdl, io, 0.0, options);
</pre>
</div>
<p>
The obtained diagonal elements are shown in Figure <a href="#orgbabd4fc">25</a> while the off-diagonal elements are shown in Figure <a href="#org6bf085f">26</a>.
</p>
<div id="orgbabd4fc" class="figure">
<p><img src="figs/enc_struts_iff_opt_damp_comp_flex_model_diag.png" alt="enc_struts_iff_opt_damp_comp_flex_model_diag.png" />
</p>
<p><span class="figure-number">Figure 25: </span>Diagonal elements of the transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) - comparison of the measured FRF and the identified dynamics using the flexible model</p>
</div>
<div id="org6bf085f" class="figure">
<p><img src="figs/enc_struts_iff_opt_damp_comp_flex_model_off_diag.png" alt="enc_struts_iff_opt_damp_comp_flex_model_off_diag.png" />
</p>
<p><span class="figure-number">Figure 26: </span>Off-diagonal elements of the transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) - comparison of the measured FRF and the identified dynamics using the flexible model</p>
</div>
<div class="important" id="orgebf4261">
<p>
Using flexible models for the APA, the agreement between the Simscape model of the nano-hexapod and the measured FRF is very good.
</p>
<p>
Only the flexible mode of the top-plate is not appearing in the model which is very logical as the top plate is taken as a solid body.
</p>
</div>
</div>
</div>
<div id="outline-container-orgb2cbcb7" class="outline-4">
<h4 id="orgb2cbcb7"><span class="section-number-4">1.3.6</span> Conclusion</h4>
<div class="outline-text-4" id="text-1-3-6">
<div class="important" id="org663bf94">
<p>
The decentralized Integral Force Feedback strategy applied on the nano-hexapod is very effective in damping all the suspension modes.
</p>
<p>
The Simscape model (especially when using a flexible model for the APA) is shown to be very accurate, even when IFF is applied.
</p>
</div>
</div>
</div>
</div>
<div id="outline-container-org586ff2f" class="outline-3">
<h3 id="org586ff2f"><span class="section-number-3">1.4</span> Modal Analysis</h3>
<div class="outline-text-3" id="text-1-4">
<p>
<a id="orgbfbcca9"></a>
</p>
<p>
Several 3-axis accelerometers are fixed on the top platform of the nano-hexapod as shown in Figure <a href="#org4db386b">31</a>.
</p>
<div id="org243ab08" class="figure">
<p><img src="figs/accelerometers_nano_hexapod.jpg" alt="accelerometers_nano_hexapod.jpg" />
</p>
<p><span class="figure-number">Figure 27: </span>Location of the accelerometers on top of the nano-hexapod</p>
</div>
<p>
The top platform is then excited using an instrumented hammer as shown in Figure <a href="#orgc92fed9">28</a>.
</p>
<div id="orgc92fed9" class="figure">
<p><img src="figs/hammer_excitation_compliance_meas.jpg" alt="hammer_excitation_compliance_meas.jpg" />
</p>
<p><span class="figure-number">Figure 28: </span>Example of an excitation using an instrumented hammer</p>
</div>
<p>
From this experiment, the resonance frequencies and the associated mode shapes can be computed (Section <a href="#org317dc32">1.4.1</a>).
Then, in Section <a href="#org67d629f">1.4.2</a>, the vertical compliance of the nano-hexapod is experimentally estimated.
Finally, in Section <a href="#org2a6cc1b">1.4.3</a>, the measured compliance is compare with the estimated one from the Simscape model.
</p>
</div>
<div id="outline-container-orgf7a3206" class="outline-4">
<h4 id="orgf7a3206"><span class="section-number-4">1.4.1</span> Obtained Mode Shapes</h4>
<div class="outline-text-4" id="text-1-4-1">
<p>
<a id="org317dc32"></a>
</p>
<p>
We can observe the mode shapes of the first 6 modes that are the suspension modes (the plate is behaving as a solid body) in Figure <a href="#org80cf65d">29</a>.
</p>
<div id="org80cf65d" class="figure">
<p><img src="figs/mode_shapes_annotated.gif" alt="mode_shapes_annotated.gif" />
</p>
<p><span class="figure-number">Figure 29: </span>Measured mode shapes for the first six modes</p>
</div>
<p>
Then, there is a mode at 692Hz which corresponds to a flexible mode of the top plate (Figure <a href="#orgfc339eb">30</a>).
</p>
<div id="orgfc339eb" class="figure">
<p><img src="figs/ModeShapeFlex1_crop.gif" alt="ModeShapeFlex1_crop.gif" />
</p>
<p><span class="figure-number">Figure 30: </span>First flexible mode at 692Hz</p>
</div>
<p>
The obtained modes are summarized in Table <a href="#orgaf23a41">2</a>.
</p>
<table id="orgaf23a41" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption class="t-above"><span class="table-number">Table 2:</span> Description of the identified modes</caption>
<colgroup>
<col class="org-right" />
<col class="org-right" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-right">Mode</th>
<th scope="col" class="org-right">Freq. [Hz]</th>
<th scope="col" class="org-left">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-right">1</td>
<td class="org-right">105</td>
<td class="org-left">Suspension Mode: Y-translation</td>
</tr>
<tr>
<td class="org-right">2</td>
<td class="org-right">107</td>
<td class="org-left">Suspension Mode: X-translation</td>
</tr>
<tr>
<td class="org-right">3</td>
<td class="org-right">131</td>
<td class="org-left">Suspension Mode: Z-translation</td>
</tr>
<tr>
<td class="org-right">4</td>
<td class="org-right">161</td>
<td class="org-left">Suspension Mode: Y-tilt</td>
</tr>
<tr>
<td class="org-right">5</td>
<td class="org-right">162</td>
<td class="org-left">Suspension Mode: X-tilt</td>
</tr>
<tr>
<td class="org-right">6</td>
<td class="org-right">180</td>
<td class="org-left">Suspension Mode: Z-rotation</td>
</tr>
<tr>
<td class="org-right">7</td>
<td class="org-right">692</td>
<td class="org-left">(flexible) Membrane mode of the top platform</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="outline-container-orgff9895e" class="outline-4">
<h4 id="orgff9895e"><span class="section-number-4">1.4.2</span> Nano-Hexapod Compliance - Effect of IFF</h4>
<div class="outline-text-4" id="text-1-4-2">
<p>
<a id="org67d629f"></a>
</p>
<p>
In this section, we wish to estimated the effectiveness of the IFF strategy concerning the compliance.
</p>
<p>
The top plate is excited vertically using the instrumented hammer two times:
</p>
<ol class="org-ol">
<li>no control loop is used</li>
<li>decentralized IFF is used</li>
</ol>
<p>
The data is loaded.
</p>
<div class="org-src-container">
<pre class="src src-matlab">frf_ol = load(<span class="org-string">'Measurement_Z_axis.mat'</span>); <span class="org-comment">% Open-Loop</span>
frf_iff = load(<span class="org-string">'Measurement_Z_axis_damped.mat'</span>); <span class="org-comment">% IFF</span>
</pre>
</div>
<p>
The mean vertical motion of the top platform is computed by averaging all 5 accelerometers.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Multiply by 10 (gain in m/s^2/V) and divide by 5 (number of accelerometers)</span></span>
d_frf_ol = 10<span class="org-type">/</span>5<span class="org-type">*</span>(frf_ol.FFT1_H1_4_1_RMS_Y_Mod <span class="org-type">+</span> frf_ol.FFT1_H1_7_1_RMS_Y_Mod <span class="org-type">+</span> frf_ol.FFT1_H1_10_1_RMS_Y_Mod <span class="org-type">+</span> frf_ol.FFT1_H1_13_1_RMS_Y_Mod <span class="org-type">+</span> frf_ol.FFT1_H1_16_1_RMS_Y_Mod)<span class="org-type">./</span>(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>frf_ol.FFT1_H1_16_1_RMS_X_Val)<span class="org-type">.^</span>2;
d_frf_iff = 10<span class="org-type">/</span>5<span class="org-type">*</span>(frf_iff.FFT1_H1_4_1_RMS_Y_Mod <span class="org-type">+</span> frf_iff.FFT1_H1_7_1_RMS_Y_Mod <span class="org-type">+</span> frf_iff.FFT1_H1_10_1_RMS_Y_Mod <span class="org-type">+</span> frf_iff.FFT1_H1_13_1_RMS_Y_Mod <span class="org-type">+</span> frf_iff.FFT1_H1_16_1_RMS_Y_Mod)<span class="org-type">./</span>(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>frf_iff.FFT1_H1_16_1_RMS_X_Val)<span class="org-type">.^</span>2;
</pre>
</div>
<p>
The vertical compliance (magnitude of the transfer function from a vertical force applied on the top plate to the vertical motion of the top plate) is shown in Figure <a href="#org4db386b">31</a>.
</p>
<div id="org4db386b" class="figure">
<p><img src="figs/compliance_vertical_comp_iff.png" alt="compliance_vertical_comp_iff.png" />
</p>
<p><span class="figure-number">Figure 31: </span>Measured vertical compliance with and without IFF</p>
</div>
<div class="important" id="org53a8b78">
<p>
From Figure <a href="#org4db386b">31</a>, it is clear that the IFF control strategy is very effective in damping the suspensions modes of the nano-hexapod.
It also has the effect of (slightly) degrading the vertical compliance at low frequency.
</p>
<p>
It also seems some damping can be added to the modes at around 205Hz which are flexible modes of the struts.
</p>
</div>
</div>
</div>
<div id="outline-container-org5b92fbe" class="outline-4">
<h4 id="org5b92fbe"><span class="section-number-4">1.4.3</span> Comparison with the Simscape Model</h4>
<div class="outline-text-4" id="text-1-4-3">
<p>
<a id="org2a6cc1b"></a>
</p>
<p>
Let&rsquo;s now compare the measured vertical compliance with the vertical compliance as estimated from the Simscape model.
</p>
<p>
The transfer function from a vertical external force to the absolute motion of the top platform is identified (with and without IFF) using the Simscape model.
The comparison is done in Figure <a href="#org604134f">32</a>.
Again, the model is quite accurate!
</p>
<div id="org604134f" class="figure">
<p><img src="figs/compliance_vertical_comp_model_iff.png" alt="compliance_vertical_comp_model_iff.png" />
</p>
<p><span class="figure-number">Figure 32: </span>Measured vertical compliance with and without IFF</p>
</div>
</div>
</div>
</div>
<div id="outline-container-org9339bb2" class="outline-3">
<h3 id="org9339bb2"><span class="section-number-3">1.5</span> Conclusion</h3>
<div class="outline-text-3" id="text-1-5">
<div class="important" id="org287b575">
<p>
From the previous analysis, several conclusions can be drawn:
</p>
<ul class="org-ul">
<li>Decentralized IFF is very effective in damping the &ldquo;suspension&rdquo; modes of the nano-hexapod (Figure <a href="#org75235a1">22</a>)</li>
<li>Decentralized IFF does not damp the &ldquo;spurious&rdquo; modes of the struts nor the flexible modes of the top plate (Figure <a href="#org75235a1">22</a>)</li>
<li>Even though the Simscape model and the experimentally measured FRF are in good agreement (Figures <a href="#orgbabd4fc">25</a> and <a href="#org6bf085f">26</a>), the obtain dynamics from the control inputs \(\bm{u}\) and the encoders \(d\bm{\mathcal{L}}_m\) is very difficult to control</li>
</ul>
<p>
Therefore, in the following sections, the encoders will be fixed to the plates.
The goal is to be less sensitive to the flexible modes of the struts.
</p>
</div>
</div>
</div>
</div>
<div id="outline-container-org0b4dd6c" class="outline-2">
<h2 id="org0b4dd6c"><span class="section-number-2">2</span> Encoders fixed to the plates - Dynamics</h2>
<div class="outline-text-2" id="text-2">
<p>
<a id="org78f0482"></a>
</p>
<p>
In this section, the encoders are fixed to the plates rather than to the struts as shown in Figure <a href="#org15a2a62">33</a>.
</p>
<div id="org15a2a62" class="figure">
<p><img src="figs/IMG_20210625_083801.jpg" alt="IMG_20210625_083801.jpg" />
</p>
<p><span class="figure-number">Figure 33: </span>Nano-Hexapod with encoders fixed to the struts</p>
</div>
<p>
It is structured as follow:
</p>
<ul class="org-ul">
<li>Section <a href="#orgee027dd">2.1</a>: The dynamics of the nano-hexapod is identified.</li>
<li>Section <a href="#org7e7593e">2.2</a>: The identified dynamics is compared with the Simscape model.</li>
<li>Section <a href="#orgcdf0f51">2.3</a>: The Integral Force Feedback (IFF) control strategy is applied and the dynamics of the damped nano-hexapod is identified and compare with the Simscape model.</li>
</ul>
</div>
<div id="outline-container-org22434c2" class="outline-3">
<h3 id="org22434c2"><span class="section-number-3">2.1</span> Identification of the dynamics</h3>
<div class="outline-text-3" id="text-2-1">
<p>
<a id="orgee027dd"></a>
</p>
<p>
In this section, the dynamics of the nano-hexapod with the encoders fixed to the plates is identified.
</p>
<p>
First, the measurement data are loaded in Section <a href="#orgb3e4ad6">2.1.1</a>, then the transfer function matrix from the actuators to the encoders are estimated in Section <a href="#orgfd04a93">2.1.2</a>.
Finally, the transfer function matrix from the actuators to the force sensors is estimated in Section <a href="#orgce3b648">2.1.3</a>.
</p>
</div>
<div id="outline-container-org09b4ab4" class="outline-4">
<h4 id="org09b4ab4"><span class="section-number-4">2.1.1</span> Data Loading and Spectral Analysis Setup</h4>
<div class="outline-text-4" id="text-2-1-1">
<p>
<a id="orgb3e4ad6"></a>
</p>
<p>
The actuators are excited one by one using a low pass filtered white noise.
For each excitation, the 6 force sensors and 6 encoders are measured and saved.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Load Identification Data</span></span>
meas_data_lf = {};
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:6</span>
meas_data_lf(<span class="org-constant">i</span>) = {load(sprintf(<span class="org-string">'mat/frf_exc_strut_%i_enc_plates_noise.mat'</span>, <span class="org-constant">i</span>), <span class="org-string">'t'</span>, <span class="org-string">'Va'</span>, <span class="org-string">'Vs'</span>, <span class="org-string">'de'</span>)};
<span class="org-keyword">end</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgf56fae0" class="outline-4">
<h4 id="orgf56fae0"><span class="section-number-4">2.1.2</span> Transfer function from Actuator to Encoder</h4>
<div class="outline-text-4" id="text-2-1-2">
<p>
<a id="orgfd04a93"></a>
</p>
<p>
Let&rsquo;s compute the coherence from the excitation voltage \(\bm{u}\) and the displacement \(d\bm{\mathcal{L}}_m\) as measured by the encoders.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Coherence</span></span>
coh_dvf = zeros(length(f), 6, 6);
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:6</span>
coh_dvf(<span class="org-type">:</span>, <span class="org-type">:</span>, <span class="org-constant">i</span>) = mscohere(meas_data_lf{<span class="org-constant">i</span>}.Va, meas_data_lf{<span class="org-constant">i</span>}.de, win, [], [], 1<span class="org-type">/</span>Ts);
<span class="org-keyword">end</span>
</pre>
</div>
<p>
The obtained coherence shown in Figure <a href="#org0135874">34</a> is quite good up to 400Hz.
</p>
<div id="org0135874" class="figure">
<p><img src="figs/enc_plates_dvf_coh.png" alt="enc_plates_dvf_coh.png" />
</p>
<p><span class="figure-number">Figure 34: </span>Obtained coherence for the DVF plant</p>
</div>
<p>
Then the 6x6 transfer function matrix is estimated.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% DVF Plant (transfer function from u to dLm)</span></span>
G_dvf = zeros(length(f), 6, 6);
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:6</span>
G_dvf(<span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span>) = tfestimate(meas_data_lf{<span class="org-constant">i</span>}.Va, meas_data_lf{<span class="org-constant">i</span>}.de, win, [], [], 1<span class="org-type">/</span>Ts);
<span class="org-keyword">end</span>
</pre>
</div>
<p>
The diagonal and off-diagonal terms of this transfer function matrix are shown in Figure <a href="#org02f971c">35</a>.
</p>
<div id="org02f971c" class="figure">
<p><img src="figs/enc_plates_dvf_frf.png" alt="enc_plates_dvf_frf.png" />
</p>
<p><span class="figure-number">Figure 35: </span>Measured FRF for the DVF plant</p>
</div>
<div class="important" id="org6aa6186">
<p>
From Figure <a href="#org02f971c">35</a>, we can draw few conclusions on the transfer functions from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\) when the encoders are fixed to the plates:
</p>
<ul class="org-ul">
<li>the decoupling is rather good at low frequency (below the first suspension mode).
The low frequency gain is constant for the off diagonal terms, whereas when the encoders where fixed to the struts, the low frequency gain of the off-diagonal terms were going to zero (Figure <a href="#org3221a6d">5</a>).</li>
<li>the flexible modes of the struts at 226Hz and 337Hz are indeed shown in the transfer functions, but their amplitudes are rather low.</li>
<li>the diagonal terms have alternating poles and zeros up to at least 600Hz: the flexible modes of the struts are not affecting the alternating pole/zero pattern. This what not the case when the encoders were fixed to the struts (Figure <a href="#org3221a6d">5</a>).</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-org5d6e9ab" class="outline-4">
<h4 id="org5d6e9ab"><span class="section-number-4">2.1.3</span> Transfer function from Actuator to Force Sensor</h4>
<div class="outline-text-4" id="text-2-1-3">
<p>
<a id="orgce3b648"></a>
</p>
<p>
Let&rsquo;s now compute the coherence from the excitation voltage \(\bm{u}\) and the voltage \(\bm{\tau}_m\) generated by the Force senors.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Coherence for the IFF plant</span></span>
coh_iff = zeros(length(f), 6, 6);
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:6</span>
coh_iff(<span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span>) = mscohere(meas_data_lf{<span class="org-constant">i</span>}.Va, meas_data_lf{<span class="org-constant">i</span>}.Vs, win, [], [], 1<span class="org-type">/</span>Ts);
<span class="org-keyword">end</span>
</pre>
</div>
<p>
The coherence is shown in Figure <a href="#org2a8d34f">36</a>, and is very good for from 10Hz up to 2kHz.
</p>
<div id="org2a8d34f" class="figure">
<p><img src="figs/enc_plates_iff_coh.png" alt="enc_plates_iff_coh.png" />
</p>
<p><span class="figure-number">Figure 36: </span>Obtained coherence for the IFF plant</p>
</div>
<p>
Then the 6x6 transfer function matrix is estimated.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% IFF Plant</span></span>
G_iff = zeros(length(f), 6, 6);
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:6</span>
G_iff(<span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span>) = tfestimate(meas_data_lf{<span class="org-constant">i</span>}.Va, meas_data_lf{<span class="org-constant">i</span>}.Vs, win, [], [], 1<span class="org-type">/</span>Ts);
<span class="org-keyword">end</span>
</pre>
</div>
<p>
The bode plot of the diagonal and off-diagonal terms are shown in Figure <a href="#orgabc98a9">37</a>.
</p>
<div id="orgabc98a9" class="figure">
<p><img src="figs/enc_plates_iff_frf.png" alt="enc_plates_iff_frf.png" />
</p>
<p><span class="figure-number">Figure 37: </span>Measured FRF for the IFF plant</p>
</div>
<div class="important" id="org8c91aa3">
<p>
It is shown in Figure <a href="#org81dbb17">38</a> that:
</p>
<ul class="org-ul">
<li>The IFF plant has alternating poles and zeros</li>
<li>The first flexible mode of the struts as 235Hz is appearing, and therefore is should be possible to add some damping to this mode using IFF</li>
<li>The decoupling is quite good at low frequency (below the first model) as well as high frequency (above the last suspension mode, except near the flexible modes of the top plate)</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-orgda420de" class="outline-4">
<h4 id="orgda420de"><span class="section-number-4">2.1.4</span> Save Identified Plants</h4>
<div class="outline-text-4" id="text-2-1-4">
<p>
The identified dynamics is saved for further use.
</p>
<div class="org-src-container">
<pre class="src src-matlab">save(<span class="org-string">'mat/identified_plants_enc_plates.mat'</span>, <span class="org-string">'f'</span>, <span class="org-string">'Ts'</span>, <span class="org-string">'G_iff'</span>, <span class="org-string">'G_dvf'</span>)
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org42eff57" class="outline-3">
<h3 id="org42eff57"><span class="section-number-3">2.2</span> Comparison with the Simscape Model</h3>
<div class="outline-text-3" id="text-2-2">
<p>
<a id="org7e7593e"></a>
</p>
<p>
In this section, the measured dynamics done in Section <a href="#orgee027dd">2.1</a> is compared with the dynamics estimated from the Simscape model.
</p>
</div>
<div id="outline-container-org21aca8b" class="outline-4">
<h4 id="org21aca8b"><span class="section-number-4">2.2.1</span> Identification Setup</h4>
<div class="outline-text-4" id="text-2-2-1">
<p>
The nano-hexapod is initialized with the APA taken as flexible models.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Initialize Nano-Hexapod</span></span>
n_hexapod = initializeNanoHexapodFinal(<span class="org-string">'flex_bot_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'flex_top_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'motion_sensor_type'</span>, <span class="org-string">'plates'</span>, ...
<span class="org-string">'actuator_type'</span>, <span class="org-string">'flexible'</span>);
</pre>
</div>
</div>
</div>
<div id="outline-container-org27466ed" class="outline-4">
<h4 id="org27466ed"><span class="section-number-4">2.2.2</span> Dynamics from Actuator to Force Sensors</h4>
<div class="outline-text-4" id="text-2-2-2">
<p>
Then the transfer function from \(\bm{u}\) to \(\bm{\tau}_m\) is identified using the Simscape model.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Identify the IFF Plant (transfer function from u to taum)</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/du'</span>], 1, <span class="org-string">'openinput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Inputs</span>
io(io_i) = linio([mdl, <span class="org-string">'/dum'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Force Sensors</span>
Giff = exp(<span class="org-type">-</span>s<span class="org-type">*</span>Ts)<span class="org-type">*</span>linearize(mdl, io, 0.0, options);
</pre>
</div>
<p>
The identified dynamics is compared with the measured FRF:
</p>
<ul class="org-ul">
<li>Figure <a href="#org81dbb17">38</a>: the individual transfer function from \(u_1\) (the DAC voltage for the first actuator) to the force sensors of all 6 struts are compared</li>
<li>Figure <a href="#org0a93b96">39</a>: all the diagonal elements are compared</li>
<li>Figure <a href="#org9abd99d">40</a>: all the off-diagonal elements are compared</li>
</ul>
<div id="org81dbb17" class="figure">
<p><img src="figs/enc_plates_iff_comp_simscape_all.png" alt="enc_plates_iff_comp_simscape_all.png" />
</p>
<p><span class="figure-number">Figure 38: </span>IFF Plant for the first actuator input and all the force senosrs</p>
</div>
<div id="org0a93b96" class="figure">
<p><img src="figs/enc_plates_iff_comp_simscape.png" alt="enc_plates_iff_comp_simscape.png" />
</p>
<p><span class="figure-number">Figure 39: </span>Diagonal elements of the IFF Plant</p>
</div>
<div id="org9abd99d" class="figure">
<p><img src="figs/enc_plates_iff_comp_offdiag_simscape.png" alt="enc_plates_iff_comp_offdiag_simscape.png" />
</p>
<p><span class="figure-number">Figure 40: </span>Off diagonal elements of the IFF Plant</p>
</div>
</div>
</div>
<div id="outline-container-org8a65375" class="outline-4">
<h4 id="org8a65375"><span class="section-number-4">2.2.3</span> Dynamics from Actuator to Encoder</h4>
<div class="outline-text-4" id="text-2-2-3">
<p>
Now, the dynamics from the DAC voltage \(\bm{u}\) to the encoders \(d\bm{\mathcal{L}}_m\) is estimated using the Simscape model.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Identify the DVF Plant (transfer function from u to dLm)</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/du'</span>], 1, <span class="org-string">'openinput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Inputs</span>
io(io_i) = linio([mdl, <span class="org-string">'/dL'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Encoders</span>
Gdvf = exp(<span class="org-type">-</span>s<span class="org-type">*</span>Ts)<span class="org-type">*</span>linearize(mdl, io, 0.0, options);
</pre>
</div>
<p>
The identified dynamics is compared with the measured FRF:
</p>
<ul class="org-ul">
<li>Figure <a href="#orgc0e03ff">41</a>: the individual transfer function from \(u_3\) (the DAC voltage for the actuator number 3) to the six encoders</li>
<li>Figure <a href="#org74b7118">42</a>: all the diagonal elements are compared</li>
<li>Figure <a href="#org88a2941">43</a>: all the off-diagonal elements are compared</li>
</ul>
<div id="orgc0e03ff" class="figure">
<p><img src="figs/enc_plates_dvf_comp_simscape_all.png" alt="enc_plates_dvf_comp_simscape_all.png" />
</p>
<p><span class="figure-number">Figure 41: </span>DVF Plant for the first actuator input and all the encoders</p>
</div>
<div id="org74b7118" class="figure">
<p><img src="figs/enc_plates_dvf_comp_simscape.png" alt="enc_plates_dvf_comp_simscape.png" />
</p>
<p><span class="figure-number">Figure 42: </span>Diagonal elements of the DVF Plant</p>
</div>
<div id="org88a2941" class="figure">
<p><img src="figs/enc_plates_dvf_comp_offdiag_simscape.png" alt="enc_plates_dvf_comp_offdiag_simscape.png" />
</p>
<p><span class="figure-number">Figure 43: </span>Off diagonal elements of the DVF Plant</p>
</div>
</div>
</div>
<div id="outline-container-orgae011ec" class="outline-4">
<h4 id="orgae011ec"><span class="section-number-4">2.2.4</span> Conclusion</h4>
<div class="outline-text-4" id="text-2-2-4">
<div class="important" id="org3060b40">
<p>
The Simscape model is quite accurate for the transfer function matrices from \(\bm{u}\) to \(\bm{\tau}_m\) and from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\) except at frequencies of the flexible modes of the top-plate.
The Simscape model can therefore be used to develop the control strategies.
</p>
</div>
</div>
</div>
</div>
<div id="outline-container-org1a3e12c" class="outline-3">
<h3 id="org1a3e12c"><span class="section-number-3">2.3</span> Integral Force Feedback</h3>
<div class="outline-text-3" id="text-2-3">
<p>
<a id="orgcdf0f51"></a>
</p>
<p>
In this section, the Integral Force Feedback (IFF) control strategy is applied to the nano-hexapod in order to add damping to the suspension modes.
</p>
<p>
The control architecture is shown in Figure <a href="#org4eb73e1">44</a>:
</p>
<ul class="org-ul">
<li>\(\bm{\tau}_m\) is the measured voltage of the 6 force sensors</li>
<li>\(\bm{K}_{\text{IFF}}\) is the \(6 \times 6\) diagonal controller</li>
<li>\(\bm{u}\) is the plant input (voltage generated by the 6 DACs)</li>
<li>\(\bm{u}^\prime\) is the new plant inputs with added damping</li>
</ul>
<div id="org4eb73e1" class="figure">
<p><img src="figs/control_architecture_iff.png" alt="control_architecture_iff.png" />
</p>
<p><span class="figure-number">Figure 44: </span>Integral Force Feedback Strategy</p>
</div>
<ul class="org-ul">
<li>Section <a href="#orga012750">2.3.1</a></li>
</ul>
</div>
<div id="outline-container-org6a4edf2" class="outline-4">
<h4 id="org6a4edf2"><span class="section-number-4">2.3.1</span> Effect of IFF on the plant - Simscape Model</h4>
<div class="outline-text-4" id="text-2-3-1">
<p>
<a id="orga012750"></a>
</p>
<p>
The nano-hexapod is initialized with flexible APA and the encoders fixed to the struts.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Initialize the Simscape model in closed loop</span></span>
n_hexapod = initializeNanoHexapodFinal(<span class="org-string">'flex_bot_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'flex_top_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'motion_sensor_type'</span>, <span class="org-string">'plates'</span>, ...
<span class="org-string">'actuator_type'</span>, <span class="org-string">'flexible'</span>);
</pre>
</div>
<p>
The same controller as the one developed when the encoder were fixed to the struts is used.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Optimal IFF controller</span></span>
load(<span class="org-string">'Kiff.mat'</span>, <span class="org-string">'Kiff'</span>)
</pre>
</div>
<p>
The transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) is identified.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Identify the (damped) transfer function from u to dLm for different values of the IFF gain</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/du'</span>], 1, <span class="org-string">'openinput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Inputs</span>
io(io_i) = linio([mdl, <span class="org-string">'/dL'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Plate Displacement (encoder)</span>
</pre>
</div>
<p>
First in Open-Loop:
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Transfer function from u to dL (open-loop)</span></span>
Gd_ol = exp(<span class="org-type">-</span>s<span class="org-type">*</span>Ts)<span class="org-type">*</span>linearize(mdl, io, 0.0, options);
</pre>
</div>
<p>
And then with the IFF controller:
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Initialize the Simscape model in closed loop</span></span>
n_hexapod = initializeNanoHexapodFinal(<span class="org-string">'flex_bot_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'flex_top_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'motion_sensor_type'</span>, <span class="org-string">'plates'</span>, ...
<span class="org-string">'actuator_type'</span>, <span class="org-string">'flexible'</span>, ...
<span class="org-string">'controller_type'</span>, <span class="org-string">'iff'</span>);
<span class="org-matlab-cellbreak"><span class="org-comment">%% Transfer function from u to dL (IFF)</span></span>
Gd_iff = exp(<span class="org-type">-</span>s<span class="org-type">*</span>Ts)<span class="org-type">*</span>linearize(mdl, io, 0.0, options);
</pre>
</div>
<p>
It is first verified that the system is stable:
</p>
<div class="org-src-container">
<pre class="src src-matlab">isstable(Gd_iff)
</pre>
</div>
<pre class="example">
1
</pre>
<p>
The diagonal and off-diagonal terms of the \(6 \times 6\) transfer function matrices identified are compared in Figure <a href="#org77788db">45</a>.
It is shown, as was the case when the encoders were fixed to the struts, that the IFF control strategy is very effective in damping the suspension modes of the nano-hexapod.
</p>
<div id="org77788db" class="figure">
<p><img src="figs/enc_plates_iff_gains_effect_dvf_plant.png" alt="enc_plates_iff_gains_effect_dvf_plant.png" />
</p>
<p><span class="figure-number">Figure 45: </span>Effect of the IFF control strategy on the transfer function from \(\bm{\tau}\) to \(d\bm{\mathcal{L}}_m\)</p>
</div>
</div>
</div>
<div id="outline-container-orgfe2d8fa" class="outline-4">
<h4 id="orgfe2d8fa"><span class="section-number-4">2.3.2</span> Effect of IFF on the plant - FRF</h4>
<div class="outline-text-4" id="text-2-3-2">
<p>
The IFF control strategy is experimentally implemented.
The (damped) transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) is experimentally identified.
</p>
<p>
The identification data are loaded:
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Load Identification Data</span></span>
meas_iff_plates = {};
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:6</span>
meas_iff_plates(<span class="org-constant">i</span>) = {load(sprintf(<span class="org-string">'mat/frf_exc_iff_strut_%i_enc_plates_noise.mat'</span>, <span class="org-constant">i</span>), <span class="org-string">'t'</span>, <span class="org-string">'Va'</span>, <span class="org-string">'Vs'</span>, <span class="org-string">'de'</span>, <span class="org-string">'u'</span>)};
<span class="org-keyword">end</span>
</pre>
</div>
<p>
And the parameters used for the transfer function estimation are defined below.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-comment">% Sampling Time [s]</span>
Ts = (meas_iff_plates{1}.t(end) <span class="org-type">-</span> (meas_iff_plates{1}.t(1)))<span class="org-type">/</span>(length(meas_iff_plates{1}.t)<span class="org-type">-</span>1);
<span class="org-comment">% Hannning Windows</span>
win = hanning(ceil(1<span class="org-type">*</span>Fs));
<span class="org-comment">% And we get the frequency vector</span>
[<span class="org-type">~</span>, f] = tfestimate(meas_iff_plates{1}.Va, meas_iff_plates{1}.de, win, [], [], 1<span class="org-type">/</span>Ts);
</pre>
</div>
<p>
The estimation is performed using the <code>tfestimate</code> command.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Estimation of the transfer function matrix from u to dL when IFF is applied</span></span>
G_enc_iff_opt = zeros(length(f), 6, 6);
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:6</span>
G_enc_iff_opt(<span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span>) = tfestimate(meas_iff_plates{<span class="org-constant">i</span>}.Va, meas_iff_plates{<span class="org-constant">i</span>}.de, win, [], [], 1<span class="org-type">/</span>Ts);
<span class="org-keyword">end</span>
</pre>
</div>
<p>
The obtained diagonal and off-diagonal elements of the transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) are shown in Figure <a href="#org78269be">46</a> both without and with IFF.
</p>
<div id="org78269be" class="figure">
<p><img src="figs/enc_plant_plates_effect_iff.png" alt="enc_plant_plates_effect_iff.png" />
</p>
<p><span class="figure-number">Figure 46: </span>Effect of the IFF control strategy on the transfer function from \(\bm{\tau}\) to \(d\bm{\mathcal{L}}_m\)</p>
</div>
<div class="important" id="orged28f87">
<p>
As was predicted with the Simscape model, the IFF control strategy is very effective in damping the suspension modes of the nano-hexapod.
Little damping is also applied on the first flexible mode of the strut at 235Hz.
However, no damping is applied on other modes, such as the flexible modes of the top plate.
</p>
</div>
</div>
</div>
<div id="outline-container-org051609d" class="outline-4">
<h4 id="org051609d"><span class="section-number-4">2.3.3</span> Comparison of the measured FRF and the Simscape model</h4>
<div class="outline-text-4" id="text-2-3-3">
<p>
Let&rsquo;s now compare the obtained damped plants obtained experimentally with the one extracted from Simscape:
</p>
<ul class="org-ul">
<li>Figure <a href="#org8b1e216">47</a>: the individual transfer function from \(u_1^\prime\) to the six encoders are comapred</li>
<li>Figure <a href="#org815ef46">48</a>: all the diagonal elements are compared</li>
<li>Figure <a href="#org5197c61">49</a>: all the off-diagonal elements are compared</li>
</ul>
<div id="org8b1e216" class="figure">
<p><img src="figs/enc_plates_opt_iff_comp_simscape_all.png" alt="enc_plates_opt_iff_comp_simscape_all.png" />
</p>
<p><span class="figure-number">Figure 47: </span>FRF from one actuator to all the encoders when the plant is damped using IFF</p>
</div>
<div id="org815ef46" class="figure">
<p><img src="figs/damped_iff_plates_plant_comp_diagonal.png" alt="damped_iff_plates_plant_comp_diagonal.png" />
</p>
<p><span class="figure-number">Figure 48: </span>Comparison of the diagonal elements of the transfer functions from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\) with active damping (IFF) applied with an optimal gain \(g = 400\)</p>
</div>
<div id="org5197c61" class="figure">
<p><img src="figs/damped_iff_plates_plant_comp_off_diagonal.png" alt="damped_iff_plates_plant_comp_off_diagonal.png" />
</p>
<p><span class="figure-number">Figure 49: </span>Comparison of the off-diagonal elements of the transfer functions from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\) with active damping (IFF) applied with an optimal gain \(g = 400\)</p>
</div>
<div class="important" id="org041d2f4">
<p>
From Figures <a href="#org815ef46">48</a> and <a href="#org5197c61">49</a>, it is clear that the Simscape model very well represents the dynamics of the nano-hexapod.
This is true to around 400Hz, then the dynamics depends on the flexible modes of the top plate which are not modelled.
</p>
</div>
</div>
</div>
<div id="outline-container-org5c1d983" class="outline-4">
<h4 id="org5c1d983"><span class="section-number-4">2.3.4</span> Save Damped Plant</h4>
<div class="outline-text-4" id="text-2-3-4">
<p>
The experimentally identified plant is saved for further use.
</p>
<div class="org-src-container">
<pre class="src src-matlab">save(<span class="org-string">'matlab/mat/damped_plant_enc_plates.mat'</span>, <span class="org-string">'f'</span>, <span class="org-string">'Ts'</span>, <span class="org-string">'G_enc_iff_opt'</span>)
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">save(<span class="org-string">'mat/damped_plant_enc_plates.mat'</span>, <span class="org-string">'f'</span>, <span class="org-string">'Ts'</span>, <span class="org-string">'G_enc_iff_opt'</span>)
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org81c7b46" class="outline-3">
<h3 id="org81c7b46"><span class="section-number-3">2.4</span> Conclusion</h3>
<div class="outline-text-3" id="text-2-4">
<div class="important" id="orgdb816af">
<p>
In this section, the dynamics of the nano-hexapod with the encoders fixed to the plates is studied.
</p>
<p>
It has been found that:
</p>
<ul class="org-ul">
<li>The measured dynamics is in agreement with the dynamics of the simscape model, up to the flexible modes of the top plate.
See figures <a href="#org0a93b96">39</a> and <a href="#org9abd99d">40</a> for the transfer function to the force sensors and Figures <a href="#org74b7118">42</a> and <a href="#org88a2941">43</a>for the transfer functions to the encoders</li>
<li>The Integral Force Feedback strategy is very effective in damping the suspension modes of the nano-hexapod (Figure <a href="#org78269be">46</a>).</li>
<li>The transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) show nice dynamical properties and is a much better candidate for the high-authority-control than when the encoders were fixed to the struts.
At least up to the flexible modes of the top plate, the diagonal elements of the transfer function matrix have alternating poles and zeros, and the phase is moving smoothly.
Only the flexible modes of the top plates seems to be problematic for control.</li>
</ul>
</div>
</div>
</div>
</div>
<div id="outline-container-org550b3cf" class="outline-2">
<h2 id="org550b3cf"><span class="section-number-2">3</span> Decentralized High Authority Control with Integral Force Feedback</h2>
<div class="outline-text-2" id="text-3">
<p>
<a id="org5933b35"></a>
</p>
<p>
In this section is studied the HAC-LAC architecture for the Nano-Hexapod.
More precisely:
</p>
<ul class="org-ul">
<li>The LAC control is a decentralized force feedback as studied in Section <a href="#orgcdf0f51">2.3</a></li>
<li>The HAC control is a decentralized controller working in the frame of the struts</li>
</ul>
<p>
The corresponding control architecture is shown in Figure <a href="#orge15f8c1">50</a> with:
</p>
<ul class="org-ul">
<li>\(\bm{r}_{\mathcal{X}_n}\): the \(6 \times 1\) reference signal in the cartesian frame</li>
<li>\(\bm{r}_{d\mathcal{L}}\): the \(6 \times 1\) reference signal transformed in the frame of the struts thanks to the inverse kinematic</li>
<li>\(\bm{\epsilon}_{d\mathcal{L}}\): the \(6 \times 1\) length error of the 6 struts</li>
<li>\(\bm{u}^\prime\): input of the damped plant</li>
<li>\(\bm{u}\): generated DAC voltages</li>
<li>\(\bm{\tau}_m\): measured force sensors</li>
<li>\(d\bm{\mathcal{L}}_m\): measured displacement of the struts by the encoders</li>
</ul>
<div id="orge15f8c1" class="figure">
<p><img src="figs/control_architecture_hac_iff_struts.png" alt="control_architecture_hac_iff_struts.png" />
</p>
<p><span class="figure-number">Figure 50: </span>HAC-LAC: IFF + Control in the frame of the legs</p>
</div>
<ul class="org-ul">
<li>Section <a href="#orgbb2caf4">3.1</a>: the decentralized high authority controller is tuned using the Simscape model</li>
<li>Section <a href="#org80ba353">3.3</a>: the controller is implemented and tested experimentally</li>
<li>Section <a href="#org3d2e861">3.2</a>: some reference tracking tests are performed</li>
</ul>
</div>
<div id="outline-container-orgc35ef9f" class="outline-3">
<h3 id="orgc35ef9f"><span class="section-number-3">3.1</span> High Authority Controller</h3>
<div class="outline-text-3" id="text-3-1">
<p>
<a id="orgbb2caf4"></a>
</p>
<p>
In this section, the decentralized high authority controller \(\bm{K}_{\mathcal{L}}\) is first tuned using the Simscape model.
</p>
</div>
<div id="outline-container-orgff066a2" class="outline-4">
<h4 id="orgff066a2"><span class="section-number-4">3.1.1</span> Simscape Model</h4>
<div class="outline-text-4" id="text-3-1-1">
<p>
First initialized the nano-hexapod with a flexible APA model and with the IFF control strategy.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Initialize the Simscape model</span></span>
n_hexapod = initializeNanoHexapodFinal(<span class="org-string">'flex_bot_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'flex_top_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'motion_sensor_type'</span>, <span class="org-string">'plates'</span>, ...
<span class="org-string">'actuator_type'</span>, <span class="org-string">'flexible'</span>, ...
<span class="org-string">'controller_type'</span>, <span class="org-string">'iff'</span>);
</pre>
</div>
<p>
Then the controller is loaded
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Load the decentralized IFF controller</span></span>
load(<span class="org-string">'Kiff.mat'</span>, <span class="org-string">'Kiff'</span>)
</pre>
</div>
<p>
The inputs and outputs for the transfer function estimation are defined.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Identify the (damped) transfer function from u to dLm for different values of the IFF gain</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/du'</span>], 1, <span class="org-string">'openinput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Inputs</span>
io(io_i) = linio([mdl, <span class="org-string">'/dL'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Plate Displacement (encoder)</span>
</pre>
</div>
<p>
And the plant from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) is identified and the bode plot of its diagonal terms are shown in Figure <a href="#org073440b">51</a>.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Identified of the damped TF from u' to dL</span></span>
Gd_iff_opt = exp(<span class="org-type">-</span>s<span class="org-type">*</span>Ts)<span class="org-type">*</span>linearize(mdl, io, 0.0, options);
</pre>
</div>
<div id="org073440b" class="figure">
<p><img src="figs/hac_iff_struts_enc_plates_plant_bode.png" alt="hac_iff_struts_enc_plates_plant_bode.png" />
</p>
<p><span class="figure-number">Figure 51: </span>Transfer functions from \(u\) to \(d\mathcal{L}_m\) with IFF (diagonal and off-diagonal elements)</p>
</div>
</div>
</div>
<div id="outline-container-orgf928e84" class="outline-4">
<h4 id="orgf928e84"><span class="section-number-4">3.1.2</span> HAC Controller</h4>
<div class="outline-text-4" id="text-3-1-2">
<p>
Let&rsquo;s first try to design a first decentralized controller with:
</p>
<ul class="org-ul">
<li>a bandwidth of 100Hz</li>
<li>sufficient phase margin</li>
<li>simple and understandable components</li>
</ul>
<p>
After some very basic and manual loop shaping, the following controller is developed:
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Lead to increase phase margin</span></span>
a = 2; <span class="org-comment">% Amount of phase lead / width of the phase lead / high frequency gain</span>
wc = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>100; <span class="org-comment">% Frequency with the maximum phase lead [rad/s]</span>
H_lead = (1 <span class="org-type">+</span> s<span class="org-type">/</span>(wc<span class="org-type">/</span>sqrt(a)))<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>(wc<span class="org-type">*</span>sqrt(a)));
<span class="org-matlab-cellbreak"><span class="org-comment">%% Low Pass filter to increase robustness</span></span>
H_lpf = 1<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>200);
<span class="org-matlab-cellbreak"><span class="org-comment">%% Notch at the top-plate resonance</span></span>
gm = 0.02;
xi = 0.3;
wn = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>700;
H_notch = (s<span class="org-type">^</span>2 <span class="org-type">+</span> 2<span class="org-type">*</span>gm<span class="org-type">*</span>xi<span class="org-type">*</span>wn<span class="org-type">*</span>s <span class="org-type">+</span> wn<span class="org-type">^</span>2)<span class="org-type">/</span>(s<span class="org-type">^</span>2 <span class="org-type">+</span> 2<span class="org-type">*</span>xi<span class="org-type">*</span>wn<span class="org-type">*</span>s <span class="org-type">+</span> wn<span class="org-type">^</span>2);
<span class="org-matlab-cellbreak"><span class="org-comment">%% Decentralized HAC</span></span>
Khac_iff_struts = <span class="org-type">-</span>(1<span class="org-type">/</span>(2.87e<span class="org-type">-</span>5)) <span class="org-type">*</span> ...<span class="org-comment"> % Gain</span>
H_lead <span class="org-type">*</span> ...<span class="org-comment"> % Lead</span>
H_notch <span class="org-type">*</span> ...<span class="org-comment"> % Notch</span>
(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>100<span class="org-type">/</span>s) <span class="org-type">*</span> ...<span class="org-comment"> % Integrator</span>
eye(6); <span class="org-comment">% 6x6 Diagonal</span>
</pre>
</div>
<p>
This controller is saved for further use.
</p>
<div class="org-src-container">
<pre class="src src-matlab">save(<span class="org-string">'mat/Khac_iff_struts.mat'</span>, <span class="org-string">'Khac_iff_struts'</span>)
</pre>
</div>
<p>
The Loop Gain is computed and shown in Figure <a href="#org6616769">52</a>.
</p>
<div class="org-src-container">
<pre class="src src-matlab">Lhac_iff_struts = Khac_iff_struts<span class="org-type">*</span>Gd_iff_opt;
</pre>
</div>
<div id="org6616769" class="figure">
<p><img src="figs/loop_gain_hac_iff_struts.png" alt="loop_gain_hac_iff_struts.png" />
</p>
<p><span class="figure-number">Figure 52: </span>Diagonal and off-diagonal elements of the Loop gain for &ldquo;HAC-IFF-Struts&rdquo;</p>
</div>
</div>
</div>
<div id="outline-container-orgdbe1e4e" class="outline-4">
<h4 id="orgdbe1e4e"><span class="section-number-4">3.1.3</span> Verification of the Stability using the Simscape model</h4>
<div class="outline-text-4" id="text-3-1-3">
<p>
The HAC-IFF control strategy is implemented using Simscape.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Initialize the Simscape model in closed loop</span></span>
n_hexapod = initializeNanoHexapodFinal(<span class="org-string">'flex_bot_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'flex_top_type'</span>, <span class="org-string">'4dof'</span>, ...
<span class="org-string">'motion_sensor_type'</span>, <span class="org-string">'plates'</span>, ...
<span class="org-string">'actuator_type'</span>, <span class="org-string">'flexible'</span>, ...
<span class="org-string">'controller_type'</span>, <span class="org-string">'hac-iff-struts'</span>);
</pre>
</div>
<p>
We identify the closed-loop system.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Identification</span></span>
Gd_iff_hac_opt = linearize(mdl, io, 0.0, options);
</pre>
</div>
<p>
And verify that it is indeed stable.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Verify the stability</span></span>
isstable(Gd_iff_hac_opt)
</pre>
</div>
<pre class="example">
1
</pre>
</div>
</div>
<div id="outline-container-orgd9f7778" class="outline-4">
<h4 id="orgd9f7778"><span class="section-number-4">3.1.4</span> Experimental Loop Gain</h4>
<div class="outline-text-4" id="text-3-1-4">
<p>
Now, the loop gain is estimated from the measured FRF.
</p>
<div class="org-src-container">
<pre class="src src-matlab">L_frf = zeros(size(G_enc_iff_opt));
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:size(G_enc_iff_opt, 1)</span>
L_frf(<span class="org-constant">i</span>, <span class="org-type">:</span>, <span class="org-type">:</span>) = squeeze(G_enc_iff_opt(<span class="org-constant">i</span>,<span class="org-type">:</span>,<span class="org-type">:</span>))<span class="org-type">*</span>freqresp(Khac_iff_struts, f(<span class="org-constant">i</span>), <span class="org-string">'Hz'</span>);
<span class="org-keyword">end</span>
</pre>
</div>
<p>
The bode plot of the loop gain is shown in Figure <a href="#org90941b4">53</a>.
</p>
<div id="org90941b4" class="figure">
<p><img src="figs/hac_iff_plates_exp_loop_gain_diag.png" alt="hac_iff_plates_exp_loop_gain_diag.png" />
</p>
<p><span class="figure-number">Figure 53: </span>Diagonal and Off-diagonal elements of the Loop gain (experimental data)</p>
</div>
</div>
</div>
</div>
<div id="outline-container-orgf630708" class="outline-3">
<h3 id="orgf630708"><span class="section-number-3">3.2</span> Reference Tracking - Trajectories</h3>
<div class="outline-text-3" id="text-3-2">
<p>
<a id="org3d2e861"></a>
</p>
<p>
In this section, several trajectories representing the wanted pose (position and orientation) of the top platform with respect to the bottom platform are defined.
</p>
<p>
These trajectories will be used to test the HAC-LAC architecture.
</p>
<p>
In order to transform the wanted pose to the wanted displacement of the 6 struts, the inverse kinematic is required.
As a first approximation, the Jacobian matrix can be used instead of using the full inverse kinematic equations.
</p>
<p>
Therefore, the control architecture with the input trajectory \(\bm{r}_{\mathcal{X}_n}\) is shown in Figure <a href="#org528069f">54</a>.
</p>
<div id="org528069f" class="figure">
<p><img src="figs/control_architecture_hac_iff_L.png" alt="control_architecture_hac_iff_L.png" />
</p>
<p><span class="figure-number">Figure 54: </span>HAC-LAC: IFF + Control in the frame of the legs</p>
</div>
<p>
In the following sections, several reference trajectories are defined:
</p>
<ul class="org-ul">
<li>Section <a href="#org1d146b7">3.2.1</a>: simple scans in the Y-Z plane</li>
<li>Section <a href="#org06816a2">3.2.2</a>: scans in tilt are performed</li>
<li>Section <a href="#org9c3b4fd">3.2.3</a>: scans with X-Y-Z translations in order to draw the word &ldquo;NASS&rdquo;</li>
</ul>
</div>
<div id="outline-container-orga2d3693" class="outline-4">
<h4 id="orga2d3693"><span class="section-number-4">3.2.1</span> Y-Z Scans</h4>
<div class="outline-text-4" id="text-3-2-1">
<p>
<a id="org1d146b7"></a>
</p>
</div>
<div id="outline-container-org2a4bd93" class="outline-5">
<h5 id="org2a4bd93"><span class="section-number-5">3.2.1.1</span> Generate the Scan</h5>
<div class="outline-text-5" id="text-3-2-1-1">
<p>
A function <code>generateYZScanTrajectory</code> has been developed (accessible <a href="#orgc2fc0b5">here</a>) in order to easily generate scans in the Y-Z plane.
</p>
<p>
For instance, the following generated trajectory is represented in Figure <a href="#orgae2721a">55</a>.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Generate the Y-Z trajectory scan</span></span>
Rx_yz = generateYZScanTrajectory(...
<span class="org-string">'y_tot'</span>, 4e<span class="org-type">-</span>6, ...<span class="org-comment"> % Length of Y scans [m]</span>
<span class="org-string">'z_tot'</span>, 8e<span class="org-type">-</span>6, ...<span class="org-comment"> % Total Z distance [m]</span>
<span class="org-string">'n'</span>, 5, ...<span class="org-comment"> % Number of Y scans</span>
<span class="org-string">'Ts'</span>, 1e<span class="org-type">-</span>3, ...<span class="org-comment"> % Sampling Time [s]</span>
<span class="org-string">'ti'</span>, 2, ...<span class="org-comment"> % Time to go to initial position [s]</span>
<span class="org-string">'tw'</span>, 0.5, ...<span class="org-comment"> % Waiting time between each points [s]</span>
<span class="org-string">'ty'</span>, 2, ...<span class="org-comment"> % Time for a scan in Y [s]</span>
<span class="org-string">'tz'</span>, 1); <span class="org-comment">% Time for a scan in Z [s]</span>
</pre>
</div>
<div id="orgae2721a" class="figure">
<p><img src="figs/yz_scan_example_trajectory_yz_plane.png" alt="yz_scan_example_trajectory_yz_plane.png" />
</p>
<p><span class="figure-number">Figure 55: </span>Generated scan in the Y-Z plane</p>
</div>
<p>
The Y and Z positions as a function of time are shown in Figure <a href="#orga2aa757">56</a>.
</p>
<div id="orga2aa757" class="figure">
<p><img src="figs/yz_scan_example_trajectory.png" alt="yz_scan_example_trajectory.png" />
</p>
<p><span class="figure-number">Figure 56: </span>Y and Z trajectories as a function of time</p>
</div>
</div>
</div>
<div id="outline-container-orge120b27" class="outline-5">
<h5 id="orge120b27"><span class="section-number-5">3.2.1.2</span> Reference Signal for the Strut lengths</h5>
<div class="outline-text-5" id="text-3-2-1-2">
<p>
Using the Jacobian matrix, it is possible to compute the wanted struts lengths as a function of time:
</p>
\begin{equation}
\bm{r}_{d\mathcal{L}} = \bm{J} \bm{r}_{\mathcal{X}_n}
\end{equation}
<div class="org-src-container">
<pre class="src src-matlab">dL_ref = [n_hexapod.geometry.J<span class="org-type">*</span>Rx_yz(<span class="org-type">:</span>, 2<span class="org-type">:</span>7)<span class="org-type">'</span>]<span class="org-type">'</span>;
</pre>
</div>
<p>
The reference signal for the strut length is shown in Figure <a href="#org2bf4934">57</a>.
</p>
<div id="org2bf4934" class="figure">
<p><img src="figs/yz_scan_example_trajectory_struts.png" alt="yz_scan_example_trajectory_struts.png" />
</p>
<p><span class="figure-number">Figure 57: </span>Trajectories for the 6 individual struts</p>
</div>
</div>
</div>
<div id="outline-container-orgc95d0c0" class="outline-5">
<h5 id="orgc95d0c0"><span class="section-number-5">3.2.1.3</span> Time domain simulation with 2DoF model</h5>
<div class="outline-text-5" id="text-3-2-1-3">
<p>
Before trying to follow this reference with the nano-hexapod, let&rsquo;s try to do it using the Simscape model.
</p>
<p>
The nano-hexapod is initialized with the APA modelled as 2DoF system (for the simulation to run quickly).
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Initialize the Simscape model in closed loop</span></span>
n_hexapod = initializeNanoHexapodFinal(<span class="org-string">'flex_bot_type'</span>, <span class="org-string">'2dof'</span>, ...
<span class="org-string">'flex_top_type'</span>, <span class="org-string">'3dof'</span>, ...
<span class="org-string">'motion_sensor_type'</span>, <span class="org-string">'plates'</span>, ...
<span class="org-string">'actuator_type'</span>, <span class="org-string">'2dof'</span>, ...
<span class="org-string">'controller_type'</span>, <span class="org-string">'hac-iff-struts'</span>);
</pre>
</div>
<p>
The reference path as well as the measured motion are compared in Figure <a href="#org55b9a93">58</a>.
</p>
<div id="org55b9a93" class="figure">
<p><img src="figs/ref_track_hac_iff_struts_yz_plane.png" alt="ref_track_hac_iff_struts_yz_plane.png" />
</p>
<p><span class="figure-number">Figure 58: </span>Simulated Y-Z motion</p>
</div>
<p>
The motion errors are computed and shown in Figure <a href="#orge52e063">59</a>.
It is clear that the hexapod is indeed tracking the reference path.
However, in this simulation, no disturbances are included nor sensor noises.
</p>
<div id="orge52e063" class="figure">
<p><img src="figs/ref_track_hac_iff_struts_pos_error.png" alt="ref_track_hac_iff_struts_pos_error.png" />
</p>
<p><span class="figure-number">Figure 59: </span>Positioning errors as a function of time</p>
</div>
</div>
</div>
</div>
<div id="outline-container-org685944b" class="outline-4">
<h4 id="org685944b"><span class="section-number-4">3.2.2</span> Tilt Scans</h4>
<div class="outline-text-4" id="text-3-2-2">
<p>
<a id="org06816a2"></a>
</p>
</div>
</div>
<div id="outline-container-org94ade03" class="outline-4">
<h4 id="org94ade03"><span class="section-number-4">3.2.3</span> &ldquo;NASS&rdquo; reference path</h4>
<div class="outline-text-4" id="text-3-2-3">
<p>
<a id="org9c3b4fd"></a>
In this section, a reference path that &ldquo;draws&rdquo; the work &ldquo;NASS&rdquo; is developed.
</p>
<p>
First, a series of points representing each letter are defined.
Between each letter, a negative Z motion is performed.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% List of points that draws "NASS"</span></span>
ref_path = [ ...
0, 0,0; <span class="org-comment">% Initial Position</span>
0,0,1; 0,4,1; 3,0,1; 3,4,1; <span class="org-comment">% N</span>
3,4,0; 4,0,0; <span class="org-comment">% Transition</span>
4,0,1; 4,3,1; 5,4,1; 6,4,1; 7,3,1; 7,2,1; 4,2,1; 4,3,1; 5,4,1; 6,4,1; 7,3,1; 7,0,1; <span class="org-comment">% A</span>
7,0,0; 8,0,0; <span class="org-comment">% Transition</span>
8,0,1; 11,0,1; 11,2,1; 8,2,1; 8,4,1; 11,4,1; <span class="org-comment">% S</span>
11,4,0; 12,0,0; <span class="org-comment">% Transition</span>
12,0,1; 15,0,1; 15,2,1; 12,2,1; 12,4,1; 15,4,1; <span class="org-comment">% S</span>
15,4,0;
];
<span class="org-matlab-cellbreak"><span class="org-comment">%% Center the trajectory arround zero</span></span>
ref_path = ref_path <span class="org-type">-</span> (max(ref_path) <span class="org-type">-</span> min(ref_path))<span class="org-type">/</span>2;
<span class="org-matlab-cellbreak"><span class="org-comment">%% Define the X-Y-Z cuboid dimensions containing the trajectory</span></span>
X_max = 10e<span class="org-type">-</span>6;
Y_max = 4e<span class="org-type">-</span>6;
Z_max = 2e<span class="org-type">-</span>6;
ref_path = ([X_max, Y_max, Z_max]<span class="org-type">./</span>max(ref_path))<span class="org-type">.*</span>ref_path; <span class="org-comment">% [m]</span>
</pre>
</div>
<p>
Then, using the <code>generateXYZTrajectory</code> function, the \(6 \times 1\) trajectory signal is computed.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Generating the trajectory</span></span>
Rx_nass = generateXYZTrajectory(<span class="org-string">'points'</span>, ref_path);
</pre>
</div>
<p>
The trajectory in the X-Y plane is shown in Figure <a href="#org670cb34">60</a> (the transitions between the letters are removed).
</p>
<div id="org670cb34" class="figure">
<p><img src="figs/ref_track_test_nass.png" alt="ref_track_test_nass.png" />
</p>
<p><span class="figure-number">Figure 60: </span>Reference path corresponding to the &ldquo;NASS&rdquo; acronym</p>
</div>
<p>
It can also be better viewed in a 3D representation as in Figure <a href="#org689bf2b">61</a>.
</p>
<div id="org689bf2b" class="figure">
<p><img src="figs/ref_track_test_nass_3d.png" alt="ref_track_test_nass_3d.png" />
</p>
<p><span class="figure-number">Figure 61: </span>Reference path that draws &ldquo;NASS&rdquo; - 3D view</p>
</div>
</div>
</div>
</div>
<div id="outline-container-org3ab486a" class="outline-3">
<h3 id="org3ab486a"><span class="section-number-3">3.3</span> First Experimental Tests with the HAC</h3>
<div class="outline-text-3" id="text-3-3">
<p>
<a id="org80ba353"></a>
</p>
<p>
Both the Integral Force Feedback controller (developed in Section <a href="#orgcdf0f51">2.3</a>) and the high authority controller working in the frame of the struts (developed in Section <a href="#orgbb2caf4">3.1</a>) are implemented experimentally.
</p>
</div>
<div id="outline-container-orgf916df0" class="outline-4">
<h4 id="orgf916df0"><span class="section-number-4">3.3.1</span> Initial Controller</h4>
<div class="outline-text-4" id="text-3-3-1">
<p>
The controller designed in Section <a href="#orgbb2caf4">3.1</a> is implemented experimentally and some reference tracking tests are performed.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Load the experimental data</span></span>
load(<span class="org-string">'hac_iff_struts_yz_scans.mat'</span>, <span class="org-string">'t'</span>, <span class="org-string">'de'</span>)
</pre>
</div>
<p>
The position of the top-platform is estimated using the Jacobian matrix:
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Pose of the top platform from the encoder values</span></span>
load(<span class="org-string">'jacobian.mat'</span>, <span class="org-string">'J'</span>);
Xe = [inv(J)<span class="org-type">*</span>de<span class="org-type">'</span>]<span class="org-type">'</span>;
</pre>
</div>
<p>
The reference path as well as the measured position are partially shown in the Y-Z plane in Figure <a href="#org37eeb34">62</a>.
</p>
<div id="org37eeb34" class="figure">
<p><img src="figs/yz_scans_exp_results_first_K.png" alt="yz_scans_exp_results_first_K.png" />
</p>
<p><span class="figure-number">Figure 62: </span>Measured position \(\bm{\mathcal{X}}_n\) and reference signal \(\bm{r}_{\mathcal{X}_n}\) in the Y-Z plane - Zoom on a change of direction</p>
</div>
<div class="important" id="orgc3c90ca">
<p>
It is clear from Figure <a href="#org37eeb34">62</a> that the position of the nano-hexapod effectively tracks to reference signal.
However, oscillations with amplitudes as large as 50nm can be observe.
</p>
<p>
It turns out that the frequency of these oscillations is 100Hz which is corresponding to the crossover frequency of the High Authority Control loop.
This clearly indicates poor stability margins.
In the next section, the controller is re-designed to improve the stability margins.
</p>
</div>
</div>
</div>
<div id="outline-container-org9fb3bde" class="outline-4">
<h4 id="org9fb3bde"><span class="section-number-4">3.3.2</span> Controller with increased stability margins</h4>
<div class="outline-text-4" id="text-3-3-2">
<p>
The High Authority Controller is re-designed in order to improve the stability margins.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Lead</span></span>
a = 5; <span class="org-comment">% Amount of phase lead / width of the phase lead / high frequency gain</span>
wc = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>110; <span class="org-comment">% Frequency with the maximum phase lead [rad/s]</span>
H_lead = (1 <span class="org-type">+</span> s<span class="org-type">/</span>(wc<span class="org-type">/</span>sqrt(a)))<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>(wc<span class="org-type">*</span>sqrt(a)));
<span class="org-matlab-cellbreak"><span class="org-comment">%% Low Pass Filter</span></span>
H_lpf = 1<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>300);
<span class="org-matlab-cellbreak"><span class="org-comment">%% Notch</span></span>
gm = 0.02;
xi = 0.5;
wn = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>700;
H_notch = (s<span class="org-type">^</span>2 <span class="org-type">+</span> 2<span class="org-type">*</span>gm<span class="org-type">*</span>xi<span class="org-type">*</span>wn<span class="org-type">*</span>s <span class="org-type">+</span> wn<span class="org-type">^</span>2)<span class="org-type">/</span>(s<span class="org-type">^</span>2 <span class="org-type">+</span> 2<span class="org-type">*</span>xi<span class="org-type">*</span>wn<span class="org-type">*</span>s <span class="org-type">+</span> wn<span class="org-type">^</span>2);
<span class="org-matlab-cellbreak"><span class="org-comment">%% HAC Controller</span></span>
Khac_iff_struts = <span class="org-type">-</span>2.2e4 <span class="org-type">*</span> ...<span class="org-comment"> % Gain</span>
H_lead <span class="org-type">*</span> ...<span class="org-comment"> % Lead</span>
H_lpf <span class="org-type">*</span> ...<span class="org-comment"> % Lead</span>
H_notch <span class="org-type">*</span> ...<span class="org-comment"> % Notch</span>
(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>100<span class="org-type">/</span>s) <span class="org-type">*</span> ...<span class="org-comment"> % Integrator</span>
eye(6); <span class="org-comment">% 6x6 Diagonal</span>
</pre>
</div>
<p>
The bode plot of the new loop gain is shown in Figure <a href="#org110e5c9">63</a>.
</p>
<div id="org110e5c9" class="figure">
<p><img src="figs/hac_iff_plates_exp_loop_gain_redesigned_K.png" alt="hac_iff_plates_exp_loop_gain_redesigned_K.png" />
</p>
<p><span class="figure-number">Figure 63: </span>Loop Gain for the updated decentralized HAC controller</p>
</div>
<p>
This new controller is implemented experimentally and several tracking tests are performed.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Load Measurements</span></span>
load(<span class="org-string">'hac_iff_more_lead_nass_scan.mat'</span>, <span class="org-string">'t'</span>, <span class="org-string">'de'</span>)
</pre>
</div>
<p>
The pose of the top platform is estimated from the encoder position using the Jacobian matrix.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Compute the pose of the top platform</span></span>
load(<span class="org-string">'jacobian.mat'</span>, <span class="org-string">'J'</span>);
Xe = [inv(J)<span class="org-type">*</span>de<span class="org-type">'</span>]<span class="org-type">'</span>;
</pre>
</div>
<p>
The measured motion as well as the trajectory are shown in Figure <a href="#org0ca99ac">64</a>.
</p>
<div id="org0ca99ac" class="figure">
<p><img src="figs/nass_scans_first_test_exp.png" alt="nass_scans_first_test_exp.png" />
</p>
<p><span class="figure-number">Figure 64: </span>Measured position \(\bm{\mathcal{X}}_n\) and reference signal \(\bm{r}_{\mathcal{X}_n}\) for the &ldquo;NASS&rdquo; trajectory</p>
2021-06-08 22:14:48 +02:00
</div>
<p>
The trajectory and measured motion are also shown in the X-Y plane in Figure <a href="#org988707a">65</a>.
</p>
<div id="org988707a" class="figure">
<p><img src="figs/ref_track_nass_exp_hac_iff_struts.png" alt="ref_track_nass_exp_hac_iff_struts.png" />
</p>
<p><span class="figure-number">Figure 65: </span>Reference path and measured motion in the X-Y plane</p>
2021-06-07 19:00:29 +02:00
</div>
<p>
The orientations errors as a function of time are shown in Figure <a href="#org80e7add">66</a>.
</p>
<div id="org80e7add" class="figure">
<p><img src="figs/ref_track_nass_exp_hac_iff_struts_errors_angle.png" alt="ref_track_nass_exp_hac_iff_struts_errors_angle.png" />
</p>
<p><span class="figure-number">Figure 66: </span>Orientation errors as a function of time during the &ldquo;NASS&rdquo; trajectory</p>
</div>
<div class="important" id="org08c6e73">
<p>
Using the updated High Authority Controller, the nano-hexapod can follow trajectories with high accuracy (the position errors are in the order of 50nm peak to peak, and the orientation errors 300nrad peak to peak).
2021-06-14 18:08:46 +02:00
</p>
</div>
</div>
</div>
</div>
</div>
<div id="outline-container-orgd43e917" class="outline-2">
<h2 id="orgd43e917"><span class="section-number-2">4</span> Functions</h2>
<div class="outline-text-2" id="text-4">
</div>
<div id="outline-container-orga4d4cf8" class="outline-3">
<h3 id="orga4d4cf8"><span class="section-number-3">4.1</span> <code>generateXYZTrajectory</code></h3>
<div class="outline-text-3" id="text-4-1">
2021-06-14 18:08:46 +02:00
<p>
<a id="org8b2b979"></a>
</p>
</div>
<div id="outline-container-org6cfda6f" class="outline-4">
<h4 id="org6cfda6f">Function description</h4>
<div class="outline-text-4" id="text-org6cfda6f">
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[ref]</span> = <span class="org-function-name">generateXYZTrajectory</span>(<span class="org-variable-name">args</span>)
<span class="org-comment">% generateXYZTrajectory -</span>
<span class="org-comment">%</span>
<span class="org-comment">% Syntax: [ref] = generateXYZTrajectory(args)</span>
<span class="org-comment">%</span>
<span class="org-comment">% Inputs:</span>
<span class="org-comment">% - args</span>
<span class="org-comment">%</span>
<span class="org-comment">% Outputs:</span>
<span class="org-comment">% - ref - Reference Signal</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org9800be6" class="outline-4">
<h4 id="org9800be6">Optional Parameters</h4>
<div class="outline-text-4" id="text-org9800be6">
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-keyword">arguments</span>
<span class="org-variable-name">args</span>.points double {mustBeNumeric} = zeros(2, 3) <span class="org-comment">% [m]</span>
<span class="org-variable-name">args</span>.ti (1,1) double {mustBeNumeric, mustBePositive} = 1 <span class="org-comment">% Time to go to first point and after last point [s]</span>
<span class="org-variable-name">args</span>.tw (1,1) double {mustBeNumeric, mustBePositive} = 0.5 <span class="org-comment">% Time wait between each point [s]</span>
<span class="org-variable-name">args</span>.tm (1,1) double {mustBeNumeric, mustBePositive} = 1 <span class="org-comment">% Motion time between points [s]</span>
<span class="org-variable-name">args</span>.Ts (1,1) double {mustBeNumeric, mustBePositive} = 1e<span class="org-type">-</span>3 <span class="org-comment">% Sampling Time [s]</span>
<span class="org-keyword">end</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgf3b578b" class="outline-4">
<h4 id="orgf3b578b">Initialize Time Vectors</h4>
<div class="outline-text-4" id="text-orgf3b578b">
<div class="org-src-container">
<pre class="src src-matlab">time_i = 0<span class="org-type">:</span>args.Ts<span class="org-type">:</span>args.ti;
time_w = 0<span class="org-type">:</span>args.Ts<span class="org-type">:</span>args.tw;
time_m = 0<span class="org-type">:</span>args.Ts<span class="org-type">:</span>args.tm;
</pre>
</div>
</div>
</div>
<div id="outline-container-orgb851e15" class="outline-4">
<h4 id="orgb851e15">XYZ Trajectory</h4>
<div class="outline-text-4" id="text-orgb851e15">
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-comment">% Go to initial position</span>
xyz = (args.points(1,<span class="org-type">:</span>))<span class="org-type">'*</span>(time_i<span class="org-type">/</span>args.ti);
<span class="org-comment">% Wait</span>
xyz = [xyz, xyz(<span class="org-type">:</span>,end)<span class="org-type">.*</span>ones(size(time_w))];
<span class="org-comment">% Scans</span>
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">2:size(args.points, 1)</span>
<span class="org-comment">% Go to next point</span>
xyz = [xyz, xyz(<span class="org-type">:</span>,end) <span class="org-type">+</span> (args.points(<span class="org-constant">i</span>,<span class="org-type">:</span>)<span class="org-type">'</span> <span class="org-type">-</span> xyz(<span class="org-type">:</span>,end))<span class="org-type">*</span>(time_m<span class="org-type">/</span>args.tm)];
<span class="org-comment">% Wait a litle bit</span>
xyz = [xyz, xyz(<span class="org-type">:</span>,end)<span class="org-type">.*</span>ones(size(time_w))];
<span class="org-keyword">end</span>
<span class="org-comment">% End motion</span>
xyz = [xyz, xyz(<span class="org-type">:</span>,end) <span class="org-type">-</span> xyz(<span class="org-type">:</span>,end)<span class="org-type">*</span>(time_i<span class="org-type">/</span>args.ti)];
</pre>
</div>
</div>
</div>
<div id="outline-container-org2bb47be" class="outline-4">
<h4 id="org2bb47be">Reference Signal</h4>
<div class="outline-text-4" id="text-org2bb47be">
<div class="org-src-container">
<pre class="src src-matlab">t = 0<span class="org-type">:</span>args.Ts<span class="org-type">:</span>args.Ts<span class="org-type">*</span>(length(xyz) <span class="org-type">-</span> 1);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">ref = zeros(length(xyz), 7);
ref(<span class="org-type">:</span>, 1) = t;
ref(<span class="org-type">:</span>, 2<span class="org-type">:</span>4) = xyz<span class="org-type">'</span>;
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org0ee8065" class="outline-3">
<h3 id="org0ee8065"><span class="section-number-3">4.2</span> <code>generateYZScanTrajectory</code></h3>
<div class="outline-text-3" id="text-4-2">
<p>
<a id="orgc2fc0b5"></a>
</p>
</div>
<div id="outline-container-orgc8448d7" class="outline-4">
<h4 id="orgc8448d7">Function description</h4>
<div class="outline-text-4" id="text-orgc8448d7">
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[ref]</span> = <span class="org-function-name">generateYZScanTrajectory</span>(<span class="org-variable-name">args</span>)
<span class="org-comment">% generateYZScanTrajectory -</span>
<span class="org-comment">%</span>
<span class="org-comment">% Syntax: [ref] = generateYZScanTrajectory(args)</span>
<span class="org-comment">%</span>
<span class="org-comment">% Inputs:</span>
<span class="org-comment">% - args</span>
<span class="org-comment">%</span>
<span class="org-comment">% Outputs:</span>
<span class="org-comment">% - ref - Reference Signal</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org0528208" class="outline-4">
<h4 id="org0528208">Optional Parameters</h4>
<div class="outline-text-4" id="text-org0528208">
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-keyword">arguments</span>
<span class="org-variable-name">args</span>.y_tot (1,1) double {mustBeNumeric} = 10e<span class="org-type">-</span>6 <span class="org-comment">% [m]</span>
<span class="org-variable-name">args</span>.z_tot (1,1) double {mustBeNumeric} = 10e<span class="org-type">-</span>6 <span class="org-comment">% [m]</span>
<span class="org-variable-name">args</span>.n (1,1) double {mustBeInteger, mustBePositive} = 10 <span class="org-comment">% [-]</span>
<span class="org-variable-name">args</span>.Ts (1,1) double {mustBeNumeric, mustBePositive} = 1e<span class="org-type">-</span>4 <span class="org-comment">% [s]</span>
<span class="org-variable-name">args</span>.ti (1,1) double {mustBeNumeric, mustBePositive} = 1 <span class="org-comment">% [s]</span>
<span class="org-variable-name">args</span>.tw (1,1) double {mustBeNumeric, mustBePositive} = 1 <span class="org-comment">% [s]</span>
<span class="org-variable-name">args</span>.ty (1,1) double {mustBeNumeric, mustBePositive} = 1 <span class="org-comment">% [s]</span>
<span class="org-variable-name">args</span>.tz (1,1) double {mustBeNumeric, mustBePositive} = 1 <span class="org-comment">% [s]</span>
<span class="org-keyword">end</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgbf0d54b" class="outline-4">
<h4 id="orgbf0d54b">Initialize Time Vectors</h4>
<div class="outline-text-4" id="text-orgbf0d54b">
<div class="org-src-container">
<pre class="src src-matlab">time_i = 0<span class="org-type">:</span>args.Ts<span class="org-type">:</span>args.ti;
time_w = 0<span class="org-type">:</span>args.Ts<span class="org-type">:</span>args.tw;
time_y = 0<span class="org-type">:</span>args.Ts<span class="org-type">:</span>args.ty;
time_z = 0<span class="org-type">:</span>args.Ts<span class="org-type">:</span>args.tz;
</pre>
</div>
</div>
</div>
<div id="outline-container-org67d0409" class="outline-4">
<h4 id="org67d0409">Y and Z vectors</h4>
<div class="outline-text-4" id="text-org67d0409">
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-comment">% Go to initial position</span>
y = (time_i<span class="org-type">/</span>args.ti)<span class="org-type">*</span>(args.y_tot<span class="org-type">/</span>2);
<span class="org-comment">% Wait</span>
y = [y, y(end)<span class="org-type">*</span>ones(size(time_w))];
<span class="org-comment">% Scans</span>
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:args.n</span>
<span class="org-keyword">if</span> mod(<span class="org-constant">i</span>,2) <span class="org-type">==</span> 0
y = [y, <span class="org-type">-</span>(args.y_tot<span class="org-type">/</span>2) <span class="org-type">+</span> (time_y<span class="org-type">/</span>args.ty)<span class="org-type">*</span>args.y_tot];
<span class="org-keyword">else</span>
y = [y, (args.y_tot<span class="org-type">/</span>2) <span class="org-type">-</span> (time_y<span class="org-type">/</span>args.ty)<span class="org-type">*</span>args.y_tot];
<span class="org-keyword">end</span>
<span class="org-keyword">if</span> <span class="org-constant">i</span> <span class="org-type">&lt;</span> args.n
y = [y, y(end)<span class="org-type">*</span>ones(size(time_z))];
<span class="org-keyword">end</span>
<span class="org-keyword">end</span>
<span class="org-comment">% Wait a litle bit</span>
y = [y, y(end)<span class="org-type">*</span>ones(size(time_w))];
<span class="org-comment">% End motion</span>
y = [y, y(end) <span class="org-type">-</span> y(end)<span class="org-type">*</span>time_i<span class="org-type">/</span>args.ti];
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-comment">% Go to initial position</span>
z = (time_i<span class="org-type">/</span>args.ti)<span class="org-type">*</span>(args.z_tot<span class="org-type">/</span>2);
<span class="org-comment">% Wait</span>
z = [z, z(end)<span class="org-type">*</span>ones(size(time_w))];
<span class="org-comment">% Scans</span>
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:args.n</span>
z = [z, z(end)<span class="org-type">*</span>ones(size(time_y))];
<span class="org-keyword">if</span> <span class="org-constant">i</span> <span class="org-type">&lt;</span> args.n
z = [z, z(end) <span class="org-type">-</span> (time_z<span class="org-type">/</span>args.tz)<span class="org-type">*</span>args.z_tot<span class="org-type">/</span>(args.n<span class="org-type">-</span>1)];
<span class="org-keyword">end</span>
<span class="org-keyword">end</span>
<span class="org-comment">% Wait a litle bit</span>
z = [z, z(end)<span class="org-type">*</span>ones(size(time_w))];
2021-06-14 18:08:46 +02:00
<span class="org-comment">% End motion</span>
z = [z, z(end) <span class="org-type">-</span> z(end)<span class="org-type">*</span>time_i<span class="org-type">/</span>args.ti];
</pre>
</div>
</div>
</div>
<div id="outline-container-org19a085f" class="outline-4">
<h4 id="org19a085f">Reference Signal</h4>
<div class="outline-text-4" id="text-org19a085f">
<div class="org-src-container">
<pre class="src src-matlab">t = 0<span class="org-type">:</span>args.Ts<span class="org-type">:</span>args.Ts<span class="org-type">*</span>(length(y) <span class="org-type">-</span> 1);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">ref = zeros(length(y), 7);
ref(<span class="org-type">:</span>, 1) = t;
ref(<span class="org-type">:</span>, 3) = y;
ref(<span class="org-type">:</span>, 4) = z;
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org9a74f9f" class="outline-3">
<h3 id="org9a74f9f"><span class="section-number-3">4.3</span> <code>getTransformationMatrixAcc</code></h3>
<div class="outline-text-3" id="text-4-3">
<p>
<a id="orgb8a9326"></a>
</p>
</div>
<div id="outline-container-orgd53237f" class="outline-4">
<h4 id="orgd53237f">Function description</h4>
<div class="outline-text-4" id="text-orgd53237f">
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[M]</span> = <span class="org-function-name">getTransformationMatrixAcc</span>(<span class="org-variable-name">Opm</span>, <span class="org-variable-name">Osm</span>)
<span class="org-comment">% getTransformationMatrixAcc -</span>
<span class="org-comment">%</span>
<span class="org-comment">% Syntax: [M] = getTransformationMatrixAcc(Opm, Osm)</span>
<span class="org-comment">%</span>
<span class="org-comment">% Inputs:</span>
<span class="org-comment">% - Opm - Nx3 (N = number of accelerometer measurements) X,Y,Z position of accelerometers</span>
<span class="org-comment">% - Opm - Nx3 (N = number of accelerometer measurements) Unit vectors representing the accelerometer orientation</span>
<span class="org-comment">%</span>
<span class="org-comment">% Outputs:</span>
<span class="org-comment">% - M - Transformation Matrix</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orge58d78e" class="outline-4">
<h4 id="orge58d78e">Transformation matrix from motion of the solid body to accelerometer measurements</h4>
<div class="outline-text-4" id="text-orge58d78e">
<p>
Let&rsquo;s try to estimate the x-y-z acceleration of any point of the solid body from the acceleration/angular acceleration of the solid body expressed in \(\{O\}\).
For any point \(p_i\) of the solid body (corresponding to an accelerometer), we can write:
</p>
\begin{equation}
\begin{bmatrix}
a_{i,x} \\ a_{i,y} \\ a_{i,z}
\end{bmatrix} = \begin{bmatrix}
\dot{v}_x \\ \dot{v}_y \\ \dot{v}_z
\end{bmatrix} + p_i \times \begin{bmatrix}
\dot{\omega}_x \\ \dot{\omega}_y \\ \dot{\omega}_z
\end{bmatrix}
\end{equation}
<p>
We can write the cross product as a matrix product using the skew-symmetric transformation:
</p>
\begin{equation}
\begin{bmatrix}
a_{i,x} \\ a_{i,y} \\ a_{i,z}
\end{bmatrix} = \begin{bmatrix}
\dot{v}_x \\ \dot{v}_y \\ \dot{v}_z
\end{bmatrix} + \underbrace{\begin{bmatrix}
0 & p_{i,z} & -p_{i,y} \\
-p_{i,z} & 0 & p_{i,x} \\
p_{i,y} & -p_{i,x} & 0
\end{bmatrix}}_{P_{i,[\times]}} \cdot \begin{bmatrix}
\dot{\omega}_x \\ \dot{\omega}_y \\ \dot{\omega}_z
\end{bmatrix}
\end{equation}
<p>
If we now want to know the (scalar) acceleration \(a_i\) of the point \(p_i\) in the direction of the accelerometer direction \(\hat{s}_i\), we can just project the 3d acceleration on \(\hat{s}_i\):
</p>
\begin{equation}
a_i = \hat{s}_i^T \cdot \begin{bmatrix}
a_{i,x} \\ a_{i,y} \\ a_{i,z}
\end{bmatrix} = \hat{s}_i^T \cdot \begin{bmatrix}
\dot{v}_x \\ \dot{v}_y \\ \dot{v}_z
\end{bmatrix} + \left( \hat{s}_i^T \cdot P_{i,[\times]} \right) \cdot \begin{bmatrix}
\dot{\omega}_x \\ \dot{\omega}_y \\ \dot{\omega}_z
\end{bmatrix}
\end{equation}
<p>
Which is equivalent as a simple vector multiplication:
</p>
\begin{equation}
a_i = \begin{bmatrix}
\hat{s}_i^T & \hat{s}_i^T \cdot P_{i,[\times]}
\end{bmatrix}
\begin{bmatrix}
\dot{v}_x \\ \dot{v}_y \\ \dot{v}_z \\ \dot{\omega}_x \\ \dot{\omega}_y \\ \dot{\omega}_z
\end{bmatrix} = \begin{bmatrix}
\hat{s}_i^T & \hat{s}_i^T \cdot P_{i,[\times]}
\end{bmatrix} {}^O\vec{x}
\end{equation}
<p>
And finally we can combine the 6 (line) vectors for the 6 accelerometers to write that in a matrix form.
We obtain Eq. \eqref{eq:M_matrix}.
</p>
<div class="important" id="org1739c3d">
<p>
The transformation from solid body acceleration \({}^O\vec{x}\) from sensor measured acceleration \(\vec{a}\) is:
</p>
\begin{equation} \label{eq:M_matrix}
\vec{a} = \underbrace{\begin{bmatrix}
\hat{s}_1^T & \hat{s}_1^T \cdot P_{1,[\times]} \\
\vdots & \vdots \\
\hat{s}_6^T & \hat{s}_6^T \cdot P_{6,[\times]}
\end{bmatrix}}_{M} {}^O\vec{x}
\end{equation}
<p>
with \(\hat{s}_i\) the unit vector representing the measured direction of the i&rsquo;th accelerometer expressed in frame \(\{O\}\) and \(P_{i,[\times]}\) the skew-symmetric matrix representing the cross product of the position of the i&rsquo;th accelerometer expressed in frame \(\{O\}\).
</p>
</div>
<p>
Let&rsquo;s define such matrix using matlab:
</p>
<div class="org-src-container">
<pre class="src src-matlab">M = zeros(length(Opm), 6);
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:length(Opm)</span>
Ri = [0, Opm(3,<span class="org-constant">i</span>), <span class="org-type">-</span>Opm(2,<span class="org-constant">i</span>);
<span class="org-type">-</span>Opm(3,<span class="org-constant">i</span>), 0, Opm(1,<span class="org-constant">i</span>);
Opm(2,<span class="org-constant">i</span>), <span class="org-type">-</span>Opm(1,<span class="org-constant">i</span>), 0];
M(<span class="org-constant">i</span>, 1<span class="org-type">:</span>3) = Osm(<span class="org-type">:</span>,<span class="org-constant">i</span>)<span class="org-type">'</span>;
M(<span class="org-constant">i</span>, 4<span class="org-type">:</span>6) = Osm(<span class="org-type">:</span>,<span class="org-constant">i</span>)<span class="org-type">'*</span>Ri;
<span class="org-keyword">end</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-keyword">end</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgcc3967c" class="outline-3">
<h3 id="orgcc3967c"><span class="section-number-3">4.4</span> <code>getJacobianNanoHexapod</code></h3>
<div class="outline-text-3" id="text-4-4">
<p>
<a id="org5deee92"></a>
</p>
</div>
<div id="outline-container-org29eb7ca" class="outline-4">
<h4 id="org29eb7ca">Function description</h4>
<div class="outline-text-4" id="text-org29eb7ca">
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[J]</span> = <span class="org-function-name">getJacobianNanoHexapod</span>(<span class="org-variable-name">Hbm</span>)
<span class="org-comment">% getJacobianNanoHexapod -</span>
<span class="org-comment">%</span>
<span class="org-comment">% Syntax: [J] = getJacobianNanoHexapod(Hbm)</span>
<span class="org-comment">%</span>
<span class="org-comment">% Inputs:</span>
<span class="org-comment">% - Hbm - Height of {B} w.r.t. {M} [m]</span>
<span class="org-comment">%</span>
<span class="org-comment">% Outputs:</span>
<span class="org-comment">% - J - Jacobian Matrix</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org2bef4b2" class="outline-4">
<h4 id="org2bef4b2">Transformation matrix from motion of the solid body to accelerometer measurements</h4>
<div class="outline-text-4" id="text-org2bef4b2">
<div class="org-src-container">
<pre class="src src-matlab">Fa = [[<span class="org-type">-</span>86.05, <span class="org-type">-</span>74.78, 22.49],
[ 86.05, <span class="org-type">-</span>74.78, 22.49],
[ 107.79, <span class="org-type">-</span>37.13, 22.49],
[ 21.74, 111.91, 22.49],
[<span class="org-type">-</span>21.74, 111.91, 22.49],
[<span class="org-type">-</span>107.79, <span class="org-type">-</span>37.13, 22.49]]<span class="org-type">'*</span>1e<span class="org-type">-</span>3; <span class="org-comment">% Ai w.r.t. {F} [m]</span>
Mb = [[<span class="org-type">-</span>28.47, <span class="org-type">-</span>106.25, <span class="org-type">-</span>22.50],
[ 28.47, <span class="org-type">-</span>106.25, <span class="org-type">-</span>22.50],
[ 106.25, 28.47, <span class="org-type">-</span>22.50],
[ 77.78, 77.78, <span class="org-type">-</span>22.50],
[<span class="org-type">-</span>77.78, 77.78, <span class="org-type">-</span>22.50],
[<span class="org-type">-</span>106.25, 28.47, <span class="org-type">-</span>22.50]]<span class="org-type">'*</span>1e<span class="org-type">-</span>3; <span class="org-comment">% Bi w.r.t. {M} [m]</span>
H = 95e<span class="org-type">-</span>3; <span class="org-comment">% Stewart platform height [m]</span>
Fb = Mb <span class="org-type">+</span> [0; 0; H]; <span class="org-comment">% Bi w.r.t. {F} [m]</span>
si = Fb <span class="org-type">-</span> Fa;
si = si<span class="org-type">./</span>vecnorm(si); <span class="org-comment">% Normalize</span>
Bb = Mb <span class="org-type">-</span> [0; 0; Hbm];
J = [si<span class="org-type">'</span>, cross(Bb, si)<span class="org-type">'</span>];
</pre>
</div>
</div>
2021-06-07 19:00:29 +02:00
</div>
2021-06-14 18:08:46 +02:00
</div>
2021-06-09 18:14:45 +02:00
</div>
2021-06-07 19:00:29 +02:00
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
<p class="date">Created: 2021-07-02 ven. 18:25</p>
2021-06-07 19:00:29 +02:00
</div>
</body>
</html>