2019-12-11 17:09:32 +01:00
<?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-11-03 09:45:50 +01:00
<!-- 2020 - 11 - 03 mar. 09:45 -->
2019-12-11 17:09:32 +01:00
< 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" / >
2020-02-25 18:21:17 +01:00
< link rel = "stylesheet" type = "text/css" href = "./css/htmlize.css" / >
< link rel = "stylesheet" type = "text/css" href = "./css/readtheorg.css" / >
2020-04-17 10:25:44 +02:00
< 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 >
2019-12-11 17:09:32 +01:00
< / head >
< body >
< div id = "org-div-home-and-up" >
2020-02-25 18:21:17 +01:00
< a accesskey = "h" href = "./index.html" > UP < / a >
2019-12-11 17:09:32 +01:00
|
2020-02-25 18:21:17 +01:00
< a accesskey = "H" href = "./index.html" > HOME < / a >
2019-12-11 17:09:32 +01:00
< / 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 >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org6171274" > 1. Simscape Configuration< / a >
< ul >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org73bab13" > Function description< / a > < / li >
< li > < a href = "#org588a7a9" > Optional Parameters< / a > < / li >
< li > < a href = "#org9a662ce" > Structure initialization< / a > < / li >
< li > < a href = "#org59a48c9" > Add Type< / a > < / li >
< li > < a href = "#org0b9e4dd" > Save the Structure< / a > < / li >
2020-02-25 18:10:20 +01:00
< / ul >
< / li >
< li > < a href = "#orgdda6840" > 2. Logging Configuration< / a >
< ul >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org16752fc" > Function description< / a > < / li >
< li > < a href = "#org8582ca7" > Optional Parameters< / a > < / li >
< li > < a href = "#orge06cd88" > Structure initialization< / a > < / li >
< li > < a href = "#orgce56736" > Add Type< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org60d91f1" > Sampling Time< / a > < / li >
2020-11-03 09:45:50 +01:00
< li > < a href = "#orgb0b7480" > Save the Structure< / a > < / li >
2020-02-25 18:10:20 +01:00
< / ul >
< / li >
< li > < a href = "#org1bf1870" > 3. Ground< / a >
< ul >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org5268fd9" > Simscape Model< / a > < / li >
< li > < a href = "#org488b87b" > Function description< / a > < / li >
< li > < a href = "#org007273f" > Optional Parameters< / a > < / li >
< li > < a href = "#org5e583c4" > Structure initialization< / a > < / li >
< li > < a href = "#org238b0e3" > Add Type< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org4c31ca5" > Ground Solid properties< / a > < / li >
2020-03-13 17:40:22 +01:00
< li > < a href = "#org542691f" > Rotation Point< / a > < / li >
2020-11-03 09:45:50 +01:00
< li > < a href = "#orgaac8766" > Save the Structure< / a > < / li >
2020-02-25 18:10:20 +01:00
< / ul >
< / li >
< li > < a href = "#orga045749" > 4. Granite< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-11-03 09:45:50 +01:00
< li > < a href = "#orgee9cd2e" > Simscape Model< / a > < / li >
< li > < a href = "#orgeefef30" > Function description< / a > < / li >
< li > < a href = "#orgcdae5ac" > Optional Parameters< / a > < / li >
< li > < a href = "#org734efbd" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org413c06d" > Add Granite Type< / a > < / li >
2020-11-03 09:45:50 +01:00
< li > < a href = "#orgb09a907" > Material and Geometry< / a > < / li >
< li > < a href = "#org01454e2" > Stiffness and Damping properties< / a > < / li >
< li > < a href = "#org8c04d7a" > Equilibrium position of the each joint.< / a > < / li >
< li > < a href = "#orgace9c7f" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org5e56bf2" > 5. Translation Stage< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org24fb48a" > Simscape Model< / a > < / li >
< li > < a href = "#org3050e0c" > Function description< / a > < / li >
< li > < a href = "#orgfd5133d" > Optional Parameters< / a > < / li >
< li > < a href = "#orgcece457" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org715e876" > Add Translation Stage Type< / a > < / li >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org3fe28ba" > Material and Geometry< / a > < / li >
< li > < a href = "#org8d52fe4" > Stiffness and Damping properties< / a > < / li >
< li > < a href = "#org557467b" > Equilibrium position of the each joint.< / a > < / li >
< li > < a href = "#org8105482" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-11-03 09:45:50 +01:00
< li > < a href = "#orgfb9d278" > 6. Tilt Stage< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org72c208c" > Simscape Model< / a > < / li >
< li > < a href = "#org3dc23ba" > Function description< / a > < / li >
< li > < a href = "#orgadde228" > Optional Parameters< / a > < / li >
< li > < a href = "#org169f69a" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#orgea3a7ba" > Add Tilt Type< / a > < / li >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org36ae12b" > Material and Geometry< / a > < / li >
< li > < a href = "#org916d4da" > Stiffness and Damping properties< / a > < / li >
< li > < a href = "#org6de2867" > Equilibrium position of the each joint.< / a > < / li >
< li > < a href = "#org5ef9c1d" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org6fe10ff" > 7. Spindle< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-11-03 09:45:50 +01:00
< li > < a href = "#orga72bd28" > Simscape Model< / a > < / li >
< li > < a href = "#org11594c9" > Function description< / a > < / li >
< li > < a href = "#orgf2246a4" > Optional Parameters< / a > < / li >
< li > < a href = "#org79dfc58" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#orge5b17ec" > Add Spindle Type< / a > < / li >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org7439869" > Material and Geometry< / a > < / li >
< li > < a href = "#org197f6c2" > Stiffness and Damping properties< / a > < / li >
< li > < a href = "#org11f9106" > Equilibrium position of the each joint.< / a > < / li >
< li > < a href = "#org802ab4e" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org1e01222" > 8. Micro Hexapod< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org3be92a2" > Simscape Model< / a > < / li >
< li > < a href = "#org1f057b4" > Function description< / a > < / li >
< li > < a href = "#orgca2b281" > Optional Parameters< / a > < / li >
< li > < a href = "#org181d2af" > Function content< / a > < / li >
< li > < a href = "#org50a53ee" > Add Type< / a > < / li >
< li > < a href = "#org9a94be5" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#orga55d418" > 9. Center of gravity compensation< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org03fe943" > Simscape Model< / a > < / li >
< li > < a href = "#org7e9c684" > Function description< / a > < / li >
< li > < a href = "#org30a65a0" > Optional Parameters< / a > < / li >
< li > < a href = "#orgfbaaf18" > Structure initialization< / a > < / li >
< li > < a href = "#orgd1e226f" > Add Type< / a > < / li >
< li > < a href = "#orga8da922" > Material and Geometry< / a > < / li >
< li > < a href = "#org2294619" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org7586ab7" > 10. Mirror< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org6506586" > Simscape Model< / a > < / li >
< li > < a href = "#org95db869" > Function description< / a > < / li >
< li > < a href = "#org9746d1d" > Optional Parameters< / a > < / li >
< li > < a href = "#orgf9d6201" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#orgff14824" > Add Mirror Type< / a > < / li >
2020-04-17 10:25:44 +02:00
< li > < a href = "#org4ad73aa" > Mass and Inertia< / a > < / li >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org87c25ef" > Stiffness and Damping properties< / a > < / li >
< li > < a href = "#org2ec60c8" > Equilibrium position of the each joint.< / a > < / li >
2020-04-17 10:25:44 +02:00
< li > < a href = "#orgc381755" > Geometry< / a > < / li >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org0fef54e" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org26371bd" > 11. Nano Hexapod< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org60b2d4e" > Simscape Model< / a > < / li >
< li > < a href = "#org3ef53ba" > Function description< / a > < / li >
< li > < a href = "#org6b134e3" > Optional Parameters< / a > < / li >
< li > < a href = "#orgdb37eb8" > Function content< / a > < / li >
< li > < a href = "#org642309a" > Add Type< / a > < / li >
< li > < a href = "#orgb487e26" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org3d615a1" > 12. Sample< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-11-03 09:45:50 +01:00
< li > < a href = "#orgb84662c" > Simscape Model< / a > < / li >
< li > < a href = "#org677c762" > Function description< / a > < / li >
< li > < a href = "#org682b4fa" > Optional Parameters< / a > < / li >
< li > < a href = "#orgb23c303" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org2bb1d24" > Add Sample Type< / a > < / li >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org2b97ba9" > Material and Geometry< / a > < / li >
2020-04-01 16:17:26 +02:00
< li > < a href = "#org228453f" > Compute the Inertia< / a > < / li >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org935d94f" > Stiffness and Damping properties< / a > < / li >
< li > < a href = "#orga761bca" > Equilibrium position of the each joint.< / a > < / li >
< li > < a href = "#orgbf05a0d" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#orge9cbdc9" > 13. Initialize Controller< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org5e84eb6" > Function Declaration and Documentation< / a > < / li >
< li > < a href = "#org45ea01b" > Optional Parameters< / a > < / li >
< li > < a href = "#orge048df4" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org4207f98" > Controller Type< / a > < / li >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org30cfbaa" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#orgae5cb57" > 14. Generate Reference Signals< / a >
2019-12-11 17:09:32 +01:00
< ul >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org8ba86fb" > Function Declaration and Documentation< / a > < / li >
< li > < a href = "#org0aeaea4" > Optional Parameters< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#orge94c0c2" > Initialize Parameters< / a > < / li >
2020-11-03 09:45:50 +01:00
< li > < a href = "#orgae1f7d8" > Translation Stage< / a > < / li >
< li > < a href = "#org9712ae2" > Tilt Stage< / a > < / li >
< li > < a href = "#org000e2fe" > Spindle< / a > < / li >
< li > < a href = "#org59c3861" > Micro Hexapod< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org04d73dc" > Axis Compensation< / a > < / li >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org6407ca0" > Nano Hexapod< / a > < / li >
< li > < a href = "#orge5d3d7b" > Save< / a > < / li >
2019-12-11 17:09:32 +01:00
< / ul >
< / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org544c9dd" > 15. Initialize Disturbances< / a >
2019-12-11 17:09:32 +01:00
< ul >
2020-11-03 09:45:50 +01:00
< li > < a href = "#orga6a780c" > Function Declaration and Documentation< / a > < / li >
< li > < a href = "#orgff4e994" > Optional Parameters< / a > < / li >
2020-02-25 18:10:20 +01:00
< 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 >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org976c195" > Save< / a > < / li >
2019-12-11 17:09:32 +01:00
< / ul >
< / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#orgefb8a5e" > 16. Initialize Position Errors< / a >
< ul >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org5592bea" > Function Declaration and Documentation< / a > < / li >
< li > < a href = "#orgf20a527" > Optional Parameters< / a > < / li >
< li > < a href = "#orgb76955b" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#orgc890f7d" > Type< / a > < / li >
< li > < a href = "#org7d50228" > Position Errors< / a > < / li >
2020-11-03 09:45:50 +01:00
< li > < a href = "#org799eabe" > Save< / a > < / li >
2020-02-25 18:10:20 +01:00
< / ul >
< / li >
< li > < a href = "#orgc87e890" > 17. Z-Axis Geophone< / a > < / li >
< li > < a href = "#orgcbddbd1" > 18. Z-Axis Accelerometer< / a > < / li >
2019-12-11 17:09:32 +01:00
< / ul >
< / div >
< / div >
2020-02-03 17:50:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
The full Simscape Model is represented in Figure < a href = "#org742ece0" > 1< / a > .
2020-02-03 17:50:32 +01:00
< / p >
2020-02-25 18:10:20 +01:00
< div id = "org742ece0" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2019-12-11 17:09:32 +01:00
< / div >
2020-02-03 17:50:32 +01:00
2019-12-11 17:09:32 +01:00
< p >
2020-02-03 17:50:32 +01:00
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” .
2019-12-11 17:09:32 +01:00
< / p >
< p >
2020-02-03 17:50:32 +01:00
Each stage is configured (geometry, mass properties, dynamic properties … ) using one function.
2019-12-11 17:09:32 +01:00
< / p >
2020-02-03 17:50:32 +01:00
< p >
These functions are defined below.
< / p >
2019-12-11 17:09:32 +01:00
2020-02-25 18:10:20 +01:00
< div id = "outline-container-org6171274" class = "outline-2" >
< h2 id = "org6171274" > < span class = "section-number-2" > 1< / span > Simscape Configuration< / h2 >
2020-02-03 17:50:32 +01:00
< div class = "outline-text-2" id = "text-1" >
< p >
2020-02-25 18:10:20 +01:00
< a id = "orgb590dcf" > < / a >
< / p >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org73bab13" class = "outline-3" >
< h3 id = "org73bab13" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org73bab13" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > function< / span > < span class = "org-variable-name" > []< / span > = < span class = "org-function-name" > initializeSimscapeConfiguration< / span > (< span class = "org-variable-name" > args< / span > )
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org588a7a9" class = "outline-3" >
< h3 id = "org588a7a9" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org588a7a9" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-11-03 09:45:50 +01:00
args.gravity logical {mustBeNumericOrLogical} = < span class = "org-constant" > true< / span >
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org9a662ce" class = "outline-3" >
< h3 id = "org9a662ce" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org9a662ce" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > conf_simscape = struct();
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org59a48c9" class = "outline-3" >
< h3 id = "org59a48c9" > Add Type< / h3 >
< div class = "outline-text-3" id = "text-org59a48c9" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > if< / span > args.gravity
2020-02-25 18:10:20 +01:00
conf_simscape.type = 1;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > else< / span >
2020-02-25 18:10:20 +01:00
conf_simscape.type = 2;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org0b9e4dd" class = "outline-3" >
< h3 id = "org0b9e4dd" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org0b9e4dd" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > save(< span class = "org-string" > './mat/conf_simscape.mat'< / span > , < span class = "org-string" > 'conf_simscape'< / span > );
2020-02-25 18:10:20 +01:00
< / 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 >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org16752fc" class = "outline-3" >
< h3 id = "org16752fc" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org16752fc" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > function< / span > < span class = "org-variable-name" > []< / span > = < span class = "org-function-name" > initializeLoggingConfiguration< / span > (< span class = "org-variable-name" > args< / span > )
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org8582ca7" class = "outline-3" >
< h3 id = "org8582ca7" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org8582ca7" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-11-03 09:45:50 +01:00
args.log char {mustBeMember(args.log,{< span class = "org-string" > 'none'< / span > , < span class = "org-string" > 'all'< / span > , < span class = "org-string" > 'forces'< / span > })} = < span class = "org-string" > 'none'< / span >
args.Ts (1,1) double {mustBeNumeric, mustBePositive} = 1e< span class = "org-type" > -< / span > 3
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orge06cd88" class = "outline-3" >
< h3 id = "orge06cd88" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-orge06cd88" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > conf_log = struct();
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgce56736" class = "outline-3" >
< h3 id = "orgce56736" > Add Type< / h3 >
< div class = "outline-text-3" id = "text-orgce56736" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > switch< / span > < span class = "org-constant" > args.log< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'none'< / span >
2020-02-25 18:10:20 +01:00
conf_log.type = 0;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'all'< / span >
2020-02-25 18:10:20 +01:00
conf_log.type = 1;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'forces'< / span >
2020-02-25 18:10:20 +01:00
conf_log.type = 2;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / 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 >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgb0b7480" class = "outline-3" >
< h3 id = "orgb0b7480" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-orgb0b7480" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > save(< span class = "org-string" > './mat/conf_log.mat'< / span > , < span class = "org-string" > 'conf_log'< / span > );
2020-02-25 18:10:20 +01:00
< / 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 >
2020-02-03 17:50:32 +01:00
< / p >
< / div >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org5268fd9" class = "outline-3" >
< h3 id = "org5268fd9" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-org5268fd9" >
2020-02-03 17:50:32 +01:00
< 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 >
2019-12-11 17:09:32 +01:00
2020-02-25 18:10:20 +01:00
< div id = "org31eeec1" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2019-12-11 17:09:32 +01:00
2020-02-25 18:10:20 +01:00
< div id = "org342019d" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org488b87b" class = "outline-3" >
< h3 id = "org488b87b" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org488b87b" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > function< / span > < span class = "org-variable-name" > [ground]< / span > = < span class = "org-function-name" > initializeGround< / span > (< span class = "org-variable-name" > args< / span > )
2019-12-11 17:09:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org007273f" class = "outline-3" >
< h3 id = "org007273f" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org007273f" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-11-03 09:45:50 +01:00
args.type char {mustBeMember(args.type,{< span class = "org-string" > 'none'< / span > , < span class = "org-string" > 'rigid'< / span > })} = < span class = "org-string" > 'rigid'< / span >
args.rot_point (3,1) double {mustBeNumeric} = zeros(3,1) < span class = "org-comment" > % Rotation point for the ground motion [m]< / span >
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org5e583c4" class = "outline-3" >
< h3 id = "org5e583c4" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org5e583c4" >
2019-12-11 17:09:32 +01:00
< p >
2020-02-03 17:50:32 +01:00
First, we initialize the < code > granite< / code > structure.
2019-12-11 17:09:32 +01:00
< / p >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > ground = struct();
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org238b0e3" class = "outline-3" >
< h3 id = "org238b0e3" > Add Type< / h3 >
< div class = "outline-text-3" id = "text-org238b0e3" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > switch< / span > < span class = "org-constant" > args.type< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'none'< / span >
2020-02-25 18:10:20 +01:00
ground.type = 0;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'rigid'< / span >
2020-02-25 18:10:20 +01:00
ground.type = 1;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-02-25 18:10:20 +01:00
< div id = "outline-container-org4c31ca5" class = "outline-3" >
< h3 id = "org4c31ca5" > Ground Solid properties< / h3 >
< div class = "outline-text-3" id = "text-org4c31ca5" >
2019-12-11 17:09:32 +01:00
< p >
2020-02-03 17:50:32 +01:00
We set the shape and density of the ground solid element.
2019-12-11 17:09:32 +01:00
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > ground.shape = [2, 2, 0.5]; < span class = "org-comment" > % [m]< / span >
ground.density = 2800; < span class = "org-comment" > % [kg/m3]< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-03-13 17:40:22 +01:00
< 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 >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgaac8766" class = "outline-3" >
< h3 id = "orgaac8766" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-orgaac8766" >
2020-02-03 17:50:32 +01:00
< p >
The < code > ground< / code > structure is saved.
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > save(< span class = "org-string" > './mat/stages.mat'< / span > , < span class = "org-string" > 'ground'< / span > , < span class = "org-string" > '-append'< / span > );
2019-12-11 17:09:32 +01:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2020-02-25 18:10:20 +01:00
< 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" >
2019-12-11 17:09:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
< a id = "org82dc444" > < / a >
2019-12-11 17:09:32 +01:00
< / p >
< / div >
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgee9cd2e" class = "outline-3" >
< h3 id = "orgee9cd2e" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-orgee9cd2e" >
2019-12-11 17:09:32 +01:00
< p >
2020-02-03 17:50:32 +01:00
The Simscape model of the granite is composed of:
2019-12-11 17:09:32 +01:00
< / p >
2020-02-03 17:50:32 +01:00
< 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 >
2019-12-11 17:09:32 +01:00
< p >
2020-02-03 17:50:32 +01:00
The output < code > sample_pos< / code > corresponds to the impact point of the X-ray.
2019-12-11 17:09:32 +01:00
< / p >
2020-02-25 18:10:20 +01:00
< div id = "org3072cb3" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2019-12-11 17:09:32 +01:00
2020-02-25 18:10:20 +01:00
< div id = "org089e7b6" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgeefef30" class = "outline-3" >
< h3 id = "orgeefef30" > Function description< / h3 >
< div class = "outline-text-3" id = "text-orgeefef30" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > function< / span > < span class = "org-variable-name" > [granite]< / span > = < span class = "org-function-name" > initializeGranite< / span > (< span class = "org-variable-name" > args< / span > )
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgcdae5ac" class = "outline-3" >
< h3 id = "orgcdae5ac" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-orgcdae5ac" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-11-03 09:45:50 +01:00
args.type char {mustBeMember(args.type,{< span class = "org-string" > 'rigid'< / span > , < span class = "org-string" > 'flexible'< / span > , < span class = "org-string" > 'none'< / span > , < span class = "org-string" > 'modal-analysis'< / span > , < span class = "org-string" > 'init'< / span > })} = < span class = "org-string" > 'flexible'< / span >
args.Foffset logical {mustBeNumericOrLogical} = < span class = "org-constant" > false< / span >
args.density (1,1) double {mustBeNumeric, mustBeNonnegative} = 2800 < span class = "org-comment" > % Density [kg/m3]< / span >
args.K (3,1) double {mustBeNumeric, mustBeNonnegative} = [4e9; 3e8; 8e8] < span class = "org-comment" > % [N/m]< / span >
args.C (3,1) double {mustBeNumeric, mustBeNonnegative} = [4.0e5; 1.1e5; 9.0e5] < span class = "org-comment" > % [N/(m/s)]< / span >
args.x0 (1,1) double {mustBeNumeric} = 0 < span class = "org-comment" > % Rest position of the Joint in the X direction [m]< / span >
args.y0 (1,1) double {mustBeNumeric} = 0 < span class = "org-comment" > % Rest position of the Joint in the Y direction [m]< / span >
args.z0 (1,1) double {mustBeNumeric} = 0 < span class = "org-comment" > % Rest position of the Joint in the Z direction [m]< / span >
args.sample_pos (1,1) double {mustBeNumeric} = 0.8 < span class = "org-comment" > % Height of the measurment point [m]< / span >
< span class = "org-keyword" > end< / span >
2019-12-11 17:09:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org734efbd" class = "outline-3" >
< h3 id = "org734efbd" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org734efbd" >
2019-12-11 17:09:32 +01:00
< p >
2020-02-03 17:50:32 +01:00
First, we initialize the < code > granite< / code > structure.
2019-12-11 17:09:32 +01:00
< / p >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > granite = struct();
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-02-25 18:10:20 +01:00
< div id = "outline-container-org413c06d" class = "outline-3" >
< h3 id = "org413c06d" > Add Granite Type< / h3 >
< div class = "outline-text-3" id = "text-org413c06d" >
2019-12-11 17:09:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > switch< / span > < span class = "org-constant" > args.type< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'none'< / span >
2020-02-25 18:10:20 +01:00
granite.type = 0;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'rigid'< / span >
2020-02-25 18:10:20 +01:00
granite.type = 1;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'flexible'< / span >
2020-02-25 18:10:20 +01:00
granite.type = 2;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'modal-analysis'< / span >
2020-02-25 18:10:20 +01:00
granite.type = 3;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'init'< / span >
2020-02-25 18:10:20 +01:00
granite.type = 4;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2019-12-11 17:09:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgb09a907" class = "outline-3" >
< h3 id = "orgb09a907" > Material and Geometry< / h3 >
< div class = "outline-text-3" id = "text-orgb09a907" >
2019-12-11 17:09:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
Properties of the Material and link to the geometry of the granite.
2019-12-11 17:09:32 +01:00
< / p >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > granite.density = args.density; < span class = "org-comment" > % [kg/m3]< / span >
granite.STEP = < span class = "org-string" > './STEPS/granite/granite.STEP'< / span > ;
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2019-12-11 17:09:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
Z-offset for the initial position of the sample with respect to the granite top surface.
2019-12-11 17:09:32 +01:00
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > granite.sample_pos = args.sample_pos; < span class = "org-comment" > % [m]< / span >
2019-12-11 17:09:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org01454e2" class = "outline-3" >
< h3 id = "org01454e2" > Stiffness and Damping properties< / h3 >
< div class = "outline-text-3" id = "text-org01454e2" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > granite.K = args.K; < span class = "org-comment" > % [N/m]< / span >
granite.C = args.C; < span class = "org-comment" > % [N/(m/s)]< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org8c04d7a" class = "outline-3" >
< h3 id = "org8c04d7a" > Equilibrium position of the each joint.< / h3 >
< div class = "outline-text-3" id = "text-org8c04d7a" >
2019-12-11 17:09:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > if< / span > args.Foffset < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'none'< / span > ) < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'rigid'< / span > ) < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'init'< / span > )
load(< span class = "org-string" > 'mat/Foffset.mat'< / span > , < span class = "org-string" > 'Fgm'< / span > );
granite.Deq = < span class = "org-type" > -< / span > Fgm< span class = "org-type" > './< / span > granite.K;
< span class = "org-keyword" > else< / span >
2020-02-25 18:10:20 +01:00
granite.Deq = zeros(6,1);
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgace9c7f" class = "outline-3" >
< h3 id = "orgace9c7f" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-orgace9c7f" >
2020-02-03 17:50:32 +01:00
< p >
The < code > granite< / code > structure is saved.
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > save(< span class = "org-string" > './mat/stages.mat'< / span > , < span class = "org-string" > 'granite'< / span > , < span class = "org-string" > '-append'< / span > );
2019-12-11 17:09:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-02-03 17:50:32 +01:00
< / div >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org5e56bf2" class = "outline-2" >
< h2 id = "org5e56bf2" > < span class = "section-number-2" > 5< / span > Translation Stage< / h2 >
2020-02-25 18:10:20 +01:00
< div class = "outline-text-2" id = "text-5" >
2019-12-11 17:09:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
< a id = "orga6fcdbd" > < / a >
2019-12-11 17:09:32 +01:00
< / p >
2020-02-03 17:50:32 +01:00
< / div >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org24fb48a" class = "outline-3" >
< h3 id = "org24fb48a" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-org24fb48a" >
2019-12-11 17:09:32 +01:00
< p >
2020-02-03 17:50:32 +01:00
The Simscape model of the Translation stage consist of:
2019-12-11 17:09:32 +01:00
< / p >
2020-02-03 17:50:32 +01:00
< 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 >
2019-12-11 17:09:32 +01:00
2020-02-25 18:10:20 +01:00
< div id = "orgb5e657d" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2019-12-11 17:09:32 +01:00
2020-02-25 18:10:20 +01:00
< div id = "org55b7d60" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org3050e0c" class = "outline-3" >
< h3 id = "org3050e0c" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org3050e0c" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > function< / span > < span class = "org-variable-name" > [ty]< / span > = < span class = "org-function-name" > initializeTy< / span > (< span class = "org-variable-name" > args< / span > )
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgfd5133d" class = "outline-3" >
< h3 id = "orgfd5133d" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-orgfd5133d" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-11-03 09:45:50 +01:00
args.type char {mustBeMember(args.type,{< span class = "org-string" > 'none'< / span > , < span class = "org-string" > 'rigid'< / span > , < span class = "org-string" > 'flexible'< / span > , < span class = "org-string" > 'modal-analysis'< / span > , < span class = "org-string" > 'init'< / span > })} = < span class = "org-string" > 'flexible'< / span >
args.Foffset logical {mustBeNumericOrLogical} = < span class = "org-constant" > false< / span >
< span class = "org-keyword" > end< / span >
2019-12-11 17:09:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgcece457" class = "outline-3" >
< h3 id = "orgcece457" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-orgcece457" >
2019-12-11 17:09:32 +01:00
< p >
2020-02-03 17:50:32 +01:00
First, we initialize the < code > ty< / code > structure.
2019-12-11 17:09:32 +01:00
< / p >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > ty = struct();
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-02-25 18:10:20 +01:00
< 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" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > switch< / span > < span class = "org-constant" > args.type< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'none'< / span >
2020-02-25 18:10:20 +01:00
ty.type = 0;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'rigid'< / span >
2020-02-25 18:10:20 +01:00
ty.type = 1;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'flexible'< / span >
2020-02-25 18:10:20 +01:00
ty.type = 2;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'modal-analysis'< / span >
2020-02-25 18:10:20 +01:00
ty.type = 3;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'init'< / span >
2020-02-25 18:10:20 +01:00
ty.type = 4;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org3fe28ba" class = "outline-3" >
< h3 id = "org3fe28ba" > Material and Geometry< / h3 >
< div class = "outline-text-3" id = "text-org3fe28ba" >
2019-12-11 17:09:32 +01:00
< p >
2020-02-03 17:50:32 +01:00
Define the density of the materials as well as the geometry (STEP files).
2019-12-11 17:09:32 +01:00
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-comment" > % Ty Granite frame< / span >
ty.granite_frame.density = 7800; < span class = "org-comment" > % [kg/m3] => 43kg< / span >
ty.granite_frame.STEP = < span class = "org-string" > './STEPS/Ty/Ty_Granite_Frame.STEP'< / span > ;
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Guide Translation Ty< / span >
ty.guide.density = 7800; < span class = "org-comment" > % [kg/m3] => 76kg< / span >
ty.guide.STEP = < span class = "org-string" > './STEPS/ty/Ty_Guide.STEP'< / span > ;
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Ty - Guide_Translation12< / span >
ty.guide12.density = 7800; < span class = "org-comment" > % [kg/m3]< / span >
ty.guide12.STEP = < span class = "org-string" > './STEPS/Ty/Ty_Guide_12.STEP'< / span > ;
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Ty - Guide_Translation11< / span >
ty.guide11.density = 7800; < span class = "org-comment" > % [kg/m3]< / span >
ty.guide11.STEP = < span class = "org-string" > './STEPS/ty/Ty_Guide_11.STEP'< / span > ;
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Ty - Guide_Translation22< / span >
ty.guide22.density = 7800; < span class = "org-comment" > % [kg/m3]< / span >
ty.guide22.STEP = < span class = "org-string" > './STEPS/ty/Ty_Guide_22.STEP'< / span > ;
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Ty - Guide_Translation21< / span >
ty.guide21.density = 7800; < span class = "org-comment" > % [kg/m3]< / span >
ty.guide21.STEP = < span class = "org-string" > './STEPS/Ty/Ty_Guide_21.STEP'< / span > ;
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Ty - Plateau translation< / span >
ty.frame.density = 7800; < span class = "org-comment" > % [kg/m3]< / span >
ty.frame.STEP = < span class = "org-string" > './STEPS/ty/Ty_Stage.STEP'< / span > ;
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Ty Stator Part< / span >
ty.stator.density = 5400; < span class = "org-comment" > % [kg/m3]< / span >
ty.stator.STEP = < span class = "org-string" > './STEPS/ty/Ty_Motor_Stator.STEP'< / span > ;
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Ty Rotor Part< / span >
ty.rotor.density = 5400; < span class = "org-comment" > % [kg/m3]< / span >
ty.rotor.STEP = < span class = "org-string" > './STEPS/ty/Ty_Motor_Rotor.STEP'< / span > ;
2019-12-11 17:09:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
2020-02-03 17:50:32 +01:00
< / div >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org8d52fe4" class = "outline-3" >
< h3 id = "org8d52fe4" > Stiffness and Damping properties< / h3 >
< div class = "outline-text-3" id = "text-org8d52fe4" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > ty.K = [2e8; 1e8; 2e8; 6e7; 9e7; 6e7]; < span class = "org-comment" > % [N/m, N*m/rad]< / span >
ty.C = [8e4; 5e4; 8e4; 2e4; 3e4; 2e4]; < span class = "org-comment" > % [N/(m/s), N*m/(rad/s)]< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org557467b" class = "outline-3" >
< h3 id = "org557467b" > Equilibrium position of the each joint.< / h3 >
< div class = "outline-text-3" id = "text-org557467b" >
2019-12-11 17:09:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > if< / span > args.Foffset < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'none'< / span > ) < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'rigid'< / span > ) < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'init'< / span > )
load(< span class = "org-string" > 'mat/Foffset.mat'< / span > , < span class = "org-string" > 'Ftym'< / span > );
ty.Deq = < span class = "org-type" > -< / span > Ftym< span class = "org-type" > './< / span > ty.K;
< span class = "org-keyword" > else< / span >
2020-02-25 18:10:20 +01:00
ty.Deq = zeros(6,1);
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org8105482" class = "outline-3" >
< h3 id = "org8105482" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org8105482" >
2020-02-03 17:50:32 +01:00
< p >
The < code > ty< / code > structure is saved.
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > save(< span class = "org-string" > './mat/stages.mat'< / span > , < span class = "org-string" > 'ty'< / span > , < span class = "org-string" > '-append'< / span > );
2019-12-11 17:09:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-02-03 17:50:32 +01:00
< / div >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgfb9d278" class = "outline-2" >
< h2 id = "orgfb9d278" > < span class = "section-number-2" > 6< / span > Tilt Stage< / h2 >
2020-02-25 18:10:20 +01:00
< div class = "outline-text-2" id = "text-6" >
2019-12-11 17:09:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
< a id = "orga630083" > < / a >
2019-12-11 17:09:32 +01:00
< / p >
2020-02-03 17:50:32 +01:00
< / div >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org72c208c" class = "outline-3" >
< h3 id = "org72c208c" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-org72c208c" >
2019-12-11 17:09:32 +01:00
< p >
2020-02-03 17:50:32 +01:00
The Simscape model of the Tilt stage is composed of:
2019-12-11 17:09:32 +01:00
< / p >
2020-02-03 17:50:32 +01:00
< 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 >
2019-12-11 17:09:32 +01:00
2020-02-25 18:10:20 +01:00
< div id = "orgee25bbf" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2019-12-11 17:09:32 +01:00
2020-02-25 18:10:20 +01:00
< div id = "orgcb39e81" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org3dc23ba" class = "outline-3" >
< h3 id = "org3dc23ba" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org3dc23ba" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > function< / span > < span class = "org-variable-name" > [ry]< / span > = < span class = "org-function-name" > initializeRy< / span > (< span class = "org-variable-name" > args< / span > )
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgadde228" class = "outline-3" >
< h3 id = "orgadde228" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-orgadde228" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-11-03 09:45:50 +01:00
args.type char {mustBeMember(args.type,{< span class = "org-string" > 'none'< / span > , < span class = "org-string" > 'rigid'< / span > , < span class = "org-string" > 'flexible'< / span > , < span class = "org-string" > 'modal-analysis'< / span > , < span class = "org-string" > 'init'< / span > })} = < span class = "org-string" > 'flexible'< / span >
args.Foffset logical {mustBeNumericOrLogical} = < span class = "org-constant" > false< / span >
2020-02-25 18:10:20 +01:00
args.Ry_init (1,1) double {mustBeNumeric} = 0
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2019-12-11 17:09:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org169f69a" class = "outline-3" >
< h3 id = "org169f69a" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org169f69a" >
2019-12-11 17:09:32 +01:00
< p >
2020-02-03 17:50:32 +01:00
First, we initialize the < code > ry< / code > structure.
2019-12-11 17:09:32 +01:00
< / p >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > ry = struct();
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-02-25 18:10:20 +01:00
< 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" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > switch< / span > < span class = "org-constant" > args.type< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'none'< / span >
2020-02-25 18:10:20 +01:00
ry.type = 0;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'rigid'< / span >
2020-02-25 18:10:20 +01:00
ry.type = 1;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'flexible'< / span >
2020-02-25 18:10:20 +01:00
ry.type = 2;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'modal-analysis'< / span >
2020-02-25 18:10:20 +01:00
ry.type = 3;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'init'< / span >
2020-02-25 18:10:20 +01:00
ry.type = 4;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org36ae12b" class = "outline-3" >
< h3 id = "org36ae12b" > Material and Geometry< / h3 >
< div class = "outline-text-3" id = "text-org36ae12b" >
2019-12-11 17:09:32 +01:00
< p >
2020-02-03 17:50:32 +01:00
Properties of the Material and link to the geometry of the Tilt stage.
2019-12-11 17:09:32 +01:00
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-comment" > % Ry - Guide for the tilt stage< / span >
ry.guide.density = 7800; < span class = "org-comment" > % [kg/m3]< / span >
ry.guide.STEP = < span class = "org-string" > './STEPS/ry/Tilt_Guide.STEP'< / span > ;
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Ry - Rotor of the motor< / span >
ry.rotor.density = 2400; < span class = "org-comment" > % [kg/m3]< / span >
ry.rotor.STEP = < span class = "org-string" > './STEPS/ry/Tilt_Motor_Axis.STEP'< / span > ;
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Ry - Motor< / span >
ry.motor.density = 3200; < span class = "org-comment" > % [kg/m3]< / span >
ry.motor.STEP = < span class = "org-string" > './STEPS/ry/Tilt_Motor.STEP'< / span > ;
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Ry - Plateau Tilt< / span >
ry.stage.density = 7800; < span class = "org-comment" > % [kg/m3]< / span >
ry.stage.STEP = < span class = "org-string" > './STEPS/ry/Tilt_Stage.STEP'< / span > ;
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2019-12-11 17:09:32 +01:00
2020-02-03 17:50:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
Z-Offset so that the center of rotation matches the sample center;
2020-02-03 17:50:32 +01:00
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > ry.z_offset = 0.58178; < span class = "org-comment" > % [m]< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2019-12-11 17:09:32 +01:00
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > ry.Ry_init = args.Ry_init; < span class = "org-comment" > % [rad]< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org916d4da" class = "outline-3" >
< h3 id = "org916d4da" > Stiffness and Damping properties< / h3 >
< div class = "outline-text-3" id = "text-org916d4da" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-02-25 18:10:20 +01:00
< 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];
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org6de2867" class = "outline-3" >
< h3 id = "org6de2867" > Equilibrium position of the each joint.< / h3 >
< div class = "outline-text-3" id = "text-org6de2867" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > if< / span > args.Foffset < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'none'< / span > ) < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'rigid'< / span > ) < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'init'< / span > )
load(< span class = "org-string" > 'mat/Foffset.mat'< / span > , < span class = "org-string" > 'Fym'< / span > );
ry.Deq = < span class = "org-type" > -< / span > Fym< span class = "org-type" > './< / span > ry.K;
< span class = "org-keyword" > else< / span >
2020-02-25 18:10:20 +01:00
ry.Deq = zeros(6,1);
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org5ef9c1d" class = "outline-3" >
< h3 id = "org5ef9c1d" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org5ef9c1d" >
2020-02-03 17:50:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
The < code > ry< / code > structure is saved.
2020-02-03 17:50:32 +01:00
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > save(< span class = "org-string" > './mat/stages.mat'< / span > , < span class = "org-string" > 'ry'< / span > , < span class = "org-string" > '-append'< / span > );
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org6fe10ff" class = "outline-2" >
< h2 id = "org6fe10ff" > < span class = "section-number-2" > 7< / span > Spindle< / h2 >
2020-02-25 18:10:20 +01:00
< div class = "outline-text-2" id = "text-7" >
2020-02-03 17:50:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
< a id = "org85f7685" > < / a >
2020-02-03 17:50:32 +01:00
< / p >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orga72bd28" class = "outline-3" >
< h3 id = "orga72bd28" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-orga72bd28" >
2020-02-03 17:50:32 +01:00
< 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 >
2020-02-25 18:10:20 +01:00
< div id = "orgf8cd2b8" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2020-02-25 18:10:20 +01:00
< div id = "org8f17d51" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org11594c9" class = "outline-3" >
< h3 id = "org11594c9" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org11594c9" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > function< / span > < span class = "org-variable-name" > [rz]< / span > = < span class = "org-function-name" > initializeRz< / span > (< span class = "org-variable-name" > args< / span > )
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgf2246a4" class = "outline-3" >
< h3 id = "orgf2246a4" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-orgf2246a4" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-11-03 09:45:50 +01:00
args.type char {mustBeMember(args.type,{< span class = "org-string" > 'none'< / span > , < span class = "org-string" > 'rigid'< / span > , < span class = "org-string" > 'flexible'< / span > , < span class = "org-string" > 'modal-analysis'< / span > , < span class = "org-string" > 'init'< / span > })} = < span class = "org-string" > 'flexible'< / span >
args.Foffset logical {mustBeNumericOrLogical} = < span class = "org-constant" > false< / span >
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org79dfc58" class = "outline-3" >
< h3 id = "org79dfc58" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org79dfc58" >
2020-02-03 17:50:32 +01:00
< p >
First, we initialize the < code > rz< / code > structure.
< / p >
< div class = "org-src-container" >
< pre class = "src src-matlab" > rz = struct();
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / 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" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > switch< / span > < span class = "org-constant" > args.type< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'none'< / span >
2020-02-25 18:10:20 +01:00
rz.type = 0;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'rigid'< / span >
2020-02-25 18:10:20 +01:00
rz.type = 1;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'flexible'< / span >
2020-02-25 18:10:20 +01:00
rz.type = 2;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'modal-analysis'< / span >
2020-02-25 18:10:20 +01:00
rz.type = 3;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'init'< / span >
2020-02-25 18:10:20 +01:00
rz.type = 4;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org7439869" class = "outline-3" >
< h3 id = "org7439869" > Material and Geometry< / h3 >
< div class = "outline-text-3" id = "text-org7439869" >
2020-02-03 17:50:32 +01:00
< p >
Properties of the Material and link to the geometry of the spindle.
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-comment" > % Spindle - Slip Ring< / span >
rz.slipring.density = 7800; < span class = "org-comment" > % [kg/m3]< / span >
rz.slipring.STEP = < span class = "org-string" > './STEPS/rz/Spindle_Slip_Ring.STEP'< / span > ;
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Spindle - Rotor< / span >
rz.rotor.density = 7800; < span class = "org-comment" > % [kg/m3]< / span >
rz.rotor.STEP = < span class = "org-string" > './STEPS/rz/Spindle_Rotor.STEP'< / span > ;
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Spindle - Stator< / span >
rz.stator.density = 7800; < span class = "org-comment" > % [kg/m3]< / span >
rz.stator.STEP = < span class = "org-string" > './STEPS/rz/Spindle_Stator.STEP'< / span > ;
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
2020-02-03 17:50:32 +01:00
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org197f6c2" class = "outline-3" >
< h3 id = "org197f6c2" > Stiffness and Damping properties< / h3 >
< div class = "outline-text-3" id = "text-org197f6c2" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-02-25 18:10:20 +01:00
< pre class = "src src-matlab" > rz.K = [7e8; 7e8; 2e9; 1e7; 1e7; 1e7];
rz.C = [4e4; 4e4; 7e4; 1e4; 1e4; 1e4];
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org11f9106" class = "outline-3" >
< h3 id = "org11f9106" > Equilibrium position of the each joint.< / h3 >
< div class = "outline-text-3" id = "text-org11f9106" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > if< / span > args.Foffset < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'none'< / span > ) < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'rigid'< / span > ) < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'init'< / span > )
load(< span class = "org-string" > 'mat/Foffset.mat'< / span > , < span class = "org-string" > 'Fzm'< / span > );
rz.Deq = < span class = "org-type" > -< / span > Fzm< span class = "org-type" > './< / span > rz.K;
< span class = "org-keyword" > else< / span >
2020-02-25 18:10:20 +01:00
rz.Deq = zeros(6,1);
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org802ab4e" class = "outline-3" >
< h3 id = "org802ab4e" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org802ab4e" >
2020-02-03 17:50:32 +01:00
< p >
The < code > rz< / code > structure is saved.
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > save(< span class = "org-string" > './mat/stages.mat'< / span > , < span class = "org-string" > 'rz'< / span > , < span class = "org-string" > '-append'< / span > );
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org1e01222" class = "outline-2" >
< h2 id = "org1e01222" > < span class = "section-number-2" > 8< / span > Micro Hexapod< / h2 >
2020-02-25 18:10:20 +01:00
< div class = "outline-text-2" id = "text-8" >
2020-02-03 17:50:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
< a id = "org01254ae" > < / a >
2020-02-03 17:50:32 +01:00
< / p >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org3be92a2" class = "outline-3" >
< h3 id = "org3be92a2" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-org3be92a2" >
2020-02-03 17:50:32 +01:00
2020-02-25 18:10:20 +01:00
< div id = "org13345ec" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2020-02-25 18:10:20 +01:00
< div id = "orga63e01a" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org1f057b4" class = "outline-3" >
< h3 id = "org1f057b4" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org1f057b4" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > function< / span > < span class = "org-variable-name" > [micro_hexapod]< / span > = < span class = "org-function-name" > initializeMicroHexapod< / span > (< span class = "org-variable-name" > args< / span > )
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgca2b281" class = "outline-3" >
< h3 id = "orgca2b281" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-orgca2b281" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-11-03 09:45:50 +01:00
args.type char {mustBeMember(args.type,{< span class = "org-string" > 'none'< / span > , < span class = "org-string" > 'rigid'< / span > , < span class = "org-string" > 'flexible'< / span > , < span class = "org-string" > 'modal-analysis'< / span > , < span class = "org-string" > 'init'< / span > , < span class = "org-string" > 'compliance'< / span > })} = < span class = "org-string" > 'flexible'< / span >
< span class = "org-comment" > % initializeFramesPositions< / span >
args.H (1,1) double {mustBeNumeric, mustBePositive} = 350e< span class = "org-type" > -< / span > 3
args.MO_B (1,1) double {mustBeNumeric} = 270e< span class = "org-type" > -< / span > 3
< span class = "org-comment" > % generateGeneralConfiguration< / span >
args.FH (1,1) double {mustBeNumeric, mustBePositive} = 50e< span class = "org-type" > -< / span > 3
args.FR (1,1) double {mustBeNumeric, mustBePositive} = 175.5e< span class = "org-type" > -< / span > 3
args.FTh (6,1) double {mustBeNumeric} = [< span class = "org-type" > -< / span > 10, 10, 120< span class = "org-type" > -< / span > 10, 120< span class = "org-type" > +< / span > 10, 240< span class = "org-type" > -< / span > 10, 240< span class = "org-type" > +< / span > 10]< span class = "org-type" > *< / span > (< span class = "org-constant" > pi< / span > < span class = "org-type" > /< / span > 180)
args.MH (1,1) double {mustBeNumeric, mustBePositive} = 45e< span class = "org-type" > -< / span > 3
args.MR (1,1) double {mustBeNumeric, mustBePositive} = 118e< span class = "org-type" > -< / span > 3
args.MTh (6,1) double {mustBeNumeric} = [< span class = "org-type" > -< / span > 60< span class = "org-type" > +< / span > 10, 60< span class = "org-type" > -< / span > 10, 60< span class = "org-type" > +< / span > 10, 180< span class = "org-type" > -< / span > 10, 180< span class = "org-type" > +< / span > 10, < span class = "org-type" > -< / span > 60< span class = "org-type" > -< / span > 10]< span class = "org-type" > *< / span > (< span class = "org-constant" > pi< / span > < span class = "org-type" > /< / span > 180)
< span class = "org-comment" > % initializeStrutDynamics< / span >
args.Ki (6,1) double {mustBeNumeric, mustBeNonnegative} = 2e7< span class = "org-type" > *< / span > ones(6,1)
args.Ci (6,1) double {mustBeNumeric, mustBeNonnegative} = 1.4e3< span class = "org-type" > *< / span > ones(6,1)
< span class = "org-comment" > % initializeCylindricalPlatforms< / span >
2020-02-03 17:50:32 +01:00
args.Fpm (1,1) double {mustBeNumeric, mustBePositive} = 10
2020-11-03 09:45:50 +01:00
args.Fph (1,1) double {mustBeNumeric, mustBePositive} = 26e< span class = "org-type" > -< / span > 3
args.Fpr (1,1) double {mustBeNumeric, mustBePositive} = 207.5e< span class = "org-type" > -< / span > 3
2020-02-03 17:50:32 +01:00
args.Mpm (1,1) double {mustBeNumeric, mustBePositive} = 10
2020-11-03 09:45:50 +01:00
args.Mph (1,1) double {mustBeNumeric, mustBePositive} = 26e< span class = "org-type" > -< / span > 3
args.Mpr (1,1) double {mustBeNumeric, mustBePositive} = 150e< span class = "org-type" > -< / span > 3
< span class = "org-comment" > % initializeCylindricalStruts< / span >
2020-02-03 17:50:32 +01:00
args.Fsm (1,1) double {mustBeNumeric, mustBePositive} = 1
2020-11-03 09:45:50 +01:00
args.Fsh (1,1) double {mustBeNumeric, mustBePositive} = 100e< span class = "org-type" > -< / span > 3
args.Fsr (1,1) double {mustBeNumeric, mustBePositive} = 25e< span class = "org-type" > -< / span > 3
2020-02-03 17:50:32 +01:00
args.Msm (1,1) double {mustBeNumeric, mustBePositive} = 1
2020-11-03 09:45:50 +01:00
args.Msh (1,1) double {mustBeNumeric, mustBePositive} = 100e< span class = "org-type" > -< / span > 3
args.Msr (1,1) double {mustBeNumeric, mustBePositive} = 25e< span class = "org-type" > -< / span > 3
< span class = "org-comment" > % inverseKinematics< / span >
2020-02-03 17:50:32 +01:00
args.AP (3,1) double {mustBeNumeric} = zeros(3,1)
args.ARB (3,3) double {mustBeNumeric} = eye(3)
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Force that stiffness of each joint should apply at t=0< / span >
args.Foffset logical {mustBeNumericOrLogical} = < span class = "org-constant" > false< / span >
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org181d2af" class = "outline-3" >
< h3 id = "org181d2af" > Function content< / h3 >
< div class = "outline-text-3" id = "text-org181d2af" >
2020-05-05 11:38:52 +02:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > stewart = initializeStewartPlatform();
stewart = initializeFramesPositions(stewart, ...
2020-11-03 09:45:50 +01:00
< span class = "org-string" > 'H'< / span > , args.H, ...
< span class = "org-string" > 'MO_B'< / span > , args.MO_B);
2020-05-05 11:38:52 +02:00
stewart = generateGeneralConfiguration(stewart, ...
2020-11-03 09:45:50 +01:00
< span class = "org-string" > 'FH'< / span > , args.FH, ...
< span class = "org-string" > 'FR'< / span > , args.FR, ...
< span class = "org-string" > 'FTh'< / span > , args.FTh, ...
< span class = "org-string" > 'MH'< / span > , args.MH, ...
< span class = "org-string" > 'MR'< / span > , args.MR, ...
< span class = "org-string" > 'MTh'< / span > , args.MTh);
2020-05-05 11:38:52 +02:00
stewart = computeJointsPose(stewart);
< / pre >
< / div >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > stewart = initializeStrutDynamics(stewart, ...
2020-11-03 09:45:50 +01:00
< span class = "org-string" > 'K'< / span > , args.Ki, ...
< span class = "org-string" > 'C'< / span > , args.Ci);
2020-05-05 11:38:52 +02:00
stewart = initializeJointDynamics(stewart, ...
2020-11-03 09:45:50 +01:00
< span class = "org-string" > 'type_F'< / span > , < span class = "org-string" > 'universal_p'< / span > , ...
< span class = "org-string" > 'type_M'< / span > , < span class = "org-string" > 'spherical_p'< / span > );
2020-05-05 11:38:52 +02:00
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-matlab" > stewart = initializeCylindricalPlatforms(stewart, ...
2020-11-03 09:45:50 +01:00
< span class = "org-string" > 'Fpm'< / span > , args.Fpm, ...
< span class = "org-string" > 'Fph'< / span > , args.Fph, ...
< span class = "org-string" > 'Fpr'< / span > , args.Fpr, ...
< span class = "org-string" > 'Mpm'< / span > , args.Mpm, ...
< span class = "org-string" > 'Mph'< / span > , args.Mph, ...
< span class = "org-string" > 'Mpr'< / span > , args.Mpr);
2020-05-05 11:38:52 +02:00
stewart = initializeCylindricalStruts(stewart, ...
2020-11-03 09:45:50 +01:00
< span class = "org-string" > 'Fsm'< / span > , args.Fsm, ...
< span class = "org-string" > 'Fsh'< / span > , args.Fsh, ...
< span class = "org-string" > 'Fsr'< / span > , args.Fsr, ...
< span class = "org-string" > 'Msm'< / span > , args.Msm, ...
< span class = "org-string" > 'Msh'< / span > , args.Msh, ...
< span class = "org-string" > 'Msr'< / span > , args.Msr);
2020-05-05 11:38:52 +02:00
stewart = computeJacobian(stewart);
stewart = initializeStewartPose(stewart, ...
2020-11-03 09:45:50 +01:00
< span class = "org-string" > 'AP'< / span > , args.AP, ...
< span class = "org-string" > 'ARB'< / span > , args.ARB);
2020-05-05 11:38:52 +02:00
< / pre >
< / div >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > stewart = initializeInertialSensor(stewart, < span class = "org-string" > 'type'< / span > , < span class = "org-string" > 'none'< / span > );
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< p >
Equilibrium position of the each joint.
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > if< / span > args.Foffset < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'none'< / span > ) < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'rigid'< / span > ) < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'init'< / span > )
load(< span class = "org-string" > 'mat/Foffset.mat'< / span > , < span class = "org-string" > 'Fhm'< / span > );
stewart.actuators.dLeq = < span class = "org-type" > -< / span > Fhm< span class = "org-type" > './< / span > args.Ki;
< span class = "org-keyword" > else< / span >
2020-05-05 11:38:52 +02:00
stewart.actuators.dLeq = zeros(6,1);
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org50a53ee" class = "outline-3" >
< h3 id = "org50a53ee" > Add Type< / h3 >
< div class = "outline-text-3" id = "text-org50a53ee" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > switch< / span > < span class = "org-constant" > args.type< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'none'< / span >
2020-05-05 11:38:52 +02:00
stewart.type = 0;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'rigid'< / span >
2020-05-05 11:38:52 +02:00
stewart.type = 1;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'flexible'< / span >
2020-05-05 11:38:52 +02:00
stewart.type = 2;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'modal-analysis'< / span >
2020-05-05 11:38:52 +02:00
stewart.type = 3;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'init'< / span >
2020-05-05 11:38:52 +02:00
stewart.type = 4;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'compliance'< / span >
2020-05-05 11:38:52 +02:00
stewart.type = 5;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org9a94be5" class = "outline-3" >
< h3 id = "org9a94be5" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org9a94be5" >
2020-02-03 17:50:32 +01:00
< p >
The < code > micro_hexapod< / code > structure is saved.
< / p >
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > micro_hexapod = stewart;
2020-11-03 09:45:50 +01:00
save(< span class = "org-string" > './mat/stages.mat'< / span > , < span class = "org-string" > 'micro_hexapod'< / span > , < span class = "org-string" > '-append'< / span > );
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2020-02-25 18:10:20 +01:00
< 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" >
2020-02-03 17:50:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
< a id = "org9989724" > < / a >
2020-02-03 17:50:32 +01:00
< / p >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org03fe943" class = "outline-3" >
< h3 id = "org03fe943" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-org03fe943" >
2020-02-03 17:50:32 +01:00
< 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 >
2020-02-25 18:10:20 +01:00
< div id = "orge09d585" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2020-02-25 18:10:20 +01:00
< div id = "orga3d0932" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org7e9c684" class = "outline-3" >
< h3 id = "org7e9c684" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org7e9c684" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > function< / span > < span class = "org-variable-name" > [axisc]< / span > = < span class = "org-function-name" > initializeAxisc< / span > (< span class = "org-variable-name" > args< / span > )
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org30a65a0" class = "outline-3" >
< h3 id = "org30a65a0" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org30a65a0" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-11-03 09:45:50 +01:00
args.type char {mustBeMember(args.type,{< span class = "org-string" > 'none'< / span > , < span class = "org-string" > 'rigid'< / span > , < span class = "org-string" > 'flexible'< / span > })} = < span class = "org-string" > 'flexible'< / span >
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
2020-02-03 17:50:32 +01:00
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgfbaaf18" class = "outline-3" >
< h3 id = "orgfbaaf18" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-orgfbaaf18" >
2020-02-03 17:50:32 +01:00
< p >
First, we initialize the < code > axisc< / code > structure.
< / p >
< div class = "org-src-container" >
< pre class = "src src-matlab" > axisc = struct();
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgd1e226f" class = "outline-3" >
< h3 id = "orgd1e226f" > Add Type< / h3 >
< div class = "outline-text-3" id = "text-orgd1e226f" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > switch< / span > < span class = "org-constant" > args.type< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'none'< / span >
2020-02-25 18:10:20 +01:00
axisc.type = 0;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'rigid'< / span >
2020-02-25 18:10:20 +01:00
axisc.type = 1;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'flexible'< / span >
2020-02-25 18:10:20 +01:00
axisc.type = 2;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orga8da922" class = "outline-3" >
< h3 id = "orga8da922" > Material and Geometry< / h3 >
< div class = "outline-text-3" id = "text-orga8da922" >
2020-02-03 17:50:32 +01:00
< p >
Properties of the Material and link to the geometry files.
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-comment" > % Structure< / span >
axisc.structure.density = 3400; < span class = "org-comment" > % [kg/m3]< / span >
axisc.structure.STEP = < span class = "org-string" > './STEPS/axisc/axisc_structure.STEP'< / span > ;
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Wheel< / span >
axisc.wheel.density = 2700; < span class = "org-comment" > % [kg/m3]< / span >
axisc.wheel.STEP = < span class = "org-string" > './STEPS/axisc/axisc_wheel.STEP'< / span > ;
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Mass< / span >
axisc.mass.density = 7800; < span class = "org-comment" > % [kg/m3]< / span >
axisc.mass.STEP = < span class = "org-string" > './STEPS/axisc/axisc_mass.STEP'< / span > ;
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Gear< / span >
axisc.gear.density = 7800; < span class = "org-comment" > % [kg/m3]< / span >
axisc.gear.STEP = < span class = "org-string" > './STEPS/axisc/axisc_gear.STEP'< / span > ;
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org2294619" class = "outline-3" >
< h3 id = "org2294619" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org2294619" >
2020-02-03 17:50:32 +01:00
< p >
The < code > axisc< / code > structure is saved.
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > save(< span class = "org-string" > './mat/stages.mat'< / span > , < span class = "org-string" > 'axisc'< / span > , < span class = "org-string" > '-append'< / span > );
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2020-02-25 18:10:20 +01:00
< 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" >
2020-02-03 17:50:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
< a id = "org3d670bf" > < / a >
2020-02-03 17:50:32 +01:00
< / p >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org6506586" class = "outline-3" >
< h3 id = "org6506586" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-org6506586" >
2020-02-03 17:50:32 +01:00
< 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 >
2020-02-25 18:10:20 +01:00
< div id = "org281f48a" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2020-02-25 18:10:20 +01:00
< div id = "orgf4fa701" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org95db869" class = "outline-3" >
< h3 id = "org95db869" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org95db869" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > function< / span > < span class = "org-variable-name" > []< / span > = < span class = "org-function-name" > initializeMirror< / span > (< span class = "org-variable-name" > args< / span > )
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org9746d1d" class = "outline-3" >
< h3 id = "org9746d1d" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org9746d1d" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-11-03 09:45:50 +01:00
args.type char {mustBeMember(args.type,{< span class = "org-string" > 'none'< / span > , < span class = "org-string" > 'rigid'< / span > , < span class = "org-string" > 'flexible'< / span > })} = < span class = "org-string" > 'rigid'< / span >
args.shape char {mustBeMember(args.shape,{< span class = "org-string" > 'spherical'< / span > , < span class = "org-string" > 'conical'< / span > })} = < span class = "org-string" > 'spherical'< / span >
args.angle (1,1) double {mustBeNumeric, mustBePositive} = 45 < span class = "org-comment" > % [deg]< / span >
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 10 < span class = "org-comment" > % [kg]< / span >
args.freq (6,1) double {mustBeNumeric, mustBeNonnegative} = 200< span class = "org-type" > *< / span > ones(6,1) < span class = "org-comment" > % [Hz]< / span >
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgf9d6201" class = "outline-3" >
< h3 id = "orgf9d6201" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-orgf9d6201" >
2020-02-03 17:50:32 +01:00
< p >
First, we initialize the < code > mirror< / code > structure.
< / p >
< div class = "org-src-container" >
< pre class = "src src-matlab" > mirror = struct();
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / 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" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > switch< / span > < span class = "org-constant" > args.type< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'none'< / span >
2020-02-25 18:10:20 +01:00
mirror.type = 0;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'rigid'< / span >
2020-02-25 18:10:20 +01:00
mirror.type = 1;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'flexible'< / span >
2020-04-17 10:25:44 +02:00
mirror.type = 2;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-02-03 17:50:32 +01:00
2020-04-17 10:25:44 +02:00
< 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 >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org87c25ef" class = "outline-3" >
< h3 id = "org87c25ef" > Stiffness and Damping properties< / h3 >
< div class = "outline-text-3" id = "text-org87c25ef" >
2020-04-17 10:25:44 +02:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > mirror.K = zeros(6,1);
2020-11-03 09:45:50 +01:00
mirror.K(1< span class = "org-type" > :< / span > 3) = mirror.mass < span class = "org-type" > *< / span > (2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > *< / span > mirror.freq(1< span class = "org-type" > :< / span > 3))< span class = "org-type" > .^< / span > 2;
2020-04-17 10:25:44 +02:00
mirror.C = zeros(6,1);
2020-11-03 09:45:50 +01:00
mirror.C(1< span class = "org-type" > :< / span > 3) = 0.2 < span class = "org-type" > *< / span > sqrt(mirror.K(1< span class = "org-type" > :< / span > 3)< span class = "org-type" > .*< / span > mirror.mass);
2020-04-17 10:25:44 +02:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org2ec60c8" class = "outline-3" >
< h3 id = "org2ec60c8" > Equilibrium position of the each joint.< / h3 >
< div class = "outline-text-3" id = "text-org2ec60c8" >
2020-04-17 10:25:44 +02:00
< 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" >
2020-02-03 17:50:32 +01:00
< p >
We define the geometrical values.
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > mirror.h = 0.05; < span class = "org-comment" > % Height of the mirror [m]< / span >
2020-02-25 18:10:20 +01:00
2020-11-03 09:45:50 +01:00
mirror.thickness = 0.02; < span class = "org-comment" > % Thickness of the plate supporting the sample [m]< / span >
2020-02-25 18:10:20 +01:00
2020-11-03 09:45:50 +01:00
mirror.hole_rad = 0.125; < span class = "org-comment" > % radius of the hole in the mirror [m]< / span >
2020-02-25 18:10:20 +01:00
2020-11-03 09:45:50 +01:00
mirror.support_rad = 0.1; < span class = "org-comment" > % radius of the support plate [m]< / span >
2020-02-25 18:10:20 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % point of interest offset in z (above the top surfave) [m]< / span >
< span class = "org-keyword" > switch< / span > < span class = "org-constant" > args.type< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'none'< / span >
mirror.jacobian = 0.205;
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'rigid'< / span >
mirror.jacobian = 0.205 < span class = "org-type" > -< / span > mirror.h;
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'flexible'< / span >
mirror.jacobian = 0.205 < span class = "org-type" > -< / span > mirror.h;
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
2020-11-03 09:45:50 +01:00
mirror.rad = 0.180; < span class = "org-comment" > % radius of the mirror (at the bottom surface) [m]< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > mirror.cone_length = mirror.rad< span class = "org-type" > *< / span > tand(args.angle)< span class = "org-type" > +< / span > mirror.h< span class = "org-type" > +< / span > mirror.jacobian; < span class = "org-comment" > % Distance from Apex point of the cone to jacobian point< / span >
2020-02-03 17:50:32 +01:00
< / 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 = [...
2020-11-03 09:45:50 +01:00
mirror.support_rad< span class = "org-type" > +< / span > 5e< span class = "org-type" > -< / span > 3 mirror.h< span class = "org-type" > -< / span > mirror.thickness
mirror.hole_rad mirror.h< span class = "org-type" > -< / span > mirror.thickness; ...
2020-02-03 17:50:32 +01:00
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" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > if< / span > strcmp(args.shape, < span class = "org-string" > 'spherical'< / span > )
mirror.sphere_radius = sqrt((mirror.jacobian< span class = "org-type" > +< / span > mirror.h)< span class = "org-type" > ^< / span > 2< span class = "org-type" > +< / span > mirror.rad< span class = "org-type" > ^< / span > 2); < span class = "org-comment" > % Radius of the sphere [mm]< / span >
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > for< / span > < span class = "org-variable-name" > z< / span > = < span class = "org-constant" > linspace(0, mirror.h, 101)< / span >
mirror.shape = [mirror.shape; sqrt(mirror.sphere_radius< span class = "org-type" > ^< / span > 2< span class = "org-type" > -< / span > (z< span class = "org-type" > -< / span > mirror.jacobian< span class = "org-type" > -< / span > mirror.h)< span class = "org-type" > ^< / span > 2) z];
< span class = "org-keyword" > end< / span >
< span class = "org-keyword" > elseif< / span > strcmp(args.shape, < span class = "org-string" > 'conical'< / span > )
mirror.shape = [mirror.shape; mirror.rad< span class = "org-type" > +< / span > mirror.h< span class = "org-type" > /< / span > tand(args.angle) mirror.h];
< span class = "org-keyword" > else< / span >
error(< span class = "org-string" > 'Shape should be either conical or spherical'< / span > );
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< p >
Finally, we close the shape.
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > mirror.shape = [mirror.shape; mirror.support_rad< span class = "org-type" > +< / span > 5e< span class = "org-type" > -< / span > 3 mirror.h];
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org0fef54e" class = "outline-3" >
< h3 id = "org0fef54e" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org0fef54e" >
2020-02-03 17:50:32 +01:00
< p >
The < code > mirror< / code > structure is saved.
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > save(< span class = "org-string" > './mat/stages.mat'< / span > , < span class = "org-string" > 'mirror'< / span > , < span class = "org-string" > '-append'< / span > );
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org26371bd" class = "outline-2" >
< h2 id = "org26371bd" > < span class = "section-number-2" > 11< / span > Nano Hexapod< / h2 >
2020-02-25 18:10:20 +01:00
< div class = "outline-text-2" id = "text-11" >
2020-02-03 17:50:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
< a id = "org9a9721e" > < / a >
2020-02-03 17:50:32 +01:00
< / p >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org60b2d4e" class = "outline-3" >
< h3 id = "org60b2d4e" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-org60b2d4e" >
2020-02-03 17:50:32 +01:00
2020-02-25 18:10:20 +01:00
< div id = "orga6643fc" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2020-02-25 18:10:20 +01:00
< div id = "org4d9fd08" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org3ef53ba" class = "outline-3" >
< h3 id = "org3ef53ba" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org3ef53ba" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > function< / span > < span class = "org-variable-name" > [nano_hexapod]< / span > = < span class = "org-function-name" > initializeNanoHexapod< / span > (< span class = "org-variable-name" > args< / span > )
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org6b134e3" class = "outline-3" >
< h3 id = "org6b134e3" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org6b134e3" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-11-03 09:45:50 +01:00
args.type char {mustBeMember(args.type,{< span class = "org-string" > 'none'< / span > , < span class = "org-string" > 'rigid'< / span > , < span class = "org-string" > 'flexible'< / span > , < span class = "org-string" > 'init'< / span > })} = < span class = "org-string" > 'flexible'< / span >
< span class = "org-comment" > % initializeFramesPositions< / span >
args.H (1,1) double {mustBeNumeric, mustBePositive} = 95e< span class = "org-type" > -< / span > 3
args.MO_B (1,1) double {mustBeNumeric} = 170e< span class = "org-type" > -< / span > 3
< span class = "org-comment" > % generateGeneralConfiguration< / span >
args.FH (1,1) double {mustBeNumeric, mustBePositive} = 15e< span class = "org-type" > -< / span > 3
args.FR (1,1) double {mustBeNumeric, mustBePositive} = 100e< span class = "org-type" > -< / span > 3
args.FTh (6,1) double {mustBeNumeric} = [< span class = "org-type" > -< / span > 10, 10, 120< span class = "org-type" > -< / span > 10, 120< span class = "org-type" > +< / span > 10, 240< span class = "org-type" > -< / span > 10, 240< span class = "org-type" > +< / span > 10]< span class = "org-type" > *< / span > (< span class = "org-constant" > pi< / span > < span class = "org-type" > /< / span > 180)
args.MH (1,1) double {mustBeNumeric, mustBePositive} = 15e< span class = "org-type" > -< / span > 3
args.MR (1,1) double {mustBeNumeric, mustBePositive} = 90e< span class = "org-type" > -< / span > 3
args.MTh (6,1) double {mustBeNumeric} = [< span class = "org-type" > -< / span > 60< span class = "org-type" > +< / span > 10, 60< span class = "org-type" > -< / span > 10, 60< span class = "org-type" > +< / span > 10, 180< span class = "org-type" > -< / span > 10, 180< span class = "org-type" > +< / span > 10, < span class = "org-type" > -< / span > 60< span class = "org-type" > -< / span > 10]< span class = "org-type" > *< / span > (< span class = "org-constant" > pi< / span > < span class = "org-type" > /< / span > 180)
< span class = "org-comment" > % initializeStrutDynamics< / span >
args.actuator char {mustBeMember(args.actuator,{< span class = "org-string" > 'piezo'< / span > , < span class = "org-string" > 'lorentz'< / span > , < span class = "org-string" > 'amplified'< / span > })} = < span class = "org-string" > 'piezo'< / span >
2020-05-20 16:41:34 +02:00
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
2020-11-03 09:45:50 +01:00
args.F_gain (1,1) double {mustBeNumeric} = 1
args.k (1,1) double {mustBeNumeric} = < span class = "org-type" > -< / span > 1
args.c (1,1) double {mustBeNumeric} = < span class = "org-type" > -< / span > 1
< span class = "org-comment" > % initializeJointDynamics< / span >
args.type_F char {mustBeMember(args.type_F,{< span class = "org-string" > 'universal'< / span > , < span class = "org-string" > 'spherical'< / span > , < span class = "org-string" > 'universal_p'< / span > , < span class = "org-string" > 'spherical_p'< / span > , < span class = "org-string" > 'universal_3dof'< / span > , < span class = "org-string" > 'spherical_3dof'< / span > , < span class = "org-string" > 'flexible'< / span > })} = < span class = "org-string" > 'universal'< / span >
args.type_M char {mustBeMember(args.type_M,{< span class = "org-string" > 'universal'< / span > , < span class = "org-string" > 'spherical'< / span > , < span class = "org-string" > 'universal_p'< / span > , < span class = "org-string" > 'spherical_p'< / span > , < span class = "org-string" > 'universal_3dof'< / span > , < span class = "org-string" > 'spherical_3dof'< / span > , < span class = "org-string" > 'flexible'< / span > })} = < span class = "org-string" > 'spherical'< / span >
args.Ka_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1.2e8< span class = "org-type" > *< / span > ones(6,1)
args.Ca_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e1< span class = "org-type" > *< / span > ones(6,1)
args.Kr_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1.1e7< span class = "org-type" > *< / span > ones(6,1)
args.Cr_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e1< span class = "org-type" > *< / span > ones(6,1)
args.Kf_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 33< span class = "org-type" > *< / span > ones(6,1)
args.Cf_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e< span class = "org-type" > -< / span > 4< span class = "org-type" > *< / span > ones(6,1)
args.Kt_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 236< span class = "org-type" > *< / span > ones(6,1)
args.Ct_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e< span class = "org-type" > -< / span > 3< span class = "org-type" > *< / span > ones(6,1)
args.Kf_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 33< span class = "org-type" > *< / span > ones(6,1)
args.Cf_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e< span class = "org-type" > -< / span > 4< span class = "org-type" > *< / span > ones(6,1)
args.Kt_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 236< span class = "org-type" > *< / span > ones(6,1)
args.Ct_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e< span class = "org-type" > -< / span > 3< span class = "org-type" > *< / span > ones(6,1)
args.Ka_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1.2e8< span class = "org-type" > *< / span > ones(6,1)
args.Ca_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e1< span class = "org-type" > *< / span > ones(6,1)
args.Kr_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1.1e7< span class = "org-type" > *< / span > ones(6,1)
args.Cr_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e1< span class = "org-type" > *< / span > ones(6,1)
< span class = "org-comment" > % initializeCylindricalPlatforms< / span >
2020-02-03 17:50:32 +01:00
args.Fpm (1,1) double {mustBeNumeric, mustBePositive} = 1
2020-11-03 09:45:50 +01:00
args.Fph (1,1) double {mustBeNumeric, mustBePositive} = 10e< span class = "org-type" > -< / span > 3
args.Fpr (1,1) double {mustBeNumeric, mustBePositive} = 150e< span class = "org-type" > -< / span > 3
2020-02-03 17:50:32 +01:00
args.Mpm (1,1) double {mustBeNumeric, mustBePositive} = 1
2020-11-03 09:45:50 +01:00
args.Mph (1,1) double {mustBeNumeric, mustBePositive} = 10e< span class = "org-type" > -< / span > 3
args.Mpr (1,1) double {mustBeNumeric, mustBePositive} = 120e< span class = "org-type" > -< / span > 3
< span class = "org-comment" > % initializeCylindricalStruts< / span >
2020-02-03 17:50:32 +01:00
args.Fsm (1,1) double {mustBeNumeric, mustBePositive} = 0.1
2020-11-03 09:45:50 +01:00
args.Fsh (1,1) double {mustBeNumeric, mustBePositive} = 50e< span class = "org-type" > -< / span > 3
args.Fsr (1,1) double {mustBeNumeric, mustBePositive} = 5e< span class = "org-type" > -< / span > 3
2020-02-03 17:50:32 +01:00
args.Msm (1,1) double {mustBeNumeric, mustBePositive} = 0.1
2020-11-03 09:45:50 +01:00
args.Msh (1,1) double {mustBeNumeric, mustBePositive} = 50e< span class = "org-type" > -< / span > 3
args.Msr (1,1) double {mustBeNumeric, mustBePositive} = 5e< span class = "org-type" > -< / span > 3
< span class = "org-comment" > % inverseKinematics< / span >
2020-02-03 17:50:32 +01:00
args.AP (3,1) double {mustBeNumeric} = zeros(3,1)
args.ARB (3,3) double {mustBeNumeric} = eye(3)
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Equilibrium position of each leg< / span >
2020-02-03 17:50:32 +01:00
args.dLeq (6,1) double {mustBeNumeric} = zeros(6,1)
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Force that stiffness of each joint should apply at t=0< / span >
args.Foffset logical {mustBeNumericOrLogical} = < span class = "org-constant" > false< / span >
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgdb37eb8" class = "outline-3" >
< h3 id = "orgdb37eb8" > Function content< / h3 >
< div class = "outline-text-3" id = "text-orgdb37eb8" >
2020-05-05 11:38:52 +02:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > stewart = initializeStewartPlatform();
2020-11-03 09:45:50 +01:00
stewart = initializeFramesPositions(stewart, < span class = "org-string" > 'H'< / span > , args.H, < span class = "org-string" > 'MO_B'< / span > , args.MO_B);
2020-05-05 11:38:52 +02:00
2020-11-03 09:45:50 +01:00
stewart = generateGeneralConfiguration(stewart, < span class = "org-string" > 'FH'< / span > , args.FH, < span class = "org-string" > 'FR'< / span > , args.FR, < span class = "org-string" > 'FTh'< / span > , args.FTh, < span class = "org-string" > 'MH'< / span > , args.MH, < span class = "org-string" > 'MR'< / span > , args.MR, < span class = "org-string" > 'MTh'< / span > , args.MTh);
2020-05-05 11:38:52 +02:00
stewart = computeJointsPose(stewart);
< / pre >
< / div >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > if< / span > args.k < span class = "org-type" > > < / span > 0 < span class = "org-type" > & & < / span > args.c < span class = "org-type" > > < / span > 0
stewart = initializeStrutDynamics(stewart, < span class = "org-string" > 'type'< / span > , < span class = "org-string" > 'classical'< / span > , < span class = "org-string" > 'K'< / span > , args.k< span class = "org-type" > *< / span > ones(6,1), < span class = "org-string" > 'C'< / span > , args.c< span class = "org-type" > *< / span > ones(6,1));
< span class = "org-keyword" > elseif< / span > args.k < span class = "org-type" > > < / span > 0
stewart = initializeStrutDynamics(stewart, < span class = "org-string" > 'type'< / span > , < span class = "org-string" > 'classical'< / span > , < span class = "org-string" > 'K'< / span > , args.k< span class = "org-type" > *< / span > ones(6,1), < span class = "org-string" > 'C'< / span > , 1.5< span class = "org-type" > *< / span > sqrt(args.k)< span class = "org-type" > *< / span > ones(6,1));
< span class = "org-keyword" > elseif< / span > strcmp(args.actuator, < span class = "org-string" > 'piezo'< / span > )
stewart = initializeStrutDynamics(stewart, < span class = "org-string" > 'type'< / span > , < span class = "org-string" > 'classical'< / span > , < span class = "org-string" > 'K'< / span > , 1e7< span class = "org-type" > *< / span > ones(6,1), < span class = "org-string" > 'C'< / span > , 1e2< span class = "org-type" > *< / span > ones(6,1));
< span class = "org-keyword" > elseif< / span > strcmp(args.actuator, < span class = "org-string" > 'lorentz'< / span > )
stewart = initializeStrutDynamics(stewart, < span class = "org-string" > 'type'< / span > , < span class = "org-string" > 'classical'< / span > , < span class = "org-string" > 'K'< / span > , 1e4< span class = "org-type" > *< / span > ones(6,1), < span class = "org-string" > 'C'< / span > , 1e2< span class = "org-type" > *< / span > ones(6,1));
< span class = "org-keyword" > elseif< / span > strcmp(args.actuator, < span class = "org-string" > 'amplified'< / span > )
stewart = initializeStrutDynamics(stewart, < span class = "org-string" > 'type'< / span > , < span class = "org-string" > 'amplified'< / span > , ...
< span class = "org-string" > 'k1'< / span > , args.k1< span class = "org-type" > *< / span > ones(6,1), ...
< span class = "org-string" > 'c1'< / span > , args.c1< span class = "org-type" > *< / span > ones(6,1), ...
< span class = "org-string" > 'ka'< / span > , args.ka< span class = "org-type" > *< / span > ones(6,1), ...
< span class = "org-string" > 'ke'< / span > , args.ke< span class = "org-type" > *< / span > ones(6,1), ...
< span class = "org-string" > 'F_gain'< / span > , args.F_gain< span class = "org-type" > *< / span > ones(6,1));
< span class = "org-keyword" > else< / span >
error(< span class = "org-string" > 'args.actuator should be piezo, lorentz or amplified'< / span > );
< span class = "org-keyword" > end< / span >
2020-05-05 11:38:52 +02:00
< / pre >
< / div >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > stewart = initializeJointDynamics(stewart, ...
2020-11-03 09:45:50 +01:00
< span class = "org-string" > 'type_F'< / span > , args.type_F, ...
< span class = "org-string" > 'type_M'< / span > , args.type_M, ...
< span class = "org-string" > 'Kf_M'< / span > , args.Kf_M, ...
< span class = "org-string" > 'Cf_M'< / span > , args.Cf_M, ...
< span class = "org-string" > 'Kt_M'< / span > , args.Kt_M, ...
< span class = "org-string" > 'Ct_M'< / span > , args.Ct_M, ...
< span class = "org-string" > 'Kf_F'< / span > , args.Kf_F, ...
< span class = "org-string" > 'Cf_F'< / span > , args.Cf_F, ...
< span class = "org-string" > 'Kt_F'< / span > , args.Kt_F, ...
< span class = "org-string" > 'Ct_F'< / span > , args.Ct_F, ...
< span class = "org-string" > 'Ka_F'< / span > , args.Ka_F, ...
< span class = "org-string" > 'Ca_F'< / span > , args.Ca_F, ...
< span class = "org-string" > 'Kr_F'< / span > , args.Kr_F, ...
< span class = "org-string" > 'Cr_F'< / span > , args.Cr_F, ...
< span class = "org-string" > 'Ka_M'< / span > , args.Ka_M, ...
< span class = "org-string" > 'Ca_M'< / span > , args.Ca_M, ...
< span class = "org-string" > 'Kr_M'< / span > , args.Kr_M, ...
< span class = "org-string" > 'Cr_M'< / span > , args.Cr_M);
2020-04-03 18:04:47 +02:00
< / pre >
< / div >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > stewart = initializeCylindricalPlatforms(stewart, < span class = "org-string" > 'Fpm'< / span > , args.Fpm, < span class = "org-string" > 'Fph'< / span > , args.Fph, < span class = "org-string" > 'Fpr'< / span > , args.Fpr, < span class = "org-string" > 'Mpm'< / span > , args.Mpm, < span class = "org-string" > 'Mph'< / span > , args.Mph, < span class = "org-string" > 'Mpr'< / span > , args.Mpr);
2020-05-05 11:38:52 +02:00
2020-11-03 09:45:50 +01:00
stewart = initializeCylindricalStruts(stewart, < span class = "org-string" > 'Fsm'< / span > , args.Fsm, < span class = "org-string" > 'Fsh'< / span > , args.Fsh, < span class = "org-string" > 'Fsr'< / span > , args.Fsr, < span class = "org-string" > 'Msm'< / span > , args.Msm, < span class = "org-string" > 'Msh'< / span > , args.Msh, < span class = "org-string" > 'Msr'< / span > , args.Msr);
2020-05-05 11:38:52 +02:00
stewart = computeJacobian(stewart);
2020-11-03 09:45:50 +01:00
stewart = initializeStewartPose(stewart, < span class = "org-string" > 'AP'< / span > , args.AP, < span class = "org-string" > 'ARB'< / span > , args.ARB);
2020-04-03 18:04:47 +02:00
< / pre >
< / div >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > stewart = initializeInertialSensor(stewart, < span class = "org-string" > 'type'< / span > , < span class = "org-string" > 'accelerometer'< / span > );
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2019-12-11 17:09:32 +01:00
2020-04-01 16:17:26 +02:00
< p >
Equilibrium position of the each joint.
< / p >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-04-01 16:17:26 +02:00
< pre class = "src src-matlab" >
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > if< / span > args.Foffset < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'none'< / span > ) < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'rigid'< / span > ) < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'init'< / span > )
load(< span class = "org-string" > 'mat/Foffset.mat'< / span > , < span class = "org-string" > 'Fnm'< / span > );
stewart.actuators.dLeq = < span class = "org-type" > -< / span > Fnm< span class = "org-type" > './< / span > stewart.Ki;
< span class = "org-keyword" > else< / span >
2020-05-05 11:38:52 +02:00
stewart.actuators.dLeq = args.dLeq;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org642309a" class = "outline-3" >
< h3 id = "org642309a" > Add Type< / h3 >
< div class = "outline-text-3" id = "text-org642309a" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > switch< / span > < span class = "org-constant" > args.type< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'none'< / span >
2020-05-05 11:38:52 +02:00
stewart.type = 0;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'rigid'< / span >
2020-05-05 11:38:52 +02:00
stewart.type = 1;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'flexible'< / span >
2020-05-05 11:38:52 +02:00
stewart.type = 2;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'init'< / span >
2020-05-05 11:38:52 +02:00
stewart.type = 4;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgb487e26" class = "outline-3" >
< h3 id = "orgb487e26" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-orgb487e26" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > nano_hexapod = stewart;
2020-11-03 09:45:50 +01:00
save(< span class = "org-string" > './mat/stages.mat'< / span > , < span class = "org-string" > 'nano_hexapod'< / span > , < span class = "org-string" > '-append'< / span > );
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-02-25 18:10:20 +01:00
< 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" >
2020-02-03 17:50:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
< a id = "org9f0d804" > < / a >
2020-02-03 17:50:32 +01:00
< / p >
< / div >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgb84662c" class = "outline-3" >
< h3 id = "orgb84662c" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-orgb84662c" >
2020-02-03 17:50:32 +01:00
< 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 >
2019-12-11 17:09:32 +01:00
2020-02-25 18:10:20 +01:00
< div id = "org4bf20ba" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2020-02-25 18:10:20 +01:00
< div id = "orgfaf9137" class = "figure" >
2020-02-03 17:50:32 +01:00
< 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 >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org677c762" class = "outline-3" >
< h3 id = "org677c762" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org677c762" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > function< / span > < span class = "org-variable-name" > [sample]< / span > = < span class = "org-function-name" > initializeSample< / span > (< span class = "org-variable-name" > args< / span > )
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org682b4fa" class = "outline-3" >
< h3 id = "org682b4fa" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org682b4fa" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-11-03 09:45:50 +01:00
args.type char {mustBeMember(args.type,{< span class = "org-string" > 'rigid'< / span > , < span class = "org-string" > 'flexible'< / span > , < span class = "org-string" > 'none'< / span > , < span class = "org-string" > 'init'< / span > })} = < span class = "org-string" > 'flexible'< / span >
args.radius (1,1) double {mustBeNumeric, mustBePositive} = 0.1 < span class = "org-comment" > % [m]< / span >
args.height (1,1) double {mustBeNumeric, mustBePositive} = 0.3 < span class = "org-comment" > % [m]< / span >
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 50 < span class = "org-comment" > % [kg]< / span >
args.freq (6,1) double {mustBeNumeric, mustBePositive} = 100< span class = "org-type" > *< / span > ones(6,1) < span class = "org-comment" > % [Hz]< / span >
args.offset (1,1) double {mustBeNumeric} = 0 < span class = "org-comment" > % [m]< / span >
args.Foffset logical {mustBeNumericOrLogical} = < span class = "org-constant" > false< / span >
< span class = "org-keyword" > end< / span >
2019-12-11 17:09:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgb23c303" class = "outline-3" >
< h3 id = "orgb23c303" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-orgb23c303" >
2020-02-03 17:50:32 +01:00
< p >
First, we initialize the < code > sample< / code > structure.
< / p >
< div class = "org-src-container" >
< pre class = "src src-matlab" > sample = struct();
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / 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" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > switch< / span > < span class = "org-constant" > args.type< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'none'< / span >
2020-02-25 18:10:20 +01:00
sample.type = 0;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'rigid'< / span >
2020-02-25 18:10:20 +01:00
sample.type = 1;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'flexible'< / span >
2020-02-25 18:10:20 +01:00
sample.type = 2;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'init'< / span >
2020-02-25 18:10:20 +01:00
sample.type = 3;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org2b97ba9" class = "outline-3" >
< h3 id = "org2b97ba9" > Material and Geometry< / h3 >
< div class = "outline-text-3" id = "text-org2b97ba9" >
2020-02-03 17:50:32 +01:00
< p >
We define the geometrical parameters of the sample as well as its mass and position.
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > sample.radius = args.radius; < span class = "org-comment" > % [m]< / span >
sample.height = args.height; < span class = "org-comment" > % [m]< / span >
sample.mass = args.mass; < span class = "org-comment" > % [kg]< / span >
sample.offset = args.offset; < span class = "org-comment" > % [m]< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2020-04-01 16:17:26 +02:00
< div id = "outline-container-org228453f" class = "outline-3" >
< h3 id = "org228453f" > Compute the Inertia< / h3 >
< div class = "outline-text-3" id = "text-org228453f" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > sample.inertia = [1< span class = "org-type" > /< / span > 12 < span class = "org-type" > *< / span > sample.mass < span class = "org-type" > *< / span > (3< span class = "org-type" > *< / span > sample.radius< span class = "org-type" > ^< / span > 2 < span class = "org-type" > +< / span > sample.height< span class = "org-type" > ^< / span > 2); ...
1< span class = "org-type" > /< / span > 12 < span class = "org-type" > *< / span > sample.mass < span class = "org-type" > *< / span > (3< span class = "org-type" > *< / span > sample.radius< span class = "org-type" > ^< / span > 2 < span class = "org-type" > +< / span > sample.height< span class = "org-type" > ^< / span > 2); ...
1< span class = "org-type" > /< / span > 2 < span class = "org-type" > *< / span > sample.mass < span class = "org-type" > *< / span > sample.radius< span class = "org-type" > ^< / span > 2];
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org935d94f" class = "outline-3" >
< h3 id = "org935d94f" > Stiffness and Damping properties< / h3 >
< div class = "outline-text-3" id = "text-org935d94f" >
2020-04-01 16:17:26 +02:00
< 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" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > sample.K(1< span class = "org-type" > :< / span > 3) = sample.mass < span class = "org-type" > .*< / span > (2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > *< / span > args.freq(1< span class = "org-type" > :< / span > 3))< span class = "org-type" > .^< / span > 2; < span class = "org-comment" > % [N/m]< / span >
sample.C(1< span class = "org-type" > :< / span > 3) = 0.1 < span class = "org-type" > *< / span > sqrt(sample.K(1< span class = "org-type" > :< / span > 3)< span class = "org-type" > *< / span > sample.mass); < span class = "org-comment" > % [N/(m/s)]< / span >
2020-04-01 16:17:26 +02:00
< / pre >
< / div >
< p >
Rotational Stiffness and Damping:
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > sample.K(4< span class = "org-type" > :< / span > 6) = sample.inertia < span class = "org-type" > .*< / span > (2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > *< / span > args.freq(4< span class = "org-type" > :< / span > 6))< span class = "org-type" > .^< / span > 2; < span class = "org-comment" > % [N/m]< / span >
sample.C(4< span class = "org-type" > :< / span > 6) = 0.1 < span class = "org-type" > *< / span > sqrt(sample.K(4< span class = "org-type" > :< / span > 6)< span class = "org-type" > .*< / span > sample.inertia); < span class = "org-comment" > % [N/(m/s)]< / span >
2020-04-01 16:17:26 +02:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orga761bca" class = "outline-3" >
< h3 id = "orga761bca" > Equilibrium position of the each joint.< / h3 >
< div class = "outline-text-3" id = "text-orga761bca" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > if< / span > args.Foffset < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'none'< / span > ) < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'rigid'< / span > ) < span class = "org-type" > & & < / span > < span class = "org-type" > ~< / span > strcmp(args.type, < span class = "org-string" > 'init'< / span > )
load(< span class = "org-string" > 'mat/Foffset.mat'< / span > , < span class = "org-string" > 'Fsm'< / span > );
sample.Deq = < span class = "org-type" > -< / span > Fsm< span class = "org-type" > './< / span > sample.K;
< span class = "org-keyword" > else< / span >
2020-04-01 16:17:26 +02:00
sample.Deq = zeros(6,1);
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgbf05a0d" class = "outline-3" >
< h3 id = "orgbf05a0d" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-orgbf05a0d" >
2019-12-11 17:09:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
The < code > sample< / code > structure is saved.
2019-12-11 17:09:32 +01:00
< / p >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > save(< span class = "org-string" > './mat/stages.mat'< / span > , < span class = "org-string" > 'sample'< / span > , < span class = "org-string" > '-append'< / span > );
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-02-25 18:10:20 +01:00
< 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" >
2019-12-11 17:09:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
< a id = "orgd0062b9" > < / a >
2019-12-11 17:09:32 +01:00
< / p >
2020-02-25 18:10:20 +01:00
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org5e84eb6" class = "outline-3" >
< h3 id = "org5e84eb6" > Function Declaration and Documentation< / h3 >
< div class = "outline-text-3" id = "text-org5e84eb6" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > function< / span > < span class = "org-variable-name" > []< / span > = < span class = "org-function-name" > initializeController< / span > (< span class = "org-variable-name" > args< / span > )
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org45ea01b" class = "outline-3" >
< h3 id = "org45ea01b" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org45ea01b" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-11-03 09:45:50 +01:00
args.type char {mustBeMember(args.type,{< span class = "org-string" > 'open-loop'< / span > , < span class = "org-string" > 'iff'< / span > , < span class = "org-string" > 'dvf'< / span > , < span class = "org-string" > 'hac-dvf'< / span > , < span class = "org-string" > 'ref-track-L'< / span > , < span class = "org-string" > 'ref-track-iff-L'< / span > , < span class = "org-string" > 'cascade-hac-lac'< / span > , < span class = "org-string" > 'hac-iff'< / span > , < span class = "org-string" > 'stabilizing'< / span > })} = < span class = "org-string" > 'open-loop'< / span >
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orge048df4" class = "outline-3" >
< h3 id = "orge048df4" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-orge048df4" >
2020-02-03 17:50:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
First, we initialize the < code > controller< / code > structure.
2020-02-03 17:50:32 +01:00
< / p >
2019-12-11 17:09:32 +01:00
< div class = "org-src-container" >
2020-02-25 18:10:20 +01:00
< 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" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > switch< / span > < span class = "org-constant" > args.type< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'open-loop'< / span >
2020-02-25 18:10:20 +01:00
controller.type = 1;
2020-11-03 09:45:50 +01:00
controller.name = < span class = "org-string" > 'Open-Loop'< / span > ;
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'dvf'< / span >
2020-02-25 18:10:20 +01:00
controller.type = 2;
2020-11-03 09:45:50 +01:00
controller.name = < span class = "org-string" > 'Decentralized Direct Velocity Feedback'< / span > ;
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'iff'< / span >
2020-02-25 18:10:20 +01:00
controller.type = 3;
2020-11-03 09:45:50 +01:00
controller.name = < span class = "org-string" > 'Decentralized Integral Force Feedback'< / span > ;
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'hac-dvf'< / span >
2020-03-13 17:40:22 +01:00
controller.type = 4;
2020-11-03 09:45:50 +01:00
controller.name = < span class = "org-string" > 'HAC-DVF'< / span > ;
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'ref-track-L'< / span >
2020-03-23 10:05:32 +01:00
controller.type = 5;
2020-11-03 09:45:50 +01:00
controller.name = < span class = "org-string" > 'Reference Tracking in the frame of the legs'< / span > ;
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'ref-track-iff-L'< / span >
2020-03-23 10:05:32 +01:00
controller.type = 6;
2020-11-03 09:45:50 +01:00
controller.name = < span class = "org-string" > 'Reference Tracking in the frame of the legs + IFF'< / span > ;
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'cascade-hac-lac'< / span >
2020-03-23 10:05:32 +01:00
controller.type = 7;
2020-11-03 09:45:50 +01:00
controller.name = < span class = "org-string" > 'Cascade Control + HAC-LAC'< / span > ;
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'hac-iff'< / span >
2020-03-25 19:23:22 +01:00
controller.type = 8;
2020-11-03 09:45:50 +01:00
controller.name = < span class = "org-string" > 'HAC-IFF'< / span > ;
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'stabilizing'< / span >
2020-04-03 18:04:47 +02:00
controller.type = 9;
2020-11-03 09:45:50 +01:00
controller.name = < span class = "org-string" > 'Stabilizing Controller'< / span > ;
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org30cfbaa" class = "outline-3" >
< h3 id = "org30cfbaa" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org30cfbaa" >
2020-02-03 17:50:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
The < code > controller< / code > structure is saved.
2020-02-03 17:50:32 +01:00
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > save(< span class = "org-string" > './mat/controller.mat'< / span > , < span class = "org-string" > 'controller'< / span > );
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2020-02-25 18:10:20 +01:00
< 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" >
2020-02-03 17:50:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
< a id = "org5ace526" > < / a >
2020-02-03 17:50:32 +01:00
< / p >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org8ba86fb" class = "outline-3" >
< h3 id = "org8ba86fb" > Function Declaration and Documentation< / h3 >
< div class = "outline-text-3" id = "text-org8ba86fb" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > function< / span > < span class = "org-variable-name" > [ref]< / span > = < span class = "org-function-name" > initializeReferences< / span > (< span class = "org-variable-name" > args< / span > )
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org0aeaea4" class = "outline-3" >
< h3 id = "org0aeaea4" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org0aeaea4" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Sampling Frequency [s]< / span >
args.Ts (1,1) double {mustBeNumeric, mustBePositive} = 1e< span class = "org-type" > -< / span > 3
< span class = "org-comment" > % Maximum simulation time [s]< / span >
2020-02-03 17:50:32 +01:00
args.Tmax (1,1) double {mustBeNumeric, mustBePositive} = 100
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Either "constant" / "triangular" / "sinusoidal"< / span >
args.Dy_type char {mustBeMember(args.Dy_type,{< span class = "org-string" > 'constant'< / span > , < span class = "org-string" > 'triangular'< / span > , < span class = "org-string" > 'sinusoidal'< / span > })} = < span class = "org-string" > 'constant'< / span >
< span class = "org-comment" > % Amplitude of the displacement [m]< / span >
2020-02-03 17:50:32 +01:00
args.Dy_amplitude (1,1) double {mustBeNumeric} = 0
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Period of the displacement [s]< / span >
2020-02-03 17:50:32 +01:00
args.Dy_period (1,1) double {mustBeNumeric, mustBePositive} = 1
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Either "constant" / "triangular" / "sinusoidal"< / span >
args.Ry_type char {mustBeMember(args.Ry_type,{< span class = "org-string" > 'constant'< / span > , < span class = "org-string" > 'triangular'< / span > , < span class = "org-string" > 'sinusoidal'< / span > })} = < span class = "org-string" > 'constant'< / span >
< span class = "org-comment" > % Amplitude [rad]< / span >
2020-02-03 17:50:32 +01:00
args.Ry_amplitude (1,1) double {mustBeNumeric} = 0
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Period of the displacement [s]< / span >
2020-02-03 17:50:32 +01:00
args.Ry_period (1,1) double {mustBeNumeric, mustBePositive} = 1
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Either "constant" / "rotating"< / span >
args.Rz_type char {mustBeMember(args.Rz_type,{< span class = "org-string" > 'constant'< / span > , < span class = "org-string" > 'rotating'< / span > , < span class = "org-string" > 'rotating-not-filtered'< / span > })} = < span class = "org-string" > 'constant'< / span >
< span class = "org-comment" > % Initial angle [rad]< / span >
2020-02-03 17:50:32 +01:00
args.Rz_amplitude (1,1) double {mustBeNumeric} = 0
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Period of the rotating [s]< / span >
2020-02-03 17:50:32 +01:00
args.Rz_period (1,1) double {mustBeNumeric, mustBePositive} = 1
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % For now, only constant is implemented< / span >
args.Dh_type char {mustBeMember(args.Dh_type,{< span class = "org-string" > 'constant'< / span > })} = < span class = "org-string" > 'constant'< / span >
< span class = "org-comment" > % Initial position [m,m,m,rad,rad,rad] of the top platform (Pitch-Roll-Yaw Euler angles)< / span >
2020-02-03 17:50:32 +01:00
args.Dh_pos (6,1) double {mustBeNumeric} = zeros(6, 1), ...
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % For now, only constant is implemented< / span >
args.Rm_type char {mustBeMember(args.Rm_type,{< span class = "org-string" > 'constant'< / span > })} = < span class = "org-string" > 'constant'< / span >
< span class = "org-comment" > % Initial position of the two masses< / span >
args.Rm_pos (2,1) double {mustBeNumeric} = [0; < span class = "org-constant" > pi< / span > ]
< span class = "org-comment" > % For now, only constant is implemented< / span >
args.Dn_type char {mustBeMember(args.Dn_type,{< span class = "org-string" > 'constant'< / span > })} = < span class = "org-string" > 'constant'< / span >
< span class = "org-comment" > % Initial position [m,m,m,rad,rad,rad] of the top platform< / span >
2020-02-03 17:50:32 +01:00
args.Dn_pos (6,1) double {mustBeNumeric} = zeros(6,1)
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-02-25 18:10:20 +01:00
< div id = "outline-container-orge94c0c2" class = "outline-3" >
< h3 id = "orge94c0c2" > Initialize Parameters< / h3 >
< div class = "outline-text-3" id = "text-orge94c0c2" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-matlab-cellbreak" > < span class = "org-comment" > %% Set Sampling Time< / span > < / span >
2020-02-03 17:50:32 +01:00
Ts = args.Ts;
Tmax = args.Tmax;
2020-11-03 09:45:50 +01:00
< span class = "org-matlab-cellbreak" > < span class = "org-comment" > %% Low Pass Filter to filter out the references< / span > < / span >
s = zpk(< span class = "org-string" > 's'< / span > );
w0 = 2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > *< / span > 10;
2020-02-03 17:50:32 +01:00
xi = 1;
2020-11-03 09:45:50 +01:00
H_lpf = 1< span class = "org-type" > /< / span > (1 < span class = "org-type" > +< / span > 2< span class = "org-type" > *< / span > xi< span class = "org-type" > /< / span > w0< span class = "org-type" > *< / span > s < span class = "org-type" > +< / span > s< span class = "org-type" > ^< / span > 2< span class = "org-type" > /< / span > w0< span class = "org-type" > ^< / span > 2);
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgae1f7d8" class = "outline-3" >
< h3 id = "orgae1f7d8" > Translation Stage< / h3 >
< div class = "outline-text-3" id = "text-orgae1f7d8" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-matlab-cellbreak" > < span class = "org-comment" > %% Translation stage - Dy< / span > < / span >
t = 0< span class = "org-type" > :< / span > Ts< span class = "org-type" > :< / span > Tmax; < span class = "org-comment" > % Time Vector [s]< / span >
2020-02-03 17:50:32 +01:00
Dy = zeros(length(t), 1);
Dyd = zeros(length(t), 1);
Dydd = zeros(length(t), 1);
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > switch< / span > < span class = "org-constant" > args.Dy_type< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'constant'< / span >
Dy< span class = "org-type" > (:) < / span > = args.Dy_amplitude;
Dyd< span class = "org-type" > (:) < / span > = 0;
Dydd< span class = "org-type" > (:) < / span > = 0;
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'triangular'< / span >
< span class = "org-comment" > % This is done to unsure that we start with no displacement< / span >
Dy_raw = args.Dy_amplitude< span class = "org-type" > *< / span > sawtooth(2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > *< / span > t< span class = "org-type" > /< / span > args.Dy_period,1< span class = "org-type" > /< / span > 2);
i0 = find(t< span class = "org-type" > > =< / span > args.Dy_period< span class = "org-type" > /< / span > 4,1);
Dy(1< span class = "org-type" > :< / span > end< span class = "org-type" > -< / span > i0< span class = "org-type" > +< / span > 1) = Dy_raw(i0< span class = "org-type" > :< / span > end);
Dy(end< span class = "org-type" > -< / span > i0< span class = "org-type" > +< / span > 2< span class = "org-type" > :< / span > end) = Dy_raw(end); < span class = "org-comment" > % we fix the last value< / span >
< span class = "org-comment" > % The signal is filtered out< / span >
2020-02-03 17:50:32 +01:00
Dy = lsim(H_lpf, Dy, t);
2020-11-03 09:45:50 +01:00
Dyd = lsim(H_lpf< span class = "org-type" > *< / span > s, Dy, t);
Dydd = lsim(H_lpf< span class = "org-type" > *< / span > s< span class = "org-type" > ^< / span > 2, Dy, t);
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'sinusoidal'< / span >
Dy< span class = "org-type" > (:) < / span > = args.Dy_amplitude< span class = "org-type" > *< / span > sin(2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > /< / span > args.Dy_period< span class = "org-type" > *< / span > t);
Dyd = args.Dy_amplitude< span class = "org-type" > *< / span > 2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > /< / span > args.Dy_period< span class = "org-type" > *< / span > cos(2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > /< / span > args.Dy_period< span class = "org-type" > *< / span > t);
Dydd = < span class = "org-type" > -< / span > args.Dy_amplitude< span class = "org-type" > *< / span > (2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > /< / span > args.Dy_period)< span class = "org-type" > ^< / span > 2< span class = "org-type" > *< / span > sin(2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > /< / span > args.Dy_period< span class = "org-type" > *< / span > t);
< span class = "org-keyword" > otherwise< / span >
warning(< span class = "org-string" > 'Dy_type is not set correctly'< / span > );
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
Dy = struct(< span class = "org-string" > 'time'< / span > , t, < span class = "org-string" > 'signals'< / span > , struct(< span class = "org-string" > 'values'< / span > , Dy), < span class = "org-string" > 'deriv'< / span > , Dyd, < span class = "org-string" > 'dderiv'< / span > , Dydd);
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org9712ae2" class = "outline-3" >
< h3 id = "org9712ae2" > Tilt Stage< / h3 >
< div class = "outline-text-3" id = "text-org9712ae2" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-matlab-cellbreak" > < span class = "org-comment" > %% Tilt Stage - Ry< / span > < / span >
t = 0< span class = "org-type" > :< / span > Ts< span class = "org-type" > :< / span > Tmax; < span class = "org-comment" > % Time Vector [s]< / span >
2020-02-03 17:50:32 +01:00
Ry = zeros(length(t), 1);
Ryd = zeros(length(t), 1);
Rydd = zeros(length(t), 1);
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > switch< / span > < span class = "org-constant" > args.Ry_type< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'constant'< / span >
Ry< span class = "org-type" > (:) < / span > = args.Ry_amplitude;
Ryd< span class = "org-type" > (:) < / span > = 0;
Rydd< span class = "org-type" > (:) < / span > = 0;
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'triangular'< / span >
Ry_raw = args.Ry_amplitude< span class = "org-type" > *< / span > sawtooth(2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > *< / span > t< span class = "org-type" > /< / span > args.Ry_period,1< span class = "org-type" > /< / span > 2);
i0 = find(t< span class = "org-type" > > =< / span > args.Ry_period< span class = "org-type" > /< / span > 4,1);
Ry(1< span class = "org-type" > :< / span > end< span class = "org-type" > -< / span > i0< span class = "org-type" > +< / span > 1) = Ry_raw(i0< span class = "org-type" > :< / span > end);
Ry(end< span class = "org-type" > -< / span > i0< span class = "org-type" > +< / span > 2< span class = "org-type" > :< / span > end) = Ry_raw(end); < span class = "org-comment" > % we fix the last value< / span >
< span class = "org-comment" > % The signal is filtered out< / span >
2020-02-03 17:50:32 +01:00
Ry = lsim(H_lpf, Ry, t);
2020-11-03 09:45:50 +01:00
Ryd = lsim(H_lpf< span class = "org-type" > *< / span > s, Ry, t);
Rydd = lsim(H_lpf< span class = "org-type" > *< / span > s< span class = "org-type" > ^< / span > 2, Ry, t);
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'sinusoidal'< / span >
Ry< span class = "org-type" > (:) < / span > = args.Ry_amplitude< span class = "org-type" > *< / span > sin(2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > /< / span > args.Ry_period< span class = "org-type" > *< / span > t);
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
Ryd = args.Ry_amplitude< span class = "org-type" > *< / span > 2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > /< / span > args.Ry_period< span class = "org-type" > *< / span > cos(2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > /< / span > args.Ry_period< span class = "org-type" > *< / span > t);
Rydd = < span class = "org-type" > -< / span > args.Ry_amplitude< span class = "org-type" > *< / span > (2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > /< / span > args.Ry_period)< span class = "org-type" > ^< / span > 2< span class = "org-type" > *< / span > sin(2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > /< / span > args.Ry_period< span class = "org-type" > *< / span > t);
< span class = "org-keyword" > otherwise< / span >
warning(< span class = "org-string" > 'Ry_type is not set correctly'< / span > );
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
Ry = struct(< span class = "org-string" > 'time'< / span > , t, < span class = "org-string" > 'signals'< / span > , struct(< span class = "org-string" > 'values'< / span > , Ry), < span class = "org-string" > 'deriv'< / span > , Ryd, < span class = "org-string" > 'dderiv'< / span > , Rydd);
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org000e2fe" class = "outline-3" >
< h3 id = "org000e2fe" > Spindle< / h3 >
< div class = "outline-text-3" id = "text-org000e2fe" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-matlab-cellbreak" > < span class = "org-comment" > %% Spindle - Rz< / span > < / span >
t = 0< span class = "org-type" > :< / span > Ts< span class = "org-type" > :< / span > Tmax; < span class = "org-comment" > % Time Vector [s]< / span >
2020-02-03 17:50:32 +01:00
Rz = zeros(length(t), 1);
Rzd = zeros(length(t), 1);
Rzdd = zeros(length(t), 1);
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > switch< / span > < span class = "org-constant" > args.Rz_type< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'constant'< / span >
Rz< span class = "org-type" > (:) < / span > = args.Rz_amplitude;
Rzd< span class = "org-type" > (:) < / span > = 0;
Rzdd< span class = "org-type" > (:) < / span > = 0;
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'rotating-not-filtered'< / span >
Rz< span class = "org-type" > (:) < / span > = 2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > /< / span > args.Rz_period< span class = "org-type" > *< / span > t;
2020-04-03 18:04:47 +02:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % The signal is filtered out< / span >
Rz< span class = "org-type" > (:) < / span > = 2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > /< / span > args.Rz_period< span class = "org-type" > *< / span > t;
Rzd< span class = "org-type" > (:) < / span > = 2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > /< / span > args.Rz_period;
Rzdd< span class = "org-type" > (:) < / span > = 0;
2020-04-03 18:04:47 +02:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % We add the angle offset< / span >
Rz = Rz < span class = "org-type" > +< / span > args.Rz_amplitude;
2020-04-03 18:04:47 +02:00
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'rotating'< / span >
Rz< span class = "org-type" > (:) < / span > = 2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > /< / span > args.Rz_period< span class = "org-type" > *< / span > t;
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % The signal is filtered out< / span >
2020-02-03 17:50:32 +01:00
Rz = lsim(H_lpf, Rz, t);
2020-11-03 09:45:50 +01:00
Rzd = lsim(H_lpf< span class = "org-type" > *< / span > s, Rz, t);
Rzdd = lsim(H_lpf< span class = "org-type" > *< / span > s< span class = "org-type" > ^< / span > 2, Rz, t);
2020-02-25 18:10:20 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % We add the angle offset< / span >
Rz = Rz < span class = "org-type" > +< / span > args.Rz_amplitude;
< span class = "org-keyword" > otherwise< / span >
warning(< span class = "org-string" > 'Rz_type is not set correctly'< / span > );
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
Rz = struct(< span class = "org-string" > 'time'< / span > , t, < span class = "org-string" > 'signals'< / span > , struct(< span class = "org-string" > 'values'< / span > , Rz), < span class = "org-string" > 'deriv'< / span > , Rzd, < span class = "org-string" > 'dderiv'< / span > , Rzdd);
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org59c3861" class = "outline-3" >
< h3 id = "org59c3861" > Micro Hexapod< / h3 >
< div class = "outline-text-3" id = "text-org59c3861" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-matlab-cellbreak" > < span class = "org-comment" > %% Micro-Hexapod< / span > < / span >
2020-02-03 17:50:32 +01:00
t = [0, Ts];
Dh = zeros(length(t), 6);
Dhl = zeros(length(t), 6);
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > switch< / span > < span class = "org-constant" > args.Dh_type< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'constant'< / span >
2020-02-03 17:50:32 +01:00
Dh = [args.Dh_pos, args.Dh_pos];
2020-11-03 09:45:50 +01:00
load(< span class = "org-string" > 'mat/stages.mat'< / span > , < span class = "org-string" > 'micro_hexapod'< / span > );
2020-02-03 17:50:32 +01:00
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);
2020-11-03 09:45:50 +01:00
ARB = [cos(tz) < span class = "org-type" > -< / span > sin(tz) 0;
2020-02-03 17:50:32 +01:00
sin(tz) cos(tz) 0;
2020-11-03 09:45:50 +01:00
0 0 1]< span class = "org-type" > *< / span > ...
2020-02-03 17:50:32 +01:00
[ cos(ty) 0 sin(ty);
0 1 0;
2020-11-03 09:45:50 +01:00
< span class = "org-type" > -< / span > sin(ty) 0 cos(ty)]< span class = "org-type" > *< / span > ...
2020-02-03 17:50:32 +01:00
[1 0 0;
2020-11-03 09:45:50 +01:00
0 cos(tx) < span class = "org-type" > -< / span > sin(tx);
2020-02-03 17:50:32 +01:00
0 sin(tx) cos(tx)];
2020-11-03 09:45:50 +01:00
[< span class = "org-type" > ~< / span > , Dhl] = inverseKinematics(micro_hexapod, < span class = "org-string" > 'AP'< / span > , AP, < span class = "org-string" > 'ARB'< / span > , ARB);
2020-02-03 17:50:32 +01:00
Dhl = [Dhl, Dhl];
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > otherwise< / span >
warning(< span class = "org-string" > 'Dh_type is not set correctly'< / span > );
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
Dh = struct(< span class = "org-string" > 'time'< / span > , t, < span class = "org-string" > 'signals'< / span > , struct(< span class = "org-string" > 'values'< / span > , Dh));
Dhl = struct(< span class = "org-string" > 'time'< / span > , t, < span class = "org-string" > 'signals'< / span > , struct(< span class = "org-string" > 'values'< / span > , Dhl));
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-02-25 18:10:20 +01:00
< div id = "outline-container-org04d73dc" class = "outline-3" >
< h3 id = "org04d73dc" > Axis Compensation< / h3 >
< div class = "outline-text-3" id = "text-org04d73dc" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-matlab-cellbreak" > < span class = "org-comment" > %% Axis Compensation - Rm< / span > < / span >
2020-02-03 17:50:32 +01:00
t = [0, Ts];
2019-12-11 17:09:32 +01:00
2020-02-03 17:50:32 +01:00
Rm = [args.Rm_pos, args.Rm_pos];
2020-11-03 09:45:50 +01:00
Rm = struct(< span class = "org-string" > 'time'< / span > , t, < span class = "org-string" > 'signals'< / span > , struct(< span class = "org-string" > 'values'< / span > , Rm));
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org6407ca0" class = "outline-3" >
< h3 id = "org6407ca0" > Nano Hexapod< / h3 >
< div class = "outline-text-3" id = "text-org6407ca0" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-matlab-cellbreak" > < span class = "org-comment" > %% Nano-Hexapod< / span > < / span >
2020-02-03 17:50:32 +01:00
t = [0, Ts];
Dn = zeros(length(t), 6);
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > switch< / span > < span class = "org-constant" > args.Dn_type< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > 'constant'< / span >
2020-02-03 17:50:32 +01:00
Dn = [args.Dn_pos, args.Dn_pos];
2020-02-25 18:10:20 +01:00
2020-11-03 09:45:50 +01:00
load(< span class = "org-string" > 'mat/stages.mat'< / span > , < span class = "org-string" > 'nano_hexapod'< / span > );
2020-02-25 18:10:20 +01:00
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);
2020-11-03 09:45:50 +01:00
ARB = [cos(tz) < span class = "org-type" > -< / span > sin(tz) 0;
2020-02-25 18:10:20 +01:00
sin(tz) cos(tz) 0;
2020-11-03 09:45:50 +01:00
0 0 1]< span class = "org-type" > *< / span > ...
2020-02-25 18:10:20 +01:00
[ cos(ty) 0 sin(ty);
0 1 0;
2020-11-03 09:45:50 +01:00
< span class = "org-type" > -< / span > sin(ty) 0 cos(ty)]< span class = "org-type" > *< / span > ...
2020-02-25 18:10:20 +01:00
[1 0 0;
2020-11-03 09:45:50 +01:00
0 cos(tx) < span class = "org-type" > -< / span > sin(tx);
2020-02-25 18:10:20 +01:00
0 sin(tx) cos(tx)];
2020-11-03 09:45:50 +01:00
[< span class = "org-type" > ~< / span > , Dnl] = inverseKinematics(nano_hexapod, < span class = "org-string" > 'AP'< / span > , AP, < span class = "org-string" > 'ARB'< / span > , ARB);
2020-02-25 18:10:20 +01:00
Dnl = [Dnl, Dnl];
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > otherwise< / span >
warning(< span class = "org-string" > 'Dn_type is not set correctly'< / span > );
< span class = "org-keyword" > end< / span >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
Dn = struct(< span class = "org-string" > 'time'< / span > , t, < span class = "org-string" > 'signals'< / span > , struct(< span class = "org-string" > 'values'< / span > , Dn));
Dnl = struct(< span class = "org-string" > 'time'< / span > , t, < span class = "org-string" > 'signals'< / span > , struct(< span class = "org-string" > 'values'< / span > , Dnl));
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orge5d3d7b" class = "outline-3" >
< h3 id = "orge5d3d7b" > Save< / h3 >
< div class = "outline-text-3" id = "text-orge5d3d7b" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-matlab-cellbreak" > < span class = "org-comment" > %% Save< / span > < / span >
save(< span class = "org-string" > './mat/nass_references.mat'< / span > , < span class = "org-string" > 'Dy'< / span > , < span class = "org-string" > 'Ry'< / span > , < span class = "org-string" > 'Rz'< / span > , < span class = "org-string" > 'Dh'< / span > , < span class = "org-string" > 'Dhl'< / span > , < span class = "org-string" > 'Rm'< / span > , < span class = "org-string" > 'Dn'< / span > , < span class = "org-string" > 'Dnl'< / span > , < span class = "org-string" > 'args'< / span > , < span class = "org-string" > 'Ts'< / span > );
< span class = "org-keyword" > end< / span >
2019-12-11 17:09:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-02-03 17:50:32 +01:00
< / div >
2019-12-11 17:09:32 +01:00
2020-02-25 18:10:20 +01:00
< 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" >
2019-12-11 17:09:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
< a id = "org199c5f8" > < / a >
2019-12-11 17:09:32 +01:00
< / p >
2020-02-03 17:50:32 +01:00
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orga6a780c" class = "outline-3" >
< h3 id = "orga6a780c" > Function Declaration and Documentation< / h3 >
< div class = "outline-text-3" id = "text-orga6a780c" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > function< / span > < span class = "org-variable-name" > []< / span > = < span class = "org-function-name" > initializeDisturbances< / span > (< span class = "org-variable-name" > args< / span > )
< span class = "org-comment" > % initializeDisturbances - Initialize the disturbances< / span >
< span class = "org-comment" > %< / span >
< span class = "org-comment" > % Syntax: [] = initializeDisturbances(args)< / span >
< span class = "org-comment" > %< / span >
< span class = "org-comment" > % Inputs:< / span >
< span class = "org-comment" > % - args -< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgff4e994" class = "outline-3" >
< h3 id = "orgff4e994" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-orgff4e994" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-11-03 09:45:50 +01:00
< span class = "org-comment" > % Global parameter to enable or disable the disturbances< / span >
args.enable logical {mustBeNumericOrLogical} = < span class = "org-constant" > true< / span >
< span class = "org-comment" > % Ground Motion - X direction< / span >
args.Dwx logical {mustBeNumericOrLogical} = < span class = "org-constant" > true< / span >
< span class = "org-comment" > % Ground Motion - Y direction< / span >
args.Dwy logical {mustBeNumericOrLogical} = < span class = "org-constant" > true< / span >
< span class = "org-comment" > % Ground Motion - Z direction< / span >
args.Dwz logical {mustBeNumericOrLogical} = < span class = "org-constant" > true< / span >
< span class = "org-comment" > % Translation Stage - X direction< / span >
args.Fty_x logical {mustBeNumericOrLogical} = < span class = "org-constant" > true< / span >
< span class = "org-comment" > % Translation Stage - Z direction< / span >
args.Fty_z logical {mustBeNumericOrLogical} = < span class = "org-constant" > true< / span >
< span class = "org-comment" > % Spindle - Z direction< / span >
args.Frz_z logical {mustBeNumericOrLogical} = < span class = "org-constant" > true< / span >
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-02-25 18:10:20 +01:00
< div id = "outline-container-orgf744aeb" class = "outline-3" >
< h3 id = "orgf744aeb" > Load Data< / h3 >
< div class = "outline-text-3" id = "text-orgf744aeb" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > load(< span class = "org-string" > './mat/dist_psd.mat'< / span > , < span class = "org-string" > 'dist_f'< / span > );
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2019-12-11 17:09:32 +01:00
< p >
2020-02-03 17:50:32 +01:00
We remove the first frequency point that usually is very large.
< / p >
< / div >
< / div >
2020-02-25 18:10:20 +01:00
< div id = "outline-container-org6c7d666" class = "outline-3" >
< h3 id = "org6c7d666" > Parameters< / h3 >
< div class = "outline-text-3" id = "text-org6c7d666" >
2020-02-03 17:50:32 +01:00
< p >
We define some parameters that will be used in the algorithm.
2019-12-11 17:09:32 +01:00
< / p >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > Fs = 2< span class = "org-type" > *< / span > dist_f.f(end); < span class = "org-comment" > % Sampling Frequency of data is twice the maximum frequency of the PSD vector [Hz]< / span >
N = 2< span class = "org-type" > *< / span > length(dist_f.f); < span class = "org-comment" > % Number of Samples match the one of the wanted PSD< / span >
T0 = N< span class = "org-type" > /< / span > Fs; < span class = "org-comment" > % Signal Duration [s]< / span >
df = 1< span class = "org-type" > /< / span > T0; < span class = "org-comment" > % Frequency resolution of the DFT [Hz]< / span >
< span class = "org-comment" > % Also equal to (dist_f.f(2)-dist_f.f(1))< / span >
t = linspace(0, T0, N< span class = "org-type" > +< / span > 1)< span class = "org-type" > '< / span > ; < span class = "org-comment" > % Time Vector [s]< / span >
Ts = 1< span class = "org-type" > /< / span > Fs; < span class = "org-comment" > % Sampling Time [s]< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-02-25 18:10:20 +01:00
< div id = "outline-container-orgb2108c4" class = "outline-3" >
< h3 id = "orgb2108c4" > Ground Motion< / h3 >
< div class = "outline-text-3" id = "text-orgb2108c4" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > phi = dist_f.psd_gm;
2020-11-03 09:45:50 +01:00
C = zeros(N< span class = "org-type" > /< / span > 2,1);
< span class = "org-keyword" > for< / span > < span class = "org-variable-name" > < span class = "org-constant" > i< / span > < / span > = < span class = "org-constant" > 1:N/2< / span >
C(< span class = "org-constant" > i< / span > ) = sqrt(phi(< span class = "org-constant" > i< / span > )< span class = "org-type" > *< / span > df);
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > if< / span > args.Dwx < span class = "org-type" > & & < / span > args.enable
rng< span class = "org-type" > (111);< / span >
theta = 2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > *< / span > rand(N< span class = "org-type" > /< / span > 2,1); < span class = "org-comment" > % Generate random phase [rad]< / span >
Cx = [0 ; C< span class = "org-type" > .*< / span > complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2< span class = "org-type" > :< / span > end)))];;
Dwx = N< span class = "org-type" > /< / span > sqrt(2)< span class = "org-type" > *< / span > ifft(Cx); < span class = "org-comment" > % Ground Motion - x direction [m]< / span >
< span class = "org-keyword" > else< / span >
2020-02-03 17:50:32 +01:00
Dwx = zeros(length(t), 1);
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > if< / span > args.Dwy < span class = "org-type" > & & < / span > args.enable
rng< span class = "org-type" > (112);< / span >
theta = 2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > *< / span > rand(N< span class = "org-type" > /< / span > 2,1); < span class = "org-comment" > % Generate random phase [rad]< / span >
Cx = [0 ; C< span class = "org-type" > .*< / span > complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2< span class = "org-type" > :< / span > end)))];;
Dwy = N< span class = "org-type" > /< / span > sqrt(2)< span class = "org-type" > *< / span > ifft(Cx); < span class = "org-comment" > % Ground Motion - y direction [m]< / span >
< span class = "org-keyword" > else< / span >
2020-02-03 17:50:32 +01:00
Dwy = zeros(length(t), 1);
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > if< / span > args.Dwy < span class = "org-type" > & & < / span > args.enable
rng< span class = "org-type" > (113);< / span >
theta = 2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > *< / span > rand(N< span class = "org-type" > /< / span > 2,1); < span class = "org-comment" > % Generate random phase [rad]< / span >
Cx = [0 ; C< span class = "org-type" > .*< / span > complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2< span class = "org-type" > :< / span > end)))];;
Dwz = N< span class = "org-type" > /< / span > sqrt(2)< span class = "org-type" > *< / span > ifft(Cx); < span class = "org-comment" > % Ground Motion - z direction [m]< / span >
< span class = "org-keyword" > else< / span >
2020-02-03 17:50:32 +01:00
Dwz = zeros(length(t), 1);
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-02-25 18:10:20 +01:00
< div id = "outline-container-orgb70c65e" class = "outline-3" >
< h3 id = "orgb70c65e" > Translation Stage - X direction< / h3 >
< div class = "outline-text-3" id = "text-orgb70c65e" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > if< / span > args.Fty_x < span class = "org-type" > & & < / span > args.enable
phi = dist_f.psd_ty; < span class = "org-comment" > % TODO - we take here the vertical direction which is wrong but approximate< / span >
C = zeros(N< span class = "org-type" > /< / span > 2,1);
< span class = "org-keyword" > for< / span > < span class = "org-variable-name" > < span class = "org-constant" > i< / span > < / span > = < span class = "org-constant" > 1:N/2< / span >
C(< span class = "org-constant" > i< / span > ) = sqrt(phi(< span class = "org-constant" > i< / span > )< span class = "org-type" > *< / span > df);
< span class = "org-keyword" > end< / span >
rng< span class = "org-type" > (121);< / span >
theta = 2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > *< / span > rand(N< span class = "org-type" > /< / span > 2,1); < span class = "org-comment" > % Generate random phase [rad]< / span >
Cx = [0 ; C< span class = "org-type" > .*< / span > complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2< span class = "org-type" > :< / span > end)))];;
u = N< span class = "org-type" > /< / span > sqrt(2)< span class = "org-type" > *< / span > ifft(Cx); < span class = "org-comment" > % Disturbance Force Ty x [N]< / span >
2020-02-03 17:50:32 +01:00
Fty_x = u;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > else< / span >
2020-02-03 17:50:32 +01:00
Fty_x = zeros(length(t), 1);
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-02-25 18:10:20 +01:00
< div id = "outline-container-org070255a" class = "outline-3" >
< h3 id = "org070255a" > Translation Stage - Z direction< / h3 >
< div class = "outline-text-3" id = "text-org070255a" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > if< / span > args.Fty_z < span class = "org-type" > & & < / span > args.enable
2020-02-03 17:50:32 +01:00
phi = dist_f.psd_ty;
2020-11-03 09:45:50 +01:00
C = zeros(N< span class = "org-type" > /< / span > 2,1);
< span class = "org-keyword" > for< / span > < span class = "org-variable-name" > < span class = "org-constant" > i< / span > < / span > = < span class = "org-constant" > 1:N/2< / span >
C(< span class = "org-constant" > i< / span > ) = sqrt(phi(< span class = "org-constant" > i< / span > )< span class = "org-type" > *< / span > df);
< span class = "org-keyword" > end< / span >
rng< span class = "org-type" > (122);< / span >
theta = 2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > *< / span > rand(N< span class = "org-type" > /< / span > 2,1); < span class = "org-comment" > % Generate random phase [rad]< / span >
Cx = [0 ; C< span class = "org-type" > .*< / span > complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2< span class = "org-type" > :< / span > end)))];;
u = N< span class = "org-type" > /< / span > sqrt(2)< span class = "org-type" > *< / span > ifft(Cx); < span class = "org-comment" > % Disturbance Force Ty z [N]< / span >
2020-02-03 17:50:32 +01:00
Fty_z = u;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > else< / span >
2020-02-03 17:50:32 +01:00
Fty_z = zeros(length(t), 1);
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-02-25 18:10:20 +01:00
< div id = "outline-container-orgfd5f32b" class = "outline-3" >
< h3 id = "orgfd5f32b" > Spindle - Z direction< / h3 >
< div class = "outline-text-3" id = "text-orgfd5f32b" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > if< / span > args.Frz_z < span class = "org-type" > & & < / span > args.enable
2020-02-03 17:50:32 +01:00
phi = dist_f.psd_rz;
2020-11-03 09:45:50 +01:00
C = zeros(N< span class = "org-type" > /< / span > 2,1);
< span class = "org-keyword" > for< / span > < span class = "org-variable-name" > < span class = "org-constant" > i< / span > < / span > = < span class = "org-constant" > 1:N/2< / span >
C(< span class = "org-constant" > i< / span > ) = sqrt(phi(< span class = "org-constant" > i< / span > )< span class = "org-type" > *< / span > df);
< span class = "org-keyword" > end< / span >
rng< span class = "org-type" > (131);< / span >
theta = 2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > *< / span > rand(N< span class = "org-type" > /< / span > 2,1); < span class = "org-comment" > % Generate random phase [rad]< / span >
Cx = [0 ; C< span class = "org-type" > .*< / span > complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2< span class = "org-type" > :< / span > end)))];;
u = N< span class = "org-type" > /< / span > sqrt(2)< span class = "org-type" > *< / span > ifft(Cx); < span class = "org-comment" > % Disturbance Force Rz z [N]< / span >
2020-02-03 17:50:32 +01:00
Frz_z = u;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > else< / span >
2020-02-03 17:50:32 +01:00
Frz_z = zeros(length(t), 1);
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-02-25 18:10:20 +01:00
< div id = "outline-container-orgba4d479" class = "outline-3" >
< h3 id = "orgba4d479" > Direct Forces< / h3 >
< div class = "outline-text-3" id = "text-orgba4d479" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > u = zeros(length(t), 6);
Fd = u;
< / pre >
< / div >
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-02-25 18:10:20 +01:00
< 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" >
2019-12-11 17:09:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > Dwx = Dwx < span class = "org-type" > -< / span > Dwx(1);
Dwy = Dwy < span class = "org-type" > -< / span > Dwy(1);
Dwz = Dwz < span class = "org-type" > -< / span > Dwz(1);
Fty_x = Fty_x < span class = "org-type" > -< / span > Fty_x(1);
Fty_z = Fty_z < span class = "org-type" > -< / span > Fty_z(1);
Frz_z = Frz_z < span class = "org-type" > -< / span > Frz_z(1);
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org976c195" class = "outline-3" >
< h3 id = "org976c195" > Save< / h3 >
< div class = "outline-text-3" id = "text-org976c195" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > save(< span class = "org-string" > './mat/nass_disturbances.mat'< / span > , < span class = "org-string" > 'Dwx'< / span > , < span class = "org-string" > 'Dwy'< / span > , < span class = "org-string" > 'Dwz'< / span > , < span class = "org-string" > 'Fty_x'< / span > , < span class = "org-string" > 'Fty_z'< / span > , < span class = "org-string" > 'Frz_z'< / span > , < span class = "org-string" > 'Fd'< / span > , < span class = "org-string" > 'Ts'< / span > , < span class = "org-string" > 't'< / span > , < span class = "org-string" > 'args'< / span > );
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2020-02-25 18:10:20 +01:00
< 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 >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org5592bea" class = "outline-3" >
< h3 id = "org5592bea" > Function Declaration and Documentation< / h3 >
< div class = "outline-text-3" id = "text-org5592bea" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > function< / span > < span class = "org-variable-name" > []< / span > = < span class = "org-function-name" > initializePosError< / span > (< span class = "org-variable-name" > args< / span > )
< span class = "org-comment" > % initializePosError - Initialize the position errors< / span >
< span class = "org-comment" > %< / span >
< span class = "org-comment" > % Syntax: [] = initializePosError(args)< / span >
< span class = "org-comment" > %< / span >
< span class = "org-comment" > % Inputs:< / span >
< span class = "org-comment" > % - args -< / span >
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgf20a527" class = "outline-3" >
< h3 id = "orgf20a527" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-orgf20a527" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-11-03 09:45:50 +01:00
args.error logical {mustBeNumericOrLogical} = < span class = "org-constant" > false< / span >
args.Dy (1,1) double {mustBeNumeric} = 0 < span class = "org-comment" > % [m]< / span >
args.Ry (1,1) double {mustBeNumeric} = 0 < span class = "org-comment" > % [m]< / span >
args.Rz (1,1) double {mustBeNumeric} = 0 < span class = "org-comment" > % [m]< / span >
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-orgb76955b" class = "outline-3" >
< h3 id = "orgb76955b" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-orgb76955b" >
2020-02-25 18:10:20 +01:00
< 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" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > if< / span > args.error
2020-02-25 18:10:20 +01:00
pos_error.type = 1;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > else< / span >
2020-02-25 18:10:20 +01:00
pos_error.type = 0;
2020-11-03 09:45:50 +01:00
< span class = "org-keyword" > end< / span >
2020-02-25 18:10:20 +01:00
< / 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 >
2020-11-03 09:45:50 +01:00
< div id = "outline-container-org799eabe" class = "outline-3" >
< h3 id = "org799eabe" > Save< / h3 >
< div class = "outline-text-3" id = "text-org799eabe" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > save(< span class = "org-string" > './mat/pos_error.mat'< / span > , < span class = "org-string" > 'pos_error'< / span > );
2020-02-25 18:10:20 +01:00
< / 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" >
2020-02-03 17:50:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
< a id = "orgda06de2" > < / a >
2020-02-03 17:50:32 +01:00
< / p >
2019-12-11 17:09:32 +01:00
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > function< / span > < span class = "org-variable-name" > [geophone]< / span > = < span class = "org-function-name" > initializeZAxisGeophone< / span > (< span class = "org-variable-name" > args< / span > )
2020-02-03 17:50:32 +01:00
arguments
2020-11-03 09:45:50 +01:00
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 1e< span class = "org-type" > -< / span > 3 < span class = "org-comment" > % [kg]< / span >
args.freq (1,1) double {mustBeNumeric, mustBePositive} = 1 < span class = "org-comment" > % [Hz]< / span >
< span class = "org-keyword" > end< / span >
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-matlab-cellbreak" > < span class = "org-comment" > %%< / span > < / span >
2020-02-03 17:50:32 +01:00
geophone.m = args.mass;
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-matlab-cellbreak" > < span class = "org-comment" > %% The Stiffness is set to have the damping resonance frequency< / span > < / span >
geophone.k = geophone.m < span class = "org-type" > *< / span > (2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > *< / span > args.freq)< span class = "org-type" > ^< / span > 2;
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-matlab-cellbreak" > < span class = "org-comment" > %% We set the damping value to have critical damping< / span > < / span >
geophone.c = 2< span class = "org-type" > *< / span > sqrt(geophone.m < span class = "org-type" > *< / span > geophone.k);
2019-12-11 17:09:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-matlab-cellbreak" > < span class = "org-comment" > %% Save< / span > < / span >
save(< span class = "org-string" > './mat/geophone_z_axis.mat'< / span > , < span class = "org-string" > 'geophone'< / span > );
< span class = "org-keyword" > end< / span >
2019-12-11 17:09:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-02-03 17:50:32 +01:00
2020-02-25 18:10:20 +01:00
< 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" >
2020-02-03 17:50:32 +01:00
< p >
2020-02-25 18:10:20 +01:00
< a id = "org071e205" > < / a >
2020-02-03 17:50:32 +01:00
< / p >
< div class = "org-src-container" >
2020-11-03 09:45:50 +01:00
< pre class = "src src-matlab" > < span class = "org-keyword" > function< / span > < span class = "org-variable-name" > [accelerometer]< / span > = < span class = "org-function-name" > initializeZAxisAccelerometer< / span > (< span class = "org-variable-name" > args< / span > )
2020-02-03 17:50:32 +01:00
arguments
2020-11-03 09:45:50 +01:00
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 1e< span class = "org-type" > -< / span > 3 < span class = "org-comment" > % [kg]< / span >
args.freq (1,1) double {mustBeNumeric, mustBePositive} = 5e3 < span class = "org-comment" > % [Hz]< / span >
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-matlab-cellbreak" > < span class = "org-comment" > %%< / span > < / span >
2020-02-03 17:50:32 +01:00
accelerometer.m = args.mass;
2020-11-03 09:45:50 +01:00
< span class = "org-matlab-cellbreak" > < span class = "org-comment" > %% The Stiffness is set to have the damping resonance frequency< / span > < / span >
accelerometer.k = accelerometer.m < span class = "org-type" > *< / span > (2< span class = "org-type" > *< / span > < span class = "org-constant" > pi< / span > < span class = "org-type" > *< / span > args.freq)< span class = "org-type" > ^< / span > 2;
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-matlab-cellbreak" > < span class = "org-comment" > %% We set the damping value to have critical damping< / span > < / span >
accelerometer.c = 2< span class = "org-type" > *< / span > sqrt(accelerometer.m < span class = "org-type" > *< / span > accelerometer.k);
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-matlab-cellbreak" > < span class = "org-comment" > %% Gain correction of the accelerometer to have a unity gain until the resonance< / span > < / span >
accelerometer.gain = < span class = "org-type" > -< / span > accelerometer.k< span class = "org-type" > /< / span > accelerometer.m;
2020-02-03 17:50:32 +01:00
2020-11-03 09:45:50 +01:00
< span class = "org-matlab-cellbreak" > < span class = "org-comment" > %% Save< / span > < / span >
save(< span class = "org-string" > './mat/accelerometer_z_axis.mat'< / span > , < span class = "org-string" > 'accelerometer'< / span > );
< span class = "org-keyword" > end< / span >
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
2019-12-11 17:09:32 +01:00
< / div >
< / div >
< div id = "postamble" class = "status" >
< p class = "author" > Author: Dehaeze Thomas< / p >
2020-11-03 09:45:50 +01:00
< p class = "date" > Created: 2020-11-03 mar. 09:45< / p >
2019-12-11 17:09:32 +01:00
< / div >
< / body >
< / html >