## 3 Results
### Mathematical Formulation of the Convention--DH and Direct/Inverse Kinematics  
The kinematics of the manipulator is determined by establishing the rules for references by applying Equation (4) to Equation (5). Figure 6 presents the kinematics of the manipulator. Table 1 includes the values of the distances between the links. Figure 5: (**a**) Conical base of the manipulator; (**b**) toothed ring; (**c**) shoulder; (**d**) extension arm; (**e**) toothed ring with motor mount; (**f**) secondary double pinion; (**g**) shoulder pad; (**h**) main single pinion; (**i**) toothed wheel; (**j**) robotic arm. Applying Equation (2) and with DH parameters from Table 2, we obtain the individual homogeneous transformation matrix (A1, A2, A3, A4, A5, A6), and by denoting C as cosine and S as sine we obtain:  
\[\text{A1}= \begin{bmatrix}\text{C01}&0&\text{S01}&0\\ \text{S01}&0&-\text{C01}&0\\ 0&1&0&\text{d1}\\ 0&0&0&1\end{bmatrix} , \tag{9}\]  
\[\text{A2}= \begin{bmatrix}\text{C02}&-\text{S02}&0&\text{d2.C02}\\ \text{S02}&\text{C02}&0&\text{d2.S02}\\ 0&0&1&0\\ 0&0&0&1\end{bmatrix} , \tag{10}\]  
\[\text{A3}= \begin{bmatrix}\text{C03}&-\text{S03}&0&\text{d3-C03}\\ \text{S03}&\text{C03}&0&\text{d3-S03}\\ 0&0&1&0\\ 0&0&0&1\end{bmatrix} , \tag{11}\] \begin{table}
\begin{tabular}{c c} \hline \hline
**d** & **Distance [mm]** \\ \hline d1 & 163.00 \\ d2 & 204.00 \\ d3 & 230.00 \\ d4 & 100.00 \\ d5 & 100.00 \\ d6 & 100.00 \\ \hline \end{tabular}
\end{table} 
Table 1: Distance values between links. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Link** & **a [mm]** & \(\alpha\) [\({}^{\circ}\)] & **d [mm]** & \(\theta\) [\({}^{\circ}\)] \\ \hline L01 & 0 & 90 & d1 & 01 \\ L12 & d2 & 0 & 0 & 02 \\ L23 & d3 & 0 & 0 & 03 \\ L34 & 0 & 90 & d4 & 04 \\ L45 & 0 & \(-90\) & d5 & 05 \\ L56 & 0 & 0 & d6 & 06 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: DH parameters. Figure 6: Kinematics of the robotic manipulator. \[\text{A4}= \begin{bmatrix}\text{C04}&\text{O}&\text{S04}&0\\ \text{S04}&0&-\text{C04}&0\\ 0&1&0&\text{d4}\\ 0&0&0&1\end{bmatrix} , \tag{12}\]  
\[\text{A5}= \begin{bmatrix}\text{C05}&0&-\text{S05}&0\\ \text{S05}&0&\text{C05}&0\\ 0&-1&0&\text{d5}\\ 0&0&0&1\end{bmatrix} , \tag{13}\]  
\[\text{A6}= \begin{bmatrix}\text{C06}&-\text{S06}&0&0\\ \text{S06}&\text{C06}&0&0\\ 0&0&1&\text{d6}\\ 0&0&0&1\end{bmatrix} , \tag{14}\]  
The final homogeneous matrix to which the position and orientation of the effector is related is caused by the successive multiplication of Equations (9)-(14). Inverse kinematics is an important and challenging problem in the field of robotics. The analytical solution to the problem is complex and time-consuming depending on the manipulator configuration and the number of solutions. An iterative numerical method was applied to solve the inverse kinematics problem using a particle swarm optimization (PSO) algorithm. [PERSON] and [PERSON] [62] applied PSO and obtained good results compared to other meta heuristic studies in the literature. The proposed algorithm generates solutions for inverse kinematics through a space search, i.e., it finds the ideal values of the six joint angles to minimize the error. Figure 7 shows the pseudocode of the PSO algorithm used in the inverse kinematics process. The pseudo code of the PSO in Figure 7 aims to minimize errors. Essentially, the algorithm searches for the angles of each joint by means of particle velocity, applies direct kinematics (calculates the position and orientation), and then calculates the error between the intended position and the position with the searched solution. The speed of the particle decreases as the error decreases. The algorithm is in a cycle until it reaches the stopping  
Figure 7: This pseudo code for PSO meta heuristics. criterion (error smaller than the desired error: if it has not reached the maximum number of iterations or if it has not reached the maximum iterative time).