[Done] Partition Stewart struct - Variant Simscape

This commit is contained in:
Thomas Dehaeze 2020-02-11 15:16:07 +01:00
parent 2231aa53ce
commit e1cd9b0aa8
30 changed files with 2326 additions and 1211 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

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-01-29 mer. 20:22 --> <!-- 2020-02-11 mar. 15:10 -->
<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>Kinematic Study of the Stewart Platform</title> <title>Kinematic Study of the Stewart Platform</title>
@ -268,69 +268,73 @@ 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="#orgc15a3c4">1. Jacobian Analysis</a> <li><a href="#org12dba9f">1. Jacobian Analysis</a>
<ul> <ul>
<li><a href="#orgfe46499">1.1. Jacobian Computation</a></li> <li><a href="#orgf11b2b6">1.1. Jacobian Computation</a></li>
<li><a href="#org47a46f9">1.2. Jacobian - Velocity loop closure</a></li> <li><a href="#org77e916f">1.2. Jacobian - Velocity loop closure</a></li>
<li><a href="#org39fe037">1.3. Jacobian - Static Force Transformation</a></li> <li><a href="#orgbd5d473">1.3. Jacobian - Static Force Transformation</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org022818a">2. Stiffness Analysis</a> <li><a href="#orgecbb7b3">2. Stiffness Analysis</a>
<ul> <ul>
<li><a href="#orgd894508">2.1. Computation of the Stiffness and Compliance Matrix</a></li> <li><a href="#orgbea68d5">2.1. Computation of the Stiffness and Compliance Matrix</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org8111618">3. Forward and Inverse Kinematics</a> <li><a href="#org7c304b7">3. Forward and Inverse Kinematics</a>
<ul> <ul>
<li><a href="#org7985a6a">3.1. Inverse Kinematics</a></li> <li><a href="#org9b180e9">3.1. Inverse Kinematics</a></li>
<li><a href="#orgf5c4aa7">3.2. Forward Kinematics</a></li> <li><a href="#orga3a2319">3.2. Forward Kinematics</a></li>
<li><a href="#orgbb81fc8">3.3. Approximate solution of the Forward and Inverse Kinematic problem for small displacement using the Jacobian matrix</a></li> <li><a href="#org12d14b0">3.3. Approximate solution of the Forward and Inverse Kinematic problem for small displacement using the Jacobian matrix</a></li>
<li><a href="#org62d03d6">3.4. Estimation of the range validity of the approximate inverse kinematics</a> <li><a href="#orgbad3ae9">3.4. Estimation of the range validity of the approximate inverse kinematics</a>
<ul> <ul>
<li><a href="#orga5bc217">3.4.1. Stewart architecture definition</a></li> <li><a href="#orge3ab830">3.4.1. Stewart architecture definition</a></li>
<li><a href="#org871d94a">3.4.2. Comparison for &ldquo;pure&rdquo; translations</a></li> <li><a href="#org294ab65">3.4.2. Comparison for &ldquo;pure&rdquo; translations</a></li>
<li><a href="#orgc70d027">3.4.3. Conclusion</a></li> <li><a href="#orgea391a3">3.4.3. Conclusion</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</li> </li>
<li><a href="#orgac7950e">4. Estimated required actuator stroke from specified platform mobility</a> <li><a href="#orgddb8d5d">4. Estimated required actuator stroke from specified platform mobility</a>
<ul> <ul>
<li><a href="#org4c2a482">4.1. Stewart architecture definition</a></li> <li><a href="#orgfb6bdb7">4.1. Stewart architecture definition</a></li>
<li><a href="#org0e2cd41">4.2. Wanted translations and rotations</a></li> <li><a href="#orgba0801f">4.2. Wanted translations and rotations</a></li>
<li><a href="#org546da0e">4.3. Needed stroke for &ldquo;pure&rdquo; rotations or translations</a></li> <li><a href="#orgdeca909">4.3. Needed stroke for &ldquo;pure&rdquo; rotations or translations</a></li>
<li><a href="#org782ea0a">4.4. Needed stroke for &ldquo;combined&rdquo; rotations or translations</a></li> <li><a href="#orgb713047">4.4. Needed stroke for &ldquo;combined&rdquo; rotations or translations</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org531e516">5. Estimated platform mobility from specified actuator stroke</a> <li><a href="#orge5f80c6">5. Estimated platform mobility from specified actuator stroke</a>
<ul> <ul>
<li><a href="#org741de4c">5.1. Stewart architecture definition</a></li> <li><a href="#org1865dbc">5.1. Stewart architecture definition</a></li>
<li><a href="#orgbc52ab0">5.2. Pure translations</a></li> <li><a href="#orga4b5e5b">5.2. Pure translations</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org09341b5">6. Functions</a> <li><a href="#org748d42a">6. Functions</a>
<ul> <ul>
<li><a href="#orga28bc27">6.1. <code>computeJacobian</code>: Compute the Jacobian Matrix</a> <li><a href="#org00ba36f">6.1. <code>computeJacobian</code>: Compute the Jacobian Matrix</a>
<ul> <ul>
<li><a href="#org129055c">Function description</a></li> <li><a href="#orgbdf3a2a">Function description</a></li>
<li><a href="#orgffa7442">Compute Jacobian Matrix</a></li> <li><a href="#orgd1d8163">Check the <code>stewart</code> structure elements</a></li>
<li><a href="#org318cdc7">Compute Stiffness Matrix</a></li> <li><a href="#orge54466d">Compute Jacobian Matrix</a></li>
<li><a href="#orgeb50736">Compute Compliance Matrix</a></li> <li><a href="#org560e1a1">Compute Stiffness Matrix</a></li>
<li><a href="#orga853f82">Compute Compliance Matrix</a></li>
<li><a href="#org4e11a57">Populate the <code>stewart</code> structure</a></li>
</ul> </ul>
</li> </li>
<li><a href="#orgccfd192">6.2. <code>inverseKinematics</code>: Compute Inverse Kinematics</a> <li><a href="#org6c7006f">6.2. <code>inverseKinematics</code>: Compute Inverse Kinematics</a>
<ul> <ul>
<li><a href="#org14c61e7">Function description</a></li> <li><a href="#org7136bfb">Theory</a></li>
<li><a href="#orgb04bb62">Optional Parameters</a></li> <li><a href="#org75ec482">Function description</a></li>
<li><a href="#orge635491">Theory</a></li> <li><a href="#orgc83e0f8">Optional Parameters</a></li>
<li><a href="#orgbc14960">Compute</a></li> <li><a href="#org3ea2f51">Check the <code>stewart</code> structure elements</a></li>
<li><a href="#org210ed60">Compute</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org1f75518">6.3. <code>forwardKinematicsApprox</code>: Compute the Approximate Forward Kinematics</a> <li><a href="#org8f0dc6c">6.3. <code>forwardKinematicsApprox</code>: Compute the Approximate Forward Kinematics</a>
<ul> <ul>
<li><a href="#org665e0fd">Function description</a></li> <li><a href="#org7c35749">Function description</a></li>
<li><a href="#org89c6f2b">Optional Parameters</a></li> <li><a href="#org5eee73c">Optional Parameters</a></li>
<li><a href="#org3ae22c5">Computation</a></li> <li><a href="#orgee36d86">Check the <code>stewart</code> structure elements</a></li>
<li><a href="#orgc3e4684">Computation</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -353,17 +357,17 @@ In this analysis, the relation between the geometrical parameters of the manipul
The current document is divided in the following sections: The current document is divided in the following sections:
</p> </p>
<ul class="org-ul"> <ul class="org-ul">
<li>Section <a href="#org9f3c0b7">1</a>: The Jacobian matrix is derived from the geometry of the Stewart platform. Then it is shown that the Jacobian can link velocities and forces present in the system, and thus this matrix can be very useful for both analysis and control of the Stewart platform.</li> <li>Section <a href="#orge973aef">1</a>: The Jacobian matrix is derived from the geometry of the Stewart platform. Then it is shown that the Jacobian can link velocities and forces present in the system, and thus this matrix can be very useful for both analysis and control of the Stewart platform.</li>
<li>Section <a href="#orgbd08620">2</a>: The stiffness and compliance matrices are derived from the Jacobian matrix and the stiffness of each strut.</li> <li>Section <a href="#org2a4a521">2</a>: The stiffness and compliance matrices are derived from the Jacobian matrix and the stiffness of each strut.</li>
<li>Section <a href="#orgde74d25">3</a>: The Forward and Inverse kinematic problems are presented.</li> <li>Section <a href="#org8833597">3</a>: The Forward and Inverse kinematic problems are presented.</li>
<li>Section <a href="#orge3719af">4</a>: The Inverse kinematic solution is used to estimate required actuator stroke from the wanted mobility of the Stewart platform.</li> <li>Section <a href="#org6ddfbc5">4</a>: The Inverse kinematic solution is used to estimate required actuator stroke from the wanted mobility of the Stewart platform.</li>
</ul> </ul>
<div id="outline-container-orgc15a3c4" class="outline-2"> <div id="outline-container-org12dba9f" class="outline-2">
<h2 id="orgc15a3c4"><span class="section-number-2">1</span> Jacobian Analysis</h2> <h2 id="org12dba9f"><span class="section-number-2">1</span> Jacobian Analysis</h2>
<div class="outline-text-2" id="text-1"> <div class="outline-text-2" id="text-1">
<p> <p>
<a id="org9f3c0b7"></a> <a id="orge973aef"></a>
</p> </p>
<p> <p>
From <a class='org-ref-reference' href="#taghirad13_paral">taghirad13_paral</a>: From <a class='org-ref-reference' href="#taghirad13_paral">taghirad13_paral</a>:
@ -374,8 +378,8 @@ The Jacobian matrix not only reveals the <b>relation between the joint variable
</p> </p>
</blockquote> </blockquote>
</div> </div>
<div id="outline-container-orgfe46499" class="outline-3"> <div id="outline-container-orgf11b2b6" class="outline-3">
<h3 id="orgfe46499"><span class="section-number-3">1.1</span> Jacobian Computation</h3> <h3 id="orgf11b2b6"><span class="section-number-3">1.1</span> Jacobian Computation</h3>
<div class="outline-text-3" id="text-1-1"> <div class="outline-text-3" id="text-1-1">
<p> <p>
If we note: If we note:
@ -400,7 +404,7 @@ Then, we can compute the Jacobian with the following equation (the superscript \
\end{equation*} \end{equation*}
<p> <p>
The Jacobian matrix \(\bm{J}\) can be computed using the <code>computeJacobian</code> function (accessible <a href="#orga4eba5e">here</a>). The Jacobian matrix \(\bm{J}\) can be computed using the <code>computeJacobian</code> function (accessible <a href="#org519ef53">here</a>).
For instance: For instance:
</p> </p>
<div class="org-src-container"> <div class="org-src-container">
@ -418,8 +422,8 @@ This will add three new matrix to the <code>stewart</code> structure:
</div> </div>
</div> </div>
<div id="outline-container-org47a46f9" class="outline-3"> <div id="outline-container-org77e916f" class="outline-3">
<h3 id="org47a46f9"><span class="section-number-3">1.2</span> Jacobian - Velocity loop closure</h3> <h3 id="org77e916f"><span class="section-number-3">1.2</span> Jacobian - Velocity loop closure</h3>
<div class="outline-text-3" id="text-1-2"> <div class="outline-text-3" id="text-1-2">
<p> <p>
The Jacobian matrix links the input joint rate \(\dot{\bm{\mathcal{L}}} = [ \dot{l}_1, \dot{l}_2, \dot{l}_3, \dot{l}_4, \dot{l}_5, \dot{l}_6 ]^T\) of each strut to the output twist vector of the mobile platform is denoted by \(\dot{\bm{X}} = [^A\bm{v}_p, {}^A\bm{\omega}]^T\): The Jacobian matrix links the input joint rate \(\dot{\bm{\mathcal{L}}} = [ \dot{l}_1, \dot{l}_2, \dot{l}_3, \dot{l}_4, \dot{l}_5, \dot{l}_6 ]^T\) of each strut to the output twist vector of the mobile platform is denoted by \(\dot{\bm{X}} = [^A\bm{v}_p, {}^A\bm{\omega}]^T\):
@ -442,13 +446,13 @@ If the Jacobian matrix is inversible, we can also compute \(\dot{\bm{\mathcal{X}
<p> <p>
The Jacobian matrix can also be used to approximate forward and inverse kinematics for small displacements. The Jacobian matrix can also be used to approximate forward and inverse kinematics for small displacements.
This is explained in section <a href="#org907e556">3.3</a>. This is explained in section <a href="#org2e542bf">3.3</a>.
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-org39fe037" class="outline-3"> <div id="outline-container-orgbd5d473" class="outline-3">
<h3 id="org39fe037"><span class="section-number-3">1.3</span> Jacobian - Static Force Transformation</h3> <h3 id="orgbd5d473"><span class="section-number-3">1.3</span> Jacobian - Static Force Transformation</h3>
<div class="outline-text-3" id="text-1-3"> <div class="outline-text-3" id="text-1-3">
<p> <p>
If we note: If we note:
@ -475,19 +479,19 @@ If the Jacobian matrix is inversible, we also have the following relation:
</div> </div>
</div> </div>
<div id="outline-container-org022818a" class="outline-2"> <div id="outline-container-orgecbb7b3" class="outline-2">
<h2 id="org022818a"><span class="section-number-2">2</span> Stiffness Analysis</h2> <h2 id="orgecbb7b3"><span class="section-number-2">2</span> Stiffness Analysis</h2>
<div class="outline-text-2" id="text-2"> <div class="outline-text-2" id="text-2">
<p> <p>
<a id="orgbd08620"></a> <a id="org2a4a521"></a>
</p> </p>
<p> <p>
Here, we focus on the deflections of the manipulator moving platform that are the result of the external applied wrench to the mobile platform. Here, we focus on the deflections of the manipulator moving platform that are the result of the external applied wrench to the mobile platform.
The amount of these deflections are a function of the applied wrench as well as the manipulator <b>structural stiffness</b>. The amount of these deflections are a function of the applied wrench as well as the manipulator <b>structural stiffness</b>.
</p> </p>
</div> </div>
<div id="outline-container-orgd894508" class="outline-3"> <div id="outline-container-orgbea68d5" class="outline-3">
<h3 id="orgd894508"><span class="section-number-3">2.1</span> Computation of the Stiffness and Compliance Matrix</h3> <h3 id="orgbea68d5"><span class="section-number-3">2.1</span> Computation of the Stiffness and Compliance Matrix</h3>
<div class="outline-text-3" id="text-2-1"> <div class="outline-text-3" id="text-2-1">
<p> <p>
As explain in <a href="stewart-architecture.html">this</a> document, each Actuator is modeled by 3 elements in parallel: As explain in <a href="stewart-architecture.html">this</a> document, each Actuator is modeled by 3 elements in parallel:
@ -538,24 +542,24 @@ The compliance matrix of a manipulator shows the mapping of the moving platform
\end{equation*} \end{equation*}
<p> <p>
The stiffness and compliance matrices are computed using the <code>computeJacobian</code> function (accessible <a href="#orga4eba5e">here</a>). The stiffness and compliance matrices are computed using the <code>computeJacobian</code> function (accessible <a href="#org519ef53">here</a>).
</p> </p>
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-org8111618" class="outline-2"> <div id="outline-container-org7c304b7" class="outline-2">
<h2 id="org8111618"><span class="section-number-2">3</span> Forward and Inverse Kinematics</h2> <h2 id="org7c304b7"><span class="section-number-2">3</span> Forward and Inverse Kinematics</h2>
<div class="outline-text-2" id="text-3"> <div class="outline-text-2" id="text-3">
<p> <p>
<a id="orgde74d25"></a> <a id="org8833597"></a>
</p> </p>
</div> </div>
<div id="outline-container-org7985a6a" class="outline-3"> <div id="outline-container-org9b180e9" class="outline-3">
<h3 id="org7985a6a"><span class="section-number-3">3.1</span> Inverse Kinematics</h3> <h3 id="org9b180e9"><span class="section-number-3">3.1</span> Inverse Kinematics</h3>
<div class="outline-text-3" id="text-3-1"> <div class="outline-text-3" id="text-3-1">
<p> <p>
<a id="orgc35b397"></a> <a id="org3d57c25"></a>
</p> </p>
<blockquote> <blockquote>
@ -584,16 +588,16 @@ Otherwise, the solution gives complex numbers.
</p> </p>
<p> <p>
This inverse kinematic solution can be obtained using the function <code>inverseKinematics</code> (described <a href="#org38cce35">here</a>). This inverse kinematic solution can be obtained using the function <code>inverseKinematics</code> (described <a href="#orgaf5a9a0">here</a>).
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-orgf5c4aa7" class="outline-3"> <div id="outline-container-orga3a2319" class="outline-3">
<h3 id="orgf5c4aa7"><span class="section-number-3">3.2</span> Forward Kinematics</h3> <h3 id="orga3a2319"><span class="section-number-3">3.2</span> Forward Kinematics</h3>
<div class="outline-text-3" id="text-3-2"> <div class="outline-text-3" id="text-3-2">
<p> <p>
<a id="orga5abf69"></a> <a id="orgf7da4c0"></a>
</p> </p>
<blockquote> <blockquote>
@ -612,11 +616,11 @@ In a next section, an approximate solution of the forward kinematics problem is
</div> </div>
</div> </div>
<div id="outline-container-orgbb81fc8" class="outline-3"> <div id="outline-container-org12d14b0" class="outline-3">
<h3 id="orgbb81fc8"><span class="section-number-3">3.3</span> Approximate solution of the Forward and Inverse Kinematic problem for small displacement using the Jacobian matrix</h3> <h3 id="org12d14b0"><span class="section-number-3">3.3</span> Approximate solution of the Forward and Inverse Kinematic problem for small displacement using the Jacobian matrix</h3>
<div class="outline-text-3" id="text-3-3"> <div class="outline-text-3" id="text-3-3">
<p> <p>
<a id="org907e556"></a> <a id="org2e542bf"></a>
</p> </p>
<p> <p>
@ -639,15 +643,18 @@ As the inverse kinematic can be easily solved exactly this is not much useful, h
</p> </p>
<p> <p>
The function <code>forwardKinematicsApprox</code> (described <a href="#org0199633">here</a>) can be used to solve the forward kinematic problem using the Jacobian matrix. The function <code>forwardKinematicsApprox</code> (described <a href="#org7ba3dc5">here</a>) can be used to solve the forward kinematic problem using the Jacobian matrix.
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-org62d03d6" class="outline-3"> <div id="outline-container-orgbad3ae9" class="outline-3">
<h3 id="org62d03d6"><span class="section-number-3">3.4</span> Estimation of the range validity of the approximate inverse kinematics</h3> <h3 id="orgbad3ae9"><span class="section-number-3">3.4</span> Estimation of the range validity of the approximate inverse kinematics</h3>
<div class="outline-text-3" id="text-3-4"> <div class="outline-text-3" id="text-3-4">
<p> <p>
<a id="org6f7aec6"></a>
</p>
<p>
As we know how to exactly solve the Inverse kinematic problem, we can compare the exact solution with the approximate solution using the Jacobian matrix. As we know how to exactly solve the Inverse kinematic problem, we can compare the exact solution with the approximate solution using the Jacobian matrix.
For small displacements, the approximate solution is expected to work well. For small displacements, the approximate solution is expected to work well.
We would like here to determine up to what displacement this approximation can be considered as correct. We would like here to determine up to what displacement this approximation can be considered as correct.
@ -659,8 +666,8 @@ This will also gives us the range for which the approximate forward kinematic is
</p> </p>
</div> </div>
<div id="outline-container-orga5bc217" class="outline-4"> <div id="outline-container-orge3ab830" class="outline-4">
<h4 id="orga5bc217"><span class="section-number-4">3.4.1</span> Stewart architecture definition</h4> <h4 id="orge3ab830"><span class="section-number-4">3.4.1</span> Stewart architecture definition</h4>
<div class="outline-text-4" id="text-3-4-1"> <div class="outline-text-4" id="text-3-4-1">
<p> <p>
We first define some general Stewart architecture. We first define some general Stewart architecture.
@ -680,8 +687,8 @@ stewart = computeJacobian(stewart);
</div> </div>
</div> </div>
<div id="outline-container-org871d94a" class="outline-4"> <div id="outline-container-org294ab65" class="outline-4">
<h4 id="org871d94a"><span class="section-number-4">3.4.2</span> Comparison for &ldquo;pure&rdquo; translations</h4> <h4 id="org294ab65"><span class="section-number-4">3.4.2</span> Comparison for &ldquo;pure&rdquo; translations</h4>
<div class="outline-text-4" id="text-3-4-2"> <div class="outline-text-4" id="text-3-4-2">
<p> <p>
Let&rsquo;s first compare the perfect and approximate solution of the inverse for pure \(x\) translations. Let&rsquo;s first compare the perfect and approximate solution of the inverse for pure \(x\) translations.
@ -689,8 +696,8 @@ Let&rsquo;s first compare the perfect and approximate solution of the inverse fo
<p> <p>
We compute the approximate and exact required strut stroke to have the wanted mobile platform \(x\) displacement. We compute the approximate and exact required strut stroke to have the wanted mobile platform \(x\) displacement.
The estimate required strut stroke for both the approximate and exact solutions are shown in Figure <a href="#org9fbaffc">1</a>. The estimate required strut stroke for both the approximate and exact solutions are shown in Figure <a href="#orgb688993">1</a>.
The relative strut length displacement is shown in Figure <a href="#org76bebd2">2</a>. The relative strut length displacement is shown in Figure <a href="#org4c3ea1b">2</a>.
</p> </p>
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-matlab">Xrs = logspace(<span class="org-type">-</span>6, <span class="org-type">-</span>1, 100); <span class="org-comment">% Wanted X translation of the mobile platform [m]</span> <pre class="src src-matlab">Xrs = logspace(<span class="org-type">-</span>6, <span class="org-type">-</span>1, 100); <span class="org-comment">% Wanted X translation of the mobile platform [m]</span>
@ -707,14 +714,14 @@ Ls_exact = zeros(6, length(Xrs));
</div> </div>
<div id="org9fbaffc" class="figure"> <div id="orgb688993" class="figure">
<p><img src="figs/inverse_kinematics_approx_validity_x_translation.png" alt="inverse_kinematics_approx_validity_x_translation.png" /> <p><img src="figs/inverse_kinematics_approx_validity_x_translation.png" alt="inverse_kinematics_approx_validity_x_translation.png" />
</p> </p>
<p><span class="figure-number">Figure 1: </span>Comparison of the Approximate solution and True solution for the Inverse kinematic problem (<a href="./figs/inverse_kinematics_approx_validity_x_translation.png">png</a>, <a href="./figs/inverse_kinematics_approx_validity_x_translation.pdf">pdf</a>)</p> <p><span class="figure-number">Figure 1: </span>Comparison of the Approximate solution and True solution for the Inverse kinematic problem (<a href="./figs/inverse_kinematics_approx_validity_x_translation.png">png</a>, <a href="./figs/inverse_kinematics_approx_validity_x_translation.pdf">pdf</a>)</p>
</div> </div>
<div id="org76bebd2" class="figure"> <div id="org4c3ea1b" class="figure">
<p><img src="figs/inverse_kinematics_approx_validity_x_translation_relative.png" alt="inverse_kinematics_approx_validity_x_translation_relative.png" /> <p><img src="figs/inverse_kinematics_approx_validity_x_translation_relative.png" alt="inverse_kinematics_approx_validity_x_translation_relative.png" />
</p> </p>
<p><span class="figure-number">Figure 2: </span>Relative length error by using the Approximate solution of the Inverse kinematic problem (<a href="./figs/inverse_kinematics_approx_validity_x_translation_relative.png">png</a>, <a href="./figs/inverse_kinematics_approx_validity_x_translation_relative.pdf">pdf</a>)</p> <p><span class="figure-number">Figure 2: </span>Relative length error by using the Approximate solution of the Inverse kinematic problem (<a href="./figs/inverse_kinematics_approx_validity_x_translation_relative.png">png</a>, <a href="./figs/inverse_kinematics_approx_validity_x_translation_relative.pdf">pdf</a>)</p>
@ -722,8 +729,8 @@ Ls_exact = zeros(6, length(Xrs));
</div> </div>
</div> </div>
<div id="outline-container-orgc70d027" class="outline-4"> <div id="outline-container-orgea391a3" class="outline-4">
<h4 id="orgc70d027"><span class="section-number-4">3.4.3</span> Conclusion</h4> <h4 id="orgea391a3"><span class="section-number-4">3.4.3</span> Conclusion</h4>
<div class="outline-text-4" id="text-3-4-3"> <div class="outline-text-4" id="text-3-4-3">
<p> <p>
For small wanted displacements (up to \(\approx 1\%\) of the size of the Hexapod), the approximate inverse kinematic solution using the Jacobian matrix is quite correct. For small wanted displacements (up to \(\approx 1\%\) of the size of the Hexapod), the approximate inverse kinematic solution using the Jacobian matrix is quite correct.
@ -733,11 +740,11 @@ For small wanted displacements (up to \(\approx 1\%\) of the size of the Hexapod
</div> </div>
</div> </div>
<div id="outline-container-orgac7950e" class="outline-2"> <div id="outline-container-orgddb8d5d" class="outline-2">
<h2 id="orgac7950e"><span class="section-number-2">4</span> Estimated required actuator stroke from specified platform mobility</h2> <h2 id="orgddb8d5d"><span class="section-number-2">4</span> Estimated required actuator stroke from specified platform mobility</h2>
<div class="outline-text-2" id="text-4"> <div class="outline-text-2" id="text-4">
<p> <p>
<a id="orge3719af"></a> <a id="org6ddfbc5"></a>
</p> </p>
<p> <p>
Let&rsquo;s say one want to design a Stewart platform with some specified mobility (position and orientation). Let&rsquo;s say one want to design a Stewart platform with some specified mobility (position and orientation).
@ -745,8 +752,8 @@ One may want to determine the required actuator stroke required to obtain the sp
This is what is analyzed in this section. This is what is analyzed in this section.
</p> </p>
</div> </div>
<div id="outline-container-org4c2a482" class="outline-3"> <div id="outline-container-orgfb6bdb7" class="outline-3">
<h3 id="org4c2a482"><span class="section-number-3">4.1</span> Stewart architecture definition</h3> <h3 id="orgfb6bdb7"><span class="section-number-3">4.1</span> Stewart architecture definition</h3>
<div class="outline-text-3" id="text-4-1"> <div class="outline-text-3" id="text-4-1">
<p> <p>
Let&rsquo;s first define the Stewart platform architecture that we want to study. Let&rsquo;s first define the Stewart platform architecture that we want to study.
@ -766,8 +773,8 @@ stewart = computeJacobian(stewart);
</div> </div>
</div> </div>
<div id="outline-container-org0e2cd41" class="outline-3"> <div id="outline-container-orgba0801f" class="outline-3">
<h3 id="org0e2cd41"><span class="section-number-3">4.2</span> Wanted translations and rotations</h3> <h3 id="orgba0801f"><span class="section-number-3">4.2</span> Wanted translations and rotations</h3>
<div class="outline-text-3" id="text-4-2"> <div class="outline-text-3" id="text-4-2">
<p> <p>
Let&rsquo;s now define the wanted extreme translations and rotations. Let&rsquo;s now define the wanted extreme translations and rotations.
@ -784,8 +791,8 @@ Rz_max = 0; <span class="org-comment">% Rotation [rad]</span>
</div> </div>
</div> </div>
<div id="outline-container-org546da0e" class="outline-3"> <div id="outline-container-orgdeca909" class="outline-3">
<h3 id="org546da0e"><span class="section-number-3">4.3</span> Needed stroke for &ldquo;pure&rdquo; rotations or translations</h3> <h3 id="orgdeca909"><span class="section-number-3">4.3</span> Needed stroke for &ldquo;pure&rdquo; rotations or translations</h3>
<div class="outline-text-3" id="text-4-3"> <div class="outline-text-3" id="text-4-3">
<p> <p>
As a first estimation, we estimate the needed actuator stroke for &ldquo;pure&rdquo; rotations and translation. As a first estimation, we estimate the needed actuator stroke for &ldquo;pure&rdquo; rotations and translation.
@ -816,8 +823,8 @@ This is surely a low estimation of the required stroke.
</div> </div>
</div> </div>
<div id="outline-container-org782ea0a" class="outline-3"> <div id="outline-container-orgb713047" class="outline-3">
<h3 id="org782ea0a"><span class="section-number-3">4.4</span> Needed stroke for &ldquo;combined&rdquo; rotations or translations</h3> <h3 id="orgb713047"><span class="section-number-3">4.4</span> Needed stroke for &ldquo;combined&rdquo; rotations or translations</h3>
<div class="outline-text-3" id="text-4-4"> <div class="outline-text-3" id="text-4-4">
<p> <p>
We know would like to have a more precise estimation. We know would like to have a more precise estimation.
@ -1137,23 +1144,23 @@ This is probably a much realistic estimation of the required actuator stroke.
</div> </div>
</div> </div>
<div id="outline-container-org531e516" class="outline-2"> <div id="outline-container-orge5f80c6" class="outline-2">
<h2 id="org531e516"><span class="section-number-2">5</span> Estimated platform mobility from specified actuator stroke</h2> <h2 id="orge5f80c6"><span class="section-number-2">5</span> Estimated platform mobility from specified actuator stroke</h2>
<div class="outline-text-2" id="text-5"> <div class="outline-text-2" id="text-5">
<p> <p>
<a id="orgf61fb6c"></a> <a id="org10d9ea8"></a>
</p> </p>
<p> <p>
Here, from some value of the actuator stroke, we would like to estimate the mobility of the Stewart platform. Here, from some value of the actuator stroke, we would like to estimate the mobility of the Stewart platform.
</p> </p>
<p> <p>
As explained in section <a href="#orgde74d25">3</a>, the forward kinematic problem of the Stewart platform is quite difficult to solve. As explained in section <a href="#org8833597">3</a>, the forward kinematic problem of the Stewart platform is quite difficult to solve.
However, for small displacements, we can use the Jacobian as an approximate solution. However, for small displacements, we can use the Jacobian as an approximate solution.
</p> </p>
</div> </div>
<div id="outline-container-org741de4c" class="outline-3"> <div id="outline-container-org1865dbc" class="outline-3">
<h3 id="org741de4c"><span class="section-number-3">5.1</span> Stewart architecture definition</h3> <h3 id="org1865dbc"><span class="section-number-3">5.1</span> Stewart architecture definition</h3>
<div class="outline-text-3" id="text-5-1"> <div class="outline-text-3" id="text-5-1">
<p> <p>
Let&rsquo;s first define the Stewart platform architecture that we want to study. Let&rsquo;s first define the Stewart platform architecture that we want to study.
@ -1182,8 +1189,8 @@ L_max = 50e<span class="org-type">-</span>6; <span class="org-comment">% [m]</s
</div> </div>
</div> </div>
<div id="outline-container-orgbc52ab0" class="outline-3"> <div id="outline-container-orga4b5e5b" class="outline-3">
<h3 id="orgbc52ab0"><span class="section-number-3">5.2</span> Pure translations</h3> <h3 id="orga4b5e5b"><span class="section-number-3">5.2</span> Pure translations</h3>
<div class="outline-text-3" id="text-5-2"> <div class="outline-text-3" id="text-5-2">
<p> <p>
Let&rsquo;s first estimate the mobility in translation when the orientation of the Stewart platform stays the same. Let&rsquo;s first estimate the mobility in translation when the orientation of the Stewart platform stays the same.
@ -1255,7 +1262,7 @@ We can also approximate the mobility by a sphere with a radius equal to the mini
</table> </table>
<div id="org16756e7" class="figure"> <div id="orga71e017" class="figure">
<p><img src="figs/mobility_translations_null_rotation.png" alt="mobility_translations_null_rotation.png" /> <p><img src="figs/mobility_translations_null_rotation.png" alt="mobility_translations_null_rotation.png" />
</p> </p>
<p><span class="figure-number">Figure 3: </span>Obtain mobility of the Stewart platform for zero rotations (<a href="./figs/mobility_translations_null_rotation.png">png</a>, <a href="./figs/mobility_translations_null_rotation.pdf">pdf</a>)</p> <p><span class="figure-number">Figure 3: </span>Obtain mobility of the Stewart platform for zero rotations (<a href="./figs/mobility_translations_null_rotation.png">png</a>, <a href="./figs/mobility_translations_null_rotation.pdf">pdf</a>)</p>
@ -1264,18 +1271,18 @@ We can also approximate the mobility by a sphere with a radius equal to the mini
</div> </div>
</div> </div>
<div id="outline-container-org09341b5" class="outline-2"> <div id="outline-container-org748d42a" class="outline-2">
<h2 id="org09341b5"><span class="section-number-2">6</span> Functions</h2> <h2 id="org748d42a"><span class="section-number-2">6</span> Functions</h2>
<div class="outline-text-2" id="text-6"> <div class="outline-text-2" id="text-6">
<p> <p>
<a id="org2d73657"></a> <a id="org1e1d299"></a>
</p> </p>
</div> </div>
<div id="outline-container-orga28bc27" class="outline-3"> <div id="outline-container-org00ba36f" class="outline-3">
<h3 id="orga28bc27"><span class="section-number-3">6.1</span> <code>computeJacobian</code>: Compute the Jacobian Matrix</h3> <h3 id="org00ba36f"><span class="section-number-3">6.1</span> <code>computeJacobian</code>: Compute the Jacobian Matrix</h3>
<div class="outline-text-3" id="text-6-1"> <div class="outline-text-3" id="text-6-1">
<p> <p>
<a id="orga4eba5e"></a> <a id="org519ef53"></a>
</p> </p>
<p> <p>
@ -1283,9 +1290,9 @@ This Matlab function is accessible <a href="src/computeJacobian.m">here</a>.
</p> </p>
</div> </div>
<div id="outline-container-org129055c" class="outline-4"> <div id="outline-container-orgbdf3a2a" class="outline-4">
<h4 id="org129055c">Function description</h4> <h4 id="orgbdf3a2a">Function description</h4>
<div class="outline-text-4" id="text-org129055c"> <div class="outline-text-4" id="text-orgbdf3a2a">
<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">computeJacobian</span>(<span class="org-variable-name">stewart</span>) <pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[stewart]</span> = <span class="org-function-name">computeJacobian</span>(<span class="org-variable-name">stewart</span>)
<span class="org-comment">% computeJacobian -</span> <span class="org-comment">% computeJacobian -</span>
@ -1294,55 +1301,87 @@ This Matlab function is accessible <a href="src/computeJacobian.m">here</a>.
<span class="org-comment">%</span> <span class="org-comment">%</span>
<span class="org-comment">% Inputs:</span> <span class="org-comment">% Inputs:</span>
<span class="org-comment">% - stewart - With at least the following fields:</span> <span class="org-comment">% - stewart - With at least the following fields:</span>
<span class="org-comment">% - As [3x6] - The 6 unit vectors for each strut expressed in {A}</span> <span class="org-comment">% - geometry.As [3x6] - The 6 unit vectors for each strut expressed in {A}</span>
<span class="org-comment">% - Ab [3x6] - The 6 position of the joints bi expressed in {A}</span> <span class="org-comment">% - geometry.Ab [3x6] - The 6 position of the joints bi expressed in {A}</span>
<span class="org-comment">% - actuators.K [6x1] - Total stiffness of the actuators</span>
<span class="org-comment">%</span> <span class="org-comment">%</span>
<span class="org-comment">% Outputs:</span> <span class="org-comment">% Outputs:</span>
<span class="org-comment">% - stewart - With the 3 added field:</span> <span class="org-comment">% - stewart - With the 3 added field:</span>
<span class="org-comment">% - J [6x6] - The Jacobian Matrix</span> <span class="org-comment">% - kinematics.J [6x6] - The Jacobian Matrix</span>
<span class="org-comment">% - K [6x6] - The Stiffness Matrix</span> <span class="org-comment">% - kinematics.K [6x6] - The Stiffness Matrix</span>
<span class="org-comment">% - C [6x6] - The Compliance Matrix</span> <span class="org-comment">% - kinematics.C [6x6] - The Compliance Matrix</span>
</pre> </pre>
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-orgffa7442" class="outline-4"> <div id="outline-container-orgd1d8163" class="outline-4">
<h4 id="orgffa7442">Compute Jacobian Matrix</h4> <h4 id="orgd1d8163">Check the <code>stewart</code> structure elements</h4>
<div class="outline-text-4" id="text-orgffa7442"> <div class="outline-text-4" id="text-orgd1d8163">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-matlab">stewart.J = [stewart.As<span class="org-type">'</span> , cross(stewart.Ab, stewart.As)<span class="org-type">'</span>]; <pre class="src src-matlab">assert(isfield(stewart.geometry, <span class="org-string">'As'</span>), <span class="org-string">'stewart.geometry should have attribute As'</span>)
As = stewart.geometry.As;
assert(isfield(stewart.geometry, <span class="org-string">'Ab'</span>), <span class="org-string">'stewart.geometry should have attribute Ab'</span>)
Ab = stewart.geometry.Ab;
assert(isfield(stewart.actuators, <span class="org-string">'K'</span>), <span class="org-string">'stewart.actuators should have attribute K'</span>)
Ki = stewart.actuators.K;
</pre> </pre>
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-org318cdc7" class="outline-4">
<h4 id="org318cdc7">Compute Stiffness Matrix</h4> <div id="outline-container-orge54466d" class="outline-4">
<div class="outline-text-4" id="text-org318cdc7"> <h4 id="orge54466d">Compute Jacobian Matrix</h4>
<div class="outline-text-4" id="text-orge54466d">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-matlab">stewart.K = stewart.J<span class="org-type">'*</span>diag(stewart.Ki)<span class="org-type">*</span>stewart.J; <pre class="src src-matlab">J = [As<span class="org-type">'</span> , cross(Ab, As)<span class="org-type">'</span>];
</pre> </pre>
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-orgeb50736" class="outline-4"> <div id="outline-container-org560e1a1" class="outline-4">
<h4 id="orgeb50736">Compute Compliance Matrix</h4> <h4 id="org560e1a1">Compute Stiffness Matrix</h4>
<div class="outline-text-4" id="text-orgeb50736"> <div class="outline-text-4" id="text-org560e1a1">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-matlab">stewart.C = inv(stewart.K); <pre class="src src-matlab">K = J<span class="org-type">'*</span>diag(Ki)<span class="org-type">*</span>J;
</pre>
</div>
</div>
</div>
<div id="outline-container-orga853f82" class="outline-4">
<h4 id="orga853f82">Compute Compliance Matrix</h4>
<div class="outline-text-4" id="text-orga853f82">
<div class="org-src-container">
<pre class="src src-matlab">C = inv(K);
</pre>
</div>
</div>
</div>
<div id="outline-container-org4e11a57" class="outline-4">
<h4 id="org4e11a57">Populate the <code>stewart</code> structure</h4>
<div class="outline-text-4" id="text-org4e11a57">
<div class="org-src-container">
<pre class="src src-matlab">stewart.kinematics.J = J;
stewart.kinematics.K = K;
stewart.kinematics.C = C;
</pre> </pre>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-orgccfd192" class="outline-3">
<h3 id="orgccfd192"><span class="section-number-3">6.2</span> <code>inverseKinematics</code>: Compute Inverse Kinematics</h3> <div id="outline-container-org6c7006f" class="outline-3">
<h3 id="org6c7006f"><span class="section-number-3">6.2</span> <code>inverseKinematics</code>: Compute Inverse Kinematics</h3>
<div class="outline-text-3" id="text-6-2"> <div class="outline-text-3" id="text-6-2">
<p> <p>
<a id="org38cce35"></a> <a id="orgaf5a9a0"></a>
</p> </p>
<p> <p>
@ -1350,48 +1389,9 @@ This Matlab function is accessible <a href="src/inverseKinematics.m">here</a>.
</p> </p>
</div> </div>
<div id="outline-container-org14c61e7" class="outline-4"> <div id="outline-container-org7136bfb" class="outline-4">
<h4 id="org14c61e7">Function description</h4> <h4 id="org7136bfb">Theory</h4>
<div class="outline-text-4" id="text-org14c61e7"> <div class="outline-text-4" id="text-org7136bfb">
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[Li, dLi]</span> = <span class="org-function-name">inverseKinematics</span>(<span class="org-variable-name">stewart</span>, <span class="org-variable-name">args</span>)
<span class="org-comment">% inverseKinematics - Compute the needed length of each strut to have the wanted position and orientation of {B} with respect to {A}</span>
<span class="org-comment">%</span>
<span class="org-comment">% Syntax: [stewart] = inverseKinematics(stewart)</span>
<span class="org-comment">%</span>
<span class="org-comment">% Inputs:</span>
<span class="org-comment">% - stewart - A structure with the following fields</span>
<span class="org-comment">% - Aa [3x6] - The positions ai expressed in {A}</span>
<span class="org-comment">% - Bb [3x6] - The positions bi expressed in {B}</span>
<span class="org-comment">% - args - Can have the following fields:</span>
<span class="org-comment">% - AP [3x1] - The wanted position of {B} with respect to {A}</span>
<span class="org-comment">% - ARB [3x3] - The rotation matrix that gives the wanted orientation of {B} with respect to {A}</span>
<span class="org-comment">%</span>
<span class="org-comment">% Outputs:</span>
<span class="org-comment">% - Li [6x1] - The 6 needed length of the struts in [m] to have the wanted pose of {B} w.r.t. {A}</span>
<span class="org-comment">% - dLi [6x1] - The 6 needed displacement of the struts from the initial position in [m] to have the wanted pose of {B} w.r.t. {A}</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgb04bb62" class="outline-4">
<h4 id="orgb04bb62">Optional Parameters</h4>
<div class="outline-text-4" id="text-orgb04bb62">
<div class="org-src-container">
<pre class="src src-matlab">arguments
stewart
args.AP (3,1) double {mustBeNumeric} = zeros(3,1)
args.ARB (3,3) double {mustBeNumeric} = eye(3)
<span class="org-keyword">end</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orge635491" class="outline-4">
<h4 id="orge635491">Theory</h4>
<div class="outline-text-4" id="text-orge635491">
<p> <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\). 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\).
</p> </p>
@ -1425,27 +1425,85 @@ Otherwise, when the limbs&rsquo; lengths derived yield complex numbers, then the
</div> </div>
</div> </div>
<div id="outline-container-orgbc14960" class="outline-4"> <div id="outline-container-org75ec482" class="outline-4">
<h4 id="orgbc14960">Compute</h4> <h4 id="org75ec482">Function description</h4>
<div class="outline-text-4" id="text-orgbc14960"> <div class="outline-text-4" id="text-org75ec482">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-matlab">Li = sqrt(args.AP<span class="org-type">'*</span>args.AP <span class="org-type">+</span> diag(stewart.Bb<span class="org-type">'*</span>stewart.Bb) <span class="org-type">+</span> diag(stewart.Aa<span class="org-type">'*</span>stewart.Aa) <span class="org-type">-</span> (2<span class="org-type">*</span>args.AP<span class="org-type">'*</span>stewart.Aa)<span class="org-type">'</span> <span class="org-type">+</span> (2<span class="org-type">*</span>args.AP<span class="org-type">'*</span>(args.ARB<span class="org-type">*</span>stewart.Bb))<span class="org-type">'</span> <span class="org-type">-</span> diag(2<span class="org-type">*</span>(args.ARB<span class="org-type">*</span>stewart.Bb)<span class="org-type">'*</span>stewart.Aa)); <pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[Li, dLi]</span> = <span class="org-function-name">inverseKinematics</span>(<span class="org-variable-name">stewart</span>, <span class="org-variable-name">args</span>)
<span class="org-comment">% inverseKinematics - Compute the needed length of each strut to have the wanted position and orientation of {B} with respect to {A}</span>
<span class="org-comment">%</span>
<span class="org-comment">% Syntax: [stewart] = inverseKinematics(stewart)</span>
<span class="org-comment">%</span>
<span class="org-comment">% Inputs:</span>
<span class="org-comment">% - stewart - A structure with the following fields</span>
<span class="org-comment">% - geometry.Aa [3x6] - The positions ai expressed in {A}</span>
<span class="org-comment">% - geometry.Bb [3x6] - The positions bi expressed in {B}</span>
<span class="org-comment">% - geometry.l [6x1] - Length of each strut</span>
<span class="org-comment">% - args - Can have the following fields:</span>
<span class="org-comment">% - AP [3x1] - The wanted position of {B} with respect to {A}</span>
<span class="org-comment">% - ARB [3x3] - The rotation matrix that gives the wanted orientation of {B} with respect to {A}</span>
<span class="org-comment">%</span>
<span class="org-comment">% Outputs:</span>
<span class="org-comment">% - Li [6x1] - The 6 needed length of the struts in [m] to have the wanted pose of {B} w.r.t. {A}</span>
<span class="org-comment">% - dLi [6x1] - The 6 needed displacement of the struts from the initial position in [m] to have the wanted pose of {B} w.r.t. {A}</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc83e0f8" class="outline-4">
<h4 id="orgc83e0f8">Optional Parameters</h4>
<div class="outline-text-4" id="text-orgc83e0f8">
<div class="org-src-container">
<pre class="src src-matlab">arguments
stewart
args.AP (3,1) double {mustBeNumeric} = zeros(3,1)
args.ARB (3,3) double {mustBeNumeric} = eye(3)
<span class="org-keyword">end</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org3ea2f51" class="outline-4">
<h4 id="org3ea2f51">Check the <code>stewart</code> structure elements</h4>
<div class="outline-text-4" id="text-org3ea2f51">
<div class="org-src-container">
<pre class="src src-matlab">assert(isfield(stewart.geometry, <span class="org-string">'Aa'</span>), <span class="org-string">'stewart.geometry should have attribute Aa'</span>)
Aa = stewart.geometry.Aa;
assert(isfield(stewart.geometry, <span class="org-string">'Bb'</span>), <span class="org-string">'stewart.geometry should have attribute Bb'</span>)
Bb = stewart.geometry.Bb;
assert(isfield(stewart.geometry, <span class="org-string">'l'</span>), <span class="org-string">'stewart.geometry should have attribute l'</span>)
l = stewart.geometry.l;
</pre>
</div>
</div>
</div>
<div id="outline-container-org210ed60" class="outline-4">
<h4 id="org210ed60">Compute</h4>
<div class="outline-text-4" id="text-org210ed60">
<div class="org-src-container">
<pre class="src src-matlab">Li = sqrt(args.AP<span class="org-type">'*</span>args.AP <span class="org-type">+</span> diag(Bb<span class="org-type">'*</span>Bb) <span class="org-type">+</span> diag(Aa<span class="org-type">'*</span>Aa) <span class="org-type">-</span> (2<span class="org-type">*</span>args.AP<span class="org-type">'*</span>Aa)<span class="org-type">'</span> <span class="org-type">+</span> (2<span class="org-type">*</span>args.AP<span class="org-type">'*</span>(args.ARB<span class="org-type">*</span>Bb))<span class="org-type">'</span> <span class="org-type">-</span> diag(2<span class="org-type">*</span>(args.ARB<span class="org-type">*</span>Bb)<span class="org-type">'*</span>Aa));
</pre> </pre>
</div> </div>
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-matlab">dLi = Li<span class="org-type">-</span>stewart.l; <pre class="src src-matlab">dLi = Li<span class="org-type">-</span>l;
</pre> </pre>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-org1f75518" class="outline-3"> <div id="outline-container-org8f0dc6c" class="outline-3">
<h3 id="org1f75518"><span class="section-number-3">6.3</span> <code>forwardKinematicsApprox</code>: Compute the Approximate Forward Kinematics</h3> <h3 id="org8f0dc6c"><span class="section-number-3">6.3</span> <code>forwardKinematicsApprox</code>: Compute the Approximate Forward Kinematics</h3>
<div class="outline-text-3" id="text-6-3"> <div class="outline-text-3" id="text-6-3">
<p> <p>
<a id="org0199633"></a> <a id="org7ba3dc5"></a>
</p> </p>
<p> <p>
@ -1453,9 +1511,9 @@ This Matlab function is accessible <a href="src/forwardKinematicsApprox.m">here<
</p> </p>
</div> </div>
<div id="outline-container-org665e0fd" class="outline-4"> <div id="outline-container-org7c35749" class="outline-4">
<h4 id="org665e0fd">Function description</h4> <h4 id="org7c35749">Function description</h4>
<div class="outline-text-4" id="text-org665e0fd"> <div class="outline-text-4" id="text-org7c35749">
<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">[P, R]</span> = <span class="org-function-name">forwardKinematicsApprox</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">[P, R]</span> = <span class="org-function-name">forwardKinematicsApprox</span>(<span class="org-variable-name">stewart</span>, <span class="org-variable-name">args</span>)
<span class="org-comment">% forwardKinematicsApprox - Computed the approximate pose of {B} with respect to {A} from the length of each strut and using</span> <span class="org-comment">% forwardKinematicsApprox - Computed the approximate pose of {B} with respect to {A} from the length of each strut and using</span>
@ -1465,7 +1523,7 @@ This Matlab function is accessible <a href="src/forwardKinematicsApprox.m">here<
<span class="org-comment">%</span> <span class="org-comment">%</span>
<span class="org-comment">% Inputs:</span> <span class="org-comment">% Inputs:</span>
<span class="org-comment">% - stewart - A structure with the following fields</span> <span class="org-comment">% - stewart - A structure with the following fields</span>
<span class="org-comment">% - J [6x6] - The Jacobian Matrix</span> <span class="org-comment">% - kinematics.J [6x6] - The Jacobian Matrix</span>
<span class="org-comment">% - args - Can have the following fields:</span> <span class="org-comment">% - args - Can have the following fields:</span>
<span class="org-comment">% - dL [6x1] - Displacement of each strut [m]</span> <span class="org-comment">% - dL [6x1] - Displacement of each strut [m]</span>
<span class="org-comment">%</span> <span class="org-comment">%</span>
@ -1477,9 +1535,9 @@ This Matlab function is accessible <a href="src/forwardKinematicsApprox.m">here<
</div> </div>
</div> </div>
<div id="outline-container-org89c6f2b" class="outline-4"> <div id="outline-container-org5eee73c" class="outline-4">
<h4 id="org89c6f2b">Optional Parameters</h4> <h4 id="org5eee73c">Optional Parameters</h4>
<div class="outline-text-4" id="text-org89c6f2b"> <div class="outline-text-4" id="text-org5eee73c">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-matlab">arguments <pre class="src src-matlab">arguments
stewart stewart
@ -1490,16 +1548,27 @@ This Matlab function is accessible <a href="src/forwardKinematicsApprox.m">here<
</div> </div>
</div> </div>
<div id="outline-container-org3ae22c5" class="outline-4"> <div id="outline-container-orgee36d86" class="outline-4">
<h4 id="org3ae22c5">Computation</h4> <h4 id="orgee36d86">Check the <code>stewart</code> structure elements</h4>
<div class="outline-text-4" id="text-org3ae22c5"> <div class="outline-text-4" id="text-orgee36d86">
<div class="org-src-container">
<pre class="src src-matlab">assert(isfield(stewart.kinematics, <span class="org-string">'J'</span>), <span class="org-string">'stewart.kinematics should have attribute J'</span>)
J = stewart.kinematics.J;
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc3e4684" class="outline-4">
<h4 id="orgc3e4684">Computation</h4>
<div class="outline-text-4" id="text-orgc3e4684">
<p> <p>
From a small displacement of each strut \(d\bm{\mathcal{L}}\), we can compute the From a small displacement of each strut \(d\bm{\mathcal{L}}\), we can compute the
position and orientation of {B} with respect to {A} using the following formula: position and orientation of {B} with respect to {A} using the following formula:
\[ d \bm{\mathcal{X}} = \bm{J}^{-1} d\bm{\mathcal{L}} \] \[ d \bm{\mathcal{X}} = \bm{J}^{-1} d\bm{\mathcal{L}} \]
</p> </p>
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-matlab">X = stewart.J<span class="org-type">\</span>args.dL; <pre class="src src-matlab">X = J<span class="org-type">\</span>args.dL;
</pre> </pre>
</div> </div>
@ -1534,6 +1603,7 @@ We then compute the corresponding rotation matrix.
</div> </div>
</div> </div>
</div> </div>
<p> <p>
<h1 class='org-ref-bib-h1'>Bibliography</h1> <h1 class='org-ref-bib-h1'>Bibliography</h1>
@ -1543,7 +1613,7 @@ We then compute the corresponding rotation matrix.
</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-01-29 mer. 20:22</p> <p class="date">Created: 2020-02-11 mar. 15:10</p>
</div> </div>
</body> </body>
</html> </html>

View File

@ -591,22 +591,39 @@ This Matlab function is accessible [[file:src/computeJacobian.m][here]].
% %
% Inputs: % Inputs:
% - stewart - With at least the following fields: % - stewart - With at least the following fields:
% - As [3x6] - The 6 unit vectors for each strut expressed in {A} % - geometry.As [3x6] - The 6 unit vectors for each strut expressed in {A}
% - Ab [3x6] - The 6 position of the joints bi expressed in {A} % - geometry.Ab [3x6] - The 6 position of the joints bi expressed in {A}
% - actuators.K [6x1] - Total stiffness of the actuators
% %
% Outputs: % Outputs:
% - stewart - With the 3 added field: % - stewart - With the 3 added field:
% - J [6x6] - The Jacobian Matrix % - kinematics.J [6x6] - The Jacobian Matrix
% - K [6x6] - The Stiffness Matrix % - kinematics.K [6x6] - The Stiffness Matrix
% - C [6x6] - The Compliance Matrix % - kinematics.C [6x6] - The Compliance Matrix
#+end_src #+end_src
*** Check the =stewart= structure elements
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_src matlab
assert(isfield(stewart.geometry, 'As'), 'stewart.geometry should have attribute As')
As = stewart.geometry.As;
assert(isfield(stewart.geometry, 'Ab'), 'stewart.geometry should have attribute Ab')
Ab = stewart.geometry.Ab;
assert(isfield(stewart.actuators, 'K'), 'stewart.actuators should have attribute K')
Ki = stewart.actuators.K;
#+end_src
*** Compute Jacobian Matrix *** Compute Jacobian Matrix
:PROPERTIES: :PROPERTIES:
:UNNUMBERED: t :UNNUMBERED: t
:END: :END:
#+begin_src matlab #+begin_src matlab
stewart.J = [stewart.As' , cross(stewart.Ab, stewart.As)']; J = [As' , cross(Ab, As)'];
#+end_src #+end_src
*** Compute Stiffness Matrix *** Compute Stiffness Matrix
@ -614,7 +631,7 @@ This Matlab function is accessible [[file:src/computeJacobian.m][here]].
:UNNUMBERED: t :UNNUMBERED: t
:END: :END:
#+begin_src matlab #+begin_src matlab
stewart.K = stewart.J'*diag(stewart.Ki)*stewart.J; K = J'*diag(Ki)*J;
#+end_src #+end_src
*** Compute Compliance Matrix *** Compute Compliance Matrix
@ -622,9 +639,20 @@ This Matlab function is accessible [[file:src/computeJacobian.m][here]].
:UNNUMBERED: t :UNNUMBERED: t
:END: :END:
#+begin_src matlab #+begin_src matlab
stewart.C = inv(stewart.K); C = inv(K);
#+end_src #+end_src
*** Populate the =stewart= structure
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_src matlab
stewart.kinematics.J = J;
stewart.kinematics.K = K;
stewart.kinematics.C = C;
#+end_src
** =inverseKinematics=: Compute Inverse Kinematics ** =inverseKinematics=: Compute Inverse Kinematics
:PROPERTIES: :PROPERTIES:
:header-args:matlab+: :tangle src/inverseKinematics.m :header-args:matlab+: :tangle src/inverseKinematics.m
@ -634,41 +662,6 @@ This Matlab function is accessible [[file:src/computeJacobian.m][here]].
This Matlab function is accessible [[file:src/inverseKinematics.m][here]]. This Matlab function is accessible [[file:src/inverseKinematics.m][here]].
*** Function description
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_src matlab
function [Li, dLi] = inverseKinematics(stewart, args)
% inverseKinematics - Compute the needed length of each strut to have the wanted position and orientation of {B} with respect to {A}
%
% Syntax: [stewart] = inverseKinematics(stewart)
%
% Inputs:
% - stewart - A structure with the following fields
% - Aa [3x6] - The positions ai expressed in {A}
% - Bb [3x6] - The positions bi expressed in {B}
% - args - Can have the following fields:
% - AP [3x1] - The wanted position of {B} with respect to {A}
% - ARB [3x3] - The rotation matrix that gives the wanted orientation of {B} with respect to {A}
%
% Outputs:
% - Li [6x1] - The 6 needed length of the struts in [m] to have the wanted pose of {B} w.r.t. {A}
% - dLi [6x1] - The 6 needed displacement of the struts from the initial position in [m] to have the wanted pose of {B} w.r.t. {A}
#+end_src
*** Optional Parameters
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_src matlab
arguments
stewart
args.AP (3,1) double {mustBeNumeric} = zeros(3,1)
args.ARB (3,3) double {mustBeNumeric} = eye(3)
end
#+end_src
*** Theory *** Theory
:PROPERTIES: :PROPERTIES:
:UNNUMBERED: t :UNNUMBERED: t
@ -694,16 +687,68 @@ Hence, for $i = 1, 2, \dots, 6$, each limb length can be uniquely determined by:
If the position and orientation of the moving platform lie in the feasible workspace of the manipulator, one unique solution to the limb length is determined by the above equation. If the position and orientation of the moving platform lie in the feasible workspace of the manipulator, one unique solution to the limb length is determined by the above equation.
Otherwise, when the limbs' lengths derived yield complex numbers, then the position or orientation of the moving platform is not reachable. Otherwise, when the limbs' lengths derived yield complex numbers, then the position or orientation of the moving platform is not reachable.
*** Function description
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_src matlab
function [Li, dLi] = inverseKinematics(stewart, args)
% inverseKinematics - Compute the needed length of each strut to have the wanted position and orientation of {B} with respect to {A}
%
% Syntax: [stewart] = inverseKinematics(stewart)
%
% Inputs:
% - stewart - A structure with the following fields
% - geometry.Aa [3x6] - The positions ai expressed in {A}
% - geometry.Bb [3x6] - The positions bi expressed in {B}
% - geometry.l [6x1] - Length of each strut
% - args - Can have the following fields:
% - AP [3x1] - The wanted position of {B} with respect to {A}
% - ARB [3x3] - The rotation matrix that gives the wanted orientation of {B} with respect to {A}
%
% Outputs:
% - Li [6x1] - The 6 needed length of the struts in [m] to have the wanted pose of {B} w.r.t. {A}
% - dLi [6x1] - The 6 needed displacement of the struts from the initial position in [m] to have the wanted pose of {B} w.r.t. {A}
#+end_src
*** Optional Parameters
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_src matlab
arguments
stewart
args.AP (3,1) double {mustBeNumeric} = zeros(3,1)
args.ARB (3,3) double {mustBeNumeric} = eye(3)
end
#+end_src
*** Check the =stewart= structure elements
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_src matlab
assert(isfield(stewart.geometry, 'Aa'), 'stewart.geometry should have attribute Aa')
Aa = stewart.geometry.Aa;
assert(isfield(stewart.geometry, 'Bb'), 'stewart.geometry should have attribute Bb')
Bb = stewart.geometry.Bb;
assert(isfield(stewart.geometry, 'l'), 'stewart.geometry should have attribute l')
l = stewart.geometry.l;
#+end_src
*** Compute *** Compute
:PROPERTIES: :PROPERTIES:
:UNNUMBERED: t :UNNUMBERED: t
:END: :END:
#+begin_src matlab #+begin_src matlab
Li = sqrt(args.AP'*args.AP + diag(stewart.Bb'*stewart.Bb) + diag(stewart.Aa'*stewart.Aa) - (2*args.AP'*stewart.Aa)' + (2*args.AP'*(args.ARB*stewart.Bb))' - diag(2*(args.ARB*stewart.Bb)'*stewart.Aa)); Li = sqrt(args.AP'*args.AP + diag(Bb'*Bb) + diag(Aa'*Aa) - (2*args.AP'*Aa)' + (2*args.AP'*(args.ARB*Bb))' - diag(2*(args.ARB*Bb)'*Aa));
#+end_src #+end_src
#+begin_src matlab #+begin_src matlab
dLi = Li-stewart.l; dLi = Li-l;
#+end_src #+end_src
** =forwardKinematicsApprox=: Compute the Approximate Forward Kinematics ** =forwardKinematicsApprox=: Compute the Approximate Forward Kinematics
@ -728,7 +773,7 @@ This Matlab function is accessible [[file:src/forwardKinematicsApprox.m][here]].
% %
% Inputs: % Inputs:
% - stewart - A structure with the following fields % - stewart - A structure with the following fields
% - J [6x6] - The Jacobian Matrix % - kinematics.J [6x6] - The Jacobian Matrix
% - args - Can have the following fields: % - args - Can have the following fields:
% - dL [6x1] - Displacement of each strut [m] % - dL [6x1] - Displacement of each strut [m]
% %
@ -748,6 +793,15 @@ This Matlab function is accessible [[file:src/forwardKinematicsApprox.m][here]].
end end
#+end_src #+end_src
*** Check the =stewart= structure elements
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_src matlab
assert(isfield(stewart.kinematics, 'J'), 'stewart.kinematics should have attribute J')
J = stewart.kinematics.J;
#+end_src
*** Computation *** Computation
:PROPERTIES: :PROPERTIES:
:UNNUMBERED: t :UNNUMBERED: t
@ -756,7 +810,7 @@ From a small displacement of each strut $d\bm{\mathcal{L}}$, we can compute the
position and orientation of {B} with respect to {A} using the following formula: position and orientation of {B} with respect to {A} using the following formula:
\[ d \bm{\mathcal{X}} = \bm{J}^{-1} d\bm{\mathcal{L}} \] \[ d \bm{\mathcal{X}} = \bm{J}^{-1} d\bm{\mathcal{L}} \]
#+begin_src matlab #+begin_src matlab
X = stewart.J\args.dL; X = J\args.dL;
#+end_src #+end_src
The position vector corresponds to the first 3 elements. The position vector corresponds to the first 3 elements.
@ -777,6 +831,7 @@ We then compute the corresponding rotation matrix.
s(2)*s(1)*(1-cos(theta)) + s(3)*sin(theta), s(2)^2*(1-cos(theta)) + cos(theta), s(2)*s(3)*(1-cos(theta)) - s(1)*sin(theta); s(2)*s(1)*(1-cos(theta)) + s(3)*sin(theta), s(2)^2*(1-cos(theta)) + cos(theta), s(2)*s(3)*(1-cos(theta)) - s(1)*sin(theta);
s(3)*s(1)*(1-cos(theta)) - s(2)*sin(theta), s(3)*s(2)*(1-cos(theta)) + s(1)*sin(theta), s(3)^2*(1-cos(theta)) + cos(theta)]; s(3)*s(1)*(1-cos(theta)) - s(2)*sin(theta), s(3)*s(2)*(1-cos(theta)) + s(1)*sin(theta), s(3)^2*(1-cos(theta)) + cos(theta)];
#+end_src #+end_src
* Bibliography :ignore: * Bibliography :ignore:
bibliographystyle:unsrt bibliographystyle:unsrt
bibliography:ref.bib bibliography:ref.bib

Binary file not shown.

Binary file not shown.

View File

@ -5,17 +5,31 @@ function [stewart] = computeJacobian(stewart)
% %
% Inputs: % Inputs:
% - stewart - With at least the following fields: % - stewart - With at least the following fields:
% - As [3x6] - The 6 unit vectors for each strut expressed in {A} % - geometry.As [3x6] - The 6 unit vectors for each strut expressed in {A}
% - Ab [3x6] - The 6 position of the joints bi expressed in {A} % - geometry.Ab [3x6] - The 6 position of the joints bi expressed in {A}
% - actuators.K [6x1] - Total stiffness of the actuators
% %
% Outputs: % Outputs:
% - stewart - With the 3 added field: % - stewart - With the 3 added field:
% - J [6x6] - The Jacobian Matrix % - kinematics.J [6x6] - The Jacobian Matrix
% - K [6x6] - The Stiffness Matrix % - kinematics.K [6x6] - The Stiffness Matrix
% - C [6x6] - The Compliance Matrix % - kinematics.C [6x6] - The Compliance Matrix
stewart.J = [stewart.As' , cross(stewart.Ab, stewart.As)']; assert(isfield(stewart.geometry, 'As'), 'stewart.geometry should have attribute As')
As = stewart.geometry.As;
stewart.K = stewart.J'*diag(stewart.Ki)*stewart.J; assert(isfield(stewart.geometry, 'Ab'), 'stewart.geometry should have attribute Ab')
Ab = stewart.geometry.Ab;
stewart.C = inv(stewart.K); assert(isfield(stewart.actuators, 'K'), 'stewart.actuators should have attribute K')
Ki = stewart.actuators.K;
J = [As' , cross(Ab, As)'];
K = J'*diag(Ki)*J;
C = inv(K);
stewart.kinematics.J = J;
stewart.kinematics.K = K;
stewart.kinematics.C = C;

View File

@ -5,43 +5,74 @@ function [stewart] = computeJointsPose(stewart)
% %
% Inputs: % Inputs:
% - stewart - A structure with the following fields % - stewart - A structure with the following fields
% - Fa [3x6] - Its i'th column is the position vector of joint ai with respect to {F} % - platform_F.Fa [3x6] - Its i'th column is the position vector of joint ai with respect to {F}
% - Mb [3x6] - Its i'th column is the position vector of joint bi with respect to {M} % - platform_M.Mb [3x6] - Its i'th column is the position vector of joint bi with respect to {M}
% - FO_A [3x1] - Position of {A} with respect to {F} % - platform_F.FO_A [3x1] - Position of {A} with respect to {F}
% - MO_B [3x1] - Position of {B} with respect to {M} % - platform_M.MO_B [3x1] - Position of {B} with respect to {M}
% - FO_M [3x1] - Position of {M} with respect to {F} % - geometry.FO_M [3x1] - Position of {M} with respect to {F}
% %
% Outputs: % Outputs:
% - stewart - A structure with the following added fields % - stewart - A structure with the following added fields
% - Aa [3x6] - The i'th column is the position of ai with respect to {A} % - geometry.Aa [3x6] - The i'th column is the position of ai with respect to {A}
% - Ab [3x6] - The i'th column is the position of bi with respect to {A} % - geometry.Ab [3x6] - The i'th column is the position of bi with respect to {A}
% - Ba [3x6] - The i'th column is the position of ai with respect to {B} % - geometry.Ba [3x6] - The i'th column is the position of ai with respect to {B}
% - Bb [3x6] - The i'th column is the position of bi with respect to {B} % - geometry.Bb [3x6] - The i'th column is the position of bi with respect to {B}
% - l [6x1] - The i'th element is the initial length of strut i % - geometry.l [6x1] - The i'th element is the initial length of strut i
% - As [3x6] - The i'th column is the unit vector of strut i expressed in {A} % - geometry.As [3x6] - The i'th column is the unit vector of strut i expressed in {A}
% - Bs [3x6] - The i'th column is the unit vector of strut i expressed in {B} % - geometry.Bs [3x6] - The i'th column is the unit vector of strut i expressed in {B}
% - FRa [3x3x6] - The i'th 3x3 array is the rotation matrix to orientate the bottom of the i'th strut from {F} % - struts_F.l [6x1] - Length of the Fixed part of the i'th strut
% - MRb [3x3x6] - The i'th 3x3 array is the rotation matrix to orientate the top of the i'th strut from {M} % - struts_M.l [6x1] - Length of the Mobile part of the i'th strut
% - platform_F.FRa [3x3x6] - The i'th 3x3 array is the rotation matrix to orientate the bottom of the i'th strut from {F}
% - platform_M.MRb [3x3x6] - The i'th 3x3 array is the rotation matrix to orientate the top of the i'th strut from {M}
stewart.Aa = stewart.Fa - repmat(stewart.FO_A, [1, 6]); assert(isfield(stewart.platform_F, 'Fa'), 'stewart.platform_F should have attribute Fa')
stewart.Bb = stewart.Mb - repmat(stewart.MO_B, [1, 6]); Fa = stewart.platform_F.Fa;
stewart.Ab = stewart.Bb - repmat(-stewart.MO_B-stewart.FO_M+stewart.FO_A, [1, 6]); assert(isfield(stewart.platform_M, 'Mb'), 'stewart.platform_M should have attribute Mb')
stewart.Ba = stewart.Aa - repmat( stewart.MO_B+stewart.FO_M-stewart.FO_A, [1, 6]); Mb = stewart.platform_M.Mb;
stewart.As = (stewart.Ab - stewart.Aa)./vecnorm(stewart.Ab - stewart.Aa); % As_i is the i'th vector of As assert(isfield(stewart.platform_F, 'FO_A'), 'stewart.platform_F should have attribute FO_A')
FO_A = stewart.platform_F.FO_A;
stewart.l = vecnorm(stewart.Ab - stewart.Aa)'; assert(isfield(stewart.platform_M, 'MO_B'), 'stewart.platform_M should have attribute MO_B')
MO_B = stewart.platform_M.MO_B;
stewart.Bs = (stewart.Bb - stewart.Ba)./vecnorm(stewart.Bb - stewart.Ba); assert(isfield(stewart.geometry, 'FO_M'), 'stewart.geometry should have attribute FO_M')
FO_M = stewart.geometry.FO_M;
stewart.FRa = zeros(3,3,6); Aa = Fa - repmat(FO_A, [1, 6]);
stewart.MRb = zeros(3,3,6); Bb = Mb - repmat(MO_B, [1, 6]);
Ab = Bb - repmat(-MO_B-FO_M+FO_A, [1, 6]);
Ba = Aa - repmat( MO_B+FO_M-FO_A, [1, 6]);
As = (Ab - Aa)./vecnorm(Ab - Aa); % As_i is the i'th vector of As
l = vecnorm(Ab - Aa)';
Bs = (Bb - Ba)./vecnorm(Bb - Ba);
FRa = zeros(3,3,6);
MRb = zeros(3,3,6);
for i = 1:6 for i = 1:6
stewart.FRa(:,:,i) = [cross([0;1;0], stewart.As(:,i)) , cross(stewart.As(:,i), cross([0;1;0], stewart.As(:,i))) , stewart.As(:,i)]; FRa(:,:,i) = [cross([0;1;0], As(:,i)) , cross(As(:,i), cross([0;1;0], As(:,i))) , As(:,i)];
stewart.FRa(:,:,i) = stewart.FRa(:,:,i)./vecnorm(stewart.FRa(:,:,i)); FRa(:,:,i) = FRa(:,:,i)./vecnorm(FRa(:,:,i));
stewart.MRb(:,:,i) = [cross([0;1;0], stewart.Bs(:,i)) , cross(stewart.Bs(:,i), cross([0;1;0], stewart.Bs(:,i))) , stewart.Bs(:,i)]; MRb(:,:,i) = [cross([0;1;0], Bs(:,i)) , cross(Bs(:,i), cross([0;1;0], Bs(:,i))) , Bs(:,i)];
stewart.MRb(:,:,i) = stewart.MRb(:,:,i)./vecnorm(stewart.MRb(:,:,i)); MRb(:,:,i) = MRb(:,:,i)./vecnorm(MRb(:,:,i));
end end
stewart.geometry.Aa = Aa;
stewart.geometry.Ab = Ab;
stewart.geometry.Ba = Ba;
stewart.geometry.Bb = Bb;
stewart.geometry.As = As;
stewart.geometry.Bs = Bs;
stewart.geometry.l = l;
stewart.struts_F.l = l/2;
stewart.struts_M.l = l/2;
stewart.platform_F.FRa = FRa;
stewart.platform_M.MRb = MRb;

View File

@ -34,21 +34,36 @@ arguments
args.platforms logical {mustBeNumericOrLogical} = true args.platforms logical {mustBeNumericOrLogical} = true
end end
assert(isfield(stewart.platform_F, 'FO_A'), 'stewart.platform_F should have attribute FO_A')
FO_A = stewart.platform_F.FO_A;
assert(isfield(stewart.platform_M, 'MO_B'), 'stewart.platform_M should have attribute MO_B')
MO_B = stewart.platform_M.MO_B;
assert(isfield(stewart.geometry, 'H'), 'stewart.geometry should have attribute H')
H = stewart.geometry.H;
assert(isfield(stewart.platform_F, 'Fa'), 'stewart.platform_F should have attribute Fa')
Fa = stewart.platform_F.Fa;
assert(isfield(stewart.platform_M, 'Mb'), 'stewart.platform_M should have attribute Mb')
Mb = stewart.platform_M.Mb;
figure; figure;
hold on; hold on;
FTa = [eye(3), stewart.FO_A; ... FTa = [eye(3), FO_A; ...
zeros(1,3), 1]; zeros(1,3), 1];
ATb = [args.ARB, args.AP; ... ATb = [args.ARB, args.AP; ...
zeros(1,3), 1]; zeros(1,3), 1];
BTm = [eye(3), -stewart.MO_B; ... BTm = [eye(3), -MO_B; ...
zeros(1,3), 1]; zeros(1,3), 1];
FTm = FTa*ATb*BTm; FTm = FTa*ATb*BTm;
d_unit_vector = stewart.H/4; d_unit_vector = H/4;
d_label = stewart.H/20; d_label = H/20;
Ff = [0, 0, 0]; Ff = [0, 0, 0];
if args.frames if args.frames
@ -62,24 +77,22 @@ if args.frames
end end
end end
Fa = stewart.FO_A;
if args.frames if args.frames
quiver3(Fa(1)*ones(1,3), Fa(2)*ones(1,3), Fa(3)*ones(1,3), ... quiver3(FO_A(1)*ones(1,3), FO_A(2)*ones(1,3), FO_A(3)*ones(1,3), ...
[d_unit_vector 0 0], [0 d_unit_vector 0], [0 0 d_unit_vector], '-', 'Color', args.F_color) [d_unit_vector 0 0], [0 d_unit_vector 0], [0 0 d_unit_vector], '-', 'Color', args.F_color)
if args.labels if args.labels
text(Fa(1) + d_label, ... text(FO_A(1) + d_label, ...
Fa(2) + d_label, ... FO_A(2) + d_label, ...
Fa(3) + d_label, '$\{A\}$', 'Color', args.F_color); FO_A(3) + d_label, '$\{A\}$', 'Color', args.F_color);
end end
end end
if args.platforms && isfield(stewart, 'platforms') && isfield(stewart.platforms, 'Fpr') if args.platforms && stewart.platform_F.type == 1
theta = [0:0.01:2*pi+0.01]; % Angles [rad] theta = [0:0.01:2*pi+0.01]; % Angles [rad]
v = null([0; 0; 1]'); % Two vectors that are perpendicular to the circle normal v = null([0; 0; 1]'); % Two vectors that are perpendicular to the circle normal
center = [0; 0; 0]; % Center of the circle center = [0; 0; 0]; % Center of the circle
radius = stewart.platforms.Fpr; % Radius of the circle [m] radius = stewart.platform_F.R; % Radius of the circle [m]
points = center*ones(1, length(theta)) + radius*(v(:,1)*cos(theta) + v(:,2)*sin(theta)); points = center*ones(1, length(theta)) + radius*(v(:,1)*cos(theta) + v(:,2)*sin(theta));
@ -89,14 +102,14 @@ if args.platforms && isfield(stewart, 'platforms') && isfield(stewart.platforms,
end end
if args.joints if args.joints
scatter3(stewart.Fa(1,:), ... scatter3(Fa(1,:), ...
stewart.Fa(2,:), ... Fa(2,:), ...
stewart.Fa(3,:), 'MarkerEdgeColor', args.F_color); Fa(3,:), 'MarkerEdgeColor', args.F_color);
if args.labels if args.labels
for i = 1:size(stewart.Fa,2) for i = 1:size(Fa,2)
text(stewart.Fa(1,i) + d_label, ... text(Fa(1,i) + d_label, ...
stewart.Fa(2,i), ... Fa(2,i), ...
stewart.Fa(3,i), sprintf('$a_{%i}$', i), 'Color', args.F_color); Fa(3,i), sprintf('$a_{%i}$', i), 'Color', args.F_color);
end end
end end
end end
@ -115,7 +128,7 @@ if args.frames
end end
end end
FB = stewart.FO_A + args.AP; FB = FO_A + args.AP;
if args.frames if args.frames
FB_uv = FTm*[d_unit_vector*eye(3); zeros(1,3)]; % Rotated Unit vectors FB_uv = FTm*[d_unit_vector*eye(3); zeros(1,3)]; % Rotated Unit vectors
@ -129,11 +142,11 @@ if args.frames
end end
end end
if args.platforms && isfield(stewart, 'platforms') && isfield(stewart.platforms, 'Mpr') if args.platforms && stewart.platform_M.type == 1
theta = [0:0.01:2*pi+0.01]; % Angles [rad] theta = [0:0.01:2*pi+0.01]; % Angles [rad]
v = null((FTm(1:3,1:3)*[0;0;1])'); % Two vectors that are perpendicular to the circle normal v = null((FTm(1:3,1:3)*[0;0;1])'); % Two vectors that are perpendicular to the circle normal
center = Fm(1:3); % Center of the circle center = Fm(1:3); % Center of the circle
radius = stewart.platforms.Mpr; % Radius of the circle [m] radius = stewart.platform_M.R; % Radius of the circle [m]
points = center*ones(1, length(theta)) + radius*(v(:,1)*cos(theta) + v(:,2)*sin(theta)); points = center*ones(1, length(theta)) + radius*(v(:,1)*cos(theta) + v(:,2)*sin(theta));
@ -143,7 +156,7 @@ if args.platforms && isfield(stewart, 'platforms') && isfield(stewart.platforms,
end end
if args.joints if args.joints
Fb = FTm*[stewart.Mb;ones(1,6)]; Fb = FTm*[Mb;ones(1,6)];
scatter3(Fb(1,:), ... scatter3(Fb(1,:), ...
Fb(2,:), ... Fb(2,:), ...
@ -160,14 +173,14 @@ end
if args.legs if args.legs
for i = 1:6 for i = 1:6
plot3([stewart.Fa(1,i), Fb(1,i)], ... plot3([Fa(1,i), Fb(1,i)], ...
[stewart.Fa(2,i), Fb(2,i)], ... [Fa(2,i), Fb(2,i)], ...
[stewart.Fa(3,i), Fb(3,i)], '-', 'Color', args.L_color); [Fa(3,i), Fb(3,i)], '-', 'Color', args.L_color);
if args.labels if args.labels
text((stewart.Fa(1,i)+Fb(1,i))/2 + d_label, ... text((Fa(1,i)+Fb(1,i))/2 + d_label, ...
(stewart.Fa(2,i)+Fb(2,i))/2, ... (Fa(2,i)+Fb(2,i))/2, ...
(stewart.Fa(3,i)+Fb(3,i))/2, sprintf('$%i$', i), 'Color', args.L_color); (Fa(3,i)+Fb(3,i))/2, sprintf('$%i$', i), 'Color', args.L_color);
end end
end end
end end

View File

@ -6,7 +6,7 @@ function [P, R] = forwardKinematicsApprox(stewart, args)
% %
% Inputs: % Inputs:
% - stewart - A structure with the following fields % - stewart - A structure with the following fields
% - J [6x6] - The Jacobian Matrix % - kinematics.J [6x6] - The Jacobian Matrix
% - args - Can have the following fields: % - args - Can have the following fields:
% - dL [6x1] - Displacement of each strut [m] % - dL [6x1] - Displacement of each strut [m]
% %
@ -19,7 +19,10 @@ arguments
args.dL (6,1) double {mustBeNumeric} = zeros(6,1) args.dL (6,1) double {mustBeNumeric} = zeros(6,1)
end end
X = stewart.J\args.dL; assert(isfield(stewart.kinematics, 'J'), 'stewart.kinematics should have attribute J')
J = stewart.kinematics.J;
X = J\args.dL;
P = X(1:3); P = X(1:3);

View File

@ -5,7 +5,7 @@ function [stewart] = generateCubicConfiguration(stewart, args)
% %
% Inputs: % Inputs:
% - stewart - A structure with the following fields % - stewart - A structure with the following fields
% - H [1x1] - Total height of the platform [m] % - geometry.H [1x1] - Total height of the platform [m]
% - args - Can have the following fields: % - args - Can have the following fields:
% - Hc [1x1] - Height of the "useful" part of the cube [m] % - Hc [1x1] - Height of the "useful" part of the cube [m]
% - FOc [1x1] - Height of the center of the cube with respect to {F} [m] % - FOc [1x1] - Height of the center of the cube with respect to {F} [m]
@ -14,8 +14,8 @@ function [stewart] = generateCubicConfiguration(stewart, args)
% %
% Outputs: % Outputs:
% - stewart - updated Stewart structure with the added fields: % - stewart - updated Stewart structure with the added fields:
% - Fa [3x6] - Its i'th column is the position vector of joint ai with respect to {F} % - platform_F.Fa [3x6] - Its i'th column is the position vector of joint ai with respect to {F}
% - Mb [3x6] - Its i'th column is the position vector of joint bi with respect to {M} % - platform_M.Mb [3x6] - Its i'th column is the position vector of joint bi with respect to {M}
arguments arguments
stewart stewart
@ -25,6 +25,9 @@ arguments
args.MHb (1,1) double {mustBeNumeric, mustBeNonnegative} = 15e-3 args.MHb (1,1) double {mustBeNumeric, mustBeNonnegative} = 15e-3
end end
assert(isfield(stewart.geometry, 'H'), 'stewart.geometry should have attribute H')
H = stewart.geometry.H;
sx = [ 2; -1; -1]; sx = [ 2; -1; -1];
sy = [ 0; 1; -1]; sy = [ 0; 1; -1];
sz = [ 1; 1; 1]; sz = [ 1; 1; 1];
@ -40,5 +43,8 @@ CCm = [Cc(:,2), Cc(:,2), Cc(:,4), Cc(:,4), Cc(:,6), Cc(:,6)]; % CCm(:,i) corresp
CSi = (CCm - CCf)./vecnorm(CCm - CCf); CSi = (CCm - CCf)./vecnorm(CCm - CCf);
stewart.Fa = CCf + [0; 0; args.FOc] + ((args.FHa-(args.FOc-args.Hc/2))./CSi(3,:)).*CSi; Fa = CCf + [0; 0; args.FOc] + ((args.FHa-(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; Mb = CCf + [0; 0; args.FOc-H] + ((H-args.MHb-(args.FOc-args.Hc/2))./CSi(3,:)).*CSi;
stewart.platform_F.Fa = Fa;
stewart.platform_M.Mb = Mb;

View File

@ -14,8 +14,8 @@ function [stewart] = generateGeneralConfiguration(stewart, args)
% %
% Outputs: % Outputs:
% - stewart - updated Stewart structure with the added fields: % - stewart - updated Stewart structure with the added fields:
% - Fa [3x6] - Its i'th column is the position vector of joint ai with respect to {F} % - platform_F.Fa [3x6] - Its i'th column is the position vector of joint ai with respect to {F}
% - Mb [3x6] - Its i'th column is the position vector of joint bi with respect to {M} % - platform_M.Mb [3x6] - Its i'th column is the position vector of joint bi with respect to {M}
arguments arguments
stewart stewart
@ -27,10 +27,13 @@ arguments
args.MTh (6,1) double {mustBeNumeric} = [-60+10, 60-10, 60+10, 180-10, 180+10, -60-10]*(pi/180); args.MTh (6,1) double {mustBeNumeric} = [-60+10, 60-10, 60+10, 180-10, 180+10, -60-10]*(pi/180);
end end
stewart.Fa = zeros(3,6); Fa = zeros(3,6);
stewart.Mb = zeros(3,6); Mb = zeros(3,6);
for i = 1:6 for i = 1:6
stewart.Fa(:,i) = [args.FR*cos(args.FTh(i)); args.FR*sin(args.FTh(i)); args.FH]; Fa(:,i) = [args.FR*cos(args.FTh(i)); args.FR*sin(args.FTh(i)); args.FH];
stewart.Mb(:,i) = [args.MR*cos(args.MTh(i)); args.MR*sin(args.MTh(i)); -args.MH]; Mb(:,i) = [args.MR*cos(args.MTh(i)); args.MR*sin(args.MTh(i)); -args.MH];
end end
stewart.platform_F.Fa = Fa;
stewart.platform_M.Mb = Mb;

View File

@ -5,35 +5,39 @@ function [stewart] = initializeAmplifiedStrutDynamics(stewart, args)
% %
% Inputs: % Inputs:
% - args - Structure with the following fields: % - args - Structure with the following fields:
% - Ksi [6x1] - Vertical stiffness contribution of the piezoelectric stack [N/m] % - Ka [6x1] - Vertical stiffness contribution of the piezoelectric stack [N/m]
% - Csi [6x1] - Vertical damping contribution of the piezoelectric stack [N/(m/s)] % - Ca [6x1] - Vertical damping contribution of the piezoelectric stack [N/(m/s)]
% - Kdi [6x1] - Vertical stiffness when the piezoelectric stack is removed [N/m] % - Kr [6x1] - Vertical (residual) stiffness when the piezoelectric stack is removed [N/m]
% - Cdi [6x1] - Vertical damping when the piezoelectric stack is removed [N/(m/s)] % - Cr [6x1] - Vertical (residual) damping when the piezoelectric stack is removed [N/(m/s)]
% %
% Outputs: % Outputs:
% - stewart - updated Stewart structure with the added fields: % - stewart - updated Stewart structure with the added fields:
% - Ki [6x1] - Total Stiffness of each strut [N/m] % - actuators.type = 2
% - Ci [6x1] - Total Damping of each strut [N/(m/s)] % - actuators.K [6x1] - Total Stiffness of each strut [N/m]
% - Ksi [6x1] - Vertical stiffness contribution of the piezoelectric stack [N/m] % - actuators.C [6x1] - Total Damping of each strut [N/(m/s)]
% - Csi [6x1] - Vertical damping contribution of the piezoelectric stack [N/(m/s)] % - actuators.Ka [6x1] - Vertical stiffness contribution of the piezoelectric stack [N/m]
% - Kdi [6x1] - Vertical stiffness when the piezoelectric stack is removed [N/m] % - actuators.Ca [6x1] - Vertical damping contribution of the piezoelectric stack [N/(m/s)]
% - Cdi [6x1] - Vertical damping when the piezoelectric stack is removed [N/(m/s)] % - actuators.Kr [6x1] - Vertical stiffness when the piezoelectric stack is removed [N/m]
% - actuators.Cr [6x1] - Vertical damping when the piezoelectric stack is removed [N/(m/s)]
arguments arguments
stewart stewart
args.Kdi (6,1) double {mustBeNumeric, mustBeNonnegative} = 5e6*ones(6,1) args.Kr (6,1) double {mustBeNumeric, mustBeNonnegative} = 5e6*ones(6,1)
args.Cdi (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e1*ones(6,1) args.Cr (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e1*ones(6,1)
args.Ksi (6,1) double {mustBeNumeric, mustBeNonnegative} = 15e6*ones(6,1) args.Ka (6,1) double {mustBeNumeric, mustBeNonnegative} = 15e6*ones(6,1)
args.Csi (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e1*ones(6,1) args.Ca (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e1*ones(6,1)
end end
stewart.Ksi = args.Ksi; K = args.Ka + args.Kr;
stewart.Csi = args.Csi; C = args.Ca + args.Cr;
stewart.Kdi = args.Kdi; stewart.actuators.type = 2;
stewart.Cdi = args.Cdi;
stewart.Ki = args.Ksi + args.Kdi; stewart.actuators.Ka = args.Ka;
stewart.Ci = args.Csi + args.Cdi; stewart.actuators.Ca = args.Ca;
stewart.actuator_type = 2; stewart.actuators.Kr = args.Kr;
stewart.actuators.Cr = args.Cr;
stewart.actuators.K = K;
stewart.actuators.C = K;

View File

@ -14,15 +14,17 @@ function [stewart] = initializeCylindricalPlatforms(stewart, args)
% %
% Outputs: % Outputs:
% - stewart - updated Stewart structure with the added fields: % - stewart - updated Stewart structure with the added fields:
% - platforms [struct] - structure with the following fields: % - platform_F [struct] - structure with the following fields:
% - Fpm [1x1] - Fixed Platform Mass [kg] % - type = 1
% - Msi [3x3] - Mobile Platform Inertia matrix [kg*m^2] % - M [1x1] - Fixed Platform Mass [kg]
% - Fph [1x1] - Fixed Platform Height [m] % - I [3x3] - Fixed Platform Inertia matrix [kg*m^2]
% - Fpr [1x1] - Fixed Platform Radius [m] % - H [1x1] - Fixed Platform Height [m]
% - Mpm [1x1] - Mobile Platform Mass [kg] % - R [1x1] - Fixed Platform Radius [m]
% - Fsi [3x3] - Fixed Platform Inertia matrix [kg*m^2] % - platform_M [struct] - structure with the following fields:
% - Mph [1x1] - Mobile Platform Height [m] % - M [1x1] - Mobile Platform Mass [kg]
% - Mpr [1x1] - Mobile Platform Radius [m] % - I [3x3] - Mobile Platform Inertia matrix [kg*m^2]
% - H [1x1] - Mobile Platform Height [m]
% - R [1x1] - Mobile Platform Radius [m]
arguments arguments
stewart stewart
@ -34,20 +36,24 @@ arguments
args.Mpr (1,1) double {mustBeNumeric, mustBePositive} = 100e-3 args.Mpr (1,1) double {mustBeNumeric, mustBePositive} = 100e-3
end end
platforms = struct(); I_F = diag([1/12*args.Fpm * (3*args.Fpr^2 + args.Fph^2), ...
1/12*args.Fpm * (3*args.Fpr^2 + args.Fph^2), ...
1/2 *args.Fpm * args.Fpr^2]);
platforms.Fpm = args.Fpm; I_M = diag([1/12*args.Mpm * (3*args.Mpr^2 + args.Mph^2), ...
platforms.Fph = args.Fph; 1/12*args.Mpm * (3*args.Mpr^2 + args.Mph^2), ...
platforms.Fpr = args.Fpr; 1/2 *args.Mpm * args.Mpr^2]);
platforms.Fpi = diag([1/12 * platforms.Fpm * (3*platforms.Fpr^2 + platforms.Fph^2), ...
1/12 * platforms.Fpm * (3*platforms.Fpr^2 + platforms.Fph^2), ...
1/2 * platforms.Fpm * platforms.Fpr^2]);
platforms.Mpm = args.Mpm; stewart.platform_F.type = 1;
platforms.Mph = args.Mph;
platforms.Mpr = args.Mpr;
platforms.Mpi = diag([1/12 * platforms.Mpm * (3*platforms.Mpr^2 + platforms.Mph^2), ...
1/12 * platforms.Mpm * (3*platforms.Mpr^2 + platforms.Mph^2), ...
1/2 * platforms.Mpm * platforms.Mpr^2]);
stewart.platforms = platforms; stewart.platform_F.I = I_F;
stewart.platform_F.M = args.Fpm;
stewart.platform_F.R = args.Fpr;
stewart.platform_F.H = args.Fph;
stewart.platform_M.type = 1;
stewart.platform_M.I = I_M;
stewart.platform_M.M = args.Mpm;
stewart.platform_M.R = args.Mpr;
stewart.platform_M.H = args.Mph;

View File

@ -14,15 +14,16 @@ function [stewart] = initializeCylindricalStruts(stewart, args)
% %
% Outputs: % Outputs:
% - stewart - updated Stewart structure with the added fields: % - stewart - updated Stewart structure with the added fields:
% - struts [struct] - structure with the following fields: % - struts_F [struct] - structure with the following fields:
% - Fsm [6x1] - Mass of the Fixed part of the struts [kg] % - M [6x1] - Mass of the Fixed part of the struts [kg]
% - Fsi [3x3x6] - Moment of Inertia for the Fixed part of the struts [kg*m^2] % - I [3x3x6] - Moment of Inertia for the Fixed part of the struts [kg*m^2]
% - Msm [6x1] - Mass of the Mobile part of the struts [kg] % - H [6x1] - Height of cylinder for the Fixed part of the struts [m]
% - Msi [3x3x6] - Moment of Inertia for the Mobile part of the struts [kg*m^2] % - R [6x1] - Radius of cylinder for the Fixed part of the struts [m]
% - Fsh [6x1] - Height of cylinder for the Fixed part of the struts [m] % - struts_M [struct] - structure with the following fields:
% - Fsr [6x1] - Radius of cylinder for the Fixed part of the struts [m] % - M [6x1] - Mass of the Mobile part of the struts [kg]
% - Msh [6x1] - Height of cylinder for the Mobile part of the struts [m] % - I [3x3x6] - Moment of Inertia for the Mobile part of the struts [kg*m^2]
% - Msr [6x1] - Radius of cylinder for the Mobile part of the struts [m] % - H [6x1] - Height of cylinder for the Mobile part of the struts [m]
% - R [6x1] - Radius of cylinder for the Mobile part of the struts [m]
arguments arguments
stewart stewart
@ -34,25 +35,37 @@ arguments
args.Msr (1,1) double {mustBeNumeric, mustBePositive} = 5e-3 args.Msr (1,1) double {mustBeNumeric, mustBePositive} = 5e-3
end end
struts = struct(); Fsm = ones(6,1).*args.Fsm;
Fsh = ones(6,1).*args.Fsh;
Fsr = ones(6,1).*args.Fsr;
struts.Fsm = ones(6,1).*args.Fsm; Msm = ones(6,1).*args.Msm;
struts.Msm = ones(6,1).*args.Msm; Msh = ones(6,1).*args.Msh;
Msr = ones(6,1).*args.Msr;
struts.Fsh = ones(6,1).*args.Fsh; I_F = zeros(3, 3, 6); % Inertia of the "fixed" part of the strut
struts.Fsr = ones(6,1).*args.Fsr; I_M = zeros(3, 3, 6); % Inertia of the "mobile" part of the strut
struts.Msh = ones(6,1).*args.Msh;
struts.Msr = ones(6,1).*args.Msr;
struts.Fsi = zeros(3, 3, 6);
struts.Msi = zeros(3, 3, 6);
for i = 1:6 for i = 1:6
struts.Fsi(:,:,i) = diag([1/12 * struts.Fsm(i) * (3*struts.Fsr(i)^2 + struts.Fsh(i)^2), ... I_F(:,:,i) = diag([1/12 * Fsm(i) * (3*Fsr(i)^2 + Fsh(i)^2), ...
1/12 * struts.Fsm(i) * (3*struts.Fsr(i)^2 + struts.Fsh(i)^2), ... 1/12 * Fsm(i) * (3*Fsr(i)^2 + Fsh(i)^2), ...
1/2 * struts.Fsm(i) * struts.Fsr(i)^2]); 1/2 * Fsm(i) * Fsr(i)^2]);
struts.Msi(:,:,i) = diag([1/12 * struts.Msm(i) * (3*struts.Msr(i)^2 + struts.Msh(i)^2), ...
1/12 * struts.Msm(i) * (3*struts.Msr(i)^2 + struts.Msh(i)^2), ... I_M(:,:,i) = diag([1/12 * Msm(i) * (3*Msr(i)^2 + Msh(i)^2), ...
1/2 * struts.Msm(i) * struts.Msr(i)^2]); 1/12 * Msm(i) * (3*Msr(i)^2 + Msh(i)^2), ...
1/2 * Msm(i) * Msr(i)^2]);
end end
stewart.struts = struts; stewart.struts_M.type = 1;
stewart.struts_M.I = I_M;
stewart.struts_M.M = Msm;
stewart.struts_M.R = Msr;
stewart.struts_M.H = Msh;
stewart.struts_F.type = 1;
stewart.struts_F.I = I_F;
stewart.struts_F.M = Fsm;
stewart.struts_F.R = Fsr;
stewart.struts_F.H = Fsh;

View File

@ -1,4 +1,4 @@
function [stewart] = initializeFramesPositions(args) function [stewart] = initializeFramesPositions(stewart, args)
% initializeFramesPositions - Initialize the positions of frames {A}, {B}, {F} and {M} % initializeFramesPositions - Initialize the positions of frames {A}, {B}, {F} and {M}
% %
% Syntax: [stewart] = initializeFramesPositions(args) % Syntax: [stewart] = initializeFramesPositions(args)
@ -10,22 +10,26 @@ function [stewart] = initializeFramesPositions(args)
% %
% Outputs: % Outputs:
% - stewart - A structure with the following fields: % - stewart - A structure with the following fields:
% - H [1x1] - Total Height of the Stewart Platform [m] % - geometry.H [1x1] - Total Height of the Stewart Platform [m]
% - FO_M [3x1] - Position of {M} with respect to {F} [m] % - geometry.FO_M [3x1] - Position of {M} with respect to {F} [m]
% - MO_B [3x1] - Position of {B} with respect to {M} [m] % - platform_M.MO_B [3x1] - Position of {B} with respect to {M} [m]
% - FO_A [3x1] - Position of {A} with respect to {F} [m] % - platform_F.FO_A [3x1] - Position of {A} with respect to {F} [m]
arguments arguments
stewart
args.H (1,1) double {mustBeNumeric, mustBePositive} = 90e-3 args.H (1,1) double {mustBeNumeric, mustBePositive} = 90e-3
args.MO_B (1,1) double {mustBeNumeric} = 50e-3 args.MO_B (1,1) double {mustBeNumeric} = 50e-3
end end
stewart = struct(); H = args.H; % Total Height of the Stewart Platform [m]
stewart.H = args.H; % Total Height of the Stewart Platform [m] FO_M = [0; 0; H]; % Position of {M} with respect to {F} [m]
stewart.FO_M = [0; 0; stewart.H]; % Position of {M} with respect to {F} [m] MO_B = [0; 0; args.MO_B]; % Position of {B} with respect to {M} [m]
stewart.MO_B = [0; 0; args.MO_B]; % Position of {B} with respect to {M} [m] FO_A = MO_B + FO_M; % Position of {A} with respect to {F} [m]
stewart.FO_A = stewart.MO_B + stewart.FO_M; % Position of {A} with respect to {F} [m] stewart.geometry.H = H;
stewart.geometry.FO_M = FO_M;
stewart.platform_M.MO_B = MO_B;
stewart.platform_F.FO_A = FO_A;

View File

@ -0,0 +1,48 @@
function [stewart] = initializeInertialSensor(stewart, args)
% initializeInertialSensor - Initialize the inertial sensor in each strut
%
% Syntax: [stewart] = initializeInertialSensor(args)
%
% Inputs:
% - args - Structure with the following fields:
% - type - 'geophone', 'accelerometer', 'none'
% - mass [1x1] - Weight of the inertial mass [kg]
% - freq [1x1] - Cutoff frequency [Hz]
%
% Outputs:
% - stewart - updated Stewart structure with the added fields:
% - stewart.sensors.inertial
% - type - 1 (geophone), 2 (accelerometer), 3 (none)
% - K [1x1] - Stiffness [N/m]
% - C [1x1] - Damping [N/(m/s)]
% - M [1x1] - Inertial Mass [kg]
% - G [1x1] - Gain
arguments
stewart
args.type char {mustBeMember(args.type,{'geophone', 'accelerometer', 'none'})} = 'none'
args.mass (1,1) double {mustBeNumeric, mustBeNonnegative} = 1e-2
args.freq (1,1) double {mustBeNumeric, mustBeNonnegative} = 1e3
end
sensor = struct();
switch args.type
case 'geophone'
sensor.type = 1;
sensor.M = args.mass;
sensor.K = sensor.M * (2*pi*args.freq)^2;
sensor.C = 2*sqrt(sensor.M * sensor.K);
case 'accelerometer'
sensor.type = 2;
sensor.M = args.mass;
sensor.K = sensor.M * (2*pi*args.freq)^2;
sensor.C = 2*sqrt(sensor.M * sensor.K);
sensor.G = -sensor.K/sensor.M;
case 'none'
sensor.type = 3;
end
stewart.sensors.inertial = sensor;

View File

@ -5,46 +5,88 @@ function [stewart] = initializeJointDynamics(stewart, args)
% %
% Inputs: % Inputs:
% - args - Structure with the following fields: % - args - Structure with the following fields:
% - Ksbi [6x1] - Bending (Rx, Ry) Stiffness for each top Spherical joints [(N.m)/rad] % - type_F - 'universal', 'spherical', 'univesal_p', 'spherical_p'
% - Csbi [6x1] - Bending (Rx, Ry) Damping of each top Spherical joint [(N.m)/(rad/s)] % - type_M - 'universal', 'spherical', 'univesal_p', 'spherical_p'
% - Ksti [6x1] - Torsion (Rz) Stiffness for each top Spherical joints [(N.m)/rad] % - Kf_M [6x1] - Bending (Rx, Ry) Stiffness for each top joints [(N.m)/rad]
% - Csti [6x1] - Torsion (Rz) Damping of each top Spherical joint [(N.m)/(rad/s)] % - Kt_M [6x1] - Torsion (Rz) Stiffness for each top joints [(N.m)/rad]
% - Kubi [6x1] - Bending (Rx, Ry) Stiffness for each bottom Universal joints [(N.m)/rad] % - Cf_M [6x1] - Bending (Rx, Ry) Damping of each top joint [(N.m)/(rad/s)]
% - Cubi [6x1] - Bending (Rx, Ry) Damping of each bottom Universal joint [(N.m)/(rad/s)] % - Ct_M [6x1] - Torsion (Rz) Damping of each top joint [(N.m)/(rad/s)]
% - disable [boolean] - Sets all the stiffness/damping to zero % - Kf_F [6x1] - Bending (Rx, Ry) Stiffness for each bottom joints [(N.m)/rad]
% - Kt_F [6x1] - Torsion (Rz) Stiffness for each bottom joints [(N.m)/rad]
% - Cf_F [6x1] - Bending (Rx, Ry) Damping of each bottom joint [(N.m)/(rad/s)]
% - Cf_F [6x1] - Torsion (Rz) Damping of each bottom joint [(N.m)/(rad/s)]
% %
% Outputs: % Outputs:
% - stewart - updated Stewart structure with the added fields: % - stewart - updated Stewart structure with the added fields:
% - Ksbi [6x1] - Bending (Rx, Ry) Stiffness for each top Spherical joints [(N.m)/rad] % - stewart.joints_F and stewart.joints_M:
% - Csbi [6x1] - Bending (Rx, Ry) Damping of each top Spherical joint [(N.m)/(rad/s)] % - type - 1 (universal), 2 (spherical), 3 (universal perfect), 4 (spherical perfect)
% - Ksti [6x1] - Torsion (Rz) Stiffness for each top Spherical joints [(N.m)/rad] % - Kx, Ky, Kz [6x1] - Translation (Tx, Ty, Tz) Stiffness [N/m]
% - Csti [6x1] - Torsion (Rz) Damping of each top Spherical joint [(N.m)/(rad/s)] % - Kf [6x1] - Flexion (Rx, Ry) Stiffness [(N.m)/rad]
% - Kubi [6x1] - Bending (Rx, Ry) Stiffness for each bottom Universal joints [(N.m)/rad] % - Kt [6x1] - Torsion (Rz) Stiffness [(N.m)/rad]
% - Cubi [6x1] - Bending (Rx, Ry) Damping of each bottom Universal joint [(N.m)/(rad/s)] % - Cx, Cy, Cz [6x1] - Translation (Rx, Ry) Damping [N/(m/s)]
% - Cf [6x1] - Flexion (Rx, Ry) Damping [(N.m)/(rad/s)]
% - Cb [6x1] - Torsion (Rz) Damping [(N.m)/(rad/s)]
arguments arguments
stewart stewart
args.Ksbi (6,1) double {mustBeNumeric, mustBeNonnegative} = 15*ones(6,1) args.type_F char {mustBeMember(args.type_F,{'universal', 'spherical', 'univesal_p', 'spherical_p'})} = 'universal'
args.Csbi (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e-4*ones(6,1) args.type_M char {mustBeMember(args.type_M,{'universal', 'spherical', 'univesal_p', 'spherical_p'})} = 'spherical'
args.Ksti (6,1) double {mustBeNumeric, mustBeNonnegative} = 20*ones(6,1) args.Kf_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 15*ones(6,1)
args.Csti (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e-3*ones(6,1) args.Cf_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e-4*ones(6,1)
args.Kubi (6,1) double {mustBeNumeric, mustBeNonnegative} = 15*ones(6,1) args.Kt_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 20*ones(6,1)
args.Cubi (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e-4*ones(6,1) args.Ct_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e-3*ones(6,1)
args.disable logical {mustBeNumericOrLogical} = false args.Kf_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 15*ones(6,1)
args.Cf_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e-4*ones(6,1)
args.Kt_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 20*ones(6,1)
args.Ct_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e-3*ones(6,1)
end end
if args.disable switch args.type_F
stewart.Ksbi = zeros(6,1); case 'universal'
stewart.Csbi = zeros(6,1); stewart.joints_F.type = 1;
stewart.Ksti = zeros(6,1); case 'spherical'
stewart.Csti = zeros(6,1); stewart.joints_F.type = 2;
stewart.Kubi = zeros(6,1); case 'universal_p'
stewart.Cubi = zeros(6,1); stewart.joints_F.type = 3;
else case 'spherical_p'
stewart.Ksbi = args.Ksbi; stewart.joints_F.type = 4;
stewart.Csbi = args.Csbi;
stewart.Ksti = args.Ksti;
stewart.Csti = args.Csti;
stewart.Kubi = args.Kubi;
stewart.Cubi = args.Cubi;
end end
switch args.type_M
case 'universal'
stewart.joints_M.type = 1;
case 'spherical'
stewart.joints_M.type = 2;
case 'universal_p'
stewart.joints_M.type = 3;
case 'spherical_p'
stewart.joints_M.type = 4;
end
stewart.joints_M.Kx = zeros(6,1);
stewart.joints_M.Ky = zeros(6,1);
stewart.joints_M.Kz = zeros(6,1);
stewart.joints_F.Kx = zeros(6,1);
stewart.joints_F.Ky = zeros(6,1);
stewart.joints_F.Kz = zeros(6,1);
stewart.joints_M.Cx = zeros(6,1);
stewart.joints_M.Cy = zeros(6,1);
stewart.joints_M.Cz = zeros(6,1);
stewart.joints_F.Cx = zeros(6,1);
stewart.joints_F.Cy = zeros(6,1);
stewart.joints_F.Cz = zeros(6,1);
stewart.joints_M.Kf = args.Kf_M;
stewart.joints_M.Kt = args.Kf_M;
stewart.joints_F.Kf = args.Kf_F;
stewart.joints_F.Kt = args.Kf_F;
stewart.joints_M.Cf = args.Cf_M;
stewart.joints_M.Ct = args.Cf_M;
stewart.joints_F.Cf = args.Cf_F;
stewart.joints_F.Ct = args.Cf_F;

View File

@ -0,0 +1,31 @@
function [stewart] = initializeStewartPlatform()
% initializeStewartPlatform - Initialize the stewart structure
%
% Syntax: [stewart] = initializeStewartPlatform(args)
%
% Outputs:
% - stewart - A structure with the following sub-structures:
% - platform_F -
% - platform_M -
% - joints_F -
% - joints_M -
% - struts_F -
% - struts_M -
% - actuators -
% - geometry -
% - properties -
stewart = struct();
stewart.platform_F = struct();
stewart.platform_M = struct();
stewart.joints_F = struct();
stewart.joints_M = struct();
stewart.struts_F = struct();
stewart.struts_M = struct();
stewart.actuators = struct();
stewart.sensors = struct();
stewart.sensors.inertial = struct();
stewart.sensors.force = struct();
stewart.sensors.relative = struct();
stewart.geometry = struct();
stewart.kinematics = struct();

View File

@ -14,7 +14,7 @@ function [stewart] = initializeStewartPose(stewart, args)
% %
% Outputs: % Outputs:
% - stewart - updated Stewart structure with the added fields: % - stewart - updated Stewart structure with the added fields:
% - dLi[6x1] - The 6 needed displacement of the struts from the initial position in [m] to have the wanted pose of {B} w.r.t. {A} % - actuators.Leq [6x1] - The 6 needed displacement of the struts from the initial position in [m] to have the wanted pose of {B} w.r.t. {A}
arguments arguments
stewart stewart
@ -24,4 +24,4 @@ end
[Li, dLi] = inverseKinematics(stewart, 'AP', args.AP, 'ARB', args.ARB); [Li, dLi] = inverseKinematics(stewart, 'AP', args.AP, 'ARB', args.ARB);
stewart.dLi = dLi; stewart.actuators.Leq = dLi;

View File

@ -5,21 +5,22 @@ function [stewart] = initializeStrutDynamics(stewart, args)
% %
% Inputs: % Inputs:
% - args - Structure with the following fields: % - args - Structure with the following fields:
% - Ki [6x1] - Stiffness of each strut [N/m] % - K [6x1] - Stiffness of each strut [N/m]
% - Ci [6x1] - Damping of each strut [N/(m/s)] % - C [6x1] - Damping of each strut [N/(m/s)]
% %
% Outputs: % Outputs:
% - stewart - updated Stewart structure with the added fields: % - stewart - updated Stewart structure with the added fields:
% - Ki [6x1] - Stiffness of each strut [N/m] % - actuators.type = 1
% - Ci [6x1] - Damping of each strut [N/(m/s)] % - actuators.K [6x1] - Stiffness of each strut [N/m]
% - actuators.C [6x1] - Damping of each strut [N/(m/s)]
arguments arguments
stewart stewart
args.Ki (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e6*ones(6,1) args.K (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e6*ones(6,1)
args.Ci (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e1*ones(6,1) args.C (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e1*ones(6,1)
end end
stewart.Ki = args.Ki; stewart.actuators.type = 1;
stewart.Ci = args.Ci;
stewart.actuator_type = 1; stewart.actuators.K = args.K;
stewart.actuators.C = args.C;

View File

@ -5,8 +5,9 @@ function [Li, dLi] = inverseKinematics(stewart, args)
% %
% Inputs: % Inputs:
% - stewart - A structure with the following fields % - stewart - A structure with the following fields
% - Aa [3x6] - The positions ai expressed in {A} % - geometry.Aa [3x6] - The positions ai expressed in {A}
% - Bb [3x6] - The positions bi expressed in {B} % - geometry.Bb [3x6] - The positions bi expressed in {B}
% - geometry.l [6x1] - Length of each strut
% - args - Can have the following fields: % - args - Can have the following fields:
% - AP [3x1] - The wanted position of {B} with respect to {A} % - AP [3x1] - The wanted position of {B} with respect to {A}
% - ARB [3x3] - The rotation matrix that gives the wanted orientation of {B} with respect to {A} % - ARB [3x3] - The rotation matrix that gives the wanted orientation of {B} with respect to {A}
@ -21,6 +22,15 @@ arguments
args.ARB (3,3) double {mustBeNumeric} = eye(3) args.ARB (3,3) double {mustBeNumeric} = eye(3)
end end
Li = sqrt(args.AP'*args.AP + diag(stewart.Bb'*stewart.Bb) + diag(stewart.Aa'*stewart.Aa) - (2*args.AP'*stewart.Aa)' + (2*args.AP'*(args.ARB*stewart.Bb))' - diag(2*(args.ARB*stewart.Bb)'*stewart.Aa)); assert(isfield(stewart.geometry, 'Aa'), 'stewart.geometry should have attribute Aa')
Aa = stewart.geometry.Aa;
dLi = Li-stewart.l; assert(isfield(stewart.geometry, 'Bb'), 'stewart.geometry should have attribute Bb')
Bb = stewart.geometry.Bb;
assert(isfield(stewart.geometry, 'l'), 'stewart.geometry should have attribute l')
l = stewart.geometry.l;
Li = sqrt(args.AP'*args.AP + diag(Bb'*Bb) + diag(Aa'*Aa) - (2*args.AP'*Aa)' + (2*args.AP'*(args.ARB*Bb))' - diag(2*(args.ARB*Bb)'*Aa));
dLi = Li-l;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff