Kinematic calibration and error compensation method of a series-parallel fracture reduction robot
Through the combination of D-H method and extended Kalman filtering and BiTCN-BiGRU-Transformer neural network, an error model containing geometric and non-geometric errors is established, which solves the problem of low error compensation accuracy in traditional methods and achieves higher error compensation accuracy and real-time.
Patent Information
- Application Number
- CN202410306243.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-18
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-03-18
AI Technical Summary
Traditional kinematic calibration methods are difficult to establish a complete error model in complex hybrid robots, and the error parameter identification is unstable, resulting in low error compensation accuracy, especially the impact of non-geometric errors is not fully considered.
The kinematic model was established using the D-H method, combined with extended Kalman filtering and BiTCN-BiGRU-Transformer neural network, and measured the position pose by a near-infrared camera, and an error model containing geometric and non-geometric errors was established to perform real-time error compensation.
It effectively eliminates the influence of non-geometric errors on calibration accuracy, improves the real-time and accuracy of error compensation, and enhances the robustness of robot kinematic calibration.
Smart Images

Figure CN118322188B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the cross-technical field of robots and medical treatment, and relates to the kinematic calibration and error compensation technology of robots, and specifically to a kinematic calibration and error compensation method of a series-parallel fracture reduction robot. Background Art
[0002] Medical robots represent the cutting-edge interdisciplinary achievements of robotics and medicine, integrating precise mechanical operations, artificial intelligence algorithms, and medical diagnosis and treatment knowledge, providing important technical support for improving diagnosis and treatment accuracy and enhancing surgical intervention. Serial-parallel robots are widely used in the field of medical robots. For example, in orthopedic surgical robots, the high degree of freedom and large range of motion of serial mechanisms can be used to operate flexibly in complex environments, and the compact structure and high rigidity of parallel mechanisms can be used to perform delicate operations in limited spaces.
[0003] Robot kinematic calibration and error compensation is a process of accurately adjusting and optimizing the robot's terminal position motion parameters, aiming to improve the robot's positioning and repeatability accuracy. The calibration process involves adjusting and identifying the parameters in the kinematic model, which usually include joint degree, connecting rod length, connecting rod offset and geometric error parameters, and compensating the robot's motion through the error calculated by the error model. In view of the high precision and fine operation requirements of medical robots, robot kinematic calibration and error compensation are of great significance.
[0004] The Chinese invention patent with patent number CN101231749A discloses "a calibration method for an industrial robot". First, the posture transformation matrix of the robot tool coordinate system relative to the basic coordinate system is established. Secondly, the position coordinate vector of the center of the laser tracker on the calibration block relative to the basic coordinate system is established. Then, by fully differentiating the position coordinate vector, the linear function of the position error, structural parameter error and joint variable error is obtained, and the error values of each joint variable and the structural parameter error are calculated to obtain a more accurate posture accuracy.
[0005] The Chinese invention patent with patent number CN117359613A discloses a "robot error compensation method based on adaptive Kalman filtering and neural network". The invention establishes a kinematic model of a seven-axis robotic arm through the DH algorithm, and uses adaptive Kalman filtering and neural network training to obtain the optimal error prediction model. According to the predicted value output by the model, the robot's joint angles are compensated for errors.
[0006] The Chinese invention patent with patent number CN104516268A discloses "a robot calibration error compensation method based on fuzzy neural network". The first error compensation of the robot is performed by compiling the homogeneous transformation matrix between adjacent links and calculating the kinematic equations and error equations of the robot end effector. The kinematic equations and error equations about the angle are generated, and the fuzzy neural network model is used to perform the second error compensation on the robot.
[0007] Traditional kinematic calibration methods encounter two main problems in complex hybrid robot applications: first, such robots have many joints, each with multiple error sources, and the structural errors between joints affect each other, making it difficult to establish a complete, compact, and continuous error model; second, traditional error identification methods are susceptible to matrix ill-posed problems and lack robustness, resulting in unstable identification results and inability to effectively compensate for high-precision errors. Although current technologies attempt to establish appropriate error models to improve calibration accuracy, they often ignore the impact of non-geometric errors on the results. Even if optimization methods and neural networks are used for secondary error compensation, the network structure is simple and the prediction ability is limited, making it difficult to accurately calculate the impact of non-geometric errors. Summary of the invention
[0008] In order to overcome the shortcomings of the prior art robot kinematic error model being incomplete and the error parameter identification being unstable resulting in low error compensation accuracy, the present invention provides a series-parallel fracture reduction robot kinematic calibration and error compensation method for effectively improving the error compensation accuracy.
[0009] The technical solution adopted by the present invention to solve its technical problem is:
[0010] A kinematic calibration and error compensation method for a serial-parallel fracture reduction robot comprises the following steps:
[0011] Step 1: Use the Denavit–Hartenberg Parameters (DH) method to establish a kinematic model of the serial-parallel hybrid robot, and establish a mapping model between the active kinematic chain joint variables and the active platform center of the parallel mechanism under the error state. The model includes the connecting rod length error Δa. i , connecting rod torsion angle error Δα i , connecting rod eccentricity error Δd i , joint angle error Δθ i Equal error parameters; calculate the pose parameters of the theoretical motion end, and use the mechanism method to establish a mapping model between the active motion chain joint variables and the parallel mechanism active platform center under the error state. 混 (T);
[0012] Step 2: Use a near-infrared camera to collect the actual posture of the robot end, obtain the measured posture of the optical markers on the robot's active platform, passive platform and ball joint, determine the rotation center coordinates of the robot's active platform and passive platform, and calibrate the center position of the ball joint;
[0013] Step 3: Establish a robot error model, and use extended Kalman filtering to identify error parameters of the error model based on theoretical posture error and actual measurement error;
[0014] Step 4: Build a BiTCN-BiGRU-Transformer neural network as the robot's error prediction model, use the error model built in step 3 to calculate the theoretical pose and the actual pose collected in step 2 for training, and obtain a robot error prediction model including geometric and non-geometric errors; use Pytorch to build a BiTCN-BiGRU-Transformer neural network, use the actual pose and error to train the network, and obtain an error compensation prediction model;
[0015] Step 5: Perform real-time error compensation on the robot's joints based on the motion parameters output by the error prediction model. The error compensation parameters calculated by the prediction model are calculated to the joint angles of the six-axis robot through the robot's kinematic model to achieve real-time compensation for the robot's motion.
[0016] Furthermore, in step 1, a mapping model including the active kinematic chain joint variables and the parallel mechanism active platform center under the error state is established by using a mechanism method, and the DH parameter of the active kinematic chain error model is expressed as:
[0017] a′ i =a i +Δa i , α′ i =α i +Δα i , d′ i =d i +d i ,θ′ i =θ i +Δθ i
[0018] Among them, Δa i , Δα i , Δd i , Δθ i They are respectively the connecting rod length error, connecting rod torsion angle error, connecting rod eccentricity error, and joint angle error, a′ i , α′ i , d′ i ,θ′ iare the corrected connecting rod length, connecting rod torsion angle, connecting rod eccentric length, and joint angle respectively; a i , α i ,d i ,θ i They are the basic connecting rod length, connecting rod torsion angle, connecting rod eccentric length, and joint angle, respectively, where i represents the i-th joint;
[0019] Then the adjacent joint error model matrix of the active kinematic chain is:
[0020]
[0021] The error model of the active kinematic chain end is:
[0022] f(T)=arg{minT=f(θ i ,Δθ i ,ai,Δai,α i ,Δα i ,d i ,Δd i )}
[0023] Since the planes where the two branches of the parallel mechanism are located are perpendicular to each other, the individual movement of each branch only affects the change in the position of the terminal output in one direction. Therefore, the parallel mechanism is divided into two branches for separate analysis. For the branch composed of the first connecting rod, we can obtain:
[0024] ω′1=ω1+Δω1, L′1=L1+ΔL1, L′2=L2+ΔL2, L′3=L3+ΔL3, L′4=L4+ΔL4
[0025] Among them, ω′1, L'1, L'2, L'3, and L'4 are the corrected active motion angle, passive motion angle, and length, respectively, Δ(*) represents the error amount, and ω1, L1, L2, L3, and L4 are the basic values of the parameters, respectively;
[0026] The closed vector equation of the quadrilateral is:
[0027]
[0028] Transforming the vector equation into complex form is:
[0029]
[0030] Using the sine and cosine functions of the vector angle, the closed-loop vector equation expression is:
[0031]
[0032] ω1 and ω2 are solved by Newton's iteration method;
[0033] Similarly, the branch chain composed of the second link is studied to obtain the end posture error model of the parallel mechanism:
[0034] f'(T)=f(T)·Rot ω (ω3+Δω3)·Rot ω (ω6+Δω6)
[0035] Among them, Rot ω () represents the rotation around the angle ω;
[0036] Assume that the ball joint coordinate system is Sph T, then the end position of the parallel mechanism relative to the spherical joint coordinate system is:
[0037] p o =f(q i ,T sph ,L),(i=1,2,3,4,5,6)
[0038] Among them, q i is the joint angle, T sph is the expression of the ball joint in the world coordinate system, L is the total length of the parallel mechanism;
[0039] Then the end error model of the serial-parallel robot is:
[0040]
[0041] Furthermore, in step 2, the serial robot arm is unfolded, the end of the serial robot arm is fixedly connected to the active platform of the parallel mechanism by screws, the center of the active platform is controlled to collect data to meet the random motion parameters of the normal distribution, the near-infrared camera records the positions of the first optical marker, the second optical marker, and the third optical marker, and the above steps are transformed and repeated on the Y-axis of the center of the active platform;
[0042] The positions of the first optical marker, the second optical marker and the third optical marker are recorded by a near-infrared camera, so the rotation center of the active and passive platform can be calculated by the positions of the optical markers. Assuming the center of the fitted sphere is (x, y, z), the radius is r, and any point (x i ,y i ,z i ) to the center of the sphere:
[0043]
[0044] The collected data is taken in and the least square method is used to fit (x, y, z), which is the coordinate of the rotation center of the active and passive platforms. According to the calibration, the active and passive rotation centers A i (a i ,bi ,c i ) and,B i (d i ,e i ,f i ), calculate the rod length L of the parallel mechanism:
[0045]
[0046] Assume that the fulcrum of the ball joint is P(x,y,z), and the rotation center of the joint before and after the rotation center is A i (a i ,b i ,c i ),B i (d i ,e i ,f i ). According to the vector formula:
[0047]
[0048] Calculate the cross product of two vectors and get:
[0049]
[0050] Then and The square area of the parallelogram is:
[0051]
[0052] According to the cross multiplication theory, the connecting line of the centers of the two rotating joints at the front and rear of the mechanism should pass through the ball joint, that is, the straight line distance from the fulcrum to the two rotating joints should be equal to zero, and then Record residual The residual sum is:
[0053]
[0054] The partial derivative of the residual sum is obtained as:
[0055]
[0056] Find the minimum value of the residual sum, set the partial derivatives equal to zero, and divide by the coefficient N to get:
[0057]
[0058] Arranged into matrix form:
[0059]
[0060] Solve the equations to obtain the center coordinates P(x, y, z) of the spherical joint.
[0061] Furthermore, in step 3, the error parameters are solved according to the extended Kalman filter algorithm:
[0062] Z k =J k Δx k +V k
[0063] Among them, Z k is the end position error of the kth point, J k is the error Jacobian matrix of the corresponding points, Δx k is the parameter error of the corresponding point, V k is the measurement error;
[0064] By iterating the equation
[0065] Δx k∣k-1 =Δx k-1∣k-1
[0066] A k∣k-1 =A k-1∣k-1 +B k-1
[0067]
[0068] Where Δx k∣k-1 is the unaccounted error ΔP at point k k The parameter value, ω k-1 represents white noise with a mean of zero, B k-1 Represents the covariance matrix corresponding to white noise, and the Kalman gain is expressed as:
[0069]
[0070] Then the corrected error parameter can be expressed as
[0071] A k∣k =(IK k J k )A k∣k -1
[0072] The modified covariance matrix is:
[0073] A k∣k =(IK k J k )A k∣k-1
[0074] when The iterative solution is completed and the error parameter is obtained.
[0075] In step 4, the BiTCN-BiGRU-Transformer bidirectional temporal convolution is combined with the bidirectional gated recurrent unit to fuse the Transformer prediction model. A bidirectional branch BiTCN is added on the basis of TCN, and the bidirectional gated recurrent unit BiGRU is also fused with the Transformer structure containing a multihead self-attention mechanism. Compared with TCN, the role of bidirectional temporal convolution in prediction is to extract the forward and backward time information in the input sequence to obtain better feature extraction capabilities.
[0076] A bidirectional temporal convolutional network is established. The forward and reverse temporal convolutional models are composed of multiple residual blocks. Each residual block includes two layers of dilated causal convolution, two layers of weight normalization, two layers of leaky ReLU mapping, and two layers of regularization layers composed of Dropout and 1×1 convolution. The BiTCN model uses bidirectional dilated causal convolution and introduces residual blocks to construct an identity mapping, so that the model structure converges in the direction of the identity mapping, avoiding the increase of prediction error as the network deepens, and solving the problems of gradient explosion and gradient disappearance caused by the deepening of the network.
[0077] Build a BiGRU bidirectional gated recurrent network to obtain the features processed by the bidirectional time convolution model and enter the BiGRU bidirectional gated recurrent network. This network is a recursive neural network that can capture medium and long-distance dependencies. Through bidirectionality, the model's ability to perceive dynamic changes in time series prediction is improved. The special diagnosis obtained by BiTCN is input into the BiGRU layer. The hidden layer state h of BiGRU at time t t Through the forward state With reverse state The weighted summation yields:
[0078]
[0079] Among them, GRU represents the nonlinear transformation of the input, projecting the vector into the corresponding hidden layer state, w t and v t They represent the weights of the forward hidden layer and the reverse hidden layer of BiGRU at time t, respectively, and b t represents the bias corresponding to the hidden layer at time t; the temporal features extracted by BiGRU are input into the Transformer module, which is Figure 7As shown in the figure, the entire Transformer module consists of a multi-head attention mechanism and a feedforward neural network. The input features first enter the multi-head attention module for feature fusion. The multi-head attention mechanism can process multiple input data in parallel. After passing through multiple linear layers, it is connected to a normalization module and connected to the original data through a residual connection to enter the feedforward neural network. Then, the residual layer and the normalization layer are used for linear output. In the Transformer module, a multi-head self-attention layer is embedded in the module. The self-attention layer is used to capture the global dependencies in the feature data. The self-attention mechanism allows the network to dynamically adjust the weights of each time step during learning to better capture long-term dependencies and global patterns.
[0080] The data of the robot's real posture collected in step 2 and the theoretical posture calculated after error model correction are divided into training set and validation set according to the set ratio, and the BiTCN-BiGRU-Transformer neural network is used for training. The Adam optimizer is used for model training, the learning rate is set, and the parameters are tuned. The loss function is the root mean square error RMSE, and the formula is as follows:
[0081]
[0082] Among them, n represents the number of samples, i represents the sample sequence, X, Y, Z, RX, RY, and RZ represent the true label position and posture errors, respectively, and X', Y', Z', RX', RY', and RZ' represent the predicted values, respectively.
[0083] The beneficial effects of the present invention are mainly manifested in:
[0084] (1) The extended Kalman filter algorithm is used to model and identify the robot's geometric error parameters. The BiTCN-BiGRU-Transformer bidirectional temporal convolution is combined with the bidirectional gated recurrent unit to fusion the Transformer error prediction model, which effectively eliminates the influence of non-geometric errors such as joint backlash, measurement noise and measurement configuration on the calibration accuracy.
[0085] (2) The BiTCN-BiGRU-Transformer model adds a bidirectional branch BiTCN on the basis of TCN, and the bidirectional gated recurrent unit BiGRU also integrates the Transformer structure with a multi-head self-attention mechanism. Compared with TCN (Temporal Convolutional Networks) and GRU (Gate Recurrent Unit), it has better feature extraction capabilities and better dynamic change perception capabilities in prediction, and enhances the real-time performance of error compensation.
[0086] (3) A near-infrared camera is used to measure the end-point posture of the robot. Compared with expensive coordinate measuring instruments, it has the advantages of simple use and low cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] Figure 1 It is a schematic diagram of the overall structure of the serial-parallel robot;
[0088] Figure 2 It is a schematic diagram of the parallel mechanism structure;
[0089] Figure 3 It is a schematic diagram of a single-plane branch chain of a parallel mechanism;
[0090] Figure 4 Schematic diagram of the BiTCN-BiGRU-Transformer neural network structure;
[0091] Figure 5 This is a schematic diagram of the BiTCN bidirectional temporal convolutional network architecture;
[0092] Figure 6 This is a schematic diagram of the BiGRU bidirectional gated recurrent unit architecture;
[0093] Figure 7 This is a schematic diagram of the Transformer deep network architecture;
[0094] In the figure, a is a serial robot and b is a parallel mechanism, 1. an active platform, 2. a first Hooke's joint, 3. a second Hooke's joint, 4. a third Hooke's joint, 5. a first connecting rod, 6. a second connecting rod, 7. a third connecting rod, 8. a ball joint, 9. a fourth Hooke's joint, 10. a fifth Hooke's joint, 11. a sixth Hooke's joint, 12. a first optical marker, 13. a first connecting member, 14. a second optical marker, 15. a second connecting member, 16. a third optical marker, 17. a third connecting member, 18. a frame. DETAILED DESCRIPTION
[0095] The present invention will be further described below in conjunction with the accompanying drawings.
[0096] Reference Figure 1 to Figure 7A kinematic calibration and error compensation method of a serial-parallel fracture reduction robot, the serial-parallel fracture reduction robot comprises a serial robot a and a parallel mechanism b, the parallel mechanism b mainly comprises an active platform 1, a first Hooke's joint 2, a second Hooke's joint 3, a third Hooke's joint 4, a first connecting rod 5, a second connecting rod 6, a third connecting rod 7, a ball joint 8, a fourth Hooke's joint 9, a fifth Hooke's joint 10, a sixth Hooke's joint 11, a first optical marker 12, a first connecting member 13, a second optical marker 14, a second connecting member 15, a third optical marker 16, a third connecting member 17 and a frame 18. During the robot kinematic calibration process, the first optical marker 12 is fixed to the side of the passive platform through the first connecting member 13, the second optical marker 14 is fixed to the side of the support of the ball joint 8 through the second connecting member 15, and the third optical marker 16 is fixed to the side of the active platform 1 through the third connecting member 17. According to the principle of equivalent motion transfer, the rotation effects of the active platform, passive platform and ball joint will be equivalently transferred to the optical marker.
[0097] The kinematic calibration and error compensation method of the serial-parallel fracture reduction robot comprises the following steps:
[0098] Step 1: Use the Denavit–Hartenberg Parameters (DH) method to establish a kinematic model of the serial-parallel hybrid robot, and establish a mapping model between the active kinematic chain joint variables and the active platform center of the parallel mechanism under the error state. The model includes the connecting rod length error Δa. i , connecting rod torsion angle error Δα i , connecting rod eccentricity error Δd i , joint angle error Δθ i Equal error parameters; calculate the pose parameters of the theoretical motion end, and use the mechanism method to establish a mapping model between the active motion chain joint variables and the parallel mechanism active platform center under the error state. 混 (T);
[0099] The mechanism method is used to establish a mapping model between the joint variables of the active kinematic chain and the center of the active platform of the parallel mechanism under error conditions. Figure 1 , the DH parameters of the active kinematic chain error model are expressed as:
[0100] a i '=a i +Δa i , α i '=α i +Δα i , d i '=d i +d i ,θ i '=θ i +Δθi
[0101] Among them, Δa i , Δα i , Δd i , Δθ i They are connecting rod length error, connecting rod torsion angle error, connecting rod eccentricity error, and joint angle error, respectively. i '、α i '、d i '、θ i ' are respectively the corrected connecting rod length, connecting rod torsion angle, connecting rod eccentric length, and joint angle; a i , α i ,d i ,θ i They are the basic connecting rod length, connecting rod torsion angle, connecting rod eccentric length, and joint angle, respectively, where i represents the i-th joint;
[0102] Then the adjacent joint error model matrix of the active kinematic chain is:
[0103]
[0104] The error model of the active kinematic chain end is:
[0105] f(T)=arg{minT=f(θ i ,Δθ i ,a i ,Δa i ,α i ,Δα i ,d i ,Δd i )}
[0106] Since the planes where the two branches of the parallel mechanism are located are perpendicular to each other, the individual movement of each branch only affects the change in the position of the terminal output in one direction, so the parallel mechanism is divided into two branches for separate analysis; Figure 3 , for the branch chain composed of the first connecting rod 5, we can get:
[0107] ω′1=ω1+Δω1, L′1=L1+ΔL1, L′2=L2+ΔL2, L′3=L3+ΔL3, L′4=L4+ΔL4
[0108] Among them, ω′1, L'1, L'2, L'3, and L'4 are the corrected active motion angle, passive motion angle, and length, respectively, Δ(*) represents the error amount, and ω1, L1, L2, L3, and L4 are the basic values of the parameters, respectively;
[0109] The closed vector equation of the quadrilateral is:
[0110]
[0111] Transforming the vector equation into complex form is:
[0112]
[0113] Using the sine and cosine functions of the vector angle, the closed-loop vector equation expression is:
[0114]
[0115] ω1 and ω2 are solved by Newton's iteration method;
[0116] Similarly, by studying the branch chain composed of the second link 6, the end posture error model of the parallel mechanism can be obtained:
[0117] f'(T)=f(T)·Rot ω (ω3+Δω3)·Rot ω (ω6+Δω6)
[0118] Among them, Rot ω () represents the rotation around the angle ω;
[0119] Assume that the ball joint coordinate system is Sph T, then the end position of the parallel mechanism relative to the ball joint coordinate system is:
[0120] p o =f(q i ,T sph ,L),(i=1,2,3,4,5,6)
[0121] Among them, q i is the joint angle, T sph is the expression of the ball joint in the world coordinate system, L is the total length of the parallel mechanism;
[0122] Then the end error model of the serial-parallel robot is:
[0123]
[0124] Step 2: Use a near-infrared camera to collect the actual posture of the robot end, obtain the measured posture of the optical markers on the robot's active platform, passive platform and ball joint, determine the rotation center coordinates of the robot's active platform and passive platform, and calibrate the center position of the ball joint;
[0125] The serial robot arm is unfolded, and the end of the serial robot arm is fixedly connected to the active platform of the parallel mechanism by screws. The center of the active platform 1 is controlled to collect data in accordance with the random motion parameters of the normal distribution. The near-infrared camera records the positions of the first optical marker 12, the second optical marker 14, and the third optical marker 16. The above steps are transformed and repeated on the Y axis of the center of the active platform 1.
[0126] The positions of the first optical marker 12, the second optical marker 14 and the third optical marker 16 are recorded by a near-infrared camera, so the rotation center of the active and passive platform can be calculated by the positions of the optical markers. Assuming the center of the fitted sphere is (x, y, z), the radius is r, and any point (x i ,y i ,z i ) to the center of the sphere:
[0127]
[0128] The collected data is taken in and (x, y, z) is fitted by the least square method, which is the coordinate of the rotation center of the active and passive platforms. According to the calibration, the active and passive rotation centers A i (a i ,b i ,c i ) and,B i (d i ,e i ,f i ), calculate the rod length L of the parallel mechanism:
[0129]
[0130] Assume that the fulcrum of the ball joint is P(x,y,z), and the rotation center of the joint before and after the rotation center is A i (a i ,b i ,c i ),B i (d i ,e i ,f i ), according to the vector formula:
[0131]
[0132] Calculate the cross product of the two vectors and get:
[0133]
[0134] Then and The square area of the parallelogram is:
[0135]
[0136] According to the cross multiplication theory, the connecting line of the centers of the two rotating joints at the front and rear of the mechanism should pass through the ball joint, that is, the straight line distance from the fulcrum to the two rotating joints should be equal to zero, and then Record residual The residual sum is:
[0137]
[0138] The partial derivative of the residual sum is obtained as:
[0139]
[0140] Find the minimum value of the residual sum, set the partial derivatives equal to zero, and divide by the coefficient N to get:
[0141]
[0142] Arranged into matrix form:
[0143]
[0144] Solving the equations can obtain the center coordinates P (x, y, z) of the ball joint;
[0145] Step 3: Establish a robot error model, and use extended Kalman filtering to identify error parameters of the error model based on theoretical posture error and actual measurement error;
[0146] The error parameters are solved according to the extended Kalman filter algorithm:
[0147] Z k =J k Δx k +V k
[0148] Among them, Z k is the end position error of the kth point, J k is the error Jacobian matrix of the corresponding points, Δx k is the parameter error of the corresponding point, V k is the measurement error;
[0149] By iterating the equation
[0150] Δx k∣k-1 =Δx k-1∣k-1
[0151] A k∣k-1 =A k-1∣k-1 +B k-1
[0152]
[0153] Where Δx k∣k-1 is the unaccounted error ΔP at point k k The parameter value, ω k-1 represents white noise with a mean of zero, B k-1 Represents the covariance matrix corresponding to white noise, and the Kalman gain is expressed as:
[0154]
[0155] The corrected error parameter is expressed as
[0156] A k∣k =(IK k J k )A k∣k-1
[0157] The modified covariance matrix is:
[0158] A k∣k =(IK k J k )A k∣k-1
[0159] when The iterative solution is completed and the error parameter is obtained;
[0160] Step 4: Build a BiTCN-BiGRU-Transformer neural network as the robot's error prediction model, use the error model built in step 3 to calculate the theoretical pose and the actual pose collected in step 2 for training, and obtain a robot error prediction model including geometric and non-geometric errors; use Pytorch to build a BiTCN-BiGRU-Transformer neural network, use the actual pose and error to train the network, and obtain an error compensation prediction model;
[0161] Reference Figure 4 , BiTCN-BiGRU-Transformer bidirectional temporal convolution combined with bidirectional gated recurrent unit fusion Transformer prediction model, adds bidirectional branch BiTCN on the basis of TCN, and bidirectional gated recurrent unit BiGRU also fuses Transformer structure with multi-head self-attention mechanism. Compared with TCN, the role of bidirectional temporal convolution in prediction is to extract forward and backward time information in the input sequence to obtain better feature extraction capabilities.
[0162] Reference Figure 5, a bidirectional temporal convolutional network is established. The forward and reverse temporal convolution models are composed of multiple residual blocks. Each residual block includes two layers of dilated causal convolution, two layers of weight normalization, two layers of Leaky ReLU mapping, and two layers of regularization layers composed of Dropout and 1×1 convolution. The BiTCN model adopts bidirectional dilated causal convolution, introduces residual blocks, and constructs an identity mapping, so that the model structure converges in the direction of the identity mapping, avoiding the increase of prediction error as the network deepens, and solving the problems of gradient explosion and gradient disappearance caused by the deepening of the network.
[0163] Reference Figure 6 , build a BiGRU bidirectional gated recurrent network, obtain the features processed by the bidirectional time convolution model and enter the BiGRU bidirectional gated recurrent network, which is a recursive neural network that can capture medium and long-distance dependencies. Through bidirectionality, the model's ability to perceive dynamic changes in time series prediction is improved. The special diagnosis obtained by BiTCN is input into the BiGRU layer. The hidden layer state h of BiGRU at time t t Through the forward state With reverse state The weighted summation yields:
[0164]
[0165] Among them, GRU represents the nonlinear transformation of the input, projecting the vector into the corresponding hidden layer state, w t and v t They represent the weights of the forward hidden layer and the reverse hidden layer of BiGRU at time t, respectively, and b t Represents the bias corresponding to the hidden layer at time t. The temporal features extracted by BiGRU are input into the Transformer module, which is Figure 7 As shown in the figure, the entire Transformer module consists of a multi-head attention mechanism and a feedforward neural network. The input features first enter the multi-head attention module for feature fusion. The multi-head attention mechanism can process multiple input data in parallel. After passing through multiple linear layers, it is connected to a normalization module and connected to the original data to enter the feedforward neural network through residual connection. Then, the residual layer and the normalization layer are used for linear output. In the Transformer module, a multi-head self-attention layer is embedded in the module. The self-attention layer is used to capture the global dependencies in the feature data. The self-attention mechanism allows the network to dynamically adjust the weights of each time step during learning to better capture long-term dependencies and global patterns.
[0166] The data of the robot's real posture collected in step 2 and the theoretical posture calculated by error model correction in step 3 are divided into training set and validation set in a ratio of 8:2, and the BiTCN-BiGRU-Transformer neural network is used for training. In this embodiment, the Adam optimizer is used for model training, and the learning rate is 0.001 for parameter tuning. The loss function is the root mean square error RMSE, and the formula is as follows:
[0167]
[0168] Where n represents the number of samples, i represents the sample sequence, X, Y, Z, RX, RY, and RZ represent the true label position and posture errors, respectively, and X', Y', Z', RX', RY', and RZ' represent the predicted values, respectively;
[0169] Step 5: According to the trained model, the robot's motion error is predicted, and the predicted value is converted into joint angle motion parameters through kinematic inverse solution to achieve robot error compensation.
[0170] The present invention is not limited to the embodiments described above. The above description of the specific embodiments is only to describe and illustrate the technical solution of the present invention. The above specific embodiments are only illustrative and not restrictive. Without departing from the scope of the present invention and the scope of protection of the claims, ordinary technicians in this field can make many forms of specific changes under the enlightenment of the present invention, which all belong to the protection scope of the present invention.
Claims
1. A kinematic calibration and error compensation method for a serial-parallel fracture reduction robot, characterized in that: The method comprises the following steps: Step 1: Use the DH method to establish the kinematic model of the serial-parallel hybrid robot, and establish a mapping model between the active kinematic chain joint variables and the active platform center of the parallel mechanism under the error state. The model includes the connecting rod length error Δa i , connecting rod torsion angle error Δα i , connecting rod eccentricity error Δd i , joint angle error Δθ i Equal error parameters; calculate the pose parameters of the theoretical motion end, and use the mechanism method to establish a mapping model between the active motion chain joint variables and the parallel mechanism active platform center under the error state. 混 (T); Step 2: Use a near-infrared camera to collect the actual posture of the robot end, obtain the measured posture of the optical markers on the robot's active platform, passive platform and ball joint, determine the rotation center coordinates of the robot's active platform and passive platform, and calibrate the center position of the ball joint; Step 3: Establish a robot error model, and use extended Kalman filtering to identify error parameters of the error model based on theoretical posture error and actual measurement error; Step 4: Build a BiTCN-BiGRU-Transformer neural network as the robot's error prediction model, use the error model built in step 3 to calculate the theoretical pose and the actual pose collected in step 2 for training, and obtain a robot error prediction model including geometric and non-geometric errors; use Pytorch to build a BiTCN-BiGRU-Transformer neural network, use the actual pose and error to train the network, and obtain an error compensation prediction model; Step 5: Perform real-time error compensation on the robot's joints based on the motion parameters output by the error prediction model. The error compensation parameters calculated by the prediction model are calculated to the joint angles of the six-axis robot through the robot's kinematic model to achieve real-time compensation for the robot's motion.
2. The kinematic calibration and error compensation method of a serial-parallel fracture reduction robot as claimed in claim 1, characterized in that: In step 1, a mapping model including the active kinematic chain joint variables and the parallel mechanism active platform center under the error state is established by using the mechanism method. The DH parameter of the active kinematic chain error model is expressed as: a′ i =a i +D a i ,a' i =a i +Da i ,d′ i =d i +Δd i ,θ′ i =θ i +Δθ i Among them, Δa i , Δα i , Δd i , Δθ i They are connecting rod length error, connecting rod torsion angle error, connecting rod eccentricity error, and joint angle error, respectively. i '、α i '、d i '、θ i ' are respectively the corrected connecting rod length, connecting rod torsion angle, connecting rod eccentric length, and joint angle; a i , α i ,d i ,θ i They are the basic connecting rod length, connecting rod torsion angle, connecting rod eccentric length, and joint angle, respectively, where i represents the i-th joint; Then the adjacent joint error model matrix of the active kinematic chain is: The error model of the active kinematic chain end is: f(T)=arg{minT=f(θ i ,Dth i ,a i ,D i ,a i ,Da i ,d i ,Δd i )} Since the planes where the two branches of the parallel mechanism are located are perpendicular to each other, the individual movement of each branch only affects the change in the position of the terminal output in one direction. Therefore, the parallel mechanism is divided into two branches for separate analysis. For the branch composed of the first connecting rod, we can obtain: ω1'=ω1+Δω1, L'1=L1+ΔL1, L'2=L2+ΔL2, L'3=L3+ΔL3, L'4=L4+ΔL4 Among them, ω1', L'1, L'2, L'3, and L'4 are the corrected active motion angle, passive motion angle, and length, respectively, Δ(*) represents the error amount, and ω1, L1, L2, L3, and L4 are the basic values of the parameters, respectively; The closed vector equation of the quadrilateral is: Transforming the vector equation into complex form is: Using the sine and cosine functions of the vector angle, the closed-loop vector equation expression is: ω1 and ω2 are solved by Newton's iteration method; Similarly, the branch chain composed of the second link is studied to obtain the end posture error model of the parallel mechanism: f'(T)=f(T)·Rot ω (ω3+Δω3)·Rot ω (ω6+Δω6) Among them, Rot ω () represents the rotation around the angle ω; Assume that the ball joint coordinate system is Sph T, then the end position of the parallel mechanism relative to the spherical joint coordinate system is: p o =f(q i ,T sph ,L),i=1,2,3,4,5,6 Among them, q i is the joint angle, T sph is the expression of the ball joint in the world coordinate system, L is the total length of the parallel mechanism; Then the terminal error model of the serial-parallel hybrid robot is:
3. A kinematic calibration and error compensation method for a serial-parallel fracture reduction robot as described in claim 1 or 2, characterized in that: In the step 2, the serial robot arm is unfolded, the end of the serial robot arm is fixedly connected to the active platform of the parallel mechanism by screws, the center of the active platform is controlled to collect data to meet the random motion parameters of the normal distribution, the near-infrared camera records the positions of the first optical marker, the second optical marker, and the third optical marker, and the above steps are transformed and repeated on the Y axis of the center of the active platform; The positions of the first optical marker, the second optical marker and the third optical marker are recorded by a near-infrared camera, so the rotation centers of the active platform and the passive platform can be calculated by the positions of the optical markers. Assuming the center of the fitted sphere is (x, y, z), the radius is r, and any point (x i ,y i ,z i ) to the center of the sphere: The collected data is taken in and (x, y, z) is fitted by the least square method, which is the coordinates of the rotation center of the active platform and the passive platform. The active and passive rotation centers A obtained by calibration are i (a i ,b i ,c i ) and B i (d i ,e i ,f i ), calculate the rod length L of the parallel mechanism: Assume that the fulcrum of the ball joint is P(x,y,z), and the rotation center of the joint before and after the rotation center is A i (a i ,b i ,c i ),B i (d i ,e i ,f i ), according to the vector formula: Calculate the cross product of the two vectors and get: Then and The square area of the parallelogram is: According to the cross multiplication theory, the connecting line of the centers of the two rotating joints at the front and rear of the mechanism should pass through the ball joint, that is, the straight line distance from the fulcrum to the two rotating joints should be equal to zero, and then Record residual The residual sum is: The partial derivative of the residual sum is obtained as: Find the minimum value of the residual sum, set the partial derivatives equal to zero, and divide by the coefficient N to get: Arranged into matrix form: Solve the equations to obtain the center coordinates P(x, y, z) of the spherical joint.
4. A kinematic calibration and error compensation method for a serial-parallel fracture reduction robot as claimed in claim 1 or 2, characterized in that: In step 3, the error parameters are solved according to the extended Kalman filter algorithm: With k =J k Δx k +V k Among them, Z k is the end position error of the kth point, J k is the error Jacobian matrix of the corresponding points, Δx k is the parameter error of the corresponding point, V k is the measurement error; By iterating the equation Δx k∣k-1 =Δx k-1∣k-1 A k∣k-1 =A k-1∣k-1 +B k-1 Where Δx k∣k-1 is the unaccounted error ΔP at point k k The parameter value, ω k-1 represents white noise with a mean of zero, B k-1 Represents the covariance matrix corresponding to white noise, and the Kalman gain is expressed as: Then the corrected error parameter can be expressed as A k∣k =(I-K k J k )A k∣k-1 The modified covariance matrix is: A k∣k =(I-K k J k )A k∣k-1 when The iterative solution is completed and the error parameter is obtained.
5. A kinematic calibration and error compensation method for a serial-parallel fracture reduction robot as claimed in claim 1 or 2, characterized in that: In step 4, the BiTCN-BiGRU-Transformer bidirectional temporal convolution is combined with the bidirectional gated recurrent unit to fuse the Transformer prediction model. A bidirectional branch BiTCN is added on the basis of TCN. The bidirectional gated recurrent unit BiGRU is also fused with the Transformer structure containing a multi-head self-attention mechanism. Compared with TCN, the role of the bidirectional temporal convolution in prediction is to extract the forward and backward time information in the input sequence to obtain better feature extraction capabilities. A bidirectional temporal convolutional network is established. The forward and reverse temporal convolutional models are composed of multiple residual blocks. Each residual block includes two layers of dilated causal convolution, two layers of weight normalization, two layers of leaky ReLU mapping, and two layers of regularization layers composed of Dropout and 1×1 convolution. The BiTCN model uses bidirectional dilated causal convolution and introduces residual blocks to construct an identity mapping, so that the model structure converges in the direction of the identity mapping, avoiding the increase of prediction error as the network deepens, and solving the problems of gradient explosion and gradient disappearance caused by the deepening of the network. Build a BiGRU bidirectional gated recurrent network to obtain the features processed by the bidirectional temporal convolution model. The BiGRU bidirectional gated recurrent network is a recursive neural network that can capture medium and long-distance dependencies. Through bidirectionality, the model's ability to perceive dynamic changes in time series prediction is improved. The special diagnosis obtained by BiTCN is input into the BiGRU layer. The hidden layer state h of BiGRU at time t t Through the forward state With reverse state The weighted summation yields: Among them, GRU represents the nonlinear transformation of the input, projecting the vector into the corresponding hidden layer state, w t and v t They represent the weights of the forward hidden layer and the reverse hidden layer of BiGRU at time t, respectively, and b t Represents the bias corresponding to the hidden layer at time t. The time series features extracted by BiGRU are input into the Transformer module. The entire Transformer module consists of a multi-head attention mechanism and a feedforward neural network. The input features first enter the multi-head attention module for feature fusion. The multi-head attention mechanism can process multiple input data in parallel. After multiple linear layers, it is connected to a normalization module and connected to the original data through a residual connection to enter the feedforward neural network. Then, the residual layer and the normalization layer are linearized and output. In the Transformer module, a multi-head self-attention layer is embedded in the module. The self-attention layer is used to capture the global dependencies in the feature data. The self-attention mechanism allows the network to dynamically adjust the weights of each time step during learning in order to better capture long-term dependencies and global patterns. The data of the robot's real posture collected in step 2 and the theoretical posture calculated after error model correction are divided into training set and validation set according to the set ratio, and the BiTCN-BiGRU-Transformer neural network is used for training. The Adam optimizer is used for model training, the learning rate is set, and the parameters are tuned. The loss function is the root mean square error RMSE, and the formula is as follows: Among them, n represents the number of samples, i represents the sample sequence, X, Y, Z, RX, RY, and RZ represent the true label position and posture errors, respectively, and X', Y', Z', RX', RY', and RZ' represent the predicted values, respectively.
