stewart-simscape/docs/stewart-architecture.html

2735 lines
94 KiB
HTML

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2020-09-01 mar. 13:18 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Stewart Platform - Definition of the Architecture</title>
<meta name="generator" content="Org mode" />
<meta name="author" content="Dehaeze Thomas" />
<link rel="stylesheet" type="text/css" href="./css/htmlize.css"/>
<link rel="stylesheet" type="text/css" href="./css/readtheorg.css"/>
<script src="./js/jquery.min.js"></script>
<script src="./js/bootstrap.min.js"></script>
<script src="./js/jquery.stickytableheaders.min.js"></script>
<script src="./js/readtheorg.js"></script>
<script>MathJax = {
tex: {
tags: 'ams',
macros: {bm: ["\\boldsymbol{#1}",1],}
}
};
</script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
</head>
<body>
<div id="org-div-home-and-up">
<a accesskey="h" href="./index.html"> UP </a>
|
<a accesskey="H" href="./index.html"> HOME </a>
</div><div id="content">
<h1 class="title">Stewart Platform - Definition of the Architecture</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org8d01b94">1. Definition of the Stewart Platform Geometry</a>
<ul>
<li><a href="#org8fe4e0e">1.1. Frames Definition</a></li>
<li><a href="#org1fc986a">1.2. Location of the Spherical Joints</a></li>
<li><a href="#org6a51c7d">1.3. Length and orientation of the struts</a></li>
<li><a href="#org9261b10">1.4. Rest Position of the Stewart platform</a></li>
</ul>
</li>
<li><a href="#orgbce93f2">2. Definition of the Inertia and geometry of the Fixed base, Mobile platform and Struts</a>
<ul>
<li><a href="#orgd783c33">2.1. Inertia and Geometry of the Fixed and Mobile platforms</a></li>
<li><a href="#org126d465">2.2. Inertia and Geometry of the struts</a></li>
</ul>
</li>
<li><a href="#orgd7fb840">3. Definition of the stiffness and damping of the joints</a>
<ul>
<li><a href="#orgdb7ce43">3.1. Stiffness and Damping of the Actuator</a></li>
<li><a href="#orgd5629d6">3.2. Stiffness and Damping of the Spherical Joints</a></li>
</ul>
</li>
<li><a href="#org6d2c540">4. Summary of the Initialization Procedure and Matlab Example</a>
<ul>
<li><a href="#org715f118">4.1. Example of the initialization of a Stewart Platform</a></li>
</ul>
</li>
<li><a href="#org48340b4">5. Functions</a>
<ul>
<li><a href="#orgd89f0e1">5.1. <code>initializeStewartPlatform</code>: Initialize the Stewart Platform structure</a>
<ul>
<li><a href="#orgb291f1f">Documentation</a></li>
<li><a href="#orgcf374f3">Function description</a></li>
<li><a href="#orgd567fc1">Initialize the Stewart structure</a></li>
</ul>
</li>
<li><a href="#orgb11894c">5.2. <code>initializeFramesPositions</code>: Initialize the positions of frames {A}, {B}, {F} and {M}</a>
<ul>
<li><a href="#org4135d2d">Documentation</a></li>
<li><a href="#org66f1ebb">Function description</a></li>
<li><a href="#orgd50a826">Optional Parameters</a></li>
<li><a href="#org458592e">Compute the position of each frame</a></li>
<li><a href="#org51c0261">Populate the <code>stewart</code> structure</a></li>
</ul>
</li>
<li><a href="#org9057387">5.3. <code>generateGeneralConfiguration</code>: Generate a Very General Configuration</a>
<ul>
<li><a href="#org967b04c">Documentation</a></li>
<li><a href="#orge721b0e">Function description</a></li>
<li><a href="#orgfe31977">Optional Parameters</a></li>
<li><a href="#org232e4c2">Compute the pose</a></li>
<li><a href="#org7ee3958">Populate the <code>stewart</code> structure</a></li>
</ul>
</li>
<li><a href="#org861f6de">5.4. <code>computeJointsPose</code>: Compute the Pose of the Joints</a>
<ul>
<li><a href="#orgc1c4d18">Documentation</a></li>
<li><a href="#orgc7c8a40">Function description</a></li>
<li><a href="#orga2673d1">Optional Parameters</a></li>
<li><a href="#org772540a">Check the <code>stewart</code> structure elements</a></li>
<li><a href="#org52b0d4c">Compute the position of the Joints</a></li>
<li><a href="#org4b76b0f">Compute the strut length and orientation</a></li>
<li><a href="#orgd621d5e">Compute the orientation of the Joints</a></li>
<li><a href="#org0e8aa0a">Populate the <code>stewart</code> structure</a></li>
</ul>
</li>
<li><a href="#org329bef9">5.5. <code>initializeStewartPose</code>: Determine the initial stroke in each leg to have the wanted pose</a>
<ul>
<li><a href="#org609919f">Function description</a></li>
<li><a href="#orgb26889a">Optional Parameters</a></li>
<li><a href="#org3d3ef62">Use the Inverse Kinematic function</a></li>
<li><a href="#org8df3429">Populate the <code>stewart</code> structure</a></li>
</ul>
</li>
<li><a href="#org6ff5b31">5.6. <code>initializeCylindricalPlatforms</code>: Initialize the geometry of the Fixed and Mobile Platforms</a>
<ul>
<li><a href="#orgcffde44">Function description</a></li>
<li><a href="#org017553c">Optional Parameters</a></li>
<li><a href="#org25a390a">Compute the Inertia matrices of platforms</a></li>
<li><a href="#org943c8fa">Populate the <code>stewart</code> structure</a></li>
</ul>
</li>
<li><a href="#org60aa215">5.7. <code>initializeCylindricalStruts</code>: Define the inertia of cylindrical struts</a>
<ul>
<li><a href="#org4d297c7">Function description</a></li>
<li><a href="#org2a5dca5">Optional Parameters</a></li>
<li><a href="#orgc056498">Compute the properties of the cylindrical struts</a></li>
<li><a href="#orge3443c7">Populate the <code>stewart</code> structure</a></li>
</ul>
</li>
<li><a href="#org3ad0cd1">5.8. <code>initializeStrutDynamics</code>: Add Stiffness and Damping properties of each strut</a>
<ul>
<li><a href="#orgd6ed57c">Documentation</a></li>
<li><a href="#orgab544d8">Function description</a></li>
<li><a href="#org972382f">Optional Parameters</a></li>
<li><a href="#orgadb8327">Add Stiffness and Damping properties of each strut</a></li>
</ul>
</li>
<li><a href="#orgd8d403e">5.9. <code>initializeAmplifiedStrutDynamics</code>: Add Stiffness and Damping properties of each strut for an amplified piezoelectric actuator</a>
<ul>
<li><a href="#org4003bdd">Documentation</a></li>
<li><a href="#org4439879">Function description</a></li>
<li><a href="#org2078010">Optional Parameters</a></li>
<li><a href="#org9b435e8">Compute the total stiffness and damping</a></li>
<li><a href="#org072dfc3">Populate the <code>stewart</code> structure</a></li>
</ul>
</li>
<li><a href="#org65c17b2">5.10. <code>initializeFlexibleStrutDynamics</code>: Model each strut with a flexible element</a>
<ul>
<li><a href="#orgf23e693">Function description</a></li>
<li><a href="#org72115e7">Optional Parameters</a></li>
<li><a href="#orge6e22da">Compute the axial offset</a></li>
<li><a href="#org70de463">Populate the <code>stewart</code> structure</a></li>
</ul>
</li>
<li><a href="#orgeb6173a">5.11. <code>initializeJointDynamics</code>: Add Stiffness and Damping properties for spherical joints</a>
<ul>
<li><a href="#orgf0f39ef">Function description</a></li>
<li><a href="#org8d19d2d">Optional Parameters</a></li>
<li><a href="#orgc6d4183">Add Actuator Type</a></li>
<li><a href="#orgc0e613c">Add Stiffness and Damping in Translation of each strut</a></li>
<li><a href="#org04698fc">Add Stiffness and Damping in Rotation of each strut</a></li>
<li><a href="#org6cc5773">Stiffness and Mass matrices for flexible joint</a></li>
</ul>
</li>
<li><a href="#orgea07e0e">5.12. <code>initializeInertialSensor</code>: Initialize the inertial sensor in each strut</a>
<ul>
<li><a href="#orgd667bbb">Geophone - Working Principle</a></li>
<li><a href="#orgca7729f">Accelerometer - Working Principle</a></li>
<li><a href="#orgc4ffbf6">Function description</a></li>
<li><a href="#org6b45828">Optional Parameters</a></li>
<li><a href="#org463075d">Compute the properties of the sensor</a></li>
<li><a href="#orga292b49">Populate the <code>stewart</code> structure</a></li>
</ul>
</li>
<li><a href="#org5266e9d">5.13. <code>displayArchitecture</code>: 3D plot of the Stewart platform architecture</a>
<ul>
<li><a href="#org1619f14">Function description</a></li>
<li><a href="#orgf9184d1">Optional Parameters</a></li>
<li><a href="#org441ed7f">Check the <code>stewart</code> structure elements</a></li>
<li><a href="#orgc088b18">Figure Creation, Frames and Homogeneous transformations</a></li>
<li><a href="#orgc25a979">Fixed Base elements</a></li>
<li><a href="#org8417772">Mobile Platform elements</a></li>
<li><a href="#org5f40b79">Legs</a></li>
<li><a href="#org81be27b">5.13.1. Figure parameters</a></li>
<li><a href="#orgf41db0f">5.13.2. Subplots</a></li>
</ul>
</li>
<li><a href="#org3db8668">5.14. <code>describeStewartPlatform</code>: Display some text describing the current defined Stewart Platform</a>
<ul>
<li><a href="#org93d2ee5">Function description</a></li>
<li><a href="#org4587f8f">Optional Parameters</a></li>
<li><a href="#org0ad0d00">5.14.1. Geometry</a></li>
<li><a href="#org3d00e31">5.14.2. Actuators</a></li>
<li><a href="#org0933fe4">5.14.3. Joints</a></li>
<li><a href="#org7f9d11e">5.14.4. Kinematics</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<p>
In this document is explained how the Stewart Platform architecture is defined.
</p>
<p>
Some efforts has been made such that the procedure for the definition of the Stewart Platform architecture is as logical and clear as possible.
</p>
<p>
When possible, the notations are compatible with the one used in (<a href="#citeproc_bib_item_1">Taghirad 2013</a>).
</p>
<p>
The definition of the Stewart platform is done in three main parts:
</p>
<ul class="org-ul">
<li>First, the geometry if defined (Section <a href="#orga5e83f9">1</a>)</li>
<li>Then, the inertia of the mechanical elements are defined (Section <a href="#orga326389">2</a>)</li>
<li>Finally, the Stiffness and Damping characteristics of the elements are defined (Section <a href="#org96459ea">3</a>)</li>
</ul>
<p>
In section <a href="#orgaede9ee">4</a>, the procedure the initialize the Stewart platform is summarize and the associated Matlab code is shown.
</p>
<p>
Finally, all the Matlab function used to initialize the Stewart platform are described in section <a href="#orgac086c4">5</a>.
</p>
<div id="outline-container-org8d01b94" class="outline-2">
<h2 id="org8d01b94"><span class="section-number-2">1</span> Definition of the Stewart Platform Geometry</h2>
<div class="outline-text-2" id="text-1">
<p>
<a id="orga5e83f9"></a>
</p>
<p>
Stewart platforms are generated in multiple steps:
</p>
<ul class="org-ul">
<li>Definition of the frames</li>
<li>Definition of the location of the joints</li>
<li>Computation of the length and orientation of the struts</li>
<li>Choice of the rest position of the mobile platform</li>
</ul>
<p>
This steps are detailed below.
</p>
</div>
<div id="outline-container-org8fe4e0e" class="outline-3">
<h3 id="org8fe4e0e"><span class="section-number-3">1.1</span> Frames Definition</h3>
<div class="outline-text-3" id="text-1-1">
<p>
We define 4 important <b>frames</b> (see Figure <a href="#org9940a8f">1</a>):
</p>
<ul class="org-ul">
<li>\(\{F\}\): Frame fixed to the <b>Fixed</b> base and located at the center of its bottom surface.
This is used to fix the Stewart platform to some support.</li>
<li>\(\{M\}\): Frame fixed to the <b>Moving</b> platform and located at the center of its top surface.
This is used to place things on top of the Stewart platform.</li>
<li>\(\{A\}\): Frame fixed to the fixed base.</li>
<li>\(\{B\}\): Frame fixed to the moving platform.</li>
</ul>
<p>
Even though frames \(\{A\}\) and \(\{B\}\) don&rsquo;t usually correspond to physical elements, they are of primary importance.
Firstly, they are used for the definition of the motion of the Mobile platform with respect to the fixed frame:
</p>
<ul class="org-ul">
<li>In position: \({}^A\bm{P}_{B}\) (read: Position of frame \(\{B\}\) expressed in frame \(\{A\}\))</li>
<li>In rotation: \({}^A\bm{R}_{B}\) (read: The rotation matrix that express the orientation of frame \(\{B\}\) expressed in frame \(\{A\}\))</li>
</ul>
<p>
The frames \(\{A\}\) and \(\{B\}\) are used for all the kinematic analysis (Jacobian, Stiffness matrix, &#x2026;).
</p>
<p>
Typical choice of \(\{A\}\) and \(\{B\}\) are:
</p>
<ul class="org-ul">
<li>Center of mass of the payload</li>
<li>Location where external forces are applied to the mobile platform (for instance when the mobile platform is in contact with a stiff environment)</li>
<li>Center of the cube for the cubic configuration</li>
</ul>
<p>
The definition of the frames is done with the <code>initializeFramesPositions</code> function (<a href="#org3009bf2">link</a>);
</p>
<div id="org9940a8f" class="figure">
<p><img src="figs/frame_definition.png" alt="frame_definition.png" width="500px" />
</p>
<p><span class="figure-number">Figure 1: </span>Definition of the Frames for the Stewart Platform</p>
</div>
</div>
</div>
<div id="outline-container-org1fc986a" class="outline-3">
<h3 id="org1fc986a"><span class="section-number-3">1.2</span> Location of the Spherical Joints</h3>
<div class="outline-text-3" id="text-1-2">
<p>
Then, we define the <b>location of the spherical joints</b> (see Figure <a href="#org5a59399">2</a>):
</p>
<ul class="org-ul">
<li>\(\bm{a}_{i}\) are the position of the spherical joints fixed to the fixed base</li>
<li>\(\bm{b}_{i}\) are the position of the spherical joints fixed to the moving platform</li>
</ul>
<p>
The location of the joints will define the Geometry of the Stewart platform.
Many characteristics of the platform depend on the location of the joints.
</p>
<p>
The location of the joints can be set to arbitrary positions or it can be computed to obtain specific configurations such as:
</p>
<ul class="org-ul">
<li>A cubic configuration: function <code>generateCubicConfiguration</code> (described in <a href="cubic-configuration.html">this</a> file)</li>
<li>A symmetrical configuration</li>
</ul>
<p>
A function (<code>generateGeneralConfiguration</code>) to set the position of the joints on a circle is described <a href="#org9f50820">here</a>.
</p>
<p>
The location of the spherical joints are then given by \({}^{F}\bm{a}_{i}\) and \({}^{M}\bm{b}_{i}\).
</p>
<div id="org5a59399" class="figure">
<p><img src="figs/joint_location.png" alt="joint_location.png" width="500px" />
</p>
<p><span class="figure-number">Figure 2: </span>Position of the Spherical/Universal joints for the Stewart Platform</p>
</div>
</div>
</div>
<div id="outline-container-org6a51c7d" class="outline-3">
<h3 id="org6a51c7d"><span class="section-number-3">1.3</span> Length and orientation of the struts</h3>
<div class="outline-text-3" id="text-1-3">
<p>
From the location of the joints (\({}^{F}\bm{a}_{i}\) and \({}^{M}\bm{b}_{i}\)), we compute the length \(l_i\) and orientation of each strut \(\hat{\bm{s}}_i\) (unit vector aligned with the strut).
The length and orientation of each strut is represented in figure <a href="#org145b8ab">3</a>.
</p>
<p>
This is done with the <code>computeJointsPose</code> function (<a href="#org7f34b08">link</a>).
</p>
<div id="org145b8ab" class="figure">
<p><img src="figs/length_orientation_struts.png" alt="length_orientation_struts.png" width="500px" />
</p>
<p><span class="figure-number">Figure 3: </span>Length \(l_i\) and orientation \(\hat{\bm{s}}_i\) of the Stewart platform struts</p>
</div>
</div>
</div>
<div id="outline-container-org9261b10" class="outline-3">
<h3 id="org9261b10"><span class="section-number-3">1.4</span> Rest Position of the Stewart platform</h3>
<div class="outline-text-3" id="text-1-4">
<p>
We may want to initialize the Stewart platform in some position and orientation that corresponds to its rest position.
</p>
<p>
To do so, we choose:
</p>
<ul class="org-ul">
<li>the position of \(\bm{O}_B\) expressed in \(\{A\}\) using \({}^A\bm{P}\)</li>
<li>the orientation of \(\{B\}\) expressed in \(\{A\}\) using a rotation matrix \({}^{A}\bm{R}_{B}\)</li>
</ul>
<p>
Then, the function <code>initializeStewartPose</code> (<a href="#orga94c6a9">link</a>) compute the corresponding initial and rest position of each of the strut.
</p>
</div>
</div>
</div>
<div id="outline-container-orgbce93f2" class="outline-2">
<h2 id="orgbce93f2"><span class="section-number-2">2</span> Definition of the Inertia and geometry of the Fixed base, Mobile platform and Struts</h2>
<div class="outline-text-2" id="text-2">
<p>
<a id="orga326389"></a>
</p>
<p>
Now that the geometry of the Stewart platform has been defined, we have to choose the inertia of:
</p>
<ul class="org-ul">
<li>The Fixed base</li>
<li>The Mobile platform</li>
<li>The two parts of the struts</li>
</ul>
<p>
The inertia of these elements will modify the dynamics of the systems.
It is thus important to set them properly.
</p>
</div>
<div id="outline-container-orgd783c33" class="outline-3">
<h3 id="orgd783c33"><span class="section-number-3">2.1</span> Inertia and Geometry of the Fixed and Mobile platforms</h3>
<div class="outline-text-3" id="text-2-1">
<p>
In order to set the inertia of the fixed and mobile platforms, we can use the following function that assume that both platforms are cylindrical:
</p>
<ul class="org-ul">
<li><code>initializeCylindricalPlatforms</code> (<a href="#org6ad7062">link</a>): by choosing the height, radius and mass of the platforms, it computes the inertia matrix that will be used for simulation</li>
</ul>
</div>
</div>
<div id="outline-container-org126d465" class="outline-3">
<h3 id="org126d465"><span class="section-number-3">2.2</span> Inertia and Geometry of the struts</h3>
<div class="outline-text-3" id="text-2-2">
<p>
Similarly for the struts, we suppose here that they have a cylindrical shape.
They are initialize with the following function:
</p>
<ul class="org-ul">
<li><code>initializeCylindricalStruts</code> (<a href="#org6263b6d">link</a>): the two parts of each strut are supposed to by cylindrical. We can set the mass and geometry of both strut parts.</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-orgd7fb840" class="outline-2">
<h2 id="orgd7fb840"><span class="section-number-2">3</span> Definition of the stiffness and damping of the joints</h2>
<div class="outline-text-2" id="text-3">
<p>
<a id="org96459ea"></a>
</p>
<p>
The global stiffness and damping of the Stewart platform depends on its geometry but also on the stiffness and damping of:
</p>
<ul class="org-ul">
<li>the actuator because of the finite stiffness of the actuator / linear guide</li>
<li>the spherical joints</li>
</ul>
</div>
<div id="outline-container-orgdb7ce43" class="outline-3">
<h3 id="orgdb7ce43"><span class="section-number-3">3.1</span> Stiffness and Damping of the Actuator</h3>
<div class="outline-text-3" id="text-3-1">
<p>
Each Actuator is modeled by 3 elements in parallel (Figure <a href="#orgf28da6c">4</a>):
</p>
<ul class="org-ul">
<li>A spring with a stiffness \(k_{i}\)</li>
<li>A dashpot with a damping \(c_{i}\)</li>
<li>An ideal force actuator generating a force \(\tau_i\)</li>
</ul>
<div id="orgf28da6c" class="figure">
<p><img src="figs/stewart_platform_actuator.png" alt="stewart_platform_actuator.png" />
</p>
<p><span class="figure-number">Figure 4: </span>Model of the Stewart platform actuator</p>
</div>
<p>
The initialization of the stiffness and damping properties of the actuators is done with the <code>initializeStrutDynamics</code> (<a href="#org7f8f2b7">link</a>).
</p>
</div>
</div>
<div id="outline-container-orgd5629d6" class="outline-3">
<h3 id="orgd5629d6"><span class="section-number-3">3.2</span> Stiffness and Damping of the Spherical Joints</h3>
<div class="outline-text-3" id="text-3-2">
<p>
Even though we often suppose that the spherical joint are perfect in the sense that we neglect its stiffness and damping, we can set some rotation stiffness and damping of each of the spherical/universal joints.
</p>
<p>
This is done with the <code>initializeJointDynamics</code> function (<a href="#org0d21456">link</a>).
</p>
</div>
</div>
</div>
<div id="outline-container-org6d2c540" class="outline-2">
<h2 id="org6d2c540"><span class="section-number-2">4</span> Summary of the Initialization Procedure and Matlab Example</h2>
<div class="outline-text-2" id="text-4">
<p>
<a id="orgaede9ee"></a>
</p>
<p>
The procedure to define the Stewart platform is the following:
</p>
<ol class="org-ol">
<li>Define the initial position of frames \(\{A\}\), \(\{B\}\), \(\{F\}\) and \(\{M\}\).
We do that using the <code>initializeFramesPositions</code> function.
We have to specify the total height of the Stewart platform \(H\) and the position \({}^{M}\bm{O}_{B}\) of \(\{B\}\) with respect to \(\{M\}\).</li>
<li>Compute the positions of joints \({}^{F}\bm{a}_{i}\) and \({}^{M}\bm{b}_{i}\).
We can do that using various methods depending on the wanted architecture:
<ul class="org-ul">
<li><code>generateCubicConfiguration</code> permits to generate a cubic configuration</li>
</ul></li>
<li>Compute the position and orientation of the joints with respect to the fixed base and the moving platform.
This is done with the <code>computeJointsPose</code> function.
If wanted, compute the rest position of each strut to have the wanted pose of the mobile platform with the function <code>initializeStewartPose</code>.</li>
<li>Define the mass and inertia of each element of the Stewart platform with the <code>initializeCylindricalPlatforms</code> and <code>initializeCylindricalStruts</code></li>
<li>Define the dynamical properties of the Stewart platform by setting the stiffness and damping of the actuators and joints.</li>
</ol>
<p>
By following this procedure, we obtain a Matlab structure <code>stewart</code> that contains all the information for the Simscape model and for further analysis.
</p>
</div>
<div id="outline-container-org715f118" class="outline-3">
<h3 id="org715f118"><span class="section-number-3">4.1</span> Example of the initialization of a Stewart Platform</h3>
<div class="outline-text-3" id="text-4-1">
<p>
Let&rsquo;s first define the Stewart Platform Geometry.
</p>
<div class="org-src-container">
<pre class="src src-matlab">stewart = initializeStewartPlatform();
stewart = initializeFramesPositions(stewart, 'H', 90e-3, 'MO_B', 45e-3);
stewart = generateGeneralConfiguration(stewart);
stewart = computeJointsPose(stewart);
stewart = initializeStewartPose(stewart, 'AP', [0;0;0], 'ARB', eye(3));
</pre>
</div>
<p>
Then, define the inertia and geometry of the fixed base, mobile platform and struts.
</p>
<div class="org-src-container">
<pre class="src src-matlab">stewart = initializeCylindricalPlatforms(stewart);
stewart = initializeCylindricalStruts(stewart);
</pre>
</div>
<p>
We initialize the strut stiffness and damping properties.
</p>
<div class="org-src-container">
<pre class="src src-matlab">stewart = initializeStrutDynamics(stewart, 'K', 1e6*ones(6,1), 'C', 1e2*ones(6,1));
stewart = initializeAmplifiedStrutDynamics(stewart);
stewart = initializeJointDynamics(stewart);
</pre>
</div>
<p>
And finally the inertial sensors included in each strut.
</p>
<div class="org-src-container">
<pre class="src src-matlab">stewart = initializeInertialSensor(stewart, 'type', 'none');
</pre>
</div>
<p>
The obtained <code>stewart</code> Matlab structure contains all the information for analysis of the Stewart platform and for simulations using Simscape.
</p>
<p>
The function <code>displayArchitecture</code> can be used to display the current Stewart configuration:
</p>
<div class="org-src-container">
<pre class="src src-matlab">displayArchitecture(stewart, 'views', 'all');
</pre>
</div>
<div id="org85ee757" class="figure">
<p><img src="figs/stewart_architecture_example.png" alt="stewart_architecture_example.png" />
</p>
<p><span class="figure-number">Figure 5: </span>Display of the current Stewart platform architecture (<a href="./figs/stewart_architecture_example.png">png</a>, <a href="./figs/stewart_architecture_example.pdf">pdf</a>)</p>
</div>
<p>
There are many options to show or hides elements such as labels and frames.
The documentation of the function is available <a href="#org5526211">here</a>.
</p>
<p>
Let&rsquo;s now move a little bit the top platform and re-display the configuration:
</p>
<div class="org-src-container">
<pre class="src src-matlab">tx = 0.1; % [rad]
ty = 0.2; % [rad]
tz = 0.05; % [rad]
Rx = [1 0 0;
0 cos(tx) -sin(tx);
0 sin(tx) cos(tx)];
Ry = [ cos(ty) 0 sin(ty);
0 1 0;
-sin(ty) 0 cos(ty)];
Rz = [cos(tz) -sin(tz) 0;
sin(tz) cos(tz) 0;
0 0 1];
ARB = Rz*Ry*Rx;
AP = [0.08; 0; 0]; % [m]
displayArchitecture(stewart, 'AP', AP, 'ARB', ARB);
view([0 -1 0]);
</pre>
</div>
<div id="orgfe6ca21" class="figure">
<p><img src="figs/stewart_architecture_example_pose.png" alt="stewart_architecture_example_pose.png" />
</p>
<p><span class="figure-number">Figure 6: </span>Display of the Stewart platform architecture at some defined pose (<a href="./figs/stewart_architecture_example_pose.png">png</a>, <a href="./figs/stewart_architecture_example_pose.pdf">pdf</a>)</p>
</div>
<p>
One can also use the <code>describeStewartPlatform</code> function to have a description of the current Stewart platform&rsquo;s state.
</p>
<pre class="example">
describeStewartPlatform(stewart)
GEOMETRY:
- The height between the fixed based and the top platform is 90 [mm].
- Frame {A} is located 45 [mm] above the top platform.
- The initial length of the struts are:
95.2, 95.2, 95.2, 95.2, 95.2, 95.2 [mm]
ACTUATORS:
- The actuators are mechanicaly amplified.
- The vertical stiffness and damping contribution of the piezoelectric stack is:
ka = 2e+07 [N/m] ca = 1e+01 [N/(m/s)]
- Vertical stiffness when the piezoelectric stack is removed is:
kr = 5e+06 [N/m] cr = 1e+01 [N/(m/s)]
JOINTS:
- The joints on the fixed based are universal joints
- The joints on the mobile based are spherical joints
- The position of the joints on the fixed based with respect to {F} are (in [mm]):
113 -20 15
113 20 15
-39.3 108 15
-73.9 88.1 15
-73.9 -88.1 15
-39.3 -108 15
- The position of the joints on the mobile based with respect to {M} are (in [mm]):
57.9 -68.9 -15
57.9 68.9 -15
30.8 84.6 -15
-88.6 15.6 -15
-88.6 -15.6 -15
30.8 -84.6 -15
KINEMATICS:
'org_babel_eoe'
ans =
'org_babel_eoe'
</pre>
</div>
</div>
</div>
<div id="outline-container-org48340b4" class="outline-2">
<h2 id="org48340b4"><span class="section-number-2">5</span> Functions</h2>
<div class="outline-text-2" id="text-5">
<p>
<a id="orgac086c4"></a>
</p>
</div>
<div id="outline-container-orgd89f0e1" class="outline-3">
<h3 id="orgd89f0e1"><span class="section-number-3">5.1</span> <code>initializeStewartPlatform</code>: Initialize the Stewart Platform structure</h3>
<div class="outline-text-3" id="text-5-1">
<p>
<a id="org2917f22"></a>
</p>
<p>
This Matlab function is accessible <a href="../src/initializeStewartPlatform.m">here</a>.
</p>
</div>
<div id="outline-container-orgb291f1f" class="outline-4">
<h4 id="orgb291f1f">Documentation</h4>
<div class="outline-text-4" id="text-orgb291f1f">
<div id="orgda43da5" class="figure">
<p><img src="figs/stewart-frames-position.png" alt="stewart-frames-position.png" />
</p>
<p><span class="figure-number">Figure 7: </span>Definition of the position of the frames</p>
</div>
</div>
</div>
<div id="outline-container-orgcf374f3" class="outline-4">
<h4 id="orgcf374f3">Function description</h4>
<div class="outline-text-4" id="text-orgcf374f3">
<div class="org-src-container">
<pre class="src src-matlab">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 -
</pre>
</div>
</div>
</div>
<div id="outline-container-orgd567fc1" class="outline-4">
<h4 id="orgd567fc1">Initialize the Stewart structure</h4>
<div class="outline-text-4" id="text-orgd567fc1">
<div class="org-src-container">
<pre class="src src-matlab">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();
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgb11894c" class="outline-3">
<h3 id="orgb11894c"><span class="section-number-3">5.2</span> <code>initializeFramesPositions</code>: Initialize the positions of frames {A}, {B}, {F} and {M}</h3>
<div class="outline-text-3" id="text-5-2">
<p>
<a id="org3009bf2"></a>
</p>
<p>
This Matlab function is accessible <a href="../src/initializeFramesPositions.m">here</a>.
</p>
</div>
<div id="outline-container-org4135d2d" class="outline-4">
<h4 id="org4135d2d">Documentation</h4>
<div class="outline-text-4" id="text-org4135d2d">
<div id="orgc3e1d9c" class="figure">
<p><img src="figs/stewart-frames-position.png" alt="stewart-frames-position.png" />
</p>
<p><span class="figure-number">Figure 8: </span>Definition of the position of the frames</p>
</div>
</div>
</div>
<div id="outline-container-org66f1ebb" class="outline-4">
<h4 id="org66f1ebb">Function description</h4>
<div class="outline-text-4" id="text-org66f1ebb">
<div class="org-src-container">
<pre class="src src-matlab">function [stewart] = initializeFramesPositions(stewart, args)
% initializeFramesPositions - Initialize the positions of frames {A}, {B}, {F} and {M}
%
% Syntax: [stewart] = initializeFramesPositions(stewart, args)
%
% Inputs:
% - args - Can have the following fields:
% - H [1x1] - Total Height of the Stewart Platform (height from {F} to {M}) [m]
% - MO_B [1x1] - Height of the frame {B} with respect to {M} [m]
%
% Outputs:
% - stewart - A structure with the following fields:
% - geometry.H [1x1] - Total Height of the Stewart Platform [m]
% - geometry.FO_M [3x1] - Position of {M} with respect to {F} [m]
% - platform_M.MO_B [3x1] - Position of {B} with respect to {M} [m]
% - platform_F.FO_A [3x1] - Position of {A} with respect to {F} [m]
</pre>
</div>
</div>
</div>
<div id="outline-container-orgd50a826" class="outline-4">
<h4 id="orgd50a826">Optional Parameters</h4>
<div class="outline-text-4" id="text-orgd50a826">
<div class="org-src-container">
<pre class="src src-matlab">arguments
stewart
args.H (1,1) double {mustBeNumeric, mustBePositive} = 90e-3
args.MO_B (1,1) double {mustBeNumeric} = 50e-3
end
</pre>
</div>
</div>
</div>
<div id="outline-container-org458592e" class="outline-4">
<h4 id="org458592e">Compute the position of each frame</h4>
<div class="outline-text-4" id="text-org458592e">
<div class="org-src-container">
<pre class="src src-matlab">H = args.H; % Total Height of the Stewart Platform [m]
FO_M = [0; 0; H]; % Position of {M} with respect to {F} [m]
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]
</pre>
</div>
</div>
</div>
<div id="outline-container-org51c0261" class="outline-4">
<h4 id="org51c0261">Populate the <code>stewart</code> structure</h4>
<div class="outline-text-4" id="text-org51c0261">
<div class="org-src-container">
<pre class="src src-matlab">stewart.geometry.H = H;
stewart.geometry.FO_M = FO_M;
stewart.platform_M.MO_B = MO_B;
stewart.platform_F.FO_A = FO_A;
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org9057387" class="outline-3">
<h3 id="org9057387"><span class="section-number-3">5.3</span> <code>generateGeneralConfiguration</code>: Generate a Very General Configuration</h3>
<div class="outline-text-3" id="text-5-3">
<p>
<a id="org9f50820"></a>
</p>
<p>
This Matlab function is accessible <a href="../src/generateGeneralConfiguration.m">here</a>.
</p>
</div>
<div id="outline-container-org967b04c" class="outline-4">
<h4 id="org967b04c">Documentation</h4>
<div class="outline-text-4" id="text-org967b04c">
<p>
Joints are positions on a circle centered with the Z axis of {F} and {M} and at a chosen distance from {F} and {M}.
The radius of the circles can be chosen as well as the angles where the joints are located (see Figure <a href="#org4c354b6">9</a>).
</p>
<div id="org4c354b6" class="figure">
<p><img src="figs/stewart_bottom_plate.png" alt="stewart_bottom_plate.png" />
</p>
<p><span class="figure-number">Figure 9: </span>Position of the joints</p>
</div>
</div>
</div>
<div id="outline-container-orge721b0e" class="outline-4">
<h4 id="orge721b0e">Function description</h4>
<div class="outline-text-4" id="text-orge721b0e">
<div class="org-src-container">
<pre class="src src-matlab">function [stewart] = generateGeneralConfiguration(stewart, args)
% generateGeneralConfiguration - Generate a Very General Configuration
%
% Syntax: [stewart] = generateGeneralConfiguration(stewart, args)
%
% Inputs:
% - args - Can have the following fields:
% - FH [1x1] - Height of the position of the fixed joints with respect to the frame {F} [m]
% - FR [1x1] - Radius of the position of the fixed joints in the X-Y [m]
% - FTh [6x1] - Angles of the fixed joints in the X-Y plane with respect to the X axis [rad]
% - MH [1x1] - Height of the position of the mobile joints with respect to the frame {M} [m]
% - FR [1x1] - Radius of the position of the mobile joints in the X-Y [m]
% - MTh [6x1] - Angles of the mobile joints in the X-Y plane with respect to the X axis [rad]
%
% Outputs:
% - stewart - updated Stewart structure with the added fields:
% - platform_F.Fa [3x6] - Its i'th column is the position vector of joint ai with respect to {F}
% - platform_M.Mb [3x6] - Its i'th column is the position vector of joint bi with respect to {M}
</pre>
</div>
</div>
</div>
<div id="outline-container-orgfe31977" class="outline-4">
<h4 id="orgfe31977">Optional Parameters</h4>
<div class="outline-text-4" id="text-orgfe31977">
<div class="org-src-container">
<pre class="src src-matlab">arguments
stewart
args.FH (1,1) double {mustBeNumeric, mustBePositive} = 15e-3
args.FR (1,1) double {mustBeNumeric, mustBePositive} = 115e-3;
args.FTh (6,1) double {mustBeNumeric} = [-10, 10, 120-10, 120+10, 240-10, 240+10]*(pi/180);
args.MH (1,1) double {mustBeNumeric, mustBePositive} = 15e-3
args.MR (1,1) double {mustBeNumeric, mustBePositive} = 90e-3;
args.MTh (6,1) double {mustBeNumeric} = [-60+10, 60-10, 60+10, 180-10, 180+10, -60-10]*(pi/180);
end
</pre>
</div>
</div>
</div>
<div id="outline-container-org232e4c2" class="outline-4">
<h4 id="org232e4c2">Compute the pose</h4>
<div class="outline-text-4" id="text-org232e4c2">
<div class="org-src-container">
<pre class="src src-matlab">Fa = zeros(3,6);
Mb = zeros(3,6);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">for i = 1:6
Fa(:,i) = [args.FR*cos(args.FTh(i)); args.FR*sin(args.FTh(i)); args.FH];
Mb(:,i) = [args.MR*cos(args.MTh(i)); args.MR*sin(args.MTh(i)); -args.MH];
end
</pre>
</div>
</div>
</div>
<div id="outline-container-org7ee3958" class="outline-4">
<h4 id="org7ee3958">Populate the <code>stewart</code> structure</h4>
<div class="outline-text-4" id="text-org7ee3958">
<div class="org-src-container">
<pre class="src src-matlab">stewart.platform_F.Fa = Fa;
stewart.platform_M.Mb = Mb;
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org861f6de" class="outline-3">
<h3 id="org861f6de"><span class="section-number-3">5.4</span> <code>computeJointsPose</code>: Compute the Pose of the Joints</h3>
<div class="outline-text-3" id="text-5-4">
<p>
<a id="org7f34b08"></a>
</p>
<p>
This Matlab function is accessible <a href="../src/computeJointsPose.m">here</a>.
</p>
</div>
<div id="outline-container-orgc1c4d18" class="outline-4">
<h4 id="orgc1c4d18">Documentation</h4>
<div class="outline-text-4" id="text-orgc1c4d18">
<div id="org8ffb841" class="figure">
<p><img src="figs/stewart-struts.png" alt="stewart-struts.png" />
</p>
<p><span class="figure-number">Figure 10: </span>Position and orientation of the struts</p>
</div>
</div>
</div>
<div id="outline-container-orgc7c8a40" class="outline-4">
<h4 id="orgc7c8a40">Function description</h4>
<div class="outline-text-4" id="text-orgc7c8a40">
<div class="org-src-container">
<pre class="src src-matlab">function [stewart] = computeJointsPose(stewart, args)
% computeJointsPose -
%
% Syntax: [stewart] = computeJointsPose(stewart, args)
%
% Inputs:
% - stewart - A structure with the following fields
% - platform_F.Fa [3x6] - Its i'th column is the position vector of joint ai with respect to {F}
% - platform_M.Mb [3x6] - Its i'th column is the position vector of joint bi with respect to {M}
% - platform_F.FO_A [3x1] - Position of {A} with respect to {F}
% - platform_M.MO_B [3x1] - Position of {B} with respect to {M}
% - geometry.FO_M [3x1] - Position of {M} with respect to {F}
% - 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:
% - stewart - A structure with the following added fields
% - geometry.Aa [3x6] - The i'th column is the position of ai with respect to {A}
% - geometry.Ab [3x6] - The i'th column is the position of bi with respect to {A}
% - geometry.Ba [3x6] - The i'th column is the position of ai with respect to {B}
% - geometry.Bb [3x6] - The i'th column is the position of bi with respect to {B}
% - geometry.l [6x1] - The i'th element is the initial length of strut i
% - geometry.As [3x6] - The i'th column is the unit vector of strut i expressed in {A}
% - geometry.Bs [3x6] - The i'th column is the unit vector of strut i expressed in {B}
% - struts_F.l [6x1] - Length of the Fixed part of the i'th strut
% - 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}
</pre>
</div>
</div>
</div>
<div id="outline-container-orga2673d1" class="outline-4">
<h4 id="orga2673d1">Optional Parameters</h4>
<div class="outline-text-4" id="text-orga2673d1">
<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)
end
</pre>
</div>
</div>
</div>
<div id="outline-container-org772540a" class="outline-4">
<h4 id="org772540a">Check the <code>stewart</code> structure elements</h4>
<div class="outline-text-4" id="text-org772540a">
<div class="org-src-container">
<pre class="src src-matlab">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;
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, 'FO_M'), 'stewart.geometry should have attribute FO_M')
FO_M = stewart.geometry.FO_M;
</pre>
</div>
</div>
</div>
<div id="outline-container-org52b0d4c" class="outline-4">
<h4 id="org52b0d4c">Compute the position of the Joints</h4>
<div class="outline-text-4" id="text-org52b0d4c">
<div class="org-src-container">
<pre class="src src-matlab">Aa = Fa - repmat(FO_A, [1, 6]);
Bb = Mb - repmat(MO_B, [1, 6]);
</pre>
</div>
<p>
Original:
</p>
<div class="org-src-container">
<pre class="src src-matlab">Ab = Bb - repmat(-MO_B-FO_M+FO_A, [1, 6]);
Ba = Aa - repmat( MO_B+FO_M-FO_A, [1, 6]);
</pre>
</div>
<p>
Translation &amp; Rotation: (Rotation and then translation)
</p>
<div class="org-src-container">
<pre class="src src-matlab">Ab = args.ARB *Bb - repmat(-args.AP, [1, 6]);
Ba = args.ARB'*Aa - repmat( args.AP, [1, 6]);
</pre>
</div>
</div>
</div>
<div id="outline-container-org4b76b0f" class="outline-4">
<h4 id="org4b76b0f">Compute the strut length and orientation</h4>
<div class="outline-text-4" id="text-org4b76b0f">
<div class="org-src-container">
<pre class="src src-matlab">As = (Ab - Aa)./vecnorm(Ab - Aa); % As_i is the i'th vector of As
l = vecnorm(Ab - Aa)';
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">Bs = (Bb - Ba)./vecnorm(Bb - Ba);
</pre>
</div>
</div>
</div>
<div id="outline-container-orgd621d5e" class="outline-4">
<h4 id="orgd621d5e">Compute the orientation of the Joints</h4>
<div class="outline-text-4" id="text-orgd621d5e">
<div class="org-src-container">
<pre class="src src-matlab">FRa = zeros(3,3,6);
MRb = zeros(3,3,6);
for i = 1:6
FRa(:,:,i) = [cross([0;1;0], As(:,i)) , cross(As(:,i), cross([0;1;0], As(:,i))) , As(:,i)];
FRa(:,:,i) = FRa(:,:,i)./vecnorm(FRa(:,:,i));
MRb(:,:,i) = [cross([0;1;0], Bs(:,i)) , cross(Bs(:,i), cross([0;1;0], Bs(:,i))) , Bs(:,i)];
MRb(:,:,i) = MRb(:,:,i)./vecnorm(MRb(:,:,i));
end
</pre>
</div>
</div>
</div>
<div id="outline-container-org0e8aa0a" class="outline-4">
<h4 id="org0e8aa0a">Populate the <code>stewart</code> structure</h4>
<div class="outline-text-4" id="text-org0e8aa0a">
<div class="org-src-container">
<pre class="src src-matlab">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;
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org329bef9" class="outline-3">
<h3 id="org329bef9"><span class="section-number-3">5.5</span> <code>initializeStewartPose</code>: Determine the initial stroke in each leg to have the wanted pose</h3>
<div class="outline-text-3" id="text-5-5">
<p>
<a id="orga94c6a9"></a>
</p>
<p>
This Matlab function is accessible <a href="../src/initializeStewartPose.m">here</a>.
</p>
</div>
<div id="outline-container-org609919f" class="outline-4">
<h4 id="org609919f">Function description</h4>
<div class="outline-text-4" id="text-org609919f">
<div class="org-src-container">
<pre class="src src-matlab">function [stewart] = initializeStewartPose(stewart, args)
% initializeStewartPose - Determine the initial stroke in each leg to have the wanted pose
% It uses the inverse kinematic
%
% Syntax: [stewart] = initializeStewartPose(stewart, args)
%
% 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:
% - stewart - updated Stewart structure with the added fields:
% - 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}
</pre>
</div>
</div>
</div>
<div id="outline-container-orgb26889a" class="outline-4">
<h4 id="orgb26889a">Optional Parameters</h4>
<div class="outline-text-4" id="text-orgb26889a">
<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)
end
</pre>
</div>
</div>
</div>
<div id="outline-container-org3d3ef62" class="outline-4">
<h4 id="org3d3ef62">Use the Inverse Kinematic function</h4>
<div class="outline-text-4" id="text-org3d3ef62">
<div class="org-src-container">
<pre class="src src-matlab">[Li, dLi] = inverseKinematics(stewart, 'AP', args.AP, 'ARB', args.ARB);
</pre>
</div>
</div>
</div>
<div id="outline-container-org8df3429" class="outline-4">
<h4 id="org8df3429">Populate the <code>stewart</code> structure</h4>
<div class="outline-text-4" id="text-org8df3429">
<div class="org-src-container">
<pre class="src src-matlab">stewart.actuators.Leq = dLi;
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org6ff5b31" class="outline-3">
<h3 id="org6ff5b31"><span class="section-number-3">5.6</span> <code>initializeCylindricalPlatforms</code>: Initialize the geometry of the Fixed and Mobile Platforms</h3>
<div class="outline-text-3" id="text-5-6">
<p>
<a id="org6ad7062"></a>
</p>
<p>
This Matlab function is accessible <a href="../src/initializeCylindricalPlatforms.m">here</a>.
</p>
</div>
<div id="outline-container-orgcffde44" class="outline-4">
<h4 id="orgcffde44">Function description</h4>
<div class="outline-text-4" id="text-orgcffde44">
<div class="org-src-container">
<pre class="src src-matlab">function [stewart] = initializeCylindricalPlatforms(stewart, args)
% initializeCylindricalPlatforms - Initialize the geometry of the Fixed and Mobile Platforms
%
% Syntax: [stewart] = initializeCylindricalPlatforms(args)
%
% Inputs:
% - args - Structure with the following fields:
% - Fpm [1x1] - Fixed Platform Mass [kg]
% - Fph [1x1] - Fixed Platform Height [m]
% - Fpr [1x1] - Fixed Platform Radius [m]
% - Mpm [1x1] - Mobile Platform Mass [kg]
% - Mph [1x1] - Mobile Platform Height [m]
% - Mpr [1x1] - Mobile Platform Radius [m]
%
% Outputs:
% - stewart - updated Stewart structure with the added fields:
% - platform_F [struct] - structure with the following fields:
% - type = 1
% - M [1x1] - Fixed Platform Mass [kg]
% - I [3x3] - Fixed Platform Inertia matrix [kg*m^2]
% - H [1x1] - Fixed Platform Height [m]
% - R [1x1] - Fixed Platform Radius [m]
% - platform_M [struct] - structure with the following fields:
% - M [1x1] - Mobile Platform Mass [kg]
% - I [3x3] - Mobile Platform Inertia matrix [kg*m^2]
% - H [1x1] - Mobile Platform Height [m]
% - R [1x1] - Mobile Platform Radius [m]
</pre>
</div>
</div>
</div>
<div id="outline-container-org017553c" class="outline-4">
<h4 id="org017553c">Optional Parameters</h4>
<div class="outline-text-4" id="text-org017553c">
<div class="org-src-container">
<pre class="src src-matlab">arguments
stewart
args.Fpm (1,1) double {mustBeNumeric, mustBePositive} = 1
args.Fph (1,1) double {mustBeNumeric, mustBePositive} = 10e-3
args.Fpr (1,1) double {mustBeNumeric, mustBePositive} = 125e-3
args.Mpm (1,1) double {mustBeNumeric, mustBePositive} = 1
args.Mph (1,1) double {mustBeNumeric, mustBePositive} = 10e-3
args.Mpr (1,1) double {mustBeNumeric, mustBePositive} = 100e-3
end
</pre>
</div>
</div>
</div>
<div id="outline-container-org25a390a" class="outline-4">
<h4 id="org25a390a">Compute the Inertia matrices of platforms</h4>
<div class="outline-text-4" id="text-org25a390a">
<div class="org-src-container">
<pre class="src src-matlab">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]);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">I_M = diag([1/12*args.Mpm * (3*args.Mpr^2 + args.Mph^2), ...
1/12*args.Mpm * (3*args.Mpr^2 + args.Mph^2), ...
1/2 *args.Mpm * args.Mpr^2]);
</pre>
</div>
</div>
</div>
<div id="outline-container-org943c8fa" class="outline-4">
<h4 id="org943c8fa">Populate the <code>stewart</code> structure</h4>
<div class="outline-text-4" id="text-org943c8fa">
<div class="org-src-container">
<pre class="src src-matlab">stewart.platform_F.type = 1;
stewart.platform_F.I = I_F;
stewart.platform_F.M = args.Fpm;
stewart.platform_F.R = args.Fpr;
stewart.platform_F.H = args.Fph;
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">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;
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org60aa215" class="outline-3">
<h3 id="org60aa215"><span class="section-number-3">5.7</span> <code>initializeCylindricalStruts</code>: Define the inertia of cylindrical struts</h3>
<div class="outline-text-3" id="text-5-7">
<p>
<a id="org6263b6d"></a>
</p>
<p>
This Matlab function is accessible <a href="../src/initializeCylindricalStruts.m">here</a>.
</p>
</div>
<div id="outline-container-org4d297c7" class="outline-4">
<h4 id="org4d297c7">Function description</h4>
<div class="outline-text-4" id="text-org4d297c7">
<div class="org-src-container">
<pre class="src src-matlab">function [stewart] = initializeCylindricalStruts(stewart, args)
% initializeCylindricalStruts - Define the mass and moment of inertia of cylindrical struts
%
% Syntax: [stewart] = initializeCylindricalStruts(args)
%
% Inputs:
% - args - Structure with the following fields:
% - Fsm [1x1] - Mass of the Fixed part of the struts [kg]
% - Fsh [1x1] - Height of cylinder for the Fixed part of the struts [m]
% - Fsr [1x1] - Radius of cylinder for the Fixed part of the struts [m]
% - Msm [1x1] - Mass of the Mobile part of the struts [kg]
% - Msh [1x1] - Height of cylinder for the Mobile part of the struts [m]
% - Msr [1x1] - Radius of cylinder for the Mobile part of the struts [m]
%
% Outputs:
% - stewart - updated Stewart structure with the added fields:
% - struts_F [struct] - structure with the following fields:
% - M [6x1] - Mass of the Fixed part of the struts [kg]
% - I [3x3x6] - Moment of Inertia for the Fixed part of the struts [kg*m^2]
% - H [6x1] - Height of cylinder for the Fixed part of the struts [m]
% - R [6x1] - Radius of cylinder for the Fixed part of the struts [m]
% - struts_M [struct] - structure with the following fields:
% - M [6x1] - Mass of the Mobile part of the struts [kg]
% - I [3x3x6] - Moment of Inertia for the Mobile part of the struts [kg*m^2]
% - 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]
</pre>
</div>
</div>
</div>
<div id="outline-container-org2a5dca5" class="outline-4">
<h4 id="org2a5dca5">Optional Parameters</h4>
<div class="outline-text-4" id="text-org2a5dca5">
<div class="org-src-container">
<pre class="src src-matlab">arguments
stewart
args.type_F char {mustBeMember(args.type_F,{'cylindrical', 'none'})} = 'cylindrical'
args.type_M char {mustBeMember(args.type_M,{'cylindrical', 'none'})} = 'cylindrical'
args.Fsm (1,1) double {mustBeNumeric, mustBePositive} = 0.1
args.Fsh (1,1) double {mustBeNumeric, mustBePositive} = 50e-3
args.Fsr (1,1) double {mustBeNumeric, mustBePositive} = 5e-3
args.Msm (1,1) double {mustBeNumeric, mustBePositive} = 0.1
args.Msh (1,1) double {mustBeNumeric, mustBePositive} = 50e-3
args.Msr (1,1) double {mustBeNumeric, mustBePositive} = 5e-3
end
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc056498" class="outline-4">
<h4 id="orgc056498">Compute the properties of the cylindrical struts</h4>
<div class="outline-text-4" id="text-orgc056498">
<div class="org-src-container">
<pre class="src src-matlab">Fsm = ones(6,1).*args.Fsm;
Fsh = ones(6,1).*args.Fsh;
Fsr = ones(6,1).*args.Fsr;
Msm = ones(6,1).*args.Msm;
Msh = ones(6,1).*args.Msh;
Msr = ones(6,1).*args.Msr;
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">I_F = zeros(3, 3, 6); % Inertia of the "fixed" part of the strut
I_M = zeros(3, 3, 6); % Inertia of the "mobile" part of the strut
for i = 1:6
I_F(:,:,i) = diag([1/12 * Fsm(i) * (3*Fsr(i)^2 + Fsh(i)^2), ...
1/12 * Fsm(i) * (3*Fsr(i)^2 + Fsh(i)^2), ...
1/2 * Fsm(i) * Fsr(i)^2]);
I_M(:,:,i) = diag([1/12 * Msm(i) * (3*Msr(i)^2 + Msh(i)^2), ...
1/12 * Msm(i) * (3*Msr(i)^2 + Msh(i)^2), ...
1/2 * Msm(i) * Msr(i)^2]);
end
</pre>
</div>
</div>
</div>
<div id="outline-container-orge3443c7" class="outline-4">
<h4 id="orge3443c7">Populate the <code>stewart</code> structure</h4>
<div class="outline-text-4" id="text-orge3443c7">
<div class="org-src-container">
<pre class="src src-matlab">switch args.type_M
case 'cylindrical'
stewart.struts_M.type = 1;
case 'none'
stewart.struts_M.type = 2;
end
stewart.struts_M.I = I_M;
stewart.struts_M.M = Msm;
stewart.struts_M.R = Msr;
stewart.struts_M.H = Msh;
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">switch args.type_F
case 'cylindrical'
stewart.struts_F.type = 1;
case 'none'
stewart.struts_F.type = 2;
end
stewart.struts_F.I = I_F;
stewart.struts_F.M = Fsm;
stewart.struts_F.R = Fsr;
stewart.struts_F.H = Fsh;
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org3ad0cd1" class="outline-3">
<h3 id="org3ad0cd1"><span class="section-number-3">5.8</span> <code>initializeStrutDynamics</code>: Add Stiffness and Damping properties of each strut</h3>
<div class="outline-text-3" id="text-5-8">
<p>
<a id="org7f8f2b7"></a>
</p>
<p>
This Matlab function is accessible <a href="../src/initializeStrutDynamics.m">here</a>.
</p>
</div>
<div id="outline-container-orgd6ed57c" class="outline-4">
<h4 id="orgd6ed57c">Documentation</h4>
<div class="outline-text-4" id="text-orgd6ed57c">
<div id="orgbbfb204" class="figure">
<p><img src="figs/piezoelectric_stack.jpg" alt="piezoelectric_stack.jpg" width="500px" />
</p>
<p><span class="figure-number">Figure 11: </span>Example of a piezoelectric stach actuator (PI)</p>
</div>
<p>
A simplistic model of such amplified actuator is shown in Figure <a href="#org624c98d">12</a> where:
</p>
<ul class="org-ul">
<li>\(K\) represent the vertical stiffness of the actuator</li>
<li>\(C\) represent the vertical damping of the actuator</li>
<li>\(F\) represents the force applied by the actuator</li>
<li>\(F_{m}\) represents the total measured force</li>
<li>\(v_{m}\) represents the absolute velocity of the top part of the actuator</li>
<li>\(d_{m}\) represents the total relative displacement of the actuator</li>
</ul>
<div id="org624c98d" class="figure">
<p><img src="figs/actuator_model_simple.png" alt="actuator_model_simple.png" />
</p>
<p><span class="figure-number">Figure 12: </span>Simple model of an Actuator</p>
</div>
</div>
</div>
<div id="outline-container-orgab544d8" class="outline-4">
<h4 id="orgab544d8">Function description</h4>
<div class="outline-text-4" id="text-orgab544d8">
<div class="org-src-container">
<pre class="src src-matlab">function [stewart] = initializeStrutDynamics(stewart, args)
% initializeStrutDynamics - Add Stiffness and Damping properties of each strut
%
% Syntax: [stewart] = initializeStrutDynamics(args)
%
% Inputs:
% - args - Structure with the following fields:
% - K [6x1] - Stiffness of each strut [N/m]
% - C [6x1] - Damping of each strut [N/(m/s)]
%
% Outputs:
% - stewart - updated Stewart structure with the added fields:
% - actuators.type = 1
% - actuators.K [6x1] - Stiffness of each strut [N/m]
% - actuators.C [6x1] - Damping of each strut [N/(m/s)]
</pre>
</div>
</div>
</div>
<div id="outline-container-org972382f" class="outline-4">
<h4 id="org972382f">Optional Parameters</h4>
<div class="outline-text-4" id="text-org972382f">
<div class="org-src-container">
<pre class="src src-matlab">arguments
stewart
args.K (6,1) double {mustBeNumeric, mustBeNonnegative} = 20e6*ones(6,1)
args.C (6,1) double {mustBeNumeric, mustBeNonnegative} = 2e1*ones(6,1)
end
</pre>
</div>
</div>
</div>
<div id="outline-container-orgadb8327" class="outline-4">
<h4 id="orgadb8327">Add Stiffness and Damping properties of each strut</h4>
<div class="outline-text-4" id="text-orgadb8327">
<div class="org-src-container">
<pre class="src src-matlab">stewart.actuators.type = 1;
stewart.actuators.K = args.K;
stewart.actuators.C = args.C;
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgd8d403e" class="outline-3">
<h3 id="orgd8d403e"><span class="section-number-3">5.9</span> <code>initializeAmplifiedStrutDynamics</code>: Add Stiffness and Damping properties of each strut for an amplified piezoelectric actuator</h3>
<div class="outline-text-3" id="text-5-9">
<p>
<a id="org7d40eca"></a>
</p>
<p>
This Matlab function is accessible <a href="../src/initializeAmplifiedStrutDynamics.m">here</a>.
</p>
</div>
<div id="outline-container-org4003bdd" class="outline-4">
<h4 id="org4003bdd">Documentation</h4>
<div class="outline-text-4" id="text-org4003bdd">
<p>
An amplified piezoelectric actuator is shown in Figure <a href="#org9e7e9ad">13</a>.
</p>
<div id="org9e7e9ad" class="figure">
<p><img src="figs/amplified_piezo_with_displacement_sensor.jpg" alt="amplified_piezo_with_displacement_sensor.jpg" width="500px" />
</p>
<p><span class="figure-number">Figure 13: </span>Example of an Amplified piezoelectric actuator with an integrated displacement sensor (Cedrat Technologies)</p>
</div>
<p>
A simplistic model of such amplified actuator is shown in Figure <a href="#org0fd7540">14</a> where the parameters are described in Table <a href="#org9030eaa">1</a>.
</p>
<table id="org9030eaa" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption class="t-above"><span class="table-number">Table 1:</span> Parameters used for the model of the APA 100M</caption>
<colgroup>
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">&#xa0;</th>
<th scope="col" class="org-left">Meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">\(k_e\)</td>
<td class="org-left">Stiffness used to adjust the pole of the isolator</td>
</tr>
<tr>
<td class="org-left">\(k_1\)</td>
<td class="org-left">Stiffness of the metallic suspension when the stack is removed</td>
</tr>
<tr>
<td class="org-left">\(k_a\)</td>
<td class="org-left">Stiffness of the actuator</td>
</tr>
<tr>
<td class="org-left">\(c_1\)</td>
<td class="org-left">Added viscous damping</td>
</tr>
</tbody>
</table>
<div id="org0fd7540" class="figure">
<p><img src="./figs/souleille18_model_piezo.png" alt="souleille18_model_piezo.png" />
</p>
<p><span class="figure-number">Figure 14: </span>Picture of an APA100M from Cedrat Technologies. Simplified model of a one DoF payload mounted on such isolator</p>
</div>
</div>
</div>
<div id="outline-container-org4439879" class="outline-4">
<h4 id="org4439879">Function description</h4>
<div class="outline-text-4" id="text-org4439879">
<div class="org-src-container">
<pre class="src src-matlab">function [stewart] = initializeAmplifiedStrutDynamics(stewart, args)
% initializeAmplifiedStrutDynamics - Add Stiffness and Damping properties of each strut
%
% Syntax: [stewart] = initializeAmplifiedStrutDynamics(args)
%
% Inputs:
% - args - Structure with the following fields:
% - Ka [6x1] - Stiffness of the actuator [N/m]
% - Ke [6x1] - Stiffness used to adjust the pole of the isolator [N/m]
% - K1 [6x1] - Stiffness of the metallic suspension when the stack is removed [N/m]
% - C1 [6x1] - Added viscous damping [N/(m/s)]
%
% Outputs:
% - stewart - updated Stewart structure with the added fields:
% - actuators.type = 2
% - actuators.K [6x1] - Total Stiffness of each strut [N/m]
% - actuators.C [6x1] - Total Damping of each strut [N/(m/s)]
% - actuators.Ka [6x1] - Stiffness of the actuator [N/m]
% - actuators.Ke [6x1] - Stiffness used to adjust the pole of the isolator [N/m]
% - actuators.K1 [6x1] - Stiffness of the metallic suspension when the stack is removed [N/m]
% - actuators.C1 [6x1] - Added viscous damping [N/(m/s)]
</pre>
</div>
</div>
</div>
<div id="outline-container-org2078010" class="outline-4">
<h4 id="org2078010">Optional Parameters</h4>
<div class="outline-text-4" id="text-org2078010">
<div class="org-src-container">
<pre class="src src-matlab">arguments
stewart
args.Ke (6,1) double {mustBeNumeric, mustBeNonnegative} = 1.5e6*ones(6,1)
args.Ka (6,1) double {mustBeNumeric, mustBeNonnegative} = 43e6*ones(6,1)
args.K1 (6,1) double {mustBeNumeric, mustBeNonnegative} = 0.4e6*ones(6,1)
args.C1 (6,1) double {mustBeNumeric, mustBeNonnegative} = 10*ones(6,1)
end
</pre>
</div>
</div>
</div>
<div id="outline-container-org9b435e8" class="outline-4">
<h4 id="org9b435e8">Compute the total stiffness and damping</h4>
<div class="outline-text-4" id="text-org9b435e8">
<div class="org-src-container">
<pre class="src src-matlab">K = args.K1 + args.Ka.*args.Ke./(args.Ka + args.Ke);
C = args.C1;
</pre>
</div>
</div>
</div>
<div id="outline-container-org072dfc3" class="outline-4">
<h4 id="org072dfc3">Populate the <code>stewart</code> structure</h4>
<div class="outline-text-4" id="text-org072dfc3">
<div class="org-src-container">
<pre class="src src-matlab">stewart.actuators.type = 2;
stewart.actuators.Ka = args.Ka;
stewart.actuators.Ke = args.Ke;
stewart.actuators.K1 = args.K1;
stewart.actuators.C1 = args.C1;
stewart.actuators.K = K;
stewart.actuators.C = C;
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org65c17b2" class="outline-3">
<h3 id="org65c17b2"><span class="section-number-3">5.10</span> <code>initializeFlexibleStrutDynamics</code>: Model each strut with a flexible element</h3>
<div class="outline-text-3" id="text-5-10">
<p>
<a id="org6f69b03"></a>
</p>
<p>
This Matlab function is accessible <a href="../src/initializeFlexibleStrutDynamics.m">here</a>.
</p>
</div>
<div id="outline-container-orgf23e693" class="outline-4">
<h4 id="orgf23e693">Function description</h4>
<div class="outline-text-4" id="text-orgf23e693">
<div class="org-src-container">
<pre class="src src-matlab">function [stewart] = initializeFlexibleStrutDynamics(stewart, args)
% initializeFlexibleStrutDynamics - Add Stiffness and Damping properties of each strut
%
% Syntax: [stewart] = initializeFlexibleStrutDynamics(args)
%
% Inputs:
% - args - Structure with the following fields:
% - K [nxn] - Vertical stiffness contribution of the piezoelectric stack [N/m]
% - M [nxn] - Vertical damping contribution of the piezoelectric stack [N/(m/s)]
% - xi [1x1] - Vertical (residual) stiffness when the piezoelectric stack is removed [N/m]
% - step_file [6x1] - Vertical (residual) damping when the piezoelectric stack is removed [N/(m/s)]
% - Gf [6x1] - Gain from strain in [m] to measured [N] such that it matches
%
% Outputs:
% - stewart - updated Stewart structure with the added fields:
</pre>
</div>
</div>
</div>
<div id="outline-container-org72115e7" class="outline-4">
<h4 id="org72115e7">Optional Parameters</h4>
<div class="outline-text-4" id="text-org72115e7">
<div class="org-src-container">
<pre class="src src-matlab">arguments
stewart
args.K double {mustBeNumeric} = zeros(6,6)
args.M double {mustBeNumeric} = zeros(6,6)
args.H double {mustBeNumeric} = 0
args.n_xyz double {mustBeNumeric} = zeros(2,3)
args.xi double {mustBeNumeric} = 0.1
args.Gf double {mustBeNumeric} = 1
args.step_file char {} = ''
end
</pre>
</div>
</div>
</div>
<div id="outline-container-orge6e22da" class="outline-4">
<h4 id="orge6e22da">Compute the axial offset</h4>
<div class="outline-text-4" id="text-orge6e22da">
<div class="org-src-container">
<pre class="src src-matlab">stewart.actuators.ax_off = (stewart.geometry.l(1) - args.H)/2; % Axial Offset at the ends of the actuator
</pre>
</div>
</div>
</div>
<div id="outline-container-org70de463" class="outline-4">
<h4 id="org70de463">Populate the <code>stewart</code> structure</h4>
<div class="outline-text-4" id="text-org70de463">
<div class="org-src-container">
<pre class="src src-matlab">stewart.actuators.type = 3;
stewart.actuators.Km = args.K;
stewart.actuators.Mm = args.M;
stewart.actuators.n_xyz = args.n_xyz;
stewart.actuators.xi = args.xi;
stewart.actuators.step_file = args.step_file;
stewart.actuators.K = args.K(3,3); % Axial Stiffness
stewart.actuators.Gf = args.Gf;
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgeb6173a" class="outline-3">
<h3 id="orgeb6173a"><span class="section-number-3">5.11</span> <code>initializeJointDynamics</code>: Add Stiffness and Damping properties for spherical joints</h3>
<div class="outline-text-3" id="text-5-11">
<p>
<a id="org0d21456"></a>
</p>
<p>
This Matlab function is accessible <a href="../src/initializeJointDynamics.m">here</a>.
</p>
</div>
<div id="outline-container-orgf0f39ef" class="outline-4">
<h4 id="orgf0f39ef">Function description</h4>
<div class="outline-text-4" id="text-orgf0f39ef">
<div class="org-src-container">
<pre class="src src-matlab">function [stewart] = initializeJointDynamics(stewart, args)
% initializeJointDynamics - Add Stiffness and Damping properties for the spherical joints
%
% Syntax: [stewart] = initializeJointDynamics(args)
%
% Inputs:
% - args - Structure with the following fields:
% - type_F - 'universal', 'spherical', 'universal_p', 'spherical_p'
% - type_M - 'universal', 'spherical', 'universal_p', 'spherical_p'
% - Kf_M [6x1] - Bending (Rx, Ry) Stiffness for each top joints [(N.m)/rad]
% - Kt_M [6x1] - Torsion (Rz) Stiffness for each top joints [(N.m)/rad]
% - Cf_M [6x1] - Bending (Rx, Ry) Damping of each top joint [(N.m)/(rad/s)]
% - Ct_M [6x1] - Torsion (Rz) Damping of each top joint [(N.m)/(rad/s)]
% - 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:
% - stewart - updated Stewart structure with the added fields:
% - stewart.joints_F and stewart.joints_M:
% - type - 1 (universal), 2 (spherical), 3 (universal perfect), 4 (spherical perfect)
% - Kx, Ky, Kz [6x1] - Translation (Tx, Ty, Tz) Stiffness [N/m]
% - Kf [6x1] - Flexion (Rx, Ry) Stiffness [(N.m)/rad]
% - Kt [6x1] - Torsion (Rz) Stiffness [(N.m)/rad]
% - 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)]
</pre>
</div>
</div>
</div>
<div id="outline-container-org8d19d2d" class="outline-4">
<h4 id="org8d19d2d">Optional Parameters</h4>
<div class="outline-text-4" id="text-org8d19d2d">
<div class="org-src-container">
<pre class="src src-matlab">arguments
stewart
args.type_F char {mustBeMember(args.type_F,{'universal', 'spherical', 'universal_p', 'spherical_p', 'universal_3dof', 'spherical_3dof', 'flexible'})} = 'universal'
args.type_M char {mustBeMember(args.type_M,{'universal', 'spherical', 'universal_p', 'spherical_p', 'universal_3dof', 'spherical_3dof', 'flexible'})} = 'spherical'
args.Kf_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 33*ones(6,1)
args.Cf_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e-4*ones(6,1)
args.Kt_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 236*ones(6,1)
args.Ct_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e-3*ones(6,1)
args.Kf_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 33*ones(6,1)
args.Cf_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e-4*ones(6,1)
args.Kt_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 236*ones(6,1)
args.Ct_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e-3*ones(6,1)
args.Ka_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1.2e8*ones(6,1)
args.Ca_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e1*ones(6,1)
args.Kr_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1.1e7*ones(6,1)
args.Cr_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e1*ones(6,1)
args.Ka_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1.2e8*ones(6,1)
args.Ca_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e1*ones(6,1)
args.Kr_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1.1e7*ones(6,1)
args.Cr_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e1*ones(6,1)
args.K_M double {mustBeNumeric} = zeros(6,6)
args.M_M double {mustBeNumeric} = zeros(6,6)
args.n_xyz_M double {mustBeNumeric} = zeros(2,3)
args.xi_M double {mustBeNumeric} = 0.1
args.step_file_M char {} = ''
args.K_F double {mustBeNumeric} = zeros(6,6)
args.M_F double {mustBeNumeric} = zeros(6,6)
args.n_xyz_F double {mustBeNumeric} = zeros(2,3)
args.xi_F double {mustBeNumeric} = 0.1
args.step_file_F char {} = ''
end
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc6d4183" class="outline-4">
<h4 id="orgc6d4183">Add Actuator Type</h4>
<div class="outline-text-4" id="text-orgc6d4183">
<div class="org-src-container">
<pre class="src src-matlab">switch args.type_F
case 'universal'
stewart.joints_F.type = 1;
case 'spherical'
stewart.joints_F.type = 2;
case 'universal_p'
stewart.joints_F.type = 3;
case 'spherical_p'
stewart.joints_F.type = 4;
case 'flexible'
stewart.joints_F.type = 5;
case 'universal_3dof'
stewart.joints_F.type = 6;
case 'spherical_3dof'
stewart.joints_F.type = 7;
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;
case 'flexible'
stewart.joints_M.type = 5;
case 'universal_3dof'
stewart.joints_M.type = 6;
case 'spherical_3dof'
stewart.joints_M.type = 7;
end
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc0e613c" class="outline-4">
<h4 id="orgc0e613c">Add Stiffness and Damping in Translation of each strut</h4>
<div class="outline-text-4" id="text-orgc0e613c">
<p>
Axial and Radial (shear) Stiffness
</p>
<div class="org-src-container">
<pre class="src src-matlab">stewart.joints_M.Ka = args.Ka_M;
stewart.joints_M.Kr = args.Kr_M;
stewart.joints_F.Ka = args.Ka_F;
stewart.joints_F.Kr = args.Kr_F;
</pre>
</div>
<p>
Translation Damping
</p>
<div class="org-src-container">
<pre class="src src-matlab">stewart.joints_M.Ca = args.Ca_M;
stewart.joints_M.Cr = args.Cr_M;
stewart.joints_F.Ca = args.Ca_F;
stewart.joints_F.Cr = args.Cr_F;
</pre>
</div>
</div>
</div>
<div id="outline-container-org04698fc" class="outline-4">
<h4 id="org04698fc">Add Stiffness and Damping in Rotation of each strut</h4>
<div class="outline-text-4" id="text-org04698fc">
<p>
Rotational Stiffness
</p>
<div class="org-src-container">
<pre class="src src-matlab">stewart.joints_M.Kf = args.Kf_M;
stewart.joints_M.Kt = args.Kt_M;
stewart.joints_F.Kf = args.Kf_F;
stewart.joints_F.Kt = args.Kt_F;
</pre>
</div>
<p>
Rotational Damping
</p>
<div class="org-src-container">
<pre class="src src-matlab">stewart.joints_M.Cf = args.Cf_M;
stewart.joints_M.Ct = args.Ct_M;
stewart.joints_F.Cf = args.Cf_F;
stewart.joints_F.Ct = args.Ct_F;
</pre>
</div>
</div>
</div>
<div id="outline-container-org6cc5773" class="outline-4">
<h4 id="org6cc5773">Stiffness and Mass matrices for flexible joint</h4>
<div class="outline-text-4" id="text-org6cc5773">
<div class="org-src-container">
<pre class="src src-matlab">stewart.joints_F.M = args.M_F;
stewart.joints_F.K = args.K_F;
stewart.joints_F.n_xyz = args.n_xyz_F;
stewart.joints_F.xi = args.xi_F;
stewart.joints_F.xi = args.xi_F;
stewart.joints_F.step_file = args.step_file_F;
stewart.joints_M.M = args.M_M;
stewart.joints_M.K = args.K_M;
stewart.joints_M.n_xyz = args.n_xyz_M;
stewart.joints_M.xi = args.xi_M;
stewart.joints_M.step_file = args.step_file_M;
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgea07e0e" class="outline-3">
<h3 id="orgea07e0e"><span class="section-number-3">5.12</span> <code>initializeInertialSensor</code>: Initialize the inertial sensor in each strut</h3>
<div class="outline-text-3" id="text-5-12">
<p>
<a id="orgd96277a"></a>
</p>
<p>
This Matlab function is accessible <a href="../src/initializeInertialSensor.m">here</a>.
</p>
</div>
<div id="outline-container-orgd667bbb" class="outline-4">
<h4 id="orgd667bbb">Geophone - Working Principle</h4>
<div class="outline-text-4" id="text-orgd667bbb">
<p>
From the schematic of the Z-axis geophone shown in Figure <a href="#orge962c25">15</a>, we can write the transfer function from the support velocity \(\dot{w}\) to the relative velocity of the inertial mass \(\dot{d}\):
\[ \frac{\dot{d}}{\dot{w}} = \frac{-\frac{s^2}{{\omega_0}^2}}{\frac{s^2}{{\omega_0}^2} + 2 \xi \frac{s}{\omega_0} + 1} \]
with:
</p>
<ul class="org-ul">
<li>\(\omega_0 = \sqrt{\frac{k}{m}}\)</li>
<li>\(\xi = \frac{1}{2} \sqrt{\frac{m}{k}}\)</li>
</ul>
<div id="orge962c25" class="figure">
<p><img src="figs/inertial_sensor.png" alt="inertial_sensor.png" />
</p>
<p><span class="figure-number">Figure 15: </span>Schematic of a Z-Axis geophone</p>
</div>
<p>
We see that at frequencies above \(\omega_0\):
\[ \frac{\dot{d}}{\dot{w}} \approx -1 \]
</p>
<p>
And thus, the measurement of the relative velocity of the mass with respect to its support gives the absolute velocity of the support.
</p>
<p>
We generally want to have the smallest resonant frequency \(\omega_0\) to measure low frequency absolute velocity, however there is a trade-off between \(\omega_0\) and the mass of the inertial mass.
</p>
</div>
</div>
<div id="outline-container-orgca7729f" class="outline-4">
<h4 id="orgca7729f">Accelerometer - Working Principle</h4>
<div class="outline-text-4" id="text-orgca7729f">
<p>
From the schematic of the Z-axis accelerometer shown in Figure <a href="#org6e272e3">16</a>, we can write the transfer function from the support acceleration \(\ddot{w}\) to the relative position of the inertial mass \(d\):
\[ \frac{d}{\ddot{w}} = \frac{-\frac{1}{{\omega_0}^2}}{\frac{s^2}{{\omega_0}^2} + 2 \xi \frac{s}{\omega_0} + 1} \]
with:
</p>
<ul class="org-ul">
<li>\(\omega_0 = \sqrt{\frac{k}{m}}\)</li>
<li>\(\xi = \frac{1}{2} \sqrt{\frac{m}{k}}\)</li>
</ul>
<div id="org6e272e3" class="figure">
<p><img src="figs/inertial_sensor.png" alt="inertial_sensor.png" />
</p>
<p><span class="figure-number">Figure 16: </span>Schematic of a Z-Axis geophone</p>
</div>
<p>
We see that at frequencies below \(\omega_0\):
\[ \frac{d}{\ddot{w}} \approx -\frac{1}{{\omega_0}^2} \]
</p>
<p>
And thus, the measurement of the relative displacement of the mass with respect to its support gives the absolute acceleration of the support.
</p>
<p>
Note that there is trade-off between:
</p>
<ul class="org-ul">
<li>the highest measurable acceleration \(\omega_0\)</li>
<li>the sensitivity of the accelerometer which is equal to \(-\frac{1}{{\omega_0}^2}\)</li>
</ul>
</div>
</div>
<div id="outline-container-orgc4ffbf6" class="outline-4">
<h4 id="orgc4ffbf6">Function description</h4>
<div class="outline-text-4" id="text-orgc4ffbf6">
<div class="org-src-container">
<pre class="src src-matlab">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
</pre>
</div>
</div>
</div>
<div id="outline-container-org6b45828" class="outline-4">
<h4 id="org6b45828">Optional Parameters</h4>
<div class="outline-text-4" id="text-org6b45828">
<div class="org-src-container">
<pre class="src src-matlab">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
</pre>
</div>
</div>
</div>
<div id="outline-container-org463075d" class="outline-4">
<h4 id="org463075d">Compute the properties of the sensor</h4>
<div class="outline-text-4" id="text-org463075d">
<div class="org-src-container">
<pre class="src src-matlab">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
</pre>
</div>
</div>
</div>
<div id="outline-container-orga292b49" class="outline-4">
<h4 id="orga292b49">Populate the <code>stewart</code> structure</h4>
<div class="outline-text-4" id="text-orga292b49">
<div class="org-src-container">
<pre class="src src-matlab">stewart.sensors.inertial = sensor;
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org5266e9d" class="outline-3">
<h3 id="org5266e9d"><span class="section-number-3">5.13</span> <code>displayArchitecture</code>: 3D plot of the Stewart platform architecture</h3>
<div class="outline-text-3" id="text-5-13">
<p>
<a id="org5526211"></a>
</p>
<p>
This Matlab function is accessible <a href="../src/displayArchitecture.m">here</a>.
</p>
</div>
<div id="outline-container-org1619f14" class="outline-4">
<h4 id="org1619f14">Function description</h4>
<div class="outline-text-4" id="text-org1619f14">
<div class="org-src-container">
<pre class="src src-matlab">function [] = displayArchitecture(stewart, args)
% displayArchitecture - 3D plot of the Stewart platform architecture
%
% Syntax: [] = displayArchitecture(args)
%
% Inputs:
% - stewart
% - args - Structure with 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}
% - ARB [3x3] - The rotation matrix that gives the wanted orientation of {B} with respect to {A}
% - F_color [color] - Color used for the Fixed elements
% - M_color [color] - Color used for the Mobile elements
% - L_color [color] - Color used for the Legs elements
% - frames [true/false] - Display the Frames
% - legs [true/false] - Display the Legs
% - joints [true/false] - Display the Joints
% - labels [true/false] - Display the Labels
% - platforms [true/false] - Display the Platforms
% - views ['all', 'xy', 'yz', 'xz', 'default'] -
%
% Outputs:
</pre>
</div>
</div>
</div>
<div id="outline-container-orgf9184d1" class="outline-4">
<h4 id="orgf9184d1">Optional Parameters</h4>
<div class="outline-text-4" id="text-orgf9184d1">
<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)
args.F_color = [0 0.4470 0.7410]
args.M_color = [0.8500 0.3250 0.0980]
args.L_color = [0 0 0]
args.frames logical {mustBeNumericOrLogical} = true
args.legs logical {mustBeNumericOrLogical} = true
args.joints logical {mustBeNumericOrLogical} = true
args.labels logical {mustBeNumericOrLogical} = true
args.platforms logical {mustBeNumericOrLogical} = true
args.views char {mustBeMember(args.views,{'all', 'xy', 'xz', 'yz', 'default'})} = 'default'
end
</pre>
</div>
</div>
</div>
<div id="outline-container-org441ed7f" class="outline-4">
<h4 id="org441ed7f">Check the <code>stewart</code> structure elements</h4>
<div class="outline-text-4" id="text-org441ed7f">
<div class="org-src-container">
<pre class="src src-matlab">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;
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc088b18" class="outline-4">
<h4 id="orgc088b18">Figure Creation, Frames and Homogeneous transformations</h4>
<div class="outline-text-4" id="text-orgc088b18">
<p>
The reference frame of the 3d plot corresponds to the frame \(\{F\}\).
</p>
<div class="org-src-container">
<pre class="src src-matlab">if ~strcmp(args.views, 'all')
figure;
else
f = figure('visible', 'off');
end
hold on;
</pre>
</div>
<p>
We first compute homogeneous matrices that will be useful to position elements on the figure where the reference frame is \(\{F\}\).
</p>
<div class="org-src-container">
<pre class="src src-matlab">FTa = [eye(3), FO_A; ...
zeros(1,3), 1];
ATb = [args.ARB, args.AP; ...
zeros(1,3), 1];
BTm = [eye(3), -MO_B; ...
zeros(1,3), 1];
FTm = FTa*ATb*BTm;
</pre>
</div>
<p>
Let&rsquo;s define a parameter that define the length of the unit vectors used to display the frames.
</p>
<div class="org-src-container">
<pre class="src src-matlab">d_unit_vector = H/4;
</pre>
</div>
<p>
Let&rsquo;s define a parameter used to position the labels with respect to the center of the element.
</p>
<div class="org-src-container">
<pre class="src src-matlab">d_label = H/20;
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc25a979" class="outline-4">
<h4 id="orgc25a979">Fixed Base elements</h4>
<div class="outline-text-4" id="text-orgc25a979">
<p>
Let&rsquo;s first plot the frame \(\{F\}\).
</p>
<div class="org-src-container">
<pre class="src src-matlab">Ff = [0, 0, 0];
if args.frames
quiver3(Ff(1)*ones(1,3), Ff(2)*ones(1,3), Ff(3)*ones(1,3), ...
[d_unit_vector 0 0], [0 d_unit_vector 0], [0 0 d_unit_vector], '-', 'Color', args.F_color)
if args.labels
text(Ff(1) + d_label, ...
Ff(2) + d_label, ...
Ff(3) + d_label, '$\{F\}$', 'Color', args.F_color);
end
end
</pre>
</div>
<p>
Now plot the frame \(\{A\}\) fixed to the Base.
</p>
<div class="org-src-container">
<pre class="src src-matlab">if args.frames
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)
if args.labels
text(FO_A(1) + d_label, ...
FO_A(2) + d_label, ...
FO_A(3) + d_label, '$\{A\}$', 'Color', args.F_color);
end
end
</pre>
</div>
<p>
Let&rsquo;s then plot the circle corresponding to the shape of the Fixed base.
</p>
<div class="org-src-container">
<pre class="src src-matlab">if args.platforms &amp;&amp; stewart.platform_F.type == 1
theta = [0:0.01:2*pi+0.01]; % Angles [rad]
v = null([0; 0; 1]'); % Two vectors that are perpendicular to the circle normal
center = [0; 0; 0]; % Center of the circle
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));
plot3(points(1,:), ...
points(2,:), ...
points(3,:), '-', 'Color', args.F_color);
end
</pre>
</div>
<p>
Let&rsquo;s now plot the position and labels of the Fixed Joints
</p>
<div class="org-src-container">
<pre class="src src-matlab">if args.joints
scatter3(Fa(1,:), ...
Fa(2,:), ...
Fa(3,:), 'MarkerEdgeColor', args.F_color);
if args.labels
for i = 1:size(Fa,2)
text(Fa(1,i) + d_label, ...
Fa(2,i), ...
Fa(3,i), sprintf('$a_{%i}$', i), 'Color', args.F_color);
end
end
end
</pre>
</div>
</div>
</div>
<div id="outline-container-org8417772" class="outline-4">
<h4 id="org8417772">Mobile Platform elements</h4>
<div class="outline-text-4" id="text-org8417772">
<p>
Plot the frame \(\{M\}\).
</p>
<div class="org-src-container">
<pre class="src src-matlab">Fm = FTm*[0; 0; 0; 1]; % Get the position of frame {M} w.r.t. {F}
if args.frames
FM_uv = FTm*[d_unit_vector*eye(3); zeros(1,3)]; % Rotated Unit vectors
quiver3(Fm(1)*ones(1,3), Fm(2)*ones(1,3), Fm(3)*ones(1,3), ...
FM_uv(1,1:3), FM_uv(2,1:3), FM_uv(3,1:3), '-', 'Color', args.M_color)
if args.labels
text(Fm(1) + d_label, ...
Fm(2) + d_label, ...
Fm(3) + d_label, '$\{M\}$', 'Color', args.M_color);
end
end
</pre>
</div>
<p>
Plot the frame \(\{B\}\).
</p>
<div class="org-src-container">
<pre class="src src-matlab">FB = FO_A + args.AP;
if args.frames
FB_uv = FTm*[d_unit_vector*eye(3); zeros(1,3)]; % Rotated Unit vectors
quiver3(FB(1)*ones(1,3), FB(2)*ones(1,3), FB(3)*ones(1,3), ...
FB_uv(1,1:3), FB_uv(2,1:3), FB_uv(3,1:3), '-', 'Color', args.M_color)
if args.labels
text(FB(1) - d_label, ...
FB(2) + d_label, ...
FB(3) + d_label, '$\{B\}$', 'Color', args.M_color);
end
end
</pre>
</div>
<p>
Let&rsquo;s then plot the circle corresponding to the shape of the Mobile platform.
</p>
<div class="org-src-container">
<pre class="src src-matlab">if args.platforms &amp;&amp; stewart.platform_M.type == 1
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
center = Fm(1:3); % Center of the circle
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));
plot3(points(1,:), ...
points(2,:), ...
points(3,:), '-', 'Color', args.M_color);
end
</pre>
</div>
<p>
Plot the position and labels of the rotation joints fixed to the mobile platform.
</p>
<div class="org-src-container">
<pre class="src src-matlab">if args.joints
Fb = FTm*[Mb;ones(1,6)];
scatter3(Fb(1,:), ...
Fb(2,:), ...
Fb(3,:), 'MarkerEdgeColor', args.M_color);
if args.labels
for i = 1:size(Fb,2)
text(Fb(1,i) + d_label, ...
Fb(2,i), ...
Fb(3,i), sprintf('$b_{%i}$', i), 'Color', args.M_color);
end
end
end
</pre>
</div>
</div>
</div>
<div id="outline-container-org5f40b79" class="outline-4">
<h4 id="org5f40b79">Legs</h4>
<div class="outline-text-4" id="text-org5f40b79">
<p>
Plot the legs connecting the joints of the fixed base to the joints of the mobile platform.
</p>
<div class="org-src-container">
<pre class="src src-matlab">if args.legs
for i = 1:6
plot3([Fa(1,i), Fb(1,i)], ...
[Fa(2,i), Fb(2,i)], ...
[Fa(3,i), Fb(3,i)], '-', 'Color', args.L_color);
if args.labels
text((Fa(1,i)+Fb(1,i))/2 + d_label, ...
(Fa(2,i)+Fb(2,i))/2, ...
(Fa(3,i)+Fb(3,i))/2, sprintf('$%i$', i), 'Color', args.L_color);
end
end
end
</pre>
</div>
</div>
</div>
<div id="outline-container-org81be27b" class="outline-4">
<h4 id="org81be27b"><span class="section-number-4">5.13.1</span> Figure parameters</h4>
<div class="outline-text-4" id="text-5-13-1">
<div class="org-src-container">
<pre class="src src-matlab">switch args.views
case 'default'
view([1 -0.6 0.4]);
case 'xy'
view([0 0 1]);
case 'xz'
view([0 -1 0]);
case 'yz'
view([1 0 0]);
end
axis equal;
axis off;
</pre>
</div>
</div>
</div>
<div id="outline-container-orgf41db0f" class="outline-4">
<h4 id="orgf41db0f"><span class="section-number-4">5.13.2</span> Subplots</h4>
<div class="outline-text-4" id="text-5-13-2">
<div class="org-src-container">
<pre class="src src-matlab">if strcmp(args.views, 'all')
hAx = findobj('type', 'axes');
figure;
s1 = subplot(2,2,1);
copyobj(get(hAx(1), 'Children'), s1);
view([0 0 1]);
axis equal;
axis off;
title('Top')
s2 = subplot(2,2,2);
copyobj(get(hAx(1), 'Children'), s2);
view([1 -0.6 0.4]);
axis equal;
axis off;
s3 = subplot(2,2,3);
copyobj(get(hAx(1), 'Children'), s3);
view([1 0 0]);
axis equal;
axis off;
title('Front')
s4 = subplot(2,2,4);
copyobj(get(hAx(1), 'Children'), s4);
view([0 -1 0]);
axis equal;
axis off;
title('Side')
close(f);
end
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org3db8668" class="outline-3">
<h3 id="org3db8668"><span class="section-number-3">5.14</span> <code>describeStewartPlatform</code>: Display some text describing the current defined Stewart Platform</h3>
<div class="outline-text-3" id="text-5-14">
<p>
<a id="org6849838"></a>
</p>
<p>
This Matlab function is accessible <a href="../src/describeStewartPlatform.m">here</a>.
</p>
</div>
<div id="outline-container-org93d2ee5" class="outline-4">
<h4 id="org93d2ee5">Function description</h4>
<div class="outline-text-4" id="text-org93d2ee5">
<div class="org-src-container">
<pre class="src src-matlab">function [] = describeStewartPlatform(stewart)
% describeStewartPlatform - Display some text describing the current defined Stewart Platform
%
% Syntax: [] = describeStewartPlatform(args)
%
% Inputs:
% - stewart
%
% Outputs:
</pre>
</div>
</div>
</div>
<div id="outline-container-org4587f8f" class="outline-4">
<h4 id="org4587f8f">Optional Parameters</h4>
<div class="outline-text-4" id="text-org4587f8f">
<div class="org-src-container">
<pre class="src src-matlab">arguments
stewart
end
</pre>
</div>
</div>
</div>
<div id="outline-container-org0ad0d00" class="outline-4">
<h4 id="org0ad0d00"><span class="section-number-4">5.14.1</span> Geometry</h4>
<div class="outline-text-4" id="text-5-14-1">
<div class="org-src-container">
<pre class="src src-matlab">fprintf('GEOMETRY:\n')
fprintf('- The height between the fixed based and the top platform is %.3g [mm].\n', 1e3*stewart.geometry.H)
if stewart.platform_M.MO_B(3) &gt; 0
fprintf('- Frame {A} is located %.3g [mm] above the top platform.\n', 1e3*stewart.platform_M.MO_B(3))
else
fprintf('- Frame {A} is located %.3g [mm] below the top platform.\n', - 1e3*stewart.platform_M.MO_B(3))
end
fprintf('- The initial length of the struts are:\n')
fprintf('\t %.3g, %.3g, %.3g, %.3g, %.3g, %.3g [mm]\n', 1e3*stewart.geometry.l)
fprintf('\n')
</pre>
</div>
</div>
</div>
<div id="outline-container-org3d00e31" class="outline-4">
<h4 id="org3d00e31"><span class="section-number-4">5.14.2</span> Actuators</h4>
<div class="outline-text-4" id="text-5-14-2">
<div class="org-src-container">
<pre class="src src-matlab">fprintf('ACTUATORS:\n')
if stewart.actuators.type == 1
fprintf('- The actuators are classical.\n')
fprintf('- The Stiffness and Damping of each actuators is:\n')
fprintf('\t k = %.0e [N/m] \t c = %.0e [N/(m/s)]\n', stewart.actuators.K(1), stewart.actuators.C(1))
elseif stewart.actuators.type == 2
fprintf('- The actuators are mechanicaly amplified.\n')
fprintf('- The vertical stiffness and damping contribution of the piezoelectric stack is:\n')
fprintf('\t ka = %.0e [N/m] \t ca = %.0e [N/(m/s)]\n', stewart.actuators.Ka(1), stewart.actuators.Ca(1))
fprintf('- Vertical stiffness when the piezoelectric stack is removed is:\n')
fprintf('\t kr = %.0e [N/m] \t cr = %.0e [N/(m/s)]\n', stewart.actuators.Kr(1), stewart.actuators.Cr(1))
end
fprintf('\n')
</pre>
</div>
</div>
</div>
<div id="outline-container-org0933fe4" class="outline-4">
<h4 id="org0933fe4"><span class="section-number-4">5.14.3</span> Joints</h4>
<div class="outline-text-4" id="text-5-14-3">
<div class="org-src-container">
<pre class="src src-matlab">fprintf('JOINTS:\n')
</pre>
</div>
<p>
Type of the joints on the fixed base.
</p>
<div class="org-src-container">
<pre class="src src-matlab">switch stewart.joints_F.type
case 1
fprintf('- The joints on the fixed based are universal joints\n')
case 2
fprintf('- The joints on the fixed based are spherical joints\n')
case 3
fprintf('- The joints on the fixed based are perfect universal joints\n')
case 4
fprintf('- The joints on the fixed based are perfect spherical joints\n')
end
</pre>
</div>
<p>
Type of the joints on the mobile platform.
</p>
<div class="org-src-container">
<pre class="src src-matlab">switch stewart.joints_M.type
case 1
fprintf('- The joints on the mobile based are universal joints\n')
case 2
fprintf('- The joints on the mobile based are spherical joints\n')
case 3
fprintf('- The joints on the mobile based are perfect universal joints\n')
case 4
fprintf('- The joints on the mobile based are perfect spherical joints\n')
end
</pre>
</div>
<p>
Position of the fixed joints
</p>
<div class="org-src-container">
<pre class="src src-matlab">fprintf('- The position of the joints on the fixed based with respect to {F} are (in [mm]):\n')
fprintf('\t % .3g \t % .3g \t % .3g\n', 1e3*stewart.platform_F.Fa)
</pre>
</div>
<p>
Position of the mobile joints
</p>
<div class="org-src-container">
<pre class="src src-matlab">fprintf('- The position of the joints on the mobile based with respect to {M} are (in [mm]):\n')
fprintf('\t % .3g \t % .3g \t % .3g\n', 1e3*stewart.platform_M.Mb)
fprintf('\n')
</pre>
</div>
</div>
</div>
<div id="outline-container-org7f9d11e" class="outline-4">
<h4 id="org7f9d11e"><span class="section-number-4">5.14.4</span> Kinematics</h4>
<div class="outline-text-4" id="text-5-14-4">
<div class="org-src-container">
<pre class="src src-matlab">fprintf('KINEMATICS:\n')
if isfield(stewart.kinematics, 'K')
fprintf('- The Stiffness matrix K is (in [N/m]):\n')
fprintf('\t % .0e \t % .0e \t % .0e \t % .0e \t % .0e \t % .0e\n', stewart.kinematics.K)
end
if isfield(stewart.kinematics, 'C')
fprintf('- The Damping matrix C is (in [m/N]):\n')
fprintf('\t % .0e \t % .0e \t % .0e \t % .0e \t % .0e \t % .0e\n', stewart.kinematics.C)
end
</pre>
</div>
</div>
</div>
</div>
</div>
<p>
</p>
<style>.csl-entry{text-indent: -1.5em; margin-left: 1.5em;}</style><h2 class='citeproc-org-bib-h2'>Bibliography</h2>
<div class="csl-bib-body">
<div class="csl-entry"><a name="citeproc_bib_item_1"></a>Taghirad, Hamid. 2013. <i>Parallel Robots : Mechanics and Control</i>. Boca Raton, FL: CRC Press.</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
<p class="date">Created: 2020-09-01 mar. 13:18</p>
</div>
</body>
</html>