A robot inverse solution prediction method based on POA-Transformer-BiGRU-Attention integrated optimization algorithm
By adopting the POA-Transformer-BiGRU-Attention integrated optimization algorithm in robot inverse kinematics problems, the problem that traditional methods are difficult to achieve accurate, stable and real-time solutions in complex scenarios and high-degree of freedom systems is solved, and higher prediction accuracy and convergence speed are achieved.
Patent Information
- Application Number
- CN202510200274.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-02-24
AI Technical Summary
When traditional methods face complex scenarios and high-degree of freedom systems, it is difficult to achieve accurate, stable and real-time solutions to robotic inverse kinematics problems.
The robot inverse solution prediction method based on the POA-Transformer-BiGRU-Attention integrated optimization algorithm is adopted. By initializing the individual position of the robot, evaluating and updating it using the fitness function, combining the Transformer, BiGRU and Attention mechanisms, the predicted inverse solution results are generated and their accuracy is measured by the objective function.
It realizes accurate, stable and real-time solution of robot inverse kinematics problems in complex scenarios and high-degree of freedom systems, improving prediction accuracy and convergence speed.
Smart Images

Figure CN119692394B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robotics technology, and in particular to a robot inverse solution prediction method based on a POA-Transformer-BiGRU-Attention integrated optimization algorithm. Background Art
[0002] Multi-degree-of-freedom robots have been widely used in many fields such as industrial manufacturing, medical treatment, and service robots, and can perform precision operations such as welding, assembly, and surgery. However, the core problem in the motion control of multi-degree-of-freedom robots is the inverse kinematics solution, that is, solving the angles of each joint of the robot based on the position and posture of the target end effector. Due to the complex geometric structure and multi-solution nature of multi-degree-of-freedom robots, the inverse kinematics solution exhibits highly nonlinear characteristics. Although traditional analytical and numerical methods perform well in some simple applications, they often find it difficult to achieve accurate, stable, and real-time solutions when faced with complex scenarios and high-degree-of-freedom systems.
[0003] The complexity of the inverse kinematics problem of multi-DOF robots is mainly reflected in its high degree of nonlinearity and multiple solutions. The relationship between the robot end position and the joint angle usually does not have a closed analytical expression, and the solution is extremely difficult. In addition, there are often multiple possible solution sets for multi-DOF robot systems, and some solutions may not meet the physical constraints of the robot or exceed the range of joint motion. Traditional solution methods often rely on complex mathematical derivations or iterative solutions, which are prone to fall into local optimal solutions and are difficult to guarantee global optimal solutions. Especially when dealing with high-dimensional problems with nonlinear errors, their convergence speed and solution efficiency are significantly reduced.
[0004] Traditional inverse kinematics methods are mainly divided into analytical methods and iterative methods. The analytical method relies on the mathematical model of the robot structure and obtains a closed solution through complex equations. However, it is only applicable to robots with specific structures and is difficult to handle more complex non-standard robots. Although iterative methods (such as the Newton-Raphson method) are highly versatile, their results depend on the initial values, are prone to falling into local optimality, and have slow iterative convergence in high-dimensional nonlinear systems. In recent years, machine learning and deep learning methods have been introduced into inverse kinematics solutions, using large amounts of data to approximate high-dimensional nonlinear functions. However, these methods rely on large-scale data training, are highly sensitive to data distribution, have limited model generalization capabilities, and perform less than ideally in scenarios with high real-time requirements. These methods are unable to solve complex multi-degree-of-freedom multi-robot inverse solutions. Summary of the invention
[0005] Based on this, the present invention provides a robot inverse solution prediction method based on the POA-Transformer-BiGRU-Attention integrated optimization algorithm to solve the problem that traditional methods are difficult to achieve accurate, stable and real-time solutions when facing complex scenes and high-degree-of-freedom systems.
[0006] The present invention provides a robot inverse solution prediction method based on the POA-Transformer-BiGRU-Attention integrated optimization algorithm, comprising:
[0007] Initialize the POA algorithm and randomly initialize the individual positions of the robots ;
[0008] The individual position of the robot is adjusted using the fitness function Evaluate and position the robot Update, get the updated robot position ;
[0009] Order input data , input data X i After the Transformer model training, the output feature Z′ is generated;
[0010] Use the BiGRU algorithm to complete the input data X of the Transformer model training i Processing is performed to obtain the final state, and the weighted summation result is solved by combining the attention mechanism;
[0011] The predicted inverse solution result is generated according to the result of the weighted summation, and the accuracy of the predicted inverse solution result is measured by using the objective function to obtain the global optimal solution.
[0012] Initialize the robot's individual position P i The operations include,
[0013] Set the number of robots to N and the maximum number of iterations to T max ;
[0014] Initialize the robot's individual position for,
[0015] ;
[0016] in, Represents the value of the ith data point on the dth feature.
[0017] The individual position of the robot is adjusted using the fitness function Evaluate and position the robot Update, get the updated robot position The operations include,
[0018] Using fitness function The individual position of the robot Conduct an assessment,
[0019] ;
[0020] Robot individual position P i The update formula is,
[0021] ;
[0022] in, Indicates the current best position. Represents a random number, represents a perturbation term to increase search diversity.
[0023] include,
[0024] Transformer uses a self-attention mechanism to process the input sequence. Given an input sequence ;
[0025] The input sequence self-attention mechanism is calculated as follows:
[0026] ;
[0027] ;
[0028] ;
[0029] Where Q represents the query matrix, W Q represents the query weight matrix, K represents the Key matrix, W K represents the Key weight matrix, V represents the Value matrix, W V represents the Value weight matrix, Represents the i-th element in the sequence;
[0030] The attention weights are calculated by dot product:
[0031] ;
[0032] Among them, A represents the attention weight matrix, d k represents the dimension of matrix K;
[0033] Get the output matrix Z based on the attention weight matrix A and the matrix V,
[0034] Z = AV;
[0035] Use the ReLU activation function to process the output matrix Z to obtain the output features ,
[0036] .
[0037] include,
[0038] The output feature Z′ of Transformer is used as the input of BiGRU, which contains two GRU layers, one for processing the forward sequence and the other for processing the reverse sequence;
[0039] For each time step t, BiGRU updates the forward hidden state and the reverse hidden state ,
[0040] ;
[0041] ;
[0042] ;
[0043] ;
[0044] in, represents the output of Z′ at time step t, represents the weight matrix associated with the candidate hidden state, represents the weight matrix associated with the update gate, represents the weight matrix associated with the reset gate, , , Both represent weight matrices, Represents the reset gate, represents the hidden state at time step t-1, represents the update gate, Represents the sigmoid function.
[0045] include,
[0046] BiGRU processes the sequence in two directions, obtaining the forward state and the backward state respectively:
[0047] ;
[0048] ;
[0049] in, represents the forward state, Indicates the backward state;
[0050] Get the final state based on the forward state and the conceptual state ,
[0051] .
[0052] The operations to solve the weighted sum result by combining the attention mechanism include:
[0053] ;
[0054] ;
[0055] in, represents the energy value at time step t, represents the context vector, represents the attention weight at time step t, represents the energy value at time step j, and T represents the total number of time steps of the sequence;
[0056] based on and Get the weighted summation result z,
[0057] .
[0058] The operations that use the objective function to measure the accuracy of the predicted inverse solution include:
[0059] The objective function The calculation includes,
[0060] ;
[0061] in, represents the joint angle vector, , , , Both represent weight coefficients, represents the position error, represents the attitude error, represents the joint limit constraint, represents the prediction error;
[0062] The position error The calculation includes,
[0063] ;
[0064] in, represents the desired end-effector position vector, represents the actual end-effector position vector;
[0065] The attitude error The calculation includes,
[0066] ;
[0067] in, represents the desired rotation matrix of the end effector, represents the actual rotation matrix of the end effector;
[0068] The joint limit constraints The calculation includes,
[0069] ;
[0070] in, represents the restriction coefficient, Indicates The allowed rotation angles are Indicates The maximum allowed rotation angle of the parameter, Indicates The minimum allowed rotation angle of a parameter, if Exceeding the defined robot range , a penalty term is imposed to force convergence to the effective search space;
[0071] Minimize the objective function by iteratively adjusting the model parameters and the POA algorithm optimization strategy The value of ensures the accuracy of the inverse solution and obtains the global optimal solution.
[0072] Beneficial effects: The present invention demonstrates powerful global search capabilities and fast convergence by simulating the predation behavior of pelicans. The inverse solution of a multi-degree-of-freedom robot involves complex interactions between multiple joints. Secondly, the Transformer structure can effectively process long sequence data, using the self-attention mechanism to capture long-range dependencies and improve feature extraction capabilities. At the same time, BiGRU enhances the understanding of dynamic changes in time series through forward and backward information processing. The Attention mechanism enables the model to dynamically focus on important features, optimize feature selection, and thus improve prediction accuracy.
[0073] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] The accompanying drawings are used to better understand the present invention and do not constitute a limitation of the present invention.
[0075] Figure 1 is a flow chart provided according to the present invention;
[0076] Figure 2 is a schematic diagram of a 6-DOF industrial robot provided according to the present invention;
[0077] Figure 3 This is an iterative comparison chart of the POA-Transformer-BiGRU integrated learning algorithm provided by the present invention and GA, DE, and PWO algorithms. DETAILED DESCRIPTION
[0078] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0079] like Figure 1 As shown, the present invention provides a robot inverse solution prediction method based on the POA-Transformer-BiGRU-Attention integrated optimization algorithm, comprising:
[0080] S1: Initialize the POA algorithm (Pelican Optimization Algorithm, partially ordered alignment algorithm) and randomly initialize the individual positions of the robots It should be noted that:
[0081] Initialize the robot's individual position P i The operations include,
[0082] Set the number of robots to N and the maximum number of iterations to T max ;
[0083] Initialize the robot's individual position for,
[0084] ;
[0085] in, Represents the value of the ith data point on the dth feature.
[0086] S2: Use the fitness function to adjust the individual position of the robot Evaluate and position the robot Update, get the updated robot position It should be noted that:
[0087] The individual position of the robot is adjusted using the fitness function Evaluate and position the robot Update, get the updated robot position The operations include,
[0088] Using fitness function The individual position of the robot Conduct an assessment,
[0089] ;
[0090] Robot individual position P i The update formula is,
[0091] ;
[0092] in, Indicates the current best position. Represents a random number, represents a perturbation term to increase search diversity.
[0093] S3: Let input data X i = , input data X i After the Transformer model training, the output feature Z′ is generated. It should be noted that:
[0094] Transformer uses a self-attention mechanism to process the input sequence. Given an input sequence ;
[0095] The input sequence self-attention mechanism is calculated as follows:
[0096] ;
[0097] ;
[0098] ;
[0099] Where Q represents the query matrix, W Q represents the query weight matrix, K represents the Key matrix, W K represents the Key weight matrix, V represents the Value matrix, W V represents the Value weight matrix, Represents the i-th element in the sequence;
[0100] The attention weights are calculated by dot product:
[0101] ;
[0102] Among them, A represents the attention weight matrix, d k represents the dimension of matrix K;
[0103] Get the output matrix Z based on the attention weight matrix A and the matrix V,
[0104] Z = AV;
[0105] Use the ReLU activation function to process the output matrix Z to obtain the output features ,
[0106] .
[0107] S4: Input data X for training the Transformer model (Transformer is a deep learning model architecture for natural language processing NLP) using the BiGRU (rectified linear unit) algorithm i The final state is obtained by processing, and the weighted summation result is solved by combining the attention mechanism. It should be noted that:
[0108] The output feature Z′ of Transformer is used as the input of BiGRU (Bidirectional Gated Recurrent Unit). BiGRU contains two GRU (Gated Recurrent Unit) layers, one for processing the forward sequence and the other for processing the reverse sequence.
[0109] For each time step t, BiGRU updates the forward hidden state and the reverse hidden state ,
[0110] ;
[0111] ;
[0112] ;
[0113] ;
[0114] in, represents the output of Z′ at time step t, represents the weight matrix associated with the candidate hidden state, represents the weight matrix associated with the update gate, represents the weight matrix associated with the reset gate, , , Both represent weight matrices, Represents the reset gate, represents the hidden state at time step t-1, represents the update gate, Represents the sigmoid function.
[0115] include,
[0116] BiGRU processes the sequence in two directions, obtaining the forward state and the backward state respectively:
[0117] ;
[0118] ;
[0119] in, represents the forward state, Indicates the backward state;
[0120] Get the final state based on the forward state and the conceptual state ,
[0121] .
[0122] Attention means attention mechanism.
[0123] The operations to solve the weighted sum result by combining the attention mechanism include:
[0124] ;
[0125] ;
[0126] in, represents the energy value at time step t, represents the context vector, represents the attention weight at time step t, represents the energy value at time step j, and T represents the total number of time steps of the sequence;
[0127] based on and Get the weighted summation result z,
[0128] .
[0129] S5: Generate a predicted inverse solution result according to the weighted summation result, use the objective function to measure the accuracy of the predicted inverse solution result, and obtain the global optimal solution. It should be noted that:
[0130] The operations that use the objective function to measure the accuracy of the predicted inverse solution include:
[0131] The objective function The calculation includes,
[0132] ;
[0133] in, represents the joint angle vector, , , , Both represent weight coefficients, represents the position error, represents the attitude error, represents the joint limit constraint, represents the prediction error;
[0134] The position error The calculation includes,
[0135] ;
[0136] in, represents the desired end-effector position vector, represents the actual end-effector position vector;
[0137] The attitude error The calculation includes,
[0138] ;
[0139] in, represents the desired rotation matrix of the end effector, represents the actual rotation matrix of the end effector;
[0140] The joint limit constraints The calculation includes,
[0141] ;
[0142] in, represents the restriction coefficient, Indicates The allowed rotation angles are Indicates The maximum allowed rotation angle of the parameter, Indicates The minimum allowed rotation angle of a parameter, if Exceeding the defined robot range , a penalty term is imposed to force convergence to the effective search space;
[0143] Minimize the objective function by iteratively adjusting the model parameters and the POA algorithm optimization strategy The value of ensures the accuracy of the inverse solution and obtains the global optimal solution.
[0144] In order to verify the performance of the algorithm proposed in this invention, a 6-DOF industrial robot is used to verify the accuracy of the proposed POA-Transformer-BiGRU-Attention composite optimization algorithm to obtain the inverse solution of the 6-DOF industrial robot. Figure 2 shown.
[0145] Pose parameters of 6-DOF industrial robot end effector , joint angle , using the mapping relationship between joint space and Cartesian space Construct a training set, where represents the position along the x-axis, represents the position along the y-axis, represents the position along the z-axis, represents the angle of rotation around the x-axis, represents the angle of rotation around the y-axis, represents the angle of rotation around the z-axis, represents the direction vector along the x-axis, represents the direction vector along the y-axis, represents the direction vector along the z-axis, represents the normal vector along the x-axis, represents the normal vector along the y-axis, Represents the normal vector along the z-axis.
[0146] The total amount of data in this experimental data set is 5000 groups, from which 2500 groups of samples are randomly selected as training sets, and the other 600 groups are used as test sets. The number of input and output nodes of POA is set to 12 and 6 respectively. POA uses Sigmoid as the excitation function. The number of hidden layer nodes is 30. The maximum number of iterations of the POA-Transformer-BiGRU ensemble learning algorithm Set to 200, warning value is a The safety factor is set to 0.8.
[0147] The comparison of inverse kinematics errors of the six postures is shown in Table 1. Randomly select 10 points in the reachable space of the industrial robot, take the earth coordinate system as the reference, record the Cartesian coordinates corresponding to the points, use the POA-Transformer-BiGRU-Attention ensemble learning algorithm proposed in this paper to calculate the inverse solution and the corresponding posture, and calculate the inverse solution error. The unit of error is mm. The results are shown in Table 1:
[0148] Table 1: Inverse kinematics verification of 10 fixed positions (based on the earth coordinate system)
[0149]
[0150] As shown in Table 1, the maximum error of the inverse solution obtained by the POA-Transformer-BiGRU-Attention ensemble learning algorithm after 6-DOF verification is no more than 0.03%, which can meet the general posture requirements. The number of iterations and convergence curve of the POA-Transformer-BiGRU-Attention ensemble learning algorithm are shown in Figure 1. Figure 3 shown.
[0151] Depend on Figure 3 It can be seen that the POA-Transformer-BiGRU-Attention ensemble learning algorithm can quickly find the optimal solution after the iteration starts. The fitness value of this algorithm is smaller than that of the algorithm using only GA (genetic algorithm), DE (differential evolution algorithm), GWO (grey wolf optimization algorithm), fast convergence speed, smooth curve, and good real-time performance. The root mean square error (RMSE) indicates the degree of curve fitting between the predicted value and the true value. The algorithm settings in the present invention are as follows:
[0152] ;
[0153] in, represents the root mean square error, n represents the total number of observations, represents the true value, Represents the predicted value.
[0154] The present invention conducted 2500 training sets and 10 test experiments on the POA-Transformer-BiGRU-Attention ensemble learning algorithm. By comparison, it was found that the error fluctuation between the predicted value and the true value of the hybrid optimization algorithm of the POA-Transformer-BiGRU-Attention ensemble learning algorithm was small, and the fluctuation amplitude was less than 5 mm, which was within the normal probability error range of the intelligent optimization algorithm. This verifies that the prediction accuracy of the POA-Transformer-BiGRU ensemble learning algorithm proposed in the present invention is relatively good.
[0155] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A robot inverse solution prediction method based on POA-Transformer-BiGRU-Attention integrated optimization algorithm, characterized in that: include: Initialize the POA algorithm and randomly initialize the individual positions of the robots ; Initialize the robot's individual position P i The operations include, Set the number of robots to N and the maximum number of iterations to T max ; Initialize the robot's individual position for, ; in, Represents the value of the ith data point on the dth feature; The individual position of the robot is adjusted using the fitness function Evaluate and position the robot Update, get the updated robot position ; Let the input data X i = , input data X i After the Transformer model training, the output feature Z′ is generated; Use the BiGRU algorithm to complete the input data X of the Transformer model training i Processing is performed to obtain the final state, and the weighted summation result is solved by combining the attention mechanism; Generate a predicted inverse solution result according to the weighted summation result, use the objective function to measure the accuracy of the predicted inverse solution result, and obtain the global optimal solution; The operations that use the objective function to measure the accuracy of the predicted inverse solution include: The objective function The calculation includes, ; in, represents the joint angle vector, , , , Both represent weight coefficients, represents the position error, represents the attitude error, represents the joint limit constraint, represents the prediction error; The position error The calculation includes, ; in, represents the desired end-effector position vector, represents the actual end-effector position vector; The attitude error The calculation includes, ; in, represents the desired rotation matrix of the end effector, represents the actual rotation matrix of the end effector; The joint limit constraints The calculation includes, ; in, represents the restriction coefficient, Indicates The allowed rotation angles are Indicates The maximum allowed rotation angle of the parameter, Indicates The minimum allowed rotation angle of a parameter, if Exceeding the defined robot range , a penalty term is imposed to force convergence to the effective search space; Minimize the objective function by iteratively adjusting the model parameters and the POA algorithm optimization strategy The value of ensures the accuracy of the inverse solution and obtains the global optimal solution.
2. According to claim 1, a robot inverse solution prediction method based on the POA-Transformer-BiGRU-Attention integrated optimization algorithm is characterized in that: The individual position of the robot is adjusted using the fitness function Evaluate and position the robot Update, get the updated robot position The operations include, Using fitness function The individual position of the robot Conduct an assessment, ; Robot individual position P i The update formula is, ; in, Indicates the current best position. Represents a random number, represents a perturbation term to increase search diversity.
3. The robot inverse solution prediction method based on the POA-Transformer-BiGRU-Attention integrated optimization algorithm according to claim 2, characterized in that: include, Transformer uses a self-attention mechanism to process the input sequence. Given an input sequence ; The input sequence self-attention mechanism is calculated as follows: ; ; ; Where Q represents the query matrix, W Q represents the query weight matrix, K represents the Key matrix, W K represents the Key weight matrix, V represents the Value matrix, W V represents the Value weight matrix, Represents the i-th element in the sequence; The attention weights are calculated by dot product: ; Among them, A represents the attention weight matrix, d k represents the dimension of matrix K; Get the output matrix Z based on the attention weight matrix A and the matrix V, Z = AV; Use the ReLU activation function to process the output matrix Z to obtain the output features , 。 4. The robot inverse solution prediction method based on the POA-Transformer-BiGRU-Attention integrated optimization algorithm according to claim 3 is characterized in that: include, The output feature Z′ of Transformer is used as the input of BiGRU, which contains two GRU layers, one for processing the forward sequence and the other for processing the reverse sequence; For each time step t, BiGRU updates the forward hidden state and the reverse hidden state , ; ; ; ; in, represents the output of Z′ at time step t, represents the weight matrix associated with the candidate hidden state, represents the weight matrix associated with the update gate, represents the weight matrix associated with the reset gate, , , Both represent weight matrices, Represents the reset gate, represents the hidden state at time step t-1, represents the update gate, Represents the sigmoid function.
5. The robot inverse solution prediction method based on the POA-Transformer-BiGRU-Attention integrated optimization algorithm according to claim 4, characterized in that: include, BiGRU processes the sequence in two directions, obtaining the forward state and the backward state respectively: ; ; in, represents the forward state, Indicates the backward state; Get the final state based on the forward state and the conceptual state , 。 6. The robot inverse solution prediction method based on the POA-Transformer-BiGRU-Attention integrated optimization algorithm according to claim 5, characterized in that: The operations to solve the weighted summation result by combining the attention mechanism include: ; ; in, represents the energy value at time step t, represents the context vector, represents the attention weight at time step t, represents the energy value at time step j, and T represents the total number of time steps of the sequence; based on and Get the weighted summation result z, 。
Citation Information
Patent Citations
Forward kinematics solving method of parallel robot
CN102968665A
Intrusion detection method and system based on feature selection and transformer-BiGRU
CN118199933A