Machine tool spindle thermal error modeling prediction and compensation method based on physical-data hybrid driving

By employing a physics-data hybrid approach, combining collinear clustering and grey relational analysis, a neural network model is constructed. This addresses the problem of insufficient accuracy in modeling thermal errors of machine tool spindles in existing technologies, achieving high-precision thermal error prediction and compensation.

CN121234698APending Publication Date: 2025-12-30SHANGHAI JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510910761.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-02
Publication Date
2025-12-30

AI Technical Summary

Technical Problem

Existing CNC machine tool spindle thermal error modeling methods mainly rely on experimental data-driven approaches, lacking consideration of physical laws, resulting in insufficient model prediction accuracy and difficulty in meeting the needs of high-precision machining.

Method used

A physical-data hybrid driving method is adopted. By synchronously collecting machine tool spindle temperature, strain and thermal error data, collinear clustering and grey relational analysis are performed to construct a physical-data hybrid driving neural network model. Then, multiple linear regression fitting is performed to establish a machine tool spindle thermal error prediction model.

Benefits of technology

It significantly improves the accuracy and stability of strain measurement, enhances the efficiency and accuracy of thermal error modeling, and enables more precise thermal error prediction and compensation, meeting the needs of high-precision machining.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121234698A_ABST
    Figure CN121234698A_ABST
Patent Text Reader

Abstract

The invention provides a machine tool spindle thermal error modeling prediction and compensation method based on physical-data hybrid drive, and the method comprises the steps: S1, synchronously collecting key position data in a process that a machine tool spindle operates from a cold machine state to a thermal balance state; s2, carrying out collinearity clustering analysis and grey relational degree analysis on the acquired temperature data of the measuring points, and selecting a plurality of sensitive temperature measuring point data; s3, constructing a physical-data hybrid drive neural network model based on a thermal expansion physical equation, inputting the sensitive temperature measurement point data as an independent variable and the corresponding strain data as a dependent variable into a neural network for training, and performing strain prediction; and S4, performing multiple linear regression fitting on strain data predicted by the neural network model and thermal error data acquired by experiments, establishing a thermal error prediction model of the machine tool spindle, and performing thermal error compensation according to a prediction result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of precision technology of CNC machining tools, specifically, it relates to a method for modeling, predicting and compensating for thermal errors of machine tool spindles based on physical-data hybrid drive. Background Technology

[0002] With the continuous advancement of science and technology, modern manufacturing technology is moving towards higher precision, higher efficiency, and higher quality. This also places more stringent requirements on the precision of CNC machine tools, and the need to improve their machining accuracy is becoming increasingly urgent.

[0003] During machine tool operation, heat is generated by motor drive, mechanical friction, and cutting processes, forming multiple heat sources within the machine tool. Under the influence of these heat sources, the machine tool produces an uneven temperature field distribution. This uneven temperature field causes thermal deformation of key machine tool components, with the most significant impact on the lead screw, bearings, spindle box, and crossbeam. Although the amount of thermal deformation in these components is small, its impact on high-precision machining is not negligible. Thermal deformation directly leads to thermal errors during machining, which manifest in several ways: First, positioning errors, as the thermal elongation of the lead screw causes a deviation between the actual and commanded positions of the worktable; second, shape errors, as the thermal deformation of the spindle affects the relative position of the tool and workpiece, leading to deviations in the machining contour; and third, dimensional errors, as the overall thermal deformation of the machine tool alters the machining coordinate system, affecting the accuracy of the machining dimensions. These errors accumulate over time, ultimately affecting the machining accuracy of the machine tool. Statistics show that thermal errors account for 40%-70% of machining errors in precision machine tools, and even higher in extreme cases. For precision and ultra-precision machining, thermal error is often a key factor limiting the improvement of machine tool machining accuracy. The spindle is the core component and main heat source of CNC machine tools; therefore, establishing an effective spindle thermal error modeling method is crucial for current research on CNC machine tool thermal error prediction and compensation.

[0004] Extensive research has been conducted on thermal error modeling methods for CNC machine tool spindles. However, traditional thermal error prediction models primarily rely on experimental data to drive the model, lacking consideration of physical laws. This leads to problems such as insufficient prediction accuracy and limited generalization ability, making it difficult to meet the demands of high-precision machining. Therefore, a thermal error modeling and compensation method that combines physical laws and experimental data is needed. Summary of the Invention

[0005] To address the shortcomings of existing technologies, the purpose of this invention is to provide a method for modeling, predicting, and compensating for thermal errors in machine tool spindles based on a physical-data hybrid drive.

[0006] The method for modeling, predicting, and compensating machine tool spindle thermal errors based on physical-data hybrid drive provided by the present invention includes:

[0007] Step S1: Synchronously collect temperature, strain, and thermal error data at key locations during the process of the machine tool spindle moving from a cold state to a thermal equilibrium state;

[0008] Step S2: Perform collinearity clustering analysis and grey relational analysis on the collected temperature data of the measurement points, and select the most representative sensitive temperature measurement point data;

[0009] Step S3: Based on the physical equation of thermal expansion, construct a physical-data hybrid driven neural network model, using the sensitive temperature measurement point data as the independent variable and the corresponding strain data as the dependent variable, and input the model into the neural network for training to predict strain.

[0010] Step S4: Perform multiple linear regression fitting on the strain data predicted by the neural network model and the thermal error data collected experimentally to finally establish a machine tool spindle thermal error prediction model, and perform compensation based on the prediction results. The machine tool spindle thermal error modeling, prediction, and compensation system based on a physics-data hybrid drive provided by this invention includes:

[0011] Module M1: Synchronously acquires temperature, strain, and thermal error data at key locations during the process of the machine tool spindle transitioning from a cold state to a thermal equilibrium state;

[0012] Module M2: Performs collinearity clustering analysis and grey relational analysis on the collected temperature data from the measurement points, and selects data from several of the most representative sensitive temperature measurement points;

[0013] Module M3: Based on the physical equation of thermal expansion, a physical-data hybrid driven neural network model is constructed. The data of the sensitive temperature measurement points are used as independent variables, and the corresponding strain data are used as dependent variables. The neural network is then trained to predict strain.

[0014] Module M4: Performs multiple linear regression fitting between the strain data predicted by the neural network model and the experimentally collected thermal error data to ultimately establish a machine tool spindle thermal error prediction model, and performs compensation based on the prediction results.

[0015] Compared with the prior art, the present invention has the following beneficial effects:

[0016] 1. This invention utilizes a high-precision optical adaptive deformation measurement technology based on a domain-specific convolution algorithm and a deformation coordination mechanism to extract strain data. By innovatively integrating local feature extraction and global deformation coordination, it significantly improves the measurement accuracy and stability of strain.

[0017] 2. This invention fully guarantees the transitivity requirements by establishing a fuzzy equivalence matrix, while simultaneously satisfying the three key conditions of reflexivity, symmetry, and transitivity, thereby achieving more accurate and reasonable clustering analysis;

[0018] 3. This invention employs fuzzy clustering analysis, which can effectively reduce collinearity among temperature variables, reduce data redundancy, and provide a clear classification basis for subsequent selection of temperature sensitive points, thereby significantly improving the efficiency and accuracy of thermal error modeling.

[0019] 4. This invention uses grey relational analysis to determine the degree of correlation between temperature data at measuring points and thermal errors, thereby selecting the most representative sensitive temperature data at measuring points. The measuring points meet the following conditions: high correlation with thermal errors, able to reflect the characteristics of the main heat sources, reasonable spatial distribution, and easy to install and maintain.

[0020] 5. The model of this invention fully considers the thermal expansion characteristics of key machine tool components, providing a physical basis for subsequent strain prediction based on hybrid driving neural networks.

[0021] 6. The training process of the neural network in this invention uses Adaptive Moment Estimation (Adam) to optimize the parameters of the neural network in order to minimize the total loss function that combines the physical loss term and the data loss term. The learning rate can be adjusted according to the first and second moments of the gradient, which can achieve rapid convergence during the training process and avoid getting trapped in local optima, thereby improving the accuracy and stability of thermal error prediction. Attached Figure Description

[0022] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0023] Figure 1 This is a flowchart of the machine tool spindle thermal error modeling, prediction and compensation method based on physical-data hybrid drive of the present invention.

[0024] Figure 2 This is a preferred embodiment of the present invention, showing the number of clusters and the distance between clusters.

[0025] Figure 3 This is a preferred embodiment of the present invention, showing the correlation between each measuring point and thermal error.

[0026] Figure 4 The thermodynamic diagram is a preferred embodiment of the present invention.

[0027] Figure 5 This is a preferred embodiment of the physical-data hybrid driven neural network structure diagram of the present invention. Detailed Implementation

[0028] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.

[0029] This invention provides a method for modeling, predicting, and compensating machine tool spindle thermal errors based on a physics-data hybrid drive (“physics-data” refers to the combination of physics and data), including:

[0030] Step S1: Synchronously collect temperature, strain, and thermal error data at key locations during the process of the machine tool spindle moving from a cold state to a thermal equilibrium state;

[0031] Step S2: Perform collinearity clustering analysis and grey relational analysis on the collected temperature data of the measurement points, and select the most representative sensitive temperature measurement point data;

[0032] Step S3: Based on the physical equation of thermal expansion, construct a physical-data hybrid driven neural network model, using the sensitive temperature measurement point data as the independent variable and the corresponding strain data as the dependent variable, and input the model into the neural network for training to predict strain.

[0033] Step S4: Perform multiple linear regression fitting on the strain data predicted by the neural network model and the thermal error data collected in the experiment to finally establish a machine tool spindle thermal error prediction model, and make compensation based on the prediction results.

[0034] Furthermore, in step S1, temperature sensors and displacement sensors are respectively set at key positions of the machine tool spindle. Based on a multi-channel data acquisition card and a LabVIEW measurement and control platform, multi-channel synchronous acquisition of temperature and spindle thermal displacement data is achieved through hardware synchronization architecture and software collaborative control.

[0035] Furthermore, in step S1, strain data is extracted using a high-precision optical adaptive deformation measurement technology based on a domain-specific convolution algorithm and a deformation coordination mechanism. This technology significantly improves the measurement accuracy and stability of strain by innovatively integrating local feature extraction and global deformation coordination.

[0036] Furthermore, in step S2, the collinear clustering analysis uses a fuzzy clustering algorithm to establish fuzzy similarity relationships between the measurement points, and then performs cluster analysis on the variables, grouping highly correlated temperature measurement points into one class to form several temperature feature groups. The main analysis steps and principles of the collinear clustering analysis are as follows:

[0037] Step S2A1: Standardize sample data; First, the temperature measurement point data is standardized to simplify subsequent matrix calculations. There are two main methods for standardizing sample data: standard deviation transformation method or range transformation method. In this embodiment, the range transformation method is used to standardize the temperature measurement point data, and the formula is as follows:

[0038]

[0039] Where, x ij For multiple temperature measurement points obtained through measurement, the subscripts i and j represent the dummy index numbers of the measurement point matrix operation.

[0040] Step S2A2: Establish the fuzzy similarity matrix; fuzzy similarity matrix R = [r ij ] p×p There are many methods for constructing fuzzy similarity matrices, such as the reciprocal of absolute value method, the cosine of the included angle method, the distance method, and the correlation coefficient method. This embodiment uses the correlation coefficient method to establish the fuzzy similarity matrix. Let the set of p temperature measurement points be X = {x1, x2, ..., x...} p}, where x i =[x i1 ,x i2 ,…,x im Let m be the m observations of the i-th temperature change (i = 1, 2, ..., p). Then, let r be the correlation coefficient describing the closeness between variables x and y. ij The calculation formula is:

[0041]

[0042] in, In a p×p matrix, the subscripts i and j represent the row and column indexes of the matrix operation.

[0043] Step S2A3: Establish a fuzzy equivalence matrix; In cluster analysis, the accuracy and rationality of the clustering results can only be ensured when the fuzzy matrix simultaneously possesses the three mathematical conditions of reflexivity, symmetry, and transitivity. The fuzzy similarity matrix constructed above can well satisfy the requirements of reflexivity and symmetry, but it cannot fully guarantee the requirement of transitivity. Therefore, it is necessary to construct a special matrix (i.e., a fuzzy equivalence matrix) that can simultaneously satisfy the three key conditions of reflexivity, symmetry, and transitivity, thereby achieving more accurate and rational cluster analysis. This invention uses the squaring method to transform the fuzzy similarity matrix into its transitive closure t(R) (i.e., R→R). 2 →…→R 2k →…), after a finite number of operations, there exists an integer k (k≥1) such that The integer k is an undetermined exponent under transitivity requirements; where, the symbol... Represents the product of two fuzzy matrices. The power of R is called the power of R, and the formula for calculating it is as follows:

[0044]

[0045] Here, the symbol "∧" represents taking the smaller of two numbers, and the symbol "∨" represents taking the larger of two numbers. Let t(R) = R 2k , which is the fuzzy equivalence matrix we are looking for.

[0046] Step S2A4: Cluster Analysis; After solving for the fuzzy equivalence matrix, this matrix can be used to measure the correlation between measurement points and divide the measurement points into several categories, ensuring that each measurement point belongs to a specific category with a certain membership degree for further analysis. The advantage of fuzzy cluster analysis is that it can effectively reduce collinearity between temperature variables, reduce data redundancy, and provide a clear classification basis for subsequent selection of temperature-sensitive points, thereby significantly improving the efficiency and accuracy of thermal error modeling.

[0047] Further, in step S2, the grey relational analysis is used to determine the degree of correlation between the temperature data at the measuring point and the thermal error, thereby selecting the most representative sensitive measuring point temperature data. The measuring points should meet the following conditions: high correlation with thermal error, ability to reflect the characteristics of the main heat source, reasonable spatial distribution, and ease of installation and maintenance. Specifically, this invention uses grey comprehensive relational analysis, characterized by including:

[0048] Step S2B1 involves performing grey absolute correlation analysis; X i ={x i (1),x i (2),…,x i Let (n)} be the sequence of system behaviors, and let So, For X i The initial nulling image is called D, which is called the initial nulling operator. Based on the above definition, let the thermal error sequence be X0, and the sequence of temperature measurement point i be X... i Their initial zeroing images are as follows:

[0049]

[0050] Then define ε 0i For X i Absolute grey relational degree relative to X0:

[0051]

[0052] in:

[0053]

[0054] Among them, S0, S iThis is an intermediate form;

[0055] Step S2B2: Perform grey relative correlation analysis; let X i ={x i (1),x i (2),…,x i Let (n)} be the sequence of system behaviors, and let: x i (k)c=x i (k) / x i (1), (k = 1, 2, ..., n). Then, X i C = X' i ={x i (1) c, x i (2) c,…,x i (n)c} is X i The initial value image of C is called the initialization operator. Based on the above definition, let the thermal error sequence be X0, and the sequence of temperature measurement point i be X... i Their initial values ​​are as follows:

[0056] X′0={x′0(1),x′0(2),…,x′0(n)}

[0057] X′ i ={x i ′(1),x i ′(2),…,x i ′(n)}

[0058] According to the formula X′0 and X′ were calculated. i The initial point of the image is zeroed out as follows:

[0059]

[0060] Then define:

[0061]

[0062] For X i The relative grey relational degree relative to X0. Where:

[0063]

[0064] Step S2B3: Perform grey comprehensive correlation analysis; denoted as ε 0i and r 0i Two sequences X0 and X are respectively. i Given the absolute and relative correlation degrees, the comprehensive correlation degree ρ is defined. 0i :

[0065] ρ 0i =θε 0i+(1-θ)r 0i

[0066] For X0 and X i The grey comprehensive correlation degree is calculated. Here, θ∈[0,1], typically taken as θ=0.5, which mainly adjusts the influence of grey absolute correlation degree and grey relative correlation degree on the grey comprehensive correlation degree. The grey comprehensive correlation degree between the temperature sequence and the thermal error sequence at each measuring point is calculated to quantify their similarity and influence. Finally, based on the correlation degree, the temperature-sensitive point with the highest correlation degree with the thermal error is selected as the key input to the neural network model. The advantage of grey correlation analysis is that it can effectively identify the temperature measuring points that have the greatest impact on thermal error, significantly reducing model complexity, while providing key data support for the neural network model, thereby improving the model's accuracy and reliability.

[0067] Furthermore, in step S3, the thermal expansion of key machine tool components is quantified using the thermal expansion equation, thereby constructing a physical model of the thermal deformation of key machine tool spindle components. This model fully considers the thermal expansion characteristics of key machine tool components, providing a physical basis for subsequent strain prediction based on a hybrid driving neural network.

[0068] Specifically, the thermal expansion equation is:

[0069]

[0070] Where, Θ ij Representing position x i Location, Time t j The thermal expansion at time M represents the total number of discrete points in space, T(x) i ,t j ) represents the position x of the i-th sequence. i and the j-th sequence time t j The temperature at time T0 is the reference temperature, α is the coefficient of thermal expansion, and dx is the length of the minute unit.

[0071] In step S3, the physics-data hybrid driven neural network model adopts a BP neural network framework, using the temperature of the sensitive measurement points as the input layer. The number of selected temperature measurement points determines the number of neurons in the input layer, which is set to n here. The model's output is a predicted strain value of a certain component of the machine tool spindle, so the output layer has one node. The transfer functions of the input layer and hidden layer are of the Sigmoid type, expressed as:

[0072]

[0073] Where x is the net input value of the neuron.

[0074] Since the range of the Sigmoid function is [0,1], in order to speed up the training of the BP network, the temperature data of the input layer needs to be normalized and transformed to the range [0,1].

[0075] Suppose that the BP neural network has L pairs of learning samples (X). k O k ), where X k For input data, O k For the expected output data, k represents the index number of the sample. X k The actual output obtained after transmission over the network is Y. k Then Y k The expected output O is required k The mean squared error between them is:

[0076]

[0077] The total error E of the learning sample set can be expressed as:

[0078]

[0079] The gradient descent method is used to modify the weights of each node in the neural network to minimize E. A single training sample corresponds to a weight W. ij The correction value is:

[0080]

[0081] In the formula: η represents the learning rate, and η∈[0,1].

[0082] All learning samples with weight W ij The correction value is:

[0083]

[0084] To increase the stability of the learning process, W is usually adjusted using the following formula. ij Make corrections:

[0085]

[0086] In the formula: β represents the correction coefficient constant; W ij (t) represents the connection weights after the t-th iteration of training; W ij (t-1) represents the connection weights after the (t-1)th iteration of training.

[0087] Adjust the number of nodes in the hidden layer, the weights of each node, and the learning rate until the model achieves the required prediction accuracy on both the training and validation sets.

[0088] Further, in step S3, the loss function consists of two parts: a physical loss term and a data loss term. The physical loss term is based on the physical law of thermal expansion and is calculated using the thermal expansion equation. The data loss term uses the mean squared error (MSE) to quantify the difference between the predicted data and the experimental data, i.e., MSE = ||predicted data - experimental data||². During the model training phase, the physical loss term and the data loss term are integrated into the total loss function, and the weights and biases of the network are adjusted using the error backpropagation algorithm to minimize the total loss function.

[0089] Furthermore, in step S3, the training process of the neural network employs Adaptive Moment Estimation (Adam) to optimize the parameters of the neural network, minimizing the total loss function that combines the physical loss term and the data loss term. This algorithm is an adaptive optimization algorithm that adjusts the learning rate based on the first and second moments of the gradient, enabling rapid convergence during training while avoiding getting trapped in local optima, thereby improving the accuracy and stability of thermal error prediction.

[0090] Furthermore, in step S4, the multiple linear regression modeling method is based on statistical principles. In this embodiment, the strain data predicted by the above neural network model is used as input, and the spindle thermal error data collected in the experiment is used as output. The general expression of the regression model is as follows:

[0091] ΔZ=β0+β1ΔE1+β2ΔE2+…+β p ΔE p +ε

[0092] Where ΔZ represents the change in spindle thermal error; β i (i = 0, 1, ..., p) represents the regression coefficient, which is unknown; ΔE i (i = 1, 2, ..., p) represents the predicted change in strain at key machine tool points; ε represents the random error, generally assumed to have an expected value of 0 and a variance of σ. 2 The subscript i indicates that the variables β and ΔE correspond to the i-th machine tool key point.

[0093] Assume that the strain (E) at N key locations of the machine tool, obtained through neural network prediction, will be... i1 E i2 ,…,E ip And the measured thermal error data Z of the spindle. i Noted as: (E i1 E i2 ,…,E ip Z i (i = 1, 2, ..., N), where the subscript i represents the i-th key point of the machine tool, then the regression model can be written in the following form:

[0094]

[0095] The vector form of the transformation is:

[0096] ΔZ=ΔEβ+ε

[0097] in,

[0098]

[0099] Where, ε N They are independent random variables that follow the same normal distribution, and the subscript N corresponds to the N sets of key positions of the machine tool;

[0100] Next, the regression coefficient β i Perform a theoretical estimation based on the least squares method. Let the regression coefficient β be... i The least squares estimate is c i (i = 0, 1, ..., p), then c i The experimental measurement value ΔZ should be such that... i The sum of squared residuals for (i = 0, 1, ..., N) is minimized, i.e.:

[0101] To minimize M(c0,c1,...,c p The minimum value of ) needs to satisfy the following condition:

[0102]

[0103] A multiple linear regression model was then established between the predicted strain data and the collected thermal error data, resulting in the final machine tool spindle thermal error prediction model. After the model was established, it needed to be evaluated based on statistical principles, with key evaluation parameters including regression coefficients, variance, standard deviation, and maximum residual. Thermal error compensation for the machine tool was then performed based on the predicted data from the final thermal error prediction model.

[0104] In a more specific preferred example, such as Figure 1 As shown, the machine tool spindle thermal error modeling, prediction, and compensation method based on physical-data hybrid drive provided by the present invention includes:

[0105] Step S1: To synchronously acquire temperature, strain, and spindle thermal displacement data of the machine tool spindle during its transition from cold start to thermal equilibrium, temperature sensors are first installed at key locations on the machine tool. These key locations include components prone to heat generation and significantly impacting machining accuracy, such as the lead screw, bearings, spindle box, and crossbeam. Displacement sensors are then installed at key locations on the spindle to measure thermal errors. A multi-channel synchronous acquisition system is built using a data acquisition card and the LabVIEW platform, with the acquisition frequency set to 1kHz to ensure data timeliness and continuity. Strain data is extracted using high-precision optical adaptive deformation measurement technology based on a domain-specific convolution algorithm and deformation coordination mechanism.

[0106] Step S2: Perform collinearity clustering analysis on the measurement point data. Use a fuzzy clustering algorithm to calculate the correlation coefficient between each measurement point, grouping highly correlated measurement points into one category to form several temperature feature groups. Then, perform grey relational analysis to determine the degree of correlation between the measurement point data and thermal error, thereby selecting the most representative sensitive measurement point data.

[0107] Step S2 specifically includes the following steps:

[0108] Step S2.1: Perform fuzzy clustering analysis on the measurement point data to divide the temperature measurement points into several categories. First, calculate the similarity matrix between the temperature data of each measurement point to measure the degree of correlation between the measurement points; then, use a fuzzy clustering algorithm (such as FCM algorithm) to divide the measurement points into several categories, ensuring that each measurement point belongs to a specific category with a certain membership degree. The resulting cluster number and inter-cluster distance curves are shown below. Figure 2 As shown; finally, representative measurement points in each category are identified for further analysis.

[0109] Step S2.2: Use grey relational analysis to evaluate the correlation between the measuring points and the thermal error. First, use the thermal error data as a reference sequence and the temperature data of each measuring point as a comparison sequence to establish a correlation model between the two. The resulting correlation diagram between each measuring point and the thermal error is shown below. Figure 3 As shown; next, the grey correlation degree between the temperature sequence and the thermal error sequence at each measuring point is calculated to quantify their similarity and influence. The resulting correlation thermodynamic diagram is shown below. Figure 4 As shown; finally, based on the degree of correlation, the temperature-sensitive point with the highest correlation to thermal error is selected as the key input for neural network modeling.

[0110] Step S3: Design a physical-data hybrid driven neural network model, and train and optimize it to achieve accurate prediction of machine tool thermal errors. The physical-data hybrid driven neural network structure diagram is shown below. Figure 5 As shown.

[0111] Step S3 specifically includes the following steps:

[0112] Step S3.1: The physics-data hybrid driven neural network model adopts the BP neural network framework, with the temperature and strain of the sensitive measurement point as the input layer and the strain prediction value as the output layer.

[0113] Step S3.2: Physical constraints are introduced into the loss function of the physics-data hybrid-driven neural network model, using the thermal expansion equation as a regularization term. The physical loss term is based on the physical laws of thermal expansion, using the thermal expansion equation to quantify the changes caused by thermal expansion. The thermal expansion equation is:

[0114]

[0115] Where, Θ ij Representing position x i Location, Time t j The thermal expansion at time M represents the total number of discrete points in space, T(x) i ,t j ) represents the position x of the i-th sequence. i and the j-th sequence time t j The temperature at time T0 is the reference temperature, α is the coefficient of thermal expansion, and dx is the length of the minute unit.

[0116] The data loss term uses mean squared error (MSE) to quantify the difference between the predicted and experimental data, i.e., MSE = ||predicted data - experimental data||². During model training, the physical loss term and the data loss term are integrated into the total loss function, and the network weights and biases are adjusted using the backpropagation algorithm to minimize the total loss function.

[0117] Step S3.3: The parameters of the neural network are optimized using the Adaptive Moment Estimation (Adam) algorithm. This algorithm is an adaptive optimization algorithm that adjusts the learning rate based on the first and second moments of the gradient, thereby improving convergence speed and stability. During training, the experimental data is divided into training and validation sets, and cross-validation is used to evaluate model performance. By adjusting the network structure parameters and learning rate, the model achieves high prediction accuracy on both the training and validation sets.

[0118] Step S4: Perform multivariate regression fitting on the strain data predicted by the neural network model and the thermal error data collected in the experiment to finally establish a machine tool spindle thermal error prediction model, and perform compensation based on the prediction results. A comparison of the error between the physical-data hybrid driven machine tool spindle thermal error modeling and prediction method and the actual thermal error value shows that the average absolute error between the predicted thermal error and the measured value is less than 5 micrometers, indicating that the method has high prediction accuracy.

[0119] The present invention also provides a machine tool spindle thermal error modeling, prediction and compensation system based on physical-data hybrid drive. The machine tool spindle thermal error modeling, prediction and compensation system based on physical-data hybrid drive can be implemented by executing the process steps of the machine tool spindle thermal error modeling, prediction and compensation method based on physical-data hybrid drive. That is, those skilled in the art can understand the machine tool spindle thermal error modeling, prediction and compensation method based on physical-data hybrid drive as a preferred embodiment of the machine tool spindle thermal error modeling, prediction and compensation system based on physical-data hybrid drive.

[0120] Module M1: Synchronously acquires temperature, strain, and thermal error data at key locations during the process of the machine tool spindle transitioning from a cold state to a thermal equilibrium state;

[0121] Module M2: Performs collinearity clustering analysis and grey relational analysis on the collected temperature data from the measurement points, and selects data from several of the most representative sensitive temperature measurement points;

[0122] Module M3: Based on the physical equation of thermal expansion, a physical-data hybrid driven neural network model is constructed. The data of the sensitive temperature measurement points are used as independent variables, and the corresponding strain data are used as dependent variables. The neural network is then trained to predict strain.

[0123] Module M4: Performs multiple linear regression fitting and compensation on the strain data predicted by the neural network model and the thermal error data collected in the experiment, and finally establishes a machine tool spindle thermal error prediction model, and performs compensation based on the prediction results.

[0124] Furthermore, in the module M1, temperature sensors and displacement sensors are respectively set at key positions of the machine tool. Based on a multi-channel data acquisition card and a LabVIEW measurement and control platform, multi-channel synchronous acquisition of temperature and spindle thermal displacement data is achieved through hardware synchronization architecture and software collaborative control.

[0125] Furthermore, in module M1, high-precision optical adaptive deformation measurement technology based on domain convolution algorithm and deformation coordination mechanism is used to extract strain data. This technology significantly improves the measurement accuracy and stability of strain by innovatively integrating local feature extraction and global deformation coordination.

[0126] Furthermore, in module M2, the collinearity clustering analysis uses a fuzzy clustering algorithm to establish fuzzy similarity relationships between measurement points, and then performs cluster analysis on the variables, grouping highly correlated temperature measurement points into one category to form several temperature feature groups. The main analysis modules and principles are as follows:

[0127] Module M2A1: Standardized Sample Data; First, the temperature measurement point data is standardized to simplify subsequent matrix calculations. There are two main methods for standardizing sample data: standard deviation transformation and range transformation. This embodiment uses the range transformation method to standardize the temperature measurement point data, as shown in the following formula:

[0128]

[0129] Where, x ij This refers to the data obtained from multiple temperature measurement points.

[0130] Module M2A2: Establishes a fuzzy similarity matrix; fuzzy similarity matrix R = [r ij ] p×p There are many methods for constructing fuzzy similarity matrices, such as the reciprocal of absolute value method, the cosine of the included angle method, the distance method, and the correlation coefficient method. This invention uses the correlation coefficient method to establish the fuzzy similarity matrix. Let the set of p temperature measurement points be X = {x1, x2, ..., x...} p}, where x i =[x i1 ,x i2 ,…,x im Let (i = 1, 2, ..., p) be the m-th observation of the i-th temperature change, and define the correlation coefficient describing the closeness between variables x and y as r. ij The calculation formula is:

[0131]

[0132] in,

[0133] Module M2A3: Establishing a fuzzy equivalence matrix; In cluster analysis, the accuracy and rationality of clustering results can only be ensured when the fuzzy matrix simultaneously possesses the three mathematical conditions of reflexivity, symmetry, and transitivity. The fuzzy similarity matrix constructed above can well satisfy the requirements of reflexivity and symmetry, but it cannot fully guarantee the requirement of transitivity. Therefore, it is necessary to construct a special matrix (i.e., a fuzzy equivalence matrix) that can simultaneously satisfy the three key conditions of reflexivity, symmetry, and transitivity, thereby achieving more accurate and rational cluster analysis. This invention uses the squaring method to transform the fuzzy similarity matrix into its transitive closure t(R) (i.e., R→R). 2 →…→R 2k →…), after a finite number of operations, there exists an integer k (k≥1) such that Wherein, the integer k is the undetermined exponent under the transitivity requirement, and the symbol is... Represents the product of two fuzzy matrices. The power of R is called the power of R, and the formula for calculating it is as follows:

[0134]

[0135] Here, the symbol "∧" represents taking the smaller of two numbers, and the symbol "∨" represents taking the larger of two numbers. Let t(R) = R 2k , which is the fuzzy equivalence matrix we are looking for.

[0136] Module M2A4: Cluster Analysis; After solving for the fuzzy equivalence matrix, this matrix can be used to measure the degree of correlation between measurement points and divide the points into several categories, ensuring that each measurement point belongs to a specific category with a certain membership degree for further analysis. The advantage of fuzzy cluster analysis is that it can effectively reduce collinearity between temperature variables, reduce data redundancy, and provide a clear classification basis for subsequent selection of temperature-sensitive points, thereby significantly improving the efficiency and accuracy of thermal error modeling.

[0137] Furthermore, in module M2, the grey relational analysis is used to determine the degree of correlation between the temperature data at the measuring points and the thermal error, thereby selecting the most representative sensitive measuring point temperature data. The measuring points should meet the following conditions: high correlation with thermal error, ability to reflect the characteristics of the main heat sources, reasonable spatial distribution, and ease of installation and maintenance. Specifically, this invention uses grey comprehensive relational analysis, characterized by including:

[0138] Module M2B1 performs grey absolute correlation analysis; X i ={x i (1),x i (2),…,x i Let (n)} be the sequence of system behaviors, and let So, For X i The initial nulling image is called D, which is called the initial nulling operator. Based on the above definition, let the thermal error sequence be X0, and the sequence of temperature measurement point i be X... i Their initial zeroing images are as follows:

[0139]

[0140] Then define:

[0141]

[0142] For X i The absolute gray relational degree relative to X0. Where:

[0143]

[0144]

[0145] Module M2B2: Performs grey relative correlation analysis; let X i ={x i(1),x i (2),…,x i Let (n)} be the sequence of system behaviors, and let: x i (k)c=x i (k) / x i (1), (k = 1, 2, ..., n). Then, X i C = X' i ={x i (1) c, x i (2) c,…,x i (n)c} is X i The initial value image of C is called the initialization operator. Based on the above definition, let the thermal error sequence be X0, and the sequence of temperature measurement point i be X... i Their initial values ​​are as follows:

[0146] X′0={x′0(1),x′0(2),…,x′0(n)}

[0147] X′ i ={x i ′(1),x i ′(2),…,x i ′(n)}

[0148] According to the formula X′0 and X′ were calculated. i The initial point of the image is zeroed out as follows:

[0149]

[0150] Then define:

[0151]

[0152] For X i The relative grey relational degree relative to X0. Where:

[0153]

[0154] Module M2B3: Performs grey comprehensive correlation analysis; denoted as ε 0i and r 0i Two sequences X0 and X are respectively. i The absolute and relative correlation degrees are defined as follows:

[0155] ρ 0i =θε 0i +(1-θ)r 0i

[0156] For X0 and X iThe grey comprehensive correlation degree is calculated. Here, θ∈[0,1], typically taken as θ=0.5, which mainly adjusts the influence of grey absolute correlation degree and grey relative correlation degree on the grey comprehensive correlation degree. The grey comprehensive correlation degree between the temperature sequence and the thermal error sequence at each measuring point is calculated to quantify their similarity and influence. Finally, based on the correlation degree, the temperature-sensitive point with the highest correlation degree with the thermal error is selected as the key input to the neural network model. The advantage of grey correlation analysis is that it can effectively identify the temperature measuring points that have the greatest impact on thermal error, significantly reducing model complexity, while providing key data support for the neural network model, thereby improving the model's accuracy and reliability.

[0157] Furthermore, in module M3, the thermal expansion of key machine tool components is quantified using the thermal expansion equation, thereby constructing a physical model of the thermal deformation of key machine tool spindle components. This model fully considers the thermal expansion characteristics of key machine tool components, providing a physical basis for subsequent strain prediction based on a hybrid driving neural network.

[0158] Specifically, the thermal expansion equation is:

[0159]

[0160] Where, Θ ij Representing position x i Location, Time t j The thermal expansion at time M represents the total number of discrete points in space, T(x) i ,t j ) represents position x i and time t j The temperature at the point is T0, where T0 is the reference temperature, α is the coefficient of thermal expansion, and dx is the length of the minute unit.

[0161] In module M3, the physics-data hybrid driven neural network model adopts a backpropagation (BP) neural network framework, using the temperature of sensitive measurement points as the input layer. The number of selected temperature measurement points determines the number of neurons in the input layer, which is set to n here. The model's output is a predicted strain value of a certain component of the machine tool spindle, so the output layer has one node. The transfer functions of the input and hidden layers are of the Sigmoid type, expressed as:

[0162]

[0163] Where x is the net input value of the neuron.

[0164] Since the range of the Sigmoid function is [0,1], in order to speed up the training of the BP network, the temperature data of the input layer needs to be normalized and transformed to the range [0,1].

[0165] Suppose that the BP neural network has L pairs of learning samples (X).k O k ), where X k For input data, O k This represents the expected output data. k The actual output obtained after transmission over the network is Y. k Then Y k The expected output O is required k The mean squared error between them is:

[0166]

[0167] The total error of the learning sample set can be expressed as:

[0168]

[0169] The gradient descent method is used to modify the weights of each node in the neural network to minimize E. A single training sample corresponds to a weight W. ij The correction value is:

[0170]

[0171] In the formula: η represents the learning rate, and η∈[0,1].

[0172] All learning samples with weight W ij The correction value is:

[0173]

[0174] To increase the stability of the learning process, W is usually adjusted using the following formula. ij Make corrections:

[0175]

[0176] In the formula: β represents the correction coefficient constant; W ij (t) represents the connection weights after the t-th iteration of training; W ij (t-1) represents the connection weights after the (t-1)th iteration of training.

[0177] Adjust the number of nodes in the hidden layer, the weights of each node, and the learning rate until the model achieves the required prediction accuracy on both the training and validation sets.

[0178] Furthermore, in module M3, the loss function consists of two parts: a physical loss term and a data loss term. The physical loss term is based on the physical law of thermal expansion and is calculated using the thermal expansion equation. The data loss term uses the mean squared error (MSE) to quantify the difference between the predicted data and the experimental data, i.e., MSE = ||predicted data - experimental data||². During the model training phase, the physical loss term and the data loss term are integrated into the total loss function, and the weights and biases of the network are adjusted using the backpropagation algorithm to minimize the total loss function.

[0179] Furthermore, in module M3, the training process of the neural network employs Adaptive Moment Estimation (Adam) to optimize the network parameters, minimizing the total loss function that combines the physical loss term and the data loss term. This algorithm is an adaptive optimization algorithm that adjusts the learning rate based on the first and second moments of the gradient, enabling rapid convergence during training while avoiding getting trapped in local optima, thereby improving the accuracy and stability of thermal error prediction.

[0180] Furthermore, in module M4, the multiple linear regression modeling method is based on statistical principles. In this embodiment, the strain data predicted by the above neural network model is used as input, and the spindle thermal error data collected in the experiment is used as output. The general expression of the regression model is as follows:

[0181] ΔZ=β0+β1ΔE1+β2ΔE2+…+β p ΔE p +ε

[0182] Where ΔZ represents the change in spindle thermal error; β i (i = 0, 1, ..., p) represents the regression coefficient, which is unknown; ΔE i (i = 1, 2, ..., p) represents the predicted change in strain at key machine tool points; ε represents the random error, which is generally assumed to have an expected value of 0 and a variance of σ².

[0183] Assume that the strain (E) at N key locations of the machine tool, obtained through neural network prediction, will be... i1 E i2 ,…,E ip And the measured thermal error data Z of the spindle. i Noted as: (E i1 E i2 ,…,E ip Z i If i = 1, 2, ..., N, then the regression model can be written in the following form:

[0184]

[0185] The vector form of the transformation is:

[0186] ΔZ=ΔEβ+ε

[0187] Where, ε N They are independent random variables that follow the same normal distribution, and the subscript N corresponds to the N sets of key positions of the machine tool;

[0188]

[0189] Next, the regression coefficient β i Perform a theoretical estimation based on the least squares method. Let the regression coefficient β be... i The least squares estimate is c i (i = 0, 1, ..., p); then c i The experimental measurement value ΔZ should be such that... i The sum of squared residuals for (i = 0, 1, ..., N) is minimized, i.e.:

[0190] To minimize M(c0,c1,...,c p The minimum value of ) needs to satisfy the following condition:

[0191]

[0192] A multiple linear regression model was then established between the predicted strain data and the collected thermal error data, resulting in the final machine tool spindle thermal error prediction model. After the model was established, it needed to be evaluated based on statistical principles, with key evaluation parameters including regression coefficients, variance, standard deviation, and maximum residual. Thermal error compensation for the machine tool was then performed based on the predicted data from the final thermal error prediction model.

[0193] In summary, this invention provides a method for modeling, predicting, and compensating machine tool spindle thermal errors based on a physics-data hybrid driving approach. The method includes: Step S1: Synchronously collecting temperature, strain, and thermal error data at key locations during the process of the machine tool spindle transitioning from a cold state to a thermal equilibrium state; Step S2: Performing collinearity clustering and grey relational analysis on the collected temperature data to select several of the most representative sensitive temperature measurement points; Step S3: Constructing a physics-data hybrid driving neural network model based on the thermal expansion equation, using the sensitive temperature measurement point data as independent variables and the corresponding strain data as dependent variables, inputting them into the neural network for training to predict strain; Step S4: Performing multiple regression fitting between the strain data predicted by the neural network model and the experimentally collected thermal error data to finally establish a machine tool spindle thermal error prediction model, and compensating based on the prediction results. This method solves the problem that traditional thermal error modeling and compensation methods mainly rely on experimental data and lack consideration of physical laws, thereby improving the prediction and compensation accuracy and generalization ability of the machine tool thermal error model.

[0194] Those skilled in the art will understand that, besides implementing the system and its various devices, modules, and units provided by this invention in the form of purely computer-readable program code, the same functions can be achieved entirely through logical programming of the method steps, making the system and its various devices, modules, and units of this invention function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, the system and its various devices, modules, and units provided by this invention can be considered as a hardware component, and the devices, modules, and units included therein for implementing various functions can also be considered as structures within the hardware component; alternatively, the devices, modules, and units for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0195] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.

Claims

1. A method for modeling, predicting and compensating thermal errors of a machine tool spindle based on physical-data hybrid driving, characterized in that, Comprise: Step S1: synchronously collecting temperature, strain and thermal error data at key positions during the process of running from cold state to thermal equilibrium state of machine tool spindle; Step S2: performing collinearity clustering analysis and grey correlation degree analysis on the collected temperature data of measuring points, and selecting multiple sensitive temperature measuring point data; Step S3: based on thermal expansion physical equation, constructing a physical-data hybrid driven neural network model, inputting the sensitive temperature measuring point data as independent variables and the corresponding strain data as dependent variables into the neural network for training to perform strain prediction; Step S4: performing multiple linear regression fitting on the strain data predicted by the neural network model and the thermal error data collected by experiment, finally establishing a machine tool spindle thermal error prediction model, and compensating according to the prediction result.

2. The machine tool spindle thermal error modeling, prediction and compensation method based on physical-data hybrid driving according to claim 1, characterized in that, In the step S1, temperature sensors and displacement sensors are arranged at key positions of the machine tool, and multi-channel synchronous acquisition of temperature and spindle thermal displacement data is realized through hardware synchronization architecture and software cooperative control based on multi-channel data acquisition card and LabVIEW measurement and control platform; In the step S1, strain data is extracted by using high-precision optical adaptive deformation measurement technology based on domain convolution algorithm and deformation coordination mechanism.

3. The machine tool spindle thermal error modeling, prediction and compensation method based on physical-data hybrid driving according to claim 1, characterized in that, In the step S2, the collinearity clustering analysis uses fuzzy clustering algorithm to establish fuzzy similarity relationship between measuring points, and then performs clustering analysis on variables, classifies temperature measuring points, and forms several temperature characteristic groups; The collinearity clustering analysis comprises: Step S2A1: standardizing sample data; first, standardize the temperature measuring point data to simplify the operation amount of the subsequent matrix; the standardization sample data method is standard deviation transformation method or range transformation method; when using range transformation method to standardize the data of temperature measuring points, the formula is as follows: wherein x ij is the plurality of temperature measurement point data obtained by measurement; Step S2A2: Establishing a fuzzy similarity matrix; the fuzzy similarity matrix R=[r ik ] p×p In absolute value reciprocal method, angle cosine method, distance method or correlation coefficient method, when the correlation coefficient method is used to establish the fuzzy similarity matrix; set the collection of p temperature measuring points as X={x1, x2, …, x p}, wherein x i =[x i1 , x i2 , …, x im ](i=1, 2, …, p) is the mth observation value of the ith temperature change, and the correlation coefficient r ij describing the closeness between variables x and y is defined, and the calculation formula is: wherein In a p x p matrix, the i, j subscripts represent the matrix operation row, column dummy index numbers; Step S2A3: establishing fuzzy equivalence matrix; adopting the method of matrix to transform fuzzy similar matrix into its transmission closure t(R) (i.e. R→R 2 →…→R 2k →…), after finite times of operation, there is an integer k (k≥1) such that The integer k is the undetermined index under the requirement of transitivity; wherein, the symbol represents the product of two fuzzy matrices, is called the power of R, and the calculation formula is as follows: where the symbol "A" denotes taking the smaller of the two numbers, and the symbol "V" denotes taking the larger of the two numbers; let t(R) = R 2k is the sought fuzzy equivalence matrix. Step S2A4: clustering analysis; after solving the fuzzy equivalence matrix, the correlation degree between measuring points is measured by using the fuzzy equivalence matrix, and the measuring points are divided into several categories, ensuring that each measuring point belongs to a specific category with a certain membership degree.

4. The machine tool spindle thermal error modeling, prediction and compensation method based on physical-data hybrid driving according to claim 1, characterized in that, In step S2, the grey correlation degree analysis is used to determine the correlation degree between temperature data of measuring points and thermal error, and the grey comprehensive correlation degree is analyzed, comprising: Step S2B1: Perform grey absolute correlation analysis; X i ={x i (1),x i (2),…,x i Let (n)} be the sequence of system behaviors, and let (k = 1, 2, ..., n); For X i The initial nulling image is called D, which is called the initial nulling operator; the thermal error sequence is denoted as X0, and the sequence of temperature measurement point i is denoted as X... i Their initial zeroing images are as follows: Definition X i Absolute grey correlation degree relative to X0: Wherein: wherein S0, S i is a middle order; Step S2B2: Grey relative correlation degree analysis is performed; let X i ={x i (1),x i (2),…,x i (n)} be a system behavior sequence, let: x i (k)c=x i (k) / x i (1), k=1, 2, …, n; X i C=X' i ={x i (1)c,x i (2)c,…,x i (n)c} be the initial value image of X i , and call C the initial value operator; let the thermal error sequence be X0, and the sequence of temperature measuring points i be X i , let the thermal error sequence be X0, and the sequence of temperature measuring points i be X i , and the initial value image be respectively: X'0={x'0(1),x'0(2),…,x'0(n)} X′ i = {x i ′(1), x i ′(2),..., x i ′(n)} According to the formula X'0and X'1are calculated i The starting point zeroing image is: Definition: For X i Relative gray correlation degree relative to X0; wherein: Step S2B3: Grey comprehensive correlation analysis is performed; record ε 0i and r 0i are absolute correlation degree and relative correlation degree of two sequences X0 and X i respectively, and ρ 0i is defined as the grey comprehensive correlation degree of X0 and X i . p 0i = θe 0i + (1 - θ) r 0i Where, θ ∈ [0, 1], generally θ = 0.5, which is mainly used to adjust the influence degree of grey absolute correlation degree and grey relative correlation degree on grey comprehensive correlation degree; the grey comprehensive correlation degree between the temperature sequence of each measuring point and the thermal error sequence is calculated to quantify the similarity and influence degree; finally, according to the correlation degree, the temperature sensitive point with the highest thermal error correlation degree is selected as the key input of the neural network model.

5. The physical-data hybrid driving based machine tool spindle thermal error modeling, prediction and compensation method according to claim 1, characterized in that, In step S3, the thermal expansion equation is used to quantify the thermal expansion of the key components of the machine tool, and then a thermal deformation physical model of the key components of the machine tool spindle is constructed; The thermal expansion equation is: wherein Θ ij represents the thermal expansion amount at position x i , time t j , M represents the total number of spatial discrete points, T(x i , t j ) represents the temperature at the i-th sequence position x i and the j-th sequence time t j , T0 is a reference temperature, and a is a thermal expansion coefficient, and dx is a micro-unit length; In step S3, the physical-data hybrid driving neural network model adopts a BP neural network framework, with the temperature of the sensitive measuring point as the input layer, and the number of temperature measuring points selected determines the number of input layer neurons, which is n here; the output of the model is a predicted strain value of the machine tool spindle, so the output layer has one node; the transfer functions of the input layer and the hidden layer are Sigmoid type, and the expression is: Where, x is the net input value of the neuron; Since the value range of the Sigmoid function is [0, 1], in order to speed up the training of the BP network, the temperature data of the input layer need to be normalized and transformed to [0, 1]; Let BP neural network has L pairs of learning samples (X k , O k ), where X k is input data, O k is expected output data; actual output obtained after X k propagates through the network is Y k , then mean square error between Y k and required expected output O k is: The total error of the learning sample set can be expressed as: The weights of the individual nodes of the neural network are modified by the gradient descent method so that E takes a minimum value, and the correction value of the weight W ij of a single learning sample is Where: η represents the learning rate, and η ∈ [0, 1]; The correction value of all learning samples to the weight W ij is: To increase the stability of the learning process, it is often necessary to modify W ij by the following equation: wherein: β represents a correction constant; W ij (t) represents the connection weight after the tth iteration cycle of training; W ij (t-1) represents the connection weight after the (t-1)th iteration cycle of training; Adjust the number of nodes in the hidden layer, the weights of the nodes in each layer, and the learning rate until the model reaches the desired prediction accuracy on both the training set and the validation set; In step S3, the loss function is composed of two parts: the physical loss term and the data loss term; the physical loss term is calculated based on the physical law of thermal expansion through the thermal expansion equation; the data loss term uses mean square error (MSE) to quantify the difference between the predicted data and the experimental data, i.e. MSE = ||predicted data-experimental data||2; during the model training phase, the physical loss term and the data loss term are integrated into the total loss function, and the weights and biases of the network are adjusted through the error back propagation algorithm to minimize the total loss function; In step S3, the training process of the neural network uses Adaptive moment estimation (Adam) to optimize the parameters of the neural network to minimize the total loss function combined with the physical loss term and the data loss term.

6. The physical-data hybrid driving based machine tool spindle thermal error modeling, prediction and compensation method according to claim 5, characterized in that, In step S4, the multiple linear regression modeling method is based on statistical principles, using the strain data predicted by the neural network model as input and the spindle thermal error data collected through experiments as output, and the expression of the regression model is as follows: ΔZ = β0+ β1ΔE1+ β2ΔE2+... + β p ΔE p + ε β2ΔE2+... + β p ΔE p + ε where ΔZ represents the variation of the spindle thermal error; β i (i = 0, 1, …, p) represents the regression coefficient, unknown; ΔE i (i = 1, 2, …, p) represents the predicted variation of the machine tool key point strain; ε represents the random error, generally assumed to have an expected value of 0 and a variance of σ 2 ; the subscript i represents the i-th machine tool key point corresponding to the variables β and ΔE. N sets of key position strains (E i1 ,E i2 ,…,E ip ) of the machine tool obtained through neural network prediction and the measured thermal error data Z i of the spindle are denoted as: (E i1 ,E i2 ,…,E ip ; Z i ), i = 1, 2, …, N, wherein the subscript i represents the corresponding i th key point of the machine tool, and the regression model is written in the following form: The transformed vector form is: ΔZ = ΔEβ + ε Where, wherein ε N are random variables independent of each other and subject to the same normal distribution, the subscript N corresponds to N groups of key positions of the machine tool; Next, the theoretical estimation based on the least square method is performed on the regression coefficient β i ; the least square estimation of the regression coefficient β i is denoted as c i (i=0, 1, …, p); c i should make the residual sum of squares of the test measurement values ΔZ i (i=0, 1, …, N) reach the minimum, that is: to a minimum; i.e. to find the minimum of M(c0, c1,..., c p ) subject to the condition that: A multiple linear regression model between the predicted strain data and the collected thermal error data is established, and a final machine tool spindle thermal error prediction model is established. After the model is established, it also needs to be evaluated based on statistical principles, and the main evaluation parameters include regression coefficients, variances, standard deviations, and maximum residuals. The final thermal error prediction model is used to predict the data of the machine tool for thermal error compensation.

7. The physical-data hybrid driving machine tool spindle thermal error modeling, prediction and compensation method according to claim 1, characterized in that, In step S1, in order to synchronously collect temperature, strain and spindle thermal displacement data from the cold state to the thermal equilibrium process of the machine tool spindle, first, temperature sensors are arranged at key positions of the machine tool, including positions prone to heat and significantly affecting machining accuracy; then, displacement sensors are arranged at key positions of the spindle to measure thermal errors; a multi-channel synchronous acquisition system is built through a data acquisition card and a LabVIEW platform, and the acquisition frequency is set to 1KHz to ensure the timeliness and continuity of the data; strain data is extracted through high-precision optical adaptive deformation measurement technology based on domain convolution algorithm and deformation coordination mechanism; In step S2, collinearity cluster analysis is performed on the measured point data, and a fuzzy clustering algorithm is used to calculate the correlation coefficients between the measured points, and the measured points with high correlation are classified into one class to form several temperature characteristic groups; then, gray correlation degree analysis is performed to determine the correlation degree between the measured point data and the thermal error, so as to select the most representative sensitive measured point data; In step S3, a physical-data hybrid driving neural network model is designed and trained and optimized to realize accurate prediction of the machine tool thermal error; the physical-data hybrid driving neural network structure diagram; In step S4, the strain data predicted by the neural network model and the thermal error data collected in the experiment are subjected to multiple regression fitting, and a machine tool spindle thermal error prediction model is finally established, and compensation is performed according to the prediction result.

8. The physical-data hybrid driving machine tool spindle thermal error modeling, prediction and compensation method according to claim 7, characterized in that, Step S2 includes: Step S2.1: Perform fuzzy clustering algorithm analysis on the measured point data, and divide the temperature measured points into several categories; first, calculate the similarity matrix between the temperature data of each measured point to measure the correlation degree between the measured points; then, the measured points are divided into several categories through a fuzzy clustering algorithm (such as FCM algorithm), ensuring that each measured point belongs to a specific category with a certain membership degree, and the number of obtained clusters and inter-class distance curves are obtained; finally, determine the representative measured points in each category for further analysis; Step S2.2: using grey correlation analysis to evaluate the degree of correlation between the measuring points and thermal errors; first, taking the thermal error data as the reference sequence and the temperature data of each measuring point as the comparison sequence, a correlation model between the two is established to obtain a thermal error correlation diagram of each measuring point; then, the grey correlation degree between the temperature sequence of each measuring point and the thermal error sequence is calculated to quantify the similarity and influence degree, and a relevant thermal force diagram is obtained; finally, according to the correlation degree, the temperature sensitive point with the highest correlation degree with the thermal error is selected as the key input of the neural network model.

9. The physical-data hybrid driving machine tool spindle thermal error modeling, prediction and compensation method according to claim 8, characterized in that, the step S3 comprises: Step S3.1: the physical-data hybrid driving neural network model adopts a BP neural network framework, taking the sensitive measuring point temperature and strain as the input layer and the strain prediction value as the output layer; Step S3.2: a physical constraint condition is introduced into the loss function of the physical-data hybrid driving neural network model, and a thermal expansion theory equation is taken as a regularization term of the network; a physical loss term is based on the physical law of thermal expansion, and a thermal expansion equation is used to quantify the changes caused by thermal expansion; the thermal expansion equation is: wherein Θ ij represents the thermal expansion amount at position x i , time t j , M represents the total number of spatial discrete points, T(x i , t j ) represents the temperature at the i-th sequence position x i and the j-th sequence time t j , T0 is a reference temperature, and a is a thermal expansion coefficient, and dx is a micro-unit length; a data loss term uses mean square error (MSE) to quantify the difference between the predicted data and the experimental data, i.e. MSE = ||predicted data-experimental data||2; in the model training stage, the physical loss term and the data loss term are integrated into the total loss function, and the weights and biases of the network are adjusted by means of the error back propagation algorithm to minimize the total loss function; Step S3.3: the Adam algorithm is used to optimize the parameters of the neural network, which is an adaptive optimization algorithm that can adjust the learning rate according to the first and second moments of the gradient to improve the convergence speed and stability; during the training process, the experimental data is divided into a training set and a validation set, and the cross-validation method is used to evaluate the model performance; by adjusting the network structure parameters and learning rate, the model achieves high prediction accuracy on both the training set and the validation set.

10. A physical-data hybrid driven machine tool spindle thermal error modeling, prediction and compensation system, characterized in that, including: Module M1: synchronously collecting temperature, strain and thermal error data at key positions during the process of running from cold machine state to thermal equilibrium state of the machine tool spindle; Module M2: performing collinearity clustering analysis and grey correlation analysis on the collected temperature data of the measuring points to select multiple most representative sensitive temperature measuring point data; Module M3: based on the thermal expansion physical equation, a physical-data hybrid driving neural network model is constructed, the sensitive temperature measuring point data are taken as independent variables, and the corresponding strain data are taken as dependent variables and input into the neural network for training to predict the strain; Module M4: the strain data predicted by the neural network model are subjected to multiple linear regression fitting with the collected thermal error data to finally establish a machine tool spindle thermal error prediction model, and compensation is performed according to the prediction result.