A robot dynamic obstacle avoidance trajectory optimization method and system based on an improved DMP
By introducing force coupling terms and multi-objective optimization into the DMP model, and combining it with an improved sparrow search algorithm, the problems of local adjustment and global optimization of the robot's dynamic obstacle avoidance trajectory are solved, realizing safe and smooth obstacle avoidance trajectory generation that can adapt to complex obstacle scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- UNIV OF SHANGHAI FOR SCI & TECH
- Filing Date
- 2026-04-23
- Publication Date
- 2026-07-07
AI Technical Summary
Existing robot dynamic motion primitive methods lack local adjustment capabilities when facing dynamic obstacles, cannot generate safe and smooth obstacle avoidance trajectories in real time, and have low computational efficiency and limited ability to handle complex obstacles.
By introducing a force coupling term into the DMP model, the steering force and potential force are integrated. Combined with multi-objective optimization criteria and an improved sparrow search algorithm, the optimal obstacle avoidance trajectory is generated, and the parameters are optimized to achieve local adjustment and global optimization of the trajectory.
It improves the robot's obstacle avoidance adaptability and operational safety in complex dynamic environments, maintains the consistency and smoothness of trajectory characteristics, reduces computational overhead, and adapts to multi-obstacle scenarios.
Smart Images

Figure CN122071117B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of robot control and intelligent manufacturing technology, and more specifically, to a method and system for optimizing dynamic obstacle avoidance trajectory of a robot based on an improved DMP. Background Technology
[0002] In modern industrial production, robots are increasingly used for tasks such as assembly, handling, and sorting. To improve the efficiency and accuracy of robot operation, the "Learning from Demonstration (LFD)" method is widely adopted. LFD allows robots to quickly master new skills by imitating human demonstrations, thereby reducing the workload of repetitive programming and manual debugging. However, traditional LFD methods suffer from insufficient adaptability in dynamic environments, especially in industrial settings where moving obstacles frequently appear. Existing LFD methods cannot generate safe and smooth obstacle avoidance trajectories in real time.
[0003] Dynamic Movement Primitives (DMPs) is a typical method for modeling learned demonstration trajectories. DMPs generate robot trajectories through a second-order dynamic system and mandatory terms, offering advantages such as fast convergence, controllable parameters, and adaptability to changes in start and end points, thus finding widespread application in high-precision industrial tasks. However, the classic DMP method lacks local adjustment capabilities when encountering dynamic obstacles, failing to achieve real-time obstacle avoidance and smooth trajectory adjustment while maintaining the characteristics of the demonstration trajectory.
[0004] To enhance the dynamic adaptability of dynamic motion primitives, existing research has proposed several improvement methods:
[0005] One approach is the coupling term method based on artificial potential fields, which calculates obstacle avoidance forces through artificial potential fields to enable robots to stay away from obstacles. However, the generated trajectory lacks smoothness and is prone to sharp turns or jitter.
[0006] The second method is a coupling strategy based on the steering angle. By calculating the angle between the trajectory velocity direction and the obstacle direction, the trajectory can be adjusted to avoid obstacles. However, it has poor scalability for obstacles with complex volume, and the response may be too early or too slow.
[0007] Thirdly, the coupling term method based on virtual interactive force achieves precise trajectory adjustment through virtual impedance or force feedback, which is highly flexible but has high implementation complexity and computational load.
[0008] In summary, existing methods still have shortcomings in terms of trajectory feature preservation, dynamic obstacle avoidance capability, trajectory quality, and computational efficiency, which limit the autonomous operation capability of industrial robots in complex environments. Summary of the Invention
[0009] To overcome the shortcomings of existing technologies, this invention provides a robot dynamic obstacle avoidance trajectory optimization method and system based on an improved DMP, aiming to solve problems such as insufficient obstacle avoidance adaptability, insufficient trajectory smoothness, limited ability to handle complex obstacles, low computational efficiency, and insufficient preservation of trajectory features in existing technologies.
[0010] To achieve the aforementioned objectives of the invention, the technical solution adopted to solve its technical problems is as follows:
[0011] This invention discloses a method for optimizing a robot's dynamic obstacle avoidance trajectory based on an improved Dynamic Obstacle Management Platform (DMP), comprising the following steps:
[0012] Step S1, Trajectory Modeling: Obtain the robot's teaching trajectory, establish a trajectory dynamics model based on dynamic motion primitives, and learn and store the weights of the forced terms used to characterize the trajectory geometry.
[0013] Step S2, construct an improved DMP model with force coupling terms: construct a force coupling term that integrates steering force and potential force, and introduce it into the dynamic equation of the dynamic motion primitive to obtain an improved DMP model with force coupling terms;
[0014] Step S3, Multi-objective optimization criterion definition: Construct a comprehensive fitness function, which integrates the average curvature index, the Fraser distance index, and the safety distance index, and is used to evaluate trajectory smoothness, teaching trajectory feature preservation, and obstacle avoidance safety, respectively;
[0015] Step S4, Global Parameter Optimization: The improved sparrow search algorithm is used to globally optimize the parameters to be optimized in the improved DMP model to generate the optimal obstacle avoidance trajectory.
[0016] Furthermore, in step S1, the dynamic equation of the dynamic motion element is expressed as:
[0017] ,
[0018] ,
[0019] Where y is the current position. Let y be the first derivative of position y with respect to time, and z be the velocity state. Let z be the first derivative of the velocity state with respect to time, and g be the target position. It is a time constant. , The damping coefficient is... This is a mandatory item;
[0020] To describe the time evolution of the motion process, a phase variable s is introduced, which satisfies the following gauge system equations:
[0021] ,
[0022] in, Let s be the first derivative of the phase variable s with respect to time. To standardize the system attenuation coefficient.
[0023] Furthermore, the mandatory item Represented as a weighted combination of Gaussian functions:
[0024] ,
[0025] ,
[0026] Where N is the number of Gaussian functions, w i Let be the weight coefficients of the i-th Gaussian function. The center of the i-th Gaussian function, Let be the width parameter of the i-th Gaussian function;
[0027] According to the teaching trajectory ,speed and acceleration The target coercion term is obtained by reverse calculation and used for subsequent weight learning:
[0028] ,
[0029] in, is the time constant, and g is the target position.
[0030] Furthermore, in step S2, a force coupling term is introduced into the dynamic motion primitive. :
[0031] ,
[0032] Force coupling term fusion steering force With potential force :
[0033] ,
[0034] Where m is the number of obstacles. Assign weights to each obstacle. This is the scaling factor for the safety distance. Take 1, For steering force, For potential field force;
[0035] Steering force The expression for driving a robot to avoid obstacles in a direction perpendicular to its current velocity is:
[0036] ,
[0037] in, This is the steering force gain coefficient. The angle between the current velocity direction and the obstacle direction. , Let be a rotation matrix. This is the current velocity vector;
[0038] Potential force The expression for the repulsive potential field used to simulate the area around an obstacle is:
[0039] ,
[0040] in, d is the potential field gain coefficient, a positive constant, used to adjust the strength of the repulsive potential field. The real-time distance between the robot and the obstacle. To set a safe distance threshold, The robot's current position vector.
[0041] Furthermore, in step S3, the average curvature index, the Fraser distance index, and the safety distance index are defined and summed with weights:
[0042] ,
[0043] Where F is the comprehensive fitness function, and the smaller the value, the higher the quality of the generalization trajectory; w1, w2, and w3 are S traj S sim S safe The weights are used to adjust the importance of the three; f nor S is the normalization function; traj S represents the mean curvature. sim S is the Frescher distance; safe For a safe distance; the normalization function f nor The range normalization method is used to map each index to the interval [0, 1] to eliminate the influence of dimensions; for any index S, its normalized value f nor (S) is calculated as (SS) min ) / (S max -S min ), where S min and S max These are the minimum and maximum values of the indicator during the current optimization process, respectively.
[0044] Using mean curvature The expression for trajectory smoothness is:
[0045] ,
[0046] Where n is the number of trajectory sampling points, Let be the curvature at the j-th sampling point;
[0047] For a two-dimensional trajectory, the curvature is expressed as:
[0048] ,
[0049] in, and Let x and y be the first derivatives of the trajectory's x and y coordinates with respect to time at the j-th sampling point, respectively. and These are the second derivatives of the abscissa and ordinate of the trajectory at the j-th sampling point with respect to time, respectively.
[0050] Mean curvature S traj The smaller the value, the smoother the trajectory;
[0051] Fraser distance The expression for measuring the similarity between the generalized trajectory and the taught trajectory is:
[0052] ,
[0053] in, ( ) represents the Fréchet distance function. For teaching trajectory, For generalized trajectory; Fraser distance The smaller the value, the better the generated trajectory retains the original motion characteristics of the taught trajectory;
[0054] safe distance The expression for measuring the safety level between a trajectory and obstacles is:
[0055] ,
[0056] in, The minimum distance between the trajectory and the obstacle. To preset a safe distance threshold, This is the penalty coefficient;
[0057] When the distance between the trajectory and the obstacle is less than the safe distance, a penalty is introduced to improve the obstacle avoidance safety of the trajectory.
[0058] Furthermore, in step S4, the position update rule for individual explorers in the improved sparrow search algorithm is as follows:
[0059] ,
[0060] in, Let i be the position of the i-th sparrow in the j-th dimension of the t-th generation. For dynamic weights, This represents the sparrow's ranking number within the group of discoverers, where α is a random number within the range (0,1). The maximum number of iterations, This is a random warning value. As a safety threshold, For random numbers that follow a standard normal distribution, It is a matrix whose elements are all 1s;
[0061] To improve the algorithm's global search capability in the early stages and its local optimization capability in the later stages, a dynamic weight mechanism is further introduced, the expression of which is:
[0062] ,
[0063] in, and These are the maximum and minimum values of the dynamic weights, respectively, and t is the current iteration number;
[0064] In each iteration, the fitness value of each individual in the population is calculated according to the comprehensive fitness function, and the positions of explorers, followers, and guards are updated in sequence until the stopping criterion is met.
[0065] The stopping criterion is any of the following conditions:
[0066] (1) The current iteration number has reached the maximum iteration number. ;
[0067] (2) The overall fitness function F is less than the preset threshold. ;
[0068] (3) The change in optimal fitness over several consecutive generations is less than the preset threshold ε;
[0069] By optimizing the parameters using an improved sparrow search algorithm, the optimal parameter combination suitable for dynamic obstacle environments is obtained, thereby generating an obstacle avoidance trajectory that combines safety, smoothness, and trajectory feature preservation.
[0070] This invention also discloses a robot dynamic obstacle avoidance trajectory optimization system based on an improved DMP, comprising:
[0071] The trajectory modeling module is used to acquire the robot's teaching trajectory, establish a trajectory dynamics model based on dynamic motion primitives, and learn and store the weights of the forced terms used to characterize the trajectory geometry.
[0072] The force coupling term construction module is used to construct a force coupling term that integrates steering force and potential force. The steering force is used to drive the robot to avoid obstacles in a direction perpendicular to the velocity direction, and the potential force is used to simulate the repulsive potential field around the obstacle.
[0073] An improved DMP model construction module is used to introduce the force coupling terms into the dynamic equations of the dynamic motion primitives to construct an improved DMP model;
[0074] A multi-objective optimization criterion definition module is used to construct a comprehensive fitness function, which integrates the average curvature index, the Friesian distance index, and the safety distance index.
[0075] The parameter global optimization module is used to globally optimize the parameters to be optimized in the improved DMP model using an improved sparrow search algorithm to generate the optimal obstacle avoidance trajectory. The improved sparrow search algorithm uses a circular chaotic mapping to initialize the initial population to improve the population distribution uniformity and global search capability, and uses a dynamic weight mechanism to adjust the iteration process to improve the local optimization capability and convergence accuracy in the later stages of the algorithm.
[0076] The present invention further discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described method for optimizing robot dynamic obstacle avoidance trajectory based on an improved DMP.
[0077] By employing the above technical solutions, this invention has the following advantages and positive effects compared with the prior art:
[0078] 1. To address the insufficient obstacle avoidance adaptability in existing technologies, this invention introduces a force coupling term into the DMP model and integrates steering force and potential field force. This enables the robot to adjust its local trajectory in real time based on the obstacle's position and motion state when approaching an obstacle, effectively avoiding collisions. Compared to traditional methods that require relearning the entire trajectory, this invention achieves dynamic obstacle avoidance while preserving trajectory execution continuity, significantly improving the adaptability and operational safety of industrial robots in complex dynamic environments.
[0079] 2. To address the issue of insufficient trajectory feature preservation in existing technologies, this invention introduces Fréchet distance as a trajectory similarity evaluation index, constraining the overall shape similarity between the generated trajectory and the taught trajectory during trajectory optimization. Therefore, while completing obstacle avoidance tasks, the robot can retain as many of the main motion features of the original taught trajectory as possible, avoiding excessive trajectory deviation, thereby improving consistency and operational accuracy during task execution.
[0080] 3. To address the issue of insufficient trajectory smoothness in existing technologies, this invention employs average curvature as the evaluation and optimization criterion for trajectory smoothness, quantifying and constraining the degree of trajectory curvature. This approach effectively suppresses sharp turns, local oscillations, and discontinuities that occur during obstacle avoidance, ensuring that the trajectory maintains good smoothness and naturalness even after dynamic adjustments. This, in turn, improves the robot's stability, control accuracy, and operational quality during task execution.
[0081] 4. To address the low computational efficiency of existing technologies, this invention employs an improved Sparrow Search Algorithm (SSA) to globally optimize the parameters of the DMP model. Combined with circular chaotic mapping and a dynamic weighting mechanism, this improves the quality of the initial population distribution, the algorithm's global search capability, and the accuracy of subsequent local optimization. Therefore, this invention can shorten parameter optimization time and reduce computational overhead while ensuring trajectory optimization effectiveness, making it more suitable for the rapid decision-making and real-time task execution needs of industrial robots in dynamic environments.
[0082] 5. To address the limited ability of existing technologies to handle complex obstacles, this invention introduces a multi-obstacle weighting mechanism to comprehensively model and weight the influence of multiple obstacles. This allows the robot to simultaneously consider the positional relationships, influence levels, and cumulative effects of multiple obstacles during trajectory generation and adjustment. Compared to traditional methods that only apply to single or regular obstacles, this invention offers better adaptability and versatility for complex volume obstacles, multiple obstacles, and dynamically changing obstacle scenarios. Attached Figure Description
[0083] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0084] Figure 1 This is a flowchart of a robot dynamic obstacle avoidance trajectory optimization method based on an improved DMP according to the present invention;
[0085] Figure 2 This is a schematic diagram of a dynamic obstacle scene in an industrial robot experimental platform according to the present invention. Detailed Implementation
[0086] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0087] Example 1
[0088] like Figure 1 As shown, this invention discloses a robot dynamic obstacle avoidance trajectory optimization method based on an improved DMP (Dynamic Motion Model). By introducing a force coupling term into the classical dynamic motion primitives and combining a multi-obstacle weighting mechanism, an average curvature optimization criterion, a Friesian distance optimization criterion, and an improved sparrow search algorithm, the method achieves real-time local adjustment and global optimization of the robot trajectory. This enables the robot to complete the task trajectory safely, smoothly, and while preserving the taught characteristics as much as possible in a dynamic obstacle environment. The specific steps include:
[0089] Step S1, Trajectory Modeling: Obtain the robot's teaching trajectory, establish a trajectory dynamics model based on dynamic motion primitives, and learn and store the weights of the forced terms used to characterize the trajectory geometry.
[0090] Specifically, in step S1, the dynamic equation of the dynamic motion element is expressed as:
[0091] ,
[0092] ,
[0093] Where y is the current position. Let y be the first derivative of position y with respect to time, and z be the velocity state. Let z be the first derivative of the velocity state with respect to time, and g be the target position. It is a time constant. , The damping coefficient is... This is a mandatory item;
[0094] To describe the time evolution of the motion process, a phase variable s is introduced, which satisfies the following gauge system equations:
[0095] ,
[0096] in, Let s be the first derivative of the phase variable s with respect to time. To standardize the system attenuation coefficient.
[0097] Furthermore, the mandatory item Represented as a weighted combination of Gaussian functions:
[0098] ,
[0099] ,
[0100] Where N is the number of Gaussian functions, w i Let be the weight coefficients of the i-th Gaussian function. The center of the i-th Gaussian function, Let be the width parameter of the i-th Gaussian function;
[0101] According to the teaching trajectory ,speed and acceleration The target coercion term is obtained by reverse calculation and used for subsequent weight learning:
[0102] .
[0103] in, is the time constant, and g is the target position.
[0104] Step S2, construct an improved DMP model with force coupling terms: construct a force coupling term that integrates steering force and potential force, and introduce it into the dynamic equation of the dynamic motion primitive to obtain an improved DMP model with force coupling terms.
[0105] Specifically, in step S2, a force coupling term is introduced into the dynamic motion primitive. :
[0106] ,
[0107] Force coupling term fusion steering force With potential force :
[0108] ,
[0109] Where m is the number of obstacles. Assign weights to each obstacle. This is the scaling factor for the safety distance. Take 1, For steering force, For potential field force;
[0110] Steering force The expression for driving a robot to avoid obstacles in a direction perpendicular to its current velocity is:
[0111] ,
[0112] in, This is the steering force gain coefficient. The angle between the current velocity direction and the obstacle direction. , Let be a rotation matrix. This is the current velocity vector;
[0113] Potential force The expression for simulating the repulsive potential field around an obstacle to induce a robot to avoid it when approaching the obstacle is as follows:
[0114] ,
[0115] in, d is the potential field gain coefficient, a positive constant, used to adjust the strength of the repulsive potential field. The real-time distance between the robot and the obstacle. To set a safe distance threshold, This is the robot's current position vector.
[0116] Specifically, in step S3, the average curvature index, the Fraser distance index, and the safety distance index are defined and summed with weights:
[0117] ,
[0118] Where F is the comprehensive fitness function, and the smaller the value, the higher the quality of the generalization trajectory; w1, w2, and w3 are S traj S sim S safe The weights are used to adjust the importance of the three; f nor S is the normalization function; traj S represents the mean curvature. sim S is the Frescher distance; safe For a safe distance; the normalization function f nor The range normalization method is used to map each index to the interval [0, 1] to eliminate the influence of dimensions; for any index S, its normalized value f nor (S) is calculated as (SS) min ) / (S max -S min ), where S min and S max These are the minimum and maximum values of the indicator during the current optimization process, respectively.
[0119] Using mean curvature The expression for trajectory smoothness is:
[0120] ,
[0121] Where n is the number of trajectory sampling points, Let be the curvature at the j-th sampling point;
[0122] For a two-dimensional trajectory, the curvature is expressed as:
[0123] ,
[0124] in, and Let x and y be the first derivatives of the trajectory's x and y coordinates with respect to time at the j-th sampling point, respectively. and These are the second derivatives of the abscissa and ordinate of the trajectory at the j-th sampling point with respect to time, respectively.
[0125] Mean curvature S traj The smaller the value, the smoother the trajectory;
[0126] Fraser distance The expression for measuring the similarity between the generalized trajectory and the taught trajectory is:
[0127] ,
[0128] in, ( ) represents the Fréchet distance function. For teaching trajectory, For generalized trajectory; Fraser distance The smaller the value, the better the generated trajectory retains the original motion characteristics of the taught trajectory;
[0129] safe distance The expression for measuring the safety level between a trajectory and obstacles is:
[0130] ,
[0131] in, The minimum distance between the trajectory and the obstacle. To preset a safe distance threshold, This is the penalty coefficient;
[0132] When the distance between the trajectory and the obstacle is less than the safe distance, a penalty is introduced to improve the obstacle avoidance safety of the trajectory.
[0133] Step S4, Global Parameter Optimization: The improved sparrow search algorithm is used to globally optimize the parameters to be optimized in the improved DMP model to generate the optimal obstacle avoidance trajectory.
[0134] Specifically, in step S4, the position update rule for individual explorers in the improved sparrow search algorithm is as follows:
[0135] ,
[0136] in, Let i be the position of the i-th sparrow in the j-th dimension of the t-th generation. For dynamic weights, This represents the sparrow's ranking number within the group of discoverers, where α is a random number within the range (0,1) used to adjust the exponential decay term. The maximum number of iterations, This is a random warning value. As a safety threshold, For random numbers that follow a standard normal distribution, It is a matrix whose elements are all 1s;
[0137] To improve the algorithm's global search capability in the early stages and its local optimization capability in the later stages, a dynamic weight mechanism is further introduced, the expression of which is:
[0138] ,
[0139] in, and These are the maximum and minimum values of the dynamic weights, respectively, and t is the current iteration number;
[0140] In each iteration, the fitness value of each individual in the population is calculated according to the comprehensive fitness function, and the positions of explorers, followers, and guards are updated in sequence until the stopping criterion is met.
[0141] The stopping criterion is any of the following conditions:
[0142] (1) The current iteration number has reached the maximum iteration number. ;
[0143] (2) The overall fitness function F is less than the preset threshold. ;
[0144] (3) The change in optimal fitness over several consecutive generations is less than the preset threshold ε;
[0145] By improving the sparrow search algorithm and optimizing the parameters, the optimal parameter combination suitable for dynamic obstacle environments is obtained, thereby generating an obstacle avoidance trajectory that combines safety, smoothness, and trajectory feature preservation.
[0146] The experimental results are shown in the table below: In terms of computational efficiency and optimization accuracy, the SSA algorithm outperforms both the GWO and WOA algorithms. SSA requires only 16 iterations to achieve an optimization result of 0.054648, while GWO and WOA require 43 and 50 iterations respectively, with optimization accuracies of 0.055091 and 0.056751. This demonstrates that the SSA algorithm can obtain a higher-accuracy solution with fewer iterations, fully showcasing its powerful global search capability and efficient local adjustment capability. Therefore, this study selects the SSA algorithm to optimize the improved DMP model.
[0147]
[0148] Example 2
[0149] This invention also discloses a robot dynamic obstacle avoidance trajectory optimization system based on an improved DMP, comprising:
[0150] The trajectory modeling module is used to acquire the robot's teaching trajectory, establish a trajectory dynamics model based on dynamic motion primitives, and learn and store the weights of the forced terms used to characterize the trajectory geometry.
[0151] The force coupling term construction module is used to construct a force coupling term that integrates steering force and potential force. The steering force is used to drive the robot to avoid obstacles in a direction perpendicular to the velocity direction, and the potential force is used to simulate the repulsive potential field around the obstacle.
[0152] An improved DMP model construction module is used to introduce the force coupling terms into the dynamic equations of the dynamic motion primitives to construct an improved DMP model;
[0153] A multi-objective optimization criterion definition module is used to construct a comprehensive fitness function, which integrates the average curvature index, the Friesian distance index, and the safety distance index.
[0154] The parameter global optimization module is used to globally optimize the parameters to be optimized in the improved DMP model using an improved sparrow search algorithm to generate the optimal obstacle avoidance trajectory. The improved sparrow search algorithm uses a circular chaotic mapping to initialize the initial population to improve the population distribution uniformity and global search capability, and uses a dynamic weight mechanism to adjust the iteration process to improve the local optimization capability and convergence accuracy in the later stages of the algorithm.
[0155] Figure 2This diagram illustrates a dynamic obstacle scenario in an industrial robot experimental platform, showcasing the present invention. The diagram shows the teaching trajectory within the robot's workspace and the positional distribution of two obstacles. The red arrows indicate the direction of the teaching trajectory. Obstacle 1 and obstacle 2 are located in different areas near the robot's trajectory, used to construct a multi-obstacle interference environment. This diagram serves to illustrate the application of the present invention's method in a real robot platform for trajectory learning, obstacle avoidance adjustment, and optimization verification in multi-obstacle scenarios.
[0156] Example 3
[0157] This embodiment also provides a computer-readable storage medium storing a computer program (or computer-executable instructions). When the computer program is executed by a processor (e.g., the CPU of an industrial robot controller, an embedded microprocessor, or a host industrial control computer), it can implement all or part of the steps of the robot dynamic obstacle avoidance trajectory optimization method based on the improved DMP described in the above method embodiments.
[0158] 1. Physical form of storage media:
[0159] In this embodiment, the computer-readable storage medium can be any entity or device capable of carrying or storing program code. Specifically, it includes, but is not limited to, electrically erasable read-only memory (EEPROM), read-only memory (ROM), random access memory (RAM), hard disk drive (HDD), solid-state drive (SSD), USB flash drive, portable hard drive, optical disc (CD-ROM or DVD), magnetic disk, or flash memory chips, etc., which are non-transitory storage media. The medium can exist independently or be integrated into the robot's controller.
[0160] 2. The specific process of program execution:
[0161] When the processor executes the computer program, it performs at least the following specific operations:
[0162] Trajectory modeling steps: acquire robot teaching trajectory data, establish a trajectory dynamics model based on dynamic motion primitives (DMP), and calculate and store the weights of the forced terms used to characterize the trajectory geometry.
[0163] Obstacle avoidance coupling steps: Construct a force coupling term that integrates steering force and potential field force, and introduce it into the dynamic equation of dynamic motion primitive to generate an improved DMP model with force coupling term;
[0164] The optimization criteria definition steps are as follows: Construct a comprehensive fitness function that integrates the average curvature index, the Fraser distance index, and the safety distance index;
[0165] Parameter optimization steps: The improved sparrow search algorithm is used to globally optimize the parameters to be optimized in the improved DMP model, and finally output the optimal obstacle avoidance trajectory.
[0166] 3. Generation of control signals:
[0167] In a specific application scenario (combined with) Figure 2 In the multi-obstacle environment shown, after the processor reads and executes the program on the storage medium, it first parses the teaching trajectory features stored in the medium, then calculates the relative distance between the robot's end effector and the dynamic obstacles in real time, and generates smooth joint angular displacement commands or Cartesian space pose commands by solving the improved DMP model, and sends them to the robot's servo driver, thereby controlling the robot to achieve dynamic obstacle avoidance.
[0168] 4. Integrated and Distributed Deployment:
[0169] It should be noted that the computer-readable storage medium can be located in a single robot control cabinet to achieve centralized control; or it can be distributed between a cloud server and a local gateway, wherein the cloud is used to store the teaching trajectory weights and perform complex global parameter optimization (step S4), while the local controller only performs lightweight DMP trajectory generation and real-time force coupling calculation (step S2).
[0170] 5. Explanation of beneficial effects:
[0171] By using the aforementioned storage medium, existing industrial robots can acquire dynamic obstacle avoidance and high-precision trajectory maintenance capabilities without significant modifications to their hardware structure, simply through software upgrades or program burning. This greatly reduces the cost and time required for technology upgrades, and has extremely high industrial practical value.
[0172] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for optimizing a robot's dynamic obstacle avoidance trajectory based on an improved DMP (Dynamic Obstacle Avoidance Management System), characterized in that... Includes the following steps: Step S1, Trajectory Modeling: Obtain the robot's teaching trajectory, establish a trajectory dynamics model based on dynamic motion primitives, and learn and store the weights of the forced terms used to characterize the trajectory geometry. In step S1, the dynamic equation of the dynamic motion element is expressed as: Where y is the current position. Let y be the first derivative of position y with respect to time, and z be the velocity state. Let z be the first derivative of the velocity state with respect to time, and g be the target position. It is a time constant. , The damping coefficient is... This is a mandatory item; To describe the time evolution of the motion process, a phase variable s is introduced, which satisfies the following gauge system equations: in, Let s be the first derivative of the phase variable s with respect to time. To standardize the system attenuation coefficient; The mandatory items Represented as a weighted combination of Gaussian functions: Where N is the number of Gaussian functions, w i Let be the weight coefficients of the i-th Gaussian function. The center of the i-th Gaussian function, Let be the width parameter of the i-th Gaussian function. Let i be the i-th Gaussian function; According to the teaching trajectory ,speed and acceleration The target coercion term is obtained by reverse calculation and used for subsequent weight learning: in, Let g be the time constant and g be the target position. Step S2, construct an improved DMP model with force coupling terms: construct a force coupling term that integrates steering force and potential force, and introduce it into the dynamic equation of the dynamic motion primitive to obtain an improved DMP model with force coupling terms; In step S2, a force coupling term is introduced into the dynamic motion primitive. : Force coupling term fusion steering force With potential force : Where m is the number of obstacles, ω i Assign weights to each obstacle. This is the scaling factor for the safety distance. , For steering force, For potential field force; Steering force The expression for driving a robot to avoid obstacles in a direction perpendicular to its current velocity is: in, This is the steering force gain coefficient. Let be a rotation matrix. This is the current velocity vector; Potential force The expression for the repulsive potential field used to simulate the area around an obstacle is: in, d is the potential field gain coefficient, a positive constant, used to adjust the strength of the repulsive potential field. The real-time distance between the robot and the obstacle. To set a safe distance threshold, This is the robot's current position vector; Step S3, Multi-objective optimization criterion definition: Construct a comprehensive fitness function, which integrates the average curvature index, the Fraser distance index, and the safety distance index, and is used to evaluate trajectory smoothness, teaching trajectory feature preservation, and obstacle avoidance safety, respectively; Step S4, Global Parameter Optimization: The improved sparrow search algorithm is used to globally optimize the parameters to be optimized in the improved DMP model to generate the optimal obstacle avoidance trajectory.
2. The robot dynamic obstacle avoidance trajectory optimization method based on improved DMP according to claim 1, characterized in that, In step S3, the average curvature index, the Fraser distance index, and the safety distance index are defined and summed with weights: Where F is the comprehensive fitness function, and the smaller the value, the higher the quality of the generalization trajectory; w1, w2, and w3 are S... traj、 S sim、 S safe The weights are used to adjust the importance of the three; f nor S is the normalization function; traj S represents the mean curvature. sim S is the Frescher distance; safe For a safe distance; the normalization function f nor The range normalization method is used to map each index to the interval [0, 1] to eliminate the influence of dimensions; for any index S, its normalized value f nor (S) is calculated as (SS) min ) / (S max -S min ), where S min and S max These are the minimum and maximum values of the indicator during the current optimization process, respectively. Using mean curvature The expression for trajectory smoothness is: Where n is the number of trajectory sampling points, Let be the curvature at the j-th sampling point; For a two-dimensional trajectory, the curvature is expressed as: in, and Let x and y be the first derivatives of the trajectory's x and y coordinates with respect to time at the j-th sampling point, respectively. and These are the second derivatives of the abscissa and ordinate of the trajectory at the j-th sampling point with respect to time, respectively. Mean curvature S traj The smaller the value, the smoother the trajectory; Fraser distance The expression for measuring the similarity between the generalized trajectory and the taught trajectory is: in, ( ) represents the Fréchet distance function. For teaching trajectory, For generalized trajectory; Fraser distance The smaller the value, the better the generated trajectory retains the original motion characteristics of the taught trajectory; safe distance The expression for measuring the safety level between a trajectory and obstacles is: in, The minimum distance between the trajectory and the obstacle. To preset a safe distance threshold, This is the penalty coefficient; When the distance between the trajectory and the obstacle is less than the safe distance, a penalty is introduced to improve the obstacle avoidance safety of the trajectory.
3. The method for optimizing robot dynamic obstacle avoidance trajectory based on improved DMP according to claim 2, characterized in that, In step S4, the position update rule for individual explorers in the improved sparrow search algorithm is as follows: in, Let i be the position of the i-th sparrow in the j-th dimension of the t-th generation. For dynamic weights, This indicates the sparrow's ranking number within the group of discoverers. The maximum number of iterations, This is a random warning value. As a safety threshold, For random numbers that follow a standard normal distribution, It is a matrix whose elements are all 1s; To improve the algorithm's global search capability in the early stages and its local optimization capability in the later stages, a dynamic weight mechanism is further introduced, the expression of which is: in, and These are the maximum and minimum values of the dynamic weights, respectively, and t is the current iteration number; In each iteration, the fitness value of each individual in the population is calculated according to the comprehensive fitness function, and the positions of explorers, followers, and guards are updated in sequence until the stopping criterion is met. The stopping criterion is any of the following conditions: (1) The current iteration number has reached the maximum iteration number. ; (2) The overall fitness function F is less than the preset threshold. ; (3) The change in optimal fitness over several consecutive generations is less than the preset threshold ε; By optimizing the parameters using an improved sparrow search algorithm, the optimal parameter combination suitable for dynamic obstacle environments is obtained, thereby generating an obstacle avoidance trajectory that combines safety, smoothness, and trajectory feature preservation.
4. A robot dynamic obstacle avoidance trajectory optimization system based on an improved DMP, characterized in that, The optimization is performed using the robot dynamic obstacle avoidance trajectory optimization method based on any one of claims 1-3, including: The trajectory modeling module is used to acquire the robot's teaching trajectory, establish a trajectory dynamics model based on dynamic motion primitives, and learn and store the weights of the forced terms used to characterize the trajectory geometry. The force coupling term construction module is used to construct a force coupling term that integrates steering force and potential force. The steering force is used to drive the robot to avoid obstacles in a direction perpendicular to the velocity direction, and the potential force is used to simulate the repulsive potential field around the obstacle. An improved DMP model construction module is used to introduce the force coupling terms into the dynamic equations of the dynamic motion primitives to construct an improved DMP model; A multi-objective optimization criterion definition module is used to construct a comprehensive fitness function, which integrates the average curvature index, the Friesian distance index, and the safety distance index. The parameter global optimization module is used to globally optimize the parameters to be optimized in the improved DMP model using an improved sparrow search algorithm to generate the optimal obstacle avoidance trajectory. The improved sparrow search algorithm uses a circular chaotic mapping to initialize the initial population to improve the population distribution uniformity and global search capability, and uses a dynamic weight mechanism to adjust the iteration process to improve the local optimization capability and convergence accuracy in the later stages of the algorithm.
5. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the robot dynamic obstacle avoidance trajectory optimization method based on any one of claims 1 to 3.
Citation Information
Patent Citations
Track planning method for mechanical arm to pass through space passing points based on improved dynamic motion primitives
CN119871350A
Mechanical arm dynamic obstacle avoidance trajectory planning method based on dynamic motion primitive and steering force field
CN119871351A