1 Introduction

High-speed cutting stands as a key focal point for future advancements in the field of machining and holds significant potential as a primary direction for further development. The motorized spindle plays a pivotal role in high-speed CNC machine tools as a critical component, directly impacting the overall performance of the machines. The primary source of mistakes in the processing of high-speed CNC machine tools is thermal error. It is important to note that thermal error is thought to be responsible for a sizeable portion of the overall error seen in machine tools, ranging from 40 to 70% [1,2,3].

Correct temperature-dependent point selection is beneficial for engineers to accurately capture thermal behavior and deformation in the system. This information is very important for optimizing performance and reducing thermal errors in various applications such as machining, manufacturing, and precision equipment. By combining K-means algorithm and Pearson correlation coefficient, Zhou et al. [4] successfully simplified the selection of temperature measurement location. The gray correlation order was used by Chen et al. [5] to pinpoint the thermally sensitive areas that closely match the spindle’s thermal deformation. They simplified the configuration of temperature measurement points for the spindle’s temperature field. To mitigate the collinearity-induced coupling effect among temperature variables, spectral clustering methods and Spearman correlation analysis were used by Guo et al. [6]. This approach effectively reduced the aforementioned coupling effect. Zhang et al. [7] presented an optimization approach for selecting temperature measurement points in machine tools. This approach employed fuzzy clustering and gray theory. Chen et al. [8] built the motorized spindle model with the software Workbench. By conducting a thermal-structural coupling analysis, they were able to determine the heat generation of individual components within the spindle. Wu et al. [9] utilized software such as Hyper Mesh and Abaqus to develop a thermodynamic finite element model for the mechanical spindle.

The creation of precise thermal error prediction models, which considerably improves the accuracy of CNC machining equipment, is a key milestone in the development of error compensation technology. Dai et al. [10] proposed an ANFIS-based prediction model that accurately forecasts the temperature deviation of the motorized spindle. This model exhibits high accuracy and robustness against interference, with a residual error below 1 μm. Xin et al. [11] combined the BP neural network with a two-step method to create a modeling approach. Experimental results demonstrate that the two-step method exhibits approximately 126% higher prediction accuracy compared to the direct method, indicating its substantial potential for engineering applications. Li et al. [12] utilized the GA-LSSVM model. The analysis conducted demonstrated the superior performance of the GA-LSSVM model, as it exhibited smaller model residuals and higher prediction accuracy. Cao et al. [13] introduced the MEA-BP thermal error model, which led to a remarkable 63.16% enhancement in traditional modeling and prediction accuracy compared to the conventional BP neural network approach. A prediction model utilizing the MEA-NARX neural network was presented by Sun et al. [14]. Comparing this model’s prediction accuracy to the NARX neural network model with randomly chosen parameters, a significant improvement of 36.98% was seen. Wen et al. [15] devised a thermal error prediction model that integrated WOA with SVR, resulting in a maximum fitting error reduction to 3.72 microns and a root mean square error reduction to 1.33 microns. Du et al. [16] presented a thermal error modeling approach named CNN-GRU. This approach utilizes comprehensive temperature data from the machine tool, climate environment, and workpiece error feature set as input to the model. By employing this method, they achieved improved prediction accuracy along with enhanced generalization capabilities. Liu et al. [17] uses VMD-GW-LSTM network model to compensate thermal error, and the highest compensation rate can reach 77.78%. Shi et al. [18] established a special measuring system to measure the axial thermal deformation of motorized spindle cooled by shaft core at different speeds. When the motorized spindle is used, the accuracy after compensation is improved by about 90%. To sum up, the accuracy of the above neural network is not very high, and the calculation time is long.

When there is natural air convection, surface microstructure is thought to be a useful technique for improving the heat transfer performance of micro radiators [19]. By using laser processing technology, Liu et al. [20] created a metal-polymer composite microradiator with a microgroove and microcolumn structure. They then investigated the effects of microstructure type, spacing, and height on the microradiator’s capacity for heat transmission. With its microcolumn construction, the microradiator can lower the temperature of the heat source by 22.4% and has high heat transmission performance. Four different microstructures with surface roughness were created on aluminum fin radiators by You et al. [21] using four standard processing techniques: roughening, polishing, oxidation, and shot peening. As surface roughness rose, so did the aluminum fin radiator’s capacity to transport heat. Zhuang et al. [22], based on microimprint technology, prepared metal-polymer composite microradiator with microgroove and microcolumn structure; the heat transfer performance of microradiator with microcolumn structure is better than that of a microgroove structure. Ventola et al. [23], using direct metal laser sintering technology, prepared aluminum microradiator with rough micro-nanocomposite structure with surface roughness of 1–25 μm, and the heat transfer performance of the microradiator was improved by 50% compared with the standard manufacturing. Chen et al. [24] copper and aluminum microradiators with a microcolumn structure were prepared by electrodeposition, and the heat transfer performance of microradiators was improved by 10% and 4%, respectively. The abovementioned preparation methods often use expensive processing methods for microradiator limits the industrial production of microradiators, and the prepared microradiators have low heat transfer performance and large overall size, but this paper has the advantages of low equipment price, no limitation of hardness of processing materials, simple process, and low processing cost.

KELM has the following advantages in thermal error modeling: adapting to different data types, efficient model training, insensitivity to feature selection, and enhancing the stability of the model. Using the KELM algorithm to model can deal with different types, different data levels, and nonlinear problems, thus improving the accuracy and thermal error modeling’s robustness. The NGO-KELM model, combining KELM and NGO, optimizes feature selection, boosting accuracy, and robustness. The NGO simulates a goshawk’s foraging strategy, excelling in global search, rapid convergence, and high robustness compared to traditional algorithms. Experimental validation of NGO-KELM and BA-KELM models confirms the accuracy of NGO-KELM predictions, showcasing its effectiveness in thermal error modeling. Lastly, structural improvements in bearing chambers enhance heat dissipation, reducing temperature and thermal deformation, thereby elevating machining accuracy and providing a new method for improving the machining accuracy of machine tools.

2 Build an experimental platform

2.1 Construction and experiment of experimental platform

Since the motorized spindle of a CNC machine tool spins at a high speed for extended periods of time and produces a lot of heat during the machining process, it is easy to cause thermal deformation and an increase in thermal error, which lowers the machine tool’s accuracy. Therefore, in order to lessen the impact that thermal inaccuracy and motorized spindle deformation have on machine tool accuracy, the following experiments are designed to collect temperature information. The influence of thermal deformation of motorized spindle on machine tool accuracy is shown in Fig. 1.

Fig. 1
figure 1

Luence of thermal deformation of electric spindle on machine tool accuracy. (a) Electric spindle test bench (b) Temperature acquisition system (c) Temperature acquisition point

PT100 thermal resistors are fitted at the bearing positions prior to and following the temperature within the motorized spindle to measure the temperature of the outer layer of the spindle. Figure 2 and Table 1 illustrate the positioning of temperature sensors, with T5 located in the front bearing and T10 positioned in the rear bearing. The primary sources of heat in high-speed motorized spindles include the stator, front and rear bearings, and rotor. In order to collect accurate heating data from these heat sources and combine with the literature published by Dai [25], temperature measuring points are placed in 10 different positions.

Fig. 2
figure 2

Construction of experimental platform, installation of sensors and distribution of measuring points

Table 1 Distribution position of sensors

2.2 Result analysis

During practical machining operations, the motorized spindle frequently runs continuously at a constant speed. This experiment aims to examine the degree of heat and heat error operating at three speeds: 2000 r/min, 4000 r/min, and 10,000 r/min. Each group is tested for a duration of 180 min. The system collects degree of heat and heat error data. A steady ambient temperature of 22 °C is kept throughout the experiment in the lab to lessen the impact of outside temperature on the results. To ensure data accuracy, a 12-h cooling period was implemented for each group before conducting the subsequent experiment. A visual representation of the degree of heat and heat error data is shown in Fig. 3.

Fig. 3
figure 3

2000–10,000 r/min temperature and thermal displacement curves of the motorized spindle at various rotational speeds are depicted

Figure 3a–c depicts the gradual increase in temperature over time for each measuring point, reaching a dynamic equilibrium state. Compared to the other parts, the front and rear bearings are hotter, according to temperature monitoring points T5 and T10. The rear bearing’s temperature (T10) is greater than the front bearing’s temperature (T5) since there is not a cooling mechanism at that place. The remaining temperature measurement locations reveal noticeably lower temperatures on the motorized spindle’s surface. Figure 2d shows how the motorized spindle’s axial thermal error rises with greater rotational speeds and gradually stabilizes. The information about temperature and thermal inaccuracy collected throughout the experiment offers vital evidence in favor of future motorized spindle investigations that aim to improve temperature monitoring locations and predict thermal errors.

3 Thermal error modeling

KELM, known as kernel extreme learning machine, is a rapid, straightforward, and efficient machine learning technique. It has superior training speed compared to conventional neural networks, implementation simplicity, generalization capability, and robustness. Consequently, it finds superior application in thermal error modeling, analysis, and prediction within real-world scenarios. However, extreme input data situations may induce overfitting concerns. To address this, the present study incorporates the northern goshawk optimization algorithm to optimize KELM’s initial parameters and enhance the algorithm’s efficiency, stability, and scalability. The NGO-KELM model, thus developed, serves as a robust technical solution supporting thermal error modeling applications. Furthermore, the study includes a comparative analysis with the widely used bat optimization algorithm.

3.1 Kernel extreme learning machine algorithm

KELM enhances the prediction performance while maintaining the benefits of ELM. It comprises three layers: input, hidden, and output layers. The working principle of KELM can be categorized into two stages: training and prediction. The number of hidden layer nodes is usually determined by empirical formula H = (a + b)1/2 + m, where a is the number of input layer nodes, b is the number of output layer nodes, and m is generally an integer between 1 and 10. This paper determines that the number of hidden layers is 7.

  • (1) The learning objective function F(x) of the ELM, a single hidden layer feedforward neural network, is written as follows:

    $$F\left({\text{x}}\right)=h\left({\text{x}}\right)\times \beta =H\times \beta =L$$
    (1)

where X is the input vector, h(x) and H are the hidden node outputs, β is the output weight, and L is the expected output.

  • (2) In order to tackle the problem of network training, a linear system is used, with HT being the generalized inverse matrix of H. Regularization coefficient C and identity matrix I are introduced to improve the stability of neural networks, and the output weight’s least squares solution is

    $$\beta ={H}^{T}{\left(H{H}^{T}+\frac{\rm I}{c}\right)}^{-1}L$$
    (2)
  • (3) ELM introduces the kernel function, and the kernel matrix is

    $${\Omega }_{ELM}=H{H}^{T}=h\left({\text{x}}_{i}\right)h\left({\text{x}}_{j}\right)=K\left({\text{x}}_{i},{\text{x}}_{j}\right)$$
    (3)

where xi, xj are experimental input vectors, then Formula  (4) can be expressed as

$$F\left({\text{x}}\right)=\left[K({\text{x,x}}_{1});\dots ;K({\text{x,x}}_{\text{n}})\right]{\left(\frac{\rm I}{c}+{\Omega }_{ELM}\right)}^{-1}L$$
(4)

where (x1, x2, …, xn) is a given training sample, n is the number of samples, and k is the kernel function.

3.2 NGO-KELM thermal error prediction model

The northern goshawk optimization algorithm (NGO) [26] derives its inspiration from swarm intelligence observed in the hunting behavior of northern goshawks. This algorithm encompasses two primary stages: prey identification and tracking. By carefully studying, imagining, and simulating the hunting process, an optimization algorithm embracing the concept of “prey-hunter” is devised. In this context, the term “prey” symbolizes the optimal solution of the problem being addressed, leading to enhanced predictive efficiency. On the other hand, the “hunter” represents the optimization algorithm utilized during the search process. By integrating these elements, the NGO algorithm offers a novel approach to optimization Fig. 4.

Fig. 4
figure 4

NGO-KELM flow chart

To optimize the selection of super parameters in the KELM, we can combine it with the NGO algorithm. This entails mapping the kernel parameters to the target parameter space for optimization and employing the NGO algorithm to search for the optimal combination of these parameters. By leveraging this approach, we enhance the performance of KELM, leading to improved results in classification and regression tasks. The modeling steps involved are as follows:

  1. (1)

    Initializing the information of optimization problems

  2. (2)

    Specify the number of iterations (t) and the total number of members (n)

  3. (3)

    Initialize the position of the northern goshawk and evaluate the objective function

  4. (4)

    Calculating the objective function

  5. (5)

    Random selection of prey: stage 1: prey identification (exploration stage), using formula (5) to randomly select prey

    $${Y}_{i}={x}_{k},i=\mathrm{1,2},...,n,k=\mathrm{1,2},i-1,i+1,N$$
    (5)
  6. (6)

    Update for the first time: calculate the variables using function \({x}_{i,j}^{{new,{Y}_{1}}}\), calculate the new state of the jth dimension using formula (6), and update the population members using formula (7).

    $${x}_{i,j}^{new,{Y}_{1}}=\left\{\begin{array}{c}{x}_{i,j}+r({Y}_{i,j}-I{x}_{i,j}),{{\text{M}}}_{{Y}_{i}}<{M}_{i}\\ {x}_{i,j}+r({x}_{i,j}-{Y}_{i,j}),{{\text{M}}}_{{Y}_{i}}\ge {M}_{i}\end{array}\right.$$
    (6)
    $${X}_{i}=\left\{\begin{array}{c} {X}_{i}^{new,{Y}_{1}},{M}_{i}^{new,{Y}_{1}}<{M}_{i}\\ {X}_{i}, { M}_{i}^{new,{Y}_{1}}\ge {M}_{i}\end{array}\right.$$
    (7)

    where I is a random number that can be 1 or 2

  7. (7)

    Second update: second stage: tracking operation (development stage), using (8) to update R, and using (9) to calculate the new state of the jth dimension. Update population members using (10).

    $${x}_{i,j}^{new,{Y}_{1}}={x}_{i,j}=+R(2r-1){x}_{i,j}$$
    (8)
    $$R=0.02\left(1-\frac{t}{T}\right)$$
    (9)
    $${X}_{i}=\left\{\begin{array}{c}{X}_{i}^{new,{Y}_{2}},{M}_{i}^{new,{Y}_{2}}<{M}_{i}\\ {X}_{i}, { M}_{i}^{new,{Y}_{2}}\ge {M}_{i}\end{array}\right.$$
    (10)
  8. (8)

    Updates are applied to every member in the population when the first and second phases of the suggested NGO algorithm are finished. The goal function, the population's individual values, and the current top-performing solution are all suitably updated after each iteration. The algorithm then moves on to the next iteration, where population members continue to get changes based on Eqs. (5), (6), (7), (8), (9), and (10), up to the very last iteration. The best answer found throughout the iterations is used to establish the optimal solution for the given optimization issue when the NGO method has been fully implemented. The abovementioned ideal solution is introduced into KELM for additional training and learning, and subsequently, the motorized spindle thermal error prediction model is created. Figure 4 illustrates the process of optimizing the kernel limit learning machine using the NGO algorithm

3.3 Thermal error prediction and analysis

In order to improve the prediction accuracy of the model, the experimental data obtained when the spindle speed is 4000 r/min are used as the training data set. And the method of pedigree clustering combined with gray relational analysis is used to reduce the temperature measuring points to four: T2, T5, T7, and T10. Additionally, predictions are conducted at spindle speeds of 2000 r/min and 10,000 r/min to verify accuracy across different operating conditions. Three models, namely, KELM, BA-KELM, and NGO-KELM, are employed for modeling. Figures 5 and 6 illustrate prediction curves for each model across various speeds. It is evident from the figure that both the BA-KELM and NGO-KELM models exhibit higher prediction accuracy compared to the KELM model across various speeds, with NGO-KELM slightly outperforming BA-KELM. Consequently, the optimized neural network yields predicted values that are closer to the actual measured values. This improvement in prediction accuracy greatly enhances the KELM model. Upon analyzing the prediction curve, noticeable fluctuations appear when the thermal elongation curve reaches equilibrium. Hence, the prediction error ranges for KELM, BA-KELM, and NGO-KELM at 4000 r/min are − 1.6 to 9.79µm, − 6.24 to 2.61µm, and − 5.15 to 3.89µm, respectively. At 10,000 r/min, the corresponding prediction error ranges are − 5 to 0.18 µm, − 8.15 to 0.68 µm, and − 5.15 to 3.89 µm for KELM, BA-KELM, and NGO-KELM, respectively.

Fig. 5
figure 5

2000 r/min curve and residual diagram of each model’s predictions

Fig. 6
figure 6

10,000 r/min curve and residual diagram of each model’s predictions

This passage examines performance indicators, including MAE, R2, RMSE, and ε, to evaluate the fit and accuracy of KELM, BA-KELM, and NGO-KELM models across different rotational speeds. R2 gauges the model’s fit to the data, ranging theoretically from (− ∞, 1]. A value closer to 1 signifies a stronger fit, while closer to 0 suggests a weaker fit. The average absolute error (MAE) reflects the average of the absolute differences between the numbers as projected and as they were, while the root mean square error (RMSE) indicates the squared root of the average of the squared errors with a range of [0, + ∞). Lower values indicate better predictive accuracy, and larger values reflect increased prediction errors. ε serves as an indicator of modeling accuracy, with values closer to 1 implying higher accuracy levels.

Figure 7 illustrates the improved performance of BA-KELM and NGO-KELM models compared to the KELM model at various speeds. The R2 values for KELM, BA-KELM, and NGO-KELM are 0.830, 0.936, and 0.962, respectively. These values indicate that NGO-KELM demonstrates the highest level of fitting. Moreover, NGO-KELM exhibits lower MAE and RMSE values (2.936, 3.196) compared to KELM and BA-KELM, indicating a significant reduction in prediction error. NGO-KELM also demonstrates the highest ε value of 0.947, indicating improved modeling accuracy. Comparatively, BA-KELM and NGO-KELM achieve an increase in R2 values of 0.106 and 0.132, respectively, thus reducing the root mean square error by 3.654 and the average absolute error by 0.944, respectively. This emphasizes that NGO-KELM leads to the largest error reduction. Furthermore, the accuracy of BA-KELM and NGO-KELM models improves by 3.7% and 9.9%, respectively. The NGO-KELM model demonstrates superior prediction accuracy, stability, and generalization capabilities in comparison to the other two models.

Fig. 7
figure 7

Each model predicts the evaluation results

4 Miniature radiator for front and rear bearing rooms

Given that the front and rear bearings are overheated, this paper suggests a structural improvement method at the point where the front and rear bearing chambers and the bearings meet in order to reduce the temperature of the front and rear bearings in the motorized spindle’s main heating parts. This will improve the reduction of thermal error’s influence on the motorized spindle’s accuracy. The columnar structure proposed in this paper increases the heat transfer area and enhances the effect of convective heat transfer. The micro-nanocomposite structure of columnar structure increases the surface roughness, and considering the relationship between surface roughness and the emissivity of surface radiation, which increases with the increase of surface roughness. Therefore, the micro-nanocomposite structure on the square column enhances the radiation heat transfer effect, so the heat dissipation effect of the bearings in contact with the chambers can be increased in order to lessen the motorized spindle’s thermal inaccuracy and more effectively regulate the temperature increase of the bearing components. In addition, this microstructure has not changed much, and the contact area has been reduced by about 20%. The bearing and bearing seat are over-matched and closely matched, and the circumferential stress is uniform, which has little influence on the bonding strength.

In order to machine this structure, DK 7632 high-speed WEDM machine tool is adopted, which has a fully automatic numerical control system, and can realize the movement of electrode wire in X-axis and Y-axis directions, thus achieving the purpose of cutting microstructure shape. Before cutting the wire, the machine tool can complete the autonomous cutting by writing the wire path program, and the machine tool’s control panel’s discharge parameters can be changed to achieve the desired machining conditions. Specific experimental parameters are shown in Table 2. The preparation process is shown in Fig. 8.

Table 2 Specific experimental parameters
Fig. 8
figure 8

Preparation process

Using the COMSOL program, a simulation analysis is performed to confirm the viability of this approach. The motorized spindle simulation model includes the solid-fluid heat transfer module, laminar flow module, and non-isothermal flow module paired with two modules. The solid-liquid heat transfer module’s boundary conditions are established. In Table 3, the boundary conditions are displayed. Figures 9 and 10 display the outcomes of the simulation.

Table 3 Boundary conditions
Fig. 9
figure 9

Improve simulation cloud picture and temperature curve

Fig. 10
figure 10

Simulation nephogram and temperature curve before improvement

The bearing's maximum temperature was 37.5 °C before the improvement, and it was 3.25 °C lower at 34.25 °C after the invention was applied, as shown by the simulation results in Figs. 9 and 10(a) and the front and rear bearing temperature diagram in Figs. 9 and 10(b), when compared with the temperature field results at the joint between the bearing’s outer ring and the bearing chamber before and after adding. After the temperature is stable, the temperature before improvement is 37.1 ℃, and the temperature of the improved bearing is 33.6 ℃, which is 3.5 ℃ lower. It is evident that there is a noticeable drop in temperature at the front bearing with the microheat dissipation construction. The findings demonstrate that the columnar construction improves convective heat transmission and expands the heat transfer area, which boosts the front and rear bearings’ ability to dissipate heat. It works well to lower the motorized spindle’s thermal inaccuracy.

The machining precision is impacted by the thermal deformation brought on by heat buildup in the complexly structured spindle. Reducing the heat deformation inside the spindle is therefore crucial. Table 3 shows the boundary conditions. Additionally, the pre-tightening condition and compatible geometric relationship within the bearing will alter due to the thermal displacement brought on by the process’s rise in temperature, which will have an impact on the bearing’s heat dissipation and support stiffness. Nevertheless, this feedback effect is not taken into account in the model because this paper solely examines the impact of thermal deformation. This research primarily examines the thermal deformation of the motorized spindle in the Z direction because, based on previous experience, the thermal displacement in this direction is the most noticeable. Figure 11a, b illustrates that the spindle’s maximum thermal deformation with the microheat dissipation structure applied is 30.1 μm, whereas the spindle’s maximum thermal deformation without improvement is 45.3 μm. After applying this structure, the thermal deformation is reduced by 15.2 μm, and the effect is obvious. After improvement, the thermal deformation of motorized spindle has been significantly improved.

Fig. 11
figure 11

Thermal deformation simulation nephogram

5 Conclusion

This study focuses on A02 spindle for analysis. Temperature data are collected by experimental means. The NGO-KELM spindle’s thermal error prediction model is developed. Comparative analysis with BA-KELM and KELM models was used. The bearing chamber structure is improved and the findings listed below are reached:

  1. (1)

    An established thermal error model utilizing NGO-KELM is in place. The working conditions at 2000 r/min and 10,000 r/min are verified by experiments. The results indicate a clear superiority of the NGO-KELM model in terms of accuracy compared to both the KELM and BA-KELM models. The NGO-KELM model surpasses them by 10.4% and 5.2%, respectively, achieving an impressive model accuracy of 95.7%. Hence, the NGO-KELM model proves to be a preferable alternative for forecasting the thermal deviation of the motorized spindle.

  2. (2)

    A miniature heat dissipation structure is employed in the contact between the front and rear bearing chambers and the front and rear bearings to improve the heat dissipation effect and lessen the spindle’s thermal deformation. The findings indicate that after applying this structure, the spindle’s thermal deformation in the Z direction drops by 15.2 μm and the temperature at the bearings decreases by 3.5 ℃. There is a clear improvement in both thermal deformation and temperature increase.