# Trajectory Planning of Robotic Arm Based on Particle Swarm Optimization Algorithm
## 3 Improved Particle Swarm Optimization Algorithm  
### Particle Swarm Optimization  
PSO, proposed by [PERSON] and [PERSON] in 1995, serves as a heuristic global search algorithm rooted in swarm intelligence, mimicking the foraging behavior of birds. The essence of the PSO algorithm lies in leveraging all individuals in the population to share information. This facilitates the movement of the entire population in the problem-solving space, transitioning from disorder to order in an evolutionary process, ultimately leading to the acquisition of the optimal solution for the processed problem. The algorithm is known for its simplicity, minimal parameter settings, ease of implementation, and robust global search ability. As a result, it has garnered attention both from researchers and in engineering fields, finding widespread applications.  
Furthermore, PSO employs a particle to simulate the bird actions mentioned above. Each particle carries out automatic search in a multidimensional space, and the particle has only two attributes: velocity and position. Therefore, the optimal solution of a single particle is called the individual extreme value whose optimal represents the global optimal solution of this iteration. At the end of each iteration, the particle velocity and position are updated. Finally, the iteration is stopped whenever reaching the maximum number of iterations or the required fitness level; consequently, the optimal solution of the system is obtained. As for the operation process of the algorithm, it is divided into six steps, which are described below.  
Step 1: Particle initialization. At this level, a random number is assigned to the position and velocity of each particle. Moreover, the maximum number of iterations, the number of independent variables of the objective function, and the maximum velocity of the particle are set.  
Step 2: Whenever a particle updates its position and velocity, its fitness function determines its fitness based on its movement state.  
Step 3: The individual optimal solution of each particle is updated. Each particle individual optimal solution is continuously recorded. When the fitness exceeds the individual optimal solution, this latter will be updated.  
Step 4: During the learning process of each particle, the global best solution is updated. By comparing the individual best solutions of all particles, the current global best solution is determined and compared with the historical global best solution. If it is better than the historical global best solution, the latter will be updated.  
Step 5: All particles' velocities are updated with the current velocity, individual best, and global best as in Equation (13), and the next position of each particle is updated with the current position and velocity as in Equation (14).  
\[\begin{array}{l}V(t+1)=w\times V(t)+c_{1}\times r_{1}\times(pb-X(t))\\ +c_{2}\times r_{2}\times(gb-X(t))\\ \\ X(t+1)=X(t)+V(t+1)\end{array} \tag{13}\]  
In the equation, \(w\) represents the inertia weight; \(c_{1}\) and \(c_{2}\) represent the cognitive and social learning factors of the particle, respectively; \(r_{1}\) and \(r_{2}\) are random numbers between 0 and 1; \(pb\) and \(gb\) denote the individual best solution and global best solution of the particle, respectively; and \(V\) and \(X\) represent the velocity and position of the particle, respectively.  
Step 6: Termination conditions are established. Different termination conditions are set for diverse problems. The set number of iterations is reached, and the difference between the computation meets the minimum bound.