Motorized spindle thermal error prediction method and device considering temperature lag phenomenon
By constructing an electrical spindle thermal error prediction model that considers the temperature hysteresis phenomenon, the problem of insufficient robustness and accuracy in the prior art is solved, and more accurate and flexible thermal error prediction is achieved.
Patent Information
- Application Number
- CN202510316535.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-18
- Publication Date
- 2025-04-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing thermal error prediction methods for electric spindles have shortcomings in terms of robustness and prediction accuracy, especially in the fact that the temperature hysteresis phenomenon and the variable working state of the electric spindle are not fully considered.
A thermal error prediction method for the electric spindle considering the temperature hysteresis is adopted. By collecting the temperature and thermal error timing data at different speeds and states of the electric spindle, a spindle state classifier, temperature prediction model and temperature-thermal error model are constructed, and integrated into the thermal error prediction model of the electric spindle. The model uses support vector machine, expanded causal convolution layer and GRU-Transformer technologies to extract the characteristic relationship between temperature and thermal error time series to perform accurate thermal error prediction.
The accuracy and robustness of thermal error modeling of electric spindles is improved, and the temperature hysteresis phenomenon and the working state of the electric spindle can be more effectively considered, thereby improving the accuracy of thermal error prediction.
Smart Images

Figure CN119862789A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of thermal error analysis of precision high-speed electric spindles, and in particular relates to a method and a device for predicting thermal errors of electric spindles taking temperature hysteresis into consideration. Background Art
[0002] As a new generation of manufacturing core unit, the electric spindle has a "zero transmission" feature that makes it more efficient and accurate, but its compact and complex structure also makes its errors have a greater impact on processing. Studies have shown that thermal errors account for 40%-70% of the errors generated by the electric spindle structure. Therefore, in order to ensure processing accuracy, the impact of thermal errors must be reduced as much as possible.
[0003] The most effective and economical way to reduce thermal error is to perform thermal error compensation on the electric spindle. Thermal error compensation is to correct the thermal error by adjusting the position of the tool or workpiece. The accuracy of thermal error modeling determines the accuracy of thermal error compensation. In existing research, methods including least squares method, multivariate regression model, support vector machine, neural network model, etc. have been used for thermal error modeling, but the existing methods still have much room for improvement in robustness and accuracy.
[0004] A Chinese patent document with publication number CN116900792A discloses a method and device for thermal error compensation of a spindle in machine tool processing, wherein the method includes: obtaining the spindle speed and thermal elongation of the electric spindle of a CNC machine tool at the same time, and obtaining the thermal error data of the electric spindle at the same time based on the spindle speed and the current thermal elongation at the same time; establishing a spindle thermal error prediction model for the CNC machine tool using multiple groups of spindle speed and thermal error data at a preset time; obtaining a spindle thermal error compensation value using the prediction result output by the spindle thermal error prediction model, and performing error compensation based on the spindle thermal error compensation value.
[0005] A Chinese patent document with publication number CN118350271A discloses a method for modeling thermal errors of electric spindles, including: building an electric spindle temperature rise-deformation data test platform, testing the temperature data of the electric spindle at different speeds, and obtaining a training set and a test set based on the test data; establishing a BiLSTM neural network model, using a hybrid strategy to improve the traditional whale optimization algorithm, and setting the position of the whale population as a hyperparameter of the model; inputting the temperature data obtained from the test into the model, and using the root mean square error of the model as the fitness value of the improved whale optimization algorithm; searching for the whale position through the improved whale optimization algorithm to obtain the optimal hyperparameters; building a model with the optimal hyperparameters, training the model with the training set, and testing the model with the test set.
[0006] One factor that has a great impact on robustness and accuracy is the hysteresis of temperature, that is, the heat-generating components of the electric spindle are mainly the built-in motor and bearings, which are all inside the electric spindle, and it takes a certain amount of time for the heat generated by them to be transferred to the outer shell of the electric spindle. In addition, the variability of the working state of the electric spindle also increases the difficulty of thermal error modeling of the electric spindle.
[0007] Therefore, when modeling the thermal error of the electric spindle, it is necessary to fully consider the working state of the electric spindle and the hysteresis of the temperature, and effectively predict the temperature. Only on this basis can a more accurate thermal error model be obtained. Summary of the invention
[0008] The present invention provides a method and device for predicting thermal errors of an electric spindle taking temperature hysteresis into consideration, which can solve the problems of insufficient robustness of the model and insufficient prediction accuracy in existing prediction methods.
[0009] A method for predicting thermal errors of an electric spindle taking into account temperature hysteresis phenomena comprises the following steps: (1) Collect the temperature time series data, thermal error time series data and corresponding electric spindle state data at different speeds and different states of the electric spindle to form a training set; (2) Construct a spindle state classifier. The input of the spindle state classifier is the temperature time series data, and the output is the probability of the spindle rotation state. and the probability of the spindle stopping state ; (3) Construct a spindle temperature prediction model. The spindle temperature prediction model is divided into a spindle rotation state temperature measurement sub-model and a spindle stop state temperature measurement sub-model according to the state of the electric spindle. The input of the two temperature measurement sub-models is the temperature time series data, and the output is the predicted temperature sequence of the next time period; (4) Constructing a spindle temperature-thermal error model. The input of the spindle temperature-thermal error model is the final predicted temperature sequence obtained according to the spindle state classifier and the spindle temperature prediction model, and the output is the predicted thermal error. (5) Using the training set, the spindle state classifier, the spindle temperature prediction model, and the spindle temperature-thermal error model are trained, and the three trained models are integrated into the electric spindle thermal error prediction model; (6) During the application process, the temperature time series data is collected and input into the electric spindle thermal error prediction model to obtain the predicted thermal error.
[0010] In step (1), temperature time series data and thermal error time series data are collected at a frequency of 1 Hz.
[0011] In step (2), support vector machine (SVM) is used to construct a spindle state classifier. The results of SVM are introduced into the Platscaling method to output the probabilities of the two working states of the spindle, which are: the probability of the spindle rotation state and the probability of the spindle stopping state .
[0012] In step (3), each temperature measurement sub-model includes several residual blocks, each residual block includes two dilated causal convolution layers, two weight normalization layers, two ReLU activation function layers, two random dropout layers and a residual connection layer; in each temperature measurement sub-model, each weight vector is first normalized, and then processed using the nonlinear activation function ReLU and Dropout regularization. At the same time, a residual connection is added between every two dilated causal convolution layers, and a 1×1 convolution is used to add the residuals at each time step to ensure that the input and output dimensions are equal.
[0013] In step (4), a GRU-Transformer is used to construct a spindle temperature-thermal error model, including a GRU encoder module, a Transformer encoder module, and a thermal error decoding prediction module; The Transformer encoder module contains several Transformer encoding units, each of which includes a multi-head attention layer, a feed-forward fully connected layer, two normalization layers, and two residual connections; The thermal error decoding prediction module contains several Transformer decoding units, a fully connected layer and a normalization layer. Each Transformer decoding unit includes two multi-head attention layers, a feed-forward fully connected layer and three normalization layers to predict the thermal error.
[0014] In step (4), the input of the spindle temperature-thermal error model is the final predicted temperature sequence obtained according to the spindle state classifier and the spindle temperature prediction model. The specific formula is: ; In the formula, The final predicted temperature series is used as the input of the spindle temperature-thermal error model; is the temperature series predicted by the temperature measurement sub-model of the main shaft rotation state, is the temperature sequence predicted by the spindle stop state temperature measurement sub-model, is the current temperature value; the probability of the spindle rotation state output by the spindle state classifier and the probability of the spindle stopping state As a weight.
[0015] In step (5), when the spindle temperature prediction model is trained, the temperature time series data in the training set is input. First, the temperature time series data is divided into two types of data according to the state data of the electric spindle, including temperature time series data corresponding to the spindle rotation state and temperature time series data corresponding to the spindle stop state; then, each type of temperature time series data is sampled by sliding window and divided into several segments of temperature time series data; then, the segmented temperature time series data is input into two corresponding temperature measurement sub-models for training.
[0016] The specific process of step (6) is as follows: During the application process, the temperature time series data is collected and input into the electric spindle thermal error prediction model, which first passes through the spindle state classifier to output the probability of the spindle rotation state. and the probability of the spindle stopping state ; The collected temperature time series data are respectively input into two corresponding temperature measurement sub-models in the spindle temperature prediction model to obtain the temperature sequence predicted by the spindle rotation state temperature measurement sub-model and the temperature sequence predicted by the spindle stop state temperature measurement sub-model; According to the output of the electric spindle thermal error prediction model and the two temperature measurement sub-models, the final predicted temperature sequence is calculated, and the final predicted temperature sequence is input into the spindle temperature-thermal error model to obtain the predicted thermal error.
[0017] A device for predicting thermal errors of an electric spindle taking temperature hysteresis into consideration comprises a memory and one or more processors. The memory stores executable codes. When the one or more processors execute the executable codes, the device is used to implement the above-mentioned method for predicting thermal errors of the electric spindle.
[0018] Compared with the prior art, the present invention has the following beneficial effects: 1. The thermal error modeling of the present invention takes into account the state of the electric spindle and the temperature hysteresis phenomenon, thereby improving the accuracy of the modeling.
[0019] 2. The spindle temperature-thermal error model adopted in the present invention adopts a multi-head attention mechanism to fully extract the characteristic relationship in the temperature and thermal error time series, thereby improving the accuracy of modeling.
[0020] 3. The modeling method adopted in the present invention has good robustness and can be applied to different electric spindle systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 The present invention is a flowchart of a method for predicting thermal errors of an electric spindle taking into account the temperature hysteresis phenomenon according to an embodiment of the present invention.
[0022] Figure 2 The data are the time series data of the temperature and thermal error of the electric spindle collected in the embodiment of the present invention.
[0023] Figure 3 4 is a structural diagram of each temperature measurement sub-model in an embodiment of the present invention.
[0024] Figure 4 4 is a structural diagram of the spindle temperature-thermal error model in an embodiment of the present invention.
[0025] Figure 5 It is an application flow chart after integrating the three models into the electric spindle thermal error prediction model in an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be pointed out that the embodiments described below are intended to facilitate the understanding of the present invention and do not have any limiting effect on the present invention.
[0027] like Figure 1 As shown, a method for predicting thermal error of an electric spindle considering temperature hysteresis phenomenon comprises the following steps: S01, collect the time series data of temperature and thermal error of the high-speed electric spindle at different speeds and different states and the corresponding electric spindle state data, the specific data is as follows Figure 2 As shown. And divide it into training data set and test data set of the model.
[0028] In this embodiment, the temperature and thermal error data of a plurality of temperature measuring points under different states at a plurality of different rotational speeds of the high-speed electric spindle are collected at a frequency of 1 Hz, and the state data of the electric spindle is recorded.
[0029] S02, constructing a spindle state classifier, and using the temperature data and electric spindle state data in the training data set for training.
[0030] In this implementation, the SVM binary classifier is used to construct the spindle state classifier, where the kernel function is a Gaussian radial basis function, and its expression is: ; in, and is the temperature data in the training data set; are the parameters of the kernel function.
[0031] Then the SVM optimization objective function of this problem is obtained as follows: ; ; in, is the normal vector of the hyperplane, is the bias term, is the slack variable, is the regularization parameter, It is a mapping function that maps input data to a high-dimensional space.
[0032] The final classification decision function formula is: ; in, is the trained Lagrange multiplier, is the optimal bias term obtained through training.
[0033] Then the results of SVM are introduced into the Plat scaling method to output the probabilities of two working states: and .
[0034] S03, constructing a spindle temperature prediction model, and using the temperature time series data in the training data set for training.
[0035] The spindle temperature prediction model is divided into a spindle rotation state temperature measurement sub-model and a spindle stop state temperature measurement sub-model according to the state of the electric spindle. The input of the two temperature measurement sub-models is the temperature time series data, and the output is the predicted temperature sequence of the next time period.
[0036] like Figure 3 As shown in the figure, each temperature measurement sub-model includes several residual blocks, each residual block includes two dilated causal convolution layers, two weight normalization layers, two ReLU activation function layers, two random dropout layers and a residual connection layer. In each temperature measurement sub-model, each weight vector is first normalized, and the nonlinear activation function ReLU and Dropout regularization are used. At the same time, residual connections are added to every two layers of dilated convolution, and 1×1 convolution is used to add residuals at each time step to ensure that the input and output dimensions are equal.
[0037] The training process of the two temperature measurement sub-models is as follows: the input is the temperature time series data in the training data set. First, the temperature time series data is divided into two categories according to the state data of the electric spindle, and each category of temperature time series data is sampled by sliding window to be divided into several segments of temperature time series data. Then, the segmented temperature time series data is input into the two built temperature measurement sub-models for training.
[0038] S04, construct a spindle temperature-thermal error model and use the temperature and thermal error data in the training set for training.
[0039] like Figure 4 As shown, in this embodiment, GRU-Transformer is used to construct a spindle temperature-thermal error model, which includes a GRU encoder module, a Transformer encoder module and a thermal error decoding prediction module.
[0040] Among them, the GRU encoder module includes several GRU units, each GRU unit includes an update gate and a reset gate, and its update equation is: ; ; ; ; in, , , , , and is the weight coefficient of the network, , and is the bias vector, and is the activation vector of the update gate and the reset gate.
[0041] The Transformer encoder module contains several Transformer encoding units. Each Transformer encoding unit includes a multi-head attention layer, a feedforward fully connected layer, two normalized layers and two residual connections. The calculation formula for its position encoding is: ; ; Among them, PE represents the position encoding matrix, and denote the positions of even and odd indices respectively, Indicates the specific time step of the current sample in the input sequence, Represents the feature dimension of each sample.
[0042] The function of the multi-head attention layer is to integrate the temperature vector and the thermal error vector, and its calculation formula is: ; ; in, represents the attention head, is the attention aggregation function, , , are three linear transformation weight matrices, , , are the query vector, key vector, and value vector. represents the multi-head attention function, is the connection function, is the output linear transformation matrix.
[0043] The thermal error decoding prediction module contains several Transformer decoding units, fully connected layers and normalization layers. Each Transformer decoding unit includes two multi-head attention layers, one feedforward fully connected layer and three normalization layers to predict the thermal error. Its output is calculated as: ; in represents the thermal error, is the normalization function, represents the output of the Transformer decoder, is the bias term.
[0044] S05, integrating the models in steps S02, S03, and S04 to obtain a final thermal error model of the electric spindle that takes into account the temperature hysteresis phenomenon, and verifying it using the data in the test data set.
[0045] like Figure 5 As shown in Figure 1, the integration process of the spindle state classifier, the spindle temperature prediction model, and the spindle temperature-thermal error model is: Output of the spindle state classifier and As the weight of the two temperature measurement sub-models, the final predicted temperature is obtained, and its calculation formula is: ; in, is the final predicted temperature series, is the temperature series predicted by the temperature measurement sub-model of the main shaft rotation state, is the temperature sequence predicted by the spindle stop state temperature measurement sub-model, is the current temperature value.
[0046] and It serves as the input of the spindle temperature-thermal error model to achieve the integration of the three models and finally obtain the prediction result of the thermal error.
[0047] In order to verify the effectiveness of the present invention, three existing electric spindle thermal error modeling methods, CNN, SVR, and RFBN, were selected for comparison with the model of the present invention. The data of the electric spindle at three speeds of 9000r / min, 15000r / min, and 18000r / min were used, and the mean absolute error (MAE), mean square error (MSE), and determination coefficient (C) were selected. R 2 The performance of the model is compared by three indicators, and the results are shown in Table 1. It can be seen that the model of the present invention has good robustness and accuracy.
[0048] Table 1
[0049] The embodiments described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for predicting thermal errors of an electric spindle considering temperature hysteresis, characterized in that: The following steps are involved: (1) Collect the temperature time series data, thermal error time series data and corresponding electric spindle state data at different speeds and different states of the electric spindle to form a training set; (2) Construct a spindle state classifier. The input of the spindle state classifier is the temperature time series data, and the output is the probability of the spindle rotation state. and the probability of the spindle stopping state ; (3) Construct a spindle temperature prediction model. The spindle temperature prediction model is divided into a spindle rotation state temperature measurement sub-model and a spindle stop state temperature measurement sub-model according to the state of the electric spindle. The input of the two temperature measurement sub-models is the temperature time series data, and the output is the predicted temperature sequence of the next time period; (4) Constructing a spindle temperature-thermal error model. The input of the spindle temperature-thermal error model is the final predicted temperature sequence obtained according to the spindle state classifier and the spindle temperature prediction model, and the output is the predicted thermal error. (5) Using the training set, the spindle state classifier, the spindle temperature prediction model, and the spindle temperature-thermal error model are trained, and the three trained models are integrated into the electric spindle thermal error prediction model; (6) During the application process, the temperature time series data is collected and input into the electric spindle thermal error prediction model to obtain the predicted thermal error.
2. The method for predicting thermal error of an electric spindle considering temperature hysteresis according to claim 1, characterized in that: In step (1), temperature time series data and thermal error time series data are collected at a frequency of 1 Hz.
3. The method for predicting thermal error of an electric spindle considering temperature hysteresis according to claim 1, characterized in that: In step (2), support vector machine (SVM) is used to construct a spindle state classifier. The results of SVM are introduced into the Plat scaling method to output the probabilities of the two working states of the spindle, which are: the probability of the spindle rotation state and the probability of the spindle stopping state .
4. The method for predicting thermal error of an electric spindle considering temperature hysteresis according to claim 1, characterized in that: In step (3), each temperature measurement sub-model includes several residual blocks, each residual block includes two dilated causal convolution layers, two weight normalization layers, two ReLU activation function layers, two random dropout layers and a residual connection layer; in each temperature measurement sub-model, each weight vector is first normalized, and then processed using the nonlinear activation function ReLU and Dropout regularization. At the same time, a residual connection is added between every two dilated causal convolution layers, and a 1×1 convolution is used to add the residuals at each time step to ensure that the input and output dimensions are equal.
5. The method for predicting thermal error of an electric spindle considering temperature hysteresis according to claim 1, characterized in that: In step (4), a GRU-Transformer is used to construct a spindle temperature-thermal error model, including a GRU encoder module, a Transformer encoder module, and a thermal error decoding prediction module; The Transformer encoder module contains several Transformer encoding units, each of which includes a multi-head attention layer, a feedforward fully connected layer, two normalization layers, and two residual connections; The thermal error decoding prediction module contains several Transformer decoding units, a fully connected layer and a normalization layer. Each Transformer decoding unit includes two multi-head attention layers, a feed-forward fully connected layer and three normalization layers to predict the thermal error.
6. The method for predicting thermal errors of an electric spindle considering temperature hysteresis according to claim 1, characterized in that: In step (4), the input of the spindle temperature-thermal error model is the final predicted temperature sequence obtained according to the spindle state classifier and the spindle temperature prediction model. The specific formula is: ; In the formula, The final predicted temperature series is used as the input of the spindle temperature-thermal error model; is the temperature series predicted by the temperature measurement sub-model of the main shaft rotation state, is the temperature sequence predicted by the spindle stop state temperature measurement sub-model, is the current temperature value; The output of the spindle state classifier is the probability of the spindle rotation state and the probability of the spindle stopping state As a weight.
7. The method for predicting thermal error of an electric spindle considering temperature hysteresis according to claim 1, characterized in that: In step (5), when the spindle temperature prediction model is trained, the temperature time series data in the training set is input. First, the temperature time series data is divided into two types of data according to the state data of the electric spindle, including temperature time series data corresponding to the spindle rotation state and temperature time series data corresponding to the spindle stop state; then, each type of temperature time series data is sampled by sliding window and divided into several segments of temperature time series data; then, the segmented temperature time series data is input into two corresponding temperature measurement sub-models for training.
8. The method for predicting thermal error of an electric spindle considering temperature hysteresis according to claim 1, characterized in that: The specific process of step (6) is as follows: During the application process, the temperature time series data is collected and input into the electric spindle thermal error prediction model, which first passes through the spindle state classifier to output the probability of the spindle rotation state. and the probability of the spindle stopping state ; The collected temperature time series data are respectively input into two corresponding temperature measurement sub-models in the spindle temperature prediction model to obtain the temperature sequence predicted by the spindle rotation state temperature measurement sub-model and the temperature sequence predicted by the spindle stop state temperature measurement sub-model; According to the output of the electric spindle thermal error prediction model and the two temperature measurement sub-models, the final predicted temperature sequence is calculated, and the final predicted temperature sequence is input into the spindle temperature-thermal error model to obtain the predicted thermal error.
9. A device for predicting thermal errors of an electric spindle taking into account the temperature hysteresis phenomenon, characterized in that: It comprises a memory and one or more processors, wherein the memory stores executable codes, and when the one or more processors execute the executable codes, they are used to implement the electric spindle thermal error prediction method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Main shaft thermal error compensation method and device for machine tool machining
CN116900792A
Motorized spindle thermal error modeling method, system and device and storage medium
CN118350271A
Machine tool thermal error compensation method and system
CN117572820A