# Comparison Study of the PSO and SBPSO on Universal Robot Trajectory Planning
## 2 Materials and Methods
### Serendipity-Based Particle Swarm Optimization
This feature makes the algorithms of optimization find it difficult to escape from a \"black groove\" [33] represented in Equation (23): \[f_{5}(x)=\left[\left(\left\|x\right\|^{2}-d\right)^{2}\right]^{\frac{1}{8}}+ \frac{1}{d}(\frac{1}{2}\left\|x\right\|^{2}+\sum_{i=1}^{d}x_{i})+\frac{1}{2}\] (23)
6. **Ackley function**--there are several local minimums in the parabolic valley. If the function characterized by having an almost flat outer region represent in Equation (24): \[f_{6}(x)=-20\exp(-0.2\sqrt{\frac{1}{d}}\sum_{i=1}^{d}x_{i}^{2})-exp(\frac{1}{ d}\sum_{i=1}^{d}cos(2\pi x_{i}))+20+exp(1)\] (24)

For each of the functions presented, Table 2 shows the search space boundaries and the initialization ranges. The values associated with the parameters w, C\({}_{1}\), and C\({}_{2}\), are defined in Equation (11). The standard PSO's performance might vary, also its modifications [34; 35]. To perform a proper comparison, all parameters of the SBPSO and the standard PSO were defined with the same value: w (weight of inertia) which starts at 0.9 and C\({}_{1}\) = C\({}_{2}\) = 2.0 and decays linearly ending at 0.3. The maximum velocity V\({}_{\max}\) of the particle has been defined related to the dimensions of the search space [25]. Other parameters are specific to SBPSO. They are related to quantity and speed of the scout particles, the detection of premature convergence, and the creation of inspection and adjacent points. The number of Girl Scouts was set to 12 percent of the total number of particles. Equations (13), (15), and (17) have additional parameters: C3 = 1.5, which corresponds to 2% of the search space, and \(\lambda\) = 10\({}^{-4}\). Two thresholds were used: \(\delta_{stag}\) and \(\delta_{conv}\) to detect premature convergence. \(\delta_{stag}\) was assigned the value 10\({}^{-4}\) and the threshold \(\delta_{conv}\). corresponds to 6% of the total iterations number. \(\delta_{conv}\). used to set iterations number whose gBest particle's fitness value has not improved. All of the above parameters were set after repeated simulations and produced good results in the functions which have been studied. ## 3 Results

The performance of the SBPSO algorithms is evaluated and makes a comparison study with the traditional PSO algorithm applied on UR5 trajectory planning. The result presents the fact that, in the SBPSO, the result of serendipity combined with scout particles, more active than the traditional PSO. Figures 5-10 show the behavior of the swarm (with 30 particles) in the Sphere, Rosenbrock, Griewank, Rastrigin, HappyCat and Ackley, for 2000 iterations respectively. In the

\begin{table}
\begin{tabular}{c c c} \hline \hline
**Functions** & **Search Space** & **Initialization Range** \\ \hline \(f_{1}\) & \(-200\leq x_{i}\leq 200\) & \(100\leq x_{i}\leq 200\) \\ \(f_{2}\) & \(-130\leq x_{i}\leq 130\) & \(75\leq x_{i}\leq 130\) \\ \(f_{3}\) & \(-300\leq x_{i}\leq 300\) & \(150\leq x_{i}\leq 300\) \\ \(f_{4}\) & \(-6.10\leq x_{i}\leq 6.

figures below, the traditional PSO stagnated before iteration 2000, but the SBPSO is still active. Figure 5: In the Sphere function (30 particles), the traditional PSO stagnated close to iteration 1300, and the SBPSO remains active close to iteration 2000. Figure 6: In the Rosenbrock function (30 particle), the traditional PSO stagnated close to iteration 870, and the SBPSO remains active near the 2000 iteration. Figure 8: In the Rastrigin (30 particles) function, the traditional PSO stagnate close to iteration 1210 and SBPSO remains active near the 2000 iteration. Figure 7: In the Griewank function (30 particles), the PSO stagnated near the iteration 1010 and the SBPSO remains active near iteration 2000. Tables 3 and 4 show the size of the population, the iterations number, the best fitness value and standard deviation of benchmark functions. Figure 10: In the Ackley function (30 particles), the traditional PSO stagnated close to iteration 1500 and the SBPSO remains active close to iteration 2000.