A method for predicting thermal errors of electric spindles based on digital twins

Through the thermal error prediction method optimized by digital twin technology and multi-objective evolution algorithm, combined with the improved Transformer model, the problems of low thermal error modeling and prediction efficiency and poor interpretation in the existing technology are solved, and high-precision and robust thermal error prediction are achieved.

CN118821525BActive Publication Date: 2025-03-07YANGZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410823629.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2025-03-07
Estimated Expiration
2044-06-25

AI Technical Summary

Technical Problem

The prior art has problems such as low computational efficiency, deviation from physical mechanisms, overfitting and weak interpretability in machine tool thermal error modeling and prediction.

Method used

Using the digital twin-based thermal error prediction method of electric spindles, finite element thermal analysis is performed by constructing a three-dimensional structural model of the electric spindle, combining a multi-objective evolution algorithm to optimize the temperature measurement point layout, collect temperature rise signals in real time and input the improved Transformer model for prediction, and dynamically adjust the steady-state temperature field model and the Transformer model to achieve high-precision thermal error prediction.

Benefits of technology

It significantly improves the accuracy and robustness of thermal error prediction, reduces testing costs, reduces redundant measurement point deployment, and expands the ways of high-end CNC equipment accuracy monitoring and operation and maintenance decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118821525B_ABST
    Figure CN118821525B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for predicting thermal errors of electric spindles based on digital twins. The method constructs a three-dimensional structural model of the electric spindle, performs finite element thermal analysis on the electric spindle, obtains a steady-state temperature field model of the electric spindle simulation, and preliminarily selects thermal sensitive points as temperature measurement points; a multi-objective evolutionary algorithm is used to optimize the layout of the temperature measurement points, and temperature rise signals and thermal errors are collected in real time; the collected temperature rise signals are input into the established improved Transformer model for prediction to obtain the prediction results of the thermal errors; the thermal errors of the predicted results are compared with the collected thermal errors, and the steady-state temperature field model and the improved Transformer model are adjusted according to the comparison results; the thermal errors of the electric spindles are predicted according to the adjusted steady-state temperature field model and the improved Transformer model. By introducing the idea of ​​digital twin modeling, the prior knowledge obtained by finite element numerical modeling and the high-performance estimation characteristics of artificial intelligence algorithms are effectively combined to improve the prediction accuracy of spindle geometric errors. The layout of temperature rise measurement points is optimized to reduce testing costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the spindle precision control of high-end machine tools, and in particular to a method for predicting thermal errors of electric spindles based on digital twins. Background Art

[0002] CNC gear grinding machines play a key role in the gear manufacturing of high-end equipment such as aviation equipment, satellite manufacturing and application, rail transportation equipment, marine engineering equipment, process industry, etc. The heat generated by the high-speed grinding process causes uneven temperature and thermal error inside the machine tool, resulting in thermal error of the electric spindle components, increasing the machining error of the gear surface, and seriously affecting the machining accuracy.

[0003] At present, thermal error modeling and prediction for machine tools are mainly achieved through two methods: numerical solution based on finite element method and intelligent time series prediction algorithm. In the prior art, a method combining finite element analysis with experimental data of thermocouples and capacitive strain gauges is proposed to create a thermal displacement model for micro-milling spindles. The model aims to significantly reduce the machining error caused by heat by accurately predicting the displacement of the spindle at different speeds, solving the problem of thermal error in micro-machining that seriously affects manufacturing accuracy. However, the machine tool thermal error modeling and prediction technology based on finite element numerical simulation requires accurate calculation of boundary conditions and heat source parameters, and the calculation efficiency is low. Using advanced testing methods to obtain temperature rise data and establish a mapping relationship with thermal error based on machine learning and statistical learning methods is also a current research method. In the prior art, the mapping relationship between temperature and thermal error is fitted using a fuzzy neural network algorithm, and its prediction accuracy is higher than that of a perceptron network. In the prior art, a new dynamic spatiotemporal memory graph convolutional network model embedded in an industrial-oriented machine learning big data framework is proposed to accurately predict and control the thermal error of machine tools. This method significantly improves the prediction accuracy and robustness, as well as the training efficiency of real-time error control by comprehensively capturing the temporal and spatial feature interactions of thermal errors. However, pure data-driven prediction methods are prone to deviate from physical mechanisms, resulting in shortcomings such as overfitting and weak interpretability. Summary of the invention

[0004] Purpose of the invention: In view of the above shortcomings, the present invention provides a thermal error prediction method for an electric spindle based on digital twins with high thermal error prediction accuracy.

[0005] Technical solution: To solve the above problems, the present invention adopts a method for predicting thermal errors of electric spindles based on digital twins, which includes the following steps:

[0006] (1) Construct a three-dimensional structural model of the electric spindle, perform finite element thermal analysis on the electric spindle, obtain a steady-state temperature field model for the electric spindle simulation, and preliminarily select thermally sensitive points as temperature measurement points based on the simulation results;

[0007] (2) using a multi-objective evolutionary algorithm to optimize the layout of temperature measurement points, wherein the multi-objective optimization algorithm includes an unsupervised objective function and a supervised objective function;

[0008] (3) Real-time acquisition of the temperature rise signal and displacement of the electric spindle at each temperature measurement point after optimization;

[0009] (4) Inputting the collected temperature rise signal into the established improved Transformer model for prediction, and obtaining the prediction result of thermal error;

[0010] (5) Compare the thermal error of the predicted result with the acquired displacement of the electric spindle, and adjust the steady-state temperature field model and improve the Transformer model according to the comparison result;

[0011] (6) The thermal error of the electric spindle is predicted based on the adjusted steady-state temperature field model and the improved Transformer model.

[0012] Beneficial effects: Compared with the prior art, the significant advantage of the present invention is that it introduces the concept of digital twin modeling in the field of forming gear grinding processing, effectively combines the prior knowledge obtained by finite element numerical modeling with the high-performance estimation characteristics of artificial intelligence algorithms, and realizes the prediction of geometric errors at the grinding wheel end of the machine tool spindle. The established dual-objective optimization temperature rise measurement point layout scheme can significantly reduce testing costs and reduce redundant measurement point deployment. At the same time, the multi-channel inverse Transformer prediction algorithm effectively considers the correlation between the temperature rise characteristics of different channels, and combines the variable-length prediction mode to achieve high-precision thermal error prediction under different review step lengths, which greatly expands the way of precision monitoring and subsequent operation and maintenance decision-making of high-end CNC equipment. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 It is a schematic diagram of the flow chart of the prediction method of the present invention.

[0014] Figure 2 This is the result of optimizing the layout of the temperature rise measurement points in the present invention.

[0015] Figure 3 It is a schematic diagram of the framework of the multi-channel inverse Transformer prediction algorithm in the present invention.

[0016] Figure 4 It is a schematic diagram of the prediction result of the thermal error of the spindle in the present invention; Figure 4 (a) is a schematic diagram of the axial thermal error prediction results at the first prediction starting point; Figure 4 (b) is a schematic diagram of the radial thermal error prediction results at the first prediction starting point; Figure 4 (c) is a schematic diagram of the axial thermal error prediction results at the second prediction starting point; Figure 4 (d) Schematic diagram of the radial thermal error prediction results at the second prediction starting point.

[0017] Figure 5 It is a comparison chart of the prediction accuracy of the temperature rise measurement point layout method in the present invention under different review step sizes. DETAILED DESCRIPTION

[0018] like Figure 1 As shown, in this embodiment, a method for predicting thermal errors of an electric spindle based on digital twins includes the following steps:

[0019] Step S1: A three-dimensional structure model of the electric spindle is established based on the grinding processing characteristics of the gear grinding machine spindle, and a high-fidelity numerical simulation steady-state temperature field model is established based on the measured heat source and corresponding boundary conditions in the historical processing to simulate the temperature field and thermal error of the gear grinding process.

[0020] This embodiment is fully verified by SKMC-3000 / 20 profile gear grinding machine. The main parameters of the machine tool and data acquisition system are as follows: Figure 2 and Table 1. To ensure the accuracy of the experiment and avoid random or occasional errors caused by external factors, the machining parameters consistent with the actual gear grinding process were adopted: the ambient temperature of the machining workshop was maintained at 20 ± 0.2 °C; the working speed of the grinding wheel was set to 1900 rpm; the linear reciprocating speed of the column in the X direction of the machine tool and the speed of the Z-axis slide in the Z direction were 2.5 m / min and 3.0 m / min respectively; the working speed of the CNC rotary table was 500 ° / min.

[0021] Table 1 Profile Gear Grinding Machine and Test System Parameters

[0022] parameter value Profile Gear Grinding Machine SKMC-3000 / 20 Electric spindle NMD045 Maximum speed 4500r / min Maximum Torque 100N·m Temperature Sensor PT100 Laser displacement sensor LTS-25-02

[0023] Then, the simplified three-dimensional model of the electric spindle was meshed using the finite element analysis software ANSYS Workbench. The various components of the NMD045 electric spindle model were meshed using a combination of automatic meshing, hexahedral meshing, and patch fitting algorithms. The materials of the electric spindle components are: the rotating shaft and bearings are made of 45 steel and GCr15 respectively, the stator-rotor is made of silicon steel, and the rest of the spindle is made of Q235 material. Table 2 lists the material properties of the various components of the electric spindle system in detail.

[0024] Table 2 Material properties of the electric spindle of the forming gear grinding machine

[0025]

[0026] The heat source of the grinding spindle of the gear grinder is divided into two parts: internal and external. The internal heat source mainly comes from three areas: the power loss of the built-in motor, the friction of the bearings, and the heat generated by the grinding process itself. The external heat source includes environmental factors and human activities. Studies have shown that the internal heat source has a greater impact on the thermal error of the spindle. More than 95% of the heat generated by grinding is dissipated by the coolant, which effectively reduces its impact on the deformation of the spindle. Therefore, it is necessary to focus on the power loss of the built-in motor and the friction heat generated at the bearings.

[0027] The power loss of the motor built into the electric spindle is usually converted into heat generated by the motor stator and rotor, and its power loss usually accounts for 1 / 5 to 1 / 4 of the rated power of the motor. The formula for calculating the heat rate of the stator and rotor is as follows:

[0028] q=Q / V

[0029] Where Q represents the heat generated in kilowatts (kW), V represents the volume in cubic meters (m3), and q represents the heat generation rate in watts per cubic meter (W / m3). The gear grinder uses an electric spindle with a rated power of 25kW. The estimated power loss is about 6.25kW, of which the stator loss is about 4.2kW, accounting for two-thirds of the total stator loss, and the remaining power loss of about 2kW comes from the rotor. It can be calculated that the heat generation of the rotor and stator is 1.24E+06W / m 3 and 1.30E+06W / m 3 .

[0030] Next, the heat generated by the electric spindle bearing can be calculated using the Palmgren method, as shown below:

[0031] Q = 1.047 × 10 -4 ×Mn

[0032] Where M represents the bearing friction torque in Newton millimeters (N mm), n represents the rotation speed in revolutions per minute (r / min), and Q represents the heat generated by the bearing in watts (W). At a specific rotation working speed, the heat generation rate of the front and rear bearings and other boundary conditions of the numerical simulation are listed in the following Tables 3 and 4.

[0033] Table 3 Heat generation rate of the front and rear end bearings of the main shaft

[0034] Bearings Speed ​​(r / min) Heat generation / W <![CDATA[Volume / m 3 > <![CDATA[Heat generation rate / (W / m 3 )]]> Front bearing 1900 43.17 1.04E-04 4.15E+05 Rear end bearing 1900 23.54 5.77E-05 4.09E+05

[0035] Table 4 Calculation of convection heat transfer coefficient of electric spindle

[0036] Location Convective heat transfer coefficient (W / m2·℃) Heat transfer between stator and cooling tank 292.6 Heat transfer between the front bearing area and the cooling slots 283.1 Heat transfer between stator and rotor 210.6 Heat transfer between the rotor tip and the surrounding air 163.2 Heat transfer in the air gap between the front and rear sealing rings 258.1 Heat transfer between moving surfaces such as the spindle head and the surrounding air 181.3 Heat transfer between the spindle housing and the surrounding air 12.1

[0037] Internal heat convection is also an important factor affecting the thermal error of the electric spindle. Specifically, it includes: heat transfer between the stator and the cooling groove; heat transfer between the front bearing area and the cooling groove; heat transfer between the stator and the rotor; heat transfer between the rotor end and the surrounding air; heat transfer in the air gap between the front and rear sealing rings; heat transfer between the moving surfaces of the spindle head and the surrounding air; heat transfer between the spindle housing and the surrounding air.

[0038] Based on the numerical simulation results of steady-state temperature field and axial and radial deformation (such as Figure 2 As shown in the figure, eight temperature-sensitive measurement points were initially identified. These measurement points are named as follows: T1: electric spindle head, T2: near the front bearing, T3: near the rear bearing, T4: rear of the spindle box, T5: coolant inlet, T6: coolant outlet, T7: midpoint of the spindle x end face, and T8: ambient temperature.

[0039] Step S2: The established steady-state temperature field model is combined with a multi-objective evolutionary algorithm to optimize the layout of sensitive temperature rise measurement points, the feasible solution range of the multi-objective optimization is determined based on the steady-state temperature field, and the unsupervised objective function in the multi-objective optimization is constructed through monotonicity and trend indicators. The correlation coefficient between the measured thermal error and the temperature rise is further used to establish a supervised optimization objective function.

[0040] The established steady-state temperature field model and the multi-objective evolutionary algorithm to optimize the layout of sensitive temperature rise measurement points need to consider the heat source and convection boundary conditions of the electric spindle in step S2. First, the multi-objective optimization problem can be expressed as follows: Select a function f that satisfies multiple criteria i : A feasible solution x is:

[0041]

[0042] Among them, F(x) represents the set of multi-objective functions, and function g t (x) and h r (x) represent inequality and equality constraints respectively, and the symbol [l p ,u p ] specifies the lower and upper limits of the i-th variable.

[0043] Then, based on the concepts of Pareto optimality and dominance, the balance between multiple conflicting objectives is balanced and the multi-objective optimization process established in the above formula (3) is solved. The multi-objective optimization function can be expressed as [f1(x), f2(x),…, f n (x)] T , n is the number of optimization targets. In this embodiment, two types of objective functions f are used, namely, unsupervised and supervised And achieve the Pareto optimal solution under the optimization of NSGA-II algorithm. The main focus is on the quality of the input, that is, the collected temperature signal. It is mainly quantified by the following two indicators: monotonicity (M(X,T)) and trend (Tr(X,T)). Unsupervised objective function It can be expressed as a weighted combination of monotonicity and trend, and only the measurement points with obvious temperature increase and clear trend are beneficial to the subsequent thermal error prediction.

[0044]

[0045] Among them, X tr (t k ) is the temperature rise signal at t k The amplitude at the moment, X tr (t k+1 ) is the temperature rise signal at t k+1 The amplitude at the moment t, K is the number of sequence blocks intercepted in time, and δ represents the amplitude of the temperature rise signal at t k+1 and t k Derivative calculation at time.

[0046] On the other hand, a supervised optimization objective function f is established by measuring the correlation coefficient between the thermal error (output) and the temperature rise (input). s 2 Suppose the temperature data of the electric spindle at the mth temperature measuring point at the i-th moment is X mi , the corresponding thermal error data of the nth thermal error measurement point at the i-th moment is y ni , correlation coefficient It can be expressed as follows,

[0047]

[0048] The larger of them A higher value indicates a higher correlation between thermal error and the temperature measurement points.

[0049] For the eight temperature-sensitive measurement points initially determined, the Pareto optimal solution including T1, T2, T3 and T4 was generated according to the temperature measurement point layout method of the above dual-objective optimization, which was subsequently used as the measurement point input into the multi-channel ITransformer.

[0050] Step S3: Use platinum resistance to record the temperature rise of the gear grinding machine spindle for the optimized multi-channel measuring points, and use laser displacement sensor to capture the axial and radial displacement of the electric spindle, and then generate temperature rise characteristics-displacement samples with time step as dynamic sliding window to conduct time series prediction research on the input thermal error model. The platinum resistance is installed by 502 glue and attached to the surface of the electric spindle housing. The laser displacement sensor is fixed to the axial and radial ends of the electric spindle grinding wheel by magnetic base.

[0051] Step S4: The temperature rise signal is then input into the established multi-channel inverse Transformer model (multi-channel ITransformer), which embeds the temperature rise sequence features of each channel into the tokens completely, rather than extracting the features of a single moment based on timestamps, so that the attention module can effectively identify the correlation between multi-channel signals. The model consists of an encoding layer, a decoding layer, and a linear projection layer, wherein the encoding and decoding layers include a multi-head attention layer, a normalization operator, and a residual connection.

[0052] Here, the temperature rise signal obtained at the sensitive measuring point is defined as Where T b is the look-back time step, and the multi-channel signal is labeled C. Assuming that T b The temperature rise signal within the timestamp predicts the thermal error at the future time, which is expressed as As shown in the following formula,

[0053]

[0054] Where f represents the mapping relationship between thermal error and actual measured temperature rise signal, Y T:p represents the thermal error of the electric spindle to be predicted, and It is the collected multi-channel temperature rise data.

[0055] The inverted Transformer (ITransformer) proposed a time-series multi-channel ITransformer prediction model, which has the advantage of embedding each temperature rise sequence into a token independently, so that the attention module can effectively identify the correlation between multi-channel signals. At the same time, the multi-channel ITransformer continues the variable step prediction architecture of encoding-decoding (Sequence to Sequence, Seq2Seq). Here, the multi-channel temperature rise sequence of the given input is Its corresponding token embedding form is expressed as It can be obtained by the following formula:

[0056]

[0057] Where XT :,c Represented as the transpose of the cth time series variable at all time steps, is the embedding expression of the initial token.

[0058] The prediction process is:

[0059] S41: Encoding process, according to the embedded word H 0 , the multi-channel ITransformer will first enter the encoding process, and each encoding block executes a total of L encoding The encoding layer EncBlock is as follows:

[0060]

[0061] The calculation process of each encoding layer EncBlock mainly includes multi-head attention calculation MuliAtten, forward propagation and normalization layer LayerNorm, as shown in the following formula:

[0062]

[0063] in, A normalization layer is applied to the embedded representation of each channel data.

[0064] Then the normalized embedding expression It will be further processed by the GeLU activation function and the forward propagation layer LayerFF as shown below:

[0065]

[0066] S42: Decoding process. The decoding process uses operators similar to those used in decoding, such as attention feature extraction and normalization layer. First, the input and the embedded expression after mask processing. Then a total of L decoding Layer decoding can be expressed as the following formula:

[0067]

[0068] Compared with the encoding block, the decoding uses an additional masked multi-head self-attention mechanism, which ensures that the prediction result of position i only depends on the data before time i, as shown in the following formula:

[0069]

[0070] S43: Linear projection prediction, the decoded hidden layer information is input into the linear unit to generate the prediction value (thermal error), as shown below,

[0071]

[0072] Among them, Projection is the linear layer of the multi-layer perceptron used to map the prediction results

[0073] The overall algorithm structure is as follows Figure 3 As shown, the preset parameters involved are shown in Table 5, where the review step length T b , determined by the Akaike Information Criterion (AIC), the prediction step length T p And sliding window size The other parameters in the prediction model are selected by considering the prediction accuracy and calculation time.

[0074] Table 5 Main parameter settings in multi-channel ITransformer

[0075]

[0076] In addition, all verified and compared deep learning hardware and software settings are shown in Table 6.

[0077] Table 6 Verification calculation software and hardware settings

[0078] parameter value parameter value operating system Ubuntu 20.04 programming language Python 3.8.18 CPU Intel-i9-13900KF GPU RTX 4090 Memory 64G Deep Learning Libraries PyTorch 2.1 Cudnn version 8.9.7 CUDA Version 11.8

[0079] Through the selection of the above preset parameters and the establishment of the computing environment, the multi-channel ITransformer uses the temperature signal of the sensitive measurement points (T1, T2, T3 and T4) minus the ambient temperature at T8 as the timing input. And set up a comparative experiment of axial and radial thermal error prediction at different prediction starting points (45% and 85% of the total processing time respectively), and the obtained thermal error prediction results are as follows Figure 4 As shown, it is not difficult to find that the proposed multi-channel ITransformer can achieve lower thermal error prediction results, and the selection of the prediction starting point has a certain influence on the autoregressive prediction accuracy.

[0080] In addition, the study on the prediction of thermal errors of electric spindles compares the classic time series prediction method and other prediction algorithms based on Transformer. Their detailed descriptions and necessary parameter settings are as follows:

[0081] Classic time series forecasting methods:

[0082] Fuzzy neural network (FNN): FNN combines the principles of fuzzy logic with the learning process of neural networks. The FNN used contains an input layer, a hidden layer, and an output layer. The model configuration is consistent with the parameters such as the number of iterations and learning rate of the multi-channel ITransformer, and the input feature extraction method is also consistent with this study.

[0083] Bidirectional gated circulation unit (BiGRU): The basic prediction model is a gated circulation unit, with a batch size of 128, an iteration number of 10,000, a learning rate of 0.0001, and the input feature extraction method is consistent with this study. BiGRU implements prediction model training through the time back propagation training strategy.

[0084] Other Transformer prediction methods:

[0085] Vanilla Transformer: The original version of the Transformer model, consisting of an encoding and decoding structure. The multi-head attention mechanism, normalization, forward propagation module, and input data form are consistent with this paper. The main difference is the setting of the token embedding. Vanilla Transformer focuses on the embedding expression of a given timestamp range, rather than the embedding expression of all time steps of the variable.

[0086] ITransformer: ITransformer applies the attention mechanism and forward propagation network to the inverted dimension of the input data, which helps capture the correlation between multiple variables and improve the accuracy of sequence prediction under long time steps. The common preset parameters in ITransformer are consistent with the method described in this article, and its input data only uses a single channel temperature rise signal.

[0087] In the comparative experiment, both accuracy and computational efficiency were considered, and the specific results are shown in Table 7. The prediction error is expressed by mean absolute error (MAE) and root mean square error (RMSE), and the computational efficiency is measured by floating point operations (FLOPs). FLOPs is implemented using the complexity calculation library fvcore developed by Facebook. Both are the average values ​​of the axial and radial prediction results at different prediction starting points. From the perspective of computational accuracy and algorithm complexity, the designed multi-channel ITransformer achieves a lower prediction error without requiring too many hardware resources.

[0088] Table 7 Comparison results with existing thermal error prediction methods

[0089] Comparison Method MAE RMSE FLOPs FNN 0.0296 0.0308 1.8B BiGRU 0.0144 0.0197 2.8B Vanilla Transformer 0.0134 0.0114 12.8B ITransformer 0.0042 0.0068 5.9B This embodiment 0.0015 0.0031 7.3B

[0090] Step S5: Compare the established multi-channel inverse Transformer prediction result, i.e., the radial displacement of the electric spindle shaft, with the thermal error measured by the laser displacement sensor, and dynamically adjust the established high-fidelity numerical model and the data-driven multi-channel inverse Transformer algorithm based on the feedback control idea, and finally realize the high-precision test and prediction of the thermal error of the electric spindle under the digital-analog linkage. The digital-analog linkage mechanism realizes the dynamic regulation of the numerical model and the prediction algorithm through the difference between the predicted thermal error and the actual measured value, calculates the partial derivative between the difference and the parameter to be adjusted, and realizes the optimization solution based on the gradient descent method, and finally achieves the purpose of high-precision measurement and prediction of the thermal error of the electric spindle driven by the joint drive of "data" and "model".

[0091] To verify the effectiveness of this regulation mechanism, the following ablation experiment is set up to deeply analyze the response relationship between the temperature measurement point layout and the multi-channel ITransformer prediction architecture to the prediction performance.

[0092] Ablation experiment I, the influence of temperature measurement points on the accuracy of thermal error prediction: The first group compared and evaluated the effect of using three of the four measurement points (T1~T4) for thermal error modeling: AE-2(1): using measurement points T2, T3, and T4 for thermal error prediction; AE-2(2): using measurement points T1, T3, and T4 for thermal error prediction; AE-2(3): using measurement points T1, T2, and T4 for thermal error prediction; AE-2(4): using measurement points T1, T2, and T3 for thermal error prediction. The second group of comparisons focuses on combinations that use only two measurement points: AE-2(5): using measurement points T3 and T4 for thermal error prediction; AE-2(6): using measurement points T1 and T2 for thermal error prediction; AE-2(7): using measurement points T1 and T3 for thermal error prediction; AE-2(8): using measurement points T1 and T4 for thermal error prediction; AE-2(9): using measurement points T2 and T3 for thermal error prediction; AE-2(10): using measurement points T2 and T4 for thermal error prediction.

[0093] This ablation experiment aims to evaluate the importance and potential redundancy of sensitive measurement points, as well as how different combinations affect the accuracy of thermal error modeling, by observing the impact of different combinations on the accuracy of thermal error modeling. Figure 5The importance of selecting the best temperature measurement points is effectively highlighted. It is found that the accuracy of thermal error prediction using T1, T2, T3, and T4 simultaneously is significantly higher than any combination using only three or two of the measurement points. This finding also indirectly proves that the selected measurement points are necessary and non-redundant.

[0094] Ablation Experiment II, Impact of Architecture in the Designed Multi-channel ITransformer Predictor: According to current understanding, Transformer-based prediction architectures are generally divided into two unique types: one that relies only on the encoding process, and the other that includes both encoding and decoding processes, known as Seq2Seq. The Seq2Seq variant simplifies the decoding process of the Transformer, thereby reducing the time and space complexity. However, it encounters challenges in handling variable-length predictions. In contrast, the Seq2Seq architecture of the Transformer model used in this example excels at handling predictions of different timestamps, a capability further illustrated in Table 5. Despite its high consumption of computational resources, the Seq2Seq architecture's proficiency in managing tasks of different lengths and reducing generalization error makes it a more practical choice.

[0095] Table 8. The impact of prediction architecture in multi-channel ITransformer

[0096] Architecture MAE RMSE FLOPs Encoder-Decoder Architecture 0.0015 0.0031 7.3B Coding architecture 0.0049 0.0068 3.6B

[0097] The above description is only a specific implementation of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a technician familiar with the technical field within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention.

Claims

1. A method for predicting thermal errors of electric spindles based on digital twins, characterized in that: The following steps are involved: (1) Construct a three-dimensional structural model of the electric spindle, perform finite element thermal analysis on the electric spindle, obtain a steady-state temperature field model for the electric spindle simulation, and preliminarily select thermally sensitive points as temperature measurement points based on the simulation results; (2) optimizing the layout of temperature measurement points using a multi-objective optimization algorithm, wherein the multi-objective optimization algorithm includes an unsupervised objective function and a supervised objective function; The unsupervised objective function is constructed by using monotonicity and trend indicators, and is expressed as a weighted combination of monotonicity and trend; The monotonicity function is: The trend function is: Among them, X tr (t k ) is the temperature rise signal at t k The amplitude at the moment, X tr (t k+1 ) is the temperature rise signal at t k+1 The amplitude at the moment t, K is the number of sequence blocks intercepted in time, and δ represents the amplitude of the temperature rise signal at t k+1 and t k Derivative calculations at moments; The supervised objective function is constructed by the correlation coefficient between thermal error and temperature rise. for: Among them, X mi is the data of the mth temperature measurement point at the i-th moment, y ni is the data of the nth thermal error measurement point at the i-th moment, is the average value of the mth temperature measurement point, is the average value of the nth thermal error measurement point, m is the total number of temperature measurement points, n is the total number of thermal error measurement points, and T is the length of the temperature and thermal error signal; (3) Real-time acquisition of the temperature rise signal and displacement of the electric spindle at each temperature measurement point after optimization; (4) Inputting the collected temperature rise signal into the established improved Transformer model for prediction, and obtaining the prediction result of thermal error; The improved Transformer model in step (4) is a multi-channel inverse Transformer model, and each temperature rise sequence is independently embedded into a token. The corresponding token embedding form is expressed as It can be obtained by the following formula: Where X T :,c Represented as the transpose of the cth time series variable at all time steps, is the embedding expression of the initial token; The improved Transformer model prediction process is: (41) Encoding process, each encoding block executes L encoding The encoding layer EncBlock is as follows: Among them, H 0 is the embedding expression of the initial token; To execute encoding The embedded representation after the encoding layer; The calculation process of each encoding layer EncBlock includes multi-head attention calculation MuliAtten, forward propagation and normalization layer LayerNorm; as shown in the following formula: Normalization layer is applied to the embedded representation of each channel data; Normalized embedding representation It will be further processed by the GeLU activation function and the forward propagation layer LayerFF as shown below: (42) The decoding process is done by inputting and the masked embedded expression, and then a total of L decoding Layer decoding is expressed as the following formula: Compared with the encoding block, the decoding additionally uses the masked multi-head self-attention mechanism MaskedAtten, as shown in the following formula: (43) Linear projection prediction: the decoded hidden layer information is input into the linear unit to generate the predicted value, as shown below: Projection is the linear layer of the multi-layer perceptron used to map the prediction results Execute l for the cth sequence encoding The embedded expression after encoding and decoding; (5) Compare the thermal error of the predicted result with the acquired displacement of the electric spindle, and adjust the steady-state temperature field model and improve the Transformer model according to the comparison result; (6) The thermal error of the electric spindle is predicted based on the adjusted steady-state temperature field model and the improved Transformer model.

2. The method for predicting thermal errors of an electric spindle according to claim 1, characterized in that: The finite element thermal analysis of the electric spindle in step (1) includes determining heat sources and boundary conditions, wherein the heat sources include power loss of the built-in motor and friction heat at the bearings; the boundary conditions include heat transfer between the stator and the cooling groove; heat transfer between the front bearing area and the cooling groove; and heat transfer between the stator and the rotor; Heat transfer between the rotor end and the surrounding air; heat transfer in the air gap between the front and rear sealing rings; heat transfer between the moving surface and the surrounding air; heat transfer between the main shaft housing and the surrounding air.

3. The method for predicting thermal errors of an electric spindle according to claim 1, characterized in that: In the step (3), the temperature rise signal of the electric spindle at each temperature measuring point is collected by a platinum resistor attached to the surface of the electric spindle housing; the displacement of the electric spindle is collected by a laser displacement sensor, and the displacement of the electric spindle includes axial displacement and radial displacement.

4. The method for predicting thermal errors of an electric spindle according to claim 1, characterized in that: In the step (5), the thermal error of the predicted result is compared with the displacement of the collected electric spindle, and the steady-state temperature field model and the improved Transformer model are adjusted according to the comparison result. Specifically, the difference between the thermal error of the predicted result and the displacement of the collected electric spindle is calculated, and the partial derivative between the interpolation and the parameter to be adjusted is calculated, and the optimization solution is achieved according to the gradient descent method.

5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.