Thermal error modeling method of truss robot based on GA-LSTM

Purpose – The selection of sensitive temperature measurement points is the premise of thermal error modeling and compensation. However, most of the sensitive temperature measurement point selection methods do not consider the in ﬂ uence of the variability of thermal sensitive points on thermal error modeling and compensation. This paper considers the variability of thermal sensitive points, and aims to propose a sensitive temperature measurement point selection method and thermal error modeling method that can reduce the in ﬂ uence of thermal sensitive point variability. Design/methodology/approach – Taking the truss robot as the experimental object, the ﬁ nite element method is used to construct the simulation model of the truss robot, and the temperature measurement point layout scheme is designed based on the simulation model to collect the temperature and thermal error data. After the clustering of the temperature measurement point data is completed, the improved attention mechanism is used to extract the temperature data of the key time steps of the temperature measurement points in each category for thermal error modeling. Findings – By comparing with the thermal error modeling method of the conventional ﬁ xed sensitive temperature measurement points, it is proved that the method proposed in this paper is more ﬂ exible in the processing of sensitive temperature measurement points and more stable in prediction accuracy. Originality/value – The Grey Attention-Long Short Term Memory (GA-LSTM) thermal error prediction model proposed in this paper can reduce the in ﬂ uence of the variability of thermal sensitive points on the accuracy of thermal error modeling in long-term processing, and improve the accuracy of thermal error prediction model, which has certain application value. It has guiding signi ﬁ cance for thermal error compensation prediction.


Introduction
As a typical industrial robot, the truss robot plays an important role in the manufacturing industry, especially in the field of high-precision machining.In high-speed precision machining, the machining error caused by thermal error accounts for about 40%-70% of the total error (Mayr et al., 2012;Li et al., 2015), which greatly affects the machining accuracy.Therefore, it is an urgent problem to find an effective thermal error control method.
The control methods of thermal error can be divided into two categories.One is to control the thermal error by changing the structure, such as optimizing the structure (Sun et al., 2017) and changing the cooling method (Grama et al., 2018).Such methods are not only economical and cost-intensive, but also complicated to operate, which is difficult to popularize in the actual processing process.The other is the method of thermal error compensation, which needs to arrange temperature measurement points on the robot, and establish a thermal error model based on the temperature difference data to predict the thermal error and then compensate for the thermal error.
Generally speaking, the thermal error control method of changing the structure requires the selection of materials with a small thermal expansion coefficient for manufacturing or the improvement of the cooling method of the mechanism at the beginning of the mechanism design.This method will not only lead to economic cost-intensive, but also difficult to operate, so it is difficult to popularize in the actual machining process.The thermal error compensation method based on thermal error modeling only needs to arrange the temperature measurement points on the mechanism, and the temperature data can be collected for thermal error compensation, which is undoubtedly a lower cost and more effective method.The The current issue and full text archive of this journal is available on Emerald Insight at: https://www.emerald.com/insight/0143-991X.htm arrangement of temperature measuring points and the selection of thermal sensitive points are the basis of thermal error modeling.
Aiming at the screening of thermal-sensitive points, Huang et al. (2021) used a thermal imager combined with a fuzzy clustering method to screen the thermal-sensitive points of computer numerical control (CNC) machine tools.Sun et al. (2022) used the F statistical test to determine the number of fuzzy C-means clustering (FCM) and combined it with the grey correlation degree to screen out the thermal sensitive points.Wen et al. (2022) also used FCM combined with grey relational degree to screen the heat-sensitive points.These clustering methods simplified the screening method of thermal sensitive points and improved the accuracy of the thermal error prediction model.
However, because the traditional fuzzy clustering algorithm is easy to fall into the local optimal solution, the selected data cannot better express the real temperature change.Therefore, many scholars have improved the traditional fuzzy clustering algorithm and applied it to thermal error modeling.Shi et al. (2023) improved the initialization method of the initial membership matrix in FCM.Zhao et al. (2019) used the standardized Euclidean distance to improve the Euclidean distance and used the metric factor to select the initial clustering center.The above-improved clustering method reduced the multicollinearity of each temperature measuring point to a certain extent.Miao et al. (2015) proved that the thermal sensitive point is variable by analyzing the batch gas cutting experimental data on the Leaderway-V450 machine tool.Therefore, the above selection of fixed thermal sensitive points ignores the variation characteristics of thermal sensitive points.In the long-term prediction, the robustness of the prediction accuracy will be greatly reduced.Aiming at the variation characteristics of thermalsensitive points, Miao et al. (2015) proposed a thermal error modeling method based on a principal component regression algorithm, which significantly reduced the influence of temperature-sensitive point changes on the prediction accuracy of the model.Liao et al. (2020) proposed a method for selecting heatsensitive points based on time characteristics.The point where the fastest temperature reaches the highest value in the measurement process is selected as the heat-sensitive point.Compared with the heat-sensitive point selected by the traditional correlation analysis method, it has higher prediction accuracy.Fu et al. (2022) proposed a set thermal error model based on the influence of temperature points on thermal error, which weights and optimizes multiple thermal error prediction models established by combining multiple thermal sensitive points.The above methods have improved the robustness of model prediction accuracy on the basis of traditional methods.
The traditional thermal error modeling method often uses the critical temperature at the current time as the input to predict the thermal error.However, the thermal error not only depends on the temperature characteristics of the current time but also has an inseparable relationship with the temperature characteristics of the past continuous time (Olabode et al., 2023;Hans and Ghosh, 2020).This leads to the low prediction accuracy and robustness of the thermal error model established by the traditional method due to the inability to consider the time series characteristics.The long short-term memory network (LSTM) network with strong memory ability can make up for this deficiency of the traditional model, and the LSTM network has good applicability in thermal error modeling and compensation.Therefore, the LSTM network is more and more widely used in the field of thermal error modeling.Liu et al. (2021aLiu et al. ( , 2021b) ) proposed variable mode decomposition-grey wolf algorithm-LSTM based on VDM, GW and LSTM for thermal error modeling.Gao et al. (2021) proposed particle swarm optimization (PSO)-LSTM based on PSO and LSTM for thermal error modeling.Guo et al. (2022) proposed convolutional neural network (CNN)-LSTM based on CNN and LSTM for thermal error modeling.Ngoc et al. (2022) and Liu et al. (2021aLiu et al. ( , 2021b) ) used LSTM for thermal error modeling.LSTM network has been applied more and more in the field of thermal error modeling and has more robust prediction accuracy than the traditional model used for thermal error modeling.Therefore, LSTM network is selected for thermal error modeling in this paper.
Based on the idea of attention mechanism, this paper optimizes the temperature data of the temperature measurement point and combines it with the LSTM network to model the thermal error of the truss robot.The rest of this paper is organized as follows: the second section introduces the basic principles of genetic algorithm (GA)-LSTM-based thermal error modeling methods.The third section introduces the experimental setup of thermal error acquisition of a truss robot.The fourth section verifies the performance of the thermal error prediction model based on the grey attentionlong short term memory (GA-LSTM) proposed in this paper.The fifth section summarizes the conclusion.

The thermal error modeling method based on genetic algorithm long short-term memory network
LSTM network has a strong ability of time series prediction and can well process thermal error data with time series characteristics.However, at the same time, there are many parameters to be trained in the LSTM network.If the temperature data of all temperature measurement points are input into the LSTM network for prediction, it will greatly affect the efficiency of thermal error modeling and is not conducive to real-time online compensation.Therefore, this paper optimizes the temperature data of the temperature measurement point based on the idea of attention mechanism and combines it with the LSTM network to model the thermal error of the truss robot.
2.1 The basic principle of long short-term memory network LSTM network is a powerful recursive system, which is specially used to overcome the problems of gradient disappearance or gradient explosion when learning long-term dependence (Hochreiter and Schmidhuber, 1997).The LSTM unit consists of a forgetting gate f t , an input gate i t , a unit state C t and an output gate o t .Its unique gating unit and unit state can complete the forgetting of memory information and longterm and short-term memory operations.The structure of the LSTM unit is shown in Figure 1.
In LSTM, the first gating unit is the forgetting gate, whose input is the output h t-1 of the previous moment and the input X t of the current moment.It forgets some of the input information through the sigmoid function and inputs the remaining information into the unit state of the current moment.The second gating unit input gate in LSTM determines which input information can update the information in the unit state.C t represents the state candidate value, which represents an intermediate state between the unit state C t-1 at the previous moment and the unit state C t at the current moment.The output gate of the third gating unit in LSTM determines what information is output, and the output result h t is mainly determined by the updated cell state C t .The main calculation process of LSTM can be expressed as: where X t is the input at the current time, W represents the weight matrix, b represents the bias, s and tanh are activation functions and represents the multiplication of matrix elements.

Fuzzy C-means clustering
The FCM describes the correlation between each data point of the sample and each cluster through the membership degree, updates the membership matrix and each cluster center through continuous iteration and finally converges the objective function.The objective function is defined as: In the formula: m is the number of clusters in the cluster, N is the number of samples, C is the number of cluster centers, X ¼ (x 1 , x 2 , . .., x i ) is the sample data, u ij is the membership degree of the sample point x i to the cluster center c j , c j is the j th cluster center and k*k is a distance metric, this paper uses Euclidean distance.
The convergence condition of the objective function is as follows: In the formula: U is the membership matrix, t is the number of iterations and « is a small constant, which represents the minimum variation of membership.That is, comparing the (t 1 1) th iteration matrix with the t th iteration matrix, if it does not change, it represents the convergence of the objective function.
The calculation method of membership degree is as follows: The calculation method of cluster center is as follows:

Temperature measurement point optimization method based on attention mechanism
The traditional temperature measurement point optimization method first divides the temperature measurement points into multiple categories by clustering method and then uses the correlation analysis method to select the temperature measurement point with the highest correlation with the thermal error data as the key temperature measurement point.This method reduces the workload by discarding the temperature data other than the key temperature measurement points, but the key temperature measurement points are often not fixed due to the change in ambient temperature.At this time, if the conventional method of selecting fixed key temperature measuring points is used for thermal error modeling, the temperature information of key temperature measuring points may be ignored, resulting in unstable prediction effect of LSTM network.The attention mechanism is an input processing method of neural networks.Its essence is to imitate the thinking activity of the human brain when observing things.At this time, humans tend to pay more attention to the parts they are interested in Li and Yu (2023).In this paper, the idea of attention mechanism is introduced.After the clustering is completed, the temperature data of each type of temperature measurement point is divided into time steps.At the same time, attention is added between the input layer and the LSTM layer to extract the temperature data of the temperature measurement point in the key time step of each type to generate a new feature vector as the input of the LSTM network.
The basic principle of the attention mechanism is to calculate the weight of each input feature according to the scoring function and the softmax function, assign high weight to Industrial Robot: the international journal of robotics research and application important features and assign low weight to non-important features.In thermal error modeling, the attention mechanism is to give the appropriate attention size from high to low by comparing the correlation degree between the data of the temperature measurement point and the thermal error data.According to the size of the attention, a new input feature is obtained to predict the thermal error.Its attention distribution calculation formula is as follows: Among them, N represents an N-dimensional input variable, a i is the attention distribution, which represents the weight distribution of each temperature measurement point, S(X i , Y) is the scoring function, X ¼ {X 1 , X 2 , . .., X i } is the temperature data of each temperature measurement point and Y is the thermal error data of the end effector of the truss robot.
The conventional scoring functions in the attention mechanism include point product models and additive models.The weights of the feature vectors calculated by these scoring functions are more inclined to compare the similarity between the query vector and the input feature, which is a relatively hard comparison.In this paper, the method of grey correlation degree is used to replace the scoring function in the attention mechanism, and the temperature measurement points are scored by the correlation degree between the temperature measurement points and the thermal error data.Grey correlation degree is a method to quantify the degree of connection between the analyzed data sequences.The larger the calculated value of the grey correlation degree is, the greater the correlation degree between the corresponding sequences is.The grey correlation degree g(X i , Y) is as follows: In the formula: j ij is the coefficient of grey correlation degree between the reference sequence and the comparison sequence; Y j is the thermal error data of the j th hour; x is the temperature data of the j th hour of the i th temperature measurement point; s is the number of temperature measuring points; r is the resolution coefficient, usually 0.5.The improved attention distribution calculation method is as follows: After the attention distribution calculation is completed, the attention of the temperature data of each temperature measurement point is summarized by weighted average to generate a new feature vector.The calculation process is as follows: The attention-weighted feature vector is input into the LSTM network for thermal error prediction, which avoids the deficiency of ignoring the information of large-scale temperature measurement points in the conventional temperature measurement point optimization method and can reduce the influence of the variability of temperature measurement points on thermal error prediction.The framework of the temperature measurement point optimization method based on the attention mechanism is shown in Figure 2, where X nt represents the temperature data at the time t of the n th temperature measurement point, and « is the data completed by the time step feature extraction in each cluster.

Genetic algorithm long short-term memory network structure
The GA-LSTM structure is shown in Figure 3, where m, n and v. are the number of temperature measuring points in the first cluster, the second cluster and the v. cluster after clustering.A new feature vector sum is generated in each cluster, and the feature vector of each cluster is combined with the ambient temperature to form the input of the LSTM network at time t.
In the training process, the gradient descent algorithm is used as the optimization algorithm for network weight update, and the mean square error (MSE) is used as the loss function.

Thermal error experiment of three truss robot
A long-term experiment was carried out on the truss robot prototype.The temperature data of each temperature measurement point and the thermal error data of the end effector in X, Y and Z directions were collected and the temperature measurement points were divided by the FCM algorithm.

Experimental settings
The truss robot is mainly composed of a column, an Xdirection beam, a Y-direction beam and a mechanical arm.The X-direction double beams are connected to the column.Among them, the manipulator can realize X-direction and Ydirection sliding through the slide rail of each beam; at the same time, there is a movable Y-direction beam, which can slide along the X-direction track through a driving device composed of a motor, a reducer and a rack.
In the experiment, the ambient temperature is selected as the only heat source to study the thermal error of the truss robot in the high-temperature environment.The beam structure of the truss robot is its main supporting component.The span of the beam structure is often large, and it is connected to many truss robot components.The thermal error generated by the beam structure accounts for most of the overall thermal error of the truss robot.To improve the efficiency of simulation and experiment, the structure of the truss robot is simplified and only the main beam structure is retained as the simulation object.Using the simulation software, combined with the change range of the ambient temperature of the space environment in which the truss robot is located, the temperature change of the truss robot when the ambient temperature increases from 26°C to 36°C is analyzed.The temperature field is shown in Figure 4 when the steady state is reached.
According to the steady-state temperature field of the truss robot obtained by the simulation software, the high-temperature zone, the medium-temperature zone and the low-temperature zone are divided.Five, four and three PT100 magnetic suction temperature sensors are arranged in these three temperature zones, a total of 12 temperature measurement points.The temperature measurement point layout scheme is shown in Figure 5.Among them, T1-T5 are the temperature measurement points in the high-temperature zone, T6-T9 are the temperature measurement points in the middle-temperature zone and T10-T12 are the temperature measurement points in the low-temperature zone.According to the temperature measurement point arrangement scheme shown in Figure 5, the temperature sensor is installed, and the specific arrangement of the temperature measurement point of the truss robot is shown in Figure 6.
In the experiment, the data acquisition card is used to record and monitor the temperature change of each temperature measurement point.The ambient temperature is measured by a thermometer (accuracy of 60.1°C), the dial gauge (accuracy of 60.2 mm) is used and the special fixture is designed and installed at the corresponding position of the end-effector to measure the thermal error of the end-effector of the truss robot in X, Y and Z directions.The thermal error measurement method of the end-effector is shown in Figure 7.Only under the influence of ambient temperature, the thermal deformation of the truss robot beam structure is slow, so the dial gauge reading is observed and recorded every half an hour during the experiment.The temperature data of each temperature measurement point of the truss robot and the cumulative thermal error of the end effector were observed in 13 days, and a total of 300 sets of data were measured.Among them, the temperature of each temperature measurement point and the ambient temperature change curve are shown in Figure 8.The first 220 sets of data are taken as the training set, and the rest are taken as the verification set to predict the thermal errors of the end effector of the truss robot in X, Y and Z directions.

Division of temperature measurement points
FCM is used to divide 12 temperature measuring points, and the F-statistic test is used to determine the number of FCM clusters.The larger the F value is, the greater the difference between the types is and the more reasonable the classification is.The calculation process of the F-statistic test is as follows: Among them, S 2 a is the intergroup variance of each cluster of temperature measurement points and S 2 b is the intragroup variance of each cluster of temperature measurement points: Here, n is the number of clusters, c j is the cluster center of cluster j and c is the clustering center of all temperature measurement points: Among them, m is the number of temperature measurement points in cluster j and x ij denotes the i th temperature measurement point of cluster j.
The F values and clustering results of different clustering numbers are shown in Table 1, and the F values in the table retain two decimal places.Obviously when the number of clusters n ¼ 3, the F value is the largest.Therefore, when the number of clusters of FCM is set to n ¼ 3, clustering is performed and the classification results are shown in Table 2.
After the completion of clustering, the grey correlation degree method is used to sort the correlation degree of each temperature measuring point, so as to facilitate the comparison between the temperature measuring point optimization method based on the attention mechanism proposed in this paper and the traditional temperature measuring point optimization method of selecting fixed thermal sensitive points.The ranking results of grey correlation degree from large to small are shown in Table 3.

Model performance verification
To verify the effectiveness of the thermal error modeling method based on GA-LSTM proposed in this paper, it is compared with the A-LSTM that uses the conventional attention mechanism to extract the key time step features of each cluster of temperature measurement points and the LSTM that uses the traditional fixed temperature Industrial Robot: the international journal of robotics research and application measurement method for error prediction.Among them, GA-LSTM and A-LSTM adopt the method proposed in this paper to extract the key time step feature of each type of temperature measurement point for thermal error modeling.The (MAE, root mean square error (RMSE) and mean absolute percentage error (MAPE) are used as the performance evaluation indexes of the model.The smaller the value, the higher the prediction accuracy of the model.Defined as follows:

Class
Temperature measuring point 1 T2, T7 2 T3, T4, T5, T6, T8, T9, T11, T12 3 T1, T10 Source: Authors' own work Industrial Robot: the international journal of robotics research and application between the measured value and the predicted value.The closer the fitting residual is to 0, the better the model performance is.
From the results, it can be seen that compared with the thermal error prediction model established by LSTM using fixed temperature measurement points, the fitting residuals of GA-LSTM and A-LSTM using two attention mechanisms to extract the key time step features of temperature measurement points in X, Y and Z directions are closer to 0, and the fluctuation range is smaller.At the same time, compared with the A-LSTM before the improvement of the attention mechanism, the GA-LSTM after the improvement of the attention mechanism has smaller residual fluctuations in all three directions, and the residual fluctuations in all three directions are basically within 2 mm, which is much better than A-LSTM.Table 4 is the comparison of the prediction effect of each model in three directions under the three evaluation indexes.It can be seen from the table that the thermal error models A-LSTM and GA-LSTM established by the key time step feature extraction method proposed in this paper are much smaller than the thermal error models established by the fixed temperature measurement point method.At the same time, except for the MAPE value in the Y direction, the GA-LSTM has the smallest errors in all three directions.The structure shows that the model has good prediction performance.
In the long-term thermal error experiment, with the change of ambient temperature every day, the change of key temperature measurement points will be more frequent and the conventional method of selecting fixed temperature measurement points has been greatly affected by the variability of key temperature measurement points.At this time, the selected thermal sensitive points often cannot effectively reflect the temperature characteristics of all temperature measurement points, which leads to the relatively poor prediction performance of LSTM.GA-LSTM and A-LSTM are used to extract the key time step features of each cluster of temperature measurement points, which can effectively reduce the influence of the variability of temperature measurement points on prediction accuracy.The GA-LSTM, which improves the scoring function in the attention mechanism, adopts the grey correlation method for scoring.Compared with the hardness of conventional scoring functions, it can more effectively calculate the degree of correlation between temperature measurement points and thermal errors.Therefore, its prediction is the best in all three directions.The experimental results prove the effectiveness of the thermal error modeling method for extracting key time step features by the attention mechanism and the effectiveness of the improved attention mechanism.

Conclusion
The traditional temperature measurement point optimization method is to select fixed thermal sensitive points for thermal error modeling, ignoring the variation characteristics of thermal sensitive points.In the long-term prediction, the robustness of the prediction accuracy will be greatly reduced.Based on the traditional attention mechanism, this paper improves it to optimize the temperature measurement point and improves the modeling efficiency and model prediction accuracy without abandoning the temperature measurement point data.Based on the current work, we draw the following conclusions: The thermal error prediction model A-LSTM is constructed by using the conventional attention mechanism to extract the key time step features of each cluster of temperature measurement points.The average RMSE, MAE and MAPE in the X, Y and Z directions of A-LSTM are 31.6%,35.0% and 35.9% lower than those of LSTM with fixed temperature measurement.It shows that the thermal error prediction model established by the temperature measurement optimization method based on the attention mechanism to extract the key time step characteristics of each cluster of temperature measurement points has higher prediction accuracy.
The average RMSE, MAE and MAPE of GA-LSTM thermal error prediction model constructed by improved attention mechanism in X, Y and Z directions are 28.0%,31.2% and 15.4% lower than those of A-LSTM with conventional attention mechanism.It shows that the GA-LSTM thermal error prediction model GA-LSTM constructed by the improved attention mechanism has higher prediction accuracy than the A-LSTM using the conventional attention mechanism.
The GA-LSTM thermal error prediction model based on attention mechanism proposed in this paper can reduce the influence of the variability of thermal sensitive points on the accuracy of thermal error modeling in long-term processing, and improve the accuracy of thermal error prediction model, which has certain guiding significance for thermal error compensation prediction.However, the thermal error compensation effect has not been verified.In the future, the thermal error compensation experiment will be carried out based on this model, and its compensation effect will be verified in the next stage of research work.

Figure 1
Figure 1 LSTM unit structure diagram

Figure 2
Figure 2 Optimization method of temperature measurement point based on attention mechanism

Figure 6 Figure 7 Figure 8
Figure 6 The specific arrangement of temperature measurement points of truss robot 20)In the above formula, N is the number of samples and y i and y i represents the predicted and observed values of the i th sample, respectively.The (a)-(c) of Figures 9-11 are the thermal error prediction effects of each model in each direction of the end effector of the truss robot.It can be seen from the figure that compared with the thermal error prediction model established by LSTM using fixed temperature measurement points, the two GA-LSTM and A-LSTM using attention mechanism to extract the key time step features of temperature measurement points have better fitting performance with the measured values in X, Y and Z directions.At the same time, the prediction accuracy of the three directions of GA-LSTM improved by grey correlation degree is obviously better than that of A-LSTM before improvement.The (d) of Figures 9-11 is the fitting residuals of each model in three different directions.The fitting residual is the difference

Figure 9 X
Figure 9 X direction prediction effect

Table 3
Grey correlation degree ranking results

Table 4
Comparison of model prediction effectsLong Li, Binyang Chen and Jiangli Yu Industrial Robot: the international journal of robotics research and application