Update simulation of kinematics

This commit is contained in:
Thomas Dehaeze 2019-12-11 14:47:14 +01:00
parent 6a3481b8ac
commit 7ca627ff91
2 changed files with 75 additions and 43 deletions

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2019-12-10 mar. 18:03 -->
<!-- 2019-12-11 mer. 14:47 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Kinematics of the station</title>
@ -283,16 +283,16 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orgc0809a7">1. Micro Hexapod</a>
<li><a href="#orgf49d055">1. Micro Hexapod</a>
<ul>
<li><a href="#org5ed8144">1.1. How the Symetrie Hexapod is controlled on the micro station</a></li>
<li><a href="#orge1f9456">1.2. Control of the Micro-Hexapod using Simscape</a>
<li><a href="#orgb024fa1">1.1. How the Symetrie Hexapod is controlled on the micro station</a></li>
<li><a href="#org34abe0f">1.2. Control of the Micro-Hexapod using Simscape</a>
<ul>
<li><a href="#orgaec6c7a">1.2.1. Using Bushing Joint</a></li>
<li><a href="#org964676d">1.2.2. Using Inverse Kinematics and Leg Actuators</a>
<li><a href="#org118cdf5">1.2.1. Using Bushing Joint</a></li>
<li><a href="#org37b4bdd">1.2.2. Using Inverse Kinematics and Leg Actuators</a>
<ul>
<li><a href="#org3fcf5f8">1.2.2.1. Theory</a></li>
<li><a href="#orgc39da76">1.2.2.2. Matlab Implementation</a></li>
<li><a href="#org9839e83">1.2.2.1. Theory</a></li>
<li><a href="#org78fd3cf">1.2.2.2. Matlab Implementation</a></li>
</ul>
</li>
</ul>
@ -307,12 +307,12 @@ for the JavaScript code in this tag.
In this document, we discuss the way the motion of each stage is defined.
</p>
<div id="outline-container-orgc0809a7" class="outline-2">
<h2 id="orgc0809a7"><span class="section-number-2">1</span> Micro Hexapod</h2>
<div id="outline-container-orgf49d055" class="outline-2">
<h2 id="orgf49d055"><span class="section-number-2">1</span> Micro Hexapod</h2>
<div class="outline-text-2" id="text-1">
</div>
<div id="outline-container-org5ed8144" class="outline-3">
<h3 id="org5ed8144"><span class="section-number-3">1.1</span> How the Symetrie Hexapod is controlled on the micro station</h3>
<div id="outline-container-orgb024fa1" class="outline-3">
<h3 id="orgb024fa1"><span class="section-number-3">1.1</span> How the Symetrie Hexapod is controlled on the micro station</h3>
<div class="outline-text-3" id="text-1-1">
<p>
For the Micro-Hexapod, the convention for the angles are defined in <code>MAN_A_Software API_4.0.150918_EN.pdf</code> on page 13 (section 2.4 - Rotation Vectors):
@ -360,8 +360,8 @@ Thus, it does the translations and then the rotation around the new translated f
</div>
</div>
<div id="outline-container-orge1f9456" class="outline-3">
<h3 id="orge1f9456"><span class="section-number-3">1.2</span> Control of the Micro-Hexapod using Simscape</h3>
<div id="outline-container-org34abe0f" class="outline-3">
<h3 id="org34abe0f"><span class="section-number-3">1.2</span> Control of the Micro-Hexapod using Simscape</h3>
<div class="outline-text-3" id="text-1-2">
<p>
We can think of two main ways to position the Micro-Hexapod using Simscape.
@ -378,15 +378,15 @@ This require a little bit more of mathematical derivations but this is the chose
</p>
</div>
<div id="outline-container-orgaec6c7a" class="outline-4">
<h4 id="orgaec6c7a"><span class="section-number-4">1.2.1</span> Using Bushing Joint</h4>
<div id="outline-container-org118cdf5" class="outline-4">
<h4 id="org118cdf5"><span class="section-number-4">1.2.1</span> Using Bushing Joint</h4>
<div class="outline-text-4" id="text-1-2-1">
<p>
In the documentation of the Bushing Joint (<code>doc "Bushing Joint"</code>) that is used to position the Hexapods, it is mention that the following frame is positioned with respect to the base frame in a way shown in figure <a href="#orgaa7f4a2">1</a>.
In the documentation of the Bushing Joint (<code>doc "Bushing Joint"</code>) that is used to position the Hexapods, it is mention that the following frame is positioned with respect to the base frame in a way shown in figure <a href="#orgbf74afe">1</a>.
</p>
<div id="orgaa7f4a2" class="figure">
<div id="orgbf74afe" class="figure">
<p><img src="figs/bushing_joint_transform.png" alt="bushing_joint_transform.png" />
</p>
<p><span class="figure-number">Figure 1: </span>Joint Transformation Sequence for the Bushing Joint</p>
@ -404,8 +404,8 @@ However, the Bushing Joint makes rotations around mobiles axes (X, Y' and then Z
</div>
</div>
<div id="outline-container-org964676d" class="outline-4">
<h4 id="org964676d"><span class="section-number-4">1.2.2</span> Using Inverse Kinematics and Leg Actuators</h4>
<div id="outline-container-org37b4bdd" class="outline-4">
<h4 id="org37b4bdd"><span class="section-number-4">1.2.2</span> Using Inverse Kinematics and Leg Actuators</h4>
<div class="outline-text-4" id="text-1-2-2">
<p>
Here, we can use the Inverse Kinematic of the Hexapod to determine the length of each leg in order to obtain some defined translation and rotation of the mobile platform.
@ -418,10 +418,21 @@ The advantages are:
<li>we can position the Hexapod as we want by specifying a rotation matrix</li>
<li>the hexapod keeps its full flexibility as we don't specify any wanted displacements, only leg's rest position</li>
</ul>
<p>
However:
</p>
<ul class="org-ul">
<li>even though the rest position of each leg (the position where the stiffness force is zero) is set correctly, the hexapod will we deflected due to gravity</li>
</ul>
<p>
Thus, for this simulation, we <b>remove the gravity</b>.
</p>
</div>
<div id="outline-container-org3fcf5f8" class="outline-5">
<h5 id="org3fcf5f8"><span class="section-number-5">1.2.2.1</span> Theory</h5>
<div id="outline-container-org9839e83" class="outline-5">
<h5 id="org9839e83"><span class="section-number-5">1.2.2.1</span> Theory</h5>
<div class="outline-text-5" id="text-1-2-2-1">
<p>
For inverse kinematic analysis, it is assumed that the position \({}^A\bm{P}\) and orientation of the moving platform \({}^A\bm{R}_B\) are given and the problem is to obtain the joint variables, namely, \(\bm{L} = [l_1, l_2, \dots, l_6]^T\).
@ -456,20 +467,29 @@ Otherwise, when the limbs' lengths derived yield complex numbers, then the posit
</div>
</div>
<div id="outline-container-orgc39da76" class="outline-5">
<h5 id="orgc39da76"><span class="section-number-5">1.2.2.2</span> Matlab Implementation</h5>
<div id="outline-container-org78fd3cf" class="outline-5">
<h5 id="org78fd3cf"><span class="section-number-5">1.2.2.2</span> Matlab Implementation</h5>
<div class="outline-text-5" id="text-1-2-2-2">
<p>
We open the Simulink file.
</p>
<div class="org-src-container">
<pre class="src src-matlab">open <span class="org-string">'simscape/hexapod_tests.slx'</span>
</pre>
</div>
<p>
We load the configuration and set a small <code>StopTime</code>.
</p>
<div class="org-src-container">
<pre class="src src-matlab">load<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'simscape/conf_simscape.mat'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
<span class="org-matlab-simulink-keyword">set_param</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">conf_simscape</span>, <span class="org-string">'StopTime'</span>, '<span class="org-highlight-numbers-number">0</span>.<span class="org-highlight-numbers-number">5</span><span class="org-type">'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
</pre>
</div>
<p>
We define the wanted position/orientation of the Hexapod under study.
</p>
<div class="org-src-container">
<pre class="src src-matlab">tx = <span class="org-highlight-numbers-number">0</span>.<span class="org-highlight-numbers-number">1</span>; <span class="org-comment">% [rad]</span>
ty = <span class="org-highlight-numbers-number">0</span>.<span class="org-highlight-numbers-number">2</span>; <span class="org-comment">% [rad]</span>
@ -494,6 +514,9 @@ hexapod = initializeMicroHexapod<span class="org-rainbow-delimiters-depth-1">(</
</pre>
</div>
<p>
We run the simulation.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-simulink-keyword">sim</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'simscape/hexapod_tests.slx'</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
@ -515,15 +538,15 @@ And we verify that we indeed succeed to go to the wanted position.
</colgroup>
<tbody>
<tr>
<td class="org-right">-2.12e-06</td>
<td class="org-right">1.611e-10</td>
</tr>
<tr>
<td class="org-right">2.9787e-06</td>
<td class="org-right">-1.3748e-10</td>
</tr>
<tr>
<td class="org-right">-4.4341e-06</td>
<td class="org-right">8.4879e-11</td>
</tr>
</tbody>
</table>
@ -545,21 +568,21 @@ And we verify that we indeed succeed to go to the wanted position.
</colgroup>
<tbody>
<tr>
<td class="org-right">-1.5714e-06</td>
<td class="org-right">1.4513e-06</td>
<td class="org-right">7.8133e-06</td>
<td class="org-right">-1.2659e-10</td>
<td class="org-right">6.5603e-11</td>
<td class="org-right">6.2183e-10</td>
</tr>
<tr>
<td class="org-right">8.4113e-07</td>
<td class="org-right">-7.1485e-07</td>
<td class="org-right">-7.4572e-06</td>
<td class="org-right">1.0354e-10</td>
<td class="org-right">-5.2439e-11</td>
<td class="org-right">-5.2425e-10</td>
</tr>
<tr>
<td class="org-right">-7.5348e-06</td>
<td class="org-right">7.7112e-06</td>
<td class="org-right">-2.3088e-06</td>
<td class="org-right">-5.9816e-10</td>
<td class="org-right">5.532e-10</td>
<td class="org-right">-1.7737e-10</td>
</tr>
</tbody>
</table>
@ -571,7 +594,7 @@ And we verify that we indeed succeed to go to the wanted position.
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
<p class="date">Created: 2019-12-10 mar. 18:03</p>
<p class="date">Created: 2019-12-11 mer. 14:47</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -104,6 +104,11 @@ The advantages are:
- we can position the Hexapod as we want by specifying a rotation matrix
- the hexapod keeps its full flexibility as we don't specify any wanted displacements, only leg's rest position
However:
- even though the rest position of each leg (the position where the stiffness force is zero) is set correctly, the hexapod will we deflected due to gravity
Thus, for this simulation, we *remove the gravity*.
**** Theory
For inverse kinematic analysis, it is assumed that the position ${}^A\bm{P}$ and orientation of the moving platform ${}^A\bm{R}_B$ are given and the problem is to obtain the joint variables, namely, $\bm{L} = [l_1, l_2, \dots, l_6]^T$.
@ -140,15 +145,18 @@ Otherwise, when the limbs' lengths derived yield complex numbers, then the posit
#+end_src
**** Matlab Implementation
We open the Simulink file.
#+begin_src matlab
open 'simscape/hexapod_tests.slx'
#+end_src
We load the configuration and set a small =StopTime=.
#+begin_src matlab
load('simscape/conf_simscape.mat');
set_param(conf_simscape, 'StopTime', '0.5');
#+end_src
We define the wanted position/orientation of the Hexapod under study.
#+begin_src matlab
tx = 0.1; % [rad]
ty = 0.2; % [rad]
@ -172,6 +180,7 @@ Otherwise, when the limbs' lengths derived yield complex numbers, then the posit
hexapod = initializeMicroHexapod(struct('AP', AP, 'ARB', ARB));
#+end_src
We run the simulation.
#+begin_src matlab
sim('simscape/hexapod_tests.slx')
#+end_src
@ -182,15 +191,15 @@ And we verify that we indeed succeed to go to the wanted position.
#+end_src
#+RESULTS:
| -2.12e-06 |
| 2.9787e-06 |
| -4.4341e-06 |
| 1.611e-10 |
| -1.3748e-10 |
| 8.4879e-11 |
#+begin_src matlab :results table replace
simout.R.Data(:, :, end)-ARB
#+end_src
#+RESULTS:
| -1.5714e-06 | 1.4513e-06 | 7.8133e-06 |
| 8.4113e-07 | -7.1485e-07 | -7.4572e-06 |
| -7.5348e-06 | 7.7112e-06 | -2.3088e-06 |
| -1.2659e-10 | 6.5603e-11 | 6.2183e-10 |
| 1.0354e-10 | -5.2439e-11 | -5.2425e-10 |
| -5.9816e-10 | 5.532e-10 | -1.7737e-10 |