Machine tool thermal error modeling method based on time convolutional network and transfer learning
By introducing time convolution network and transfer learning technology into machine tool thermal error modeling, combined with the encoder-decoder architecture, the problem of re-acquisition of thermal error modeling between different machine tools is solved, and high-precision and low-cost thermal error prediction and model expansion are achieved.
Patent Information
- Application Number
- CN202411843383.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-03-21
AI Technical Summary
The prior art different thermal characteristics between different machine tools lead to thermal error modeling that requires re-acquisition of data, which increases manpower and material consumption, especially when the number of machine tools increases.
The thermal error modeling method of machine tools based on time convolution network and transfer learning is adopted. By introducing an encoder-decoder architecture, the dimension of temperature data is reduced and redundant data is reduced. In combination with transfer learning technology, the data of one machine tool is used to establish a thermal error model with sufficient accuracy on other machine tools.
It improves the feature extraction capability of the model, significantly improves the prediction accuracy, reduces the computational complexity and data acquisition costs, and can quickly expand to hundreds of machine tools while ensuring prediction accuracy.
Smart Images

Figure CN119668191A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of thermal error compensation of CNC machine tools, and more specifically, relates to a machine tool thermal error modeling method based on temporal convolutional networks and transfer learning. Background Art
[0002] Thermal error compensation technology for machine tools is a key link in the control of machine tool machining accuracy. As the machine tool runs for a long time, the thermal effects caused by factors such as friction, cutting and ambient temperature changes will cause thermal deformation of machine tool components, which will directly affect the machining accuracy. The accumulation of such thermal errors will lead to workpiece dimensional deviations, reduced surface quality, and even cause workpiece scrapping or machine tool damage. Studies have shown that thermal errors account for a large proportion of the total machining error, especially for high-precision machining equipment, where the impact of thermal errors on machining results is particularly significant.
[0003] Therefore, it is necessary to study a method to alleviate or even eliminate the impact of thermal errors on machine tool processing. Error control method is a common method to alleviate the impact of thermal errors. Error control method is economical and effective in reducing thermal effects. The compensation model is used to establish a thermal error compensation system to eliminate the impact of thermal errors. Its core is a compensation model with strong robustness and good predictive performance.
[0004] However, due to the different thermal characteristics between different machine tools, after collecting data for modeling on one machine tool, it is necessary to collect data again for modeling on another machine tool. As the number of machine tools increases, the manpower and material resources consumed in collecting data will also increase accordingly. Summary of the invention
[0005] The purpose of the present invention is to provide a machine tool thermal error modeling method based on a time convolutional network and transfer learning. The method introduces an encoder-decoder architecture based on the time convolutional network, reduces redundant data by reducing the dimension of temperature data, reduces computational complexity while ensuring prediction accuracy, and because thermal errors have complex nonlinear patterns and require multi-level feature extraction capabilities, the encoder-decoder architecture can extract deep-level features of the input sequence through a multi-layer network, thereby obtaining higher prediction accuracy. At the same time, combined with transfer learning technology, after a machine tool realizes the required thermal error modeling, only partial data from other machine tools is needed to establish a thermal error model of sufficient accuracy on this machine tool.
[0006] In order to achieve the above objectives, the technical solution adopted by the present invention is: a machine tool thermal error modeling method based on time convolutional network and transfer learning, which comprises the following steps:
[0007] Step 1: From the time the machine tool is turned on to the time it runs for a certain period of time, collect the thermal deformation data of the spindle and the temperature data of various parts of the machine tool at the corresponding time at regular intervals, and then upgrade the temperature and thermal deformation data and organize them into the format required by the model.
[0008] Step 2: Then, a batch of source domain data Xs and target domain data Xt are input into the model framework ED-TCN in sequence. After a series of feature extractions such as encoding and decoding at the TCN layer, a batch of source domain reconstruction sequences are obtained. s and the reconstruction sequence of the target domain t , and at the same time, the source domain features extracted by encoding encoder_features s and target domain features encoder_features t Returns and is called for subsequent loss calculation.
[0009] Step 3: Then calculate the loss:
[0010] 3-1) First, calculate the loss obtained at the fully connected layer. After inputting the reconstructed sequence obtained through the encoding and decoding framework into the fully connected layer, the predicted value can be obtained, and this predicted value is used to calculate the MSE loss value, which is divided into source domain loss mse_loss s , and target domain loss mse_loss t .
[0011] 3-2) Then calculate the reconstruction loss, and calculate the MSE loss of the reconstruction sequence obtained above to get reconstruction_loss s , and reconstruction_loss t .
[0012] 3-3) Finally, perform RSD loss calculation and convert the TCN encoded output encoder_features returned above into s and encoder_features t , perform the representation subspace distance (RSD) loss calculation to get RSD_loss s .
[0013] The five losses are summed up to get the total loss. Through training, updating, and iteration, domain adaptation between the source domain and the target domain is achieved. Finally, an encoding-decoding-temporal convolutional network model that achieves domain adaptation is obtained.
[0014] Step 4: Finally, input the target domain data to be tested for prediction, and then compare it with the true value, calculate the residual, and compare the prediction effect.
[0015] As a further preferred embodiment, the processing temperature data is input into the improved encoding-decoding-temporal convolutional network model for training, which specifically includes:
[0016] (2.1) Input the sorted temperature data into the encoder of the improved encoding-decoding-temporal convolutional network, encode the input data to obtain the encoding vector (including the encoding vector of the source domain data and the encoding vector of the target domain data);
[0017] (2.2) The encoded vector is used as the input of the decoder in the improved encoding-decoding-temporal convolutional network to decode and obtain the reconstructed data (same as above);
[0018] (2.3) Input the reconstructed data into the fully connected layer to obtain the predicted value of thermal deformation;
[0019] (2.4) Based on the reconstruction loss function (2 source domain and target domain) obtained from the temperature data and the reconstructed data after dimensionality increase processing, the prediction value loss function (2) obtained from the predicted value of thermal deformation and the true value of thermal deformation, and the representation subspace distance loss function obtained from the source domain coding vector and the target domain coding vector, repeat steps (2.1), (2.2), and (2.3) until the loss function value is less than the preset value, or the model reaches the preset number of iterations, thereby completing the network training.
[0020] As a further preferred embodiment, the encoding vector is represented by h n,t·f , reconstruct data V n,t·f It is expressed as follows and constructed using the following formula:
[0021] X n,t·f =S(X n,f )
[0022] h n,t·f =σ(X n,t·f )
[0023] V ‘n,t·f =σ′(h n,t·f )
[0024] X n,f is the initial temperature data, n is the number of samples, f is the number of temperature features, t is the number of time steps after division, S is the time step division function, σ is the encoding function, and σ' is the decoding function.
[0025] As a further preference, the improved loss function is represented by L and satisfies the following conditions:
[0026] L1(ytrue ,y pred )=(y true -y pred ) 2
[0027] L2(X n,t·f ,V n,t·f )=(X n,t·f -V ‘n,t·f ) 2
[0028]
[0029]
[0030]
[0031] L=L1+L2+L3
[0032] In the formula, y true is the true error value, y pred is the prediction error value, L1 is the error prediction value loss function, L2 is the reconstruction data loss function, L3 is the subspace distance loss function, σ Θ is the principal axis calculation function between two domains, σ P Weight matrix calculation function.
[0033] In general, the advantages of the present invention are to improve the feature extraction capability of the model, effectively improve the prediction accuracy, and reduce the computational complexity and improve the efficiency while ensuring the prediction accuracy. At the same time, combined with the transfer learning technology, the cost is effectively reduced. The method of the present invention meets the requirements of machine tools in processing plants such as 3C products. After collecting enough data from one machine, only part of the data of the target machine tool needs to be collected to establish a model with sufficient accuracy, which can be spread to hundreds or thousands of machine tools. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A flowchart of a method for modeling thermal errors of machine tools based on a temporal convolutional network and transfer learning provided by an embodiment of the present invention;
[0035] Figure 2 It is a schematic diagram of the arrangement of sensors for temperature data collection of the present invention;
[0036] Figure 3 This is the framework diagram of the encoding and decoding-temporal convolutional network of the present invention;
[0037] Figure 4 One of the prediction diagram and evaluation index table for mutual migration between two machine tools of the present invention;
[0038] Figure 5The second one is the prediction diagram and evaluation index table of mutual migration between two machine tools of the present invention; DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0040] The present invention discloses a method for modeling thermal errors of machine tools based on a temporal convolutional network and transfer learning. The method collects temperature and thermal deformation data of the machine tool during operation, uses an improved encoder-decoder architecture in deep learning theory to extract feature vectors of the data, and then proposes inputting the feature vectors into a fully connected layer to obtain a specific thermal error value. Since the extracted deep features contain a lot of information, and this information does not have a specific physical meaning, the method can accurately predict the thermal error value at the next moment. In order to verify the method, the present invention collects data of various working conditions of actual machine tool operation, and after processing and inputting into this model, the prediction effect is significantly improved.
[0041] The present invention constructs an encoding-decoding network structure, converts input data in a high-dimensional space into encoding vectors in a low-dimensional space through the encoding network, reconstructs the encoding vectors in the low-dimensional space back to the original input data through the decoding network, and uses the encoding features to represent the subspace distance calculation loss. It is possible to use scarce data to establish a model with sufficient accuracy. The method proposed in the present invention can reduce the consumption of experimental data collection on the basis of stably improving the prediction accuracy of the model.
[0042] The method specifically comprises the following steps:
[0043] (1) Data preprocessing, obtaining sample sets
[0044] Arrange multiple temperature sensors on the parts of the machine tool that are susceptible to heat, such as the spindle, lead screw, etc., as well as some locations for measuring the ambient temperature to represent the influence of external heat sources. Collect temperature data of various working conditions during the operation of the machine tool, and use a high-precision scale to measure the thermal deformation of the spindle. At the same time, in order to ensure the accuracy and continuity of the data, collect temperature and thermal deformation data every fixed period of time (4-5 minutes). After the collection is completed, the data is organized into the format required by the model, and the dimensionality is increased. Then, it is input into the model in batches.
[0045] (2) Deep learning regression algorithm pre-training
[0046] In order to make it easier to input each data into the deep learning network for training, the sorted data is input into the encoding-decoding-time convolutional network for training in batches, and the last encoding vector obtained from each training is used as the feature output obtained by adaptive extraction, that is, the temperature data of the first batch is input into the encoding-decoding-time convolutional network for training to output a batch of feature vectors.
[0047] The specific training method is as follows:
[0048] (2.1) Input the sorted temperature data into the encoder of the improved encoding-decoding-temporal convolutional network, encode the input data to obtain the encoding vector (including the encoding vector of the source domain data and the encoding vector of the target domain data);
[0049] (2.2) The encoded vector is used as the input of the decoder in the improved encoding-decoding-temporal convolutional network to decode and obtain the reconstructed data (same as above);
[0050] (2.3) Input the reconstructed data into the fully connected layer to obtain the predicted value of thermal deformation;
[0051] (2.4) Based on the reconstruction loss function (2 source domain and target domain) obtained from the temperature data and the reconstructed data after dimensionality increase, the prediction value loss function (2) obtained from the predicted value of thermal deformation and the true value of thermal deformation, and the representation subspace distance loss function obtained from the source domain encoding vector and the target domain encoding vector, steps (2.1), (2.2), and (2.3) are repeated until the loss function is less than the preset value or the predetermined number of iterations is reached to complete the network training. The preset value can be set according to actual needs. The smaller the value, the higher the similarity between the reconstructed data and the original data. When the number of iterations reaches the upper limit, the training stops automatically. The original signal is transformed by multiple encoding and decoding (step-by-step dimensionality reduction), and the samples are converted from the original space to the new feature space to automatically learn hierarchical features. According to the error (loss function) between the final output and the input, the network parameters are gradually adjusted to minimize the loss function. The number of training times is set to 200 times. The loss function decreases with the increase of training, indicating that the low-dimensional code vector gradually better represents the original high-dimensional vector.
[0052] Among them, the encoding vector is h n,t·f It is expressed as follows and constructed using the following formula:
[0053] h n,t·f =σ(X n,t·f )=s f (W.X n,t·f +b)
[0054] Where σ is the encoding function, X n,t·fis a batch of processed temperature data, n is the number of samples, f is the number of temperature features, and t is the number of time steps after division; s f is the activation function of the encoding network, and W and b are the neural network encoding weights.
[0055] Reconstruct data using V ‘n,t·f It is expressed as follows and constructed using the following formula:
[0056] V ‘n,t·f =σ′(h n,t·f )=s g (W′·X n,t·f +d)
[0057] Where σ′ is the decoding function, s g is the activation function of the decoding network, and W′ and d are the decoding weights of the neural network.
[0058] The modified loss function is represented by L and satisfies the following conditions:
[0059] L1(y true ,y pred )=(y true -y pred ) 2
[0060] L2(X n,t·f ,V n,t·f )=(X n,t·f -V ‘n,t·f ) 2
[0061]
[0062] L=L1+L2+L3
[0063] In the formula, y true is the true error value, y pred is the prediction error value, L1 is the error prediction value loss function, L2 is the reconstruction data loss function, L3 is the subspace distance loss function, σ Θ is the principal axis calculation function between two domains, σ P Weight matrix calculation function.
[0064] (3) Research results
[0065] Based on the above-mentioned summary loss value, it is continuously updated iteratively, and this cycle is repeated until the upper limit of the number of iterations is reached. After the training of the deep learning regression algorithm model is completed, a model with the lowest loss value is obtained, thereby realizing the thermal error value prediction.
[0066] The method of the present invention is described below by taking the prediction of thermal errors of a spindle under various operating conditions of a machine tool as an example.
[0067] like Figure 1 As shown, the specific implementation steps of the embodiment of the present invention are as follows:
[0068] (1) The experimental conditions were set as three working conditions: spindle speeds of 5000r / min, 10000r / min, and 15000r / min for the two machine tools. The experimental arrangement was 4 hours of heating, 2 hours of cooling, 4 hours of heating, and 10 hours of cooling. One experiment lasted 20 hours. Temperature data and spindle thermal deformation data were collected every 5 minutes, for a total of 240 groups. Multiple temperature sensors were placed on the main heat points of the machine tools, and high-precision scales were placed on the workbench. The 480 groups of experimental data from 2 days were allocated 6:4 as training and test data as the input of the deep learning regression model. The layout of the temperature sensors and scales is as follows: Figure 2 .
[0069] (2) Input the processed temperature data into the encoder-decoder-temporal convolutional network for training, such as Figure 3 As shown, the training steps of the encoding and decoding network are as follows:
[0070] Given a preprocessed temperature data sample set {X n,t·f}N, N is the total number of temperature data samples, and the encoding network converts each batch of training samples X into n,t·f Transformed into the encoding vector h n,t·f :
[0071] h n,t·f =σ(X n,t·f )=s f (W.X n,t·f +b)
[0072] In the formula, s f is the activation function of the encoding network; W and b are the neural network encoding weights;
[0073] Then the encoding vector h m,i Through the decoding function σ', it is transformed back to X n,t·f A reconstructed representation of V ‘n,t·f :
[0074] V ‘n,t·f =σ′(h n,t·f )=s g (W′·X n,t·f +d)
[0075] Where σ′ is the decoding function, s g is the activation function of the decoding network, and W′,d is the neural network decoding weight.
[0076] Then calculate the function σ through the mainΘ , weight matrix calculation function σ P . Calculate the principal angle Θ and weight matrix P s ,P t .
[0077]
[0078]
[0079] By minimizing the loss function L = L1(y true ,y pred )+L2(X n,t·f ,V n,t·f )+L3(Θ,P s ,P t ), that is, to repeat encoding and decoding multiple times so that the loss function is less than the preset value or reaches the upper limit of the number of iterations, so as to complete the training of the entire network.
[0080] The L loss function will gradually decrease with the increase of training times. The number of training times can be limited according to actual conditions, such as 200 training times.
[0081] According to the trained model, a new set of unknown temperature data is input into the model to predict the actual thermal deformation value (error value) of the spindle, thereby realizing the prediction of the thermal deformation value of the spindle.
[0082] After training the model with the lowest loss value, use the predicted data to test the model. Figure 4 and Figure 5 The results of the mutual migration of the spindle 5000r / min working conditions between the two machine tools show that the model proposed by this invention has reached the optimal level, and three evaluation indicators are used for evaluation:
[0083] R 2 It is an indicator of goodness of fit, also known as the "coefficient of determination", which indicates the proportion of the variance of the variable that the model can explain. 2 The value of is between 0 and 1, and the closer it is to 1, the better the model fit. 2 The calculation formula is:
[0084]
[0085] The residual sum of squares (RSS) is the sum of the squares of the differences between the actual values and the values predicted by the model.
[0086] The total sum of squares (TSS) is the sum of the squares of the differences between the actual values and the mean of the actual values.
[0087] The root mean square error (RMSE) is a commonly used statistical indicator to measure the difference between the actual value of the model and the predicted value of the model. The calculation formula of RMSE is as follows:
[0088]
[0089] x i is the ith actual value, y i is the i-th predicted value, n is the total number of observed values.
[0090] Mean Absolute Error (MAE), or mean absolute error, represents the average value of the absolute error between the predicted value and the observed value. The calculation formula is as follows:
[0091]
[0092] In summary, after the high-level features of the hot dance are extracted based on the method proposed in the present invention, the encoding vector is output, the sequence is reconstructed, and the input loss is calculated. After the predicted thermal error is analyzed, it is found that the method is of great significance in terms of prediction accuracy and the generalization and stability of the method in application.
[0093] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A machine tool thermal error modeling method based on temporal convolutional network and transfer learning, characterized in that: The steps include: Step 1: Data collection: From the time the machine tool is turned on to the time it runs for a certain period of time, the thermal deformation data of the spindle and the temperature data of various parts of the machine tool at the corresponding time are collected at regular intervals, and then the temperature and thermal deformation data are upgraded and organized into the format required by the model; Step 2: Input a batch of source domain data Xs and target domain data Xt into the model framework ED-TCN in sequence. After a series of feature extractions such as encoding and decoding at the TCN layer, a batch of source domain reconstruction sequences are obtained. s and the reconstruction sequence of the target domain t , and at the same time, the features extracted by encoding encoder_features s and encoder_features t Returns and is called for subsequent loss calculation; Step 3: Calculate the loss of experience: 3-1) Calculate the loss obtained at the fully connected layer. After inputting the reconstructed sequence obtained through the encoding and decoding framework into the fully connected layer, the predicted value can be obtained, and this predicted value is used to calculate the MSE loss value, which is divided into source domain loss mse_loss s , and target domain loss mse_loss t ; 3-2) Then calculate the reconstruction loss, and calculate the MSE loss of the reconstruction sequence obtained above to get reconstruction_loss s , and reconstruction_loss t ; 3-3) Finally, perform RSD loss calculation and convert the TCN encoded output encoder_features returned above into s and encoder_features t , perform the representation subspace distance (RSD) loss calculation to get RSD_loss s ; These five losses are aggregated to obtain the total loss, and domain adaptation between the source domain and the target domain is achieved through training, updating, and iteration; finally, an encoding-decoding-temporal convolutional network model that achieves domain adaptation is obtained. Step 4: Finally, input the target domain data to be tested into the encoding-decoding-temporal convolutional network model for prediction.
2. According to claim 1, a machine tool thermal error modeling method based on temporal convolutional network and transfer learning is characterized in that: The processed temperature data is input into the improved encoding-decoding-temporal convolutional network model, and the training includes: (2.1) Input the sorted temperature data into the encoder of the improved encoding-decoding-temporal convolutional network, and encode the input data to obtain the encoding vector; (2.2) Using the coded vector as the input of the decoder in the improved coding-decoding-temporal convolutional network to decode and obtain reconstructed data; (2.3) Input the reconstructed data into the fully connected layer to obtain the predicted value of thermal deformation; (2.4) Based on the reconstruction loss function obtained by the temperature data after dimensionality increase and the reconstructed data, the prediction value loss function obtained by the predicted value of thermal deformation and the true value of thermal deformation, and the representation subspace distance loss function obtained by the source domain coding vector and the target domain coding vector, steps (2.1), (2.2), and (2.3) are repeated until the loss function value is less than the preset value, or the model reaches the preset number of iterations, thereby completing the network training.
3. According to claim 2, a machine tool thermal error modeling method based on time convolutional network and transfer learning is characterized in that: The encoding vector is denoted by h n,t·f , reconstruct data V n,t·f It is expressed as follows and constructed using the following formula: X n,t·f =S(X n,f ) h n,t·f =σ(X n,t·f ) V' n,t·f =σ′(h n,t·f ) X n,f is the initial temperature data, n is the number of samples, f is the number of temperature features, t is the number of time steps after division, S is the time step division function, σ is the encoding function, and σ' is the decoding function.
4. According to claim 3, a method for modeling machine tool thermal errors based on temporal convolutional networks and transfer learning is characterized in that: The improved loss function is represented by L and satisfies the following conditions: L1(and true ,and pred )=(and true -and pred ) 2 L2(X n,t·f ,V n,t·f )=(X n,t·f -V' n,t·f ) 2 L=L1+L2+L3 In the formula, y true is the true error value, y pred is the prediction error value, L1 is the error prediction value loss function, L2 is the reconstruction data loss function, L3 is the subspace distance loss function, σ Θ is the principal axis calculation function between two domains, σ P Weight matrix calculation function.
Citation Information
Cited By
Machine tool thermal error prediction method based on multi-modal deep learning and domain adaptation
CN120234592A
A machine tool thermal error prediction method based on multimodal deep learning and domain adaptation
CN120234592B
Double-spindle thermal error prediction method fusing expansion convolution and domain self-adaption
CN122110898A
A dual principal axis thermal error prediction method fusing dilated convolution and domain adaptation
CN122110898B