In this document is explained how the Simscape model of the Stewart Platform is implemented.
It is divided in the following sections:
- section [[sec:simscape_parameters]]: is explained how the parameters of the Stewart platform are set for the Simscape model
- section [[sec:simulink_configuration]]: the Simulink configuration (solver, simulation time, ...) is shared among all the Simulink files. It is explain how this is done.
- section [[sec:subsystem_reference]]: All the elements (platforms, struts, sensors, ...) are saved in separate files and imported in Simulink files using "subsystem referenced".
- section [[sec:fixed_mobile_platforms]]: The simscape model for the fixed base and mobile platform are described in this section.
- section [[sec:struts]]: The simscape model for the Stewart platform struts is described in this section.
The Simscape Model of the Stewart Platform is working with the =stewart= structure generated using the functions described [[file:stewart-architecture.org][here]].
All the geometry and inertia of the mechanical elements are defined in the =stewart= structure.
By updating the =stewart= structure in the workspace, the Simscape model will be automatically updated.
Thus, nothing should be changed by hand inside the Simscape model.
The main advantage to have all the parameters defined in one structure (and not hard-coded in some simulink blocs) it that we can easily change the Stewart architecture/parameters in a Matlab script to perform some parametric study for instance.
As multiple simulink files will be used for simulation and tests, it is very useful to determine good simulation configuration that will be *shared* among all the simulink files.
This is done using something called "*Configuration Reference*" ([[https://fr.mathworks.com/help/simulink/ug/more-about-configuration-references.html][documentation]]).
Basically, the configuration is stored in a mat file =conf_simscape.mat= and then loaded in the workspace for it to be accessible to all the simulink models.
It is automatically loaded when the Simulink project is open. It can be loaded manually with the command:
Several Stewart platform models are used, for instance one is use to study the dynamics while the other is used to apply active damping techniques.
However, all the Simscape models share some subsystems using the *Subsystem Reference* Simulink block ([[https://fr.mathworks.com/help/simulink/ug/referenced-subsystem-1.html][documentation]]).
These shared subsystems are:
- =Fixed_Based.slx= - Fixed base of the Stewart Platform
- =Mobile_Platform.slx= - Mobile platform of the Stewart Platform
- =stewart_strut.slx= - One strut containing two spherical/universal joints, the actuator as well as the included sensors. A parameter =i= is initialized to determine what it the "number" of the strut.
These subsystems are referenced from another subsystem called =Stewart_Platform.slx= shown in figure [[fig:simscape_stewart_platform]], that basically connect them correctly.
This subsystem is then referenced in other simulink models for various purposes (control, analysis, simulation, ...).
#+name: fig:simscape_stewart_platform
#+caption: Simscape Subsystem of the Stewart platform. Encapsulate the Subsystems corresponding to the fixed base, mobile platform and all the struts.
[[file:figs/simscape_stewart_platform.png]]
* Subsystem - Fixed base and Mobile Platform
<<sec:fixed_mobile_platforms>>
Both the fixed base and the mobile platform simscape models share many similarities.
Their are both composed of:
- a solid body representing the platform
- 6 rigid transform blocks to go from the frame $\{F\}$ (resp. $\{M\}$) to the location of the joints.
These rigid transform are using ${}^F\bm{a}_i$ (resp. ${}^M\bm{b}_i$) for the position of the joint and ${}^F\bm{R}_{a_i}$ (resp. ${}^M\bm{R}_{b_i}$) for the orientation of the joint.
As always, the parameters that define the geometry are taken from the =stewart= structure.
#+name: fig:simscape_fixed_base
#+caption: Simscape Model of the Fixed base
#+attr_html: :width 1000px
[[file:figs/simscape_fixed_base.png]]
#+name: fig:simscape_mobile_platform
#+caption: Simscape Model of the Mobile platform
#+attr_html: :width 800px
[[file:figs/simscape_mobile_platform.png]]
* Subsystem - Struts
<<sec:struts>>
** Strut Configuration
For the Stewart platform, the 6 struts are identical.
Thus, all the struts used in the Stewart platform are referring to the same subsystem called =stewart_strut.slx= and shown in Figure [[fig:simscape_strut]].
This strut as the following structure:
- *Universal Joint** connected on the Fixed base
- *Prismatic Joint** for the actuator
- *Spherical Joint** connected on the Mobile platform
The other common configuration *SPS* has the disadvantage of having additional passive degrees-of-freedom corresponding to the rotation of the strut around its main axis.
This is why the *UPS* configuration is used, but other configuration can be easily implemented.