A method for generating motion paths for a robotic arm
By constructing a sixth-order polynomial equation and a genetic algorithm model, and combining adaptive adjustment of crossover and mutation rates, the motion path generation method of the robotic arm is optimized, solving the problems of cumbersome collision avoidance optimization and poor compatibility, and achieving efficient multi-objective collaborative optimization.
Patent Information
- Application Number
- CN202510081470.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2045-01-20
AI Technical Summary
Existing methods for generating motion paths for robotic arms are too cumbersome in the collision avoidance optimization process and have poor compatibility with other optimization objectives, resulting in insufficient optimization of the generated paths.
A sixth-order polynomial equation is constructed to represent the time-varying joint angles of the robotic arm. The polynomial coefficient sequence is obtained through iterative genetic algorithm model. The fitness function is constructed by adaptively adjusting the crossover rate and mutation rate to optimize collision avoidance and compatibility with other targets.
It improves the efficiency of collision avoidance optimization and the compatibility of multi-objective optimization, reduces computational complexity, and protects high-performing individuals through an adaptive adjustment mechanism to avoid local optima and generate better motion paths.
Smart Images

Figure CN119567274B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for generating motion paths for a robotic arm, belonging to the field of robotic arm control technology. Background Technology
[0002] In modern production and service scenarios, robotic arms undertake a variety of complex tasks.
[0003] The process of generating motion paths for robotic arms is quite complex and cumbersome, especially since collision detection is involved. This can lead to excessive computational load and conflicts with other optimization objectives, resulting in a final motion path that only has good collision avoidance performance but is far from the optimal goal in terms of path quality and optimization level.
[0004] Therefore, existing methods for generating motion paths for robotic arms need to address the complexity and cumbersome nature of collision avoidance optimization, as well as its poor compatibility with other optimization objectives. Summary of the Invention
[0005] The purpose of this application is to overcome the shortcomings of the prior art and provide a motion path generation method for a robotic arm with strong anti-collision optimization capabilities and high-efficiency multi-objective collaborative optimization.
[0006] To achieve the above objectives, this application employs the following technical solution:
[0007] Firstly, a method for generating the motion path of a robotic arm, comprising:
[0008] Construct a sixth-order polynomial equation for the change of the joint angle of the robotic arm over time;
[0009] Establish forward and inverse kinematic models of the robotic arm and obstacles, and construct a fitness function based on the collision simulation results of the robotic arm in the forward and inverse kinematic models;
[0010] A genetic algorithm model is constructed using a sequence of polynomial coefficients as individuals. The sequence of polynomial coefficients in the individual with the highest fitness is obtained through iteration of the genetic algorithm model. Each iteration includes: adaptively adjusting the crossover rate according to the relationship between the average fitness of the crossover individuals and the average fitness of the population, and using the adjusted crossover rate as the crossover rate for the next iteration; and adaptively adjusting the mutation rate according to the relationship between the average fitness of the mutated individuals and the average fitness of the population, and using the adjusted mutation rate as the mutation rate for the next iteration.
[0011] The sixth-degree polynomial equation is solved using the sequence of polynomial coefficients from the individual with the highest fitness to obtain the motion path of the robotic arm.
[0012] In some embodiments of the first aspect, obtaining the polynomial coefficient sequence of the individual with the highest fitness through iteration of the genetic algorithm model includes, in response to the number of iterations reaching a set maximum number of iterations, obtaining the polynomial sequence of the individual with the highest fitness in the last iteration population.
[0013] Each iteration also includes,
[0014] The fitness of each individual is calculated based on the fitness function.
[0015] The probability of each individual's choice is calculated using the following formula:
[0016] ,
[0017] In the formula, For the first The probability of an individual's choice This represents the traversal sequence number of the individual. For the first The fitness of an individual Population size;
[0018] A second population is generated based on the selection probability of each individual.
[0019] Based on the crossover rate, neighboring individuals are selected in the second population and their genes are sorted according to a set rule; crossover positions are set so that the selected neighboring individuals can perform gene crossover at the crossover positions.
[0020] Based on the mutation rate, individuals in the second population are selected for gene mutation using the following formula:
[0021] ,
[0022] In the formula, The gene before the mutation. The mutated gene, The mean, For variance, mean and variance Gaussian noise;
[0023] The second population, which has undergone gene crossover and gene mutation, will be used as the population for the next iteration.
[0024] In some embodiments of the first aspect, the sixth-degree polynomial equation is solved using a sequence of polynomial coefficients from the individual with the highest fitness to obtain the motion path of the robotic arm, including,
[0025] The sixth-order polynomial equations are filled in based on the polynomial coefficient sequence from the individual with the highest fitness. After filling, the sixth-order polynomial equations for each robotic arm joint are as follows:
[0026] ,
[0027] In the formula, For time, This refers to the serial number of the robotic arm joint. For the first The joint angles of a robotic arm changing over time. , , , , , and The first polynomial in the polynomial coefficient sequence Polynomial coefficients of each robotic arm joint;
[0028] Set boundary constraints:
[0029] ,
[0030] In the formula, The initial time, For the end time, and For angle constraints, and For angular velocity constraints, and For angular acceleration constraints, and They are respectively The first and second derivatives,
[0031] The joint angles of each robotic arm joint as a function of time are obtained by solving the boundary constraints and the sixth-order polynomial equations of each robotic arm joint after filling. The motion path of the robotic arm is obtained by combining the joint angles of all robotic arm joints as a function of time.
[0032] In some embodiments of the first aspect, the crossover rate is varied according to the following formula:
[0033] ,
[0034] In the formula, The adjusted crossover rate, Set an upper limit for the cross rate. Set a lower limit for the cross rate. The average fitness of the crossover individuals, The maximum fitness for all individuals in this iteration. The average fitness of all individuals in this iteration. The set adjustment coefficient.
[0035] In some embodiments of the first aspect, the variation rate is changed according to the following formula:
[0036] ,
[0037] In the formula, The adjusted variability, Set an upper limit for the mutation rate. To set a lower limit for the mutation rate, The average fitness of the variant individuals. The maximum fitness for all individuals in this iteration. The average fitness of all individuals in this iteration. The set adjustment coefficient.
[0038] In some embodiments of the first aspect, the fitness function in the fitness function constructed based on the collision simulation results of the robotic arm in the forward and inverse kinematics model is as follows:
[0039] ,
[0040] In the formula, For fitness, The penalty weight is the penalty parameter for trajectory smoothness. As the trajectory path length weight, For smoothness penalty parameters, For path penalty parameters, The parameters affecting the collision results of the robotic arm; in the aforementioned forward and inverse kinematics model, the parameters affecting the collision results of the robotic arm are as follows: Set it to 0; otherwise, the collision results of the robotic arm will affect the parameters. Take 1.
[0041] In some embodiments of the first aspect, constructing the fitness function based on the collision simulation results of the robotic arm in the forward and inverse kinematics model includes,
[0042] Each segment of the robotic arm is designated as a cylindrical envelope, and the obstacle is designated as a spherical envelope.
[0043] The sum of the radii of the cylindrical envelope and the spherical envelope is obtained;
[0044] Obtain the shortest distance from the axis of the cylindrical envelope to the center of the spherical envelope;
[0045] Extract the endpoints of the axis of the cylindrical envelope;
[0046] In response to the shortest distance being greater than the radius, the collision result of the robotic arm affects the parameters. Take 1;
[0047] In response to the shortest distance being less than or equal to the distance from the center of the spherical envelope to one endpoint of the axis of the cylindrical envelope, and the distance from the center of the spherical envelope to either endpoint of the axis of the cylindrical envelope being greater than the radius, the collision result influence parameters of the robotic arm are determined. Take 1;
[0048] In response to the shortest distance being less than or equal to the distance from the center of the spherical envelope to one endpoint of the axis of the cylindrical envelope, and the distance from the center of the spherical envelope to either endpoint of the axis of the cylindrical envelope being less than or equal to the sum of the radii, the collision result influencing parameters of the robotic arm are determined. Set to 0;
[0049] In response to the shortest distance being less than or equal to the distance from the center of the spherical envelope to one endpoint of the axis of the cylindrical envelope, and only the distance from one endpoint of the axis of the cylindrical envelope to the center of the spherical envelope being greater than the radius, the collision result influence parameters of the robotic arm are determined. Take 0.
[0050] Secondly, this application also provides a computer device, including a processor and a memory connected to the processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, it performs the steps of the motion path generation method for a robotic arm as described in any embodiment of the first aspect.
[0051] Thirdly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the motion path generation method for the robotic arm described in any embodiment of the first aspect.
[0052] Fourthly, this application also provides a computer program product, including a computer program / instructions, characterized in that, when the computer program / instructions are executed by a processor, they implement the steps of the motion path generation method for the robotic arm described in any embodiment of the first aspect.
[0053] Compared with the prior art, the beneficial effects achieved by this application are as follows:
[0054] This application generates motion paths based on a genetic algorithm model and a sixth-order polynomial equation representing the time-varying joint angles of a robotic arm. The genetic algorithm model iteratively obtains the polynomial coefficient sequence of the sixth-order polynomial equation, leveraging the advantages of genetic algorithms in distributed parallel optimization to reduce the complexity of collision avoidance optimization. Simultaneously, collision detection optimization is integrated into the overall optimization as a fitness function, promoting compatibility between collision avoidance optimization and other optimization objectives. Furthermore, this application employs an adaptive adjustment mechanism based on comparing the average fitness of an individual with the average fitness of the population to regulate the crossover and mutation rates. This helps expand the multi-objective search range in the early stages of iteration when excellent individuals are lacking, protects excellent individuals in the genetic algorithm model in later stages of iteration, and avoids local optima. Attached Figure Description
[0055] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0056] Figure 1 This is a flowchart of the motion path generation method for the robotic arm provided in this embodiment;
[0057] Figure 2 This is a schematic block diagram of the computer device provided in this embodiment;
[0058] Figure 3 Based on Figure 1 Flowchart of the improvement plan steps;
[0059] Figure 4 It is a comparison curve of the variation rate and crossover rate of traditional GA and improved GA with the number of iterations under the same experimental conditions;
[0060] Figure 5 Is with Figure 4 Corresponding fitness comparison chart of traditional GA and improved GA;
[0061] Figure 6 This is a schematic diagram illustrating the envelope determination during a collision simulation of a robotic arm.
[0062] Figure 7 This is a diagram showing the path generation effect when the obstacle is at position A relative to the robotic arm;
[0063] Figure 8 This is a diagram showing the path generation effect when the obstacle is at position B relative to the robotic arm.
[0064] Figure 9This is a diagram showing the path generation effect when the obstacle is at position C relative to the robotic arm.
[0065] Figure 10 Based on Figure 1 Flowchart of the steps in the improvement plan. Detailed Implementation
[0066] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments and specific features in the embodiments are detailed descriptions of the technical solution of the present application, rather than limitations thereof. In the absence of conflict, the embodiments and technical features in the embodiments can be combined with each other.
[0067] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0068] Example 1:
[0069] Figure 1 This is a flowchart illustrating a motion path generation method for a robotic arm according to Embodiment 1 of the present invention. This flowchart merely shows the logical sequence of the method described in this embodiment. Provided there are no conflicts, different methods may be used in other possible embodiments of the present invention. Figure 1 Complete the steps shown or described in the order indicated.
[0070] The motion path generation method for the robotic arm provided in this embodiment can be applied to a terminal or server. See also Figure 1 The method implemented in this way specifically includes the following steps:
[0071] Construct a sixth-order polynomial equation for the change of the joint angle of the robotic arm over time;
[0072] Establish forward and inverse kinematic models of the robotic arm and obstacles, and construct a fitness function based on the collision simulation results of the robotic arm in the forward and inverse kinematic models;
[0073] A genetic algorithm model is constructed using a sequence of polynomial coefficients as individuals. The sequence of polynomial coefficients in the individual with the highest fitness is obtained through iteration of the genetic algorithm model. Each iteration includes: adaptively adjusting the crossover rate based on the relationship between the average fitness of the crossover individuals and the average fitness of the population, and using the adjusted crossover rate as the crossover rate for the next iteration; and adaptively adjusting the mutation rate based on the relationship between the average fitness of the mutated individuals and the average fitness of the population, and using the adjusted mutation rate as the mutation rate for the next iteration.
[0074] The motion path of the robotic arm is obtained by solving the sequence of polynomial coefficients from the individual with the highest fitness in the sixth-order polynomial equation.
[0075] Genetic algorithm models offer several advantages for mathematical optimization. This embodiment generates motion paths based on constructing a genetic algorithm model and a sixth-order polynomial equation representing the time-varying joint angles of the robotic arm. The genetic algorithm model iteratively obtains the polynomial coefficient sequence of the sixth-order polynomial equation, leveraging its strength in distributed parallel optimization to reduce the complexity of collision avoidance optimization. Simultaneously, collision detection optimization is integrated into the overall optimization as a fitness function, promoting compatibility between collision avoidance optimization and other optimization objectives. This embodiment also employs an adaptive adjustment mechanism based on comparing the average fitness of individuals with the average fitness of the population to regulate crossover and mutation rates. This helps expand the multi-objective search range in the early stages of iteration when excellent individuals are lacking, protects excellent individuals in the genetic algorithm model in later stages of iteration, and avoids local optima.
[0076] Example 2:
[0077] This embodiment provides a method for generating the motion path of a robotic arm, which can be referred to as follows. Figure 3 This embodiment is an optimization based on Embodiment 1 to improve the technical effect and refine the technical solution. For the contents not described in detail in this embodiment, please refer to Embodiment 1.
[0078] As one embodiment, the fitness function in the fitness function is constructed based on the collision simulation results of the robotic arm in the forward and inverse kinematics model as follows:
[0079] ,
[0080] In the formula, For fitness, The penalty weight is the penalty parameter for trajectory smoothness. As the trajectory path length weight, For smoothness penalty parameters, For path penalty parameters, The parameters affecting the robot arm's collision results; in the forward and inverse kinematics models, the parameters affecting the robot arm's collision results when it collides with an obstacle. Set it to 0; otherwise, the collision results of the robotic arm will affect the parameters. Take 1.
[0081] This fitness function helps to simultaneously optimize the three objectives of collision avoidance, trajectory smoothing, and trajectory path length. Those skilled in the art can add or replace the trajectory smoothness penalty parameter and trajectory path length weight with other optimization objectives as needed to achieve synergistic optimization between collision avoidance and other objectives.
[0082] As one embodiment, reference Figure 6 A fitness function is constructed based on the collision simulation results of the robotic arm in the forward and inverse kinematics models, including:
[0083] Each segment of the robotic arm is set as a cylindrical envelope, and obstacles are set as spherical envelopes;
[0084] Obtain the envelope radius of the cylindrical envelope and the radius of the spherical envelope radius and ;
[0085] Obtain the axis of the cylindrical envelope from the center of the spherical envelope. shortest distance ;
[0086] Extracting the axis of the cylindrical envelope endpoints and ;
[0087] Response to shortest distance Greater than the radius and There is no possibility of collision; the impact of collision on the robotic arm parameters is negligible. Take 1;
[0088] Response to shortest distance Less than or equal to the center of the spherical envelope to the axis of the cylindrical envelope The distance at one of the endpoints, and the center of the spherical envelope to the axis of the cylindrical envelope The distance between any endpoints is greater than the radius and The robotic arm and the obstacle's envelope do not overlap in space, and the collision result of the robotic arm affects the parameters. Take 1;
[0089] Response to shortest distance Less than or equal to the center of the spherical envelope to the axis of the cylindrical envelope The distance at one of the endpoints, and the center of the spherical envelope to the axis of the cylindrical envelope The distance between any endpoints is less than or equal to the radius. The relative positions of the robotic arm and the obstacle partially overlap, and the collision result of the robotic arm affects the parameters. Set to 0;
[0090] Response to shortest distance Less than or equal to the center of the spherical envelope to the axis of the cylindrical envelope The distance at one of the endpoints, and only the axis of the cylindrical envelope. One end point is connected to the center of the spherical envelope. The distance is greater than the radius and The relative positions of the robotic arm and the obstacle partially overlap, and the collision result of the robotic arm affects the parameters. Take 0.
[0091] The aim is to simplify the complex collision detection problem into the positional relationships of geometric shapes.
[0092] Those skilled in the art will readily recognize that the collision results of the robotic arm affect parameters. The value can be 0 or 1, and the impact parameter is determined by the collision result of each individual robotic arm. This directly determines the fitness value of each individual, and thus, in the genetic algorithm model, individuals that directly cause collisions between the robotic arm and obstacles will be eliminated during the iteration process.
[0093] As one embodiment, the crossover rate is changed according to the following formula:
[0094] ,
[0095] In the formula, The adjusted crossover rate, Set an upper limit for the cross rate. Set a lower limit for the cross rate. The average fitness of the crossover individuals, The maximum fitness for all individuals in this iteration. The average fitness of all individuals in this iteration. The set adjustment coefficient.
[0096] The mutation rate changes according to the following formula:
[0097] ,
[0098] In the formula, The adjusted variability, Set an upper limit for the mutation rate. To set a lower limit for the mutation rate, The average fitness of the variant individuals. The maximum fitness for all individuals in this iteration. The average fitness of all individuals in this iteration. The degree of adaptive adjustment is changed by adjusting the magnitude of the set adjustment coefficient. (Reference) Figure 4 , Figure 4In this example, "Improved GA" represents the genetic algorithm model, and "Traditional GA" represents the traditional genetic algorithm model. It's easy to see that the crossover and mutation rates of the genetic algorithm model in this example are higher in the early stages of iteration and gradually decrease with increasing iteration count; the search range is increased in the early stages of iteration, and the crossover and mutation rates are reduced in the later stages to protect superior individuals. (References...) Figure 4 corresponding Figure 5 Those skilled in the art will readily recognize that, under the adaptive mutation and crossover mechanism, the average fitness of individuals in the genetic algorithm model of this embodiment increases rapidly, surpassing that of traditional genetic algorithm models much earlier. Comparative experimental configuration: Population size For 200 individuals, the total number of robotic arm joints There are 6, the maximum number of iterations maxGen is 30, and the polynomial coefficients corresponding to each robotic arm joint are 7. Therefore, the number of gene segments in a single individual is 42. Let... 90% 60%, 30% 15% It is 0.5.
[0099] Fitness is the criterion for evaluating the quality of an individual. The two formulas mentioned above aim to reduce the crossover / mutation rate when the fitness of a crossover or mutated individual is significantly greater than the average fitness level of the population within the current iteration, in order to protect superior individuals; and to increase the crossover / mutation rate when the fitness of a crossover or mutated individual is significantly comparable to the average fitness level of the population within the current iteration, in order to expand the search range and find superior individuals.
[0100] The motion path generation method for the robotic arm provided in this embodiment offers a specific adaptive mechanism design compared to Embodiment 1, and also introduces a more stringent principle for determining the values of parameters affecting the robotic arm collision results.
[0101] Example 3:
[0102] This embodiment provides a method for generating motion paths for a robotic arm. This embodiment is a supplement to Embodiment 2. For details not described in this embodiment, please refer to Embodiment 2.
[0103] In one embodiment, when constructing a genetic algorithm model using polynomial coefficient sequences as individuals, the initial population should be generated based on the size of the polynomial coefficient sequence of the previously constructed sixth-degree polynomial equation. For example, in a robotic arm composed of six joints, each robotic arm's sixth-degree polynomial equation requires seven polynomial coefficients. In one embodiment, the initial population is generated with 42 gene fragments for each individual. Alternatively, the genetic algorithm model provided in any embodiment can be used to obtain only a portion of the polynomial coefficients in the sixth-degree polynomial equation.
[0104] As one embodiment, the sequence of polynomial coefficients in the individual with the highest fitness is obtained through the iteration of the genetic algorithm model, including, in response to the number of iterations reaching the set maximum number of iterations maxGen, the algorithm is terminated, and the polynomial sequence in the individual with the highest fitness in the last iteration population is added to the sixth-degree polynomial equation.
[0105] Each iteration process also includes,
[0106] The fitness of each individual in the current iteration population is calculated based on the fitness function provided in Example 1 or 2.
[0107] The probability of each individual's choice is calculated using the following formula:
[0108] ,
[0109] In the formula, For the first The probability of an individual's choice This represents the traversal sequence number of the individual. For the first The fitness of an individual For population size; it is not difficult for those skilled in the art to see that individuals with higher fitness have a higher probability of being selected;
[0110] A second population is generated based on the selection probability of each individual. Compared with the original population, the second population has a higher probability of generating individuals with higher fitness.
[0111] Based on the crossover rate, neighboring individuals are selected in the second population, and their genes are sorted according to a predetermined pattern. Crossover points are set so that the selected neighboring individuals can perform gene crossover at these points. For example, the gene sequence of a neighboring individual (i.e., the parent individual) and They are respectively: , , The total number of genes. That is, each polynomial coefficient of each robotic arm joint is a gene segment. If a robotic arm contains 6 joints, then the total number of genes is 42. The first gene segment of the first parent individual. To and The first gene segment of the corresponding second parent individual, and so on; in the... Gene crossover is performed at each locus, and the gene sequence of the offspring individuals after crossover is... and They are respectively: , , For the first generation of individuals The gene segment, the first After the first gene segment (excluding the first one) (Number) gene segments originate from the second parent individual. For the second generation of individuals The gene segment, the first After the first gene segment (excluding the first one) (each) gene segment originates from the first parent individual;
[0112] Based on the mutation rate, individuals are selected from the second population and subjected to gene mutation using the following formula. In this embodiment, Gaussian mutation is used:
[0113] ,
[0114] In the formula, The gene before the mutation. The mutated gene, The mean, For variance, mean and variance Gaussian noise; Gaussian mutation can effectively prevent genetic algorithms from converging to local optima too early and increase population diversity;
[0115] The second population, which has undergone gene crossover and gene mutation, will be used as the population for the next iteration.
[0116] As one embodiment, the sixth-degree polynomial equation is solved using the sequence of polynomial coefficients from the individual with the highest fitness to obtain the motion path of the robotic arm, including,
[0117] Fill in the sixth-order polynomial equations based on the polynomial coefficient sequence of the individual with the highest fitness. After filling, the sixth-order polynomial equation for each robotic arm joint is:
[0118] ,
[0119] In the formula, For time, This refers to the serial number of the robotic arm joint. For the first The joint angles of a robotic arm changing over time. , , , , , and The first polynomial in the polynomial coefficient sequence Polynomial coefficients of each robotic arm joint;
[0120] Set boundary constraints:
[0121] ,
[0122] In the formula, The initial time, For the end time, and For angle constraints, and For angular velocity constraints, and For angular acceleration constraints, and They are respectively The first and second derivatives,
[0123] Based on the boundary constraints and the sixth-order polynomial equations of each robotic arm joint after filling, the joint angles of each robotic arm joint as a function of time are obtained. By combining the joint angles of all robotic arm joints as a function of time, the motion path of the robotic arm is obtained, which can meet the time and speed requirements.
[0124] As one embodiment, a sixth-order polynomial should also be designed based on the starting point and target point pose of the robotic arm end effector.
[0125] As one embodiment, the boundary constraints at the starting point and the target point are transformed as follows:
[0126] (a) Angle constraints: ;
[0127] (b) Velocity constraints: ;
[0128] (c) Acceleration constraints: ;
[0129] As one embodiment, the path penalty parameter mentioned in Embodiment 2 Smoothness penalty parameter They can be obtained respectively using the following formulas:
[0130] ,
[0131] ,
[0132] In the formula, and The first Time points of each robotic arm joint and time point The joint angle, This represents the total number of joints in the robotic arm. For time point number, The total number of time points. and They are time points respectively and time point The position vector of the robotic arm's end effector. This is an operation for calculating the Euclidean distance between vectors. As one embodiment, the output motion path of the robotic arm is presented as a time point and changes in the joint angles of the robotic arm; it is a discontinuous path, which can be interpolated and fitted by those skilled in the art.
[0133] Smoothness penalty parameter The fitness function penalty is determined by calculating the sum of the absolute values of joint angle changes along the trajectory, reflecting the continuity and stability of each joint during movement. Path penalty parameters. The fitness function penalty is determined by calculating the total distance the end effector travels along the entire trajectory, which encourages the generation of shorter trajectories, improves motion efficiency, and reduces energy consumption.
[0134] As one embodiment, the standard Denavit-Hartenberg (DH) modeling method is used for kinematic analysis to establish forward and inverse kinematic models. The standard DH modeling method is applicable to both forward and inverse kinematics, supports path planning and optimization, and supports machine learning and data analysis.
[0135] As one embodiment, the sixth-degree polynomial equation is solved using the polynomial coefficient sequence from the individual with the highest fitness to obtain the motion path of the robotic arm, including solving the polynomial coefficient sequence from the individual with the highest fitness { Substituting into the sixth-degree polynomial, within the time interval [ Within the framework, based on forward and inverse kinematics solutions, the joint trajectories are transformed into the position and orientation trajector trajectories of the end effector, thereby obtaining the optimal motion trajectory of the robotic arm.
[0136] refer to Figure 7 , Figure 8 and Figure 9 The images show the paths (in blue) generated by the robotic arm (red) according to the motion path generation method provided in this embodiment when the obstacle (dark green sphere) is in three different positions (A, B, and C). It can be seen that the motion path generation method of the robotic arm provided in this embodiment has a good path generation effect.
[0137] The motion path generation method for the robotic arm provided in this embodiment can also be followed... Figure 10 Execute as shown. Figure 10 In this context, `newPop` is a container used to store the individual with the highest fitness in each iteration, and `x` is the set number of individuals with the highest fitness included in `newPop`.
[0138] The motion path generation method for the robotic arm provided in this embodiment simplifies the positional relationship between the robotic arm and obstacles through geometric envelope method, avoiding collisions and improving motion safety; it uses sixth-order polynomial interpolation to generate smooth trajectories, combined with multi-objective collaborative iterative computation to improve motion stability and reduce energy consumption; and an adaptive adjustment mechanism dynamically adjusts the crossover rate and mutation probability to quickly select the optimal fitness value, improving work efficiency. This method can flexibly adjust the trajectory according to different scenarios and task requirements, enhancing system adaptability and stability, and has good application prospects.
[0139] Example 4:
[0140] This embodiment provides a computer device, including a processor and a memory connected to the processor. The memory stores a computer program. When the computer program is executed by the processor, it performs the steps of the motion path generation method for a robotic arm as provided in any one of embodiments one to three.
[0141] The computer device may be a server or an electronic terminal, as one embodiment, see reference. Figure 2 The computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The database stores data acquired and generated in the motion path generation method of the robotic arm. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements the motion path generation method of the robotic arm provided in any one of embodiments one to three.
[0142] Those skilled in the art will understand that Figure 2 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0143] The computer device provided in this embodiment has the same technical effects as any one of embodiments one to three, and will not be described again here.
[0144] Example 5:
[0145] This embodiment provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the motion path generation method for the robotic arm provided in any one of embodiments one to three.
[0146] The computer-readable storage medium provided in this embodiment has the same technical effects as any one of embodiments one to three, and will not be described again here.
[0147] Example 6:
[0148] This embodiment provides a computer program product storing a computer program that, when executed by a processor, implements the steps of the motion path generation method for the robotic arm provided in any one of embodiments one to three. The computer program product provided in this embodiment can be transmitted, distributed, and downloaded via the Internet in the form of signals.
[0149] The computer program product provided in this embodiment has the same technical effects as any one of the three embodiments, and will not be described again here.
[0150] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0151] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0152] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0153] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0154] Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more.
[0155] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for generating motion paths for a robotic arm, characterized in that, include, Construct a sixth-order polynomial equation for the change of the joint angle of the robotic arm over time; Establish forward and inverse kinematic models of the robotic arm and obstacles, and construct a fitness function based on the collision simulation results of the robotic arm in the forward and inverse kinematic models; A genetic algorithm model is constructed using a sequence of polynomial coefficients as individuals. The sequence of polynomial coefficients in the individual with the highest fitness is obtained through iteration of the genetic algorithm model. Each iteration includes: adaptively adjusting the crossover rate according to the relationship between the average fitness of the crossover individuals and the average fitness of the population, and using the adjusted crossover rate as the crossover rate for the next iteration; and adaptively adjusting the mutation rate according to the relationship between the average fitness of the mutated individuals and the average fitness of the population, and using the adjusted mutation rate as the mutation rate for the next iteration. The sixth-degree polynomial equation is solved using the sequence of polynomial coefficients from the individual with the highest fitness to obtain the motion path of the robotic arm. The fitness function constructed based on the collision simulation results of the robotic arm in the forward and inverse kinematics model is as follows: , In the formula, For fitness, The penalty weight is the penalty parameter for trajectory smoothness. As the trajectory path length weight, For smoothness penalty parameters, For path penalty parameters, The parameters affecting the collision results of the robotic arm; in the aforementioned forward and inverse kinematics model, the parameters affecting the collision results of the robotic arm are as follows: Set it to 0; otherwise, the collision results of the robotic arm will affect the parameters. Take 1; The step of constructing a fitness function based on the collision simulation results of the robotic arm in the forward and inverse kinematics model includes, Each segment of the robotic arm is designated as a cylindrical envelope, and the obstacle is designated as a spherical envelope. Obtain the sum of the radii of the cylindrical envelope and the spherical envelope; Obtain the shortest distance from the axis of the cylindrical envelope to the center of the spherical envelope; Extract the endpoints of the axis of the cylindrical envelope; In response to the shortest distance being greater than the radius, the collision result of the robotic arm affects the parameters. Take 1; In response to the shortest distance being less than or equal to the distance from the center of the spherical envelope to one endpoint of the axis of the cylindrical envelope, and the distance from the center of the spherical envelope to either endpoint of the axis of the cylindrical envelope being greater than the radius, the collision result influence parameters of the robotic arm are determined. Take 1; In response to the shortest distance being less than or equal to the distance from the center of the spherical envelope to one endpoint of the axis of the cylindrical envelope, and the distance from the center of the spherical envelope to either endpoint of the axis of the cylindrical envelope being less than or equal to the sum of the radii, the collision result influencing parameters of the robotic arm are determined. Set to 0; In response to the shortest distance being less than or equal to the distance from the center of the spherical envelope to one endpoint of the axis of the cylindrical envelope, and only the distance from one endpoint of the axis of the cylindrical envelope to the center of the spherical envelope being greater than the radius, the collision result influence parameters of the robotic arm are determined. Take 0.
2. The motion path generation method for the robotic arm according to claim 1, characterized in that, The step of obtaining the polynomial coefficient sequence of the individual with the highest fitness through the iteration of the genetic algorithm model includes, in response to the number of iterations reaching the set maximum number of iterations, obtaining the polynomial sequence of the individual with the highest fitness in the last iteration population. Each iteration also includes, The fitness of each individual is calculated based on the fitness function. The probability of each individual's choice is calculated using the following formula: , In the formula, For the first The probability of an individual's choice This represents the traversal sequence number of the individual. For the first The fitness of an individual Population size; A second population is generated based on the selection probability of each individual. Based on the crossover rate, neighboring individuals are selected in the second population and their genes are sorted according to a set rule; crossover positions are set so that the selected neighboring individuals can perform gene crossover at the crossover positions. Based on the mutation rate, individuals in the second population are selected for gene mutation using the following formula: , In the formula, The gene before the mutation. The mutated gene, The mean, For variance, mean and variance Gaussian noise; The second population, which has undergone gene crossover and gene mutation, will be used as the population for the next iteration.
3. The motion path generation method for the robotic arm according to claim 1 or 2, characterized in that, The sixth-degree polynomial equation is solved using the polynomial coefficient sequence from the individual with the highest fitness to obtain the motion path of the robotic arm, including: The sixth-order polynomial equations are filled in based on the polynomial coefficient sequence from the individual with the highest fitness. After filling, the sixth-order polynomial equations for each robotic arm joint are: , In the formula, For time, This refers to the serial number of the robotic arm joint. For the first The joint angles of a robotic arm changing over time. , , , , , and The first polynomial in the polynomial coefficient sequence Polynomial coefficients of each robotic arm joint; Set boundary constraints: , In the formula, The initial time, For the end time, and For angle constraints, and For angular velocity constraints, and For angular acceleration constraints, and They are respectively The first and second derivatives, The joint angles of each robotic arm joint as a function of time are obtained by solving the boundary constraints and the sixth-order polynomial equations of each robotic arm joint after filling. The motion path of the robotic arm is obtained by combining the joint angles of all robotic arm joints as a function of time.
4. The motion path generation method for the robotic arm according to claim 1 or 2, characterized in that, The crossover rate is changed according to the following formula: , In the formula, The adjusted crossover rate, Set an upper limit for the cross rate. Set a lower limit for the cross rate. The average fitness of the crossover individuals, The maximum fitness for all individuals in this iteration. The average fitness of all individuals in this iteration. The set adjustment coefficient.
5. The motion path generation method for the robotic arm according to claim 1 or 2, characterized in that, The mutation rate is changed according to the following formula: , In the formula, The adjusted variability, Set an upper limit for the mutation rate. To set a lower limit for the mutation rate, The average fitness of the variant individuals. The maximum fitness for all individuals in this iteration. The average fitness of all individuals in this iteration. The set adjustment coefficient.
6. A computer device, characterized in that, It includes a processor and a memory connected to the processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, it performs the steps of the motion path generation method for the robotic arm as described in any one of claims 1 to 5.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the motion path generation method for the robotic arm according to any one of claims 1 to 5.
8. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the motion path generation method for the robotic arm according to any one of claims 1 to 5.
Citation Information
Patent Citations
Mechanical arm path planning method based on simulated annealing genetic algorithm
CN108858198A
Mechanical arm track planning method and system based on self-adaptive genetic algorithm
CN110125927A
