Robotic trajectory optimization method, system, device, and medium

By improving the Grey Wolf algorithm and utilizing elite reverse learning and parameter tuning to optimize robot trajectories, the complexity and reliability issues of existing algorithms are resolved. This achieves smooth optimization and efficient operation of robot trajectories, thereby improving work efficiency and service life.

CN116442231BActive Publication Date: 2026-05-19SHANGHAI ELECTRICGROUP CORP
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI ELECTRICGROUP CORP
Filing Date
2023-04-26
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing robot trajectory optimization algorithms suffer from problems such as complex programming, poor reliability, slow search speed, and insufficient predictability. In particular, genetic algorithms require encoding and decoding and their parameters depend on experience, while the reward function design of reinforcement learning is complex and has strong black box characteristics.

Method used

By improving the Grey Wolf algorithm, utilizing an elite reverse learning strategy or adjusting parameters, the robot trajectory planning is optimized, a time-optimal objective function is established, and the robot joint trajectory is optimized, including parameterization and improvements to the Grey Wolf algorithm.

Benefits of technology

It achieves smooth optimization of robot trajectory, improves work efficiency, reduces running time and energy consumption, and extends robot lifespan.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116442231B_ABST
    Figure CN116442231B_ABST
Patent Text Reader

Abstract

The application discloses a robot trajectory optimization method, system, device and medium, wherein the robot trajectory optimization method comprises the following steps: establishing a kinematics model of a robot, obtaining joint coordinates of the robot based on the kinematics model; performing parameterization processing on the joint coordinates based on a preset trajectory planning method and a preset kinematics constraint to obtain joint trajectory parameters of the robot; determining a time optimization as an optimization target according to the joint trajectory parameters, establishing an objective function; improving an original grey wolf algorithm to obtain an improved grey wolf algorithm; optimizing the optimization target based on the objective function by using the improved grey wolf algorithm until a preset termination condition is met, and outputting an optimized target joint trajectory. The grey wolf algorithm is improved by designing adjustment parameters, the trajectory of the robot is optimized by using the improved grey wolf algorithm, the optimal running time is obtained to complete trajectory planning movement, and therefore the working efficiency of the robot can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of robotics, and in particular to a method, system, device, and medium for optimizing robot trajectories. Background Technology

[0002] With the development of science and technology, robots have permeated all walks of life. In their practical applications, working accuracy and motion smoothness are important indicators for measuring robot performance. Based on this, improving work efficiency, reducing operational errors, and minimizing running time and energy consumption have become key issues that need to be addressed in robot applications. The prerequisite and foundation for solving these problems is the research on robot trajectory planning, such as B-spline curves, fifth-order polynomials, and 3-5-3 order polynomial trajectory planning. These planning methods allow robots to move more smoothly, but how to optimize for time optimization remains a challenge.

[0003] With the emergence of various optimization algorithms, many excellent algorithms have been applied to robot trajectory planning optimization problems. In particular, self-inspired algorithms such as particle swarm optimization and genetic algorithms have been proven to be effective in optimizing time-optimal problems.

[0004] However, existing optimization algorithms all have some problems. For example, the programming process of genetic algorithms is relatively complex, requiring encoding of the problem and decoding of the optimal solution. Reliability is also a concern, as some parameters need to be selected empirically, and these parameters directly affect the results. The search speed of these algorithms is relatively slow, requiring even more training time if high precision is required. Furthermore, in reinforcement learning, the design of the reward function is complex; a poorly designed function can negatively impact performance, and the entire process is a black box with poor predictability. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to overcome the above-mentioned defects in the prior art and provide a robot trajectory optimization method, system, device and medium.

[0006] The present invention solves the above-mentioned technical problems through the following technical solution:

[0007] This invention provides a robot trajectory optimization method, the trajectory optimization method comprising:

[0008] Establish a kinematic model of the robot, and obtain the joint coordinates of the robot based on the kinematic model;

[0009] The joint coordinates are parameterized based on a preset trajectory planning method and preset kinematic constraints to obtain the joint trajectory parameters of the robot.

[0010] Based on the joint trajectory parameters, an objective function is established with time optimization as the objective.

[0011] The original Grey Wolf algorithm was improved to obtain the improved Grey Wolf algorithm;

[0012] Based on the objective function, the improved Grey Wolf algorithm is used to optimize the objective until a preset termination condition is met, and the optimized target joint trajectory is output.

[0013] Preferably, the improvement of the original Grey Wolf algorithm to obtain the improved Grey Wolf algorithm includes:

[0014] The original Grey Wolf algorithm is improved based on the elite reverse learning strategy to obtain the improved Grey Wolf algorithm;

[0015] or,

[0016] The original Grey Wolf algorithm was improved by adjusting the design parameters, resulting in the improved Grey Wolf algorithm.

[0017] Preferably, when the original Grey Wolf algorithm is improved based on an elite reverse learning strategy, the step of optimizing the optimization objective using the improved Grey Wolf algorithm includes:

[0018] The gray wolf population is initialized based on the elite reverse learning strategy, and a random population and a dynamic reverse population are randomly generated in space.

[0019] The fitness of the random population and the dynamic reverse population are compared to select multiple gray wolves that meet the preset fitness conditions as the initial population.

[0020] Initialize the convergence factor and coefficient vector, and calculate the fitness values ​​of all wolves according to the objective function to determine the α wolf, β wolf, γ wolf and update the position of the gray wolf;

[0021] Based on the updated gray wolf positions, update the convergence factor and the coefficient vector; calculate the fitness of all gray wolves based on the updated convergence factor and the coefficient vector;

[0022] Based on the fitness of all the gray wolves, update the positions and fitness of the α wolf, β wolf, and γ wolf respectively, so as to determine the updated optimal fitness value and optimal gray wolf position;

[0023] The optimal target joint trajectory is determined based on the optimal gray wolf position updated according to the preset maximum number of iterations.

[0024] Preferably, when the design adjustment parameters improve the original Grey Wolf algorithm, the optimization of the optimization objective using the improved Grey Wolf algorithm includes:

[0025] Initialize the location and input parameters of the gray wolf population, calculate the fitness according to the objective function, and determine the optimal gray wolf location;

[0026] The location of gray wolves is updated through the entire hunting process of gray wolves. The search time is controlled by the adjustment parameters, and the updated optimal fitness value and optimal gray wolf location are determined.

[0027] The optimal target joint trajectory is determined based on the optimal gray wolf position updated according to the preset maximum number of iterations.

[0028] And / or,

[0029] The input parameters include the gray wolf population, convergence factor, and coefficient vector;

[0030] The process of updating the gray wolf positions through the entire gray wolf hunting process, and determining the updated optimal fitness value and optimal gray wolf position, includes:

[0031] Calculate the objective function for each individual wolf in the pack and determine the α, β, and γ wolves to update the gray wolf positions;

[0032] Based on the current position of the gray wolf, update the convergence factor and the coefficient vector;

[0033] The fitness of all gray wolves is calculated based on the updated convergence factor and the coefficient vector;

[0034] Based on the fitness of all gray wolves, update the positions and fitness of the α wolf, β wolf, and γ wolf respectively, to determine the updated optimal fitness value and optimal gray wolf position.

[0035] Preferably, the design adjustment parameters include:

[0036] The adjustment parameters are designed based on the preset maximum number of iterations, the total motion time of the robot, and the upper and lower limits of the adjustment parameters;

[0037] The adjustment parameters include:

[0038]

[0039] Where λ is the adjustment parameter, λ max To adjust the upper limit of the parameter, λ min To adjust the lower limit of the parameters, t is the total motion time of the robot, and T is the preset maximum number of iterations.

[0040] Preferably, the improved Grey Wolf algorithm includes:

[0041] K = |C·X p (t)-X(t)|

[0042] X(t+1)=X p (t)-A·K

[0043] Coefficient vector formula:

[0044] A = 2a·r1-a

[0045] C = 2a·r²

[0046] When the original Grey Wolf algorithm is improved based on the elite reverse learning strategy, the convergence factor a is updated to a nonlinear convergence factor a′.

[0047]

[0048] Updated coefficient vector formula:

[0049] A=2a′·r1-a′

[0050] When designing and adjusting parameters to improve the original Grey Wolf algorithm

[0051] Updated coefficient vector formula:

[0052] A=d·r1-d

[0053]

[0054] Other wolves are determined by the positions of the α, β, and γ wolves (X). α X β X γ Perform location update;

[0055] K α =|C1·X α -X|

[0056] K β =|C2·X β -X|

[0057] K γ =|C3·X γ -X|

[0058]

[0059] Where t is the current iteration number, A and C are coefficient vectors, and X... p X(t) represents the location of the prey; X(t) represents the current position vector of the gray wolf, and X(t+1) is the updated position vector of the gray wolf at time t+1. Let r1 and r2 be the convergence factor that linearly decreases from 2 to 0, and t be the current iteration number. max This represents the total number of iterations.

[0060] Preferably, the parameterization of the joint coordinates based on a preset trajectory planning method and preset kinematic constraints to obtain the joint trajectory parameters of the robot includes:

[0061] The joint coordinates are interpolated and fitted based on the polynomial interpolation function and the preset kinematic constraints to obtain the joint trajectory parameters of the robot.

[0062] The joint trajectory parameters include the joint angle, velocity, and acceleration of each joint.

[0063] Preferably, the step of determining the objective function based on the joint trajectory parameters, with time optimization as the objective, includes:

[0064] By sequentially connecting the points corresponding to each joint position according to the joint trajectory parameters, the joint trajectory curve of the robot is obtained;

[0065] The objective function is established based on the joint trajectory curves of the robot.

[0066] The present invention also provides a robot trajectory optimization system, the trajectory optimization system comprising:

[0067] The model building module builds a kinematic model of the robot and obtains the joint coordinates of the robot based on the kinematic model.

[0068] The parameterization module performs parameterization processing on the joint coordinates based on a preset trajectory planning method and preset kinematic constraints to obtain the joint trajectory parameters of the robot.

[0069] The objective function establishment module determines the objective function with time optimization as the optimization objective based on the joint trajectory parameters;

[0070] The improvement module improves the original Grey Wolf algorithm to obtain the improved Grey Wolf algorithm;

[0071] The optimization module optimizes the objective function using the improved Grey Wolf algorithm until a preset termination condition is met, and then outputs the optimized target joint trajectory.

[0072] Preferably, the improvement module improves the original gray wolf algorithm based on an elite reverse learning strategy to obtain an improved gray wolf algorithm;

[0073] or,

[0074] The original Grey Wolf algorithm was improved by adjusting the design parameters, resulting in the improved Grey Wolf algorithm.

[0075] Preferably, the optimization module initializes the gray wolf population based on the elite reverse learning strategy and randomly generates a random population and a dynamic reverse population in space.

[0076] The fitness of the random population and the dynamic reverse population are compared to select multiple gray wolves that meet the preset fitness conditions as the initial population.

[0077] Initialize the convergence factor and coefficient vector, and calculate the fitness values ​​of all wolves according to the objective function to determine the α wolf, β wolf, γ wolf and update the position of the gray wolf;

[0078] Based on the updated gray wolf positions, update the convergence factor and the coefficient vector; calculate the fitness of all gray wolves based on the updated convergence factor and the coefficient vector;

[0079] Based on the fitness of all the gray wolves, update the positions and fitness of the α wolf, β wolf, and γ wolf respectively, so as to determine the updated optimal fitness value and optimal gray wolf position;

[0080] The optimal target joint trajectory is determined based on the optimal gray wolf position updated according to the preset maximum number of iterations.

[0081] Preferably, the optimization module initializes the position and input parameters of the gray wolf population, calculates the fitness according to the objective function, and determines the optimal position of the gray wolves.

[0082] The location of gray wolves is updated through the entire hunting process of gray wolves. The search time is controlled by the adjustment parameters, and the updated optimal fitness value and optimal gray wolf location are determined.

[0083] The optimal target joint trajectory is determined by updating the optimal gray wolf position sequentially based on the preset maximum number of iterations.

[0084] And / or,

[0085] The input parameters include the gray wolf population, convergence factor, and coefficient vector;

[0086] The optimization module calculates the objective function for each individual wolf and determines the α, β, and γ wolves to update the gray wolf positions.

[0087] Based on the current position of the gray wolf, update the convergence factor and the coefficient vector;

[0088] The fitness of all gray wolves is calculated based on the updated convergence factor and the coefficient vector;

[0089] Based on the fitness of all gray wolves, update the positions and fitness of the α wolf, β wolf, and γ wolf respectively, to determine the updated optimal fitness value and optimal gray wolf position.

[0090] Preferably, the design adjustment parameters include:

[0091] The adjustment parameters are designed based on the preset maximum number of iterations, the total motion time of the robot, and the upper and lower limits of the adjustment parameters;

[0092] The adjustment parameters include:

[0093]

[0094] Where λ is the adjustment parameter, λ max To adjust the upper limit of the parameter, λ min To adjust the lower limit of the parameters, t is the total motion time of the robot, and T is the preset maximum number of iterations.

[0095] Preferably, the improved Grey Wolf algorithm includes:

[0096] K = |C·X p (t)-X(t)|

[0097] X(t+1)=X p (t)-A·K

[0098] Coefficient vector formula:

[0099] A = 2a·r1-a

[0100] C = 2a·r²

[0101] When the original Grey Wolf algorithm is improved based on the elite reverse learning strategy, the convergence factor a is updated to a nonlinear convergence factor a′.

[0102]

[0103] Updated coefficient vector formula:

[0104] A=2a′·r1-a′

[0105] When designing and adjusting parameters to improve the original Grey Wolf algorithm

[0106] Updated coefficient vector formula:

[0107] A=d·r1-d

[0108]

[0109] Other wolves are determined by the positions of the α, β, and γ wolves (X). α X β X γ Perform location update;

[0110] Kα =|C1·X α -X|

[0111] K β =|C2·X β -X|

[0112] K γ =|C3·X γ -X|

[0113]

[0114] Where t is the current iteration number, A and C are coefficient vectors, and X... p X(t) represents the location of the prey; X(t) represents the current position vector of the gray wolf, and X(t+1) is the updated position vector of the gray wolf at time t+1. Let r1 and r2 be the convergence factor that linearly decreases from 2 to 0, and t be the current iteration number. max This represents the total number of iterations.

[0115] Preferably, the parameterization module performs interpolation fitting on the joint coordinates based on a polynomial interpolation function and the preset kinematic constraints to obtain the joint trajectory parameters of the robot;

[0116] The joint trajectory parameters include the joint angle, velocity, and acceleration of each joint.

[0117] Preferably, the objective function establishment module connects the points corresponding to each joint position sequentially according to the joint trajectory parameters to obtain the joint trajectory curve of the robot;

[0118] The objective function is established based on the joint trajectory curves of the robot.

[0119] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the robot trajectory optimization method described above.

[0120] The present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the robot trajectory optimization method as described above.

[0121] Based on common knowledge in the field, the above-mentioned preferred conditions can be combined arbitrarily to obtain various preferred embodiments of this application.

[0122] The positive and progressive effects of this invention are as follows: by designing and adjusting the parameters to improve the gray wolf algorithm, the improved gray wolf algorithm is used to optimize the robot's trajectory, and the optimal running time is obtained to complete the trajectory planning motion. This can improve the robot's working efficiency, and the curves of running trajectory, speed, and acceleration are constrained to be smooth and will not produce abrupt changes, thereby extending the robot's service life. Attached Figure Description

[0123] Figure 1 This is a schematic diagram of the first process of the robot trajectory optimization method provided in an embodiment of the present invention.

[0124] Figure 2 This is a schematic diagram of the second process of the robot trajectory optimization method provided in an embodiment of the present invention.

[0125] Figure 3 This is a schematic diagram of the third process of the robot trajectory optimization method provided in an embodiment of the present invention.

[0126] Figure 4 This is a schematic diagram of the fourth process of the robot trajectory optimization method provided in an embodiment of the present invention.

[0127] Figure 5 This is a schematic diagram of the fifth process of the robot trajectory optimization method provided in an embodiment of the present invention.

[0128] Figure 6 This is a schematic diagram of the convergence factor for the robot trajectory optimization method provided in an embodiment of the present invention.

[0129] Figure 7 This is a schematic diagram illustrating the first effect of the robot trajectory optimization method provided in an embodiment of the present invention.

[0130] Figure 8 This is a schematic diagram illustrating the second effect of the robot trajectory optimization method provided in an embodiment of the present invention.

[0131] Figure 9 This is a schematic diagram illustrating the third effect of the robot trajectory optimization method provided in this embodiment of the invention.

[0132] Figure 10 This is a schematic diagram of the robot trajectory optimization system provided in an embodiment of the present invention.

[0133] Figure 11 This is a schematic diagram of the structure of an electronic device for implementing a robot trajectory optimization method according to an embodiment of the present invention. Detailed Implementation

[0134] The present invention will be further illustrated by way of embodiments below, but the present invention is not limited to the scope of the embodiments described herein.

[0135] To more clearly illustrate the technical solutions of the embodiments in this specification, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely some examples or embodiments of this specification. For those skilled in the art, these drawings can be applied to other similar scenarios without creative effort. Unless obvious from the context or otherwise specified, the same reference numerals in the drawings represent the same structures or operations.

[0136] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the document does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0137] It should be understood that the terms “system,” “device,” “unit,” and / or “module” used herein are one way to distinguish different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they may be replaced by other expressions.

[0138] As illustrated herein, unless the context clearly indicates otherwise, the words “a,” “an,” “an,” and / or “the” do not specifically refer to the singular and may also include the plural. Generally speaking, the terms “comprising” and “including” only indicate the inclusion of explicitly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.

[0139] The definitions used herein, such as the terms “having,” “may have,” “comprising,” or “may include,” indicate the presence of the corresponding function, operation, element, etc., and do not limit the presence of one or more other functions, operations, elements, etc. Furthermore, it should be understood that the terms “comprising” or “having” as used herein indicate the presence of the features, figures, steps, operations, elements, components, or combinations thereof described in the specification, without excluding the presence or addition of one or more other features, figures, steps, operations, elements, components, or combinations thereof.

[0140] The definitions of "A or B", "at least one of A and / or B" or "one or more of A and / or B" used herein include any and all combinations of the words listed therewith. For example, "A or B", "at least one of A and B" or "at least one of A or B" means (1) including at least one A, (2) including at least one B, or (3) including at least one A and at least one B.

[0141] The definitions of "first" and "second" in this document, and the descriptions of "first" and "second" appearing in this document, are for illustrative purposes and to distinguish the objects being described. They do not indicate any order or limit on the number of devices, and do not constitute any limitation on this document. For example, a first element may be referred to as a second element without departing from the scope of this disclosure, and similarly, a second element may be referred to as a first element.

[0142] The definition of connection in this document will be understood to mean that when an element (e.g., a first element) is “connected to” or “(operationally or communicatively) coupled to” another element (e.g., a second element), the element may be directly connected or coupled to the other element, and there may be an intermediate element (e.g., a third element) between the element and the other element. Conversely, it will be understood that when an element (e.g., a first element) is “directly connected to” or “directly coupled to” another element (e.g., a second element), there is no intermediate element (e.g., a third element) between the element and the other element.

[0143] Flowcharts are used in this document to illustrate the operations performed by the system according to the embodiments herein. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, the steps can be processed in reverse order or simultaneously. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.

[0144] Existing trajectory optimization algorithms all have some problems. For example, the programming process of genetic algorithms is relatively complex, requiring encoding of the problem and decoding of the optimal solution. Reliability is also a concern, as some parameters need to be selected empirically, and these parameters directly affect the results. The search speed of these algorithms is relatively slow, requiring more training time if high solution accuracy is required. Furthermore, in reinforcement learning, the design of the reward function is complex; a poorly designed function can affect the performance, and the entire process is a black box with poor predictability. Based on these considerations, this embodiment provides a robot trajectory optimization method, such as... Figure 1 As shown, the robot trajectory optimization method in this embodiment includes:

[0145] S101. Establish the kinematic model of the robot and obtain the joint coordinates of the robot based on the kinematic model.

[0146] It should be noted that this embodiment can be applied to robots with n degrees of freedom. This embodiment takes a six-axis collaborative robot as an example for explanation.

[0147] Optionally, establishing the robot's dynamic model may include, based on the DH model, establishing the robot's kinematic equations, which can be obtained by right-multiplying by four motion matrices. The transformation matrix of the six links can be obtained using the following formula:

[0148] T i i-1 =Rot(z) i-1 ,θ i )×Trans(z i-1 ,d i )×Trans(x i ,a i )×Rot(x i ,α i )

[0149]

[0150] Multiplying by six link matrices yields the transformation matrix of the end joint relative to the base coordinates.

[0151] in, This represents the homogeneous transformation matrix from joint i-1 to joint i, where the subscript i indicates the joint or link number, and d... i In the equation θ represents the offset of the i-th link. i α represents the joint angle of joint i connected to the i-th link. i The DH parameter table represents the link deflection angle. Therefore, by multiplying adjacent joints, the homogeneous transformation matrix of the end effector in the base coordinate system can be obtained (multiplying the six link matrices yields the transformation matrix of the end joint relative to the base coordinate system). ):

[0152]

[0153] Expanding the above equation yields the robot's kinematic equations:

[0154]

[0155] Where, p x p y p z Let S1 be the coordinates of the robot's end effector in the base coordinate system, denoted as sinθ1, cosθ1. 234 It is represented as cos(θ2+θ3+θ4). The other parameters in the above formula are represented in the same way as before, and will not be repeated here.

[0156] S102. Based on the preset trajectory planning method and preset kinematic constraints, the joint coordinates are parameterized to obtain the joint trajectory parameters of the robot.

[0157] As an optional implementation of this embodiment, step S102 of this embodiment includes:

[0158] S1021. The joint coordinates are interpolated and fitted based on the polynomial interpolation function and the preset kinematic constraints to obtain the joint trajectory parameters of the robot.

[0159] The joint trajectory parameters include the joint angle, velocity, and acceleration of each joint.

[0160] Optionally, this embodiment uses a fifth-order polynomial interpolation function for parameterization, q i (t)=a i0 +a i1 t+a i2 t 2 +a i3 t 3 +a i4 t 4 +a i5 t 5 Assuming the joint angle positions of all key points in joint space are known, and the velocities and accelerations at the starting and ending points are both zero, the pre-defined kinematic constraints are:

[0161]

[0162] And q i (t) needs to satisfy the following condition:

[0163]

[0164] Based on the above constraints, the coefficients of the polynomial can be solved:

[0165]

[0166] Substituting the coefficients into the robot's joint trajectory yields the planned joint angles, velocities, and accelerations.

[0167]

[0168]

[0169]

[0170] Among them, t f =t i+1 -t i This represents the running time between two nodes, a. inThe coefficients of the fifth-degree polynomial, q i Represents the joint angle at any given time. Represents the velocity at any given moment. It represents the acceleration at any given moment.

[0171] S103. Based on the joint trajectory parameters, determine the time-optimal optimization objective and establish the objective function.

[0172] As an optional implementation of this embodiment, S103, as Figure 2 As shown, it includes:

[0173] S1031. Connect the points corresponding to each joint position in sequence according to the joint trajectory parameters to obtain the joint trajectory curve of the robot.

[0174] S1032. Establish the objective function based on the robot's joint trajectory curves.

[0175] Optionally, the robot will pass through many intermediate points during its work. By transforming these points into a joint space representation, the correspondence between q and t can be obtained. A new variable S is designed. i Indicates t i+1 With t i Interval: S i =t i+1 -t i If i = 1, ..., n, then the total time for the robot to travel from the starting point to the ending point is:

[0176]

[0177] Therefore, the objective function for time-optimal trajectory planning is:

[0178]

[0179] S104. Improve the original Grey Wolf algorithm to obtain the improved Grey Wolf algorithm.

[0180] As an optional implementation of this embodiment, step S104 further includes:

[0181] S104a. The original Gray Wolf algorithm is improved based on the elite reverse learning strategy to obtain the improved Gray Wolf algorithm.

[0182] The original Grey Wolf algorithm initializes the population using random generation. This method produces solutions with poor reference value and may result in higher-quality solutions not being covered, impacting the overall optimization performance. This implementation employs an elite reverse learning strategy to initialize the population. During the solution process, it simultaneously searches for solutions with the opposite dynamics, using the better solution as the initial solution. This initialization ensures the population is in a more ideal position, reducing unnecessary search processes, increasing population diversity, and improving search efficiency.

[0183] As another optional implementation of this embodiment, step S104 further includes:

[0184] S104b: The original Grey Wolf algorithm is improved by adjusting the parameters to obtain the improved Grey Wolf algorithm.

[0185] As an optional implementation of this embodiment, the design adjustment parameters include:

[0186] The adjustment parameters are designed based on the preset maximum number of iterations, the total motion time of the robot, and the upper and lower limits of the adjustment parameters.

[0187] As an optional implementation of this embodiment, in order to further control the search time and improve the search efficiency as much as possible, the gray wolf algorithm is improved by designing and adjusting parameters, specifically:

[0188]

[0189] Where λ is the adjustment parameter, λ max To adjust the upper limit of the parameter, λ min To adjust the lower limit of the parameters, t is the total motion time of the robot, and T is the preset maximum number of iterations.

[0190] In this embodiment, the Grey Wolf algorithm can be improved in a variety of ways, making trajectory planning possible in multiple ways and convenient for users.

[0191] S105. Based on the objective function, the improved Grey Wolf algorithm is used to optimize the objective until the preset termination condition is met, and the optimized target joint trajectory is output.

[0192] As an optional implementation of this embodiment, when the original Grey Wolf algorithm is improved based on an elite reverse learning strategy, such as... Figure 3 As shown, step S105 includes:

[0193] S105a1. Initialize the gray wolf population based on the elite reverse learning strategy, and randomly generate a random population and a dynamic reverse population in space.

[0194] Optionally, N gray wolf positions x are randomly generated in space. ij , where i = 1, 2, ..., N. j = 1, 2, ..., D, N represents the number of gray wolves in the population. D represents the dimension of the population.

[0195] Specifically, the search space of the wolf pack optimization algorithm is an N*D space, where N is the population size and D is the dimension of the optimization object.

[0196] The position of the i-th gray wolf at time t is as follows:

[0197]

[0198] Select the three wolves with the best fitness at the current moment, namely:

[0199]

[0200]

[0201]

[0202] Generate a dynamic reverse population x i ′ j , x′ ij =E·(a ij +b ij )-x ij

[0203] Where E is the reverse elite coefficient, which is a random number within (0,1). ij The sum is b ij For x i The maximum and minimum values ​​in the j-th dimension.

[0204] S105a2. Compare the fitness of the random population and the dynamic reverse population, and select multiple gray wolves that meet the preset fitness conditions as the initial population.

[0205] Optionally, the randomly generated population and the dynamically back-learned population are compared, and N gray wolves with good fitness are selected as the initial population.

[0206] S105a3. Initialize the convergence factor and coefficient vector. Calculate the fitness values ​​of all wolves according to the objective function to determine the α, β, and γ wolves and update the gray wolf positions.

[0207] The fitness value of each individual gray wolf is calculated based on the objective function, and the top three are selected as α wolf, β wolf, and γ wolf.

[0208] S105a4. Based on the updated gray wolf positions, update the convergence factor and coefficient vector. Calculate the fitness of all gray wolves based on the updated convergence factor and coefficient vector.

[0209] Determine if the current iteration number t is less than t max If the value is less than 0, then update the position of each gray wolf according to the following formula.

[0210]

[0211] S105a5. Based on the fitness of all gray wolves, update the positions and fitness of α wolf, β wolf, and γ wolf respectively, so as to determine the updated optimal fitness value and optimal gray wolf position.

[0212] After the gray wolf positions are updated, the coefficient vectors A and C will also change. The objective function will be calculated again to generate new α wolves, β wolves, and γ wolves.

[0213] S105a6. Determine the optimal target joint trajectory based on the optimal gray wolf position updated according to the preset maximum number of iterations.

[0214] If t is reached max If the current solution is not reached, then output the current solution as the optimal solution; otherwise, output the solution that is not reached. max Then return to step S105a1 to continue the calculation until t = t max .

[0215] As another optional implementation of this embodiment, such as Figure 4 As shown, step S105 further includes:

[0216] S105b1. Initialize the location and input parameters of the gray wolf population, calculate the fitness according to the objective function, and determine the optimal gray wolf location.

[0217] S105b2. The location of gray wolves is updated through the entire hunting process of gray wolves. The search time is controlled by adjusting parameters, and the optimal fitness value and optimal gray wolf location are determined after the update.

[0218] As an optional implementation of this embodiment, the input parameters include the gray wolf population, the convergence factor, and the coefficient vector.

[0219] like Figure 5 As shown, step S105b2 of this embodiment includes:

[0220] S105b21. Calculate the objective function for each individual wolf in the pack and determine the α wolf, β wolf, and γ wolf to update the gray wolf positions.

[0221] S105b22. Based on the current position of the gray wolf, update the convergence factor and coefficient vector.

[0222] S105b23. Calculate the fitness of all gray wolves based on the updated convergence factor and the updated coefficient vector.

[0223] S105b24. Based on the fitness of all gray wolves, update the positions and fitness of α wolf, β wolf, and γ wolf respectively, to determine the updated optimal fitness value and optimal gray wolf position.

[0224] S105b3. Determine the optimal target joint trajectory by updating the optimal gray wolf position sequentially according to the preset maximum number of iterations.

[0225] As an optional implementation of this embodiment, the improved Grey Wolf algorithm includes:

[0226] K = |C·X p (t)-X(t)|

[0227] X(t+1)=X p (t)-A·K

[0228] Coefficient vector formula:

[0229] A = 2a·r1-a

[0230] C = 2a·r²

[0231] When the original Grey Wolf algorithm is improved based on the elite reverse learning strategy, the convergence factor 'a' is updated to a nonlinear convergence factor 'a'.

[0232]

[0233] Updated coefficient vector formula:

[0234] A=2a′·r1-a′

[0235] When designing and adjusting parameters to improve the original Grey Wolf algorithm

[0236] Updated coefficient vector formula:

[0237] A=d·r1-d

[0238]

[0239] When |A|≥1, the gray wolf pack will move away from the prey and expand its search area to find better prey. When |A|≥1, the gray wolf pack will approach the prey and prepare to attack it.

[0240] Other wolves are determined by the positions of the α, β, and γ wolves (X). α X β X γ Perform a location update.

[0241] K α =|C1·X α -X|

[0242] K β =|C2·X β -X|

[0243] K γ =|C3·X γ -X|

[0244]

[0245] Where t is the current iteration number, A and C are coefficient vectors, and X... p Let X(t) represent the prey's position vector, K be the distance between the gray wolf and the prey, X(t) represent the gray wolf's position vector at the current time, and X(t+1) be the updated gray wolf's position vector at time t+1. Let r1 and r2 be the convergence factor that linearly decreases from 2 to 0, and t be the current iteration number. max This represents the total number of iterations.

[0246] In the basic model, the convergence factor 'a' converges linearly from 2 to 0. In the Grey Wolf algorithm, the search efficiency depends on the convergence factor. Therefore, the ideal convergence factor should decay slowly at the beginning of the iteration to ensure strong global search capability. The decay rate should increase in the middle of the iteration to allow the algorithm to converge quickly. The decay rate should be slowed down again in the later stages of the iteration to ensure the algorithm's local exploitation capability. Based on this requirement, the search strategy of the algorithm is adjusted, updating the convergence factor 'a' in the basic model to a non-linearly convergent 'a′'. The convergence curve of 'a′' is shown below. Figure 6 As shown, from Figure 6 The curve showing the change in the nonlinear convergence factor reflects the change in the algorithm's iteration rate. Figure 7 It can be seen that the improved Grey Wolf algorithm (based on elite reverse learning) in this embodiment converges significantly faster than the traditional Grey Wolf algorithm, thus proving that the improved elite reverse learning initialization strategy and nonlinear convergence strategy in this embodiment are effective. Figure 8 It can be seen that the improved gray wolf algorithm (based on parameter adjustment) in this embodiment converges significantly faster than the traditional gray wolf algorithm. Figure 9 As can be seen, the robot joints (joint1 is denoted as joint 1, and the others are denoted as before, and will not be repeated) run smoothly without sudden changes in speed after time-optimal trajectory planning, indicating that the robot runs stably and the curve optimized by the fast convergence gray wolf algorithm meets the constraints of trajectory planning.

[0247] This embodiment improves the Grey Wolf algorithm by designing and adjusting parameters. The improved Grey Wolf algorithm is used to optimize the robot's trajectory and obtain the optimal running time to complete the trajectory planning motion. This can improve the robot's working efficiency. Furthermore, the curves of the running trajectory, speed, and acceleration are constrained to be smooth and will not produce abrupt changes, thereby extending the robot's service life.

[0248] Corresponding to the robot trajectory optimization described above, this embodiment also provides a robot trajectory optimization system. These will be described in detail below. Specifically, as... Figure 10 As shown, the robot trajectory optimization system of this embodiment includes:

[0249] Model building module 1 establishes the kinematic model of the robot and obtains the joint coordinates of the robot based on the kinematic model.

[0250] It should be noted that this embodiment can be applied to robots with n degrees of freedom. This embodiment takes a six-axis collaborative robot as an example for explanation.

[0251] Optionally, establishing the robot's dynamic model may include, based on the DH model, establishing the robot's kinematic equations, which can be obtained by right-multiplying by four motion matrices. The transformation matrix of the six links can be obtained using the following formula:

[0252] T i i-1 =Rot(z) i-1 ,θ i )×Trans(z i-1 ,d i )×Trans(x i ,a i )×Rot(x i ,α i )

[0253]

[0254] Multiplying by six link matrices yields the transformation matrix of the end joint relative to the base coordinates.

[0255] in, This represents the homogeneous transformation matrix from joint i-1 to joint i, where the subscript i indicates the joint or link number, and d... i In the equation θ represents the offset of the i-th link. i α represents the joint angle of joint i connected to the i-th link. iThe DH parameter table represents the link deflection angle. Therefore, by multiplying adjacent joints, the homogeneous transformation matrix of the end effector in the base coordinate system can be obtained (multiplying the six link matrices yields the transformation matrix of the end joint relative to the base coordinate system). ):

[0256]

[0257] Expanding the above equation yields the robot's kinematic equations:

[0258]

[0259] Where, p x p y p z Let S1 be the coordinates of the robot's end effector in the base coordinate system, denoted as sinθ1, cosθ1. 234 It is represented as cos(θ2+θ3+θ4). The other parameters in the above formula are represented in the same way as before, and will not be repeated here.

[0260] Parametric module 2 performs parametric processing on joint coordinates based on a preset trajectory planning method and preset kinematic constraints to obtain the robot's joint trajectory parameters.

[0261] As an optional implementation of this embodiment, the parameterization module 2 performs interpolation fitting on the joint coordinates based on the polynomial interpolation function and preset kinematic constraints to obtain the joint trajectory parameters of the robot.

[0262] The joint trajectory parameters include the joint angle, velocity, and acceleration of each joint.

[0263] Optionally, this embodiment uses a fifth-order polynomial interpolation function for parameterization, q i (t)=a i0 +a i1 t+a i2 t 2 +a i3 t 3 +a i4 t 4 +a i5 t 5 Assuming the joint angle positions of all key points in joint space are known, and the velocities and accelerations at the starting and ending points are both zero, the pre-defined kinematic constraints are:

[0264]

[0265] And q i (t) needs to satisfy the following condition:

[0266]

[0267] Based on the above constraints, the coefficients of the polynomial can be solved:

[0268]

[0269] Substituting the coefficients into the robot's joint trajectory yields the planned joint angles, velocities, and accelerations.

[0270]

[0271]

[0272]

[0273] Among them, t f =t i+1 -t i This represents the running time between two nodes, a. in The coefficients of the fifth-degree polynomial, q i Represents the joint angle at any given time. Represents the velocity at any given moment. It represents the acceleration at any given moment.

[0274] Module 3, which establishes the objective function, determines the optimal time as the optimization objective based on the joint trajectory parameters and establishes the objective function.

[0275] As an optional implementation of this embodiment, the objective function establishment module 3 connects the points corresponding to each joint position in sequence according to the joint trajectory parameters to obtain the joint trajectory curve of the robot.

[0276] Based on the robot's joint trajectory curves, establish the objective function.

[0277] Optionally, the robot will pass through many intermediate points during its work. By transforming these points into a joint space representation, the correspondence between q and t can be obtained. A new variable S is designed. i Indicates t i+1 With t i Interval: S i =t i+1 -t i If i = 1, ..., n, then the total time for the robot to travel from the starting point to the ending point is:

[0278]

[0279] Therefore, the objective function for time-optimal trajectory planning is:

[0280]

[0281] Improvement module 4 improves the original Grey Wolf algorithm to obtain the improved Grey Wolf algorithm.

[0282] As an optional implementation of this embodiment, the improved module 4 improves the original gray wolf algorithm based on the elite reverse learning strategy to obtain the improved gray wolf algorithm.

[0283] The original Grey Wolf algorithm initializes the population using random generation. This method produces solutions with poor reference value and may result in higher-quality solutions not being covered, impacting the overall optimization performance. This implementation employs an elite reverse learning strategy to initialize the population. During the solution process, it simultaneously searches for solutions with the opposite dynamics, using the better solution as the initial solution. This initialization ensures the population is in a more ideal position, reducing unnecessary search processes, increasing population diversity, and improving search efficiency.

[0284] As another optional implementation of this embodiment, the improved module 4 designs and adjusts parameters to improve the original gray wolf algorithm, resulting in the improved gray wolf algorithm.

[0285] As an optional implementation of this embodiment, the design adjustment parameters include:

[0286] The adjustment parameters are designed based on the preset maximum number of iterations, the total motion time of the robot, and the upper and lower limits of the adjustment parameters.

[0287] As an optional implementation of this embodiment, in order to further control the search time and improve the search efficiency as much as possible, the gray wolf algorithm is improved by designing and adjusting parameters, specifically:

[0288]

[0289] Where λ is the adjustment parameter, λ max To adjust the upper limit of the parameter, λ min To adjust the lower limit of the parameters, t is the total motion time of the robot, and T is the preset maximum number of iterations.

[0290] In this embodiment, the Grey Wolf algorithm can be improved in a variety of ways, making trajectory planning possible in multiple ways and convenient for users.

[0291] Optimization module 5 optimizes the target objective using the improved Grey Wolf algorithm based on the objective function until a preset termination condition is met, and outputs the optimized target joint trajectory.

[0292] As an optional implementation of this embodiment, the optimization module 5 initializes the gray wolf population based on the elite reverse learning strategy and randomly generates a random population and a dynamic reverse population in space.

[0293] The fitness of the random population and the dynamic reverse population are compared, and multiple gray wolves that meet the preset fitness conditions are selected as the initial population.

[0294] Optionally, N gray wolf positions x are randomly generated in space. ij , where i = 1, 2, ..., N. j = 1, 2, ..., D, N represents the number of gray wolves in the population. D represents the dimension of the population.

[0295] Specifically, the search space of the wolf pack optimization algorithm is an N*D space, where N is the population size and D is the dimension of the optimization object.

[0296] The position of the i-th gray wolf at time t is as follows:

[0297]

[0298] Select the three wolves with the best fitness at the current moment, namely:

[0299]

[0300]

[0301]

[0302] Generate a dynamic reverse population x i ′ j , x′ ij =E·(a ij +b ij )-x ij

[0303] Where E is the reverse elite coefficient, which is a random number within (0,1). ij The sum is b ij For x i The maximum and minimum values ​​in the j-th dimension.

[0304] Initialize the convergence factor and coefficient vector, calculate the fitness values ​​of all wolves according to the objective function, determine the α wolf, β wolf, γ wolf and update the position of the gray wolf.

[0305] The fitness value of each individual gray wolf is calculated based on the objective function, and the top three are selected as α wolf, β wolf, and γ wolf.

[0306] Optionally, the randomly generated population and the dynamically back-learned population are compared, and N gray wolves with good fitness are selected as the initial population.

[0307] Based on the updated gray wolf positions, update the convergence factor and coefficient vector. Calculate the fitness of all gray wolves based on the updated convergence factor and coefficient vector.

[0308] Determine if the current iteration number t is less than t max If the value is less than 0, then update the position of each gray wolf according to the following formula.

[0309]

[0310] Based on the fitness of all gray wolves, update the positions and fitness of α wolf, β wolf, and γ wolf respectively, to determine the updated optimal fitness value and optimal gray wolf position.

[0311] After the gray wolf positions are updated, the coefficient vectors A and C will also change. The objective function will be calculated again to generate new α wolves, β wolves, and γ wolves.

[0312] The optimal target joint trajectory is determined based on the optimal gray wolf position updated according to the preset maximum number of iterations.

[0313] If t is reached max If the current solution is not reached, then output the current solution as the optimal solution; otherwise, output the solution that is not reached. max If the result is not found, return to the corresponding step and continue the calculation until t = t. max .

[0314] As another optional implementation of this embodiment, the optimization module 5 initializes the position and input parameters of the gray wolf population, calculates the fitness according to the objective function, and determines the optimal position of the gray wolves.

[0315] The location of gray wolves is updated by analyzing the entire hunting process of gray wolves. The search time is controlled by adjusting parameters, and the optimal fitness value and optimal gray wolf location are determined after the update.

[0316] As an optional implementation of this embodiment, the input parameters include the gray wolf population, the convergence factor, and the coefficient vector.

[0317] Optimization module 5 calculates the objective function for each individual wolf in the pack and determines the α, β, and γ wolves to update the gray wolf positions.

[0318] Based on the current position of the gray wolf, update the convergence factor and coefficient vector.

[0319] The fitness of all gray wolves is calculated based on the updated convergence factor and coefficient vector.

[0320] Based on the fitness of all gray wolves, update the positions and fitness of α wolf, β wolf, and γ wolf respectively, to determine the updated optimal fitness value and optimal gray wolf position.

[0321] The optimal target joint trajectory is determined by updating the optimal gray wolf position sequentially based on the preset maximum number of iterations.

[0322] As an optional implementation of this embodiment, the improved Grey Wolf algorithm includes:

[0323] K = |C·X p (t)-X(t)|

[0324] X(t+1)=X p (t)-A·K

[0325] Coefficient vector formula:

[0326] A = 2a·r1-a

[0327] C = 2a·r²

[0328] When the original Grey Wolf algorithm is improved based on the elite reverse learning strategy, the convergence factor 'a' is updated to a nonlinear convergence factor 'a'.

[0329]

[0330] Updated coefficient vector formula:

[0331] A=2a′·r1-a′

[0332] When designing and adjusting parameters to improve the original Grey Wolf algorithm

[0333] Updated coefficient vector formula:

[0334] A=d·r1-d

[0335]

[0336] When |A|≥1, the gray wolf pack will move away from the prey and expand its search area to find better prey. When |A|≥1, the gray wolf pack will approach the prey and prepare to attack it.

[0337] Other wolves are determined by the positions of the α, β, and γ wolves (X). α X β X γ Perform a location update.

[0338] K α =|C1·X α -X|

[0339] K β =|C2·X β -X|

[0340] K γ =|C3·X γ -X|

[0341]

[0342] Where t is the current iteration number, A and C are coefficient vectors, and X... p Let X(t) represent the prey's position vector, K be the distance between the gray wolf and the prey, X(t) represent the gray wolf's position vector at the current time, and X(t+1) be the updated gray wolf's position vector at time t+1. Let r1 and r2 be the convergence factor that linearly decreases from 2 to 0, and t be the current iteration number. max This represents the total number of iterations.

[0343] This embodiment improves the Grey Wolf algorithm by designing and adjusting parameters. The improved Grey Wolf algorithm is used to optimize the robot's trajectory and obtain the optimal running time to complete the trajectory planning motion. This can improve the robot's working efficiency. Furthermore, the curves of the running trajectory, speed, and acceleration are constrained to be smooth and will not produce abrupt changes, thereby extending the robot's service life.

[0344] It should also be noted that the robot trajectory optimization system in this embodiment can be, for example, a separate chip, chip module, or electronic device, or a chip or chip module integrated within an electronic device. Regarding the modules / units included in the various devices and products described in the above embodiments, they can be software modules / units, hardware modules / units, or a combination of both. For example, for various devices and products applied to or integrated into a chip, all included modules / units can be implemented using hardware methods such as circuits, or at least some modules / units can be implemented using software programs running on a processor integrated within the chip, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits. For devices and products applied to or integrated into chip modules, each module / unit can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components of the chip module. Alternatively, at least some modules / units can be implemented using software programs that run on a processor integrated within the chip module, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits. Similarly, for devices and products applied to or integrated into terminals, each module / unit can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components within the terminal. Alternatively, at least some modules / units can be implemented using software programs that run on a processor integrated within the terminal, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits.

[0345] Figure 11 This is a schematic diagram of the structure of an electronic device provided in this embodiment. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the method described in the above embodiment. Figure 11 The electronic device 30 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.

[0346] like Figure 11 As shown, the electronic device 30 can be manifested as a general-purpose computing device, such as a server device. The components of the electronic device 30 may include, but are not limited to: at least one processor 31, at least one memory 32, and a bus 33 connecting different system components (including memory 32 and processor 31).

[0347] Bus 33 includes a data bus, an address bus, and a control bus.

[0348] The memory 32 may include volatile memory, such as random access memory (RAM) 321 and / or cache memory 322, and may further include read-only memory (ROM) 323.

[0349] The memory 32 may also include a program / utility 325 having a set (at least one) of program modules 324, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0350] The processor 31 executes various functional applications and data processing, such as the method described above, by running computer programs stored in the memory 32.

[0351] Electronic device 30 can also communicate with one or more external devices 34 (e.g., keyboard, pointing device, etc.). This communication can be performed via input / output (I / O) interface 35. Furthermore, the model-generating device 30 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 36. Figure 11 As shown, network adapter 36 communicates with other modules of the model-generated device 30 via bus 33. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the model-generated device 30, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems.

[0352] It should be noted that although several units / modules or sub-units / modules of the electronic device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.

[0353] This embodiment also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the method as described in the above embodiments.

[0354] The readable storage medium may be more specifically, including but not limited to: portable disk, hard disk, random access memory, read-only memory, erasable programmable read-only memory, optical storage device, magnetic storage device, or any suitable combination thereof.

[0355] In a possible implementation, the present invention can also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the method described above.

[0356] The program code for executing the present invention can be written in any combination of one or more programming languages. The program code can be executed entirely on the user device, partially on the user device, as a standalone software package, partially on the user device and partially on a remote device, or entirely on a remote device.

[0357] While specific embodiments of the present invention have been described above, those skilled in the art should understand that these are merely illustrative examples, and the scope of protection of the present invention is defined by the appended claims. Those skilled in the art can make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but all such changes and modifications fall within the scope of protection of the present invention.

Claims

1. A robot trajectory optimization method, characterized in that, The trajectory optimization method includes: Establish a kinematic model of the robot, and obtain the joint coordinates of the robot based on the kinematic model; The joint coordinates are parameterized based on a preset trajectory planning method and preset kinematic constraints to obtain the joint trajectory parameters of the robot. Based on the joint trajectory parameters, an objective function is established with time optimization as the objective. The original Grey Wolf algorithm was improved to obtain the improved Grey Wolf algorithm; Based on the objective function, the improved Grey Wolf algorithm is used to optimize the objective until a preset termination condition is met, and the optimized target joint trajectory is output. The improvement of the original Grey Wolf algorithm to obtain the improved Grey Wolf algorithm includes: The original Grey Wolf algorithm is improved based on the elite reverse learning strategy to obtain the improved Grey Wolf algorithm; or, The original Grey Wolf algorithm was improved by adjusting the design parameters to obtain the improved Grey Wolf algorithm. The design adjustment parameters include: The adjustment parameters are designed based on the preset maximum number of iterations, the total motion time of the robot, and the upper and lower limits of the adjustment parameters; The adjustment parameters include: in, To adjust the parameters, To adjust the upper limit of the parameters, To adjust the lower limit of the parameters, The total time of the robot's movement. This is the preset maximum number of iterations.

2. The robot trajectory optimization method as described in claim 1, characterized in that, When the original Grey Wolf algorithm is improved based on an elite reverse learning strategy, the optimization of the optimization objective using the improved Grey Wolf algorithm includes: The gray wolf population is initialized based on the elite reverse learning strategy, and a random population and a dynamic reverse population are randomly generated in space. The fitness of the random population and the dynamic reverse population are compared to select multiple gray wolves that meet the preset fitness conditions as the initial population. Initialize the convergence factor and coefficient vector, and calculate the fitness value of all wolves according to the objective function to determine... Wolf, Wolf, The wolf then updates the location of the gray wolf; Based on the updated gray wolf positions, update the convergence factor and the coefficient vector; calculate the fitness of all gray wolves based on the updated convergence factor and the coefficient vector; Update the fitness of all the gray wolves based on their fitness. Wolf, as described Wolf, as described The positions and fitness of wolves are assigned to determine the updated optimal fitness value and optimal gray wolf position; The optimal target joint trajectory is determined based on the optimal gray wolf position updated according to the preset maximum number of iterations.

3. The robot trajectory optimization method as described in claim 1, characterized in that, When the design adjustment parameters improve the original Grey Wolf algorithm, the optimization of the optimization objective using the improved Grey Wolf algorithm includes: Initialize the location and input parameters of the gray wolf population, calculate the fitness according to the objective function, and determine the optimal gray wolf location; The location of gray wolves is updated by analyzing the entire hunting process of gray wolves, the search time is controlled by adjusting parameters, and the optimal fitness value and optimal gray wolf location are determined after the update. The optimal target joint trajectory is determined based on the optimal gray wolf position updated according to the preset maximum number of iterations. And / or, The input parameters include the gray wolf population, convergence factor, and coefficient vector; The process of updating the gray wolf positions through the entire gray wolf hunting process, and determining the updated optimal fitness value and optimal gray wolf position, includes: Calculate and determine the objective function for each individual wolf in the pack. Wolf, Wolf, Wolves, to update the gray wolf's position; Based on the current position of the gray wolf, update the convergence factor and the coefficient vector; The fitness of all gray wolves is calculated based on the updated convergence factor and the coefficient vector; Update the fitness of all the gray wolves based on their fitness. Wolf, as described Wolf, as described The positions and fitness of wolves are assigned to determine the updated optimal fitness value and optimal gray wolf position.

4. The robot trajectory optimization method as described in claim 1, characterized in that, The improved Grey Wolf algorithm includes: Coefficient vector formula: When the original Grey Wolf algorithm is improved based on an elite reverse learning strategy, the convergence factor is... Updated to nonlinear convergence factor , Updated coefficient vector formula: When designing and adjusting parameters to improve the original Grey Wolf algorithm Updated coefficient vector formula: Other wolves according to Wolf, Wolf, Wolf position , , Perform location update; in, This represents the current iteration number. and It is a coefficient vector. Indicates the location of the prey; This represents the position vector of the gray wolf at the current moment. for The time is the updated position vector of the gray wolf. Let be the convergence factor that decreases linearly from 2 to 0. and It is a random vector in [0, 1]. This represents the current iteration number. This represents the total number of iterations.

5. The robot trajectory optimization method as described in claim 1, characterized in that, The parameterization of the joint coordinates based on a preset trajectory planning method and preset kinematic constraints to obtain the joint trajectory parameters of the robot includes: The joint coordinates are interpolated and fitted based on the polynomial interpolation function and the preset kinematic constraints to obtain the joint trajectory parameters of the robot. The joint trajectory parameters include the joint angle, velocity, and acceleration of each joint. And / or, The step of determining the objective function based on the joint trajectory parameters, with time optimization as the objective, and establishing the objective function includes: By sequentially connecting the points corresponding to each joint position according to the joint trajectory parameters, the joint trajectory curve of the robot is obtained; The objective function is established based on the joint trajectory curves of the robot.

6. A robot trajectory optimization system, characterized in that, The trajectory optimization system includes: The model building module builds a kinematic model of the robot and obtains the joint coordinates of the robot based on the kinematic model. The parameterization module performs parameterization processing on the joint coordinates based on a preset trajectory planning method and preset kinematic constraints to obtain the joint trajectory parameters of the robot. The objective function establishment module determines the objective function with time optimization as the optimization objective based on the joint trajectory parameters; The improvement module improves the original Grey Wolf algorithm to obtain the improved Grey Wolf algorithm; The optimization module optimizes the target objective based on the objective function using the improved Grey Wolf algorithm until a preset termination condition is met, and outputs the optimized target joint trajectory. The improved module improves the original Gray Wolf algorithm based on the elite reverse learning strategy to obtain the improved Gray Wolf algorithm. Alternatively, the original Grey Wolf algorithm can be improved by designing and adjusting the parameters to obtain the improved Grey Wolf algorithm; The design adjustment parameters include: The adjustment parameters are designed based on the preset maximum number of iterations, the total motion time of the robot, and the upper and lower limits of the adjustment parameters; The adjustment parameters include: in, To adjust the parameters, To adjust the upper limit of the parameters, To adjust the lower limit of the parameters, The total time of the robot's movement. This is the preset maximum number of iterations.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes a computer program, it implements the robot trajectory optimization method as described in any one of claims 1-5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the robot trajectory optimization method as described in any one of claims 1-5.