# Leg Trajectory Planning for Quadruped Robots with High-Speed Trot Gait
## 2 Materials and Methods  
### Leg Design of the Quadruped Robot  
#### 2.1.1 Leg Structure Comparison with Kinematics Analysis  
The two-joint and three-joint articulated leg structures were considered during the initial leg structure design. By comparing the differences on the aspect of geometry and kinematics, the manipulability, obstacle avoiding ability, and occupied space for legs were analyzed. Figure 1 shows the schematic for the three-joint leg structure on the left and two-joint leg structure on the right. It is assumed that the total link lengths for both two leg structures are identical and decided by the height of robots. The manipulability which measures at state \(\theta\) with respect to manipulation vector \(\mathbf{r}\) is defined as Equation (1) [20]:  
\[w=\sqrt{\det\!\mathbf{J}(\theta)\mathbf{J}^{T}(\theta)} \tag{1}\]  
For the three-joint leg structure, the Jacobian matrix can be calculated as Equation (2):  
\[\mathbf{J}(\theta_{1},\theta_{2})=\left[ \begin{array}{cc}(l_{3}+l_{1})\cos \theta_{1}+l_{2}\cos(\theta_{1}+\theta_{2})&l_{2}\cos(\theta_{1}+\theta_{2})\\ (l_{3}+l_{1})\sin\theta_{1}+l_{2}\sin(\theta_{1}+\theta_{2})&l_{2}\sin( \theta_{1}+\theta_{2})\end{array} \right] \tag{2}\]  
Therefore, the manipulability can be calculated with \(w=|\det\!\mathbf{J}(\theta_{1},\theta_{2})|=(l_{1}+l_{3})l_{2}|\sin(\theta_{2})|\). Similar, the Jacobian matrix for the two-part leg structure can be calculated as Equation (3):  
\[\mathbf{J}(\theta_{4},\theta_{5})=\left[ \begin{array}{cc}l_{4}\cos\theta_{4}+l_ {5}\cos(\theta_{4}+\theta_{5})&l_{5}\cos(\theta_{4}+\theta_{5})\\ l_{4}\sin\theta_{4}+l_{5}\sin(\theta_{4}+\theta_{5})&l_{5}\sin(\theta_{4}+ \theta_{5})\end{array} \right] \tag{3}\]  
The manipulability can be calculated with \(w=|\det\!\mathbf{J}(\theta_{4},\theta_{5})|=l_{4}l_{5}|\sin(\theta_{5})|\). Here the lengths of \(l_{1}\), \(l_{2}\), and \(l_{3}\) are given in the Table 1. For the two-joint leg structure, the manipulability can get a maximum value when the \(l_{4}\) equates to \(l_{5}\). For comparing the manipulability of two leg structures  
Figure 1: Schematic for the three-joint and two-joint leg structures. during one gait cycle, the Bezier curve for the swing phase and the cosine function for the stance phase were used. The manipulability during one gait cycle is shown in Figure 2.  
The leg structure should also protract the leg with enough ground clearance to avoid obstacles. Therefore, we compared the angles \(\alpha_{1}\) and \(\alpha_{2}\), as shown in Figure 1, which can be calculated with Equations (4) and (5):  
\[\alpha_{1} =90^{\circ}-\arccos\left(\frac{\left(l_{1}+l_{3}\right)^{2}+l_{2} ^{2}+h^{2}}{2l_{2}(l_{1}+l_{3})}\right) \tag{4}\] \[\alpha_{2} =90^{\circ}-\arccos\left(\frac{l5^{2}+h^{2}-l_{4}^{2}}{2l_{5}h}\right) \tag{5}\]  
where \(h\) represents the height between the shoulder part of leg to the ground. The obstacle avoiding ability for the three-joint and two-joint leg structures is shown in Figure 3.  
Figure 3: Obstacle avoiding ability of the three-joint and two-joint leg structures. Figure 2: Manipulability for the three-joint and two-joint leg structure. At last, the space occupied for two leg structures was also compared. Assuming that \(p_{1}=(l_{4}+l_{5}+h)/2\) and \(p_{2}=(l_{1}+l_{2}+l_{3}+h)/2\), we can get  
\[\Delta_{1}=\frac{2\sqrt{p_{1}(p_{1}-l_{4})(p_{1}-l_{5})(p_{1}-h)}}{h} \tag{6}\]  
\[\Delta_{2}=\frac{2\sqrt{p_{2}(p_{2}-l_{1}-l_{3})(p_{2}-l_{2})(p_{2}-h)}}{h} \tag{7}\]  
Setting \(h\in(0.3,0.4)\) and considering the height of the quadruped, the result can be obtained as shown in Figure 1:0  
The leg configuration between the three-joint and two-joint structures can be more clearly found in Figure 1:1 From these kinematics analyses, it can be found that, when \(h\) is selected as 0.343 in our leg design, the three-part leg structure has enough ground clearance to avoid obstacles.