Robot trajectory planning method and system based on improved particle swarm optimization
By dynamically adjusting the learning factors in the particle swarm optimization algorithm, the global search capability of the particle swarm algorithm is improved, and the problem that traditional algorithms are prone to fall into local optimal solutions is solved, achieving more efficient robotic arm trajectory planning and operating efficiency improvement.
Patent Information
- Application Number
- CN202510324737.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-04-29
AI Technical Summary
Traditional particle swarm optimization algorithms are prone to falling into the problem of local optimal solutions and slow convergence speed in robot trajectory planning, resulting in robots performing suboptimal paths.
The improved particle swarm algorithm is adopted to optimize the particle velocity and position update function by dynamically adjusting the expressions of learning factors c1 and c2 (c1=2cos2(nπ/2N), c2=2-c1), thereby improving the algorithm's global search capability and efficiency.
The improved particle swarm algorithm can more effectively optimize the motion trajectory of the robotic arm, significantly shorten the overall running time, and improve the working efficiency and motion accuracy of the robotic arm.
Smart Images

Figure CN119897868A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robot trajectory planning, and in particular to a photovoltaic panel installation robot trajectory planning method based on an improved particle swarm algorithm. Background Art
[0002] With the rapid and high-quality development of photovoltaic power generation, photovoltaic power generation will play an important role in the construction of my country's new energy system. Traditional industrial robots face the problems of low trajectory planning efficiency and unstable operation when performing complex tasks, such as photovoltaic panel installation. Trajectory planning is a key link in robotics technology, which directly affects the robot's operating efficiency and the accuracy of the task. Particle swarm optimization (PSO) is an optimization tool based on swarm intelligence, which is suitable for solving complex optimization problems. In robot trajectory planning, PSO is used to find the optimal or approximately optimal solution. Traditional PSO algorithms may encounter local optimal solutions and slow convergence when dealing with some complex problems. Existing traditional intelligent algorithms have the problem of insufficient global and local search capabilities. The PSO algorithm may converge to the local optimal solution too early in the search process, rather than the global optimal solution. In complex robot trajectory planning problems, the local optimal solution may cause the robot to execute a suboptimal path. Summary of the invention
[0003] Purpose of the invention: In order to improve the efficiency of photovoltaic panel installation by robotic arms in large photovoltaic power stations, a trajectory planning method for photovoltaic panel installation robots based on an improved particle swarm algorithm is proposed.
[0004] Technical solution: A robot trajectory planning method based on an improved particle swarm algorithm includes the following steps:
[0005] Step 1: Obtain the motion data of the robot joint, divide the motion trajectory of the robot joint into three segments, and use cubic polynomial, quintic polynomial and cubic polynomial for interpolation respectively to form a piecewise mixed polynomial interpolation function;
[0006] Step 2: Consider the constraints and select the maximum time required for each joint of the robot to move, ensuring that each joint can complete the corresponding movement within the same running trajectory; select the movement trajectory that takes the longest time for each joint in the same time period, and use the longest time period as the time length of the overall movement trajectory;
[0007] Step 3: Use an improved particle swarm algorithm to independently solve the optimal running path of each joint of the robot; the improved particle swarm algorithm uses a dynamic adjustment strategy of a learning factor for optimization;
[0008] Step 4: Substitute the maximum time consumed by the three segments of the trajectory into the piecewise mixed polynomial interpolation function to perform overall trajectory planning.
[0009] Furthermore, the motion data of the robot joints include a starting position, a target position, and key interpolation points on the path, and are converted into corresponding joint angle values through inverse kinematics equations.
[0010] Furthermore, the constraint conditions in step 2 include the movement speed and acceleration of the robot joints.
[0011] Furthermore, the improved particle swarm algorithm uses the dynamic adjustment strategy of the learning factor for optimization, specifically: optimizing the learning factor in the particle velocity and position update function of the traditional particle swarm algorithm, and the expressions of the optimized learning factors c1 and c2 are:
[0012] c1=2cos 2 (nπ / 2N)
[0013] c2=2-c1
[0014] Where N is the total number of iterations and n is the current iteration number.
[0015] Furthermore, step 3 includes:
[0016] (3.1) Initialization of particle swarm parameters: Initialize the path parameters of each particle, such as time value or control point coordinates.
[0017] (3.2) Rewrite the three-segment motion trajectory function into the form of matrix multiplication, and then substitute the time t1, t2, and t3 required for the three-segment trajectory of each joint of the robot arm to solve the coefficient a in the polynomial. ij ;
[0018] (3.3) Compare the obtained joint angular velocity and joint angular acceleration with the joint maximum angular velocity and maximum angular acceleration respectively. If the obtained joint angular velocity and joint angular acceleration do not exceed the joint maximum angular velocity and maximum angular acceleration, proceed to the next step, otherwise, re-initialize the particle position and velocity randomly;
[0019] (3.4) Iterate the fitness function of the obtained particles to find the optimal value;
[0020] (3.5) Check whether the stopping condition is met. If so, stop the algorithm; otherwise, continue to execute;
[0021] (3.6) After stopping, the maximum time consumed by each joint during operation is selected as the operating time of the mechanical joint.
[0022] Furthermore, the parameter initialization of the improved particle swarm algorithm includes: defining the dimensions of particle position and velocity corresponding to the time parameters of each segment in the piecewise mixed polynomial interpolation function, setting the particle swarm size, the maximum number of iterations, and the initial inertia weight and learning factor; each particle represents a possible motion trajectory of a robot joint.
[0023] Furthermore, in step (3.4), during the iteration process, the current position of particle i, pbest, is i Compared with the historical optimal position, the best one is taken as the historical optimal position; compared with the optimal position in the population and the historical optimal position, the best one is selected as the historical optimal position of the population.
[0024] Furthermore, the stopping condition in step (3.5) includes reaching a maximum number of iterations or a fitness reaching a threshold.
[0025] The robot trajectory planning system based on the improved particle swarm algorithm includes:
[0026] The data processing module obtains the motion data of the robot joint, divides the motion trajectory of the robot joint into three segments, and uses a cubic polynomial, a quintic polynomial and a cubic polynomial for interpolation respectively to form a piecewise mixed polynomial interpolation function;
[0027] The decision module considers the constraints and selects the maximum time required for each joint of the robot to move, ensuring that each joint can complete the corresponding movement within the same running trajectory; selects the movement trajectory that consumes the longest time for each joint in the same time period, and uses the longest time period as the time length of the overall movement trajectory;
[0028] The improved particle swarm algorithm module uses the improved particle swarm algorithm to independently solve the optimal running path of each joint of the robot; the improved particle swarm algorithm uses a dynamic adjustment strategy of a learning factor for optimization;
[0029] The planning module substitutes the maximum time value consumed when the three segments of the trajectory are running into the piecewise mixed polynomial interpolation function to perform overall trajectory planning.
[0030] Beneficial effects: The present invention studies the problem of optimal trajectory planning for installation of a robotic arm based on trajectory planning, takes the highest efficiency as the optimization goal, and proposes a method for improving the efficiency and global search capability of a particle swarm algorithm by using an adaptive learning factor. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A flowchart of improving the particle swarm algorithm for the embodiment of the present application;
[0032] Figure 2 Comparison of joint angle curves between the improved particle swarm algorithm and the standard particle swarm algorithm in the embodiment of the present application;
[0033] Figure 3 Comparison of joint angular velocity curves between the improved particle swarm algorithm and the standard particle swarm algorithm in the embodiment of the present application;
[0034] Figure 4 Comparison of joint angular acceleration curves between the improved particle swarm algorithm and the standard particle swarm algorithm in the embodiment of the present application;
[0035] Figure 5 Comparison of the fitness of joint 1 between the improved particle swarm algorithm and the standard particle swarm algorithm in this application embodiment;
[0036] Figure 6 Comparison of the fitness of joint 2 between the improved particle swarm algorithm and the standard particle swarm algorithm in this application embodiment;
[0037] Figure 7 Comparison of the fitness of joint 3 between the improved particle swarm algorithm and the standard particle swarm algorithm in this application embodiment;
[0038] Figure 8 Comparison of the fitness of joint 4 between the improved particle swarm algorithm and the standard particle swarm algorithm in the embodiment of the present application;
[0039] Fig. 9 Comparison of the fitness of joint 5 between the improved particle swarm algorithm and the standard particle swarm algorithm in the embodiment of the present application;
[0040] Fig.10 This is a comparison of the fitness of joint 6 between the improved particle swarm algorithm and the standard particle swarm algorithm in the embodiment of the present application. DETAILED DESCRIPTION
[0041] The technical solution of the present invention is further described below in conjunction with the accompanying drawings.
[0042] The present invention provides a technical solution:
[0043] The robot trajectory planning method based on the improved particle swarm algorithm includes the following steps:
[0044] Step 1: Obtain the motion data of the robot joint, divide the motion trajectory of the robot joint into three segments, and use cubic polynomial, quintic polynomial and cubic polynomial for interpolation respectively to form a piecewise mixed polynomial interpolation function;
[0045] Step 2: Consider the constraints and select the maximum time required for each joint of the robot to move, ensuring that each joint can complete the corresponding movement within the same running trajectory; select the movement trajectory that takes the longest time for each joint in the same time period, and use the longest time period as the time length of the overall movement trajectory; during the experiment, due to the differences in the movement time of each joint, the overall running time of the system depends on the joint that takes the longest time. Therefore, the longest time is an effective indicator to measure the performance of the system. Compared with the original method, the optimization algorithm proposed in this application significantly shortens the overall running time of the system and effectively improves the operating efficiency.
[0046] Step 3: Use the improved particle swarm algorithm to independently solve the optimal running path of each joint of the robot; the improved particle swarm algorithm uses the dynamic adjustment strategy of the learning factor for optimization; this method treats each joint as an independent optimization target, and the optimization objective function for any joint i is shown in equations (1.6), (1.7) and (1.8):
[0047]
[0048] max{|V ij |}≤V max (1.7)
[0049] max{|a ij |}≤a max (1.8)
[0050] The arc trajectory is divided into three segments, t i1 represents the time taken for the first segment of trajectory planning using cubic polynomial interpolation, t i2 represents the time taken for the second segment to be planned using a quintic polynomial interpolation trajectory, t i3 It represents the time used for trajectory planning using cubic polynomial interpolation in the third segment. The minimum value of the three-segment time is the optimization objective function of the joint.
[0051] Step 4: Substitute the maximum time consumed by the three segments of the trajectory into the piecewise mixed polynomial interpolation function to perform overall trajectory planning.
[0052] The specific steps of using the improved particle swarm (PSO) algorithm to plan the optimal trajectory of joint i are:
[0053] Step 1: Particle swarm initialization. A group of particles is randomly generated, each particle represents a possible solution (i.e., the motion trajectory of the robot arm).
[0054] Step 2: Initialize the path parameters of each particle, such as time value or control point coordinates.
[0055] Step 3: Rewrite the three-segment motion trajectory function into the form of matrix multiplication, as shown in formulas (1.9), (1.10), and (1.11), and then substitute the time t1, t2, and t3 required for the three-segment trajectory of each joint of the robot arm to solve the coefficient a in the polynomial ij .
[0056]
[0057] b=[0 0 0 0 0 0 θ j3 0 0 θ j0 0 0 θ j1 θ j2 ] T (1.10)
[0058] a=A -1 b=[a 13 a 12 a 11 a 10 a 25 a 24 a 23 a 22 a 21 a 20 a 33 a 32 a 31 a 30 ] T (1.11)
[0059] Step 4: Set θ ij Substitute into equations (1.12) to (1.14), and obtain the joint velocity by taking the derivative. Then compare the obtained joint angular velocity and joint angular acceleration with the joint maximum angular velocity and maximum angular acceleration respectively. If the obtained joint angular velocity and joint angular acceleration do not exceed the joint maximum angular velocity and maximum angular acceleration, proceed to the next step. Otherwise, re-initialize the particle position and velocity randomly.
[0060] θ1(t)=a 10 +a 11 t+a 12 t 2 +a 13 t 3 (1.12)
[0061] θ2(t)=a 20 +a 21 t+a 22 t 2 +a 23 t 3 +a 24 t 4 +a25 t 5 (1.13)
[0062] θ3(t)=a 30 +a 31 t+a 32 t 2 +a 33 t 3 (1.14)
[0063] Step 5: Change the fitness function of the obtained particle to formula (1.8), and then iterate to find the optimal value.
[0064] Step 6: During the iteration process, the current position of particle i is pbest i Compare with the historical optimal position, take the best one as the historical optimal position, and then repeat this step. Assuming the number of iterations is k+1, during the iteration process, the position and velocity changes of particle i are expressed by equations (1.15) and (1.16):
[0065]
[0066]
[0067] Where:
[0068] represents the velocity of particle i in the k+1th iteration in d-dimensional space; p i represents the individual optimal position of particle i; p g Indicates the optimal position of the entire group; represents the position of particle i in the kth iteration in d-dimensional space; r1, r2 represent random numbers between [0, 1]; c1 and c2 are acceleration factors; ω represents the inertia weight.
[0069] Step 7: Compare the optimal position in the population with the historical optimal position, and select the best one as the historical optimal position of the population.
[0070] Step 8: Check whether the stopping condition is met (such as reaching the maximum number of iterations or the fitness reaching the threshold). If so, stop the algorithm; otherwise, continue to step 3.
[0071] Step 9: Select the maximum time consumed by each joint when running as the running time of the robot arm.
[0072] Simulation analysis:
[0073] The particle population size is set to 30, the position interval is set to [0,3], the maximum angular velocity of the joint is set to 2.5rad / s as the initialization parameter, the spatial dimension is 3, the maximum number of iterations is 100, and the standard particle swarm algorithm and the improved particle swarm algorithm are simulated and analyzed by MATLAB to obtain the optimized joint angle, angular velocity and angular acceleration curves.
[0074] Comparison of joint angle curves Figure 2 , joint angular velocity curve comparison see Figure 3 , the comparison of joint angular acceleration curves is shown in Figure 4 .
[0075] By comparison, it can be found that the improved particle swarm algorithm optimizes the motion trajectory of the robot arm more effectively than the standard particle swarm algorithm, so that the robot arm takes less time to perform tasks and improves the work efficiency of the robot arm. The improved algorithm pays more attention to the smoothness of the trajectory. The optimized motion trajectory of the robot arm joint is smoother, reducing vibration or jitter during the movement. The improved algorithm optimizes the joint motion trajectory of the robot arm more accurately, making the trajectory closer to the expected path, thereby improving the precision and accuracy of the movement.
[0076] The fitness comparison of joint 1 is shown in Figure 5 , the fitness comparison of joint 2 is shown in Figure 6 , the fitness comparison of joint 3 is shown in Figure 7 , the fitness comparison of joint 4 is shown in Figure 8 , the fitness comparison of joint 5 is shown in Fig. 9 , the fitness comparison of joint 6 is shown in Fig.10 .
[0077] By observing the fitness simulation curves of each joint, it can be found that the improved particle swarm algorithm will converge to a better solution at a faster speed. And the improved particle swarm algorithm has a stronger search ability than the standard particle swarm algorithm. Therefore, the optimized robot arm joint motion trajectory can be found more quickly.
[0078] Table 1 Running time of each joint trajectory after standard PSO optimization
[0079]
[0080]
[0081] Extract the maximum running time of each joint trajectory in the three stages in Table 1, and add them up to get the time required for the robot arm to run the entire trajectory:
[0082] The maximum time required for the first trajectory to run is t_1=0.98767s, the maximum time required for the second trajectory to run is t_2=0.71525s, and the maximum time required for the third trajectory to run is t_3=1.5711s. The total time required for the entire trajectory to run is t=3.26808s, which is 0.93192s shorter than the initial iteration value, and the robot trajectory operation efficiency is improved by 22.2%.
[0083] Table 2 Running time of each joint trajectory after improved PSO optimization
[0084]
[0085] Analyze the data in Table 2:
[0086] The maximum time required for the first trajectory to run is t_1=0.71803s, the maximum time required for the second trajectory to run is t_2=0.74777s, the maximum time required for the third trajectory to run is t_3=1.4208s, and the total time required for the entire trajectory to run is t=2.8866s, which is 1.3134s shorter than the initial iteration value, and the robot arm trajectory operation efficiency is improved by 31.3%.
[0087] The present invention studies the optimal trajectory planning problem of installing the robot arm on the basis of trajectory planning, takes the shortest time as the optimization goal, and proposes a method to improve the efficiency and global search ability of the particle swarm algorithm by using an adaptive learning factor. The improved algorithm is simulated in MATLAB. By comparing with the simulation results of the standard particle swarm algorithm, it is found that the improved algorithm reduces the running time of each joint of the robot arm, which is 31.3% shorter than the running time of the unoptimized robot arm trajectory, and the efficiency is improved by 9% relative to the standard particle swarm algorithm. Such results illustrate the effectiveness of the improved algorithm and verify the feasibility and practicality of the improved method.
Claims
1. A robot trajectory planning method based on an improved particle swarm algorithm is characterized by: The following steps are involved: Step 1: Obtain the motion data of the robot joint, divide the motion trajectory of the robot joint into three segments, and use cubic polynomial, quintic polynomial and cubic polynomial for interpolation respectively to form a piecewise mixed polynomial interpolation function; Step 2: Consider the constraints and select the maximum time required for each joint of the robot to move, ensuring that each joint can complete the corresponding movement within the same running trajectory; select the movement trajectory that takes the longest time for each joint in the same time period, and use the longest time period as the time length of the overall movement trajectory; Step 3: Use an improved particle swarm algorithm to independently solve the optimal running path of each joint of the robot; the improved particle swarm algorithm uses a dynamic adjustment strategy of a learning factor for optimization; Step 4: Substitute the maximum time consumed by the three segments of the trajectory into the piecewise mixed polynomial interpolation function to perform overall trajectory planning.
2. The robot trajectory planning method based on improved particle swarm algorithm according to claim 1 is characterized in that: The motion data of the robot joints include a starting position, a target position, and key interpolation points on the path, and are converted into corresponding joint angle values through inverse kinematics equations.
3. The robot trajectory planning method based on improved particle swarm algorithm according to claim 1 is characterized in that: The constraints described in step 2 include the movement speed and acceleration of the robot joints.
4. The robot trajectory planning method based on improved particle swarm algorithm according to claim 1 is characterized in that: The improved particle swarm algorithm uses the dynamic adjustment strategy of the learning factor for optimization. Specifically, the learning factor in the particle velocity and position update function of the traditional particle swarm algorithm is optimized. The expressions of the optimized learning factors c1 and c2 are: c1=2cos 2 (nπ / 2N) c2=2-c1 Where N is the total number of iterations and n is the current iteration number.
5. The robot trajectory planning method based on improved particle swarm algorithm according to claim 1 is characterized in that: Step 3 includes: (3.1) Initialization of particle swarm parameters: initialization of the path parameters of each particle; (3.2) Rewrite the three-segment motion trajectory function into the form of matrix multiplication, and then substitute the time t1, t2, and t3 required for the three-segment trajectory of each joint of the robot arm to solve the coefficient a in the polynomial. ij ; (3.3) Compare the obtained joint angular velocity and joint angular acceleration with the joint maximum angular velocity and maximum angular acceleration respectively. If the obtained joint angular velocity and joint angular acceleration do not exceed the joint maximum angular velocity and maximum angular acceleration, proceed to the next step, otherwise, re-initialize the particle position and velocity randomly; (3.4) Iterate the fitness function of the obtained particles to find the optimal value; (3.5) Check whether the stopping condition is met. If so, stop the algorithm; otherwise, continue to execute; (3.6) After stopping, the maximum time consumed by each joint during operation is selected as the operating time of the mechanical joint.
6. The robot trajectory planning method based on improved particle swarm algorithm according to claim 5 is characterized in that: The parameter initialization of the improved particle swarm algorithm includes: defining the dimensions of particle position and velocity corresponding to the time parameters of each segment in the piecewise mixed polynomial interpolation function, setting the particle swarm size, the maximum number of iterations, the initial inertia weight, and the learning factor; each particle represents a possible motion trajectory of a robot joint.
7. The robot trajectory planning method based on improved particle swarm algorithm according to claim 5 is characterized in that: In step (3.4), during the iteration process, the current position of particle i is pbest. i Compared with the historical optimal position, the best one is taken as the historical optimal position; compared with the optimal position in the population and the historical optimal position, the best one is selected as the historical optimal position of the population.
8. The robot trajectory planning method based on improved particle swarm algorithm according to claim 5 is characterized in that: The stopping conditions in step (3.5) include reaching the maximum number of iterations or the fitness reaching a threshold.
9. A robot trajectory planning system based on an improved particle swarm algorithm using the robot trajectory planning method based on an improved particle swarm algorithm according to claim 1, characterized in that: include: The data processing module obtains the motion data of the robot joint, divides the motion trajectory of the robot joint into three segments, and uses a cubic polynomial, a quintic polynomial and a cubic polynomial for interpolation respectively to form a piecewise mixed polynomial interpolation function; The decision module considers the constraints and selects the maximum time required for each joint of the robot to move, ensuring that each joint can complete the corresponding movement within the same running trajectory; selects the movement trajectory that consumes the longest time for each joint in the same time period, and uses the longest time period as the time length of the overall movement trajectory; The improved particle swarm algorithm module uses the improved particle swarm algorithm to independently solve the optimal running path of each joint of the robot; the improved particle swarm algorithm uses a dynamic adjustment strategy of a learning factor for optimization; The planning module substitutes the maximum time value consumed when the three segments of the trajectory are running into the piecewise mixed polynomial interpolation function to perform overall trajectory planning.
10. The robot trajectory planning system based on improved particle swarm algorithm according to claim 9, characterized in that: The improved particle swarm algorithm uses the dynamic adjustment strategy of the learning factor for optimization. Specifically, the learning factor in the particle velocity and position update function of the traditional particle swarm algorithm is optimized. The expressions of the optimized learning factors c1 and c2 are: c1=2cos 2 (nπ / 2N)c2=2-c1 Where N is the total number of iterations and n is the current iteration number.
Citation Information
Patent Citations
Power distribution network optimization scheduling method considering time-varying road impedance of electric vehicle
CN115275999A
Industrial mechanical arm trajectory planning method based on time optimization
CN118848974A
Mechanical arm trajectory planning method, system and equipment based on improved particle swarm optimization and storage medium
CN119017372A