A Modeling Method for Thermal Error of CNC Machine Tool Spindle Considering Dynamic Cooling Effect
Through the CNC machine spindle thermal error modeling method that considers the dynamic cooling effect, and using technical means such as KE-LSTM and dual attention mechanism, a thermal error model with robustness and strong generalization ability was established, solving the problem of degradation of model generalization ability caused by ignoring the dynamic cooling effect in the existing methods, and achieving high-precision thermal error prediction and compensation effects.
Patent Information
- Application Number
- CN202510436170.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2045-04-09
AI Technical Summary
The existing thermal error modeling method of CNC machine tools ignores the dynamic cooling effect, which makes it difficult for the model to adapt to changes in working conditions and reduces generalization capabilities, which affects the thermal error compensation effect and the machine tool working accuracy stability.
A method for thermal error modeling of CNC machine spindles considering dynamic cooling effect is proposed. By 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 gray wolf optimization algorithm, a thermal error model with robustness and strong generalization ability is established.
High-precision prediction of thermal error of CNC machine tool spindle is achieved, the prediction residual is stable at ±3μm, and the MAE can reach 1.69μm, which improves the processing accuracy and thermal error compensation effect.
Smart Images

Figure CN119937460B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of error compensation for numerical control machine tools, and particularly relates to a method for modeling the thermal error of the spindle of a numerical control machine tool considering the dynamic cooling effect. Background Art
[0002] As the industrial mother machine of modern manufacturing, the accuracy stability of a numerical control machine tool directly affects the machining quality of parts. When the spindle of a numerical control machine tool rotates at a high speed, a large amount of heat is easily generated; this heat is transferred to various parts of the machine tool through heat conduction and convection, forming a non-uniform temperature field, resulting in thermo-elastic deformation of the corresponding components, changing the ideal position of the spindle axis in space, and forming the thermal error of the spindle. To timely 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 only when the coolant temperature exceeds the threshold and stop working when it is lower than the threshold, and the heat dissipation capacity changes with the working state of the refrigerator, which easily forms a dynamic cooling effect, resulting in a "wave-like" change in the spindle temperature and forming a time-varying non-linear thermal error. Thermal error compensation is the key technology for controlling thermal error, and thermal error modeling is the core among them.
[0003] The current modeling methods ignore the dynamic cooling effect, which easily leads to the difficulty of the established thermal error model in adapting to the changes in working conditions and the decline in generalization ability, seriously affecting the later thermal error compensation effect and resulting in the decline of the working precision stability of the machine tool. Summary of the Invention
[0004] The purpose of the present invention is to propose a method for modeling the thermal error of the spindle of a numerical control machine tool 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 purpose, the present invention adopts the following technical solutions:
[0006] A method for modeling the thermal error of the spindle of a numerical control machine tool considering the dynamic cooling effect includes the following steps:
[0007] 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 processing to construct a data set;
[0008] The temperature data includes the real-time temperature of the spindle near the cooling water channel , the temperature at the top of the spindle box , the temperature at the bottom of the column and the temperature at the bottom of the machine tool ; the thermal error data is the axial displacement of the numerical control machine tool;
[0009] Step 2: Construct a dynamic cooling effect characterization layer;
[0010] First, within the time window, based on the real-time temperature of the main shaft and the coolant temperature threshold perform cooling effect encoding ;
[0011] Then, map the cooling effect encoding to a cooling effect feature matrix , is the weight parameter matrix of the dynamic cooling effect characterization layer, is the bias term of the dynamic cooling effect characterization layer;
[0012] Step 3: Construct the KE-LSTM temperature feature extraction layer;
[0013] First, improve the LSTM network by fusing the Kolmogorov-Arnold network with the long short-term memory neural network to form KE-LSTM neurons;
[0014] Then, the activation functions of the forget gate, input gate, and output gate in the KE-LSTM neurons adopt the hard-sigmoid activation function; the activation functions of the candidate cell state and hidden state in the KE-LSTM neurons adopt the Softsign activation function;
[0015] Finally, stack two layers of KE-LSTM neurons with hidden units of and respectively to construct the KE-LSTM temperature feature extraction layer;
[0016] Step 4: Construct the dual attention mechanism fusion layer;
[0017] First, use the KE-LSTM temperature feature extraction layer to extract the temperature hidden state features in the temperature data within the time window, construct the temperature hidden state matrix , and splice the temperature hidden state matrix with the cooling effect encoding and calculate the differential attention through the differential self-attention mechanism, perform a linear transformation on , and output the context vector ;
[0018] Then, perform average pooling on the temperature hidden state matrix to extract the global statistical information of each channel ; use the fully connected layer to reduce the dimension of the compressed global statistical information , and then use the LeakyReLU activation function for nonlinear processing to obtain the dimension-reduced global information ;
[0019] For the cooling effect feature matrix Perform average pooling to extract the dynamic cooling information of each channel , and then perform a linear transformation on and through a fully connected layer, and calculate the channel weights through the Sigmoid function ;
[0020] Calculate the context vector based on the channel attention weights considering the dynamic cooling effect ; is the temperature hidden state matrix, represents the Hadamard product operation;
[0021] Finally, add the context vector output by the differential attention mechanism and the context vector output by the channel attention mechanism to obtain the fused feature vector ;
[0022] Step 5: Construct the KAN layer and the prediction output layer;
[0023] Stack two layers of Kolmogorov - Arnold networks with hidden units of and respectively to construct the KAN layer, further process the fused feature vector , and then output the thermal error prediction value after linear transformation;
[0024] Step 6: Optimize the model hyperparameters based on the grey wolf optimization algorithm and the dataset constructed in Step 1, and establish a machine tool spindle thermal error model considering the dynamic cooling effect.
[0025] Furthermore, 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 chiller ; designing the spindle movement speed spectrum of the numerically controlled machine tool.
[0026] 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.
[0027] Furthermore, the thermal error data is synchronously measured by an eddy current displacement sensor installed axially on the numerically controlled machine tool.
[0028] Furthermore, the hard - sigmoid activation function ; the Softsign activation function , is the input value.
[0029] Further, the optimized model hyperparameters include the number of hidden units in the KE-LSTM layer and , the time window length , the number of hidden units in the KAN layer and .
[0030] The present invention has the following beneficial effects:
[0031] (1) According to the "ON-OFF" control principle of the refrigerating machine, cooling effect encoding is performed based on the real-time temperature of the main shaft near the cooling water channel and the coolant threshold temperature, and it is mapped into a cooling effect feature matrix through a fully connected layer, characterizing the respective dynamic cooling effects received at different positions of the machine tool.
[0032] (2) Embed the KAN network in the LSTM gating unit to construct KE-LSTM neurons, and reconstruct the non-linear transformation of the input gate, forget gate, and output gate through B-spline combination and residual connection, significantly improving the expression ability of temperature time series features; then adopt the hard-sigmoid activation function and Softsign activation function to balance gradient stability and non-linear fitting ability.
[0033] (3) Dual attention mechanism; differential self-attention eliminates the noise of the cooling effect encoding and temperature hidden state features, captures the "wave-like" temperature change time series dependence characteristics, and enhances the context modeling ability; channel attention dynamically calculates the feature channel weights based on the LeakyReLU activation function and Sigmoid activation function, considers the dynamic cooling effect, and realizes temperature feature enhancement.
[0034] (4) Design the KAN layer, construct a non-linear mapping relationship between temperature features and thermal errors through a learnable B-spline activation function, and combine the grey wolf optimization algorithm to optimize the key hyperparameters of the network, improving the model prediction accuracy and interpretability.
[0035] (5) The prediction residuals of the established CCTEM model are stable within ±3μm, and the MAE can reach 1.69μm, laying a core algorithm foundation for the real-time compensation of thermal errors of high-precision CNC machine tools and improving the machining accuracy. Description of the Drawings
[0036] Figure 1 It is a schematic structural diagram of the CCTEM model of the present invention.
[0037] Figure 2 It is a comparison chart of the prediction results of the model of the present invention and other models.
[0038] Figure 3 It is a comparison chart of the prediction residuals of the model of the present invention and other models.
[0039] Figure 4 This is a comparison chart of MAE and RMSE between the model of the present invention and other models. Specific implementation mode
[0040] As Figure 1 shown, a method for modeling the thermal error of the spindle of a numerically controlled machine tool considering the dynamic cooling effect provided by this embodiment includes the following steps:
[0041] Step 1: Design a thermal characteristic experiment to collect temperature data and thermal error data;
[0042] The thermal characteristic experiment includes: First, based on the "ON - OFF" intermittent cooling principle, referring to the ambient temperature, set the coolant temperature threshold of the chiller ; when the coolant temperature is higher than the threshold, the chiller works; when it is lower than the threshold, it stops working; then, design the spindle movement speed spectrum of the numerically controlled machine tool, with each movement time being 20 minutes and the pause time being 10 minutes.
[0043] Data acquisition: To monitor the status of the cooling system and obtain the spindle temperature field information, arrange 1 PT100 temperature sensor at the front bearing of the spindle near the cooling water jacket to collect the real - time temperature of the spindle . In addition, arrange 1 PT100 temperature sensor at the center of the top of the spindle box, the bottom of the column, and the bottom of the machine tool bed respectively to collect the temperature at the top of the spindle box , the temperature at the bottom of the column and the temperature at the bottom of the machine tool . Use an eddy current displacement sensor to synchronously measure the axial thermal error data of the spindle.
[0044] Perform time - slicing processing on the collected temperature data ( , , , ) and thermal error data to construct a data set.
[0045] Step 2: Construct a dynamic cooling effect characterization layer;
[0046] First, perform cooling effect encoding based on the real - time temperature of the spindle and the coolant temperature threshold; within the time window (the width of the time window is ), generate a cooling effect encoding according to the comparison between the real - time temperature of the spindle and the coolant temperature threshold ; if the real - time temperature of the spindle is greater than or equal to the coolant temperature threshold , the cooling effect encoding is 1; if the real - time temperature of the spindle is less than the coolant temperature threshold , the cooling effect encoding is 0. When it is less than the coolant temperature threshold
[0047] Then, perform feature mapping; map the cooling effect encoding to a cooling effect feature matrix through a fully connected layer , is the weight parameter matrix of the dynamic cooling effect characterization layer, is the bias term of the dynamic cooling effect characterization layer; it characterizes the cooling effects at different positions of the CNC machine tool.
[0048] Step 3: Construct a KE-LSTM temperature feature extraction layer;
[0049] First, improve the LSTM network to enhance its non-linear expression ability;
[0050] Use the Kolmogorov-Arnold network (KAN) to perform non-linear transformation on the input features of the input gate, forget gate, output gate, and candidate cell state in the long short-term memory neural network (LSTM), improve the performance and interpretability of the LSTM, and construct a KE-LSTM neuron;
[0051] The input gate in the KE-LSTM neuron , the forget gate , the output gate , the candidate cell state The expressions are as follows:
[0052] ,
[0053] ,
[0054] ,
[0055] ,
[0056] In the formula, is the overall temperature data of the machine tool within the time window and the cooling effect encoding concatenated into an input matrix, is the hidden state at the previous moment, , , , are scaling factor parameter matrices; , , , are linear combinations of B-splines; , , , are basic functions similar to residual connections , , , , is , , , 's scaling factor; is the input value.
[0057] Then, optimize the activation function; improve gradient stability and sparsity, and alleviate the vanishing gradient problem;
[0058] Adopt the hard - sigmoid activation function for the forget gate, input gate, and output gate in the KE - LSTM neuron , is the input value; the hard - sigmoid activation function has higher gradient stability and sparsity, can effectively solve the vanishing gradient problem, improve training stability, and at the same time generate sparse representations, improve the generalization ability of the model and reduce overfitting.
[0059] Adopt the Softsign activation function for the candidate cell state and hidden state in the KE - LSTM neuron , is the input value; the Softsign activation function can better alleviate the vanishing gradient problem, improve computational efficiency, enhance the generalization ability of the model, and improve training stability.
[0060] Finally, construct the KE - LSTM temperature feature extraction layer by stacking two layers of KE - LSTM neurons; and the hidden units are respectively and . The KE - LSTM temperature feature extraction layer is used to extract the temperature hidden features within the time window.
[0061] Step 4: Construct a dual - attention mechanism fusion layer;
[0062] First, capture the temporal correlation of the dynamic cooling effect through a differential self - attention mechanism;
[0063] 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, concatenate the temperature hidden state matrix H with the cooling effect encoding to ; calculate the differential attention through the query (Q), key (K), and value (V) matrices, perform a linear transformation on , and output the context vector ; is the weight parameter matrix of the differential self - attention layer; is the bias term of the differential self - attention layer.
[0064] Then, the temperature hidden features and the cooling effect are dynamically weighted and fused through the channel attention mechanism to adaptively enhance the contribution of the key channels;
[0065] Perform average pooling on the temperature hidden state matrix to extract the global statistical information of each channel ; Use a fully connected layer to reduce the dimension of the compressed global statistical information , and then perform non-linear processing using the LeakyReLU activation function to obtain the dimension-reduced global information , is the weight parameter matrix of the dimension reduction transformation, is the bias term of the dimension reduction transformation.
[0066] Perform average pooling on the cooling effect feature matrix to extract the dynamic cooling information of each channel , and then perform a linear transformation on the dimension-reduced global information and the dynamic cooling information through a fully connected layer, and calculate the channel weight through the Sigmoid function; is the channel weight, , are the weight parameter matrices of the dimension increase transformation; , are the bias terms of the dimension increase transformation.
[0067] Calculate the context vector based on the channel attention weight considering the dynamic cooling effect; is the temperature hidden state matrix, is the Hadamard product operation.
[0068] Finally, add the vector output by the differential attention mechanism and the vector output by the channel attention mechanism to obtain the fused feature vector .
[0069] Step 5: Construct the KAN layer and the prediction output layer;
[0070] Further process the fused features through two-layer KAN networks with hidden units of and respectively to enhance the non-linear modeling ability of the model; then output the predicted value of the thermal error after linear transformation, is the thermal error vector, is the feature vector output by the KAN layer; is the weight parameter matrix of the output layer, is the bias term of the output layer.
[0071] Step 6: Optimize the hyperparameters of the model based on the Grey Wolf Optimization algorithm and the dataset constructed in Step 1;
[0072] 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 , the length of the time window , the number of hidden units in the KAN layer and other key hyperparameters; Based on the optimized key hyperparameters, a thermal error model of the machine tool spindle considering the dynamic cooling effect is established, abbreviated as CCTEM.
[0073] The thermal error model CCTEM constructed in this embodiment; is compared with the LSTM model, GRU model, BPNN model, and MLR model established by traditional modeling methods. Using the machine tool thermal state characteristic experiment method in Step 1, temperature data and thermal error data different from the modeling working conditions are re-collected to verify the prediction capabilities of the CCTEM constructed in this embodiment and each comparison model. The prediction results are as follows Figure 2 shown; The CCTEM thermal error model has the best prediction effect, and the prediction residual is about ±3μm, as shown in Figure 3 shown; The mean absolute error MAE and root mean square error RMSE of each model are as shown in Figure 4 shown. The results show that the MAE and RMSE of the CCTEM model are only 1.69μm and 2.09μm. Compared with the LSTM model, GRU model, BPNN model, and MLR model, the MAE is reduced by 38%, 36%, 37%, 40% respectively, and the RMSE is reduced by 35%, 31%, 37%, 40% respectively, verifying the effectiveness and superiority of the modeling method proposed in this embodiment.
[0074] The above is only a preferred embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any modification and replacement based on the technical solutions and inventive concepts provided by the present invention should be covered within 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