A pinn-based error compensation method for a robot arm
By using a PINN-based robotic arm error compensation method, combined with a dynamic physical parameter correction layer and a multi-stage residual fine-tuning module, the problems of poor parameter adaptability and insufficient physical consistency in traditional robotic arm error compensation are solved, achieving high-precision and robust attitude prediction and error compensation.
Patent Information
- Application Number
- CN202610036202.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-13
- Publication Date
- 2026-03-20
- Estimated Expiration
- 2046-01-13
AI Technical Summary
Traditional robotic arms struggle to dynamically adapt their DH parameters to parameter deviations caused by factors such as assembly errors, component wear, and flexible deformation, resulting in insufficient accuracy in kinematic modeling. Deep learning-driven error compensation models suffer from a lack of physical consistency and weak generalization ability.
A PINN-based error compensation method for robotic arms is adopted. By constructing a dynamic correction layer for physical parameters and a multi-stage residual fine-tuning module, combined with data-driven prediction of attitude angles, a multi-scale output fusion mechanism is introduced, and a total loss function is constructed for optimization, thus achieving deep integration of neural networks and robotic arm kinematic models.
It improves the physical consistency and interpretability of robotic arm posture prediction, enhances the model's generalization ability and accuracy under complex working conditions, and realizes online identification of robotic arm geometric parameters and accurate estimation of end-effector posture.
Smart Images

Figure CN121492066B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of deep learning, in particular to a mechanical arm error compensation method based on PINN. BACKGROUND
[0002] At present, the DH parameters of the traditional mechanical arm are obtained by static calibration and remain fixed for a long time, which is difficult to dynamically adapt to the deviation between the theoretical parameters and the real working condition parameters caused by non-ideal factors such as assembly error, part wear and flexible deformation, and further leads to insufficient kinematics modeling accuracy; the traditional error compensation model driven by deep learning only relies on data fitting to realize prediction, without deeply integrating the kinematics core physical laws of the mechanical arm, and generally has the problems of lack of physical consistency and weak model explainability; at the same time, the deep neural network is prone to gradient disappearance and feature information loss during training, which causes slow model convergence speed and insufficient running stability, and the existing loss function design cannot optimize the error characteristics in the high-precision interval, resulting in weak model generalization ability and difficulty in meeting the error compensation demand under complex and variable working conditions. SUMMARY
[0003] The present application aims to at least partially solve the technical problems of poor parameter adaptability, insufficient physical consistency and weak generalization ability in the existing mechanical arm error compensation method.
[0004] To this end, the present application discloses a mechanical arm error compensation method based on PINN, comprising the following steps:
[0005] S1: collecting the end space position, attitude angle, multi-axis real-time torque, multi-axis joint angle and sensor measured attitude angle of the mechanical arm to obtain an initial DH parameter matrix of the mechanical arm, wherein the end space position, the attitude angle, the multi-axis real-time torque and the multi-axis joint angle constitute an input feature vector;
[0006] S2: constructing a mechanical arm error compensation network based on PINN: at the end of the feature extraction network, based on the feature reuse architecture, a parallel branch is introduced after the output of the fine-tuning correction layer to establish a gradient flow channel across layers and form an MSR-FT multi-stage residual fine-tuning module; an auxiliary output branch is introduced on the side of the main regression path to realize multi-flow convergence through learnable weighting parameters and form an MS-OF multi-scale output fusion mechanism; finally, the dynamic DH parameter compensation term constrained by physics and the predicted attitude angle driven by data are output in parallel;
[0007] S3: based on the initial DH parameter matrix and the dynamic DH parameter compensation term, a physical parameter dynamic correction layer is constructed for superposition and correction, the homogeneous transformation matrix of each joint of the mechanical arm is calculated and multiplied to obtain a total transformation matrix, the rotation matrix is extracted from the total transformation matrix and the physical derived attitude angle is obtained through Euler angle transformation;
[0008] S4: calculating a data loss term, a small error enhancement term and a physical consistency loss term based on the sensor measurement pose angle, the predicted pose angle and the physically derived pose angle, wherein the data loss term, the small error enhancement term and the physical consistency loss term constitute a total loss function;
[0009] S5: based on the total loss function, calculating the gradient of all learnable parameters in the physical information neural network by chain rule, updating all learning weights in the physical information neural network and the dynamically constrained DH parameter compensation term by AdamW optimizer, and adjusting the learning rate by ReduceLROnPlateau until the training is completed;
[0010] S6: after the training is completed, using the trained physical information neural network to infer the measured robot arm, and outputting a high-reliability predicted pose angle constrained by physical laws in real time, and updating the initial kinematics model according to the dynamically constrained DH parameter compensation term output by the network, for online identification of the geometric parameters of the robot arm and accurate estimation of the end pose.
[0011] The PINN-based robot arm error compensation method disclosed in the application has the following beneficial effects:
[0012] (1) strong physical consistency: by introducing a dynamically constrained DH parameter compensation term, combining with the forward kinematics constraint to construct a physical parameter dynamic correction layer, realizing the deep fusion of the neural network and the kinematics model of the robot arm, and ensuring that the pose prediction result strictly follows the motion law of the robot arm, effectively improving the physical rationality of the model output;
[0013] (2) high interpretability: the dynamically constrained DH parameter compensation term output by the network corresponds to structural parameters such as link length, offset and torsion angle, which have clear physical meanings, and can clearly trace the decision logic and error compensation mechanism of the model for the motion state of the robot arm, avoiding the black box problem of traditional data-driven models;
[0014] (3) precision and robustness: the total loss function composed of the data loss term, the small error enhancement term and the physical consistency loss term realizes constraint optimization, and at the same time, relying on the MSR-FT multi-stage residual fine-tuning module and the MS-OF multi-scale output fusion mechanism improves the feature extraction and parameter optimization efficiency, so that the model not only realizes high-precision pose prediction, but also has excellent generalization ability and environmental adaptability, effectively meeting the error compensation demand under complex working conditions.
[0015] In addition, the PINN-based robot arm error compensation method disclosed in the application can also have the following additional technical features:
[0016] Further, in the step S1:
[0017] The input feature vector is:
[0018] wherein the end-space position is , the attitude angle is , the multi-axis real-time torque is , and the multi-axis joint angle is ;
[0019] The sensor measured attitude angle is ;
[0020] The initial DH parameter matrix is wherein is the length of the connecting rod between adjacent joint axes, is the offset of the connecting rod along the previous joint axis, is the torsion angle between adjacent axes, is the rotation angle of the jth joint.
[0021] Further, in the step S2: the feature extraction network, specifically wherein is a learnable weight, is a learnable bias term, is a LeakyReLU activation function.
[0022] Further, in the step S2: in the MSR-FT multi-stage residual fine-tuning module, the features after the first fine-tuning are divided into two flow branches: a deep refinement branch and a short-circuit adaptation branch; the deep refinement branch further extracts high-order semantics through a fine-tuning correction auxiliary layer, and the short-circuit adaptation branch performs dimension alignment and feature reservation through a short-circuit adaptation layer; finally, the short-circuit features are weighted using a weighted residual fusion, and the deep layer features are executed to obtain a fused feature vector form of the main output, and then the main output is divided into a predicted attitude angle and a dynamic DH parameter compensation term to establish a gradient flow channel across layers.
[0023] Further, in the step S2: in the MS-OF multi-scale output fusion mechanism, an auxiliary output branch is introduced in the output layer, which directly obtains global feature information from the front-end feature extraction network; the auxiliary features are dynamically scaled by introducing learnable parameters to obtain , which is linearly superimposed with the predicted attitude angle in the main output, so as to optimize the parameter update of the deep and shallow networks in parallel in the back propagation.
[0024] Furthermore, the deep refinement branch utilizes a fine-tuning auxiliary layer to perform high-order semantic extraction on the input features, thereby obtaining a deep feature vector. : ,in It includes linear transformation, batch normalization, and activation operations to extract higher-dimensional nonlinear kinematic features.
[0025] Furthermore, the short-circuit adaptation branch utilizes the short-circuit adaptation layer to establish a characteristic direct connection channel, firstly for... LeakyReLU activation is performed, followed by dimension alignment via linear projection to obtain the fitting features. : ,in, To adapt branch weights for short-circuit testing, For short-circuit adaptation branch bias terms, The parameters for the LeakyReLU activation function are used. The short-circuit adaptation branch can preserve the low-frequency fundamental information in the input signal and prevent gradient vanishing in deep networks.
[0026] Furthermore, the weighted residual fusion involves introducing a scaling factor in the output stage. The short-circuit features are weighted and then summed linearly with the predictions from the deep features to obtain the final output. : During backpropagation, the network establishes a coupled update mechanism between the main gradient and auxiliary gradients. The coefficients ensure that auxiliary information provides effective gradient correction without interfering with the learning of the main features.
[0027] Furthermore, the main output in the form of the fused feature vector... It is a composite vector containing kinematic states and physical parameter corrections; by partitioning the vector space, Decoupling consists of two parts: , among which, the former Dimensional components It is directly used as the predicted output for the attitude angle; later Dimensional components It serves as a dynamic DH parameter compensation term subject to physical constraints, used to correct the DH kinematic parameter table in real time, thereby achieving deep integration of the physical model and the neural network.
[0028] Furthermore, in step S3: the physical parameter dynamic correction layer is constructed based on the initial DH parameter matrix and the dynamic DH parameter compensation term for superposition correction. The calculation of the superposition correction of the physical parameter dynamic correction layer is as follows: ,in, The scale constraint constant is This is the tanh activation function.
[0029] Further, in the step S3: the homogeneous transformation matrix of each joint of the mechanical arm is ;
[0030] The total transformation matrix is , wherein, is the rotation matrix of the end, is the position vector of the end effector;
[0031] The calculation of the Euler angle transformation of the rotation matrix is .
[0032] Further, in the step S4: the data loss term is , wherein, is the number of samples, is the predicted pose angle, is the sensor measured pose angle; the small error enhancement term is , wherein, is the weight term, is the control parameter; the physical consistency loss term is , wherein, is the physically derived pose angle, is the positive kinematics function.
[0033] Further, in the step S5: the calculation of the chain method, specifically , wherein, is all the learnable parameters of the physical information neural network; the training target of the physical information neural network is .
[0034] Additional contents and advantages of the present application will be given in the following description, or can be understood through the practice of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0035] The technical solutions and beneficial effects of the present application will become apparent and easy to understand from the following content combined with the drawings, wherein:
[0036] Figure 1 is a flowchart of the PINN-based mechanical arm error compensation method of the present application;
[0037] Figure 2 is a result graph in the constant speed state in the technical solution of the present application;
[0038] Figure 3 is a result graph in the low speed state in the technical solution of the present application;
[0039] Figure 4A result graph in a high-speed state in the technical solution of the present application;
[0040] Figure 5 Another flowchart of the PINN-based mechanical arm error compensation method of the present application;
[0041] Figure 6 DH parameter joint corresponding kinematics mapping relationship diagram of the PINN-based mechanical arm error compensation method of the present application. DETAILED DESCRIPTION
[0042] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments.
[0043] The PINN-based mechanical arm error compensation method disclosed in the present application will be described below with reference to the drawings.
[0044] As shown in Figure 1 , Figure 2 , Figure 3 , Figure 4 , Figure 5 and Figure 6 , a PINN-based mechanical arm error compensation method comprises the following steps:
[0045] S1: Collect the end space position, attitude angle, multi-axis real-time torque, multi-axis joint angle and sensor measured attitude angle of the mechanical arm to obtain an initial DH parameter matrix of the mechanical arm, wherein the end space position, attitude angle, multi-axis real-time torque and multi-axis joint angle constitute an input feature vector;
[0046] S2: Construct a PINN-based mechanical arm error compensation network: at the end of the feature extraction network, based on the feature multiplexing architecture, a parallel branch is introduced after the output of the fine-tuning correction layer to establish a cross-level gradient flow channel, constituting an MSR-FT multi-stage residual fine-tuning module; an auxiliary output branch is introduced on the side of the main regression path, and multi-flow convergence is realized through learnable weighting parameters, constituting an MS-OF multi-scale output fusion mechanism; finally, the physical constraint dynamic DH parameter compensation term and the data-driven predicted attitude angle are output in parallel;
[0047] S3: Based on the initial DH parameter matrix and the dynamic DH parameter compensation term, a physical parameter dynamic correction layer is constructed for superimposed correction, the homogeneous transformation matrix of each joint of the mechanical arm is calculated and multiplied to obtain a total transformation matrix, and the rotation matrix is extracted from the total transformation matrix and the physical derived attitude angle is obtained through Euler angle transformation;
[0048] S4: based on the sensor measurement attitude angle, the predicted attitude angle and the physically derived attitude angle, calculating the data loss term, the small error enhancement term and the physical consistency loss term, wherein the data loss term, the small error enhancement term and the physical consistency loss term constitute a total loss function;
[0049] S5: based on the total loss function, calculating the gradient of all learnable parameters in the physical information neural network by chain rule, updating all learning weights and dynamic DH parameter compensation terms in the physical information neural network by AdamW optimizer, and adjusting the learning rate by ReduceLROnPlateau until the training is completed;
[0050] S6: after the training is completed, using the trained physical information neural network to infer the measured robot arm, and outputting the high-reliability predicted attitude angle constrained by the physical law in real time, and updating the initial kinematics model according to the dynamic DH parameter compensation term output by the network, for online identification of the geometric parameters of the robot arm and accurate estimation of the end posture.
[0051] In step S1:
[0052] The input feature vector is:
[0053] , wherein the end space position is , the attitude angle is , the multi-axis real-time torque is , and the multi-axis joint angle is ;
[0054] The sensor measured attitude angle is ;
[0055] The initial DH parameter matrix is , wherein is the length of the connecting rod between adjacent joint axes, is the offset of the connecting rod along the previous joint axis, is the torsion angle between adjacent axes, is the rotation angle of the jth joint.
[0056] In step S2: the feature extraction network is specifically , wherein is the learnable weight, is the learnable bias term, is the LeakyReLU activation function.
[0057] In step S2: in the MSR-FT multi-stage residual fine-tuning module, the features after primary fine-tuning are divided into two branches: a deep refinement branch and a short circuit adaptation branch; the deep refinement branch further extracts high-order semantics through a fine-tuning correction auxiliary layer, and the short circuit adaptation branch performs dimension alignment and feature reservation through a short circuit adaptation layer; finally, the short circuit features are weighted using a weighted residual fusion, and a weighted linear sum is performed with the deep features to obtain a main output in the form of a fusion feature vector, and the main output is divided into a predicted pose angle and a dynamic DH parameter compensation term to establish a gradient flow channel across layers.
[0058] In step S2: in the MS-OF multi-scale output fusion mechanism, an auxiliary output branch is introduced at the output layer, which directly obtains global feature information from the front-end feature extraction network; the auxiliary features are dynamically scaled by introducing learnable parameters to obtain , which is linearly superimposed with the predicted pose angle in the main output, so that the parameter updates of the deep and shallow networks are optimized in parallel in the back propagation.
[0059] The deep refinement branch uses a fine-tuning correction auxiliary layer to extract high-order semantic features from the input features to obtain deep feature vectors . , wherein contains linear transformation, batch normalization and activation operation, which is used to extract higher-dimensional nonlinear kinematic features.
[0060] The short circuit adaptation branch uses a short circuit adaptation layer to establish a direct feature channel. Firstly, the input signal is activated by LeakyReLU, and then dimension alignment is performed by linear projection to obtain adaptive features . , wherein is the short circuit adaptation branch weight, is the short circuit adaptation branch bias, is the LeakyReLU activation function parameter, and the short circuit adaptation branch can reserve the low-frequency basic information in the input signal to prevent gradient vanishing in the deep network.
[0061] Weighted residual fusion: in the output stage, a scaling factor is introduced to weight the short circuit features, and a weighted linear sum is performed with the predicted results of the deep features, and finally is outputted. , the network forms a coupled update mechanism of main gradient and auxiliary gradient in the back propagation, the coefficients of which ensure that the auxiliary information provides effective gradient correction without interfering with the main feature learning.
[0062] The main output in the form of a fusion feature vector is a compound vector containing kinematic state and physical parameter correction amount; by vector space cutting, it is decoupled into two parts: : wherein the former dimension component is directly taken as the predicted output of the predicted attitude angle; the latter dimension component is taken as the dynamic DH parameter compensation item subject to physical constraints, used to correct the DH kinematic parameter table in real time, realizing the deep fusion of the physical model and the neural network.
[0063] In step S3: based on the initial DH parameter matrix and the dynamic DH parameter compensation item, a physical parameter dynamic correction layer is constructed for superimposed correction, and the calculation of the physical parameter dynamic correction layer for superimposed correction is wherein is a scale constraint constant, is a tanh activation function.
[0064] In step S3: the homogeneous transformation matrix of each joint of the mechanical arm is .
[0065] The total transformation matrix is wherein is the rotation matrix of the end, is the position vector of the end effector;
[0066] The calculation of the Euler angle transformation of the rotation matrix is .
[0067] In step S4: the data loss term is wherein is the number of samples, is the predicted attitude angle, is the sensor measured attitude angle; the small error enhancement term is wherein is a weight item, is a control parameter; the physical consistency loss term is wherein is the physically derived attitude angle, is the forward kinematics function.
[0068] In step S5: the calculation of the chain rule, specifically wherein is all the learnable parameters of the physical information neural network; the training target of the physical information neural network is .
[0069] Embodiment
[0070] This embodiment is used to illustrate the specific implementation process and effect of the PINN-based mechanical arm error compensation method of the application.
[0071] (I) Equipment Introduction
[0072] The mechanical arm error compensation system is composed of a six-axis industrial robot, a high-precision gyroscope, a lower computer processing unit and an upper computer. The Bort BRTIRUS1510A six-axis industrial robot is selected as the main body for error compensation of the application, and the HWT9073-CAN gyroscope is used to measure the attitude of the robot end effector.
[0073] The HWT9073-CAN gyroscope can accurately output the current attitude of the module in a dynamic environment, with an attitude measurement accuracy of 0.001 degrees and stability meeting the requirements of this embodiment.
[0074] The lower computer processing unit communicates with the gyroscope through the CAN bus to realize data acquisition of the gyroscope and wireless transmission and reception with the upper computer. The lower computer processing unit and the gyroscope together constitute a robot end attitude angle measurement device.
[0075] (II) Data Acquisition
[0076] The data acquisition process of this embodiment is performed as follows:
[0077] First, the HWT9073-CAN gyroscope is rigidly fixed to the Bort BRTIRUS1510A six-axis industrial robot end flange through a bracket, ensuring that the gyroscope coordinate system and the robot end effector coordinate system are completely coincident, eliminating the influence of installation deviation on the measurement results. The gyroscope outputs roll angle, pitch angle and yaw angle data in real time, providing original attitude data for subsequent error compensation.
[0078] Second, the lower computer processing unit establishes a communication connection with the HWT9073-CAN gyroscope through the CAN bus and receives the attitude angle data frames (including timestamp, roll angle, pitch angle, yaw angle and data check bit) output by the gyroscope in real time. The lower computer performs preliminary preprocessing on the received original data, first analyzes the data frame format, filters invalid frames with verification errors, and then uses a sliding average filtering algorithm to reduce noise on valid attitude angle data, further reducing high-frequency noise interference. Subsequently, the lower computer transmits the preprocessed attitude angle data to the upper computer in the form of timestamp, roll angle, pitch angle and yaw angle according to the self-defined format.
[0079] Finally, the upper computer communicates with the BRTIRUS1510A robot through the TCP / IP protocol to realize control, while receiving the gyroscope data transmitted by the lower computer.
[0080] (III) Specific Effects
[0081] As shown in Table 1, to compensate for the absolute pose error test results of the end effector of the mechanical arm under different speed conditions before:
[0082] Table 1 shows the absolute pose error of the end effector of the mechanical arm measured by the test sample before compensation under different speed conditions. Among them, the maximum error of the U, V, and W components of the mechanical arm under low speed condition is 1.6444 degrees, 1.4706 degrees, and 1.3275 degrees, respectively; the maximum error of the U, V, and W components of the mechanical arm under high speed condition is 1.8793 degrees, 1.5404 degrees, and 1.4495 degrees, respectively. The increase in speed significantly increases the deviation between the measured value and the expected value, which indicates that the increase in the running speed of the mechanical arm will directly exacerbate the absolute pose error of its end effector, and the influence on different components is significantly uneven. At the same time, the R² value of each component under the three conditions is less than 0.985, indicating that the fitting degree of the theoretical value and the measured value of the original data is insufficient, which cannot meet the high-precision control requirement, and also confirms the technical limitations of the traditional mechanical arm kinematics model in dealing with speed changes, assembly errors and other factors.
[0083] Table 1 Performance indicators of three groups of data before compensation
[0084]
[0085] As shown in Table 2, after the error compensation method based on PINN of the present application is processed, the technical effect of the mechanical arm pose measurement is:
[0086] (1) The error is greatly reduced:
[0087] Under low speed condition, the maximum error of U component is reduced from 1.6444 degrees to 0.3193 degrees, MAE is reduced from 0.631148 degrees to 0.079293 degrees, and RMSE is reduced from 0.764903 degrees to 0.099222 degrees; under high speed condition, the maximum error of V component is reduced from 1.5404 degrees to 0.2912 degrees, MAE is reduced from 0.602959 degrees to 0.093719 degrees, and RMSE is reduced from 0.695908 degrees to 0.112232 degrees. The maximum error of each component under all conditions is controlled within 0.36 degrees, the overall MAE is less than 0.09 degrees, and the RMSE is not more than 0.108 degrees.
[0088] (2) The fitting degree and stability are excellent:
[0089] The R² value of each component and the overall is improved to more than 0.9995, among which the overall R² under low speed condition reaches 0.999629, indicating that the compensated data is highly consistent with the true pose. And from low speed to high speed condition, it is significantly better than the problem of error explosion with the increase of speed in traditional algorithm, which reflects the strong adaptability of the present application to different conditions.
[0090] (3) Precision pass rate is significantly improved:
[0091] The precision pass rate of ≤0.5 degrees is 100% under all working conditions, the precision pass rate of ≤0.15 degrees is over 83%, and the precision pass rate of ≤0.05 degrees is in the range of 31%-37.5%.
[0092] This result fully proves that the present application effectively solves the problems of poor parameter adaptability, insufficient physical consistency and weak generalization ability in the existing mechanical arm error compensation method through the synergistic effect of the physical parameter dynamic correction layer, the MSR-FT multi-stage residual fine-tuning module and the MS-OF multi-scale output fusion mechanism, realizes online identification of the geometric parameters of the mechanical arm and accurate estimation of the end posture.
[0093] Table 2 Data performance indicators after data compensation of three groups
[0094]
[0095] Comparative example
[0096] The present comparative example aims to compare the performance difference between the present application and the existing conventional mechanical arm error compensation technology, and three existing conventional compensation technologies of XGboost, back propagation (BP) neural network and random forest are selected to carry out comparative experiments, and the specific results are shown in Table 3.
[0097] Table 3 Posture error evaluation index after compensation
[0098]
[0099] As can be seen from the data in Table 3, the three classical algorithms all have the existing technical defects to be solved by the present application under different speed working conditions, and the defects become more prominent with the increase of speed:
[0100] Under low speed working condition, the BP neural network has high frequency oscillation, the XGboost has local fluctuation, and the random forest has the highest maximum error;
[0101] In normal speed working condition, the maximum error of the random forest suddenly rises to 0.8519, and the error of the XGboost slightly deteriorates;
[0102] Under high speed working condition, the 0.15 pass rate of the BP neural network decreases to 56.61%, and the RMSE of the random forest rises to 0.4198.
[0103] While the present application has stable and excellent performance under all working conditions, R 2The maximum error is as low as 0.3082-0.3595, and the qualified rate of 0.15 is more than 83%. The advantages of the application are derived from the synergistic effect of the physical parameter dynamic correction layer, the MSR-FT multi-stage residual fine-tuning module and the MS-OF multi-scale output fusion mechanism, which can dynamically focus on key features, optimize the efficiency of cross-level gradient propagation, and integrate the forward kinematics physical constraints of the mechanical arm, realizing the deep fusion of data-driven and physical laws.
[0104] However, the traditional error compensation algorithm is difficult to adapt to complex working condition changes due to the lack of physical modeling support or the limitation of network structure design, and its performance is significantly inferior to that of the method of the application.
[0105] According to the PINN-based mechanical arm error compensation method disclosed by the application, the following beneficial effects are achieved:
[0106] (1) Strong physical consistency: by introducing a dynamic DH parameter compensation term subject to physical constraints, combining the forward kinematics constraint to construct a physical parameter dynamic correction layer, realizing the deep fusion of the neural network and the kinematics model of the mechanical arm, ensuring that the pose prediction result strictly follows the mechanical arm motion law, and effectively improving the physical rationality of the model output;
[0107] (2) High interpretability: the dynamic DH parameter compensation term output by the network corresponds to the structural parameters such as link length, offset and twist angle, which have clear physical meaning, and can clearly trace the decision logic and error compensation mechanism of the model for the motion state of the mechanical arm, avoiding the black box problem of traditional data-driven models;
[0108] (3) Precision and robustness: the total loss function composed of the data loss term, the small error enhancement term and the physical consistency loss term realizes constraint optimization, and at the same time relies on the MSR-FT multi-stage residual fine-tuning module and the MS-OF multi-scale output fusion mechanism to improve the feature extraction and parameter optimization efficiency, so that the model not only realizes high-precision pose prediction, but also has excellent generalization ability and environmental adaptability, effectively meeting the error compensation demand under complex working conditions.
[0109] Although the embodiments of the application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the application.
Claims
1. A method for compensating errors in a robotic arm based on PINN, characterized in that, Includes the following steps: S1: Collect the end-effector spatial position, attitude angle, multi-axis real-time torque, multi-axis joint angle and sensor-measured attitude angle of the robotic arm to obtain the initial DH parameter matrix of the robotic arm, wherein the end-effector spatial position, the attitude angle, the multi-axis real-time torque and the multi-axis joint angle constitute the input feature vector; S2: Constructing a PINN-based error compensation network for a robotic arm: At the end of the feature extraction network, based on a feature reuse architecture, a parallel branch is introduced after the fine-tuning correction layer output to establish a gradient flow channel across layers, forming an MSR-FT multi-stage residual fine-tuning module; an auxiliary output branch is introduced beside the main regression path, and multi-stream convergence is achieved through learnable weighted parameters, forming an MS-OF multi-scale output fusion mechanism; finally, the physically constrained dynamic DH parameter compensation term and the data-driven predicted attitude angle are output in parallel. S3: Based on the initial DH parameter matrix and the dynamic DH parameter compensation term, a physical parameter dynamic correction layer is constructed for superposition correction. The homogeneous transformation matrix of each joint of the robotic arm is calculated and multiplied to obtain the total transformation matrix. The rotation matrix is extracted from the total transformation matrix and the physical derivation attitude angle is obtained through Euler angle transformation. S4: Based on the sensor-measured attitude angle, the predicted attitude angle, and the physically derived attitude angle, calculate the data loss term, the small error enhancement term, and the physical consistency loss term, wherein the data loss term, the small error enhancement term, and the physical consistency loss term constitute the total loss function; S5: Based on the total loss function, calculate the gradient of all learnable parameters in the physical information neural network using the chain method, update all learning weights and the compensation term of the physically constrained dynamic DH parameters in the physical information neural network using the AdamW optimizer, and adjust the learning rate using ReduceLROnPlateau until training is complete. S6: After training is completed, the physical information neural network that has converged during training is used to infer the robotic arm under test and output a highly reliable predicted attitude angle constrained by physical laws in real time. At the same time, the initial kinematic model is updated based on the dynamic DH parameter compensation term output by the network.
2. The PINN-based robotic arm error compensation method as described in claim 1, characterized in that, In step S1: The input feature vector is: Wherein, the spatial position of the end is The attitude angle is The multi-axis real-time torque is The multi-axis joint angle is ; The sensor measures the attitude angle as follows: ; The initial DH parameter matrix is as follows: ,in, This refers to the length of the link between adjacent joint axes. This represents the offset of the link along the axis of the previous joint. The angle of twist between adjacent axes. For the first The rotation angle of each joint.
3. The PINN-based robotic arm error compensation method as described in claim 1, characterized in that, In step S2: the feature extraction network is specifically... ,in, For learnable weights, For learnable bias terms, This is the LeakyReLU activation function.
4. The PINN-based robotic arm error compensation method as described in claim 1, characterized in that, In step S2: In the MSR-FT multi-stage residual fine-tuning module, the features after first-level fine-tuning are divided into two flow branches: a deep refinement branch and a short-circuit adaptation branch; the deep refinement branch further extracts higher-order semantics through fine-tuning and correcting the auxiliary layer, while the short-circuit adaptation branch performs dimension alignment and feature preservation through the short-circuit adaptation layer; finally, the short-circuit features are weighted using weighted residual fusion, and a weighted linear sum is performed with the deep features to obtain the main output in the form of a fused feature vector, and then the main output is divided into predicted pose angle and dynamic DH parameter compensation term to establish a gradient flow channel across layers.
5. The PINN-based robotic arm error compensation method as described in claim 1, characterized in that, In step S2: In the MS-OF multi-scale output fusion mechanism, an auxiliary output branch is introduced in the output layer. This branch directly obtains global feature information from the front-end feature extraction network. By introducing learnable parameters to dynamically scale the auxiliary features, we obtain... This is then linearly superimposed with the predicted attitude angle in the main output, thereby optimizing the parameter updates of deep and shallow networks in parallel during backpropagation.
6. The PINN-based robotic arm error compensation method as described in claim 4, characterized in that, The deep refinement branch utilizes a fine-tuning auxiliary layer to perform high-order semantic extraction on the input features, resulting in a deep feature vector. : ,in It includes linear transformation, batch normalization, and activation operations to extract higher-dimensional nonlinear kinematic features.
7. The PINN-based robotic arm error compensation method as described in claim 4, characterized in that, The short-circuit adaptation branch establishes a characteristic direct connection channel using the short-circuit adaptation layer, firstly for... LeakyReLU activation is performed, followed by dimension alignment via linear projection to obtain the fitting features. : Short-circuit adaptation branches can preserve low-frequency fundamental information in the input signal, preventing gradient vanishing in deep networks.
8. The PINN-based robotic arm error compensation method as described in claim 4, characterized in that, The weighted residual fusion described above: In the output stage, a scaling factor is introduced. The short-circuit features are weighted and then summed linearly with the prediction results of the deep features to obtain the final output. : During backpropagation, the network establishes a coupled update mechanism between the main gradient and auxiliary gradients. The coefficients ensure that the auxiliary information provides effective gradient correction without interfering with the learning of the main features.
9. The PINN-based robotic arm error compensation method as described in claim 4, characterized in that, The main output in the form of the fused feature vector It is a composite vector containing kinematic states and physical parameter corrections; by partitioning the vector space, Decoupling consists of two parts: , among which, the former Dimensional components It is directly used as the predicted output for the attitude angle; later Dimensional components It serves as a dynamic DH parameter compensation term subject to physical constraints, used to correct the DH kinematic parameter table in real time, thereby achieving deep integration of the physical model and the neural network.
10. The PINN-based robotic arm error compensation method as described in claim 1, characterized in that, In step S3: the physical parameter dynamic correction layer is constructed based on the initial DH parameter matrix and the dynamic DH parameter compensation term for superposition correction. The calculation of the superposition correction of the physical parameter dynamic correction layer is as follows: ,in, For scale constraint constants, This is the tanh activation function.
11. The PINN-based robotic arm error compensation method as described in claim 1, characterized in that, In step S3: the homogeneous transformation matrix of each joint of the robotic arm is ; The total transformation matrix is: ,in, For the rotation matrix at the end, The position vector of the end effector; For rotation matrix The calculation of the Euler angle transformation is as follows: .
12. The PINN-based robotic arm error compensation method as described in claim 1, characterized in that, In step S4: the data loss term is ,in, For the sample size, To predict attitude angles, The sensor measures the attitude angle; the small error enhancement term is... ,in, As a weighted term, For control parameters; the physical consistency loss term is ,in, To derive the attitude angle from a physical perspective, It is a positive kinematic function.
13. The PINN-based robotic arm error compensation method as described in claim 1, characterized in that, In step S5: the calculation using the chain method is specifically as follows: ,in, These are all learnable parameters of the physical information neural network; the training objective of the physical information neural network is... .
Citation Information
Patent Citations
Redundant robot repetitive motion planning method based on initial value correction
CN118123811A
Physical and data hybrid driven mechanical arm dynamic model identification method
CN120562257A