2270 lines
101 KiB
HTML
2270 lines
101 KiB
HTML
<?xml version="1.0" encoding="utf-8"?>
|
|
<?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-02-03 lun. 17:50 -->
|
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title>Subsystems used for the Simscape Models</title>
|
|
<meta name="generator" content="Org mode" />
|
|
<meta name="author" content="Dehaeze Thomas" />
|
|
<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"/>
|
|
<link rel="stylesheet" type="text/css" href="../css/zenburn.css"/>
|
|
<script type="text/javascript" src="../js/jquery.min.js"></script>
|
|
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
|
|
<script type="text/javascript" src="../js/jquery.stickytableheaders.min.js"></script>
|
|
<script type="text/javascript" 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-2020 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>
|
|
</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">Subsystems used for the Simscape Models</h1>
|
|
<div id="table-of-contents">
|
|
<h2>Table of Contents</h2>
|
|
<div id="text-table-of-contents">
|
|
<ul>
|
|
<li><a href="#org24fecd0">1. Ground</a>
|
|
<ul>
|
|
<li><a href="#org38c2a50">Simscape Model</a></li>
|
|
<li><a href="#orgbea8190">Function description</a></li>
|
|
<li><a href="#orgf18be46">1.1. Function content</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org986974d">2. Granite</a>
|
|
<ul>
|
|
<li><a href="#org35b1621">Simscape Model</a></li>
|
|
<li><a href="#org61e2e22">Function description</a></li>
|
|
<li><a href="#orgd519a90">Optional Parameters</a></li>
|
|
<li><a href="#org831399b">Function content</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org96eb619">3. Translation Stage</a>
|
|
<ul>
|
|
<li><a href="#org9145419">Simscape Model</a></li>
|
|
<li><a href="#orge5ad8d7">Function description</a></li>
|
|
<li><a href="#orgc5c9db0">Optional Parameters</a></li>
|
|
<li><a href="#orgd0b44d4">Function content</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orgf987405">4. Tilt Stage</a>
|
|
<ul>
|
|
<li><a href="#org84f3c05">Simscape Model</a></li>
|
|
<li><a href="#org7db55ca">Function description</a></li>
|
|
<li><a href="#org3f7baeb">Optional Parameters</a></li>
|
|
<li><a href="#org1356969">Function content</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org337e2e4">5. Spindle</a>
|
|
<ul>
|
|
<li><a href="#orgd79b270">Simscape Model</a></li>
|
|
<li><a href="#orga14209c">Function description</a></li>
|
|
<li><a href="#org268d789">Optional Parameters</a></li>
|
|
<li><a href="#org9f47b77">Function content</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orga9a2f3d">6. Micro Hexapod</a>
|
|
<ul>
|
|
<li><a href="#orgbf8ff53">Simscape Model</a></li>
|
|
<li><a href="#org3e2ffad">Function description</a></li>
|
|
<li><a href="#org4841d4e">Optional Parameters</a></li>
|
|
<li><a href="#orgf0627eb">Function content</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org9a2ef73">7. Center of gravity compensation</a>
|
|
<ul>
|
|
<li><a href="#orga90d992">Simscape Model</a></li>
|
|
<li><a href="#org471bdfc">Function description</a></li>
|
|
<li><a href="#orgc9a8eba">Optional Parameters</a></li>
|
|
<li><a href="#org5b79853">Function content</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org25bbe89">8. Mirror</a>
|
|
<ul>
|
|
<li><a href="#org0d3e9fc">Simscape Model</a></li>
|
|
<li><a href="#orga55279b">Function description</a></li>
|
|
<li><a href="#org2f5fbef">Optional Parameters</a></li>
|
|
<li><a href="#org49f3ae9">Function content</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org78820bf">9. Nano Hexapod</a>
|
|
<ul>
|
|
<li><a href="#orga5c9f7b">Simscape Model</a></li>
|
|
<li><a href="#orgdd116d3">Function description</a></li>
|
|
<li><a href="#orga9e9d2d">Optional Parameters</a></li>
|
|
<li><a href="#org2dc960a">Function content</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orgf2f70c8">10. Sample</a>
|
|
<ul>
|
|
<li><a href="#org8595c5a">Simscape Model</a></li>
|
|
<li><a href="#orgcfe3954">Function description</a></li>
|
|
<li><a href="#orgfc63702">Optional Parameters</a></li>
|
|
<li><a href="#orgd132686">Function content</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orgeeed03f">11. Generate Reference Signals</a>
|
|
<ul>
|
|
<li><a href="#org10e0036">Function Declaration and Documentation</a></li>
|
|
<li><a href="#org5407b72">Optional Parameters</a></li>
|
|
<li><a href="#org305283f">Initialize Parameters</a></li>
|
|
<li><a href="#org7536993">Translation Stage</a></li>
|
|
<li><a href="#org7d3086c">Tilt Stage</a></li>
|
|
<li><a href="#org4f0a106">Spindle</a></li>
|
|
<li><a href="#org552aaf9">Micro Hexapod</a></li>
|
|
<li><a href="#org8cb66c8">Axis Compensation</a></li>
|
|
<li><a href="#orge18457b">Nano Hexapod</a></li>
|
|
<li><a href="#orgd30bcd5">Save</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org14370d0">12. Initialize Disturbances</a>
|
|
<ul>
|
|
<li><a href="#org0dd4c94">Function Declaration and Documentation</a></li>
|
|
<li><a href="#orgeb97bab">Optional Parameters</a></li>
|
|
<li><a href="#org31a3a0f">Load Data</a></li>
|
|
<li><a href="#orgd42aef1">Parameters</a></li>
|
|
<li><a href="#org32e95d0">Ground Motion</a></li>
|
|
<li><a href="#orgb479ac1">Translation Stage - X direction</a></li>
|
|
<li><a href="#org5f1ce80">Translation Stage - Z direction</a></li>
|
|
<li><a href="#org29a5822">Spindle - Z direction</a></li>
|
|
<li><a href="#org123d0e1">Direct Forces</a></li>
|
|
<li><a href="#org9f0d544">Set initial value to zero</a></li>
|
|
<li><a href="#org4394b83">Save</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org012182d">13. Z-Axis Geophone</a></li>
|
|
<li><a href="#orgcbfdd06">14. Z-Axis Accelerometer</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<p>
|
|
The full Simscape Model is represented in Figure <a href="#org2ac59f9">1</a>.
|
|
</p>
|
|
|
|
|
|
<div id="org2ac59f9" class="figure">
|
|
<p><img src="figs/images/simscape_picture.png" alt="simscape_picture.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 1: </span>Screenshot of the Multi-Body Model representation</p>
|
|
</div>
|
|
|
|
<p>
|
|
This model is divided into multiple subsystems that are independent.
|
|
These subsystems are saved in separate files and imported in the main file using a block balled “subsystem reference”.
|
|
</p>
|
|
|
|
<p>
|
|
Each stage is configured (geometry, mass properties, dynamic properties …) using one function.
|
|
</p>
|
|
|
|
<p>
|
|
These functions are defined below.
|
|
</p>
|
|
|
|
<div id="outline-container-org24fecd0" class="outline-2">
|
|
<h2 id="org24fecd0"><span class="section-number-2">1</span> Ground</h2>
|
|
<div class="outline-text-2" id="text-1">
|
|
<p>
|
|
<a id="org0dcc872"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org38c2a50" class="outline-3">
|
|
<h3 id="org38c2a50">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-org38c2a50">
|
|
<p>
|
|
The model of the Ground is composed of:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>A <b>Cartesian</b> joint that is used to simulation the ground motion</li>
|
|
<li>A solid that represents the ground on which the granite is located</li>
|
|
</ul>
|
|
|
|
|
|
<div id="org8b53b3e" class="figure">
|
|
<p><img src="figs/images/simscape_model_ground.png" alt="simscape_model_ground.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 2: </span>Simscape model for the Ground</p>
|
|
</div>
|
|
|
|
|
|
<div id="orgdddd7d2" class="figure">
|
|
<p><img src="figs/images/simscape_picture_ground.png" alt="simscape_picture_ground.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 3: </span>Simscape picture for the Ground</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgbea8190" class="outline-3">
|
|
<h3 id="orgbea8190">Function description</h3>
|
|
<div class="outline-text-3" id="text-orgbea8190">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[ground]</span> = <span class="org-function-name">initializeGround</span>()
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgf18be46" class="outline-3">
|
|
<h3 id="orgf18be46"><span class="section-number-3">1.1</span> Function content</h3>
|
|
<div class="outline-text-3" id="text-1-1">
|
|
<p>
|
|
First, we initialize the <code>granite</code> structure.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">ground = struct();
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
We set the shape and density of the ground solid element.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">ground.shape = [2, 2, 0.5]; <span class="org-comment">% [m]</span>
|
|
ground.density = 2800; <span class="org-comment">% [kg/m3]</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
The <code>ground</code> structure is saved.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save(<span class="org-string">'./mat/stages.mat'</span>, <span class="org-string">'ground'</span>, <span class="org-string">'-append'</span>);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org986974d" class="outline-2">
|
|
<h2 id="org986974d"><span class="section-number-2">2</span> Granite</h2>
|
|
<div class="outline-text-2" id="text-2">
|
|
<p>
|
|
<a id="org9f38209"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org35b1621" class="outline-3">
|
|
<h3 id="org35b1621">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-org35b1621">
|
|
<p>
|
|
The Simscape model of the granite is composed of:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>A cartesian joint such that the granite can vibrations along x, y and z axis</li>
|
|
<li>A solid</li>
|
|
</ul>
|
|
|
|
<p>
|
|
The output <code>sample_pos</code> corresponds to the impact point of the X-ray.
|
|
</p>
|
|
|
|
|
|
<div id="org3fbd593" class="figure">
|
|
<p><img src="figs/images/simscape_model_granite.png" alt="simscape_model_granite.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 4: </span>Simscape model for the Granite</p>
|
|
</div>
|
|
|
|
|
|
<div id="org1f18c35" class="figure">
|
|
<p><img src="figs/images/simscape_picture_granite.png" alt="simscape_picture_granite.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 5: </span>Simscape picture for the Granite</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org61e2e22" class="outline-3">
|
|
<h3 id="org61e2e22">Function description</h3>
|
|
<div class="outline-text-3" id="text-org61e2e22">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[granite]</span> = <span class="org-function-name">initializeGranite</span>(<span class="org-variable-name">args</span>)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgd519a90" class="outline-3">
|
|
<h3 id="orgd519a90">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-orgd519a90">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.density (1,1) double {mustBeNumeric, mustBeNonnegative} = 2800 <span class="org-comment">% Density [kg/m3]</span>
|
|
args.x0 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% Rest position of the Joint in the X direction [m]</span>
|
|
args.y0 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% Rest position of the Joint in the Y direction [m]</span>
|
|
args.z0 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% Rest position of the Joint in the Z direction [m]</span>
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org831399b" class="outline-3">
|
|
<h3 id="org831399b">Function content</h3>
|
|
<div class="outline-text-3" id="text-org831399b">
|
|
<p>
|
|
First, we initialize the <code>granite</code> structure.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">granite = struct();
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Properties of the Material and link to the geometry of the granite.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">granite.density = args.density; <span class="org-comment">% [kg/m3]</span>
|
|
granite.STEP = <span class="org-string">'./STEPS/granite/granite.STEP'</span>;
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Stiffness of the connection with Ground.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">granite.k.x = 4e9; <span class="org-comment">% [N/m]</span>
|
|
granite.k.y = 3e8; <span class="org-comment">% [N/m]</span>
|
|
granite.k.z = 8e8; <span class="org-comment">% [N/m]</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Damping of the connection with Ground.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">granite.c.x = 4.0e5; <span class="org-comment">% [N/(m/s)]</span>
|
|
granite.c.y = 1.1e5; <span class="org-comment">% [N/(m/s)]</span>
|
|
granite.c.z = 9.0e5; <span class="org-comment">% [N/(m/s)]</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Equilibrium position of the Cartesian joint.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">granite.x0 = args.x0;
|
|
granite.y0 = args.y0;
|
|
granite.z0 = args.z0;
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Z-offset for the initial position of the sample with respect to the granite top surface.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">granite.sample_pos = 0.8; <span class="org-comment">% [m]</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
The <code>granite</code> structure is saved.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save(<span class="org-string">'./mat/stages.mat'</span>, <span class="org-string">'granite'</span>, <span class="org-string">'-append'</span>);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org96eb619" class="outline-2">
|
|
<h2 id="org96eb619"><span class="section-number-2">3</span> Translation Stage</h2>
|
|
<div class="outline-text-2" id="text-3">
|
|
<p>
|
|
<a id="orgef3354a"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org9145419" class="outline-3">
|
|
<h3 id="org9145419">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-org9145419">
|
|
<p>
|
|
The Simscape model of the Translation stage consist of:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>One rigid body for the fixed part of the translation stage</li>
|
|
<li>One rigid body for the moving part of the translation stage</li>
|
|
<li>Four 6-DOF Joints that only have some rigidity in the X and Z directions.
|
|
The rigidity in rotation comes from the fact that we use multiple joints that are located at different points</li>
|
|
<li>One 6-DOF joint that represent the Actuator.
|
|
It is used to impose the motion in the Y direction</li>
|
|
<li>One 6-DOF joint to inject force disturbance in the X and Z directions</li>
|
|
</ul>
|
|
|
|
|
|
<div id="orge183483" class="figure">
|
|
<p><img src="figs/images/simscape_model_ty.png" alt="simscape_model_ty.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 6: </span>Simscape model for the Translation Stage</p>
|
|
</div>
|
|
|
|
|
|
<div id="orgf77c023" class="figure">
|
|
<p><img src="figs/images/simscape_picture_ty.png" alt="simscape_picture_ty.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 7: </span>Simscape picture for the Translation Stage</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge5ad8d7" class="outline-3">
|
|
<h3 id="orge5ad8d7">Function description</h3>
|
|
<div class="outline-text-3" id="text-orge5ad8d7">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[ty]</span> = <span class="org-function-name">initializeTy</span>(<span class="org-variable-name">args</span>)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgc5c9db0" class="outline-3">
|
|
<h3 id="orgc5c9db0">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-orgc5c9db0">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.x11 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.z11 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.x21 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.z21 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.x12 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.z12 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.x22 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.z22 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgd0b44d4" class="outline-3">
|
|
<h3 id="orgd0b44d4">Function content</h3>
|
|
<div class="outline-text-3" id="text-orgd0b44d4">
|
|
<p>
|
|
First, we initialize the <code>ty</code> structure.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">ty = struct();
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Define the density of the materials as well as the geometry (STEP files).
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-comment">% Ty Granite frame</span>
|
|
ty.granite_frame.density = 7800; <span class="org-comment">% [kg/m3] => 43kg</span>
|
|
ty.granite_frame.STEP = <span class="org-string">'./STEPS/Ty/Ty_Granite_Frame.STEP'</span>;
|
|
|
|
<span class="org-comment">% Guide Translation Ty</span>
|
|
ty.guide.density = 7800; <span class="org-comment">% [kg/m3] => 76kg</span>
|
|
ty.guide.STEP = <span class="org-string">'./STEPS/ty/Ty_Guide.STEP'</span>;
|
|
|
|
<span class="org-comment">% Ty - Guide_Translation12</span>
|
|
ty.guide12.density = 7800; <span class="org-comment">% [kg/m3]</span>
|
|
ty.guide12.STEP = <span class="org-string">'./STEPS/Ty/Ty_Guide_12.STEP'</span>;
|
|
|
|
<span class="org-comment">% Ty - Guide_Translation11</span>
|
|
ty.guide11.density = 7800; <span class="org-comment">% [kg/m3]</span>
|
|
ty.guide11.STEP = <span class="org-string">'./STEPS/ty/Ty_Guide_11.STEP'</span>;
|
|
|
|
<span class="org-comment">% Ty - Guide_Translation22</span>
|
|
ty.guide22.density = 7800; <span class="org-comment">% [kg/m3]</span>
|
|
ty.guide22.STEP = <span class="org-string">'./STEPS/ty/Ty_Guide_22.STEP'</span>;
|
|
|
|
<span class="org-comment">% Ty - Guide_Translation21</span>
|
|
ty.guide21.density = 7800; <span class="org-comment">% [kg/m3]</span>
|
|
ty.guide21.STEP = <span class="org-string">'./STEPS/Ty/Ty_Guide_21.STEP'</span>;
|
|
|
|
<span class="org-comment">% Ty - Plateau translation</span>
|
|
ty.frame.density = 7800; <span class="org-comment">% [kg/m3]</span>
|
|
ty.frame.STEP = <span class="org-string">'./STEPS/ty/Ty_Stage.STEP'</span>;
|
|
|
|
<span class="org-comment">% Ty Stator Part</span>
|
|
ty.stator.density = 5400; <span class="org-comment">% [kg/m3]</span>
|
|
ty.stator.STEP = <span class="org-string">'./STEPS/ty/Ty_Motor_Stator.STEP'</span>;
|
|
|
|
<span class="org-comment">% Ty Rotor Part</span>
|
|
ty.rotor.density = 5400; <span class="org-comment">% [kg/m3]</span>
|
|
ty.rotor.STEP = <span class="org-string">'./STEPS/ty/Ty_Motor_Rotor.STEP'</span>;
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Stiffness of the stage.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">ty.k.ax = 5e8; <span class="org-comment">% Axial Stiffness for each of the 4 guidance (y) [N/m]</span>
|
|
ty.k.rad = 5e7; <span class="org-comment">% Radial Stiffness for each of the 4 guidance (x-z) [N/m]</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Damping of the stage.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">ty.c.ax = 70710; <span class="org-comment">% [N/(m/s)]</span>
|
|
ty.c.rad = 22360; <span class="org-comment">% [N/(m/s)]</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Equilibrium position of the joints.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">ty.x0_11 = args.x11;
|
|
ty.z0_11 = args.z11;
|
|
ty.x0_12 = args.x12;
|
|
ty.z0_12 = args.z12;
|
|
ty.x0_21 = args.x21;
|
|
ty.z0_21 = args.z21;
|
|
ty.x0_22 = args.x22;
|
|
ty.z0_22 = args.z22;
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
The <code>ty</code> structure is saved.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save(<span class="org-string">'./mat/stages.mat'</span>, <span class="org-string">'ty'</span>, <span class="org-string">'-append'</span>);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgf987405" class="outline-2">
|
|
<h2 id="orgf987405"><span class="section-number-2">4</span> Tilt Stage</h2>
|
|
<div class="outline-text-2" id="text-4">
|
|
<p>
|
|
<a id="orgbd58d0c"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org84f3c05" class="outline-3">
|
|
<h3 id="org84f3c05">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-org84f3c05">
|
|
<p>
|
|
The Simscape model of the Tilt stage is composed of:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>Two solid bodies for the two part of the stage</li>
|
|
<li><b>Four</b> 6-DOF joints to model the flexibility of the stage.
|
|
These joints are virtually located along the rotation axis and are connecting the two solid bodies.
|
|
These joints have some translation stiffness in the u-v-w directions aligned with the joint.
|
|
The stiffness in rotation between the two solids is due to the fact that the 4 joints are connecting the two solids are different locations</li>
|
|
<li>A Bushing Joint used for the Actuator.
|
|
The Ry motion is imposed by the input.</li>
|
|
</ul>
|
|
|
|
|
|
<div id="orge190172" class="figure">
|
|
<p><img src="figs/images/simscape_model_ry.png" alt="simscape_model_ry.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 8: </span>Simscape model for the Tilt Stage</p>
|
|
</div>
|
|
|
|
|
|
<div id="orge0d4a43" class="figure">
|
|
<p><img src="figs/images/simscape_picture_ry.png" alt="simscape_picture_ry.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 9: </span>Simscape picture for the Tilt Stage</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org7db55ca" class="outline-3">
|
|
<h3 id="org7db55ca">Function description</h3>
|
|
<div class="outline-text-3" id="text-org7db55ca">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[ry]</span> = <span class="org-function-name">initializeRy</span>(<span class="org-variable-name">args</span>)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org3f7baeb" class="outline-3">
|
|
<h3 id="org3f7baeb">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-org3f7baeb">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.x11 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.y11 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.z11 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.x12 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.y12 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.z12 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.x21 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.y21 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.z21 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.x22 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.y22 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.z22 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org1356969" class="outline-3">
|
|
<h3 id="org1356969">Function content</h3>
|
|
<div class="outline-text-3" id="text-org1356969">
|
|
<p>
|
|
First, we initialize the <code>ry</code> structure.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">ry = struct();
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Properties of the Material and link to the geometry of the Tilt stage.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-comment">% Ry - Guide for the tilt stage</span>
|
|
ry.guide.density = 7800; <span class="org-comment">% [kg/m3]</span>
|
|
ry.guide.STEP = <span class="org-string">'./STEPS/ry/Tilt_Guide.STEP'</span>;
|
|
|
|
<span class="org-comment">% Ry - Rotor of the motor</span>
|
|
ry.rotor.density = 2400; <span class="org-comment">% [kg/m3]</span>
|
|
ry.rotor.STEP = <span class="org-string">'./STEPS/ry/Tilt_Motor_Axis.STEP'</span>;
|
|
|
|
<span class="org-comment">% Ry - Motor</span>
|
|
ry.motor.density = 3200; <span class="org-comment">% [kg/m3]</span>
|
|
ry.motor.STEP = <span class="org-string">'./STEPS/ry/Tilt_Motor.STEP'</span>;
|
|
|
|
<span class="org-comment">% Ry - Plateau Tilt</span>
|
|
ry.stage.density = 7800; <span class="org-comment">% [kg/m3]</span>
|
|
ry.stage.STEP = <span class="org-string">'./STEPS/ry/Tilt_Stage.STEP'</span>;
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Stiffness of the stage.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">ry.k.tilt = 1e4; <span class="org-comment">% Rotation stiffness around y [N*m/deg]</span>
|
|
ry.k.h = 1e8; <span class="org-comment">% Stiffness in the direction of the guidance [N/m]</span>
|
|
ry.k.rad = 1e8; <span class="org-comment">% Stiffness in the top direction [N/m]</span>
|
|
ry.k.rrad = 1e8; <span class="org-comment">% Stiffness in the side direction [N/m]</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Damping of the stage.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">ry.c.tilt = 2.8e2;
|
|
ry.c.h = 2.8e4;
|
|
ry.c.rad = 2.8e4;
|
|
ry.c.rrad = 2.8e4;
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Equilibrium position of the joints.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">ry.x0_11 = args.x11;
|
|
ry.y0_11 = args.y11;
|
|
ry.z0_11 = args.z11;
|
|
ry.x0_12 = args.x12;
|
|
ry.y0_12 = args.y12;
|
|
ry.z0_12 = args.z12;
|
|
ry.x0_21 = args.x21;
|
|
ry.y0_21 = args.y21;
|
|
ry.z0_21 = args.z21;
|
|
ry.x0_22 = args.x22;
|
|
ry.y0_22 = args.y22;
|
|
ry.z0_22 = args.z22;
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Z-Offset so that the center of rotation matches the sample center;
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">ry.z_offset = 0.58178; <span class="org-comment">% [m]</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
The <code>ty</code> structure is saved.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save(<span class="org-string">'./mat/stages.mat'</span>, <span class="org-string">'ry'</span>, <span class="org-string">'-append'</span>);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org337e2e4" class="outline-2">
|
|
<h2 id="org337e2e4"><span class="section-number-2">5</span> Spindle</h2>
|
|
<div class="outline-text-2" id="text-5">
|
|
<p>
|
|
<a id="org5f0e9c3"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-orgd79b270" class="outline-3">
|
|
<h3 id="orgd79b270">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-orgd79b270">
|
|
<p>
|
|
The Simscape model of the Spindle is composed of:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>Two rigid bodies: the stator and the rotor</li>
|
|
<li>A Bushing Joint that is used both as the actuator (the Rz motion is imposed by the input) and as the force perturbation in the Z direction.</li>
|
|
<li>The Bushing joint has some flexibility in the X-Y-Z directions as well as in Rx and Ry rotations</li>
|
|
</ul>
|
|
|
|
|
|
<div id="org2aa38c3" class="figure">
|
|
<p><img src="figs/images/simscape_model_rz.png" alt="simscape_model_rz.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 10: </span>Simscape model for the Spindle</p>
|
|
</div>
|
|
|
|
|
|
<div id="org4c5d2eb" class="figure">
|
|
<p><img src="figs/images/simscape_picture_rz.png" alt="simscape_picture_rz.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 11: </span>Simscape picture for the Spindle</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orga14209c" class="outline-3">
|
|
<h3 id="orga14209c">Function description</h3>
|
|
<div class="outline-text-3" id="text-orga14209c">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[rz]</span> = <span class="org-function-name">initializeRz</span>(<span class="org-variable-name">args</span>)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org268d789" class="outline-3">
|
|
<h3 id="org268d789">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-org268d789">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.rigid logical {mustBeNumericOrLogical} = <span class="org-constant">false</span>
|
|
args.x0 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.y0 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.z0 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.rx0 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [rad]</span>
|
|
args.ry0 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [rad]</span>
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org9f47b77" class="outline-3">
|
|
<h3 id="org9f47b77">Function content</h3>
|
|
<div class="outline-text-3" id="text-org9f47b77">
|
|
<p>
|
|
First, we initialize the <code>rz</code> structure.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">rz = struct();
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Properties of the Material and link to the geometry of the spindle.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-comment">% Spindle - Slip Ring</span>
|
|
rz.slipring.density = 7800; <span class="org-comment">% [kg/m3]</span>
|
|
rz.slipring.STEP = <span class="org-string">'./STEPS/rz/Spindle_Slip_Ring.STEP'</span>;
|
|
|
|
<span class="org-comment">% Spindle - Rotor</span>
|
|
rz.rotor.density = 7800; <span class="org-comment">% [kg/m3]</span>
|
|
rz.rotor.STEP = <span class="org-string">'./STEPS/rz/Spindle_Rotor.STEP'</span>;
|
|
|
|
<span class="org-comment">% Spindle - Stator</span>
|
|
rz.stator.density = 7800; <span class="org-comment">% [kg/m3]</span>
|
|
rz.stator.STEP = <span class="org-string">'./STEPS/rz/Spindle_Stator.STEP'</span>;
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Stiffness of the stage.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">rz.k.rot = 1e6; <span class="org-comment">% TODO - Rotational Stiffness (Rz) [N*m/deg]</span>
|
|
rz.k.tilt = 1e6; <span class="org-comment">% Rotational Stiffness (Rx, Ry) [N*m/deg]</span>
|
|
rz.k.ax = 2e9; <span class="org-comment">% Axial Stiffness (Z) [N/m]</span>
|
|
rz.k.rad = 7e8; <span class="org-comment">% Radial Stiffness (X, Y) [N/m]</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Damping of the stage.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">rz.c.rot = 1.6e3;
|
|
rz.c.tilt = 1.6e3;
|
|
rz.c.ax = 7.1e4;
|
|
rz.c.rad = 4.2e4;
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Equilibrium position of the joints.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">rz.x0 = args.x0;
|
|
rz.y0 = args.y0;
|
|
rz.z0 = args.z0;
|
|
rz.rx0 = args.rx0;
|
|
rz.ry0 = args.ry0;
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
The <code>rz</code> structure is saved.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save(<span class="org-string">'./mat/stages.mat'</span>, <span class="org-string">'rz'</span>, <span class="org-string">'-append'</span>);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orga9a2f3d" class="outline-2">
|
|
<h2 id="orga9a2f3d"><span class="section-number-2">6</span> Micro Hexapod</h2>
|
|
<div class="outline-text-2" id="text-6">
|
|
<p>
|
|
<a id="orgd8026c4"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-orgbf8ff53" class="outline-3">
|
|
<h3 id="orgbf8ff53">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-orgbf8ff53">
|
|
|
|
<div id="org6cb0e9e" class="figure">
|
|
<p><img src="figs/images/simscape_model_micro_hexapod.png" alt="simscape_model_micro_hexapod.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 12: </span>Simscape model for the Micro-Hexapod</p>
|
|
</div>
|
|
|
|
|
|
<div id="orgd747fcb" class="figure">
|
|
<p><img src="figs/images/simscape_picture_micro_hexapod.png" alt="simscape_picture_micro_hexapod.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 13: </span>Simscape picture for the Micro-Hexapod</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org3e2ffad" class="outline-3">
|
|
<h3 id="org3e2ffad">Function description</h3>
|
|
<div class="outline-text-3" id="text-org3e2ffad">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[micro_hexapod]</span> = <span class="org-function-name">initializeMicroHexapod</span>(<span class="org-variable-name">args</span>)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org4841d4e" class="outline-3">
|
|
<h3 id="org4841d4e">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-org4841d4e">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
<span class="org-comment">% initializeFramesPositions</span>
|
|
args.H (1,1) double {mustBeNumeric, mustBePositive} = 350e<span class="org-type">-</span>3
|
|
args.MO_B (1,1) double {mustBeNumeric} = 270e<span class="org-type">-</span>3
|
|
<span class="org-comment">% generateGeneralConfiguration</span>
|
|
args.FH (1,1) double {mustBeNumeric, mustBePositive} = 50e<span class="org-type">-</span>3
|
|
args.FR (1,1) double {mustBeNumeric, mustBePositive} = 175.5e<span class="org-type">-</span>3
|
|
args.FTh (6,1) double {mustBeNumeric} = [<span class="org-type">-</span>10, 10, 120<span class="org-type">-</span>10, 120<span class="org-type">+</span>10, 240<span class="org-type">-</span>10, 240<span class="org-type">+</span>10]<span class="org-type">*</span>(<span class="org-constant">pi</span><span class="org-type">/</span>180)
|
|
args.MH (1,1) double {mustBeNumeric, mustBePositive} = 45e<span class="org-type">-</span>3
|
|
args.MR (1,1) double {mustBeNumeric, mustBePositive} = 118e<span class="org-type">-</span>3
|
|
args.MTh (6,1) double {mustBeNumeric} = [<span class="org-type">-</span>60<span class="org-type">+</span>10, 60<span class="org-type">-</span>10, 60<span class="org-type">+</span>10, 180<span class="org-type">-</span>10, 180<span class="org-type">+</span>10, <span class="org-type">-</span>60<span class="org-type">-</span>10]<span class="org-type">*</span>(<span class="org-constant">pi</span><span class="org-type">/</span>180)
|
|
<span class="org-comment">% initializeStrutDynamics</span>
|
|
args.Ki (6,1) double {mustBeNumeric, mustBeNonnegative} = 2e7<span class="org-type">*</span>ones(6,1)
|
|
args.Ci (6,1) double {mustBeNumeric, mustBeNonnegative} = 1.4e3<span class="org-type">*</span>ones(6,1)
|
|
<span class="org-comment">% initializeCylindricalPlatforms</span>
|
|
args.Fpm (1,1) double {mustBeNumeric, mustBePositive} = 10
|
|
args.Fph (1,1) double {mustBeNumeric, mustBePositive} = 26e<span class="org-type">-</span>3
|
|
args.Fpr (1,1) double {mustBeNumeric, mustBePositive} = 207.5e<span class="org-type">-</span>3
|
|
args.Mpm (1,1) double {mustBeNumeric, mustBePositive} = 10
|
|
args.Mph (1,1) double {mustBeNumeric, mustBePositive} = 26e<span class="org-type">-</span>3
|
|
args.Mpr (1,1) double {mustBeNumeric, mustBePositive} = 150e<span class="org-type">-</span>3
|
|
<span class="org-comment">% initializeCylindricalStruts</span>
|
|
args.Fsm (1,1) double {mustBeNumeric, mustBePositive} = 1
|
|
args.Fsh (1,1) double {mustBeNumeric, mustBePositive} = 100e<span class="org-type">-</span>3
|
|
args.Fsr (1,1) double {mustBeNumeric, mustBePositive} = 25e<span class="org-type">-</span>3
|
|
args.Msm (1,1) double {mustBeNumeric, mustBePositive} = 1
|
|
args.Msh (1,1) double {mustBeNumeric, mustBePositive} = 100e<span class="org-type">-</span>3
|
|
args.Msr (1,1) double {mustBeNumeric, mustBePositive} = 25e<span class="org-type">-</span>3
|
|
<span class="org-comment">% inverseKinematics</span>
|
|
args.AP (3,1) double {mustBeNumeric} = zeros(3,1)
|
|
args.ARB (3,3) double {mustBeNumeric} = eye(3)
|
|
<span class="org-comment">% Equilibrium position of each leg</span>
|
|
args.dLeq (6,1) double {mustBeNumeric} = zeros(6,1)
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgf0627eb" class="outline-3">
|
|
<h3 id="orgf0627eb">Function content</h3>
|
|
<div class="outline-text-3" id="text-orgf0627eb">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">micro_hexapod = initializeFramesPositions(<span class="org-string">'H'</span>, args.H, <span class="org-string">'MO_B'</span>, args.MO_B);
|
|
micro_hexapod = generateGeneralConfiguration(micro_hexapod, <span class="org-string">'FH'</span>, args.FH, <span class="org-string">'FR'</span>, args.FR, <span class="org-string">'FTh'</span>, args.FTh, <span class="org-string">'MH'</span>, args.MH, <span class="org-string">'MR'</span>, args.MR, <span class="org-string">'MTh'</span>, args.MTh);
|
|
micro_hexapod = computeJointsPose(micro_hexapod);
|
|
micro_hexapod = initializeStrutDynamics(micro_hexapod, <span class="org-string">'Ki'</span>, args.Ki, <span class="org-string">'Ci'</span>, args.Ci);
|
|
micro_hexapod = initializeCylindricalPlatforms(micro_hexapod, <span class="org-string">'Fpm'</span>, args.Fpm, <span class="org-string">'Fph'</span>, args.Fph, <span class="org-string">'Fpr'</span>, args.Fpr, <span class="org-string">'Mpm'</span>, args.Mpm, <span class="org-string">'Mph'</span>, args.Mph, <span class="org-string">'Mpr'</span>, args.Mpr);
|
|
micro_hexapod = initializeCylindricalStruts(micro_hexapod, <span class="org-string">'Fsm'</span>, args.Fsm, <span class="org-string">'Fsh'</span>, args.Fsh, <span class="org-string">'Fsr'</span>, args.Fsr, <span class="org-string">'Msm'</span>, args.Msm, <span class="org-string">'Msh'</span>, args.Msh, <span class="org-string">'Msr'</span>, args.Msr);
|
|
micro_hexapod = computeJacobian(micro_hexapod);
|
|
[Li, dLi] = inverseKinematics(micro_hexapod, <span class="org-string">'AP'</span>, args.AP, <span class="org-string">'ARB'</span>, args.ARB);
|
|
micro_hexapod.Li = Li;
|
|
micro_hexapod.dLi = dLi;
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Equilibrium position of the each joint.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">micro_hexapod.dLeq = args.dLeq;
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
The <code>micro_hexapod</code> structure is saved.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save(<span class="org-string">'./mat/stages.mat'</span>, <span class="org-string">'micro_hexapod'</span>, <span class="org-string">'-append'</span>);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org9a2ef73" class="outline-2">
|
|
<h2 id="org9a2ef73"><span class="section-number-2">7</span> Center of gravity compensation</h2>
|
|
<div class="outline-text-2" id="text-7">
|
|
<p>
|
|
<a id="org78dbda2"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-orga90d992" class="outline-3">
|
|
<h3 id="orga90d992">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-orga90d992">
|
|
<p>
|
|
The Simscape model of the Center of gravity compensator is composed of:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>One main solid that is connected to two other solids (the masses to position of center of mass) through two revolute joints</li>
|
|
<li>The angle of both revolute joints is set by the input</li>
|
|
</ul>
|
|
|
|
|
|
<div id="org346194a" class="figure">
|
|
<p><img src="figs/images/simscape_model_axisc.png" alt="simscape_model_axisc.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 14: </span>Simscape model for the Center of Mass compensation system</p>
|
|
</div>
|
|
|
|
|
|
<div id="orgf28b8e0" class="figure">
|
|
<p><img src="figs/images/simscape_picture_axisc.png" alt="simscape_picture_axisc.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 15: </span>Simscape picture for the Center of Mass compensation system</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org471bdfc" class="outline-3">
|
|
<h3 id="org471bdfc">Function description</h3>
|
|
<div class="outline-text-3" id="text-org471bdfc">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[axisc]</span> = <span class="org-function-name">initializeAxisc</span>()
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgc9a8eba" class="outline-3">
|
|
<h3 id="orgc9a8eba">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-orgc9a8eba">
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="outline-container-org5b79853" class="outline-3">
|
|
<h3 id="org5b79853">Function content</h3>
|
|
<div class="outline-text-3" id="text-org5b79853">
|
|
<p>
|
|
First, we initialize the <code>axisc</code> structure.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">axisc = struct();
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Properties of the Material and link to the geometry files.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-comment">% Structure</span>
|
|
axisc.structure.density = 3400; <span class="org-comment">% [kg/m3]</span>
|
|
axisc.structure.STEP = <span class="org-string">'./STEPS/axisc/axisc_structure.STEP'</span>;
|
|
|
|
<span class="org-comment">% Wheel</span>
|
|
axisc.wheel.density = 2700; <span class="org-comment">% [kg/m3]</span>
|
|
axisc.wheel.STEP = <span class="org-string">'./STEPS/axisc/axisc_wheel.STEP'</span>;
|
|
|
|
<span class="org-comment">% Mass</span>
|
|
axisc.mass.density = 7800; <span class="org-comment">% [kg/m3]</span>
|
|
axisc.mass.STEP = <span class="org-string">'./STEPS/axisc/axisc_mass.STEP'</span>;
|
|
|
|
<span class="org-comment">% Gear</span>
|
|
axisc.gear.density = 7800; <span class="org-comment">% [kg/m3]</span>
|
|
axisc.gear.STEP = <span class="org-string">'./STEPS/axisc/axisc_gear.STEP'</span>;
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
The <code>axisc</code> structure is saved.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save(<span class="org-string">'./mat/stages.mat'</span>, <span class="org-string">'axisc'</span>, <span class="org-string">'-append'</span>);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org25bbe89" class="outline-2">
|
|
<h2 id="org25bbe89"><span class="section-number-2">8</span> Mirror</h2>
|
|
<div class="outline-text-2" id="text-8">
|
|
<p>
|
|
<a id="org8380b00"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org0d3e9fc" class="outline-3">
|
|
<h3 id="org0d3e9fc">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-org0d3e9fc">
|
|
<p>
|
|
The Simscape Model of the mirror is just a solid body.
|
|
The output <code>mirror_center</code> corresponds to the center of the Sphere and is the point of measurement for the metrology
|
|
</p>
|
|
|
|
|
|
<div id="org5a9b7de" class="figure">
|
|
<p><img src="figs/images/simscape_model_mirror.png" alt="simscape_model_mirror.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 16: </span>Simscape model for the Mirror</p>
|
|
</div>
|
|
|
|
|
|
<div id="org0827485" class="figure">
|
|
<p><img src="figs/images/simscape_picture_mirror.png" alt="simscape_picture_mirror.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 17: </span>Simscape picture for the Mirror</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orga55279b" class="outline-3">
|
|
<h3 id="orga55279b">Function description</h3>
|
|
<div class="outline-text-3" id="text-orga55279b">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[]</span> = <span class="org-function-name">initializeMirror</span>(<span class="org-variable-name">args</span>)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org2f5fbef" class="outline-3">
|
|
<h3 id="org2f5fbef">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-org2f5fbef">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.shape char {mustBeMember(args.shape,{<span class="org-string">'spherical'</span>, <span class="org-string">'conical'</span>})} = <span class="org-string">'spherical'</span>
|
|
args.angle (1,1) double {mustBeNumeric, mustBePositive} = 45 <span class="org-comment">% [deg]</span>
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org49f3ae9" class="outline-3">
|
|
<h3 id="org49f3ae9">Function content</h3>
|
|
<div class="outline-text-3" id="text-org49f3ae9">
|
|
<p>
|
|
First, we initialize the <code>mirror</code> structure.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">mirror = struct();
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
We define the geometrical values.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">mirror.h = 50; <span class="org-comment">% Height of the mirror [mm]</span>
|
|
mirror.thickness = 25; <span class="org-comment">% Thickness of the plate supporting the sample [mm]</span>
|
|
mirror.hole_rad = 120; <span class="org-comment">% radius of the hole in the mirror [mm]</span>
|
|
mirror.support_rad = 100; <span class="org-comment">% radius of the support plate [mm]</span>
|
|
mirror.jacobian = 150; <span class="org-comment">% point of interest offset in z (above the top surfave) [mm]</span>
|
|
mirror.rad = 180; <span class="org-comment">% radius of the mirror (at the bottom surface) [mm]</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">mirror.density = 2400; <span class="org-comment">% Density of the material [kg/m3]</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">mirror.cone_length = mirror.rad<span class="org-type">*</span>tand(args.angle)<span class="org-type">+</span>mirror.h<span class="org-type">+</span>mirror.jacobian; <span class="org-comment">% Distance from Apex point of the cone to jacobian point</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Now we define the Shape of the mirror.
|
|
We first start with the internal part.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">mirror.shape = [...
|
|
0 mirror.h<span class="org-type">-</span>mirror.thickness
|
|
mirror.hole_rad mirror.h<span class="org-type">-</span>mirror.thickness; ...
|
|
mirror.hole_rad 0; ...
|
|
mirror.rad 0 ...
|
|
];
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Then, we define the reflective used part of the mirror.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">if</span> strcmp(args.shape, <span class="org-string">'spherical'</span>)
|
|
mirror.sphere_radius = sqrt((mirror.jacobian<span class="org-type">+</span>mirror.h)<span class="org-type">^</span>2<span class="org-type">+</span>mirror.rad<span class="org-type">^</span>2); <span class="org-comment">% Radius of the sphere [mm]</span>
|
|
|
|
<span class="org-keyword">for</span> <span class="org-variable-name">z</span> = <span class="org-constant">linspace(0, mirror.h, 101)</span>
|
|
mirror.shape = [mirror.shape; sqrt(mirror.sphere_radius<span class="org-type">^</span>2<span class="org-type">-</span>(z<span class="org-type">-</span>mirror.jacobian<span class="org-type">-</span>mirror.h)<span class="org-type">^</span>2) z];
|
|
<span class="org-keyword">end</span>
|
|
<span class="org-keyword">elseif</span> strcmp(args.shape, <span class="org-string">'conical'</span>)
|
|
mirror.shape = [mirror.shape; mirror.rad<span class="org-type">+</span>mirror.h<span class="org-type">/</span>tand(args.angle) mirror.h];
|
|
<span class="org-keyword">else</span>
|
|
error(<span class="org-string">'Shape should be either conical or spherical'</span>);
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Finally, we close the shape.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">mirror.shape = [mirror.shape; 0 mirror.h];
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
The <code>mirror</code> structure is saved.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save(<span class="org-string">'./mat/stages.mat'</span>, <span class="org-string">'mirror'</span>, <span class="org-string">'-append'</span>);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org78820bf" class="outline-2">
|
|
<h2 id="org78820bf"><span class="section-number-2">9</span> Nano Hexapod</h2>
|
|
<div class="outline-text-2" id="text-9">
|
|
<p>
|
|
<a id="org187b662"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-orga5c9f7b" class="outline-3">
|
|
<h3 id="orga5c9f7b">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-orga5c9f7b">
|
|
|
|
<div id="org8b903f5" class="figure">
|
|
<p><img src="figs/images/simscape_model_nano_hexapod.png" alt="simscape_model_nano_hexapod.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 18: </span>Simscape model for the Nano Hexapod</p>
|
|
</div>
|
|
|
|
|
|
<div id="orgfd39daa" class="figure">
|
|
<p><img src="figs/images/simscape_picture_nano_hexapod.png" alt="simscape_picture_nano_hexapod.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 19: </span>Simscape picture for the Nano Hexapod</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgdd116d3" class="outline-3">
|
|
<h3 id="orgdd116d3">Function description</h3>
|
|
<div class="outline-text-3" id="text-orgdd116d3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[nano_hexapod]</span> = <span class="org-function-name">initializeNanoHexapod</span>(<span class="org-variable-name">args</span>)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orga9e9d2d" class="outline-3">
|
|
<h3 id="orga9e9d2d">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-orga9e9d2d">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
<span class="org-comment">% initializeFramesPositions</span>
|
|
args.H (1,1) double {mustBeNumeric, mustBePositive} = 90e<span class="org-type">-</span>3
|
|
args.MO_B (1,1) double {mustBeNumeric} = 175e<span class="org-type">-</span>3
|
|
<span class="org-comment">% generateGeneralConfiguration</span>
|
|
args.FH (1,1) double {mustBeNumeric, mustBePositive} = 15e<span class="org-type">-</span>3
|
|
args.FR (1,1) double {mustBeNumeric, mustBePositive} = 100e<span class="org-type">-</span>3
|
|
args.FTh (6,1) double {mustBeNumeric} = [<span class="org-type">-</span>10, 10, 120<span class="org-type">-</span>10, 120<span class="org-type">+</span>10, 240<span class="org-type">-</span>10, 240<span class="org-type">+</span>10]<span class="org-type">*</span>(<span class="org-constant">pi</span><span class="org-type">/</span>180)
|
|
args.MH (1,1) double {mustBeNumeric, mustBePositive} = 15e<span class="org-type">-</span>3
|
|
args.MR (1,1) double {mustBeNumeric, mustBePositive} = 90e<span class="org-type">-</span>3
|
|
args.MTh (6,1) double {mustBeNumeric} = [<span class="org-type">-</span>60<span class="org-type">+</span>10, 60<span class="org-type">-</span>10, 60<span class="org-type">+</span>10, 180<span class="org-type">-</span>10, 180<span class="org-type">+</span>10, <span class="org-type">-</span>60<span class="org-type">-</span>10]<span class="org-type">*</span>(<span class="org-constant">pi</span><span class="org-type">/</span>180)
|
|
<span class="org-comment">% initializeStrutDynamics</span>
|
|
args.actuator char {mustBeMember(args.actuator,{<span class="org-string">'piezo'</span>, <span class="org-string">'lorentz'</span>})} = <span class="org-string">'piezo'</span>
|
|
<span class="org-comment">% initializeCylindricalPlatforms</span>
|
|
args.Fpm (1,1) double {mustBeNumeric, mustBePositive} = 1
|
|
args.Fph (1,1) double {mustBeNumeric, mustBePositive} = 10e<span class="org-type">-</span>3
|
|
args.Fpr (1,1) double {mustBeNumeric, mustBePositive} = 150e<span class="org-type">-</span>3
|
|
args.Mpm (1,1) double {mustBeNumeric, mustBePositive} = 1
|
|
args.Mph (1,1) double {mustBeNumeric, mustBePositive} = 10e<span class="org-type">-</span>3
|
|
args.Mpr (1,1) double {mustBeNumeric, mustBePositive} = 100e<span class="org-type">-</span>3
|
|
<span class="org-comment">% initializeCylindricalStruts</span>
|
|
args.Fsm (1,1) double {mustBeNumeric, mustBePositive} = 0.1
|
|
args.Fsh (1,1) double {mustBeNumeric, mustBePositive} = 50e<span class="org-type">-</span>3
|
|
args.Fsr (1,1) double {mustBeNumeric, mustBePositive} = 5e<span class="org-type">-</span>3
|
|
args.Msm (1,1) double {mustBeNumeric, mustBePositive} = 0.1
|
|
args.Msh (1,1) double {mustBeNumeric, mustBePositive} = 50e<span class="org-type">-</span>3
|
|
args.Msr (1,1) double {mustBeNumeric, mustBePositive} = 5e<span class="org-type">-</span>3
|
|
<span class="org-comment">% inverseKinematics</span>
|
|
args.AP (3,1) double {mustBeNumeric} = zeros(3,1)
|
|
args.ARB (3,3) double {mustBeNumeric} = eye(3)
|
|
<span class="org-comment">% Equilibrium position of each leg</span>
|
|
args.dLeq (6,1) double {mustBeNumeric} = zeros(6,1)
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org2dc960a" class="outline-3">
|
|
<h3 id="org2dc960a">Function content</h3>
|
|
<div class="outline-text-3" id="text-org2dc960a">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">nano_hexapod = initializeFramesPositions(<span class="org-string">'H'</span>, args.H, <span class="org-string">'MO_B'</span>, args.MO_B);
|
|
nano_hexapod = generateGeneralConfiguration(nano_hexapod, <span class="org-string">'FH'</span>, args.FH, <span class="org-string">'FR'</span>, args.FR, <span class="org-string">'FTh'</span>, args.FTh, <span class="org-string">'MH'</span>, args.MH, <span class="org-string">'MR'</span>, args.MR, <span class="org-string">'MTh'</span>, args.MTh);
|
|
nano_hexapod = computeJointsPose(nano_hexapod);
|
|
<span class="org-keyword">if</span> strcmp(args.actuator, <span class="org-string">'piezo'</span>)
|
|
nano_hexapod = initializeStrutDynamics(nano_hexapod, <span class="org-string">'Ki'</span>, 1e7<span class="org-type">*</span>ones(6,1), <span class="org-string">'Ci'</span>, 1e2<span class="org-type">*</span>ones(6,1));
|
|
<span class="org-keyword">elseif</span> strcmp(args.actuator, <span class="org-string">'lorentz'</span>)
|
|
nano_hexapod = initializeStrutDynamics(nano_hexapod, <span class="org-string">'Ki'</span>, 1e4<span class="org-type">*</span>ones(6,1), <span class="org-string">'Ci'</span>, 1e2<span class="org-type">*</span>ones(6,1));
|
|
<span class="org-keyword">else</span>
|
|
error(<span class="org-string">'args.actuator should be piezo or lorentz'</span>);
|
|
<span class="org-keyword">end</span>
|
|
nano_hexapod = initializeCylindricalPlatforms(nano_hexapod, <span class="org-string">'Fpm'</span>, args.Fpm, <span class="org-string">'Fph'</span>, args.Fph, <span class="org-string">'Fpr'</span>, args.Fpr, <span class="org-string">'Mpm'</span>, args.Mpm, <span class="org-string">'Mph'</span>, args.Mph, <span class="org-string">'Mpr'</span>, args.Mpr);
|
|
nano_hexapod = initializeCylindricalStruts(nano_hexapod, <span class="org-string">'Fsm'</span>, args.Fsm, <span class="org-string">'Fsh'</span>, args.Fsh, <span class="org-string">'Fsr'</span>, args.Fsr, <span class="org-string">'Msm'</span>, args.Msm, <span class="org-string">'Msh'</span>, args.Msh, <span class="org-string">'Msr'</span>, args.Msr);
|
|
nano_hexapod = computeJacobian(nano_hexapod);
|
|
[Li, dLi] = inverseKinematics(nano_hexapod, <span class="org-string">'AP'</span>, args.AP, <span class="org-string">'ARB'</span>, args.ARB);
|
|
nano_hexapod.Li = Li;
|
|
nano_hexapod.dLi = dLi;
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">nano_hexapod.dLeq = args.dLeq;
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save(<span class="org-string">'./mat/stages.mat'</span>, <span class="org-string">'nano_hexapod'</span>, <span class="org-string">'-append'</span>);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgf2f70c8" class="outline-2">
|
|
<h2 id="orgf2f70c8"><span class="section-number-2">10</span> Sample</h2>
|
|
<div class="outline-text-2" id="text-10">
|
|
<p>
|
|
<a id="org4854da4"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org8595c5a" class="outline-3">
|
|
<h3 id="org8595c5a">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-org8595c5a">
|
|
<p>
|
|
The Simscape model of the sample environment is composed of:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>A rigid transform that can be used to translate the sample (position offset)</li>
|
|
<li>A cartesian joint to add some flexibility to the sample environment mount</li>
|
|
<li>A solid that represent the sample</li>
|
|
<li>An input is added to apply some external forces and torques at the center of the sample environment.
|
|
This could be the case for cable forces for instance.</li>
|
|
</ul>
|
|
|
|
|
|
<div id="org9d8ffc0" class="figure">
|
|
<p><img src="figs/images/simscape_model_sample.png" alt="simscape_model_sample.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 20: </span>Simscape model for the Sample</p>
|
|
</div>
|
|
|
|
|
|
<div id="org4e2af07" class="figure">
|
|
<p><img src="figs/images/simscape_picture_sample.png" alt="simscape_picture_sample.png" />
|
|
</p>
|
|
<p><span class="figure-number">Figure 21: </span>Simscape picture for the Sample</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgcfe3954" class="outline-3">
|
|
<h3 id="orgcfe3954">Function description</h3>
|
|
<div class="outline-text-3" id="text-orgcfe3954">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[sample]</span> = <span class="org-function-name">initializeSample</span>(<span class="org-variable-name">args</span>)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgfc63702" class="outline-3">
|
|
<h3 id="orgfc63702">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-orgfc63702">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.radius (1,1) double {mustBeNumeric, mustBePositive} = 0.1 <span class="org-comment">% [m]</span>
|
|
args.height (1,1) double {mustBeNumeric, mustBePositive} = 0.3 <span class="org-comment">% [m]</span>
|
|
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 50 <span class="org-comment">% [kg]</span>
|
|
args.freq (1,1) double {mustBeNumeric, mustBePositive} = 100 <span class="org-comment">% [Hz]</span>
|
|
args.offset (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.x0 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.y0 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
args.z0 (1,1) double {mustBeNumeric} = 0 <span class="org-comment">% [m]</span>
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgd132686" class="outline-3">
|
|
<h3 id="orgd132686">Function content</h3>
|
|
<div class="outline-text-3" id="text-orgd132686">
|
|
<p>
|
|
First, we initialize the <code>sample</code> structure.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">sample = struct();
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
We define the geometrical parameters of the sample as well as its mass and position.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">sample.radius = args.radius; <span class="org-comment">% [m]</span>
|
|
sample.height = args.height; <span class="org-comment">% [m]</span>
|
|
sample.mass = args.mass; <span class="org-comment">% [kg]</span>
|
|
sample.offset = args.offset; <span class="org-comment">% [m]</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Stiffness of the sample fixation.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">sample.k.x = sample.mass <span class="org-type">*</span> (2<span class="org-type">*</span><span class="org-constant">pi</span> <span class="org-type">*</span> args.freq)<span class="org-type">^</span>2; <span class="org-comment">% [N/m]</span>
|
|
sample.k.y = sample.mass <span class="org-type">*</span> (2<span class="org-type">*</span><span class="org-constant">pi</span> <span class="org-type">*</span> args.freq)<span class="org-type">^</span>2; <span class="org-comment">% [N/m]</span>
|
|
sample.k.z = sample.mass <span class="org-type">*</span> (2<span class="org-type">*</span><span class="org-constant">pi</span> <span class="org-type">*</span> args.freq)<span class="org-type">^</span>2; <span class="org-comment">% [N/m]</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Damping of the sample fixation.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">sample.c.x = 0.1<span class="org-type">*</span>sqrt(sample.k.x<span class="org-type">*</span>sample.mass); <span class="org-comment">% [N/(m/s)]</span>
|
|
sample.c.y = 0.1<span class="org-type">*</span>sqrt(sample.k.y<span class="org-type">*</span>sample.mass); <span class="org-comment">% [N/(m/s)]</span>
|
|
sample.c.z = 0.1<span class="org-type">*</span>sqrt(sample.k.z<span class="org-type">*</span>sample.mass); <span class="org-comment">% [N/(m/s)]</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Equilibrium position of the Cartesian joint corresponding to the sample fixation.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">sample.x0 = args.x0; <span class="org-comment">% [m]</span>
|
|
sample.y0 = args.y0; <span class="org-comment">% [m]</span>
|
|
sample.z0 = args.z0; <span class="org-comment">% [m]</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
The <code>sample</code> structure is saved.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save(<span class="org-string">'./mat/stages.mat'</span>, <span class="org-string">'sample'</span>, <span class="org-string">'-append'</span>);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgeeed03f" class="outline-2">
|
|
<h2 id="orgeeed03f"><span class="section-number-2">11</span> Generate Reference Signals</h2>
|
|
<div class="outline-text-2" id="text-11">
|
|
<p>
|
|
<a id="org437a56b"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org10e0036" class="outline-3">
|
|
<h3 id="org10e0036">Function Declaration and Documentation</h3>
|
|
<div class="outline-text-3" id="text-org10e0036">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[ref]</span> = <span class="org-function-name">initializeReferences</span>(<span class="org-variable-name">args</span>)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org5407b72" class="outline-3">
|
|
<h3 id="org5407b72">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-org5407b72">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
<span class="org-comment">% Sampling Frequency [s]</span>
|
|
args.Ts (1,1) double {mustBeNumeric, mustBePositive} = 1e<span class="org-type">-</span>3
|
|
<span class="org-comment">% Maximum simulation time [s]</span>
|
|
args.Tmax (1,1) double {mustBeNumeric, mustBePositive} = 100
|
|
<span class="org-comment">% Either "constant" / "triangular" / "sinusoidal"</span>
|
|
args.Dy_type char {mustBeMember(args.Dy_type,{<span class="org-string">'constant'</span>, <span class="org-string">'triangular'</span>, <span class="org-string">'sinusoidal'</span>})} = <span class="org-string">'constant'</span>
|
|
<span class="org-comment">% Amplitude of the displacement [m]</span>
|
|
args.Dy_amplitude (1,1) double {mustBeNumeric} = 0
|
|
<span class="org-comment">% Period of the displacement [s]</span>
|
|
args.Dy_period (1,1) double {mustBeNumeric, mustBePositive} = 1
|
|
<span class="org-comment">% Either "constant" / "triangular" / "sinusoidal"</span>
|
|
args.Ry_type char {mustBeMember(args.Ry_type,{<span class="org-string">'constant'</span>, <span class="org-string">'triangular'</span>, <span class="org-string">'sinusoidal'</span>})} = <span class="org-string">'constant'</span>
|
|
<span class="org-comment">% Amplitude [rad]</span>
|
|
args.Ry_amplitude (1,1) double {mustBeNumeric} = 0
|
|
<span class="org-comment">% Period of the displacement [s]</span>
|
|
args.Ry_period (1,1) double {mustBeNumeric, mustBePositive} = 1
|
|
<span class="org-comment">% Either "constant" / "rotating"</span>
|
|
args.Rz_type char {mustBeMember(args.Rz_type,{<span class="org-string">'constant'</span>, <span class="org-string">'rotating'</span>})} = <span class="org-string">'constant'</span>
|
|
<span class="org-comment">% Initial angle [rad]</span>
|
|
args.Rz_amplitude (1,1) double {mustBeNumeric} = 0
|
|
<span class="org-comment">% Period of the rotating [s]</span>
|
|
args.Rz_period (1,1) double {mustBeNumeric, mustBePositive} = 1
|
|
<span class="org-comment">% For now, only constant is implemented</span>
|
|
args.Dh_type char {mustBeMember(args.Dh_type,{<span class="org-string">'constant'</span>})} = <span class="org-string">'constant'</span>
|
|
<span class="org-comment">% Initial position [m,m,m,rad,rad,rad] of the top platform (Pitch-Roll-Yaw Euler angles)</span>
|
|
args.Dh_pos (6,1) double {mustBeNumeric} = zeros(6, 1), ...
|
|
<span class="org-comment">% For now, only constant is implemented</span>
|
|
args.Rm_type char {mustBeMember(args.Rm_type,{<span class="org-string">'constant'</span>})} = <span class="org-string">'constant'</span>
|
|
<span class="org-comment">% Initial position of the two masses</span>
|
|
args.Rm_pos (2,1) double {mustBeNumeric} = [0; <span class="org-constant">pi</span>]
|
|
<span class="org-comment">% For now, only constant is implemented</span>
|
|
args.Dn_type char {mustBeMember(args.Dn_type,{<span class="org-string">'constant'</span>})} = <span class="org-string">'constant'</span>
|
|
<span class="org-comment">% Initial position [m,m,m,rad,rad,rad] of the top platform</span>
|
|
args.Dn_pos (6,1) double {mustBeNumeric} = zeros(6,1)
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="outline-container-org305283f" class="outline-3">
|
|
<h3 id="org305283f">Initialize Parameters</h3>
|
|
<div class="outline-text-3" id="text-org305283f">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Set Sampling Time</span></span>
|
|
Ts = args.Ts;
|
|
Tmax = args.Tmax;
|
|
|
|
<span class="org-matlab-cellbreak"><span class="org-comment">%% Low Pass Filter to filter out the references</span></span>
|
|
s = zpk(<span class="org-string">'s'</span>);
|
|
w0 = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>10;
|
|
xi = 1;
|
|
H_lpf = 1<span class="org-type">/</span>(1 <span class="org-type">+</span> 2<span class="org-type">*</span>xi<span class="org-type">/</span>w0<span class="org-type">*</span>s <span class="org-type">+</span> s<span class="org-type">^</span>2<span class="org-type">/</span>w0<span class="org-type">^</span>2);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org7536993" class="outline-3">
|
|
<h3 id="org7536993">Translation Stage</h3>
|
|
<div class="outline-text-3" id="text-org7536993">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Translation stage - Dy</span></span>
|
|
t = 0<span class="org-type">:</span>Ts<span class="org-type">:</span>Tmax; <span class="org-comment">% Time Vector [s]</span>
|
|
Dy = zeros(length(t), 1);
|
|
Dyd = zeros(length(t), 1);
|
|
Dydd = zeros(length(t), 1);
|
|
<span class="org-keyword">switch</span> <span class="org-constant">args.Dy_type</span>
|
|
<span class="org-keyword">case</span> <span class="org-string">'constant'</span>
|
|
Dy<span class="org-type">(:) </span>= args.Dy_amplitude;
|
|
Dyd<span class="org-type">(:) </span>= 0;
|
|
Dydd<span class="org-type">(:) </span>= 0;
|
|
<span class="org-keyword">case</span> <span class="org-string">'triangular'</span>
|
|
<span class="org-comment">% This is done to unsure that we start with no displacement</span>
|
|
Dy_raw = args.Dy_amplitude<span class="org-type">*</span>sawtooth(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>t<span class="org-type">/</span>args.Dy_period,1<span class="org-type">/</span>2);
|
|
i0 = find(t<span class="org-type">>=</span>args.Dy_period<span class="org-type">/</span>4,1);
|
|
Dy(1<span class="org-type">:</span>end<span class="org-type">-</span>i0<span class="org-type">+</span>1) = Dy_raw(i0<span class="org-type">:</span>end);
|
|
Dy(end<span class="org-type">-</span>i0<span class="org-type">+</span>2<span class="org-type">:</span>end) = Dy_raw(end); <span class="org-comment">% we fix the last value</span>
|
|
|
|
<span class="org-comment">% The signal is filtered out</span>
|
|
Dy = lsim(H_lpf, Dy, t);
|
|
Dyd = lsim(H_lpf<span class="org-type">*</span>s, Dy, t);
|
|
Dydd = lsim(H_lpf<span class="org-type">*</span>s<span class="org-type">^</span>2, Dy, t);
|
|
<span class="org-keyword">case</span> <span class="org-string">'sinusoidal'</span>
|
|
Dy<span class="org-type">(:) </span>= args.Dy_amplitude<span class="org-type">*</span>sin(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">/</span>args.Dy_period<span class="org-type">*</span>t);
|
|
Dyd = args.Dy_amplitude<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">/</span>args.Dy_period<span class="org-type">*</span>cos(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">/</span>args.Dy_period<span class="org-type">*</span>t);
|
|
Dydd = <span class="org-type">-</span>args.Dy_amplitude<span class="org-type">*</span>(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">/</span>args.Dy_period)<span class="org-type">^</span>2<span class="org-type">*</span>sin(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">/</span>args.Dy_period<span class="org-type">*</span>t);
|
|
<span class="org-keyword">otherwise</span>
|
|
warning(<span class="org-string">'Dy_type is not set correctly'</span>);
|
|
<span class="org-keyword">end</span>
|
|
|
|
Dy = struct(<span class="org-string">'time'</span>, t, <span class="org-string">'signals'</span>, struct(<span class="org-string">'values'</span>, Dy), <span class="org-string">'deriv'</span>, Dyd, <span class="org-string">'dderiv'</span>, Dydd);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org7d3086c" class="outline-3">
|
|
<h3 id="org7d3086c">Tilt Stage</h3>
|
|
<div class="outline-text-3" id="text-org7d3086c">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Tilt Stage - Ry</span></span>
|
|
t = 0<span class="org-type">:</span>Ts<span class="org-type">:</span>Tmax; <span class="org-comment">% Time Vector [s]</span>
|
|
Ry = zeros(length(t), 1);
|
|
Ryd = zeros(length(t), 1);
|
|
Rydd = zeros(length(t), 1);
|
|
|
|
<span class="org-keyword">switch</span> <span class="org-constant">args.Ry_type</span>
|
|
<span class="org-keyword">case</span> <span class="org-string">'constant'</span>
|
|
Ry<span class="org-type">(:) </span>= args.Ry_amplitude;
|
|
Ryd<span class="org-type">(:) </span>= 0;
|
|
Rydd<span class="org-type">(:) </span>= 0;
|
|
<span class="org-keyword">case</span> <span class="org-string">'triangular'</span>
|
|
Ry_raw = args.Ry_amplitude<span class="org-type">*</span>sawtooth(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>t<span class="org-type">/</span>args.Ry_period,1<span class="org-type">/</span>2);
|
|
i0 = find(t<span class="org-type">>=</span>args.Ry_period<span class="org-type">/</span>4,1);
|
|
Ry(1<span class="org-type">:</span>end<span class="org-type">-</span>i0<span class="org-type">+</span>1) = Ry_raw(i0<span class="org-type">:</span>end);
|
|
Ry(end<span class="org-type">-</span>i0<span class="org-type">+</span>2<span class="org-type">:</span>end) = Ry_raw(end); <span class="org-comment">% we fix the last value</span>
|
|
|
|
<span class="org-comment">% The signal is filtered out</span>
|
|
Ry = lsim(H_lpf, Ry, t);
|
|
Ryd = lsim(H_lpf<span class="org-type">*</span>s, Ry, t);
|
|
Rydd = lsim(H_lpf<span class="org-type">*</span>s<span class="org-type">^</span>2, Ry, t);
|
|
<span class="org-keyword">case</span> <span class="org-string">'sinusoidal'</span>
|
|
Ry<span class="org-type">(:) </span>= args.Ry_amplitude<span class="org-type">*</span>sin(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">/</span>args.Ry_period<span class="org-type">*</span>t);
|
|
|
|
Ryd = args.Ry_amplitude<span class="org-type">*</span>2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">/</span>args.Ry_period<span class="org-type">*</span>cos(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">/</span>args.Ry_period<span class="org-type">*</span>t);
|
|
Rydd = <span class="org-type">-</span>args.Ry_amplitude<span class="org-type">*</span>(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">/</span>args.Ry_period)<span class="org-type">^</span>2<span class="org-type">*</span>sin(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">/</span>args.Ry_period<span class="org-type">*</span>t);
|
|
<span class="org-keyword">otherwise</span>
|
|
warning(<span class="org-string">'Ry_type is not set correctly'</span>);
|
|
<span class="org-keyword">end</span>
|
|
|
|
Ry = struct(<span class="org-string">'time'</span>, t, <span class="org-string">'signals'</span>, struct(<span class="org-string">'values'</span>, Ry), <span class="org-string">'deriv'</span>, Ryd, <span class="org-string">'dderiv'</span>, Rydd);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org4f0a106" class="outline-3">
|
|
<h3 id="org4f0a106">Spindle</h3>
|
|
<div class="outline-text-3" id="text-org4f0a106">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Spindle - Rz</span></span>
|
|
t = 0<span class="org-type">:</span>Ts<span class="org-type">:</span>Tmax; <span class="org-comment">% Time Vector [s]</span>
|
|
Rz = zeros(length(t), 1);
|
|
Rzd = zeros(length(t), 1);
|
|
Rzdd = zeros(length(t), 1);
|
|
|
|
<span class="org-keyword">switch</span> <span class="org-constant">args.Rz_type</span>
|
|
<span class="org-keyword">case</span> <span class="org-string">'constant'</span>
|
|
Rz<span class="org-type">(:) </span>= args.Rz_amplitude;
|
|
Rzd<span class="org-type">(:) </span>= 0;
|
|
Rzdd<span class="org-type">(:) </span>= 0;
|
|
<span class="org-keyword">case</span> <span class="org-string">'rotating'</span>
|
|
Rz<span class="org-type">(:) </span>= args.Rz_amplitude<span class="org-type">+</span>2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">/</span>args.Rz_period<span class="org-type">*</span>t;
|
|
|
|
<span class="org-comment">% The signal is filtered out</span>
|
|
Rz = lsim(H_lpf, Rz, t);
|
|
Rzd = lsim(H_lpf<span class="org-type">*</span>s, Rz, t);
|
|
Rzdd = lsim(H_lpf<span class="org-type">*</span>s<span class="org-type">^</span>2, Rz, t);
|
|
<span class="org-keyword">otherwise</span>
|
|
warning(<span class="org-string">'Rz_type is not set correctly'</span>);
|
|
<span class="org-keyword">end</span>
|
|
|
|
Rz = struct(<span class="org-string">'time'</span>, t, <span class="org-string">'signals'</span>, struct(<span class="org-string">'values'</span>, Rz), <span class="org-string">'deriv'</span>, Rzd, <span class="org-string">'dderiv'</span>, Rzdd);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org552aaf9" class="outline-3">
|
|
<h3 id="org552aaf9">Micro Hexapod</h3>
|
|
<div class="outline-text-3" id="text-org552aaf9">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Micro-Hexapod</span></span>
|
|
t = [0, Ts];
|
|
Dh = zeros(length(t), 6);
|
|
Dhl = zeros(length(t), 6);
|
|
|
|
<span class="org-keyword">switch</span> <span class="org-constant">args.Dh_type</span>
|
|
<span class="org-keyword">case</span> <span class="org-string">'constant'</span>
|
|
Dh = [args.Dh_pos, args.Dh_pos];
|
|
|
|
load(<span class="org-string">'mat/stages.mat'</span>, <span class="org-string">'micro_hexapod'</span>);
|
|
|
|
AP = [args.Dh_pos(1) ; args.Dh_pos(2) ; args.Dh_pos(3)];
|
|
|
|
tx = args.Dh_pos(4);
|
|
ty = args.Dh_pos(5);
|
|
tz = args.Dh_pos(6);
|
|
|
|
ARB = [cos(tz) <span class="org-type">-</span>sin(tz) 0;
|
|
sin(tz) cos(tz) 0;
|
|
0 0 1]<span class="org-type">*</span>...
|
|
[ cos(ty) 0 sin(ty);
|
|
0 1 0;
|
|
<span class="org-type">-</span>sin(ty) 0 cos(ty)]<span class="org-type">*</span>...
|
|
[1 0 0;
|
|
0 cos(tx) <span class="org-type">-</span>sin(tx);
|
|
0 sin(tx) cos(tx)];
|
|
|
|
[<span class="org-type">~</span>, Dhl] = inverseKinematics(micro_hexapod, <span class="org-string">'AP'</span>, AP, <span class="org-string">'ARB'</span>, ARB);
|
|
Dhl = [Dhl, Dhl];
|
|
<span class="org-keyword">otherwise</span>
|
|
warning(<span class="org-string">'Dh_type is not set correctly'</span>);
|
|
<span class="org-keyword">end</span>
|
|
|
|
Dh = struct(<span class="org-string">'time'</span>, t, <span class="org-string">'signals'</span>, struct(<span class="org-string">'values'</span>, Dh));
|
|
Dhl = struct(<span class="org-string">'time'</span>, t, <span class="org-string">'signals'</span>, struct(<span class="org-string">'values'</span>, Dhl));
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org8cb66c8" class="outline-3">
|
|
<h3 id="org8cb66c8">Axis Compensation</h3>
|
|
<div class="outline-text-3" id="text-org8cb66c8">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Axis Compensation - Rm</span></span>
|
|
t = [0, Ts];
|
|
|
|
Rm = [args.Rm_pos, args.Rm_pos];
|
|
Rm = struct(<span class="org-string">'time'</span>, t, <span class="org-string">'signals'</span>, struct(<span class="org-string">'values'</span>, Rm));
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge18457b" class="outline-3">
|
|
<h3 id="orge18457b">Nano Hexapod</h3>
|
|
<div class="outline-text-3" id="text-orge18457b">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Nano-Hexapod</span></span>
|
|
t = [0, Ts];
|
|
Dn = zeros(length(t), 6);
|
|
|
|
<span class="org-keyword">switch</span> <span class="org-constant">args.Dn_type</span>
|
|
<span class="org-keyword">case</span> <span class="org-string">'constant'</span>
|
|
Dn = [args.Dn_pos, args.Dn_pos];
|
|
<span class="org-keyword">otherwise</span>
|
|
warning(<span class="org-string">'Dn_type is not set correctly'</span>);
|
|
<span class="org-keyword">end</span>
|
|
|
|
Dn = struct(<span class="org-string">'time'</span>, t, <span class="org-string">'signals'</span>, struct(<span class="org-string">'values'</span>, Dn));
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgd30bcd5" class="outline-3">
|
|
<h3 id="orgd30bcd5">Save</h3>
|
|
<div class="outline-text-3" id="text-orgd30bcd5">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"> <span class="org-matlab-cellbreak"><span class="org-comment">%% Save</span></span>
|
|
save(<span class="org-string">'mat/nass_references.mat'</span>, <span class="org-string">'Dy'</span>, <span class="org-string">'Ry'</span>, <span class="org-string">'Rz'</span>, <span class="org-string">'Dh'</span>, <span class="org-string">'Dhl'</span>, <span class="org-string">'Rm'</span>, <span class="org-string">'Dn'</span>, <span class="org-string">'Ts'</span>);
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org14370d0" class="outline-2">
|
|
<h2 id="org14370d0"><span class="section-number-2">12</span> Initialize Disturbances</h2>
|
|
<div class="outline-text-2" id="text-12">
|
|
<p>
|
|
<a id="org8b97db7"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org0dd4c94" class="outline-3">
|
|
<h3 id="org0dd4c94">Function Declaration and Documentation</h3>
|
|
<div class="outline-text-3" id="text-org0dd4c94">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[]</span> = <span class="org-function-name">initializeDisturbances</span>(<span class="org-variable-name">args</span>)
|
|
<span class="org-comment">% initializeDisturbances - Initialize the disturbances</span>
|
|
<span class="org-comment">%</span>
|
|
<span class="org-comment">% Syntax: [] = initializeDisturbances(args)</span>
|
|
<span class="org-comment">%</span>
|
|
<span class="org-comment">% Inputs:</span>
|
|
<span class="org-comment">% - args -</span>
|
|
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgeb97bab" class="outline-3">
|
|
<h3 id="orgeb97bab">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-orgeb97bab">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
<span class="org-comment">% Global parameter to enable or disable the disturbances</span>
|
|
args.enable logical {mustBeNumericOrLogical} = <span class="org-constant">true</span>
|
|
<span class="org-comment">% Ground Motion - X direction</span>
|
|
args.Dwx logical {mustBeNumericOrLogical} = <span class="org-constant">true</span>
|
|
<span class="org-comment">% Ground Motion - Y direction</span>
|
|
args.Dwy logical {mustBeNumericOrLogical} = <span class="org-constant">true</span>
|
|
<span class="org-comment">% Ground Motion - Z direction</span>
|
|
args.Dwz logical {mustBeNumericOrLogical} = <span class="org-constant">true</span>
|
|
<span class="org-comment">% Translation Stage - X direction</span>
|
|
args.Fty_x logical {mustBeNumericOrLogical} = <span class="org-constant">true</span>
|
|
<span class="org-comment">% Translation Stage - Z direction</span>
|
|
args.Fty_z logical {mustBeNumericOrLogical} = <span class="org-constant">true</span>
|
|
<span class="org-comment">% Spindle - Z direction</span>
|
|
args.Frz_z logical {mustBeNumericOrLogical} = <span class="org-constant">true</span>
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="outline-container-org31a3a0f" class="outline-3">
|
|
<h3 id="org31a3a0f">Load Data</h3>
|
|
<div class="outline-text-3" id="text-org31a3a0f">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">load(<span class="org-string">'./disturbances/mat/dist_psd.mat'</span>, <span class="org-string">'dist_f'</span>);
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
We remove the first frequency point that usually is very large.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div id="outline-container-orgd42aef1" class="outline-3">
|
|
<h3 id="orgd42aef1">Parameters</h3>
|
|
<div class="outline-text-3" id="text-orgd42aef1">
|
|
<p>
|
|
We define some parameters that will be used in the algorithm.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">Fs = 2<span class="org-type">*</span>dist_f.f(end); <span class="org-comment">% Sampling Frequency of data is twice the maximum frequency of the PSD vector [Hz]</span>
|
|
N = 2<span class="org-type">*</span>length(dist_f.f); <span class="org-comment">% Number of Samples match the one of the wanted PSD</span>
|
|
T0 = N<span class="org-type">/</span>Fs; <span class="org-comment">% Signal Duration [s]</span>
|
|
df = 1<span class="org-type">/</span>T0; <span class="org-comment">% Frequency resolution of the DFT [Hz]</span>
|
|
<span class="org-comment">% Also equal to (dist_f.f(2)-dist_f.f(1))</span>
|
|
t = linspace(0, T0, N<span class="org-type">+</span>1)<span class="org-type">'</span>; <span class="org-comment">% Time Vector [s]</span>
|
|
Ts = 1<span class="org-type">/</span>Fs; <span class="org-comment">% Sampling Time [s]</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org32e95d0" class="outline-3">
|
|
<h3 id="org32e95d0">Ground Motion</h3>
|
|
<div class="outline-text-3" id="text-org32e95d0">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">phi = dist_f.psd_gm;
|
|
C = zeros(N<span class="org-type">/</span>2,1);
|
|
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:N/2</span>
|
|
C(<span class="org-constant">i</span>) = sqrt(phi(<span class="org-constant">i</span>)<span class="org-type">*</span>df);
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">if</span> args.Dwx <span class="org-type">&&</span> args.enable
|
|
theta = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>rand(N<span class="org-type">/</span>2,1); <span class="org-comment">% Generate random phase [rad]</span>
|
|
Cx = [0 ; C<span class="org-type">.*</span>complex(cos(theta),sin(theta))];
|
|
Cx = [Cx; flipud(conj(Cx(2<span class="org-type">:</span>end)))];;
|
|
Dwx = N<span class="org-type">/</span>sqrt(2)<span class="org-type">*</span>ifft(Cx); <span class="org-comment">% Ground Motion - x direction [m]</span>
|
|
<span class="org-keyword">else</span>
|
|
Dwx = zeros(length(t), 1);
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">if</span> args.Dwy <span class="org-type">&&</span> args.enable
|
|
theta = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>rand(N<span class="org-type">/</span>2,1); <span class="org-comment">% Generate random phase [rad]</span>
|
|
Cx = [0 ; C<span class="org-type">.*</span>complex(cos(theta),sin(theta))];
|
|
Cx = [Cx; flipud(conj(Cx(2<span class="org-type">:</span>end)))];;
|
|
Dwy = N<span class="org-type">/</span>sqrt(2)<span class="org-type">*</span>ifft(Cx); <span class="org-comment">% Ground Motion - y direction [m]</span>
|
|
<span class="org-keyword">else</span>
|
|
Dwy = zeros(length(t), 1);
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">if</span> args.Dwy <span class="org-type">&&</span> args.enable
|
|
theta = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>rand(N<span class="org-type">/</span>2,1); <span class="org-comment">% Generate random phase [rad]</span>
|
|
Cx = [0 ; C<span class="org-type">.*</span>complex(cos(theta),sin(theta))];
|
|
Cx = [Cx; flipud(conj(Cx(2<span class="org-type">:</span>end)))];;
|
|
Dwz = N<span class="org-type">/</span>sqrt(2)<span class="org-type">*</span>ifft(Cx); <span class="org-comment">% Ground Motion - z direction [m]</span>
|
|
<span class="org-keyword">else</span>
|
|
Dwz = zeros(length(t), 1);
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgb479ac1" class="outline-3">
|
|
<h3 id="orgb479ac1">Translation Stage - X direction</h3>
|
|
<div class="outline-text-3" id="text-orgb479ac1">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">if</span> args.Fty_x <span class="org-type">&&</span> args.enable
|
|
phi = dist_f.psd_ty; <span class="org-comment">% TODO - we take here the vertical direction which is wrong but approximate</span>
|
|
C = zeros(N<span class="org-type">/</span>2,1);
|
|
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:N/2</span>
|
|
C(<span class="org-constant">i</span>) = sqrt(phi(<span class="org-constant">i</span>)<span class="org-type">*</span>df);
|
|
<span class="org-keyword">end</span>
|
|
theta = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>rand(N<span class="org-type">/</span>2,1); <span class="org-comment">% Generate random phase [rad]</span>
|
|
Cx = [0 ; C<span class="org-type">.*</span>complex(cos(theta),sin(theta))];
|
|
Cx = [Cx; flipud(conj(Cx(2<span class="org-type">:</span>end)))];;
|
|
u = N<span class="org-type">/</span>sqrt(2)<span class="org-type">*</span>ifft(Cx); <span class="org-comment">% Disturbance Force Ty x [N]</span>
|
|
Fty_x = u;
|
|
<span class="org-keyword">else</span>
|
|
Fty_x = zeros(length(t), 1);
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org5f1ce80" class="outline-3">
|
|
<h3 id="org5f1ce80">Translation Stage - Z direction</h3>
|
|
<div class="outline-text-3" id="text-org5f1ce80">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">if</span> args.Fty_z <span class="org-type">&&</span> args.enable
|
|
phi = dist_f.psd_ty;
|
|
C = zeros(N<span class="org-type">/</span>2,1);
|
|
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:N/2</span>
|
|
C(<span class="org-constant">i</span>) = sqrt(phi(<span class="org-constant">i</span>)<span class="org-type">*</span>df);
|
|
<span class="org-keyword">end</span>
|
|
theta = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>rand(N<span class="org-type">/</span>2,1); <span class="org-comment">% Generate random phase [rad]</span>
|
|
Cx = [0 ; C<span class="org-type">.*</span>complex(cos(theta),sin(theta))];
|
|
Cx = [Cx; flipud(conj(Cx(2<span class="org-type">:</span>end)))];;
|
|
u = N<span class="org-type">/</span>sqrt(2)<span class="org-type">*</span>ifft(Cx); <span class="org-comment">% Disturbance Force Ty z [N]</span>
|
|
Fty_z = u;
|
|
<span class="org-keyword">else</span>
|
|
Fty_z = zeros(length(t), 1);
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org29a5822" class="outline-3">
|
|
<h3 id="org29a5822">Spindle - Z direction</h3>
|
|
<div class="outline-text-3" id="text-org29a5822">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">if</span> args.Frz_z <span class="org-type">&&</span> args.enable
|
|
phi = dist_f.psd_rz;
|
|
C = zeros(N<span class="org-type">/</span>2,1);
|
|
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:N/2</span>
|
|
C(<span class="org-constant">i</span>) = sqrt(phi(<span class="org-constant">i</span>)<span class="org-type">*</span>df);
|
|
<span class="org-keyword">end</span>
|
|
theta = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>rand(N<span class="org-type">/</span>2,1); <span class="org-comment">% Generate random phase [rad]</span>
|
|
Cx = [0 ; C<span class="org-type">.*</span>complex(cos(theta),sin(theta))];
|
|
Cx = [Cx; flipud(conj(Cx(2<span class="org-type">:</span>end)))];;
|
|
u = N<span class="org-type">/</span>sqrt(2)<span class="org-type">*</span>ifft(Cx); <span class="org-comment">% Disturbance Force Rz z [N]</span>
|
|
Frz_z = u;
|
|
<span class="org-keyword">else</span>
|
|
Frz_z = zeros(length(t), 1);
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org123d0e1" class="outline-3">
|
|
<h3 id="org123d0e1">Direct Forces</h3>
|
|
<div class="outline-text-3" id="text-org123d0e1">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">u = zeros(length(t), 6);
|
|
Fd = u;
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org9f0d544" class="outline-3">
|
|
<h3 id="org9f0d544">Set initial value to zero</h3>
|
|
<div class="outline-text-3" id="text-org9f0d544">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">Dwx = Dwx <span class="org-type">-</span> Dwx(1);
|
|
Dwy = Dwy <span class="org-type">-</span> Dwy(1);
|
|
Dwz = Dwz <span class="org-type">-</span> Dwz(1);
|
|
Fty_x = Fty_x <span class="org-type">-</span> Fty_x(1);
|
|
Fty_z = Fty_z <span class="org-type">-</span> Fty_z(1);
|
|
Frz_z = Frz_z <span class="org-type">-</span> Frz_z(1);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org4394b83" class="outline-3">
|
|
<h3 id="org4394b83">Save</h3>
|
|
<div class="outline-text-3" id="text-org4394b83">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save(<span class="org-string">'mat/nass_disturbances.mat'</span>, <span class="org-string">'Dwx'</span>, <span class="org-string">'Dwy'</span>, <span class="org-string">'Dwz'</span>, <span class="org-string">'Fty_x'</span>, <span class="org-string">'Fty_z'</span>, <span class="org-string">'Frz_z'</span>, <span class="org-string">'Fd'</span>, <span class="org-string">'Ts'</span>, <span class="org-string">'t'</span>);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org012182d" class="outline-2">
|
|
<h2 id="org012182d"><span class="section-number-2">13</span> Z-Axis Geophone</h2>
|
|
<div class="outline-text-2" id="text-13">
|
|
<p>
|
|
<a id="orgd430677"></a>
|
|
</p>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[geophone]</span> = <span class="org-function-name">initializeZAxisGeophone</span>(<span class="org-variable-name">args</span>)
|
|
arguments
|
|
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 1e<span class="org-type">-</span>3 <span class="org-comment">% [kg]</span>
|
|
args.freq (1,1) double {mustBeNumeric, mustBePositive} = 1 <span class="org-comment">% [Hz]</span>
|
|
<span class="org-keyword">end</span>
|
|
|
|
<span class="org-matlab-cellbreak"><span class="org-comment">%%</span></span>
|
|
geophone.m = args.mass;
|
|
|
|
<span class="org-matlab-cellbreak"><span class="org-comment">%% The Stiffness is set to have the damping resonance frequency</span></span>
|
|
geophone.k = geophone.m <span class="org-type">*</span> (2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>args.freq)<span class="org-type">^</span>2;
|
|
|
|
<span class="org-matlab-cellbreak"><span class="org-comment">%% We set the damping value to have critical damping</span></span>
|
|
geophone.c = 2<span class="org-type">*</span>sqrt(geophone.m <span class="org-type">*</span> geophone.k);
|
|
|
|
<span class="org-matlab-cellbreak"><span class="org-comment">%% Save</span></span>
|
|
save(<span class="org-string">'./mat/geophone_z_axis.mat'</span>, <span class="org-string">'geophone'</span>);
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgcbfdd06" class="outline-2">
|
|
<h2 id="orgcbfdd06"><span class="section-number-2">14</span> Z-Axis Accelerometer</h2>
|
|
<div class="outline-text-2" id="text-14">
|
|
<p>
|
|
<a id="orgfc8332f"></a>
|
|
</p>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[accelerometer]</span> = <span class="org-function-name">initializeZAxisAccelerometer</span>(<span class="org-variable-name">args</span>)
|
|
arguments
|
|
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 1e<span class="org-type">-</span>3 <span class="org-comment">% [kg]</span>
|
|
args.freq (1,1) double {mustBeNumeric, mustBePositive} = 5e3 <span class="org-comment">% [Hz]</span>
|
|
<span class="org-keyword">end</span>
|
|
|
|
<span class="org-matlab-cellbreak"><span class="org-comment">%%</span></span>
|
|
accelerometer.m = args.mass;
|
|
|
|
<span class="org-matlab-cellbreak"><span class="org-comment">%% The Stiffness is set to have the damping resonance frequency</span></span>
|
|
accelerometer.k = accelerometer.m <span class="org-type">*</span> (2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>args.freq)<span class="org-type">^</span>2;
|
|
|
|
<span class="org-matlab-cellbreak"><span class="org-comment">%% We set the damping value to have critical damping</span></span>
|
|
accelerometer.c = 2<span class="org-type">*</span>sqrt(accelerometer.m <span class="org-type">*</span> accelerometer.k);
|
|
|
|
<span class="org-matlab-cellbreak"><span class="org-comment">%% Gain correction of the accelerometer to have a unity gain until the resonance</span></span>
|
|
accelerometer.gain = <span class="org-type">-</span>accelerometer.k<span class="org-type">/</span>accelerometer.m;
|
|
|
|
<span class="org-matlab-cellbreak"><span class="org-comment">%% Save</span></span>
|
|
save(<span class="org-string">'./mat/accelerometer_z_axis.mat'</span>, <span class="org-string">'accelerometer'</span>);
|
|
<span class="org-keyword">end</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="postamble" class="status">
|
|
<p class="author">Author: Dehaeze Thomas</p>
|
|
<p class="date">Created: 2020-02-03 lun. 17:50</p>
|
|
</div>
|
|
</body>
|
|
</html>
|