Numerical control machine tool spindle thermal error modeling method considering dynamic cooling effect
Through the CNC machine spindle thermal error modeling method that considers the dynamic cooling effect, the problem of ignoring the dynamic cooling effect in the existing technology that the model generalization ability is reduced due to the loss of dynamic cooling effect, high-precision and stable thermal error compensation are achieved, and the machining accuracy of the machine tool is improved.
Patent Information
- Application Number
- CN202510436170.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-04-09
AI Technical Summary
The existing thermal error modeling method of CNC machine tools ignores the dynamic cooling effect, making it difficult for the model to adapt to changes in working conditions, and the generalization ability decreases, affecting the thermal error compensation effect, and reducing the working accuracy and stability of the machine tool.
A method for thermal error modeling of CNC machine spindles considering dynamic cooling effect is proposed. Through designing thermal characteristic experiments, temperature data and thermal error data are collected, dynamic cooling effect characterization layer is constructed, KE-LSTM temperature feature extraction layer and dual attention mechanism fusion layer, combined with KAN layer and prediction output layer, and finally optimize the model hyperparameters through the gray wolf optimization algorithm.
A thermal error model with strong robustness and generalization ability has been established, which can effectively capture the dynamic cooling effect, improve the accuracy and stability of thermal error compensation, and improve the machining accuracy of machine tools.
Smart Images

Figure CN119937460A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of error compensation of numerically controlled machine tools, and in particular relates to a method for modeling thermal errors of a spindle of a numerically controlled machine tool taking into account a dynamic cooling effect. Background Art
[0002] As the industrial mother machine of modern manufacturing industry, the precision and stability of CNC machine tools directly affect the quality of parts processing. The high-speed rotation of the spindle of CNC machine tools easily generates a large amount of heat; this heat is transferred to various parts of the machine tool through heat conduction and convection, forming a non-uniform temperature field, causing the corresponding parts to be thermoelastically deformed, changing the ideal position of the spindle axis in space, and forming spindle thermal errors. In order to promptly remove the heat generated inside the spindle, the "ON-OFF" intermittent cooling control method is often used; this control method makes the refrigerator start working when the coolant temperature exceeds the threshold, and stops working when it is lower than the threshold. The heat dissipation capacity changes with the working state of the refrigerator, which is easy to form a dynamic cooling effect, causing the spindle temperature to change in a "wave-like" manner, forming a time-varying nonlinear thermal error. Thermal error compensation is a key technology for controlling thermal errors, among which thermal error modeling is the core.
[0003] The current modeling method ignores the dynamic cooling effect, which easily leads to the established thermal error model being difficult to adapt to changes in working conditions and a decrease in generalization ability, which seriously affects the subsequent thermal error compensation effect and causes a decrease in the working accuracy and stability of the machine tool. Summary of the invention
[0004] The purpose of the present invention is to propose a CNC machine tool spindle thermal error modeling method considering the dynamic cooling effect. This method constructs a thermal error model with strong robustness and generalization ability, providing core support for thermal error compensation.
[0005] To achieve the above object, the present invention adopts the following technical solution:
[0006] A method for modeling thermal errors of a CNC machine tool spindle considering dynamic cooling effects comprises the following steps: Step 1: Design a thermal characteristic experiment based on the "ON-OFF" intermittent cooling principle, collect temperature data and thermal error data, and perform time slicing to construct a data set; The temperature data includes the real-time temperature of the spindle near the cooling water channel , Spindle box top temperature , column bottom temperature and machine bottom temperature ; The thermal error data refers to the axial displacement of the CNC machine tool; Step 2: Construct a dynamic cooling effect characterization layer; First, within the time window, based on the real-time temperature of the spindle and coolant temperature threshold Encoding the cooling effect ; Then, the cooling effect encoding is mapped into the cooling effect feature matrix , is the weight parameter matrix of the dynamic cooling effect characterization layer, is the dynamic cooling effect characterization layer bias term; Step 3: Construct the KE-LSTM temperature feature extraction layer; First, the LSTM network is improved, and the Kolmogorov-Arnold network is fused with the long short-term memory neural network to form the KE-LSTM neuron; Then, the activation functions of the forget gate, input gate, and output gate in the KE-LSTM neuron adopt the hard-sigmoid activation function; the activation functions of the candidate cell state and hidden state in the KE-LSTM neuron adopt the Softsign activation function; Finally, the hidden units are and The two layers of KE-LSTM neurons are stacked to construct the KE-LSTM temperature feature extraction layer; Step 4: Construct a dual attention mechanism fusion layer; First, the KE-LSTM temperature feature extraction layer is used to extract the temperature hidden state features in the temperature data within the time window and construct the temperature hidden state matrix , the temperature hidden state matrix Coding with cooling effect After splicing, the differential attention is calculated through the differential self-attention mechanism ,right Perform linear transformation and output context vector ; Then, the hidden state matrix for temperature Perform average pooling to extract global statistics for each channel ; Use the fully connected layer to compress the global statistical information Perform dimensionality reduction, and then use the LeakyReLU activation function for nonlinear processing to obtain dimensionality reduction global information ; Cooling effect characteristic matrix Perform average pooling to extract dynamic cooling information for each channel , and then based on the fully connected layer and Perform linear transformation and calculate channel weights through Sigmoid function ; Calculate context vector based on channel attention weights considering dynamic cooling effect ; is the temperature hidden state matrix, represents the Hadamard product operation; Finally, the context vector output by the differential attention mechanism And the context vector output by the channel attention mechanism Add to get the fused feature vector ; Step 5: Construct KAN layer and prediction output layer; The hidden units are and The two-layer Kolmogorov-Arnold network is stacked to construct the KAN layer, which further processes the fused feature vector , and then output the thermal error prediction value after linear transformation ; Step 6: Optimize the model hyperparameters based on the Grey Wolf optimization algorithm and the data set constructed in step 1, and establish a machine tool spindle thermal error model considering the dynamic cooling effect.
[0007] Furthermore, the thermal characteristic experiment includes: based on the "ON-OFF" intermittent cooling principle, referring to the ambient temperature, setting the coolant temperature threshold of the refrigerator ; Design the spindle motion speed spectrum of CNC machine tools.
[0008] Furthermore, the temperature data is collected by temperature sensors respectively arranged at the front bearing of the spindle near the cooling water channel, the center of the top of the spindle box, the bottom of the column, and the bottom of the machine tool bed.
[0009] Furthermore, the thermal error data is synchronously measured by an eddy current displacement sensor installed in the axial direction of the CNC machine tool.
[0010] Furthermore, the hard-sigmoid activation function ; The Softsign activation function , is the input value.
[0011] Furthermore, the optimized model hyperparameters include the number of hidden units in the KE-LSTM layer. and , time window length , the number of hidden units in the KAN layer and .
[0012] The present invention has the following beneficial effects:
[0013] (1) According to the "ON-OFF" control principle of the refrigerator, the cooling effect is encoded based on the real-time temperature of the spindle near the cooling water channel and the coolant threshold temperature. It is mapped into a cooling effect feature matrix through a fully connected layer to characterize the dynamic cooling effects at different positions of the machine tool.
[0014] (2) The KAN network is embedded in the LSTM gating unit to construct the KE-LSTM neuron. The nonlinear transformation of the input gate, forget gate, and output gate is reconstructed through B-spline combination and residual connection, which significantly improves the expression ability of temperature time series features. Then, the hard-sigmoid activation function and the Softsign activation function are used to take into account both gradient stability and nonlinear fitting ability.
[0015] (3) Dual attention mechanism: Differential self-attention eliminates the noise of cooling effect encoding and temperature hidden state features, captures the “wave-like” time-dependent characteristics of temperature changes, and enhances context modeling capabilities; channel attention dynamically calculates feature channel weights based on the LeakyReLU activation function and the Sigmoid activation function, taking into account the dynamic cooling effect to achieve temperature feature enhancement.
[0016] (4) The KAN layer is designed to construct the nonlinear mapping relationship between temperature features and thermal errors through a learnable B-spline activation function. The key hyperparameters of the network are optimized by combining the Grey Wolf Optimization Algorithm to improve the prediction accuracy and interpretability of the model.
[0017] (5) The established CCTEM model predicts a stable residual error of ±3 μm and a MAE of 1.69 μm, which lays the core algorithm foundation for real-time compensation of thermal errors of high-precision CNC machine tools and improves machining accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a schematic diagram of the CCTEM model structure of the present invention.
[0019] Figure 2 This is a comparison chart of the prediction results of the model of the present invention and other models.
[0020] Figure 3 This is a comparison chart of the prediction residuals of the model of the present invention and other models.
[0021] Figure 4 This is a comparison chart of MAE and RMSE between the model of the present invention and other models. DETAILED DESCRIPTION
[0022] like Figure 1 As shown, the present embodiment provides a method for modeling thermal errors of a CNC machine tool spindle taking into account a dynamic cooling effect, comprising the following steps:
[0023] Step 1: Design a thermal characteristic experiment and collect temperature data and thermal error data; The thermal characteristics experiment includes: First, based on the "ON-OFF" intermittent cooling principle, refer to the ambient temperature and set the coolant temperature threshold of the refrigerator ; When the coolant temperature is higher than the threshold, the refrigerator works; when it is lower than the threshold, it stops working; then, the CNC machine tool spindle motion speed spectrum is designed, each motion time is 20 minutes, and the pause time is 10 minutes.
[0024] Data acquisition: In order to monitor the cooling system status and obtain the spindle temperature field information, a PT100 temperature sensor is arranged at the front bearing of the spindle near the cooling water jacket to collect the real-time spindle temperature. In addition, a PT100 temperature sensor is arranged at the center of the top of the spindle box, the bottom of the column, and the bottom of the machine bed to collect the temperature of the top of the spindle box. , column bottom temperature and machine bottom temperature The axial thermal error data of the spindle is synchronously measured using an eddy current displacement sensor.
[0025] The collected temperature data ( , , , ) and thermal error data are processed by time slicing to construct a dataset.
[0026] Step 2: Construct a dynamic cooling effect characterization layer; First, the cooling effect is encoded based on the real-time spindle temperature and the coolant temperature threshold; in the time window (the width of the time window is ) according to the real-time spindle temperature and coolant temperature threshold The contrast generative cooling effect encoding ; If the real-time spindle temperature Greater than or equal to the coolant temperature threshold When the cooling effect is coded as 1; if the real-time spindle temperature Less than coolant temperature threshold When , the cooling effect is encoded as 0.
[0027] Then, feature mapping is performed; the cooling effect encoding is mapped into a cooling effect feature matrix through a fully connected layer , is the weight parameter matrix of the dynamic cooling effect characterization layer, It is the dynamic cooling effect characterization layer bias term; it characterizes the cooling influence of different positions of the CNC machine tool.
[0028] Step 3: Construct the KE-LSTM temperature feature extraction layer; First, improve the LSTM network and enhance its nonlinear expression ability; The Kolmogorov-Arnold network (KAN) is used to perform nonlinear transformation on the input gate, forget gate, output gate, and input features of candidate cell states in the long short-term memory neural network (LSTM), improve the performance and interpretability of LSTM, and construct KE-LSTM neurons; Input gate in KE-LSTM neuron , Forget Gate , output gate , candidate cell states The expression is as follows: , , , , In the formula, is the overall temperature data of the machine tool within the time window And the cooling effect coding The concatenated input matrix, is the hidden state at the previous moment, , , , is the scaling factor parameter matrix; , , , is a linear combination of B-splines; , , , It is similar to the basic function of residual connection , , , , yes , , , The scaling factor of is the input value.
[0029] Then, optimize the activation function; improve the gradient stability and sparsity, and alleviate the gradient vanishing problem;
[0030] Use the hard-sigmoid activation function in the forget gate, input gate, and output gate of the KE-LSTM neuron , is the input value; the hard-sigmoid activation function has higher gradient stability and sparsity, which can effectively solve the gradient vanishing problem, improve training stability, and generate sparse representation, improve the generalization ability of the model and reduce overfitting.
[0031] The activation function of the candidate cell state and hidden state in the KE-LSTM neuron adopts the Softsign activation function , is the input value; the Softsign activation function can better alleviate the gradient vanishing problem, improve computational efficiency, enhance model generalization ability, and improve training stability.
[0032] Finally, the two layers of KE-LSTM neurons are stacked to construct the KE-LSTM temperature feature extraction layer; and the hidden units are and The KE-LSTM temperature feature extraction layer is used to extract the temperature hidden features within the time window.
[0033] Step 4: Construct a dual attention mechanism fusion layer; First, the temporal correlation of the dynamic cooling effect is captured through a differential self-attention mechanism; Use the KE-LSTM temperature feature extraction layer to extract the temperature hidden state features within the time window and obtain the temperature hidden state matrix , is the width of the time window, encoding the temperature hidden state matrix H and the cooling effect Splice to ; Calculate differential attention through query (Q), key (K), value (V) matrix ,right Perform linear transformation and output context vector ; is the differential self-attention layer weight parameter matrix; is the differential self-attention layer bias term.
[0034] Then, the temperature hidden features and cooling effects are dynamically weighted and fused through the channel attention mechanism to adaptively improve the contribution of key channels. Hidden state matrix for temperature Perform average pooling to extract global statistics for each channel ; Use the fully connected layer to compress the global statistical information Perform dimensionality reduction, and then use the LeakyReLU activation function for nonlinear processing to obtain dimensionality reduction global information , is the dimension reduction transformation weight parameter matrix, is the dimension reduction transformation bias term.
[0035] Cooling effect characteristic matrix Perform average pooling to extract dynamic cooling information for each channel , and then reduce the dimension of the global information based on the fully connected layer and dynamic cooling information Perform linear transformation and calculate channel weights through Sigmoid function ; is the channel weight, , is the dimension-raising transformation weight parameter matrix; , is the bias term of the dimension-raising transformation.
[0036] Calculate context vector based on channel attention weights considering dynamic cooling effect ; is the temperature hidden state matrix, is the Hadamard product operation.
[0037] Finally, the vector output by the differential attention mechanism and the vector output by the channel attention mechanism are added to obtain the fused feature vector .
[0038] Step 5: Construct KAN layer and prediction output layer; The hidden units are and The two-layer KAN network further processes the fusion features to enhance the nonlinear modeling capability of the model; the thermal error prediction value is output after linear transformation. , is the thermal error vector, is the feature vector output by the KAN layer; is the output layer weight parameter matrix, is the output layer bias term.
[0039] Step 6: Optimize model hyperparameters based on the Gray Wolf Optimization Algorithm and the dataset constructed in Step 1; According to the structural characteristics of the thermal error model, the Grey Wolf Optimization (GWO) algorithm is used to optimize the number of hidden units in the KE-LSTM layer. and , time window length , the number of hidden units in the KAN layer and Key hyperparameters: Based on the optimized key hyperparameters, a machine tool spindle thermal error model considering dynamic cooling effect is established, referred to as CCTEM.
[0040] The thermal error model CCTEM constructed in this embodiment is compared with the LSTM model, GRU model, BPNN model, and MLR model constructed by the traditional modeling method. Using the machine tool thermal characteristics experimental method in step 1, the temperature data and thermal error data under different modeling conditions are re-collected to verify the prediction ability of the CCTEM constructed in this embodiment and the comparison models. The prediction results are as follows: Figure 2 As shown in the figure, the CCTEM thermal error model has the best prediction effect, and the prediction residual is about ±3μm. Figure 3 As shown; the mean absolute error MAE and root mean square error RMSE of each model are as follows Figure 4 As shown, the results show that the MAE and RMSE of the CCTEM model are only 1.69μm and 2.09μm, which are reduced by 38%, 36%, 37%, and 40% of MAE and 35%, 31%, 37%, and 40% of RMSE respectively compared with the LSTM model, GRU model, BPNN model, and MLR model, verifying the effectiveness and superiority of the modeling method proposed in this embodiment.
[0041] The above description is only a preferred implementation manner of the present invention, but the protection scope of the present invention is not limited thereto, and any modification and replacement based on the technical solution and inventive concept provided by the present invention should be included in the protection scope of the present invention.
Claims
1. A method for modeling thermal errors of CNC machine tool spindles considering dynamic cooling effects, characterized in that: The steps include: Step 1: Design a thermal characteristic experiment based on the "ON-OFF" intermittent cooling principle, collect temperature data and thermal error data, and perform time slicing to construct a data set; The temperature data includes the real-time temperature of the spindle near the cooling water channel , Spindle box top temperature , column bottom temperature and machine bottom temperature ; The thermal error data refers to the axial displacement of the CNC machine tool; Step 2: Construct a dynamic cooling effect characterization layer; First, within the time window, based on the real-time temperature of the spindle and coolant temperature threshold Encoding the cooling effect ; Then, the cooling effect encoding is mapped into the cooling effect feature matrix , is the weight parameter matrix of the dynamic cooling effect characterization layer, is the dynamic cooling effect characterization layer bias term; Step 3: Construct the KE-LSTM temperature feature extraction layer; First, the LSTM network is improved, and the Kolmogorov-Arnold network is fused with the long short-term memory neural network to form the KE-LSTM neuron; Then, the activation functions of the forget gate, input gate, and output gate in the KE-LSTM neuron adopt the hard-sigmoid activation function; the activation functions of the candidate cell state and hidden state in the KE-LSTM neuron adopt the Softsign activation function; Finally, the hidden units are and The two layers of KE-LSTM neurons are stacked to construct the KE-LSTM temperature feature extraction layer; Step 4: Construct a dual attention mechanism fusion layer; First, the KE-LSTM temperature feature extraction layer is used to extract the temperature hidden state features in the temperature data within the time window and construct the temperature hidden state matrix , the temperature hidden state matrix Coding with cooling effect After splicing, the differential attention is calculated through the differential self-attention mechanism ,right Perform linear transformation and output context vector ; Then, the hidden state matrix for temperature Perform average pooling to extract global statistics for each channel ; Use the fully connected layer to compress the global statistical information Perform dimensionality reduction, and then use the LeakyReLU activation function for nonlinear processing to obtain dimensionality reduction global information ; Cooling effect characteristic matrix Perform average pooling to extract dynamic cooling information for each channel , and then based on the fully connected layer and Perform linear transformation and calculate channel weights through Sigmoid function ; Calculate context vector based on channel attention weights considering dynamic cooling effect ; is the temperature hidden state matrix, represents the Hadamard product operation; Finally, the context vector output by the differential attention mechanism And the context vector output by the channel attention mechanism Add to get the fused feature vector ; Step 5: Construct KAN layer and prediction output layer; The hidden units are and The two-layer Kolmogorov-Arnold network is stacked to construct the KAN layer, which further processes the fused feature vector , and then output the thermal error prediction value after linear transformation ; Step 6: Optimize the model hyperparameters based on the Grey Wolf optimization algorithm and the data set constructed in step 1, and establish a machine tool spindle thermal error model considering the dynamic cooling effect.
2. A method for modeling thermal errors of CNC machine tool spindles considering dynamic cooling effects according to claim 1, characterized in that: The thermal characteristics experiment includes: based on the "ON-OFF" intermittent cooling principle, referring to the ambient temperature, setting the coolant temperature threshold of the refrigerator ; Design the spindle motion speed spectrum of CNC machine tools.
3. The method for modeling thermal error of a CNC machine tool spindle considering dynamic cooling effect according to claim 1, characterized in that: The temperature data is collected by temperature sensors arranged at the front bearing of the spindle near the cooling water channel, the center of the top of the spindle box, the bottom of the column, and the bottom of the machine tool bed.
4. The method for modeling thermal error of a CNC machine tool spindle considering dynamic cooling effect according to claim 1, characterized in that: The thermal error data is synchronously measured by an eddy current displacement sensor installed in the axial direction of the CNC machine tool.
5. The method for modeling thermal error of a CNC machine tool spindle considering dynamic cooling effect according to claim 1, characterized in that: The hard-sigmoid activation function ; The Softsign activation function , is the input value.
6. The method for modeling thermal error of a CNC machine tool spindle considering dynamic cooling effect according to claim 1, characterized in that: The optimized model hyperparameters include the number of hidden units in the KE-LSTM layer and , time window length , the number of hidden units in the KAN layer and .
Citation Information
Patent Citations
Numerical control machine tool spindle thermal error segmentation modeling method considering thermal hysteresis
CN114896771A
Spindle thermal error compensation method insensitive to cooling system disturbance
US20210048793A1
Cited By
Numerical control machine tool spindle thermal error compensation method considering temperature sensor fault
CN120469340A
Machine tool thermal error modeling method based on multi-source heterogeneous temperature feature fusion
CN120763871A
A machine tool thermal error modeling method based on multi-source heterogeneous temperature feature fusion
CN120763871B
Numerical control machine tool spindle thermal error modeling method based on cooling liquid temperature
CN122151710A