# Application of the MiL and HiL Simulation Techniques in Stewart Platform Control Development
## 2 Stewart Platform  
The Stewart platform (Figure 3) is a parallel manipulator with six degrees of freedom [15]. Its advantages are mainly its positioning precision, stiffness, and high power-to-density ratio. Its disadvantage is its relatively small workspace [16; 17; 18]. Application of the Stewart platform can range from vibration isolation, motion simulators, to stabilization of a load, and more [19; 20]. The Stewart platform consists of a base plate, six extensible legs, six upper and lower joint pairs, and a moving plate. The base plate is attached to the ground. The upper and lower joint pairs are formed by spherical and universal joints. The position and orientation of the moving plate depend on the extension of each extensible leg, which is represented by a linear actuator, which consists of a linear actuator body and a piston rod. The resulting trajectory of the moving plate is thus given by a synchronized motion of the actuators. The calculation of the required piston rod extension is done with the use of inverse kinematics [21; 22]. Figure 3: Schematic view of the general Stewart platform. As shown in Figure 3, there is a base coordinate system \(\mathbf{O_{b}}x_{b}y_{b}z_{b}\) fixed to the centre of the base plate. The lower joint position is given by \(\mathbf{B_{k}}^{\mathbf{b}}\). The second coordinate system \(\mathbf{O_{p}}x_{p}y_{p}z_{p}\) is fixed to the moving plate. The upper joint position is given by \(\mathbf{A_{k}}^{\mathbf{p}}\). The linear actuator body and the piston rod are related by a cylindrical joint. The linear actuator body is attached by the universal joint to the base plate. The piston rod is attached by the spherical joint to the moving plate. The position of the moving plate is given by (1). The orientation of the moving plate is given by roll \(\varphi\), pitch \(\theta\) and yaw \(\Psi\) angles of the moving plate coordinate system with respect to the base coordinate system. The position and orientation of the moving plate is thus given by (2). \[\overline{\mathbf{O_{b}}\mathbf{O_{p}}}=\mathbf{r}^{b}=[x_{b},y_{b},z_{b}]^{T} \tag{1}\]  
\[\mathbf{q}=[x_{b},y_{b},z_{b},\varphi,\ \theta,\ \Psi]^{T} \tag{2}\]  
To calculate the leg length required to reach the desired \(\mathbf{q}\), we need to use inverse kinematics (3). In this article, we will differentiate between desired position and orientation of the moving plate \(\mathbf{q_{w}}\) and an actual position and orientation of the moving plate \(\mathbf{q_{y}}\). Based on the structure of the Stewart platform given by the vectors of upper and lower joint position \(\mathbf{a_{k}}^{\mathbf{p}}\) and \(\mathbf{b_{k}}^{\mathbf{b}}\), and the desired position and orientation, we can calculate the leg vector \(\mathbf{l_{k}}^{\mathbf{b}}\). \(\mathbf{R}\) is a rotation matrix. \(C\) and \(S\) represent \(cos\) and \(sin\) functions. The leg length is then obtained from (5). The leg length consists of \(h_{k}\), which is a fixed length of the linear actuator body and \(y_{k}\), which represents the piston rod extension. The piston rod extension \(y_{k}\) is controlled by the Stewart platform control system. The piston rod extension is given by a distance of the piston rod reference frame with respect to the linear actuator body reference frame as is described in Section 3. Note that these calculations do not consider limitations such as minimum and maximum length of the extensible legs, as well as minimum and maximum joint angles, collisions of the bodies and singularity configurations. All these factors determine the workspace of the Stewart platform and should be checked on [23]. \[\overline{\mathbf{B_{k}^{b}}\mathbf{A_{k}^{b}}}=\mathbf{l_{k}^{b}}=\mathbf{r }^{b}+\mathbf{R}\ \mathbf{a_{k}^{p}}-\mathbf{b_{k}^{b}} \tag{3}\]  
\[k=1,2,\ldots,\ 6\]  
\[\mathbf{R}=\left[