Mechanical arm trajectory tracking control method and mechanical arm
Through physical modeling, DH kinematic analysis, 3-5-3-order polynomial interpolation method and reinforcement learning algorithm, the robotic arm trajectory control is optimized, and the problem of poor accuracy of robotic arm motion trajectory is solved, and the work efficiency and trajectory accuracy are improved. .
Patent Information
- Application Number
- CN202411248152.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-09-06
AI Technical Summary
The existing robotic arm movement trajectory is poorly accurate. Due to external interference and robotic arm wear, artificial programming needs frequent correction, which increases the commissioning workload and reduces work efficiency.
Through physical modeling, DH kinematic analysis, 3-5-3-order polynomial interpolation method trajectory planning and reinforcement learning algorithm, the robotic arm model and trajectory control are optimized to ensure trajectory accuracy and joint linkage.
It realizes accurate tracking and control of the movement trajectory of the robotic arm, reduces the need for manual correction, and improves work efficiency and the practical application accuracy of the robotic arm.
Smart Images

Figure CN119238493A_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 an industrial robot. 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 usually 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 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 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: Physically modeling the robotic arm to obtain a robotic arm model; Perform kinematic analysis on the robot model based on the DH method to optimize the robot model; The trajectory planning of the preset points of the optimized robot model is carried out using the 3-5-3 degree polynomial interpolation method; A reinforcement learning algorithm is used to track and control the planned trajectory.
[0006] Optionally, in the robot arm trajectory tracking control method, the method of physically modeling the robot arm to obtain the robot arm model includes: Use NX software to build a 3D model of a six-axis robotic arm and define the joint type and range of motion; Configuring constraints of the six-axis robot, wherein the constraints include the relationship, angle, speed and acceleration of each joint and connecting rod in the six-axis robot; 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.
[0007] 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: Setting DH parameters, wherein the DH parameters include 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 is performed on the DH parameter model to optimize the robot arm model.
[0008] Optionally, in the robot arm trajectory tracking control method, the method of performing forward and inverse kinematics analysis on the DH parameter model includes: Perform spatial coordinate transformation according to DH parameters to obtain the coordinate transformation relationship between adjacent links of the robot arm; According to the coordinate transformation relationship between adjacent links, forward kinematics analysis is performed to obtain the position matrix of the end effector of the robot arm; Using the DH parameter model, the inverse kinematics analysis of the end effector of the robot arm is performed to obtain the angles of the joints.
[0009] Optionally, in the robot arm trajectory tracking control method, the method of performing trajectory planning on the preset points of the optimized robot arm model using the 3-5-3 degree polynomial interpolation method includes: Obtain the relationship information between the connecting rods and joints of the optimized robotic arm model; Based on the quantum particle swarm algorithm and 3-5-3rd order polynomial interpolation method, the optimal time for each joint to move at a preset point under the condition of satisfying the constraint 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 polynomial interpolation method to obtain the motion trajectory of each joint; The forward kinematics analysis is used to obtain the time-optimal trajectory planning of the robot end effector.
[0010] Optionally, in the robot arm trajectory tracking control method, the method for obtaining the relationship information between the connecting rods and joints of the optimized robot arm model includes: Construct 3-5-3 spline interpolation; Acquire 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 the motion coefficient and the interpolation point is obtained through fixed points; According to the relationship between the fixed point, motion coefficient and interpolation point, the position and posture of the robot arm joint are obtained.
[0011] 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 under the constraint condition based on the quantum particle swarm algorithm and the 3-5-3 polynomial interpolation method includes: Get the motion time of the robot arm joints in three trajectories; Optimize the objective function of the quantum particle swarm 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; According to the updated particle position, velocity and acceleration, the optimal time for each joint to move at the preset point is obtained.
[0012] 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: Set the robot arm parameters in MCD, including constraints between links, rigid body definition, collision body definition, joint constraints, position controller, velocity controller, material properties, and posture definition; Write PLC control program and establish communication between PLC and MCD; Using 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.
[0013] In order to solve the above technical problems, the present invention also provides a robotic arm, which performs trajectory tracking control using the robotic arm trajectory tracking control method as described in any one of claims 1 to 8; the robotic arm includes multiple joints and connecting rods.
[0014] Optionally, in the robotic arm, the robotic arm is a six-axis robotic arm.
[0015] The robot arm trajectory tracking control method and robot arm provided by the present invention include: physical modeling of the robot arm to obtain the robot arm model; kinematic analysis of the robot arm model based on the DH method to optimize the robot arm model; trajectory planning of the preset points of the optimized robot arm model using the 3-5-3 polynomial interpolation method; and tracking and controlling the planned trajectory using the reinforcement learning algorithm. By performing kinematic analysis on the robot arm model, a model is prepared for subsequent trajectory planning to ensure the accuracy of subsequent trajectory planning; trajectory planning by 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; 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 the subsequent analysis and optimization of the motion trajectory; by tracking and controlling the trajectory by the reinforcement learning algorithm, the motion trajectory of the robot arm can be adjusted and optimized in time, thereby ensuring that the motion trajectory of the robot arm meets the preset requirements when it is actually used, and solving the problem of poor accuracy of the existing robot arm motion trajectory. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flow chart of the robot arm trajectory tracking control method provided in this embodiment; Figure 2 A schematic diagram of the flying speed of particles in the particle swarm algorithm provided in this embodiment; Figure 3 The quantum particle swarm algorithm optimization time flow chart provided for this embodiment; Figure 4 A schematic diagram of the PLCSIM Adv communication principle provided for this embodiment; Figure 5 A schematic diagram of the open-loop simulation results of the robot arm end trajectory provided in this embodiment; Figure 6 A schematic diagram of the Matrikon OPC communication method provided for this embodiment; Figure 7 A schematic diagram of the closed-loop simulation results of the robot arm end trajectory provided in this embodiment. DETAILED DESCRIPTION
[0017] The robot arm trajectory tracking control method and the robot arm proposed in the present invention are further described in detail below in combination with the accompanying drawings and specific embodiments. It should be noted that the accompanying drawings are all in a very simplified form and use non-precise proportions, which are only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention. In addition, the structure shown in the accompanying drawings is often a part of the actual structure. In particular, the emphasis of each accompanying drawing is different, and sometimes different proportions are used.
[0018] It should be noted that the terms "first", "second", etc. in the specification, claims and drawings of the present invention are used to distinguish similar objects in order to describe the embodiments of the present invention, rather than 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 "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0019] This embodiment provides a robot arm trajectory tracking control method, such as Figure 1 As shown, including: S1, physically modeling the robotic arm to obtain a robotic arm model; S2, kinematic analysis of the robot model is performed based on the DH method to optimize the robot model; S3, using 3-5-3 degree polynomial interpolation method to perform trajectory planning for the preset points of the optimized robotic arm model; S4, uses reinforcement learning algorithm to track and control the planned trajectory.
[0020] The robot arm trajectory tracking control method provided in the present 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 by polynomial interpolation method to ensure that the motion trajectory of the end of the robot arm meets the preset requirements and can link the joints and connecting rods of the robot arm; performs positive kinematic analysis again after the joint space trajectory planning is completed to obtain the motion trajectory of the end effector of the robot arm, which is convenient for subsequent analysis and optimization of the motion trajectory; tracks and controls the trajectory by reinforcement learning algorithm, and can adjust and optimize the motion trajectory of the robot arm in time, 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 motion trajectory of the robot arm.
[0021] Specifically, in this embodiment, in step S1, a method for physically modeling the robotic arm to obtain a robotic arm model includes: 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.
[0022] NX is a fully integrated computer-aided design, manufacturing and engineering analysis software, which is widely used in industrial design, robotics engineering and manufacturing, and can help users achieve efficient and innovative operations from the entire process of concept-design-verification-production and manufacturing. NX also includes the MCD module, which allows engineers to consider the influence of multiple disciplines and various factors during the design process, such as friction, workspace, structural strength, fluid dynamics, etc., which can effectively reduce the workload of early calculations and later modifications and redesigns.
[0023] 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 technologies 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.
[0024] 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.
[0025] S12, configuring constraint conditions of the six-axis robotic arm, wherein the constraint conditions include the relationship, angle, speed and acceleration of each joint and connecting rod in the six-axis robotic arm.
[0026] 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 robot arm moves within a certain range.
[0027] S13, based on the three-dimensional model of the six-axis robotic arm, MCD modeling is performed according to constraint conditions to obtain a robotic arm model.
[0028] 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; secondly, determining the rotation axis with a hinge pair, and verifying the correctness of the robot arm connecting rod action through the gripper; then establishing position control, speed control and other controllers, and setting the range of each axis rotation angle, rotation speed, and acceleration.
[0029] In this embodiment, a three-dimensional model of a six-axis robotic arm is established based on NX software, and an MCD model is established on this basis to implement hard limits on the robotic arm joint link relationship, angle, speed, and acceleration, laying the foundation for subsequent trajectory planning and control.
[0030] Furthermore, in this embodiment, step S2, the method of performing kinematic analysis on the robot model based on the DH method includes: S21, setting DH parameters, wherein the DH parameters include joint angle, link offset, link length and link torsion angle.
[0031] 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.
[0032] In a specific embodiment, the DH parameters are as shown in Table 1:
[0033] Table 1. DH parameters S22, establishing a DH parameter model in Matlab according to the set DH parameters.
[0034] 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.
[0035] S23, performing forward and inverse kinematics analysis on the DH parameter model to optimize the robot arm model.
[0036] Specifically, in this embodiment, first, a spatial coordinate transformation is performed according to 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:
[0037] Expand the above formula to get:
[0038] Then, according to the coordinate transformation relationship between adjacent links, a forward kinematic analysis is performed to obtain the pose matrix of the end effector of the robot arm. Specifically, the homogeneous transformation matrix is multiplied to finally obtain the pose matrix of the end effector relative to the base coordinate system:
[0039] 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 zRepresents the position of the end effector in the reference coordinate system. Using the above formula, the pose matrices of each joint are multiplied to finally obtain the pose of the end effector. This process is called forward kinematics.
[0040] Afterwards, the DH parameter model is used to perform inverse kinematics analysis on the end effector of the robot arm to obtain the angle of the joint. Specifically, in the trajectory planning of the six-degree-of-freedom robot arm between four points, the pose matrix of the end effector at the four points is obtained through forward and inverse kinematics analysis as follows:
[0041]
[0042] Then, the DH parameter model is used to perform inverse kinematic analysis on the four-point pose matrix to obtain the joint angles at the four points, as shown in Table 2:
[0043] Table 2. Angle interpolation points in joint space Furthermore, in this embodiment, in step S3, the method of performing trajectory planning for the preset points of the optimized robotic arm model using the 3-5-3 degree polynomial interpolation method includes: S31, obtaining relationship information between the connecting rods and joints of the optimized robotic arm model.
[0044] In the existing trajectory planning schemes, cubic polynomial interpolation or quintic polynomial interpolation is usually used. However, the trajectory planning effects of these two methods are not 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 during the point-to-point movement, and discontinuities will appear. Therefore, the speed control on the fine operation path is not ideal, which is easy to cause large impact and vibration, and shorten 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 movement of the robot arm is continuous, if the acceleration is not planned properly, the oscillation amplitude is easy to be too large, which affects the life of the joint and is not conducive to the control of the joint angular velocity.
[0045] 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.
[0046] Specifically, first, construct a 3-5-3 spline interpolation. 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:
[0047]
[0048]
[0049] in, represents the cubic polynomial interpolation of the first segment joint angle, The second segment joint angle quintic polynomial interpolation, The third segment joint angles are interpolated using cubic polynomials, whose first-order derivatives and second-order inverses are angular velocity and angular acceleration, respectively. , , , respectively represent the j-th coefficient of the first, second, and third trajectory interpolation.
[0050] 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 Based on the above constraints, the motion coefficient a is derived ij The relationship between the interpolation points is as follows:
[0051]
[0052]
[0053] in, t i (i=1, 2, 3) represents the movement time of the robot arm joints in the three trajectories respectively.
[0054] 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 aThe first row after multiplication; the -1 behind it is the displacement of the starting point of the quintic polynomial, and the second row is the angular velocity; similarly, the -1 behind it is the velocity of the starting point of the quintic polynomial, the third row is the acceleration, and the -2 behind it is the acceleration of the quintic polynomial when time is equal to 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 and time zero, respectively. Substituting time 0 into the displacement, velocity, and acceleration equations, these three rows can be obtained respectively. Row 13 represents the displacement of the third segment of the trajectory, and it can be substituted into the displacement function of the first segment of the trajectory when time is zero. Similarly, row 14 represents the displacement of the second segment of the trajectory, and it can be substituted into the displacement function of the second segment of the trajectory when time is zero.
[0055] Afterwards, 3-5-3 spline interpolation is used to obtain the relationship between the motion coefficient and the interpolation point through fixed points.
[0056] 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 paths can be interpolated using cubic polynomials to complete tasks such as transportation, and the starting and ending speeds and accelerations are set to 0.
[0057] Finally, the position and posture of the robot arm joints are obtained based on the relationship between the fixed points, motion coefficients and interpolation points.
[0058] In practical applications, the relationship information may include not only the position and posture of the robot joints, but also the posture relationship between the robot joints and the robot connecting rods and the robot end effector. The posture relationship may be obtained by the forward and inverse kinematics analysis of step S2.
[0059] S32, based on quantum particle swarm algorithm and 3-5-3rd order polynomial interpolation method, obtains the optimal time for each joint to move at a preset point under the condition of satisfying the constraint; 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. The speed represents the speed of individual movement, and the 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 encountered by population g to the current position is called g best .
[0060] like Figure 2 As shown in the figure, when the particle swarm algorithm constrains the particle speed, if the self-learning factor c1 is small, the global learning factor c2 is large, and the inertia weight w is large, it is conducive to 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 conducive to local search and can converge faster, but it may ignore the global situation and miss the optimal solution.
[0061] 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.
[0062] Specifically, the key to using quantum particle swarm algorithm to optimize the time of 3-5-3 degree polynomial interpolation is to select the independent variable to be optimized. Figure 3 As shown in the figure, firstly, the motion time t1, t2, and t3 of the robot 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.
[0063] 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:
[0064]
[0065] Wherein, ti1, ti2, and ti3 represent the first path motion time, the second path motion time, and the third path motion time of the i-th joint, respectively. Because the robot arm selected in this embodiment has six degrees of freedom, i is 1 to 6. Vmaxi represents the maximum angular velocity of the i-th joint, and Amaxi represents the maximum angular acceleration of the i-th joint.
[0066] Next, 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. In practical applications, 100 particles are randomly generated within the three interpolation times, and the acceleration coefficient is calculated using the formula in the 3-5-3 spline trajectory interpolation method according to the coordinates of the four points of the manipulator joint; the velocity and acceleration of the joint are constrained according to the first-order derivative and second-order derivative of the 3-5-3 spline trajectory interpolation expression; if the velocity and acceleration meet the constraints, the position and velocity of the particles are updated according to the objective function; if the velocity and acceleration do not meet the constraints, the optimal time of the particles is modified, and the velocity and acceleration of the joint are constrained again according to the first-order derivative and second-order derivative of the 3-5-3 spline trajectory interpolation expression.
[0067] 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 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 is 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 .
[0068] S33, obtaining the maximum time of all joints moving at the preset points and summing them up to obtain the longest movement time.
[0069] Specifically, the sum of the maximum values of the running time of each joint in the three paths obtained in step S32 is taken as the final trajectory running time.
[0070] S34, using a 3-5-3rd order polynomial interpolation method to process the longest motion time to obtain the motion trajectory of each joint.
[0071] 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 repeat it again.
[0072] S35, using forward kinematics analysis to obtain the optimal trajectory planning for the end effector of the robot arm.
[0073] 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 go into details about it.
[0074] Furthermore, in this embodiment, in step S4, a method for tracking and controlling the planned trajectory using a reinforcement learning algorithm includes: S41, setting the robot arm parameters in the MCD, wherein the robot arm 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.
[0075] Specifically, in this embodiment, setting the robot arm parameters in the MCD may also include: Dynamic modeling in MCD mainly considers factors such as mass, inertia, gravity, friction and external loads to calculate the torque and force required for the joints to ensure the stability and performance of the robot arm; and, in MCD, electrical system integration design, which mainly includes the integration of electrical components such as motors, sensors, and limit switches into the design of the robot arm, so as to analyze the behavior of the circuit, verify the correctness of the design, and optimize the performance; 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; And, in MCD, electromagnetic compatibility (EMC) analysis is used to analyze the electromagnetic interference that may be generated by electrical systems.
[0076] After setting the parameters of the robot arm, it is also necessary to perform virtual debugging on it. The process mainly includes: In the MCD, in order to control the movement of the robot arm, it is necessary to set the input and output signals that interact with the PLC, and express the action relationship through formulas. This embodiment uses three signal adapters, which represent the controllers of the first path, the second path, and the third path respectively. The PLC transmits data time series data, and the MCD uses polynomial interpolation to process the sequence.
[0077] S42, write the PLC control program and establish communication between the PLC and the MCD.
[0078] Specifically, when writing a PLC control program, a timer, a counter and other devices are used in the PLC to write a time series code so as to sequentially transmit the first period of time, the second period of time and the third period of time. The PLC program written in this embodiment is to track the optimal trajectory of the joint time under the constraint conditions, and the expression in the signal adapter of the PLC and the NX is combined to obtain the optimal trajectory function of the joint time, and finally realize the tracking control of the joint trajectory of the robot arm. The pseudo code of the PLC and NX related programs is shown in Table 3:
[0079] Table 3. PLC and NX joint related program pseudo code When establishing communication, considering that NX MCD supports communication modes such as OPC UA, OPC DA, TCP, PROFINET, and PLCSIM Adv, in order to simulate the hardware behavior of the actual PLC as much as possible, including processing time, terminals, and communication functions, this embodiment uses PLCSIM Adv for communication.
[0080] like Figure 4As shown, the sequence simulator in MCD realizes the control effect by simulating the controller, which can verify the correctness of the logic to ensure that it can work correctly in the actual PLC operation. It is simple and straightforward. In order to simulate the actual PLC hardware behavior as much as possible in a virtual situation, this embodiment directly uses the PLCSIM Adv simulator (such as the S7-PLCSIMAdvance advanced simulator) to use NX and PLC together, which can achieve seamless connection from design to automated control.
[0081] Specifically, download the code to the PLCSIM Advanced simulator; then add the corresponding virtual instance in the external signal configuration of NX MCD; finally, map the relevant variables of the signal in MCD to complete the link between PLC and NX MCD and simulate the joint simulation process of the robot arm.
[0082] S43, using the reinforcement learning controller and the PLC control program, a simulation demonstration is performed based on the MCD to obtain the effect of the robot arm trajectory tracking control.
[0083] 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 the 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 as follows: Figure 5 shown.
[0084] In this embodiment, PLC and MCD are debugged together to track the trajectory in open-loop control. The use of PLC for open-loop control debugging of the robot arm trajectory includes but is not limited to the following two meanings: (1) For occasions with low precision requirements, open-loop control can meet basic motion control requirements, such as simple handling and assembly; PLC can control the movement of the robot arm through a preset instruction sequence to achieve a predetermined trajectory. (2) Cost-effectiveness: Compared with closed-loop control systems, open-loop control systems have a simple structure and low cost. When high-precision control is not required, using PLC open-loop control is an economical choice.
[0085] However, if Figure 5As shown, the green line is the expected 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 expected 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 inability to automatically adjust to maintain stability, which 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, in the face of scenarios that require higher precision and better dynamic response, closed-loop control is usually a better choice.
[0086] To this end, this embodiment uses a reinforcement learning controller in Simulink to track and control the optimal time trajectory of the robot arm planned by Matlab code, and combines NX MCD simulation to demonstrate the closed-loop effect of robot arm trajectory tracking.
[0087] 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.
[0088] Among them, DDPG (Deep Deterministic Policy Gradient for Reinforcement Learning) is implemented in Simulink. The specific methods include: first, use Matlab code to plan the time-optimal trajectory and save the data; then, create a Simulink model, set the simulation time and step size according to the maximum time sum of the joints of the three paths, the sampling frequency of NX and Simulink, etc., and set the environment for tracking the joint trajectory of the robot arm; then, define the reward function module in Simulink, which involves how to compare the actual position of the robot arm with the target position; then, define 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 playback buffer, the learning factor, etc., as well as the number of iterations, which are specifically written through Matlab code; then, define the training parameters, train the agent according to the possible range of changes in the joint angle of the robot arm, observe the changes in the reward function, and save the trained agent after a certain number of iterations; finally, through the Matrikon OPC interface, make the interface parameters in Simulink correspond to the signals in NX MCD, and perform real trajectory tracking control simulation.
[0089] The Matrikon OPC communication method provided in this embodiment is as follows Figure 6As shown, Matrikon-OPC provides a data subscription and publishing mechanism, which can be used as a transfer station for signal transmission between Matlab and NX, ensuring data security and real-time, and can handle a large amount of concurrent data. Matrikon-OPC-Explorer can help users connect to local or remote OPC servers, view data sources on the server, read, write and monitor OPC values. There is a special OPC read and write module in Simulink. 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 movements.
[0090] The optimal time 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 result in NX MCD is 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.
[0091] This embodiment also provides a robotic arm, which performs trajectory tracking control using the robotic arm trajectory tracking control method as described above; the robotic arm includes multiple joints and connecting rods.
[0092] In practical applications, the robotic arm may be a six-axis robotic arm.
[0093] 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.
[0094] The robot arm trajectory tracking control method and robot arm provided in this embodiment include: physical modeling of the robot arm to obtain the robot arm model; kinematic analysis of the robot arm model based on the DH method to optimize the robot arm model; trajectory planning of the preset points of the optimized robot arm model using the 3-5-3 polynomial interpolation method; and tracking and controlling the planned trajectory using the reinforcement learning algorithm. By performing kinematic analysis on the robot arm model, a model is prepared for subsequent trajectory planning to ensure the accuracy of subsequent trajectory planning; trajectory planning by 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; 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 the subsequent analysis and optimization of the motion trajectory; by tracking and controlling the trajectory by the reinforcement learning algorithm, the motion trajectory of the robot arm can be adjusted and optimized in time, thereby ensuring that the motion trajectory of the robot arm meets the preset requirements when it is actually used, solving the problem of poor accuracy of the existing robot arm motion trajectory.
[0095] The above description is only a description of the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention. Any changes or modifications made by a person skilled in the art 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: Physically modeling the robotic arm to obtain a robotic arm model; Perform kinematic analysis on the robot model based on the DH method to optimize the robot model; The trajectory planning of the preset points of the optimized robot model is carried out using the 3-5-3 degree polynomial interpolation method; A reinforcement learning algorithm is used to track and control the planned trajectory.
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 the robotic arm model comprises: Use NX software to build a 3D model of a six-axis robotic arm and define the joint type and range of motion; Configuring constraints of the six-axis robot, wherein the constraints include the relationship, angle, speed and acceleration of each joint and connecting rod in the six-axis robot; 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 model based on the DH method includes: Setting DH parameters, wherein the DH parameters include 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 is performed on the DH parameter model to optimize the robot arm model.
4. The robot arm trajectory tracking control method according to claim 3, characterized in that: The method for performing forward and inverse kinematics 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 robot arm; According to the coordinate transformation relationship between adjacent links, forward kinematics analysis is performed to obtain the position matrix of the end effector of the robot arm; Using the DH parameter model, the inverse kinematics analysis of the end effector of the robot arm is performed to obtain the angles of the joints.
5. The robot arm trajectory tracking control method according to claim 1, characterized in that: 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 comprises: Obtain the relationship information between the connecting rods and joints of the optimized robotic arm model; Based on the quantum particle swarm algorithm and 3-5-3rd order polynomial interpolation method, the optimal time for each joint to move at a preset point under the condition of satisfying the constraint 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 polynomial interpolation method to obtain the motion trajectory of each joint; The forward kinematics analysis is used to obtain the time-optimal trajectory planning of the robot end effector.
6. The robot arm trajectory tracking control method according to claim 5, characterized in that: The method for obtaining the relationship information between the connecting rods and joints of the optimized mechanical arm model includes: Construct 3-5-3 spline interpolation; Acquire 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 the motion coefficient and the interpolation point is obtained through fixed points; According to the relationship between the fixed point, motion coefficient and interpolation point, the position and posture of the robot arm joint are obtained.
7. The robot arm trajectory tracking control method according to claim 5, characterized in that: The method for obtaining the optimal time for each joint to move at a preset point under the constraint condition based on the quantum particle swarm algorithm and the 3-5-3 degree polynomial interpolation method comprises: Get the motion time of the robot arm joints in three trajectories; Optimize the objective function of the quantum particle swarm 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; According to the updated particle position, velocity and acceleration, the optimal time for each joint to move between preset points is obtained.
8. The robot arm trajectory tracking control method according to claim 2, characterized in that: The method of using the reinforcement learning algorithm to track and control the planned trajectory includes: Set the robot arm parameters in MCD, including constraints between links, rigid body definition, collision body definition, joint constraints, position controller, velocity controller, material properties, and posture definition; Write PLC control program and establish communication between PLC and MCD; Using 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.
9. A robotic arm, characterized in that: The robotic arm performs trajectory tracking control using the robotic arm trajectory tracking control method as described in any one of claims 1 to 8; the robotic arm includes multiple joints and connecting rods.
10. The robot arm according to claim 9, characterized in that: 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
Mechanical arm obstacle avoidance path planning method and system based on reinforcement learning
CN118386252A
Parallel kinematic machine trajectory planning method
US20120290131A1
