# Finding Optimal Manipulator Arm Shapes to Avoid Collisions in a Static Environment
## 6 Discussion  
The two proposed methods for finding optimal manipulator arm shapes to avoid collisions were tested on multiple testing workplaces, three of which are presented in this article. The importance of the results is demonstrated in Figure 16, which shows alternative solutions for the first and second testing workplaces with strictly straight arms (the third workplace does not have any valid solution with straight arms) together with the corresponding solutions acquired using the PSO method. As can be seen, the manipulators are much larger than when using arms with curvature, and the arms must have very specific lengths, so the manipulator would have to be custom made anyway. Moreover, these solutions could be invalid in real conditions, as there can be more obstacles at the top (or even a ceiling), which are not included in the simplified simulation model. In general, it can be stated that the PSO method proved to be better in finding the optimal solution, as the fitness function value of the result is typically better (lower), but at the expense of much longer simulation times (see Table 3). The PSO method is sometimes prone to finding a non-optimal solution and requires multiple executions to find the global  
Figure 16: The smallest robots with straight arms able to reach the whole trajectory in the first and second testing workplaces compared to robots with curved arms. (**a**) First workplace, straight arms. (**b**) First workplace, curved arms. (**c**) Second workplace, straight arms. (**d**) Second workplace, curved arms. \begin{table}
\begin{tabular}{l c c c c c c c} \hline \hline  & \multicolumn{2}{c}{**Example 1**} & \multicolumn{2}{c}{**Example 2**} & \multicolumn{3}{c}{**Example 3**} \\  & **Iterative** & **PSO** & **Iterative** & **PSO** & **Iterative** & **PSO** & **PSO*** \\ \hline Arm 1 dist. [m] & 0.320 & 0.308 & 0.403 & 0.456 & 0.418 & 0.337 & 0.689 \\ Arm 1 bend. [m] & 0.000 & 0.000 & 0.119 & 0.093 & 0.190 & 0.071 & 0.000 \\ Arm 2 dist. [m] & 0.320 & 0.343 & 0.403 & 0.406 & 0.418 & 0.530 & 0.971 \\ Arm 2 bend. [m] & 0.019 & 0.010 & 0.273 & 0.185 & 0.020 & 0.029 & 0.437 \\ Fitness function & 0.134 & 0.133 & 0.279 & 0.256 & 0.230 & 0.203 & 0.463 \\ Steps or eras & 4 & 60 & 48 & 65 & 20 & 65 & 23 \\ Particles & – & 1000 & – & 1000 & – & 1000 & 1000 \\ Time [s] & 0.2 & 49.1 & 1.4 & 43.5 & 0.6 & 660 & 756 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Results for the testing workplaces, including the time required to run the corresponding optimization algorithm (PSO* denotes the non-optimal solution). minimum, which further extends the calculation time. This was demonstrated in the third example (see Figure 14c). The iterative method is limited by using dependent lengths of the lower and upper arm--being able to analyze the situation more deeply and change the lengths individually would require a substantial modification of the algorithm. PSO was chosen just to demonstrate that it is possible to use a population-based optimization algorithm in this application, and to roughly compare the performance of a general-purpose optimization method with an iterative method designed directly for the particular problem. Thorough analysis and comparison of various PSO variations and configurations, and even different optimization methods, was not the aim of this work, and could be performed in future research. Other optimization algorithms could probably be able to find the solution in a shorter time or find a slightly better solution. A big advantage of the PSO method is its simplicity--as it is not necessary to perform the in-depth analysis of collisions--and its scalability. In this paper, PSO operated in a six-dimensional space with six parameters of each particle (solution candidate). However, this number can be extended; thus, it is also possible to optimize other parameters of the robot, which will be the focus of further research on this topic by the authors.