2019-12-11 17:09:32 +01:00
<?xml version="1.0" encoding="utf-8"?>
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" lang = "en" xml:lang = "en" >
< head >
2020-05-20 16:41:34 +02:00
<!-- 2020 - 05 - 20 mer. 16:41 -->
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-20 16:41:34 +02:00
< li > < a href = "#org71549c6" > Function description< / a > < / li >
< li > < a href = "#org4eb7ed1" > Optional Parameters< / a > < / li >
< li > < a href = "#org0273d6e" > Structure initialization< / a > < / li >
< li > < a href = "#org0533a9d" > Add Type< / a > < / li >
< li > < a href = "#orga766ac2" > Save the Structure< / a > < / li >
2020-02-25 18:10:20 +01:00
< / ul >
< / li >
< li > < a href = "#orgdda6840" > 2. Logging Configuration< / a >
< ul >
2020-05-20 16:41:34 +02:00
< li > < a href = "#org90f799b" > Function description< / a > < / li >
< li > < a href = "#org542977b" > Optional Parameters< / a > < / li >
< li > < a href = "#org7e6aef5" > Structure initialization< / a > < / li >
< li > < a href = "#org85a00ab" > Add Type< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org60d91f1" > Sampling Time< / a > < / li >
2020-05-20 16:41:34 +02:00
< li > < a href = "#orge45398b" > 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-20 16:41:34 +02:00
< li > < a href = "#org849e75c" > Simscape Model< / a > < / li >
< li > < a href = "#orgef88347" > Function description< / a > < / li >
< li > < a href = "#orge9001a2" > Optional Parameters< / a > < / li >
< li > < a href = "#org326d9cd" > Structure initialization< / a > < / li >
< li > < a href = "#org7e3f81e" > Add Type< / a > < / li >
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-20 16:41:34 +02:00
< li > < a href = "#orgaf3586d" > 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-20 16:41:34 +02:00
< li > < a href = "#org63e5af5" > Simscape Model< / a > < / li >
< li > < a href = "#org1964327" > Function description< / a > < / li >
< li > < a href = "#org323a4d2" > Optional Parameters< / a > < / li >
< li > < a href = "#org9951928" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org413c06d" > Add Granite Type< / a > < / li >
2020-05-20 16:41:34 +02:00
< li > < a href = "#org10cd272" > Material and Geometry< / a > < / li >
< li > < a href = "#org334e053" > Stiffness and Damping properties< / a > < / li >
< li > < a href = "#org22b74be" > Equilibrium position of the each joint.< / a > < / li >
< li > < a href = "#orgc54eb09" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-05-20 16:41:34 +02:00
< li > < a href = "#org9a6562c" > 5. Translation Stage< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-05-20 16:41:34 +02:00
< li > < a href = "#orge4997dc" > Simscape Model< / a > < / li >
< li > < a href = "#org09bc809" > Function description< / a > < / li >
< li > < a href = "#org21ffabf" > Optional Parameters< / a > < / li >
< li > < a href = "#org6bb4743" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org715e876" > Add Translation Stage Type< / a > < / li >
2020-05-20 16:41:34 +02:00
< li > < a href = "#orgcd38e39" > Material and Geometry< / a > < / li >
< li > < a href = "#orge09c9f6" > Stiffness and Damping properties< / a > < / li >
< li > < a href = "#org8e3c173" > Equilibrium position of the each joint.< / a > < / li >
< li > < a href = "#org1a14fbf" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-05-20 16:41:34 +02:00
< li > < a href = "#org005e07a" > 6. Tilt Stage< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-05-20 16:41:34 +02:00
< li > < a href = "#org07fc6bc" > Simscape Model< / a > < / li >
< li > < a href = "#orgfa2c18a" > Function description< / a > < / li >
< li > < a href = "#org98764fa" > Optional Parameters< / a > < / li >
< li > < a href = "#org7dff4aa" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#orgea3a7ba" > Add Tilt Type< / a > < / li >
2020-05-20 16:41:34 +02:00
< li > < a href = "#org76b4e3d" > Material and Geometry< / a > < / li >
< li > < a href = "#orgb2aa2be" > Stiffness and Damping properties< / a > < / li >
< li > < a href = "#org6b04545" > Equilibrium position of the each joint.< / a > < / li >
< li > < a href = "#orge7788bb" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-05-20 16:41:34 +02:00
< li > < a href = "#orge49a64e" > 7. Spindle< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-05-20 16:41:34 +02:00
< li > < a href = "#orga83b541" > Simscape Model< / a > < / li >
< li > < a href = "#orge0149e5" > Function description< / a > < / li >
< li > < a href = "#org4018244" > Optional Parameters< / a > < / li >
< li > < a href = "#org595008e" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#orge5b17ec" > Add Spindle Type< / a > < / li >
2020-05-20 16:41:34 +02:00
< li > < a href = "#org33822ab" > Material and Geometry< / a > < / li >
< li > < a href = "#org099371d" > Stiffness and Damping properties< / a > < / li >
< li > < a href = "#org7169219" > Equilibrium position of the each joint.< / a > < / li >
< li > < a href = "#orgd01db06" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-05-20 16:41:34 +02:00
< li > < a href = "#orgf16b0ab" > 8. Micro Hexapod< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-05-20 16:41:34 +02:00
< li > < a href = "#org7ce0042" > Simscape Model< / a > < / li >
< li > < a href = "#org8e8fb99" > Function description< / a > < / li >
< li > < a href = "#org678a047" > Optional Parameters< / a > < / li >
< li > < a href = "#org74a22e9" > Function content< / a > < / li >
< li > < a href = "#orged79a97" > Add Type< / a > < / li >
< li > < a href = "#org484999b" > Save the Structure< / a > < / li >
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-20 16:41:34 +02:00
< li > < a href = "#org7be0b08" > Simscape Model< / a > < / li >
< li > < a href = "#org7786362" > Function description< / a > < / li >
< li > < a href = "#org174a7a0" > Optional Parameters< / a > < / li >
< li > < a href = "#org80c2470" > Structure initialization< / a > < / li >
< li > < a href = "#orgc00cdcd" > Add Type< / a > < / li >
< li > < a href = "#org24e9b2c" > Material and Geometry< / a > < / li >
< li > < a href = "#org7c46efe" > Save the Structure< / a > < / li >
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-20 16:41:34 +02:00
< li > < a href = "#orgd6e16a6" > Simscape Model< / a > < / li >
< li > < a href = "#org18a29e3" > Function description< / a > < / li >
< li > < a href = "#orge97107b" > Optional Parameters< / a > < / li >
< li > < a href = "#orgeba3129" > Structure initialization< / a > < / li >
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-20 16:41:34 +02:00
< li > < a href = "#org42b4b18" > Stiffness and Damping properties< / a > < / li >
< li > < a href = "#org48c3eec" > 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-20 16:41:34 +02:00
< li > < a href = "#orgb814645" > Save the Structure< / a > < / li >
2020-02-03 17:50:32 +01:00
< / ul >
< / li >
2020-05-20 16:41:34 +02:00
< li > < a href = "#org2516704" > 11. Nano Hexapod< / a >
2020-02-03 17:50:32 +01:00
< ul >
2020-05-20 16:41:34 +02:00
< li > < a href = "#org56d49c9" > Simscape Model< / a > < / li >
< li > < a href = "#org0016478" > Function description< / a > < / li >
< li > < a href = "#org35f64ed" > Optional Parameters< / a > < / li >
< li > < a href = "#org0737b17" > Function content< / a > < / li >
< li > < a href = "#org3b2b31f" > Add Type< / a > < / li >
< li > < a href = "#org5b7657f" > Save the Structure< / a > < / li >
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-20 16:41:34 +02:00
< li > < a href = "#org4068b6d" > Simscape Model< / a > < / li >
< li > < a href = "#org7cb3c0a" > Function description< / a > < / li >
< li > < a href = "#org45dfb8b" > Optional Parameters< / a > < / li >
< li > < a href = "#org777606d" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org2bb1d24" > Add Sample Type< / a > < / li >
2020-05-20 16:41:34 +02:00
< li > < a href = "#org3bf8f39" > Material and Geometry< / a > < / li >
2020-04-01 16:17:26 +02:00
< li > < a href = "#org228453f" > Compute the Inertia< / a > < / li >
2020-05-20 16:41:34 +02:00
< li > < a href = "#orga217348" > Stiffness and Damping properties< / a > < / li >
< li > < a href = "#orgc6700d2" > Equilibrium position of the each joint.< / a > < / li >
< li > < a href = "#orgb88e566" > Save the Structure< / a > < / li >
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-20 16:41:34 +02:00
< li > < a href = "#orgbaecbcc" > Function Declaration and Documentation< / a > < / li >
< li > < a href = "#org5f24bdc" > Optional Parameters< / a > < / li >
< li > < a href = "#org6e89216" > Structure initialization< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org4207f98" > Controller Type< / a > < / li >
2020-05-20 16:41:34 +02:00
< li > < a href = "#org202f2f5" > 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-20 16:41:34 +02:00
< li > < a href = "#org671c2c2" > Function Declaration and Documentation< / a > < / li >
< li > < a href = "#org5323b00" > Optional Parameters< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#orge94c0c2" > Initialize Parameters< / a > < / li >
2020-05-20 16:41:34 +02:00
< li > < a href = "#orgf66b222" > Translation Stage< / a > < / li >
< li > < a href = "#orga18d111" > Tilt Stage< / a > < / li >
< li > < a href = "#org8d2c73d" > Spindle< / a > < / li >
< li > < a href = "#org8ba04e2" > Micro Hexapod< / a > < / li >
2020-02-25 18:10:20 +01:00
< li > < a href = "#org04d73dc" > Axis Compensation< / a > < / li >
2020-05-20 16:41:34 +02:00
< li > < a href = "#org34337a8" > Nano Hexapod< / a > < / li >
< li > < a href = "#orgf26ccc6" > 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-20 16:41:34 +02:00
< li > < a href = "#orga2a09de" > Function Declaration and Documentation< / a > < / li >
< li > < a href = "#org3bd7db1" > 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-20 16:41:34 +02:00
< li > < a href = "#org38c42fa" > 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-20 16:41:34 +02:00
< li > < a href = "#orgf8f086e" > Function Declaration and Documentation< / a > < / li >
< li > < a href = "#org8dbc80b" > Optional Parameters< / a > < / li >
< li > < a href = "#org5d6b026" > Structure initialization< / a > < / li >
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-20 16:41:34 +02:00
< li > < a href = "#org01d19da" > 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-20 16:41:34 +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-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-20 16:41:34 +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.gravity logical {mustBeNumericOrLogical} = true
end
2020-02-25 18:10:20 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-20 16:41:34 +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
< div class = "org-src-container" >
< pre class = "src src-matlab" > conf_simscape = struct();
< / pre >
< / div >
< / div >
< / div >
2020-05-20 16:41:34 +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" > 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-20 16:41:34 +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-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-20 16:41:34 +02:00
< div id = "outline-container-org90f799b" class = "outline-3" >
< h3 id = "org90f799b" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org90f799b" >
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-20 16:41:34 +02:00
< div id = "outline-container-org542977b" class = "outline-3" >
< h3 id = "org542977b" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org542977b" >
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-20 16:41:34 +02:00
< div id = "outline-container-org7e6aef5" class = "outline-3" >
< h3 id = "org7e6aef5" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org7e6aef5" >
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-20 16:41:34 +02:00
< div id = "outline-container-org85a00ab" class = "outline-3" >
< h3 id = "org85a00ab" > Add Type< / h3 >
< div class = "outline-text-3" id = "text-org85a00ab" >
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-20 16:41:34 +02:00
< div id = "outline-container-orge45398b" class = "outline-3" >
< h3 id = "orge45398b" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-orge45398b" >
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-20 16:41:34 +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 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-20 16:41:34 +02:00
< div id = "outline-container-orgef88347" class = "outline-3" >
< h3 id = "orgef88347" > Function description< / h3 >
< div class = "outline-text-3" id = "text-orgef88347" >
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-20 16:41:34 +02:00
< div id = "outline-container-orge9001a2" class = "outline-3" >
< h3 id = "orge9001a2" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-orge9001a2" >
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-20 16:41:34 +02:00
< div id = "outline-container-org326d9cd" class = "outline-3" >
< h3 id = "org326d9cd" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org326d9cd" >
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-20 16:41:34 +02:00
< div id = "outline-container-org7e3f81e" class = "outline-3" >
< h3 id = "org7e3f81e" > Add Type< / h3 >
< div class = "outline-text-3" id = "text-org7e3f81e" >
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-20 16:41:34 +02:00
< div id = "outline-container-orgaf3586d" class = "outline-3" >
< h3 id = "orgaf3586d" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-orgaf3586d" >
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-20 16:41:34 +02:00
< div id = "outline-container-org63e5af5" class = "outline-3" >
< h3 id = "org63e5af5" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-org63e5af5" >
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-20 16:41:34 +02:00
< div id = "outline-container-org1964327" class = "outline-3" >
< h3 id = "org1964327" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org1964327" >
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-20 16:41:34 +02:00
< div id = "outline-container-org323a4d2" class = "outline-3" >
< h3 id = "org323a4d2" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org323a4d2" >
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-20 16:41:34 +02:00
< div id = "outline-container-org9951928" class = "outline-3" >
< h3 id = "org9951928" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org9951928" >
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-20 16:41:34 +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" >
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-20 16:41:34 +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-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-20 16:41:34 +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" >
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-20 16:41:34 +02:00
< div id = "outline-container-orgc54eb09" class = "outline-3" >
< h3 id = "orgc54eb09" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-orgc54eb09" >
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-20 16:41:34 +02:00
< div id = "outline-container-org9a6562c" class = "outline-2" >
< h2 id = "org9a6562c" > < 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-20 16:41:34 +02:00
< div id = "outline-container-orge4997dc" class = "outline-3" >
< h3 id = "orge4997dc" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-orge4997dc" >
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-20 16:41:34 +02:00
< div id = "outline-container-org09bc809" class = "outline-3" >
< h3 id = "org09bc809" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org09bc809" >
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-20 16:41:34 +02:00
< div id = "outline-container-org21ffabf" class = "outline-3" >
< h3 id = "org21ffabf" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org21ffabf" >
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-20 16:41:34 +02:00
< div id = "outline-container-org6bb4743" class = "outline-3" >
< h3 id = "org6bb4743" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org6bb4743" >
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-20 16:41:34 +02:00
< div id = "outline-container-orgcd38e39" class = "outline-3" >
< h3 id = "orgcd38e39" > Material and Geometry< / h3 >
< div class = "outline-text-3" id = "text-orgcd38e39" >
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-20 16:41:34 +02:00
< div id = "outline-container-orge09c9f6" class = "outline-3" >
< h3 id = "orge09c9f6" > Stiffness and Damping properties< / h3 >
< div class = "outline-text-3" id = "text-orge09c9f6" >
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-20 16:41:34 +02:00
< div id = "outline-container-org8e3c173" class = "outline-3" >
< h3 id = "org8e3c173" > Equilibrium position of the each joint.< / h3 >
< div class = "outline-text-3" id = "text-org8e3c173" >
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-20 16:41:34 +02:00
< div id = "outline-container-org1a14fbf" class = "outline-3" >
< h3 id = "org1a14fbf" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org1a14fbf" >
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-20 16:41:34 +02:00
< div id = "outline-container-org005e07a" class = "outline-2" >
< h2 id = "org005e07a" > < 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-20 16:41:34 +02:00
< div id = "outline-container-org07fc6bc" class = "outline-3" >
< h3 id = "org07fc6bc" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-org07fc6bc" >
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-20 16:41:34 +02:00
< div id = "outline-container-orgfa2c18a" class = "outline-3" >
< h3 id = "orgfa2c18a" > Function description< / h3 >
< div class = "outline-text-3" id = "text-orgfa2c18a" >
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-20 16:41:34 +02:00
< div id = "outline-container-org98764fa" class = "outline-3" >
< h3 id = "org98764fa" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org98764fa" >
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-20 16:41:34 +02:00
< div id = "outline-container-org7dff4aa" class = "outline-3" >
< h3 id = "org7dff4aa" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org7dff4aa" >
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-20 16:41:34 +02:00
< div id = "outline-container-org76b4e3d" class = "outline-3" >
< h3 id = "org76b4e3d" > Material and Geometry< / h3 >
< div class = "outline-text-3" id = "text-org76b4e3d" >
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-20 16:41:34 +02:00
< div id = "outline-container-orgb2aa2be" class = "outline-3" >
< h3 id = "orgb2aa2be" > Stiffness and Damping properties< / h3 >
< div class = "outline-text-3" id = "text-orgb2aa2be" >
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-20 16:41:34 +02:00
< div id = "outline-container-org6b04545" class = "outline-3" >
< h3 id = "org6b04545" > Equilibrium position of the each joint.< / h3 >
< div class = "outline-text-3" id = "text-org6b04545" >
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-20 16:41:34 +02:00
< div id = "outline-container-orge7788bb" class = "outline-3" >
< h3 id = "orge7788bb" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-orge7788bb" >
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-20 16:41:34 +02:00
< div id = "outline-container-orge49a64e" class = "outline-2" >
< h2 id = "orge49a64e" > < 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-20 16:41:34 +02:00
< div id = "outline-container-orga83b541" class = "outline-3" >
< h3 id = "orga83b541" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-orga83b541" >
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-20 16:41:34 +02:00
< div id = "outline-container-orge0149e5" class = "outline-3" >
< h3 id = "orge0149e5" > Function description< / h3 >
< div class = "outline-text-3" id = "text-orge0149e5" >
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-20 16:41:34 +02:00
< div id = "outline-container-org4018244" class = "outline-3" >
< h3 id = "org4018244" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org4018244" >
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-20 16:41:34 +02:00
< div id = "outline-container-org595008e" class = "outline-3" >
< h3 id = "org595008e" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org595008e" >
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-20 16:41:34 +02:00
< div id = "outline-container-org33822ab" class = "outline-3" >
< h3 id = "org33822ab" > Material and Geometry< / h3 >
< div class = "outline-text-3" id = "text-org33822ab" >
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-20 16:41:34 +02:00
< div id = "outline-container-org099371d" class = "outline-3" >
< h3 id = "org099371d" > Stiffness and Damping properties< / h3 >
< div class = "outline-text-3" id = "text-org099371d" >
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-20 16:41:34 +02:00
< div id = "outline-container-org7169219" class = "outline-3" >
< h3 id = "org7169219" > Equilibrium position of the each joint.< / h3 >
< div class = "outline-text-3" id = "text-org7169219" >
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-20 16:41:34 +02:00
< div id = "outline-container-orgd01db06" class = "outline-3" >
< h3 id = "orgd01db06" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-orgd01db06" >
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-20 16:41:34 +02:00
< div id = "outline-container-orgf16b0ab" class = "outline-2" >
< h2 id = "orgf16b0ab" > < 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-20 16:41:34 +02:00
< div id = "outline-container-org7ce0042" class = "outline-3" >
< h3 id = "org7ce0042" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-org7ce0042" >
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-20 16:41:34 +02:00
< div id = "outline-container-org8e8fb99" class = "outline-3" >
< h3 id = "org8e8fb99" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org8e8fb99" >
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-20 16:41:34 +02:00
< div id = "outline-container-org678a047" class = "outline-3" >
< h3 id = "org678a047" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org678a047" >
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-20 16:41:34 +02:00
< div id = "outline-container-org74a22e9" class = "outline-3" >
< h3 id = "org74a22e9" > Function content< / h3 >
< div class = "outline-text-3" id = "text-org74a22e9" >
2020-05-05 11:38:52 +02:00
< 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-20 16:41:34 +02:00
< div id = "outline-container-orged79a97" class = "outline-3" >
< h3 id = "orged79a97" > Add Type< / h3 >
< div class = "outline-text-3" id = "text-orged79a97" >
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-20 16:41:34 +02:00
< div id = "outline-container-org484999b" class = "outline-3" >
< h3 id = "org484999b" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org484999b" >
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-20 16:41:34 +02:00
< div id = "outline-container-org7be0b08" class = "outline-3" >
< h3 id = "org7be0b08" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-org7be0b08" >
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-20 16:41:34 +02:00
< div id = "outline-container-org7786362" class = "outline-3" >
< h3 id = "org7786362" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org7786362" >
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-20 16:41:34 +02:00
< div id = "outline-container-org174a7a0" class = "outline-3" >
< h3 id = "org174a7a0" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org174a7a0" >
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-20 16:41:34 +02:00
< div id = "outline-container-org80c2470" class = "outline-3" >
< h3 id = "org80c2470" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org80c2470" >
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-20 16:41:34 +02:00
< div id = "outline-container-orgc00cdcd" class = "outline-3" >
< h3 id = "orgc00cdcd" > Add Type< / h3 >
< div class = "outline-text-3" id = "text-orgc00cdcd" >
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-20 16:41:34 +02:00
< div id = "outline-container-org24e9b2c" class = "outline-3" >
< h3 id = "org24e9b2c" > Material and Geometry< / h3 >
< div class = "outline-text-3" id = "text-org24e9b2c" >
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-20 16:41:34 +02:00
< div id = "outline-container-org7c46efe" class = "outline-3" >
< h3 id = "org7c46efe" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org7c46efe" >
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-20 16:41:34 +02:00
< div id = "outline-container-orgd6e16a6" class = "outline-3" >
< h3 id = "orgd6e16a6" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-orgd6e16a6" >
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-20 16:41:34 +02:00
< div id = "outline-container-org18a29e3" class = "outline-3" >
< h3 id = "org18a29e3" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org18a29e3" >
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-20 16:41:34 +02:00
< div id = "outline-container-orge97107b" class = "outline-3" >
< h3 id = "orge97107b" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-orge97107b" >
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-20 16:41:34 +02:00
< div id = "outline-container-orgeba3129" class = "outline-3" >
< h3 id = "orgeba3129" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-orgeba3129" >
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-20 16:41:34 +02:00
< div id = "outline-container-org42b4b18" class = "outline-3" >
< h3 id = "org42b4b18" > Stiffness and Damping properties< / h3 >
< div class = "outline-text-3" id = "text-org42b4b18" >
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-20 16:41:34 +02:00
< div id = "outline-container-org48c3eec" class = "outline-3" >
< h3 id = "org48c3eec" > Equilibrium position of the each joint.< / h3 >
< div class = "outline-text-3" id = "text-org48c3eec" >
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-20 16:41:34 +02:00
< div id = "outline-container-orgb814645" class = "outline-3" >
< h3 id = "orgb814645" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-orgb814645" >
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-20 16:41:34 +02:00
< div id = "outline-container-org2516704" class = "outline-2" >
< h2 id = "org2516704" > < 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-20 16:41:34 +02:00
< div id = "outline-container-org56d49c9" class = "outline-3" >
< h3 id = "org56d49c9" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-org56d49c9" >
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-20 16:41:34 +02:00
< div id = "outline-container-org0016478" class = "outline-3" >
< h3 id = "org0016478" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org0016478" >
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-20 16:41:34 +02:00
< div id = "outline-container-org35f64ed" class = "outline-3" >
< h3 id = "org35f64ed" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org35f64ed" >
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
2020-05-20 16:41:34 +02:00
args.actuator char {mustBeMember(args.actuator,{'piezo', 'lorentz', 'amplified'})} = 'piezo'
args.k1 (1,1) double {mustBeNumeric} = 1e6
args.ke (1,1) double {mustBeNumeric} = 5e6
args.ka (1,1) double {mustBeNumeric} = 60e6
args.c1 (1,1) double {mustBeNumeric} = 10
args.ce (1,1) double {mustBeNumeric} = 10
args.ca (1,1) double {mustBeNumeric} = 10
2020-05-05 11:38:52 +02:00
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-20 16:41:34 +02:00
< div id = "outline-container-org0737b17" class = "outline-3" >
< h3 id = "org0737b17" > Function content< / h3 >
< div class = "outline-text-3" id = "text-org0737b17" >
2020-05-05 11:38:52 +02:00
< 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
2020-05-20 16:41:34 +02:00
stewart = initializeStrutDynamics(stewart, 'type', 'classical', 'K', args.k*ones(6,1), 'C', args.c*ones(6,1));
2020-05-05 11:38:52 +02:00
elseif args.k > 0
2020-05-20 16:41:34 +02:00
stewart = initializeStrutDynamics(stewart, 'type', 'classical', 'K', args.k*ones(6,1), 'C', 1.5*sqrt(args.k)*ones(6,1));
2020-05-05 11:38:52 +02:00
elseif strcmp(args.actuator, 'piezo')
2020-05-20 16:41:34 +02:00
stewart = initializeStrutDynamics(stewart, 'type', 'classical', 'K', 1e7*ones(6,1), 'C', 1e2*ones(6,1));
2020-05-05 11:38:52 +02:00
elseif strcmp(args.actuator, 'lorentz')
2020-05-20 16:41:34 +02:00
stewart = initializeStrutDynamics(stewart, 'type', 'classical', 'K', 1e4*ones(6,1), 'C', 1e2*ones(6,1));
elseif strcmp(args.actuator, 'amplified')
stewart = initializeStrutDynamics(stewart, 'type', 'amplified', ...
'k1', args.k1*ones(6,1), ...
'c1', args.c1*ones(6,1), ...
'ka', args.ka*ones(6,1), ...
'ca', args.ca*ones(6,1), ...
'ke', args.ke*ones(6,1), ...
'ce', args.ce*ones(6,1));
2020-05-05 11:38:52 +02:00
else
2020-05-20 16:41:34 +02:00
error('args.actuator should be piezo, lorentz or amplified');
2020-05-05 11:38:52 +02:00
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-20 16:41:34 +02:00
< div id = "outline-container-org3b2b31f" class = "outline-3" >
< h3 id = "org3b2b31f" > Add Type< / h3 >
< div class = "outline-text-3" id = "text-org3b2b31f" >
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-20 16:41:34 +02:00
< div id = "outline-container-org5b7657f" class = "outline-3" >
< h3 id = "org5b7657f" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org5b7657f" >
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-20 16:41:34 +02:00
< div id = "outline-container-org4068b6d" class = "outline-3" >
< h3 id = "org4068b6d" > Simscape Model< / h3 >
< div class = "outline-text-3" id = "text-org4068b6d" >
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-20 16:41:34 +02:00
< div id = "outline-container-org7cb3c0a" class = "outline-3" >
< h3 id = "org7cb3c0a" > Function description< / h3 >
< div class = "outline-text-3" id = "text-org7cb3c0a" >
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-20 16:41:34 +02:00
< div id = "outline-container-org45dfb8b" class = "outline-3" >
< h3 id = "org45dfb8b" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org45dfb8b" >
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-20 16:41:34 +02:00
< div id = "outline-container-org777606d" class = "outline-3" >
< h3 id = "org777606d" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org777606d" >
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-20 16:41:34 +02:00
< div id = "outline-container-org3bf8f39" class = "outline-3" >
< h3 id = "org3bf8f39" > Material and Geometry< / h3 >
< div class = "outline-text-3" id = "text-org3bf8f39" >
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-20 16:41:34 +02:00
< div id = "outline-container-orga217348" class = "outline-3" >
< h3 id = "orga217348" > Stiffness and Damping properties< / h3 >
< div class = "outline-text-3" id = "text-orga217348" >
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-20 16:41:34 +02:00
< div id = "outline-container-orgc6700d2" class = "outline-3" >
< h3 id = "orgc6700d2" > Equilibrium position of the each joint.< / h3 >
< div class = "outline-text-3" id = "text-orgc6700d2" >
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-20 16:41:34 +02:00
< div id = "outline-container-orgb88e566" class = "outline-3" >
< h3 id = "orgb88e566" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-orgb88e566" >
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-20 16:41:34 +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-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-20 16:41:34 +02:00
< div id = "outline-container-org5f24bdc" class = "outline-3" >
< h3 id = "org5f24bdc" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org5f24bdc" >
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-20 16:41:34 +02:00
< div id = "outline-container-org6e89216" class = "outline-3" >
< h3 id = "org6e89216" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org6e89216" >
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-20 16:41:34 +02:00
< div id = "outline-container-org202f2f5" class = "outline-3" >
< h3 id = "org202f2f5" > Save the Structure< / h3 >
< div class = "outline-text-3" id = "text-org202f2f5" >
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-20 16:41:34 +02:00
< div id = "outline-container-org671c2c2" class = "outline-3" >
< h3 id = "org671c2c2" > Function Declaration and Documentation< / h3 >
< div class = "outline-text-3" id = "text-org671c2c2" >
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-20 16:41:34 +02:00
< div id = "outline-container-org5323b00" class = "outline-3" >
< h3 id = "org5323b00" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org5323b00" >
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-20 16:41:34 +02:00
< div id = "outline-container-orgf66b222" class = "outline-3" >
< h3 id = "orgf66b222" > Translation Stage< / h3 >
< div class = "outline-text-3" id = "text-orgf66b222" >
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-20 16:41:34 +02:00
< div id = "outline-container-orga18d111" class = "outline-3" >
< h3 id = "orga18d111" > Tilt Stage< / h3 >
< div class = "outline-text-3" id = "text-orga18d111" >
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-20 16:41:34 +02:00
< div id = "outline-container-org8d2c73d" class = "outline-3" >
< h3 id = "org8d2c73d" > Spindle< / h3 >
< div class = "outline-text-3" id = "text-org8d2c73d" >
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-20 16:41:34 +02:00
< div id = "outline-container-org8ba04e2" class = "outline-3" >
< h3 id = "org8ba04e2" > Micro Hexapod< / h3 >
< div class = "outline-text-3" id = "text-org8ba04e2" >
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-20 16:41:34 +02:00
< div id = "outline-container-org34337a8" class = "outline-3" >
< h3 id = "org34337a8" > Nano Hexapod< / h3 >
< div class = "outline-text-3" id = "text-org34337a8" >
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-20 16:41:34 +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-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-20 16:41:34 +02:00
< div id = "outline-container-orga2a09de" class = "outline-3" >
< h3 id = "orga2a09de" > Function Declaration and Documentation< / h3 >
< div class = "outline-text-3" id = "text-orga2a09de" >
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-20 16:41:34 +02:00
< div id = "outline-container-org3bd7db1" class = "outline-3" >
< h3 id = "org3bd7db1" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org3bd7db1" >
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-20 16:41:34 +02:00
< div id = "outline-container-org38c42fa" class = "outline-3" >
< h3 id = "org38c42fa" > Save< / h3 >
< div class = "outline-text-3" id = "text-org38c42fa" >
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-20 16:41:34 +02:00
< div id = "outline-container-orgf8f086e" class = "outline-3" >
< h3 id = "orgf8f086e" > Function Declaration and Documentation< / h3 >
< div class = "outline-text-3" id = "text-orgf8f086e" >
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-20 16:41:34 +02:00
< div id = "outline-container-org8dbc80b" class = "outline-3" >
< h3 id = "org8dbc80b" > Optional Parameters< / h3 >
< div class = "outline-text-3" id = "text-org8dbc80b" >
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-20 16:41:34 +02:00
< div id = "outline-container-org5d6b026" class = "outline-3" >
< h3 id = "org5d6b026" > Structure initialization< / h3 >
< div class = "outline-text-3" id = "text-org5d6b026" >
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-20 16:41:34 +02:00
< div id = "outline-container-org01d19da" class = "outline-3" >
< h3 id = "org01d19da" > Save< / h3 >
< div class = "outline-text-3" id = "text-org01d19da" >
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-20 16:41:34 +02:00
< p class = "date" > Created: 2020-05-20 mer. 16:41< / p >
2019-12-11 17:09:32 +01:00
< / div >
< / body >
< / html >