#+TITLE: Tikz Figures
:DRAWER:
#+HTML_LINK_HOME: ../index.html
#+HTML_LINK_UP:   ../index.html

#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="https://research.tdehaeze.xyz/css/style.css"/>
#+HTML_HEAD: <script type="text/javascript" src="https://research.tdehaeze.xyz/js/script.js"></script>

#+PROPERTY: header-args:latex  :headers '("\\usepackage{tikz}" "\\usepackage{import}" "\\import{/home/thomas/Cloud/thesis/papers/dehaeze21_mechatronics_approach_nass/tikz/}{config.tex}")
#+PROPERTY: header-args:latex+ :imagemagick t :fit yes
#+PROPERTY: header-args:latex+ :iminoptions -scale 100% -density 150
#+PROPERTY: header-args:latex+ :imoutoptions -quality 100
#+PROPERTY: header-args:latex+ :results file raw replace
#+PROPERTY: header-args:latex+ :eval no-export
#+PROPERTY: header-args:latex+ :exports both
#+PROPERTY: header-args:latex+ :mkdirp yes
#+PROPERTY: header-args:latex+ :output-dir figs
#+PROPERTY: header-args:latex+ :post pdf2svg(file=*this*, ext="png")
:END:

* Mechatronic Approach
#+begin_src latex :file nass_mechatronics_approach.pdf
\graphicspath{ {/home/thomas/Cloud/thesis/papers/dehaeze21_mechatronics_approach_nass/tikz/figs-tikz} }

\begin{tikzpicture}
  % Styles
  \tikzset{myblock/.style= {draw, fill=white, text width=3cm, align=center, minimum height=1.8cm}};
  \tikzset{mylabel/.style= {anchor=north, below, font=\bfseries\small, color=black, text width=3cm, align=center}};
  \tikzset{mymodel/.style= {anchor=south, above, font=\small, color=black, text width=3cm, align=center}};
  \tikzset{mystep/.style=  {->, ultra thick}};

  % Blocks
  \node[myblock, fill=lightblue, draw, label={[mylabel, text width=9.8cm] Dynamical Models / Simulations / Control}, minimum height = 8cm, text width = 9.8cm] (model) at (0, 0) {};

  \node[myblock, fill=lightgreen, label={[mylabel] $\mu$ Station}, left = 3 of model.south west, anchor=south east] (mustation) {};
  \node[myblock, fill=lightgreen, label={[mylabel] Disturbances},  left = 3 of model.west]                          (dist) {};
  \node[myblock, fill=lightgreen, label={[mylabel] $\nu$ Hexapod}, left = 3 of model.north west, anchor=north east] (nanohexapod) {};

  \node[myblock, fill=lightyellow, label={[mylabel] Mech. Design},    above = 1 of model.north] (mechanical) {};
  \node[myblock, fill=lightyellow, label={[mylabel] Instrumentation}, left  = 1 of mechanical]  (instrumentation) {};
  \node[myblock, fill=lightyellow, label={[mylabel] FEM},             right = 1 of mechanical]  (fem) {};

  \node[myblock, fill=lightred, label={[mylabel] Assembly},       right = 3 of model.north east, anchor=north west] (mounting) {};
  \node[myblock, fill=lightred, label={[mylabel] Test Benches},   right = 3 of model.east]                          (testbenches) {};
  \node[myblock, fill=lightred, label={[mylabel] Implementation}, right = 3 of model.south east, anchor=south west] (implementation) {};

  % Text
  \node[mymodel] at (mustation.south) {Multiple Stages\\Complex Dynamics\\Solid Bodies};
  \node[mymodel] at (dist.south) {Ground Motion\\Vibrations\\Pos. Errors};
  \node[mymodel] at (nanohexapod.south) {Concepts (Soft, Stiff) \\ Geometry \\ Sensors};

  \node[mymodel] at (instrumentation.south) {Sensors\\Amplifiers\\Actuators};
  \node[mymodel] at (mechanical.south) {Geometry\\Part Optimization\\Integration};
  \node[mymodel] at (fem.south) {Flexible joints\\APA\\Plates};

  \node[mymodel] at (mounting.south) {Mounting Tools:\\Struts\\ Nano-Hexapod};
  \node[mymodel] at (testbenches.south) {Instrumentation\\APA, Struts\\Hexapod};
  \node[mymodel] at (implementation.south) {Test Benches\\$\mu$ Station};

  % Links
  \draw[->] (dist.east) -- node[above, midway]{Measurements} node[below,midway]{} (dist.east-|model.west);
  \draw[->] (mustation.east) -- node[above, midway]{Measurements} node[below, midway]{CAD Model} (mustation.east-|model.west);

  \draw[->] ($(nanohexapod.east-|model.west)+(0, 0.2)$) -- node[above, midway]{Optimization} ($(nanohexapod.east)+(0, 0.2)$);
  \draw[<-] ($(nanohexapod.east-|model.west)-(0, 0.2)$) -- node[below, midway]{Model} ($(nanohexapod.east)-(0, 0.2)$);

  \draw[->] ($(fem.south|-model.north)+(0.2, 0)$) -- node[right, midway]{Specif.} ($(fem.south)+(0.2,0)$);
  \draw[<-] ($(fem.south|-model.north)-(0.2, 0)$) -- node[left, midway,align=right]{Super\\Element}  ($(fem.south)-(0.2,0)$);

  \draw[->] ($(mechanical.south|-model.north)+(0.2, 0)$) -- node[right, midway]{Specif.} ($(mechanical.south)+(0.2,0)$);
  \draw[<-] ($(mechanical.south|-model.north)-(0.2, 0)$) -- node[left, midway]{3D parts}        ($(mechanical.south)-(0.2,0)$);

  \draw[->] ($(instrumentation.south|-model.north)+(0.2, 0)$) -- node[right, midway]{Specif.} ($(instrumentation.south)+(0.2,0)$);
  \draw[<-] ($(instrumentation.south|-model.north)-(0.2, 0)$) -- node[left, midway]{Model}         ($(instrumentation.south)-(0.2,0)$);

  \draw[->] ($(testbenches.west-|model.east)+(0, 0.2)$) -- node[above, midway]{Control Laws} ($(testbenches.west)+(0, 0.2)$);
  \draw[<-] ($(testbenches.west-|model.east)-(0, 0.2)$) -- node[below, midway]{Refinement}   ($(testbenches.west)-(0, 0.2)$);

  \draw[->] ($(implementation.west-|model.east)+(0, 0.2)$) -- node[above, midway]{Control Laws} ($(implementation.west)+(0, 0.2)$);
  \draw[<-] ($(implementation.west-|model.east)-(0, 0.2)$) -- node[below, midway]{Refinement}   ($(implementation.west)-(0, 0.2)$);

  % Steps
  \draw[mystep] (mustation.north) -- (dist.south);
  \draw[mystep] (dist.north)      -- (nanohexapod.south);
  \draw[mystep, postaction={decorate,decoration={raise=1ex,text along path,text align=center,text={Validation of Concept}}}] (nanohexapod.north) to[out=90, in=180] (instrumentation.west);
  \draw[mystep] (instrumentation.east) -- (mechanical.west);
  \draw[mystep] (mechanical.east)      -- (fem.west);
  \draw[mystep, postaction={decorate,decoration={raise=1ex,text along path,text align=center,text={Procurement}}}] (fem.east) to[out=0, in=90] (mounting.north);
  \draw[mystep] (mounting.south)    -- (testbenches.north);
  \draw[mystep] (testbenches.south) -- (implementation.north);

  % Inside Model
  \node[inner sep=1pt, outer sep=6pt, anchor=north west, draw, fill=white, thin] (multibodymodel) at ($(model.north west) - (0, 0.5)$)
    {\includegraphics[width=5.6cm]{simscape_nano_hexapod.png}};

  \node[inner sep=1pt, outer sep=6pt, anchor=south west, draw, fill=white, thin] (simscape) at (model.south west)
    {\includegraphics[width=5.6cm]{simscape_picture.jpg}};

  % Feedback Model
  \node[inner sep=3pt, outer sep=6pt, anchor=north east, draw, fill=white, thin] (simscape_sim) at ($(model.north east) - (0, 0.5)$)
    {\includegraphics[width=3.6cm]{simscape_simulations.pdf}};

  % FeedBack
  \node[inner sep=3pt, outer sep=6pt, anchor=south east, draw, fill=white, thin] (feedback) at (model.south east)
    {\includegraphics[width=3.6cm]{classical_feedback_small.pdf}};
\end{tikzpicture}
#+end_src

#+RESULTS:
[[file:figs/nass_mechatronics_approach.png]]
