Next Article in Journal
In Vitro and In Vivo Testing of Stereolithography (SLA)-Manufactured Haemocompatible Photopolymers for Blood Pump
Previous Article in Journal
Deep Learning-Based Prediction of Stress and Strain Maps in Arterial Walls for Improved Cardiovascular Risk Assessment
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Thermal Error Prediction Method of High-Speed Motorized Spindle Based on Pelican Optimization Algorithm and CNN-LSTM

1
School of Computer Science and Technology, University of Chinese Academy of Sciences, Beijing 100049, China
2
Shenyang Institute of Computing Technology, Chinese Academy of Sciences, Shenyang 110168, China
3
School of Mathematics and Computer Sciences, Chifeng University, Chifeng 024000, China
*
Author to whom correspondence should be addressed.
Appl. Sci. 2024, 14(1), 381; https://doi.org/10.3390/app14010381
Submission received: 6 December 2023 / Revised: 27 December 2023 / Accepted: 28 December 2023 / Published: 31 December 2023

Abstract

:
Given motorized spindles’ extensive periods of prolonged high-velocity operation, they are prone to temperature changes, which leads to the problem of thermal error, leading to diminished precision in machining operations. To address the thermal error issue in motorized spindles of computer numerical control (CNC) machine tools, this study proposes a pelican optimization algorithm (POA)-optimized convolutional neural network (CNN)–long short-term memory (LSTM) hybrid neural network model (POA-CNN-LSTMNN). Initially, the identification of temperature-sensitive locations in the spindle system is performed using a combination of hierarchical clustering, the K-medoids algorithm, and Pearson’s coefficient calculation. Subsequently, the temperature data from these identified points, along with real-time collected spindle thermal error data, are employed to construct the model. The Pelican optimization algorithm is used to enhance the model parameters to achieve the best performance. Finally, the proposed model is subjected to a comparative analysis with other thermal error prediction models. Drawing from the experimental findings, it is evident that the POA-CNN-LSTMNN model exhibits superior prediction performance.

1. Introduction

The precision of machining in CNC machine tools has consistently remained a focal point in the manufacturing industry, serving as a crucial indicator of overall machining capabilities within the modern machinery sector. The precision of CNC machine equipment is influenced by a multitude of elements, encompassing dimensional errors, geometric errors, thermal errors, and tool deflection errors [1]. Within the diverse origins of machine tool error, thermal error accounts for the largest proportion, reaching more than 40–70% [2,3,4]. The incorporation of high-speed motorized spindles into CNC machine equipment is becoming more and more popular. The attributes of motorized spindles significantly influence the production accuracy, robustness, and dependability of CNC machine tools [5,6,7]. Although the motorized spindle rotates at a rapid pace, the primary source of thermal errors affecting machining accuracy is the spindle’s thermal deformation resulting from temperature elevation [8]. The thermal expansion of the motorized spindle is the predominant factor that influences a machine tool’s accuracy and consistency [9]. The conventional approaches to mitigating thermal error primarily involve error avoidance and error compensation techniques [10]. Error avoidance refers to avoiding the generation of errors or reducing the probability of errors as much as possible by means of design and process control. It usually starts from the system design and engineering point of view to optimize each link and reduce the factors that may lead to errors. For example, in mechanical structure design, using rigid materials and increasing supporting points can enhance the rigidity of the system and decrease the errors caused by vibration. Error compensation refers to correcting the errors that have occurred by means of measurement and compensation. When the error cannot be completely avoided, it can be corrected by measuring the error accurately and using compensation methods to achieve the target accuracy requirements. Error compensation is usually based on measured data and mathematical models, and the error is corrected by calculating and adjusting control parameters. For example, during machine tool operations, the temperature change of the spindle is recorded simultaneously and compared with the pre-established temperature–thermal error relationship model, and the machining size is corrected by using the compensation algorithm to meet the accuracy requirements. The error avoidance method is usually a one-time investment that is optimized in the design stage. If the system is not properly designed, the need for additional corrections can be costly in terms of time and human and financial resources. Error compensation, on the other hand, is a software-based compensation method that is easier to operate, more economical, and more effective. The error software compensation method has become the current mainstream method to mitigate thermal errors because of its flexible, efficient, cost-effective, and real-time nature [11]. Prior to implementing thermal error compensation techniques, it is essential to accurately forecast the thermal deviation and compensate for the forecasted value within the system via software compensation. Employing a forecasting model for analyzing and compensating for error is a promising approach that offers the potential to diminish machine tool thermal error without incurring additional costs [12]. Therefore, the establishment of a precise model for predicting thermal errors and the exact estimation of predictive results are essential prerequisites and key links to ensuring the effective compensation of thermal error. The model-driven strategy for compensating for thermal errors is also a sustainable and cost-effective compensation method [13]. Xiao et al. [14] proposed both a binary linear regression model and an artificial neural network (ANN) model to address the spindle’s thermal expansion. Through experimental comparisons, they demonstrated the superiority of the ANN model in resolving the issue. Fu et al. [15] introduced a model for predicting thermal errors utilizing a foundation of SVD-AUKF that combines singular value decomposition and adaptive unscented Kalman filter techniques and verified its effectiveness with different experiments on two machine tools. Gowda et al. [16] put forward a multivariate linear regression model to analyze machine tools’ thermal error and conducted several case studies using cross-validation, and the accuracy of the predictions made by the final model reached 96.7%. Song et al. [17] introduced a model that aims to forecast and compensate for thermal errors by utilizing edge computing as a foundation and carried out spindle variable speed experiments and spindle intermittent constant speed experiments. After compensation, in the scenario of spindle speed variation, the spindle’s axial thermal error exhibited a fluctuation range of −19.8 μm to 11.5 μm and of −11.9 μm to 7.7 μm in the scenario of spindle intermittent constant speed, which greatly reduced the error fluctuation range and improved the accuracy stability. de Farias et al. [18] proposed an error compensation system grounded in the foundation of the radial basis function and carried out experiments on three-axis CNC machine equipment. In accordance with the obtained results, the thermal maximum error was reduced by 77.8% in a higher-temperature operating environment. Luo et al. [19] introduced a single-dimensional convolutional minimal gate unit thermal error forecasting model built upon residuals, which incorporated both cloud computing and edge computing, and the final accuracy reached 98.18%. Jia et al. [20] developed a 1DCNN-GRU-attention architecture model and finally proved experimentally that the model’s correctness in forecasting thermal errors reached 81.53% in the complex case of multiple coupling. Du et al. [21] put forth a model grounded in nonlinear programming and thermal distortion decoupling and compared it with MLR and BPNN thermal deformation prediction models, ultimately showcasing the superior performance of their proposed model.
Prior to establishing the thermal error forecasting model, it is essential to initially acquire temperature data from the heated component of the machining equipment. Subsequently, the relationship between temperature variations and corresponding thermal error can be investigated. CNC machine tool beds are generally huge. If there are multiple locations for measuring temperature, on the one hand, it means that there are too many sensors and that complicated wiring will cause a lot of human and financial costs. On the other hand, it means that the temperatures of various sections within the machine tool are collinear, which will affect the model’s identification and stability. Therefore, the accurate selection of the thermal critical temperature points plays a pivotal role in predicting and compensating for thermal errors [22]. Zhu et al. [23] proposed an iterative elimination-based approach for opting for key temperature points and finally determined the temperatures of three key points as the inputs to the model from eight points, thereby establishing a thermal error forecasting model built upon the random forest algorithm and making a comparison with the traditional active learning model, which proved that the precision of this model was higher. Katageri et al. [24] developed two thermal sensitive point selection methods—the method for assessing thermal error sensitivity and the method for conducting thermal modal analysis—and used the cantilever beam as an example for experimental analysis, finally proving that modeling the thermal errors utilizing the key temperature point data chosen through these two new methods resulted in better robustness of the models. Li et al. [25] downsized the quantity of temperature measurement locations from eight to four by utilizing the selection method of the analysis of statistical correlations and a self-organizing feature map, which efficiently eliminated the multicollinearity between temperature measuring points, and put forward the IPSO-BP model, concluding that the proposed IPSO-BP model displayed a heightened capability for predicting the thermal elongation of a spindle. Abdulshahed et al. [26] used the gray model combined with the fuzzy C-mean to select key thermal measurement locations and used the adaptive fuzzy inference system of the fuzzy C-mean to design and develop a model for predicting thermal errors, and the experimental results substantiated that the absolute residuals of the predicted thermal error from the model were below 2 μm. Liu et al. [27] put forward a model for forecasting a spindle’s thermal elongation by utilizing the principles of BiLSTM. For model training, eight key temperature measurement points were selected, including seven on the spindle and one representing the ambient temperature, and it was finally proven that the constructed model achieved a forecasting precision exceeding 85%. Kumar et al. [28] reduced the number of temperature sensors at the center of a measured object from three to one by building an improved binary polynomial regression model; finally, it was proven that the model accuracy reached 85.99% with only one sensor. Yao et al. [29] presented a methodology for selecting critical temperature points based on sensitivity analysis and then combined a multiple regression algorithm with a linear fitting method to construct a comprehensive model for predicting thermal positioning errors. Subsequent experimentation involving thermal error prediction and compensation was conducted, and in the end, the highest positional deviation of the Z-axis was reduced by 87.09% and 49.87% in the cold and hot states, respectively. Abdulshahed et al. [30] arranged an extensive array of temperature measurement locations on a CNC milling machine and used the gray model and the fuzzy C-mean strategy to compress the 76 candidate temperature sensing locations to 5 key temperature points. Subsequently, a prediction model employing the adaptive fuzzy neuro inference principle was developed, which was validated to enhance the machine tool’s level of accuracy to over 80% across various operating conditions. Yang et al. [31] implemented the weighted gray correlation to minimize the quantity of points for thermal measurement from 16 to 4 and introduced an adaptive modeling method for thermal compensation in gear machine tools. The experimental findings revealed a reduction in thermal errors of 11.75%. Dai et al. [32] applied a combined grey correlation and FCM to refine 10 temperature sensing locations, ultimately narrowing down the selection to 4 points, and used the KELM enhanced by the serpentine optimization algorithm (SO-KELM) for the prediction modeling, and the accuracy reached 96.95%. The impact of thermal errors on the performance of CNC machine equipment is substantial, underscoring the necessity for a resilient and exceptionally precise thermal error forecasting model [33]. The utilization of neural networks in modeling the thermal errors of machine equipment has been steadily growing due to their powerful nonlinear processing capability, massively parallel computation, strong computational capability, high fault-tolerant rate, etc. The long short-term memory neural network (LSTMNN) falls under a distinct category of recurrent neural networks (RNNs). LSTMNN can better capture and remember long-term dependencies by introducing memory units and gating mechanisms. Compared with the standard RNNs, LSTMNN displays improved capability in handling long-term dependencies within time series data, thus improving the memory ability of the model. Thermal retention effects and the cumulative thermal deformation not only influence the thermal error dependent on the temperature properties at the present moment but are also inextricably linked to the temperature characteristics at previous consecutive times [34]. Therefore, LSTMNN has a unique advantage in dealing with CNC machine tool thermal errors. Deep learning, as a data-centric algorithm that utilizes large-scale data, has the capacity to autonomously acquire complex mapping relationships and understand high-dimensional data characteristics, independent of variables like the surrounding conditions or intricate parameters [35]. Serving as the core technology for deep learning, CNN has special advantages in extracting and processing multidimensional spatial features such as two-dimensional and three-dimensional features [36]. While establishing the thermal error forecasting model, the input is the temperature readings from each key thermal measurement location on the machining equipment. The temperature readings from each temperature sensing location typically demonstrate continuous changes over time, indicating their temporal characteristics. They also possess spatial characteristics. This is due to the fact that the temperature measurement points are commonly situated in various sections of the machine and the temperature data from different locations have significant differences, which reflect the spatial characteristics of the machine structure. Consequently, the temperature data inputted into the model have both temporal and spatial properties. To proficiently capture the time-based and spatial properties of temperature rise data and construct a highly precise model for thermal deviation prediction, this article adopts a CNN-LSTM hybrid neural network (CNN-LSTMNN) for constructing the predictive model. The pelican optimization algorithm (POA) represents a groundbreaking swarm intelligence algorithm, put forward by Pavel Trojovský and Mohammad Dehghani in 2022. The algorithm emulates the natural hunting behavior of pelicans. POA has a strong exploration ability to effectively check the search domain and identify the optimal region, a strong development ability to find the optimal solution, and is more formidable than and superior to other comparable algorithms in solving optimization problems [37]. Herein it is used to enhance the parameter optimization of CNN-LSTMNN with the goal of constructing a more accurate POA-CNN-LSTMNN model. To summarize, this study first adopts hierarchical clustering combined with the K-medoids algorithm and the Pearson correlation coefficient approach to choose the points that are sensitive to temperature near the spindle. Then, the temperature readings gathered from the temperature-sensitive locations and the corresponding thermal error data are used as inputs and outputs to build a POA-CNN-LSTMNN thermal error forecasting model. Finally, a comparative analysis is conducted with the other three models to demonstrate the robustness of the proposed approach. Figure 1 illustrates the research trajectory followed in this study.

2. Thermal Error Modeling

2.1. Selection of Temperature-Sensitive Points

To ensure the precision of the thermal error forecasting model and address the issue of collinearity among temperature measurement points, it is imperative to carry out the selection of points that are sensitive to temperature. Herein we use hierarchical clustering combined with the K-medoids algorithm and Pearson’s correlation coefficient method (H-K-P) to conduct the task of selecting temperature-sensitive locations. The K-medoids algorithm is more robust, more easily interpretable, more widely applicable, and more computationally efficient than the K-means method [38]. Hierarchical clustering can reflect well the categories from the K-medoids principle. Then, the correlation scores among all temperature data points and thermal errors within each cluster are computed according to Pearson’s correlation coefficient method, and the points with the strongest correlation to thermal errors in each grouping are identified as the key points in their respective clusters. In this way, K temperature-sensitive points are selected.

2.1.1. Principle of Hierarchical Clustering Algorithm

The idea of hierarchical clustering is to divide the dataset at different levels based on the similarity between clusters and finally form a tree-like structure. The proximity between clusters can be assessed by the distance between two samples. At first, it is assumed that each sample point is a separate category, and then the two categories with the highest similarity are found and merged in each iteration of the algorithm. This process is repeated until all samples are merged into a large category. Hierarchical clustering can reflect well the hierarchical relationship between data, and there is no need to predefine the number of clusters. The execution process is as follows:
(1)
The data of N temperature measurement points to be classified are regarded as N classes, each class contains exactly one sample, and the feature data set to be classified by X is constructed:
X = X 1 , X 2 , X 3 , , X N
(2)
Calculate the similarity between the N classes, where the similarity is measured by the mutual distance between the temperature measurement points. The N-order similarity symmetry matrix M 0 is obtained:
M 0 = 0 M 1,2 M 1 , N M 2,1 0 M 2 , N   M N , 1 M N , 2 0
where M i , j denotes the distance between temperature measurement points X i to X j , 1 ≤ i,jN.
(3)
Among the off-diagonal elements of the matrix, choose the one with the smallest value Assuming that this element is M p , q , merge the temperature measurement points X p and X q into a new class. The new class can be noted as X g = X p , X q . Eliminate the rows and columns where X p and X q are located in the original matrix M 0 and recalculate the interclass similarity of the N-1 classes consisting of the N-2 classes in the original matrix and the new class X g to obtain the new N-1 order similarity matrix M 1 :
M 1 = 0 M 1,2 M 1 , N 1 M 2,1 0 M 2 , N 1   M N 1,1 M N 1,2 0
(4)
Iterate step 2 from M 1 to obtain the matrix of order N-2: M 2 , then iterate the above steps from M 2 to obtain M 3 , and so forth, until eventually all the thermal measurement locations are consolidated into a single overarching category.
(5)
Based on the results of calculating similarity in each step mentioned above, create a dendrogram for hierarchical clustering.

2.1.2. Principle of K-Medoids Algorithm

X is a sample set consisting of N objects, X = X 1 , X 2 , , X i , , X N ,   1 i N , and each object X i has attributes of r dimensions. These N objects are to be clustered into K classes using the K-medoids algorithm using the following procedure:
(1)
Identify the optimal value for the number of cluster centers, K.
(2)
Randomly choose the data from k temperature measuring locations as the centers of K clusters, also called centroids:
C ( 0 ) = C 1 0 , C 2 0 , , C j 0 , , C K 0 1 < K < N ,   1 j K
(3)
Calculate the Euclidean distance from each object X i to each centroid C j :
D i s X i , C j = l = 1 r X i l C j l 2
where X i l denotes the l-th feature of the i-th object, C j l denotes the l-th feature of the j-th centroid, and 1 ≤ lr.
(4)
Compare the Euclidean distance from each object to each centroid in turn, and allocate the objects to the cluster where the closest centroid is located to obtain K clusters:
K ( 0 ) = H 1 0 , H 2 0 , H 3 0 , , H K 0
(5)
For each cluster, compute the total distance between each sample point and all other sample points and select the point with the smallest total distance as the new cluster center:
C j 1 = m i n i = 1 H j X i H j D i s X i , X j   i j ,   1 j H j
where H j represents the j-th cluster, and H j is the number of samples of the j-th cluster. The new K centroids are expressed as follows:
C ( 1 ) = C 1 1 , C 2 1 , , C j 1 , , C K 1 1 < K < N ,   1 j K
(6)
Repeat steps 3 and 4 to obtain new K clusters:
K ( 1 ) = H 1 1 , H 2 1 , H 3 1 , , H K 1
(7)
Repeat steps 5 and 6 until the center of mass of each cluster does not change and consider that the algorithm has converged and the clustering is completed. The final K clusters are obtained as follows:
K ( t ) = H 1 t , H 2 t , H 3 t , , H K t
where t stands for the algorithm having gone through a total of t iterations.

2.1.3. Principle of Pearson’s Correlation Coefficient

The Pearson correlation coefficient is a method to assess the strength of linear relevancy between two factors, with values ranging from −1 to 1. A value of +1 indicates a perfect positive correlation, signifying a strong positive linear relationship between two variables, and a value of −1 indicates a perfect negative correlation, signifying a strong negative linear relationship. A correlation coefficient close to 0 indicates no linear relationship. The Pearson correlation coefficient is calculated as follows.
r O , U = C o v O , U σ O · σ U = i = 1 n O i O ¯ U i U ¯ i = 1 n O i O ¯ 2 · i = 1 n U i U ¯ 2
where r O , U represents the Pearson correlation coefficient of two variables O and U, respectively; C o v O , U is their covariance; and σ O and σ U are the standard deviations of variables O and U, respectively. O i and U i are each element of variables O and U, respectively, and O ¯ and U are the average values of variables O and U, respectively.

2.2. Introduction of CNN-LSTMNN

2.2.1. Convolutional Neural Network

A convolutional neural network (CNN) enables the effective extraction of spatial features. CNN is utilized to extract features from input data by leveraging convolutional kernels. The extracted characteristics are subsequently fed into a fully connected network for recognition and forecasting tasks. The process of feature extraction includes four steps: convolutional computation, activation, batch normalization, and pooling.
Convolution computation is an effective method for feature extraction. Convolution calculation usually uses a square convolution kernel to perform a sliding window operation on the input data at a specified step size to traverse the input features. At each step, the convolution kernel will appear to overlap regions with the input features. The corresponding elements of the overlapping regions are multiplied and summed, and the bias terms are added to obtain a fraction of the output features. The depth of the convolutional kernel should match the depth of the input features. After the convolution kernel is finished traversing the input features according to step size, the extracted output feature data can be obtained.
Activation means choosing an activation function to introduce nonlinearity. Linear models have limited expressive capacity. Adding nonlinear factors will make the expression ability of neural networks more powerful.
Batch normalization (BN) is a technique that standardizes the input data for every layer, centering their mean around 0 and scaling their variance to 1 and following a standard normal distribution. This technique helps mitigate the issue of gradient vanishing to some extent.
Pooling involves downsampling feature data, reducing the number of features and decreasing dimensionality through sampling. Popularly utilized techniques comprise maximum pooling and average pooling. Maximum pooling can keep the most significant features in the input feature map and, at the same time, decrease the size of the characteristic graph to avoid the problem of overfitting. Average pooling involves computing the arithmetic mean of all pixels of the characteristic data map as the output in each pooling window. Both pooling methods are effective in enhancing the model’s capacity for generalization, making it less sensitive to minor variations in the input data. Figure 2 illustrates the essential computation process of CNN.

2.2.2. Long Short-Term Memory Neural Network

The long short-term memory neural network (LSTMNN) can effectively extract continuous-time features. In contrast to RNN, LSTMNN exhibits distinctive features and advantages, such as capturing long-term dependence, alleviating the disappearance and explosion of gradients, processing variable-length sequences, learning gating mechanisms, and carrying out parallel computing. LSTMNN can automatically learn the important information and ignore the unimportant parts in the input data through the gating mechanism, which can control the flow of information inside the memory unit. This makes LSTMNN more resistant to noise and redundant information and improves the robustness of the model. Moreover, in traditional RNN, the backpropagated gradient is prone to the problem of gradient vanishing or gradient explosion on long sequences, which leads to difficulties with the training and learning of deep networks. However, LSTMNN effectively alleviates this problem through the gating mechanism, which enables the gradient to be effectively transmitted over longer time steps, further improving the training efficiency and performance of the network.
The underlying structure of the LSTMNN’s hidden layer is characterized by the addition of three thresholds and two states, namely, the forgetting threshold f t , the input threshold i t and the output threshold o t , as well as the cellular state C t and the candidate state C t ~ . They are computed as follows:
h t = tanh C t     o t
C t = C t ~ i t + C t 1 f t
C t ~ = t a n h ( h t 1 W h c + x t W x c + b c )
i t = σ ( h t 1 W h i + x t W x i + b i )
f t = σ h t 1   W h f + x t W x f + b f
o t = σ ( h t 1 W h o + x t W x o + b o )
where h t 1 denotes the immediate memory at the preceding time step t 1 ; h t represents the immediate memory at the ongoing time step t ; x t is the input characteristic at the current time; b i , b f , and b o are the to-be-trained bias items; W x i , W x f , and W x o are the to-be-trained parameter matrices of x t ; W h i , W h f , and W h o are the to-be-trained parameter matrices of h t ; cellular state C t represents sustained memory, C t ~ denotes temporary memory; and σ stands for using sigmoid to activate the function. The diagram illustrating the structural units of LSTMNN is illustrated in Figure 3.
The design of the CNN-LSTM neural network (CNN-LSTMNN) is depicted in Figure 4. CNN uses a pair of convolutional layers and a pair of pooling layers, whereas the LSTMNN part uses two LSTM layers and two dropout layers. The dropout layer can discard a certain proportion of the neurons in the last hidden layer, which alleviates the over-fitting problem. Table 1 showcases the parameter configurations of CNN-LSTMNN.

2.3. Pelican Optimization Algorithm Principle

The pelican optimization algorithm (POA) is a nascent swarm intelligence optimization algorithm that draws inspiration from the accurate hunting behavior of pelicans in nature and thus was developed from the study of their hunting process. Pelicans are distributed in warm waters all over the world, belonging to the family of large swimming birds. They have a body length of about 150 cm, a beak length of more than 30 cm, and developed throat sacs suitable for fishing mainly in lakes, rivers, coasts, and marshes. They often live in groups. Large pelicans have a wingspan of up to 3 m and can fly long distances at speeds in excess of 40 km per hour. Pelicans have very sharp eyes and are good at swimming and flying. Even when flying high in the air, the fish swimming in the water cannot evade the vigilant gaze of pelicans. If flocks of pelicans find fish, they align themselves in a straight formation or a semicircle to outflank and herd the fish toward the shallows. At that moment, they expand their beaks and swim forward, and the fish become their food regardless of the water that is also gathered. Then, they close their mouths and shrink their throat sacs to squeeze out the water, and the delicious fish are swallowed into their stomachs for a good meal. POA simulates the foraging behavior of pelicans: It has the ability to conduct global and local searches and can discover the potential best solution within the search space. This algorithm holds certain application value in addressing diverse optimization problems. The algorithm’s mathematical model is represented as follows.
(1)
Initialize the population.
POA is an algorithm that relies on a population-centric approach, with pelicans serving as the constituent members of this population. Each pelican represents a candidate solution. Suppose N pelicans exist in an M-dimensional space, denoted as P 1 , P 2 ,…, P N . Then, the positions of the N pelicans can be represented by an N × M matrix, denoted as matrix P, as follows:
P =   P 1 P i P N   N × M =   p 1,1 p 1 , j p 1 , M p i , 1 p i , j p i , M p N , 1 p N , j , p N , M   N × M ,   i = 1,2 , , N ; j = 1,2 , , M ;
where p i , j denotes the i-th pelican’s site in the j-th dimension. At the beginning, the site of the pelican is randomly distributed, so p i , j can be initialized in a random manner within the specified lower and upper boundaries of the prey hunting range for the pelican at index i in the j-th dimension. The formula is as follows:
p i , j = m i n j + r · m a x j m i n j ,   i = 1,2 , ,   N ;   j = 1,2 , , M ;
Among them, m i n j and m a x j are the minimum and maximum boundaries of the prey hunting range of the pelican at index i in the j-th dimension, respectively, and r represents a randomly generated number within the range (0, 1).
(2)
Determine the objective function.
In the POA algorithm, each pelican’s position serves as a potential solution; the objective function can be determined by considering the vector composed of potential solutions. It is shown below:
F =   F 1 F i F N   N × 1 =   F ( P 1 ) F ( P i ) F ( P N )   N × 1   ,   i = 1,2 , N
where F i is the objective function value for the i-th potential outcome, and F is the objective function vector.
(3)
Discover and lock in prey.
During this phase, pelicans search for and find prey high in the air and later move toward the area where the prey is located. The random distribution of prey within the search space enhances the searching capacity of the pelican. The position update equation of the pelican in this phase is as follows:
p i , j a =   p i , j + r · h j R · p i , j , F h < F i ;   p i , j + r · p i , j h j ,    F h F i   ;
P i =   P i a ,   F i a < F i P i ,   F i a F i
where p i , j a signifies the i-th pelican’s revised position in the j-th dimension, and r is a random digit assigned a value of either 1 or 2. h j is the prey’s position in the j-th dimension, and F h is the number of corresponding objective functions. P i a is the newly updated global location of the i-th pelican, and F i a is its objective function.
(4)
Carry out predation of the prey.
In this step, the pelican locks the prey area and then extends its wings above the water level in that area to compel the prey in the locked area toward shallow water so that the fish can move upward and smoothly enter the throat sac of the pelican. This predation mode is beneficial for the pelican to catch more fish. The mathematical calculation process of this step is as follows:
p i , j b = p i , j + C · 1 t T · 2 · r 1 · p i , j
P i =   P i b ,   F i b < F i P i ,   F i b F i
where p i , j b stands for the updated site of the pelican at index i in the j-th dimension, as determined in step 4; C = 0.2 is a constant; and C · 1 t / T describes the neighborhood radius of the pelican members. t stands for the current iteration number, and T stands for the upper limit of iterations. P i b is the i-th pelican’s latest global position at the current step, and F i b is the objective function based on this position.

2.4. Pelican Optimization Algorithm Principle

The process of establishing the POA-CNN-LSTMNN model for forecasting thermal errors is described as follows:
(1)
Establish the architecture of the CNN-LSTMNN.
(2)
Prepare the training dataset and test dataset.
(3)
Randomly assign initial values to the parameters and thresholds of CNN-LSTMNN.
(4)
Initialize the pelican population and configure the parameters of the pelican optimization algorithm, including:
(1)
The total number of iterations: This parameter influences both the program’s runtime and the reliability of the model—here, the algorithm is configured to run for a total of 80 iterations;
(2)
The population size, represented by the total number of individuals N, specified as 50;
(3)
The dimensionality of the optimization problem space: To refine the parameters of the CNN-LSTMNN model, namely, the learning rate, the number of iterations, and the number of nodes in the hidden layer, the dimension of the algorithm is set to 3.
(5)
Compute the fitness score for each individual: Assess the fitness value of each specific individual based on the optimization objective of the problem. Subsequently, perform a sorting operation based on the fitness scores to identify the best position and the worst position found so far. The fitness value can be the objective function value of the problem or the index related to the objective function. Here, POA’s fitness function is determined by the root mean square error (RMSE) between actual values and the predictions.
(6)
Find the prey and move towards it: Each individual pelican adopts different search strategies to choose the next moving direction and distance according to its own position and fitness value. Update the member position according to Equation (21) to obtain the current optimal value.
(7)
Predation of prey: Update the pelican’s position further with Equation (23).
(8)
Evaluation of fitness: Recalculate the fitness value of the moved individual. If the existing best value outperforms the earlier one, the best overall solution is updated. If not, the program returns to step 4 and continues iterating until a termination criterion is met.
(9)
After the algorithm’s iterations are finished, the chosen optimal solution is used to determine the specific values for the parameters and thresholds in the CNN-LSTMNN model.
Figure 5 illustrates the workflow of the POA-CNN-LSTMNN thermal error prediction model.

2.5. CSOA-CNN-LSTMNN Model

The chicken swarm optimization algorithm (CSOA) is an optimization method based on swarm intelligence, drawing inspiration from the behavioral patterns of chicken flocks. To validate the resilience of the POA-CNN-LSTMNN model, we compared it with the CSOA-CNN-LSTMNN model. The data used for model training were consistent. CSOA effectively extracted the swarm intelligence of chickens to optimize the problem, and its optimization performance was stronger than common swarm intelligence-based approaches such as the genetic algorithm (GA) and the particle swarm optimization algorithm (PSO) [39,40,41]. CSOA seeks the best possible solution for the problem by simulating the exploration and cooperative behavior of different chickens in a flock. In the CSOA, each chicken represents a solution, and the whole chicken swarm represents the whole solution space. Every chicken in the flock has its own position information, and they seek the optimal solution by moving and communicating with each other. During the optimization process, each chicken evaluates its own solution based on its own fitness function and shares its experience with the surrounding chickens. In this way, the knowledge and experience in the flock are gradually transferred and accumulated, thus helping the flock to obtain the best solution faster. The steps for the CSOA-CNN-LSTMNN approach are described as follows:
(1)
Establish the architecture of CNN-LSTMNN.
(2)
Prepare data sets, including test sets and training sets.
(3)
Carry out random initialization of the CNN-LSTMNN parameters and thresholds.
(4)
Randomly generate the initial flock and initialize the population parameters, including the size of the population, represented as N; the topmost iteration count Max_Iterations; the frequency of population updates G, and so on.
(5)
Compute the fitness score for each individual within the population. The RMSE between the forecasted and true values of the model’s thermal error is utilized as the fitness function of CSOA.
(6)
Rank the calculated N fitness function values of the chickens, with the best-fit chickens designated as the roosters, the worst-fit chickens as the chicks, and the rest as the hens, so as to establish a hierarchical order of chickens.
(7)
Group the chickens after establishing the hierarchical order, with each rooster in a group and as many groups as there are roosters; randomly assign the rest of the hens and chicks to groups with roosters; and after the assignment is completed, randomly identify certain hens in each group as the mother hen of the chicks, thereby determining the membership of the groups.
(8)
Adjust the sites of roosters, hens, and chicks.
(9)
Reevaluate the fitness value based on the updated position of each chicken.
(10)
Ascertain whether the updated solution is an improvement over the previous iteration’s solution. If yes, update the solution; if not, do not update it. Then continue to the next iteration, in which the hierarchical order and membership of the flock are re-determined every G iteration until the predefined stopping condition is fulfilled, the algorithm ends, and the best outcome is outputted.
The flowchart of the CSOA-CNN-LSTMNN modeling is shown in Figure 6.

3. Thermal Error Experiment

To substantiate the robustness of the POA-CNN-LSTMNN model, experiments were conducted using a machine tool equipped with a high-velocity motorized spindle provided by the laboratory. Throughout the experiment, it was essential to simultaneously gather temperature data from multiple points around the spindle and spindle thermal error data. The measurements of temperature were obtained from various sources, including a high-precision PT100 temperature sensor with a patch design and a resolution of 0.15 °C, an industrial measuring device utilizing non-contact infrared probes for metering purposes, and a paperless recorder with 12 channels used for recording and data acquisition. The spindle’s thermal error comprised axial errors in the Z direction and radial errors in the X/Y direction. Here, the eddy current displacement sensor was employed for collecting the most dominant axial thermal error data, and the change in radial thermal error was relatively small and could be ignored [42,43,44]. We arranged 11 temperature measurement locations in the spindle’s front and rear bearings, motor, spindle box cavity, etc. Together with ambient temperature, 12 locations were designated for temperature measurement. The detailed arrangement of thermal measuring locations is illustrated in Figure 7.
The process of acquiring temperature and thermal error data is depicted in Figure 8 and Figure 9, respectively. The spindle’s sensor setup was carried out in accordance with Table 2, enabling the collection of temperature data from the 12 designated measurement points. To guarantee the model’s generalization and precision, the data were collected for seven different spindle speeds during this experiment. Each of the seven groups of experiments started with the machine in a cold state and allowed the spindle to run at a certain speed for four hours, with temperature and thermal error data collected at one-minute intervals. The rotational speeds of the seven groups of experimental spindles from low to high were V1 = 1000 r/min, V2 = 2500 r/min, V3 = 4000 r/min, V4 = 5500 r/min, V5 = 7000 r/min, V6 = 8500 r/min, and V7 = 10,000 r/min. The data obtained from the experiment are presented in Figure 10.
The H-K-P method was employed for select points with temperature sensitivity from the 12 thermal measurement locations. When applying the K-medoids algorithm, it is essential to initially ascertain the quantity of cluster centers. In cases where we did not know how many categories were good, we first used the hierarchical clustering algorithm to ascertain the quantity of groups. To cluster the temperature data obtained from the 12 measurement points, hierarchical clustering was employed. The resulting clustering outcomes are illustrated in Figure 11.
From the graph of clustering results in Figure 11, it can be seen that the effective number of clusters for the 12 to-be-clustered measurement points needed to be clustered into four classes. If clustered into 2 classes, T10 formed one class and the rest of the points formed another class, but T12 and T9 and the rest of the points of the interclass spacing formed too large of a group. If clustered into three classes, T10 formed one class, T12 formed one class, and the rest of the points formed another class, but T9 was still too far from the other points. Therefore, it would not have been appropriate to assign T9 to any specific group. The best clustering result was one class for T10, one for T12, one for T9, and one for all of the remaining points with small differences in class spacing—that is, clustering into four classes.
We used the hierarchical clustering algorithm to find out that the 12 temperature measurement points need to be divided into four classes. Next, we use the K-medoids algorithm with 4 as the cluster center number and obtained the final grouping indicated in Table 3.
The K-medoids algorithm completed the classification of the temperature measuring points, but it was not able to identify the optimal temperature measurement location in each group. The Pearson correlation coefficient method was able to compute the linear relativity between the temperature variables and the thermal errors and indicated that the point with the greatest correlation score within each clustering group was the key temperature measuring point of the group. The temperature readings from the identified key point within each group were used as inputs for the model to eliminate the covariance between the temperature sensing locations. The results of the Pearson’s coefficient calculation for each temperature point are shown in Table 4. Table 4 provides a clear indication that the largest values in each group were T10, T12, T9, and T7. In summary, the four thermal critical points chosen by the H-K-P method were T10, T12, T9, and T7, respectively.

4. Prediction Performance Analysis

We use the temperature readings from the four crucial thermal points at a spindle speed of V4 = 5500 r/min and the corresponding thermal error data to serve as the training dataset and the temperature measurements from the four identified temperature-sensitive points of the remaining six sets of experiments and the recorded data of the associated thermal error measurements as the test set for the analysis and establishment of the model.
Before feeding the input data into the model, data preprocessing was performed to normalize the input data to the range of (0, 1), ensuring uniformity in the magnitude of the input variables and eliminating potential adverse effects on the model caused by outlier data. Here, the min–max normalization method was used for data preprocessing. The formula is as follows:
w n o r = w w m i n w m a x w m i n
In the formula, w represents the original data value; w m a x and w m i n represent the maximum and minimum values in the original data samples, respectively; and w n o r represents the normalized value after preprocessing. After data normalization, the speed of gradient descent in finding the optimal solution can be accelerated, leading to improved model efficiency.
To demonstrate the effectiveness of the proposed POA-CNN-LSTMNN model, its prediction performance was analyzed in comparison with three additional distinct neural network architectures: the CSOA-CNN-LSTMNN model, the CNN-LSTMNN model, and the LSTMNN model. Throughout the training process, the input and output data remained consistent across all models. Finally, each model’s performance was assessed by utilizing the test set data in diverse operational scenarios. Both the POA and the CSOA are promising optimization techniques that have been recently developed for enhancing the optimization of neural network parameters. The convergence curve of their fitness functions is shown in Figure 12. As is evident from Figure 12, the number of iterations needed for POA to converge was lower than that of CSOA across various speeds, indicating that POA exhibited superior optimization performance compared to CSOA.
Let us take a look at the dissimilarity between the predicted and the true thermal error curve of each model on different test sets. As can be seen in Figure 13, Figure 14, Figure 15, Figure 16, Figure 17 and Figure 18, the POA-CNN-LSTMNN model’s thermal error prediction curves most closely matched the actual curves for each speed, followed by the CSOA-CNN-LSTMNN model and the CNN-LSTMNN model, and the LSTMNN model’s predictive curves exhibited the greatest deviation from the actual values. From the residual curves and residual breakdowns in Figure 19, Figure 20, Figure 21, Figure 22, Figure 23 and Figure 24, it can be seen that at a spindle rate of 1000 r/min, the POA-CNN-LSTMNN model demonstrated the highest residual of 0.797 μm, the lowest residual of −0.589 μm, and an absolute residual fluctuation of 1.386 μm; in the CSOA-CNN-LSTMNN model, the highest residual was 1.369 μm, the lowest residual was −1.628 μm, and the absolute residual fluctuation was 2.997 μm; for the CNN-LSTMNN model, the highest residual was 1.561 μm, the lowest residual was −1.272 μm, and the absolute residual fluctuation was 2.833 μm; and in the LSTMNN model, the highest residual was 2.369 μm, the lowest residual was −1.418 μm, and the absolute residual fluctuation was 3.787 μm. From the residual curve graph, the blue color represents the residual curve of the POA-CNN-LSTMNN model, the green color represents the residual curve of the CSOA-CNN-LSTMNN model, the yellow color represents the residual curve of the CNN-LSTMNN model, and the red color represents the residual curve of the LSTMNN model. The range of residual curves in red covers all other curves, and the residual curves in blue had the least amount of fluctuation. At a spindle speed of 2500 r/min, the maximum residual observed for the POA-CNN-LSTMNN model was 1.212 μm, whereas the minimum residual was −1.043 μm, resulting in an absolute residual fluctuation of 2.255 μm; in the case of the CSOA-CNN-LSTMNN model, the maximum residual was found to be 1.592 μm, whereas the minimum residual was −1.294 μm and the absolute residual fluctuation measured at 2.886 μm; regarding the CNN-LSTMNN model, the maximum residual was recorded at 1.876 μm, the minimum residual was observed at −1.388 μm, and the absolute fluctuation in residual values amounted to 3.264 μm; and the LSTMNN model showed a maximum residual of 2.045 μm and a minimum residual of −2.005 μm, resulting in an absolute residual fluctuation of 4.05 μm. The graphs of residuals were still blue for the POA-CNN-LSTMNN residual curve, which was closest to the X-axis when the vertical coordinate was zero. At a spindle rate of 4000 r/min, the residual fluctuation ranges of the POA-CNN-LSTMNN, CSOA-CNN-LSTMNN, CNN-LSTMNN, and LSTMNN models were 3.162 μm, 3.642 μm, 4.538 μm, and 6.433 μm, respectively, the residual maxima were 1.515 μm, 2.517 μm, 2.652 μm, and 2.973 μm, respectively; and their residual minimums were −1.647 μm, −1.125 μm, −1.886 μm, and −3.46 μm, respectively. From the residual curve graphs, it can also be clearly seen that the residual curves of the LSTMNN model had the largest coverage and those of the POA-CNN-LSTMNN model had the has the smallest coverage. When the spindle rate was 7000 r/min, the peak values of the residuals for the POA-CNN-LSTMNN, CSOA-CNN-LSTMNN, CNN-LSTMNN, and LSTMNN models were 1.241 μm, 2.233 μm, 2.943 μm, and 4.016 μm, respectively; the minimum values of the residuals were −2.601 μm, −3.862 μm, −1.761 μm, and −6.353 μm, respectively; and the absolute values of the residuals were 3.842 μm, 6.095 μm, 4.704 μm, and 10.369 μm, respectively. The blue residual curves of the POA-CNN-LSTMNN model had the smallest fluctuation range. When the spindle rate was 8500 r/min, the maximum, minimum, and absolute residual values of the LSTMNN model were 4.056 μm, −4.76 μm, and 8.816 μm respectively. The maximum residual value, minimum residual value, and absolute residual value of the CNN-LSTMNN model were 3.188 μm, −3.435 μm, and 6.623 μm respectively. The maximum, minimum, and absolute residual values of the CSOA-CNN-LSTMNN model were 2.458 μm, −4.558 μm, and 7.016 μm respectively. The maximum, minimum, and absolute residual values of the POA-CNN-LSTMNN model were 1.895 μm, −3.068 μm, and 4.963 μm, respectively. The prediction residual curve of the POA-CNN-LSTMNN model was closest to the 0 axis. When the spindle rate was 10,000 r/min, the maximum residuals of the LSTMNN model, CNN-LSTMNN model, CSOA-CNN-LSTMNN model, and POA-CNN-LSTMNN model were 5.254 μm, 2.899 μm, 1.766 μm, and 1.801 μm respectively. The minimum residuals were −9.047 μm, −6.589 μm, −5.117 μm, and −2.462 μm respectively. The absolute values of the residual fluctuations were 14.301 μm, 9.488 μm, 6.883 μm, and 4.263 μm respectively. The residual curve of the POA-CNN-LSTMNN model had the smallest fluctuation and was closest to the zero axis. To sum up, at different spindle speeds, the residual curve of the LSTMNN model fluctuated the most, followed by the CNN-LSTMNN model and CSOA-CNN-LSTMNN model, and the residual curve of the POA-CNN-LSTMNN model fluctuated the least, which fully shows that, among the four models, the POA-CNN-LSTMNN model stood out as the most superior.
To further substantiate the effectiveness of the model for forecasting thermal errors proposed in this study, we employed four commonly used evaluation metrics. These metrics included the root mean square error function (RMSE), the mean absolute error function (MAE), the mean square error function (MSE), and the coefficient of determination R-square ( R 2 ).
The RMSE provides an indication of the dispersion level among the samples, and in nonlinear fitting, a smaller RMSE value indicates a better level of accuracy. The MAE is highly interpretable and easy to understand, and a lower value indicates better prediction performance. The R-Square indicates the level of data fitness, and the range of its values is generally (0, 1); the closer to 1, the better the model fits. For the MSE, as the value decreases, the model correctness increases. The formulas for the four evaluation functions are as follows, where y ^ i is thermal error predicted value, y i is thermal error actual value, y ¯ i is the average error value, and n represents the total count of thermal errors:
R M S E = i = 1 n ( y i y ^ i ) 2 n i = 1,2 , , n
M A E = 1 n i = 1 n ( y i y ^ i ) i = 1,2 , , n
R 2 = 1 i = 1 n y i y ^ i 2 i = 1 n y i y ¯ i 2
M S E = 1 n i = 1 n y i y ^ i 2
Figure 25 displays the evaluation index values of each model across various speeds. When the spindle speed was 1000 r/min, the RMSE values for the POA-CNN-LSTMNN, CSOA-CNN-LSTMNN, CNN-LSTMNN, and LSTMNN models were 1.153, 1.679, 1.832, and 2.151, respectively; the MAE values were 1.025, 1.331, 1.562, and 1.963, respectively; the R 2 values were 0.982, 0.931, 0.845, and 0.727, respectively; and the MSE values were 1.329, 1.362, 3.356, and 4.627 respectively. When the spindle rate was 2500 r/min, the RMSE values of the POA-CNN-LSTMNN, CSOA-CNN-LSTMNN, CNN-LSTMNN, and LSTMNN models were 1.118, 1.526, 1.937, and 3.701, respectively; the MAE values were 1.072, 1.191, 1.403, and 2.834, respectively; and the R 2 and MSE values were 0.974 and 1.25, 0.898 and 2.329, 0.856 and 3.752, and 0.781 and 13.697, respectively. When the spindle rate was 4000 r/min, the RMSE values of the POA-CNN-LSTMNN, CSOA-CNN-LSTMNN, CNN-LSTMNN, and LSTMNN models were 1.751, 2.082, 2.257, and 3.316 respectively; the MAE values were 1.045, 1.564, 1.713, and 2.301, respectively; the R 2 values were 0.977, 0.901, 0.834, and 0.695, respectively; and the MSE values were 3.066, 4.335, 5.094, and 10.996 respectively. When the spindle rate was 7000 r/min, the RMSE values of the POA-CNN-LSTMNN, CSOA-CNN-LSTMNN, CNN-LSTMNN, and LSTMNN models were 1.428, 2.164, 2.256, and 3.271 respectively; the MAE values were 1.127, 1.945, 2.066, and 2.831, respectively; the R 2 values were 0.962, 0.865, 0.791, and 0.696, respectively; and the MSE values were 2.039, 4.683, 5.089, and 10.699, respectively. When the spindle speed was 8500 r/min, the RMSE and MAE values of the POA-CNN-LSTMNN, CSOA-CNN-LSTMNN, CNN-LSTMNN, and LSTMNN models were 1.126 and 0.968, 2.507 and 1.638, 2.825 and 2.064, and 3.617 and 2.871, respectively; and the R 2 and MSE values were 0.927 and 1.245, 0.861 and 6.285, 0.775 and 7.981, and 0.607 and 13.083, respectively. When the spindle speed was 10,000 r/min, the RMSE values of the POA-CNN-LSTMNN, CSOA-CNN-LSTMNN, CNN-LSTMNN, and LSTMNN models were 2.568, 3.107, 3.624, and 3.875 respectively; the MAE values were 1.883, 2. 453, 2.972, and 3.128, respectively; the R 2 values were 0.971, 0.843, 0.762, and 0.611, respectively; and the MSE values were 6.595, 9.653, 13.133, and 15.016 respectively. The average RMSE, MAE, R 2 , and MSE values of the POA-CNN-LSTMNN model at different speeds were 1.524, 1.187, 0.965, and 2.587, respectively. The mean RMSE, MAE, R 2 , and MSE values of the CSOA-CNN-LSTMNN model at different speeds were 2.177, 1.687, 0.883, and 4.774, respectively. The average RMSE, MAE, R 2 , and MSE values of the CNN-LSTMNN model at different speeds were 2.455, 1.963, 0.811, and 6.401, respectively. The mean RMSE, MAE, R 2 , and MSE values of the LSTMNN model at different speeds were 3.322, 2.655, 0.686, and 11.353, respectively. The POA-CNN-LSTMNN model had 30%, 38%, and 54% lower average RMSE values than the CSOA-CNN-LSTMNN, CNN-LSTMNN, and LSTMNN models, respectively. The average MAE values of the POA-CNN-LSTMNN model were 30%, 39%, and 55% lower than those of the CSOA-CNN-LSTMNN, CNN-LSTMNN, and LSTMNN models, respectively. Compared to the CSOA-CNN-LSTMNN, CNN-LSTMNN, and LSTMNN models, the average R 2 and MSE values of the POA-CNN-LSTMNN model increased by 9%, 19%, and 41% and decreased by 46%, 59%, and 77%, respectively.
To sum up, the POA-CNN-LSTMNN model outperformed other models across all evaluated index values. This suggests that the model exhibited superior prediction performance and delivered the best forecasting results.

5. Conclusions

Aiming at the thermal error problem of motorized spindles, this study puts forward a thermal error prediction modeling method, and the main work is as follows:
  • Firstly, the H-K-P algorithm is employed to cluster the temperature-measuring locations near the spindle. The hierarchical clustering algorithm is applied to determine the clustering number K, and then all the pre-selected temperature sensor locations are clustered into K classes by using the K-medoids algorithm. After the clustering is completed, the Pearson correlation coefficient is utilized to evaluate the association degree between temperature data and thermal error in each category, and the point with the largest association degree is determined as the critical temperature point of this group. In the end, 12 temperature measuring points are successfully reduced to four crucial temperature points, thereby resolving the issue of collinearity among temperature measurement locations.
  • Using temperature-sensitive point data in conjunction with thermal error data, a predictive model for thermal errors in CNC machine tool motorized spindles is trained and developed. Aiming at the special property of thermal error having both time-varying characteristics and spatial characteristics, the POA-CNN-LSTMNN model is suggested, which incorporates LSTMNN for capturing temporal characteristics, utilizes CNN for extracting spatial features, and employs POA to optimize the parameters of the CNN-LSTM hybrid neural network, thus improving its predictive performance.
  • To verify the model’s generalization and validity, the experimental analysis is carried out under different rotating speeds of the motorized spindle. The CSOA-CNN-LSTMNN, CNN-LSTMNN, and LSTMNN models are used to compare with the model proposed in this study. The experimental findings reveal significant improvements achieved by the POA-CNN-LSTMNN model in comparison to the other three models. On average, the POA-CNN-LSTMNN model exhibited a reduction of 40.7% and 41.3% in the RMSE and MAE, respectively. Additionally, the R 2 was 23% higher on average compared to the other models, and MSE was reduced by 60.7% on average. These results strongly support the superiority and effectiveness of the POA-CNN-LSTMNN model in thermal error prediction for motorized spindles. The model demonstrates promising applicability and potential in the field of thermal error forecasting for motorized spindles in CNC machine tools. During the experimental process, we encountered various challenges. For instance, due to environmental conditions and equipment limitations, there were constraints in data acquisition. Extensive data collection efforts were required over a long period of time to ensure data quality and model accuracy. In future research, we will need to further explore efficient methods for data acquisition. Additionally, we aim to optimize the model to enhance its prediction accuracy and further expand the performance and application domains of thermal error prediction models.

Author Contributions

Y.G. (Ying Gao): writing—original draft preparation, conceptualization, validation, formal analysis; X.X.: methodology, project administration, supervision; Y.G. (Yinrui Guo): investigation, writing—review and editing. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the Liaoning Province Intelligent Assembly and the Inspection Technology Engineering Research Center (P6-0343).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are available on request from the corresponding author. They are restricted to the experimental results.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Soori, M.; Arezoo, B. Dimensional, geometrical, thermal and tool deflection errors compensation in 5-Axis CNC milling operations. Aust. J. Mech. Eng. 2007, 3, 154–196. [Google Scholar] [CrossRef]
  2. Horejš, O.; Mareš, M.; Havlík, L. Compensation of Thermally Induced Errors in Five-Axis Computer Numerical Control Machining Centers Equipped with Different Spindles. J. Manuf. Sci. Eng. 2022, 144, 101009. [Google Scholar] [CrossRef]
  3. Grama, S.N.; Mathur, A.; Badhe, A.N. A model-based cooling strategy for motorized spindle to reduce thermal errors. Int. J. Mach. Tools Manuf. 2018, 132, 3–16. [Google Scholar] [CrossRef]
  4. Mayr, J.; Müller, M.; Weikert, S. Automated thermal main spindle & B-axis error compensation of 5-axis machine tools. CIRP Ann. 2016, 65, 479–482. [Google Scholar] [CrossRef]
  5. Dai, Y.; Tao, X.; Xuan, L.; Qu, H.; Wang, G. Thermal error prediction model of a motorized spindle considering variable preload. Int. J. Adv. Manuf. Technol. 2022, 121, 4745–4756. [Google Scholar] [CrossRef]
  6. Shengli, T.; Xiaoan, C.; Pengfan, W.U. Research on Flexible Loading System of High-speed Motorized Spindles Based on High-pressure Water Jet. J. Mech. Eng. 2021, 57, 36–44. [Google Scholar] [CrossRef]
  7. Zhiyong, W.; Weitao, D.U. Dynamics Analysis of Spindle-bearing Systems on Spiral Bevel Gear Cutting Machines. China Mech. Eng. 2019, 30, 2211–2266. [Google Scholar]
  8. Dai, Y.; Tao, X.; Li, Z.; Zhan, S.; Li, Y.; Gao, Y. A Review of Key Technologies for High-Speed Motorized Spindles of CNC Machine Tools. Machines 2022, 10, 145. [Google Scholar] [CrossRef]
  9. Liu, Y.; Wang, X.; Zhu, X.; Zhai, Y. Thermal error prediction of motorized spindle for five-axis machining center based on analytical modeling and BP neural network. J. Mech. Sci. Technol. 2021, 35, 281–292. [Google Scholar] [CrossRef]
  10. Shi, H.; Jiang, C.; Yan, Z.; Tao, T.; Mei, X. Bayesian neural network–based thermal error modeling of feed drive system of CNC machine tool. Int. J. Adv. Manuf. Technol. 2020, 108, 3031–3044. [Google Scholar] [CrossRef]
  11. Xiang, S.; Deng, M.; Li, H.; Du, Z.; Yang, J. Cross-rail deformation modeling, measurement and compensation for a gantry slideway grinding machine considering thermal effects. Meas. Sci. Technol. 2019, 30, 065007. [Google Scholar] [CrossRef]
  12. Mareš, M.; Horejš, O.; Havlík, L. Thermal error compensation of a 5-axis machine tool using indigenous temperature sensors and CNC integrated Python code validated with a machined test piece. Precis. Eng. 2020, 66, 21–30. [Google Scholar] [CrossRef]
  13. Zimmermann, N.; Mayr, J.; Wegener, K. Statistical analysis of self-optimizing thermal error compensation models for machine tools. In Proceedings of the EUSPEN—Special Interest Group Meeting: Thermal Issues, Zurich, Switzerland, 22–23 March 2022. [Google Scholar]
  14. Xiao, Q.; Luo, Z.; Luo, M.; Liu, S.; Hsu, W.; Huang, C. Thermal Deformation Test and Modeling of Main Spindle of Numerical Control Vertical Machining Center. J. Phys. Conf. Ser. 2020, 1583, 012005. [Google Scholar] [CrossRef]
  15. Fu, G.; Zhou, L.; Zheng, Y.; Lu, C.; Wang, X.; Xie, L. Improved unscented Kalman filter algorithm-based rapid identification of thermal errors of machine tool spindle for shortening thermal equilibrium time. Measurement 2022, 195, 111121. [Google Scholar] [CrossRef]
  16. Gowda, C.R.; Dutta, R.; Pasha, A.T.; Ravi, L. Use of multiple linear regression to compensate for diametrical deviations in machined components due to thermal errors. Mater. Today Proc. 2022, 56, 2630–2639. [Google Scholar] [CrossRef]
  17. Song, L.; Liu, K.; Zhao, D.; Zhang, S.; Zhang, Z.; Wang, Y. The spindle axial time-varying thermal error compensation method for horizontal boring and milling machine tool based on edge computing. Int. J. Adv. Manuf. Technol. 2023, 128, 2631–2638. [Google Scholar] [CrossRef]
  18. de Farias, A.; dos Santos, M.O.; Bordinassi, E.C. Development of a thermal error compensation system for a CNC machine using a radial basis function neural network. J. Braz. Soc. Mech. Sci. Eng. 2022, 44, 494. [Google Scholar] [CrossRef]
  19. Luo, F.; Ma, C.; Liu, J.; Gui, H.; Li, M. Thermal error prediction and control method combining residual-based one-dimensional convolution-minimum gate unit model with physical-data-edge-cloud terminal architecture. Neural Comput. Appl. 2023, 35, 15477–15502. [Google Scholar] [CrossRef]
  20. Jia, G.; Zhang, X.; Wang, X.; Zhang, X.; Huang, N. A spindle thermal error modeling based on 1DCNN-GRU-Attention architecture under controlled ambient temperature and active cooling. Int. J. Adv. Manuf. Technol. 2023, 127, 1525–1539. [Google Scholar] [CrossRef]
  21. Du, H.; Jiang, G.; Tao, T.; Hou, R.; Yan, Z.; Mei, X. A thermal error modeling method for CNC lathes based on thermal distortion decoupling and nonlinear programming. Int. J. Adv. Manuf. Technol. 2023, 128, 2599–2612. [Google Scholar] [CrossRef]
  22. Huang, B.; Xie, J.; Liu, X.; Yan, J.; Liu, K.; Yang, M. Vertical Machining Center Feed Axis Thermal Error Compensation Strategy Research. Appl. Sci. 2023, 13, 2990. [Google Scholar] [CrossRef]
  23. Zhu, M.; Yang, Y.; Feng, X.; Du, Z.; Yang, J. Robust modeling method for thermal error of CNC machine tools based on random forest algorithm. J. Intell. Manuf. 2023, 34, 2013–2026. [Google Scholar] [CrossRef]
  24. Katageri, P.; Suresh, B.S.; Pasha Taj, A. An approach to identify and select optimal temperature-sensitive measuring points for thermal error compensation modeling in CNC machines: A case study using cantilever beam. Mater. Today Proc. 2021, 45, 264–269. [Google Scholar] [CrossRef]
  25. Li, B.; Tian, X.; Zhang, M. Thermal error modeling of machine tool spindle based on the improved algorithm optimized BP neural network. Int. J. Adv. Manuf. Technol. 2019, 105, 1497–1505. [Google Scholar] [CrossRef]
  26. Abdulshahed, A.M.; Longstaff, A.P.; Fletcher, S.; Myers, A. Thermal error modelling of machine tools based on ANFIS with fuzzy c-means clustering using a thermal imaging camera. Appl. Math. Model. 2015, 39, 1837–1852. [Google Scholar] [CrossRef]
  27. Liu, P.-L.; Du, Z.-C.; Li, H.-M.; Deng, M.; Feng, X.-B.; Yang, J.-G. Thermal error modeling based on BiLSTM deep learning for CNC machine tool. Adv. Manuf. 2021, 9, 235–249. [Google Scholar] [CrossRef]
  28. Kumar, S.; Srinivasu, D.S. Optimal number of thermal hotspots selection on motorized milling spindle to predict its thermal deformation. Mater. Today Proc. 2022, 62, 3376–3385. [Google Scholar] [CrossRef]
  29. Xiaopeng, Y.; Teng, H.; Xiaohu, W.; Liang, M.; Guofu, Y. Study on an approach for decoupling and separating the thermal positioning errors of machining center linear axes. Int. J. Adv. Manuf. Technol. 2023, 128, 1139–1153. [Google Scholar] [CrossRef]
  30. Abdulshahed, A.M.; Longstaff, A.P.; Fletcher, S. The application of ANFIS prediction models for thermal error compensation on CNC machine tools. Appl. Soft Comput. 2015, 27, 158–168. [Google Scholar] [CrossRef]
  31. Yang, S.; Luo, X.; Chen, X.U.; Luo, Z. Self-adaptive compensation method of thermal error for hobbing machine tool. Int. J. Innov. Comput. Inf. Control 2021, 17, 2045–2055. [Google Scholar]
  32. Dai, Y.; Pang, J.; Li, Z.; Li, W.; Wang, Q.; Li, S. Modeling of thermal error electric spindle based on KELM ameliorated by snake optimization. Case Stud. Therm. Eng. 2022, 40, 102504. [Google Scholar] [CrossRef]
  33. Huang, Y.; Chen, Y.; Hu, Z. Thermal error modeling and analysis of CNC machine tools based on wavelet neural network. In Proceedings of the 2021 IEEE International Conference on Consumer Electronics and Computer Engineering (ICCECE), Guangzhou, China, 15–17 January 2021; pp. 454–457. [Google Scholar]
  34. Fan, J.; Wang, P.; Tao, H.; Pan, R. A thermal deformation prediction method for grinding machine’ spindle. Int. J. Adv. Manuf. Technol. 2022, 118, 1125–1139. [Google Scholar] [CrossRef]
  35. Ning, F.; Shi, Y.; Cai, M.; Xu, W.; Zhang, X. Manufacturing cost estimation based on a deep-learning method. J. Manuf. Syst. 2020, 54, 186–195. [Google Scholar] [CrossRef]
  36. Chengyang, W.; Sitong, X.; Wansheng, X. Spindle thermal error prediction approach based on thermal infrared images: A deep learning method. J. Manuf. Syst. 2021, 59, 67–80. [Google Scholar] [CrossRef]
  37. Trojovský, P.; Dehghani, M. Pelican Optimization Algorithm: A Novel Nature-Inspired Algorithm for Engineering Applications. Sensors 2022, 22, 855. [Google Scholar] [CrossRef] [PubMed]
  38. Park, H.-S.; Jun, C.-H. A simple and fast algorithm for K-medoids clustering. Expert Syst. Appl. 2009, 36, 3336–3341. [Google Scholar] [CrossRef]
  39. Hafez, A.I.; Zawbaa, H.M.; Emary, E.; Mahmoud, H.A.; Hassanien, A.E. An innovative approach for feature selection based on chicken swarm optimization. In Proceedings of the 2015 7th International Conference of Soft Computing and Pattern Recognition (SoCPaR), Fukuoka, Japan, 13–15 November 2015; pp. 19–24. [Google Scholar]
  40. Al Shayokh, M.; Shin, S.Y. Bio Inspired Distributed WSN Localization Based on Chicken Swarm Optimization. Wirel. Pers. Commun. 2017, 97, 5691–5706. [Google Scholar] [CrossRef]
  41. Deb, S.; Gao, X.-Z.; Tammi, K.; Kalita, K.; Mahanta, P. Recent Studies on Chicken Swarm Optimization algorithm: A review (2014–2018). Artif. Intell. Rev. 2020, 53, 1737–1765. [Google Scholar] [CrossRef]
  42. Tan, F.; Yin, G.; Zheng, K.; Wang, X. Thermal error prediction of machine tool spindle using segment fusion LSSVM. Int. J. Adv. Manuf. Technol. 2021, 116, 99–114. [Google Scholar] [CrossRef]
  43. Yao, X.; Hu, T.; Yin, G.; Cheng, C. Thermal error modeling and prediction analysis based on OM algorithm for machine tool’s spindle. Int. J. Adv. Manuf. Technol. 2020, 106, 3345–3356. [Google Scholar] [CrossRef]
  44. Liu, Y.; Miao, E.; Liu, H.; Chen, Y. Robust machine tool thermal error compensation modelling based on temperature-sensitive interval segmentation modelling technology. Int. J. Adv. Manuf. Technol. 2020, 106, 655–669. [Google Scholar] [CrossRef]
Figure 1. Diagram of the overall prediction process for thermal errors.
Figure 1. Diagram of the overall prediction process for thermal errors.
Applsci 14 00381 g001
Figure 2. Calculation process diagram of CNN’s core steps.
Figure 2. Calculation process diagram of CNN’s core steps.
Applsci 14 00381 g002
Figure 3. Structural unit diagram of LSTMNN.
Figure 3. Structural unit diagram of LSTMNN.
Applsci 14 00381 g003
Figure 4. Structure diagram of CNN-LSTMNN.
Figure 4. Structure diagram of CNN-LSTMNN.
Applsci 14 00381 g004
Figure 5. POA-CNN-LSTMNN modeling process.
Figure 5. POA-CNN-LSTMNN modeling process.
Applsci 14 00381 g005
Figure 6. CSOA-CNN-LSTMNN modeling process.
Figure 6. CSOA-CNN-LSTMNN modeling process.
Applsci 14 00381 g006
Figure 7. Location map of the temperature measuring point.
Figure 7. Location map of the temperature measuring point.
Applsci 14 00381 g007
Figure 8. Paperless temperature acquisition recorder.
Figure 8. Paperless temperature acquisition recorder.
Applsci 14 00381 g008
Figure 9. Diagram of error collected: (a) axial thermal error acquisition of the spindle; (b) eddy current displacement sensor; (c) PC data acquisition interface diagram.
Figure 9. Diagram of error collected: (a) axial thermal error acquisition of the spindle; (b) eddy current displacement sensor; (c) PC data acquisition interface diagram.
Applsci 14 00381 g009
Figure 10. Temperature data curve and thermal error data curve of spindle at different rotations.
Figure 10. Temperature data curve and thermal error data curve of spindle at different rotations.
Applsci 14 00381 g010
Figure 11. Diagram of hierarchical clustering results.
Figure 11. Diagram of hierarchical clustering results.
Applsci 14 00381 g011
Figure 12. Fitness function curves of the POA and CSOA algorithms under different test sets.
Figure 12. Fitness function curves of the POA and CSOA algorithms under different test sets.
Applsci 14 00381 g012
Figure 13. Predicted and actual thermal error curves at 1000 r/min: (a) POA-CNN-LSTMNN model; (b) CSOA-CNN-LSTMNN model; (c) CNN-LSTMNN model; (d) LSTMNN model.
Figure 13. Predicted and actual thermal error curves at 1000 r/min: (a) POA-CNN-LSTMNN model; (b) CSOA-CNN-LSTMNN model; (c) CNN-LSTMNN model; (d) LSTMNN model.
Applsci 14 00381 g013
Figure 14. Predicted and actual thermal error curves at 2500 r/min: (a) POA-CNN-LSTMNN model; (b) CSOA-CNN-LSTMNN model; (c) CNN-LSTMNN model; (d) LSTMNN model.
Figure 14. Predicted and actual thermal error curves at 2500 r/min: (a) POA-CNN-LSTMNN model; (b) CSOA-CNN-LSTMNN model; (c) CNN-LSTMNN model; (d) LSTMNN model.
Applsci 14 00381 g014
Figure 15. Predicted and actual thermal error curves at 4000 r/min: (a) POA-CNN-LSTMNN model; (b) CSOA-CNN-LSTMNN model; (c) CNN-LSTMNN model; (d) LSTMNN model.
Figure 15. Predicted and actual thermal error curves at 4000 r/min: (a) POA-CNN-LSTMNN model; (b) CSOA-CNN-LSTMNN model; (c) CNN-LSTMNN model; (d) LSTMNN model.
Applsci 14 00381 g015
Figure 16. Predicted and actual thermal error curves at 7000 r/min: (a) POA-CNN-LSTMNN model; (b) CSOA-CNN-LSTMNN model; (c) CNN-LSTMNN model; (d) LSTMNN model.
Figure 16. Predicted and actual thermal error curves at 7000 r/min: (a) POA-CNN-LSTMNN model; (b) CSOA-CNN-LSTMNN model; (c) CNN-LSTMNN model; (d) LSTMNN model.
Applsci 14 00381 g016
Figure 17. Predicted and actual thermal error curves at 8500 r/min: (a) POA-CNN-LSTMNN model; (b) CSOA-CNN-LSTMNN model; (c) CNN-LSTMNN model; (d) LSTMNN model.
Figure 17. Predicted and actual thermal error curves at 8500 r/min: (a) POA-CNN-LSTMNN model; (b) CSOA-CNN-LSTMNN model; (c) CNN-LSTMNN model; (d) LSTMNN model.
Applsci 14 00381 g017
Figure 18. Predicted and actual thermal error curves at 10000 r/min: (a) POA-CNN-LSTMNN model; (b) CSOA-CNN-LSTMNN model; (c) CNN-LSTMNN model; (d) LSTMNN model.
Figure 18. Predicted and actual thermal error curves at 10000 r/min: (a) POA-CNN-LSTMNN model; (b) CSOA-CNN-LSTMNN model; (c) CNN-LSTMNN model; (d) LSTMNN model.
Applsci 14 00381 g018
Figure 19. Residual curves and details at 1000 r/min: (a) residual details of each model; (b) residual curve of each model.
Figure 19. Residual curves and details at 1000 r/min: (a) residual details of each model; (b) residual curve of each model.
Applsci 14 00381 g019
Figure 20. Residual curves and details at 2500 r/min: (a) residual details of each model; (b) residual curve of each model.
Figure 20. Residual curves and details at 2500 r/min: (a) residual details of each model; (b) residual curve of each model.
Applsci 14 00381 g020
Figure 21. Residual curves and details at 4000 r/min: (a) residual details of each model; (b) residual curve of each model.
Figure 21. Residual curves and details at 4000 r/min: (a) residual details of each model; (b) residual curve of each model.
Applsci 14 00381 g021
Figure 22. Residual curves and details at 7000 r/min: (a) residual details of each model; (b) residual curve of each model.
Figure 22. Residual curves and details at 7000 r/min: (a) residual details of each model; (b) residual curve of each model.
Applsci 14 00381 g022
Figure 23. Residual curves and details at 8500 r/min: (a) residual details of each model; (b) residual curve of each model.
Figure 23. Residual curves and details at 8500 r/min: (a) residual details of each model; (b) residual curve of each model.
Applsci 14 00381 g023
Figure 24. Residual curves and details at 10,000 r/min: (a) residual details of each model; (b) residual curve of each model.
Figure 24. Residual curves and details at 10,000 r/min: (a) residual details of each model; (b) residual curve of each model.
Applsci 14 00381 g024
Figure 25. Values of four evaluation indexes for each model at different speeds: (a) 1000 r/min; (b) 2500 r/min; (c) 4000 r/min; (d) 7000 r/min; (e) 8500 r/min; (f) 10,000 r/min.
Figure 25. Values of four evaluation indexes for each model at different speeds: (a) 1000 r/min; (b) 2500 r/min; (c) 4000 r/min; (d) 7000 r/min; (e) 8500 r/min; (f) 10,000 r/min.
Applsci 14 00381 g025
Table 1. CNN-LSTMNN model structure parameter settings.
Table 1. CNN-LSTMNN model structure parameter settings.
ModelStructureLayerParameter
CNN-LSTMNNCNNConvolutionFilters = 32, kernel_size = 3 × 3, stride = 1
MaxPoolingPool_size = 2 × 2, stride = 2
ActivationRelu
ConvolutionFilters = 64, kernel_size = 3 × 3, stride = 1
MaxPoolingPool_size = 2 × 2, stride = 2
ActivationRelu
LSTMNNLSTMNN-1Neurons = 50, dropout = 0.25
LSTMNN-2Neurons = 50, dropout = 0.25
Table 2. Distribution of temperature measuring points for the motorized spindle.
Table 2. Distribution of temperature measuring points for the motorized spindle.
Temperature Measurement Point NumberTemperature Measurement Point Position
T1, T2, T3Outside of the front bearing
T4, T6Outside of the rear bearing
T5, T7, T8Built-in motor housing
T9Inside of the front bearing
T10Inside of the rear bearing
T11Spindle box cavity
T12Ambient temperature
Table 3. Grouping of k-medoids.
Table 3. Grouping of k-medoids.
Clustering Category1234
Temperature Measuring PointT1, T2, T3, T4, T5, T6, T7, T8, T11T12T10T9
Table 4. Pearson correlation coefficient values.
Table 4. Pearson correlation coefficient values.
Temperature Measuring
Point
Pearson Correlation Coefficient
Value
Clustering
Category
T10.8059731
T20.8644961
T30.8457291
T40.8544331
T50.8388281
T60.8427431
T70.8817791
T80.8296951
T90.9522683
T100.9964162
T110.8011271
T120.8177920
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Gao, Y.; Xia, X.; Guo, Y. A Thermal Error Prediction Method of High-Speed Motorized Spindle Based on Pelican Optimization Algorithm and CNN-LSTM. Appl. Sci. 2024, 14, 381. https://doi.org/10.3390/app14010381

AMA Style

Gao Y, Xia X, Guo Y. A Thermal Error Prediction Method of High-Speed Motorized Spindle Based on Pelican Optimization Algorithm and CNN-LSTM. Applied Sciences. 2024; 14(1):381. https://doi.org/10.3390/app14010381

Chicago/Turabian Style

Gao, Ying, Xiaojun Xia, and Yinrui Guo. 2024. "A Thermal Error Prediction Method of High-Speed Motorized Spindle Based on Pelican Optimization Algorithm and CNN-LSTM" Applied Sciences 14, no. 1: 381. https://doi.org/10.3390/app14010381

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop