836 lines
53 KiB
HTML
836 lines
53 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>
|
|
<!-- 2019-12-20 ven. 17:49 -->
|
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title>Stewart Platform - Simscape Model</title>
|
|
<meta name="generator" content="Org mode" />
|
|
<meta name="author" content="Thomas Dehaeze" />
|
|
<style type="text/css">
|
|
<!--/*--><![CDATA[/*><!--*/
|
|
.title { text-align: center;
|
|
margin-bottom: .2em; }
|
|
.subtitle { text-align: center;
|
|
font-size: medium;
|
|
font-weight: bold;
|
|
margin-top:0; }
|
|
.todo { font-family: monospace; color: red; }
|
|
.done { font-family: monospace; color: green; }
|
|
.priority { font-family: monospace; color: orange; }
|
|
.tag { background-color: #eee; font-family: monospace;
|
|
padding: 2px; font-size: 80%; font-weight: normal; }
|
|
.timestamp { color: #bebebe; }
|
|
.timestamp-kwd { color: #5f9ea0; }
|
|
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
|
|
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
|
|
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
|
|
.underline { text-decoration: underline; }
|
|
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
|
|
p.verse { margin-left: 3%; }
|
|
pre {
|
|
border: 1px solid #ccc;
|
|
box-shadow: 3px 3px 3px #eee;
|
|
padding: 8pt;
|
|
font-family: monospace;
|
|
overflow: auto;
|
|
margin: 1.2em;
|
|
}
|
|
pre.src {
|
|
position: relative;
|
|
overflow: visible;
|
|
padding-top: 1.2em;
|
|
}
|
|
pre.src:before {
|
|
display: none;
|
|
position: absolute;
|
|
background-color: white;
|
|
top: -10px;
|
|
right: 10px;
|
|
padding: 3px;
|
|
border: 1px solid black;
|
|
}
|
|
pre.src:hover:before { display: inline;}
|
|
/* Languages per Org manual */
|
|
pre.src-asymptote:before { content: 'Asymptote'; }
|
|
pre.src-awk:before { content: 'Awk'; }
|
|
pre.src-C:before { content: 'C'; }
|
|
/* pre.src-C++ doesn't work in CSS */
|
|
pre.src-clojure:before { content: 'Clojure'; }
|
|
pre.src-css:before { content: 'CSS'; }
|
|
pre.src-D:before { content: 'D'; }
|
|
pre.src-ditaa:before { content: 'ditaa'; }
|
|
pre.src-dot:before { content: 'Graphviz'; }
|
|
pre.src-calc:before { content: 'Emacs Calc'; }
|
|
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
|
|
pre.src-fortran:before { content: 'Fortran'; }
|
|
pre.src-gnuplot:before { content: 'gnuplot'; }
|
|
pre.src-haskell:before { content: 'Haskell'; }
|
|
pre.src-hledger:before { content: 'hledger'; }
|
|
pre.src-java:before { content: 'Java'; }
|
|
pre.src-js:before { content: 'Javascript'; }
|
|
pre.src-latex:before { content: 'LaTeX'; }
|
|
pre.src-ledger:before { content: 'Ledger'; }
|
|
pre.src-lisp:before { content: 'Lisp'; }
|
|
pre.src-lilypond:before { content: 'Lilypond'; }
|
|
pre.src-lua:before { content: 'Lua'; }
|
|
pre.src-matlab:before { content: 'MATLAB'; }
|
|
pre.src-mscgen:before { content: 'Mscgen'; }
|
|
pre.src-ocaml:before { content: 'Objective Caml'; }
|
|
pre.src-octave:before { content: 'Octave'; }
|
|
pre.src-org:before { content: 'Org mode'; }
|
|
pre.src-oz:before { content: 'OZ'; }
|
|
pre.src-plantuml:before { content: 'Plantuml'; }
|
|
pre.src-processing:before { content: 'Processing.js'; }
|
|
pre.src-python:before { content: 'Python'; }
|
|
pre.src-R:before { content: 'R'; }
|
|
pre.src-ruby:before { content: 'Ruby'; }
|
|
pre.src-sass:before { content: 'Sass'; }
|
|
pre.src-scheme:before { content: 'Scheme'; }
|
|
pre.src-screen:before { content: 'Gnu Screen'; }
|
|
pre.src-sed:before { content: 'Sed'; }
|
|
pre.src-sh:before { content: 'shell'; }
|
|
pre.src-sql:before { content: 'SQL'; }
|
|
pre.src-sqlite:before { content: 'SQLite'; }
|
|
/* additional languages in org.el's org-babel-load-languages alist */
|
|
pre.src-forth:before { content: 'Forth'; }
|
|
pre.src-io:before { content: 'IO'; }
|
|
pre.src-J:before { content: 'J'; }
|
|
pre.src-makefile:before { content: 'Makefile'; }
|
|
pre.src-maxima:before { content: 'Maxima'; }
|
|
pre.src-perl:before { content: 'Perl'; }
|
|
pre.src-picolisp:before { content: 'Pico Lisp'; }
|
|
pre.src-scala:before { content: 'Scala'; }
|
|
pre.src-shell:before { content: 'Shell Script'; }
|
|
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
|
|
/* additional language identifiers per "defun org-babel-execute"
|
|
in ob-*.el */
|
|
pre.src-cpp:before { content: 'C++'; }
|
|
pre.src-abc:before { content: 'ABC'; }
|
|
pre.src-coq:before { content: 'Coq'; }
|
|
pre.src-groovy:before { content: 'Groovy'; }
|
|
/* additional language identifiers from org-babel-shell-names in
|
|
ob-shell.el: ob-shell is the only babel language using a lambda to put
|
|
the execution function name together. */
|
|
pre.src-bash:before { content: 'bash'; }
|
|
pre.src-csh:before { content: 'csh'; }
|
|
pre.src-ash:before { content: 'ash'; }
|
|
pre.src-dash:before { content: 'dash'; }
|
|
pre.src-ksh:before { content: 'ksh'; }
|
|
pre.src-mksh:before { content: 'mksh'; }
|
|
pre.src-posh:before { content: 'posh'; }
|
|
/* Additional Emacs modes also supported by the LaTeX listings package */
|
|
pre.src-ada:before { content: 'Ada'; }
|
|
pre.src-asm:before { content: 'Assembler'; }
|
|
pre.src-caml:before { content: 'Caml'; }
|
|
pre.src-delphi:before { content: 'Delphi'; }
|
|
pre.src-html:before { content: 'HTML'; }
|
|
pre.src-idl:before { content: 'IDL'; }
|
|
pre.src-mercury:before { content: 'Mercury'; }
|
|
pre.src-metapost:before { content: 'MetaPost'; }
|
|
pre.src-modula-2:before { content: 'Modula-2'; }
|
|
pre.src-pascal:before { content: 'Pascal'; }
|
|
pre.src-ps:before { content: 'PostScript'; }
|
|
pre.src-prolog:before { content: 'Prolog'; }
|
|
pre.src-simula:before { content: 'Simula'; }
|
|
pre.src-tcl:before { content: 'tcl'; }
|
|
pre.src-tex:before { content: 'TeX'; }
|
|
pre.src-plain-tex:before { content: 'Plain TeX'; }
|
|
pre.src-verilog:before { content: 'Verilog'; }
|
|
pre.src-vhdl:before { content: 'VHDL'; }
|
|
pre.src-xml:before { content: 'XML'; }
|
|
pre.src-nxml:before { content: 'XML'; }
|
|
/* add a generic configuration mode; LaTeX export needs an additional
|
|
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
|
|
pre.src-conf:before { content: 'Configuration File'; }
|
|
|
|
table { border-collapse:collapse; }
|
|
caption.t-above { caption-side: top; }
|
|
caption.t-bottom { caption-side: bottom; }
|
|
td, th { vertical-align:top; }
|
|
th.org-right { text-align: center; }
|
|
th.org-left { text-align: center; }
|
|
th.org-center { text-align: center; }
|
|
td.org-right { text-align: right; }
|
|
td.org-left { text-align: left; }
|
|
td.org-center { text-align: center; }
|
|
dt { font-weight: bold; }
|
|
.footpara { display: inline; }
|
|
.footdef { margin-bottom: 1em; }
|
|
.figure { padding: 1em; }
|
|
.figure p { text-align: center; }
|
|
.equation-container {
|
|
display: table;
|
|
text-align: center;
|
|
width: 100%;
|
|
}
|
|
.equation {
|
|
vertical-align: middle;
|
|
}
|
|
.equation-label {
|
|
display: table-cell;
|
|
text-align: right;
|
|
vertical-align: middle;
|
|
}
|
|
.inlinetask {
|
|
padding: 10px;
|
|
border: 2px solid gray;
|
|
margin: 10px;
|
|
background: #ffffcc;
|
|
}
|
|
#org-div-home-and-up
|
|
{ text-align: right; font-size: 70%; white-space: nowrap; }
|
|
textarea { overflow-x: auto; }
|
|
.linenr { font-size: smaller }
|
|
.code-highlighted { background-color: #ffff00; }
|
|
.org-info-js_info-navigation { border-style: none; }
|
|
#org-info-js_console-label
|
|
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
|
|
.org-info-js_search-highlight
|
|
{ background-color: #ffff00; color: #000000; font-weight: bold; }
|
|
.org-svg { width: 90%; }
|
|
/*]]>*/-->
|
|
</style>
|
|
<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 type="text/javascript">
|
|
/*
|
|
@licstart The following is the entire license notice for the
|
|
JavaScript code in this tag.
|
|
|
|
Copyright (C) 2012-2019 Free Software Foundation, Inc.
|
|
|
|
The JavaScript code in this tag is free software: you can
|
|
redistribute it and/or modify it under the terms of the GNU
|
|
General Public License (GNU GPL) as published by the Free Software
|
|
Foundation, either version 3 of the License, or (at your option)
|
|
any later version. The code is distributed WITHOUT ANY WARRANTY;
|
|
without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
|
|
|
|
As additional permission under GNU GPL version 3 section 7, you
|
|
may distribute non-source (e.g., minimized or compacted) forms of
|
|
that code without the copy of the GNU GPL normally required by
|
|
section 4, provided you include this license notice and a URL
|
|
through which recipients can access the Corresponding Source.
|
|
|
|
|
|
@licend The above is the entire license notice
|
|
for the JavaScript code in this tag.
|
|
*/
|
|
<!--/*--><![CDATA[/*><!--*/
|
|
function CodeHighlightOn(elem, id)
|
|
{
|
|
var target = document.getElementById(id);
|
|
if(null != target) {
|
|
elem.cacheClassElem = elem.className;
|
|
elem.cacheClassTarget = target.className;
|
|
target.className = "code-highlighted";
|
|
elem.className = "code-highlighted";
|
|
}
|
|
}
|
|
function CodeHighlightOff(elem, id)
|
|
{
|
|
var target = document.getElementById(id);
|
|
if(elem.cacheClassElem)
|
|
elem.className = elem.cacheClassElem;
|
|
if(elem.cacheClassTarget)
|
|
target.className = elem.cacheClassTarget;
|
|
}
|
|
/*]]>*///-->
|
|
</script>
|
|
<script type="text/x-mathjax-config">
|
|
MathJax.Hub.Config({
|
|
displayAlign: "center",
|
|
displayIndent: "0em",
|
|
|
|
"HTML-CSS": { scale: 100,
|
|
linebreaks: { automatic: "false" },
|
|
webFont: "TeX"
|
|
},
|
|
SVG: {scale: 100,
|
|
linebreaks: { automatic: "false" },
|
|
font: "TeX"},
|
|
NativeMML: {scale: 100},
|
|
TeX: { equationNumbers: {autoNumber: "AMS"},
|
|
MultLineWidth: "85%",
|
|
TagSide: "right",
|
|
TagIndent: ".8em",
|
|
Macros: {
|
|
bm: ["{\\boldsymbol #1}",1],
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
<script type="text/javascript"
|
|
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"></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 - Simscape Model</h1>
|
|
<div id="table-of-contents">
|
|
<h2>Table of Contents</h2>
|
|
<div id="text-table-of-contents">
|
|
<ul>
|
|
<li><a href="#org363c6fe">1. Procedure</a></li>
|
|
<li><a href="#orgbb97f5b">2. Matlab Code</a>
|
|
<ul>
|
|
<li><a href="#org26c49f2">2.1. Simscape Model</a></li>
|
|
<li><a href="#org0aee86d">2.2. Test the functions</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org6b23b15">3. <code>initializeFramesPositions</code>: Initialize the positions of frames {A}, {B}, {F} and {M}</a>
|
|
<ul>
|
|
<li><a href="#orgacce02d">3.1. Function description</a></li>
|
|
<li><a href="#orgbb19223">3.2. Optional Parameters</a></li>
|
|
<li><a href="#org830651c">3.3. Initialize the Stewart structure</a></li>
|
|
<li><a href="#org302ef83">3.4. Compute the position of each frame</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orgefabb7d">4. <code>generateCubicConfiguration</code>: Generate a Cubic Configuration</a>
|
|
<ul>
|
|
<li><a href="#orgaa4ebd9">4.1. Function description</a></li>
|
|
<li><a href="#org59cf450">4.2. Optional Parameters</a></li>
|
|
<li><a href="#orgc3b07d9">4.3. Position of the Cube</a></li>
|
|
<li><a href="#org4ab3f4c">4.4. Compute the pose</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org1a92b53">5. <code>computeJointsPose</code>: Compute the Pose of the Joints</a>
|
|
<ul>
|
|
<li><a href="#org8d2b6ea">5.1. Function description</a></li>
|
|
<li><a href="#org663872a">5.2. Compute the position of the Joints</a></li>
|
|
<li><a href="#org08b9460">5.3. Compute the strut length and orientation</a></li>
|
|
<li><a href="#orgde1237d">5.4. Compute the orientation of the Joints</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org23b3bc2">6. <code>initializeStrutDynamics</code>: Add Stiffness and Damping properties of each strut</a>
|
|
<ul>
|
|
<li><a href="#orgfc3e940">6.1. Function description</a></li>
|
|
<li><a href="#org33a48bd">6.2. Optional Parameters</a></li>
|
|
<li><a href="#org458bd27">6.3. Add Stiffness and Damping properties of each strut</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<p>
|
|
Stewart platforms are generated in multiple steps.
|
|
</p>
|
|
|
|
<p>
|
|
We define 4 important <b>frames</b>:
|
|
</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.
|
|
It defined the center of rotation of the moving platform.</li>
|
|
<li>\(\{B\}\): Frame fixed to the moving platform.
|
|
The motion of the moving platforms and forces applied to it are defined with respect to this frame \(\{B\}\).</li>
|
|
</ul>
|
|
|
|
<p>
|
|
Then, we define the <b>location of the spherical joints</b>:
|
|
</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>
|
|
We define the <b>rest position</b> of the Stewart platform:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>For simplicity, we suppose that the fixed base and the moving platform are parallel and aligned with the vertical axis at their rest position.</li>
|
|
<li>Thus, to define the rest position of the Stewart platform, we just have to defined its total height \(H\).
|
|
\(H\) corresponds to the distance from the bottom of the fixed base to the top of the moving platform.</li>
|
|
</ul>
|
|
|
|
<p>
|
|
From \(\bm{a}_{i}\) and \(\bm{b}_{i}\), we can determine the <b>length and orientation of each strut</b>:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>\(l_{i}\) is the length of the strut</li>
|
|
<li>\({}^{A}\hat{\bm{s}}_{i}\) is the unit vector align with the strut</li>
|
|
</ul>
|
|
|
|
<p>
|
|
The position of the Spherical joints can be computed using various methods:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>Cubic configuration</li>
|
|
<li>Circular configuration</li>
|
|
<li>Arbitrary position</li>
|
|
<li>These methods should be easily scriptable and corresponds to specific functions that returns \({}^{F}\bm{a}_{i}\) and \({}^{M}\bm{b}_{i}\).
|
|
The input of these functions are the parameters corresponding to the wanted geometry.</li>
|
|
</ul>
|
|
|
|
<p>
|
|
For Simscape, we need:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>The position and orientation of each spherical joint fixed to the fixed base: \({}^{F}\bm{a}_{i}\) and \({}^{F}\bm{R}_{a_{i}}\)</li>
|
|
<li>The position and orientation of each spherical joint fixed to the moving platform: \({}^{M}\bm{b}_{i}\) and \({}^{M}\bm{R}_{b_{i}}\)</li>
|
|
<li>The rest length of each strut: \(l_{i}\)</li>
|
|
<li>The stiffness and damping of each actuator: \(k_{i}\) and \(c_{i}\)</li>
|
|
<li>The position of the frame \(\{A\}\) with respect to the frame \(\{F\}\): \({}^{F}\bm{O}_{A}\)</li>
|
|
<li>The position of the frame \(\{B\}\) with respect to the frame \(\{M\}\): \({}^{M}\bm{O}_{B}\)</li>
|
|
</ul>
|
|
|
|
<div id="outline-container-org363c6fe" class="outline-2">
|
|
<h2 id="org363c6fe"><span class="section-number-2">1</span> Procedure</h2>
|
|
<div class="outline-text-2" id="text-1">
|
|
<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}O_{B}\) of {B} with respect to {M}.</li>
|
|
<li>Compute the positions of joints \({}^{F}a_{i}\) and \({}^{M}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.</li>
|
|
<li>Define the dynamical properties of the Stewart platform.
|
|
The output are the stiffness and damping of each strut \(k_{i}\) and \(c_{i}\).
|
|
This can be done we simply choosing directly the stiffness and damping of each strut.
|
|
The stiffness and damping of each actuator can also be determine from the wanted stiffness of the Stewart platform for instance.</li>
|
|
<li>Define the mass and inertia of each element of the Stewart platform.</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>
|
|
|
|
<div id="outline-container-orgbb97f5b" class="outline-2">
|
|
<h2 id="orgbb97f5b"><span class="section-number-2">2</span> Matlab Code</h2>
|
|
<div class="outline-text-2" id="text-2">
|
|
</div>
|
|
<div id="outline-container-org26c49f2" class="outline-3">
|
|
<h3 id="org26c49f2"><span class="section-number-3">2.1</span> Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-2-1">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">open<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'stewart_platform.slx'</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org0aee86d" class="outline-3">
|
|
<h3 id="org0aee86d"><span class="section-number-3">2.2</span> Test the functions</h3>
|
|
<div class="outline-text-3" id="text-2-2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">stewart = initializeFramesPositions<span class="org-rainbow-delimiters-depth-1">(</span>struct<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">'H'</span>, 90e<span class="org-type">-</span>3, <span class="org-string">'MO_B'</span>, 50e<span class="org-type">-</span>3<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
stewart = generateCubicConfiguration<span class="org-rainbow-delimiters-depth-1">(</span>stewart, struct<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">'Hc'</span>, 60e<span class="org-type">-</span>3, <span class="org-string">'FOc'</span>, 50e<span class="org-type">-</span>3, <span class="org-string">'FHa'</span>, 15e<span class="org-type">-</span>3, <span class="org-string">'MHb'</span>, 15e<span class="org-type">-</span>3<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
stewart = computeJointsPose<span class="org-rainbow-delimiters-depth-1">(</span>stewart<span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
stewart = initializeStrutDynamics<span class="org-rainbow-delimiters-depth-1">(</span>stewart, struct<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">'Ki'</span>, 1e6<span class="org-type">*</span>ones<span class="org-rainbow-delimiters-depth-3">(</span>6,1<span class="org-rainbow-delimiters-depth-3">)</span>, <span class="org-string">'Ci'</span>, 1e2<span class="org-type">*</span>ones<span class="org-rainbow-delimiters-depth-3">(</span>6,1<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org6b23b15" class="outline-2">
|
|
<h2 id="org6b23b15"><span class="section-number-2">3</span> <code>initializeFramesPositions</code>: Initialize the positions of frames {A}, {B}, {F} and {M}</h2>
|
|
<div class="outline-text-2" id="text-3">
|
|
<p>
|
|
<a id="org23d747c"></a>
|
|
</p>
|
|
|
|
<p>
|
|
This Matlab function is accessible <a href="src/initializeFramesPositions.m">here</a>.
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-orgacce02d" class="outline-3">
|
|
<h3 id="orgacce02d"><span class="section-number-3">3.1</span> Function description</h3>
|
|
<div class="outline-text-3" id="text-3-1">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name"><span class="org-rainbow-delimiters-depth-1">[</span></span><span class="org-variable-name">stewart</span><span class="org-variable-name"><span class="org-rainbow-delimiters-depth-1">]</span></span> = <span class="org-function-name">initializeFramesPositions</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">opts_param</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
<span class="org-comment">% initializeFramesPositions - Initialize the positions of frames {A}, {B}, {F} and {M}</span>
|
|
<span class="org-comment">%</span>
|
|
<span class="org-comment">% Syntax: [stewart] = initializeFramesPositions(H, MO_B)</span>
|
|
<span class="org-comment">%</span>
|
|
<span class="org-comment">% Inputs:</span>
|
|
<span class="org-comment">% - opts_param - Structure with the following fields:</span>
|
|
<span class="org-comment">% - H [1x1] - Total Height of the Stewart Platform [m]</span>
|
|
<span class="org-comment">% - MO_B [1x1] - Height of the frame {B} with respect to {M} [m]</span>
|
|
<span class="org-comment">%</span>
|
|
<span class="org-comment">% Outputs:</span>
|
|
<span class="org-comment">% - stewart - A structure with the following fields:</span>
|
|
<span class="org-comment">% - H [1x1] - Total Height of the Stewart Platform [m]</span>
|
|
<span class="org-comment">% - FO_M [3x1] - Position of {M} with respect to {F} [m]</span>
|
|
<span class="org-comment">% - MO_B [3x1] - Position of {B} with respect to {M} [m]</span>
|
|
<span class="org-comment">% - FO_A [3x1] - Position of {A} with respect to {F} [m]</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgbb19223" class="outline-3">
|
|
<h3 id="orgbb19223"><span class="section-number-3">3.2</span> Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-3-2">
|
|
<p>
|
|
Default values for opts.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">opts = struct<span class="org-rainbow-delimiters-depth-1">(</span> ...
|
|
<span class="org-string">'H'</span>, 90e<span class="org-type">-</span>3, ...<span class="org-comment"> % [m]</span>
|
|
<span class="org-string">'MO_B'</span>, 50e<span class="org-type">-</span>3 ...<span class="org-comment"> % [m]</span>
|
|
<span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Populate opts with input parameters
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">if</span> exist<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'opts_param'</span>,<span class="org-string">'var'</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
<span class="org-keyword">for</span> <span class="org-variable-name">opt</span> = <span class="org-constant">fieldnames</span><span class="org-constant"><span class="org-rainbow-delimiters-depth-1">(</span></span><span class="org-constant">opts_param</span><span class="org-constant"><span class="org-rainbow-delimiters-depth-1">)</span></span><span class="org-constant">'</span>
|
|
opts.<span class="org-rainbow-delimiters-depth-1">(</span>opt<span class="org-rainbow-delimiters-depth-2">{</span>1<span class="org-rainbow-delimiters-depth-2">}</span><span class="org-rainbow-delimiters-depth-1">)</span> = opts_param.<span class="org-rainbow-delimiters-depth-1">(</span>opt<span class="org-rainbow-delimiters-depth-2">{</span>1<span class="org-rainbow-delimiters-depth-2">}</span><span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
<span class="org-keyword">end</span>
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org830651c" class="outline-3">
|
|
<h3 id="org830651c"><span class="section-number-3">3.3</span> Initialize the Stewart structure</h3>
|
|
<div class="outline-text-3" id="text-3-3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">stewart = struct<span class="org-rainbow-delimiters-depth-1">()</span>;
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org302ef83" class="outline-3">
|
|
<h3 id="org302ef83"><span class="section-number-3">3.4</span> Compute the position of each frame</h3>
|
|
<div class="outline-text-3" id="text-3-4">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">stewart.H = opts.H; <span class="org-comment">% Total Height of the Stewart Platform [m]</span>
|
|
|
|
stewart.FO_M = <span class="org-rainbow-delimiters-depth-1">[</span>0; 0; stewart.H<span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-comment">% Position of {M} with respect to {F} [m]</span>
|
|
|
|
stewart.MO_B = <span class="org-rainbow-delimiters-depth-1">[</span>0; 0; opts.MO_B<span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-comment">% Position of {B} with respect to {M} [m]</span>
|
|
|
|
stewart.FO_A = stewart.MO_B <span class="org-type">+</span> stewart.FO_M; <span class="org-comment">% Position of {A} with respect to {F} [m]</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgefabb7d" class="outline-2">
|
|
<h2 id="orgefabb7d"><span class="section-number-2">4</span> <code>generateCubicConfiguration</code>: Generate a Cubic Configuration</h2>
|
|
<div class="outline-text-2" id="text-4">
|
|
<p>
|
|
<a id="org90fb821"></a>
|
|
</p>
|
|
|
|
<p>
|
|
This Matlab function is accessible <a href="src/generateCubicConfiguration.m">here</a>.
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-orgaa4ebd9" class="outline-3">
|
|
<h3 id="orgaa4ebd9"><span class="section-number-3">4.1</span> Function description</h3>
|
|
<div class="outline-text-3" id="text-4-1">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name"><span class="org-rainbow-delimiters-depth-1">[</span></span><span class="org-variable-name">stewart</span><span class="org-variable-name"><span class="org-rainbow-delimiters-depth-1">]</span></span> = <span class="org-function-name">generateCubicConfiguration</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">stewart</span>, <span class="org-variable-name">opts_param</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
<span class="org-comment">% generateCubicConfiguration - Generate a Cubic Configuration</span>
|
|
<span class="org-comment">%</span>
|
|
<span class="org-comment">% Syntax: [stewart] = generateCubicConfiguration(stewart, opts_param)</span>
|
|
<span class="org-comment">%</span>
|
|
<span class="org-comment">% Inputs:</span>
|
|
<span class="org-comment">% - stewart - A structure with the following fields</span>
|
|
<span class="org-comment">% - H [1x1] - Total height of the platform [m]</span>
|
|
<span class="org-comment">% - opts_param - Structure with the following fields:</span>
|
|
<span class="org-comment">% - Hc [1x1] - Height of the "useful" part of the cube [m]</span>
|
|
<span class="org-comment">% - FOc [1x1] - Height of the center of the cute with respect to {F} [m]</span>
|
|
<span class="org-comment">% - FHa [1x1] - Height of the plane joining the points ai with respect to the frame {F} [m]</span>
|
|
<span class="org-comment">% - MHb [1x1] - Height of the plane joining the points bi with respect to the frame {M} [m]</span>
|
|
<span class="org-comment">%</span>
|
|
<span class="org-comment">% Outputs:</span>
|
|
<span class="org-comment">% - stewart - updated Stewart structure with the added fields:</span>
|
|
<span class="org-comment">% - Fa [3x6] - Its i'th column is the position vector of joint ai with respect to {F}</span>
|
|
<span class="org-comment">% - Mb [3x6] - Its i'th column is the position vector of joint bi with respect to {M}</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org59cf450" class="outline-3">
|
|
<h3 id="org59cf450"><span class="section-number-3">4.2</span> Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-4-2">
|
|
<p>
|
|
Default values for opts.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">opts = struct<span class="org-rainbow-delimiters-depth-1">(</span> ...
|
|
<span class="org-string">'Hc'</span>, 60e<span class="org-type">-</span>3, ...<span class="org-comment"> % [m]</span>
|
|
<span class="org-string">'FOc'</span>, 50e<span class="org-type">-</span>3, ...<span class="org-comment"> % [m]</span>
|
|
<span class="org-string">'FHa'</span>, 15e<span class="org-type">-</span>3, ...<span class="org-comment"> % [m]</span>
|
|
<span class="org-string">'MHb'</span>, 15e<span class="org-type">-</span>3 ...<span class="org-comment"> % [m]</span>
|
|
<span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Populate opts with input parameters
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">if</span> exist<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'opts_param'</span>,<span class="org-string">'var'</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
<span class="org-keyword">for</span> <span class="org-variable-name">opt</span> = <span class="org-constant">fieldnames</span><span class="org-constant"><span class="org-rainbow-delimiters-depth-1">(</span></span><span class="org-constant">opts_param</span><span class="org-constant"><span class="org-rainbow-delimiters-depth-1">)</span></span><span class="org-constant">'</span>
|
|
opts.<span class="org-rainbow-delimiters-depth-1">(</span>opt<span class="org-rainbow-delimiters-depth-2">{</span>1<span class="org-rainbow-delimiters-depth-2">}</span><span class="org-rainbow-delimiters-depth-1">)</span> = opts_param.<span class="org-rainbow-delimiters-depth-1">(</span>opt<span class="org-rainbow-delimiters-depth-2">{</span>1<span class="org-rainbow-delimiters-depth-2">}</span><span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
<span class="org-keyword">end</span>
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgc3b07d9" class="outline-3">
|
|
<h3 id="orgc3b07d9"><span class="section-number-3">4.3</span> Position of the Cube</h3>
|
|
<div class="outline-text-3" id="text-4-3">
|
|
<p>
|
|
We define the useful points of the cube with respect to the Cube's center.
|
|
\({}^{C}C\) are the 6 vertices of the cubes expressed in a frame {C} which is located at the center of the cube and aligned with {F} and {M}.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">sx = <span class="org-rainbow-delimiters-depth-1">[</span> 2; <span class="org-type">-</span>1; <span class="org-type">-</span>1<span class="org-rainbow-delimiters-depth-1">]</span>;
|
|
sy = <span class="org-rainbow-delimiters-depth-1">[</span> 0; 1; <span class="org-type">-</span>1<span class="org-rainbow-delimiters-depth-1">]</span>;
|
|
sz = <span class="org-rainbow-delimiters-depth-1">[</span> 1; 1; 1<span class="org-rainbow-delimiters-depth-1">]</span>;
|
|
|
|
R = <span class="org-rainbow-delimiters-depth-1">[</span>sx, sy, sz<span class="org-rainbow-delimiters-depth-1">]</span><span class="org-type">./</span>vecnorm<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">[</span>sx, sy, sz<span class="org-rainbow-delimiters-depth-2">]</span><span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
|
|
L = opts.Hc<span class="org-type">*</span>sqrt<span class="org-rainbow-delimiters-depth-1">(</span>3<span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
|
|
Cc = R<span class="org-type">'*</span><span class="org-rainbow-delimiters-depth-1">[</span><span class="org-rainbow-delimiters-depth-2">[</span>0;0;L<span class="org-rainbow-delimiters-depth-2">]</span>,<span class="org-rainbow-delimiters-depth-2">[</span>L;0;L<span class="org-rainbow-delimiters-depth-2">]</span>,<span class="org-rainbow-delimiters-depth-2">[</span>L;0;0<span class="org-rainbow-delimiters-depth-2">]</span>,<span class="org-rainbow-delimiters-depth-2">[</span>L;L;0<span class="org-rainbow-delimiters-depth-2">]</span>,<span class="org-rainbow-delimiters-depth-2">[</span>0;L;0<span class="org-rainbow-delimiters-depth-2">]</span>,<span class="org-rainbow-delimiters-depth-2">[</span>0;L;L<span class="org-rainbow-delimiters-depth-2">]</span><span class="org-rainbow-delimiters-depth-1">]</span> <span class="org-type">-</span> <span class="org-rainbow-delimiters-depth-1">[</span>0;0;1.5<span class="org-type">*</span>opts.Hc<span class="org-rainbow-delimiters-depth-1">]</span>;
|
|
|
|
CCf = <span class="org-rainbow-delimiters-depth-1">[</span>Cc<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">:</span>,1<span class="org-rainbow-delimiters-depth-2">)</span>, Cc<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">:</span>,3<span class="org-rainbow-delimiters-depth-2">)</span>, Cc<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">:</span>,3<span class="org-rainbow-delimiters-depth-2">)</span>, Cc<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">:</span>,5<span class="org-rainbow-delimiters-depth-2">)</span>, Cc<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">:</span>,5<span class="org-rainbow-delimiters-depth-2">)</span>, Cc<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">:</span>,1<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-comment">% CCf(:,i) corresponds to the bottom cube's vertice corresponding to the i'th leg</span>
|
|
CCm = <span class="org-rainbow-delimiters-depth-1">[</span>Cc<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">:</span>,2<span class="org-rainbow-delimiters-depth-2">)</span>, Cc<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">:</span>,2<span class="org-rainbow-delimiters-depth-2">)</span>, Cc<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">:</span>,4<span class="org-rainbow-delimiters-depth-2">)</span>, Cc<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">:</span>,4<span class="org-rainbow-delimiters-depth-2">)</span>, Cc<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">:</span>,6<span class="org-rainbow-delimiters-depth-2">)</span>, Cc<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">:</span>,6<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-comment">% CCm(:,i) corresponds to the top cube's vertice corresponding to the i'th leg</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org4ab3f4c" class="outline-3">
|
|
<h3 id="org4ab3f4c"><span class="section-number-3">4.4</span> Compute the pose</h3>
|
|
<div class="outline-text-3" id="text-4-4">
|
|
<p>
|
|
We can compute the vector of each leg \({}^{C}\hat{\bm{s}}_{i}\) (unit vector from \({}^{C}C_{f}\) to \({}^{C}C_{m}\)).
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">CSi = <span class="org-rainbow-delimiters-depth-1">(</span>CCm <span class="org-type">-</span> CCf<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">./</span>vecnorm<span class="org-rainbow-delimiters-depth-1">(</span>CCm <span class="org-type">-</span> CCf<span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
We now which to compute the position of the joints \(a_{i}\) and \(b_{i}\).
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">stewart.Fa = CCf <span class="org-type">+</span> <span class="org-rainbow-delimiters-depth-1">[</span>0; 0; opts.FOc<span class="org-rainbow-delimiters-depth-1">]</span> <span class="org-type">+</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>opts.FHa<span class="org-type">-</span><span class="org-rainbow-delimiters-depth-3">(</span>opts.FOc<span class="org-type">-</span>opts.Hc<span class="org-type">/</span>2<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">./</span>CSi<span class="org-rainbow-delimiters-depth-2">(</span>3,<span class="org-type">:</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">.*</span>CSi;
|
|
stewart.Mb = CCf <span class="org-type">+</span> <span class="org-rainbow-delimiters-depth-1">[</span>0; 0; opts.FOc<span class="org-type">-</span>stewart.H<span class="org-rainbow-delimiters-depth-1">]</span> <span class="org-type">+</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>stewart.H<span class="org-type">-</span>opts.MHb<span class="org-type">-</span><span class="org-rainbow-delimiters-depth-3">(</span>opts.FOc<span class="org-type">-</span>opts.Hc<span class="org-type">/</span>2<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-type">./</span>CSi<span class="org-rainbow-delimiters-depth-2">(</span>3,<span class="org-type">:</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">.*</span>CSi;
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org1a92b53" class="outline-2">
|
|
<h2 id="org1a92b53"><span class="section-number-2">5</span> <code>computeJointsPose</code>: Compute the Pose of the Joints</h2>
|
|
<div class="outline-text-2" id="text-5">
|
|
<p>
|
|
<a id="orgcb2a95c"></a>
|
|
</p>
|
|
|
|
<p>
|
|
This Matlab function is accessible <a href="src/computeJointsPose.m">here</a>.
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org8d2b6ea" class="outline-3">
|
|
<h3 id="org8d2b6ea"><span class="section-number-3">5.1</span> Function description</h3>
|
|
<div class="outline-text-3" id="text-5-1">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name"><span class="org-rainbow-delimiters-depth-1">[</span></span><span class="org-variable-name">stewart</span><span class="org-variable-name"><span class="org-rainbow-delimiters-depth-1">]</span></span> = <span class="org-function-name">computeJointsPose</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">stewart</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
<span class="org-comment">% computeJointsPose -</span>
|
|
<span class="org-comment">%</span>
|
|
<span class="org-comment">% Syntax: [stewart] = computeJointsPose(stewart, opts_param)</span>
|
|
<span class="org-comment">%</span>
|
|
<span class="org-comment">% Inputs:</span>
|
|
<span class="org-comment">% - stewart - A structure with the following fields</span>
|
|
<span class="org-comment">% - FO_A [3x1] - Position of {A} with respect to {F}</span>
|
|
<span class="org-comment">% - MO_B [3x1] - Position of {B} with respect to {M}</span>
|
|
<span class="org-comment">% - FO_M [3x1] - Position of {M} with respect to {F}</span>
|
|
<span class="org-comment">%</span>
|
|
<span class="org-comment">% Outputs:</span>
|
|
<span class="org-comment">% - stewart - A structure with the following added fields</span>
|
|
<span class="org-comment">% - Aa [3x6] - The i'th column is the position of ai with respect to {A}</span>
|
|
<span class="org-comment">% - Ab [3x6] - The i'th column is the position of bi with respect to {A}</span>
|
|
<span class="org-comment">% - Ba [3x6] - The i'th column is the position of ai with respect to {B}</span>
|
|
<span class="org-comment">% - Bb [3x6] - The i'th column is the position of bi with respect to {B}</span>
|
|
<span class="org-comment">% - l [6x1] - The i'th element is the initial length of strut i</span>
|
|
<span class="org-comment">% - As [3x6] - The i'th column is the unit vector of strut i expressed in {A}</span>
|
|
<span class="org-comment">% - Bs [3x6] - The i'th column is the unit vector of strut i expressed in {B}</span>
|
|
<span class="org-comment">% - FRa [3x3x6] - The i'th 3x3 array is the rotation matrix to orientate the bottom of the i'th strut from {F}</span>
|
|
<span class="org-comment">% - MRb [3x3x6] - The i'th 3x3 array is the rotation matrix to orientate the top of the i'th strut from {M}</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org663872a" class="outline-3">
|
|
<h3 id="org663872a"><span class="section-number-3">5.2</span> Compute the position of the Joints</h3>
|
|
<div class="outline-text-3" id="text-5-2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">stewart.Aa = stewart.Fa <span class="org-type">-</span> repmat<span class="org-rainbow-delimiters-depth-1">(</span>stewart.FO_A, <span class="org-rainbow-delimiters-depth-2">[</span>1, 6<span class="org-rainbow-delimiters-depth-2">]</span><span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
stewart.Bb = stewart.Mb <span class="org-type">-</span> repmat<span class="org-rainbow-delimiters-depth-1">(</span>stewart.MO_B, <span class="org-rainbow-delimiters-depth-2">[</span>1, 6<span class="org-rainbow-delimiters-depth-2">]</span><span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
|
|
stewart.Ab = stewart.Bb <span class="org-type">-</span> repmat<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-type">-</span>stewart.MO_B<span class="org-type">-</span>stewart.FO_M<span class="org-type">+</span>stewart.FO_A, <span class="org-rainbow-delimiters-depth-2">[</span>1, 6<span class="org-rainbow-delimiters-depth-2">]</span><span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
stewart.Ba = stewart.Aa <span class="org-type">-</span> repmat<span class="org-rainbow-delimiters-depth-1">(</span> stewart.MO_B<span class="org-type">+</span>stewart.FO_M<span class="org-type">-</span>stewart.FO_A, <span class="org-rainbow-delimiters-depth-2">[</span>1, 6<span class="org-rainbow-delimiters-depth-2">]</span><span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org08b9460" class="outline-3">
|
|
<h3 id="org08b9460"><span class="section-number-3">5.3</span> Compute the strut length and orientation</h3>
|
|
<div class="outline-text-3" id="text-5-3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">stewart.As = <span class="org-rainbow-delimiters-depth-1">(</span>stewart.Ab <span class="org-type">-</span> stewart.Aa<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">./</span>vecnorm<span class="org-rainbow-delimiters-depth-1">(</span>stewart.Ab <span class="org-type">-</span> stewart.Aa<span class="org-rainbow-delimiters-depth-1">)</span>; <span class="org-comment">% As_i is the i'th vector of As</span>
|
|
|
|
stewart.l = vecnorm<span class="org-rainbow-delimiters-depth-1">(</span>stewart.Ab <span class="org-type">-</span> stewart.Aa<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">'</span>;
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">stewart.Bs = <span class="org-rainbow-delimiters-depth-1">(</span>stewart.Bb <span class="org-type">-</span> stewart.Ba<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">./</span>vecnorm<span class="org-rainbow-delimiters-depth-1">(</span>stewart.Bb <span class="org-type">-</span> stewart.Ba<span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgde1237d" class="outline-3">
|
|
<h3 id="orgde1237d"><span class="section-number-3">5.4</span> Compute the orientation of the Joints</h3>
|
|
<div class="outline-text-3" id="text-5-4">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">stewart.FRa = zeros<span class="org-rainbow-delimiters-depth-1">(</span>3,3,6<span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
stewart.MRb = zeros<span class="org-rainbow-delimiters-depth-1">(</span>3,3,6<span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
|
|
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:6</span>
|
|
stewart.FRa<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span><span class="org-rainbow-delimiters-depth-1">)</span> = <span class="org-rainbow-delimiters-depth-1">[</span>cross<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">[</span>0;1;0<span class="org-rainbow-delimiters-depth-3">]</span>, stewart.As<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-type">:</span>,<span class="org-constant">i</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span> , cross<span class="org-rainbow-delimiters-depth-2">(</span>stewart.As<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-type">:</span>,<span class="org-constant">i</span><span class="org-rainbow-delimiters-depth-3">)</span>, cross<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">[</span>0;1;0<span class="org-rainbow-delimiters-depth-4">]</span>, stewart.As<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-type">:</span>,<span class="org-constant">i</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span> , stewart.As<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">:</span>,<span class="org-constant">i</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">]</span>;
|
|
stewart.FRa<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span><span class="org-rainbow-delimiters-depth-1">)</span> = stewart.FRa<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">./</span>vecnorm<span class="org-rainbow-delimiters-depth-1">(</span>stewart.FRa<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
|
|
stewart.MRb<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span><span class="org-rainbow-delimiters-depth-1">)</span> = <span class="org-rainbow-delimiters-depth-1">[</span>cross<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">[</span>0;1;0<span class="org-rainbow-delimiters-depth-3">]</span>, stewart.Bs<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-type">:</span>,<span class="org-constant">i</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span> , cross<span class="org-rainbow-delimiters-depth-2">(</span>stewart.Bs<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-type">:</span>,<span class="org-constant">i</span><span class="org-rainbow-delimiters-depth-3">)</span>, cross<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">[</span>0;1;0<span class="org-rainbow-delimiters-depth-4">]</span>, stewart.Bs<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-type">:</span>,<span class="org-constant">i</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span> , stewart.Bs<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">:</span>,<span class="org-constant">i</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">]</span>;
|
|
stewart.MRb<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span><span class="org-rainbow-delimiters-depth-1">)</span> = stewart.MRb<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-type">./</span>vecnorm<span class="org-rainbow-delimiters-depth-1">(</span>stewart.MRb<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org23b3bc2" class="outline-2">
|
|
<h2 id="org23b3bc2"><span class="section-number-2">6</span> <code>initializeStrutDynamics</code>: Add Stiffness and Damping properties of each strut</h2>
|
|
<div class="outline-text-2" id="text-6">
|
|
<p>
|
|
<a id="org15d65d8"></a>
|
|
</p>
|
|
|
|
<p>
|
|
This Matlab function is accessible <a href="src/initializeStrutDynamics.m">here</a>.
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-orgfc3e940" class="outline-3">
|
|
<h3 id="orgfc3e940"><span class="section-number-3">6.1</span> Function description</h3>
|
|
<div class="outline-text-3" id="text-6-1">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name"><span class="org-rainbow-delimiters-depth-1">[</span></span><span class="org-variable-name">stewart</span><span class="org-variable-name"><span class="org-rainbow-delimiters-depth-1">]</span></span> = <span class="org-function-name">initializeStrutDynamics</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">stewart</span>, <span class="org-variable-name">opts_param</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
<span class="org-comment">% initializeStrutDynamics - Add Stiffness and Damping properties of each strut</span>
|
|
<span class="org-comment">%</span>
|
|
<span class="org-comment">% Syntax: [stewart] = initializeStrutDynamics(opts_param)</span>
|
|
<span class="org-comment">%</span>
|
|
<span class="org-comment">% Inputs:</span>
|
|
<span class="org-comment">% - opts_param - Structure with the following fields:</span>
|
|
<span class="org-comment">% - Ki [6x1] - Stiffness of each strut [N/m]</span>
|
|
<span class="org-comment">% - Ci [6x1] - Damping of each strut [N/(m/s)]</span>
|
|
<span class="org-comment">%</span>
|
|
<span class="org-comment">% Outputs:</span>
|
|
<span class="org-comment">% - stewart - updated Stewart structure with the added fields:</span>
|
|
<span class="org-comment">% - Ki [6x1] - Stiffness of each strut [N/m]</span>
|
|
<span class="org-comment">% - Ci [6x1] - Damping of each strut [N/(m/s)]</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org33a48bd" class="outline-3">
|
|
<h3 id="org33a48bd"><span class="section-number-3">6.2</span> Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-6-2">
|
|
<p>
|
|
Default values for opts.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">opts = struct<span class="org-rainbow-delimiters-depth-1">(</span> ...
|
|
<span class="org-string">'Ki'</span>, 1e6<span class="org-type">*</span>ones<span class="org-rainbow-delimiters-depth-2">(</span>6,1<span class="org-rainbow-delimiters-depth-2">)</span>, ...<span class="org-comment"> % [N/m]</span>
|
|
<span class="org-string">'Ci'</span>, 1e2<span class="org-type">*</span>ones<span class="org-rainbow-delimiters-depth-2">(</span>6,1<span class="org-rainbow-delimiters-depth-2">)</span> ...<span class="org-comment"> % [N/(m/s)]</span>
|
|
<span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Populate opts with input parameters
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">if</span> exist<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'opts_param'</span>,<span class="org-string">'var'</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
<span class="org-keyword">for</span> <span class="org-variable-name">opt</span> = <span class="org-constant">fieldnames</span><span class="org-constant"><span class="org-rainbow-delimiters-depth-1">(</span></span><span class="org-constant">opts_param</span><span class="org-constant"><span class="org-rainbow-delimiters-depth-1">)</span></span><span class="org-constant">'</span>
|
|
opts.<span class="org-rainbow-delimiters-depth-1">(</span>opt<span class="org-rainbow-delimiters-depth-2">{</span>1<span class="org-rainbow-delimiters-depth-2">}</span><span class="org-rainbow-delimiters-depth-1">)</span> = opts_param.<span class="org-rainbow-delimiters-depth-1">(</span>opt<span class="org-rainbow-delimiters-depth-2">{</span>1<span class="org-rainbow-delimiters-depth-2">}</span><span class="org-rainbow-delimiters-depth-1">)</span>;
|
|
<span class="org-keyword">end</span>
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org458bd27" class="outline-3">
|
|
<h3 id="org458bd27"><span class="section-number-3">6.3</span> Add Stiffness and Damping properties of each strut</h3>
|
|
<div class="outline-text-3" id="text-6-3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">stewart.Ki = opts.Ki;
|
|
stewart.Ci = opts.Ci;
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="postamble" class="status">
|
|
<p class="author">Author: Thomas Dehaeze</p>
|
|
<p class="date">Created: 2019-12-20 ven. 17:49</p>
|
|
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
|
|
</div>
|
|
</body>
|
|
</html>
|