A multi-head GAT-based industrial robot positioning error compensation method and system

By constructing graph-structured data to train a multi-head GAT network, the problem of low positioning accuracy in existing technologies is solved, and high-precision positioning error compensation is achieved in complex environments, which is suitable for positioning error compensation of industrial robots.

CN117103258BActive Publication Date: 2025-12-19HUAZHONG UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311065690.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-22
Publication Date
2025-12-19
Estimated Expiration
2043-08-22

AI Technical Summary

Technical Problem

Existing industrial robot positioning error compensation technologies suffer from low positioning accuracy, making it difficult to meet high-precision operation requirements, especially in complex environments. Existing methods cannot effectively consider geometric and non-geometric errors and require modification of robot controller parameters.

Method used

A localization error compensation method based on multi-head GAT is adopted. A multi-head graph attention network is trained by constructing graph structure data, an adjacency matrix is ​​constructed using joint angles and localization error nodes, features are extracted using the multi-head attention mechanism, and localization accuracy is improved by iteratively optimizing the compensation of joint angles.

Benefits of technology

It effectively improves robot positioning accuracy, can enhance positioning accuracy without modifying controller parameters, reduces the number of inverse kinematics calculations, and has wide applicability and high stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117103258B_ABST
    Figure CN117103258B_ABST
Patent Text Reader

Abstract

The application discloses a kind of industrial robot positioning error compensation method and system based on multi-head GAT, wherein the method comprises: collecting joint angle and its corresponding positioning error in the industrial robot workspace, a set of joint angle and its corresponding positioning error are constructed as a node in graph to construct node set, adjacent matrix is constructed by the Euclidean distance between nodes, and node set and adjacent matrix form graph structure data;Multi-head GAT is trained using graph structure data, the error between the predicted positioning error and the positioning error of the node in the input layer is calculated, the weight parameters of multi-head GAT are updated by back propagation, and the trained multi-head GAT is obtained by training to convergence, as a positioning error prediction model.The joint angle before industrial robot executes motion instruction is input into the positioning error prediction model, and the joint angle of industrial robot is compensated using the output positioning error.The positioning accuracy of industrial robot after being compensated using the method of the application is high.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of industrial robot positioning error compensation, and more particularly relates to an industrial robot positioning error compensation method and system based on a multi-head GAT. BACKGROUND

[0002] Industrial robots usually need to complete high-precision work in complex environments, and how to ensure and improve the positioning accuracy of robots is one of the current research hotspots. The positioning accuracy of industrial robots is divided into absolute positioning accuracy and repeat positioning accuracy. The repeat positioning accuracy of the industrial robots on the market is generally high, and the absolute positioning accuracy is relatively low, which is difficult to meet the requirements of high-precision processes. When the robot performs large-scale complex processing in the workspace, it will frequently convert positions and postures in a large range, resulting in continuous changes in positioning errors. In this case, it is very difficult to accurately control the positioning accuracy. Therefore, the prediction and compensation of robot positioning errors are important research fields.

[0003] Robot positioning error compensation is mainly divided into model compensation and non-model compensation.

[0004] In the field of kinematic model compensation, domestic and foreign researchers have conducted a large amount of research on parameter identification methods, and have achieved good and stable identification effects. However, kinematic model compensation only considers the geometric error of the robot, so in order to further improve the positioning accuracy, it is necessary to model, predict and compensate non-geometric errors. In addition, some methods in kinematic model compensation need to modify the kinematic parameters in the robot controller, but commercial robots usually do not have the permission to modify the controller, so these methods are also difficult to be applied in practice.

[0005] The methods in the field of non-kinematic model compensation generally consider both geometric errors and non-geometric errors, which can more effectively compensate for positioning errors. However, the overall technology is not mature enough, and a standardized application scheme has not been formed. The mainstream space interpolation method and data-driven method in this field have some problems.

[0006] In the space interpolation method, the space grid interpolation method can predict and compensate the positioning error of the robot to a certain extent, but it often needs to sample in high-dimensional space, and the sampling method will affect the final positioning error prediction and compensation. In addition, the number of sampling points is often large, which requires a lot of time to collect data, and when predicting the error, it only relies on mathematical interpolation methods, which do not fully utilize the characteristics of the robot to improve the interpolation effect.

[0007] Data-driven methods are mainly based on various machine learning and neural networks, but these methods regard the collected joint angles and positioning errors as sample points in the Euclidean space, and input the Euclidean data into the model for training. However, the positioning error of an industrial robot is caused by the continuous superposition of joint errors and link errors, and there is certain structural information. If the Euclidean data is used as the input of the model, the structural features between the data cannot be extracted, and the accuracy of the finally predicted positioning error is reduced.

[0008] Therefore, the existing industrial robot positioning error compensation technology has the technical problem of low positioning accuracy. SUMMARY

[0009] In view of the above defects or improvement needs of the prior art, the present application provides an industrial robot positioning error compensation method and system based on multi-head GAT (Graph Neural Network), thereby solving the technical problem of low positioning accuracy of the existing industrial robot positioning error compensation technology.

[0010] To achieve the above-mentioned purpose, according to one aspect of the present application, an industrial robot positioning error compensation method based on multi-head GAT is provided, comprising:

[0011] Inputting the joint angles before the industrial robot executes the motion instruction into the positioning error prediction model, and using the output positioning error to compensate the joint angles before the industrial robot executes the motion instruction;

[0012] The positioning error prediction model is obtained by the following method:

[0013] Collecting joint angles and their corresponding positioning errors within the industrial robot workspace, constructing a node set by taking a group of joint angles and their corresponding positioning errors as a node in the graph, constructing an adjacency matrix through the Euclidean distance between nodes, and the node set and the adjacency matrix constitute the graph structure data;

[0014] Training the multi-head GAT using the graph structure data, the multi-head GAT including an input layer, a feature extractor, a feature fitter and an output layer, the feature extractor including multiple layers of GAT, and a multi-head attention mechanism being arranged in each GAT;

[0015] During training, the input layer inputs the nodes in the graph structure data and their multi-order neighborhood nodes in the adjacency matrix into the feature extractor;

[0016] In each layer of GAT, the similarity coefficients between the nodes and the neighborhood nodes of each order are calculated in parallel through the multi-head attention mechanism to extract features, the features extracted by the multi-head attention mechanism are fused as the output of each layer of GAT, and the outputs of the multiple layers of GAT are spliced and input into the feature fitter at the end of the feature extractor.

[0017] The feature fittinger inputs and outputs the features output by the feature extractor after dimension reduction, and finally outputs the predicted positioning error;

[0018] The error between the predicted positioning error and the positioning error of the node in the input layer is calculated, the weight parameters of the multi-head GAT are updated by back propagation, and the training is performed until convergence, so as to obtain the trained multi-head GAT, which is used as the positioning error prediction model.

[0019] Further, the method further comprises:

[0020] The joint angle before the industrial robot executes the motion instruction is input into the positioning error prediction model, and the positioning error is output;

[0021] The positioning error output by the positioning error prediction model is added to the position corresponding to the joint angle before the industrial robot executes the motion instruction to obtain the actual position, the pseudo target position is calculated by the actual position and the preset target position, and the pseudo target position is solved in reverse to obtain the corrected joint angle;

[0022] The corrected joint angle is used to calculate a new pseudo target position, and multiple iterations are performed until the distance error between the actual position calculated by the corrected joint angle and the preset target position is less than an error threshold or the number of iterations is greater than an iteration threshold, and the corrected joint angle at this time is used as the joint angle of the industrial robot after positioning error compensation.

[0023] Further, the joint angle of the industrial robot after positioning error compensation is obtained by the following steps:

[0024] (1) Set the iteration counter to zero k=0, and set the initial value of the pseudo target position P pse to the target position P0, and set the error threshold E t and the iteration threshold k t .

[0025] (2) Calculate the actual position after the kth iteration correction based on the positioning error

[0026]

[0027] In the formula, is the position corresponding to the joint angle , and f is the positioning error prediction model, so that is the positioning error predicted by f,

[0028] (3) Calculate the distance error E of the actual position after the kth iteration correction from the target position P0.​

[0029]

[0030] In the formula, ε(·) is defined as:

[0031]

[0032] In the formula, x a y a and z a For actual location The three coordinate components; x0, y0, and z0 are the three coordinate components of the target position P0; and Predicted positioning error The three components;

[0033] If E is less than the minimum error E recorded during the iteration process best Then update E best =E, and update the optimal joint angle. Otherwise, proceed to step (4) to continue iterating, and update the iteration count k = k + 1;

[0034] (4) Calculate the current pseudo-target position based on the previous pseudo-target position and the actual position;

[0035] actual location The small positioning error between the target position P0 and the target position is considered as a differential motion Δ. k-1 :

[0036]

[0037] Then, based on the differential motion Δ k-1 and the previous pseudo-target position Generate new pseudo-target locations

[0038]

[0039] (5) Perform inverse kinematics calculations to obtain the corresponding joint angles.

[0040] (6) Repeat steps (2)-(5) until the distance error E is less than the error threshold E during the iteration process. t Or the number of iterations k is greater than the iteration threshold k t Then the output θ best The joint angle after compensation for positioning error of industrial robot.

[0041] Furthermore, the method also includes:

[0042] Input the joint angle before the industrial robot executes the motion instruction into the positioning error prediction model, and output the positioning error;

[0043] Add the positioning error output by the positioning error prediction model to the position corresponding to the joint angle before the industrial robot executes the motion instruction to obtain the actual position, and perform inverse solution on the actual position to obtain the joint angle after the positioning error compensation of the industrial robot.

[0044] Further, the input of each GAT in the multi-head GAT is mapped into the same dimension as the output through a linear fully connected layer, and after a non-linear activation, the feature fusion is performed by directly adding the output.

[0045] Further, the non-linear activation is realized by a Mish function, and the expression of the Mish function is:

[0046] f(x)=xtanh(In(1+e x ))

[0047] Wherein, f(x) is the Mish function, tanh is the hyperbolic tangent function, and x is the input of the Mish function, that is, the input of the GAT is mapped into the same dimension as the output through a linear fully connected layer.

[0048] Further, in the feature extractor, in the i-th GAT, the similarity coefficients between the nodes and the i-th order neighborhood nodes are calculated in parallel through the multi-head attention mechanism, the similarity coefficients are normalized to obtain the attention coefficients, the normalized attention coefficients are taken as weights, and the i-th order neighborhood nodes are weighted summed to extract the features.

[0049] Further, the method further comprises:

[0050] In the feature extractor, the features extracted by the multi-head attention mechanism are spliced as the output of the other GATs except the last GAT, and in the last GAT of the feature extractor, the average value of the features extracted by the multi-head attention mechanism is taken as the output of the last GAT.

[0051] Preferably, the adjacency matrix is constructed in the following manner:

[0052] Set the maximum allowed distance of the joint angle, calculate the Euclidean distance between the joint angle of each node in the node set and the joint angle of other nodes, when the Euclidean distance is less than the maximum allowed distance, the elements of the two nodes corresponding to the Euclidean distance in the adjacency matrix are 1, otherwise the elements of the two nodes corresponding to the Euclidean distance in the adjacency matrix are 0.

[0053] According to another aspect of the present application, a multi-head GAT-based industrial robot positioning error compensation system is provided, comprising:

[0054] a data preprocessing module, configured to collect joint angles and corresponding positioning errors in an industrial robot workspace, construct a node set by taking a group of joint angles and corresponding positioning errors as a node in a graph, and construct an adjacency matrix by using the Euclidean distance between nodes, wherein the node set and the adjacency matrix constitute graph structure data;

[0055] a training module, configured to train a multi-head GAT using the graph structure data, wherein the multi-head GAT comprises an input layer, a feature extractor, a feature fitter and an output layer, the feature extractor comprises multiple layers of GAT, and a multi-head attention mechanism is arranged in each GAT; during training, the input layer inputs nodes and their multi-order neighborhood nodes in the adjacency matrix in the graph structure data into the feature extractor; in each layer of GAT, the multi-head attention mechanism is used to calculate the similarity coefficient between the nodes and the neighborhood nodes of each order in parallel to extract features, the features extracted by the multi-head attention mechanism are fused as the output of each layer of GAT, and the output of the multi-layer GAT is input into the feature fitter after being spliced at the end of the feature extractor; the feature fitter inputs the features output by the feature extractor after dimension reduction processing to the output layer, and finally outputs the predicted positioning error; the error between the predicted positioning error and the positioning error of the node in the input layer is calculated, the weight parameters of the multi-head GAT are updated through back propagation, and the trained multi-head GAT is obtained after training to convergence, which is used as a positioning error prediction model;

[0056] a compensation module, configured to input the joint angles before the industrial robot executes the motion instruction into the positioning error prediction model, and compensate the joint angles before the industrial robot executes the motion instruction using the output positioning error.

[0057] According to another aspect of the present application, an electronic device is provided, comprising:

[0058] a memory having a computer program stored thereon;

[0059] a processor configured to execute the computer program in the memory to implement the processing steps of the multi-head GAT-based industrial robot positioning error compensation method.

[0060] Overall, compared with the prior art, the above technical solutions conceived by the present application can achieve the following beneficial effects:

[0061] (1) Since the prior art uses Euclidean data as the input of the model, it cannot extract the structural features between the data, resulting in a decrease in the accuracy of the predicted positioning error. The present application uses the collected data to obtain a graph structure according to a graph construction strategy, and uses the graph structure data to train the model, thereby effectively improving the accuracy of the predicted positioning error. The adjacency matrix of the constructed graph determines the adjacent nodes of each node, i.e., the neighborhood information of the node, and the adjacent nodes of each node in the graph can provide more effective information for the inference of the positioning error of the node. The multi-head attention mechanism can calculate each node in parallel, and is very suitable for positioning error prediction. The output of the multi-layer GAT is spliced at the end of the feature extractor to merge high-dimensional and low-dimensional features, thereby suppressing the over-smoothing phenomenon and integrating the neighborhood information of each order. The method of the present application is a non-kinematic model compensation method that considers both geometric errors and non-geometric errors, and can effectively reduce the influence of geometric parameter errors and non-geometric parameter errors on the positioning error of the robot. Compared with existing machine learning and neural network models, the present application converts Euclidean data into graph structure data, which can fully exploit the internal rules of the robot positioning error and improve the prediction accuracy. The present application corrects the joint angle before the industrial robot executes the motion instruction, without modifying the kinematic parameters in the industrial robot controller, and can effectively improve the positioning accuracy of the robot. The present application completes the compensation when the modification permission of the robot controller parameters is not open, and has the advantages of wide applicability, good stability and high precision.

[0062] (2) The pseudo-target positioning error compensation method is an iterative optimization compensation method that can use a data-driven positioning error prediction model to generate a pseudo-target position and quickly correct the joint angle of the industrial robot in several iterations, so that the actual position of the compensated industrial robot is more close to the target position, and the positioning error of the industrial robot at the target position is reduced. The present application designs a pseudo-target positioning error compensation method based on the positioning error prediction model, converts the compensation problem into an optimization problem to solve, and thereby reduces the number of inverse kinematics calculations of the industrial robot, and quickly corrects the joint angle.

[0063] (3) The feature extractor mainly consists of multi-layer GAT, and the main function is to extract and learn the positioning error information in the neighborhood of the joint angle. By analogy with the idea of residual connection, the input of each layer of GAT is mapped to the same dimension as the output through a linear fully connected layer, and after nonlinear activation by a Mish function, the output is directly added to the output for feature fusion. Through comparison tests, it is found that the model with the Mish function nonlinear activation mechanism (multi-head GAT-JK-Mish) has a significantly improved performance compared with the model without the Mish function nonlinear activation mechanism (multi-head GAT), which proves the effectiveness of the Mish nonlinear activation mechanism.

[0064] (4) The normalized attention coefficient obtained in the present application can better allocate the weights of different nodes. The normalized attention coefficient is used as a weight to update the node features using the neighborhood information of the node. In order to make the learning process of the attention mechanism more stable and enrich the ability of the model, a multi-head attention mechanism is used, different feature fusion methods are used for the last layer GAT and other layers GAT of the feature extractor, in order to retain enough features first, and finally the mean value of the independent attention mechanisms is calculated to improve the training efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0065] Figure 1 is a whole flowchart of an industrial robot positioning error compensation method based on multi-head GAT provided by an embodiment of the present application;

[0066] Figure 2 is a principle diagram of an adjacency matrix generation provided by an embodiment of the present application;

[0067] Figure 3 is a new feature calculation flowchart of a multi-head graph attention network provided by an embodiment of the present application;

[0068] Figure 4 is a structure diagram of a multi-head graph attention network provided by an embodiment of the present application;

[0069] Figure 5 is a pseudo-target positioning error compensation principle diagram provided by an embodiment of the present application;

[0070] Figure 6 is a pseudo-target position generation principle diagram provided by an embodiment of the present application;

[0071] Figure 7 is an iteration flowchart of a pseudo-target positioning error compensation method provided by an embodiment of the present application;

[0072] Figure 8 is a model prediction performance comparison diagram provided by an embodiment of the present application. DETAILED DESCRIPTION

[0073] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application. In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.

[0074] As shown in Figure 1 , a multi-head GAT-based industrial robot positioning error compensation method comprises:

[0075] The joint angle before the industrial robot executes the motion instruction is input into the positioning error prediction model, and the output positioning error is used to compensate the joint angle before the industrial robot executes the motion instruction;

[0076] The positioning error prediction model is obtained by the following method:

[0077] The joint angle and its corresponding positioning error are collected in the workspace of the industrial robot, a set of joint angles and their corresponding positioning errors are constructed as a node in a graph, an adjacency matrix is constructed by the Euclidean distance between nodes, and the node set and the adjacency matrix form a graph structure data;

[0078] The multi-head GAT is trained using the graph structure data, the multi-head GAT includes an input layer, a feature extractor, a feature fitter and an output layer, the feature extractor includes multiple layers of GAT, and a multi-head attention mechanism is arranged in each GAT;

[0079] During training, the input layer inputs the nodes and their multi-order neighborhood nodes in the adjacency matrix in the graph structure data into the feature extractor;

[0080] In each layer of GAT, the similarity coefficients between the nodes and the neighborhood nodes of each order are calculated in parallel through the multi-head attention mechanism to extract features, the features extracted by the multi-head attention mechanism are fused as the output of each layer of GAT, and the outputs of the multiple layers of GAT are spliced and input into the feature fitter after the feature extractor;

[0081] The feature fitter inputs the features output by the feature extractor after dimensionality reduction processing to the output layer, and finally outputs the predicted positioning error;

[0082] The error between the predicted positioning error and the positioning error of the node in the input layer is calculated, the weight parameters of the multi-head GAT are updated by back propagation, and the training is performed until convergence, so as to obtain the trained multi-head GAT, which is used as the positioning error prediction model.

[0083] Embodiment 1

[0084] Taking the end position accuracy improvement of a UNIVERSAL ROBOTS 10 robot (hereinafter referred to as "UR10") as an example, the technical solutions of the present application are further explained and described.

[0085] A kinematic model of the UR10 robot is established, and the DH parameters of the UR10 robot are shown in Table 1.

[0086] Table 1 DH parameters of UR10

[0087] Joint θ / rad d / m a / m α / rad 1 0 0.127 0 π / 2 2 0 0 -0.612 0 3 0 0 -0.572 0 4 0 0.164 0 π / 2 5 0 0.116 0 -π / 2 6 0 0.092 0 0

[0088] Before training a multi-head graph attention network, graph-structured data is required. For Euclidean data such as robot joint angles and localization errors, a graph needs to be constructed to transform it into graph-structured data. This mainly involves constructing the node set V and the adjacency matrix A of the graph. Joint angles are used to predict the robot's localization error. For the joint angle and its corresponding localization error data v = (θ, δP), θ is the joint angle, which is the input feature of the node with a dimension of 6, and δP is the localization error, which is the model's output at the node with a dimension of 3. Assuming there are n sets of data, there is a graph with a set of n nodes.

[0089] V = {v1, v2, ..., v} n}={(θ1, δP1), (θ2, δP2)…(θ n δP n )}

[0090] If node v i to v j If a connection exists, i.e., an edge exists, then v j to v i There also exist edges; in this case, let the adjacency matrix A be... ij =A ji =1, otherwise A ij =A ji =0. Therefore, the constructed graph is an undirected and unweighted graph, and its adjacency matrix is ​​a symmetric matrix.

[0091] For n sets of joint angles and its corresponding positioning error collection platform Graph node set The generation of the adjacency matrix is ​​as follows: Figure 2 As shown, the specific steps are as follows:

[0092] (1) Select the maximum allowable distance of the joint angle. (e.g., 10°), let the joint angle number i = 1.

[0093] (2) Calculate the joint angle θ i Euclidean distance ε between the joint angles and the other joint angles θ,ij =||θ i -θ j ||, where i≠j. This gives the joint angle θ. i distance set

[0094] (3) For ε in the distance set θ,ij Determine if it is less than If it is less than, then set the corresponding element A in the adjacency matrix. ij =1, otherwise A ij =0, meaning the joint angle θ was selected. iAll joint angles that satisfy the joint space positioning error similarity condition are connected in the graph.

[0095] (4) If i = n, stop the calculation and output the adjacency matrix A; otherwise, i = i + 1, repeat step (2).

[0096] The adjacency matrix of the graph is obtained through the above process, and the adjacent nodes of each node are determined, that is, the neighborhood information of the node is determined, which is a necessary step before the multi-head graph attention network is trained. Each node in the graph has adjacent nodes that satisfy the joint space positioning error similarity condition, and these adjacent nodes can provide more effective information for the positioning error inference of the node compared to other nodes.

[0097] In the positioning error prediction model obtained by training, the input data is the joint angle θ, the feature dimension is 6, and the model output is the positioning error δP, the dimension is 3. In the multi-head GAT model, the input and output features of the nodes in the intermediate layer are transformed. In order to unify the description, let the dimension of the node input feature in the graph be D. For a graph with n nodes, all nodes are represented as:

[0098] h = {h1, h2, …, hn} n}

[0099] In the formula, For the GAT layer that directly uses joint angles as node input features, h i = θ i , D = 6. The input feature of the node is referred to as the node feature hereinafter.

[0100] In GAT, for the D-dimensional feature h i of the i-th node, the updated node obtains a D'-dimensional feature h' i , the calculation process is shown in Figure 3 , and the specific description is as follows:

[0101] (1) Feature dimension transformation

[0102] In the process of updating the node feature, the dimension of the node feature may change. For example, in the shallow GAT that extracts joint angle features, it is necessary to raise the feature dimension of the joint angle to a high-dimensional feature to improve the expression ability of the joint angle data. The following formula is used to transform the input feature:

[0103] z i = Wh i

[0104] In the formula, i = 1, 2, …, n, that is, all nodes are transformed; is a shared linear transformation parameter matrix, which is a shared learnable parameter; represents the feature after dimension change.

[0105] (2) Calculate the similarity coefficient

[0106] Let the first-order neighborhood of node i be composed of the adjacent nodes of node i:

[0107]

[0108] In the formula, A is the adjacency matrix; is the set of node numbers of the proximal joint angles in the graph construction strategy. Calculate the similarity coefficient of node i and all nodes in its neighborhood:

[0109]

[0110] In the formula, calculate z i and z j Share the parameter matrix W; is the similarity coefficient; [z i ||z j ] represents the feature concatenation of z i and z j This operation combines the feature dimensions and transforms two D' dimensional features into a 2D' dimensional feature; represents a shared attention mechanism, which is a shared learnable parameter that maps a 2D' dimensional feature to a real number:

[0111] (3) Calculate the attention coefficient

[0112] Use softmax to normalize the similarity coefficient to obtain the attention coefficient:

[0113]

[0114] In the formula, represents the attention coefficient, also known as the weight coefficient; exp(e ij ) represents In actual implementation, LeakyReLU activation function will be used to perform nonlinear mapping on e ij to obtain better results:

[0115]

[0116] The normalized attention coefficient α ij can better allocate the weights of different nodes.

[0117] (4) Aggregate new features

[0118] The main idea of aggregating new features is weighted average. Normalize the attention coefficient α ijAs the weight, the neighborhood information of the node is used to update the node feature:

[0119]

[0120] wherein, is the updated feature, i.e., the output feature; and σ(·) is an activation function.

[0121] In addition, in order to make the attention mechanism learning process more stable and enrich the ability of the model, a multi-head attention mechanism can be used.

[0122] For the intermediate layers in the feature extractor (the first layer GAT and the second layer GAT in the embodiment of the present application), K groups of independent attention mechanisms are generally spliced:

[0123]

[0124] wherein, || represents the splicing operation, as described above; is the attention coefficient calculated by the kth group of attention mechanisms; and W k is the shared linear transformation parameter matrix of the kth group of attention mechanisms; since it is a splicing operation, at this time

[0125] For the output layer in the feature extractor (the third layer GAT in the embodiment of the present application), the average of K groups of independent attention mechanisms is generally calculated:

[0126]

[0127] As shown in Figure 3 is the feature calculation process of the multi-head graph attention network.

[0128] The learning parameters W and a of the multi-head graph attention network are shared by all nodes, and for each node, only the 1st order neighborhood information needs to be concerned, without the need to know the overall topology of the graph in advance, so the multi-head graph attention network can be calculated in parallel for each node, and is very suitable for positioning error prediction. The multi-head graph attention network is constructed as shown in Figure 4 is mainly divided into two parts: a feature extractor and a feature fitter.

[0129] Figure 4In the specific embodiments, GAT (6-256 / 8 / cancat / BN / ELU) represents a GAT network and its configuration: the input feature dimension is 6, the output feature dimension is 256, 4 heads of attention mechanism are used, cancat represents that the fusion mode of each head of attention mechanism is splicing, the GAT output is input into a BN (Batch Normalization) layer, and then an ELU activation function is used on the output of the BN layer to obtain the output of the layer; the main difference between GAT (6-256 / 8 / average / BN / ELU) and other GAT layers is that average represents that the fusion mode of each head of attention mechanism is averaging. FC (448-64 / BN / ELU) represents an FC layer and its configuration: the input feature dimension is 448, the output feature dimension is 64, and the output is input into a BN layer before being input into an ELU activation function, and the meanings of the other FC layers are similar.

[0130] The ELU activation function is defined as follows:

[0131]

[0132] In the formula, x is the input of the ELU activation function, and a is a scaling factor, which is taken as 1 in Embodiment 1 of the application.

[0133] The feature extractor is mainly composed of three GAT layers, and the main function is to extract and learn the positioning error information in the joint angle neighborhood. In the spirit of residual connection, the input of each GAT layer is mapped to the same dimension as the output through a linear fully connected layer, and then added directly to the output after nonlinear activation by a Mish function for feature fusion. The expression of the Mish activation function is as follows:

[0134] f(x) = x tanh(operatornamesoftplus(x)) = x tanh(ln(1+e x ))

[0135] The outputs of the three GAT layers are spliced at the end of the feature extractor to combine high-dimensional and low-dimensional features, which not only suppresses the over-smoothing phenomenon, but also integrates the 1st, 2nd and 3rd order neighborhood information. The subsequent feature fitter learns the node neighborhood information of each order to fit and determine the weight of each order of neighborhood information, and also suppresses the noise of the adjacency matrix to some extent. Through experiments, the model prediction performance no longer improves obviously after more than 3 GAT layers, so 3 layers are selected.

[0136] The feature fitter is composed of 3 fully connected layers, and the main function is to learn the feature information extracted by the feature extractor and to reduce the dimension of the features.

[0137] In order to obtain better network initial parameters and improve the stability of the model in the training process, the Xavier initialization method is used for reference. The Xavier initialization converts the parameter initialization process into a sampling process from the interval of a certain probability distribution, and uses the relevant hyperparameters of the network (such as the number of input layer neurons) to solve the parameters of the probability distribution, so as to make the variance of each layer of the network as equal as possible, prevent the activation function from entering the saturation zone, suppress the gradient explosion or gradient disappearance phenomenon, and make the information in the network flow better.

[0138] The method samples and initializes the parameters from a uniform distribution U(-a, a), where a is determined by the formula:

[0139]

[0140] In the formula, gain is a scaling factor that can be set; fan in is the number of input layer neurons of the network; fan out is the number of output layer neurons.

[0141] The parameter optimizer selects the Adam optimizer; the MSE is used as the loss function, and for the three components (X, Y and Z) of the model output, the loss function is defined as follows:

[0142]

[0143] In the formula, MSE i represents the mean square error of the i-th component of the positioning error of the three components (X, Y and Z); n is the total number of samples; y ij and are the j-th true value and the predicted value of the i-th component, respectively.

[0144] In addition, in order to suppress overfitting, a regularization term and a Dropout operation are also added to the model during the training process, that is, some neurons are randomly discarded during the training process, and the probability of the Dropout operation is commonly used in the experiment: 0.5 for GAT layer and 0.25 for FC layer.

[0145] On this basis, the pseudo-target positioning error compensation method is used for compensation, which can effectively improve the positioning accuracy of the robot.

[0146] The pseudo-target positioning error compensation method is an iterative optimization compensation method, which can use a data-driven positioning error prediction model to generate a pseudo-target position, and quickly correct the joint angle θ0 of the robot in several iterative optimization processes, so that the actual position P a of the robot after compensation is more close to the target position P0, and the positioning error δP0 of the robot at the target position is reduced. The pseudo-target method mainly uses the positioning error vector of the target position and the actual position to infer the pseudo-target position, such asFigure 5 As shown.

[0147] The pseudo-target method is based first on the robot's actual position P. a A "pseudotarget" position P is calculated from the target position P0. pse Then, the position P is determined using theoretical kinematic geometric parameters. pse By performing inverse kinematics, the corrected joint angle θ is obtained. a The robot then obtains its corrected actual position again, and calculates a new "pseudo-target" position by comparing it with the target position P0. This process is repeated until the actual position P0 is reached. a The deviation from the target position P0 is less than the error threshold, or the specified number of iterations has been reached.

[0148] The main steps of the pseudo-target positioning error compensation method are as follows:

[0149] (1) Set the iteration counter to zero k = 0, and the corrected joint angle θ a initial value Let the joint angle be θ0 and the pseudo-target position be P. pse initial value Let the target position be P0, and set the error threshold E. t and iteration threshold k t .

[0150] (2) Calculate the actual position based on the current corrected joint angle:

[0151]

[0152] In the formula, FK(·) represents the robot's forward kinematics based on theoretical kinematic parameters. Joint angle The corresponding target position; f is the industrial robot positioning error prediction model. Let f be... The positioning error predicted by model f is, i.e.

[0153]

[0154] (3) Calculate the deviation E between the current (kth iteration) corrected actual position and the target position P0:

[0155]

[0156] In the formula, ε(·) is defined as:

[0157]

[0158] In the formula, x a y a and z aare the three coordinate components of the actual position; x0, y0, and z0 are the three coordinate components of the target position P0; and are the three components of the positioning error predicted by the algorithm.

[0159] If E is smaller than the minimum error E best recorded in the iteration process, then update E best = E, and update the optimal joint angle If E best is smaller than the set error threshold E t or the iteration number k is greater than the iteration threshold k t , then output θ best as the corrected joint angle; otherwise, continue iteration, update the iteration number k = k + 1.

[0160] (4) Calculate the current pseudo-target position based on the previous pseudo-target position and the actual position, and the principle of generating the pseudo-target position is shown in Figure 6 .

[0161] First, consider the small positioning error between the actual position and the target position P0 as the differential motion Δ k-1 :

[0162]

[0163] Then, generate a new pseudo-target position based on the differential motion Δ k-1 and the previous pseudo-target position

[0164]

[0165] (5) Perform inverse kinematics calculation based on the theoretical kinematics parameters to obtain the corresponding joint angle It is worth noting that this joint angle should be a fine adjustment of the initial joint angle θ0.

[0166]

[0167] where IK(·) represents the inverse solution based on the theoretical kinematics parameters, and in actual implementation, this process uses the Iterative Inverse Kinematics algorithm for solution:

[0168]

[0169] where The modified joint angle of the last iteration is represented, and since the generated modified joint angle is close each time, the value is used as the initial value for iteration, which can improve the operation efficiency of the IIK(·) algorithm. In this paper, inverse kinematics iteration is used, which is based on the Levenberg-Marquardt (LM) method, and in a simple way, the stability and convergence of the numerical value in iteration are improved.

[0170] (6) Repeat step (2) until the distance error E in the iteration process is less than the error threshold E t or the iteration number k is greater than the iteration threshold k t , then output θ best as the modified joint angle.

[0171] The iteration process of the pseudo-target positioning error compensation method is shown in Figure 7 . In general, compared with the prior art, the industrial robot positioning error compensation method provided by the present application simultaneously considers geometric error and non-geometric error, and compared with existing various machine learning and neural network models, the present application converts Euclidean data into graph structure data, which can fully tap the internal law of robot positioning error and improve the prediction accuracy. The present application designs a pseudo-target positioning error compensation method based on the error prediction model, converts the compensation problem into an optimization problem to solve, thereby reducing the number of robot inverse kinematics calculations, and quickly correcting the joint angle.

[0172] The multi-head GAT is trained using graph structure data, the error between the predicted positioning error and the positioning error of the nodes in the input layer is calculated, the weight parameters of the multi-head GAT are updated in reverse, and the trained multi-head GAT is obtained. The trained multi-head GAT is used as a positioning error prediction model. The joint angle of the industrial robot UR10 before executing the motion instruction is input into the positioning error prediction model, and the output positioning error is used to compensate the joint angle of the industrial robot UR10. The present application corrects the joint angle before the industrial robot executes the motion instruction, without modifying the kinematic parameters in the industrial robot controller, which can effectively improve the positioning accuracy of the robot.

[0173] Example 2

[0174] To further prove the superiority of the present application, the model of the present application and the existing CART, BPNN, GBDT, KPAC-ELM, SVR and multi-head GAT model of the present application without the Mish function activation mechanism are used to predict 30 test samples at the same time, and the comparison results are shown in Figure 8 .

[0175] Figure 8In the figure, the blue rectangle represents the maximum error, the red rectangle represents the average error, and the yellow rectangle represents the root mean square error. It can be seen from the figure that the multi-head GAT-JK-Mish model has a smaller maximum error, average error, and root mean square error than the multi-head GAT model, and the multi-head GAT-JK-Mish model has a smaller maximum error, average error, and root mean square error than the multi-head GAT-JK model. Figure 8 It can be seen from the figure that the performance of the model with the Mish function nonlinear activation (multi-head GAT-JK-Mish) is significantly improved compared with the model without the Mish function nonlinear activation mechanism (multi-head GAT), which proves the effectiveness of the Mish nonlinear activation mechanism. The maximum error, average error, and root mean square error of the model of the present application for 30 prediction samples are 0.228, 0.103, and 0.115, respectively, which are smaller than those of other models. The average error is reduced from 2.381 mm before compensation to 0.103 mm, and the accuracy is improved by 95.7%, which proves that the model proposed in the present application has better prediction performance.

[0176] Those skilled in the art will readily understand that the above description is only the preferred embodiment of the present application, and is not intended to limit the present application. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A multi-head GAT-based industrial robot positioning error compensation method, characterized in that, The method comprises the following steps: inputting the joint angle before the industrial robot executes the motion instruction into the joint angle position error prediction model, and using the output position error to compensate the joint angle before the industrial robot executes the motion instruction; the position error prediction model is obtained by the following method: collecting joint angles and their corresponding position errors in the industrial robot workspace, constructing a node set by taking a group of joint angles and their corresponding position errors as a node in a graph, constructing an adjacency matrix by the Euclidean distance between nodes, and the node set and the adjacency matrix form a graph structure data; training the multi-head GAT using the graph structure data, the multi-head GAT comprising an input layer, a feature extractor, a feature fitter and an output layer, the feature extractor comprising multiple layers of GAT, and a multi-head attention mechanism being arranged in each GAT; during training, the input layer inputs the nodes and their multi-order neighborhood nodes in the adjacency matrix in the graph structure data into the feature extractor; in each layer of GAT, the similarity coefficients between the nodes and the neighborhood nodes of each order are calculated in parallel through the multi-head attention mechanism to extract features, and the features extracted by the multi-head attention mechanism are fused as the output of each layer of GAT, and the output of the multi-layer GAT is input into the feature fitter after being spliced; the feature fitter inputs the features output by the feature extractor after dimension reduction processing into the output layer, and finally outputs the predicted position error; calculating the error between the predicted position error and the position error of the node in the input layer, updating the weight parameters of the multi-head GAT through back propagation, training until convergence, obtaining the trained multi-head GAT, and taking the trained multi-head GAT as the position error prediction model; the method further comprises: inputting the joint angle before the industrial robot executes the motion instruction into the position error prediction model, and outputting the position error; adding the position error output by the position error prediction model to the position corresponding to the joint angle before the industrial robot executes the motion instruction to obtain the actual position, calculating the pseudo target position through the actual position and the preset target position, and inversely solving the pseudo target position to obtain the corrected joint angle; using the corrected joint angle to calculate a new pseudo target position, and iterating multiple times until the distance error between the actual position calculated using the corrected joint angle and the preset target position is less than an error threshold or the number of iterations is greater than an iteration threshold, and taking the corrected joint angle at this time as the joint angle after the position error compensation of the industrial robot; the joint angle after the position error compensation of the industrial robot is obtained by the following steps: (1) Set the iteration counter to zero False target location initial value Set as target location Set an error threshold and iteration threshold ; (2) the actual position after the first iteration correction is calculated based on the positioning error :​ In the formula, is the joint angle corresponding position, is the positioning error prediction model, then is the predicted positioning error, ; (3) calculating the actual position after the first iteration correction :​​​ In the formulae, is defined as: wherein , and are the three coordinate components of the actual position ; , and are the three coordinate components of the target position ; , and are the three components of the predicted positioning error ; If the minimum error recorded during the iteration process , then update and update the optimal joint angles ; otherwise go to step (4) to continue the iteration, updating the iteration number ; (4) calculating the current pseudo target position according to the last pseudo target position and the actual position; a small positioning error between the actual position and the target position is considered as a differential motion : Further in accordance with the differential motion and the previous pseudo target position generating a new pseudo target position : (5) Perform inverse kinematics calculations to obtain the corresponding joint angles. : (6) repeating steps (2)-(5) until the distance error is less than an error threshold or the number of iterations is greater than an iteration threshold then output the joint angles for the industrial robot with position error compensation.

2. The multi-head GAT-based industrial robot positioning error compensation method of claim 1, wherein, the method further comprises: inputting the joint angle before the industrial robot executes the motion instruction into the position error prediction model, and outputting the position error; adding the position error output by the position error prediction model to the position corresponding to the joint angle before the industrial robot executes the motion instruction to obtain the actual position, and inversely solving the actual position to obtain the joint angle after the position error compensation of the industrial robot.

3. The multi-head GAT-based industrial robot positioning error compensation method of claim 1, wherein, the input of each layer of GAT in the multi-head GAT is mapped into the same dimension as the output through a linear fully connected layer, and is directly added to the output after nonlinear activation for feature fusion.

4. The multi-head GAT-based industrial robot positioning error compensation method of claim 3, wherein, The nonlinear activation is implemented by a Mish function, and an expression of the Mish function is: f ( x ) x tanh(ln(1+ e x )) wherein, f ( x ) is a Mish function, tanh is a hyperbolic tangent function, x is the input of the Mish function, i.e., the input of the GAT is mapped through a linear fully connected layer into features of the same dimension as the output.

5. The multi-head GAT-based industrial robot positioning error compensation method of claim 1, wherein, In the feature extractor, in the first i In the layer GAT, the similarity coefficients between the nodes of the parallel computing nodes and the nodes of the first i order neighborhood are calculated by a multi-head attention mechanism, the similarity coefficients are normalized to obtain attention coefficients, and the nodes of the first i order neighborhood are weighted and summed by using the normalized attention coefficients as weights to extract features.

6. The multi-head GAT-based industrial robot positioning error compensation method of claim 5, wherein, The method further includes: In other layers of the feature extractor except the last layer of the GAT, the features extracted by the multi-head attention mechanism are spliced as the output of the other layers of the GAT, and in the last layer of the feature extractor, the average value of the features extracted by the multi-head attention mechanism is taken as the output of the last layer of the GAT.

7. A multi-head GAT-based industrial robot positioning error compensation system for performing a multi-head GAT-based industrial robot positioning error compensation method according to any one of claims 1-6, characterized by Comprise: The data preprocessing module is used for collecting joint angles and corresponding positioning errors in the industrial robot workspace, constructing a node set by taking a group of joint angles and corresponding positioning errors as a node in a graph, constructing an adjacency matrix through the Euclidean distance between nodes, and combining the node set and the adjacency matrix to form a graph structure data; The training module trains the multi-head GAT using the graph structure data, the multi-head GAT includes an input layer, a feature extractor, a feature fitter, and an output layer, the feature extractor includes multiple layers of GAT, and the multi-head attention mechanism is arranged in each GAT; during training, the input layer inputs the nodes and their multi-order neighborhood nodes in the adjacency matrix in the graph structure data into the feature extractor; In each layer of the GAT, the similarity coefficients between the nodes and the neighborhood nodes of each order are calculated in parallel through the multi-head attention mechanism to extract features, the features extracted by the multi-head attention mechanism are fused as the output of each layer of the GAT, and the outputs of the multiple layers of the GAT are spliced and input into the feature fitter after the last layer of the feature extractor; the feature fitter inputs the output of the feature extractor into the output layer after dimension reduction processing, and finally outputs the predicted positioning error; the error between the predicted positioning error and the positioning error of the node in the input layer is calculated, the weight parameters of the multi-head GAT are updated through back propagation, and the training is performed until convergence, thereby obtaining the trained multi-head GAT, which is used as a positioning error prediction model; The compensation module is used for inputting the joint angles before the industrial robot executes the motion instruction into the positioning error prediction model, and compensating the joint angles before the industrial robot executes the motion instruction using the output positioning error.

8. An electronic device, comprising: Comprise: A memory having a computer program stored thereon; A processor configured to execute the computer program in the memory to implement the processing steps of the multi-head GAT-based industrial robot positioning error compensation method of any one of claims 1-6.

Citation Information

Patent Citations

  • Joint track error compensation method for oil pipe transfer robot

    CN114310917A

  • Industrial robot position error compensation method and system based on GBDT algorithm

    CN115107022A