## 3 Multibody Model of Grating Device  
The grating device system model shown in Figure 1 can be constructed without loss of generality, as shown in Table 1. According to the application, the grating mass motion can be described with five DOFs: translation X and Z and rotational \(\phi\), \(\theta\) and \(\psi\). \begin{table}
\begin{tabular}{c c c} \hline \hline
**Joint Type** & **Body(i)** & **Body(j)** \\ \hline Fixed & Grating Base & Ground \\ Prismatic(Z) & Lower plate & Grating Base \\ Prismatic(X) & Upper plate & Lower plate \\ Spherical & Grating mass & Upper plate \\ Fixed & Flexure bodies & Grating mass \\ Fixed & Flexible bodies & Flexure bodies \\ Fixed & Flexible bodies & Grating base \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Grating device bodies. Figure 3: Dynamic for design procedure for grating tiling device. The grating mass can be defined with respect to generalized coordinate as:  
\[\mathbf{q}^{i}=\left[R_{x}^{i}\ R_{y}^{i}\ R_{z}^{i}\ \phi^{i}\ \theta^{i}\ \psi^{j} \right]^{\mathrm{T}} \tag{5}\]  
where \(\mathbf{q}^{i}\) is body generalized coordinates. The system of generalized coordinates of all grating device bodies can define as:  
\[\mathbf{q}=\left[\mathbf{q}^{1}\ \mathbf{q}^{2}\ \mathbf{q}^{3}\ \mathbf{q}^{4}\ \mathbf{q}^{5}\.....,\ \mathbf{q}^{14}\right]^{T} \tag{6}\]  
Kinematics constraints equations of spherical, prismatic and rigid joints are used to drive constraints equations of grating system. The rigid joint between grating mass and ground can be obtained by constraining all degree of freedom using mathematical equations [27]. The constraints equations of the rigid joint between fixed base and ground can be written as:  
\[\mathbf{C}^{1}_{(\mathbf{q}^{1},\mathbf{q}^{5},t)}=\left[ \begin{array}{c}R_{ x}^{1}\\ R_{y}^{1}\\ R_{z}^{1}\end{array} \right]=0 \tag{7}\]  
where \(\mathbf{q}^{5}\) is generalized coordinate vector for ground and it equals zero. The prismatic joint can also be obtained by eliminating the freedom of the relative rotation between the two bodies about the joint axis and the freedom of the relative translation on one axis [28]. A prismatic joint which allows grating mass to translate in \(Z\) direction is shown in Figure 4.  
Figure 4: Prismatic joint between base and lower plate. Constraints equations of prismatic joints between lower plate and upper plate can be written as:  
\[\mathbf{C}^{3}_{(\mathbf{q}^{2},\mathbf{q}^{3},t)}=\left[ \begin{array}{c} \mathbf{h}^{2}\times\mathbf{h}^{3}\\ \mathbf{h}^{2}\times\mathbf{\xi}^{23}\\ \mathbf{n}^{27}\mathbf{n}^{3}\end{array} \right]=0 \tag{8}\]  
where \(h^{2}\), \(h^{3}\), \(n^{2}\), \(n^{3}\) and \(S^{23}\) are orthogonal vectors, see Figure 4. Equation (8) contains five independent constraint equations that define the kinematic conditions for the single-degree-of-freedom prismatic joint. Constraint equations of spherical joint shown in Figure 5 can be written as:  
\[\mathbf{C}^{4}(\mathbf{q}^{3},\mathbf{q}^{4},t)=\mathbf{r}_{p}^{3}-\mathbf{r} _{p}^{4}=\mathbf{0} \tag{9}\]  
\[\mathbf{C}^{4}(\mathbf{q}^{3},\mathbf{q}^{4},t)=\mathbf{R}^{3}+\mathbf{A}^{3} \mathbf{\bar{u}}_{3}^{i}-\mathbf{R}^{4}-\mathbf{A}^{4}\mathbf{\bar{u}}_{p}^{4} =\mathbf{0} \tag{10}\]  
where \(\mathbf{R}^{3}\) and \(\mathbf{R}^{4}\) are the global position vectors of local frames of bodies 3 and 4, respectively. The matrices \(\mathbf{A}^{3}\) and \(\mathbf{A}^{4}\) are the transformation matrices. Finally, \(\mathbf{\bar{u}}_{p}^{3}\) and \(\mathbf{\bar{u}}_{p}^{4}\) are the local position vectors defined between the body frame and joint frame. As spherical joints only prevent translation movement, Equation (10) can be written as:  
\[\mathbf{C}^{4}_{(\mathbf{q}^{3},\mathbf{q}^{4},t)}=\mathbf{R}^{3}-\mathbf{R}^ {4}=\mathbf{0} \tag{11}\]  
Because spherical joint allowed only rotation about three axes, the constraints equation for spherical joints Equation (11) can be written as a function on translation constraints as:  
\[\mathbf{C}^{4}_{(\mathbf{q}^{3},\mathbf{q}^{4},t)}=\left[