A robot arm trajectory tracking control method and robot arm
By performing physical modeling and kinematic analysis on the robotic arm, combined with the 3-5-3 polynomial interpolation method and reinforcement learning algorithm, the motion trajectory of the robotic arm is optimized, which solves the problem of poor accuracy of the existing robotic arm's motion trajectory and achieves efficient trajectory tracking control.
Patent Information
- Application Number
- CN202411248152.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-09-06
AI Technical Summary
The existing robotic arm motion trajectory has poor accuracy and is easily affected by external interference and wear and aging in actual environments, resulting in frequent debugging and low work efficiency.
By physically modeling the robotic arm, using the DH method for kinematic analysis, adopting the 3-5-3 polynomial interpolation method for trajectory planning, and combining the reinforcement learning algorithm for trajectory tracking control, the motion trajectory of the robotic arm is optimized.
The accuracy and stability of the robot arm's motion trajectory are achieved, and the motion trajectory can be adjusted and optimized in a timely manner to ensure that it meets the preset requirements in actual applications, thereby improving work efficiency.
Smart Images

Figure CN119238493B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automated mechanical technology, and in particular to a robot arm trajectory tracking control method and a robot arm. Background Art
[0002] The robotic arm is a key component of industrial robots. With the advent of Industry 4.0, the application of industrial robots is becoming more and more common. In order to enable industrial robots to accurately perform preset work content, the operating accuracy of the robotic arm is one of the important design parameters.
[0003] At present, six-axis robotic arms are commonly used to improve the flexibility of robotic arms in automated production. However, it is necessary to ensure that the motion trajectory of the robotic arm conforms to the preset planned trajectory in order to ensure that the robotic arm can perform operations accurately. The setting of the existing robotic arm motion trajectory is usually manually programmed according to the environmental characteristics and the inherent characteristics of the robotic arm. However, there are a lot of external interferences in the actual working environment, which causes a certain deviation between the actual motion trajectory of the robotic arm and the motion trajectory set by manual programming; in addition, when the robotic arm is worn and aged, it will also affect the accuracy of its actual motion trajectory. Therefore, after manual programming, it is currently necessary to frequently correct and optimize the programming according to the movement performance of the robotic arm in the actual environment, which not only increases the workload of personnel debugging, but also leads to low working efficiency of the robotic arm. Summary of the Invention
[0004] The object of the present invention is to provide a robot arm trajectory tracking control method and a robot arm, so as to solve the problem of poor accuracy of the existing robot arm motion trajectory.
[0005] In order to solve the above technical problems, the present invention provides a robot arm trajectory tracking control method, comprising:
[0006] Perform physical modeling on the robotic arm to obtain a robotic arm model;
[0007] Perform kinematic analysis on the robotic arm model based on the DH method to optimize the robotic arm model;
[0008] The trajectory planning of the preset points of the optimized robotic arm model is performed using the 3-5-3 degree polynomial interpolation method;
[0009] Reinforcement learning algorithm is used to track and control the planned trajectory.
[0010] Optionally, in the robot arm trajectory tracking control method, the method of physically modeling the robot arm to obtain the robot arm model includes:
[0011] Use NX software to build a 3D model of the six-axis robotic arm and define the joint types and range of motion;
[0012] Configuring constraints for the six-axis robotic arm, including the relationships, angles, velocities, and accelerations of the joints and links in the six-axis robotic arm;
[0013] Based on the three-dimensional model of the six-axis robotic arm, MCD modeling is performed according to the constraint conditions to obtain the robotic arm model.
[0014] Optionally, in the robot arm trajectory tracking control method, the method for performing kinematic analysis on the robot arm model based on the DH method includes:
[0015] Setting DH parameters, including joint angle, link offset, link length, and link torsion angle;
[0016] According to the set DH parameters, a DH parameter model is established in Matlab;
[0017] The forward and inverse kinematics analysis of the DH parameter model is performed to optimize the robotic arm model.
[0018] Optionally, in the robot arm trajectory tracking control method, the method of performing forward and inverse kinematic analysis on the DH parameter model includes:
[0019] Perform spatial coordinate transformation according to DH parameters to obtain the coordinate transformation relationship between adjacent links of the robotic arm;
[0020] According to the coordinate transformation relationship between adjacent links, forward kinematics analysis is performed to obtain the pose matrix of the end effector of the robotic arm;
[0021] Using the DH parameter model, the inverse kinematics analysis of the end effector of the robotic arm is performed to obtain the angle of the joint.
[0022] Optionally, in the robot arm trajectory tracking control method, the method of performing trajectory planning on the preset set points of the optimized robot arm model using a 3-5-3 degree polynomial interpolation method includes:
[0023] Obtain the relationship information between the links and joints of the optimized robotic arm model;
[0024] Based on the quantum particle swarm algorithm and 3-5-3 degree polynomial interpolation method, the optimal time for each joint to move at a preset point while satisfying the constraint conditions is obtained;
[0025] Get the maximum time of all joints moving at the preset points and sum them up to get the longest movement time;
[0026] The longest motion time is processed using the 3-5-3 degree polynomial interpolation method to obtain the motion trajectory of each joint;
[0027] The time-optimal trajectory planning of the robot end effector is obtained using forward kinematics analysis.
[0028] Optionally, in the robot arm trajectory tracking control method, the method for obtaining relationship information between the links and joints of the optimized robot arm model includes:
[0029] Construct 3-5-3 spline interpolation;
[0030] Obtaining fixed points of the joint during the movement, wherein the fixed points include an initial point, a first intermediate point, a second intermediate point, and an end point;
[0031] Using 3-5-3 spline interpolation, the relationship between motion coefficients and interpolation points is obtained through fixed points;
[0032] According to the relationship between the fixed point, motion coefficient and interpolation point, the position and posture of the robot arm joint are obtained.
[0033] Optionally, in the robot arm trajectory tracking control method, the method for obtaining the optimal time for each joint to move at a preset point while satisfying the constraint conditions based on the quantum particle swarm algorithm and the 3-5-3 degree polynomial interpolation method includes:
[0034] Get the motion time of the robot arm joints in three trajectories;
[0035] Optimize the objective function of quantum particle swarm optimization algorithm;
[0036] The motion time of the three trajectories is used as the search space, and the position, velocity and acceleration of the particles are updated according to the objective function;
[0037] Based on the updated particle position, velocity, and acceleration, the optimal time for each joint to move at the preset point is obtained.
[0038] Optionally, in the robot arm trajectory tracking control method, the method of using a reinforcement learning algorithm to track and control the planned trajectory includes:
[0039] Set the robot arm parameters in MCD, including constraints between links, definition of rigid body, definition of collision body, kinematic joint constraints, position controller, velocity controller, material properties, and definition of posture;
[0040] Write PLC control program and establish communication between PLC and MCD;
[0041] Using reinforcement learning controller and PLC control program, a simulation demonstration based on MCD is performed to obtain the effect of robot arm trajectory tracking control.
[0042] In order to solve the above technical problems, the present invention also provides a robotic arm, which uses the robotic arm trajectory tracking control method according to any one of claims 1 to 8 to perform trajectory tracking control; the robotic arm includes multiple joints and connecting rods.
[0043] Optionally, in the robotic arm, the robotic arm is a six-axis robotic arm.
[0044] The present invention provides a robot arm trajectory tracking control method and a robot arm, comprising: performing physical modeling on the robot arm to obtain a robot arm model; performing kinematic analysis on the robot arm model based on the DH method to optimize the robot arm model; performing trajectory planning on preset points of the optimized robot arm model using a 3-5-3 degree polynomial interpolation method; and tracking and controlling the planned trajectory using a reinforcement learning algorithm. By performing kinematic analysis on the robot arm model, a model is prepared for subsequent trajectory planning, thereby ensuring the accuracy of subsequent trajectory planning; performing trajectory planning using the polynomial interpolation method can ensure that the motion trajectory of the end of the robot arm meets the preset requirements and can link the various joints and connecting rods of the robot arm; performing forward kinematic analysis again after the joint space trajectory planning is completed, the motion trajectory of the end effector of the robot arm can be obtained, facilitating subsequent analysis and optimization of the motion trajectory; and tracking and controlling the trajectory using a reinforcement learning algorithm can timely adjust and optimize the motion trajectory of the robot arm, thereby ensuring that the motion trajectory of the robot arm meets the preset requirements when it is actually used, thereby solving the problem of poor accuracy of the motion trajectory of the existing robot arm. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 Flowchart of the robot arm trajectory tracking control method provided in this embodiment;
[0046] Figure 2 A schematic diagram of the particle flight speed in the particle swarm algorithm provided in this embodiment;
[0047] Figure 3 This is a flow chart of the quantum particle swarm optimization time provided in this embodiment;
[0048] Figure 4 Schematic diagram of the PLCSIM Adv communication principle provided for this embodiment;
[0049] Figure 5 Schematic diagram of the open-loop simulation results of the robot arm end trajectory provided in this embodiment;
[0050] Figure 6 Schematic diagram of the Matrikon OPC communication method provided in this embodiment;
[0051] Figure 7 Schematic diagram of the closed-loop simulation results of the robot arm end trajectory provided in this embodiment. DETAILED DESCRIPTION
[0052] The following is a further detailed description of the robot arm trajectory tracking control method and the robot arm proposed in the present invention, in conjunction with the accompanying drawings and specific embodiments. It should be noted that the drawings are all in a very simplified form and are not in precise proportions, and are only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention. In addition, the structures shown in the drawings are often part of the actual structure. In particular, different drawings may need to be presented with different focuses and sometimes use different proportions.
[0053] It should be noted that the terms "first", "second", etc. in the specification, claims, and accompanying drawings of the present invention are used to distinguish similar objects in order to describe the embodiments of the present invention, and are not used to describe a specific order or sequence. It should be understood that the structures used in this way can be interchanged under appropriate circumstances. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or are inherent to these processes, methods, products, or apparatuses.
[0054] This embodiment provides a robot arm trajectory tracking control method, such as Figure 1 Shown, including:
[0055] S1, physically modeling the robotic arm to obtain a robotic arm model;
[0056] S2, perform kinematic analysis on the robotic arm model based on the DH method to optimize the robotic arm model;
[0057] S3, using 3-5-3 degree polynomial interpolation method to perform trajectory planning for the preset points of the optimized robotic arm model;
[0058] S4 uses reinforcement learning algorithm to track and control the planned trajectory.
[0059] The robot arm trajectory tracking control method provided in this embodiment performs kinematic analysis on the robot arm model to prepare a model for subsequent trajectory planning and ensure the accuracy of subsequent trajectory planning; performs trajectory planning through polynomial interpolation method, which can ensure that the motion trajectory of the end of the robot arm meets the preset requirements and can link the various joints and connecting rods of the robot arm; by performing positive kinematic analysis again after the joint space trajectory planning is completed, the motion trajectory of the end effector of the robot arm can be obtained, which is convenient for subsequent analysis and optimization of the motion trajectory; tracks and controls the trajectory through reinforcement learning algorithm, which can timely adjust and optimize the motion trajectory of the robot arm, thereby ensuring that the motion trajectory of the robot arm meets the preset requirements when it is actually used, and solves the problem of poor accuracy of the existing robot arm motion trajectory.
[0060] Specifically, in this embodiment, in step S1, the method of physically modeling the robotic arm to obtain the robotic arm model includes:
[0061] S11, use NX software to build a three-dimensional model of the six-axis robotic arm and define the joint type and range of motion.
[0062] NX is a fully integrated computer-aided design, manufacturing, and engineering analysis software widely used in industrial design, robotics, and manufacturing. It helps users achieve efficient and innovative operations throughout the entire process, from conception to design, verification, and manufacturing. NX also includes an MCD module, allowing engineers to consider the influence of multiple disciplines and various factors during the design process, such as friction, workspace, structural strength, and fluid dynamics. This effectively reduces the workload involved in both initial calculations and subsequent modifications and redesigns.
[0063] The specific implementation method of using NX software to establish a three-dimensional model of a six-axis robotic arm can be obtained through existing technology in this field. The structure and style of the established six-axis robotic arm can also be designed according to subsequent actual needs, and this application does not impose any restrictions on this.
[0064] In this embodiment, the joint types are divided into rotational joints and linear motion joints; the range of motion can be reasonably set according to the joint type and actual usage requirements. For example, when the joint is a rotational joint, its range of motion should be the angle; when the joint is a linear motion joint, its range of motion should be the direction and distance of the linear motion.
[0065] S12, configuring the constraint conditions of the six-axis robotic arm, wherein the constraint conditions include the relationship, angle, speed and acceleration of each joint and link in the six-axis robotic arm.
[0066] Specifically, in practical applications, constraints such as the relationship, angle, speed, and acceleration of each joint and link should be range values to ensure that the six-axis robotic arm moves within a certain range.
[0067] S13, based on the three-dimensional model of the six-axis robotic arm, MCD modeling is performed according to the constraint conditions to obtain a robotic arm model.
[0068] Specifically, the method of MCD modeling based on the set constraints mainly includes: first, connecting the parts of the robot arm according to the constraints and the relationship between the parts; second, using a hinge pair to determine the rotation axis, and verifying the correctness of the robot arm link movement through the gripper; then establishing controllers such as position control and speed control, and setting the range of each axis rotation angle, speed, and acceleration.
[0069] This embodiment establishes a three-dimensional model of a six-axis robotic arm based on NX software, and establishes an MCD model on this basis to implement hard limits on the robotic arm joint link relationship, angle, speed, and acceleration, paving the way for subsequent trajectory planning and control.
[0070] Furthermore, in this embodiment, step S2, the method of performing kinematic analysis on the robot arm model based on the DH method includes:
[0071] S21, setting DH parameters, wherein the DH parameters include joint angle, link offset, link length and link torsion angle.
[0072] Generally, the robot DH coordinate system is established by determining the coordinate systems x, y and z axes respectively. This embodiment adopts standard DH parameter modeling, so the coordinate system of the joint after the connecting rod is used as its fixed coordinate system.
[0073] In a specific embodiment, the DH parameters are as shown in Table 1:
[0074]
[0075] Table 1. DH parameters
[0076] S22, establishing a DH parameter model in Matlab according to the set DH parameters.
[0077] The method of establishing the DH parameter model using Matlab is well known to those skilled in the art and will not be described in detail in this application.
[0078] S23, perform forward and inverse kinematics analysis on the DH parameter model to optimize the robotic arm model.
[0079] Specifically, in this embodiment, first, a spatial coordinate transformation is performed based on the DH parameters to obtain the coordinate transformation relationship between adjacent links of the robot arm. At this time, the homogeneous transformation matrix is obtained:
[0080]
[0081] Expand the above formula and get:
[0082]
[0083] Then, based on the coordinate transformation relationship between adjacent links, a forward kinematic analysis is performed to obtain the pose matrix of the end effector of the manipulator. Specifically, the homogeneous transformation matrices are multiplied to obtain the pose matrix of the end effector relative to the base coordinate system:
[0084]
[0085] The attitude matrix in the reference coordinate system is represented by the first 3 rows and 3 columns, n x , n y , x z Represents the x-axis direction vector of the end effector; o x , o y , o z Represents the y-axis direction vector of the end effector, a x , a y , a z The end effector shows the z-axis direction vector; p x , p y , p z Represents the position of the end effector in the reference coordinate system. Using the above formula, the pose matrices of each joint are multiplied to obtain the pose of the end effector. This process is called forward kinematics.
[0086] Afterwards, the DH parameter model is used to perform inverse kinematics analysis on the end effector of the manipulator to obtain the joint angles. Specifically, in the trajectory planning of a six-degree-of-freedom manipulator between four points, the pose matrix of the end effector at the four points is obtained through forward and inverse kinematics analysis as follows:
[0087]
[0088]
[0089] Then, the inverse kinematics analysis of the four-point pose matrix is performed using the DH parameter model to obtain the joint angles at the four points, as shown in Table 2:
[0090]
[0091] Table 2. Angle interpolation points in joint space
[0092] Furthermore, in this embodiment, in step S3, the method of performing trajectory planning on the preset points of the optimized robotic arm model using the 3-5-3 degree polynomial interpolation method includes:
[0093] S31, obtaining relationship information between the connecting rods and joints of the optimized robotic arm model.
[0094] Existing trajectory planning schemes usually use cubic polynomial interpolation or quintic polynomial interpolation. However, the trajectory planning effects of these two methods are less than ideal: although cubic polynomial interpolation is simple and easy to use, and the amount of calculation is not large, the angular acceleration curve of the joint is discontinuous and has discontinuities during point-to-point motion. Therefore, the speed control on the precise operation path is not ideal, which can easily cause large impacts and vibrations, shortening the life of the robot arm; although quintic polynomial interpolation can ensure that the angular acceleration at the path connection during the point-to-point motion of the robot arm is continuous, if the acceleration is not planned properly, the oscillation amplitude is likely to be too large, affecting the life of the joint and not conducive to the control of the joint angular velocity.
[0095] Based on this, this embodiment adopts the 3-5-3 spline trajectory interpolation method, which combines the advantages of cubic polynomials and quintic polynomials to make the robot arm run more smoothly.
[0096] Specifically, first, a 3-5-3 spline interpolation is constructed. In this embodiment, taking a six-degree-of-freedom robotic arm as an example, the 3-5-3 spline interpolation expression of its joint angle is as follows:
[0097]
[0098]
[0099]
[0100] in, represents the cubic polynomial interpolation of the first segment joint angle, The second segment joint angle quintic polynomial interpolation, The third segment joint angle is interpolated by cubic polynomial, whose first-order derivative and second-order inverse are angular velocity and angular acceleration respectively. , , , which represent the j-th coefficient of the first, second and third trajectory interpolation respectively.
[0101] Then, the fixed points of the joint during the movement are obtained, including the initial point, the first intermediate point, the second intermediate point and the end point. The condition for trajectory planning is that the speed and acceleration of the starting point and the end point are both 0, and the speed and acceleration values between the path points are not set to maintain continuity. It is known that each joint passes through four points: the initial point , first midpoint , the second midpoint , end point According to the above constraints, the motion coefficient a is derived ijThe relationship between and interpolation points is as follows:
[0102]
[0103]
[0104]
[0105] in, t i (i=1, 2, 3) represents the motion time of the robot arm joints in the three trajectories respectively.
[0106] at this time, A Each column of the matrix corresponds to a The acceleration of each row in the matrix. The angular displacement of the first cubic polynomial is the matrix A The first three rows of the matrix a The first row after multiplication; the -1 following it is the displacement of the starting point of the quintic polynomial, and the second row is the angular velocity; similarly, the -1 following it is the velocity of the starting point of the quintic polynomial, the third row is the acceleration, and the -2 following it is the acceleration of the quintic polynomial when time is 0. The same is true for rows 4 to 6, and rows 7 to 9 are the third segment, so there is no need to represent the displacement, velocity, and acceleration of the following segment when time is 0, so 1 or 2 is not subtracted. Rows 10 to 12 represent the displacement, velocity, and acceleration of the initial point at time zero, respectively. Substituting time 0 into the displacement, velocity, and acceleration equations can yield these three rows. Row 13 represents the displacement of the third segment of the trajectory, and it can be obtained by substituting time 0 into the displacement function of the first segment of the trajectory. Similarly, row 14 represents the displacement of the second segment of the trajectory, and it can be obtained by substituting time 0 into the displacement function of the second segment of the trajectory.
[0107] Afterwards, 3-5-3 spline interpolation is used to obtain the relationship between the motion coefficient and the interpolation point through fixed points.
[0108] Of course, in actual planning, trajectory planning between two points can also be used. For example, the starting and ending points of the first and third path segments can be interpolated using cubic polynomials to complete tasks such as transportation, and the speed and acceleration of the starting and ending points are set to 0.
[0109] Finally, the position and posture of the robotic arm joints are obtained based on the relationship between the fixed points, motion coefficients and interpolation points.
[0110] In practical applications, the relationship information may include not only the position and posture of the robot arm joints, but also the posture relationship between the robot arm joints and the robot arm links and the robot arm end effector. The posture relationship can be obtained by the forward and inverse kinematics analysis in step S2.
[0111] S32, based on the quantum particle swarm algorithm and 3-5-3 degree polynomial interpolation method, obtains the optimal time for each joint to move at a preset point while satisfying the constraint conditions;
[0112] Particle Swarm Optimization (PSO) is an intelligent global optimization algorithm. Each optimization problem is called a "particle", and all particles search in one dimension D. There are only two attributes in the particle swarm algorithm: speed V and position X. Speed represents the speed of individual movement, and position represents the direction of movement. Each particle is in a different initial position in the search space, and relies on continuous interaction to find the optimal solution. The particle flight speed can indicate the direction of the particle search. Each particle has a speed to determine the next flight direction. This speed is dynamically adjusted according to its own flight experience and the flight experience of the population. The optimal position encountered by particle pi itself is called p best , the optimal position that population g has encountered so far is called g best .
[0113] like Figure 2 As shown in the figure, when the particle swarm algorithm constrains the particle velocity, if the self-learning factor c1 is small, the global learning factor c2 is large, and the inertia weight w is large, it is beneficial to the global search, but the search is not fine enough and may miss the local optimal position in the space; if the self-learning factor c1 is large, the global learning factor c2 is small, and the inertia weight w is small, it is beneficial to the local search and can converge faster, but may ignore the global situation and miss the optimal solution.
[0114] To this end, this embodiment adopts the quantum particle swarm algorithm to utilize the parallelism of quantum computing and the intelligence of the particle swarm optimization algorithm, so that the search space of particles will be wider and prevent falling into the local optimal solution.
[0115] Specifically, the key to optimizing the time of 3-5-3 degree polynomial interpolation using quantum particle swarm optimization is to select the independent variable to be optimized. Figure 3 As shown in the figure, first, the motion time t1, t2, and t3 of the robot arm joints in the three trajectories are obtained as the search space, and the particle swarm search dimension is reduced to 3 dimensions, avoiding the complex calculation process.
[0116] Then, under the premise of satisfying the joint kinematic constraints, the objective function of the quantum particle swarm algorithm is optimized, and the optimized objective function is as follows:
[0117]
[0118]
[0119] Where ti1, ti2, and ti3 represent the motion time of the first, second, and third segments of the path, respectively, for the i-th joint. Because the robotic arm used in this embodiment has six degrees of freedom, i ranges from one to six. Vmaxi represents the maximum angular velocity of the i-th joint, and Amaxi represents the maximum angular acceleration of the i-th joint.
[0120] Next, the motion time of the three trajectories is used as the search space, and the particle position, velocity, and acceleration are updated according to the objective function. In practice, 100 particles are randomly generated within the three interpolation times. The acceleration coefficient is calculated using the formula of the 3-5-3 spline trajectory interpolation method based on the coordinates of the four points of the manipulator joint. The joint velocity and acceleration are constrained according to the first and second derivatives of the 3-5-3 spline trajectory interpolation expression. If the velocity and acceleration meet the constraints, the particle position and velocity are updated according to the objective function. If the velocity and acceleration do not meet the constraints, the particle's optimal time is modified, and the joint velocity and acceleration are constrained again according to the first and second derivatives of the 3-5-3 spline trajectory interpolation expression.
[0121] Finally, based on the updated particle position, velocity, and acceleration, the optimal time for each joint to move at the preset point is obtained. In practical applications, the optimal particle position and the optimal population position are updated based on the updated particle position, velocity, and acceleration; it is determined whether the convergence condition or the maximum number of iterations has been reached. If so, the maximum value of the running time of each joint in the three paths is selected as the optimal time. Otherwise, the motion coefficient a is calculated again based on the coordinates of the four points of the robot arm joint using the formula in the 3-5-3 spline trajectory interpolation method. ij .
[0122] S33, obtaining the maximum time of movement of all joints at the preset set points and summing them up to obtain the longest movement time.
[0123] Specifically, the sum of the maximum running times of the joints in the three path segments obtained in step S32 is taken as the final trajectory running time.
[0124] S34, using a 3-5-3 degree polynomial interpolation method to process the longest motion time to obtain the motion trajectory of each joint.
[0125] Among them, the method of using the 3-5-3rd order polynomial interpolation method to process the longest movement time to obtain the movement trajectory of each joint can refer to the content of the above-mentioned 3-5-3rd order polynomial interpolation method, and this application will not go into details about it.
[0126] S35, using forward kinematics analysis to obtain the time-optimal trajectory planning of the end effector of the robot arm.
[0127] Among them, the method of using forward kinematics analysis to obtain the time-optimal trajectory planning of the end effector of the robot arm can be referred to the content of the above-mentioned forward kinematics analysis, and this application will not elaborate on it again.
[0128] Furthermore, in this embodiment, in step S4, the method of using a reinforcement learning algorithm to track and control the planned trajectory includes:
[0129] S41, setting the parameters of the manipulator in the MCD, wherein the manipulator parameters include constraints between links, definition of rigid bodies, definition of collision bodies, kinematic joint constraints, position controllers, velocity controllers, material properties, and definition of postures.
[0130] Specifically, in this embodiment, setting the robot arm parameters in the MCD may further include:
[0131] Dynamic modeling in MCD mainly considers factors such as mass, inertia, gravity, friction and external loads to calculate the torque and force required by the joints to ensure the stability and performance of the robotic arm;
[0132] Also, electrical system integration design in MCD, which mainly includes integrating electrical components such as motors, sensors, and limit switches into the design of the robotic arm to analyze circuit behavior, verify the correctness of the design, and optimize performance;
[0133] Also, in MCD, thermal analysis can be added to ensure the reliability of the system in terms of thermal management, taking into account that electrical components generate heat during operation, and taking necessary heat dissipation measures;
[0134] And, in MCD, electromagnetic compatibility (EMC) analysis is used to analyze the electromagnetic interference that may be generated by electrical systems.
[0135] After setting the robot's parameters, virtual debugging is required. This process primarily involves setting input and output signals for interaction with the PLC in the MCD to control the robot's motion, and expressing the motion relationships through formulas. This embodiment uses three signal adapters, representing the controllers for the first, second, and third path segments, respectively. The PLC transmits time series data, which the MCD processes using polynomial interpolation.
[0136] S42, write the PLC control program and establish communication between the PLC and MCD.
[0137] Specifically, when writing a PLC control program, a timer, counter, and other devices are used in the PLC to write a time series code so as to sequentially transmit the first period, the second period, and the third period. The PLC program written in this embodiment is to track the optimal joint time trajectory that meets the constraint conditions. The optimal joint time trajectory function is derived by combining the PLC ladder diagram with the expression in the NX signal adapter, and ultimately achieves tracking control of the robot arm joint trajectory. The pseudo code of the PLC and NX related programs is shown in Table 3:
[0138]
[0139] Table 3. Pseudocode of PLC and NX joint program
[0140] When establishing communication, considering that NX MCD supports communication methods such as OPC UA, OPC DA, TCP, PROFINET, and PLCSIM Adv, in order to simulate the hardware behavior of the actual PLC as closely as possible, including processing time, terminals, and communication functions, this embodiment uses PLCSIM Adv for communication.
[0141] like Figure 4 As shown, the sequence simulator in MCD simulates the controller to achieve control effects, verifying the correctness of the logic to ensure correct operation in actual PLC operations. This is simple and straightforward. To simulate the behavior of actual PLC hardware as closely as possible in a virtual environment, this embodiment directly uses the PLCSIM Adv simulator (such as the S7-PLCSIM Advance advanced simulator), enabling the joint use of NX and PLC, achieving a seamless transition from design to automated control.
[0142] Specifically, the code is downloaded to the PLCSIM Advanced simulator; then, the corresponding virtual instance is added to the external signal configuration of NX MCD; finally, the signal mapping-related variables in MCD are used to link the PLC and NX MCD, simulating the joint simulation process of the robotic arm.
[0143] S43, using the reinforcement learning controller and PLC control program, a simulation demonstration is performed based on MCD to obtain the effect of robot arm trajectory tracking control.
[0144] Specifically, in this embodiment, in order to verify the open-loop control effect, Matlab and NX are first connected through the PLCSIMAdvance interface to obtain the planned trajectory; then a PLC program is written to output the time step, and NX uses the time step interpolation operation of each trajectory; finally, S7-PLCSIM Advance is used for communication, and joint debugging is performed on both NX and TIA portal. The open-loop control and the actual planned trajectory are shown in Figure 2. Figure 5 shown.
[0145] This embodiment combines the PLC and MCD for open-loop control to track the trajectory. Using PLC to debug the open-loop control of the robot's trajectory has two implications, including but not limited to the following: (1) For applications with lower precision requirements, open-loop control can meet basic motion control needs, such as simple handling and assembly. The PLC can control the robot's movements through a preset instruction sequence to achieve a predetermined trajectory. (2) Cost-effectiveness: Compared to closed-loop control systems, open-loop control systems have a simpler structure and lower cost. When high-precision control is not required, using PLC open-loop control is an economical choice.
[0146] However, if Figure 5 As shown in the figure, the green line is the desired trajectory, and the purple dotted line is the open-loop control trajectory. It can be seen that there is a significant deviation between the open-loop control trajectory and the desired trajectory. The disadvantage of open-loop control is that it cannot automatically correct deviations caused by load changes, mechanical errors, and environmental factors, resulting in poor stability of the open-loop system and an inability to automatically adjust to maintain stability. This may cause the system to oscillate or become unstable. In some applications that require high precision and safety, such as industrial automation, aerospace, or medical equipment, open-loop control may not be sufficient to ensure the safety and reliability of the operating space. Therefore, when faced with scenarios that require higher precision and better dynamic response, closed-loop control is usually a better choice.
[0147] To this end, this embodiment uses a reinforcement learning controller in Simulink to track and control the time-optimal trajectory of the robot arm planned by Matlab code, and combines NX MCD simulation to demonstrate the closed-loop effect of the robot arm trajectory tracking.
[0148] Specifically, in this embodiment, the Simulink module in Matlab 2022b is combined with NXMCD for joint simulation through the OPC interface, the trajectory is planned using Matlab code, a reinforced learning environment is established in Simulink, the intelligent agent is trained, and finally the optimal joint time trajectory is presented in NX MCD for tracking control effect.
[0149] DDPG (Deep Deterministic Policy Gradient for Reinforcement Learning) is implemented in Simulink. The specific method includes: first, using Matlab code to plan the time-optimal trajectory and save the data; then, creating a Simulink model, setting the simulation time and step size based on the maximum sum of the joint times of the three paths, the sampling frequency of NX and Simulink, and setting the environment for the robot arm joint trajectory tracking; then, defining the reward function module in Simulink, which involves how to compare the actual position of the robot arm with the target position; then defining the relevant parameters of the agent, including creating a neural network, including defining the Actor network, the Critc network, and setting the relevant parameters of the experience replay buffer, the learning factor, and the number of iterations, specifically written in Matlab code; then, defining training parameters, training the agent according to the possible range of changes in the robot arm joint angle, observing the changes in the reward function, and saving the trained agent after a certain number of iterations; finally, through the Matrikon OPC interface, the interface parameters in Simulink are matched to the signals in NX MCD, and the trajectory tracking control simulation is realized.
[0150] The Matrikon OPC communication method provided in this embodiment is as follows Figure 6 As shown, Matrikon-OPC provides a data subscription and publishing mechanism and can serve as a transit station for signal transmission between Matlab and NX. It can ensure data security and real-time performance, and can handle large amounts of concurrent data. Matrikon-OPC-Explorer can help users connect to local or remote OPC servers, view data sources on the server, and read, write, and monitor OPC values. Simulink has a dedicated OPC read and write module. In NX MCD, services can be configured through external signal adapters, and signal connections can be completed through signal mapping, including the input and output of joint angles and control signals for starting and stopping joint motion.
[0151] The time-optimal trajectory between four points based on 3-5-3 spline interpolation provided in this embodiment is tracked and controlled by a trained intelligent agent. The tracking control results in NX MCD are as follows: Figure 7 shown. Figure 7 In the figure, the green line is the expected trajectory, and the orange dotted line is the trajectory of the open-loop control. It can be seen that the overlap between the open-loop control trajectory and the expected trajectory is Figure 5 Compared with , it has better overlap.
[0152] This embodiment also provides a robotic arm, which performs trajectory tracking control using the robotic arm trajectory tracking control method described above; the robotic arm includes multiple joints and connecting rods.
[0153] In practical applications, the robotic arm may be a six-axis robotic arm.
[0154] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other. In addition, the different parts between the various embodiments can also be used in combination with each other, and the present invention is not limited to this.
[0155] The robot arm trajectory tracking control method and the robot arm provided in this embodiment include: performing physical modeling on the robot arm to obtain a robot arm model; performing kinematic analysis on the robot arm model based on the DH method to optimize the robot arm model; performing trajectory planning on the preset points of the optimized robot arm model using a 3-5-3 degree polynomial interpolation method; and tracking and controlling the planned trajectory using a reinforcement learning algorithm. By performing kinematic analysis on the robot arm model, a model is prepared for subsequent trajectory planning, thereby ensuring the accuracy of subsequent trajectory planning; performing trajectory planning using the polynomial interpolation method can ensure that the motion trajectory of the end of the robot arm meets the preset requirements and can link the various joints and connecting rods of the robot arm; performing forward kinematic analysis again after the joint space trajectory planning is completed, the motion trajectory of the end effector of the robot arm can be obtained, which is convenient for subsequent analysis and optimization of the motion trajectory; and tracking and controlling the trajectory using a reinforcement learning algorithm can timely adjust and optimize the motion trajectory of the robot arm, thereby ensuring that the motion trajectory of the robot arm meets the preset requirements when it is actually used, thereby solving the problem of poor accuracy of the motion trajectory of the existing robot arm.
[0156] The above description is only a description of the preferred embodiments of the present invention and does not limit the scope of the present invention. Any changes and modifications made by ordinary technicians in the field of the present invention based on the above disclosure shall fall within the scope of protection of the claims.
Claims
1. A robot arm trajectory tracking control method, characterized in that: include: Perform physical modeling on the robotic arm to obtain a robotic arm model; Perform kinematic analysis on the robotic arm model based on the DH method to optimize the robotic arm model; The trajectory planning of the preset points of the optimized robotic arm model is performed using the 3-5-3 degree polynomial interpolation method; Adopt reinforcement learning algorithm to track and control the planned trajectory; The method for performing trajectory planning on the preset points of the optimized robotic arm model using the 3-5-3 degree polynomial interpolation method includes: Obtain the relationship information between the links and joints of the optimized robotic arm model; Based on the quantum particle swarm algorithm and 3-5-3 degree polynomial interpolation method, the optimal time for each joint to move at a preset point while satisfying the constraint conditions is obtained; Get the maximum time of all joints moving at the preset points and sum them up to get the longest movement time; The longest motion time is processed using the 3-5-3 degree polynomial interpolation method to obtain the motion trajectory of each joint; Use forward kinematics analysis to obtain the time-optimal trajectory planning for the end effector of the robotic arm; The method for obtaining the relationship information between the connecting rods and joints of the optimized robotic arm model includes: Construct 3-5-3 spline interpolation; Obtaining fixed points of the joint during the movement, wherein the fixed points include an initial point, a first intermediate point, a second intermediate point, and an end point; Using 3-5-3 spline interpolation, the relationship between motion coefficients and interpolation points is obtained through fixed points; According to the relationship between fixed points, motion coefficients and interpolation points, the position and posture of the robot arm joints are obtained; The method for obtaining the optimal time for each joint to move at a preset point under the constraint condition while the relationship information is satisfied based on the quantum particle swarm algorithm and the 3-5-3 degree polynomial interpolation method includes: Get the motion time of the robot arm joints in three trajectories; Optimize the objective function of quantum particle swarm optimization algorithm; The motion time of the three trajectories is used as the search space, and the position, velocity and acceleration of the particles are updated according to the objective function; Based on the updated particle position, velocity, and acceleration, the optimal time for each joint to move between preset points is obtained.
2. The robot arm trajectory tracking control method according to claim 1, characterized in that: The method of physically modeling the robotic arm to obtain a robotic arm model includes: Use NX software to build a 3D model of the six-axis robotic arm and define the joint types and range of motion; Configuring constraints for the six-axis robotic arm, including the relationships, angles, velocities, and accelerations of the joints and links in the six-axis robotic arm; Based on the three-dimensional model of the six-axis robotic arm, MCD modeling is performed according to the constraint conditions to obtain the robotic arm model.
3. The robot arm trajectory tracking control method according to claim 1, characterized in that: The method for performing kinematic analysis on the robot arm model based on the DH method includes: Setting DH parameters, including joint angle, link offset, link length, and link torsion angle; According to the set DH parameters, a DH parameter model is established in Matlab; The forward and inverse kinematics analysis of the DH parameter model is performed to optimize the robotic arm model.
4. The robot arm trajectory tracking control method according to claim 3, characterized in that: The method for performing forward and inverse kinematic analysis on the DH parameter model comprises: Perform spatial coordinate transformation according to DH parameters to obtain the coordinate transformation relationship between adjacent links of the robotic arm; According to the coordinate transformation relationship between adjacent links, forward kinematics analysis is performed to obtain the pose matrix of the end effector of the robotic arm; Using the DH parameter model, the inverse kinematics analysis of the end effector of the robotic arm is performed to obtain the angle of the joint.
5. The robot arm trajectory tracking control method according to claim 2, characterized in that: The method for tracking and controlling the planned trajectory using a reinforcement learning algorithm includes: Set the robot arm parameters in MCD, including constraints between links, definition of rigid body, definition of collision body, kinematic joint constraints, position controller, velocity controller, material properties, and definition of posture; Write PLC control program and establish communication between PLC and MCD; Using reinforcement learning controller and PLC control program, a simulation demonstration based on MCD is performed to obtain the effect of robot arm trajectory tracking control.
6. A robotic arm, characterized in that: The robotic arm performs trajectory tracking control using the robotic arm trajectory tracking control method according to any one of claims 1 to 5.
7. The robotic arm according to claim 6, wherein: The robotic arm is a six-axis robotic arm.
Citation Information
Patent Citations
Mechanical arm track planning method and system based on self-adaptive genetic algorithm
CN110125927A
Self-adaptive trajectory planning method for mechanical arm
CN117773929A