2968 lines
92 KiB
HTML
2968 lines
92 KiB
HTML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
|
<head>
|
|
<!-- 2020-05-20 mer. 16:41 -->
|
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
|
<title>Subsystems used for the Simscape Models</title>
|
|
<meta name="generator" content="Org mode" />
|
|
<meta name="author" content="Dehaeze Thomas" />
|
|
<link rel="stylesheet" type="text/css" href="./css/htmlize.css"/>
|
|
<link rel="stylesheet" type="text/css" href="./css/readtheorg.css"/>
|
|
<script src="./js/jquery.min.js"></script>
|
|
<script src="./js/bootstrap.min.js"></script>
|
|
<script src="./js/jquery.stickytableheaders.min.js"></script>
|
|
<script src="./js/readtheorg.js"></script>
|
|
</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="#org6171274">1. Simscape Configuration</a>
|
|
<ul>
|
|
<li><a href="#org71549c6">Function description</a></li>
|
|
<li><a href="#org4eb7ed1">Optional Parameters</a></li>
|
|
<li><a href="#org0273d6e">Structure initialization</a></li>
|
|
<li><a href="#org0533a9d">Add Type</a></li>
|
|
<li><a href="#orga766ac2">Save the Structure</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orgdda6840">2. Logging Configuration</a>
|
|
<ul>
|
|
<li><a href="#org90f799b">Function description</a></li>
|
|
<li><a href="#org542977b">Optional Parameters</a></li>
|
|
<li><a href="#org7e6aef5">Structure initialization</a></li>
|
|
<li><a href="#org85a00ab">Add Type</a></li>
|
|
<li><a href="#org60d91f1">Sampling Time</a></li>
|
|
<li><a href="#orge45398b">Save the Structure</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org1bf1870">3. Ground</a>
|
|
<ul>
|
|
<li><a href="#org849e75c">Simscape Model</a></li>
|
|
<li><a href="#orgef88347">Function description</a></li>
|
|
<li><a href="#orge9001a2">Optional Parameters</a></li>
|
|
<li><a href="#org326d9cd">Structure initialization</a></li>
|
|
<li><a href="#org7e3f81e">Add Type</a></li>
|
|
<li><a href="#org4c31ca5">Ground Solid properties</a></li>
|
|
<li><a href="#org542691f">Rotation Point</a></li>
|
|
<li><a href="#orgaf3586d">Save the Structure</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orga045749">4. Granite</a>
|
|
<ul>
|
|
<li><a href="#org63e5af5">Simscape Model</a></li>
|
|
<li><a href="#org1964327">Function description</a></li>
|
|
<li><a href="#org323a4d2">Optional Parameters</a></li>
|
|
<li><a href="#org9951928">Structure initialization</a></li>
|
|
<li><a href="#org413c06d">Add Granite Type</a></li>
|
|
<li><a href="#org10cd272">Material and Geometry</a></li>
|
|
<li><a href="#org334e053">Stiffness and Damping properties</a></li>
|
|
<li><a href="#org22b74be">Equilibrium position of the each joint.</a></li>
|
|
<li><a href="#orgc54eb09">Save the Structure</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org9a6562c">5. Translation Stage</a>
|
|
<ul>
|
|
<li><a href="#orge4997dc">Simscape Model</a></li>
|
|
<li><a href="#org09bc809">Function description</a></li>
|
|
<li><a href="#org21ffabf">Optional Parameters</a></li>
|
|
<li><a href="#org6bb4743">Structure initialization</a></li>
|
|
<li><a href="#org715e876">Add Translation Stage Type</a></li>
|
|
<li><a href="#orgcd38e39">Material and Geometry</a></li>
|
|
<li><a href="#orge09c9f6">Stiffness and Damping properties</a></li>
|
|
<li><a href="#org8e3c173">Equilibrium position of the each joint.</a></li>
|
|
<li><a href="#org1a14fbf">Save the Structure</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org005e07a">6. Tilt Stage</a>
|
|
<ul>
|
|
<li><a href="#org07fc6bc">Simscape Model</a></li>
|
|
<li><a href="#orgfa2c18a">Function description</a></li>
|
|
<li><a href="#org98764fa">Optional Parameters</a></li>
|
|
<li><a href="#org7dff4aa">Structure initialization</a></li>
|
|
<li><a href="#orgea3a7ba">Add Tilt Type</a></li>
|
|
<li><a href="#org76b4e3d">Material and Geometry</a></li>
|
|
<li><a href="#orgb2aa2be">Stiffness and Damping properties</a></li>
|
|
<li><a href="#org6b04545">Equilibrium position of the each joint.</a></li>
|
|
<li><a href="#orge7788bb">Save the Structure</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orge49a64e">7. Spindle</a>
|
|
<ul>
|
|
<li><a href="#orga83b541">Simscape Model</a></li>
|
|
<li><a href="#orge0149e5">Function description</a></li>
|
|
<li><a href="#org4018244">Optional Parameters</a></li>
|
|
<li><a href="#org595008e">Structure initialization</a></li>
|
|
<li><a href="#orge5b17ec">Add Spindle Type</a></li>
|
|
<li><a href="#org33822ab">Material and Geometry</a></li>
|
|
<li><a href="#org099371d">Stiffness and Damping properties</a></li>
|
|
<li><a href="#org7169219">Equilibrium position of the each joint.</a></li>
|
|
<li><a href="#orgd01db06">Save the Structure</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orgf16b0ab">8. Micro Hexapod</a>
|
|
<ul>
|
|
<li><a href="#org7ce0042">Simscape Model</a></li>
|
|
<li><a href="#org8e8fb99">Function description</a></li>
|
|
<li><a href="#org678a047">Optional Parameters</a></li>
|
|
<li><a href="#org74a22e9">Function content</a></li>
|
|
<li><a href="#orged79a97">Add Type</a></li>
|
|
<li><a href="#org484999b">Save the Structure</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orga55d418">9. Center of gravity compensation</a>
|
|
<ul>
|
|
<li><a href="#org7be0b08">Simscape Model</a></li>
|
|
<li><a href="#org7786362">Function description</a></li>
|
|
<li><a href="#org174a7a0">Optional Parameters</a></li>
|
|
<li><a href="#org80c2470">Structure initialization</a></li>
|
|
<li><a href="#orgc00cdcd">Add Type</a></li>
|
|
<li><a href="#org24e9b2c">Material and Geometry</a></li>
|
|
<li><a href="#org7c46efe">Save the Structure</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org7586ab7">10. Mirror</a>
|
|
<ul>
|
|
<li><a href="#orgd6e16a6">Simscape Model</a></li>
|
|
<li><a href="#org18a29e3">Function description</a></li>
|
|
<li><a href="#orge97107b">Optional Parameters</a></li>
|
|
<li><a href="#orgeba3129">Structure initialization</a></li>
|
|
<li><a href="#orgff14824">Add Mirror Type</a></li>
|
|
<li><a href="#org4ad73aa">Mass and Inertia</a></li>
|
|
<li><a href="#org42b4b18">Stiffness and Damping properties</a></li>
|
|
<li><a href="#org48c3eec">Equilibrium position of the each joint.</a></li>
|
|
<li><a href="#orgc381755">Geometry</a></li>
|
|
<li><a href="#orgb814645">Save the Structure</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org2516704">11. Nano Hexapod</a>
|
|
<ul>
|
|
<li><a href="#org56d49c9">Simscape Model</a></li>
|
|
<li><a href="#org0016478">Function description</a></li>
|
|
<li><a href="#org35f64ed">Optional Parameters</a></li>
|
|
<li><a href="#org0737b17">Function content</a></li>
|
|
<li><a href="#org3b2b31f">Add Type</a></li>
|
|
<li><a href="#org5b7657f">Save the Structure</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org3d615a1">12. Sample</a>
|
|
<ul>
|
|
<li><a href="#org4068b6d">Simscape Model</a></li>
|
|
<li><a href="#org7cb3c0a">Function description</a></li>
|
|
<li><a href="#org45dfb8b">Optional Parameters</a></li>
|
|
<li><a href="#org777606d">Structure initialization</a></li>
|
|
<li><a href="#org2bb1d24">Add Sample Type</a></li>
|
|
<li><a href="#org3bf8f39">Material and Geometry</a></li>
|
|
<li><a href="#org228453f">Compute the Inertia</a></li>
|
|
<li><a href="#orga217348">Stiffness and Damping properties</a></li>
|
|
<li><a href="#orgc6700d2">Equilibrium position of the each joint.</a></li>
|
|
<li><a href="#orgb88e566">Save the Structure</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orge9cbdc9">13. Initialize Controller</a>
|
|
<ul>
|
|
<li><a href="#orgbaecbcc">Function Declaration and Documentation</a></li>
|
|
<li><a href="#org5f24bdc">Optional Parameters</a></li>
|
|
<li><a href="#org6e89216">Structure initialization</a></li>
|
|
<li><a href="#org4207f98">Controller Type</a></li>
|
|
<li><a href="#org202f2f5">Save the Structure</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orgae5cb57">14. Generate Reference Signals</a>
|
|
<ul>
|
|
<li><a href="#org671c2c2">Function Declaration and Documentation</a></li>
|
|
<li><a href="#org5323b00">Optional Parameters</a></li>
|
|
<li><a href="#orge94c0c2">Initialize Parameters</a></li>
|
|
<li><a href="#orgf66b222">Translation Stage</a></li>
|
|
<li><a href="#orga18d111">Tilt Stage</a></li>
|
|
<li><a href="#org8d2c73d">Spindle</a></li>
|
|
<li><a href="#org8ba04e2">Micro Hexapod</a></li>
|
|
<li><a href="#org04d73dc">Axis Compensation</a></li>
|
|
<li><a href="#org34337a8">Nano Hexapod</a></li>
|
|
<li><a href="#orgf26ccc6">Save</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org544c9dd">15. Initialize Disturbances</a>
|
|
<ul>
|
|
<li><a href="#orga2a09de">Function Declaration and Documentation</a></li>
|
|
<li><a href="#org3bd7db1">Optional Parameters</a></li>
|
|
<li><a href="#orgf744aeb">Load Data</a></li>
|
|
<li><a href="#org6c7d666">Parameters</a></li>
|
|
<li><a href="#orgb2108c4">Ground Motion</a></li>
|
|
<li><a href="#orgb70c65e">Translation Stage - X direction</a></li>
|
|
<li><a href="#org070255a">Translation Stage - Z direction</a></li>
|
|
<li><a href="#orgfd5f32b">Spindle - Z direction</a></li>
|
|
<li><a href="#orgba4d479">Direct Forces</a></li>
|
|
<li><a href="#orgf6d2198">Set initial value to zero</a></li>
|
|
<li><a href="#org38c42fa">Save</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orgefb8a5e">16. Initialize Position Errors</a>
|
|
<ul>
|
|
<li><a href="#orgf8f086e">Function Declaration and Documentation</a></li>
|
|
<li><a href="#org8dbc80b">Optional Parameters</a></li>
|
|
<li><a href="#org5d6b026">Structure initialization</a></li>
|
|
<li><a href="#orgc890f7d">Type</a></li>
|
|
<li><a href="#org7d50228">Position Errors</a></li>
|
|
<li><a href="#org01d19da">Save</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orgc87e890">17. Z-Axis Geophone</a></li>
|
|
<li><a href="#orgcbddbd1">18. Z-Axis Accelerometer</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<p>
|
|
The full Simscape Model is represented in Figure <a href="#org742ece0">1</a>.
|
|
</p>
|
|
|
|
|
|
<div id="org742ece0" 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-org6171274" class="outline-2">
|
|
<h2 id="org6171274"><span class="section-number-2">1</span> Simscape Configuration</h2>
|
|
<div class="outline-text-2" id="text-1">
|
|
<p>
|
|
<a id="orgb590dcf"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org71549c6" class="outline-3">
|
|
<h3 id="org71549c6">Function description</h3>
|
|
<div class="outline-text-3" id="text-org71549c6">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">function [] = initializeSimscapeConfiguration(args)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org4eb7ed1" class="outline-3">
|
|
<h3 id="org4eb7ed1">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-org4eb7ed1">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.gravity logical {mustBeNumericOrLogical} = true
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org0273d6e" class="outline-3">
|
|
<h3 id="org0273d6e">Structure initialization</h3>
|
|
<div class="outline-text-3" id="text-org0273d6e">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">conf_simscape = struct();
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org0533a9d" class="outline-3">
|
|
<h3 id="org0533a9d">Add Type</h3>
|
|
<div class="outline-text-3" id="text-org0533a9d">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">if args.gravity
|
|
conf_simscape.type = 1;
|
|
else
|
|
conf_simscape.type = 2;
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orga766ac2" class="outline-3">
|
|
<h3 id="orga766ac2">Save the Structure</h3>
|
|
<div class="outline-text-3" id="text-orga766ac2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save('./mat/conf_simscape.mat', 'conf_simscape');
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgdda6840" class="outline-2">
|
|
<h2 id="orgdda6840"><span class="section-number-2">2</span> Logging Configuration</h2>
|
|
<div class="outline-text-2" id="text-2">
|
|
<p>
|
|
<a id="org1f9c6ac"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org90f799b" class="outline-3">
|
|
<h3 id="org90f799b">Function description</h3>
|
|
<div class="outline-text-3" id="text-org90f799b">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">function [] = initializeLoggingConfiguration(args)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org542977b" class="outline-3">
|
|
<h3 id="org542977b">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-org542977b">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.log char {mustBeMember(args.log,{'none', 'all', 'forces'})} = 'none'
|
|
args.Ts (1,1) double {mustBeNumeric, mustBePositive} = 1e-3
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org7e6aef5" class="outline-3">
|
|
<h3 id="org7e6aef5">Structure initialization</h3>
|
|
<div class="outline-text-3" id="text-org7e6aef5">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">conf_log = struct();
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org85a00ab" class="outline-3">
|
|
<h3 id="org85a00ab">Add Type</h3>
|
|
<div class="outline-text-3" id="text-org85a00ab">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">switch args.log
|
|
case 'none'
|
|
conf_log.type = 0;
|
|
case 'all'
|
|
conf_log.type = 1;
|
|
case 'forces'
|
|
conf_log.type = 2;
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org60d91f1" class="outline-3">
|
|
<h3 id="org60d91f1">Sampling Time</h3>
|
|
<div class="outline-text-3" id="text-org60d91f1">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">conf_log.Ts = args.Ts;
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge45398b" class="outline-3">
|
|
<h3 id="orge45398b">Save the Structure</h3>
|
|
<div class="outline-text-3" id="text-orge45398b">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save('./mat/conf_log.mat', 'conf_log');
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org1bf1870" class="outline-2">
|
|
<h2 id="org1bf1870"><span class="section-number-2">3</span> Ground</h2>
|
|
<div class="outline-text-2" id="text-3">
|
|
<p>
|
|
<a id="orgbe1f388"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org849e75c" class="outline-3">
|
|
<h3 id="org849e75c">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-org849e75c">
|
|
<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="org31eeec1" 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="org342019d" 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-orgef88347" class="outline-3">
|
|
<h3 id="orgef88347">Function description</h3>
|
|
<div class="outline-text-3" id="text-orgef88347">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">function [ground] = initializeGround(args)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge9001a2" class="outline-3">
|
|
<h3 id="orge9001a2">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-orge9001a2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.type char {mustBeMember(args.type,{'none', 'rigid'})} = 'rigid'
|
|
args.rot_point (3,1) double {mustBeNumeric} = zeros(3,1) % Rotation point for the ground motion [m]
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org326d9cd" class="outline-3">
|
|
<h3 id="org326d9cd">Structure initialization</h3>
|
|
<div class="outline-text-3" id="text-org326d9cd">
|
|
<p>
|
|
First, we initialize the <code>granite</code> structure.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">ground = struct();
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org7e3f81e" class="outline-3">
|
|
<h3 id="org7e3f81e">Add Type</h3>
|
|
<div class="outline-text-3" id="text-org7e3f81e">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">switch args.type
|
|
case 'none'
|
|
ground.type = 0;
|
|
case 'rigid'
|
|
ground.type = 1;
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org4c31ca5" class="outline-3">
|
|
<h3 id="org4c31ca5">Ground Solid properties</h3>
|
|
<div class="outline-text-3" id="text-org4c31ca5">
|
|
<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]; % [m]
|
|
ground.density = 2800; % [kg/m3]
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org542691f" class="outline-3">
|
|
<h3 id="org542691f">Rotation Point</h3>
|
|
<div class="outline-text-3" id="text-org542691f">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">ground.rot_point = args.rot_point;
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgaf3586d" class="outline-3">
|
|
<h3 id="orgaf3586d">Save the Structure</h3>
|
|
<div class="outline-text-3" id="text-orgaf3586d">
|
|
<p>
|
|
The <code>ground</code> structure is saved.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save('./mat/stages.mat', 'ground', '-append');
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orga045749" class="outline-2">
|
|
<h2 id="orga045749"><span class="section-number-2">4</span> Granite</h2>
|
|
<div class="outline-text-2" id="text-4">
|
|
<p>
|
|
<a id="org82dc444"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org63e5af5" class="outline-3">
|
|
<h3 id="org63e5af5">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-org63e5af5">
|
|
<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="org3072cb3" 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="org089e7b6" 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-org1964327" class="outline-3">
|
|
<h3 id="org1964327">Function description</h3>
|
|
<div class="outline-text-3" id="text-org1964327">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">function [granite] = initializeGranite(args)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org323a4d2" class="outline-3">
|
|
<h3 id="org323a4d2">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-org323a4d2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.type char {mustBeMember(args.type,{'rigid', 'flexible', 'none', 'modal-analysis', 'init'})} = 'flexible'
|
|
args.Foffset logical {mustBeNumericOrLogical} = false
|
|
args.density (1,1) double {mustBeNumeric, mustBeNonnegative} = 2800 % Density [kg/m3]
|
|
args.K (3,1) double {mustBeNumeric, mustBeNonnegative} = [4e9; 3e8; 8e8] % [N/m]
|
|
args.C (3,1) double {mustBeNumeric, mustBeNonnegative} = [4.0e5; 1.1e5; 9.0e5] % [N/(m/s)]
|
|
args.x0 (1,1) double {mustBeNumeric} = 0 % Rest position of the Joint in the X direction [m]
|
|
args.y0 (1,1) double {mustBeNumeric} = 0 % Rest position of the Joint in the Y direction [m]
|
|
args.z0 (1,1) double {mustBeNumeric} = 0 % Rest position of the Joint in the Z direction [m]
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org9951928" class="outline-3">
|
|
<h3 id="org9951928">Structure initialization</h3>
|
|
<div class="outline-text-3" id="text-org9951928">
|
|
<p>
|
|
First, we initialize the <code>granite</code> structure.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">granite = struct();
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org413c06d" class="outline-3">
|
|
<h3 id="org413c06d">Add Granite Type</h3>
|
|
<div class="outline-text-3" id="text-org413c06d">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">switch args.type
|
|
case 'none'
|
|
granite.type = 0;
|
|
case 'rigid'
|
|
granite.type = 1;
|
|
case 'flexible'
|
|
granite.type = 2;
|
|
case 'modal-analysis'
|
|
granite.type = 3;
|
|
case 'init'
|
|
granite.type = 4;
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org10cd272" class="outline-3">
|
|
<h3 id="org10cd272">Material and Geometry</h3>
|
|
<div class="outline-text-3" id="text-org10cd272">
|
|
<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; % [kg/m3]
|
|
granite.STEP = './STEPS/granite/granite.STEP';
|
|
</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; % [m]
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org334e053" class="outline-3">
|
|
<h3 id="org334e053">Stiffness and Damping properties</h3>
|
|
<div class="outline-text-3" id="text-org334e053">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">granite.K = args.K; % [N/m]
|
|
granite.C = args.C; % [N/(m/s)]
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org22b74be" class="outline-3">
|
|
<h3 id="org22b74be">Equilibrium position of the each joint.</h3>
|
|
<div class="outline-text-3" id="text-org22b74be">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">if args.Foffset && ~strcmp(args.type, 'none') && ~strcmp(args.type, 'rigid') && ~strcmp(args.type, 'init')
|
|
load('mat/Foffset.mat', 'Fgm');
|
|
granite.Deq = -Fgm'./granite.K;
|
|
else
|
|
granite.Deq = zeros(6,1);
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgc54eb09" class="outline-3">
|
|
<h3 id="orgc54eb09">Save the Structure</h3>
|
|
<div class="outline-text-3" id="text-orgc54eb09">
|
|
<p>
|
|
The <code>granite</code> structure is saved.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save('./mat/stages.mat', 'granite', '-append');
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org9a6562c" class="outline-2">
|
|
<h2 id="org9a6562c"><span class="section-number-2">5</span> Translation Stage</h2>
|
|
<div class="outline-text-2" id="text-5">
|
|
<p>
|
|
<a id="orga6fcdbd"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-orge4997dc" class="outline-3">
|
|
<h3 id="orge4997dc">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-orge4997dc">
|
|
<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="orgb5e657d" 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="org55b7d60" 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-org09bc809" class="outline-3">
|
|
<h3 id="org09bc809">Function description</h3>
|
|
<div class="outline-text-3" id="text-org09bc809">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">function [ty] = initializeTy(args)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org21ffabf" class="outline-3">
|
|
<h3 id="org21ffabf">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-org21ffabf">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible', 'modal-analysis', 'init'})} = 'flexible'
|
|
args.Foffset logical {mustBeNumericOrLogical} = false
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org6bb4743" class="outline-3">
|
|
<h3 id="org6bb4743">Structure initialization</h3>
|
|
<div class="outline-text-3" id="text-org6bb4743">
|
|
<p>
|
|
First, we initialize the <code>ty</code> structure.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">ty = struct();
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org715e876" class="outline-3">
|
|
<h3 id="org715e876">Add Translation Stage Type</h3>
|
|
<div class="outline-text-3" id="text-org715e876">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">switch args.type
|
|
case 'none'
|
|
ty.type = 0;
|
|
case 'rigid'
|
|
ty.type = 1;
|
|
case 'flexible'
|
|
ty.type = 2;
|
|
case 'modal-analysis'
|
|
ty.type = 3;
|
|
case 'init'
|
|
ty.type = 4;
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgcd38e39" class="outline-3">
|
|
<h3 id="orgcd38e39">Material and Geometry</h3>
|
|
<div class="outline-text-3" id="text-orgcd38e39">
|
|
<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">% Ty Granite frame
|
|
ty.granite_frame.density = 7800; % [kg/m3] => 43kg
|
|
ty.granite_frame.STEP = './STEPS/Ty/Ty_Granite_Frame.STEP';
|
|
|
|
% Guide Translation Ty
|
|
ty.guide.density = 7800; % [kg/m3] => 76kg
|
|
ty.guide.STEP = './STEPS/ty/Ty_Guide.STEP';
|
|
|
|
% Ty - Guide_Translation12
|
|
ty.guide12.density = 7800; % [kg/m3]
|
|
ty.guide12.STEP = './STEPS/Ty/Ty_Guide_12.STEP';
|
|
|
|
% Ty - Guide_Translation11
|
|
ty.guide11.density = 7800; % [kg/m3]
|
|
ty.guide11.STEP = './STEPS/ty/Ty_Guide_11.STEP';
|
|
|
|
% Ty - Guide_Translation22
|
|
ty.guide22.density = 7800; % [kg/m3]
|
|
ty.guide22.STEP = './STEPS/ty/Ty_Guide_22.STEP';
|
|
|
|
% Ty - Guide_Translation21
|
|
ty.guide21.density = 7800; % [kg/m3]
|
|
ty.guide21.STEP = './STEPS/Ty/Ty_Guide_21.STEP';
|
|
|
|
% Ty - Plateau translation
|
|
ty.frame.density = 7800; % [kg/m3]
|
|
ty.frame.STEP = './STEPS/ty/Ty_Stage.STEP';
|
|
|
|
% Ty Stator Part
|
|
ty.stator.density = 5400; % [kg/m3]
|
|
ty.stator.STEP = './STEPS/ty/Ty_Motor_Stator.STEP';
|
|
|
|
% Ty Rotor Part
|
|
ty.rotor.density = 5400; % [kg/m3]
|
|
ty.rotor.STEP = './STEPS/ty/Ty_Motor_Rotor.STEP';
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge09c9f6" class="outline-3">
|
|
<h3 id="orge09c9f6">Stiffness and Damping properties</h3>
|
|
<div class="outline-text-3" id="text-orge09c9f6">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">ty.K = [2e8; 1e8; 2e8; 6e7; 9e7; 6e7]; % [N/m, N*m/rad]
|
|
ty.C = [8e4; 5e4; 8e4; 2e4; 3e4; 2e4]; % [N/(m/s), N*m/(rad/s)]
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org8e3c173" class="outline-3">
|
|
<h3 id="org8e3c173">Equilibrium position of the each joint.</h3>
|
|
<div class="outline-text-3" id="text-org8e3c173">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">if args.Foffset && ~strcmp(args.type, 'none') && ~strcmp(args.type, 'rigid') && ~strcmp(args.type, 'init')
|
|
load('mat/Foffset.mat', 'Ftym');
|
|
ty.Deq = -Ftym'./ty.K;
|
|
else
|
|
ty.Deq = zeros(6,1);
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org1a14fbf" class="outline-3">
|
|
<h3 id="org1a14fbf">Save the Structure</h3>
|
|
<div class="outline-text-3" id="text-org1a14fbf">
|
|
<p>
|
|
The <code>ty</code> structure is saved.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save('./mat/stages.mat', 'ty', '-append');
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org005e07a" class="outline-2">
|
|
<h2 id="org005e07a"><span class="section-number-2">6</span> Tilt Stage</h2>
|
|
<div class="outline-text-2" id="text-6">
|
|
<p>
|
|
<a id="orga630083"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org07fc6bc" class="outline-3">
|
|
<h3 id="org07fc6bc">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-org07fc6bc">
|
|
<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="orgee25bbf" 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="orgcb39e81" 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-orgfa2c18a" class="outline-3">
|
|
<h3 id="orgfa2c18a">Function description</h3>
|
|
<div class="outline-text-3" id="text-orgfa2c18a">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">function [ry] = initializeRy(args)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org98764fa" class="outline-3">
|
|
<h3 id="org98764fa">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-org98764fa">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible', 'modal-analysis', 'init'})} = 'flexible'
|
|
args.Foffset logical {mustBeNumericOrLogical} = false
|
|
args.Ry_init (1,1) double {mustBeNumeric} = 0
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org7dff4aa" class="outline-3">
|
|
<h3 id="org7dff4aa">Structure initialization</h3>
|
|
<div class="outline-text-3" id="text-org7dff4aa">
|
|
<p>
|
|
First, we initialize the <code>ry</code> structure.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">ry = struct();
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="outline-container-orgea3a7ba" class="outline-3">
|
|
<h3 id="orgea3a7ba">Add Tilt Type</h3>
|
|
<div class="outline-text-3" id="text-orgea3a7ba">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">switch args.type
|
|
case 'none'
|
|
ry.type = 0;
|
|
case 'rigid'
|
|
ry.type = 1;
|
|
case 'flexible'
|
|
ry.type = 2;
|
|
case 'modal-analysis'
|
|
ry.type = 3;
|
|
case 'init'
|
|
ry.type = 4;
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org76b4e3d" class="outline-3">
|
|
<h3 id="org76b4e3d">Material and Geometry</h3>
|
|
<div class="outline-text-3" id="text-org76b4e3d">
|
|
<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">% Ry - Guide for the tilt stage
|
|
ry.guide.density = 7800; % [kg/m3]
|
|
ry.guide.STEP = './STEPS/ry/Tilt_Guide.STEP';
|
|
|
|
% Ry - Rotor of the motor
|
|
ry.rotor.density = 2400; % [kg/m3]
|
|
ry.rotor.STEP = './STEPS/ry/Tilt_Motor_Axis.STEP';
|
|
|
|
% Ry - Motor
|
|
ry.motor.density = 3200; % [kg/m3]
|
|
ry.motor.STEP = './STEPS/ry/Tilt_Motor.STEP';
|
|
|
|
% Ry - Plateau Tilt
|
|
ry.stage.density = 7800; % [kg/m3]
|
|
ry.stage.STEP = './STEPS/ry/Tilt_Stage.STEP';
|
|
</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; % [m]
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">ry.Ry_init = args.Ry_init; % [rad]
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgb2aa2be" class="outline-3">
|
|
<h3 id="orgb2aa2be">Stiffness and Damping properties</h3>
|
|
<div class="outline-text-3" id="text-orgb2aa2be">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">ry.K = [3.8e8; 4e8; 3.8e8; 1.2e8; 6e4; 1.2e8];
|
|
ry.C = [1e5; 1e5; 1e5; 3e4; 1e3; 3e4];
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org6b04545" class="outline-3">
|
|
<h3 id="org6b04545">Equilibrium position of the each joint.</h3>
|
|
<div class="outline-text-3" id="text-org6b04545">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">if args.Foffset && ~strcmp(args.type, 'none') && ~strcmp(args.type, 'rigid') && ~strcmp(args.type, 'init')
|
|
load('mat/Foffset.mat', 'Fym');
|
|
ry.Deq = -Fym'./ry.K;
|
|
else
|
|
ry.Deq = zeros(6,1);
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge7788bb" class="outline-3">
|
|
<h3 id="orge7788bb">Save the Structure</h3>
|
|
<div class="outline-text-3" id="text-orge7788bb">
|
|
<p>
|
|
The <code>ry</code> structure is saved.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save('./mat/stages.mat', 'ry', '-append');
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge49a64e" class="outline-2">
|
|
<h2 id="orge49a64e"><span class="section-number-2">7</span> Spindle</h2>
|
|
<div class="outline-text-2" id="text-7">
|
|
<p>
|
|
<a id="org85f7685"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-orga83b541" class="outline-3">
|
|
<h3 id="orga83b541">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-orga83b541">
|
|
<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="orgf8cd2b8" 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="org8f17d51" 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-orge0149e5" class="outline-3">
|
|
<h3 id="orge0149e5">Function description</h3>
|
|
<div class="outline-text-3" id="text-orge0149e5">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">function [rz] = initializeRz(args)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org4018244" class="outline-3">
|
|
<h3 id="org4018244">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-org4018244">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible', 'modal-analysis', 'init'})} = 'flexible'
|
|
args.Foffset logical {mustBeNumericOrLogical} = false
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org595008e" class="outline-3">
|
|
<h3 id="org595008e">Structure initialization</h3>
|
|
<div class="outline-text-3" id="text-org595008e">
|
|
<p>
|
|
First, we initialize the <code>rz</code> structure.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">rz = struct();
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge5b17ec" class="outline-3">
|
|
<h3 id="orge5b17ec">Add Spindle Type</h3>
|
|
<div class="outline-text-3" id="text-orge5b17ec">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">switch args.type
|
|
case 'none'
|
|
rz.type = 0;
|
|
case 'rigid'
|
|
rz.type = 1;
|
|
case 'flexible'
|
|
rz.type = 2;
|
|
case 'modal-analysis'
|
|
rz.type = 3;
|
|
case 'init'
|
|
rz.type = 4;
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org33822ab" class="outline-3">
|
|
<h3 id="org33822ab">Material and Geometry</h3>
|
|
<div class="outline-text-3" id="text-org33822ab">
|
|
<p>
|
|
Properties of the Material and link to the geometry of the spindle.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">% Spindle - Slip Ring
|
|
rz.slipring.density = 7800; % [kg/m3]
|
|
rz.slipring.STEP = './STEPS/rz/Spindle_Slip_Ring.STEP';
|
|
|
|
% Spindle - Rotor
|
|
rz.rotor.density = 7800; % [kg/m3]
|
|
rz.rotor.STEP = './STEPS/rz/Spindle_Rotor.STEP';
|
|
|
|
% Spindle - Stator
|
|
rz.stator.density = 7800; % [kg/m3]
|
|
rz.stator.STEP = './STEPS/rz/Spindle_Stator.STEP';
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org099371d" class="outline-3">
|
|
<h3 id="org099371d">Stiffness and Damping properties</h3>
|
|
<div class="outline-text-3" id="text-org099371d">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">rz.K = [7e8; 7e8; 2e9; 1e7; 1e7; 1e7];
|
|
rz.C = [4e4; 4e4; 7e4; 1e4; 1e4; 1e4];
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org7169219" class="outline-3">
|
|
<h3 id="org7169219">Equilibrium position of the each joint.</h3>
|
|
<div class="outline-text-3" id="text-org7169219">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">if args.Foffset && ~strcmp(args.type, 'none') && ~strcmp(args.type, 'rigid') && ~strcmp(args.type, 'init')
|
|
load('mat/Foffset.mat', 'Fzm');
|
|
rz.Deq = -Fzm'./rz.K;
|
|
else
|
|
rz.Deq = zeros(6,1);
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgd01db06" class="outline-3">
|
|
<h3 id="orgd01db06">Save the Structure</h3>
|
|
<div class="outline-text-3" id="text-orgd01db06">
|
|
<p>
|
|
The <code>rz</code> structure is saved.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save('./mat/stages.mat', 'rz', '-append');
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgf16b0ab" class="outline-2">
|
|
<h2 id="orgf16b0ab"><span class="section-number-2">8</span> Micro Hexapod</h2>
|
|
<div class="outline-text-2" id="text-8">
|
|
<p>
|
|
<a id="org01254ae"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org7ce0042" class="outline-3">
|
|
<h3 id="org7ce0042">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-org7ce0042">
|
|
|
|
<div id="org13345ec" 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="orga63e01a" 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-org8e8fb99" class="outline-3">
|
|
<h3 id="org8e8fb99">Function description</h3>
|
|
<div class="outline-text-3" id="text-org8e8fb99">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">function [micro_hexapod] = initializeMicroHexapod(args)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org678a047" class="outline-3">
|
|
<h3 id="org678a047">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-org678a047">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible', 'modal-analysis', 'init', 'compliance'})} = 'flexible'
|
|
% initializeFramesPositions
|
|
args.H (1,1) double {mustBeNumeric, mustBePositive} = 350e-3
|
|
args.MO_B (1,1) double {mustBeNumeric} = 270e-3
|
|
% generateGeneralConfiguration
|
|
args.FH (1,1) double {mustBeNumeric, mustBePositive} = 50e-3
|
|
args.FR (1,1) double {mustBeNumeric, mustBePositive} = 175.5e-3
|
|
args.FTh (6,1) double {mustBeNumeric} = [-10, 10, 120-10, 120+10, 240-10, 240+10]*(pi/180)
|
|
args.MH (1,1) double {mustBeNumeric, mustBePositive} = 45e-3
|
|
args.MR (1,1) double {mustBeNumeric, mustBePositive} = 118e-3
|
|
args.MTh (6,1) double {mustBeNumeric} = [-60+10, 60-10, 60+10, 180-10, 180+10, -60-10]*(pi/180)
|
|
% initializeStrutDynamics
|
|
args.Ki (6,1) double {mustBeNumeric, mustBeNonnegative} = 2e7*ones(6,1)
|
|
args.Ci (6,1) double {mustBeNumeric, mustBeNonnegative} = 1.4e3*ones(6,1)
|
|
% initializeCylindricalPlatforms
|
|
args.Fpm (1,1) double {mustBeNumeric, mustBePositive} = 10
|
|
args.Fph (1,1) double {mustBeNumeric, mustBePositive} = 26e-3
|
|
args.Fpr (1,1) double {mustBeNumeric, mustBePositive} = 207.5e-3
|
|
args.Mpm (1,1) double {mustBeNumeric, mustBePositive} = 10
|
|
args.Mph (1,1) double {mustBeNumeric, mustBePositive} = 26e-3
|
|
args.Mpr (1,1) double {mustBeNumeric, mustBePositive} = 150e-3
|
|
% initializeCylindricalStruts
|
|
args.Fsm (1,1) double {mustBeNumeric, mustBePositive} = 1
|
|
args.Fsh (1,1) double {mustBeNumeric, mustBePositive} = 100e-3
|
|
args.Fsr (1,1) double {mustBeNumeric, mustBePositive} = 25e-3
|
|
args.Msm (1,1) double {mustBeNumeric, mustBePositive} = 1
|
|
args.Msh (1,1) double {mustBeNumeric, mustBePositive} = 100e-3
|
|
args.Msr (1,1) double {mustBeNumeric, mustBePositive} = 25e-3
|
|
% inverseKinematics
|
|
args.AP (3,1) double {mustBeNumeric} = zeros(3,1)
|
|
args.ARB (3,3) double {mustBeNumeric} = eye(3)
|
|
% Force that stiffness of each joint should apply at t=0
|
|
args.Foffset logical {mustBeNumericOrLogical} = false
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org74a22e9" class="outline-3">
|
|
<h3 id="org74a22e9">Function content</h3>
|
|
<div class="outline-text-3" id="text-org74a22e9">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">stewart = initializeStewartPlatform();
|
|
|
|
stewart = initializeFramesPositions(stewart, ...
|
|
'H', args.H, ...
|
|
'MO_B', args.MO_B);
|
|
|
|
stewart = generateGeneralConfiguration(stewart, ...
|
|
'FH', args.FH, ...
|
|
'FR', args.FR, ...
|
|
'FTh', args.FTh, ...
|
|
'MH', args.MH, ...
|
|
'MR', args.MR, ...
|
|
'MTh', args.MTh);
|
|
|
|
stewart = computeJointsPose(stewart);
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">stewart = initializeStrutDynamics(stewart, ...
|
|
'K', args.Ki, ...
|
|
'C', args.Ci);
|
|
|
|
stewart = initializeJointDynamics(stewart, ...
|
|
'type_F', 'universal_p', ...
|
|
'type_M', 'spherical_p');
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">stewart = initializeCylindricalPlatforms(stewart, ...
|
|
'Fpm', args.Fpm, ...
|
|
'Fph', args.Fph, ...
|
|
'Fpr', args.Fpr, ...
|
|
'Mpm', args.Mpm, ...
|
|
'Mph', args.Mph, ...
|
|
'Mpr', args.Mpr);
|
|
|
|
stewart = initializeCylindricalStruts(stewart, ...
|
|
'Fsm', args.Fsm, ...
|
|
'Fsh', args.Fsh, ...
|
|
'Fsr', args.Fsr, ...
|
|
'Msm', args.Msm, ...
|
|
'Msh', args.Msh, ...
|
|
'Msr', args.Msr);
|
|
|
|
stewart = computeJacobian(stewart);
|
|
|
|
stewart = initializeStewartPose(stewart, ...
|
|
'AP', args.AP, ...
|
|
'ARB', args.ARB);
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">stewart = initializeInertialSensor(stewart, 'type', 'none');
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Equilibrium position of the each joint.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">if args.Foffset && ~strcmp(args.type, 'none') && ~strcmp(args.type, 'rigid') && ~strcmp(args.type, 'init')
|
|
load('mat/Foffset.mat', 'Fhm');
|
|
stewart.actuators.dLeq = -Fhm'./args.Ki;
|
|
else
|
|
stewart.actuators.dLeq = zeros(6,1);
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orged79a97" class="outline-3">
|
|
<h3 id="orged79a97">Add Type</h3>
|
|
<div class="outline-text-3" id="text-orged79a97">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">switch args.type
|
|
case 'none'
|
|
stewart.type = 0;
|
|
case 'rigid'
|
|
stewart.type = 1;
|
|
case 'flexible'
|
|
stewart.type = 2;
|
|
case 'modal-analysis'
|
|
stewart.type = 3;
|
|
case 'init'
|
|
stewart.type = 4;
|
|
case 'compliance'
|
|
stewart.type = 5;
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org484999b" class="outline-3">
|
|
<h3 id="org484999b">Save the Structure</h3>
|
|
<div class="outline-text-3" id="text-org484999b">
|
|
<p>
|
|
The <code>micro_hexapod</code> structure is saved.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">micro_hexapod = stewart;
|
|
save('./mat/stages.mat', 'micro_hexapod', '-append');
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orga55d418" class="outline-2">
|
|
<h2 id="orga55d418"><span class="section-number-2">9</span> Center of gravity compensation</h2>
|
|
<div class="outline-text-2" id="text-9">
|
|
<p>
|
|
<a id="org9989724"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org7be0b08" class="outline-3">
|
|
<h3 id="org7be0b08">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-org7be0b08">
|
|
<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="orge09d585" 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="orga3d0932" 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-org7786362" class="outline-3">
|
|
<h3 id="org7786362">Function description</h3>
|
|
<div class="outline-text-3" id="text-org7786362">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">function [axisc] = initializeAxisc(args)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org174a7a0" class="outline-3">
|
|
<h3 id="org174a7a0">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-org174a7a0">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible'})} = 'flexible'
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org80c2470" class="outline-3">
|
|
<h3 id="org80c2470">Structure initialization</h3>
|
|
<div class="outline-text-3" id="text-org80c2470">
|
|
<p>
|
|
First, we initialize the <code>axisc</code> structure.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">axisc = struct();
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgc00cdcd" class="outline-3">
|
|
<h3 id="orgc00cdcd">Add Type</h3>
|
|
<div class="outline-text-3" id="text-orgc00cdcd">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">switch args.type
|
|
case 'none'
|
|
axisc.type = 0;
|
|
case 'rigid'
|
|
axisc.type = 1;
|
|
case 'flexible'
|
|
axisc.type = 2;
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org24e9b2c" class="outline-3">
|
|
<h3 id="org24e9b2c">Material and Geometry</h3>
|
|
<div class="outline-text-3" id="text-org24e9b2c">
|
|
<p>
|
|
Properties of the Material and link to the geometry files.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">% Structure
|
|
axisc.structure.density = 3400; % [kg/m3]
|
|
axisc.structure.STEP = './STEPS/axisc/axisc_structure.STEP';
|
|
|
|
% Wheel
|
|
axisc.wheel.density = 2700; % [kg/m3]
|
|
axisc.wheel.STEP = './STEPS/axisc/axisc_wheel.STEP';
|
|
|
|
% Mass
|
|
axisc.mass.density = 7800; % [kg/m3]
|
|
axisc.mass.STEP = './STEPS/axisc/axisc_mass.STEP';
|
|
|
|
% Gear
|
|
axisc.gear.density = 7800; % [kg/m3]
|
|
axisc.gear.STEP = './STEPS/axisc/axisc_gear.STEP';
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org7c46efe" class="outline-3">
|
|
<h3 id="org7c46efe">Save the Structure</h3>
|
|
<div class="outline-text-3" id="text-org7c46efe">
|
|
<p>
|
|
The <code>axisc</code> structure is saved.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save('./mat/stages.mat', 'axisc', '-append');
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org7586ab7" class="outline-2">
|
|
<h2 id="org7586ab7"><span class="section-number-2">10</span> Mirror</h2>
|
|
<div class="outline-text-2" id="text-10">
|
|
<p>
|
|
<a id="org3d670bf"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-orgd6e16a6" class="outline-3">
|
|
<h3 id="orgd6e16a6">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-orgd6e16a6">
|
|
<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="org281f48a" 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="orgf4fa701" 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-org18a29e3" class="outline-3">
|
|
<h3 id="org18a29e3">Function description</h3>
|
|
<div class="outline-text-3" id="text-org18a29e3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">function [] = initializeMirror(args)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge97107b" class="outline-3">
|
|
<h3 id="orge97107b">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-orge97107b">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible'})} = 'rigid'
|
|
args.shape char {mustBeMember(args.shape,{'spherical', 'conical'})} = 'spherical'
|
|
args.angle (1,1) double {mustBeNumeric, mustBePositive} = 45 % [deg]
|
|
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 10 % [kg]
|
|
args.freq (6,1) double {mustBeNumeric, mustBeNonnegative} = 200*ones(6,1) % [Hz]
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgeba3129" class="outline-3">
|
|
<h3 id="orgeba3129">Structure initialization</h3>
|
|
<div class="outline-text-3" id="text-orgeba3129">
|
|
<p>
|
|
First, we initialize the <code>mirror</code> structure.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">mirror = struct();
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgff14824" class="outline-3">
|
|
<h3 id="orgff14824">Add Mirror Type</h3>
|
|
<div class="outline-text-3" id="text-orgff14824">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">switch args.type
|
|
case 'none'
|
|
mirror.type = 0;
|
|
case 'rigid'
|
|
mirror.type = 1;
|
|
case 'flexible'
|
|
mirror.type = 2;
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org4ad73aa" class="outline-3">
|
|
<h3 id="org4ad73aa">Mass and Inertia</h3>
|
|
<div class="outline-text-3" id="text-org4ad73aa">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">mirror.mass = args.mass;
|
|
mirror.freq = args.freq;
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org42b4b18" class="outline-3">
|
|
<h3 id="org42b4b18">Stiffness and Damping properties</h3>
|
|
<div class="outline-text-3" id="text-org42b4b18">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">mirror.K = zeros(6,1);
|
|
mirror.K(1:3) = mirror.mass * (2*pi*mirror.freq(1:3)).^2;
|
|
|
|
mirror.C = zeros(6,1);
|
|
mirror.C(1:3) = 0.2 * sqrt(mirror.K(1:3).*mirror.mass);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org48c3eec" class="outline-3">
|
|
<h3 id="org48c3eec">Equilibrium position of the each joint.</h3>
|
|
<div class="outline-text-3" id="text-org48c3eec">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">mirror.Deq = zeros(6,1);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgc381755" class="outline-3">
|
|
<h3 id="orgc381755">Geometry</h3>
|
|
<div class="outline-text-3" id="text-orgc381755">
|
|
<p>
|
|
We define the geometrical values.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">mirror.h = 0.05; % Height of the mirror [m]
|
|
|
|
mirror.thickness = 0.025; % Thickness of the plate supporting the sample [m]
|
|
|
|
mirror.hole_rad = 0.125; % radius of the hole in the mirror [m]
|
|
|
|
mirror.support_rad = 0.1; % radius of the support plate [m]
|
|
|
|
% point of interest offset in z (above the top surfave) [m]
|
|
switch args.type
|
|
case 'none'
|
|
mirror.jacobian = 0.20;
|
|
case 'rigid'
|
|
mirror.jacobian = 0.20 - mirror.h;
|
|
case 'flexible'
|
|
mirror.jacobian = 0.20 - mirror.h;
|
|
end
|
|
|
|
mirror.rad = 0.180; % radius of the mirror (at the bottom surface) [m]
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">mirror.cone_length = mirror.rad*tand(args.angle)+mirror.h+mirror.jacobian; % Distance from Apex point of the cone to jacobian point
|
|
</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 = [...
|
|
mirror.support_rad+5e-3 mirror.h-mirror.thickness
|
|
mirror.hole_rad mirror.h-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">if strcmp(args.shape, 'spherical')
|
|
mirror.sphere_radius = sqrt((mirror.jacobian+mirror.h)^2+mirror.rad^2); % Radius of the sphere [mm]
|
|
|
|
for z = linspace(0, mirror.h, 101)
|
|
mirror.shape = [mirror.shape; sqrt(mirror.sphere_radius^2-(z-mirror.jacobian-mirror.h)^2) z];
|
|
end
|
|
elseif strcmp(args.shape, 'conical')
|
|
mirror.shape = [mirror.shape; mirror.rad+mirror.h/tand(args.angle) mirror.h];
|
|
else
|
|
error('Shape should be either conical or spherical');
|
|
end
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Finally, we close the shape.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">mirror.shape = [mirror.shape; mirror.support_rad+5e-3 mirror.h];
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgb814645" class="outline-3">
|
|
<h3 id="orgb814645">Save the Structure</h3>
|
|
<div class="outline-text-3" id="text-orgb814645">
|
|
<p>
|
|
The <code>mirror</code> structure is saved.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save('./mat/stages.mat', 'mirror', '-append');
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org2516704" class="outline-2">
|
|
<h2 id="org2516704"><span class="section-number-2">11</span> Nano Hexapod</h2>
|
|
<div class="outline-text-2" id="text-11">
|
|
<p>
|
|
<a id="org9a9721e"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org56d49c9" class="outline-3">
|
|
<h3 id="org56d49c9">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-org56d49c9">
|
|
|
|
<div id="orga6643fc" 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="org4d9fd08" 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-org0016478" class="outline-3">
|
|
<h3 id="org0016478">Function description</h3>
|
|
<div class="outline-text-3" id="text-org0016478">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">function [nano_hexapod] = initializeNanoHexapod(args)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org35f64ed" class="outline-3">
|
|
<h3 id="org35f64ed">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-org35f64ed">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible', 'init'})} = 'flexible'
|
|
% initializeFramesPositions
|
|
args.H (1,1) double {mustBeNumeric, mustBePositive} = 90e-3
|
|
args.MO_B (1,1) double {mustBeNumeric} = 175e-3
|
|
% generateGeneralConfiguration
|
|
args.FH (1,1) double {mustBeNumeric, mustBePositive} = 15e-3
|
|
args.FR (1,1) double {mustBeNumeric, mustBePositive} = 100e-3
|
|
args.FTh (6,1) double {mustBeNumeric} = [-10, 10, 120-10, 120+10, 240-10, 240+10]*(pi/180)
|
|
args.MH (1,1) double {mustBeNumeric, mustBePositive} = 15e-3
|
|
args.MR (1,1) double {mustBeNumeric, mustBePositive} = 90e-3
|
|
args.MTh (6,1) double {mustBeNumeric} = [-60+10, 60-10, 60+10, 180-10, 180+10, -60-10]*(pi/180)
|
|
% initializeStrutDynamics
|
|
args.actuator char {mustBeMember(args.actuator,{'piezo', 'lorentz', 'amplified'})} = 'piezo'
|
|
args.k1 (1,1) double {mustBeNumeric} = 1e6
|
|
args.ke (1,1) double {mustBeNumeric} = 5e6
|
|
args.ka (1,1) double {mustBeNumeric} = 60e6
|
|
args.c1 (1,1) double {mustBeNumeric} = 10
|
|
args.ce (1,1) double {mustBeNumeric} = 10
|
|
args.ca (1,1) double {mustBeNumeric} = 10
|
|
args.k (1,1) double {mustBeNumeric} = -1
|
|
args.c (1,1) double {mustBeNumeric} = -1
|
|
% initializeJointDynamics
|
|
args.type_F char {mustBeMember(args.type_F,{'universal', 'spherical', 'universal_p', 'spherical_p', 'universal_3dof'})} = 'universal'
|
|
args.type_M char {mustBeMember(args.type_M,{'universal', 'spherical', 'universal_p', 'spherical_p', 'spherical_3dof'})} = 'spherical'
|
|
args.Kf_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 15*ones(6,1)
|
|
args.Cf_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e-4*ones(6,1)
|
|
args.Kt_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 20*ones(6,1)
|
|
args.Ct_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e-3*ones(6,1)
|
|
args.Kz_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 60e6*ones(6,1)
|
|
args.Cz_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e2*ones(6,1)
|
|
args.Kf_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 15*ones(6,1)
|
|
args.Cf_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e-4*ones(6,1)
|
|
args.Kt_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 20*ones(6,1)
|
|
args.Ct_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e-3*ones(6,1)
|
|
args.Kz_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 60e6*ones(6,1)
|
|
args.Cz_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e2*ones(6,1)
|
|
% initializeCylindricalPlatforms
|
|
args.Fpm (1,1) double {mustBeNumeric, mustBePositive} = 1
|
|
args.Fph (1,1) double {mustBeNumeric, mustBePositive} = 10e-3
|
|
args.Fpr (1,1) double {mustBeNumeric, mustBePositive} = 150e-3
|
|
args.Mpm (1,1) double {mustBeNumeric, mustBePositive} = 1
|
|
args.Mph (1,1) double {mustBeNumeric, mustBePositive} = 10e-3
|
|
args.Mpr (1,1) double {mustBeNumeric, mustBePositive} = 120e-3
|
|
% initializeCylindricalStruts
|
|
args.Fsm (1,1) double {mustBeNumeric, mustBePositive} = 0.1
|
|
args.Fsh (1,1) double {mustBeNumeric, mustBePositive} = 50e-3
|
|
args.Fsr (1,1) double {mustBeNumeric, mustBePositive} = 5e-3
|
|
args.Msm (1,1) double {mustBeNumeric, mustBePositive} = 0.1
|
|
args.Msh (1,1) double {mustBeNumeric, mustBePositive} = 50e-3
|
|
args.Msr (1,1) double {mustBeNumeric, mustBePositive} = 5e-3
|
|
% inverseKinematics
|
|
args.AP (3,1) double {mustBeNumeric} = zeros(3,1)
|
|
args.ARB (3,3) double {mustBeNumeric} = eye(3)
|
|
% Equilibrium position of each leg
|
|
args.dLeq (6,1) double {mustBeNumeric} = zeros(6,1)
|
|
% Force that stiffness of each joint should apply at t=0
|
|
args.Foffset logical {mustBeNumericOrLogical} = false
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org0737b17" class="outline-3">
|
|
<h3 id="org0737b17">Function content</h3>
|
|
<div class="outline-text-3" id="text-org0737b17">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">stewart = initializeStewartPlatform();
|
|
|
|
stewart = initializeFramesPositions(stewart, 'H', args.H, 'MO_B', args.MO_B);
|
|
|
|
stewart = generateGeneralConfiguration(stewart, 'FH', args.FH, 'FR', args.FR, 'FTh', args.FTh, 'MH', args.MH, 'MR', args.MR, 'MTh', args.MTh);
|
|
|
|
stewart = computeJointsPose(stewart);
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">if args.k > 0 && args.c > 0
|
|
stewart = initializeStrutDynamics(stewart, 'type', 'classical', 'K', args.k*ones(6,1), 'C', args.c*ones(6,1));
|
|
elseif args.k > 0
|
|
stewart = initializeStrutDynamics(stewart, 'type', 'classical', 'K', args.k*ones(6,1), 'C', 1.5*sqrt(args.k)*ones(6,1));
|
|
elseif strcmp(args.actuator, 'piezo')
|
|
stewart = initializeStrutDynamics(stewart, 'type', 'classical', 'K', 1e7*ones(6,1), 'C', 1e2*ones(6,1));
|
|
elseif strcmp(args.actuator, 'lorentz')
|
|
stewart = initializeStrutDynamics(stewart, 'type', 'classical', 'K', 1e4*ones(6,1), 'C', 1e2*ones(6,1));
|
|
elseif strcmp(args.actuator, 'amplified')
|
|
stewart = initializeStrutDynamics(stewart, 'type', 'amplified', ...
|
|
'k1', args.k1*ones(6,1), ...
|
|
'c1', args.c1*ones(6,1), ...
|
|
'ka', args.ka*ones(6,1), ...
|
|
'ca', args.ca*ones(6,1), ...
|
|
'ke', args.ke*ones(6,1), ...
|
|
'ce', args.ce*ones(6,1));
|
|
else
|
|
error('args.actuator should be piezo, lorentz or amplified');
|
|
end
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">stewart = initializeJointDynamics(stewart, ...
|
|
'type_F', args.type_F, ...
|
|
'type_M', args.type_M, ...
|
|
'Kf_M' , args.Kf_M, ...
|
|
'Cf_M' , args.Cf_M, ...
|
|
'Kt_M' , args.Kt_M, ...
|
|
'Ct_M' , args.Ct_M, ...
|
|
'Kz_M' , args.Kz_M, ...
|
|
'Cz_M' , args.Cz_M, ...
|
|
'Kf_F' , args.Kf_F, ...
|
|
'Cf_F' , args.Cf_F, ...
|
|
'Kt_F' , args.Kt_F, ...
|
|
'Ct_F' , args.Ct_F, ...
|
|
'Kz_F' , args.Kz_F, ...
|
|
'Cz_F' , args.Cz_F);
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">stewart = initializeCylindricalPlatforms(stewart, 'Fpm', args.Fpm, 'Fph', args.Fph, 'Fpr', args.Fpr, 'Mpm', args.Mpm, 'Mph', args.Mph, 'Mpr', args.Mpr);
|
|
|
|
stewart = initializeCylindricalStruts(stewart, 'Fsm', args.Fsm, 'Fsh', args.Fsh, 'Fsr', args.Fsr, 'Msm', args.Msm, 'Msh', args.Msh, 'Msr', args.Msr);
|
|
|
|
stewart = computeJacobian(stewart);
|
|
|
|
stewart = initializeStewartPose(stewart, 'AP', args.AP, 'ARB', args.ARB);
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">stewart = initializeInertialSensor(stewart, 'type', 'accelerometer');
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Equilibrium position of the each joint.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">
|
|
if args.Foffset && ~strcmp(args.type, 'none') && ~strcmp(args.type, 'rigid') && ~strcmp(args.type, 'init')
|
|
load('mat/Foffset.mat', 'Fnm');
|
|
stewart.actuators.dLeq = -Fnm'./stewart.Ki;
|
|
else
|
|
stewart.actuators.dLeq = args.dLeq;
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org3b2b31f" class="outline-3">
|
|
<h3 id="org3b2b31f">Add Type</h3>
|
|
<div class="outline-text-3" id="text-org3b2b31f">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">switch args.type
|
|
case 'none'
|
|
stewart.type = 0;
|
|
case 'rigid'
|
|
stewart.type = 1;
|
|
case 'flexible'
|
|
stewart.type = 2;
|
|
case 'init'
|
|
stewart.type = 4;
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org5b7657f" class="outline-3">
|
|
<h3 id="org5b7657f">Save the Structure</h3>
|
|
<div class="outline-text-3" id="text-org5b7657f">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">nano_hexapod = stewart;
|
|
save('./mat/stages.mat', 'nano_hexapod', '-append');
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org3d615a1" class="outline-2">
|
|
<h2 id="org3d615a1"><span class="section-number-2">12</span> Sample</h2>
|
|
<div class="outline-text-2" id="text-12">
|
|
<p>
|
|
<a id="org9f0d804"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org4068b6d" class="outline-3">
|
|
<h3 id="org4068b6d">Simscape Model</h3>
|
|
<div class="outline-text-3" id="text-org4068b6d">
|
|
<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="org4bf20ba" 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="orgfaf9137" 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-org7cb3c0a" class="outline-3">
|
|
<h3 id="org7cb3c0a">Function description</h3>
|
|
<div class="outline-text-3" id="text-org7cb3c0a">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">function [sample] = initializeSample(args)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org45dfb8b" class="outline-3">
|
|
<h3 id="org45dfb8b">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-org45dfb8b">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.type char {mustBeMember(args.type,{'rigid', 'flexible', 'none', 'init'})} = 'flexible'
|
|
args.radius (1,1) double {mustBeNumeric, mustBePositive} = 0.1 % [m]
|
|
args.height (1,1) double {mustBeNumeric, mustBePositive} = 0.3 % [m]
|
|
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 50 % [kg]
|
|
args.freq (6,1) double {mustBeNumeric, mustBePositive} = 100*ones(6,1) % [Hz]
|
|
args.offset (1,1) double {mustBeNumeric} = 0 % [m]
|
|
args.Foffset logical {mustBeNumericOrLogical} = false
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org777606d" class="outline-3">
|
|
<h3 id="org777606d">Structure initialization</h3>
|
|
<div class="outline-text-3" id="text-org777606d">
|
|
<p>
|
|
First, we initialize the <code>sample</code> structure.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">sample = struct();
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org2bb1d24" class="outline-3">
|
|
<h3 id="org2bb1d24">Add Sample Type</h3>
|
|
<div class="outline-text-3" id="text-org2bb1d24">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">switch args.type
|
|
case 'none'
|
|
sample.type = 0;
|
|
case 'rigid'
|
|
sample.type = 1;
|
|
case 'flexible'
|
|
sample.type = 2;
|
|
case 'init'
|
|
sample.type = 3;
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org3bf8f39" class="outline-3">
|
|
<h3 id="org3bf8f39">Material and Geometry</h3>
|
|
<div class="outline-text-3" id="text-org3bf8f39">
|
|
<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; % [m]
|
|
sample.height = args.height; % [m]
|
|
sample.mass = args.mass; % [kg]
|
|
sample.offset = args.offset; % [m]
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org228453f" class="outline-3">
|
|
<h3 id="org228453f">Compute the Inertia</h3>
|
|
<div class="outline-text-3" id="text-org228453f">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">sample.inertia = [1/12 * sample.mass * (3*sample.radius^2 + sample.height^2); ...
|
|
1/12 * sample.mass * (3*sample.radius^2 + sample.height^2); ...
|
|
1/2 * sample.mass * sample.radius^2];
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orga217348" class="outline-3">
|
|
<h3 id="orga217348">Stiffness and Damping properties</h3>
|
|
<div class="outline-text-3" id="text-orga217348">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">sample.K = zeros(6, 1);
|
|
sample.C = zeros(6, 1);
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Translation Stiffness and Damping:
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">sample.K(1:3) = sample.mass .* (2*pi * args.freq(1:3)).^2; % [N/m]
|
|
sample.C(1:3) = 0.1 * sqrt(sample.K(1:3)*sample.mass); % [N/(m/s)]
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Rotational Stiffness and Damping:
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">sample.K(4:6) = sample.inertia .* (2*pi * args.freq(4:6)).^2; % [N/m]
|
|
sample.C(4:6) = 0.1 * sqrt(sample.K(4:6).*sample.inertia); % [N/(m/s)]
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgc6700d2" class="outline-3">
|
|
<h3 id="orgc6700d2">Equilibrium position of the each joint.</h3>
|
|
<div class="outline-text-3" id="text-orgc6700d2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">if args.Foffset && ~strcmp(args.type, 'none') && ~strcmp(args.type, 'rigid') && ~strcmp(args.type, 'init')
|
|
load('mat/Foffset.mat', 'Fsm');
|
|
sample.Deq = -Fsm'./sample.K;
|
|
else
|
|
sample.Deq = zeros(6,1);
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgb88e566" class="outline-3">
|
|
<h3 id="orgb88e566">Save the Structure</h3>
|
|
<div class="outline-text-3" id="text-orgb88e566">
|
|
<p>
|
|
The <code>sample</code> structure is saved.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save('./mat/stages.mat', 'sample', '-append');
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge9cbdc9" class="outline-2">
|
|
<h2 id="orge9cbdc9"><span class="section-number-2">13</span> Initialize Controller</h2>
|
|
<div class="outline-text-2" id="text-13">
|
|
<p>
|
|
<a id="orgd0062b9"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-orgbaecbcc" class="outline-3">
|
|
<h3 id="orgbaecbcc">Function Declaration and Documentation</h3>
|
|
<div class="outline-text-3" id="text-orgbaecbcc">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">function [] = initializeController(args)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org5f24bdc" class="outline-3">
|
|
<h3 id="org5f24bdc">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-org5f24bdc">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.type char {mustBeMember(args.type,{'open-loop', 'iff', 'dvf', 'hac-dvf', 'ref-track-L', 'ref-track-iff-L', 'cascade-hac-lac', 'hac-iff', 'stabilizing'})} = 'open-loop'
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org6e89216" class="outline-3">
|
|
<h3 id="org6e89216">Structure initialization</h3>
|
|
<div class="outline-text-3" id="text-org6e89216">
|
|
<p>
|
|
First, we initialize the <code>controller</code> structure.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">controller = struct();
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org4207f98" class="outline-3">
|
|
<h3 id="org4207f98">Controller Type</h3>
|
|
<div class="outline-text-3" id="text-org4207f98">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">switch args.type
|
|
case 'open-loop'
|
|
controller.type = 1;
|
|
controller.name = 'Open-Loop';
|
|
case 'dvf'
|
|
controller.type = 2;
|
|
controller.name = 'Decentralized Direct Velocity Feedback';
|
|
case 'iff'
|
|
controller.type = 3;
|
|
controller.name = 'Decentralized Integral Force Feedback';
|
|
case 'hac-dvf'
|
|
controller.type = 4;
|
|
controller.name = 'HAC-DVF';
|
|
case 'ref-track-L'
|
|
controller.type = 5;
|
|
controller.name = 'Reference Tracking in the frame of the legs';
|
|
case 'ref-track-iff-L'
|
|
controller.type = 6;
|
|
controller.name = 'Reference Tracking in the frame of the legs + IFF';
|
|
case 'cascade-hac-lac'
|
|
controller.type = 7;
|
|
controller.name = 'Cascade Control + HAC-LAC';
|
|
case 'hac-iff'
|
|
controller.type = 8;
|
|
controller.name = 'HAC-IFF';
|
|
case 'stabilizing'
|
|
controller.type = 9;
|
|
controller.name = 'Stabilizing Controller';
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org202f2f5" class="outline-3">
|
|
<h3 id="org202f2f5">Save the Structure</h3>
|
|
<div class="outline-text-3" id="text-org202f2f5">
|
|
<p>
|
|
The <code>controller</code> structure is saved.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save('./mat/controller.mat', 'controller');
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgae5cb57" class="outline-2">
|
|
<h2 id="orgae5cb57"><span class="section-number-2">14</span> Generate Reference Signals</h2>
|
|
<div class="outline-text-2" id="text-14">
|
|
<p>
|
|
<a id="org5ace526"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org671c2c2" class="outline-3">
|
|
<h3 id="org671c2c2">Function Declaration and Documentation</h3>
|
|
<div class="outline-text-3" id="text-org671c2c2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">function [ref] = initializeReferences(args)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org5323b00" class="outline-3">
|
|
<h3 id="org5323b00">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-org5323b00">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
% Sampling Frequency [s]
|
|
args.Ts (1,1) double {mustBeNumeric, mustBePositive} = 1e-3
|
|
% Maximum simulation time [s]
|
|
args.Tmax (1,1) double {mustBeNumeric, mustBePositive} = 100
|
|
% Either "constant" / "triangular" / "sinusoidal"
|
|
args.Dy_type char {mustBeMember(args.Dy_type,{'constant', 'triangular', 'sinusoidal'})} = 'constant'
|
|
% Amplitude of the displacement [m]
|
|
args.Dy_amplitude (1,1) double {mustBeNumeric} = 0
|
|
% Period of the displacement [s]
|
|
args.Dy_period (1,1) double {mustBeNumeric, mustBePositive} = 1
|
|
% Either "constant" / "triangular" / "sinusoidal"
|
|
args.Ry_type char {mustBeMember(args.Ry_type,{'constant', 'triangular', 'sinusoidal'})} = 'constant'
|
|
% Amplitude [rad]
|
|
args.Ry_amplitude (1,1) double {mustBeNumeric} = 0
|
|
% Period of the displacement [s]
|
|
args.Ry_period (1,1) double {mustBeNumeric, mustBePositive} = 1
|
|
% Either "constant" / "rotating"
|
|
args.Rz_type char {mustBeMember(args.Rz_type,{'constant', 'rotating', 'rotating-not-filtered'})} = 'constant'
|
|
% Initial angle [rad]
|
|
args.Rz_amplitude (1,1) double {mustBeNumeric} = 0
|
|
% Period of the rotating [s]
|
|
args.Rz_period (1,1) double {mustBeNumeric, mustBePositive} = 1
|
|
% For now, only constant is implemented
|
|
args.Dh_type char {mustBeMember(args.Dh_type,{'constant'})} = 'constant'
|
|
% Initial position [m,m,m,rad,rad,rad] of the top platform (Pitch-Roll-Yaw Euler angles)
|
|
args.Dh_pos (6,1) double {mustBeNumeric} = zeros(6, 1), ...
|
|
% For now, only constant is implemented
|
|
args.Rm_type char {mustBeMember(args.Rm_type,{'constant'})} = 'constant'
|
|
% Initial position of the two masses
|
|
args.Rm_pos (2,1) double {mustBeNumeric} = [0; pi]
|
|
% For now, only constant is implemented
|
|
args.Dn_type char {mustBeMember(args.Dn_type,{'constant'})} = 'constant'
|
|
% Initial position [m,m,m,rad,rad,rad] of the top platform
|
|
args.Dn_pos (6,1) double {mustBeNumeric} = zeros(6,1)
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="outline-container-orge94c0c2" class="outline-3">
|
|
<h3 id="orge94c0c2">Initialize Parameters</h3>
|
|
<div class="outline-text-3" id="text-orge94c0c2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">%% Set Sampling Time
|
|
Ts = args.Ts;
|
|
Tmax = args.Tmax;
|
|
|
|
%% Low Pass Filter to filter out the references
|
|
s = zpk('s');
|
|
w0 = 2*pi*10;
|
|
xi = 1;
|
|
H_lpf = 1/(1 + 2*xi/w0*s + s^2/w0^2);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgf66b222" class="outline-3">
|
|
<h3 id="orgf66b222">Translation Stage</h3>
|
|
<div class="outline-text-3" id="text-orgf66b222">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">%% Translation stage - Dy
|
|
t = 0:Ts:Tmax; % Time Vector [s]
|
|
Dy = zeros(length(t), 1);
|
|
Dyd = zeros(length(t), 1);
|
|
Dydd = zeros(length(t), 1);
|
|
switch args.Dy_type
|
|
case 'constant'
|
|
Dy(:) = args.Dy_amplitude;
|
|
Dyd(:) = 0;
|
|
Dydd(:) = 0;
|
|
case 'triangular'
|
|
% This is done to unsure that we start with no displacement
|
|
Dy_raw = args.Dy_amplitude*sawtooth(2*pi*t/args.Dy_period,1/2);
|
|
i0 = find(t>=args.Dy_period/4,1);
|
|
Dy(1:end-i0+1) = Dy_raw(i0:end);
|
|
Dy(end-i0+2:end) = Dy_raw(end); % we fix the last value
|
|
|
|
% The signal is filtered out
|
|
Dy = lsim(H_lpf, Dy, t);
|
|
Dyd = lsim(H_lpf*s, Dy, t);
|
|
Dydd = lsim(H_lpf*s^2, Dy, t);
|
|
case 'sinusoidal'
|
|
Dy(:) = args.Dy_amplitude*sin(2*pi/args.Dy_period*t);
|
|
Dyd = args.Dy_amplitude*2*pi/args.Dy_period*cos(2*pi/args.Dy_period*t);
|
|
Dydd = -args.Dy_amplitude*(2*pi/args.Dy_period)^2*sin(2*pi/args.Dy_period*t);
|
|
otherwise
|
|
warning('Dy_type is not set correctly');
|
|
end
|
|
|
|
Dy = struct('time', t, 'signals', struct('values', Dy), 'deriv', Dyd, 'dderiv', Dydd);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orga18d111" class="outline-3">
|
|
<h3 id="orga18d111">Tilt Stage</h3>
|
|
<div class="outline-text-3" id="text-orga18d111">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">%% Tilt Stage - Ry
|
|
t = 0:Ts:Tmax; % Time Vector [s]
|
|
Ry = zeros(length(t), 1);
|
|
Ryd = zeros(length(t), 1);
|
|
Rydd = zeros(length(t), 1);
|
|
|
|
switch args.Ry_type
|
|
case 'constant'
|
|
Ry(:) = args.Ry_amplitude;
|
|
Ryd(:) = 0;
|
|
Rydd(:) = 0;
|
|
case 'triangular'
|
|
Ry_raw = args.Ry_amplitude*sawtooth(2*pi*t/args.Ry_period,1/2);
|
|
i0 = find(t>=args.Ry_period/4,1);
|
|
Ry(1:end-i0+1) = Ry_raw(i0:end);
|
|
Ry(end-i0+2:end) = Ry_raw(end); % we fix the last value
|
|
|
|
% The signal is filtered out
|
|
Ry = lsim(H_lpf, Ry, t);
|
|
Ryd = lsim(H_lpf*s, Ry, t);
|
|
Rydd = lsim(H_lpf*s^2, Ry, t);
|
|
case 'sinusoidal'
|
|
Ry(:) = args.Ry_amplitude*sin(2*pi/args.Ry_period*t);
|
|
|
|
Ryd = args.Ry_amplitude*2*pi/args.Ry_period*cos(2*pi/args.Ry_period*t);
|
|
Rydd = -args.Ry_amplitude*(2*pi/args.Ry_period)^2*sin(2*pi/args.Ry_period*t);
|
|
otherwise
|
|
warning('Ry_type is not set correctly');
|
|
end
|
|
|
|
Ry = struct('time', t, 'signals', struct('values', Ry), 'deriv', Ryd, 'dderiv', Rydd);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org8d2c73d" class="outline-3">
|
|
<h3 id="org8d2c73d">Spindle</h3>
|
|
<div class="outline-text-3" id="text-org8d2c73d">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">%% Spindle - Rz
|
|
t = 0:Ts:Tmax; % Time Vector [s]
|
|
Rz = zeros(length(t), 1);
|
|
Rzd = zeros(length(t), 1);
|
|
Rzdd = zeros(length(t), 1);
|
|
|
|
switch args.Rz_type
|
|
case 'constant'
|
|
Rz(:) = args.Rz_amplitude;
|
|
Rzd(:) = 0;
|
|
Rzdd(:) = 0;
|
|
case 'rotating-not-filtered'
|
|
Rz(:) = 2*pi/args.Rz_period*t;
|
|
|
|
% The signal is filtered out
|
|
Rz(:) = 2*pi/args.Rz_period*t;
|
|
Rzd(:) = 2*pi/args.Rz_period;
|
|
Rzdd(:) = 0;
|
|
|
|
% We add the angle offset
|
|
Rz = Rz + args.Rz_amplitude;
|
|
|
|
case 'rotating'
|
|
Rz(:) = 2*pi/args.Rz_period*t;
|
|
|
|
% The signal is filtered out
|
|
Rz = lsim(H_lpf, Rz, t);
|
|
Rzd = lsim(H_lpf*s, Rz, t);
|
|
Rzdd = lsim(H_lpf*s^2, Rz, t);
|
|
|
|
% We add the angle offset
|
|
Rz = Rz + args.Rz_amplitude;
|
|
otherwise
|
|
warning('Rz_type is not set correctly');
|
|
end
|
|
|
|
Rz = struct('time', t, 'signals', struct('values', Rz), 'deriv', Rzd, 'dderiv', Rzdd);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org8ba04e2" class="outline-3">
|
|
<h3 id="org8ba04e2">Micro Hexapod</h3>
|
|
<div class="outline-text-3" id="text-org8ba04e2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">%% Micro-Hexapod
|
|
t = [0, Ts];
|
|
Dh = zeros(length(t), 6);
|
|
Dhl = zeros(length(t), 6);
|
|
|
|
switch args.Dh_type
|
|
case 'constant'
|
|
Dh = [args.Dh_pos, args.Dh_pos];
|
|
|
|
load('mat/stages.mat', 'micro_hexapod');
|
|
|
|
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) -sin(tz) 0;
|
|
sin(tz) cos(tz) 0;
|
|
0 0 1]*...
|
|
[ cos(ty) 0 sin(ty);
|
|
0 1 0;
|
|
-sin(ty) 0 cos(ty)]*...
|
|
[1 0 0;
|
|
0 cos(tx) -sin(tx);
|
|
0 sin(tx) cos(tx)];
|
|
|
|
[~, Dhl] = inverseKinematics(micro_hexapod, 'AP', AP, 'ARB', ARB);
|
|
Dhl = [Dhl, Dhl];
|
|
otherwise
|
|
warning('Dh_type is not set correctly');
|
|
end
|
|
|
|
Dh = struct('time', t, 'signals', struct('values', Dh));
|
|
Dhl = struct('time', t, 'signals', struct('values', Dhl));
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org04d73dc" class="outline-3">
|
|
<h3 id="org04d73dc">Axis Compensation</h3>
|
|
<div class="outline-text-3" id="text-org04d73dc">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">%% Axis Compensation - Rm
|
|
t = [0, Ts];
|
|
|
|
Rm = [args.Rm_pos, args.Rm_pos];
|
|
Rm = struct('time', t, 'signals', struct('values', Rm));
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org34337a8" class="outline-3">
|
|
<h3 id="org34337a8">Nano Hexapod</h3>
|
|
<div class="outline-text-3" id="text-org34337a8">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">%% Nano-Hexapod
|
|
t = [0, Ts];
|
|
Dn = zeros(length(t), 6);
|
|
|
|
switch args.Dn_type
|
|
case 'constant'
|
|
Dn = [args.Dn_pos, args.Dn_pos];
|
|
|
|
load('mat/stages.mat', 'nano_hexapod');
|
|
|
|
AP = [args.Dn_pos(1) ; args.Dn_pos(2) ; args.Dn_pos(3)];
|
|
|
|
tx = args.Dn_pos(4);
|
|
ty = args.Dn_pos(5);
|
|
tz = args.Dn_pos(6);
|
|
|
|
ARB = [cos(tz) -sin(tz) 0;
|
|
sin(tz) cos(tz) 0;
|
|
0 0 1]*...
|
|
[ cos(ty) 0 sin(ty);
|
|
0 1 0;
|
|
-sin(ty) 0 cos(ty)]*...
|
|
[1 0 0;
|
|
0 cos(tx) -sin(tx);
|
|
0 sin(tx) cos(tx)];
|
|
|
|
[~, Dnl] = inverseKinematics(nano_hexapod, 'AP', AP, 'ARB', ARB);
|
|
Dnl = [Dnl, Dnl];
|
|
otherwise
|
|
warning('Dn_type is not set correctly');
|
|
end
|
|
|
|
Dn = struct('time', t, 'signals', struct('values', Dn));
|
|
Dnl = struct('time', t, 'signals', struct('values', Dnl));
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgf26ccc6" class="outline-3">
|
|
<h3 id="orgf26ccc6">Save</h3>
|
|
<div class="outline-text-3" id="text-orgf26ccc6">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab"> %% Save
|
|
save('./mat/nass_references.mat', 'Dy', 'Ry', 'Rz', 'Dh', 'Dhl', 'Rm', 'Dn', 'Dnl', 'args', 'Ts');
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org544c9dd" class="outline-2">
|
|
<h2 id="org544c9dd"><span class="section-number-2">15</span> Initialize Disturbances</h2>
|
|
<div class="outline-text-2" id="text-15">
|
|
<p>
|
|
<a id="org199c5f8"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-orga2a09de" class="outline-3">
|
|
<h3 id="orga2a09de">Function Declaration and Documentation</h3>
|
|
<div class="outline-text-3" id="text-orga2a09de">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">function [] = initializeDisturbances(args)
|
|
% initializeDisturbances - Initialize the disturbances
|
|
%
|
|
% Syntax: [] = initializeDisturbances(args)
|
|
%
|
|
% Inputs:
|
|
% - args -
|
|
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org3bd7db1" class="outline-3">
|
|
<h3 id="org3bd7db1">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-org3bd7db1">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
% Global parameter to enable or disable the disturbances
|
|
args.enable logical {mustBeNumericOrLogical} = true
|
|
% Ground Motion - X direction
|
|
args.Dwx logical {mustBeNumericOrLogical} = true
|
|
% Ground Motion - Y direction
|
|
args.Dwy logical {mustBeNumericOrLogical} = true
|
|
% Ground Motion - Z direction
|
|
args.Dwz logical {mustBeNumericOrLogical} = true
|
|
% Translation Stage - X direction
|
|
args.Fty_x logical {mustBeNumericOrLogical} = true
|
|
% Translation Stage - Z direction
|
|
args.Fty_z logical {mustBeNumericOrLogical} = true
|
|
% Spindle - Z direction
|
|
args.Frz_z logical {mustBeNumericOrLogical} = true
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="outline-container-orgf744aeb" class="outline-3">
|
|
<h3 id="orgf744aeb">Load Data</h3>
|
|
<div class="outline-text-3" id="text-orgf744aeb">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">load('./mat/dist_psd.mat', 'dist_f');
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
We remove the first frequency point that usually is very large.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div id="outline-container-org6c7d666" class="outline-3">
|
|
<h3 id="org6c7d666">Parameters</h3>
|
|
<div class="outline-text-3" id="text-org6c7d666">
|
|
<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*dist_f.f(end); % Sampling Frequency of data is twice the maximum frequency of the PSD vector [Hz]
|
|
N = 2*length(dist_f.f); % Number of Samples match the one of the wanted PSD
|
|
T0 = N/Fs; % Signal Duration [s]
|
|
df = 1/T0; % Frequency resolution of the DFT [Hz]
|
|
% Also equal to (dist_f.f(2)-dist_f.f(1))
|
|
t = linspace(0, T0, N+1)'; % Time Vector [s]
|
|
Ts = 1/Fs; % Sampling Time [s]
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgb2108c4" class="outline-3">
|
|
<h3 id="orgb2108c4">Ground Motion</h3>
|
|
<div class="outline-text-3" id="text-orgb2108c4">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">phi = dist_f.psd_gm;
|
|
C = zeros(N/2,1);
|
|
for i = 1:N/2
|
|
C(i) = sqrt(phi(i)*df);
|
|
end
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">if args.Dwx && args.enable
|
|
rng(111);
|
|
theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
|
|
Cx = [0 ; C.*complex(cos(theta),sin(theta))];
|
|
Cx = [Cx; flipud(conj(Cx(2:end)))];;
|
|
Dwx = N/sqrt(2)*ifft(Cx); % Ground Motion - x direction [m]
|
|
else
|
|
Dwx = zeros(length(t), 1);
|
|
end
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">if args.Dwy && args.enable
|
|
rng(112);
|
|
theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
|
|
Cx = [0 ; C.*complex(cos(theta),sin(theta))];
|
|
Cx = [Cx; flipud(conj(Cx(2:end)))];;
|
|
Dwy = N/sqrt(2)*ifft(Cx); % Ground Motion - y direction [m]
|
|
else
|
|
Dwy = zeros(length(t), 1);
|
|
end
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">if args.Dwy && args.enable
|
|
rng(113);
|
|
theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
|
|
Cx = [0 ; C.*complex(cos(theta),sin(theta))];
|
|
Cx = [Cx; flipud(conj(Cx(2:end)))];;
|
|
Dwz = N/sqrt(2)*ifft(Cx); % Ground Motion - z direction [m]
|
|
else
|
|
Dwz = zeros(length(t), 1);
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgb70c65e" class="outline-3">
|
|
<h3 id="orgb70c65e">Translation Stage - X direction</h3>
|
|
<div class="outline-text-3" id="text-orgb70c65e">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">if args.Fty_x && args.enable
|
|
phi = dist_f.psd_ty; % TODO - we take here the vertical direction which is wrong but approximate
|
|
C = zeros(N/2,1);
|
|
for i = 1:N/2
|
|
C(i) = sqrt(phi(i)*df);
|
|
end
|
|
rng(121);
|
|
theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
|
|
Cx = [0 ; C.*complex(cos(theta),sin(theta))];
|
|
Cx = [Cx; flipud(conj(Cx(2:end)))];;
|
|
u = N/sqrt(2)*ifft(Cx); % Disturbance Force Ty x [N]
|
|
Fty_x = u;
|
|
else
|
|
Fty_x = zeros(length(t), 1);
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org070255a" class="outline-3">
|
|
<h3 id="org070255a">Translation Stage - Z direction</h3>
|
|
<div class="outline-text-3" id="text-org070255a">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">if args.Fty_z && args.enable
|
|
phi = dist_f.psd_ty;
|
|
C = zeros(N/2,1);
|
|
for i = 1:N/2
|
|
C(i) = sqrt(phi(i)*df);
|
|
end
|
|
rng(122);
|
|
theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
|
|
Cx = [0 ; C.*complex(cos(theta),sin(theta))];
|
|
Cx = [Cx; flipud(conj(Cx(2:end)))];;
|
|
u = N/sqrt(2)*ifft(Cx); % Disturbance Force Ty z [N]
|
|
Fty_z = u;
|
|
else
|
|
Fty_z = zeros(length(t), 1);
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgfd5f32b" class="outline-3">
|
|
<h3 id="orgfd5f32b">Spindle - Z direction</h3>
|
|
<div class="outline-text-3" id="text-orgfd5f32b">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">if args.Frz_z && args.enable
|
|
phi = dist_f.psd_rz;
|
|
C = zeros(N/2,1);
|
|
for i = 1:N/2
|
|
C(i) = sqrt(phi(i)*df);
|
|
end
|
|
rng(131);
|
|
theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
|
|
Cx = [0 ; C.*complex(cos(theta),sin(theta))];
|
|
Cx = [Cx; flipud(conj(Cx(2:end)))];;
|
|
u = N/sqrt(2)*ifft(Cx); % Disturbance Force Rz z [N]
|
|
Frz_z = u;
|
|
else
|
|
Frz_z = zeros(length(t), 1);
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgba4d479" class="outline-3">
|
|
<h3 id="orgba4d479">Direct Forces</h3>
|
|
<div class="outline-text-3" id="text-orgba4d479">
|
|
<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-orgf6d2198" class="outline-3">
|
|
<h3 id="orgf6d2198">Set initial value to zero</h3>
|
|
<div class="outline-text-3" id="text-orgf6d2198">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">Dwx = Dwx - Dwx(1);
|
|
Dwy = Dwy - Dwy(1);
|
|
Dwz = Dwz - Dwz(1);
|
|
Fty_x = Fty_x - Fty_x(1);
|
|
Fty_z = Fty_z - Fty_z(1);
|
|
Frz_z = Frz_z - Frz_z(1);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org38c42fa" class="outline-3">
|
|
<h3 id="org38c42fa">Save</h3>
|
|
<div class="outline-text-3" id="text-org38c42fa">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save('./mat/nass_disturbances.mat', 'Dwx', 'Dwy', 'Dwz', 'Fty_x', 'Fty_z', 'Frz_z', 'Fd', 'Ts', 't', 'args');
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgefb8a5e" class="outline-2">
|
|
<h2 id="orgefb8a5e"><span class="section-number-2">16</span> Initialize Position Errors</h2>
|
|
<div class="outline-text-2" id="text-16">
|
|
<p>
|
|
<a id="orga39c5fc"></a>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-orgf8f086e" class="outline-3">
|
|
<h3 id="orgf8f086e">Function Declaration and Documentation</h3>
|
|
<div class="outline-text-3" id="text-orgf8f086e">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">function [] = initializePosError(args)
|
|
% initializePosError - Initialize the position errors
|
|
%
|
|
% Syntax: [] = initializePosError(args)
|
|
%
|
|
% Inputs:
|
|
% - args -
|
|
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org8dbc80b" class="outline-3">
|
|
<h3 id="org8dbc80b">Optional Parameters</h3>
|
|
<div class="outline-text-3" id="text-org8dbc80b">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">arguments
|
|
args.error logical {mustBeNumericOrLogical} = false
|
|
args.Dy (1,1) double {mustBeNumeric} = 0 % [m]
|
|
args.Ry (1,1) double {mustBeNumeric} = 0 % [m]
|
|
args.Rz (1,1) double {mustBeNumeric} = 0 % [m]
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org5d6b026" class="outline-3">
|
|
<h3 id="org5d6b026">Structure initialization</h3>
|
|
<div class="outline-text-3" id="text-org5d6b026">
|
|
<p>
|
|
First, we initialize the <code>pos_error</code> structure.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">pos_error = struct();
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgc890f7d" class="outline-3">
|
|
<h3 id="orgc890f7d">Type</h3>
|
|
<div class="outline-text-3" id="text-orgc890f7d">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">if args.error
|
|
pos_error.type = 1;
|
|
else
|
|
pos_error.type = 0;
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org7d50228" class="outline-3">
|
|
<h3 id="org7d50228">Position Errors</h3>
|
|
<div class="outline-text-3" id="text-org7d50228">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">pos_error.Dy = args.Dy;
|
|
pos_error.Ry = args.Ry;
|
|
pos_error.Rz = args.Rz;
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org01d19da" class="outline-3">
|
|
<h3 id="org01d19da">Save</h3>
|
|
<div class="outline-text-3" id="text-org01d19da">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">save('./mat/pos_error.mat', 'pos_error');
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgc87e890" class="outline-2">
|
|
<h2 id="orgc87e890"><span class="section-number-2">17</span> Z-Axis Geophone</h2>
|
|
<div class="outline-text-2" id="text-17">
|
|
<p>
|
|
<a id="orgda06de2"></a>
|
|
</p>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">function [geophone] = initializeZAxisGeophone(args)
|
|
arguments
|
|
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 1e-3 % [kg]
|
|
args.freq (1,1) double {mustBeNumeric, mustBePositive} = 1 % [Hz]
|
|
end
|
|
|
|
%%
|
|
geophone.m = args.mass;
|
|
|
|
%% The Stiffness is set to have the damping resonance frequency
|
|
geophone.k = geophone.m * (2*pi*args.freq)^2;
|
|
|
|
%% We set the damping value to have critical damping
|
|
geophone.c = 2*sqrt(geophone.m * geophone.k);
|
|
|
|
%% Save
|
|
save('./mat/geophone_z_axis.mat', 'geophone');
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgcbddbd1" class="outline-2">
|
|
<h2 id="orgcbddbd1"><span class="section-number-2">18</span> Z-Axis Accelerometer</h2>
|
|
<div class="outline-text-2" id="text-18">
|
|
<p>
|
|
<a id="org071e205"></a>
|
|
</p>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">function [accelerometer] = initializeZAxisAccelerometer(args)
|
|
arguments
|
|
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 1e-3 % [kg]
|
|
args.freq (1,1) double {mustBeNumeric, mustBePositive} = 5e3 % [Hz]
|
|
end
|
|
|
|
%%
|
|
accelerometer.m = args.mass;
|
|
|
|
%% The Stiffness is set to have the damping resonance frequency
|
|
accelerometer.k = accelerometer.m * (2*pi*args.freq)^2;
|
|
|
|
%% We set the damping value to have critical damping
|
|
accelerometer.c = 2*sqrt(accelerometer.m * accelerometer.k);
|
|
|
|
%% Gain correction of the accelerometer to have a unity gain until the resonance
|
|
accelerometer.gain = -accelerometer.k/accelerometer.m;
|
|
|
|
%% Save
|
|
save('./mat/accelerometer_z_axis.mat', 'accelerometer');
|
|
end
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="postamble" class="status">
|
|
<p class="author">Author: Dehaeze Thomas</p>
|
|
<p class="date">Created: 2020-05-20 mer. 16:41</p>
|
|
</div>
|
|
</body>
|
|
</html>
|