A robot arm trajectory planning method, system and medium
By improving the dynamic motion primitive algorithm, the problem of easy failure in robotic arm trajectory planning was solved, and stable planning of complex and closed trajectories was achieved. The speed adjustment and fitting capabilities were enhanced, making it suitable for more application scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ANHUI UNIVERSITY OF TECHNOLOGY
- Filing Date
- 2025-02-21
- Publication Date
- 2026-07-21
AI Technical Summary
Existing robotic arm motion trajectory planning algorithms are prone to failure, especially when the beginning and end of the trajectory are the same, leading to planning failure.
An improved Dynamic Motion Primitive Element (DMP) algorithm is constructed by introducing a velocity scaling factor into the PD controller and superimposing multiple nonlinear Gaussian radial basis functions into the trajectory shape learner, combined with a path splicing strategy, to build a state-continuous composite trajectory.
It improves the adaptability and stability of robotic arm trajectory planning, enabling it to handle complex and closed trajectories, expands application scenarios, and enhances speed adjustment capabilities and fitting accuracy.
Smart Images

Figure CN120080315B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of robotic arm planning, and more specifically, to a robotic arm trajectory planning method, system, and medium. Background Technology
[0002] With the rapid development of artificial intelligence technology, robots have become one of the important symbols of intelligent manufacturing. Robotics technology has received widespread attention, especially in fields such as healthcare and services, where the application of robots is becoming increasingly widespread, placing higher demands on the level of intelligence of robots. To improve the environmental adaptability and task execution flexibility of robots, there is an urgent need to research more efficient and robust robot trajectory planning methods.
[0003] Imitation learning is a hot research topic in robotics. It involves teaching robots to learn human motion trajectories and generalizing these trajectories to enable them to master corresponding movement skills. Among these methods, the Dynamic Movement Primitive (DMP) algorithm, proposed by Ijspeert et al. in 2002, is a novel imitation learning approach. Compared to traditional methods, DMP offers advantages such as smooth and continuous trajectories, ease of implementing multi-degree-of-freedom coupling, and low computational complexity, demonstrating good universality in the field of nonlinear trajectory learning. However, the classic DMP algorithm still has some shortcomings, such as the tendency to fail when the starting and ending points of the trajectory are the same, leading to a low success rate in trajectory planning.
[0004] Chinese patent application CN111618847B, published on September 4, 2020, discloses a method for autonomous grasping of a robotic arm based on deep reinforcement learning and dynamic motion primitives. The method includes the following steps: installing a camera image component to ensure the recognition area is not occluded, preprocessing the image of the target area, and sending it as state information to the deep reinforcement learning agent; constructing a local policy proximal optimization training model based on the state and deep reinforcement learning principles; constructing a new hybrid motion primitive model by fusing dynamic motion primitives and imitation learning; and training the robotic arm to autonomously grasp objects based on the model. This application effectively solves the problem of unsmooth joint motion in robotic arms based on traditional deep reinforcement learning. By combining the dynamic motion primitive algorithm, the problem of learning meta-parameters is transformed into a reinforcement learning problem, allowing the robotic arm to complete autonomous grasping tasks using deep reinforcement learning training methods. However, while this scheme optimizes the parameter learning of dynamic motion primitives using deep reinforcement learning and improves the smoothness of trajectory generation, it does not specifically address the algorithm failure problem caused by overlapping start and end points of the running trajectory. When a grasping task requires the robotic arm to complete a closed trajectory and return to its initial position, this method may face the risk of planning failure. Summary of the Invention
[0005] 1. Technical problems to be solved
[0006] To address the problem of easy failure in existing robotic arm trajectory planning algorithms, this application provides a robotic arm trajectory planning method, system, and medium. It also improves the controller and trajectory shape learner of the dynamic motion primitive algorithm, thereby enhancing the algorithm's adaptability to situations where the beginning and end of the trajectory are the same.
[0007] 2. Technical Solution
[0008] The purpose of this application is achieved through the following technical solution.
[0009] One aspect of this application provides a robotic arm trajectory planning method, comprising: S1, acquiring an image set of an injection object in different postures, and acquiring trajectory data of the robotic arm injection; the image set includes RGB images and depth images; S2, preprocessing the acquired trajectory data to obtain an optimal reference path; S3, labeling the injection region on the preprocessed image set, and training a target recognition model based on YOLOv8 using the labeled image set; S4, training an improved Dynamic Motion Primitives (DMP) algorithm using the optimal reference path; S5, identifying the injection region in the current image set using the target recognition model, and taking the center point of the injection region as the injection point; S6, planning the motion trajectory of the robotic arm from the current position to the injection point to complete the injection and then return to the current position using the trained improved Dynamic Motion Primitives (DMP) algorithm.
[0010] Depth images are a special type of image that records the distance information from each pixel in the image to the camera. In the robotic arm trajectory planning method of this application, depth images, together with RGB images, constitute a complete image set. By analyzing color and depth images, the position and orientation information of the injection target in three-dimensional space can be obtained. This information is crucial for the motion planning of the robotic arm, as it needs to adjust its joint angles and end effector pose based on the three-dimensional coordinates of the injection point to achieve precise injection operations. The spatial information provided by the combination of color and depth images enables the robotic arm to accurately locate the injection target in complex environments, improving the success rate and stability of injection.
[0011] The Dynamic Movement Primitive (DMP) algorithm is a machine learning algorithm used for trajectory encoding and generation. In the robotic arm trajectory planning method of this application, a velocity scaling factor is introduced into the PD controller of the DMP to enhance the velocity adjustment capability; multiple nonlinear Gaussian radial basis functions are superimposed in the trajectory shape learner to improve the fitting accuracy of the trajectory shape. By preprocessing the collected trajectory data, an optimal reference path is obtained and used to train the improved segmented DMP algorithm, enabling the algorithm to learn the motion characteristics of the taught injection trajectory.
[0012] Furthermore, S4, the improved segmented dynamic motion primitive DMP algorithm includes: decomposing the dynamic motion primitive DMP algorithm into a PD controller and a trajectory shape learner f; the PD controller is used to control the position state and speed of the robotic arm; the trajectory shape learner f is used to control the shape features of the trajectory; an improved PD controller is obtained by setting a speed scaling factor in the speed term; an improved trajectory shape learner f is obtained by superimposing multiple nonlinear Gaussian radial basis functions in the trajectory shape learner f; and an improved segmented dynamic motion primitive DMP algorithm is obtained based on the improved PD controller and the improved trajectory shape learner f.
[0013] The PD (Proportional-Derivative Controller) is a feedback controller used in the DMP algorithm to control the position and speed of the robotic arm, enabling it to track a reference trajectory. The trajectory shape learner is a core component of the DMP algorithm, used to learn and encode the shape features of the taught trajectory and reconstruct nonlinear terms similar to the taught trajectory shape during trajectory generation. In traditional DMP algorithms, the trajectory shape learner typically uses a weighted linear combination. In the improved DMP algorithm proposed in this application, the trajectory shape learner is improved by introducing multiple nonlinear Gaussian radial basis functions, resulting in an improved trajectory shape learner.
[0014] On the one hand, the traditional DMP algorithm's PD controller adjusts the system state only through a linear combination of position and velocity errors, resulting in limited adjustment capabilities. By introducing a scaling factor into the velocity term, an improved PD controller is formed, which can apply additional scaling adjustment to the velocity term while ensuring position error convergence. This allows the controller to more flexibly control the robot arm's movement speed, accelerating or decelerating it according to actual needs, thus improving the accuracy and stability of trajectory tracking. The enhanced speed adjustment capability expands the application scenarios of the DMP algorithm, enabling it to adapt to tasks with specific speed requirements for the robot arm.
[0015] On the other hand, traditional DMP algorithms use a weighted linear combination to represent the trajectory shape learner, which often fails to guarantee fitting accuracy when the trajectory is complex. By superimposing multiple nonlinear Gaussian radial basis functions into the trajectory shape learner, the learner's fitting ability is significantly improved. Gaussian radial basis functions are powerful local receptive field functions, highly sensitive to local changes in input variables. By arranging multiple Gaussian kernel functions in phase space and performing nonlinear superposition, the improved trajectory shape learner can accurately approximate arbitrarily complex continuous functions. Even with sharp changes or strong nonlinearities in the trajectory, high-precision encoding learning can be achieved. This improved fitting ability allows the improved DMP algorithm to handle more diverse trajectory planning tasks and adapt to the trajectory shape requirements of different processes.
[0016] On the other hand, in some application scenarios, the starting and ending states of a trajectory may be exactly the same, such as when a robotic arm needs to move along a closed trajectory and return to its initial position. For the traditional DMP algorithm, when the starting and ending states are the same, its phase space will degenerate into a single attraction point, losing the ability to generate continuous trajectories, causing the algorithm to fail. The improved DMP algorithm cleverly utilizes a path splicing strategy, using the ending state of one trajectory as the starting parameter of another trajectory, constructing a composite trajectory with continuous states. In this way, the improved algorithm breaks through the limitations of the traditional DMP, achieving continuous and stable planning of closed trajectories, effectively solving the algorithm failure problem caused by identical starting and ending states of the trajectory, and greatly expanding the applicability of the DMP algorithm.
[0017] Furthermore, the improved PD controller is as follows:
[0018]
[0019] Where y represents the position state, τ is the time scaling factor, and α y and β y These are adjustment parameters in the PD controller; g represents the target position of the robotic arm. and These are the first and second derivatives of y, respectively.
[0020] The improved trajectory shape learner f is:
[0021]
[0022] Where, ω i represents the weight value corresponding to each basis function; s is the phase variable of the first-order system; X is the number of basis functions. These are radial basis functions;
[0023]
[0024] Where σ and c i Representing the basis functions respectively The width and center.
[0025] In traditional Dynamic Motion Element (DMP) algorithms, the trajectory shape learner typically uses linearly weighted radial basis functions (RBFs), which suffers from insufficient expressive power and struggles to fit complex trajectories well. This application addresses this issue by superimposing multiple nonlinear Gaussian RBFs into the trajectory shape learner. Firstly, Gaussian RBFs are commonly used nonlinear functions; by superimposing multiple Gaussian RBFs with different widths and centers, various complex nonlinear trajectories can be fitted, significantly enhancing the expressive power of the trajectory shape learner. Secondly, each Gaussian RBF has a large response only near its center, decaying rapidly at greater distances. This local response characteristic allows each basis function to characterize the local trajectory shape, thereby improving the local generalization performance of the trajectory shape learner.
[0026] Further, S5, using a target recognition model to identify the injection region in the current image set, and taking the center point of the injection region as the injection point, includes: using the target recognition model to identify the injection region in the RGB image and extracting the center coordinates of the injection region; calculating the three-dimensional coordinates of the center coordinates in the camera coordinate system based on the depth information corresponding to the center coordinates of the injection region in the depth image; transforming the three-dimensional coordinates of the center coordinates in the camera coordinate system to the robotic arm coordinate system to obtain the three-dimensional coordinates of the center point of the injection region in the robotic arm coordinate system, which is then used as the injection point.
[0027] Furthermore, in step S6, the improved segmented dynamic motion primitive (DMP) algorithm, after training, is used to plan the motion trajectory of the robotic arm from its current position to the injection point, completes the injection, and returns to its current position. This includes: using the current position of the robotic arm as the starting point and the injection point as the target point, the improved segmented dynamic motion primitive (DMP) algorithm is used to plan the motion trajectory of the robotic arm from the starting point to the target point as the first path; using the injection point as the starting point and the current position of the robotic arm as the target point, the improved segmented dynamic motion primitive (DMP) algorithm is used to plan the motion trajectory of the robotic arm from the starting point to the target point as the second path; the state parameters of the first path at the target point are used as the state parameters of the second path at the starting point; and the first path and the second path are connected to obtain the motion trajectory from the current position of the robotic arm to the injection point, completes the injection, and returns to the current position.
[0028] Furthermore, the state parameters include position, velocity, and phase;
[0029] Furthermore, S2 preprocesses the collected trajectory data to obtain the optimal reference path, including:
[0030] The moving average filter (MAF) algorithm is used to smooth the acquired trajectory data. Raw trajectory data often contains noise and jitter; directly using this data for trajectory planning can easily lead to oscillations or distortions in the generated trajectory, affecting the stability of the robotic arm's movement. Smoothing the trajectory data using the moving average filter algorithm effectively suppresses high-frequency noise, making the trajectory curve smoother and more continuous, providing a more reliable input for subsequent processing.
[0031] The Dynamic Time Warping (DTW) algorithm is used to align the time steps of the smoothed trajectory data. In some implementations, manually operated trajectory data is collected as training data. In this type of trajectory data, due to speed variations and pauses during manual teaching, the time steps of different trajectories are usually inconsistent. Directly encoding and learning these trajectories will cause a mismatch in the time dimension, affecting the learning effect. Using the DTW algorithm to align the time steps of the smoothed trajectories can eliminate the differences in time scales, synchronizing different trajectories in the time dimension, thus creating conditions for subsequent encoding and regression.
[0032] Gaussian Mixture Model (GMM) processing is applied to multiple time-step aligned trajectory data. By inputting the time-aligned trajectory data into the GMM for encoding, the probability distribution features of the trajectories can be extracted. The GMM is a general density estimation method that can fit arbitrarily complex probability distributions through linear combinations of multiple Gaussian components. GMM encoding transforms discrete trajectory data into a continuous probability distribution function, reducing data storage requirements and facilitating probability sampling and generation of trajectories.
[0033] Based on the trajectory data encoded by the Gaussian Mixture Regression (GMR) model, a trajectory with a uniform distribution of trajectory points is generated as the optimal reference path. Building upon the GMM encoding, regression analysis using the GMR model on the encoded trajectory data yields a reference path with a uniform distribution of trajectory points. Compared to the original trajectory, this reference path inherits the motion characteristics of the teaching data but has a more uniform node distribution and better arc length parameterization. This provides high-quality training samples for subsequent trajectory shape learner parameter estimation, helping to improve the fitting accuracy and generalization ability of the shape learner. Simultaneously, the reference path can also serve as the target state for trajectory planning, guiding the robotic arm to achieve smooth and accurate movement.
[0034] Another aspect of the embodiments of this specification also provides a robotic arm trajectory planning system, including: an acquisition module for acquiring an image set containing RGB images and depth images of an injection object in different poses, and trajectory data of the robotic arm injection; a preprocessing module for performing trajectory smoothing and trajectory time step alignment processing on the trajectory data, and obtaining an optimal reference trajectory; an image annotation module for annotating the injection area in the image set; and a path planning module for improving the Dynamic Motion Primitive (DMP) algorithm and using the improved segmented motion primitive (DMP) algorithm to plan the motion trajectory of the robotic arm from the current position to the center point of the injection area to complete the injection and return to the current position.
[0035] 3. Beneficial effects
[0036] Compared to existing technologies, the advantages of this application are:
[0037] (1) A scaling factor α was introduced into the speed term of the PD controller. y This leads to an improved controller equation. Traditional PD controllers adjust the system state solely through a linear combination of position and velocity errors, limiting their adjustment capability. By introducing a velocity scaling factor, additional scaling adjustment can be applied to the velocity term while maintaining position error convergence, enabling the controller to more flexibly control the robot arm's movement speed. The velocity scaling factor can be set according to actual needs; when α... y When α > 1, the movement of the robotic arm can be accelerated; when α y When α < 1, the movement can be slowed down; when α y When α = 1, it is equivalent to a traditional PD controller. This can be achieved by appropriately adjusting α. y This allows the robotic arm to exhibit matched motion speed characteristics at different stages, such as appropriately decelerating when approaching the target point, thus improving the accuracy and stability of trajectory tracking. Therefore, the improved PD controller endows the DMP algorithm with stronger speed adjustment capabilities, enabling it to adapt to a wider range of applications.
[0038] (2) In the trajectory shape learner f, multiple Gaussian radial basis functions are superimposed to fit the shape features of the running trajectory. Traditional DMP algorithms usually use a weighted linear combination to represent the shape learner, which makes it difficult to guarantee fitting accuracy when the running trajectory is complex. After introducing Gaussian radial basis functions, the fitting ability of the learner is greatly improved. Gaussian radial basis functions are a type of local receptive field function, which is very sensitive to local changes in input variables. By arranging multiple Gaussian kernel functions in the phase space, it can approximate any continuous function well. At the same time, Gaussian radial basis functions also have good mathematical properties, and their parameters can be estimated by simple least squares method, making the training process efficient and easy to implement. By nonlinearly combining multiple Gaussian radial basis functions, the improved trajectory shape learner can accurately characterize the shape features of the running trajectory, and can achieve high-precision encoding learning even for complex trajectories with sharp changes or strong nonlinearity.
[0039] (3) In the special case where the starting and ending trajectories coincide, the traditional DMP algorithm is prone to trajectory planning failure. This is due to the inherent time evolution mechanism of the classic DMP algorithm. When the starting and ending states are the same, the phase space of DMP will degenerate into a single attraction point, losing the ability to generate continuous trajectories. To address this problem, the improved DMP algorithm cleverly utilizes the idea of path splicing. By setting the ending state of one trajectory as the starting parameter of another trajectory, a composite trajectory with continuous states is constructed. This strategy breaks through the limitations of the classic DMP algorithm, enabling the robotic arm to autonomously plan a circular closed trajectory and smoothly return to the initial position. Attached Figure Description
[0040] Figure 1 This is a flowchart of a robotic arm trajectory planning method according to this application;
[0041] Figure 2 This application uses YOLOv8 performance curves;
[0042] Figure 3 This is the optimal trajectory diagram of the robotic arm obtained in this application;
[0043] Figure 4 This is a demonstration diagram illustrating the generalization learning of the improved dynamic motion primitive algorithm in this application. Detailed Implementation
[0044] The present application will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0045] Reference Figure 1A robotic arm trajectory planning method includes the following steps: Step 1: Acquire RGB and Depth images of injection objects in different poses as training and validation sets for target recognition; Step 2: Annotate the injection regions in the dataset images and input them into a YOLOv8 target recognition network model for training, obtaining a target recognition model that can locate the center point of the injection region on the injection object; Step 3: Acquire the trajectory of the robotic arm completing the injection process in manual mode by an expert dragging it, preprocess the obtained trajectory, and use it as the running trajectory to provide a reference for the robotic arm motion trajectory planning; Step 4: Encode the acquired running trajectory using an improved segmented dynamic motion primitive algorithm. Step 5: Using a target recognition model, identify the injection area in the current image of the camera. Use the center point of the injection area as the segment point of the robotic arm's motion trajectory to obtain the current position of the robotic arm's end effector. Plan the motion trajectory of the robotic arm's end effector from the current position to the injection point to complete the injection and then return to the current position using the robotic arm motion trajectory model. Step 6: The robotic arm starts moving from the current position and follows the imitation trajectory learned through algorithm encoding. Control the robotic arm's end effector to imitate the expert injection process and move to the injection point in a specific posture. After completing the injection task, return to the initial position of the robotic arm from the injection point according to the planned trajectory and wait to execute the next task.
[0046] Reference Figure 2 Steps one and two involve training a target recognition model using the YOLOv8 algorithm to identify the injection region. The YOLO algorithm is a real-time target detection system that predicts target bounding boxes and categories using a single neural network. It employs a single CNN model to achieve end-to-end target detection. Building on the success of previous YOLO versions, it introduces new features and improvements, further enhancing performance and flexibility. Specific innovations include a new backbone network, a new Ancher-Free detection head, and a new loss function. Compared to its predecessors YOLOv5 and YOLOv7, the YOLOv8 algorithm achieves an excellent balance between speed and accuracy, making it suitable for applications requiring rapid detection.
[0047] Reference Figure 3 Step three includes: In this embodiment, the trajectory of the expert dragging the robotic arm to complete the injection in manual mode is collected as trajectory data. The trajectory data is used to train the improved DMP algorithm to control the robotic arm to perform the injection task. The trajectory recording format is: ε i ={i,ε s,i} N Where N represents the current demonstration trajectory number, i = {1, 2, ..., T} is the time step sequence of the expert demonstration, T represents the total number of time steps in this demonstration, and ε iThis represents the robotic arm demonstration trajectory data obtained at time step i during the Nth demonstration.
[0048] Reference Figure 3 Step three involves preprocessing the collected expert demonstration robotic arm trajectory data, including trajectory smoothing, trajectory time step alignment, and optimized trajectory acquisition. The Moving Average Filtering (MAF) algorithm is used to smooth the expert trajectory to eliminate jagged disturbances caused by environmental factors during sampling, reducing their impact on subsequent generalization. The main idea of MAF is to set a fixed-width sliding window, treating the N consecutively acquired sampled values as a fixed-length queue. Each time a new data point is sampled, it is placed at the tail of the queue, while the first data point is discarded. The N data points in the queue are then averaged to obtain a new filtered result, i.e., the output filtered sequence. Let the width be N = 2k + 1, and the input and output sequences be x(n) and y(n), respectively. The filtered sequence is:
[0049]
[0050] Reference Figure 3 In step three, the Dynamic Time Warping (DTW) algorithm is used to align the trajectories in time to avoid the final trajectory learning generalization effect being affected by the misalignment of some spatially similar trajectory sequences in time steps. Multiple running trajectories have similar motion characteristics, so a Gaussian Mixture Model (GMM) is used to encode the trajectories. Then, a GMR regression model is used to generate an optimized motion trajectory that includes the motion characteristics of the running trajectory and has a uniform distribution of trajectory points.
[0051] Reference Figure 4 Step four includes: encoding and learning the acquired trajectory using the improved Dynamic Motion Element (DMP) algorithm. The DMP algorithm can be viewed as a superposition of a proportional-derivative (PD) controller and a trajectory shape learner. The most commonly used and simplest PD controller can be represented by a spring-damped system.
[0052]
[0053] Where y represents the state of the system. and These are the first and second derivatives of y, respectively; g represents the target state where the system eventually converges; and the parameter α... y and β y These can be viewed as two adjustment parameters in a PD controller, with τ being the time scaling factor. Assuming f is a nonlinear function representing the trajectory shape learner, the DMP can then be expressed as:
[0054]
[0055] By changing the target endpoint g and the nonlinear term f in equation (3), the endpoint and shape of the learned trajectory can be adjusted. To obtain the desired trajectory shape, different nonlinear terms f need to be constructed. Therefore, this can be achieved by normalizing and linearly superimposing multiple nonlinear basis functions, and its function can be expressed as:
[0056]
[0057] Where s is the phase variable from the first-order system, ω i This represents the weight value corresponding to each basis function, where X is the number of basis functions. Defined as a radial basis function, its functional expression is:
[0058]
[0059] In the formula, σ and c i Representing the basis functions respectively The width and center of the trajectory can be determined by weighting different basis functions and their corresponding weights to obtain a complex trajectory, thus achieving the desired trajectory shape. Generally, the complexity of the trajectory is proportional to the number of basis functions. To change the convergence speed of the trajectory, it is also necessary to consider the first derivative of the system state representing the velocity. Adding a scaling term τ to the top, the complete expression is:
[0060]
[0061] Equation (6) can be used to obtain learning trajectories with different target endpoints and convergence speeds. Equation (6) can also be regarded as the basic formula of the DMP algorithm. By encoding and learning the running trajectory through this algorithm, a new trajectory is obtained. This trajectory has the action characteristics of the running trajectory and has good generalization performance.
[0062] When applying the dynamic motion primitive algorithm to the vaccine injection scenario, in order to simplify the operation process, it is defined that the robotic arm returns to the initial position after completing the task. At this time, the starting point and ending point of the robotic arm's motion trajectory are the same, and the generalized trajectory is always the origin, so the dynamic motion primitive method fails. Based on the above formula, it can be seen from the properties of dynamic motion primitive that the motion process of the learning trajectory is determined by the forcing function f. When f is 0, the gy term in equation (6) is always 0, so the forcing function is always 0, which makes it impossible for the forcing function to change the motion trend of the learning trajectory. The learning trajectory moves from point y to the endpoint g according to the initial motion law of the second-order system, that is, the motion law of the critical damping model. Since the two points are the same position, the obtained learning trajectory is always one point.
[0063] When the starting and ending points of a robotic arm's movement are at the same point, the dynamic motion algorithm fails and cannot learn and generalize new motion trajectories. Considering the characteristics of vaccine injection, this paper proposes a robotic arm trajectory planning method based on vision and dynamic motion primitives. By using visually recognized injection points as the set of trajectory segmentation points, the dynamic motion primitive algorithm completes the robotic arm task trajectory planning, thus fulfilling the robotic arm injection task.
[0064] As can be seen from equation (2), this equation is a process equation. If we use As a state variable, it can be written in matrix form as follows:
[0065]
[0066] The real part of the poles of the coefficient matrix in the formula needs to be chosen with an appropriate α. y With β y The parameter is set to be less than 0 to ensure the convergence of the expression, and as the learning process progresses, the equation will converge to:
[0067]
[0068] As can be seen from equation (8), the state variables will eventually converge to the target endpoint g, that is, the DMP algorithm can guarantee that the system will eventually converge to the target state. Under this premise, it can be obtained by using the given f through equation (4). After obtaining it, a new starting position and target endpoint are set and the phase variable s is reset. Then, the learning trajectory that moves to the set new target endpoint can be obtained by using equation (6).
[0069] Therefore, for complex application scenarios, and taking advantage of the DMP algorithm's ability to converge to a specified target point, this paper proposes an improved segmented DMP algorithm for encoding and learning. Let the given trajectory be Y. ori The starting point of the learning trajectory to be generated is y0, and the target endpoint is g. Through encoding and generalization learning, a learning trajectory reaching the specified target point can be obtained. Simultaneously, a segmentation point b is calculated for the injection point to be reached in the scene. Using this segmentation point as the boundary, the trajectory is divided into two segments:
[0070] Y ori =(y ori1 ,y ori2 (9)
[0071] Set the starting point and target endpoint coordinates of the two trajectories as follows:
[0072] Y0 = [y o1 y o2 ] T (10)
[0073] G = [g1 g2]T (11)
[0074] During the learning process, the target endpoint g1 of the first segment of the learning trajectory is set based on the target injection point, enabling the generation of a motion trajectory that reaches the injection point and is as similar as possible to the running trajectory. Then, in the subsequent trajectory learning, the target endpoint g2 is set as the endpoint of the original running trajectory to ensure that the reproduced trajectory eventually returns to the original trajectory and converges to the original target point. Since the DMP algorithm converges to the target endpoint g during dynamic control, when performing segmented learning, it is only necessary to record the endpoint of the first segment of the learning trajectory and use it as the starting state variable of the subsequent segment of the learning trajectory to directly obtain a complete learning trajectory.
[0075] Reference Figure 4 Step five includes acquiring images using an RGB-D camera on the robotic arm, identifying the injection area in the color image using a target recognition model, obtaining the three-dimensional coordinates of the injection point in the camera coordinates using the center coordinates of the injection area and its depth information in the depth image, obtaining the three-dimensional coordinates of the injection point in the robotic arm coordinates after coordinate transformation, and this coordinate point is also the segment point of the robotic arm's motion trajectory, where the robotic arm's end effector completes the injection task; planning the trajectory in the current state based on the optimized motion trajectory model to obtain the robotic arm's end effector motion trajectory, and obtaining the corresponding continuous trajectories for other joints of the robotic arm through inverse kinematics of the robotic arm.
[0076] Step six includes: The robotic arm begins to perform the injection task according to the planned trajectory: The robotic arm is in a suitable posture for observing the injection object. Starting from the current position, the end effector of the robotic arm moves to the injection point according to the motion characteristics of the expert injection process. After completing the injection task, it returns to the initial position of the robotic arm to await the next injection process.
[0077] The foregoing illustrative description of the invention and its embodiments is not restrictive and can be implemented in other specific forms without departing from the spirit or essential characteristics of the invention. The accompanying drawings are only one embodiment of the invention, and the actual structure is not limited thereto. No reference numerals in the claims should limit the scope of the claims. Therefore, if a person skilled in the art, inspired by this description, designs a similar structure and embodiment without departing from the spirit of the invention, such design should fall within the scope of protection of this patent. Furthermore, the word "comprising" does not exclude other elements or steps, and the word "a" preceding an element does not exclude the inclusion of "a plurality" of that element. Multiple elements stated in the product claims can also be implemented by a single element through software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any specific order.
Claims
1. A method for planning the trajectory of a robotic arm, characterized in that, include: Collect image sets of objects being injected in different poses, as well as trajectory data of the robotic arm during injection; The image set includes RGB images and depth images; The injection regions in the image set are labeled, and the labeled image set is used to train a target recognition model based on YOLOv8. The injection region in the current image set is identified using a target recognition model, and the center point of the injection region is taken as the injection point. An improved Dynamic Motion Primitives (DMP) algorithm is used to plan the motion trajectory of the robotic arm from its current position to the injection point, completes the injection, and returns to its current position. The improved Dynamic Motion Element (DMP) algorithm is obtained by introducing a velocity scaling factor and superimposing multiple nonlinear Gaussian radial basis functions. Improved Dynamic Motion Element (DMP) algorithm, including: The Dynamic Motion Element (DMP) algorithm is decomposed into a PD controller and a trajectory shape learner. The PD controller is used to control the position and speed of the robotic arm; the trajectory shape learner Shape features used to control the trajectory; An improved PD controller is obtained by setting a speed scaling factor in the speed term; By trajectory shape learner By superimposing multiple nonlinear Gaussian radial basis functions, an improved trajectory shape learner is obtained. ; Based on the improved PD controller and the improved trajectory shape learner An improved segmented dynamic motion primitive DMP algorithm was obtained; The injection region in the current image set is identified using a target recognition model, including: The injection region in the RGB image is identified using a target recognition model, and the center coordinates of the injection region are extracted. Based on the depth information corresponding to the center coordinates of the injection area in the depth image, calculate the three-dimensional coordinates of the center coordinates in the camera coordinate system. Transform the center coordinates in the camera coordinate system to the robot arm coordinate system to obtain the three-dimensional coordinates of the center point of the injection area in the robot arm coordinate system, which is then used as the injection point. The improved Dynamic Motion Primitives (DMP) algorithm is used to plan the motion trajectory of the robotic arm from its current position to the injection point, and then back to its current position after completing the injection. This includes: Taking the current position of the robotic arm as the starting point and the injection point as the target point, the improved segmented dynamic motion primitive (DMP) algorithm is used to plan the motion trajectory of the robotic arm from the starting point to the target point, which is used as the first path. Starting from the injection point and with the current position of the robotic arm as the target point, the improved segmented dynamic motion primitive (DMP) algorithm is used to plan the motion trajectory of the robotic arm from the target point back to the initial position, which serves as the second path. Use the state parameters of the first path at the target point as the state parameters of the second path at the starting point; Connect the first path and the second path to obtain the motion trajectory from the current position of the robotic arm to the injection point to complete the injection and then return to the current position.
2. The robotic arm trajectory planning method according to claim 1, characterized in that: The improved PD controller is as follows: in, Indicates the position status. This is the time scaling factor; and These are adjustment parameters in the PD controller; Indicates the target position of the robotic arm; and They are The first and second derivatives of ; f is a nonlinear function.
3. The robotic arm trajectory planning method according to claim 1, characterized in that: Improved trajectory shape learner for: in, This represents the weight value corresponding to each basis function; For the phase variable of a first-order system; The number of basis functions. These are radial basis functions; in, and Representing the basis functions respectively The width and center of the x-axis; x is the independent variable.
4. The robotic arm trajectory planning method according to claim 1, characterized in that: The state parameters include position, velocity, and phase.
5. The robotic arm trajectory planning method according to any one of claims 1 to 4, characterized in that: Before planning the motion trajectory using the improved Dynamic Motion Primitives (DMP) algorithm, the following steps are also included: The collected trajectory data is smoothed using the moving average filter (MAF) algorithm. The Dynamic Time Warping (DTW) algorithm is used to align the time steps of the smoothed trajectory data. Gaussian Mixture Code (GMM) is applied to multiple trajectory data after time step alignment. Based on the trajectory data after GMM encoding, a Gaussian Mixture Regression (GMR) model is used to generate a trajectory with uniformly distributed trajectory points, which serves as the optimal reference path. An improved segmented dynamic motion primitive (DMP) algorithm is trained using the optimal reference path.
6. A robotic arm trajectory planning system for executing the method according to any one of claims 1 to 5, characterized in that, include: The acquisition module collects image sets containing RGB and depth images of the injection objects in different poses, as well as trajectory data of the robotic arm injection. The preprocessing module performs trajectory smoothing and trajectory time step alignment on the trajectory data to obtain the optimal reference trajectory; Image annotation module, used to annotate injection areas within an image set; The path planning module improves the Dynamic Motion Primitives (DMP) algorithm and uses the improved segmented DMP algorithm to plan the motion trajectory of the robotic arm from its current position to the center point of the injection area to complete the injection and return to the current position.
7. A computer-readable storage medium storing computer instructions that, when executed by a processor, implement the method as described in any one of claims 1 to 5.