# Design of a Bionic Spider Robot with a Two-Degrees-of-Freedom Leg Structure and Body Frame
## 3 Design and Analysis of Structure
### Design and Analysis of Leg Structure
#### 3.1.3 Kinematic Analysis  
Based on the analysis in Section 3.1.2, a simplified motion diagram of the leg mechanism is provided in Figure 6. We conduct the kinematic analysis of the selected mechanism to determine whether the touchdown points and their motion rates in the leg comply with the design requirements. We then optimize the mechanism to address any potential issues that may arise. In Figure 6, point A represents the rotational center for the leg's swinging motion, where the slider performs a reciprocating motion. Point G is the center of the slider and the connection point with the connecting rod. When performing kinematic analysis of the mechanical structure, since rod BCD has a minimal impact on kinematics due to its shape, which serves only for structural reinforcement and has fixed parameters, it can be simplified to rod BD. This simplification makes the diagram clearer, as illustrated in Figure 7.  
For convenient subsequent calculations, the definitions of the parameters for Figures 6 and 7 are summarized in Table 1 below. The definitions of rod length BD, \(l_{7}\), and angle ABD, \(\theta_{1}\), are given in Formula (2) and Formula (3), respectively. \[l_{7}=\sqrt{{l_{3}}^{2}+{l_{2}}^{2}-2\times l_{2}\times l_{3}\times\cos{\angle \theta}} \tag{2}\]  
\[\theta_{1}=\arcsin(l_{3}\times\sin({\angle\theta})/{l_{7}})+\pi/2 \tag{3}\]  
Figure 6: (**a**) Schematic diagram of the leg mechanism motion; (**b**) physical prototype of the leg structure. Figure 7: Analysis simplification. Hence, the coordinate frames for each leg of the biomimetic spider robot are established, respectively, as \(\sum O_{A}\), where A represents the legs. Additionally, the body coordinate frame, \(\sum O_{R}\), is established, where R represents the body, as shown in Figure 8. Based on this, the kinematic analysis of the biomimetic spider robot is carried out step by step. The improved Denavit-Hartenberg (D-H) parameters are used to analyze the changes in the foot end coordinates of the legs and their dynamic characteristics. The robot leg motion is shown in Figure 9.  
The initial parameters involved in Figure 9 are shown in Table 2. The drive mechanism parameters are analyzed, thereby determining the D-H-related parameters of the leg mechanism. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Serial Number** & **Name** & **Symbol** \\ \hline
1 & AB & \(l_{1}\) \\
2 & BC & \(l_{2}\) \\
3 & CD & \(l_{3}\) \\
4 & DE & \(l_{4}\) \\
5 & EG & \(l_{5}\) \\
6 & EF & \(l_{6}\) \\
8 & \(\angle\)BCD & \(\theta\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Intrinsic parameters of the leg mechanism. Figure 8: Simplified coordinate system model. Figure 9: **(a)** The swing angle of the \(i\)-th leg; **(b)** the lift height of the \(i\)-th leg. From the above, Equation (11) can be derived. \[ \begin{array}{c}\overset{2}{0}T_{A}=\begin{bmatrix}\cos(\gamma_{1})&-\sin( \gamma_{1})&0&l_{1}+d_{1}\\ \sin(\gamma_{1})&\cos(\gamma_{1})&0&0\\ 0&0&1&\Delta d\\ 0&0&0&1+l_{1}+d_{1}\end{bmatrix}\end{array}  \tag{11}\]  
In Equation (11), the term \(1+l_{1}+d_{1}\) represents the displacement of slider G from its initial position on the link to a distance \(\Delta d\). The initial position of the slider on the link is at a distance of \(l_{1}+d_{1}\) from the rotational center of the link. Therefore, the final position of the slider after movement is the sum of the initial distance and the distance it moves along the link. Since the coordinates of the foot can be represented in a coordinate system with the slider as the origin, they can be subsequently transformed into the desired coordinate system. In the slider coordinate system, the coordinates of foot F are \((x_{3},y_{3},z_{3})\), which are defined, respectively, in Equation (12). \[ \begin{cases}x_{3}=(l_{4}+l_{6})\cdot\cos(\theta_{1}-\theta_{3})-l_{7}\cdot \cos\theta_{1}-(d_{1}+\Delta d)\\ y_{3}=0\\ z_{3}=l_{7}\cdot\sin\theta_{1}-(l_{4}+l_{6})\cdot\sin(\theta_{1}-\theta_{3}) \end{cases}