# Research of Flexible Assembly of Miniature Circuit Breakers Based on Robot Trajectory Optimization
## 5 Algorithm Simulation
According to the fitness, the improved PSO raises the optimization accuracy by 1.1%, 4.4%, 15.7%, and 12.2%, respectively, compared with other algorithms. Since the chaos optimization algorithm decreases significantly as the optimization space increases, the improved PSO has significantly improved convergence speed and convergence accuracy when the optimization space increases compared to the chaotic algorithm. Figure 11: Joint motions before optimization: (**a**) Position curve; (**b**) Velocity curve; (**c**) Acceleration curve; (**d**) Jerk curve. The running time of each joint in section AB optimized by the improved PSO algorithm is shown in Table 5.  
Since the joints move simultaneously during the operation of the robot, the interpolation time of each section in Table 4 is the maximum value of the joints. Therefore, \(t_{1}=2.79\) s, \(t_{2}=3.31\) s, \(t_{3}=1.79\) s. Comparing the running time before optimization in Table 3, the overall time of section AB is decreased from 12 s to 7.89 s, i.e., decreased by 34.25%. The optimized position, velocity, acceleration, and jerk curves of the six joints are shown in Figure 13. The optimized joint curve also passes through the interpolation points \(X_{1}\), \(X_{2}\), \(X_{3}\), and \(X_{4}\), and meets the kinematic constraints in Table 4. The extreme values of the curves become closer to the constraints, and the acceleration curve is continuous and stable. Figure 13c shows that the maximum acceleration of the joints is 0.8 rad/s\({}^{2}\) which is within the acceleration constraint range of Table 3. Figure 13d shows that the maximum jerk of the joints is 1.51 rad/s\({}^{3}\) which is within the jerk constraint range in Table 3. Hence, it can be concluded that the improved PSO decreases the assembly time and raises the operation efficiency. Figure 12: Comparison of iterative process before and after PSO algorithm improvement. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Joint/i**} & \multicolumn{2}{c}{\(t_{1}\)/s} & \multicolumn{2}{c}{\(t_{2}\)/s} & \multicolumn{2}{c}{\(t_{3}\)/s} \\  & **Standard** & **Improved** & **Standard** & **Improved** & **Standard** & **Improved** \\ \hline Joint1 & 3.00 & 2.79 & 1.43 & 1.29 & 1.90 & 1.68 \\ Joint2 & 0.38 & 0.30 & 0.68 & 0.54 & 0.70 & 0.56 \\ Joint3 & 0.63 & 0.46 & 1.98 & 1.67 & 0.58 & 0.45 \\ Joint4 & 0.00 & 0.00 & 0.00 & 0.00 & 0.00 & 0.00 \\ Joint5 & 0.81 & 0.67 & 1.15 & 0.88 & 0.85 & 0.71 \\ Joint6 & 1.95 & 1.88 & 3.34 & 3.31 & 1.85 & 1.79 \\ Optimal & 3.00 & 2.79 & 3.34 & 3.31 & 1.90 & 1.79 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Time before and after the optimization of section AB. After the optimization, the time comparison of the four paths is shown in Table 6.  
It can be seen from Table 6 that after the improved PSO algorithm is applied, the times of the four sections are decreased by 2.13 s, 1.61 s, 1.95 s, and 1.21 s, respectively, and the overall time is decreased by 6.90 s, compared with those before PSO improvement, i.e., the overall efficiency is increased by 16.7%. In addition, we also implement the standard generic algorithm (GA) and chaotic optimization algorithm (COA) whose parameters are tuned to the optimal for comparison, and obviously our method is superior to the standard GA and COA. Figure 14 shows the simulation curves of the robot joint trajectory planning, illustrating the interpolation curves of the three-segment times \(t_{1}\), \(t_{2}\), and \(t_{3}\) after the optimization.