## 4 Aslb--A Bipedal Robot for Dynamics Locomotion
### Aslb Kinematics
#### 4.2.3 Inverse Kinematics  
Inverse kinematics is illustrated on right leg, and the calculations provided here can be duplicated for left leg. Inverse kinematics solutions in this work rely on the geometric calculation of \(\theta_{0,R}\) as provided in Equation (11). The geometric entities are illustrated in Figure 3.  
\[\theta_{0,R} = atan2(\sin(\theta_{0,R}),\cos(\theta_{0,R})) \tag{11}\] \[\left[ \begin{array}{c}\cos(\theta_{0,R})\\ \sin(\theta_{0,R})\end{array} \right] = \left[ \begin{array}{cc}a_{142,z}&-r_{a}\\ -r_{a}&-a_{142,z}\end{array} \right]^{-1}\left[ \begin{array}{c}r_{z}-a_{0,z} \\ r_{y}-a_{0,y}\end{array} \right]\] \[\boldsymbol{r}_{1} = \boldsymbol{r}-\boldsymbol{a}_{0}\] \[\boldsymbol{r}_{a} = \sqrt{r_{1,y}^{2}+r_{1,z}^{2}-a_{14,z}^{2}}\] \[a_{142,z} = a_{14,z}+a_{2,z}\]  
To calculate active joints \(\theta_{1,R}\) and \(\theta_{3,R}\) x and y components of the position vector \(\boldsymbol{r}_{pc}\) as given in Equation (12) are expanded in Equation (13). \[r_{pc,x} = a_{4,x}\cos(\theta_{3,R})+a_{56,x}\cos(\theta_{3,R}+\theta_{4,R}) \tag{12}\] \[r_{pc,y} = a_{4,x}\sin(\theta_{3,R})+a_{56,x}\sin(\theta_{3,R}+\theta_{4,R})\] (13) \[r_{pc,x} = a_{4,x}\cos(\theta_{3,R})+a_{56,x}(\cos(\theta_{3,R})\cos(\theta _{4,R})-\sin(\theta_{3,R})\sin(\theta_{4,R}))\] \[r_{pc,y} = a_{4,x}\sin(\theta_{3,R})+a_{56,x}(\cos(\theta_{3,R})\sin(\theta _{4,R})+\sin(\theta_{3,R})\cos(\theta_{4,R}))\]  
Equation (13) is rewritten as in Equation (14), and each scalar equation can be squared and summed as in Equation (15). \[\cos(\theta_{3,R}) = (r_{pc,x}/a_{4,x})+(a_{56,x}/a_{4,x})\cos(\theta_{3,R}+\theta_{4,R}) \tag{14}\] \[= C_{4}+C_{5}\cos(\theta_{3,R}+\theta_{4,R})\] \[\sin(\theta_{3,R}) = (r_{pc,y}/a_{4,x})+(a_{56,x}/a_{4,x})(\sin(\theta_{3,R}+\theta_{4,R})\] \[\boldsymbol{r}_{a} = \sqrt{r_{1,y}^{2}+r_{1,z}^{2}-a_{14,z}^{2}}\]0  
\[\boldsymbol{r}_{a} = \sqrt{r_{1,y}^{2}+r_{1,z}^{2}-a_{14,z}^{2}}\]1 \[\boldsymbol{r}_{a} = \sqrt{r_{1,y}^{2}+r_{1,z}^{2}-a_{14,z}^{2}}\]2 \[\boldsymbol{r}_{a} = \sqrt{r_{1,y}^{2}+r_{1,z}^{2}-a_{14,z}^{2}}\]3  
Then, using tangents of the half angle, Equation (15) can be further manipulated in Equation (16). The solution to \(\theta_{34,R}\) can be calculated by solving the quadratic problem for \(T_{34}\) as illustrated in Equation (8). \[\boldsymbol{r}_{a} = \sqrt{r_{1,y}^{2}+r_{1,z}^{2}-a_{14,z}^{2}}\]4  
After finding the solution to \(\theta_{34,R}\), these values are inserted into Equation (12) to calculate \(\theta_{3,R}\). This completes the solution to one chain of the leg mechanism. Geometric definitions such as \(\boldsymbol{r}_{pcl}\), \(\boldsymbol{r}_{cl}\) are provided in Figure 4 to calculate the joint variables on the other chain that contains \(\boldsymbol{a}_{2}\) and \(\boldsymbol{a}_{3}\). \[\boldsymbol{r}_{a} = \sqrt{r_{1,y}^{2}+r_{1,z}^{2}-a_{14,z}^{2}}\]5 Geometric entities related to calculation of \(\theta_{0,R}\). Using the known joint variables, point \(v\) is represented from origin of the joint **3** with a vector denoted as \(\mathbf{r}_{\textit{pcl}}\). Alternatively, point \(v\) can also be represented from the origin of the joint **1** with a vector that is \(\mathbf{r}_{\textit{cl}}\). These vectors are defined on \((P,R)\) plane, where the 5R mechanism lies, and provided in Equations (17) and (18), respectively. \[ \begin{array}{rcl}r_{\textit{pcl},x}&=&r_{\textit{pcl},x}-a_{6,x}\cos(\theta _{3,R}+\theta_{4,R})\\ r_{\textit{pcl},y}&=&r_{\textit{pcl},y}-a_{6,x}\sin(\theta_{3,R}+\theta_{4,R} )\\ \\ r_{\textit{cl},x}&=&a_{2,x}\cos(\theta_{1,R})+a_{3,x}\cos(\theta_{1,R}+ \theta_{2,R})\\ r_{\textit{cl},y}&=&a_{2,x}\sin(\theta_{1,R})+a_{3,x}\sin(\theta_{1,R}+ \theta_{2,R})\\ \end{array}  \tag{17}\]  
Scalar equations \(r_{\textit{cl},x}\) and \(r_{\textit{cl},y}\) of Equation (18) are squared, summed, and reorganized as provided in Equation (19) to calculate \(\beta_{R}\), which leads to \(\theta_{2,R}\). \[