A mechanical arm pose trajectory optimization method based on digital twinning and PSO-polynomial interpolation, electronic equipment and readable storage medium
Patent Information
- Application Number
- CN202610459800.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-09
- Publication Date
- 2026-08-18
AI Technical Summary
[0002]在工业机械臂轨迹规划领域,目前主流以人工示教为主,操作人员通过示教器引导机械臂末端执行器沿期望路径运动,系统通过记录关键点位姿并自动生成轨迹;该方法实现简单、操作者门槛较低,在中小批量生产中被广泛采用;然而,示教轨迹通常仅能保证几何可达性,缺乏对运动性能的主动优化,轨迹往往存在速度波动大、加速度突变、总运行时间冗余等问题,难以满足高速、高精、高平稳性作业的需求,尤其在软线插接等对末端抖动敏感的场景中,未经优化的轨迹易引发线缆晃动甚至物理损伤,直接影响产品良率
[0059] (1) The present invention uses fifth-order polynomial interpolation in a six-degree-of-freedom joint space and forces the starting and ending point velocities and accelerations to be zero. Only six boundary conditions are needed to analytically solve all coefficients. Under the premise of ensuring the continuity of position, velocity and acceleration, the computational complexity can be significantly reduced. Therefore, the present invention can effectively suppress mechanical impact and cable sway, and can control the time of single trajectory generation to the millisecond level, thus taking into account both the smoothness and real-time performance of the robotic arm.
Smart Images

Figure CN122584281A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent control technology for industrial robots, specifically relating to a method for optimizing the pose trajectory of a robotic arm based on digital twins and PSO-polynomial interpolation, an electronic device, and a readable storage medium. Background Technology
[0002] In the field of industrial robotic arm trajectory planning, the mainstream approach is currently manual teaching. Operators guide the end effector of the robotic arm along the desired path using a teach pendant, and the system automatically generates the trajectory by recording the pose of key points. This method is simple to implement and has a low operator threshold, making it widely used in small and medium-batch production. However, taught trajectories usually only guarantee geometric reachability and lack active optimization of motion performance. Trajectories often suffer from problems such as large speed fluctuations, sudden acceleration changes, and redundancy in total running time, making it difficult to meet the requirements of high-speed, high-precision, and high-stability operations. Especially in scenarios such as flexible cable splicing where end effector vibration is sensitive, unoptimized trajectories can easily cause cable swaying or even physical damage, directly affecting product yield.
[0003] To overcome the limitations of manual teaching, researchers have introduced intelligent optimization algorithms into the trajectory generation process in recent years. Gradient-free optimization methods such as PSO (Particle Swarm Optimization) and DE (Differential Evolution) have been used to search for optimal trajectory parameters due to their good adaptability to nonlinear and nonconvex problems. However, existing research has two significant shortcomings: First, at the algorithm level, single intelligent algorithms are prone to getting trapped in local optima or have low convergence efficiency, making it difficult to find a globally optimal solution stably in complex constraint spaces. Second, at the model level, most optimization frameworks do not fully embed the actual physical constraints of industrial robotic arms (such as joint angle limits and maximum angular velocity / angular acceleration limits), resulting in the generated "mathematically optimal" trajectory being unexecutable on real robotic arms, requiring repeated rework and debugging, which reduces the overall development efficiency.
[0004] In addition, traditional processes typically deploy optimization results directly to physical robots for trial runs. This approach is not only time-consuming but also carries the risk of collisions, especially in densely packed production line environments where safety hazards are particularly prominent. Although existing digital twin technology can build high-fidelity virtual production lines through platforms such as Visual Components and RobotStudio to achieve visualized simulation of robotic arm movements, current applications are mostly limited to "post-event playback" or "status monitoring" stages and have not yet formed a closed-loop linkage with the front-end intelligent optimization module.
[0005] In addition, existing trajectory optimization methods for industrial robotic arms often use high-order splines (such as seventh-order polynomials) or ignore acceleration continuity when constructing smooth trajectories. The former leads to complex parameter solutions and high computational costs, while the latter causes end-effector jitter due to abrupt acceleration changes, making it difficult to meet the precision operation requirements of industrial robotic arms.
[0006] In summary, existing technologies have significant shortcomings in areas such as algorithm robustness, physical constraint embedding, and virtual-real closed-loop verification, making it difficult to support the rapid and reliable generation of high-performance robotic arm trajectories. Summary of the Invention
[0007] To address the aforementioned technical problems, this invention provides a method for optimizing the pose trajectory of a robotic arm based on digital twins and PSO-polynomial interpolation, an electronic device, and a readable storage medium.
[0008] To achieve the above objectives, the present invention is implemented through the following technical solution:
[0009] The first aspect of this invention provides a method for optimizing the pose trajectory of a robotic arm based on digital twin and PSO-polynomial interpolation, comprising the following steps:
[0010] S1. Collect the physical characteristic parameters of the robotic arm and the specific work scenario, and verify and calibrate the parameters according to the technical parameters of the robotic arm to ensure that the technical parameters of the robotic arm are consistent with the physical characteristic parameters and obtain calibration parameters; the physical characteristic parameters of the robotic arm include the diameter of the robotic arm base and the length of each joint arm, etc.; the physical characteristic parameters of the specific work scenario include the size of the tooling table and the installation position, etc.
[0011] S2. Based on the calibration parameters obtained in step S1, construct a digital twin virtual model that matches the robotic arm's working unit in a 1:1 ratio using a 3D simulation platform. The digital twin virtual model includes a 3D geometric model of the robotic arm, a working space model, and a model of peripheral supporting equipment. The digital twin virtual model replicates the key features of the robotic arm entity, such as joint motion constraints and spatial layout, to achieve a digital mirror of the robotic arm's physical scene.
[0012] S3. Based on the digital twin virtual model constructed in step S2, simulate the actual working conditions of the robotic arm, and manually teach the 3D geometric model of the robotic arm in the digital twin virtual model to generate the initial teaching trajectory of the robotic arm in the working scenario; the initial teaching trajectory includes the spatial pose and joint angle sequence of the end effector of the robotic arm in each working scenario.
[0013] S4. The data acquisition module reads the pose trajectory data of the robotic arm in the digital twin virtual model during the entire initial teaching trajectory operation. The sampling interval of the data acquisition module is set to a fixed time interval. The pose trajectory data includes the spatial coordinates X, Y, and Z of the end effector and the attitude angle R. x R y R z The data includes the angles J1, J2, J3, J4, J5, and J6 of the robot's six joints, and the data is exported.
[0014] S5. Based on PSO and fifth-order polynomial interpolation algorithm, construct trajectory optimization model. Based on the pose trajectory data collected in step S4, take the joint angle limit of the robot arm entity, motion speed constraint, and obstacle avoidance requirements as hard indicators, and take the total trajectory motion time and smoothness as optimization objectives. Solve the optimal time allocation parameters and adjustable intermediate transition point joint angle of the initial teaching trajectory to generate the optimal pose trajectory of the robot arm with continuous position, velocity, and acceleration and satisfying multiple constraints.
[0015] S6. Import the optimal pose trajectory of the robotic arm obtained in step S5 into the digital twin virtual model constructed based on the 3D simulation platform. Drive the 3D geometric model of the virtual robotic arm in the digital twin virtual model to reproduce the complete motion process of the optimal pose trajectory of the robotic arm. Verify the motion smoothness of the optimal pose trajectory of the robotic arm and the obstacle avoidance effectiveness in the operation scenario through visualization simulation, and realize the pre-verification of the execution effect of the physical trajectory by the digital twin environment.
[0016] According to the above-mentioned robotic arm pose trajectory optimization method based on digital twin and PSO-polynomial interpolation, preferably, in step S5, the optimization logic of the PSO and fifth-order polynomial interpolation algorithm is as follows:
[0017] S51. Based on the initial teaching trajectory collected in step S4, obtain the trajectory key points that the robotic arm must reach the target work point. Divide the trajectory segments and sub-trajectories based on the trajectory key points, introduce adjustable intermediate transition points, and use a fifth-order polynomial to parametrically model each sub-trajectory to obtain a fifth-order polynomial trajectory model. Solve the polynomial coefficients through boundary conditions to ensure the smoothness of the trajectory. The sub-trajectories are smoothly spliced together to form a whole multi-segment trajectory, the shape of which is uniquely determined by a specific variable.
[0018] S52. Based on the fifth-order polynomial trajectory model obtained in S51, determine the optimization variables and construct a multi-objective optimization function with minimizing the total running time as the core, while taking into account motion smoothness and constraint feasibility.
[0019] S53. Based on the multi-objective optimization function in step S52, the PSO (Particle Swarm Optimization) algorithm is used to perform a global search for the positions of the two intermediate adjustable transition points and the time of each segment trajectory. By initializing the particle swarm within the physical feasible region, iteratively performing speed and position updates, and evaluating the fitness according to the multi-objective optimization function, the globally optimal particle is finally output, generating the optimal pose trajectory of the robotic arm that meets the requirements of smoothness, timeliness and safety.
[0020] According to the above-mentioned robotic arm pose trajectory optimization method based on digital twin and PSO-polynomial interpolation, preferably, in step S51,
[0021] The steps for dividing the trajectory segment and sub-trajectory and introducing adjustable intermediate transition points are as follows: dividing the motion between adjacent key points into independent trajectory segments; introducing two adjustable intermediate transition points. Each trajectory segment is divided into three continuous sub-trajectories, forming a four-point sequence. The three continuous sub-trajectories are as follows: the first segment starts from... arrive The second paragraph begins arrive And the third paragraph from arrive .
[0022] The starting point of the trajectory segment , , , All are 6-dimensional vectors, and their elements correspond to the angle values of the six joints of the robotic arm. They are used as decision variables in the particle swarm optimization algorithm to coordinate the smoothness of the optimal pose trajectory of the robotic arm, the total time consumption, and the obstacle avoidance performance.
[0023] The steps for parametric modeling and polynomial coefficient solving of each sub-trajectory using a fifth-order polynomial are as follows: Each sub-trajectory segment is parametrically modeled using a fifth-order polynomial in a six-degree-of-freedom joint space; the robotic arm's... Each joint in normalized time The angle below is expressed as:
[0024]
[0025] Wherein, coefficient vector The coefficient vector is uniquely determined by the boundary conditions of the sub-trajectory.
[0026] The boundary conditions include the position of the starting time. ,speed and acceleration The position of the termination time ,speed and acceleration Based on the six boundary conditions, all six polynomial coefficients can be analytically solved, thus ensuring that each sub-trajectory is continuously differentiable at the three levels of position, velocity, and acceleration, which is used to meet the requirements of industrial robots for smooth motion.
[0027] According to the above-mentioned robotic arm pose trajectory optimization method based on digital twin and PSO-polynomial interpolation, preferably, in step S51, the shape of the entire multi-segment trajectory is uniquely determined by two types of variables, specifically, the running time of each segment is... The joint angle at the adjustable intermediate transition point is: .
[0028] The specific values of the boundary conditions are: assuming that the velocity and acceleration at the start and end points of the entire trajectory segment between one trajectory key point and another are both zero, i.e., the starting velocity... Final speed Initial acceleration =0, final acceleration .
[0029] Two adjustable intermediate transition points ( The velocity estimate is based on the running time of the three sub-trajectories corresponding to the current particle in each iteration of the PSO (Particle Swarm Optimization) algorithm. and adjustable intermediate transition point position Dynamic calculations are performed, specifically:
[0030] The estimated velocity at the end of the first segment of the trajectory is:
[0031] .
[0032] The estimated velocity at the end of the second sub-trajectory is:
[0033] .
[0034] in, This indicates the adjustable intermediate transition point 1, which is the end point of the first sub-trajectory segment; This indicates the adjustable intermediate transition point 2, which is the end point of the second sub-trajectory segment; Indicates the starting point of the trajectory segment; Indicates the end point of the trajectory segment.
[0035] The estimated velocity is used as the velocity boundary condition for the corresponding sub-trajectory endpoints, and is used to analytically solve the fifth-order polynomial coefficients. This implicitly promotes the velocity continuity of the three trajectories at the connection point during the optimization process, and avoids mechanical shock caused by sudden velocity changes.
[0036] According to the above-described robotic arm pose trajectory optimization method based on digital twin and PSO-polynomial interpolation, preferably, in step S52, the multi-objective optimization function is:
[0037] ;
[0038] in, This represents the total running time of the trajectory. This is a smoothness penalty term used to suppress abrupt changes in joint acceleration, and is taken as the sum of the square integrals of the accelerations of each segment; To constrain violations of penalties, positive penalties are imposed on behaviors that exceed joint limits, speed / acceleration limits, or intrude into obstacle areas; This is a weighting coefficient used to balance timeliness, smoothness, and feasibility.
[0039] According to the above-mentioned robotic arm pose trajectory optimization method based on digital twin and PSO-polynomial interpolation, preferably, in step S53, the particle encoding method of the PSO algorithm is as follows: the trajectory parameters to be optimized in the fifth-order polynomial trajectory model are integrated into a 15-dimensional decision vector, and each particle... A complete set of candidate solutions for trajectory parameters is represented by the following dimensional structure:
[0040] ;
[0041] in, For the first The running time of the three sub-trajectories corresponding to each particle; For the first The joint angle vectors of the two adjustable intermediate transition points corresponding to each particle; superscript Used to distinguish different particles T represents the vector transpose.
[0042] According to the above-mentioned robotic arm pose trajectory optimization method based on digital twin and PSO-polynomial interpolation, preferably, in step S53, the generation method of the initial particle swarm is as follows: a global search is performed on the 15-dimensional decision variables using the PSO (Particle Swarm Optimization) algorithm; the initial particle swarm is generated within the feasible region that satisfies the physical constraints; each time component is limited to... Within the interval, the joint angles of the two adjustable intermediate transition points are based on the linear interpolation results from the start point to the end point, respectively superimposed with a uniformly distributed 6-dimensional random perturbation vector, and forcibly constrained within the joint limit range through a clipping operation.
[0043] ;
[0044] ;
[0045] in, and It is a 6-dimensional random perturbation vector; clip(⋅) means limiting the joint angle to a preset minimum value element by element. With the maximum value between.
[0046] The iterative update rule for particle velocity and position is as follows: during the iteration process, the velocity and position of each particle evolve according to the standard particle swarm optimization update rule;
[0047] ;
[0048] .
[0049] Where w is the inertia weight, and For learning factors; and The independently generated uniform random numbers in the interval [0,1]; This represents the historical best position of the i-th particle up to the g-th generation; This represents the current globally optimal position for the population. After each position update, boundary pruning is performed on both the time component and the joint angle component to ensure that all particles remain within the physically feasible region. Let be the search direction and step size of the i-th particle in the g-th generation, and each of its dimensional components corresponds to the update increment of the joint angle; Let be the current position vector of the i-th particle in the g-th generation.
[0050] The fitness evaluation and iteration termination of the particles are performed as follows: the particle fitness is determined by the multi-objective optimization function defined in step S52. Evaluation; the algorithm iterates continuously until it reaches the preset maximum number of iterations, or the global optimal fitness shows no significant improvement over several consecutive generations; the final output is the globally optimal particle. It is used to generate robot operation trajectories that meet the requirements of smoothness, timeliness and safety.
[0051] According to the above-mentioned robotic arm pose trajectory optimization method based on digital twin and PSO-polynomial interpolation, preferably, in step S6, the simulation verification step includes:
[0052] S61. Import the optimal pose trajectory of the robotic arm generated in step S5 into the digital twin virtual model built on the three-dimensional simulation platform, and drive the virtual robotic arm model to completely reproduce the motion process of the optimal pose trajectory of the robotic arm.
[0053] S62. During the simulation operation, the real-time collision detection module built into the 3D simulation platform is called to monitor the geometric interference between each link of the robotic arm and the preset static obstacles in the work scene; if no collision alarm is triggered within the entire trajectory execution cycle, the obstacle avoidance effectiveness is determined to meet the requirements; the static obstacles include tooling tables, cable supports and peripheral equipment.
[0054] S63. Synchronously collect the time-series data of angular velocity, angular acceleration and jerk of each joint of the robotic arm, and determine whether the absolute value of the jerk of all joints does not exceed the preset smoothness threshold. If they do not exceed the threshold, the motion smoothness is deemed to meet the requirements.
[0055] S64. When the preset conditions of obstacle avoidance effectiveness in step S62 and motion smoothness in step S63 are met, the optimal pose trajectory of the robotic arm is confirmed as a valid and feasible solution. The trajectory parameters of the optimal pose trajectory of the robotic arm are exported into a TP program format specific to the robotic arm and deployed to the physical robotic arm control system.
[0056] A second aspect of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement any step in the robotic arm pose trajectory optimization method based on digital twin and PSO-polynomial interpolation as described in the first aspect.
[0057] A third aspect of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a computer processor, implements any step in the robotic arm pose trajectory optimization method based on digital twin and PSO-polynomial interpolation as described in the first aspect.
[0058] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0059] (1) The present invention uses fifth-order polynomial interpolation in a six-degree-of-freedom joint space and forces the starting and ending point velocities and accelerations to be zero. Only six boundary conditions are needed to analytically solve all coefficients. Under the premise of ensuring the continuity of position, velocity and acceleration, the computational complexity can be significantly reduced. Therefore, the present invention can effectively suppress mechanical impact and cable sway, and can control the time of single trajectory generation to the millisecond level, thus taking into account both the smoothness and real-time performance of the robotic arm.
[0060] (2) Because existing robotic arm optimization algorithms are prone to getting trapped in local optima during trajectory parameter search, and most optimization models do not fully embed the physical constraints of the robotic arm (such as joint limits and speed limits), the output "optimal trajectory" is not executable on real devices and requires repeated rework and debugging. This invention constructs a multi-objective optimization function that integrates total time, smoothness penalty and constraint violation terms, and introduces a perturbation strategy and boundary clipping mechanism based on linear interpolation in the PSO particle initialization stage. This ensures that all candidate solutions are always within the physical feasible region, effectively improving the optimization success rate of the robotic arm. The generated trajectory can be directly deployed on the FANUC controller, avoiding the disconnect between offline optimization and online execution.
[0061] (3) Traditional trajectory verification relies on the trial operation of physical robotic arms. If the trajectory design is unreasonable, it may lead to a prolonged cycle time or even equipment collision, posing safety hazards and a long verification cycle. This invention imports the optimal pose trajectory of the robotic arm into a high-fidelity digital twin virtual model and completes the pre-verification in the virtual space through the dual judgment mechanism of real-time collision detection and accelerometer threshold built into the three-dimensional simulation platform. This can effectively eliminate the risk of physical trial and error, shorten the single verification time from hours to minutes, and significantly improve the deployment efficiency of the production line.
[0062] (4) Since the trajectory generated by manual teaching only satisfies geometric reachability and lacks active optimization of motion performance, it is difficult to adapt to high-speed and high-precision operation scenarios and is highly dependent on the experience of operators. This invention can automate and intelligently generate the trajectory through a closed-loop process of "virtual teaching-intelligent optimization-simulation verification". Ordinary engineers only need to complete one virtual teaching to obtain a high-performance trajectory, thereby greatly reducing the dependence on senior programmers. It is particularly suitable for flexible manufacturing scenarios with multiple varieties and small batches. In summary, this invention can reduce the number of manual teachings, effectively improve the efficiency of manual teaching, and realize the automatic generation and pre-verification of robotic arm operation trajectories with high smoothness, high timeliness and high safety. Attached Figure Description
[0063] Figure 1 This is a flowchart illustrating the process of optimizing and verifying the robotic arm trajectory in Example 1.
[0064] Figure 2 This is a flowchart illustrating the robotic arm trajectory optimization process in Example 1. Detailed Implementation
[0065] The present invention will be further illustrated by specific embodiments below, but this does not limit the scope of the invention.
[0066] Example 1
[0067] A method for optimizing the pose trajectory of a robotic arm based on digital twin and PSO-polynomial interpolation, such as Figure 1-2 As shown, the robotic arm described in this embodiment is an industrial robot with six rotary joints. Its end effector has six degrees of freedom in three-dimensional space, enabling control of any position and orientation. The robotic arm described in this embodiment is suitable for trajectory generation and verification of industrial robots with six rotary joints in a work scenario, including the following steps:
[0068] S1. Acquisition and calibration of physical characteristic parameters.
[0069] First, measure the mounting diameter of the robotic arm base and the geometric length of each link in the actual working environment. The geometric length includes the dimensions of the robotic arm's upper arm, lower arm, and end flange. Record the external dimensions, mounting coordinates, and spatial orientation of the tooling table. At the same time, obtain the kinematic parameters of each joint angle limit, maximum angular velocity, and maximum angular acceleration from the robotic arm's factory technical parameters. Compare the measured data with the factory technical parameters, calibrate any parameters with deviations, and ensure that the calibration parameters used in subsequent modeling are consistent with the physical entity.
[0070] S2. Construct a high-fidelity digital twin virtual model.
[0071] Based on the calibrated parameters, a general 3D geometric model (such as STEP format) of the robotic arm and peripheral equipment is imported into the 3D simulation platform to construct a digital twin virtual model that matches the physical working unit 1:1. Through the joint constraint module provided by the platform, the motion range of the six rotary joints of the robotic arm is set, and the spatial layout relationship of the tooling table, cable bracket and other static obstacles is reproduced to form a digital mirror containing complete kinematic constraints and geometric interference information.
[0072] S3. Virtual manual teaching generates the initial teaching trajectory.
[0073] In the digital twin virtual model, the real working conditions are simulated. The operator guides the virtual robotic arm end effector to move along the desired path through the human-machine interface. The system automatically records the key pose points and their corresponding six-joint angle sequences to generate the initial teaching trajectory. This initial teaching trajectory only guarantees geometric reachability and does not consider motion smoothness and timeliness.
[0074] S4. Extraction of pose trajectory data.
[0075] Using a data acquisition module, the running data of the entire initial teaching trajectory is read at fixed time intervals (e.g., 10 ms) and exported as a structured data file (e.g., CSV format). Each record contains a timestamp, the spatial coordinates (X, Y, Z) of the end effector, and the attitude angle (R). x R y R z And the angle values of the six joints J1, J2, J3, J4, J5, J6.
[0076] Trajectory optimization using S5, PSO, and fifth-order polynomial interpolation algorithms; based on the pose trajectory data acquired in step S4, the following optimization process is performed:
[0077] S51. Trajectory Segmentation and Modeling: Divide the motion between adjacent key points into independent trajectory segments; for each segment, introduce two adjustable intermediate transition points. Each trajectory segment is divided into three continuous sub-trajectories, forming a four-point sequence. Therefore, it is divided into three continuous sub-trajectories, which are as follows: the first segment starts from... arrive The second paragraph begins arrive And the third paragraph from arrive For each sub-trajectory, a fifth-order polynomial is used for parametric modeling in the six-degree-of-freedom joint space.
[0078] The robotic arm Each joint in normalized time The angle below is expressed as:
[0079]
[0080] Wherein, coefficient vector The coefficient vector is uniquely determined by the boundary conditions of the sub-trajectory.
[0081] Setting dynamic boundary conditions: The velocity and acceleration at the start and end points of the entire trajectory segment between two key points are set to zero; for intermediate points, the velocity is dynamically calculated based on the current optimization variables.
[0082] The estimated velocity at the end of the first segment of the trajectory is:
[0083] .
[0084] The estimated velocity at the end of the second sub-trajectory is:
[0085] .
[0086] in, This indicates the adjustable intermediate transition point 1, which is the end point of the first sub-trajectory segment; This indicates the adjustable intermediate transition point 2, which is the end point of the second sub-trajectory segment; Indicates the starting point of the trajectory segment; Indicates the end point of the trajectory segment.
[0087] The above velocity estimates are used as velocity boundary conditions for the corresponding sub-trajectory endpoints, and are used to analytically solve the fifth-order polynomial coefficients to ensure the velocity continuity of the three trajectory segments at the connection point.
[0088] S52. Determine the optimization variables and construct a multi-objective optimization function with minimizing the total running time as the core, while also considering motion smoothness and constraint feasibility.
[0089] The multi-objective optimization function is:
[0090] ;
[0091] in, This represents the total running time of the trajectory. This is a smoothness penalty term used to suppress abrupt changes in joint acceleration, and is taken as the sum of the square integrals of the accelerations of each segment; To constrain violations of penalties, positive penalties are imposed on behaviors that exceed joint limits, speed / acceleration limits, or intrude into obstacle areas; This is a weighting coefficient used to balance timeliness, smoothness, and feasibility.
[0092] S53. Constructing an optimization model: Based on the multi-objective optimization function in step S52, the PSO (Particle Swarm Optimization) algorithm is used to perform a global search for the positions of the two intermediate adjustable transition points and the time of each segment trajectory. By initializing the particle swarm within the physical feasible region, iteratively executing speed and position updates, and evaluating the fitness according to the multi-objective optimization function, the global optimal particle is finally output, generating the optimal pose trajectory of the robotic arm that meets the requirements of smoothness, timeliness, and safety.
[0093] The trajectory parameters to be optimized in the fifth-order polynomial trajectory model are integrated into a 15-dimensional decision vector for each particle. A complete set of candidate solutions for trajectory parameters is represented by the following dimensional structure:
[0094] ;
[0095] in, For the first The running time of the three sub-trajectories corresponding to each particle; For the first The joint angle vectors of the two adjustable intermediate transition points corresponding to each particle; superscript Used to distinguish different particles T represents the vector transpose.
[0096] PSO Global Search: Initialize the particle swarm within a feasible region that satisfies physical constraints, and perform various time intervals within the region. Within the adjustable intermediate transition point, the joint angle is clipped to the joint limit range after being superimposed with the linear interpolation result and a random perturbation vector. The standard PSO update rule is used for iterative search until convergence, and the globally optimal particle is output, that is, the globally optimal trajectory parameters are output, thus obtaining the optimal pose trajectory of the robotic arm.
[0097] S6. Digital Twin Pre-Verification and Deployment: Import the optimal pose trajectory of the robotic arm into the digital twin virtual model constructed in the 3D simulation platform in step S2. Drive the 3D geometric model of the virtual robotic arm in the digital twin virtual model to reproduce the complete motion process of the optimal pose trajectory of the robotic arm. Verify the smoothness of the optimal pose trajectory of the robotic arm and the effectiveness of obstacle avoidance in the working scenario through visualization simulation, and realize the pre-verification of the execution effect of the physical trajectory by the digital twin environment.
[0098] The simulation verification steps include:
[0099] S61. Import the optimal pose trajectory of the robotic arm generated in step S5 into the digital twin virtual model built on the three-dimensional simulation platform, and drive the virtual robotic arm model to completely reproduce the motion process of the optimal pose trajectory of the robotic arm.
[0100] S62. During the simulation operation, the real-time collision detection module built into the 3D simulation platform is invoked to monitor the geometric interference between each link of the robotic arm and the preset static obstacles (tooling table, support, etc.) in the work scene; if no collision alarm is triggered within the entire trajectory execution cycle, the obstacle avoidance effectiveness is determined to meet the requirements; the static obstacles include tooling table, cable support and peripheral equipment.
[0101] S63. Synchronously collect the time-series data of angular velocity, angular acceleration and jerk of each joint of the robotic arm, and determine whether the absolute value of the jerk of all joints does not exceed the preset smoothness threshold. If they do not exceed the threshold, the motion smoothness is deemed to meet the requirements.
[0102] S64. When the preset conditions of obstacle avoidance effectiveness in step S62 and motion smoothness in step S63 are met, the optimal pose trajectory of the robotic arm is confirmed as a valid and feasible solution. Finally, the optimal pose trajectory of the robotic arm is converted into a standard instruction format supported by the robot controller and deployed to the physical robotic arm to perform actual operations.
[0103] Example 2
[0104] An electronic device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement any step in the robotic arm pose trajectory optimization method based on digital twin and PSO-polynomial interpolation as described in Embodiment 1.
[0105] Furthermore, the process of the robotic arm pose trajectory optimization method based on digital twin and PSO-polynomial interpolation described in Embodiment 1 can be implemented as a computer software program. For example, this embodiment includes a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the method. In such an embodiment, the computer program can be downloaded and installed from a network, and / or installed from a removable medium. When the computer program is executed by a processor, it performs the functions defined in the method of this application.
[0106] Example 3
[0107] A computer-readable storage medium storing a computer program that, when executed by a processor, implements any step in a method for optimizing the pose trajectory of a robotic arm based on digital twins and PSO-polynomial interpolation as described in Embodiment 1.
[0108] The computer-readable medium described in this application may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0109] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Python and C++, as well as conventional procedural programming languages or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0110] In this embodiment, the computer-readable storage medium can be accelerated using hardware such as a GPU. The parallel computing advantage of the GPU is used to accelerate any step in the implementation of a robotic arm pose trajectory optimization method based on digital twin and PSO-polynomial interpolation as described in Embodiment 1.
[0111] In summary, this invention effectively overcomes the shortcomings of the prior art and has high industrial applicability. The above embodiments are intended to illustrate the substantive content of this invention, but are not intended to limit the scope of protection of this invention. Those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of this invention without departing from the essence and scope of protection of this invention.
[0112] The above embodiments are specific implementations of the present invention, but the implementation of the present invention is not limited to the above embodiments. Any other combination, change, modification, substitution, or simplification that does not exceed the design concept of the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for optimizing the pose trajectory of a robotic arm based on digital twin and PSO-polynomial interpolation, characterized in that, Includes the following steps: S1. Collect the physical characteristic parameters of the robotic arm and the specific working scene, and complete the parameter verification and calibration according to the technical parameters of the robotic arm to obtain the calibration parameters; S2. Based on the calibration parameters, construct a digital twin virtual model that matches the robotic arm's working unit using a 3D simulation platform; S3. Simulate the actual working conditions of the robotic arm based on the digital twin virtual model, perform manual teaching operations on the 3D geometric model of the robotic arm in the digital twin virtual model, and generate the initial teaching trajectory of the robotic arm in the working scenario. S4. Use a data acquisition module to read the pose trajectory data of the robotic arm in the digital twin virtual model during the entire initial teaching trajectory operation process; S5. Based on PSO and fifth-order polynomial interpolation algorithm, a trajectory optimization model is constructed to generate the optimal pose trajectory of the robotic arm based on the pose trajectory data. S6. Import the optimal pose trajectory of the robotic arm into the digital twin virtual model built on the 3D simulation platform, and verify the optimal pose trajectory of the robotic arm through visualization simulation.
2. The robotic arm pose trajectory optimization method based on digital twin and PSO-polynomial interpolation according to claim 1, characterized in that, In step S5, the optimization logic of the PSO and the fifth-order polynomial interpolation algorithm is as follows: S51. Based on the initial teaching trajectory, obtain the trajectory key points that the robotic arm must reach the target work point. Divide the trajectory segments and sub-trajectories based on the trajectory key points, introduce adjustable intermediate transition points, and use a fifth-order polynomial to parametrically model each sub-trajectory to obtain a fifth-order polynomial trajectory model. Solve the polynomial coefficients through boundary conditions. Smoothly splice the sub-trajectories to form the entire multi-segment trajectory, the shape of which is uniquely determined by a specific variable. S52. Construct a multi-objective optimization function; S53. The PSO algorithm is used to perform a global search for intermediate transition points and each sub-trajectory segment; the particle swarm is initialized, the speed and position are updated iteratively, and the fitness is evaluated based on the multi-objective optimization function. Finally, the globally optimal particle is output to generate the optimal pose trajectory of the robotic arm.
3. The robotic arm pose trajectory optimization method based on digital twin and PSO-polynomial interpolation according to claim 2, characterized in that, In step S51, The steps for parametric modeling and polynomial coefficient solving of each sub-trajectory using a fifth-order polynomial are as follows: Each sub-trajectory segment is parametrically modeled using a fifth-order polynomial in a six-degree-of-freedom joint space; the robotic arm's... Each joint in normalized time The angle below is expressed as: Wherein, coefficient vector The coefficient vector is uniquely determined by the boundary conditions of the sub-trajectory.
4. The robotic arm pose trajectory optimization method based on digital twin and PSO-polynomial interpolation according to claim 3, characterized in that, In step S51, two adjustable intermediate transition points ( The velocity estimate is based on the running time of the three sub-trajectories corresponding to the current particle in each iteration of the PSO algorithm. and adjustable intermediate transition point position Dynamic calculations are performed, specifically: The estimated velocity at the end of the first segment of the trajectory is: ; The estimated velocity at the end of the second sub-trajectory is: ; in, This indicates the adjustable intermediate transition point 1, which is the end point of the first sub-trajectory segment; This indicates the adjustable intermediate transition point 2, which is the end point of the second sub-trajectory segment; Indicates the starting point of the trajectory segment; Indicates the end point of the trajectory segment.
5. The robotic arm pose trajectory optimization method based on digital twin and PSO-polynomial interpolation according to claim 2, characterized in that, In step S52, the multi-objective optimization function is: ; in, This represents the total running time of the trajectory. This is a smoothness penalty term; To constrain violations and penalties; These are the weighting coefficients.
6. The method for optimizing the pose trajectory of a robotic arm based on digital twin and PSO-polynomial interpolation according to claim 2, characterized in that, In step S53, the particle encoding method of the PSO algorithm is as follows: the trajectory parameters to be optimized in the fifth-order polynomial trajectory model are integrated into a decision vector, and each particle... A complete set of candidate solutions for trajectory parameters is represented by the following dimensional structure: ; in, For the first The running time of the three sub-trajectories corresponding to each particle; For the first The joint angle vectors of the two adjustable intermediate transition points corresponding to each particle; superscript Used to distinguish different particles T represents the vector transpose.
7. The method for optimizing the pose trajectory of a robotic arm based on digital twin and PSO-polynomial interpolation according to claim 6, characterized in that, In step S53, the initial particle swarm is generated as follows: the PSO algorithm is used to perform a global search on the decision variables; the initial particle swarm is generated within the feasible region that satisfies the physical constraints; the joint angles of the two adjustable intermediate transition points are based on the linear interpolation results from the start point to the end point, respectively superimposed with a uniformly distributed 6-dimensional random perturbation vector, and forced to be within the joint limit range through a pruning operation, that is: ; ; in, and It is a 6-dimensional random perturbation vector; clip(⋅) means limiting the joint angle to a preset minimum value element by element. With the maximum value between; The iterative update rule for particle velocity and position is as follows: during the iteration process, the velocity and position of each particle evolve according to the standard particle swarm optimization update rule; ; ; Where w is the inertia weight, and For learning factors; and The independently generated uniform random numbers in the interval [0,1]; This represents the historical best position of the i-th particle up to the g-th generation; The current global optimal position of the population; after each position update, boundary pruning is performed on the time component and the joint angle component respectively; Let be the search direction and step size of the i-th particle in the g-th generation, and each of its dimensional components corresponds to the update increment of the joint angle; Let be the current position vector of the i-th particle in the g-th generation.
8. The method for optimizing the pose trajectory of a robotic arm based on digital twin and PSO-polynomial interpolation according to claim 1, characterized in that, In step S6, the simulation verification steps include: S61. Import the optimal pose trajectory of the robotic arm into the digital twin virtual model built on the three-dimensional simulation platform, and drive the virtual robotic arm model to completely reproduce the motion process of the optimal pose trajectory of the robotic arm. S62. Call the real-time collision detection module built into the 3D simulation platform to perform geometric interference monitoring between each link of the robotic arm and the preset static obstacles in the work scene; if no collision alarm is triggered during the entire trajectory execution cycle, the obstacle avoidance effectiveness is determined to meet the requirements. S63. Synchronously collect the time-series data of angular velocity, angular acceleration and jerk of each joint of the robotic arm, and determine whether the absolute value of the jerk of all joints does not exceed the preset smoothness threshold. If they do not exceed the threshold, the motion smoothness is deemed to meet the requirements. S64. When the preset conditions for obstacle avoidance effectiveness and motion smoothness are met, the optimal pose trajectory of the robotic arm is confirmed as an effective and feasible solution.
9. An electronic device, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements any step in the robotic arm pose trajectory optimization method based on digital twin and PSO-polynomial interpolation as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a computer processor, implements any step in the robotic arm pose trajectory optimization method based on digital twin and PSO-polynomial interpolation as described in any one of claims 1-8.