The invention provides an improved
particle swarm optimization (PSO)
algorithm for mechanical arm
trajectory planning, and aims at solving the problems that a traditional PSO
algorithm is low in convergence speed and prone to falling into a local optimal solution. Therefore, the
inertia weight and the
learning factor of the
algorithm are dynamically adjusted, so that the
inertia weight and the
learning factor change along with the increase of the number of iterations, and the global search capability and the convergence speed are enhanced; meanwhile, an elite reverse learning (EL) strategy is introduced, an
optimal trajectory planning scheme is selected according to a
fitness function, a new search area is explored through reverse particles, and the local search capability is enhanced; and a
Gaussian-Cauchy variation (GC) strategy is combined, so that the global search capability is further improved, and a local optimal solution is avoided. In the optimization process, a single-target optimization method is adopted to carry out hierarchical classification on
population solutions, and the performance of the algorithm under single-target optimization and constraint conditions is improved. Finally, the trajectory of the mechanical arm is optimized based on the algorithm, and particularly, each time period in a 3-5-3 polynomial interpolation method is finely optimized, so that the time from an
initial point to a target point is shortened, a
trajectory planning scheme with the optimal time is obtained, and the working efficiency of the mechanical arm is improved.