# Time-Optimal Trajectory Planning for Woodworking Manipulators Using an Improved PSO Algorithm
## 2 Materials and Methods
### Comparative Testing Experiment  
To test the performance of the GoldS-PSO algorithm, we selected eight test functions commonly used by IEEE Congress on Evolutionary Computation (IEEE CEC) and verified its effectiveness experimentally [40]. In Table 2, \(F_{1}\)-\(F_{5}\) are unimodal benchmark test functions with only one optimal solution, which involves testing the algorithm's convergence rate and accuracy. \(F_{6}\)-\(F_{8}\) are multimodal benchmark testing functions with many local optima, which mainly test the algorithm's ability to jump out of the local extremum. \begin{table}
\begin{tabular}{c c c c} \hline
**Function** & **Range** & **Dimension** & **Optimal Value** \\ \hline \(F_{1}(x)=\sum\limits_{i=1}^{n}x_{i}^{2}\) & \([-100,100]\) & \(30\) & \(0\) \\ \hline \(F_{2}(x)=\sum\limits_{i=1}^{n}|x_{i}^{2}|+\frac{\pi}{i=1}|x_{i}^{2}|\) & \([-10,10]\) & \(30\) & \(0\) \\ \hline \(F_{3}(x)=max_{i}\{\left|x_{i}^{2}\rightEach algorithm runs 30 times independently, calculating the mean value (Mean), best value (Best), and standard deviation (Std) of the optimal results as performance indicators for algorithm optimization, reflecting the algorithm's convergence accuracy and stability. As there are no high requirements for real-time in the woodworking manipulator's trajectory planning, we did not choose to compare and analyze the running time of each algorithm as a specific performance indicator. The results of specific performance indicators in the comparative experiment are recorded in Table 3, and the best results are highlighted in bold font. Table 3 shows that the average and standard deviation of GoldS-PSO optimization results in \(F_{1}\)-\(F_{3}\) reached the theoretical optimal values. This finding indicates that the improved algorithm had good solving accuracy and stability in such unimodal optimization problems. Gold-SA and SPSO algorithms also achieved good results but did not reach the theoretical optimal values in the \(F_{2}\) and \(F_{3}\). However, there is still a significant gap in algorithm accuracy compared to GoldS-PSO. None of the algorithms reached the theoretical optimal value at \(F_{4}\) and \(F_{5}\), but GoldS-PSO had higher accuracy. For the test functions \(F_{6}\) and \(F_{7}\), GoldS-PSO and Gold-SA achieved better results with standard deviations of 0, indicating better robustness of the algorithm. In the \(F_{8}\) test results, although the mean and best values of GoldS-PSO are slightly lower than Gold-SA, it had higher convergence accuracy than the PSO, CFPSO, and SPSO, demonstrating that the improved algorithm has a stronger ability to jump out of local optima. In summary, GoldS-PSO has significantly improved convergence \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Function** & **Range** & **Dimension** & **Optimal Value** \\ \hline \(F_{8}(x)=0.1\bigg{\{}\sin^{2}(3\pi x_{i})+\sum\limits_{i=1}^{n}\left(x_{i}-1 \right)^{2}\left[1+\sin^{2}(3\pi x_{i}+1)\right]+\) & & \\ \((x_{i}-1)^{2}\left[1+\sin^{2}\left(2\pi x_{n}\right)\right]\bigg{\}}\sum \limits_{i=1}^{n}u(x_{i},\,5,\,100,\,4)\) & [\(-\)50,50] & 30 & 0 \\ \(u=(x_{i},\,a,\,k,\,m)=\begin{cases}k(x_{i}-a)^{m},&x_{i}>a,\\ 0,&-a\leq x_{i}\leq a,\\ k(-x_{i}-a)^{m},&x_{i}<-a.\end{cases}\) & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: _Cont._  
Figure 8: \(F_{1}\)–\(F_{8}\) benchmark test function three-dimensional diagram. Figure 9: The best \(F_{1}\)–\(F_{8}\) fitness evolution curves by using PSO, SPSO, CFPSO, Gold-SA, and Golds-PSO in 30 times independent runs.