## 3 Kinematic Analysis of the Lunar Exploration Hexapod Robot
### Forward and Reverse Kinematic Analysis of the Lunar Exploration Hexapod Robot  
For a serial joint-type hexapod robot, forward kinematics aids in the analysis of the motion space of the hexapod robot. By substituting the D-H parameters from Table 3 into Equation (1), the D-H transformation matrix corresponding to each joint of the mechanical leg of the lunar hexapod robot can be obtained. Multiplying these transformation matrices yields the homogeneous transformation matrix between adjacent joint coordinates of the robot:  
\[F=\begin{pmatrix}\cos\theta_{1}\cos(\theta_{2}+\theta_{3})&-\cos\theta_{1}\sin (\theta_{2}+\theta_{3})&-\sin\theta_{1}&\cos\theta_{1}(l_{1}+l_{2}\cos\theta_ {2}+l_{3}\cos(\theta_{2}+\theta_{3}))\\ \sin\theta_{1}\cos(\theta_{2}+\theta_{3})&-\sin\theta_{1}\sin(\theta_{2}+ \theta_{3})&\cos\theta_{1}&\sin\theta_{1}(l_{1}+l_{2}\cos\theta_{2}+l_{3}\cos (\theta_{2}+\theta_{3}))\\ -\sin(\theta_{2}+\theta_{3})&-\cos(\theta_{2}+\theta_{3})&0&-l_{2}\sin\theta_ {2}-l_{3}\sin(\theta_{2}+\theta_{3})\\ 0&0&0&1\end{pmatrix} \tag{2}\]  
The respective coordinates of the robot's foot end are:  
\[\left\{\begin{array}{l}X=(\cos\theta_{1})(l_{1}+l_{2}\cos\theta_{2}+l_{3} \cos(\theta_{2}+\theta_{3}))\\ Y=(\sin\theta_{1})(l_{1}+l_{2}\cos\theta_{2}+l_{3}\cos(\theta_{2}+\theta_{3})) \\ Z=-l_{2}\sin\theta_{2}-l_{3}\sin(\theta_{2}+\theta_{3})\end{array}\right. \tag{3}\]  
The value of each joint can only be determined by the inverse kinematics solution. That is, the robot may attain the desired posture state by reversing the angle of each joint in its robotic leg so that it can achieve the desired posture state. The inverse kinematics solution of the robotic leg is solved from its forward kinematics model:  
\[\theta_{1}=\arctan\frac{\sin\theta_{1}(l_{1}+l_{2}\cos\theta_{2}+l_{3}\cos( \theta_{2}+\theta_{3}))}{\cos\theta_{1}(l_{1}+l_{2}\cos\theta_{2}+l_{3}\cos( \theta_{2}+\theta_{3}))} \tag{4}\]  
\[\theta_{2}=\arccos\left(\frac{l_{2}\sin\theta_{2}+l_{3}\sin(\theta_{2}+\theta_ {3})}{\sqrt{\left(l_{3}\cos\theta_{3}+l_{2}\right)^{2}+\left(l_{3}\sin\theta _{3}\right)^{2}}}\right)+\arcsin(\frac{1}{\sqrt{\left(l_{3}\cos\theta_{3}+l_{2 }\right)^{2}+\left(l_{3}\sin\theta_{3}\right)^{2}}}) \tag{5}\]  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Joint** & \(\theta_{i}\) & \(\alpha_{i}\) & \(l_{i}\) \\ \hline Hip & \(\theta_{1}\) & \(-\pi/2\) & \(l_{1}\) \\ Knee & \(\theta_{2}\) & \(0\) & \(l_{2}\) \\ Ankle & \(\theta_{3}\) & \(0\) & \(l_{3}\) \\ \hline \end{tabular} where \(\theta_{i}\) is the linkage pinch angle of the \(i_{th}\) leg of the hexapod robot; \(\alpha_{i}\) is the torsion angle, which denotes the angle of the rotation around \(x_{i}\) so that \(z_{(i-1)}\) is parallel to \(z_{i}l_{i}\) is the linkage length of the \(i_{th}\) leg of the hexapod robot; and \(d_{i}\) is the distance of the neighboring joints from the common plumb line.  
\end{table}
Table 3: D-H parameters of the robotic leg.  
Figure 6: D-H coordinate system of the robotic leg.  
\[\theta_{3}=\arccos\frac{(l_{3}\cos\theta_{3}+l_{2})^{2}+(l_{2}\sin\theta_{2}+l_{3} \sin(\theta_{2}+\theta_{3}))^{2}-l_{2}{}^{2}-l_{3}{}^{2}}{2l_{2}l_{3}} \tag{6}\]