A mechanical arm motion optimization method and system based on an improved sparrow algorithm
Patent Information
- Application Number
- CN202410604065.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-15
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2044-05-15
AI Technical Summary
[0005]本发明的目的在于提供一种基于改进麻雀算法的机械臂的运动优化方法及系统,以解决目前现有麻雀算法在应用于机械臂轨迹规划中,存在初始种群分布的均匀化偏低,在算法过程中容易陷入局部最优解的问题
[0045]This invention provides a motion optimization method for a robotic arm based on an improved sparrow algorithm, specifically including the following steps: S1, based on the kinematic model of the robotic arm, polynomial interpolation is used to plan the trajectory of the robotic arm to obtain the joint motion trajectory of the robotic arm; S2, based on the joint motion trajectory of the robotic arm, an objective function and constraints for trajectory optimization are constructed; S3, sine and cosine mapping, an improved elite back-learning strategy, and the Cauchy-Gaussian mutation principle are integrated into the sparrow algorithm to obtain an improved sparrow algorithm; S4, based on the objective function and constraints for trajectory optimization, the improved sparrow algorithm is applied to the trajectory planning of the robotic arm, thereby optimizing the running trajectory and running time of the robotic arm. Based on the above, this invention addresses the problems of low initial population distribution uniformity and easy getting trapped in local optima in traditional algorithms for robotic arm trajectory planning, and proposes this time-optimal trajectory planning method for robotic arms based on an improved sparrow algorithm. First, trajectory optimization is performed with the shortest time as the objective, and the motion trajectory of the robotic arm joint space is established by polynomial interpolation, and the objective function and constraints are set. Secondly, based on the combination of sine and cosine mapping and improved elite back-learning strategy, the newly improved sparrow search algorithm (NISSA) is introduced, and the later search capability of the Cauchy-Gaussian mutation strategy is optimized. The performance of the improved algorithm is compared and tested by applying the NISSA algorithm of this invention with particle swarm optimization (PSO), sparrow algorithm (SSA), and multi-strategy improved sparrow algorithm (MISSA) to the trajectory planning of the robotic arm. It is found that the improved NISSA of this invention reduces the joint running time of the robotic arm by about 17.8% compared with that before the improvement, thus improving the efficiency of the robotic arm during operation.
Smart Images

Figure CN118305805B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of robotic arm trajectory planning technology, specifically relating to a motion optimization method and system for a robotic arm based on an improved sparrow algorithm. Background Technology
[0002] The Sparrow Algorithm, which simulates the social behavior of sparrows in predation and anti-predation, demonstrates strong data mining and global search capabilities. It excels in handling high-dimensional functions, and its optimization speed and convergence performance in solving complex nonlinear problems outperform other swarm intelligence optimization algorithms. In recent years, many scholars have focused on researching more effective optimization methods, including Particle Swarm Optimization (PSO), Whale Algorithm, Genetic Algorithm, and the Sparrow Algorithm. Among these, the Sparrow Algorithm is a novel swarm intelligence optimization algorithm with strong robustness.
[0003] Based on this, numerous studies have applied and optimized the sparrow algorithm as an improvement. For example, one study proposed a chaotic sparrow search optimization algorithm and conducted multiple simulation experiments using benchmark functions, demonstrating the effectiveness of the chaotic algorithm in improving the sparrow algorithm's tendency to get trapped in local optima. Another study proposed a multi-strategy improved sparrow algorithm (MISSA), which utilizes a logistic chaotic mapping to homogenize the population and combines the local and global search capabilities of an improved sine and cosine strategy balancing algorithm. This algorithm is then used for time-optimal trajectory planning of a robotic arm, showing significant improvements in both convergence speed and accuracy. Another study proposed a trajectory localization method for an underwater robot telescopic arm based on a multi-strategy improved sparrow search algorithm, demonstrating that the optimized sparrow algorithm outperforms other algorithms. Still another study proposed a sparrow algorithm improvement strategy with dynamically selectable gait parameters, employing a trajectory tracking control strategy based on a non-sinusoidal end-effector sliding mode to improve the robot's motion efficiency, although the curve may exhibit high oscillations.
[0004] However, as the problem dimension increases, the performance of this algorithm gradually decreases, easily getting trapped in local optima and struggling to find the global optimum. Research indicates that the sparrow algorithm relies excessively on the "discoverer" role to find food; once it encounters a poor solution, it directly rejects it, limiting its ability to solve discrete optimization problems. Although the chaotic sparrow search algorithm performs well in terms of global search capability and convergence speed, multiple simulation experiments show that it still faces problems of population homogenization and susceptibility to local optima in the later stages of optimization. When approaching the global optimum, the algorithm easily gets trapped in local optima due to the reduction in population diversity. In the later stages of the ordinary sparrow algorithm, the rapid switching between discoverers and joiners may cause the local population's optimization activity to stagnate. Therefore, in summary, current sparrow algorithms, when applied to robotic arm trajectory planning, suffer from low initial population uniformity and are prone to getting trapped in local optima during the algorithm process. Summary of the Invention
[0005] The purpose of this invention is to provide a motion optimization method and system for robotic arms based on an improved sparrow algorithm, in order to solve the problem that the existing sparrow algorithm, when applied to robotic arm trajectory planning, has a low initial population distribution uniformity and is prone to getting trapped in local optima during the algorithm process.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] This invention provides a motion optimization method for a robotic arm based on an improved sparrow algorithm, specifically including the following steps:
[0008] S1. Based on the kinematic model of the robotic arm, the trajectory of the robotic arm is planned using the polynomial interpolation method to obtain the joint motion trajectory of the robotic arm.
[0009] S2. Based on the joint motion trajectory of the robotic arm, the objective function and constraints for optimizing the robotic arm trajectory are constructed.
[0010] S3. By integrating sine and cosine mapping, improved elite reverse learning strategy, and Cauchy-Gaussian mutation principle into the sparrow algorithm, an improved sparrow algorithm is obtained.
[0011] S4. Based on the objective function and constraints of the robotic arm trajectory optimization, the improved sparrow algorithm is applied to the trajectory planning of the robotic arm, thereby optimizing the running trajectory and running time of the robotic arm.
[0012] In some implementations, in S1, the polynomial interpolation method is a 3-5-3 interpolation method.
[0013] Furthermore, in S1, the method for 3-5-3 polynomial interpolation is as follows:
[0014] Select 4 path points x i1 x i2 x i3 x i4 ;
[0015] Two adjacent points form three time periods: 0-t1, t1-t2, and t2-t3.
[0016] The time interval 0-t1 is the first time interval, which uses cubic polynomial interpolation; the time interval t1-t2 is the second time interval, which uses quintic polynomial interpolation; and the time interval t2-t3 is the third time interval, which uses cubic polynomial interpolation.
[0017] Furthermore, in S2, the motion time of each joint during the movement of the robotic arm is optimized. A function is used to interpolate and fit the path points, and optimization is performed using three time segments of the trajectory points. The objective function is as follows:
[0018]
[0019] The constraints are the speed and acceleration of the robotic arm, and the conditions are as follows:
[0020]
[0021] in, Let represent the angular velocity and angular acceleration of the i-th joint, respectively.
[0022] In some implementations, in S3, sine and cosine mappings are applied to the global and local search phases of the sparrow algorithm to find the optimal time for the robotic arm's trajectory; the position of each individual in the sparrow algorithm is updated, with the i-th individual of the population updated according to the following formula:
[0023]
[0024]
[0025] in, For the i-th sparrow in the t-th iteration, Let a be the globally optimal sparrow individual in the t-th iteration, R1 be a linearly decreasing function, and assume a = 2, t max R1 is the maximum number of iterations, R2 is a random number in the range [0, 2π], R3 is a random number in the range [-2, 2], and R4 is a random number in the range [0, 1].
[0026] In some implementations, in S3, the improved elite reverse learning strategy is to generate an elite reverse solution by setting the center of symmetry as the elite center for reverse learning.
[0027] Furthermore, in S3, an improved elite back-learning strategy is used to find the optimal time for the robotic arm's trajectory; the improved elite back-learning strategy is specifically as follows:
[0028] Let X i =(x i,1 ,x i,2 ,…,x i,d () is an ordinary particle in d-dimensional space. At one of its own extreme points, it is an elite particle, that is... The elite reverse solution is:
[0029]
[0030] Among them, X ij ∈[a j ,b j ], m is the elite inverse coefficient, with a value in the range [0,1], and the dynamic boundary of the j-th dimension search space is represented as [ca j ,cb j The calculation method is as follows:
[0031] ca j =min(X) ij (6);
[0032] cb j =max(X ij (7).
[0033] In some implementations, in S3, the optimal individual is prioritized for iteration, employing a Cauchy-Gaussian mutation strategy to find the optimal time for the robotic arm's trajectory. The mutation formula is as follows:
[0034]
[0035]
[0036]
[0037] in, η is the position of the optimal individual in the population after mutation; δ is the standard deviation of the Cauchy-Gauss mutation theorem; cauchy(0,δ) and Gauss(0,δ) represent the existence of random distributions according to the Cauchy and Gauss theorems, respectively; η1 and η2 are dynamic parameters that change with each iteration.
[0038] In some implementations, S4 specifically refers to:
[0039] S41. Set path points and, based on the inverse kinematics solution, derive the joint angles corresponding to each joint from the pose of the end effector.
[0040] S42. Set the initial parameters of the Sparrow Algorithm, and use sine and cosine mapping to make the initial population chaotic. Determine whether the maximum number of iterations has been reached. If it is satisfied, stop the iteration and output the optimal fitness value of the individual sparrow and the optimal time of the robotic arm's trajectory. If it is not satisfied, continue with the following steps.
[0041] S43. Calculate the fitness value of individual sparrows using the objective function, and update the optimal position of individual sparrows;
[0042] S44. Determine if the algorithm has stalled. If not, introduce an elite reverse learning strategy and iterate under the condition that the current best individual satisfies the kinematic constraints. If so, add a Cauchy-Gaussian mutation strategy before introducing the elite reverse learning strategy to prioritize the iteration of the best individual.
[0043] This invention also discloses a motion optimization system for a robotic arm based on an improved sparrow algorithm. When the motion optimization system for a robotic arm based on the improved sparrow algorithm is executed, it implements the motion optimization method for a robotic arm based on the improved sparrow algorithm as described above.
[0044] Compared with the prior art, the present invention provides a method and system for optimizing the motion of a robotic arm based on an improved sparrow algorithm, which has the following beneficial technical effects.
[0045] This invention provides a motion optimization method for a robotic arm based on an improved sparrow algorithm, specifically including the following steps: S1, based on the kinematic model of the robotic arm, polynomial interpolation is used to plan the trajectory of the robotic arm to obtain the joint motion trajectory of the robotic arm; S2, based on the joint motion trajectory of the robotic arm, an objective function and constraints for trajectory optimization are constructed; S3, sine and cosine mapping, an improved elite back-learning strategy, and the Cauchy-Gaussian mutation principle are integrated into the sparrow algorithm to obtain an improved sparrow algorithm; S4, based on the objective function and constraints for trajectory optimization, the improved sparrow algorithm is applied to the trajectory planning of the robotic arm, thereby optimizing the running trajectory and running time of the robotic arm. Based on the above, this invention addresses the problems of low initial population distribution uniformity and easy getting trapped in local optima in traditional algorithms for robotic arm trajectory planning, and proposes this time-optimal trajectory planning method for robotic arms based on an improved sparrow algorithm. First, trajectory optimization is performed with the shortest time as the objective, and the motion trajectory of the robotic arm joint space is established by polynomial interpolation, and the objective function and constraints are set. Secondly, based on the combination of sine and cosine mapping and improved elite back-learning strategy, the newly improved sparrow search algorithm (NISSA) is introduced, and the later search capability of the Cauchy-Gaussian mutation strategy is optimized. The performance of the improved algorithm is compared and tested by applying the NISSA algorithm of this invention with particle swarm optimization (PSO), sparrow algorithm (SSA), and multi-strategy improved sparrow algorithm (MISSA) to the trajectory planning of the robotic arm. It is found that the improved NISSA of this invention reduces the joint running time of the robotic arm by about 17.8% compared with that before the improvement, thus improving the efficiency of the robotic arm during operation.
[0046] This invention employs sine and cosine mapping to chaoticate the initial population, enhancing its diversity and exploratory capabilities, thereby increasing the likelihood of finding the global optimum. Secondly, an improved elite reverse learning strategy is introduced to address the problem of the algorithm's difficulty in finding the global optimum. Through this elite strategy, reverse learning occurs with elite individuals, generating elite reverse solutions, and selecting high-performing individuals. This helps improve population diversity, thus enabling a more effective search for the global optimum.
[0047] When the algorithm tends to stagnate in the later stages, this invention incorporates a Cauchy-Gaussian mutation strategy to increase the randomness in the local search process. This helps the algorithm escape local optima and ensures that the best individual is iterated first during the period with the best fitness, thereby improving the accuracy of the solution. Attached Figure Description
[0048] The accompanying drawings are provided to further understand the invention and constitute a part of this invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0049] Figure 1 This is a schematic diagram of the motion trajectory of a robotic arm in a system based on an improved sparrow algorithm, according to the present invention.
[0050] Figure 2 This is a schematic diagram of the time-related transformation matrix in an embodiment of the motion optimization method and system for a robotic arm based on the improved sparrow algorithm of the present invention.
[0051] Figure 3 This is a schematic diagram comparing the step size search factor before and after improvement in an embodiment of the motion optimization method and system for a robotic arm based on an improved sparrow algorithm of the present invention.
[0052] Figure 4 This is a schematic diagram of the position distribution of the improved elite back learning algorithm in the system of a motion optimization method for a robotic arm based on the improved sparrow algorithm of the present invention.
[0053] Figure 5 This is a schematic diagram of the Cauchy and Gaussian probability density function curves in a robotic arm motion optimization method based on an improved sparrow algorithm according to the present invention.
[0054] Figure 6 This is a schematic diagram of the motion optimization method for a robotic arm based on an improved sparrow algorithm and the improved sparrow algorithm in the system according to the present invention.
[0055] Figure 7 This is a schematic diagram comparing the evolution curves of PSO algorithm, SSA algorithm, MISSA algorithm and improved sparrow algorithm on the test function in the motion optimization method and system of the robotic arm based on the improved sparrow algorithm of the present invention;
[0056] Figure 8 This invention relates to a motion optimization method for a robotic arm based on an improved sparrow algorithm, and compares the performance of PSO, SSA, MISSA, and the improved sparrow algorithm on the test function with f7, f8, f9, and f... 10 A comparative diagram of evolutionary curves;
[0057] Figure 9 This is a schematic diagram showing the fitness of PSO algorithm, SSA algorithm, MISSA algorithm and improved sparrow algorithm at each joint in the motion optimization method of a robotic arm based on the improved sparrow algorithm of the present invention.
[0058] Figure 10This is a schematic diagram of the motion optimization method for a robotic arm based on an improved sparrow algorithm, and the displacement (a), velocity (b), and acceleration (c) curves of each joint in the system. Detailed Implementation
[0059] To enable those skilled in the art to better understand the present invention, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0060] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0061] How can we provide a sparrow algorithm that prioritizes iterating over the optimal individual during the period with the best fitness, thereby improving the accuracy of the solution, and apply it to the trajectory planning of a robotic arm to improve the efficiency of the robotic arm's operation?
[0062] This invention provides a motion optimization method for a robotic arm based on an improved sparrow algorithm, comprising the following steps: S1, based on the kinematic model of the robotic arm, using polynomial interpolation to perform trajectory planning on the robotic arm, obtaining the joint motion trajectory of the robotic arm; S2, based on the joint motion trajectory of the robotic arm, constructing the objective function and constraints for trajectory optimization of the robotic arm; S3, integrating sine and cosine mapping, improved elite back-learning strategy, and Cauchy-Gaussian mutation principle into the sparrow algorithm to obtain an improved sparrow algorithm; S4, based on the objective function and constraints for trajectory optimization of the robotic arm, applying the improved sparrow algorithm to the trajectory planning of the robotic arm, thereby optimizing the running trajectory and running time of the robotic arm. This invention integrates sine and cosine mapping, an improved elite back-learning strategy, and the Cauchy-Gaussian mutation principle into the sparrow algorithm, thus forming an improved sparrow algorithm suitable for robotic arm motion models. This improved sparrow algorithm effectively avoids the problems of low initial population uniformity and the tendency to get trapped in local optima during the algorithm process. By using this improved sparrow algorithm, it can effectively ensure smooth transitions between the robotic arm's motion trajectories, maintain the continuity of the end effector's motion trajectory without abrupt changes, and achieve significant improvements in optimization accuracy, convergence efficiency, and robustness. It can shorten the motion time and improve motion efficiency while ensuring stable operation of the robotic arm.
[0063] In some embodiments, to ensure the continuity of the position, velocity, and acceleration of the trajectory, the present invention employs a method combining cubic and quintic polynomial interpolation to optimize the trajectory planning of the robotic arm, reduce vibration during movement, protect the mechanical structure of the robotic arm, and improve the accuracy of operation.
[0064] Select 4 path points x i1 x i2 x i3 x i4 The three time periods formed by two adjacent points can be represented as: 0-t1, t1-t2, and t2-t3. 0-t1 is the first time period, which uses cubic polynomial interpolation. t1-t2 is the second time period, which uses quintic polynomial interpolation. t2-t3 is the third time period, which uses cubic polynomial interpolation again.
[0065] The functional relationship between the displacement of the i-th joint and time t is expressed as follows:
[0066] θ i1 (t)=a i13 t 3 +a i12 t 2 +a i11 t+a i10 ;
[0067] θ i2(t)=a i25 t 5 +a i24 t 4 +a i23 t 3 +a i22 t 2 +a i21 t+a i20 ;
[0068] θ i3 (t)=a i33 t 3 +a i32 t 2 +a i31 t+a i30 ;
[0069] Taking the first derivative, we can obtain the functional expression for the velocity and time of the i-th joint:
[0070]
[0071]
[0072]
[0073] Next, we take the second derivative to obtain the functional relationship between the acceleration of the i-th joint and time:
[0074]
[0075]
[0076]
[0077] like Figure 2 As shown, the angular velocity and angular acceleration of the robotic arm's joints are both 0 at the initial and final points, and the angular velocity and angular acceleration should be equal when passing through the midpoint. The time-dependent transformation matrix can be expressed as follows: Figure 2 The matrix.
[0078] The position of the i-th joint of the robotic arm is represented as:
[0079] θ i =[0 0 0 0 0 x i3 0 0 x i0 0 0 x i2 x i1 ] T ;
[0080] The coefficient 'a' of the polynomial interpolation is expressed as:
[0081]
[0082] This invention obtains the objective function and constraints for the motion trajectory of the robotic arm by constructing them.
[0083] This invention optimizes the motion time of each joint during robotic arm movement by using a function to interpolate and fit path points, thereby reducing the time spent traversing each path point. This invention optimizes the three time segments for traversing trajectory points to minimize the robotic arm's motion time, resulting in the following objective function:
[0084]
[0085] To avoid robot arm malfunctions caused by collisions or vibrations due to excessive speed, the robot arm's speed and acceleration are used as constraints, with the following conditions:
[0086]
[0087] in, Let represent the angular velocity and angular acceleration of the i-th joint, respectively.
[0088] This invention improves the Sparrow Algorithm in three aspects: First, by introducing chaotic processing using sine and cosine mapping, the global search capability of the algorithm is enhanced, and the diversity of the population is increased, thus avoiding premature convergence. Second, an elite back-learning method is incorporated into the algorithm, which facilitates the accurate localization of elite back-learning solutions within the finite search space, thereby promoting efficient convergence. Third, by integrating a Cauchy-Gaussian mutation strategy, the priority of the most fit individual during the iteration process is optimized, further improving the algorithm's performance. Specifically:
[0089] I. Chaotic populations generated by sine and cosine mappings;
[0090] Chaos theory is renowned for its unpredictability, comprehensiveness, and high sensitivity to initial conditions; these characteristics are highly effective in improving the convergence speed of algorithms. The Sine Cosine Algorithm (SCA) is an optimization algorithm based on the properties of sine and cosine functions. This algorithm utilizes the characteristics of these two functions to effectively explore the search space, achieving a balance between search capability and exploitation capability, and successfully finding the optimal solution. In this invention, the Sine Cosine Algorithm is applied to the global and local search stages of the sparrow optimization algorithm. This improvement helps optimize the position update of each individual in the sparrow algorithm, thereby effectively avoiding the problem of the algorithm getting trapped in local optima. The i-th individual in the population is updated according to the following formula:
[0091]
[0092]
[0093] in, For the i-th sparrow in the t-th iteration, Let a be the globally optimal sparrow individual in the t-th iteration, R1 be a linearly decreasing function, and assume a = 2, t max R1 is the maximum number of iterations, R2 is a random number in the range [0, 2π], R3 is a random number in the range [-2, 2], and R4 is a random number in the range [0, 1].
[0094] As can be seen from the above formula, the step size factor R1 determines the balance between the algorithm's global development and local search capabilities. When R1 is less than 1, the next generation solution will be located in the middle between the current solution and the target solution, highlighting the algorithm's development potential. When R1 is greater than 1, the solution will be located outside the current solution and the target solution, thus highlighting the algorithm's exploratory function. During the algorithm's iteration process, R1 shows a linear decreasing trend with the increase of the number of iterations. Specifically, in the early stage of iteration, due to the high value of R1, the algorithm exhibits a strong global search capability; however, in the later stage of iteration, the value of R1 decreases, thereby improving the algorithm's development capability in terms of refinement. Using a nonlinear function to adjust R1 ensures that the decrease of R1 is not strictly proportional to the increase of t, but follows a nonlinear curve, achieving a more detailed balance between exploration and utilization between different stages of the optimization process. The adjustment strategy is as follows:
[0095]
[0096] like Figure 3 As shown. Where b is the decay rate parameter, let a = 1.2, b = 2.5, t max =200, then the change of R1 is as follows Figure 3 The improved R1 decreases more slowly in the early stages of iteration, which is suitable for maintaining strong global search capabilities in the early stages of the algorithm. This effectively balances the algorithm's optimization ability and avoids local optima. Using a sine and cosine model to chaoticate the original population not only reduces the drawback of a large population search range, but also results in a more even distribution of population positions and increased diversity, thus improving the algorithm's optimization ability. Therefore, the update method for the discoverer in the sparrow population is improved:
[0097]
[0098] II. Improve the elite reverse learning strategy;
[0099] like Figure 4As shown, to address the problem that the back-learning strategy struggles to find the global optimum under certain conditions, an improvement to the Elite Opposition-Based Learning (EOBL) strategy is proposed. This strategy generates elite back-learning solutions by setting the center of symmetry as the elite center. Figure 4 This is a distribution map of 500 back-learning particles generated using an improved elite back-learning algorithm. By selecting high-performing individuals, it enhances population diversity, thereby finding the optimal solution for back-learning more efficiently.
[0100] Let X i =(x i,1 ,x i,2 ,…,x i,d () is an ordinary particle in d-dimensional space. At one of its own extreme points, it is an elite particle, that is... The elite reverse solution is:
[0101]
[0102] Among them, X ij ∈[a j ,b j ], m is the elite inverse coefficient, with a value in the range [0, 1], and the dynamic boundary of the j-th dimension search space is represented as [ca j ,cb j The calculation method is as follows:
[0103] ca j =min(X) ij (6);
[0104] cb j =max(X ij (7).
[0105] The introduction of dynamic boundaries, as an alternative to fixed search space boundaries, allows for the accumulation of experience during the search process. Thus, as the search space gradually shrinks, the generation of inverse solutions becomes more concentrated, thereby promoting faster convergence of the algorithm. When an inverse solution lies outside the boundary, the following out-of-bounds handling is often required: random resetting.
[0106] X ij =rand(ca j +cb j ).
[0107] III. Cauchy-Gaussian mutation strategy.
[0108] In this invention, during the later stages of the sparrow algorithm, the rapid conversion between discoverers and joiners among sparrow individuals can cause local population optimization stagnation. To accurately grasp the optimal fitness time period, the best individual is prioritized for iteration, employing a Cauchy-Gaussian mutation strategy. The mutation formula is as follows:
[0109]
[0110]
[0111]
[0112] in, η is the position of the optimal individual in the population after mutation; δ is the standard deviation of the Cauchy-Gauss mutation theorem; cauchy(0,δ) and Gauss(0,δ) represent the existence of random distributions according to the Cauchy and Gauss theorems, respectively; η1 and η2 are dynamic parameters that change with each iteration.
[0113] like Figure 5 As shown, Figure 5 To compare the probability density functions of Cauchy and Gauss, by Figure 5 It can be seen that the Cauchy probability density function curve has a long tail, indicating that mutation may produce a longer step size. Combining it with Gaussian mutation can help the Sparrow Algorithm achieve a better balance between global exploration and local exploitation.
[0114] like Figure 6 As shown, to improve the operating efficiency of the robotic arm, an improved sparrow algorithm is used to optimize its running time, thus obtaining its time-optimal solution. The flowchart of the sparrow optimization algorithm combining multiple strategies is as follows: Figure 2 As shown, the steps are as follows:
[0115] Step 1: Set path points, and based on the inverse kinematics solution, obtain the joint angles corresponding to each joint from the pose of the end effector, and solve for the polynomial coefficients;
[0116] Step 2: Set the initial parameters of the SSA algorithm, including the sparrow population size NP, the number of leaders PD, the dimension dim, the upper bound ub, the lower bound lb, the safety threshold ST, the number of early warning birds SD, and the maximum number of iterations T. max At the same time, the initial population is chaoticated by sine and cosine mapping;
[0117] Step 3: Obtain the fitness value of each sparrow individual through the defined objective function, update the position and optimal fitness of the sparrow individuals, and obtain the running time of the optimal individual;
[0118] Step 4: When the algorithm gets stuck, add a Cauchy-Gaussian mutation strategy to prioritize the best fitness value for iteration, thereby helping the algorithm escape local optima;
[0119] Step 5: Update and optimize the positions of discoverers, joiners, and watchers in the sparrow population;
[0120] Step 6: Introduce an elite reverse learning strategy through formulas to explore new regions of the solution space;
[0121] Step 7: Check whether the current optimal individual meets the kinematic constraints and whether the velocity and acceleration are within the specified range;
[0122] Step 8: Determine if the maximum number of iterations has been reached. If it has, stop the iteration and output the optimal fitness value of the sparrow and the optimal trajectory time of the robotic arm. Otherwise, return to step 3.
[0123] To verify the effectiveness and feasibility of the improved sparrow algorithm, this invention selects 10 different benchmark test functions: f1 to f2. 10 Among them, the unimodal function has only one global optimum, used to test whether the algorithm can effectively find this global optimum. The multimodal function has multiple local optima, used to test the algorithm's ability to overcome local optima and find the global optimum. The benchmark functions are shown in Table 1. Since the multidimensional test function has multiple dimensions and cannot be fully represented in three-dimensional space, a dimensionality reduction method is used to fix all variables except for the two main variables.
[0124] Table 1 Benchmark Functions
[0125]
[0126]
[0127] As an example, the verification of this invention selects the PSO algorithm, SSA algorithm, and the improved MISSA algorithm with good results for comparison with the NISSA algorithm of this invention. To ensure the fairness of the experiment, the main parameters of the algorithm are set as follows: sparrow population size Np = 100, function dimension dim = 3; maximum number of iterations max_iter = 300; number of discoverers Pd = 0.2 × Np; number of vigilants Sd = 0.2 × Np; safety threshold ST = 0.6. In the PSO algorithm, the learning factors C1 and C2 are 1.3 and 1.5 respectively, and the elasticity coefficient is 1.
[0128] like Figure 7 and Figure 8 As shown in Table 2, the performance of each algorithm was evaluated and compared through 30 independent computations for each test function. The calculated mean and standard deviation were used as evaluation metrics to verify the effectiveness of the algorithms. The results are shown in Table 2. The evolution curves of each algorithm on the test function are shown in Table 2. Figure 7 and Figure 8The x-axis represents the number of iterations, and the y-axis represents the fitness function value; logarithmic values are used for ease of observation. The ideal optimal value for each benchmark function is 0, indicating that the closer the algorithm's result is to 0, the higher its convergence accuracy. The table shows that the NISSA algorithm outperforms other algorithms in both optimal value and standard deviation, demonstrating that the NISSA algorithm has the best stability and convergence accuracy.
[0129] The results of testing on multimodal functions show that, despite numerous local optima, the NISSA algorithm proposed in this invention still exhibits fast convergence capability and also ensures improved convergence accuracy. This further proves that the NISSA algorithm can maintain population diversity and effectively avoid getting trapped in local optima during iteration. Although the improvement in convergence accuracy is not significant in certain specific function tests, its convergence speed is significantly better than other comparative algorithms. Figure 7 and Figure 8 As can be clearly seen, for all test functions, the improved Sparrow Algorithm of this invention has a larger slope than other algorithms when the number of iterations is the same. When the number of iterations is reached, the fitness value is optimal. Therefore, it can be concluded that the NISSA algorithm has better convergence speed and convergence accuracy.
[0130] like Figure 9 As shown, to further verify the optimization performance of the improved sparrow algorithm, this invention compares it with the particle swarm optimization (PSO), sparrow algorithm (SSA), and sparrow algorithm improved with Logistic chaotic mapping (MISSA). The fitness value of each joint was tested. The results show that the fitness values of other algorithms are higher than those of NISSA, indicating that NISSA is more likely to find the optimal value in the population iterative optimization process than other algorithms. The comparison figure is shown below. Figure 9 As shown.
[0131] The various optimization algorithms were simulated in the robotic arm trajectory optimization, and the time required for each trajectory was recorded, as shown in Table 2. To ensure that each joint completes the predetermined trajectory, the time is the maximum running time of each joint in each trajectory segment. Table 2 shows that compared to the motion time before optimization, the improved algorithms reduced the motion time. Specifically, the trajectory route planned by NISSA was more convenient, reducing the robotic arm's running time from 11.38s to 9.35s, representing efficiency improvements of 11.6%, 10.02%, and 4.75% compared to other algorithms.
[0132] Table 2 shows the simulation time results for each algorithm optimizing the motion trajectory.
[0133]
[0134]
[0135] like Figure 10 As shown, a simulation analysis of the robotic arm's trajectory is performed. During the movement, the positions, velocities, and acceleration curves of each joint of the robotic arm are as follows: Figure 10 It can be seen that the motion curves of the robotic arm at each joint after 3-5-3 polynomial interpolation are smooth and continuous, the velocity and acceleration satisfy the constraints, and the velocity and acceleration at path points A and D are both 0. The planned displacement, velocity, and acceleration curves are smoother, reducing the running time of the robotic arm on the optimal route, fully demonstrating the effectiveness of the improved sparrow algorithm of this invention in robotic arm trajectory planning.
[0136] Finally, it should be noted that the above are merely preferred embodiments of the present invention and are not intended to limit the invention. For those skilled in the art, the present invention can have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A motion optimization method for a robotic arm based on an improved sparrow algorithm, characterized in that, Specifically, the steps include the following: S1. Based on the kinematic model of the robotic arm, the trajectory of the robotic arm is planned using the polynomial interpolation method to obtain the joint motion trajectory of the robotic arm. S2. Based on the joint motion trajectory of the robotic arm, the objective function and constraints for optimizing the robotic arm trajectory are constructed. S3. By integrating sine and cosine mapping, improved elite reverse learning strategy, and Cauchy-Gaussian mutation principle into the sparrow algorithm, an improved sparrow algorithm is obtained. Sine and cosine mappings are applied to the global and local search stages of the sparrow algorithm to find the optimal time for the robotic arm's trajectory; the position of each individual in the sparrow algorithm is updated, and the population's... i Only individuals are updated according to the following formula: (3); (4); in, For the first t The iteration of the ... i A sparrow, For the first t The globally optimal sparrow in the next iteration. It is a linearly decreasing function, assuming , It is the maximum number of iterations. The range of values is within random numbers, The range of values is within random numbers, The range of values is within Random numbers; The improved elite reverse learning strategy is to generate elite reverse solutions by setting the center of symmetry as the elite center and performing reverse learning. By improving the elite back-learning strategy, the optimal time for the robotic arm's trajectory is found; the improved elite back-learning strategy is as follows: set up It is an ordinary particle in d-dimensional space. At one of its own extreme points, it is an elite particle, that is... The elite inverse solution is: (5); in, , m is the elite inverse coefficient, with a value in the range [0,1]. j The dynamic boundary of the 3D search space is represented as The calculation method is as follows: (6); (7); The optimal individual is prioritized for iteration, and a Cauchy-Gaussian mutation strategy is used to find the optimal time for the robotic arm's trajectory, as shown in the following formula: (8); (9); (10); in, The position of the optimal individual in the population after mutation; Let the standard deviation be the standard deviation of Cauchy's variation theorem. and These represent the random distributions that exist according to Cauchy's and Gauss's theorems, respectively; and These are dynamic parameters that change with each iteration; S4. Based on the objective function and constraints of the robotic arm trajectory optimization, the improved sparrow algorithm is applied to the trajectory planning of the robotic arm, thereby optimizing the running trajectory and running time of the robotic arm.
2. The motion optimization method for a robotic arm based on the improved sparrow algorithm according to claim 1, characterized in that, In S1, the polynomial interpolation method is a 3-5-3 polynomial interpolation method.
3. The motion optimization method for a robotic arm based on the improved sparrow algorithm according to claim 2, characterized in that, In S1, the 3-5-3 polynomial interpolation method is specifically as follows: Select 4 waypoints , , , ; Two adjacent points form three time periods: ; For the first time interval, a cubic polynomial interpolation algorithm is applied; For the second time interval, a fifth-order polynomial interpolation algorithm is applied; For the third time segment, a cubic polynomial interpolation algorithm is applied.
4. The motion optimization method for a robotic arm based on the improved sparrow algorithm according to claim 3, characterized in that, In step S2, the motion time of each joint during the movement of the robotic arm is optimized. A function is used to interpolate and fit the path points, and optimization is performed using three time segments of the trajectory points. The objective function is as follows: (1); The constraints are the speed and acceleration of the robotic arm, and the conditions are as follows: (2); in, , They represent the first i Angular velocity and angular acceleration of the joint.
5. The motion optimization method for a robotic arm based on the improved sparrow algorithm according to claim 1, characterized in that, Specifically, S4 is: S41. Set path points and, based on the inverse kinematics solution, derive the joint angles corresponding to each joint from the pose of the end effector. S42. Set the initial parameters of the sparrow algorithm, and use sine and cosine mapping to make the initial population chaotic. Determine whether the maximum number of iterations has been reached. If it is satisfied, stop the iteration and output the optimal fitness value of the sparrow and the optimal time of the robotic arm's trajectory. If it is not satisfied, continue with the following steps. S43. Calculate the fitness value of individual sparrows using the objective function, and update the optimal position of individual sparrows; S44. Determine if the algorithm has stalled. If not, introduce an elite reverse learning strategy and iterate under the condition that the current best individual satisfies the kinematic constraints. If so, add a Cauchy-Gaussian mutation strategy before introducing the elite reverse learning strategy to prioritize the iteration of the best individual.
6. A motion optimization system for a robotic arm based on an improved sparrow algorithm, characterized in that, When the motion optimization system for the robotic arm based on the improved sparrow algorithm is executed, it implements the motion optimization method for the robotic arm based on the improved sparrow algorithm as described in any one of claims 1-5.
Citation Information
Patent Citations
Live-line work mechanical arm six-degree-of-freedom redundant task trajectory planning method
CN116061173A
Bidirectional extension mechanical arm path planning method and system under pose constraint
CN117047751A