Transform-GRU-based numerical control machine tool feeding system thermal error prediction method and system
By using a Transformer-GRU composite model to fuse multi-source data for thermal error prediction of CNC machine tool feed systems, the problem of insufficient accuracy in modeling with single temperature data is solved, achieving higher prediction accuracy and stability, and simplifying model structure and training time.
Patent Information
- Application Number
- CN202511155086.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-11-28
AI Technical Summary
In the current technology for predicting thermal errors in CNC machine tool feed systems, modeling with a single temperature data cannot fully cover the interactive effects of multiple factors, resulting in insufficient prediction accuracy and making it difficult to achieve high-precision thermal deformation prediction.
A Transformer-GRU composite model was adopted, which collected multi-source data through temperature and acceleration sensors. Fuzzy C-means clustering, grey relational analysis, empirical mode decomposition and wavelet threshold analysis were combined to screen out temperature-sensitive points and vibration feature data, perform multi-source information fusion, and train the Transformer-GRU model for prediction after alignment on the time axis.
It improves the reliability and generalization ability of thermal error prediction, reduces RMSE by about 16.7% and MAE by about 15.4%, improves prediction accuracy and stability, and simplifies model structure and training time.
Smart Images

Figure CN121031333A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of machine tool design, and in particular to a numerical control machine tool feeding system thermal error prediction method and system based on a Transformer-GRU. BACKGROUND
[0002] With the continuous development of intelligent manufacturing technology, and the increasing demand for precision parts in high-end industries such as aerospace and precision optics, numerical control machine tools have evolved from single production tools to the nerve center of manufacturing industry. Even so, its machining precision is still the core focus of the industry. Among the various factors that affect the machining precision of numerical control machine tools, thermal error, geometric error, control error, etc. are particularly critical, and thermal error has the largest proportion of influence. As the main moving part in the machining process, the feeding system of the numerical control machine tool is one of the main sources of thermal error of the machine tool, therefore, effective control of the thermal error of the feeding system is of great significance to improve the machining precision of the numerical control machine tool. The methods to reduce the thermal error of the feeding system of the numerical control machine tool mainly fall into two categories: error prevention and error compensation. Error prevention methods mainly reduce the generation of thermal error from the source through optimization design, process improvement, active control, etc. However, this kind of method not only has high cost, but also has great control difficulty. Error compensation method is to establish a thermal error model and adjust the machining parameters in time to offset the thermal error in the machining process, which process covers the thermal characteristic analysis, thermal error modeling and thermal error compensation of the feeding system. Among them, thermal error modeling is the key link of the whole process, which directly determines the accuracy of thermal error prediction and provides important support for the subsequent compensation link.
[0003] CN108763682B discloses a thermal optimization method and device for machine tool spindle based on Taguchi method. The thermal optimization method comprises: determining a quality parameter of the machine tool spindle; determining a key parameter of the machine tool spindle based on the quality parameter; determining a test combination based on the key parameter, and screening the test combination by the Taguchi method to obtain a screened test combination; performing machine tool spindle test based on the screened test combination, and obtaining a test result; analyzing the test result to obtain an optimal thermal performance parameter of the machine tool spindle; and performing thermal optimization on the machine tool spindle based on the optimal thermal performance parameter; the quality parameter comprises: maximum thermal deformation, maximum temperature and total mass; the determination of the key parameter of the machine tool spindle based on the quality parameter comprises: obtaining parameter properties of the quality parameter; in the case that the parameter properties are small characteristics, the key parameter of the machine tool spindle is determined as: spindle support span, taper section length, cooling channel relative to spindle distance and spindle box side groove depth.
[0004] As the main heat and energy consumption component of a numerical control machine tool, the performance of the spindle system directly affects the machining accuracy of the machine tool. At present, in the design stage, it is difficult to achieve high-precision prediction of thermal deformation and other characteristics when using a single temperature data as the basis for prediction. Single temperature data can only reflect the temperature state at a certain time or a certain position, and cannot comprehensively cover these complex factors and their interactive effects, making it difficult for the prediction model to accurately capture the true law of thermal deformation. SUMMARY
[0005] Long-term practice has found that as the core functional component of a numerical control machine tool, how to build a thermal error prediction model of the machine tool feeding system based on multi-source information fusion technology, which integrates temperature, vibration and other multi-dimensional data, to solve the problem of insufficient prediction accuracy caused by ignoring other influencing factors when modeling with single temperature data, and how to effectively integrate and feature mine different source data to improve the reliability and generalization ability of thermal error prediction. Because the generation and development of thermal deformation is the result of the joint action of multiple factors, not just determined by the single parameter of temperature. For example, the speed change during the operation of the machine tool will change the frictional heat generation of the components, and then affect the degree and distribution of thermal deformation. The difference in load size will cause different stress states of the components, indirectly causing differences in thermal deformation. If optimized by the single parameter of temperature, the final prediction result will have a large deviation from the actual situation.
[0006] Therefore, the present application aims to provide a numerical control machine tool feeding system thermal error prediction method based on Transformer-GRU, comprising:
[0007] Step S1, collecting temperature data from the start of machine tool operation to the thermal equilibrium state of the machine tool feeding system through a temperature sensor, continuously collecting vibration data during operation using an acceleration sensor, and measuring the initial positioning error of each measuring point on the lead screw using a laser interferometer. The thermal error data is obtained by subtracting the initial positioning error from all the positioning error data measured after the machine tool starts running;
[0008] Step S2, the collected temperature data is subjected to fuzzy C-means clustering and gray correlation degree screening to obtain the first data of temperature sensitive points;
[0009] Step S3, the vibration feature data after dimensionality reduction is obtained by combining empirical mode decomposition, wavelet threshold, Spearman correlation coefficient and kernel principal component analysis;
[0010] Step S4, aligning the thermal error data, the first data and the vibration feature data on the time axis and then integrating them to generate multi-source information fusion data;
[0011] Step S5, the multi-source information fusion data is divided into a training set and a test set, the training set is used to train the Transform-GRU composite model to obtain a trained model, and the test set is input into the trained model, and if the error is less than a preset value, a prediction value is output.
[0012] Preferably, in step S3, the vibration is sequentially decomposed into a plurality of single frequency intrinsic modal functions IMF and a residual from high frequency to low frequency, and each IMF is measured by a variance contribution rate, and the IMF and the residual with a variance contribution rate greater than or equal to a first preset threshold are retained;
[0013] The multi-resolution analysis characteristic of wavelet transform is used to decompose the signal into frequency bands of different scales, and a second preset threshold is used to process each frequency band to remove noise, and coefficients greater than the second preset threshold are retained, and the denoised IMF and the residual term are combined to obtain the denoised vibration signal data.
[0014] Preferably, the vibration features are extracted from the denoised vibration signal data;
[0015] The vibration data is divided into N segments with the same temperature time period, at least 15 features are extracted from the time domain, including mean, variance, standard deviation, skewness, kurtosis, peak value, peak-to-peak value, root mean square, peak factor, waveform factor, pulse factor, margin factor, kurtosis factor, and energy;
[0016] At least 4 features are extracted from the frequency domain, including center of gravity frequency, mean square frequency, frequency variance, and frequency standard deviation, and energy features of 8 nodes of the third layer of wavelet transform in the time-frequency domain.
[0017] Preferably, all vibration features need to pass through the calculation of the Spearman correlation coefficient, and the second vibration features with a correlation degree reaching a preset condition with the thermal error change of the feeding system are screened out.
[0018] Preferably, the second vibration features are centrally processed by a Gaussian kernel function so that the mean is zero; the kernel matrix after the central processing is subjected to eigenvalue decomposition, p principal components with a large contribution rate are selected according to the size of the eigenvalue, the second vibration features are projected onto the principal components to obtain a reduced feature matrix;
[0019]
[0020] K c = K-J n K-KJ n +J n KJ n
[0021] wherein K(x,y) is a Gaussian kernel function, x and y are different vectors in the second vibration feature matrix, and sigma is a Gaussian kernel parameter, K c is a kernel matrix, J n is an n-order all-1 matrix.
[0022] Preferably, the data set is divided into multiple folds, and training and testing are performed on different subsets, the steps comprising,
[0023] Step S31, traverse all sigma candidate values, and select a sigma candidate value in turn, according to the total number of sigma candidate values, randomly divide the screened vibration feature vectors into K equal subsets, each subset is called a fold, and a K-fold cross-validation index is generated;
[0024] Step S32, start the K-fold loop, and calculate the reconstruction error of each fold of the current sigma candidate value;
[0025] Step S33, calculate the average reconstruction error of all folds of the current sigma candidate value;
[0026] Step S34, calculate the average reconstruction error of each sigma candidate value, and select the sigma value with the minimum average reconstruction error as the optimal parameter.
[0027] Preferably, the step S5 comprises,
[0028] Step S51, input multi-source information fusion data, embed the data into a vector after passing through an input embedding layer, and map each data to a spatial dimension by position encoding of a position encoder;
[0029] Step S52, pass through a mask multi-head self-attention layer, and output an attention matrix perceiving data relationship;
[0030] Step S53, respectively pass through residual connection and layer normalization, a plurality of single-head self-attention layers, and output the attention matrix to a GRU layer;
[0031] Step S54, transform the features by a full connection layer after passing through a Swish activation layer, and output a prediction value by a Linear layer.
[0032] The application also discloses a test system for the above-mentioned numerical control machine tool feeding system thermal error prediction method based on a Transformer-GRU, the test system comprising a numerical control machine tool feeding system thermal error measurement system and a Transformer-GRU system, the numerical control machine tool feeding system thermal error measurement system comprising a magnetic suction type temperature sensor, a laser interferometer and a piezoelectric acceleration sensor, the magnetic suction type temperature sensor being used for collecting numerical control machine tool feeding system heat source data; the piezoelectric acceleration sensor being used for collecting vibration signal data; and the laser interferometer being used for measuring thermal error data of a measuring point on a lead screw.
[0033] The Transformer-GRU system comprises an encoder and a decoder, the encoder comprises an input embedding layer and position encoding; the decoder is composed of three decoder layers stacked, the first decoder layer comprises a masked multi-head self-attention layer, a residual connection and a layer normalization layer connected in sequence; the second decoder layer comprises a multi-head self-attention layer, a residual connection and a layer normalization layer connected in sequence; the third decoder layer comprises a multi-head self-attention layer and a GRU layer connected in sequence, and is provided with a swish activation layer, a full connection layer and a Linear layer for predicting output.
[0034] The application further discloses a thermal error prediction system for the thermal error prediction method of the Transformer-GRU-based numerical control machine tool feeding system.
[0035] A data acquisition unit is configured to acquire temperature data from the start of machine tool operation to the thermal equilibrium state of the machine tool feeding system through a temperature sensor, continuously acquire vibration data in the operation process through an acceleration sensor, and measure initial positioning errors of each measuring point on the lead screw through a laser interferometer, and the thermal error data is obtained by subtracting the initial positioning errors from all the positioning error data measured after the start of machine tool operation.
[0036] A screening unit is configured to screen first data of temperature sensitive points from the acquired temperature data through fuzzy C-means clustering and grey correlation degree.
[0037] A vibration data processing unit is configured to obtain reduced vibration feature data through empirical mode decomposition combined with wavelet thresholding, Spearman correlation coefficient and kernel principal component analysis.
[0038] A multi-source data fusion unit is configured to fuse the thermal error data, the first data and the vibration feature data after aligning them on a time axis to generate multi-source information fusion data.
[0039] A composite model unit is configured to divide the multi-source information fusion data into a training set and a test set, train a Transformer-GRU composite model using the training set to obtain a trained model, and input the test set into the trained model, and output a prediction value if the error is less than a preset value.
[0040] The application further discloses an electronic device, at least one processor; and
[0041] A memory in communication connection with the at least one processor; wherein
[0042] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the above-mentioned Transformer-GRU-based thermal error prediction method for a feed system of a numerical control machine tool.
[0043] The application also discloses a machine-readable storage medium, which stores instructions for causing a machine to perform the above-mentioned Transformer-GRU-based thermal error prediction method for a feed system of a numerical control machine tool.
[0044] The Transformer-GRU-based thermal error prediction method for a feed system of a numerical control machine tool disclosed by the application comprises the steps of collecting temperature data from the start of machine tool operation to the thermal equilibrium state of the feed system by means of a temperature sensor, continuously collecting vibration data in operation by means of an acceleration sensor, measuring initial positioning errors of each measuring point of a lead screw by means of a laser interferometer, and subtracting the initial positioning errors from all the positioning error data measured after the operation of the machine tool to obtain thermal error data. The collected temperature data is subjected to fuzzy C-means clustering and grey correlation degree analysis, and the first data of temperature sensitive points is screened out. The vibration characteristic data after dimension reduction is obtained by means of empirical mode decomposition combined with wavelet threshold, Spearman correlation coefficient and kernel principal component analysis. The thermal error data, the first data and the vibration characteristic data are aligned and fused on the time axis to generate multi-source information fusion data. The multi-source information fusion data is divided into a training set and a test set, the training set is used to train a Transformer-GRU composite model, a trained model is obtained, and then the test set is input into the model. If the error is less than a preset value, the prediction value is output. The application also discloses a test system and a thermal error prediction system. Through the built feed system thermal error experimental platform, temperature, vibration and thermal error information data are systematically collected. In the verification stage, the thermal error prediction model can be trained and predicted, and the effectiveness of the proposed thermal error prediction model is verified through comparative analysis. The Transformer-GRU composite model introduces a gated recurrent unit. When processing time series data, the GRU can well capture the local dynamic changes in the time series, thus increasing the prediction accuracy and stability. The GRU can more efficiently process short-term dependencies. In the same training time, the performance of the Transformer-GRU composite model is better. Compared with the Transformer model, the Transformer-GRU composite model reduces the RMSE by about 16.7% and the MAE by about 15.4%. The GRU structure in the Transformer-GRU composite model is simple, and the parameter quantity is small. In the process, the convergence speed may be faster than that of the LST M, and the time cost is lower.
[0045] Other features and advantages of the present application will be illustrated in detail in the following specific embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0046] The accompanying drawings, which form a part of the present application, are intended to provide further understanding of the present application and are incorporated herein for explanation by way of illustration of the present application. The illustrative embodiments of the present application, however, are not intended to limit the present application.
[0047] In the drawings:
[0048] Figure 1 A schematic diagram of a Transformer-GRU-based numerical control machine tool feeding system thermal error prediction method according to an embodiment of the present application;
[0049] Figure 2 A Transformer-GRU model structure schematic diagram of the Transformer-GRU-based numerical control machine tool feeding system thermal error prediction method according to an embodiment of the present application;
[0050] Figure 3 A thermal error test system of the Transformer-GRU-based numerical control machine tool feeding system thermal error prediction method according to an embodiment of the present application;
[0051] Figure 4 A temperature rise curve diagram of a temperature measuring point of the Transformer-GRU-based numerical control machine tool feeding system thermal error prediction method according to an embodiment of the present application;
[0052] Figure 5 A vibration measuring point data diagram of the Transformer-GRU-based numerical control machine tool feeding system thermal error prediction method according to an embodiment of the present application;
[0053] Figure 6 A thermal error curve of the Transformer-GRU-based numerical control machine tool feeding system thermal error prediction method according to an embodiment of the present application;
[0054] Figure 7 A prediction result comparison diagram of the Transformer-GRU-based numerical control machine tool feeding system thermal error prediction method according to an embodiment of the present application; DETAILED DESCRIPTION
[0056] The specific embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely intended to illustrate and explain the present application, and are not intended to limit the present application.
[0057] In order to make the person skilled in the art better understand the technical scheme of the present application, the technical scheme in the embodiments of the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by the person skilled in the art without creative labor should belong to the protection scope of the present application.
[0058] It should be noted that the terms "first", "second", "third", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances to implement the embodiments of the present application described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0059] As the core functional component of a numerical control machine tool, how to build a thermal error prediction model of the machine tool feeding system that integrates temperature, vibration and other multi-dimensional data based on multi-source information fusion technology to solve the problem of insufficient prediction accuracy caused by ignoring other influencing factors when modeling with single temperature data, and how to effectively integrate and feature mine different source data to improve the reliability and generalization ability of thermal error prediction. Because the generation and development of thermal deformation is the result of the joint action of multiple factors, not determined by only one parameter such as temperature. For example, the speed change during the operation of the machine tool will change the frictional heat generation of the parts, and then affect the degree and distribution of thermal deformation. The difference in load size will cause different stress states of the parts, which will indirectly cause the difference in thermal deformation. If optimized by only one parameter such as temperature, there will be a large deviation between the prediction result and the actual situation. The present application provides a numerical control machine tool feeding system thermal error prediction method based on Transformer-GRU, as shown in Figures 1-7 The numerical control machine tool feeding system thermal error prediction method based on Transformer-GRU includes,
[0060] Step S1, collecting temperature data from the start of machine tool operation to the thermal equilibrium state of the machine tool feeding system through a temperature sensor, continuously collecting vibration data during operation with an acceleration sensor, measuring the initial positioning error of each measuring point on the screw with a laser interferometer, and subtracting the initial positioning error from all the positioning error data measured after the machine tool starts running to obtain thermal error data;
[0061] Step S2, the collected temperature data is subjected to fuzzy C-means clustering and grey correlation degree screening to obtain first data of temperature sensitive points;
[0062] Step S3, the vibration characteristic data after dimension reduction is obtained through empirical mode decomposition combined with wavelet threshold, Spearman correlation coefficient and kernel principal component analysis;
[0063] Step S4, the thermal error data, the first data and the vibration characteristic data are aligned on a time axis and then fused to generate multi-source information fusion data;
[0064] Step S5, the multi-source information fusion data is divided into a training set and a test set, the training set is used to train a Transform-GRU composite model to obtain a trained model, and the test set is input into the trained model, and if an error is less than a preset value, a prediction value is output.
[0065] The disclosed CNC machine tool feeding system thermal error prediction method based on the Transformer-GRU, through steps S1-S5, the temperature data from the start of the machine tool operation to the thermal equilibrium state of the feeding system is collected by the temperature sensor, the vibration data in operation is continuously collected by the acceleration sensor, the initial positioning error of each measuring point of the lead screw is measured by the laser interferometer, and the thermal error data is obtained by subtracting the initial positioning error from all the positioning error data measured after the machine tool runs. The collected temperature data is subjected to fuzzy C-means clustering and grey correlation analysis, and the first data of the temperature sensitive point is screened out. The vibration characteristic data after dimension reduction is obtained by empirical mode decomposition combined with wavelet threshold, Spearman correlation coefficient and kernel principal component analysis. The thermal error data, the first data and the vibration characteristic data are aligned and fused on the time axis to generate multi-source information fusion data. The multi-source information fusion data is divided into a training set and a test set, the training set is used to train the Transformer-GRU composite model, the trained model is obtained, and then the test set is input into the model, if the error is less than the preset value, the prediction value is output. Through the built feeding system thermal error experimental platform, the temperature, vibration and thermal error information data are systematically collected. In the verification stage, the thermal error prediction model training and prediction can be carried out, and the effectiveness of the proposed thermal error prediction model is verified through comparative analysis. The Transformer-GRU composite model introduces the gated recurrent unit, when processing time series data, the GRU can well capture the local dynamic changes in the time series, thus increasing the prediction accuracy and stability. GRU can more efficiently handle short-term dependencies, and in the same training time, the performance of the Transformer-GRU composite model is better. Compared with the Transformer model, the Transformer-GRU composite model reduces the RMSE by about 16.7% and the MAE by about 15.4%. The GRU structure in the Transformer-GRU composite model is simple, the parameter amount is small, and the convergence speed in the process may be faster than LSTM, and the time cost is lower.
[0066] The temperature sensitive point can greatly reflect the temperature rise characteristics of the feeding system and the thermal error change of the ball screw of the feeding system. However, the insensitive temperature measuring point cannot effectively describe the temperature rise characteristics of the machine tool. The temperature measuring point with linear relationship will reduce the interpretability and generalization ability of the model. Therefore, in order to improve the accuracy of the prediction model, the temperature sensitive point needs to be screened out to eliminate unnecessary temperature measuring points.
[0067] Fuzzy C-means clustering (FCM) is a clustering algorithm based on fuzzy theory, which allows data points to belong to multiple clusters simultaneously, each data point has different membership degrees to different clusters, the value is between 0 and 1, and the sum of the membership degrees of all clusters is 1, unlike traditional K-means which strictly divides data points into a certain cluster. The cluster centers and the membership degrees of data points to each cluster are determined by minimizing the objective function. The objective function usually considers the distance of data points to each cluster center and the corresponding membership weight, and the membership matrix and cluster center are updated iteratively until the convergence condition is reached.
[0068] Grey relational analysis (GRA) is a method for analyzing the correlation between factors in uncertain and incomplete information systems. By calculating the grey correlation degree between the reference sequence and the comparison sequence, the similarity or proximity between them is measured. The noise in the vibration data is removed by empirical mode decomposition combined with wavelet thresholding (EMD-WT). FCM clustering and GRA are a commonly used method for screening temperature sensitive points, which can effectively screen out temperature sensitive points. FCM clustering algorithm classifies the measuring points into different categories according to the membership degree, and GRA calculates the measuring point with the maximum correlation degree in each category. The temperature sensitive points screened out by this method are shown in Table 1.
[0069] Table 1 Temperature sensitive points
[0070]
[0071] In the machine tool running process, the vibration data collected by the acceleration sensor contains a large amount of environmental noise, which seriously affects the precision of the feed system thermal error prediction, so the EMD-WT is used to denoise the collected vibration data. The main function of EMD is to decompose the vibration signal data from high frequency to low frequency into multiple single frequency intrinsic mode functions (IMF) and a residual, and use the variance contribution rate to measure each IMF, and retain the IMFs and the residual whose variance contribution rate is greater than or equal to the first preset threshold. Wavelet threshold denoising is to use the multi-resolution analysis characteristics of wavelet transform to decompose the signal into different scale frequency bands, and to remove noise by threshold processing each frequency band. The preferred hard threshold method adopted by the present application is to set the frequency band coefficient less than the second preset threshold to zero, and retain the coefficient greater than the second preset threshold, and finally combine the denoised IMF and the residual term to obtain the denoised signal. In a more preferred case of the present application, in step S3, the vibration is decomposed from high frequency to low frequency into multiple single frequency intrinsic mode functions (IMF) and a residual, and each IMF is measured by a variance contribution rate, and the IMFs and the residual whose variance contribution rate is greater than or equal to the first preset threshold are retained.
[0072] Using the multi-resolution analysis characteristics of wavelet transform, the signal is decomposed into different scale frequency bands, and the second preset threshold is processed for each frequency band to remove noise, and the coefficients greater than the second preset threshold are retained, and the denoised IMF and the residual term are combined to obtain the denoised vibration signal data.
[0073] The features collected by the present method are temperature and vibration. The temperature is measured in real time by a temperature sensor, and the collected temperature data is divided into several segments, and the average value of each segment is taken as the temperature feature of the machine tool running in that time period. In a more preferred case of the present application, the vibration features are extracted from the denoised vibration signal data;
[0074] The vibration data is divided into N segments same as the temperature time period, and at least 15 features are extracted from the time domain, including mean, variance, standard deviation, skewness, kurtosis, peak value, peak-to-peak value, root mean square, peak factor, waveform factor, pulse factor, margin factor, kurtosis factor, and energy;
[0075] At least 4 features are extracted from the frequency domain, including center of gravity frequency, mean square frequency, frequency variance, and frequency standard deviation, and the energy features of 8 nodes of the third layer of wavelet transform in the time-frequency domain are extracted.
[0076] In order to make the screened key vibration features more clearly reflect the internal correlation between them and the thermal error, make the logic of the whole thermal error analysis process more clear, and make the result more easy to understand and explain. In the more preferred case of the present application, all vibration features need to pass the calculation of the Spearman Correlation Coefficient (SCC), and the second vibration feature that meets the preset condition of the correlation degree with the thermal error change of the feeding system is screened out.
[0077] The Spearman Correlation Coefficient is a non-parametric statistical method suitable for ordered variables, which is used to evaluate the correlation between two variables. All extracted vibration features need to pass the SCC calculation, and the features that meet the required correlation degree with the thermal error change of the feeding system are screened out. The SCC calculation is as follows,
[0078]
[0079] d i =R(A i )-R(B i )
[0080] Wherein, R s is the Spearman Correlation Coefficient, n is the sample number, R(A i ) is the rank of variable A at the i-th sample point, R(B i ) is the rank of variable B at the i-th sample point, d i is the rank difference of variables A and B at the i-th sample point. R s = 1 indicates that the variables have a completely positive monotonic relationship, R s = -1 indicates that the variables have a completely negative monotonic relationship, R s = 0 indicates that the variables have no relationship, 0 < R s < 1 indicates that the variables have a positive monotonic relationship, -1 < R s < 0 indicates that the variables have a negative monotonic relationship.
[0081] For example, the collected vibration data contains vibration at 5 measuring points, and a large amount of environmental noise is contained in the data, so it is necessary to first use EMD-WT to denoise the vibration data. Then the features of each vibration data are extracted in time domain, frequency domain and time-frequency domain. The collected features are divided into 140-dimensional vibration feature vectors according to the type. When this is input as the vibration part of the prediction model, the dimension of the input data is too large, and not all vibration feature vectors can accurately describe the thermal error change. Therefore, the SCC is used to screen out the features that meet the required correlation degree with the thermal error change of the feeding system, and a total of 8 vibration feature vectors with SCC greater than 0.85 are screened out as shown in Table 2.
[0082] Table 2 Correlation coefficient of screened vibration feature vector
[0083]
[0084] The resulting vibration feature vectors are numerous, necessitating KPCA dimensionality reduction. This involves calculating the Gaussian kernel function and determining the kernel parameter σ. Using KPCA-based K-fold cross-validation, σ = 10 was selected as the optimal value from four candidate values: 0.1, 1, 10, and 100. The cumulative contribution rate of the eight vibration vectors was calculated using KPCA with σ = 10. A higher cumulative contribution rate indicates that the reduced feature vectors better represent the original feature vectors, resulting in less information loss. Principal components with a cumulative contribution rate greater than 95% were selected for dimensionality reduction, yielding 3D vibration feature vectors.
[0085] Kernel Principal Component Analysis (KPCA) is a method for dimensionality reduction of large amounts of nonlinear data. It projects the original data into a high-dimensional space using a kernel function, making the nonlinear data linearly separable. KPCA implicitly calculates the inner product of the data in the high-dimensional space through the kernel function, thus avoiding complex calculations directly in the high-dimensional space. In a more preferred embodiment of this invention, the second vibration feature is centered using a Gaussian kernel function to achieve a mean of zero; the centered kernel matrix is then subjected to eigenvalue decomposition, and p principal components with the largest contribution rates are selected based on the magnitude of the eigenvalues. The second vibration feature is then projected onto these principal components to obtain the dimensionality-reduced feature matrix.
[0086]
[0087] K c =KJ n K-KJ n +J n KJ n
[0088] Where K(x,y) is the Gaussian kernel function, × and y are different vectors in the second vibration characteristic matrix, σ is the Gaussian kernel parameter, and K c For the kernel matrix, J n It is an n-order matrix of all 1s. The first step is to construct the characteristic matrix, matrix X = [x1, x2, ..., x...]. m Suppose there exists a nonlinear mapping. Projecting the feature matrix onto a high-dimensional space results in a high-dimensional feature matrix, which can be expressed as follows:
[0089] φ(x)=[φ(x1),φ(x2),...,φ(x m )]
[0090] in, vibration feature vectors mapped to a high-dimensional space.
[0091] Second step, construct Gaussian kernel function; third step, calculate kernel matrix K; fourth step, in high-dimensional space, the data needs to be centralized to ensure that the mean of the data is zero, and the kernel matrix K c after centralization is
[0092] K c v i = λ i v i
[0093] Wherein, λ i is the eigenvalue of K c , v i is the principal component in the new feature space.
[0094] Sixth step, according to the size of the eigenvalue, select p principal components with large contribution rate, project the original data onto these principal components, and obtain the reduced feature matrix,
[0095] X' = K c V
[0096] Wherein, X' is the reduced feature matrix, and V is the matrix composed of the first k eigenvectors v.
[0097] K-fold cross validation is a commonly used model evaluation method, which divides the data set into multiple folds, and trains and tests on different subsets, so as to more comprehensively evaluate the performance of the model. In the more preferred case of the present application, the data set is divided into multiple folds, and training and testing are carried out on different subsets, and the steps include,
[0098] Step S31, traverse all σ candidate values, and select σ candidate values in turn, according to the total number of σ candidate values, randomly divide the screened vibration feature vectors into K equal subsets, each subset is called a fold, and K-fold cross validation index is generated;
[0099] Step S32, start K-fold cycle, calculate the reconstruction error of each fold of the current σ candidate value; for the / th fold, it is used as the test set, and the remaining K-1 folds are used as the training set. Calculate the kernel matrix of the training set and the test set, and obtain the reduced verification set through KPCA processing. Then reconstruct the kernel matrix and calculate the Frobenius norm error between the test set kernel matrix.
[0100] Step S33, calculate the average reconstruction error of all folds of the current σ candidate value;
[0101] Step S34, calculate the average reconstruction error of each sigma candidate value, and select the sigma value with the minimum average reconstruction error as the optimal parameter.
[0102] For strong time-dependent tasks such as machine tool thermal error prediction, the global dependence modeling advantage of self-attention in the Transformer is retained, the local time pattern capture ability is strengthened through the Gated Recurrent Unit (GRU), and the gradient characteristics of Swish are combined to improve the prediction accuracy and convergence stability of the model in dynamic scenarios. Taking the Transformer model as the main framework, the GRU neural network is used instead of the Feed-Forward Network (FFN), and the Swish activation layer is introduced to enhance the non-linear ability. As shown in Figure 2 As shown in the more preferred case of the present application, the step S5 comprises,
[0103] Step S51, input multi-source information fusion data, embed the data into a vector after passing through an input embedding layer, and map each data to a spatial dimension by a position encoder for position encoding;
[0104] Step S52, pass through a mask multi-head self-attention layer to output an attention matrix that perceives data relationships;
[0105] Step S53, respectively pass through residual connection and layer normalization, a plurality of single-head self-attention layers, and output the attention matrix to a GRU layer;
[0106] Step S54, the feature is transformed by the full connection layer after the Swish activation layer, and the prediction value is output by the Linear layer. The transformer is a model completely based on the self-attention mechanism, and the main structure is two parts of an encoder and a decoder. The encoder part is composed of an input embedding layer (IE) and its position encoding (PE), an encoder. The encoder can be composed of multiple layers of encoder stacking, and each layer of the encoder has two sublayers connected. The first sublayer is a multi-head self-attention layer (MSA). The second sublayer is a feed-forward neural network (FFN), and each sublayer is followed by a residual connection (RC) and a layer normalization (LN) to improve the training stability of the model and accelerate convergence. The decoder part is composed of an output embedding layer and its PE, a decoder and an output layer (linear and Softmax layer). The decoder can also be composed of multiple layers of decoder stacking, and each layer of the decoder has three sublayers, the first sublayer is a masked multi-head self-attention layer (MMSA), the second sublayer is an encoder-decoder attention layer (EA), and the third sublayer is a FFN. Similarly, each sublayer is also followed by RC and LN. The role of the IE is to express the input word or symbol information in the form of a vector. The role of the PE is to map each information to a fixed space dimension. MSA, as the core of the transformer model, is composed of multiple single-head self-attention (SSA) layers.
[0107] The application also discloses a test system for the above-mentioned transformer-GRU-based numerical control machine tool feeding system thermal error prediction method, the test system comprises a numerical control machine tool feeding system thermal error measurement system and a transformer-GRU system, the numerical control machine tool feeding system thermal error measurement system comprises a magnetic suction type temperature sensor, a laser interferometer and a piezoelectric acceleration sensor, the magnetic suction type temperature sensor is used for collecting numerical control machine tool feeding system heat source data; the piezoelectric acceleration sensor is used for collecting vibration signal data; and the laser interferometer is used for measuring thermal error data of a measuring point on a lead screw.
[0108] The Transformer-GRU system comprises an encoder and a decoder, the encoder comprises an input embedding layer and position encoding; the decoder is composed of three decoder layers stacked, the first decoder layer comprises a masked multi-head self-attention layer, a residual connection and a layer normalization layer connected in sequence; the second decoder layer comprises a multi-head self-attention layer, a residual connection and a layer normalization layer connected in sequence; and the third decoder layer comprises a multi-head self-attention layer and a GRU layer connected in sequence, and is provided with a swish activation layer, a full connection layer and a Linear layer for predicting an output.
[0109] MMSA is different from MSA, and the first sub-layer is a masked self-attention layer. This is because the decoding process is generated in sequence, and the i+1 information cannot be given when the i information is predicted. GRU is a simplified version of long short-term memory network, which can capture long-term dependencies in time series and is suitable for long sequence data. GRU mainly includes two gate structures: update gate (UG) and reset gate (RG).
[0110] The magnetic temperature sensor, the piezoelectric acceleration sensor and the laser interferometer respectively collect heat source data, vibration signals and screw thermal error data, comprehensively cover the key physical quantities affecting the thermal error of the feeding system, ensure the integrity and pertinence of the original data, and provide high-quality input for subsequent modeling. The multi-head self-attention mechanism of the Transformer can capture the global dependence between multiple source data (such as the cross-dimensional correlation between temperature, vibration and thermal error), and the introduction of GRU strengthens the capture of time series dynamic characteristics, such as the cumulative change law of thermal error with running time. The combination of the two makes up for the shortcomings of a single model in global correlation or time series modeling, and is more suitable for the complex dynamic characteristics of thermal error. The residual connection and layer normalization layer of the decoder improve the stability and convergence efficiency of model training; the Swish activation layer enhances the expression ability of nonlinear relationships such as temperature sudden change and vibration coupling to the implicit influence on thermal error through self-gating characteristics. The full connection layer and the Linear layer realize the accurate mapping of features to thermal error prediction values, and overall improve the adaptability of the model to complex working conditions. Through multi-source data fusion and model structure optimization, the system can effectively learn the generation mechanism and change law of thermal error, and the output prediction value can accurately reflect the thermal error state of the feeding system, providing a reliable basis for real-time error compensation and precision optimization of the numerical control machine tool, and finally improving the machining precision and equipment stability.
[0111] For example, the test system built by the present application is a thermal error experiment platform for a feeding system. The experimental equipment includes a BL-V11 model CNC machine tool, an SJ6000 laser interferometer, an intelligent thermal characteristic tester, seven PT100 magnetic temperature sensors, a DHDAS dynamic signal acquisition and analysis system, and five piezoelectric acceleration sensors. The heat sources of the feeding system include heat generated by motor work loss, friction heat of bearings and lead screws, nuts and lead screws, and guide rail pairs. The temperature sensors are arranged on the main heat sources. Similarly, the vibration sensors are arranged at positions with large vibration amplitudes. In the experiment, the Y-axis feeding system ball screw is selected as the measurement object, and five thermal error measurement points (P1, P2, P3, P4, and P5) are arranged at every 100 mm on the 0-500 mm stroke, as shown in FIG. 1. Figure 3
[0112] The running experiment process of the thermal error experiment platform for the feeding system includes,
[0113] (1) Before the machine tool runs, the initial positioning error of each measurement point on the lead screw is measured by the laser interferometer to exclude the influence of the initial error.
[0114] (2) After the machine tool runs, the Y-axis is run empty in the 0-500 mm range at a feeding speed of 8 m / min. The acceleration sensor continuously acquires during the running process, and the sampling frequency is 1000.
[0115] (3) When the machine tool runs for 120 s, stop the operation, stop acquiring the vibration signal. At the same time, the SJ6000 laser interferometer measures the thermal error measurement points of the lead screw. The measurement is performed twice to avoid the influence of random error, and the average value is taken as the positioning error data of each measurement point in 120 s.
[0116] (4) After the laser interferometer completes the measurement, the next group of samples is collected, the machine tool is run, and the vibration signal acquisition is started. After 120 s, stop the machine tool, and measure the positioning precision data. Repeat the operation, record each group of sample data, until the feeding system of the machine tool reaches the thermal equilibrium state. The temperature sensor sampling time interval is 5 s, and the acquisition is started from the beginning of the machine tool running to the acquisition stop when the feeding system of the machine tool reaches the thermal equilibrium state.
[0117] (5) The temperature data in the later stage needs to be aligned on the time axis according to the acquired vibration signal, and segmented as the temperature data corresponding to each group of samples.
[0118] (6) All the measured positioning error data needs to be subtracted by the initial positioning error to be used as the thermal error data.
[0119] According to the experiment process, 45 groups of data samples of various types of information are collected. The temperature rise of each temperature measurement point is shown in FIG. 2. The thermal error data of each measurement point is shown in FIG. 3. Figure 4 Figure 4 It can be seen that the temperature rise of the inner bearing ΔT2 and the motor ΔT3 changes greatly, reaching about 8.2°C and 7.8°C respectively, and the time to reach thermal equilibrium is longer than other measuring points. This is because the inner bearing and the motor are inside the machine tool structure, the environment is relatively closed, the air flow is slow, and the heat accumulation is large. The temperature rise of the outer bearing ΔT4, the screw nut (axial) ΔT6 and the screw nut (radial) ΔT7 change in the middle, and basically reach a thermal equilibrium state in about 60 minutes. Among them, the temperature rise ΔT6 is about 1°C larger than ΔT7, indicating that the axial size of the screw nut is small, and the temperature rise characteristics of the screw nut during movement can be better reflected. The guide rail temperature rise ΔT5 is the smallest, about 0.5°C, indicating that the heat generated by the guide rail friction is small, and the influence on the thermal error of the screw is small.
[0120] As shown in Figure 5 , the acceleration amplitude of the inner bearing seat V1 and the outer bearing seat V2 is small, and the vibration generated has little effect on the screw. The amplitude of the machine tool workbench V3 is 20m / s 2 inside, and has periodic fluctuations, which has a certain influence on the screw. The amplitude of the screw nut (axial) V4 and the screw nut (radial) V5 is the largest, which is 40-50m / s 2 , and has the greatest influence on the screw. Among them, V1, V2, V3, V4 and V5 are vibration data acquisition points.
[0121] The thermal error of the ball screw of the machine tool feeding system is measured by a laser interferometer, and is saved by its software system. The saved data is the positioning error of each thermal error measuring point of the screw at each time period. In order to obtain the thermal error data, all the data of each measuring point needs to be subtracted from the original positioning error of the measuring point at the machine tool running position, and the thermal error data of each measuring point obtained is as shown in Figure 6 . From the overall trend, all the thermal error curves show an upward trend, indicating that the thermal error at each measuring point position continues to increase over time. The thermal error of each measuring point changes obviously in the first 60 minutes, and the rising rate is significantly slowed down in the last 30 minutes, and only a few measuring points show a slight fluctuation. At the position of the screw measuring point P1 (100mm), the thermal error value is the lowest. At the position of the measuring point P5 (500mm), the thermal error is the largest.
[0122] The temperature and vibration data are fused to obtain a 7-dimensional 45-sample fusion data. With the fusion data and 5 thermal error position points as input and the thermal error as output, a data set is constructed. 85% of the data set is used as the training set and 15% as the test set, and an 8-dimensional input single-output Transformer-G RU composite model is established.
[0123] As shown in Figure 7As shown, the Transformer-GRU composite model reduces by about 16.7% in RMSE, about 15.4% in MAE, and about 29.9% in MSE. This is due to the introduction of the gated recurrent unit in the Transformer-GRU composite model, which captures the local dynamic changes in the time series well when processing time series data, thus increasing the prediction accuracy and stability. Compared with the Transformer-LSTM model, the Transformer-GRU composite model reduces by about 36.9% in RMSE, about 39.1% in MAE, and about 59.9% in MSE. This is because the GRU structure in the Transformer-GRU composite model is simple and has fewer parameters, and the convergence speed in the process may be faster than LSTM, with lower time cost. In the short-term time series information of thermal error prediction, the GRU part of the Transformer-GRU composite model can more efficiently handle short-term dependencies, while the complex structure of LSTM may be too redundant when handling short-term dependencies. Therefore, the performance of the Transformer-GRU composite model is better in the same training time.
[0124] The application also discloses a thermal error prediction system for the above-mentioned thermal error prediction method for a numerical control machine tool feeding system based on a Transformer-GRU, which comprises,
[0125] A data acquisition unit is configured to acquire temperature data from the start of machine tool operation to the thermal equilibrium state of the machine tool feeding system through a temperature sensor, continuously acquire vibration data during operation using an acceleration sensor, and measure the initial positioning error of each measuring point on the lead screw using a laser interferometer. All positioning error data measured after the start of machine tool operation minus the initial positioning error is the thermal error data;
[0126] A screening unit is configured to perform fuzzy C-means clustering and grey correlation degree screening on the acquired temperature data to obtain first data of temperature sensitive points;
[0127] A vibration data processing unit is configured to obtain reduced vibration feature data by combining empirical mode decomposition, wavelet thresholding, Spearman correlation coefficient, and kernel principal component analysis;
[0128] A multi-source data fusion unit is configured to align and fuse the thermal error data, the first data, and the vibration feature data on a time axis to generate multi-source information fusion data;
[0129] The composite model unit is used for dividing the multi-source information fusion data into a training set and a test set, training the Transform-GRU composite model by using the training set, and obtaining a trained model; and inputting the test set into the trained model, and outputting a prediction value if an error is less than a preset value.
[0130] The data acquisition unit of the thermal error prediction system collects temperature, vibration and thermal error data in a targeted manner, covers multi-dimensional information related to thermal error of the machine tool feeding system, provides complete and accurate raw data support for subsequent analysis, and ensures that the characteristics of the research object are fully captured. The screening unit effectively extracts temperature sensitive point data by fuzzy C-means clustering and grey correlation analysis, and reduces redundant temperature information;The vibration data processing unit obtains reduced vibration features closely related to thermal error through multi-step processing, which reduces the data dimension and highlights the key influencing factors, and provides high-quality input for modeling. The multi-source data fusion unit aligns and fuses thermal error data, temperature sensitive point data and vibration feature data on the time axis, breaks the isolated state of different types of data, forms multi-source information fusion data that can comprehensively reflect the system state, and is more in line with the complex mechanism of thermal error formation. The composite model unit trains and tests the fusion data by using the Transform-GRU composite model, combines the global dependence capturing capability of the Transform and the processing advantage of the GRU on the time sequence features, divides the data set and the error verification mechanism reasonably, and finally outputs the prediction value meeting the accuracy requirement, providing a reliable basis for machine tool thermal error compensation and precision optimization, and helping to improve the machining quality and equipment stability.
[0131] The application further discloses an electronic device, at least one processor;And
[0132] The memory is in communication connection with the at least one processor;Wherein,
[0133] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the above-mentioned numerical control machine tool feeding system thermal error prediction method based on Transform-GRU.
[0134] The application further discloses a machine readable storage medium, and the machine readable storage medium stores instructions for causing a machine to execute the above-mentioned numerical control machine tool feeding system thermal error prediction method based on Transform-GRU.
[0135] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all described as a combination of a series of actions, but those skilled in the art should know that the present application is not limited to the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0136] From the above description of the embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software and the necessary universal hardware platform. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in various embodiments or some parts of the embodiments.
[0137] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment mainly describes the differences from other embodiments. In particular, for the system or system embodiments, since they are basically similar to the method embodiments, they are described more simply, and the relevant parts can be referred to the part of the method embodiments. The above-described system and system embodiments are only illustrative, and the units described as separate components can be or can not be physically separated, and the components displayed as units can be or can not be physical units, i.e., they can be located in one place or distributed on multiple network units. According to actual needs, some or all of the modules can be selected to achieve the purpose of the embodiment. Those skilled in the art can understand and implement without creative labor.
[0138] The above provides a detailed description of the method and device for providing service information provided by the present application, and the principle and implementation manner of the present application are described by specific examples. The above description of the embodiments is only used to help understand the method and concept of the present application; at the same time, for those skilled in the art, according to the concept of the present application, the specific implementation manner and application range will be changed. In conclusion, the content of the specification should not be understood as a limitation of the present application.
Claims
1. A method for predicting thermal errors in a CNC machine tool feed system based on Transformer-GRU, characterized in that, The method for predicting thermal errors in CNC machine tool feed systems based on Transformer-GRU includes: Step S1: Temperature data is collected from the start of machine tool operation to the point where the machine tool feed system reaches thermal equilibrium using a temperature sensor. Vibration data is continuously collected during operation using an accelerometer. The initial positioning error of each measuring point on the lead screw is measured using a laser interferometer. The thermal error data is obtained by subtracting the initial positioning error from all the positioning error data measured after the machine tool starts operating. Step S2: Perform fuzzy C-means clustering and grey relational analysis on the collected temperature data to filter out the first data of temperature-sensitive points; Step S3: Obtain the dimensionality-reduced vibration characteristic data by combining empirical mode decomposition with wavelet thresholding, Spearman correlation coefficient, and kernel principal component analysis; Step S4: Align the thermal error data, the first data, and the vibration feature data on the time axis and then fuse them to generate multi-source information fusion data; Step S5: Divide the multi-source information fusion data into a training set and a test set. Use the training set to train the Transformer-GRU composite model to obtain the trained model. Input the test set into the trained model. If the error is less than the preset value, output the predicted value.
2. The method for predicting thermal errors in a CNC machine tool feed system based on Transformer-GRU according to claim 1, characterized in that, In step S3, the vibration is decomposed into multiple single-frequency intrinsic mode functions (IMFs) and a residual from high frequency to low frequency, and each IMF is measured by the variance contribution rate. IMFs and residuals with variance contribution rates greater than or equal to the first preset threshold are retained. By utilizing the multi-resolution analysis characteristics of wavelet transform, the signal is decomposed into frequency bands of different scales, and a second preset threshold is applied to each frequency band to remove noise. Coefficients larger than the second preset threshold are retained, and the denoised IMF and residual terms are merged to obtain the denoised vibration signal data.
3. The method for predicting thermal errors in CNC machine tool feed systems based on Transformer-GRU according to claim 2, characterized in that, Extract vibration features from the denoised vibration signal data; The vibration data is divided into N segments, which are the same as the temperature time period. At least 15 features are extracted from the time domain, including mean, variance, standard deviation, skewness, kurtosis, peak value, peak-to-peak value, root mean square, peak factor, waveform factor, impulse factor, margin factor, kurtosis factor, and energy. At least four features are extracted from the frequency domain, including centroid frequency, mean square frequency, frequency variance, and frequency standard deviation, as well as the energy features of eight nodes in the third layer of wavelet transform in the time-frequency domain.
4. The method for predicting thermal errors in a CNC machine tool feed system based on Transformer-GRU according to claim 3, characterized in that, All vibration characteristics need to be calculated using the Spearman correlation coefficient to select the second vibration characteristic whose correlation with the thermal error change of the feed system meets the preset conditions.
5. The method for predicting thermal errors in a CNC machine tool feed system based on Transformer-GRU according to claim 4, characterized in that, The second vibration feature is centered using a Gaussian kernel function to make its mean zero; the eigenvalue decomposition is performed on the centered kernel matrix, and p principal components with large contribution rates are selected according to the magnitude of the eigenvalues. The second vibration feature is then projected onto the principal components to obtain the dimension-reduced feature matrix. K c =K-J n K-KJ n +J n KJ n Where K(x,y) is the Gaussian kernel function, × and y are different vectors in the second vibration characteristic matrix, σ is the Gaussian kernel parameter, and K C For the kernel matrix, J n It is an n-order all-one matrix.
6. The method for predicting thermal errors in a CNC machine tool feed system based on Transformer-GRU according to claim 5, characterized in that, The dataset is divided into multiple folds, and training and testing are performed on different subsets. The steps include: Step S31: Traverse all σ candidate values and select σ candidate values in turn. Based on the total number of σ candidate values, randomly divide the selected vibration feature vector into K subsets of equal size. Each subset is called a fold, and generate a K-fold cross-validation index. Step S32: Start the K-fold loop and calculate the reconstruction error of each fold of the current σ candidate value; Step S33: Calculate the average reconstruction error of all folds of the current candidate σ value; Step S34: Calculate the average reconstruction error for each candidate σ value, and select the σ value with the smallest average reconstruction error as the optimal parameter.
7. The method for predicting thermal errors in CNC machine tool feed systems based on Transformer-GRU according to any one of claims 1-6, characterized in that, Step S5 includes, Step S51: Input multi-source information fusion data, after passing through the input embedding layer, the data is embedded into a vector, and the position encoder performs position encoding on each data and maps it to the spatial dimension; Step S52: After passing through the masked multi-head self-attention layer, an attention matrix that perceives data relationships is output. Step S53: After passing through residual connections and layer normalization, and multiple single-head self-attention layers, the attention matrix is output to the GRU layer. In step S54, after passing through the Swish activation layer, the features are transformed by the fully connected layer, and the predicted value is output by the Linear layer.
8. A test system for predicting thermal errors in a CNC machine tool feed system based on Transformer-GRU as described in any one of claims 1-7, characterized in that, The testing system includes a CNC machine tool feed system thermal error measurement system and a Transformer-GRU system. The CNC machine tool feed system thermal error measurement system includes a magnetic temperature sensor, a laser interferometer, and a piezoelectric accelerometer. The magnetic temperature sensor is used to collect heat source data of the CNC machine tool feed system; the piezoelectric accelerometer is used to collect vibration signal data; and the laser interferometer is used to measure the thermal error data of the measuring points on the leadscrew. The Transformer-GRU system includes an encoder and a decoder, and the encoder includes an input embedding layer and position encoding. The decoder consists of three decoder layers stacked together. The first decoder layer includes a masked multi-head self-attention layer, a residual connection layer, and a layer normalization layer connected in sequence. The second decoder layer includes a multi-head self-attention layer, a residual connection layer, and a layer normalization layer connected in sequence. The third decoder layer includes a multi-head self-attention layer and a GRU layer connected in sequence, and is equipped with a swish activation layer, a fully connected layer, and a linear layer for predicting the output.
9. A thermal error prediction system for the thermal error prediction method of the CNC machine tool feed system based on Transformer-GRU as described in any one of claims 1-7, characterized in that, The thermal error prediction system includes, The data acquisition unit is used to collect temperature data from the start of machine tool operation to the point where the machine tool feed system reaches thermal equilibrium through temperature sensors. It also uses an accelerometer to continuously collect vibration data during operation and a laser interferometer to measure the initial positioning error of each measuring point on the lead screw. The thermal error data is obtained by subtracting the initial positioning error from all the positioning error data measured after the machine tool starts operating. The filtering unit is used to filter the collected temperature data by performing fuzzy C-means clustering and grey relational analysis to select the first data of temperature-sensitive points; The vibration data processing unit is used to obtain dimensionality-reduced vibration characteristic data through empirical mode decomposition combined with wavelet thresholding, Spearman correlation coefficient, and kernel principal component analysis. A multi-source data fusion unit is used to align the thermal error data, the first data, and the vibration feature data on the time axis and then fuse them to generate multi-source information fusion data. The composite model unit is used to divide the multi-source information fusion data into a training set and a test set. The Transformer-GRU composite model is trained using the training set to obtain a trained model. The test set is input into the trained model, and if the error is less than a preset value, the predicted value is output.
10. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores instructions for causing the machine to execute the thermal error prediction method for CNC machine tool feed systems based on Transformer-GRU as described in any one of claims 1-7.
Citation Information
Patent Citations
A thermal optimization method and device for machine tool spindles based on the Taguchi method.
CN108763682B
Cited By
Method and device for determining state of health of flow battery and electronic equipment
CN121348119A