## Appendix A  
Kinematic model of robotic arm with four degrees of freedom is derived from the D-H model, as found from the robot arm as analyzed in Figure A1. We can analyze the relationship between each joint, as shown in Table A1. The aim of forward kinematics is to solve the transformation equations for the end-effectors' Cartesian position and orientation when the joint angles are given. Homogeneous transformationmatrices that transform the motion from one coordinate frame reference to another can be easily obtained from the D-H parameters, as shown in Table 11, using the conventional equations that relate every two consecutive frames to each other as follows [8]:  
\[T_{i+1}^{i}= \begin{bmatrix}c\theta_{i}&-c\alpha_{i}s\theta_{i}&s\alpha_{i}s \theta_{i}&a_{i}c\theta_{i}\\ s\theta_{i}&c\alpha_{i}c\theta_{i}&-s\alpha_{i}c\theta_{i}&a_{i}s\theta_{i}\\ 0&s\alpha_{i}&c\alpha_{i}&d_{i}\\ 0&0&0&1\end{bmatrix}  \tag{11}\]  
where \(s\) is the sine and \(c\) is the cosine of the angle. Applying Equation (11) to all four reference coordinate frames gives the following homogeneous transformations:  
\[T_{1}^{0}= \begin{bmatrix}c\theta_{1}&0&s\theta_{1}&0\\ s\theta_{1}&0&-c\theta_{1}&0\\ 0&1&0&0\\ 0&0&0&1\end{bmatrix}  \tag{12}\]  
\[T_{2}^{1}= \begin{bmatrix}c\theta_{2}&-s\theta_{2}&0&a_{2}c\theta_{2}\\ s\theta_{2}&c\theta_{2}&0&a_{2}s\theta_{2}\\ 0&0&1&0\\ 0&0&0&1\end{bmatrix}  \tag{13}\]  
\[T_{3}^{2}= \begin{bmatrix}c\theta_{3}&-s\theta_{3}&0&a_{3}c\theta_{3}\\ s\theta_{3}&c\theta_{3}&0&a_{3}s\theta_{3}\\ 0&0&1&0\\ 0&0&0&1\end{bmatrix}  \tag{14}\]  
\[T_{4}^{3}= \begin{bmatrix}c\theta_{4}&-s\theta_{4}&0&a_{4}c\theta_{4}\\ s\theta_{4}&c\theta_{4}&0&a_{4}s\theta_{4}\\ 0&0&1&0\\ 0&0&0&1\end{bmatrix}  \tag{15}\]  
These homogeneous transformations, Equations (12)-(15), describe the kinematic behavior of the robotic system at any instance of time. For instance, to find where frame 4 lies based on frame 3 when joint 4 is at a certain angle, substituting that angle in the specified transformation matrix gives the position and orientation of frame 4 based on frame 3. The first 3 \(\times\) 3 rows and columns of the homogeneous transformation describe frame 4's unit vector projection on frame 3, and the first three rows of the last column of the homogeneous transformation describe the position of frame 4's center based on frame 3. Propagating these matrices from one frame to the other gives us the forward kinematics of the robotic arm that describes the end-effector's frame based on the base frame as follows:  
\[T_{4}^{0} =T_{1}^{0}\times T_{2}^{1}\times T_{3}^{2}\times T_{4}^{3} \tag{16}\]From this point on, we use these transformation matrices as noted above. The rotation matrices and the frame's center coordinates extracted from these homogeneous transformation matrices are as follows:  
\[ \begin{split} T_{4}^{0}=&\left[\begin{matrix}r_{11}&r_{12}&r_{13}&d_{x}\\ r_{21}&r_{22}&r_{23}&d_{y}\\ r_{31}&r_{32}&r_{33}&d_{z}\\ 0&0&0&1\end{matrix}\right]\\ =&\left[\begin{matrix}c_{234}c\partial_{1}&-s_{234}c\partial_{1}&s \partial_{1}&c\partial_{1}(a_{3}c_{23}+a_{2}c\partial_{2}+a_{4}c_{234})\\ c_{234}s\partial_{1}&-s_{234}s\partial_{1}&-c\partial_{1}&s\partial_{1}(a_{3} c_{23}+a_{2}c\partial_{2}+a_{4}c_{234})\\ s_{234}&c_{234}&0&a_{3}c_{23}+a_{2}c\partial_{2}+a_{4}c_{234}\\ 0&0&0&1\end{matrix}\right]\\ \end{split}  \tag{10}\]  
where \(r\) is the 3 \(\times\) 3 rotation matrix representation of the transformation; \(d\) is the vector containing the \(X\), \(Y\) and \(Z\) coordinates of the origin of the frame; \(c_{ij}=\cos(\theta_{i}+\theta_{j})\); and \(s_{ij}=\sin(\theta_{i}+\theta_{j})\). Through Equation (10), any position in the end-effector frame can be mapped in the base frame. Hence, the forward kinematic parameters for the humanoid arm are given by:  
\[