Delete old function to make cubic configurations

This commit is contained in:
Thomas Dehaeze 2020-02-06 17:29:55 +01:00
parent d462bc2481
commit bfc62cac82
3 changed files with 74 additions and 938 deletions

View File

@ -4,7 +4,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2020-02-06 jeu. 17:25 --> <!-- 2020-02-06 jeu. 17:29 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Cubic configuration for the Stewart Platform</title> <title>Cubic configuration for the Stewart Platform</title>
@ -268,48 +268,29 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<div id="text-table-of-contents"> <div id="text-table-of-contents">
<ul> <ul>
<li><a href="#org43e4755">1. Questions we wish to answer with this analysis</a></li> <li><a href="#org75c6951">1. <span class="todo TODO">TODO</span> Configuration Analysis - Stiffness Matrix</a>
<li><a href="#org7c85269">2. <span class="todo TODO">TODO</span> Configuration Analysis - Stiffness Matrix</a>
<ul> <ul>
<li><a href="#org7a2e2af">2.1. Cubic Stewart platform centered with the cube center - Jacobian estimated at the cube center</a></li> <li><a href="#orga823f72">1.1. Cubic Stewart platform centered with the cube center - Jacobian estimated at the cube center</a></li>
<li><a href="#orgdd082ef">2.2. Cubic Stewart platform centered with the cube center - Jacobian not estimated at the cube center</a></li> <li><a href="#org4261310">1.2. Cubic Stewart platform centered with the cube center - Jacobian not estimated at the cube center</a></li>
<li><a href="#org314610d">2.3. Cubic Stewart platform not centered with the cube center - Jacobian estimated at the cube center</a></li> <li><a href="#orgf297eb8">1.3. Cubic Stewart platform not centered with the cube center - Jacobian estimated at the cube center</a></li>
<li><a href="#org460e492">2.4. Cubic Stewart platform not centered with the cube center - Jacobian estimated at the Stewart platform center</a></li> <li><a href="#orgfeaf9c1">1.4. Cubic Stewart platform not centered with the cube center - Jacobian estimated at the Stewart platform center</a></li>
<li><a href="#orgccb5ef0">2.5. Conclusion</a></li> <li><a href="#org24bdf29">1.5. Conclusion</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org29d657d">3. <span class="todo TODO">TODO</span> Cubic size analysis</a></li> <li><a href="#org2cb2ab0">2. <span class="todo TODO">TODO</span> Cubic size analysis</a></li>
<li><a href="#orgc12b0fc">4. Functions</a> <li><a href="#orgeec7b47">3. Functions</a>
<ul> <ul>
<li><a href="#org12a207e">4.1. <code>generateCubicConfiguration</code>: Generate a Cubic Configuration</a> <li><a href="#org92224ef">3.1. <code>generateCubicConfiguration</code>: Generate a Cubic Configuration</a>
<ul> <ul>
<li><a href="#orgecee38f">Function description</a></li> <li><a href="#org715472d">Function description</a></li>
<li><a href="#orgb9948d8">Documentation</a></li> <li><a href="#orgbab37f8">Documentation</a></li>
<li><a href="#orgbfb0bd5">Optional Parameters</a></li> <li><a href="#orgddbe42e">Optional Parameters</a></li>
<li><a href="#orgcb22d51">Position of the Cube</a></li> <li><a href="#org66dd074">Position of the Cube</a></li>
<li><a href="#org2f09e98">Compute the pose</a></li> <li><a href="#org388f35d">Compute the pose</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</li> </li>
<li><a href="#org4eaf218">5. <span class="todo TODO">TODO</span> initializeCubicConfiguration</a>
<ul>
<li><a href="#org4fb2bc6">5.1. Function description</a></li>
<li><a href="#orgb540658">5.2. Optional Parameters</a></li>
<li><a href="#org1474f46">5.3. Cube Creation</a></li>
<li><a href="#org03d2dd7">5.4. Vectors of each leg</a></li>
<li><a href="#orgfed36b2">5.5. Verification of Height of the Stewart Platform</a></li>
<li><a href="#orgdb27b02">5.6. Determinate the location of the joints</a></li>
<li><a href="#org5079890">5.7. Returns Stewart Structure</a></li>
</ul>
</li>
<li><a href="#orgd9f1e20">6. <span class="todo TODO">TODO</span> Tests</a>
<ul>
<li><a href="#orgea7297c">6.1. First attempt to parametrisation</a></li>
<li><a href="#orgd6ed3c3">6.2. Second attempt</a></li>
<li><a href="#orgf39eafa">6.3. Generate the Stewart platform for a Cubic configuration</a></li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -332,13 +313,7 @@ According to <a class='org-ref-reference' href="#preumont07_six_axis_singl_stage
</p> </p>
<p> <p>
To generate and study the Cubic configuration, <code>initializeCubicConfiguration</code> is used (description in section <a href="#org83d7db1">5</a>). To generate and study the Cubic configuration, <code>generateCubicConfiguration</code> is used (description in section <a href="#orgb0ae4eb">3.1</a>).
</p>
<div id="outline-container-org43e4755" class="outline-2">
<h2 id="org43e4755"><span class="section-number-2">1</span> Questions we wish to answer with this analysis</h2>
<div class="outline-text-2" id="text-1">
<p>
The goal is to study the benefits of using a cubic configuration: The goal is to study the benefits of using a cubic configuration:
</p> </p>
<ul class="org-ul"> <ul class="org-ul">
@ -346,23 +321,21 @@ The goal is to study the benefits of using a cubic configuration:
<li>No coupling between the actuators?</li> <li>No coupling between the actuators?</li>
<li>Is the center of the cube an important point?</li> <li>Is the center of the cube an important point?</li>
</ul> </ul>
</div>
</div>
<div id="outline-container-org7c85269" class="outline-2"> <div id="outline-container-org75c6951" class="outline-2">
<h2 id="org7c85269"><span class="section-number-2">2</span> <span class="todo TODO">TODO</span> Configuration Analysis - Stiffness Matrix</h2> <h2 id="org75c6951"><span class="section-number-2">1</span> <span class="todo TODO">TODO</span> Configuration Analysis - Stiffness Matrix</h2>
<div class="outline-text-2" id="text-2"> <div class="outline-text-2" id="text-1">
</div> </div>
<div id="outline-container-org7a2e2af" class="outline-3"> <div id="outline-container-orga823f72" class="outline-3">
<h3 id="org7a2e2af"><span class="section-number-3">2.1</span> Cubic Stewart platform centered with the cube center - Jacobian estimated at the cube center</h3> <h3 id="orga823f72"><span class="section-number-3">1.1</span> Cubic Stewart platform centered with the cube center - Jacobian estimated at the cube center</h3>
<div class="outline-text-3" id="text-2-1"> <div class="outline-text-3" id="text-1-1">
<p> <p>
We create a cubic Stewart platform (figure <a href="#org01dbe25">1</a>) in such a way that the center of the cube (black dot) is located at the center of the Stewart platform (blue dot). We create a cubic Stewart platform (figure <a href="#org66ade8d">1</a>) in such a way that the center of the cube (black dot) is located at the center of the Stewart platform (blue dot).
The Jacobian matrix is estimated at the location of the center of the cube. The Jacobian matrix is estimated at the location of the center of the cube.
</p> </p>
<div id="org01dbe25" class="figure"> <div id="org66ade8d" class="figure">
<p><img src="./figs/3d-cubic-stewart-aligned.png" alt="3d-cubic-stewart-aligned.png" /> <p><img src="./figs/3d-cubic-stewart-aligned.png" alt="3d-cubic-stewart-aligned.png" />
</p> </p>
<p><span class="figure-number">Figure 1: </span>Centered cubic configuration</p> <p><span class="figure-number">Figure 1: </span>Centered cubic configuration</p>
@ -466,11 +439,11 @@ save(<span class="org-string">'./mat/stewart.mat'</span>, <span class="org-strin
</div> </div>
</div> </div>
<div id="outline-container-orgdd082ef" class="outline-3"> <div id="outline-container-org4261310" class="outline-3">
<h3 id="orgdd082ef"><span class="section-number-3">2.2</span> Cubic Stewart platform centered with the cube center - Jacobian not estimated at the cube center</h3> <h3 id="org4261310"><span class="section-number-3">1.2</span> Cubic Stewart platform centered with the cube center - Jacobian not estimated at the cube center</h3>
<div class="outline-text-3" id="text-2-2"> <div class="outline-text-3" id="text-1-2">
<p> <p>
We create a cubic Stewart platform with center of the cube located at the center of the Stewart platform (figure <a href="#org01dbe25">1</a>). We create a cubic Stewart platform with center of the cube located at the center of the Stewart platform (figure <a href="#org66ade8d">1</a>).
The Jacobian matrix is not estimated at the location of the center of the cube. The Jacobian matrix is not estimated at the location of the center of the cube.
</p> </p>
@ -570,16 +543,16 @@ stewart = computeGeometricalProperties(stewart, opts);
</div> </div>
</div> </div>
<div id="outline-container-org314610d" class="outline-3"> <div id="outline-container-orgf297eb8" class="outline-3">
<h3 id="org314610d"><span class="section-number-3">2.3</span> Cubic Stewart platform not centered with the cube center - Jacobian estimated at the cube center</h3> <h3 id="orgf297eb8"><span class="section-number-3">1.3</span> Cubic Stewart platform not centered with the cube center - Jacobian estimated at the cube center</h3>
<div class="outline-text-3" id="text-2-3"> <div class="outline-text-3" id="text-1-3">
<p> <p>
Here, the &ldquo;center&rdquo; of the Stewart platform is not at the cube center (figure <a href="#org4aa7b60">2</a>). Here, the &ldquo;center&rdquo; of the Stewart platform is not at the cube center (figure <a href="#org4492663">2</a>).
The Jacobian is estimated at the cube center. The Jacobian is estimated at the cube center.
</p> </p>
<div id="org4aa7b60" class="figure"> <div id="org4492663" class="figure">
<p><img src="./figs/3d-cubic-stewart-misaligned.png" alt="3d-cubic-stewart-misaligned.png" /> <p><img src="./figs/3d-cubic-stewart-misaligned.png" alt="3d-cubic-stewart-misaligned.png" />
</p> </p>
<p><span class="figure-number">Figure 2: </span>Not centered cubic configuration</p> <p><span class="figure-number">Figure 2: </span>Not centered cubic configuration</p>
@ -692,9 +665,9 @@ We obtain \(k_x = k_y = k_z\) and \(k_{\theta_x} = k_{\theta_y}\), but the Stiff
</div> </div>
</div> </div>
<div id="outline-container-org460e492" class="outline-3"> <div id="outline-container-orgfeaf9c1" class="outline-3">
<h3 id="org460e492"><span class="section-number-3">2.4</span> Cubic Stewart platform not centered with the cube center - Jacobian estimated at the Stewart platform center</h3> <h3 id="orgfeaf9c1"><span class="section-number-3">1.4</span> Cubic Stewart platform not centered with the cube center - Jacobian estimated at the Stewart platform center</h3>
<div class="outline-text-3" id="text-2-4"> <div class="outline-text-3" id="text-1-4">
<p> <p>
Here, the &ldquo;center&rdquo; of the Stewart platform is not at the cube center. Here, the &ldquo;center&rdquo; of the Stewart platform is not at the cube center.
The Jacobian is estimated at the center of the Stewart platform. The Jacobian is estimated at the center of the Stewart platform.
@ -807,9 +780,9 @@ We obtain \(k_x = k_y = k_z\) and \(k_{\theta_x} = k_{\theta_y}\), but the Stiff
</div> </div>
</div> </div>
<div id="outline-container-orgccb5ef0" class="outline-3"> <div id="outline-container-org24bdf29" class="outline-3">
<h3 id="orgccb5ef0"><span class="section-number-3">2.5</span> Conclusion</h3> <h3 id="org24bdf29"><span class="section-number-3">1.5</span> Conclusion</h3>
<div class="outline-text-3" id="text-2-5"> <div class="outline-text-3" id="text-1-5">
<div class="important"> <div class="important">
<ul class="org-ul"> <ul class="org-ul">
<li>The cubic configuration permits to have \(k_x = k_y = k_z\) and \(k_{\theta\x} = k_{\theta_y}\)</li> <li>The cubic configuration permits to have \(k_x = k_y = k_z\) and \(k_{\theta\x} = k_{\theta_y}\)</li>
@ -821,9 +794,9 @@ We obtain \(k_x = k_y = k_z\) and \(k_{\theta_x} = k_{\theta_y}\), but the Stiff
</div> </div>
</div> </div>
<div id="outline-container-org29d657d" class="outline-2"> <div id="outline-container-org2cb2ab0" class="outline-2">
<h2 id="org29d657d"><span class="section-number-2">3</span> <span class="todo TODO">TODO</span> Cubic size analysis</h2> <h2 id="org2cb2ab0"><span class="section-number-2">2</span> <span class="todo TODO">TODO</span> Cubic size analysis</h2>
<div class="outline-text-2" id="text-3"> <div class="outline-text-2" id="text-2">
<p> <p>
We here study the effect of the size of the cube used for the Stewart configuration. We here study the effect of the size of the cube used for the Stewart configuration.
</p> </p>
@ -897,7 +870,7 @@ xlabel(<span class="org-string">'Cube Size [mm]'</span>); ylabel(<span class="or
</div> </div>
<div id="orgeec8e66" class="figure"> <div id="org009489e" class="figure">
<p><img src="figs/stiffness_cube_size.png" alt="stiffness_cube_size.png" /> <p><img src="figs/stiffness_cube_size.png" alt="stiffness_cube_size.png" />
</p> </p>
<p><span class="figure-number">Figure 3: </span>\(k_{\theta_x} = k_{\theta_y}\) and \(k_{\theta_z}\) function of the size of the cube</p> <p><span class="figure-number">Figure 3: </span>\(k_{\theta_x} = k_{\theta_y}\) and \(k_{\theta_z}\) function of the size of the cube</p>
@ -918,19 +891,19 @@ In that case, the legs will the further separated. Size of the cube is then limi
</div> </div>
</div> </div>
<div id="outline-container-orgc12b0fc" class="outline-2"> <div id="outline-container-orgeec7b47" class="outline-2">
<h2 id="orgc12b0fc"><span class="section-number-2">4</span> Functions</h2> <h2 id="orgeec7b47"><span class="section-number-2">3</span> Functions</h2>
<div class="outline-text-2" id="text-4"> <div class="outline-text-2" id="text-3">
<p> <p>
<a id="orgee0330a"></a> <a id="orgb108018"></a>
</p> </p>
</div> </div>
<div id="outline-container-org12a207e" class="outline-3"> <div id="outline-container-org92224ef" class="outline-3">
<h3 id="org12a207e"><span class="section-number-3">4.1</span> <code>generateCubicConfiguration</code>: Generate a Cubic Configuration</h3> <h3 id="org92224ef"><span class="section-number-3">3.1</span> <code>generateCubicConfiguration</code>: Generate a Cubic Configuration</h3>
<div class="outline-text-3" id="text-4-1"> <div class="outline-text-3" id="text-3-1">
<p> <p>
<a id="org0a684d8"></a> <a id="orgb0ae4eb"></a>
</p> </p>
<p> <p>
@ -938,9 +911,9 @@ This Matlab function is accessible <a href="src/generateCubicConfiguration.m">he
</p> </p>
</div> </div>
<div id="outline-container-orgecee38f" class="outline-4"> <div id="outline-container-org715472d" class="outline-4">
<h4 id="orgecee38f">Function description</h4> <h4 id="org715472d">Function description</h4>
<div class="outline-text-4" id="text-orgecee38f"> <div class="outline-text-4" id="text-org715472d">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[stewart]</span> = <span class="org-function-name">generateCubicConfiguration</span>(<span class="org-variable-name">stewart</span>, <span class="org-variable-name">args</span>) <pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[stewart]</span> = <span class="org-function-name">generateCubicConfiguration</span>(<span class="org-variable-name">stewart</span>, <span class="org-variable-name">args</span>)
<span class="org-comment">% generateCubicConfiguration - Generate a Cubic Configuration</span> <span class="org-comment">% generateCubicConfiguration - Generate a Cubic Configuration</span>
@ -965,11 +938,11 @@ This Matlab function is accessible <a href="src/generateCubicConfiguration.m">he
</div> </div>
</div> </div>
<div id="outline-container-orgb9948d8" class="outline-4"> <div id="outline-container-orgbab37f8" class="outline-4">
<h4 id="orgb9948d8">Documentation</h4> <h4 id="orgbab37f8">Documentation</h4>
<div class="outline-text-4" id="text-orgb9948d8"> <div class="outline-text-4" id="text-orgbab37f8">
<div id="orgff1f403" class="figure"> <div id="org946a873" class="figure">
<p><img src="figs/cubic-configuration-definition.png" alt="cubic-configuration-definition.png" /> <p><img src="figs/cubic-configuration-definition.png" alt="cubic-configuration-definition.png" />
</p> </p>
<p><span class="figure-number">Figure 4: </span>Cubic Configuration</p> <p><span class="figure-number">Figure 4: </span>Cubic Configuration</p>
@ -977,9 +950,9 @@ This Matlab function is accessible <a href="src/generateCubicConfiguration.m">he
</div> </div>
</div> </div>
<div id="outline-container-orgbfb0bd5" class="outline-4"> <div id="outline-container-orgddbe42e" class="outline-4">
<h4 id="orgbfb0bd5">Optional Parameters</h4> <h4 id="orgddbe42e">Optional Parameters</h4>
<div class="outline-text-4" id="text-orgbfb0bd5"> <div class="outline-text-4" id="text-orgddbe42e">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-matlab">arguments <pre class="src src-matlab">arguments
stewart stewart
@ -993,9 +966,9 @@ This Matlab function is accessible <a href="src/generateCubicConfiguration.m">he
</div> </div>
</div> </div>
<div id="outline-container-orgcb22d51" class="outline-4"> <div id="outline-container-org66dd074" class="outline-4">
<h4 id="orgcb22d51">Position of the Cube</h4> <h4 id="org66dd074">Position of the Cube</h4>
<div class="outline-text-4" id="text-orgcb22d51"> <div class="outline-text-4" id="text-org66dd074">
<p> <p>
We define the useful points of the cube with respect to the Cube&rsquo;s center. We define the useful points of the cube with respect to the Cube&rsquo;s center.
\({}^{C}C\) are the 6 vertices of the cubes expressed in a frame {C} which is \({}^{C}C\) are the 6 vertices of the cubes expressed in a frame {C} which is
@ -1020,9 +993,9 @@ CCm = [Cc(<span class="org-type">:</span>,2), Cc(<span class="org-type">:</span>
</div> </div>
</div> </div>
<div id="outline-container-org2f09e98" class="outline-4"> <div id="outline-container-org388f35d" class="outline-4">
<h4 id="org2f09e98">Compute the pose</h4> <h4 id="org388f35d">Compute the pose</h4>
<div class="outline-text-4" id="text-org2f09e98"> <div class="outline-text-4" id="text-org388f35d">
<p> <p>
We can compute the vector of each leg \({}^{C}\hat{\bm{s}}_{i}\) (unit vector from \({}^{C}C_{f}\) to \({}^{C}C_{m}\)). We can compute the vector of each leg \({}^{C}\hat{\bm{s}}_{i}\) (unit vector from \({}^{C}C_{f}\) to \({}^{C}C_{m}\)).
</p> </p>
@ -1044,442 +1017,6 @@ stewart.Mb = CCf <span class="org-type">+</span> [0; 0; args.FOc<span class="org
</div> </div>
</div> </div>
<div id="outline-container-org4eaf218" class="outline-2">
<h2 id="org4eaf218"><span class="section-number-2">5</span> <span class="todo TODO">TODO</span> initializeCubicConfiguration</h2>
<div class="outline-text-2" id="text-5">
<p>
<a id="org83d7db1"></a>
</p>
</div>
<div id="outline-container-org4fb2bc6" class="outline-3">
<h3 id="org4fb2bc6"><span class="section-number-3">5.1</span> Function description</h3>
<div class="outline-text-3" id="text-5-1">
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[stewart]</span> = <span class="org-function-name">initializeCubicConfiguration</span>(<span class="org-variable-name">opts_param</span>)
</pre>
</div>
</div>
</div>
<div id="outline-container-orgb540658" class="outline-3">
<h3 id="orgb540658"><span class="section-number-3">5.2</span> Optional Parameters</h3>
<div class="outline-text-3" id="text-5-2">
<p>
Default values for opts.
</p>
<div class="org-src-container">
<pre class="src src-matlab">opts = struct(...
<span class="org-string">'H_tot'</span>, 90, ...<span class="org-comment"> % Total height of the Hexapod [mm]</span>
<span class="org-string">'L'</span>, 110, ...<span class="org-comment"> % Size of the Cube [mm]</span>
<span class="org-string">'H'</span>, 40, ...<span class="org-comment"> % Height between base joints and platform joints [mm]</span>
<span class="org-string">'H0'</span>, 75 ...<span class="org-comment"> % Height between the corner of the cube and the plane containing the base joints [mm]</span>
);
</pre>
</div>
<p>
Populate opts with input parameters
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-keyword">if</span> exist(<span class="org-string">'opts_param'</span>,<span class="org-string">'var'</span>)
<span class="org-keyword">for</span> <span class="org-variable-name">opt</span> = <span class="org-constant">fieldnames(opts_param)'</span>
opts.(opt{1}) = opts_param.(opt{1});
<span class="org-keyword">end</span>
<span class="org-keyword">end</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org1474f46" class="outline-3">
<h3 id="org1474f46"><span class="section-number-3">5.3</span> Cube Creation</h3>
<div class="outline-text-3" id="text-5-3">
<div class="org-src-container">
<pre class="src src-matlab">points = [0, 0, 0; ...
0, 0, 1; ...
0, 1, 0; ...
0, 1, 1; ...
1, 0, 0; ...
1, 0, 1; ...
1, 1, 0; ...
1, 1, 1];
points = opts.L<span class="org-type">*</span>points;
</pre>
</div>
<p>
We create the rotation matrix to rotate the cube
</p>
<div class="org-src-container">
<pre class="src src-matlab">sx = cross([1, 1, 1], [1 0 0]);
sx = sx<span class="org-type">/</span>norm(sx);
sy = <span class="org-type">-</span>cross(sx, [1, 1, 1]);
sy = sy<span class="org-type">/</span>norm(sy);
sz = [1, 1, 1];
sz = sz<span class="org-type">/</span>norm(sz);
R = [sx<span class="org-type">'</span>, sy<span class="org-type">'</span>, sz<span class="org-type">'</span>]<span class="org-type">'</span>;
</pre>
</div>
<p>
We use to rotation matrix to rotate the cube
</p>
<div class="org-src-container">
<pre class="src src-matlab">cube = zeros(size(points));
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:size(points, 1)</span>
cube(<span class="org-constant">i</span>, <span class="org-type">:</span>) = R <span class="org-type">*</span> points(<span class="org-constant">i</span>, <span class="org-type">:</span>)<span class="org-type">'</span>;
<span class="org-keyword">end</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org03d2dd7" class="outline-3">
<h3 id="org03d2dd7"><span class="section-number-3">5.4</span> Vectors of each leg</h3>
<div class="outline-text-3" id="text-5-4">
<div class="org-src-container">
<pre class="src src-matlab">leg_indices = [3, 4; ...
2, 4; ...
2, 6; ...
5, 6; ...
5, 7; ...
3, 7];
</pre>
</div>
<p>
Vectors are:
</p>
<div class="org-src-container">
<pre class="src src-matlab">legs = zeros(6, 3);
legs_start = zeros(6, 3);
<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>
legs(<span class="org-constant">i</span>, <span class="org-type">:</span>) = cube(leg_indices(<span class="org-constant">i</span>, 2), <span class="org-type">:</span>) <span class="org-type">-</span> cube(leg_indices(<span class="org-constant">i</span>, 1), <span class="org-type">:</span>);
legs_start(<span class="org-constant">i</span>, <span class="org-type">:</span>) = cube(leg_indices(<span class="org-constant">i</span>, 1), <span class="org-type">:</span>);
<span class="org-keyword">end</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgfed36b2" class="outline-3">
<h3 id="orgfed36b2"><span class="section-number-3">5.5</span> Verification of Height of the Stewart Platform</h3>
<div class="outline-text-3" id="text-5-5">
<p>
If the Stewart platform is not contained in the cube, throw an error.
</p>
<div class="org-src-container">
<pre class="src src-matlab">Hmax = cube(4, 3) <span class="org-type">-</span> cube(2, 3);
<span class="org-keyword">if</span> opts.H0 <span class="org-type">&lt;</span> cube(2, 3)
error(sprintf(<span class="org-string">'H0 is not high enought. Minimum H0 = %.1f'</span>, cube(2, 3)));
<span class="org-keyword">else</span> <span class="org-keyword">if</span> opts.H0 <span class="org-type">+</span> opts.H <span class="org-type">&gt;</span> cube(4, 3)
error(sprintf(<span class="org-string">'H0+H is too high. Maximum H0+H = %.1f'</span>, cube(4, 3)));
error(<span class="org-string">'H0+H is too high'</span>);
<span class="org-keyword">end</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgdb27b02" class="outline-3">
<h3 id="orgdb27b02"><span class="section-number-3">5.6</span> Determinate the location of the joints</h3>
<div class="outline-text-3" id="text-5-6">
<p>
We now determine the location of the joints on the fixed platform w.r.t the fixed frame \(\{A\}\).
\(\{A\}\) is fixed to the bottom of the base.
</p>
<div class="org-src-container">
<pre class="src src-matlab">Aa = zeros(6, 3);
<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>
t = (opts.H0<span class="org-type">-</span>legs_start(<span class="org-constant">i</span>, 3))<span class="org-type">/</span>(legs(<span class="org-constant">i</span>, 3));
Aa(<span class="org-constant">i</span>, <span class="org-type">:</span>) = legs_start(<span class="org-constant">i</span>, <span class="org-type">:</span>) <span class="org-type">+</span> t<span class="org-type">*</span>legs(<span class="org-constant">i</span>, <span class="org-type">:</span>);
<span class="org-keyword">end</span>
</pre>
</div>
<p>
And the location of the joints on the mobile platform with respect to \(\{A\}\).
</p>
<div class="org-src-container">
<pre class="src src-matlab">Ab = zeros(6, 3);
<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>
t = (opts.H0<span class="org-type">+</span>opts.H<span class="org-type">-</span>legs_start(<span class="org-constant">i</span>, 3))<span class="org-type">/</span>(legs(<span class="org-constant">i</span>, 3));
Ab(<span class="org-constant">i</span>, <span class="org-type">:</span>) = legs_start(<span class="org-constant">i</span>, <span class="org-type">:</span>) <span class="org-type">+</span> t<span class="org-type">*</span>legs(<span class="org-constant">i</span>, <span class="org-type">:</span>);
<span class="org-keyword">end</span>
</pre>
</div>
<p>
And the location of the joints on the mobile platform with respect to \(\{B\}\).
</p>
<div class="org-src-container">
<pre class="src src-matlab">Bb = zeros(6, 3);
Bb = Ab <span class="org-type">-</span> (opts.H0 <span class="org-type">+</span> opts.H_tot<span class="org-type">/</span>2 <span class="org-type">+</span> opts.H<span class="org-type">/</span>2)<span class="org-type">*</span>[0, 0, 1];
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">h = opts.H0 <span class="org-type">+</span> opts.H<span class="org-type">/</span>2 <span class="org-type">-</span> opts.H_tot<span class="org-type">/</span>2;
Aa = Aa <span class="org-type">-</span> h<span class="org-type">*</span>[0, 0, 1];
Ab = Ab <span class="org-type">-</span> h<span class="org-type">*</span>[0, 0, 1];
</pre>
</div>
</div>
</div>
<div id="outline-container-org5079890" class="outline-3">
<h3 id="org5079890"><span class="section-number-3">5.7</span> Returns Stewart Structure</h3>
<div class="outline-text-3" id="text-5-7">
<div class="org-src-container">
<pre class="src src-matlab"> stewart = struct();
stewart.Aa = Aa;
stewart.Ab = Ab;
stewart.Bb = Bb;
stewart.H_tot = opts.H_tot;
<span class="org-keyword">end</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgd9f1e20" class="outline-2">
<h2 id="orgd9f1e20"><span class="section-number-2">6</span> <span class="todo TODO">TODO</span> Tests</h2>
<div class="outline-text-2" id="text-6">
</div>
<div id="outline-container-orgea7297c" class="outline-3">
<h3 id="orgea7297c"><span class="section-number-3">6.1</span> First attempt to parametrisation</h3>
<div class="outline-text-3" id="text-6-1">
<div id="org65e66e5" class="figure">
<p><img src="./figs/stewart_bottom_plate.png" alt="stewart_bottom_plate.png" />
</p>
<p><span class="figure-number">Figure 5: </span>Schematic of the bottom plates with all the parameters</p>
</div>
<p>
The goal is to choose \(\alpha\), \(\beta\), \(R_\text{leg, t}\) and \(R_\text{leg, b}\) in such a way that the configuration is cubic.
</p>
<p>
The configuration is cubic if:
\[ \overrightarrow{a_i b_i} \cdot \overrightarrow{a_j b_j} = 0, \ \forall i, j = [1, \hdots, 6], i \ne j \]
</p>
<p>
Lets express \(a_i\), \(b_i\) and \(a_j\):
</p>
\begin{equation*}
a_1 = \begin{bmatrix}R_{\text{leg,b}} \cos(120 - \alpha) \\ R_{\text{leg,b}} \cos(120 - \alpha) \\ 0\end{bmatrix} ; \quad
a_2 = \begin{bmatrix}R_{\text{leg,b}} \cos(120 + \alpha) \\ R_{\text{leg,b}} \cos(120 + \alpha) \\ 0\end{bmatrix} ; \quad
\end{equation*}
\begin{equation*}
b_1 = \begin{bmatrix}R_{\text{leg,t}} \cos(120 - \beta) \\ R_{\text{leg,t}} \cos(120 - \beta\\ H\end{bmatrix} ; \quad
b_2 = \begin{bmatrix}R_{\text{leg,t}} \cos(120 + \beta) \\ R_{\text{leg,t}} \cos(120 + \beta\\ H\end{bmatrix} ; \quad
\end{equation*}
<p>
\[ \overrightarrow{a_1 b_1} = b_1 - a_1 = \begin{bmatrix}R_{\text{leg}} \cos(120 - \alpha) \\ R_{\text{leg}} \cos(120 - \alpha) \\ 0\end{bmatrix}\]
</p>
</div>
</div>
<div id="outline-container-orgd6ed3c3" class="outline-3">
<h3 id="orgd6ed3c3"><span class="section-number-3">6.2</span> Second attempt</h3>
<div class="outline-text-3" id="text-6-2">
<p>
We start with the point of a cube in space:
</p>
\begin{align*}
[0, 0, 0] ; \ [0, 0, 1]; \ ...
\end{align*}
<p>
We also want the cube to point upward:
\[ [1, 1, 1] \Rightarrow [0, 0, 1] \]
</p>
<p>
Then we have the direction of all the vectors expressed in the frame of the hexapod.
</p>
<div class="org-src-container">
<pre class="src src-matlab">points = [0, 0, 0; ...
0, 0, 1; ...
0, 1, 0; ...
0, 1, 1; ...
1, 0, 0; ...
1, 0, 1; ...
1, 1, 0; ...
1, 1, 1];
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-type">figure</span>;
plot3(points(<span class="org-type">:</span>,1), points(<span class="org-type">:</span>,2), points(<span class="org-type">:</span>,3), <span class="org-string">'ko'</span>)
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">sx = cross([1, 1, 1], [1 0 0]);
sx = sx<span class="org-type">/</span>norm(sx);
sy = <span class="org-type">-</span>cross(sx, [1, 1, 1]);
sy = sy<span class="org-type">/</span>norm(sy);
sz = [1, 1, 1];
sz = sz<span class="org-type">/</span>norm(sz);
R = [sx<span class="org-type">'</span>, sy<span class="org-type">'</span>, sz<span class="org-type">'</span>]<span class="org-type">'</span>;
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">cube = zeros(size(points));
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:size(points, 1)</span>
cube(<span class="org-constant">i</span>, <span class="org-type">:</span>) = R <span class="org-type">*</span> points(<span class="org-constant">i</span>, <span class="org-type">:</span>)<span class="org-type">'</span>;
<span class="org-keyword">end</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-type">figure</span>;
hold on;
plot3(points(<span class="org-type">:</span>,1), points(<span class="org-type">:</span>,2), points(<span class="org-type">:</span>,3), <span class="org-string">'ko'</span>);
plot3(cube(<span class="org-type">:</span>,1), cube(<span class="org-type">:</span>,2), cube(<span class="org-type">:</span>,3), <span class="org-string">'ro'</span>);
hold off;
</pre>
</div>
<p>
Now we plot the legs of the hexapod.
</p>
<div class="org-src-container">
<pre class="src src-matlab">leg_indices = [3, 4; ...
2, 4; ...
2, 6; ...
5, 6; ...
5, 7; ...
3, 7]
<span class="org-type">figure</span>;
hold on;
<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>
plot3(cube(leg_indices(<span class="org-constant">i</span>, <span class="org-type">:</span>),1), cube(leg_indices(<span class="org-constant">i</span>, <span class="org-type">:</span>),2), cube(leg_indices(<span class="org-constant">i</span>, <span class="org-type">:</span>),3), <span class="org-string">'-'</span>);
<span class="org-keyword">end</span>
hold off;
</pre>
</div>
<p>
Vectors are:
</p>
<div class="org-src-container">
<pre class="src src-matlab">legs = zeros(6, 3);
legs_start = zeros(6, 3);
<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>
legs(<span class="org-constant">i</span>, <span class="org-type">:</span>) = cube(leg_indices(<span class="org-constant">i</span>, 2), <span class="org-type">:</span>) <span class="org-type">-</span> cube(leg_indices(<span class="org-constant">i</span>, 1), <span class="org-type">:</span>);
legs_start(<span class="org-constant">i</span>, <span class="org-type">:</span>) = cube(leg_indices(<span class="org-constant">i</span>, 1), <span class="org-type">:</span>)
<span class="org-keyword">end</span>
</pre>
</div>
<p>
We now have the orientation of each leg.
</p>
<p>
We here want to see if the position of the &ldquo;slice&rdquo; changes something.
</p>
<p>
Let&rsquo;s first estimate the maximum height of the Stewart platform.
</p>
<div class="org-src-container">
<pre class="src src-matlab">Hmax = cube(4, 3) <span class="org-type">-</span> cube(2, 3);
</pre>
</div>
<p>
Let&rsquo;s then estimate the middle position of the platform
</p>
<div class="org-src-container">
<pre class="src src-matlab">Hmid = cube(8, 3)<span class="org-type">/</span>2;
</pre>
</div>
</div>
</div>
<div id="outline-container-orgf39eafa" class="outline-3">
<h3 id="orgf39eafa"><span class="section-number-3">6.3</span> Generate the Stewart platform for a Cubic configuration</h3>
<div class="outline-text-3" id="text-6-3">
<p>
First we defined the height of the Hexapod.
</p>
<div class="org-src-container">
<pre class="src src-matlab">H = Hmax<span class="org-type">/</span>2;
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">Zs = 1.2<span class="org-type">*</span>cube(2, 3); <span class="org-comment">% Height of the fixed platform</span>
Ze = Zs <span class="org-type">+</span> H; <span class="org-comment">% Height of the mobile platform</span>
</pre>
</div>
<p>
We now determine the location of the joints on the fixed platform.
</p>
<div class="org-src-container">
<pre class="src src-matlab">Aa = zeros(6, 3);
<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>
t = (Zs<span class="org-type">-</span>legs_start(<span class="org-constant">i</span>, 3))<span class="org-type">/</span>(legs(<span class="org-constant">i</span>, 3));
Aa(<span class="org-constant">i</span>, <span class="org-type">:</span>) = legs_start(<span class="org-constant">i</span>, <span class="org-type">:</span>) <span class="org-type">+</span> t<span class="org-type">*</span>legs(<span class="org-constant">i</span>, <span class="org-type">:</span>);
<span class="org-keyword">end</span>
</pre>
</div>
<p>
And the location of the joints on the mobile platform
</p>
<div class="org-src-container">
<pre class="src src-matlab">Ab = zeros(6, 3);
<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>
t = (Ze<span class="org-type">-</span>legs_start(<span class="org-constant">i</span>, 3))<span class="org-type">/</span>(legs(<span class="org-constant">i</span>, 3));
Ab(<span class="org-constant">i</span>, <span class="org-type">:</span>) = legs_start(<span class="org-constant">i</span>, <span class="org-type">:</span>) <span class="org-type">+</span> t<span class="org-type">*</span>legs(<span class="org-constant">i</span>, <span class="org-type">:</span>);
<span class="org-keyword">end</span>
</pre>
</div>
<p>
And we plot the legs.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-type">figure</span>;
hold on;
<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>
plot3([Ab(<span class="org-constant">i</span>, 1),Aa(<span class="org-constant">i</span>, 1)], [Ab(<span class="org-constant">i</span>, 2),Aa(<span class="org-constant">i</span>, 2)], [Ab(<span class="org-constant">i</span>, 3),Aa(<span class="org-constant">i</span>, 3)], <span class="org-string">'k-'</span>);
<span class="org-keyword">end</span>
hold off;
xlim([<span class="org-type">-</span>1, 1]);
ylim([<span class="org-type">-</span>1, 1]);
zlim([0, 2]);
</pre>
</div>
</div>
</div>
</div>
<p> <p>
<h1 class='org-ref-bib-h1'>Bibliography</h1> <h1 class='org-ref-bib-h1'>Bibliography</h1>
@ -1491,7 +1028,7 @@ zlim([0, 2]);
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p> <p class="author">Author: Dehaeze Thomas</p>
<p class="date">Created: 2020-02-06 jeu. 17:25</p> <p class="date">Created: 2020-02-06 jeu. 17:29</p>
</div> </div>
</body> </body>
</html> </html>

View File

@ -31,7 +31,11 @@ The cubic (or orthogonal) configuration of the Stewart platform is now widely us
According to cite:preumont07_six_axis_singl_stage_activ, the cubic configuration provides a uniform stiffness in all directions and *minimizes the crosscoupling* from actuator to sensor of different legs (being orthogonal to each other). According to cite:preumont07_six_axis_singl_stage_activ, the cubic configuration provides a uniform stiffness in all directions and *minimizes the crosscoupling* from actuator to sensor of different legs (being orthogonal to each other).
To generate and study the Cubic configuration, =initializeCubicConfiguration= is used (description in section [[sec:initializeCubicConfiguration]]). To generate and study the Cubic configuration, =generateCubicConfiguration= is used (description in section [[sec:generateCubicConfiguration]]).
The goal is to study the benefits of using a cubic configuration:
- Equal stiffness in all the degrees of freedom?
- No coupling between the actuators?
- Is the center of the cube an important point?
* Matlab Init :noexport:ignore: * Matlab Init :noexport:ignore:
#+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name) #+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name)
@ -46,12 +50,6 @@ To generate and study the Cubic configuration, =initializeCubicConfiguration= is
simulinkproject('./'); simulinkproject('./');
#+end_src #+end_src
* Questions we wish to answer with this analysis
The goal is to study the benefits of using a cubic configuration:
- Equal stiffness in all the degrees of freedom?
- No coupling between the actuators?
- Is the center of the cube an important point?
* TODO Configuration Analysis - Stiffness Matrix * TODO Configuration Analysis - Stiffness Matrix
** Cubic Stewart platform centered with the cube center - Jacobian estimated at the cube center ** Cubic Stewart platform centered with the cube center - Jacobian estimated at the cube center
We create a cubic Stewart platform (figure [[fig:3d-cubic-stewart-aligned]]) in such a way that the center of the cube (black dot) is located at the center of the Stewart platform (blue dot). We create a cubic Stewart platform (figure [[fig:3d-cubic-stewart-aligned]]) in such a way that the center of the cube (black dot) is located at the center of the Stewart platform (blue dot).
@ -400,316 +398,6 @@ We now which to compute the position of the joints $a_{i}$ and $b_{i}$.
stewart.Mb = CCf + [0; 0; args.FOc-stewart.H] + ((stewart.H-args.MHb-(args.FOc-args.Hc/2))./CSi(3,:)).*CSi; stewart.Mb = CCf + [0; 0; args.FOc-stewart.H] + ((stewart.H-args.MHb-(args.FOc-args.Hc/2))./CSi(3,:)).*CSi;
#+end_src #+end_src
* TODO initializeCubicConfiguration
:PROPERTIES:
:HEADER-ARGS:matlab+: :exports code
:HEADER-ARGS:matlab+: :comments no
:HEADER-ARGS:matlab+: :eval no
:HEADER-ARGS:matlab+: :tangle src/initializeCubicConfiguration.m
:END:
<<sec:initializeCubicConfiguration>>
** Function description
#+begin_src matlab
function [stewart] = initializeCubicConfiguration(opts_param)
#+end_src
** Optional Parameters
Default values for opts.
#+begin_src matlab
opts = struct(...
'H_tot', 90, ... % Total height of the Hexapod [mm]
'L', 110, ... % Size of the Cube [mm]
'H', 40, ... % Height between base joints and platform joints [mm]
'H0', 75 ... % Height between the corner of the cube and the plane containing the base joints [mm]
);
#+end_src
Populate opts with input parameters
#+begin_src matlab
if exist('opts_param','var')
for opt = fieldnames(opts_param)'
opts.(opt{1}) = opts_param.(opt{1});
end
end
#+end_src
** Cube Creation
#+begin_src matlab :results none
points = [0, 0, 0; ...
0, 0, 1; ...
0, 1, 0; ...
0, 1, 1; ...
1, 0, 0; ...
1, 0, 1; ...
1, 1, 0; ...
1, 1, 1];
points = opts.L*points;
#+end_src
We create the rotation matrix to rotate the cube
#+begin_src matlab :results none
sx = cross([1, 1, 1], [1 0 0]);
sx = sx/norm(sx);
sy = -cross(sx, [1, 1, 1]);
sy = sy/norm(sy);
sz = [1, 1, 1];
sz = sz/norm(sz);
R = [sx', sy', sz']';
#+end_src
We use to rotation matrix to rotate the cube
#+begin_src matlab :results none
cube = zeros(size(points));
for i = 1:size(points, 1)
cube(i, :) = R * points(i, :)';
end
#+end_src
** Vectors of each leg
#+begin_src matlab :results none
leg_indices = [3, 4; ...
2, 4; ...
2, 6; ...
5, 6; ...
5, 7; ...
3, 7];
#+end_src
Vectors are:
#+begin_src matlab :results none
legs = zeros(6, 3);
legs_start = zeros(6, 3);
for i = 1:6
legs(i, :) = cube(leg_indices(i, 2), :) - cube(leg_indices(i, 1), :);
legs_start(i, :) = cube(leg_indices(i, 1), :);
end
#+end_src
** Verification of Height of the Stewart Platform
If the Stewart platform is not contained in the cube, throw an error.
#+begin_src matlab :results none
Hmax = cube(4, 3) - cube(2, 3);
if opts.H0 < cube(2, 3)
error(sprintf('H0 is not high enought. Minimum H0 = %.1f', cube(2, 3)));
else if opts.H0 + opts.H > cube(4, 3)
error(sprintf('H0+H is too high. Maximum H0+H = %.1f', cube(4, 3)));
error('H0+H is too high');
end
#+end_src
** Determinate the location of the joints
We now determine the location of the joints on the fixed platform w.r.t the fixed frame $\{A\}$.
$\{A\}$ is fixed to the bottom of the base.
#+begin_src matlab :results none
Aa = zeros(6, 3);
for i = 1:6
t = (opts.H0-legs_start(i, 3))/(legs(i, 3));
Aa(i, :) = legs_start(i, :) + t*legs(i, :);
end
#+end_src
And the location of the joints on the mobile platform with respect to $\{A\}$.
#+begin_src matlab :results none
Ab = zeros(6, 3);
for i = 1:6
t = (opts.H0+opts.H-legs_start(i, 3))/(legs(i, 3));
Ab(i, :) = legs_start(i, :) + t*legs(i, :);
end
#+end_src
And the location of the joints on the mobile platform with respect to $\{B\}$.
#+begin_src matlab :results none
Bb = zeros(6, 3);
Bb = Ab - (opts.H0 + opts.H_tot/2 + opts.H/2)*[0, 0, 1];
#+end_src
#+begin_src matlab :results none
h = opts.H0 + opts.H/2 - opts.H_tot/2;
Aa = Aa - h*[0, 0, 1];
Ab = Ab - h*[0, 0, 1];
#+end_src
** Returns Stewart Structure
#+begin_src matlab :results none
stewart = struct();
stewart.Aa = Aa;
stewart.Ab = Ab;
stewart.Bb = Bb;
stewart.H_tot = opts.H_tot;
end
#+end_src
* TODO Tests
** First attempt to parametrisation
#+name: fig:stewart_bottom_plate
#+caption: Schematic of the bottom plates with all the parameters
[[file:./figs/stewart_bottom_plate.png]]
The goal is to choose $\alpha$, $\beta$, $R_\text{leg, t}$ and $R_\text{leg, b}$ in such a way that the configuration is cubic.
The configuration is cubic if:
\[ \overrightarrow{a_i b_i} \cdot \overrightarrow{a_j b_j} = 0, \ \forall i, j = [1, \hdots, 6], i \ne j \]
Lets express $a_i$, $b_i$ and $a_j$:
\begin{equation*}
a_1 = \begin{bmatrix}R_{\text{leg,b}} \cos(120 - \alpha) \\ R_{\text{leg,b}} \cos(120 - \alpha) \\ 0\end{bmatrix} ; \quad
a_2 = \begin{bmatrix}R_{\text{leg,b}} \cos(120 + \alpha) \\ R_{\text{leg,b}} \cos(120 + \alpha) \\ 0\end{bmatrix} ; \quad
\end{equation*}
\begin{equation*}
b_1 = \begin{bmatrix}R_{\text{leg,t}} \cos(120 - \beta) \\ R_{\text{leg,t}} \cos(120 - \beta\\ H\end{bmatrix} ; \quad
b_2 = \begin{bmatrix}R_{\text{leg,t}} \cos(120 + \beta) \\ R_{\text{leg,t}} \cos(120 + \beta\\ H\end{bmatrix} ; \quad
\end{equation*}
\[ \overrightarrow{a_1 b_1} = b_1 - a_1 = \begin{bmatrix}R_{\text{leg}} \cos(120 - \alpha) \\ R_{\text{leg}} \cos(120 - \alpha) \\ 0\end{bmatrix}\]
** Second attempt
We start with the point of a cube in space:
\begin{align*}
[0, 0, 0] ; \ [0, 0, 1]; \ ...
\end{align*}
We also want the cube to point upward:
\[ [1, 1, 1] \Rightarrow [0, 0, 1] \]
Then we have the direction of all the vectors expressed in the frame of the hexapod.
#+begin_src matlab :results none
points = [0, 0, 0; ...
0, 0, 1; ...
0, 1, 0; ...
0, 1, 1; ...
1, 0, 0; ...
1, 0, 1; ...
1, 1, 0; ...
1, 1, 1];
#+end_src
#+begin_src matlab :results none
figure;
plot3(points(:,1), points(:,2), points(:,3), 'ko')
#+end_src
#+begin_src matlab :results none
sx = cross([1, 1, 1], [1 0 0]);
sx = sx/norm(sx);
sy = -cross(sx, [1, 1, 1]);
sy = sy/norm(sy);
sz = [1, 1, 1];
sz = sz/norm(sz);
R = [sx', sy', sz']';
#+end_src
#+begin_src matlab :results none
cube = zeros(size(points));
for i = 1:size(points, 1)
cube(i, :) = R * points(i, :)';
end
#+end_src
#+begin_src matlab :results none
figure;
hold on;
plot3(points(:,1), points(:,2), points(:,3), 'ko');
plot3(cube(:,1), cube(:,2), cube(:,3), 'ro');
hold off;
#+end_src
Now we plot the legs of the hexapod.
#+begin_src matlab :results none
leg_indices = [3, 4; ...
2, 4; ...
2, 6; ...
5, 6; ...
5, 7; ...
3, 7]
figure;
hold on;
for i = 1:6
plot3(cube(leg_indices(i, :),1), cube(leg_indices(i, :),2), cube(leg_indices(i, :),3), '-');
end
hold off;
#+end_src
Vectors are:
#+begin_src matlab :results none
legs = zeros(6, 3);
legs_start = zeros(6, 3);
for i = 1:6
legs(i, :) = cube(leg_indices(i, 2), :) - cube(leg_indices(i, 1), :);
legs_start(i, :) = cube(leg_indices(i, 1), :)
end
#+end_src
We now have the orientation of each leg.
We here want to see if the position of the "slice" changes something.
Let's first estimate the maximum height of the Stewart platform.
#+begin_src matlab :results none
Hmax = cube(4, 3) - cube(2, 3);
#+end_src
Let's then estimate the middle position of the platform
#+begin_src matlab :results none
Hmid = cube(8, 3)/2;
#+end_src
** Generate the Stewart platform for a Cubic configuration
First we defined the height of the Hexapod.
#+begin_src matlab :results none
H = Hmax/2;
#+end_src
#+begin_src matlab :results none
Zs = 1.2*cube(2, 3); % Height of the fixed platform
Ze = Zs + H; % Height of the mobile platform
#+end_src
We now determine the location of the joints on the fixed platform.
#+begin_src matlab :results none
Aa = zeros(6, 3);
for i = 1:6
t = (Zs-legs_start(i, 3))/(legs(i, 3));
Aa(i, :) = legs_start(i, :) + t*legs(i, :);
end
#+end_src
And the location of the joints on the mobile platform
#+begin_src matlab :results none
Ab = zeros(6, 3);
for i = 1:6
t = (Ze-legs_start(i, 3))/(legs(i, 3));
Ab(i, :) = legs_start(i, :) + t*legs(i, :);
end
#+end_src
And we plot the legs.
#+begin_src matlab :results none
figure;
hold on;
for i = 1:6
plot3([Ab(i, 1),Aa(i, 1)], [Ab(i, 2),Aa(i, 2)], [Ab(i, 3),Aa(i, 3)], 'k-');
end
hold off;
xlim([-1, 1]);
ylim([-1, 1]);
zlim([0, 2]);
#+end_src
* Bibliography :ignore: * Bibliography :ignore:
bibliographystyle:unsrtnat bibliographystyle:unsrtnat
bibliography:ref.bib bibliography:ref.bib

View File

@ -1,89 +0,0 @@
function [stewart] = initializeCubicConfiguration(opts_param)
opts = struct(...
'H_tot', 90, ... % Total height of the Hexapod [mm]
'L', 110, ... % Size of the Cube [mm]
'H', 40, ... % Height between base joints and platform joints [mm]
'H0', 75 ... % Height between the corner of the cube and the plane containing the base joints [mm]
);
if exist('opts_param','var')
for opt = fieldnames(opts_param)'
opts.(opt{1}) = opts_param.(opt{1});
end
end
points = [0, 0, 0; ...
0, 0, 1; ...
0, 1, 0; ...
0, 1, 1; ...
1, 0, 0; ...
1, 0, 1; ...
1, 1, 0; ...
1, 1, 1];
points = opts.L*points;
sx = cross([1, 1, 1], [1 0 0]);
sx = sx/norm(sx);
sy = -cross(sx, [1, 1, 1]);
sy = sy/norm(sy);
sz = [1, 1, 1];
sz = sz/norm(sz);
R = [sx', sy', sz']';
cube = zeros(size(points));
for i = 1:size(points, 1)
cube(i, :) = R * points(i, :)';
end
leg_indices = [3, 4; ...
2, 4; ...
2, 6; ...
5, 6; ...
5, 7; ...
3, 7];
legs = zeros(6, 3);
legs_start = zeros(6, 3);
for i = 1:6
legs(i, :) = cube(leg_indices(i, 2), :) - cube(leg_indices(i, 1), :);
legs_start(i, :) = cube(leg_indices(i, 1), :);
end
Hmax = cube(4, 3) - cube(2, 3);
if opts.H0 < cube(2, 3)
error(sprintf('H0 is not high enought. Minimum H0 = %.1f', cube(2, 3)));
else if opts.H0 + opts.H > cube(4, 3)
error(sprintf('H0+H is too high. Maximum H0+H = %.1f', cube(4, 3)));
error('H0+H is too high');
end
Aa = zeros(6, 3);
for i = 1:6
t = (opts.H0-legs_start(i, 3))/(legs(i, 3));
Aa(i, :) = legs_start(i, :) + t*legs(i, :);
end
Ab = zeros(6, 3);
for i = 1:6
t = (opts.H0+opts.H-legs_start(i, 3))/(legs(i, 3));
Ab(i, :) = legs_start(i, :) + t*legs(i, :);
end
Bb = zeros(6, 3);
Bb = Ab - (opts.H0 + opts.H_tot/2 + opts.H/2)*[0, 0, 1];
h = opts.H0 + opts.H/2 - opts.H_tot/2;
Aa = Aa - h*[0, 0, 1];
Ab = Ab - h*[0, 0, 1];
stewart = struct();
stewart.Aa = Aa;
stewart.Ab = Ab;
stewart.Bb = Bb;
stewart.H_tot = opts.H_tot;
end