Industrial mechanical arm trajectory planning method based on time optimization
By dynamically adjusting the inertia weight and learning factor of the particle swarm algorithm, combined with inverse kinematics and 3-5-3 polynomial fitting, the robot arm trajectory planning method is improved, and the imbalance between local and global search capabilities in the robot arm trajectory planning is solved. problem, improve the operating efficiency and stability of the robotic arm, and meet the time requirements of intelligent manufacturing.
Patent Information
- Application Number
- CN202410995287.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-10-29
AI Technical Summary
The existing technology is difficult to balance local and global search capabilities in robotic arm trajectory planning, and has poor stability, resulting in low operating efficiency of the robotic arm and difficulty in meeting the time requirements of intelligent manufacturing.
Dynamically adjust the inertia weight and learning factor of the particle swarm algorithm, solve the joint position sequence through inverse kinematics, and use 3-5-3 mixed polynomial fitting to generate motion trajectories, combined with the improved particle swarm algorithm for the shortest time optimization to ensure speed Satisfaction of constraints.
It significantly improves the convergence speed and optimization accuracy of the algorithm, reduces the time for the robot arm to complete tasks, and improves work efficiency and the ability to meet practical application needs.
Smart Images

Figure CN118848974A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a robot arm trajectory planning method, and in particular discloses a time-optimal industrial robot arm trajectory planning method. Technical Background
[0002] The robot arm is an important tool for humans to realize intelligent manufacturing. Trajectory planning is the premise of robot motion control, and high-performance trajectory planning algorithms can extend the robot's working life and run more smoothly. Therefore, in order to enable the robot to operate efficiently and smoothly, it is necessary to plan the trajectory of the robot path reasonably. The optimal trajectory planning of the robot is to plan the optimal trajectory through these path points according to the path points given by the execution task under the condition of satisfying the motion constraints.
[0003] The purpose of optimal trajectory planning is to make the manipulator run efficiently and smoothly according to the preset trajectory while avoiding sudden changes in various motion parameters such as angle, angular velocity, angular acceleration and angular jerk (impact), thereby reducing mechanical vibration and motion impact. The time of trajectory planning can directly reflect the working efficiency of the manipulator, which is related to whether its work meets the time restrictions and requirements of enterprises in intelligent manufacturing. Optimizing time as an indicator of trajectory planning can improve the working efficiency of the manipulator and meet the needs of practical applications. The parameters of various traditional optimization algorithms currently used are determined by experience, which makes it difficult to balance local and global search capabilities, and there are problems such as poor stability, and there is room for further improvement in performance. Summary of the invention
[0004] The purpose of the present invention is to provide a time-optimal industrial robot trajectory planning method, which optimizes the local and global search capabilities of the algorithm by dynamically adjusting the inertia weight and learning factor of the particle swarm algorithm. Taking the industrial six-axis robot as the research object, the joint position sequence corresponding to the given robot end path point is obtained by inverse kinematics, and the motion trajectory in the joint space is fitted by piecewise polynomials; under the speed constraint, the improved particle swarm algorithm is used to optimize the robot motion trajectory in the shortest time. Through MATLAB software simulation and experimental analysis, the improved algorithm has significantly improved the convergence speed and optimization accuracy, effectively reducing the time for the robot to complete the target task.
[0005] The objective of the present invention is achieved through the following technical solutions:
[0006] A time-optimal industrial robot arm trajectory planning method, the method comprising the following steps:
[0007] Step 1: Based on the established kinematic model of the robotic arm;
[0008] Step 2: Divide the robot's operating trajectory into three segments, and obtain the interpolation angles of each joint of the robot arm in the joint space through the mapping relationship in step 1, i.e., inverse kinematics solution;
[0009] Step 3: Based on the interpolation angle of the robot joint space obtained in step 2, the 3-5-3 mixed polynomial interpolation function is used to generate the continuous trajectory motion equation of the position, velocity and acceleration of the robot;
[0010] h i1 (t) = a i13 t 3 +a i12 t 2 +a i11 t 1 +a i10 (1)
[0011] h i2 (t) = a i25 t 5 +a i24 t 4 +a i23 t 3 +a i22 t 2 +a i21 t 1 +a i20 (2)
[0012] h i3 (t) = a i33 t 3 +a i32 t 2 +a i31 t 1 +a i30 (3)
[0013] Where: h i1 (t), h i2 (t), h i3 (t) represent the trajectories of the three polynomials, and the unknown coefficient a i1j , a i2j , a i3j is the jth coefficient of the interpolation function of each segment of the ith joint trajectory of the 3-5-3 spline polynomial. Using the above 14 boundary and transition constraints, the 14 unknown coefficients a of the 3-5-3 polynomial can be derived and solved. ij ;
[0014] Step 4: Obtaining a fitness function based on the optimization objective and the speed constraint condition;
[0015] f(t)=min(t i1 +t i2 +ti3 ) (4)
[0016] max{|V i |}≤V imax (5)
[0017] Where: V i and V imax are the real-time speed and maximum speed limit of the i-th joint respectively. The particle swarm algorithm is used to solve the complex constrained optimization problem.
[0018] Step 5: Use the improved particle swarm algorithm to optimize the running time of the space robot trajectory;
[0019] S1: Select the size N of the population, randomly generate N particles in the 3D search space of the interpolation time to form the initial population, and initialize the position and velocity of the particles;
[0020]
[0021]
[0022] Where: k is the number of iterations, w is the inertia weight, c1 is the individual learning factor, c2 is the social learning factor, r1 and r2 are two independent random functions that satisfy the normal distribution in [0, 1]. id is the individual optimum, p gd Optimal for the group;
[0023] S2: N groups of time variables t i1 ,t i2 ,t i3 The unknown coefficient a of the 3-5-3 polynomial can be obtained ij ;
[0024] S3: The coefficient a of the 3-5-3 polynomial ij Substitute into equations (1) to (3) and take the derivative with respect to time to obtain the velocity function of the joint angle and determine whether the real-time velocity satisfies equation (5);
[0025] S4: Calculate the fitness value of each particle. The calculation results of S3 are screened. If the speed of any of the three segments does not meet the formula (5), the fitness value of the particle is set to a very large constant. When looking for the optimal particle, the particle with a larger fitness value will be excluded through the comparison of the fitness values and will not be selected as the optimal particle. The particle itself will slowly move toward the optimal value until the speed constraint is met. If the maximum speed of the three segments meets the formula (5), the formula (4) is used as the fitness function, and the particle swarm algorithm is iterated to obtain the minimum interpolation time as the goal;
[0026] S5: For each particle, compare its fitness value with the p of the best position it has ever experienced. id The fitness value is compared, and if it is better, it is replaced with the current best position p id ;
[0027] S6: Compare the fitness value of each particle's current best position to obtain the current overall optimal particle, and then compare it with the global best position p experienced by the group. gd Compare and replace p if it is better gd ;
[0028] S7: changing the speed and position of the particles according to equations (5) to (6), and reintegrating into a new population consisting of N particles;
[0029] S8: If the termination condition is met (usually a sufficiently good fitness value or reaching a preset maximum number of iterations (Kmax), the algorithm ends, otherwise returns to step 2);
[0030] Step 6: Use the inertia weight of the improved trigonometric function, as shown in equations (8) to (9). The inertia weight value after the improvement not only retains the advantages of decreasing from large to small, but also can be a small random value between (0.2, 0.3) in the later stage, ensuring the diversity of the particle population, thereby improving the solution accuracy. Construct the ω, c1, and c2 value functions as follows:
[0031]
[0032] ω=0.2+0.1·randt>0.7T max (9)
[0033]
[0034]
[0035] Where:ω max is the maximum inertia weight, ω min is the minimum inertia weight, t is the current iteration number of the particle, T max is the maximum number of iterations, rand is a function in MATLAB, and the output is a random number between (0, 1). c1 is the global learning factor, c2 is the local learning factor, c0 is the initial value, and the learning factor is updated with each iteration of the particle. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 Flowchart of trajectory planning method;
[0037] Figure 2 Simulation trajectory graph;
[0038] Figure 3Joint angle curve graph of joints 1 to 6;
[0039] Figure 4 Angular velocity curves of joints 1 to 6;
[0040] Figure 5 Joint angular acceleration curves of joints 1 to 6;
[0041] Figure 6 Comparison chart between standard PSO and improved PSO. DETAILED DESCRIPTION
[0042] In order to clearly explain the purpose, technical details and effective application of this application and facilitate the understanding and implementation of ordinary technicians in this field, the following will be further elaborated in combination with the embodiments of the present invention and the accompanying drawings. Obviously, the implementation examples described here are only used to illustrate and explain this application, and are not used to limit this application.
[0043] This application provides a time-optimal industrial robot arm trajectory planning method, the trajectory planning flow chart is attached Figure 1 . The following steps are included:
[0044] Step 1: Based on the established kinematic model of the robotic arm;
[0045] The torsion angle α between the coordinate systems of each link i / (°), connecting rod length a i / mm, connecting rod offset d i / mm, joint angle θ i / (°)According to the DH parameter conversion rule, the homogeneous transformation matrix between the connecting rods can be obtained.
[0046] The DH parameter table of the six-degree-of-freedom industrial robot arm is as follows:
[0047] Rod <![CDATA[θ i / (°)]]> <![CDATA[d i / mm]]> <![CDATA[a i / mm]]> <![CDATA[α i / (°)]]> <![CDATA[θ i Scope]]> 1 <![CDATA[θ1]]> 0 a1 -90 -180~180 2 <![CDATA[θ2(-90)]]> 0 a2 0 -120~120 3 <![CDATA[θ3(90)]]> 0 0 90 -140~145 4 <![CDATA[θ4]]> d1 0 -90 -270~270 5 <![CDATA[θ5]]> 0 0 90 -120~120 6 <![CDATA[θ6]]> d2 0 0 -270~270
[0048] According to the above table, the homogeneous transformation matrices between the coordinate systems are:
[0049]
[0050]
[0051]
[0052] By multiplying the above homogeneous transformation matrices in sequence, we can obtain the coordinate transformation relationship of the origin of the coordinate system where the end effector of the robot is located relative to the base coordinate system {0} as follows:
[0053]
[0054] in:
[0055] n x =s6[s5(s4(c1s2+c2s1)+c3c4(s1s2-c1c2))+c5s3(s1s2-c1c2)]-c6[c5(s4(c1s2+c2s1)+c3c4(s1s2-c1c2))-s3s5(s1s2-c1c2)]
[0056] n y =c6(c3s5+c4c5s3)+s6(c3c5-c4s3s5)
[0057] n z =c6[c5(s4(s1s2-c1c2)-c3c4(c1s2+c2s1))+s3s5(c1s2+c2s1)]-s6[s5(s4(s1s2-c1c2)-c3c4(c1s2+c2s1))-c5s3(c1s2+c2s1)]
[0058] about x =c6[s5(s4(c1s2+c2s1)+c3c4(s1s2-c1c2))+c5s3(s1s2-c1c2)]+s6[c5(s4(c1s2+c2s1)+c3c4(s1s2-c1c2))-s3s5(s1s2-c1c2)]
[0059] about y =c6(c3c5-c4s3s5)-s6(c3s5+c4c5s3)
[0060] about z =-c6[s5(s4(s1s2-c1c2)-c3c4(c1s2+c2s1))-c5s3(c1s2+c2s1)]-s6[c5(s4(s1-c1c2)-c3c4(c1s2+c2s1))+s3s5(c1s2+c2s1)]
[0061] a x =c4(c1s2+c2s1)-c3s4(s1s2-c1c2)
[0062] a y =s3s4
[0063] a z =-c4(s1s2-c1c2)-c3s4(c1s2+c2s1)
[0064] p x=a2c1+d2c4(c1s2+c2s1)+d1s3(s1s2-c1c2)-d2c3s4(s1s2-c1c2)+a1
[0065] p y =d1c3+d2s3s4
[0066] p z =d1s3(c1s2+c2s1)-d2c4(s1s2-c1c2)-a2s1-d2c3s4(c1s2+c2s1)
[0067] The above parameters and equations constitute the forward kinematics equation of the robot. By knowing the rotation angle value of each joint of the robot and substituting it into this equation, we can obtain the Cartesian coordinate point of the robot's end effector in the robot's base coordinate system.
[0068] Step 2: This method divides the spatial working trajectory into three segments, and a total of two transition points need to be inserted into the trajectory to provide the joint angles of the initial point, transition point 1, transition point 2, and end point, which is convenient for the subsequent 3-5-3 polynomial difference.
[0069] Step 3: Based on the path points and joint angles of each joint obtained in step 2, the joint angles of each joint in the joint space are interpolated using 3-5-3 polynomial interpolation;
[0070] h i1 (t) = a i13 t 3 +a i12 t 2 +a i11 t 1 +a i10
[0071] h i2 (t) = a i25 t 5 +a i24 t 4 +a i23 t 3 +a i22 t 2 +a i21 t 1 +a i20
[0072] h i3 (t) = a i33 t 3 +a i32 t 2 +a i31 t 1 +a i30
[0073] Step 4: Take the first derivative of the above joints to get the angular velocity of the corresponding joint, and take the second derivative to get the angular acceleration;
[0074] Step 5: h i1 (t), h i2 (t), h i3 (t) represent the trajectories of the three polynomials, and the unknown coefficient a i1j , a i2j , a i3j is the jth coefficient of the interpolation function of each segment of the ith joint trajectory of the 3-5-3 spline polynomial. Using the above 14 boundary and transition constraints, the 14 unknown coefficients a of the 3-5-3 polynomial can be derived and solved. ij ; In formula b, θ0 is the joint angle of the i-th joint at the beginning of the first trajectory, θ1 is the angle of the i-th joint at the end of the first trajectory, θ2 is the angle of the i-th joint at the end of the second trajectory, and θ3 is the angle of the i-th joint at the end of the third trajectory. -1 bSolve
[0075] Where:
[0076]
[0077] b=[0 0 0 0 0 0 θ3 0 0 0 θ0 0 0 θ1 θ2] T
[0078] Step 6:,After completing step 5, consider the influence of multiple constraints such as optimal time, joint angular velocity and joint angular acceleration during operation, and define the fitness function and speed constraint conditions.
[0079] f(t)=min(t i1 +t i2 +t i3 )
[0080] max{|V j1 |}≤V max
[0081] max{|V j2 |}≤V max
[0082] max{|V j3 |}≤V max
[0083] Where: t i1 is the interpolation time of the nth segment of the ith joint, V j1 and V max are the instantaneous velocity and maximum velocity of the j-th joint respectively.
[0084] Step 7: Use the improved particle swarm algorithm to optimize and solve the fitness function of each joint. The specific steps are as follows:
[0085] S1: Initialize the particle swarm parameters, set the particle swarm size, particle dimension, number of iterations, inertia weight, learning factor, initialize the position and flight speed of particle i in the swarm, and achieve p id (individual optimality) and p gd (Group Optimum) Update;
[0086] S2: Calculate and update the flying speed and position of the particle in the current space;
[0087]
[0088]
[0089] S3: Update the inertia weight of the improved trigonometric function change;
[0090]
[0091] ω=0.2+0.1·randt>0.7T maX
[0092] The learning factor is also updated along with the inertia weight;
[0093]
[0094]
[0095] S4: After the above steps are completed, the fitness value corresponding to the particle is updated;
[0096] S5: Update the individual historical optimal fitness and position of each particle and the group historical optimal fitness and position;
[0097] S6: If the termination condition is met (usually a sufficiently good fitness value or reaching a preset maximum number of iterations (Kmax), the algorithm ends, otherwise returns to S2);
[0098] The following table shows the joint angles of the initial point, transition point, and end point of the six-axis robot trajectory:
[0099]
[0100]
[0101] The limits of each axis are ±180, -115, 120, -140, +145, ±-270, ±120 and ±270. It can be seen that the interpolation angle of each joint of the robot arm in the above table is within the reachable range of its workspace. Set the interpolation time of each segment to 2s, and impose constraints on the robot arm joints: the maximum speed is set to Vmax 40(°) / s and the maximum acceleration is set to Amax=30(°) / s2.
[0102] A simulation experiment is used to verify the optimization method proposed in the present invention, and the simulation platform adopts Matlab2023a version. Figures 2 to 5 To find the trajectory curve at the optimal time and the changes in each joint angle, joint angular velocity, and joint angular acceleration. Figure 6 This is a comparison diagram between the standard PSO and the improved PSO.
[0103] The improved particle swarm algorithm is superior to the standard particle swarm algorithm in terms of convergence speed and convergence accuracy. At the same time, after iterative optimization of the particle swarm algorithm, a set of optimal solutions t1 = 1.1337s, t2 = 0.8282s, t3 = 1.9606s were found. After iterative optimization of the algorithm, the total running time of the robot trajectory found was 3.8567s, which proved the superiority of the improved particle swarm algorithm.
[0104] The above specific implementation modes are used to explain the present application rather than to limit the present application. Any modifications and changes made to the present application within the purpose of the present application and the protection scope of the claims shall fall within the protection scope of the present application.
Claims
1. A time-optimal industrial robot arm trajectory planning method, characterized in that: The method comprises the following steps: Step 1: Based on the established kinematic model of the robotic arm; Step 2: Divide the robot's operating trajectory into three segments, and obtain the interpolation angles of each joint of the robot arm through the mapping relationship in step 1, that is, inverse kinematics solution; Step 3: Based on the interpolation angle of the robot arm obtained in step 2, use the 3-5-3 mixed polynomial interpolation function to generate the continuous trajectory motion equation of the position, velocity and acceleration of the robot arm; h i1 (t)=a i13 t 3 +a i12 t 2 +a i11 t 1 +a i10 (1) h i2 (t)=a i25 t 5 +a i24 t 4 +a i23 t 3 +a i22 t 2 +a i21 t 1 +a i20 (2) h i3 (t)=a i33 t 3 +a i32 t 2 +a i31 t 1 +a i30 (3) Where: h i1 (t),h i2 (t),h i3 (t) represent the trajectories of the three polynomials, and the unknown coefficient a i1j ,a i2j ,a i3j is the jth coefficient of the interpolation function of each segment of the ith joint trajectory of the 3-5-3 spline polynomial; using the above 14 boundary and transition constraints, the 14 unknown coefficients a of the 3-5-3 polynomial can be derived and solved ij ; Step 4: Obtaining a fitness function based on the optimization objective and the speed constraint condition; f(t)=m i n(t i1 +t i2 +t i3 ) (4) max{|V i |}≤V imax (5) Where: V i and V imax are the real-time speed and the maximum speed limit of the i-th joint, respectively. The particle swarm algorithm is used to solve the complex constrained optimization problem; Step 5: Use the improved particle swarm algorithm to optimize the running time of the robot trajectory in space; S1: Select the size N of the population, randomly generate N particles in the 3D search space of the interpolation time to form the initial population, and initialize the position and velocity of the particles; Where: k is the number of iterations, w is the inertia weight, c1 is the individual learning factor, c2 is the social learning factor, r1 and r2 are two independent random functions that satisfy the normal distribution in [0, 1]; p id is the individual optimum, p gd Optimal for the group; S2: N groups of time variables t i1 ,t i2 ,t i3 The unknown coefficient a of the 3-5-3 polynomial can be obtained ij ; S3: The coefficient a of the 3-5-3 polynomial ij Substitute into equations (1) to (3) and take the derivative with respect to time to obtain the velocity function of the joint angle and determine whether the real-time velocity satisfies equation (5); S4: Calculate the fitness value of each particle; screen the calculation results of S3. If the speed of any of the three segments does not meet the formula (5), the fitness value of the particle is set to a very large constant. When searching for the optimal particle, the particle with a larger fitness value will be excluded through the comparison of the fitness values and will not be selected as the optimal particle. The particle itself will slowly move toward the optimal value until the speed constraint is met. If the maximum speed of the three segments meets the formula (5), the formula (4) is used as the fitness function, and the particle swarm algorithm is iterated to obtain the minimum interpolation time as the goal. S5: For each particle, compare its fitness value with the p of the best position it has ever experienced. i The fitness value is compared, and if it is better, it is replaced with the current best position p i ; S6: Compare the fitness value of each particle's current best position to obtain the current overall optimal particle, and then compare it with the global best position p experienced by the group. g Compare and replace p if it is better g ; S7: changing the speed and position of the particles according to equations (5) to (6), and reintegrating into a new population consisting of N particles; S8: If the termination condition is met, usually a sufficiently good fitness value or a preset maximum number of iterations (Kmax) is reached, the algorithm ends, otherwise it returns to step 2; Step 6: Using the inertia weight of the improved trigonometric function, the inertia weight values shown in equations (8) to (9) not only retain the advantages of decreasing from large to small, but also can be a small random value between (0.2, 0.3) in the later stage, ensuring the diversity of the particle population, thereby improving the solution accuracy; construct the ω, c1, c2 value functions as follows: ω=0.2+0.1·randt>0.6T max (9) Where:ω max is the maximum inertia weight, ω min is the minimum inertia weight, t is the current iteration number of the particle, T max is the maximum number of iterations, rand is a function in MATLAB, and the output is a random number between (0, 1); c1 is the global learning factor, c2 is the local learning factor, c0 is the initial value, and the learning factor is updated with each iteration of the particle.
Citation Information
Cited By
Robot trajectory planning method and system based on improved particle swarm optimization
CN119897868A
Double-mechanical-arm self-adaptive motor neural network optimization system
CN120023827A
Picking mechanical arm trajectory planning method and device, terminal and medium
CN120395916A
