# Fault-Tolerant Tripod Gait Planning and Verification of a Hexopod Robot
## 2 The Modeling of Hexapod Robot
### Kinematics Model  
Kinematics analysis is the basis of gait planning and attitude control of a hexapod robot. Kinematics studies all geometric and time parameters related to motion. To complete the kinematic analysis of the robot, the first problem is to describe the robot parametrically. Based on standard Denavit-Hartenberg (D-H) notation [25; 26], the hexapod leg link can be described as in Table 1.  
In Table 1, \(a\) is the link length, \(\alpha\) is link twist, \(d\) is the offset, \(\beta\) is the joint angle. The homogeneous transformation matrix describes the relationship of a point in the different coordinate systems. The homogeneous transformation matrix from the foot end coordinate system to the reference coordinate system can be obtained by: \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Joint** & \(a\) & \(\alpha\)(\({}^{\circ}\)) & \(d\) & \(\beta\)(\({}^{\circ}\)) \\ \hline
1 & 0 & 0 & 0 & \(\beta_{1}\) \\
2 & \(l_{1}\) & 90 & 0 & \(\beta_{2}\) \\
3 & \(l_{2}\) & 0 & 0 & \(\beta_{3}\) \\
4 & \(l_{3}\) & 0 & 0 & 0 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Denavit–Hartenberg (D-H) parameters of a hexapod leg link. Figure 2: The simplified prototype of hexapod and coordinate systems. \[{}^{0}T_{4}^{i}=\left[ \begin{array}{cccc}cos\beta_{1}^{i}cos\beta_{23}^{i}&- cos\beta_{1}^{i}sin\beta_{23}^{i}&sin\beta_{1}^{i}&cos\beta_{1}^{i}(l_{1}+l_{2} cos\beta_{2}^{i}+l_{3}cos\beta_{23}^{i})\\ sin\beta_{1}^{i}cos\beta_{23}^{i}&-sin\beta_{1}^{i}sin\beta_{23}^{i}&-cos\beta _{1}^{i}&sin\beta_{1}^{i}(l_{1}+l_{2}cos\beta_{2}^{i}+l_{3}cos\beta_{23}^{i}) \\ sin\beta_{23}^{i}&cos\beta_{23}^{i}&0&l_{2}sin\beta_{2}^{i}+l_{3}sin\beta_{23}^ {i}\\ 0&0&0&1\end{array} \right] \tag{2}\]  
where \(\beta_{23}^{i}=\beta_{2}^{i}+\beta_{3}^{i}\). The reference coordinate \(\sum O_{0}^{i}\) of leg \(i\) can be expressed in the body coordinate frame \(\sum O_{b}\) as given in the following equation:  
\[{}^{b}T_{0}^{i}=\left[ \begin{array}{cccc}cos\psi_{i}&-sin\psi_{i}&0&{}^{b}P _{0x}^{i}\\ sin\psi_{i}&cos\psi_{i}&0&{}^{b}P_{0y}^{i}\\ 0&0&1&{}^{b}P_{0z}^{i}\\ 0&0&0&1\end{array} \right] \tag{3}\]  
where \(\psi_{i}\) is the angle between \(X_{0}^{i}\) and \(X_{b}\), \({}^{b}P_{0x^{\prime}}^{i}\)\({}^{b}P_{0y}^{i}\) and \({}^{b}P_{0z}^{i}\) is the position of origin \(O_{0}^{i}\) in coordinate \(\sum O_{b}\). The position of the foot end of leg \(i\) in the body coordinate can be obtained by forward kinematics, as shown in Equation (4):  
\[\left\{ \begin{array}{c}{}^{b}e_{xi}|=cos\Big{(}\beta_{1}^{i}+\psi_{i}\Big{)} \Big{(}l_{1}+l_{2}cos\beta_{2}^{i}+l_{3}cos\beta_{23}^{i}\Big{)}+{}^{b}p_{0x} ^{i}\\ {}^{b}e_{yi}|=sin(\beta_{1}^{i}+\psi_{i})\Big{(}l_{1}+l_{2}cos\beta_{2}^{i}+ l_{3}cos\beta_{23}^{i}\Big{)}+{}^{b}p_{0y}^{i}\\ {}^{b}e_{zi}|=l_{2}sin\beta_{2}^{i}+l_{3}sin\beta_{23}^{i}+{}^{b}p_{0z}^{i} \end{array} \right. \tag{4}\]  
where \({}^{b}e_{xi^{\prime}}\), \({}^{b}e_{yi^{\prime}}\)\({}^{b}e_{zi}\) are the expression of the foot end in \(\sum O_{b}\). The inverse kinematics maps the relationship between Cartesian coordinates and the joint angle. The joint angles of the hexapod robots are calculated using:  
\[\left\{ \begin{array}{c}\beta_{1}^{i}=tan^{-1}\frac{\left(\frac{b_{Aq}^{p_{ Ai}}-{}^{b}P_{0y}^{i}}{\left(b_{Aq}^{p_{Ai}}-{}^{b}P_{0y}^{i}\right)}\right)}{ \left(\frac{1}{\sqrt{\left(\xi+\beta_{2}^{i}\right)^{2}}+4l_{3}l_{2}l_{3}}^{2} -(\xi-l_{2}l_{2}^{2})\right)}-tan^{-1}\frac{\sqrt{4l_{3}^{2}l_{2}-(\xi-l_{2}^{ 2})}}{\xi+l_{2}^{2}}\\ \beta_{3}^{i}=cos^{-1}\Big{(}\frac{\xi-l_{3}^{2}-l_{3}l_{2}}{2l_{3}}\Big{)}\end{array} \right. \tag{5}\]  
where \(\xi=\left(\sqrt{\left({}^{b}P_{4x}^{i}-{}^{b}P_{0x}^{i}\right)^{2}+\left({}^{b }P_{4y}^{i}-{}^{b}P_{0y}^{i}\right)^{2}}-l_{1}\right)^{2}+\left({}^{b}P_{4z}^{ i}-{}^{b}P_{0z}^{i}\right)^{2}-l_{3}{}^{2}\). As a parallel system, the complete configuration of hexapod robot can be determined by:  
\[q=\left[ \begin{array}{cc}\beta_{Li}^{T}&x_{b}^{T}\end{array}