Ball screw thermal deformation prediction method fusing timing characteristics and attention mechanism
By constructing an AT-TCN-based prediction model for ball screw thermal deformation, and utilizing the time attention mechanism and the TCN model, the problems of insufficient accuracy and generalization ability in ball screw thermal deformation prediction are solved, achieving more efficient prediction of ball screw thermal deformation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING INFORMATION SCI & TECH UNIV
- Filing Date
- 2026-04-22
- Publication Date
- 2026-07-21
AI Technical Summary
Existing ball screw thermal deformation prediction modeling methods suffer from insufficient prediction accuracy and generalization ability when dealing with the complex nonlinear relationship between ball screw temperature change and thermal deformation and time-series dynamic characteristics.
A ball screw thermal deformation prediction method that integrates temporal features and attention mechanisms is adopted. An AT-TCN-based model is constructed, which includes a temporal attention module, a temporal convolutional network (TCN), and a fully connected layer. The key historical information is enhanced through the temporal attention mechanism. Combined with causal convolution, dilated convolution, and residual connections, the model's ability to capture long temporal dependent features is improved.
It improves the accuracy and generalization ability of predicting ball screw thermal deformation, and can more comprehensively describe the influence of thermal state and operating state on ball screw thermal deformation. The model structure is clear and the computational efficiency is high, providing an effective data-driven method.
Smart Images

Figure CN122432670A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of deep learning and thermal deformation prediction technology, and in particular to a method for predicting the thermal deformation of ball screws that integrates temporal features and attention mechanisms. Background Technology
[0002] Methods for predicting and modeling the thermal deformation of ball screws mainly include BP neural networks, support vector machines, and radial basis function neural networks. These methods have been applied to some extent in machine tool thermal deformation modeling, but they still suffer from insufficient prediction accuracy and generalization ability when dealing with the complex nonlinear relationship between ball screw temperature changes and thermal deformation, as well as time-series dynamic characteristics. Compared to traditional machine learning algorithms, deep learning algorithms do not require manual feature extraction and can learn and process more complex data patterns through multi-level neural network structures. The core idea of deep learning is to extract high-level features of data through multi-level nonlinear transformations, thereby achieving modeling and analysis of complex data.
[0003] Considering the hysteresis of ball screw thermal deformation, a deep learning algorithm with time series characteristics is used for modeling. Common deep learning models include Recurrent Neural Networks (RNNs), Long Short-Term Memory (LSTMs), and Temporal Convolutional Networks (TCNs). RNNs are prone to gradient explosion and vanishing gradient problems when processing long sequences of contact thermal resistance data, preventing the network model from converging. Furthermore, the calculation of contact thermal resistance by RNNs is serial, making parallel computation impossible and resulting in low computational efficiency when processing long sequences. LSTMs also calculate contact thermal resistance serially, making parallel computation impossible and thus resulting in low computational efficiency when processing long sequences. When processing very long time-series contact thermal resistance data, LSTMs may experience gradient vanishing or exploding problems. Compared to RNNs and LSTMs, TCNs combine causal convolutions and dilated convolutions, enabling them to capture input sequences of arbitrary length. TCNs utilize convolution operations, allowing for parallel computation and thus high computational efficiency when processing long sequences. They can capture long-term dependencies, and compared to recurrent networks, TCNs can alleviate gradient problems in long sequence training to some extent. Furthermore, TCNs are insensitive to the length of the input sequence, allowing them to handle time-series data of varying lengths. Summary of the Invention
[0004] The purpose of this invention is to address the problem that existing ball screw thermal deformation prediction modeling methods still suffer from insufficient prediction accuracy and generalization ability when dealing with the complex nonlinear relationship between ball screw temperature change and thermal deformation, as well as time-series dynamic characteristics.
[0005] To achieve the above objectives, this invention provides a method for predicting the thermal deformation of ball screws by integrating temporal features and an attention mechanism, comprising the following steps: S1. Model Construction: Construct a ball screw thermal deformation prediction model based on AT-TCN, including a temporal attention module, a temporal convolutional network (TCN), and a fully connected layer. S2. Model Training: Using the measured thermal deformation as supervision information, the network parameters of the ball screw thermal deformation prediction model are updated by minimizing the error between the predicted value and the true value, so as to obtain the trained ball screw thermal deformation prediction model. S3. Input Data and Preprocessing: The model input variables are the support bearing temperature, etc. Motor end bearing temperature Nut temperature Feed rate and load The original experimental data were constructed using a sliding time window method, combining temperature, feed rate, and load information from multiple consecutive time points into a multivariate time-series input sample. S4. Prediction and Output: The trained ball screw thermal deformation prediction model first uses a time attention module to weight different time steps within the historical time window for the input sample; then, the weighted sequence is input into the TCN, which completes long-term dependent feature extraction and high-level temporal representation learning; finally, the thermal deformation prediction value at the corresponding time is output through a fully connected layer.
[0006] Furthermore, in step S1, the time attention module employs a time attention mechanism, specifically as follows: The input sequence is: ; In the formula, The length of the historical time window; For the first The feature vector input at each time step; The temporal attention mechanism first calculates the importance of the input at each time step, then normalizes it to obtain the corresponding attention weights, and uses these weights to weight the original input sequence, thereby forming a feature representation that better reflects key historical information; The importance score for each time step is represented as follows: ; In the formula, No. The importance of each moment to the current prediction task For vector transpose, , , These are trainable parameters; The scores are normalized using the Softmax function to obtain the attention weights: ; In the formula, For the first The attention coefficient corresponding to each moment.
[0007] Furthermore, in step S1, the temporal convolutional network consists of three parts: causal convolution, dilated convolution, and residual connections. The causal convolution: TCN ensures that the current output depends only on the current and past input sequences by limiting the receptive field of the convolution; The dilated convolution: introducing dilated convolution into causal convolution to increase the receptive field, thus constructing a dilated causal convolution; The residual connection: Based on the dilated causal convolution, residual connections, weight normalization, and dropout are introduced to parameterize the weights.
[0008] Furthermore, the causal convolution specifically refers to: TCN ensures that the current output depends only on the current and past input sequences by limiting the receptive field of the convolution. The output value at any given time depends only on the current time step and the previous time steps. It does not depend on future time steps, and the formula is as follows: ; In the formula, Output is for axial thermal deformation. For the first Temperature input signal at each time step The kernel size is [size]. For the first Each convolution weight.
[0009] Furthermore, the dilated convolution specifically refers to: To construct an expanded causal convolution model, dilated convolution is introduced into causal convolution to increase the receptive field; in a length of time series Expansion rate In this context, the formula for dilated convolution is: ; In the formula, The dilation factor controls the time interval spanned by the convolution. for The data accumulated up to a given time step; the formula for calculating the receptive field of the expanded convolutional model is as follows: ; In the formula, The number of layers in the network. It is the basic expansion factor.
[0010] Furthermore, the dilation factor is increased in the dilated convolution to improve the computational efficiency of the model; when constructing the dilated causal convolution model, the size of the dilation factor for each layer is set to be the exponential size of the base dilation factor.
[0011] Furthermore, the residual connection specifically refers to: Based on the dilated causal convolution model, residual connections, weight normalization, and dropout are introduced to parameterize the weights. Weight normalization reparameterizes the weights, and dropout suppresses overfitting. Each convolution uses a residual structure, and its output expression is as follows: ; In the formula, It is a linear rectified function. For module output, For input signal, This represents the nonlinear mapping of the convolutional block.
[0012] Furthermore, in step S2, the loss function used for model training is the mean squared error, expressed as: ; In the formula, The number of training samples, This represents the actual thermal deformation value. These are the model's predicted values.
[0013] Furthermore, the ball screw thermal deformation prediction model uses a convolution kernel size of 3 and a network depth of 4 as structural parameters, with a receptive field of 32.
[0014] This invention employs the aforementioned method for predicting the thermal deformation of ball screws by integrating temporal features and an attention mechanism, and its beneficial effects are as follows: (1) The present invention simultaneously introduces three-point temperature, feed rate and load signals to make the input information more complete and enable the model to more comprehensively describe the combined influence of thermal state and operating state on the thermal deformation evolution of ball screw. (2) This invention utilizes the time attention mechanism to enhance key historical moment information and improve the model's ability to identify the dynamic evolution process of ball screw thermal deformation; it also uses TCN to extract long-term time-dependent features to enhance the model's ability to express complex nonlinear relationships. (3) The AT-TCN ball screw thermal deformation prediction model of the present invention has a clear structure and high computational efficiency, and can provide an effective data-driven method for predicting ball screw thermal deformation. Attached Figure Description
[0015] Figure 1 This is a flowchart of a ball screw thermal deformation prediction method that integrates temporal features and attention mechanism according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the time attention mechanism of a ball screw thermal deformation prediction method that integrates temporal features and attention mechanism according to an embodiment of the present invention. Figure 3 This is a causal convolution structure diagram of a ball screw thermal deformation prediction method that integrates temporal features and attention mechanism according to an embodiment of the present invention. Figure 4 This is an expanded causal convolution structure diagram of a ball screw thermal deformation prediction method that integrates temporal features and attention mechanism according to an embodiment of the present invention. Figure 5 These are the results of Experiment 1 (no load, constant feed rate 100 mm / s) of the present invention; where (a) is the temperature change and (b) is the axial thermal deformation of the ball screw. Figure 6 These are the results of Experiment 2 (no load, constant feed rate 120 mm / s) of the present invention; where (a) is the temperature change and (b) is the axial thermal deformation of the ball screw. Figure 7 The results are from Experiment 3 (load 150N, constant feed rate 90mm / s) of this invention; where (a) is the temperature change and (b) is the axial thermal deformation of the ball screw. Figure 8 The results are from Experiment 4 of this invention (load 0 / 100 / 200 / 300N, feed speed 90 / 100 / 110 / 120mm / s, 30min for each condition); where (a) is the temperature change and (b) is the axial thermal deformation of the ball screw. Figure 9 The results are from Experiment 5 of this invention (load 150 / 200 / 100 / 120N, feed speed 110 / 90 / 130 / 100mm / s, 30min for each condition); where (a) is the temperature change and (b) is the axial thermal deformation of the ball screw. Figure 10 This is a comparison curve of the three models LSTM, TCN, and AT-TCN in this invention embodiment; Figure 11 This is a scatter plot of the residuals of the LSTM model in an embodiment of the present invention; Figure 12 This is a scatter plot of the residuals of the TCN model in an embodiment of the present invention; Figure 13 This is a scatter plot of the residuals of the AT-TCN model according to an embodiment of the present invention; Figure 14 This is a partial enlarged view of the operating condition change segment in an embodiment of the present invention; Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments and the accompanying drawings. It should be understood that these descriptions are merely exemplary and not intended to limit the scope of the invention. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concept of the invention.
[0017] Example 1, such as Figure 1 As shown, the present invention provides a method for predicting the thermal deformation of ball screws by integrating temporal features and attention mechanisms, comprising the following steps: S1. Model Construction: Construct a ball screw thermal deformation prediction model based on AT-TCN, including a temporal attention module, a temporal convolutional network (TCN), and a fully connected layer. S11. The time attention module adopts the time attention mechanism (AT), specifically: The basic idea of attention mechanisms is to selectively focus on input information. That is, during information processing, different features or time steps contribute differently to the current task, and the model should be able to automatically learn the importance of each part of the information and assign it different weights. For time series prediction problems, the impact of different moments in the historical sequence on the current output usually varies significantly. Certain key moments, such as moments of state abrupt change, moments of external stimulus change, or moments of rapid response growth, often contain more valuable information; while data from some stationary phases contribute relatively little to the current prediction. Therefore, introducing a temporal attention mechanism into time series modeling helps to highlight key historical information and improve the model's ability to represent dynamic temporal features.
[0018] The time attention mechanism primarily addresses the importance allocation problem at different time steps within a historical time window; the input sequence is: ; In the formula, The length of the historical time window; For the first The feature vector input at each time step; The temporal attention mechanism first calculates the importance of the input at each time step, then normalizes it to obtain the corresponding attention weights, and uses these weights to weight the original input sequence, thereby forming a feature representation that better reflects key historical information; The importance score for each time step is represented as follows: ; In the formula, No. The importance of each moment to the current prediction task For vector transpose, , , These are trainable parameters; The scores are normalized using the Softmax function to obtain the attention weights: ; In the formula, For the first Attention coefficient at each moment; A larger attention weight indicates a more significant impact on the current output at that corresponding moment. A schematic diagram of the temporal attention mechanism is shown below. Figure 2 As shown.
[0019] S12, Temporal Convolutional Network (TCN): Temporal Convolutional Networks (TCNs) are a class of deep learning models designed for sequence modeling. They rapidly expand the receptive field while maintaining causality through dilated convolutions, thus leveraging the advantages of parallel computing to handle both short- and long-term dependencies. By stacking multiple convolutional layers and non-linear activation functions, they can learn features at different time scales, thereby better capturing long-term dependencies in time-series data. Compared to recurrent networks, TCNs exhibit longer effective memory and more stable gradient propagation capabilities across various sequence tasks, making them a good starting point model for general sequence tasks. Their structure consists of three parts: causal convolution, dilated convolution, and residual blocks.
[0020] (1) Causal convolution: It is a convolution operation, commonly used to process time series data. The structure diagram is as follows: Figure 3 As shown.
[0021] TCN ensures that the current output depends only on the current and past input sequences by limiting the receptive field of the convolution; The output value at any given time depends only on the current time step and the previous time steps. It does not depend on future time steps, and the formula is as follows: ; In the formula, Output is for axial thermal deformation. For the first Temperature input signal at each time step The kernel size is [size]. For the first Each convolution weight.
[0022] (2) Dilated convolution: To capture long-term temporal dependencies and further increase the receptive field, more network layers are needed. However, multiple network layers often cause problems such as gradient explosion, leading to model convergence failure. To address this issue, dilated convolution is introduced into causal convolution to increase the receptive field. A dilation factor is introduced to control the convolutional interval, thereby increasing the model's receptive field and constructing a dilated causal convolution model. time series Expansion rate In this context, the formula for dilated convolution is: ; In the formula, The dilation factor controls the time interval spanned by the convolution. When the number of convolutional layers increases exponentially, the model can model thermal processes over longer time scales with fewer convolutional layers, thereby improving its ability to capture the evolution trend of thermal deformation of ball screws. for Data accumulated up to a given time point; The formula for calculating the receptive field of the expanded convolutional model is as follows: ; In the formula, The number of layers in the network. It is the basic expansion factor.
[0023] The receptive field of a model can be expanded by increasing the number of network layers, increasing the number of convolutional kernels, and increasing the dilation rate. To reduce data computation complexity and improve computational efficiency, this embodiment uses an increased dilation factor to enhance model computational efficiency. A schematic diagram of the dilated causal convolutional structure is shown below. Figure 4 As shown.
[0024] When constructing a dilated causal convolution model, each layer is set with a dilation factor that is the exponential size of the base dilation factor; when the convolution kernel... =2, basic expansion factor =2, when the number of network layers is 4, the receptive field of the model convolution is 8. Compared with the causal convolution structure, the receptive field of the expanded causal convolution doubles.
[0025] (3) Residual connection: Building upon the dilated causal convolutional model, to avoid gradient degradation and vanishing issues, residual connections, Weight Normalization, and Dropout are introduced to parameterize the weights. Weight Normalization reparameterizes the weights, improving network training stability and convergence efficiency. Dropout suppresses overfitting and enhances model generalization. Each convolution employs a residual structure, with the output expression as follows: ; In the formula, It is a linear rectified function. For module output, For input signal, This represents the nonlinear mapping of the convolutional block.
[0026] S2. Model Training: Using the measured thermal deformation as supervision information, the network parameters of the ball screw thermal deformation prediction model are updated by minimizing the error between the predicted value and the true value, thus obtaining the trained ball screw thermal deformation prediction model. The loss function used for model training is the mean squared error, and its expression is: ; In the formula, The number of training samples, This represents the actual thermal deformation value. These are the model's predicted values.
[0027] Choosing the number of convolutional kernels and the network depth: In predictive models, kernel size and network depth are crucial structural parameters affecting model performance. Kernel size determines the receptive range of a single convolutional layer for local temporal features, while network depth directly impacts the model's receptive field size and its ability to extract higher-level temporal features. For ball screw thermal deformation prediction models, it is necessary to capture the short-term variations of input variables such as temperature, feed rate, and load, as well as characterize the long-term dependencies in the thermal state evolution process. Therefore, it is essential to rationally select kernel size and network depth to balance prediction accuracy and model complexity.
[0028] This embodiment uses a stepwise comparative analysis method to determine the model structure parameters. First, while keeping other training parameters consistent, the predictive performance of the model under different convolutional kernel sizes is compared to analyze the impact of changes in convolutional kernel size on the prediction results of ball screw thermal deformation. Based on this, the convolutional kernel size is further fixed, and the predictive ability of the model under different network depths is analyzed. To ensure the comparability of experimental results with different numbers of convolutional kernels, the Adam optimizer is used for training with a learning rate of 0.001, a batch size of 32, a Dropout inactivation rate of 0.1, and 32 convolutional kernels, with the dilation coefficient increasing exponentially by 2. Each experiment is iterated 2000 times. The mean squared error (MSE) and mean absolute error (MAE) are selected as model evaluation metrics to characterize prediction accuracy, while the number of model parameters (Params) and floating-point operations (FLOPs) are used to measure model complexity. The experimental results are shown in Tables 1, 2, and 3. The kernel size is [size]. For network depth.
[0029] Table 1 Experimental results of convolutional neural networks k =2
[0030] Table 2 Experimental Results of Convolutional Neural Networks k =3
[0031] Table 3 Experimental Results of Convolutional Neural Networks k =5
[0032] As shown in Tables 1, 2, and 3, the prediction error of the model generally decreases with increasing network depth. However, after the network depth reaches a certain level, the performance improvement gradually weakens, while the model complexity continues to rise. Meanwhile, when the kernel size increases from 2 to 3, the prediction accuracy of the model improves significantly. When the kernel size continues to increase from 3 to 5, although the error decreases further, the improvement is limited, while the number of parameters and computational cost increases rapidly. This indicates that excessively large kernels and excessively deep networks do not bring performance gains commensurate with the increase in complexity. Considering prediction accuracy, parameter size, and computational complexity, a kernel size of 3 and a network depth of 4 are ultimately selected as the optimal structural parameters for the time-attention-TCN ball screw thermal deformation prediction model, with a receptive field of 32.
[0033] S3. Input Data and Preprocessing: The model input variables are the support bearing temperature, etc. Motor end bearing temperature Nut temperature Feed rate and load Among them, three temperature points are used to characterize the thermal state of key parts of the ball screw, while feed rate and load are used to reflect the system operating conditions. Compared with the method of modeling using only temperature variables, this paper further introduces operating condition information, enabling the model to more comprehensively describe the combined influence of thermal state and operating state on the thermal deformation evolution of the ball screw.
[0034] To fully utilize the dynamic characteristics of ball screw thermal deformation over time, a sliding time window method is used to construct samples from the original experimental data, combining temperature, feed rate, and load information from multiple consecutive moments into a multivariate time-series input sample.
[0035] S4. Prediction and Output: The trained ball screw thermal deformation prediction model first uses a time attention module to weight different time steps within the historical time window; then, the weighted sequence is input into the TCN, which performs long-term dependent feature extraction and high-level temporal representation learning; finally, the thermal deformation prediction value at the corresponding time is output through a fully connected layer, thereby establishing a nonlinear mapping relationship between the input variables and the ball screw thermal deformation.
[0036] Example 2: Verification of the ball screw thermal deformation prediction model.
[0037] 1. Ball screw thermal deformation experiment: To obtain the time-series data of thermal deformation of ball screws under different operating conditions, this paper conducts thermal deformation experiments using a ball screw feed system thermal deformation test bench. Temperature sensors were placed at the support end bearing, motor end bearing, and nut position to collect temperature changes; an eddy current displacement sensor was placed at the axial support end of the screw to collect axial deformation data. Considering that the formation of ball screw thermal deformation is affected by the accumulation of thermal state, operating speed, and load, a total of 5 sets of ball screw thermal deformation experiments were designed, and the specific experimental schemes are shown in Table 4.
[0038] Table 4. Heat Deformation Experiment
[0039] Experiments 1 and 2 were conducted at a constant feed rate under no-load conditions to obtain the temperature rise and thermal deformation characteristics of the ball screw feed system at different feed rates. Experiment 3 introduced a constant load at a constant feed rate to analyze the impact of the constant load on the thermal deformation evolution process of the ball screw. Experiment 4 enhanced the sample's coverage of complex operating conditions by changing the feed rate and load. Experiment 5 served as validation data to verify the model's predictive and generalization abilities under unseen operating conditions. The experimental results of the ball screw thermal deformation are as follows: Figure 5-9 As shown.
[0040] 2. Temperature data processing and model evaluation metrics: Based on temperature and deformation data collected from ball screw thermal deformation experiments, a multivariate time-series dataset was constructed for training and testing the ball screw thermal deformation model. Since the thermal deformation of the ball screw exhibits significant time correlation and dynamic lag characteristics, modeling using only data from a single moment is insufficient to fully characterize the impact of changes in the screw's thermal state on the current moment's thermal deformation. Therefore, a sliding time window approach was adopted to process the temperature and deformation data, combining the input variables from multiple consecutive moments into a single sample.
[0041] Let the first The input vector at each time step is: ; In the formula, To support the bearing temperature, This refers to the temperature of the motor end bearing. For nut temperature, For feed rate, For load.
[0042] In terms of length If the historical time window is used to construct the input sample, then the first... A sample can be represented as: ; The corresponding output is the deformation at that moment, expressed as: ; In the formula, For the first Measured values of thermal deformation at each moment.
[0043] Data from Experiments 1 through 4 were used for model training and testing. Experiment 5 served as an independent validation test, verifying the model's predictive ability under unseen speed-load conditions. The training data was further divided into training and validation sets in chronological order. The training set was used for model parameter learning, while the validation set was used for parameter adjustment and convergence determination during model training. The test set was not used for model training and was only used for final performance comparison and evaluation.
[0044] This embodiment selects Long Short-Term Memory (LSTM) and Temporal Convolutional Network (TCN) as comparison objects. All three models use the same dataset and training conditions. To quantitatively evaluate the predictive performance of different models, root mean square error, mean absolute error, and coefficient of determination are selected as evaluation metrics. The definitions of each metric are as follows: ; ; ; In the formula, For the sample size, For the true value, For predicted values, This represents the average of the true values.
[0045] 3. Validation of the ball screw thermal deformation prediction model: To verify the effectiveness of the established ball screw thermal deformation prediction model in predicting ball screw thermal deformation, three models, LSTM, TCN, and AT-TCN, were selected for comparative analysis. Figure 10 The curves show the comparison between the predicted and actual values for the three models. Figure 10 It can be seen that all three models can reflect the overall trend of ball screw thermal deformation over time to a certain extent, but there are significant differences in fitting accuracy in local areas, especially in the segment where the operating conditions change. LSTM can describe the overall evolution of thermal deformation, but there are still some deviations from the true values in segments where thermal deformation increases rapidly and local changes are more obvious. The TCN model is better than LSTM in tracking the overall trend, indicating that TCN has a better ability to extract long-term dependent features in the ball screw thermal deformation sequence; while the AT-TCN model of this invention has the closest prediction curve to the true value, showing good fitting ability in both the thermal deformation growth stage and the later stabilization stage, indicating that after introducing the attention mechanism, the model makes fuller use of key historical information.
[0046] To further compare the error distributions of different models, Figure 11 , Figure 12 , Figure 13 Scatter plots of the residuals for LSTM, TCN, and AT-TCN are presented respectively. It can be seen that the LSTM model has the largest residual distribution range and strong dispersion, indicating that its prediction results fluctuate significantly and there are obvious biases in local segments. The TCN residual distribution is more concentrated than that of LSTM, indicating that the model's prediction stability is improved. The AT-TCN residuals are mostly distributed near zero, with the smallest overall fluctuation range, indicating that its predicted values have the highest consistency with the actual values. Especially in local segments after the change of operating conditions, the AT-TCN residuals can still maintain a small amplitude, indicating that the attention mechanism can enhance the model's ability to identify key historical moments, thereby improving the local tracking effect of ball screw thermal deformation prediction.
[0047] Figure 14 The results of a local magnified view of the operating condition switching section around 30 minutes are presented. It can be seen that the LSTM model is generally over-predicted in this section, exhibiting some over-prediction; the TCN model is under-predicted in the early stages of the change, showing local tracking lag; in contrast, the AT-TCN model's prediction curve is closer to the true value, and it shows better local fitting ability in the change stage after the operating condition switch, indicating that the attention mechanism can effectively enhance the model's ability to extract key historical information.
[0048] Table 5 Evaluation Indicators for Three Models
[0049] Table 5 lists the quantitative evaluation results of the three models. As can be seen from the table, AT-TCN achieves the best results in RMSE, MAE, and maximum absolute error, at 0.82, 0.65, and 1.4 μm, respectively; TCN is second, and LSTM is relatively poor. Specifically, compared to TCN, AT-TCN reduces RMSE from 1.074 to 0.821, MAE from 0.85 to 0.65, and the maximum absolute error from 2.1 μm to 1.4 μm, indicating that the introduction of a temporal attention mechanism on top of TCN further improves the model's prediction accuracy. At the same time, TCN also shows a smaller prediction error than LSTM, indicating that the convolutional temporal modeling method is more advantageous than traditional recurrent neural networks in predicting the thermal deformation of ball screws.
[0050] Based on the comprehensive prediction curves, residual distribution, and evaluation index results, LSTM can achieve basic prediction of ball screw thermal deformation sequences, but its local fitting ability and error control level are relatively limited. TCN enhances the extraction ability of temporal features through dilated causal convolution, and outperforms LSTM in overall prediction performance. Furthermore, AT-TCN utilizes an attention mechanism to strengthen the learning of key historical moment information, thus achieving better results in overall trend fitting, local dynamic response, and error control. Therefore, the AT-TCN model established in this invention has good effectiveness and applicability in predicting ball screw thermal deformation.
[0051] Therefore, this invention employs the aforementioned method for predicting ball screw thermal deformation by integrating temporal features and an attention mechanism. It simultaneously introduces three-point temperature, feed rate, and load signals to make the input information more complete, enabling the model to more comprehensively describe the combined influence of thermal and operational states on the evolution of ball screw thermal deformation. The temporal attention mechanism is used to enhance key historical moment information, improving the model's ability to identify the dynamic evolution of ball screw thermal deformation. Furthermore, long-term temporal dependency features are extracted through TCN, enhancing the model's ability to express complex nonlinear relationships. The AT-TCN ball screw thermal deformation prediction model has a clear structure and high computational efficiency, providing an effective data-driven method for predicting ball screw thermal deformation.
[0052] It is worth noting that all contents not described in detail in this invention are existing technologies and are well known to those skilled in the art.
[0053] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for predicting the thermal deformation of ball screws by integrating temporal features and attention mechanisms, characterized in that, Includes the following steps: S1. Model Construction: Construct a ball screw thermal deformation prediction model based on AT-TCN, including a temporal attention module, a temporal convolutional network (TCN), and a fully connected layer. S2. Model Training: Using the measured thermal deformation as supervision information, the network parameters of the ball screw thermal deformation prediction model are updated by minimizing the error between the predicted value and the true value, so as to obtain the trained ball screw thermal deformation prediction model. S3. Input Data and Preprocessing: The model input variables are the support bearing temperature, etc. Motor end bearing temperature Nut temperature Feed rate and load The original experimental data were constructed using a sliding time window method, combining temperature, feed rate, and load information from multiple consecutive time points into a multivariate time-series input sample. S4. Prediction and Output: The trained ball screw thermal deformation prediction model first uses a time attention module to weight different time steps within the historical time window for the input sample; then, the weighted sequence is input into the TCN, which completes long-term dependent feature extraction and high-level temporal representation learning; finally, the thermal deformation prediction value at the corresponding time is output through a fully connected layer.
2. The method for predicting the thermal deformation of ball screws by fusing temporal features and attention mechanisms according to claim 1, characterized in that, In step S1, the time attention module employs a time attention mechanism, specifically as follows: The input sequence is: ; In the formula, The length of the historical time window; For the first The feature vector input at each time step; The temporal attention mechanism first calculates the importance of the input at each time step, then normalizes it to obtain the corresponding attention weights, and uses these weights to weight the original input sequence, thereby forming a feature representation that better reflects key historical information; The importance score for each time step is represented as follows: ; In the formula, No. The importance of each moment to the current prediction task For vector transpose, , , These are trainable parameters; The scores are normalized using the Softmax function to obtain the attention weights: ; In the formula, For the first The attention coefficient corresponding to each moment.
3. The method for predicting the thermal deformation of ball screws by fusing temporal features and attention mechanisms according to claim 1, characterized in that, In step S1, the temporal convolutional network consists of three parts: causal convolution, dilated convolution, and residual connections. The causal convolution: TCN ensures that the current output depends only on the current and past input sequences by limiting the receptive field of the convolution; The dilated convolution: introducing dilated convolution into causal convolution to increase the receptive field, thus constructing a dilated causal convolution; The residual connection: Based on the dilated causal convolution, residual connections, weight normalization, and dropout are introduced to parameterize the weights.
4. The method for predicting the thermal deformation of ball screws by fusing temporal features and attention mechanisms according to claim 3, characterized in that, The causal convolution specifically refers to: TCN ensures that the current output depends only on the current and past input sequences by limiting the receptive field of the convolution. The output value at any given time depends only on the current time step and the previous time steps. It does not depend on future time steps, and the formula is as follows: ; In the formula, Output is for axial thermal deformation. For the first Temperature input signal at each time step The kernel size is [size]. For the first Each convolution weight.
5. The method for predicting the thermal deformation of ball screws by fusing temporal features and attention mechanisms according to claim 4, characterized in that, The dilated convolution specifically refers to: To construct an expanded causal convolution model, dilated convolution is introduced into causal convolution to increase the receptive field; in a length of time series Expansion rate In this context, the formula for dilated convolution is: ; In the formula, The dilation factor controls the time interval spanned by the convolution. for The data accumulated up to a given time step; the formula for calculating the receptive field of the expanded convolutional model is as follows: ; In the formula, The number of layers in the network. It is the basic expansion factor.
6. The method for predicting the thermal deformation of ball screws by fusing temporal features and attention mechanisms according to claim 5, characterized in that, In the dilated convolution, the dilation factor is increased to improve the computational efficiency of the model; when constructing the dilated causal convolution model, the size of the dilation factor for each layer is set to be the exponential size of the base dilation factor.
7. The method for predicting the thermal deformation of ball screws by fusing temporal features and attention mechanisms according to claim 5, characterized in that, The residual connection is specifically as follows: Based on the dilated causal convolution model, residual connections, weight normalization, and dropout are introduced to parameterize the weights. Weight normalization reparameterizes the weights, and dropout suppresses overfitting. Each convolution uses a residual structure, and its output expression is as follows: ; In the formula, It is a linear rectified function. For module output, For input signal, This represents the nonlinear mapping of the convolutional block.
8. The method for predicting the thermal deformation of ball screws by fusing temporal features and attention mechanisms according to claim 1, characterized in that, In step S2, the loss function used for model training is mean squared error, expressed as: ; In the formula, The number of training samples, This represents the actual thermal deformation value. These are the model's predicted values.
9. The method for predicting the thermal deformation of ball screws by fusing temporal features and attention mechanisms according to claim 1, characterized in that, The ball screw thermal deformation prediction model uses a convolution kernel size of 3 and a network depth of 4 as structural parameters, with a receptive field of 32.