2019-12-11 17:09:32 +01:00
<?xml version="1.0" encoding="utf-8"?>
2020-02-03 17:50:32 +01:00
<?xml version="1.0" encoding="utf-8"?>
2019-12-11 17:09:32 +01:00
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" lang = "en" xml:lang = "en" >
< head >
2020-05-05 11:38:52 +02:00
<!-- 2020 - 05 - 05 mar. 10:33 -->
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-05-05 11:38:52 +02:00
< li > < a href = "#org246ce35" > Function description< / a > < / li >
< li > < a href = "#org27c3039" > Optional Parameters< / a > < / li >
< li > < a href = "#org4a0049b" > Structure initialization< / a > < / li >
< li > < a href = "#org1e0f7f4" > Add Type< / a > < / li >
< li > < a href = "#orgded6aac" > 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-05-05 11:38:52 +02:00
< li > < a href = "#org3fa6ef1" > Function description< / a > < / li >
< li > < a href = "#orgc8aac8f" > Optional Parameters< / a > < / li >
< li > < a href = "#orgd4d0599" > Structure initialization< / a > < / li >
< li > < a href = "#orgaffa81c" > Add Type< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org60d91f1" > Sampling Time< / a > < / li >
2020-05-05 11:38:52 +02:00
< li > < a href = "#org1d59f8f" > Save the Structure< / a > < / li >
2020-02-25 18:10:20 +01:00
< / ul >
< / li >
< li > < a href = "#org1bf1870" > 3. Ground< / a >
< ul >
2020-05-05 11:38:52 +02:00
< li > < a href = "#org92b9277" > Simscape Model< / a > < / li >
< li > < a href = "#orgcfbce88" > Function description< / a > < / li >
< li > < a href = "#orga9eb2c7" > Optional Parameters< / a > < / li >
< li > < a href = "#org52bbc84" > Structure initialization< / a > < / li >
< li > < a href = "#orgad27bdf" > 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-05-05 11:38:52 +02:00
< li > < a href = "#org9f15b58" > 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-05-05 11:38:52 +02:00
< li > < a href = "#orga0a0825" > Simscape Model< / a > < / li >
< li > < a href = "#org06e1362" > Function description< / a > < / li >
< li > < a href = "#org3354a31" > Optional Parameters< / a > < / li >
< li > < a href = "#org4cf00fc" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org413c06d" > Add Granite Type< / a > < / li >
2020-05-05 11:38:52 +02:00
< li > < a href = "#org8f61ce3" > Material and Geometry< / a > < / li >
< li > < a href = "#org9976da6" > Stiffness and Damping properties< / a > < / li >
< li > < a href = "#orge84d6de" > Equilibrium position of the each joint.< / a > < / li >
< li > < a href = "#org559e245" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-05-05 11:38:52 +02:00
< li > < a href = "#org55e59c3" > 5. Translation Stage< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-05-05 11:38:52 +02:00
< li > < a href = "#org6281028" > Simscape Model< / a > < / li >
< li > < a href = "#orgc6c8b46" > Function description< / a > < / li >
< li > < a href = "#org23338c4" > Optional Parameters< / a > < / li >
< li > < a href = "#org748d5ce" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org715e876" > Add Translation Stage Type< / a > < / li >
2020-05-05 11:38:52 +02:00
< li > < a href = "#org76a9860" > Material and Geometry< / a > < / li >
< li > < a href = "#orgab6ccf3" > Stiffness and Damping properties< / a > < / li >
< li > < a href = "#org10a4b27" > Equilibrium position of the each joint.< / a > < / li >
< li > < a href = "#org0951db0" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-05-05 11:38:52 +02:00
< li > < a href = "#orga4374f1" > 6. Tilt Stage< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-05-05 11:38:52 +02:00
< li > < a href = "#orgf9af09c" > Simscape Model< / a > < / li >
< li > < a href = "#org88e197e" > Function description< / a > < / li >
< li > < a href = "#org438cbb4" > Optional Parameters< / a > < / li >
< li > < a href = "#org6c3c8d7" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#orgea3a7ba" > Add Tilt Type< / a > < / li >
2020-05-05 11:38:52 +02:00
< li > < a href = "#org0a4da15" > Material and Geometry< / a > < / li >
< li > < a href = "#orgc8d8e96" > Stiffness and Damping properties< / a > < / li >
< li > < a href = "#orgcff6f81" > Equilibrium position of the each joint.< / a > < / li >
< li > < a href = "#org154c09a" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-05-05 11:38:52 +02:00
< li > < a href = "#orgcd779c6" > 7. Spindle< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-05-05 11:38:52 +02:00
< li > < a href = "#orgdbf178e" > Simscape Model< / a > < / li >
< li > < a href = "#org6c50d5f" > Function description< / a > < / li >
< li > < a href = "#org6e2538c" > Optional Parameters< / a > < / li >
< li > < a href = "#org9d54b32" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#orge5b17ec" > Add Spindle Type< / a > < / li >
2020-05-05 11:38:52 +02:00
< li > < a href = "#org8611e52" > Material and Geometry< / a > < / li >
< li > < a href = "#org4bd17c5" > Stiffness and Damping properties< / a > < / li >
< li > < a href = "#orgda734ec" > Equilibrium position of the each joint.< / a > < / li >
< li > < a href = "#org3120427" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-05-05 11:38:52 +02:00
< li > < a href = "#orgaac7776" > 8. Micro Hexapod< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-05-05 11:38:52 +02:00
< li > < a href = "#org4255c8d" > Simscape Model< / a > < / li >
< li > < a href = "#orgb1add14" > Function description< / a > < / li >
< li > < a href = "#orge607d9e" > Optional Parameters< / a > < / li >
< li > < a href = "#org4f2e11d" > Function content< / a > < / li >
< li > < a href = "#orgd4fd31f" > Add Type< / a > < / li >
< li > < a href = "#org0c6e7cc" > 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-05-05 11:38:52 +02:00
< li > < a href = "#org1eff289" > Simscape Model< / a > < / li >
< li > < a href = "#orgd8c98e8" > Function description< / a > < / li >
< li > < a href = "#orgef0234c" > Optional Parameters< / a > < / li >
< li > < a href = "#orgcf18e70" > Structure initialization< / a > < / li >
< li > < a href = "#orgf9b4f63" > Add Type< / a > < / li >
< li > < a href = "#org7ee8ea4" > Material and Geometry< / a > < / li >
< li > < a href = "#org2bfb3df" > 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-05-05 11:38:52 +02:00
< li > < a href = "#orgebffada" > Simscape Model< / a > < / li >
< li > < a href = "#org0a7b625" > Function description< / a > < / li >
< li > < a href = "#orgd2ff1cd" > Optional Parameters< / a > < / li >
< li > < a href = "#orgc93419e" > 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-05-05 11:38:52 +02:00
< li > < a href = "#org773a7e1" > Stiffness and Damping properties< / a > < / li >
< li > < a href = "#org0e83cc8" > Equilibrium position of the each joint.< / a > < / li >
2020-04-17 10:25:44 +02:00
< li > < a href = "#orgc381755" > Geometry< / a > < / li >
2020-05-05 11:38:52 +02:00
< li > < a href = "#orgc66f362" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-05-05 11:38:52 +02:00
< li > < a href = "#org16c8d40" > 11. Nano Hexapod< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-05-05 11:38:52 +02:00
< li > < a href = "#org3538130" > Simscape Model< / a > < / li >
< li > < a href = "#org6e108c8" > Function description< / a > < / li >
< li > < a href = "#orgbc67bc9" > Optional Parameters< / a > < / li >
< li > < a href = "#org74a22e9" > Function content< / a > < / li >
< li > < a href = "#org0533a9d" > Add Type< / a > < / li >
< li > < a href = "#org2bdf2bc" > 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-05-05 11:38:52 +02:00
< li > < a href = "#org849e75c" > Simscape Model< / a > < / li >
< li > < a href = "#org71549c6" > Function description< / a > < / li >
< li > < a href = "#orgf81789f" > Optional Parameters< / a > < / li >
< li > < a href = "#org03107a5" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org2bb1d24" > Add Sample Type< / a > < / li >
2020-05-05 11:38:52 +02:00
< li > < a href = "#org10cd272" > Material and Geometry< / a > < / li >
2020-04-01 16:17:26 +02:00
< li > < a href = "#org228453f" > Compute the Inertia< / a > < / li >
2020-05-05 11:38:52 +02:00
< li > < a href = "#org334e053" > Stiffness and Damping properties< / a > < / li >
< li > < a href = "#org22b74be" > Equilibrium position of the each joint.< / a > < / li >
< li > < a href = "#org7316bd1" > 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-05-05 11:38:52 +02:00
< li > < a href = "#orgb134e02" > Function Declaration and Documentation< / a > < / li >
< li > < a href = "#orgcb5cea2" > Optional Parameters< / a > < / li >
< li > < a href = "#org6e3d43a" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org4207f98" > Controller Type< / a > < / li >
2020-05-05 11:38:52 +02:00
< li > < a href = "#orga766ac2" > 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-05-05 11:38:52 +02:00
< li > < a href = "#orgbe1b3ce" > Function Declaration and Documentation< / a > < / li >
< li > < a href = "#orgb74cc41" > Optional Parameters< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#orge94c0c2" > Initialize Parameters< / a > < / li >
2020-05-05 11:38:52 +02:00
< li > < a href = "#org9a6562c" > Translation Stage< / a > < / li >
< li > < a href = "#org005e07a" > Tilt Stage< / a > < / li >
< li > < a href = "#orge49a64e" > Spindle< / a > < / li >
< li > < a href = "#orgf16b0ab" > Micro Hexapod< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org04d73dc" > Axis Compensation< / a > < / li >
2020-05-05 11:38:52 +02:00
< li > < a href = "#org2516704" > Nano Hexapod< / a > < / li >
< li > < a href = "#org2b550dd" > 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-05-05 11:38:52 +02:00
< li > < a href = "#orga1fa4b5" > Function Declaration and Documentation< / a > < / li >
< li > < a href = "#orgbde77ba" > 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-05-05 11:38:52 +02:00
< li > < a href = "#orgf084184" > 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-05-05 11:38:52 +02:00
< li > < a href = "#orgbaecbcc" > Function Declaration and Documentation< / a > < / li >
< li > < a href = "#org4eb7ed1" > Optional Parameters< / a > < / li >
< li > < a href = "#org0273d6e" > 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-05-05 11:38:52 +02:00
< li > < a href = "#orgf26ccc6" > 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-05-05 11:38:52 +02:00
< div id = "outline-container-org246ce35" class = "outline-3" >
< h3 id = "org246ce35" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org246ce35" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > function [] = initializeSimscapeConfiguration(args)
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org27c3039" class = "outline-3" >
< h3 id = "org27c3039" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org27c3039" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-05-05 11:38:52 +02:00
args.gravity logical {mustBeNumericOrLogical} = true
end
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org4a0049b" class = "outline-3" >
< h3 id = "org4a0049b" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org4a0049b" >
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-05-05 11:38:52 +02:00
< div id = "outline-container-org1e0f7f4" class = "outline-3" >
< h3 id = "org1e0f7f4" > Add Type< / h3 >
< div class = "outline-text-3" id = "text-org1e0f7f4" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > if args.gravity
2020-02-25 18:10:20 +01:00
conf_simscape.type = 1;
2020-05-05 11:38:52 +02:00
else
2020-02-25 18:10:20 +01:00
conf_simscape.type = 2;
2020-05-05 11:38:52 +02:00
end
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orgded6aac" class = "outline-3" >
< h3 id = "orgded6aac" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-orgded6aac" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > save('./mat/conf_simscape.mat', 'conf_simscape');
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-05-05 11:38:52 +02:00
< div id = "outline-container-org3fa6ef1" class = "outline-3" >
< h3 id = "org3fa6ef1" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org3fa6ef1" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > function [] = initializeLoggingConfiguration(args)
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orgc8aac8f" class = "outline-3" >
< h3 id = "orgc8aac8f" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-orgc8aac8f" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-05-05 11:38:52 +02:00
args.log char {mustBeMember(args.log,{'none', 'all', 'forces'})} = 'none'
args.Ts (1,1) double {mustBeNumeric, mustBePositive} = 1e-3
end
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orgd4d0599" class = "outline-3" >
< h3 id = "orgd4d0599" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-orgd4d0599" >
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-05-05 11:38:52 +02:00
< div id = "outline-container-orgaffa81c" class = "outline-3" >
< h3 id = "orgaffa81c" > Add Type< / h3 >
< div class = "outline-text-3" id = "text-orgaffa81c" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > switch args.log
case 'none'
2020-02-25 18:10:20 +01:00
conf_log.type = 0;
2020-05-05 11:38:52 +02:00
case 'all'
2020-02-25 18:10:20 +01:00
conf_log.type = 1;
2020-05-05 11:38:52 +02:00
case 'forces'
2020-02-25 18:10:20 +01:00
conf_log.type = 2;
2020-05-05 11:38:52 +02:00
end
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-05-05 11:38:52 +02:00
< div id = "outline-container-org1d59f8f" class = "outline-3" >
< h3 id = "org1d59f8f" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org1d59f8f" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > save('./mat/conf_log.mat', 'conf_log');
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-05-05 11:38:52 +02:00
< div id = "outline-container-org92b9277" class = "outline-3" >
< h3 id = "org92b9277" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-org92b9277" >
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-05-05 11:38:52 +02:00
< div id = "outline-container-orgcfbce88" class = "outline-3" >
< h3 id = "orgcfbce88" > Function description< / h3 >
< div class = "outline-text-3" id = "text-orgcfbce88" >
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" > function [ground] = initializeGround(args)
2019-12-11 17:09:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orga9eb2c7" class = "outline-3" >
< h3 id = "orga9eb2c7" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-orga9eb2c7" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-05-05 11:38:52 +02:00
args.type char {mustBeMember(args.type,{'none', 'rigid'})} = 'rigid'
args.rot_point (3,1) double {mustBeNumeric} = zeros(3,1) % Rotation point for the ground motion [m]
end
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org52bbc84" class = "outline-3" >
< h3 id = "org52bbc84" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org52bbc84" >
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-05-05 11:38:52 +02:00
< div id = "outline-container-orgad27bdf" class = "outline-3" >
< h3 id = "orgad27bdf" > Add Type< / h3 >
< div class = "outline-text-3" id = "text-orgad27bdf" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > switch args.type
case 'none'
2020-02-25 18:10:20 +01:00
ground.type = 0;
2020-05-05 11:38:52 +02:00
case 'rigid'
2020-02-25 18:10:20 +01:00
ground.type = 1;
2020-05-05 11:38:52 +02:00
end
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > ground.shape = [2, 2, 0.5]; % [m]
ground.density = 2800; % [kg/m3]
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-05-05 11:38:52 +02:00
< div id = "outline-container-org9f15b58" class = "outline-3" >
< h3 id = "org9f15b58" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org9f15b58" >
2020-02-03 17:50:32 +01:00
< p >
The < code > ground< / code > structure is saved.
< / p >
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > save('./mat/stages.mat', 'ground', '-append');
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-05-05 11:38:52 +02:00
< div id = "outline-container-orga0a0825" class = "outline-3" >
< h3 id = "orga0a0825" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-orga0a0825" >
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-05-05 11:38:52 +02:00
< div id = "outline-container-org06e1362" class = "outline-3" >
< h3 id = "org06e1362" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org06e1362" >
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" > function [granite] = initializeGranite(args)
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org3354a31" class = "outline-3" >
< h3 id = "org3354a31" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org3354a31" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-05-05 11:38:52 +02:00
args.type char {mustBeMember(args.type,{'rigid', 'flexible', 'none', 'modal-analysis', 'init'})} = 'flexible'
args.Foffset logical {mustBeNumericOrLogical} = false
args.density (1,1) double {mustBeNumeric, mustBeNonnegative} = 2800 % Density [kg/m3]
args.K (3,1) double {mustBeNumeric, mustBeNonnegative} = [4e9; 3e8; 8e8] % [N/m]
args.C (3,1) double {mustBeNumeric, mustBeNonnegative} = [4.0e5; 1.1e5; 9.0e5] % [N/(m/s)]
args.x0 (1,1) double {mustBeNumeric} = 0 % Rest position of the Joint in the X direction [m]
args.y0 (1,1) double {mustBeNumeric} = 0 % Rest position of the Joint in the Y direction [m]
args.z0 (1,1) double {mustBeNumeric} = 0 % Rest position of the Joint in the Z direction [m]
end
2019-12-11 17:09:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org4cf00fc" class = "outline-3" >
< h3 id = "org4cf00fc" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org4cf00fc" >
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > switch args.type
case 'none'
2020-02-25 18:10:20 +01:00
granite.type = 0;
2020-05-05 11:38:52 +02:00
case 'rigid'
2020-02-25 18:10:20 +01:00
granite.type = 1;
2020-05-05 11:38:52 +02:00
case 'flexible'
2020-02-25 18:10:20 +01:00
granite.type = 2;
2020-05-05 11:38:52 +02:00
case 'modal-analysis'
2020-02-25 18:10:20 +01:00
granite.type = 3;
2020-05-05 11:38:52 +02:00
case 'init'
2020-02-25 18:10:20 +01:00
granite.type = 4;
2020-05-05 11:38:52 +02:00
end
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-05-05 11:38:52 +02:00
< div id = "outline-container-org8f61ce3" class = "outline-3" >
< h3 id = "org8f61ce3" > Material and Geometry< / h3 >
< div class = "outline-text-3" id = "text-org8f61ce3" >
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > granite.density = args.density; % [kg/m3]
granite.STEP = './STEPS/granite/granite.STEP';
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > granite.sample_pos = 0.8; % [m]
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-05-05 11:38:52 +02:00
< div id = "outline-container-org9976da6" class = "outline-3" >
< h3 id = "org9976da6" > Stiffness and Damping properties< / h3 >
< div class = "outline-text-3" id = "text-org9976da6" >
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" > granite.K = args.K; % [N/m]
granite.C = args.C; % [N/(m/s)]
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-05-05 11:38:52 +02:00
< div id = "outline-container-orge84d6de" class = "outline-3" >
< h3 id = "orge84d6de" > Equilibrium position of the each joint.< / h3 >
< div class = "outline-text-3" id = "text-orge84d6de" >
2019-12-11 17:09:32 +01:00
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > if args.Foffset & & ~strcmp(args.type, 'none') & & ~strcmp(args.type, 'rigid') & & ~strcmp(args.type, 'init')
load('mat/Foffset.mat', 'Fgm');
granite.Deq = -Fgm'./granite.K;
else
2020-02-25 18:10:20 +01:00
granite.Deq = zeros(6,1);
2020-05-05 11:38:52 +02:00
end
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-05-05 11:38:52 +02:00
< div id = "outline-container-org559e245" class = "outline-3" >
< h3 id = "org559e245" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org559e245" >
2020-02-03 17:50:32 +01:00
< p >
The < code > granite< / code > structure is saved.
< / p >
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > save('./mat/stages.mat', 'granite', '-append');
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-05-05 11:38:52 +02:00
< div id = "outline-container-org55e59c3" class = "outline-2" >
< h2 id = "org55e59c3" > < 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-05-05 11:38:52 +02:00
< div id = "outline-container-org6281028" class = "outline-3" >
< h3 id = "org6281028" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-org6281028" >
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-05-05 11:38:52 +02:00
< div id = "outline-container-orgc6c8b46" class = "outline-3" >
< h3 id = "orgc6c8b46" > Function description< / h3 >
< div class = "outline-text-3" id = "text-orgc6c8b46" >
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" > function [ty] = initializeTy(args)
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org23338c4" class = "outline-3" >
< h3 id = "org23338c4" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org23338c4" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-05-05 11:38:52 +02:00
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible', 'modal-analysis', 'init'})} = 'flexible'
args.Foffset logical {mustBeNumericOrLogical} = false
end
2019-12-11 17:09:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org748d5ce" class = "outline-3" >
< h3 id = "org748d5ce" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org748d5ce" >
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > switch args.type
case 'none'
2020-02-25 18:10:20 +01:00
ty.type = 0;
2020-05-05 11:38:52 +02:00
case 'rigid'
2020-02-25 18:10:20 +01:00
ty.type = 1;
2020-05-05 11:38:52 +02:00
case 'flexible'
2020-02-25 18:10:20 +01:00
ty.type = 2;
2020-05-05 11:38:52 +02:00
case 'modal-analysis'
2020-02-25 18:10:20 +01:00
ty.type = 3;
2020-05-05 11:38:52 +02:00
case 'init'
2020-02-25 18:10:20 +01:00
ty.type = 4;
2020-05-05 11:38:52 +02:00
end
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org76a9860" class = "outline-3" >
< h3 id = "org76a9860" > Material and Geometry< / h3 >
< div class = "outline-text-3" id = "text-org76a9860" >
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > % Ty Granite frame
ty.granite_frame.density = 7800; % [kg/m3] => 43kg
ty.granite_frame.STEP = './STEPS/Ty/Ty_Granite_Frame.STEP';
2019-12-11 17:09:32 +01:00
2020-05-05 11:38:52 +02:00
% Guide Translation Ty
ty.guide.density = 7800; % [kg/m3] => 76kg
ty.guide.STEP = './STEPS/ty/Ty_Guide.STEP';
2019-12-11 17:09:32 +01:00
2020-05-05 11:38:52 +02:00
% Ty - Guide_Translation12
ty.guide12.density = 7800; % [kg/m3]
ty.guide12.STEP = './STEPS/Ty/Ty_Guide_12.STEP';
2019-12-11 17:09:32 +01:00
2020-05-05 11:38:52 +02:00
% Ty - Guide_Translation11
ty.guide11.density = 7800; % [kg/m3]
ty.guide11.STEP = './STEPS/ty/Ty_Guide_11.STEP';
2019-12-11 17:09:32 +01:00
2020-05-05 11:38:52 +02:00
% Ty - Guide_Translation22
ty.guide22.density = 7800; % [kg/m3]
ty.guide22.STEP = './STEPS/ty/Ty_Guide_22.STEP';
2019-12-11 17:09:32 +01:00
2020-05-05 11:38:52 +02:00
% Ty - Guide_Translation21
ty.guide21.density = 7800; % [kg/m3]
ty.guide21.STEP = './STEPS/Ty/Ty_Guide_21.STEP';
2019-12-11 17:09:32 +01:00
2020-05-05 11:38:52 +02:00
% Ty - Plateau translation
ty.frame.density = 7800; % [kg/m3]
ty.frame.STEP = './STEPS/ty/Ty_Stage.STEP';
2019-12-11 17:09:32 +01:00
2020-05-05 11:38:52 +02:00
% Ty Stator Part
ty.stator.density = 5400; % [kg/m3]
ty.stator.STEP = './STEPS/ty/Ty_Motor_Stator.STEP';
2019-12-11 17:09:32 +01:00
2020-05-05 11:38:52 +02:00
% Ty Rotor Part
ty.rotor.density = 5400; % [kg/m3]
ty.rotor.STEP = './STEPS/ty/Ty_Motor_Rotor.STEP';
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-05-05 11:38:52 +02:00
< div id = "outline-container-orgab6ccf3" class = "outline-3" >
< h3 id = "orgab6ccf3" > Stiffness and Damping properties< / h3 >
< div class = "outline-text-3" id = "text-orgab6ccf3" >
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" > ty.K = [2e8; 1e8; 2e8; 6e7; 9e7; 6e7]; % [N/m, N*m/rad]
ty.C = [8e4; 5e4; 8e4; 2e4; 3e4; 2e4]; % [N/(m/s), N*m/(rad/s)]
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-05-05 11:38:52 +02:00
< div id = "outline-container-org10a4b27" class = "outline-3" >
< h3 id = "org10a4b27" > Equilibrium position of the each joint.< / h3 >
< div class = "outline-text-3" id = "text-org10a4b27" >
2019-12-11 17:09:32 +01:00
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > if args.Foffset & & ~strcmp(args.type, 'none') & & ~strcmp(args.type, 'rigid') & & ~strcmp(args.type, 'init')
load('mat/Foffset.mat', 'Ftym');
ty.Deq = -Ftym'./ty.K;
else
2020-02-25 18:10:20 +01:00
ty.Deq = zeros(6,1);
2020-05-05 11:38:52 +02:00
end
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-05-05 11:38:52 +02:00
< div id = "outline-container-org0951db0" class = "outline-3" >
< h3 id = "org0951db0" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org0951db0" >
2020-02-03 17:50:32 +01:00
< p >
The < code > ty< / code > structure is saved.
< / p >
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > save('./mat/stages.mat', 'ty', '-append');
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-05-05 11:38:52 +02:00
< div id = "outline-container-orga4374f1" class = "outline-2" >
< h2 id = "orga4374f1" > < 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-05-05 11:38:52 +02:00
< div id = "outline-container-orgf9af09c" class = "outline-3" >
< h3 id = "orgf9af09c" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-orgf9af09c" >
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-05-05 11:38:52 +02:00
< div id = "outline-container-org88e197e" class = "outline-3" >
< h3 id = "org88e197e" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org88e197e" >
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" > function [ry] = initializeRy(args)
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org438cbb4" class = "outline-3" >
< h3 id = "org438cbb4" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org438cbb4" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-05-05 11:38:52 +02:00
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible', 'modal-analysis', 'init'})} = 'flexible'
args.Foffset logical {mustBeNumericOrLogical} = false
2020-02-25 18:10:20 +01:00
args.Ry_init (1,1) double {mustBeNumeric} = 0
2020-05-05 11:38:52 +02:00
end
2019-12-11 17:09:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org6c3c8d7" class = "outline-3" >
< h3 id = "org6c3c8d7" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org6c3c8d7" >
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > switch args.type
case 'none'
2020-02-25 18:10:20 +01:00
ry.type = 0;
2020-05-05 11:38:52 +02:00
case 'rigid'
2020-02-25 18:10:20 +01:00
ry.type = 1;
2020-05-05 11:38:52 +02:00
case 'flexible'
2020-02-25 18:10:20 +01:00
ry.type = 2;
2020-05-05 11:38:52 +02:00
case 'modal-analysis'
2020-02-25 18:10:20 +01:00
ry.type = 3;
2020-05-05 11:38:52 +02:00
case 'init'
2020-02-25 18:10:20 +01:00
ry.type = 4;
2020-05-05 11:38:52 +02:00
end
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org0a4da15" class = "outline-3" >
< h3 id = "org0a4da15" > Material and Geometry< / h3 >
< div class = "outline-text-3" id = "text-org0a4da15" >
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > % Ry - Guide for the tilt stage
ry.guide.density = 7800; % [kg/m3]
ry.guide.STEP = './STEPS/ry/Tilt_Guide.STEP';
2019-12-11 17:09:32 +01:00
2020-05-05 11:38:52 +02:00
% Ry - Rotor of the motor
ry.rotor.density = 2400; % [kg/m3]
ry.rotor.STEP = './STEPS/ry/Tilt_Motor_Axis.STEP';
2019-12-11 17:09:32 +01:00
2020-05-05 11:38:52 +02:00
% Ry - Motor
ry.motor.density = 3200; % [kg/m3]
ry.motor.STEP = './STEPS/ry/Tilt_Motor.STEP';
2019-12-11 17:09:32 +01:00
2020-05-05 11:38:52 +02:00
% Ry - Plateau Tilt
ry.stage.density = 7800; % [kg/m3]
ry.stage.STEP = './STEPS/ry/Tilt_Stage.STEP';
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > ry.z_offset = 0.58178; % [m]
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > ry.Ry_init = args.Ry_init; % [rad]
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-05-05 11:38:52 +02:00
< div id = "outline-container-orgc8d8e96" class = "outline-3" >
< h3 id = "orgc8d8e96" > Stiffness and Damping properties< / h3 >
< div class = "outline-text-3" id = "text-orgc8d8e96" >
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-05-05 11:38:52 +02:00
< div id = "outline-container-orgcff6f81" class = "outline-3" >
< h3 id = "orgcff6f81" > Equilibrium position of the each joint.< / h3 >
< div class = "outline-text-3" id = "text-orgcff6f81" >
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" > if args.Foffset & & ~strcmp(args.type, 'none') & & ~strcmp(args.type, 'rigid') & & ~strcmp(args.type, 'init')
load('mat/Foffset.mat', 'Fym');
ry.Deq = -Fym'./ry.K;
else
2020-02-25 18:10:20 +01:00
ry.Deq = zeros(6,1);
2020-05-05 11:38:52 +02:00
end
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-05-05 11:38:52 +02:00
< div id = "outline-container-org154c09a" class = "outline-3" >
< h3 id = "org154c09a" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org154c09a" >
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > save('./mat/stages.mat', 'ry', '-append');
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orgcd779c6" class = "outline-2" >
< h2 id = "orgcd779c6" > < 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-05-05 11:38:52 +02:00
< div id = "outline-container-orgdbf178e" class = "outline-3" >
< h3 id = "orgdbf178e" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-orgdbf178e" >
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-05-05 11:38:52 +02:00
< div id = "outline-container-org6c50d5f" class = "outline-3" >
< h3 id = "org6c50d5f" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org6c50d5f" >
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" > function [rz] = initializeRz(args)
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org6e2538c" class = "outline-3" >
< h3 id = "org6e2538c" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org6e2538c" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-05-05 11:38:52 +02:00
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible', 'modal-analysis', 'init'})} = 'flexible'
args.Foffset logical {mustBeNumericOrLogical} = false
end
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org9d54b32" class = "outline-3" >
< h3 id = "org9d54b32" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org9d54b32" >
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > switch args.type
case 'none'
2020-02-25 18:10:20 +01:00
rz.type = 0;
2020-05-05 11:38:52 +02:00
case 'rigid'
2020-02-25 18:10:20 +01:00
rz.type = 1;
2020-05-05 11:38:52 +02:00
case 'flexible'
2020-02-25 18:10:20 +01:00
rz.type = 2;
2020-05-05 11:38:52 +02:00
case 'modal-analysis'
2020-02-25 18:10:20 +01:00
rz.type = 3;
2020-05-05 11:38:52 +02:00
case 'init'
2020-02-25 18:10:20 +01:00
rz.type = 4;
2020-05-05 11:38:52 +02:00
end
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-02-03 17:50:32 +01:00
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org8611e52" class = "outline-3" >
< h3 id = "org8611e52" > Material and Geometry< / h3 >
< div class = "outline-text-3" id = "text-org8611e52" >
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > % Spindle - Slip Ring
rz.slipring.density = 7800; % [kg/m3]
rz.slipring.STEP = './STEPS/rz/Spindle_Slip_Ring.STEP';
2020-02-03 17:50:32 +01:00
2020-05-05 11:38:52 +02:00
% Spindle - Rotor
rz.rotor.density = 7800; % [kg/m3]
rz.rotor.STEP = './STEPS/rz/Spindle_Rotor.STEP';
2020-02-03 17:50:32 +01:00
2020-05-05 11:38:52 +02:00
% Spindle - Stator
rz.stator.density = 7800; % [kg/m3]
rz.stator.STEP = './STEPS/rz/Spindle_Stator.STEP';
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-05-05 11:38:52 +02:00
< div id = "outline-container-org4bd17c5" class = "outline-3" >
< h3 id = "org4bd17c5" > Stiffness and Damping properties< / h3 >
< div class = "outline-text-3" id = "text-org4bd17c5" >
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-05-05 11:38:52 +02:00
< div id = "outline-container-orgda734ec" class = "outline-3" >
< h3 id = "orgda734ec" > Equilibrium position of the each joint.< / h3 >
< div class = "outline-text-3" id = "text-orgda734ec" >
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" > if args.Foffset & & ~strcmp(args.type, 'none') & & ~strcmp(args.type, 'rigid') & & ~strcmp(args.type, 'init')
load('mat/Foffset.mat', 'Fzm');
rz.Deq = -Fzm'./rz.K;
else
2020-02-25 18:10:20 +01:00
rz.Deq = zeros(6,1);
2020-05-05 11:38:52 +02:00
end
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-05-05 11:38:52 +02:00
< div id = "outline-container-org3120427" class = "outline-3" >
< h3 id = "org3120427" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org3120427" >
2020-02-03 17:50:32 +01:00
< p >
The < code > rz< / code > structure is saved.
< / p >
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > save('./mat/stages.mat', 'rz', '-append');
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orgaac7776" class = "outline-2" >
< h2 id = "orgaac7776" > < 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-05-05 11:38:52 +02:00
< div id = "outline-container-org4255c8d" class = "outline-3" >
< h3 id = "org4255c8d" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-org4255c8d" >
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-05-05 11:38:52 +02:00
< div id = "outline-container-orgb1add14" class = "outline-3" >
< h3 id = "orgb1add14" > Function description< / h3 >
< div class = "outline-text-3" id = "text-orgb1add14" >
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" > function [micro_hexapod] = initializeMicroHexapod(args)
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orge607d9e" class = "outline-3" >
< h3 id = "orge607d9e" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-orge607d9e" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-05-05 11:38:52 +02:00
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible', 'modal-analysis', 'init', 'compliance'})} = 'flexible'
% initializeFramesPositions
args.H (1,1) double {mustBeNumeric, mustBePositive} = 350e-3
args.MO_B (1,1) double {mustBeNumeric} = 270e-3
% generateGeneralConfiguration
args.FH (1,1) double {mustBeNumeric, mustBePositive} = 50e-3
args.FR (1,1) double {mustBeNumeric, mustBePositive} = 175.5e-3
args.FTh (6,1) double {mustBeNumeric} = [-10, 10, 120-10, 120+10, 240-10, 240+10]*(pi/180)
args.MH (1,1) double {mustBeNumeric, mustBePositive} = 45e-3
args.MR (1,1) double {mustBeNumeric, mustBePositive} = 118e-3
args.MTh (6,1) double {mustBeNumeric} = [-60+10, 60-10, 60+10, 180-10, 180+10, -60-10]*(pi/180)
% initializeStrutDynamics
args.Ki (6,1) double {mustBeNumeric, mustBeNonnegative} = 2e7*ones(6,1)
args.Ci (6,1) double {mustBeNumeric, mustBeNonnegative} = 1.4e3*ones(6,1)
% initializeCylindricalPlatforms
2020-02-03 17:50:32 +01:00
args.Fpm (1,1) double {mustBeNumeric, mustBePositive} = 10
2020-05-05 11:38:52 +02:00
args.Fph (1,1) double {mustBeNumeric, mustBePositive} = 26e-3
args.Fpr (1,1) double {mustBeNumeric, mustBePositive} = 207.5e-3
2020-02-03 17:50:32 +01:00
args.Mpm (1,1) double {mustBeNumeric, mustBePositive} = 10
2020-05-05 11:38:52 +02:00
args.Mph (1,1) double {mustBeNumeric, mustBePositive} = 26e-3
args.Mpr (1,1) double {mustBeNumeric, mustBePositive} = 150e-3
% initializeCylindricalStruts
2020-02-03 17:50:32 +01:00
args.Fsm (1,1) double {mustBeNumeric, mustBePositive} = 1
2020-05-05 11:38:52 +02:00
args.Fsh (1,1) double {mustBeNumeric, mustBePositive} = 100e-3
args.Fsr (1,1) double {mustBeNumeric, mustBePositive} = 25e-3
2020-02-03 17:50:32 +01:00
args.Msm (1,1) double {mustBeNumeric, mustBePositive} = 1
2020-05-05 11:38:52 +02:00
args.Msh (1,1) double {mustBeNumeric, mustBePositive} = 100e-3
args.Msr (1,1) double {mustBeNumeric, mustBePositive} = 25e-3
% inverseKinematics
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-05-05 11:38:52 +02:00
% Force that stiffness of each joint should apply at t=0
args.Foffset logical {mustBeNumericOrLogical} = false
end
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org4f2e11d" class = "outline-3" >
< h3 id = "org4f2e11d" > Function content< / h3 >
< div class = "outline-text-3" id = "text-org4f2e11d" >
< div class = "org-src-container" >
< pre class = "src src-matlab" > stewart = initializeStewartPlatform();
stewart = initializeFramesPositions(stewart, ...
'H', args.H, ...
'MO_B', args.MO_B);
stewart = generateGeneralConfiguration(stewart, ...
'FH', args.FH, ...
'FR', args.FR, ...
'FTh', args.FTh, ...
'MH', args.MH, ...
'MR', args.MR, ...
'MTh', args.MTh);
stewart = computeJointsPose(stewart);
< / pre >
< / div >
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, ...
'K', args.Ki, ...
'C', args.Ci);
stewart = initializeJointDynamics(stewart, ...
'type_F', 'universal_p', ...
'type_M', 'spherical_p');
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-matlab" > stewart = initializeCylindricalPlatforms(stewart, ...
'Fpm', args.Fpm, ...
'Fph', args.Fph, ...
'Fpr', args.Fpr, ...
'Mpm', args.Mpm, ...
'Mph', args.Mph, ...
'Mpr', args.Mpr);
stewart = initializeCylindricalStruts(stewart, ...
'Fsm', args.Fsm, ...
'Fsh', args.Fsh, ...
'Fsr', args.Fsr, ...
'Msm', args.Msm, ...
'Msh', args.Msh, ...
'Msr', args.Msr);
stewart = computeJacobian(stewart);
stewart = initializeStewartPose(stewart, ...
'AP', args.AP, ...
'ARB', args.ARB);
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-matlab" > stewart = initializeInertialSensor(stewart, 'type', 'none');
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< p >
Equilibrium position of the each joint.
< / p >
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > if args.Foffset & & ~strcmp(args.type, 'none') & & ~strcmp(args.type, 'rigid') & & ~strcmp(args.type, 'init')
load('mat/Foffset.mat', 'Fhm');
stewart.actuators.dLeq = -Fhm'./args.Ki;
else
stewart.actuators.dLeq = zeros(6,1);
end
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orgd4fd31f" class = "outline-3" >
< h3 id = "orgd4fd31f" > Add Type< / h3 >
< div class = "outline-text-3" id = "text-orgd4fd31f" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > switch args.type
case 'none'
stewart.type = 0;
case 'rigid'
stewart.type = 1;
case 'flexible'
stewart.type = 2;
case 'modal-analysis'
stewart.type = 3;
case 'init'
stewart.type = 4;
case 'compliance'
stewart.type = 5;
end
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-05-05 11:38:52 +02:00
< div id = "outline-container-org0c6e7cc" class = "outline-3" >
< h3 id = "org0c6e7cc" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org0c6e7cc" >
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;
save('./mat/stages.mat', 'micro_hexapod', '-append');
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-05-05 11:38:52 +02:00
< div id = "outline-container-org1eff289" class = "outline-3" >
< h3 id = "org1eff289" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-org1eff289" >
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-05-05 11:38:52 +02:00
< div id = "outline-container-orgd8c98e8" class = "outline-3" >
< h3 id = "orgd8c98e8" > Function description< / h3 >
< div class = "outline-text-3" id = "text-orgd8c98e8" >
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" > function [axisc] = initializeAxisc(args)
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orgef0234c" class = "outline-3" >
< h3 id = "orgef0234c" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-orgef0234c" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-05-05 11:38:52 +02:00
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible'})} = 'flexible'
end
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
2020-02-03 17:50:32 +01:00
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orgcf18e70" class = "outline-3" >
< h3 id = "orgcf18e70" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-orgcf18e70" >
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-05-05 11:38:52 +02:00
< div id = "outline-container-orgf9b4f63" class = "outline-3" >
< h3 id = "orgf9b4f63" > Add Type< / h3 >
< div class = "outline-text-3" id = "text-orgf9b4f63" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > switch args.type
case 'none'
2020-02-25 18:10:20 +01:00
axisc.type = 0;
2020-05-05 11:38:52 +02:00
case 'rigid'
2020-02-25 18:10:20 +01:00
axisc.type = 1;
2020-05-05 11:38:52 +02:00
case 'flexible'
2020-02-25 18:10:20 +01:00
axisc.type = 2;
2020-05-05 11:38:52 +02:00
end
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org7ee8ea4" class = "outline-3" >
< h3 id = "org7ee8ea4" > Material and Geometry< / h3 >
< div class = "outline-text-3" id = "text-org7ee8ea4" >
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > % Structure
axisc.structure.density = 3400; % [kg/m3]
axisc.structure.STEP = './STEPS/axisc/axisc_structure.STEP';
2020-02-03 17:50:32 +01:00
2020-05-05 11:38:52 +02:00
% Wheel
axisc.wheel.density = 2700; % [kg/m3]
axisc.wheel.STEP = './STEPS/axisc/axisc_wheel.STEP';
2020-02-03 17:50:32 +01:00
2020-05-05 11:38:52 +02:00
% Mass
axisc.mass.density = 7800; % [kg/m3]
axisc.mass.STEP = './STEPS/axisc/axisc_mass.STEP';
2020-02-03 17:50:32 +01:00
2020-05-05 11:38:52 +02:00
% Gear
axisc.gear.density = 7800; % [kg/m3]
axisc.gear.STEP = './STEPS/axisc/axisc_gear.STEP';
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-05-05 11:38:52 +02:00
< div id = "outline-container-org2bfb3df" class = "outline-3" >
< h3 id = "org2bfb3df" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org2bfb3df" >
2020-02-03 17:50:32 +01:00
< p >
The < code > axisc< / code > structure is saved.
< / p >
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > save('./mat/stages.mat', 'axisc', '-append');
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-05-05 11:38:52 +02:00
< div id = "outline-container-orgebffada" class = "outline-3" >
< h3 id = "orgebffada" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-orgebffada" >
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-05-05 11:38:52 +02:00
< div id = "outline-container-org0a7b625" class = "outline-3" >
< h3 id = "org0a7b625" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org0a7b625" >
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" > function [] = initializeMirror(args)
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orgd2ff1cd" class = "outline-3" >
< h3 id = "orgd2ff1cd" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-orgd2ff1cd" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-05-05 11:38:52 +02:00
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible'})} = 'rigid'
args.shape char {mustBeMember(args.shape,{'spherical', 'conical'})} = 'spherical'
args.angle (1,1) double {mustBeNumeric, mustBePositive} = 45 % [deg]
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 10 % [kg]
args.freq (6,1) double {mustBeNumeric, mustBeNonnegative} = 200*ones(6,1) % [Hz]
end
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orgc93419e" class = "outline-3" >
< h3 id = "orgc93419e" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-orgc93419e" >
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > switch args.type
case 'none'
2020-02-25 18:10:20 +01:00
mirror.type = 0;
2020-05-05 11:38:52 +02:00
case 'rigid'
2020-02-25 18:10:20 +01:00
mirror.type = 1;
2020-05-05 11:38:52 +02:00
case 'flexible'
2020-04-17 10:25:44 +02:00
mirror.type = 2;
2020-05-05 11:38:52 +02:00
end
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-05-05 11:38:52 +02:00
< div id = "outline-container-org773a7e1" class = "outline-3" >
< h3 id = "org773a7e1" > Stiffness and Damping properties< / h3 >
< div class = "outline-text-3" id = "text-org773a7e1" >
2020-04-17 10:25:44 +02:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > mirror.K = zeros(6,1);
2020-05-05 11:38:52 +02:00
mirror.K(1:3) = mirror.mass * (2*pi*mirror.freq(1:3)).^2;
2020-04-17 10:25:44 +02:00
mirror.C = zeros(6,1);
2020-05-05 11:38:52 +02:00
mirror.C(1:3) = 0.2 * sqrt(mirror.K(1:3).*mirror.mass);
2020-04-17 10:25:44 +02:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org0e83cc8" class = "outline-3" >
< h3 id = "org0e83cc8" > Equilibrium position of the each joint.< / h3 >
< div class = "outline-text-3" id = "text-org0e83cc8" >
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > mirror.h = 0.05; % Height of the mirror [m]
2020-02-25 18:10:20 +01:00
2020-05-05 11:38:52 +02:00
mirror.thickness = 0.025; % Thickness of the plate supporting the sample [m]
2020-02-25 18:10:20 +01:00
2020-05-05 11:38:52 +02:00
mirror.hole_rad = 0.125; % radius of the hole in the mirror [m]
2020-02-25 18:10:20 +01:00
2020-05-05 11:38:52 +02:00
mirror.support_rad = 0.1; % radius of the support plate [m]
2020-02-25 18:10:20 +01:00
2020-05-05 11:38:52 +02:00
% point of interest offset in z (above the top surfave) [m]
switch args.type
case 'none'
2020-02-25 18:10:20 +01:00
mirror.jacobian = 0.20;
2020-05-05 11:38:52 +02:00
case 'rigid'
mirror.jacobian = 0.20 - mirror.h;
case 'flexible'
mirror.jacobian = 0.20 - mirror.h;
end
2020-02-25 18:10:20 +01:00
2020-05-05 11:38:52 +02:00
mirror.rad = 0.180; % radius of the mirror (at the bottom surface) [m]
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > mirror.cone_length = mirror.rad*tand(args.angle)+mirror.h+mirror.jacobian; % Distance from Apex point of the cone to jacobian point
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-05-05 11:38:52 +02:00
mirror.support_rad+5e-3 mirror.h-mirror.thickness
mirror.hole_rad mirror.h-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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > if strcmp(args.shape, 'spherical')
mirror.sphere_radius = sqrt((mirror.jacobian+mirror.h)^2+mirror.rad^2); % Radius of the sphere [mm]
2020-02-03 17:50:32 +01:00
2020-05-05 11:38:52 +02:00
for z = linspace(0, mirror.h, 101)
mirror.shape = [mirror.shape; sqrt(mirror.sphere_radius^2-(z-mirror.jacobian-mirror.h)^2) z];
end
elseif strcmp(args.shape, 'conical')
mirror.shape = [mirror.shape; mirror.rad+mirror.h/tand(args.angle) mirror.h];
else
error('Shape should be either conical or spherical');
end
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< p >
Finally, we close the shape.
< / p >
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > mirror.shape = [mirror.shape; mirror.support_rad+5e-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-05-05 11:38:52 +02:00
< div id = "outline-container-orgc66f362" class = "outline-3" >
< h3 id = "orgc66f362" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-orgc66f362" >
2020-02-03 17:50:32 +01:00
< p >
The < code > mirror< / code > structure is saved.
< / p >
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > save('./mat/stages.mat', 'mirror', '-append');
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org16c8d40" class = "outline-2" >
< h2 id = "org16c8d40" > < 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-05-05 11:38:52 +02:00
< div id = "outline-container-org3538130" class = "outline-3" >
< h3 id = "org3538130" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-org3538130" >
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-05-05 11:38:52 +02:00
< div id = "outline-container-org6e108c8" class = "outline-3" >
< h3 id = "org6e108c8" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org6e108c8" >
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" > function [nano_hexapod] = initializeNanoHexapod(args)
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orgbc67bc9" class = "outline-3" >
< h3 id = "orgbc67bc9" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-orgbc67bc9" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-05-05 11:38:52 +02:00
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible', 'init'})} = 'flexible'
% initializeFramesPositions
args.H (1,1) double {mustBeNumeric, mustBePositive} = 90e-3
args.MO_B (1,1) double {mustBeNumeric} = 175e-3
% generateGeneralConfiguration
args.FH (1,1) double {mustBeNumeric, mustBePositive} = 15e-3
args.FR (1,1) double {mustBeNumeric, mustBePositive} = 100e-3
args.FTh (6,1) double {mustBeNumeric} = [-10, 10, 120-10, 120+10, 240-10, 240+10]*(pi/180)
args.MH (1,1) double {mustBeNumeric, mustBePositive} = 15e-3
args.MR (1,1) double {mustBeNumeric, mustBePositive} = 90e-3
args.MTh (6,1) double {mustBeNumeric} = [-60+10, 60-10, 60+10, 180-10, 180+10, -60-10]*(pi/180)
% initializeStrutDynamics
args.actuator char {mustBeMember(args.actuator,{'piezo', 'lorentz'})} = 'piezo'
args.k (1,1) double {mustBeNumeric} = -1
args.c (1,1) double {mustBeNumeric} = -1
% initializeJointDynamics
args.type_F char {mustBeMember(args.type_F,{'universal', 'spherical', 'universal_p', 'spherical_p', 'universal_3dof'})} = 'universal'
args.type_M char {mustBeMember(args.type_M,{'universal', 'spherical', 'universal_p', 'spherical_p', 'spherical_3dof'})} = 'spherical'
args.Kf_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 15*ones(6,1)
args.Cf_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e-4*ones(6,1)
args.Kt_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 20*ones(6,1)
args.Ct_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e-3*ones(6,1)
args.Kz_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 60e6*ones(6,1)
args.Cz_M (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e2*ones(6,1)
args.Kf_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 15*ones(6,1)
args.Cf_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e-4*ones(6,1)
args.Kt_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 20*ones(6,1)
args.Ct_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e-3*ones(6,1)
args.Kz_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 60e6*ones(6,1)
args.Cz_F (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e2*ones(6,1)
% initializeCylindricalPlatforms
2020-02-03 17:50:32 +01:00
args.Fpm (1,1) double {mustBeNumeric, mustBePositive} = 1
2020-05-05 11:38:52 +02:00
args.Fph (1,1) double {mustBeNumeric, mustBePositive} = 10e-3
args.Fpr (1,1) double {mustBeNumeric, mustBePositive} = 150e-3
2020-02-03 17:50:32 +01:00
args.Mpm (1,1) double {mustBeNumeric, mustBePositive} = 1
2020-05-05 11:38:52 +02:00
args.Mph (1,1) double {mustBeNumeric, mustBePositive} = 10e-3
args.Mpr (1,1) double {mustBeNumeric, mustBePositive} = 120e-3
% initializeCylindricalStruts
2020-02-03 17:50:32 +01:00
args.Fsm (1,1) double {mustBeNumeric, mustBePositive} = 0.1
2020-05-05 11:38:52 +02:00
args.Fsh (1,1) double {mustBeNumeric, mustBePositive} = 50e-3
args.Fsr (1,1) double {mustBeNumeric, mustBePositive} = 5e-3
2020-02-03 17:50:32 +01:00
args.Msm (1,1) double {mustBeNumeric, mustBePositive} = 0.1
2020-05-05 11:38:52 +02:00
args.Msh (1,1) double {mustBeNumeric, mustBePositive} = 50e-3
args.Msr (1,1) double {mustBeNumeric, mustBePositive} = 5e-3
% inverseKinematics
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-05-05 11:38:52 +02:00
% Equilibrium position of each leg
2020-02-03 17:50:32 +01:00
args.dLeq (6,1) double {mustBeNumeric} = zeros(6,1)
2020-05-05 11:38:52 +02:00
% Force that stiffness of each joint should apply at t=0
args.Foffset logical {mustBeNumericOrLogical} = false
end
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org74a22e9" class = "outline-3" >
< h3 id = "org74a22e9" > Function content< / h3 >
< div class = "outline-text-3" id = "text-org74a22e9" >
< div class = "org-src-container" >
< pre class = "src src-matlab" > stewart = initializeStewartPlatform();
stewart = initializeFramesPositions(stewart, 'H', args.H, 'MO_B', args.MO_B);
stewart = generateGeneralConfiguration(stewart, 'FH', args.FH, 'FR', args.FR, 'FTh', args.FTh, 'MH', args.MH, 'MR', args.MR, 'MTh', args.MTh);
stewart = computeJointsPose(stewart);
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-matlab" > if args.k > 0 & & args.c > 0
stewart = initializeStrutDynamics(stewart, 'K', args.k*ones(6,1), 'C', args.c*ones(6,1));
elseif args.k > 0
stewart = initializeStrutDynamics(stewart, 'K', args.k*ones(6,1), 'C', 1.5*sqrt(args.k)*ones(6,1));
elseif strcmp(args.actuator, 'piezo')
stewart = initializeStrutDynamics(stewart, 'K', 1e7*ones(6,1), 'C', 1e2*ones(6,1));
elseif strcmp(args.actuator, 'lorentz')
stewart = initializeStrutDynamics(stewart, 'K', 1e4*ones(6,1), 'C', 1e2*ones(6,1));
else
error('args.actuator should be piezo or lorentz');
end
< / 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, ...
'type_F', args.type_F, ...
'type_M', args.type_M, ...
'Kf_M' , args.Kf_M, ...
'Cf_M' , args.Cf_M, ...
'Kt_M' , args.Kt_M, ...
'Ct_M' , args.Ct_M, ...
'Kz_M' , args.Kz_M, ...
'Cz_M' , args.Cz_M, ...
'Kf_F' , args.Kf_F, ...
'Cf_F' , args.Cf_F, ...
'Kt_F' , args.Kt_F, ...
'Ct_F' , args.Ct_F, ...
'Kz_F' , args.Kz_F, ...
'Cz_F' , args.Cz_F);
2020-04-03 18:04:47 +02:00
< / pre >
< / div >
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > stewart = initializeCylindricalPlatforms(stewart, 'Fpm', args.Fpm, 'Fph', args.Fph, 'Fpr', args.Fpr, 'Mpm', args.Mpm, 'Mph', args.Mph, 'Mpr', args.Mpr);
stewart = initializeCylindricalStruts(stewart, 'Fsm', args.Fsm, 'Fsh', args.Fsh, 'Fsr', args.Fsr, 'Msm', args.Msm, 'Msh', args.Msh, 'Msr', args.Msr);
stewart = computeJacobian(stewart);
stewart = initializeStewartPose(stewart, 'AP', args.AP, 'ARB', args.ARB);
2020-04-03 18:04:47 +02:00
< / pre >
< / div >
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > stewart = initializeInertialSensor(stewart, 'type', 'accelerometer');
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-05-05 11:38:52 +02:00
if args.Foffset & & ~strcmp(args.type, 'none') & & ~strcmp(args.type, 'rigid') & & ~strcmp(args.type, 'init')
load('mat/Foffset.mat', 'Fnm');
stewart.actuators.dLeq = -Fnm'./stewart.Ki;
else
stewart.actuators.dLeq = args.dLeq;
end
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
2020-02-25 18:10:20 +01:00
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org0533a9d" class = "outline-3" >
< h3 id = "org0533a9d" > Add Type< / h3 >
< div class = "outline-text-3" id = "text-org0533a9d" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > switch args.type
case 'none'
stewart.type = 0;
case 'rigid'
stewart.type = 1;
case 'flexible'
stewart.type = 2;
case 'init'
stewart.type = 4;
end
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org2bdf2bc" class = "outline-3" >
< h3 id = "org2bdf2bc" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org2bdf2bc" >
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;
save('./mat/stages.mat', 'nano_hexapod', '-append');
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-05-05 11:38:52 +02:00
< div id = "outline-container-org849e75c" class = "outline-3" >
< h3 id = "org849e75c" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-org849e75c" >
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-05-05 11:38:52 +02:00
< div id = "outline-container-org71549c6" class = "outline-3" >
< h3 id = "org71549c6" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org71549c6" >
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" > function [sample] = initializeSample(args)
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orgf81789f" class = "outline-3" >
< h3 id = "orgf81789f" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-orgf81789f" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-05-05 11:38:52 +02:00
args.type char {mustBeMember(args.type,{'rigid', 'flexible', 'none', 'init'})} = 'flexible'
args.radius (1,1) double {mustBeNumeric, mustBePositive} = 0.1 % [m]
args.height (1,1) double {mustBeNumeric, mustBePositive} = 0.3 % [m]
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 50 % [kg]
args.freq (6,1) double {mustBeNumeric, mustBePositive} = 100*ones(6,1) % [Hz]
args.offset (1,1) double {mustBeNumeric} = 0 % [m]
args.Foffset logical {mustBeNumericOrLogical} = false
end
2019-12-11 17:09:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org03107a5" class = "outline-3" >
< h3 id = "org03107a5" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org03107a5" >
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > switch args.type
case 'none'
2020-02-25 18:10:20 +01:00
sample.type = 0;
2020-05-05 11:38:52 +02:00
case 'rigid'
2020-02-25 18:10:20 +01:00
sample.type = 1;
2020-05-05 11:38:52 +02:00
case 'flexible'
2020-02-25 18:10:20 +01:00
sample.type = 2;
2020-05-05 11:38:52 +02:00
case 'init'
2020-02-25 18:10:20 +01:00
sample.type = 3;
2020-05-05 11:38:52 +02:00
end
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-02-03 17:50:32 +01:00
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org10cd272" class = "outline-3" >
< h3 id = "org10cd272" > Material and Geometry< / h3 >
< div class = "outline-text-3" id = "text-org10cd272" >
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > sample.radius = args.radius; % [m]
sample.height = args.height; % [m]
sample.mass = args.mass; % [kg]
sample.offset = args.offset; % [m]
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > sample.inertia = [1/12 * sample.mass * (3*sample.radius^2 + sample.height^2); ...
1/12 * sample.mass * (3*sample.radius^2 + sample.height^2); ...
1/2 * sample.mass * sample.radius^2];
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org334e053" class = "outline-3" >
< h3 id = "org334e053" > Stiffness and Damping properties< / h3 >
< div class = "outline-text-3" id = "text-org334e053" >
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > sample.K(1:3) = sample.mass .* (2*pi * args.freq(1:3)).^2; % [N/m]
sample.C(1:3) = 0.1 * sqrt(sample.K(1:3)*sample.mass); % [N/(m/s)]
2020-04-01 16:17:26 +02:00
< / pre >
< / div >
< p >
Rotational Stiffness and Damping:
< / p >
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > sample.K(4:6) = sample.inertia .* (2*pi * args.freq(4:6)).^2; % [N/m]
sample.C(4:6) = 0.1 * sqrt(sample.K(4:6).*sample.inertia); % [N/(m/s)]
2020-04-01 16:17:26 +02:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org22b74be" class = "outline-3" >
< h3 id = "org22b74be" > Equilibrium position of the each joint.< / h3 >
< div class = "outline-text-3" id = "text-org22b74be" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > if args.Foffset & & ~strcmp(args.type, 'none') & & ~strcmp(args.type, 'rigid') & & ~strcmp(args.type, 'init')
load('mat/Foffset.mat', 'Fsm');
sample.Deq = -Fsm'./sample.K;
else
2020-04-01 16:17:26 +02:00
sample.Deq = zeros(6,1);
2020-05-05 11:38:52 +02:00
end
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-02-03 17:50:32 +01:00
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org7316bd1" class = "outline-3" >
< h3 id = "org7316bd1" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org7316bd1" >
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > save('./mat/stages.mat', 'sample', '-append');
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-05-05 11:38:52 +02:00
< div id = "outline-container-orgb134e02" class = "outline-3" >
< h3 id = "orgb134e02" > Function Declaration and Documentation< / h3 >
< div class = "outline-text-3" id = "text-orgb134e02" >
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" > function [] = initializeController(args)
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-05-05 11:38:52 +02:00
< div id = "outline-container-orgcb5cea2" class = "outline-3" >
< h3 id = "orgcb5cea2" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-orgcb5cea2" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-05-05 11:38:52 +02:00
args.type char {mustBeMember(args.type,{'open-loop', 'iff', 'dvf', 'hac-dvf', 'ref-track-L', 'ref-track-iff-L', 'cascade-hac-lac', 'hac-iff', 'stabilizing'})} = 'open-loop'
end
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org6e3d43a" class = "outline-3" >
< h3 id = "org6e3d43a" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org6e3d43a" >
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > switch args.type
case 'open-loop'
2020-02-25 18:10:20 +01:00
controller.type = 1;
2020-05-05 11:38:52 +02:00
controller.name = 'Open-Loop';
case 'dvf'
2020-02-25 18:10:20 +01:00
controller.type = 2;
2020-05-05 11:38:52 +02:00
controller.name = 'Decentralized Direct Velocity Feedback';
case 'iff'
2020-02-25 18:10:20 +01:00
controller.type = 3;
2020-05-05 11:38:52 +02:00
controller.name = 'Decentralized Integral Force Feedback';
case 'hac-dvf'
2020-03-13 17:40:22 +01:00
controller.type = 4;
2020-05-05 11:38:52 +02:00
controller.name = 'HAC-DVF';
case 'ref-track-L'
2020-03-23 10:05:32 +01:00
controller.type = 5;
2020-05-05 11:38:52 +02:00
controller.name = 'Reference Tracking in the frame of the legs';
case 'ref-track-iff-L'
2020-03-23 10:05:32 +01:00
controller.type = 6;
2020-05-05 11:38:52 +02:00
controller.name = 'Reference Tracking in the frame of the legs + IFF';
case 'cascade-hac-lac'
2020-03-23 10:05:32 +01:00
controller.type = 7;
2020-05-05 11:38:52 +02:00
controller.name = 'Cascade Control + HAC-LAC';
case 'hac-iff'
2020-03-25 19:23:22 +01:00
controller.type = 8;
2020-05-05 11:38:52 +02:00
controller.name = 'HAC-IFF';
case 'stabilizing'
2020-04-03 18:04:47 +02:00
controller.type = 9;
2020-05-05 11:38:52 +02:00
controller.name = 'Stabilizing Controller';
end
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orga766ac2" class = "outline-3" >
< h3 id = "orga766ac2" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-orga766ac2" >
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > save('./mat/controller.mat', 'controller');
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-05-05 11:38:52 +02:00
< div id = "outline-container-orgbe1b3ce" class = "outline-3" >
< h3 id = "orgbe1b3ce" > Function Declaration and Documentation< / h3 >
< div class = "outline-text-3" id = "text-orgbe1b3ce" >
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" > function [ref] = initializeReferences(args)
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orgb74cc41" class = "outline-3" >
< h3 id = "orgb74cc41" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-orgb74cc41" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-05-05 11:38:52 +02:00
% Sampling Frequency [s]
args.Ts (1,1) double {mustBeNumeric, mustBePositive} = 1e-3
% Maximum simulation time [s]
2020-02-03 17:50:32 +01:00
args.Tmax (1,1) double {mustBeNumeric, mustBePositive} = 100
2020-05-05 11:38:52 +02:00
% Either "constant" / "triangular" / "sinusoidal"
args.Dy_type char {mustBeMember(args.Dy_type,{'constant', 'triangular', 'sinusoidal'})} = 'constant'
% Amplitude of the displacement [m]
2020-02-03 17:50:32 +01:00
args.Dy_amplitude (1,1) double {mustBeNumeric} = 0
2020-05-05 11:38:52 +02:00
% Period of the displacement [s]
2020-02-03 17:50:32 +01:00
args.Dy_period (1,1) double {mustBeNumeric, mustBePositive} = 1
2020-05-05 11:38:52 +02:00
% Either "constant" / "triangular" / "sinusoidal"
args.Ry_type char {mustBeMember(args.Ry_type,{'constant', 'triangular', 'sinusoidal'})} = 'constant'
% Amplitude [rad]
2020-02-03 17:50:32 +01:00
args.Ry_amplitude (1,1) double {mustBeNumeric} = 0
2020-05-05 11:38:52 +02:00
% Period of the displacement [s]
2020-02-03 17:50:32 +01:00
args.Ry_period (1,1) double {mustBeNumeric, mustBePositive} = 1
2020-05-05 11:38:52 +02:00
% Either "constant" / "rotating"
args.Rz_type char {mustBeMember(args.Rz_type,{'constant', 'rotating', 'rotating-not-filtered'})} = 'constant'
% Initial angle [rad]
2020-02-03 17:50:32 +01:00
args.Rz_amplitude (1,1) double {mustBeNumeric} = 0
2020-05-05 11:38:52 +02:00
% Period of the rotating [s]
2020-02-03 17:50:32 +01:00
args.Rz_period (1,1) double {mustBeNumeric, mustBePositive} = 1
2020-05-05 11:38:52 +02:00
% For now, only constant is implemented
args.Dh_type char {mustBeMember(args.Dh_type,{'constant'})} = 'constant'
% Initial position [m,m,m,rad,rad,rad] of the top platform (Pitch-Roll-Yaw Euler angles)
2020-02-03 17:50:32 +01:00
args.Dh_pos (6,1) double {mustBeNumeric} = zeros(6, 1), ...
2020-05-05 11:38:52 +02:00
% For now, only constant is implemented
args.Rm_type char {mustBeMember(args.Rm_type,{'constant'})} = 'constant'
% Initial position of the two masses
args.Rm_pos (2,1) double {mustBeNumeric} = [0; pi]
% For now, only constant is implemented
args.Dn_type char {mustBeMember(args.Dn_type,{'constant'})} = 'constant'
% Initial position [m,m,m,rad,rad,rad] of the top platform
2020-02-03 17:50:32 +01:00
args.Dn_pos (6,1) double {mustBeNumeric} = zeros(6,1)
2020-05-05 11:38:52 +02:00
end
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > %% Set Sampling Time
2020-02-03 17:50:32 +01:00
Ts = args.Ts;
Tmax = args.Tmax;
2020-05-05 11:38:52 +02:00
%% Low Pass Filter to filter out the references
s = zpk('s');
w0 = 2*pi*10;
2020-02-03 17:50:32 +01:00
xi = 1;
2020-05-05 11:38:52 +02:00
H_lpf = 1/(1 + 2*xi/w0*s + s^2/w0^2);
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org9a6562c" class = "outline-3" >
< h3 id = "org9a6562c" > Translation Stage< / h3 >
< div class = "outline-text-3" id = "text-org9a6562c" >
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" > %% Translation stage - Dy
t = 0:Ts:Tmax; % Time Vector [s]
2020-02-03 17:50:32 +01:00
Dy = zeros(length(t), 1);
Dyd = zeros(length(t), 1);
Dydd = zeros(length(t), 1);
2020-05-05 11:38:52 +02:00
switch args.Dy_type
case 'constant'
Dy(:) = args.Dy_amplitude;
Dyd(:) = 0;
Dydd(:) = 0;
case 'triangular'
% This is done to unsure that we start with no displacement
Dy_raw = args.Dy_amplitude*sawtooth(2*pi*t/args.Dy_period,1/2);
i0 = find(t> =args.Dy_period/4,1);
Dy(1:end-i0+1) = Dy_raw(i0:end);
Dy(end-i0+2:end) = Dy_raw(end); % we fix the last value
% The signal is filtered out
2020-02-03 17:50:32 +01:00
Dy = lsim(H_lpf, Dy, t);
2020-05-05 11:38:52 +02:00
Dyd = lsim(H_lpf*s, Dy, t);
Dydd = lsim(H_lpf*s^2, Dy, t);
case 'sinusoidal'
Dy(:) = args.Dy_amplitude*sin(2*pi/args.Dy_period*t);
Dyd = args.Dy_amplitude*2*pi/args.Dy_period*cos(2*pi/args.Dy_period*t);
Dydd = -args.Dy_amplitude*(2*pi/args.Dy_period)^2*sin(2*pi/args.Dy_period*t);
otherwise
warning('Dy_type is not set correctly');
end
2020-02-03 17:50:32 +01:00
2020-05-05 11:38:52 +02:00
Dy = struct('time', t, 'signals', struct('values', Dy), 'deriv', Dyd, 'dderiv', Dydd);
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org005e07a" class = "outline-3" >
< h3 id = "org005e07a" > Tilt Stage< / h3 >
< div class = "outline-text-3" id = "text-org005e07a" >
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" > %% Tilt Stage - Ry
t = 0:Ts:Tmax; % Time Vector [s]
2020-02-03 17:50:32 +01:00
Ry = zeros(length(t), 1);
Ryd = zeros(length(t), 1);
Rydd = zeros(length(t), 1);
2020-05-05 11:38:52 +02:00
switch args.Ry_type
case 'constant'
Ry(:) = args.Ry_amplitude;
Ryd(:) = 0;
Rydd(:) = 0;
case 'triangular'
Ry_raw = args.Ry_amplitude*sawtooth(2*pi*t/args.Ry_period,1/2);
i0 = find(t> =args.Ry_period/4,1);
Ry(1:end-i0+1) = Ry_raw(i0:end);
Ry(end-i0+2:end) = Ry_raw(end); % we fix the last value
% The signal is filtered out
2020-02-03 17:50:32 +01:00
Ry = lsim(H_lpf, Ry, t);
2020-05-05 11:38:52 +02:00
Ryd = lsim(H_lpf*s, Ry, t);
Rydd = lsim(H_lpf*s^2, Ry, t);
case 'sinusoidal'
Ry(:) = args.Ry_amplitude*sin(2*pi/args.Ry_period*t);
2020-02-03 17:50:32 +01:00
2020-05-05 11:38:52 +02:00
Ryd = args.Ry_amplitude*2*pi/args.Ry_period*cos(2*pi/args.Ry_period*t);
Rydd = -args.Ry_amplitude*(2*pi/args.Ry_period)^2*sin(2*pi/args.Ry_period*t);
otherwise
warning('Ry_type is not set correctly');
end
2020-02-03 17:50:32 +01:00
2020-05-05 11:38:52 +02:00
Ry = struct('time', t, 'signals', struct('values', Ry), 'deriv', Ryd, 'dderiv', Rydd);
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orge49a64e" class = "outline-3" >
< h3 id = "orge49a64e" > Spindle< / h3 >
< div class = "outline-text-3" id = "text-orge49a64e" >
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" > %% Spindle - Rz
t = 0:Ts:Tmax; % Time Vector [s]
2020-02-03 17:50:32 +01:00
Rz = zeros(length(t), 1);
Rzd = zeros(length(t), 1);
Rzdd = zeros(length(t), 1);
2020-05-05 11:38:52 +02:00
switch args.Rz_type
case 'constant'
Rz(:) = args.Rz_amplitude;
Rzd(:) = 0;
Rzdd(:) = 0;
case 'rotating-not-filtered'
Rz(:) = 2*pi/args.Rz_period*t;
2020-04-03 18:04:47 +02:00
2020-05-05 11:38:52 +02:00
% The signal is filtered out
Rz(:) = 2*pi/args.Rz_period*t;
Rzd(:) = 2*pi/args.Rz_period;
Rzdd(:) = 0;
2020-04-03 18:04:47 +02:00
2020-05-05 11:38:52 +02:00
% We add the angle offset
Rz = Rz + args.Rz_amplitude;
2020-04-03 18:04:47 +02:00
2020-05-05 11:38:52 +02:00
case 'rotating'
Rz(:) = 2*pi/args.Rz_period*t;
2020-02-03 17:50:32 +01:00
2020-05-05 11:38:52 +02:00
% The signal is filtered out
2020-02-03 17:50:32 +01:00
Rz = lsim(H_lpf, Rz, t);
2020-05-05 11:38:52 +02:00
Rzd = lsim(H_lpf*s, Rz, t);
Rzdd = lsim(H_lpf*s^2, Rz, t);
2020-02-25 18:10:20 +01:00
2020-05-05 11:38:52 +02:00
% We add the angle offset
Rz = Rz + args.Rz_amplitude;
otherwise
warning('Rz_type is not set correctly');
end
2020-02-03 17:50:32 +01:00
2020-05-05 11:38:52 +02:00
Rz = struct('time', t, 'signals', struct('values', Rz), 'deriv', Rzd, 'dderiv', Rzdd);
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orgf16b0ab" class = "outline-3" >
< h3 id = "orgf16b0ab" > Micro Hexapod< / h3 >
< div class = "outline-text-3" id = "text-orgf16b0ab" >
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" > %% Micro-Hexapod
2020-02-03 17:50:32 +01:00
t = [0, Ts];
Dh = zeros(length(t), 6);
Dhl = zeros(length(t), 6);
2020-05-05 11:38:52 +02:00
switch args.Dh_type
case 'constant'
2020-02-03 17:50:32 +01:00
Dh = [args.Dh_pos, args.Dh_pos];
2020-05-05 11:38:52 +02:00
load('mat/stages.mat', 'micro_hexapod');
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-05-05 11:38:52 +02:00
ARB = [cos(tz) -sin(tz) 0;
2020-02-03 17:50:32 +01:00
sin(tz) cos(tz) 0;
2020-05-05 11:38:52 +02:00
0 0 1]*...
2020-02-03 17:50:32 +01:00
[ cos(ty) 0 sin(ty);
0 1 0;
2020-05-05 11:38:52 +02:00
-sin(ty) 0 cos(ty)]*...
2020-02-03 17:50:32 +01:00
[1 0 0;
2020-05-05 11:38:52 +02:00
0 cos(tx) -sin(tx);
2020-02-03 17:50:32 +01:00
0 sin(tx) cos(tx)];
2020-05-05 11:38:52 +02:00
[~, Dhl] = inverseKinematics(micro_hexapod, 'AP', AP, 'ARB', ARB);
2020-02-03 17:50:32 +01:00
Dhl = [Dhl, Dhl];
2020-05-05 11:38:52 +02:00
otherwise
warning('Dh_type is not set correctly');
end
2020-02-03 17:50:32 +01:00
2020-05-05 11:38:52 +02:00
Dh = struct('time', t, 'signals', struct('values', Dh));
Dhl = struct('time', t, 'signals', struct('values', 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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > %% Axis Compensation - Rm
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-05-05 11:38:52 +02:00
Rm = struct('time', t, 'signals', struct('values', Rm));
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org2516704" class = "outline-3" >
< h3 id = "org2516704" > Nano Hexapod< / h3 >
< div class = "outline-text-3" id = "text-org2516704" >
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
2020-02-03 17:50:32 +01:00
t = [0, Ts];
Dn = zeros(length(t), 6);
2020-05-05 11:38:52 +02:00
switch args.Dn_type
case 'constant'
2020-02-03 17:50:32 +01:00
Dn = [args.Dn_pos, args.Dn_pos];
2020-02-25 18:10:20 +01:00
2020-05-05 11:38:52 +02:00
load('mat/stages.mat', 'nano_hexapod');
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-05-05 11:38:52 +02:00
ARB = [cos(tz) -sin(tz) 0;
2020-02-25 18:10:20 +01:00
sin(tz) cos(tz) 0;
2020-05-05 11:38:52 +02:00
0 0 1]*...
2020-02-25 18:10:20 +01:00
[ cos(ty) 0 sin(ty);
0 1 0;
2020-05-05 11:38:52 +02:00
-sin(ty) 0 cos(ty)]*...
2020-02-25 18:10:20 +01:00
[1 0 0;
2020-05-05 11:38:52 +02:00
0 cos(tx) -sin(tx);
2020-02-25 18:10:20 +01:00
0 sin(tx) cos(tx)];
2020-05-05 11:38:52 +02:00
[~, Dnl] = inverseKinematics(nano_hexapod, 'AP', AP, 'ARB', ARB);
2020-02-25 18:10:20 +01:00
Dnl = [Dnl, Dnl];
2020-05-05 11:38:52 +02:00
otherwise
warning('Dn_type is not set correctly');
end
2019-12-11 17:09:32 +01:00
2020-05-05 11:38:52 +02:00
Dn = struct('time', t, 'signals', struct('values', Dn));
Dnl = struct('time', t, 'signals', struct('values', Dnl));
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2019-12-11 17:09:32 +01:00
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org2b550dd" class = "outline-3" >
< h3 id = "org2b550dd" > Save< / h3 >
< div class = "outline-text-3" id = "text-org2b550dd" >
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" > %% Save
save('./mat/nass_references.mat', 'Dy', 'Ry', 'Rz', 'Dh', 'Dhl', 'Rm', 'Dn', 'Dnl', 'args', 'Ts');
end
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-05-05 11:38:52 +02:00
< div id = "outline-container-orga1fa4b5" class = "outline-3" >
< h3 id = "orga1fa4b5" > Function Declaration and Documentation< / h3 >
< div class = "outline-text-3" id = "text-orga1fa4b5" >
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" > function [] = initializeDisturbances(args)
% initializeDisturbances - Initialize the disturbances
%
% Syntax: [] = initializeDisturbances(args)
%
% Inputs:
% - args -
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orgbde77ba" class = "outline-3" >
< h3 id = "orgbde77ba" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-orgbde77ba" >
2020-02-03 17:50:32 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-05-05 11:38:52 +02:00
% Global parameter to enable or disable the disturbances
args.enable logical {mustBeNumericOrLogical} = true
% Ground Motion - X direction
args.Dwx logical {mustBeNumericOrLogical} = true
% Ground Motion - Y direction
args.Dwy logical {mustBeNumericOrLogical} = true
% Ground Motion - Z direction
args.Dwz logical {mustBeNumericOrLogical} = true
% Translation Stage - X direction
args.Fty_x logical {mustBeNumericOrLogical} = true
% Translation Stage - Z direction
args.Fty_z logical {mustBeNumericOrLogical} = true
% Spindle - Z direction
args.Frz_z logical {mustBeNumericOrLogical} = true
end
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > load('./mat/dist_psd.mat', 'dist_f');
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > Fs = 2*dist_f.f(end); % Sampling Frequency of data is twice the maximum frequency of the PSD vector [Hz]
N = 2*length(dist_f.f); % Number of Samples match the one of the wanted PSD
T0 = N/Fs; % Signal Duration [s]
df = 1/T0; % Frequency resolution of the DFT [Hz]
% Also equal to (dist_f.f(2)-dist_f.f(1))
t = linspace(0, T0, N+1)'; % Time Vector [s]
Ts = 1/Fs; % Sampling Time [s]
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-05-05 11:38:52 +02:00
C = zeros(N/2,1);
for i = 1:N/2
C(i) = sqrt(phi(i)*df);
end
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > if args.Dwx & & args.enable
rng(111);
theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
Cx = [0 ; C.*complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2:end)))];;
Dwx = N/sqrt(2)*ifft(Cx); % Ground Motion - x direction [m]
else
2020-02-03 17:50:32 +01:00
Dwx = zeros(length(t), 1);
2020-05-05 11:38:52 +02:00
end
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > if args.Dwy & & args.enable
rng(112);
theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
Cx = [0 ; C.*complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2:end)))];;
Dwy = N/sqrt(2)*ifft(Cx); % Ground Motion - y direction [m]
else
2020-02-03 17:50:32 +01:00
Dwy = zeros(length(t), 1);
2020-05-05 11:38:52 +02:00
end
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > if args.Dwy & & args.enable
rng(113);
theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
Cx = [0 ; C.*complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2:end)))];;
Dwz = N/sqrt(2)*ifft(Cx); % Ground Motion - z direction [m]
else
2020-02-03 17:50:32 +01:00
Dwz = zeros(length(t), 1);
2020-05-05 11:38:52 +02:00
end
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > if args.Fty_x & & args.enable
phi = dist_f.psd_ty; % TODO - we take here the vertical direction which is wrong but approximate
C = zeros(N/2,1);
for i = 1:N/2
C(i) = sqrt(phi(i)*df);
end
rng(121);
theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
Cx = [0 ; C.*complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2:end)))];;
u = N/sqrt(2)*ifft(Cx); % Disturbance Force Ty x [N]
2020-02-03 17:50:32 +01:00
Fty_x = u;
2020-05-05 11:38:52 +02:00
else
2020-02-03 17:50:32 +01:00
Fty_x = zeros(length(t), 1);
2020-05-05 11:38:52 +02:00
end
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > if args.Fty_z & & args.enable
2020-02-03 17:50:32 +01:00
phi = dist_f.psd_ty;
2020-05-05 11:38:52 +02:00
C = zeros(N/2,1);
for i = 1:N/2
C(i) = sqrt(phi(i)*df);
end
rng(122);
theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
Cx = [0 ; C.*complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2:end)))];;
u = N/sqrt(2)*ifft(Cx); % Disturbance Force Ty z [N]
2020-02-03 17:50:32 +01:00
Fty_z = u;
2020-05-05 11:38:52 +02:00
else
2020-02-03 17:50:32 +01:00
Fty_z = zeros(length(t), 1);
2020-05-05 11:38:52 +02:00
end
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > if args.Frz_z & & args.enable
2020-02-03 17:50:32 +01:00
phi = dist_f.psd_rz;
2020-05-05 11:38:52 +02:00
C = zeros(N/2,1);
for i = 1:N/2
C(i) = sqrt(phi(i)*df);
end
rng(131);
theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
Cx = [0 ; C.*complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2:end)))];;
u = N/sqrt(2)*ifft(Cx); % Disturbance Force Rz z [N]
2020-02-03 17:50:32 +01:00
Frz_z = u;
2020-05-05 11:38:52 +02:00
else
2020-02-03 17:50:32 +01:00
Frz_z = zeros(length(t), 1);
2020-05-05 11:38:52 +02:00
end
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > Dwx = Dwx - Dwx(1);
Dwy = Dwy - Dwy(1);
Dwz = Dwz - Dwz(1);
Fty_x = Fty_x - Fty_x(1);
Fty_z = Fty_z - Fty_z(1);
Frz_z = Frz_z - Frz_z(1);
2020-02-03 17:50:32 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-orgf084184" class = "outline-3" >
< h3 id = "orgf084184" > Save< / h3 >
< div class = "outline-text-3" id = "text-orgf084184" >
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" > save('./mat/nass_disturbances.mat', 'Dwx', 'Dwy', 'Dwz', 'Fty_x', 'Fty_z', 'Frz_z', 'Fd', 'Ts', 't', 'args');
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-05-05 11:38:52 +02:00
< div id = "outline-container-orgbaecbcc" class = "outline-3" >
< h3 id = "orgbaecbcc" > Function Declaration and Documentation< / h3 >
< div class = "outline-text-3" id = "text-orgbaecbcc" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > function [] = initializePosError(args)
% initializePosError - Initialize the position errors
%
% Syntax: [] = initializePosError(args)
%
% Inputs:
% - args -
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org4eb7ed1" class = "outline-3" >
< h3 id = "org4eb7ed1" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org4eb7ed1" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
< pre class = "src src-matlab" > arguments
2020-05-05 11:38:52 +02:00
args.error logical {mustBeNumericOrLogical} = false
args.Dy (1,1) double {mustBeNumeric} = 0 % [m]
args.Ry (1,1) double {mustBeNumeric} = 0 % [m]
args.Rz (1,1) double {mustBeNumeric} = 0 % [m]
end
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-05 11:38:52 +02:00
< div id = "outline-container-org0273d6e" class = "outline-3" >
< h3 id = "org0273d6e" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org0273d6e" >
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > if args.error
2020-02-25 18:10:20 +01:00
pos_error.type = 1;
2020-05-05 11:38:52 +02:00
else
2020-02-25 18:10:20 +01:00
pos_error.type = 0;
2020-05-05 11:38:52 +02:00
end
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-05-05 11:38:52 +02:00
< div id = "outline-container-orgf26ccc6" class = "outline-3" >
< h3 id = "orgf26ccc6" > Save< / h3 >
< div class = "outline-text-3" id = "text-orgf26ccc6" >
2020-02-25 18:10:20 +01:00
< div class = "org-src-container" >
2020-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > save('./mat/pos_error.mat', 'pos_error');
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > function [geophone] = initializeZAxisGeophone(args)
2020-02-03 17:50:32 +01:00
arguments
2020-05-05 11:38:52 +02:00
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 1e-3 % [kg]
args.freq (1,1) double {mustBeNumeric, mustBePositive} = 1 % [Hz]
end
2019-12-11 17:09:32 +01:00
2020-05-05 11:38:52 +02:00
%%
2020-02-03 17:50:32 +01:00
geophone.m = args.mass;
2019-12-11 17:09:32 +01:00
2020-05-05 11:38:52 +02:00
%% The Stiffness is set to have the damping resonance frequency
geophone.k = geophone.m * (2*pi*args.freq)^2;
2019-12-11 17:09:32 +01:00
2020-05-05 11:38:52 +02:00
%% We set the damping value to have critical damping
geophone.c = 2*sqrt(geophone.m * geophone.k);
2019-12-11 17:09:32 +01:00
2020-05-05 11:38:52 +02:00
%% Save
save('./mat/geophone_z_axis.mat', 'geophone');
end
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-05-05 11:38:52 +02:00
< pre class = "src src-matlab" > function [accelerometer] = initializeZAxisAccelerometer(args)
2020-02-03 17:50:32 +01:00
arguments
2020-05-05 11:38:52 +02:00
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 1e-3 % [kg]
args.freq (1,1) double {mustBeNumeric, mustBePositive} = 5e3 % [Hz]
end
2020-02-03 17:50:32 +01:00
2020-05-05 11:38:52 +02:00
%%
2020-02-03 17:50:32 +01:00
accelerometer.m = args.mass;
2020-05-05 11:38:52 +02:00
%% The Stiffness is set to have the damping resonance frequency
accelerometer.k = accelerometer.m * (2*pi*args.freq)^2;
2020-02-03 17:50:32 +01:00
2020-05-05 11:38:52 +02:00
%% We set the damping value to have critical damping
accelerometer.c = 2*sqrt(accelerometer.m * accelerometer.k);
2020-02-03 17:50:32 +01:00
2020-05-05 11:38:52 +02:00
%% Gain correction of the accelerometer to have a unity gain until the resonance
accelerometer.gain = -accelerometer.k/accelerometer.m;
2020-02-03 17:50:32 +01:00
2020-05-05 11:38:52 +02:00
%% Save
save('./mat/accelerometer_z_axis.mat', 'accelerometer');
end
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-05-05 11:38:52 +02:00
< p class = "date" > Created: 2020-05-05 mar. 10:33< / p >
2019-12-11 17:09:32 +01:00
< / div >
< / body >
< / html >