Precision machine tool thermal error compensation system based on MSIFN network
Through the thermal error compensation system based on the MSIFN network, combined with multi-scale feature extraction and spatiotemporal feature fusion, the problems of thermal error prediction and compensation of precision machine tools are solved, and high-precision and efficient machining accuracy are improved.
Patent Information
- Application Number
- CN202510493890.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-19
- Publication Date
- 2025-08-01
AI Technical Summary
The prior art is difficult to effectively capture and compensate for thermal errors in precision machine tools, especially in complex and dynamic industrial environments, resulting in a decrease in processing accuracy.
Using a thermal error compensation system based on the MSIFN network, combining perception control, edge layer and cloud layer, through EMSENet, SGCN and GRU-TCN modules, real-time monitoring and prediction of machine tool temperature and displacement data is achieved, and compensation strategies are generated to reduce thermal errors.
The prediction accuracy of thermal error and the robustness of the model are improved, the processing accuracy and compensation efficiency are enhanced, and the error reduction rate is 61.5% to 83.3% under initial and thermal conditions.
Smart Images

Figure CN120406302A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of thermal error compensation, and specifically relates to a precision machine tool thermal error compensation system based on the MSIFN network. Background Art
[0002] In manufacturing, the quality of high-precision complex parts depends to a large extent on the performance of precision machine tools (PMTs). The machining accuracy of these machine tools is mainly affected by thermal errors, which originate from the non-uniform temperature field of internal components and external temperature changes. Research shows that thermal errors account for 40% to 70% of the overall machining error and are a key factor affecting machining accuracy. With the increase in the operating speed of machine tools, internal friction and electro-thermal effects are intensified, further deteriorating the thermal error (TE) problem. Therefore, in precision machining, effectively controlling and compensating for thermal errors is crucial for maintaining machining accuracy.
[0003] Thermal error control is the main method to reduce thermal effects. This control involves two strategies, namely error prevention and compensation. For error compensation, an opposite error is artificially created during the machining process to offset the influence of thermal errors in real time, thereby preventing errors. For error prevention, by optimizing the machine tool design and selecting suitable materials, the generation of thermal errors is minimized and explored at the design stage. Thermal error compensation methods have been proven to be cost-effective and efficient, making them the preferred method for improving machining accuracy during the operation stage. However, developing a robust and accurate prediction model is crucial for thermal error compensation. Mechanism-based and data-driven thermal error models have been developed. Specifically, mechanism-based models, such as finite element analysis technology, provide a theoretical basis for sensor configuration and initial prediction, but the simplification of the actual machine tool structure and operating conditions limits their accuracy and applicability. Recent research shows that data-driven models are more flexible and practical than mechanism-driven thermal error models because data-driven models can accurately represent the complex factors and interactions affecting thermal errors by analyzing operation data.
[0004] Thermal errors originate from temperature changes. Therefore, in the initial stage, traditional empirical models, including multiple linear regression (MLR), were used to establish the linear relationship between the dependent variable and multiple independent variables. However, the relationship between thermal errors and temperature is usually non-linear and dynamic, so these traditional empirical models encounter limitations in describing such complex relationships. To describe the complex time-dependent relationship, neural networks with a multi-layer structure are used because they can effectively capture and model these complex non-linear relationships and have strong generalization ability. Therefore, the neural network-based thermal error model has become the mainstream method. Initially, the multi-layer perceptron (MLP) applicable to regression problems was used. However, MLP often faces challenges when dealing with time series data such as thermal error data. Thermal error data has a strong dependence on historical thermal information. In this case, the recurrent neural network (RNN) was proposed for thermal error prediction. With its recurrent structure, RNN can transmit information between time steps and capture the time dependence in the sequence. However, RNN is difficult to handle long-term dependence problems during training. To overcome these problems, the gated recurrent unit (GRU), as an improved RNN architecture, was proposed for thermal error prediction. GRU introduced a reset gate and an update gate to dynamically select the information flow path, retain long-term dependence information and alleviate the vanishing gradient problem. However, although GRU performs well in many applications, it still faces certain limitations in dealing with the complex time behavior of thermal error data. At this time, the temporal convolutional network (TCN) was introduced as an emerging solution. TCN is designed specifically for time series data, and its causal and dilated convolutional structures can effectively capture long-distance dependence relationships and show superiority in dealing with long sequences. The time behavior is crucial for high-precision and strong-robustness thermal error prediction and is effectively characterized.
[0005] Research shows that TE data exhibits spatial characteristics. The above model only focuses on temporal characteristics and ignores the influence of spatial characteristics. In TE prediction, due to different sensor positions, the temperature information contains spatial characteristics. To improve the accuracy and robustness of the TE model, the spatio-temporal characteristics of TE data should be fully considered. The Gated Recurrent Unit - Temporal Convolutional Network (GRU-TCN) model is proposed. The GRU is used to achieve temporal dynamic modeling, and the TCN is used to capture long-term dependencies. This model effectively handles the complex temporal dependencies and spatial structures in sequence data, so it shows stronger performance than temporal models. GRU and TCN capture temporal and spatial characteristics respectively. In addition, these two models are sequentially related. The characteristics of TE data result in the interaction between temporal and spatial characteristics. The combined effects of these characteristics should be considered to ensure robustness and accuracy. The Spatio-Temporal Graph Convolutional Network (STGCN) is specifically designed to address the spatio-temporal dependency problem in graph-structured data. By performing convolutional operations on the graph structure, STGCN can capture spatial relationships and temporal dynamics. However, these structures only consider the spatial characteristics at a single timestamp and do not fully consider the comprehensive spatial characteristics. To achieve better generalization ability, multi-scale feature extraction is introduced. By comprehensively learning the multi-level structure of the input data, the generalization ability of the model for unseen data is improved. Since thermal errors exhibit various temperature characteristics, more efficient and accurate processing of these characteristics is required in TE prediction. Therefore, the squeeze-and-excitation attention mechanism is introduced to enable the prediction model to selectively focus on relevant feature channels. It is expected that with the excellent performance of multi-scale feature extraction and squeeze-and-excitation attention in other application scenarios, when inputting small-sample thermal information data, learning the multi-level structure of the input data can improve the prediction accuracy and robustness of the TE model. So far, there has been no report on learning the multi-level structure of the input data.
[0006] The TE model interacts with the compensation system to achieve communication with the Computer Numerical Control (CNC) system. For the compensation system, its real-time performance is crucial for achieving effective control of TE. In previous studies, certain progress has been made in TE compensation technology, but significant challenges still remain. Specifically, it is necessary to monitor and compensate for temperature fluctuations in the machine tool in real time. In traditional temperature processing methods, sensor data usually requires complex processing before it can be used for error prediction, which is particularly difficult in a dynamic and unstable production environment. In addition, traditional models often have difficulty adapting to different types of machine tools or working environments, especially under complex or poorly controlled industrial conditions. Summary of the Invention
[0007] In view of this, the purpose of the present invention is to provide a precision machine tool thermal error compensation system based on the MSIFN network, which combines deep learning-based TE compensation and digital twin technology to improve machining accuracy and compensation efficiency.
[0008] To achieve the above object, the present invention provides the following technical solutions:
[0009] A precision machine tool thermal error compensation system based on the MSIFN network, comprising a perception control layer, a function layer and an application layer;
[0010] The perception control layer includes temperature sensors and displacement sensors deployed on the machine tool, as well as a Raspberry Pi, a gateway, and a numerical control system, which are used to collect the temperature and displacement data of the machine tool in real time;
[0011] The function layer includes an edge layer and a cloud layer, where:
[0012] The edge layer embeds the MSIFN model, which is used to predict thermal errors based on real-time short-term thermal data;
[0013] The cloud layer is used to train and update the MSIFN model through long-term historical thermal data;
[0014] The application layer includes a decision support module, which is used to generate a compensation strategy according to the predicted thermal error and control the numerical control system to execute the compensation;
[0015] The MSIFN model includes the following modules:
[0016] The EMSENet module enhances key features and suppresses noise through a multi-scale channel attention mechanism;
[0017] The SGCN module models the spatial relationship across time stamps through a fully connected sensor network and an attenuation matrix;
[0018] The GRU-TCN module fuses the short-term dependence capture ability of GRU and the long-term dependence modeling ability of TCN, and integrates spatio-temporal features through a feature fusion block.
[0019] Furthermore, the EMSENet network includes:
[0020] Three parallel branches, which respectively perform global average pooling, channel dimension pooling and local time window aggregation;
[0021] A cross-time information aggregation module, which dynamically weights spatio-temporal features of different scales through a Sigmoid gating function.
[0022] Furthermore, in the three parallel branches, two of the parallel branches respectively perform global average pooling operations along the time dimension and the channel dimension:
[0023]
[0024] Where: X1 and X2 are the data obtained after performing global average pooling operations along the time dimension and the channel dimension respectively; X represents the input time series data, and Let \(L\) be the length of the time - series data and \(D\) be the number of channels;
[0025] The third parallel branch aggregates local time - window information by performing a \(1\times3\) convolution operation along the time dimension to generate an output
[0026] Furthermore, two tensors are introduced in the cross - time information aggregation module, namely the global representation and the local representation Use global average pooling layers to encode the time information of the global representation and the local representation:
[0027]
[0028] where: \(X'_1\) and \(X'_2\) respectively represent the information for encoding global time and local time; obtain the normalized channel descriptors for their application:
[0029]
[0030] Multiply the channel descriptor \(X'_1\) with the local representation \(X\) S to obtain the global - time attention representation:
[0031]
[0032] Multiply the channel descriptor \(X'_2\) with the global representation \(X\) C to obtain the global - time attention representation:
[0033]
[0034] where: \(Y_1\) and \(Y_2\) are the global - time attention representations;
[0035] Two global - time attention mechanisms retain time information at different scales and are aggregated, and a weighted representation is derived using the Sigmoid gating function:
[0036] \(Y = Y_1+Y_2\)
[0037] \(W=\text{sigmoid}(Y)\)
[0038] where: \(W\) is the weighted aggregation representation of the global - time attention representation.
[0039] Furthermore, the SGCN module constructs spatial relationships through the following steps:
[0040] Segment the sensor signals and add position encoding;
[0041] Generate a dynamic adjacency matrix based on a neural network, and adjust the cross - timestamp sensor influence weights by combining a time - decay factor;
[0042] Use a graph convolutional network to aggregate neighborhood information of node features.
[0043] Furthermore, divide the signal using a fixed segment size f into a series of segments Each segment contains segmented signals from n sensors; the number of segments N is L / f, resulting in Extract features from the sensor signals of each segment using 1×1Conv to obtain x′ t,i ;
[0044] Position encoding is introduced, and the position encoding is adjusted using sine and cosine functions through position t to enhance the expression of node features for each sensor.
[0045] Furthermore, the input node features are linearly transformed through a fully connected layer:
[0046] X′ = WX + b
[0047] where: X represents the input matrix of node features; W and b correspond to the weights and biases of the fully connected layer, respectively;
[0048] Calculate the dot product between node features using matrix multiplication to generate the initial adjacency matrix Adj:
[0049] Adj = X′X ′T
[0050] where: X′ T is the transpose of X′;
[0051] Construct an identity matrix and expand it to each batch. After multiplying the identity matrix by a large number, subtract the adjacency matrix Adj from the expanded matrix, and apply an activation function to the resulting adjacency matrix to introduce non-linearity and eliminate negative weights:
[0052] Adj = LeakyReLU(Adj - I×1e8)
[0053] where: I is the identity matrix;
[0054] Normalize each row of the adjacency matrix to ensure that the sum of the output connection weights for each node is equal to one:
[0055] Adj = softmax(Adj, axis=-1)
[0056] To ensure that each node has at least a self-connection, add the identity matrix back to the adjusted adjacency matrix:
[0057] Adj = Adj + I
[0058] Introduce a time decay mask matrix to consider the dynamic interaction between nodes at different time steps; given that the influence of adjacent time points is abrupt while the influence of time points farther away on both sides is smaller, formulate a decay factor:
[0059]
[0060] where: i represents the time step before or after the current moment;
[0061] Create a matrix based on this decay factor:
[0062] A i = A × decay
[0063] where: A is a matrix with all elements equal to 1;
[0064] Multiply this matrix by the adjacency matrix after adding the identity matrix to generate the final adjacency matrix:
[0065] Adj = Adj × A i .
[0066] Furthermore, the feature fusion block of the GRU-TCN module includes:
[0067] Concatenate the temporal features output by GRU and the spatial features output by TCN along the channel dimension:
[0068] Z = Concat(X G , X T )
[0069] where: is the data obtained by concatenation; and are the temporal features output by GRU and the spatial features output by TCN respectively;
[0070] Extract the fusion features through a convolutional layer and a ReLU activation function:
[0071] [Z′ = ReLU(Conv(Z))]
[0072] where: Z′ is the extracted fusion feature;
[0073] Introduce a residual connection to avoid gradient vanishing:
[0074] [Z″ = Z + Conv(Z′)]
[0075] where: Z″ is the feature obtained after introducing the residual.
[0076] Furthermore, the edge layer includes:
[0077] A data cleaning module for removing duplicate data and handling missing values;
[0078] A data screening module for performing data quality assessment and sensitivity analysis.
[0079] Furthermore, the cloud layer adopts a federated learning system to jointly train the MSIFN model through multi-source data without sharing sensitive data.
[0080] The beneficial effects of the present invention are as follows:
[0081] The precision machine tool thermal error compensation system based on the MSIFN network of the present invention realizes the combination of TE compensation based on deep learning and digital twin technology. Among them, by collecting the temperature and displacement data of the machine tool at the perception layer, embedding the MSIFN model at the edge layer for predicting thermal errors based on real-time short-term thermal data, and training and updating the MSIFN model through long-term historical thermal data at the cloud layer, the prediction accuracy of thermal errors can be improved; specifically, the MSIFN model includes an EMSENet module, an SGCN module, and a GRU-TCN module; among them, the EMSENet module is a key innovation, which combines the multi-scale idea and channel attention to capture more comprehensive time information and emphasize more important time information, thereby improving the accuracy and robustness of the model; the SGCN can capture the spatial relationship between different sensors at different timestamps to obtain more comprehensive spatial features; through the GRU-TCN module, time and spatial features are fused to capture the interaction between spatio-temporal features; in this way, the prediction accuracy of thermal errors can be improved and the robustness of the model can be enhanced; finally, by embedding a decision support module at the application layer for generating compensation strategies according to the predicted thermal errors and controlling the numerical control system to execute compensation, the machining accuracy and compensation efficiency of precision machine tools can be improved. Description of the Drawings
[0082] In order to make the objectives, technical solutions, and beneficial effects of the present invention clearer, the present invention provides the following drawings for illustration:
[0083] Figure 1 It is a framework diagram of the precision machine tool thermal error compensation system based on the MSIFN network of the present invention;
[0084] Figure 2 It is the working principle of the precision machine tool thermal error compensation system;
[0085] Figure 3 It is digital twin modeling;
[0086] Figure 4 It is the structure of the MSIFN model;
[0087] Figure 5 It is the structure of the EMSENet module;
[0088] Figure 6 is the overall structure of the SGCN module;
[0089] Figure 7 is the structure of the feature fusion block;
[0090] Figure 8 is the structure of the gated fusion unit;
[0091] Figure 9 is the adjustment of the main hyperparameters;
[0092] Figure 10 is the fitting curve for the first condition;
[0093] Figure 11 is the prediction result for the second condition;
[0094] Figure 12 is the ablation experiment result in the MSIFN model;
[0095] Figure 13 is the cross-validation result;
[0096] Figure 14 is the processed sample. Detailed implementation manners
[0097] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, so that those skilled in the art can better understand the present invention and be able to implement it, but the illustrated embodiments are not intended to limit the present invention.
[0098] 1. Precision Machine Tool Thermal Error Compensation System (DTTECS) Based on MSIFN Network
[0099] 1.1 System architecture
[0100] As Figure 1 shown, the precision machine tool thermal error compensation system (DTTECS) based on the MSIFN network in this embodiment includes a perception control layer, a function layer, and an application layer.
[0101] The DTTECS framework integrates various components for real-time monitoring, simulation, and compensation of thermal errors (TE). It demonstrates typical characteristics of digital twins, including model support, high-fidelity mapping, data-driven operation, and intelligent decision-making. The working principle of DTTECS is as follows: First, the sensing and control layer captures the temperature data of the machine tool in real time through sensors. This data is then transmitted to the functional layer for processing and analysis. Specifically, data cleaning and screening are performed at the edge layer. The processed data is stored in the database, and the processed short-term data is input into the TE prediction model to predict TE based on the received data. Model training is carried out in the cloud layer with the processed long-term data as the input. The MSIFN model is updated regularly, and the updated MSIFN model is deployed at the edge layer. Subsequently, the application layer makes decisions and adjustments based on the predicted error values provided by the functional layer. Specifically, in the application layer, the tool position is adjusted by controlling the control unit in the sensing and control layer to compensate for these predicted errors and ensure accuracy.
[0102] (1) Sensing and control layer
[0103] The sensing and control layer includes temperature sensors and displacement sensors deployed on the machine tool, as well as Raspberry Pi, gateways, and numerical control systems (CNC systems) for real-time collection of the temperature and displacement data of the machine tool. The sensing and control layer is mainly used to collect real-time thermal information data and perform basic control functions. Various temperature and displacement sensors are deployed on the machine tool to monitor the physical parameters of the machine tool in real time. These sensors monitor the temperature changes of various components of the machine tool, especially key components such as the spindle, motor, and base. In addition, Raspberry Pi serves as the main interface to collect thermal information from the connected temperature and displacement sensors, perform local preprocessing such as filtering and aggregation, temporarily store the data, and transmit it to the gateway. The gateway aggregates the data from multiple Raspberry Pi, converts the communication protocol to ensure compatibility, and transmits the integrated thermal information data to the edge and cloud servers. In addition, it manages the connected devices to ensure their normal operation and reliable connection. In addition, the decision-making information of the application layer is transmitted to the numerical control system, and the compensation error value is converted into executable code information of the numerical control system to achieve real-time compensation.
[0104] (2) Functional layer
[0105] The functional layer includes an edge layer and a cloud layer, where: The edge layer embeds the MSIFN model for predicting thermal errors based on real-time short-term thermal data; the cloud layer is used to train and update the MSIFN model through long-term historical thermal data. Specifically, the edge layer includes: a data cleaning module for removing duplicate data and processing missing values; a data screening module for performing data quality assessment and sensitivity analysis. The cloud layer adopts a federated learning system to jointly train the MSIFN model through multi-source data without sharing sensitive data.
[0106] The functional layer is the core of data processing and analysis, aiming to implement advanced data processing algorithms and model predictions. The collected temperature data is sent to the edge layer within the functional layer for preprocessing and model predictions. Data preprocessing includes cleaning and screening thermal information data. The data cleaning module is used to eliminate duplicate data, handle missing values, and format the data. The data screening module is used to conduct data quality assessment, variable filtering, and sensitivity analysis. In addition, the processed short-term thermal information data is used for TE prediction in the edge layer. The MSIFN model is embedded in the edge server, taking the processed short-term real-time thermal information data as input to predict the thermal error of the machine tool. It can be concluded that the edge layer in the functional layer is used to filter and transform the raw data collected from the perception control layer, ensuring high-quality data input. The cloud layer in the functional layer is used to train the MSIFN model, adjust parameters, and verify the TE model. The MSIFN model is trained using long-term historical thermal data as input. The update of the MSIFN model in the edge layer is achieved through the interaction between the cloud layer and the edge layer. The trained MSIFN model is transmitted from the cloud layer to the edge layer. In addition, to support long-term analysis and immediate decision-making, the functional layer includes a data storage system responsible for storing historical data and analysis results.
[0107] (3) Application layer
[0108] The application layer includes a decision support module for generating compensation strategies based on the predicted thermal error and controlling the numerical control system to execute the compensation. The application layer makes high-level decisions and optimizations based on the analysis information provided by the functional layer. The decision support system utilizes the prediction data of the functional layer to formulate operation strategies and implement error compensation. In addition, the application layer also includes a user interface, providing a visual interaction platform for operators to display real-time data, prediction information, and decision-making suggestions, thereby helping operators monitor and manage the machine tool more effectively. Finally, the decision is executed through the console, which manages system or user-defined decisions.
[0109] Essentially, DTTECS (Digital Twin Thermal Error Compensation System) creates a highly adaptive and real-time framework for thermal error compensation during the machining process. By integrating the digital twin model with sensor data, prediction algorithms, and compensation mechanisms, high precision and stability during operation are ensured. The thermal error is reduced, thereby improving machining accuracy, especially in environments where temperature fluctuations have a significant impact on accuracy.
[0110] 1.2. Working principle
[0111] Specifically, the working principle of DTTECS is as Figure 2As shown in the figure. DTTECS consists of three key layers: the perception control layer, the function layer, and the application layer. These layers work together to collect, process, predict, and compensate for thermal errors in the machine tool system. The following is a detailed description of the working principles and components of each layer. The working principle of the entire framework is as follows: The perception control layer collects real-time thermal information data from sensors deployed on the machine tool. These data are sent to the function layer through the gateway. The edge layer in the function layer uses the trained MSIFN model to process real-time short-term data for thermal error prediction. The cloud layer stores the processed long-term historical data, conducts model training, and updates the edge layer model when necessary. The predicted thermal error is transmitted to the application layer, where compensation strategies are formulated and applied to adjust the machine tool to offset the thermal error, reduce the thermal error, and ensure machining accuracy. The application layer provides real-time feedback through the user interface. Monitor the effectiveness of the adjustment and strategy, and feed back the data to the function layer for continuous improvement. The cloud layer in the function layer continuously optimizes the model through federated learning and long-term data analysis, improving the performance and adaptability of the system over time. Finally, the framework provides thermal error compensation execution and monitoring services.
[0112] The perception control layer is responsible for collecting real-time thermal data from the machine tool. Temperature changes and other relevant data are measured by sensors embedded in the machine tool. Raspberry Pi performs local preprocessing, including filtering and aggregation. In addition, it temporarily stores the thermal information data and transmits it to the gateway. Then the gateway transmits the collected data to the edge layer in the function layer for preliminary processing. This layer serves as the perception system of the framework, continuously monitoring the thermal state of the machine tool. The thermal information data is forwarded to the edge layer for real-time prediction. In addition, the thermal information data is forwarded to the cloud layer for...
[0113] The function layer is designed to process the collected data, perform thermal error (TE) prediction, and update the thermal error model. The components include the edge layer, model update, multi-source information fusion network (MSIFN) model, error prediction module, micro data center, router, switch, and gateway. The edge layer processes short-term real-time data and uses advanced models for instant error prediction. The error prediction is used to generate real-time predictions of thermal errors. The prediction results are sent to the application layer to execute the compensation strategy. The model update is carried out by processing long-term historical thermal information input data. The MSIFN model is used to process multi-dimensional thermal information data to predict thermal errors. The micro data center serves as the hub for data storage and initial processing. Routers and switches facilitate data transmission between components. The gateway connects the edge layer with the perception layer and the cloud layer.
[0114] The function of the cloud layer is to store long-term data and perform comprehensive analysis. The working principle of the cloud layer is as follows: The cloud layer is used for long-term data management, advanced model training and optimization. It supports the federated learning system to enhance the robustness of the model in different scenarios. The components of the cloud layer include public cloud, private cloud and federated learning system. The public cloud provides shared computing resources for model training and validation. The private cloud provides secure storage for sensitive thermal information data. The federated learning system integrates data from multiple sources without sharing sensitive information, ensuring data privacy and security.
[0115] For the application layer, its function is to execute the compensation strategy and interact with the user. The main components include compensation strategy, strategy formulation, decision-making and user interface. The compensation strategy is used to formulate compensation actions based on the predictions of the edge layer of the functional layer. Strategy formulation aims to determine the best method for implementing the compensation strategy. Decision-making is used to determine the appropriate adjustments required for the machine tool. The user interface provides real-time feedback and control options for the operator. This layer uses the predicted thermal error to execute the compensation strategy, ensuring that the machine tool operates with high precision. The interface allows the user to monitor the system performance and participate in the decision-making process.
[0116] 1.3, Digital Twin Model of Machine Tool
[0117] At the basic level, the system adopts a unit-level modeling method to define each component, including standard parts and customized parts. These components are characterized by their material properties and geometric features. In component-level modeling, assembly relationships and motion constraints are established to ensure an accurate representation of mechanical interactions. This multi-layer modeling framework forms the basis for seamless data exchange and synchronization between the physical and virtual machine tools. In digital twin technology, the construction of geometric models lays the foundation for precise simulation and analysis. These models are constructed, assembled and simulated using parametric features. Then it provides the basis for the mechanical analysis of the machine tool. In this embodiment, the construction process focuses on geometric space features. Figure 3Shows the construction of the digital twin model. The construction of the geometric model is divided into unit level and component level. Through this division, the reusability and modeling efficiency of the model are improved. The modeling process starts from basic parts, and these parts are then assembled into components. These components are then integrated into the digital twin geometric model of the machine tool. At the unit level, the basic parts of each functional component are modeled using three-dimensional (3D) modeling software (such as 3Dmax, SolidWorks, and UG). Standard parts (such as bearings and bolts) are imported from the standard part library. Custom parts are first created using reference features (including reference planes, axes, and coordinate systems) and basic solid features (such as extrusions, sweeps, revolutions, and blends). These features are further refined by engineering features (such as holes, chamfers, and ribs) and modified through operations such as feature arrays and feature copies. The last step involves material application and rendering. At the component level, modeling involves the assembly of multiple parts. Assembly constraints are applied to control the spatial relationships between parts. Kinematic pairs are established to define the motion relationships between components. Then all components are assembled into the complete geometric model of the machine tool. To ensure high structural consistency and accuracy, the geometric model is designed to reflect the dimensions, material properties, and shape of the physical machine tool. Assembly constraints and kinematic pair relationships are used to ensure the correct interaction between components. Lightweight design is applied to address potential transmission and viewing delays, ensuring high fidelity with minimal data requirements. Therefore, the construction of the geometric model prioritizes efficiency, accuracy, and lightweight design while maintaining high fidelity. These features provide the necessary conditions for the successful implementation of digital twins in CNC machine tools. These models describe physical entities and their behavior logics. They map the relationships between physical entities and their digital counterparts, including behavior logics and operation processes. Automatic adjustments are made based on real-time feedback to reflect changes in physical entities. "Virtual control of reality" involves using digital models constructed with digital twin technology to simulate and analyze physical systems in a digital environment. These simulations predict the behavior and performance of physical systems. The prediction results are used for real-time control and optimization of the operation of physical systems.
[0118] Digital twins achieve efficient management through the concepts of "virtual mirroring reality" and "virtual controlling reality". "Virtual mirroring reality" refers to creating a data-driven model through the digital mapping of physical objects. Specifically, the digital twin model establishes dynamic interactions between the physical machine tool entity and its virtual machine tool twin through two-way mapping and interaction. The mapping process from the entity to the virtual involves collecting thermal information (such as temperature and error data) from the machine tool entity through temperature and displacement sensors. This data is transmitted to the virtual model, where the edge layer in the functional layer of the digital twin system processes the thermal information and updates the model to predict thermal errors. In addition, the thermal error model is updated by the cloud layer in the functional layer of the digital twin system. The virtual model simulates the behavior of the machine tool under thermal loads, reflecting the real-time state of the physical machine tool. The interaction process from the virtual to the entity uses the virtual model to control and optimize the physical machine tool. Based on the predictions and simulations of the digital twin, compensation measures are applied to the machine tool entity, such as adjusting the thermal error compensation mechanism, to maintain the accuracy and stability during the machining process. This iterative cycle improves the performance of the machine tool by continuously updating the virtual model with real-time data while applying compensation actions to the physical machine tool. By integrating these processes, the digital twin system ensures high-fidelity thermal behavior prediction and real-time error compensation, thus achieving higher machining accuracy and reliability.
[0119] 2. Multi-Scale Spatiotemporal Interaction Fusion Network (MSIFN)
[0120] 2.1 Spatiotemporal Behavior of Thermal Error
[0121] During the operation of the machine tool, the spindle can be simplified as a long shaft. Since its length is significantly greater than its radius, heat dissipation from the periphery is ignored, and only the two ends of the shaft are considered. Then, the heat transfer of the spindle can be modeled as a first-order steady-state heat conduction model. To more accurately simulate the actual scenario, a varying heat source term is introduced to represent the temperature field change caused by non-uniform heating. The heat conduction equation is:
[0122]
[0123] where: α is the thermal diffusivity, determined by the main material; represents the second-order derivative with respect to space; represents the first-order derivative with respect to time; q(x, t) is the introduced heat source term.
[0124] Subsequently, the boundary conditions are specified:
[0125] T(0, t) = T0 + ΔT·f(t)
[0126] Where: f(t) is defined as the temperature change function measured under any actual working conditions. An adiabatic boundary is established at the other end of the spindle (x = L). Then, the heat conduction equation is discretized in the time and space domains. The x-axis is divided into N intervals from 0 to L, and the length of each interval is Δx. Time is divided into M intervals from 0 to the final time T, and the length of each interval is Δt. The forward Euler method is applied to discretize the first-order time derivative:
[0127]
[0128] The central difference method is used to discretize the second-order spatial derivative:
[0129]
[0130] The complete discretization of heat diffusion results in:
[0131]
[0132] The above equation is converted to:
[0133]
[0134] This is further converted to subscript notation:
[0135]
[0136] Where: represents the temperature at position i during time step n; represents the heat source at the same position and time step.
[0137] The thermal elongation rate is expressed as:
[0138]
[0139] Where: T0 represents the ambient temperature. Then T is replaced and converted to subscript form:
[0140]
[0141] According to the above equation, δL n represents the total length change at time step n and is closely related to Closely related to the heat conduction at the previous time step, which means Related to the previous time step, showing the time behavior of thermal expansion. That is Closely related to the heat conduction before and after, thus showing spatial behavior in its thermal expansion. Therefore, the TE data exhibits spatio-temporal characteristics. Closely related to the heat conduction before and after, thus showing spatial behavior in its thermal expansion. Therefore, the TE data exhibits spatio-temporal characteristics.
[0142] 2.2. MSIFN Model
[0143] The MSIFN model includes the following modules: the EMSENet module, which enhances key features and suppresses noise through a multi-scale channel attention mechanism; the SGCN module, which models the spatial relationships across time stamps through a fully connected sensor network and an attenuation matrix; and the GRU-TCN module, which fuses the short-term dependence capture ability of GRU and the long-term dependence modeling ability of TCN, and integrates spatio-temporal features through a feature fusion block.
[0144] Specifically, the MSIFN model aims to address the limitations of previous models by enhancing significant time information and capturing comprehensive spatio-temporal behavior. It consists of three components: EMSENet, SGCN, and GRU-TCN, as Figure 4 shown. EMSENet was proposed to comprehensively and efficiently capture time features, using the SENet concept to amplify important information and suppress unimportant information. SGCN is used to establish complete connections between sensors across all time stamps and uses an attenuation matrix to enhance correlations, effectively capturing and representing complex spatio-temporal dependencies and overcoming the limitations of existing methods. The GRU and TCN components of GRU-TCN are respectively good at capturing local and global features. By integrating these features, the model obtains richer and more comprehensive spatio-temporal information, thus improving its prediction performance.
[0145] 2.2.1, EMSENet Module
[0146] The EMSENet network includes: three parallel branches that respectively perform global average pooling, channel dimension pooling, and local time window aggregation; and a cross-time information aggregation module that dynamically weights spatio-temporal features at different scales through a Sigmoid gating function.
[0147] Specifically, the redundant or secondary information in the initial part of the long sequence interferes with the learning process, making it difficult for the GRU to capture key features from the initial part of the long sequence. To address this challenge, a feature extraction module is introduced before the GRU. This module integrates multi-scale and channel attention mechanisms to enhance the extraction of information at different levels and significant features. This method aims to effectively solve the temperature lag effect. Its multi-scale feature extraction is used to capture the cumulative effect of temperature changes over time, thereby clearly representing the temperature propagation and distribution on the spindle system. Through this preprocessing, the enhanced input is utilized more effectively, information loss is reduced, and the TE model is more adaptable to diverse inputs and environmental changes. Ultimately, the prediction performance and robustness are improved in various application scenarios. In addition, the GRU mainly focuses on time features, so complex patterns across time points are often overlooked. Therefore, this embodiment introduces attention mechanisms in the time and feature dimensions, which can capture and integrate information more comprehensively, improving the accuracy of GRU time series prediction. The rich features provide more discriminative inputs for the GRU, and the internal gating mechanism adjusts information more precisely, enhancing the accuracy and stability of the prediction. Figure 5 The structure of the EMSENet model is shown. Key features are enhanced and secondary information is suppressed, thus improving the generalization ability and robustness of the model.
[0148] The principle of EMSENet involves processing given time series data Let L be the length of the time series data and D be the number of channels. The input is divided into three branches. The first two branches perform global average pooling operations along the time dimension and the channel dimension respectively.
[0149]
[0150] where: X1 and X2 are the data obtained after performing global average pooling operations along the time dimension and the channel dimension respectively; X represents the input time series data, and L is the length of the time series data and D is the number of channels;
[0151] Then, the corresponding channel descriptors are obtained through Sigmoid, and the input X is reweighted to obtain The third branch aggregates local time window information by performing a 1×3 convolution operation along the time dimension to generate the output
[0152] Global time information is aggregated, and all channels of each time step feature are weighted by the left branch. This means that each time step has a global receptive field. The left branch is designated as the global representation while the right branch is labeled as the local representation A method for cross - temporal information aggregation with different temporal receptive fields is proposed to achieve rich feature aggregation. Two tensors are introduced in the cross - temporal information aggregation module, namely the global representation and the local representation Use the global average pooling layer to encode the temporal information of the global representation and the local representation:
[0153]
[0154] Among them: X′1 and X′2 respectively represent the information for encoding global time and local time. Then obtain the normalized channel descriptor for its application:
[0155]
[0156] Multiply the channel descriptor X′1 with the local representation X S This operation performs a weighted sum of all channel features at each time step, thereby obtaining the global - time attention representation:
[0157]
[0158] Multiply the channel descriptor X′2 with the global representation X C This operation performs a weighted sum of all channel features at each time step, thereby obtaining the global - time attention representation:
[0159]
[0160] Among them: Y1 and Y2 are the global - time attention representations;
[0161] Two global - time attention mechanisms retain temporal information at different scales and are aggregated. Subsequently, these attention mechanisms are aggregated, and a weighted representation is derived using the Sigmoid gating function:
[0162] Y = Y1 + Y2
[0163] W = sigmoid(Y)
[0164] Among them: W is the weighted aggregation representation of the global - time attention representation.
[0165] Input Is recalibrated by these weights to produce the output
[0166] 2.2.2. SGCN Module
[0167] The SGCN module constructs the spatial relationship through the following steps: segment the sensor signals and add positional encoding; generate a dynamic adjacency matrix based on a neural network, and adjust the weights of sensor influences across timestamps by combining a time decay factor; use a graph convolutional network to aggregate neighborhood information of node features.
[0168] Specifically, due to the consideration of the spatio-temporal dependence relationship of the same sensor on different graphs before, the relationship between sensors at different timestamps is ignored, which limits the ability of existing methods to fully utilize the spatio-temporal dependence relationship. Therefore, this embodiment proposes SGCN (Spatio-Temporal Graph Convolutional Network), then establishes a fully connected network among sensors at all timestamps, and finally uses a decay matrix to enhance the correlation, solving the limitations of existing methods. The overall structure of SGCN is as Figure 6 shown.
[0169] The principle of SGCN is as follows: For the given time series data L represents the length of the time series data, and D represents the number of channels. To access the sensor information at different timestamps, the signal of each sensor is divided into multiple segments. Using a fixed segment size f, the signal is divided into a series of segments Each segment contains the segmented signals from n sensors. The number of segments N can be calculated as to obtain Then apply 1×1Conv to extract features from the sensor signals of each segment to obtain x′ t,i .
[0170] Subsequently, in order to preserve the directionality, that is, the relative position information of each segment, positional encoding is introduced. The positional encoding is adjusted using sine and cosine functions through the position t to enhance the expression of each sensor feature. For the processed node features, a method for generating an adjacency matrix based on a neural network is proposed to capture the relationship between them. Use a fully connected layer to transform the node features, thereby capturing the interaction between nodes and constructing a graph structure.
[0171] To better understand the relationship between the processed node features, this embodiment proposes a method for generating an adjacency matrix based on a neural network module. The node features are transformed through a fully connected layer to capture the interaction between nodes, thereby constructing a graph structure. The implementation details are as follows:
[0172] The input node features are linearly transformed through a fully connected layer:
[0173] X′ = WX + b
[0174] where: X represents the input matrix of node features; W and b correspond to the weights and biases of the fully connected layer respectively;
[0175] Calculate the dot product between node features using matrix multiplication to generate the initial adjacency matrix Adj:
[0176] Adj = X'X ′T
[0177] where: X ′T is the transpose of X';
[0178] Construct an identity matrix and expand it to each batch. Multiply this identity matrix by a large number to reduce the self-connection weight to zero in subsequent steps. Subtract the adjacency matrix Adj from this expanded matrix and apply an activation function to the resulting adjacency matrix to introduce non-linearity and eliminate negative weights:
[0179] Adj = LeakyReLU(Adj - I×1e8)
[0180] where: I is the identity matrix;
[0181] Normalize each row of the adjacency matrix to ensure that the sum of the output connection weights of each node is equal to one:
[0182] Adj = softmax(Adj, axis=-1)
[0183] To ensure that each node has at least a self-connection, add the identity matrix back to the adjusted adjacency matrix:
[0184] Adj = Adj + I
[0185] Through this process, the connections between different sensors in the current time step are correctly established. To further explore the connections between sensors at different time steps, a time decay mask matrix is introduced to consider the dynamic interaction between nodes at different time steps. Given that the influence of adjacent time points is abrupt while the influence of more distant time points on both sides is smaller, a decay factor is formulated:
[0186]
[0187] where: i represents the time step before or after the current moment;
[0188] Create a matrix based on this decay factor:
[0189] A i = A × decay
[0190] where: A is a matrix with all elements equal to 1;
[0191] Multiply this matrix by the adjacency matrix after adding the identity matrix to generate the final adjacency matrix:
[0192] Adj = Adj × Ai
[0193] The final graph structure reflects the undirected relationships and dynamic changes between nodes at different time steps, providing an accurate and dynamic framework for subsequent graph analysis. By applying the GCN (Graph Convolutional Network) technology to the adjacency matrix, the structural information in the graph is directly utilized, enabling the automatic learning of complex relationships between two nodes. Finally, the understanding of the data topology structure is enhanced through neighborhood information aggregation, and the prediction accuracy is improved. The ability of automatic feature learning further reduces the need for manual feature engineering, thereby enhancing the generalization ability and practical value of the model.
[0194] 2.2.3. GRU-TCN Module
[0195] GRU (Gated Recurrent Unit) is used to process features before prediction, but it is not suitable for multi-dimensional spatial data. This leads to the loss of spatial information, reducing the generalization ability and robustness of the model. To address this challenge, this embodiment proposes the GRU-TCN module. By integrating the spatial enhancement features of TCN (Temporal Convolutional Network) to compensate for the loss of spatial information. At the same time, the advantage of GRU's sensitivity to time is utilized to solve the weakness of TCN in dealing with short-term dependencies. GRU-TCN can process the features input to GRU more comprehensively and consider a wide range of spatio-temporal dependencies for the TCN input. Subsequently, a feature fusion block is used to combine the outputs of GRU and TCN, as Figure 7 shown.
[0196] The principle of the feature fusion block is as follows:
[0197] Connect the two inputs and along the third dimension, and concatenate the temporal features output by GRU and the spatial features output by TCN along the channel dimension:
[0198] Z = Concat(X G , X ] )
[0199] where: is the concatenated data; and are the temporal features output by GRU and the spatial features output by TCN, respectively.
[0200] To further extract and enhance the expressive ability of these fused features, 1×1 convolution operations are used to extract features. The ReLU activation function is used to increase non-linearity, thereby improving the expressive ability and generalization ability of the model. That is, the fused features are extracted through the convolutional layer and the ReLU activation function:
[0201] [Z′ = ReLU(Conv(Z))2
[0202] Wherein: Z′ is the extracted fused feature.
[0203] The features are further refined through 1×1Conv operations to ensure that the TE model can capture deep features.
[0204] In this structure, convolution is used not only for feature extraction, but also helps to capture local dependencies and enhance the sensitivity to patterns in the input data. Then, the integration of spatio-temporal features is improved. A residual structure is added at the end to maintain the stability of the network and also avoid gradient vanishing and information loss in the deep architecture. That is, in this embodiment, a residual connection is introduced to avoid gradient vanishing:
[0205] [Z″ = Z + Conv(Z′)]
[0206] Wherein: Z″ is the feature obtained after introducing the residual.
[0207] The above content describes a layer in the feature fusion module. For similar reasons, a residual layer is added at the end. As a variant of RNN, GRU performs well in dealing with temporal dependencies in time series data. However, it has deficiencies in capturing local temporal patterns in the input data and utilizing spatial information. In contrast, TCN uses an extended convolutional structure to capture local features in spatio-temporal information, maintain the time order and alleviate these limitations. The advantages of GRU and TCN are utilized in the feature fusion block, and their feature outputs are concatenated along the third dimension. The sensitivity to features at different time scales is enhanced, and spatio-temporal information is deeply fused. Through comprehensive feature representation, the prediction performance and robustness of the model in dealing with complex time series data are improved. After the feature fusion module, a gated fusion unit (GFU) is introduced, as Figure 8 shown.
[0208] 3. Experimental Research
[0209] 3.1. Experimental Setup
[0210] In this embodiment, an investigation is carried out on the spindle of the TGK46100 CNC boring machine, and a sensor system is designed to synchronously collect temperature and displacement data. This acquisition system is used to record temperature and thermal error (TE) data simultaneously. The change of thermal error is monitored by tracking the change of the temperature of the spindle system. The selection of the measurement points is based on the criteria formulated according to expert experience: (1) The sensors are arranged at key positions of the spindle to capture important data; (2) The selected positions should facilitate the installation of the sensors. The components include the motor, bearing, base, coolant and the surrounding environment. The detailed installation positions are listed in Table 1.
[0211] Table 1 Specific Installation Positions of Temperature Sensors
[0212]
[0213] A complex and variable training dataset was selected to verify the generalization ability and stability of the model. Meanwhile, a simpler and more consistent test dataset was applied to evaluate the model's generalization ability from extreme cases to common scenarios. The thermal elongation of the main shaft exhibits time-series characteristics and shows complex historical correlations in actual operations. Complete operation data was included in the training set to capture these complex and variable characteristics. Under the first condition, the main shaft speed first increases and then decreases. Under the second condition, the speed cycles through acceleration and deceleration every 80 minutes. The first condition involves more complex speed changes. In this case, a rapid increase in temperature and TE data was observed, followed by a gradual stabilization. TE rapidly increased from 35 μm to 40 μm and then gradually decreased. Under the second condition, the periodic changes simulated common operating modes. The temperature and TE data showed an upward trend and reached 15 μm at 150 min. The collection frequencies of the thermal information data were different under the two conditions. Under the first condition, the thermal information data was collected every 7.5 seconds, resulting in 4000 data points. Under the second condition, the data was collected every 15 seconds, resulting in 2000 data points. These datasets reflect the thermal behaviors under two different operating conditions.
[0214] 3.2, MSIFN Model Parameter Settings
[0215] To tune the hyperparameters, metrics such as root mean square error (RMSE), mean absolute error (MAE), and coefficient of determination R 2 were used. RMSE was used to identify large prediction errors, MAE was used to evaluate the model's robustness to outliers, and R 2 was used to evaluate the overall fitting performance of the model. While keeping other parameters unchanged, the hyperparameters were adjusted one by one. After a series of tests, the best prediction performance was achieved with two layers, a learning rate of 0.001, a batch size of 32, and a time window of 8. The influence of model parameters on the fitting results is as Figure 9 shown. Each hyperparameter comparison assumed that other hyperparameters were set to their optimal values. Too many layers may lead to overfitting, thus reducing the fitting performance. A time window of 8 was chosen to account for the lag effect, where the change in TE lags behind the change in temperature and previous several data points need to be considered. However, a larger time window may introduce noise of irrelevant information. Adam was used as the optimizer to ensure satisfactory convergence of the TE model.
[0216] 4. Results and Discussion
[0217] 4.1. Model Comparison Experiments
[0218] 4.1.1. Model Training Results
[0219] Thermal information data was collected under two operating conditions. The data under the first condition was used as the training set, while the data under the second condition was used as the test set. This selection verified the adaptability of the model to new environments. It ensured the model's ability to handle various operating conditions, enhancing robustness and prediction accuracy. As Figure 10 shown, MLP, GRU, TCN, GRU-TCN, STGCN, ONT-GCN, and MSIFN models were trained. Their fitting performances are listed in Table 2. The fitting performances of the TE models were compared horizontally in terms of metrics and vertically across different models. Among all the TE models, the ONT-GCN model had the best overall fitting performance, with the lowest RMSE (0.2149), MSE (0.0580), and a relatively high R 2 (0.9992), indicating its strong prediction accuracy and robustness. The GRU-TCN model performed excellently in fitting performance, with the lowest MAE (0.1516) and a relatively high R 2 (0.9991), making it very effective in precise prediction tasks. TCN performed well, with a relatively low RMSE (0.2647) and a relatively high R 2 (0.9990), showing competitive accuracy. The fitting performance of the STGCN model was comparable to that of GRU-TCN, with slightly higher RMSE (0.2489) and MAE (0.1883), but maintaining a strong R 2 (0.9991). The fitting performance of MSIFN was moderate, with an RMSE of 0.3396 and an R 2 of 0.9984, indicating that its competitiveness was inferior to ONT-GCN and GRU-TCN. Simpler models, such as MLP and GRU, had limited fitting performance, with relatively high RMSEs (0.5681 and 0.6230 respectively) and relatively low R 2 (0.9956 and 0.9947 respectively), reflecting their difficulties in handling complex data and large errors. Horizontally, the ONT-GCN and GRU-TCN models consistently had stronger fitting performances in all metrics than other models, while vertically, simpler models such as MLP and GRU lagged significantly in fitting performance.
[0220] Table 2 Comparison of fitting performances
[0221]
[0222] 4.1.2, Model prediction results
[0223] The trained TE models were tested under the second operating condition, as Figure 11As shown. Their performance is evaluated using the metrics mentioned above, as listed in Table 3. As a basic neural network, MLP (Multi-Layer Perceptron) can capture simple non-linear relationships in input data. However, when dealing with complex time series data, it shows obvious limitations, resulting in the worst performance in the TE model. In contrast, GRU (Gated Recurrent Unit) optimizes the information flow through update and reset gates, effectively capturing short-term and long-term dependencies in time series data. TCN (Temporal Convolutional Network), with its unique convolutional structure, efficiently processes time information and captures long-term dependencies. Compared with MLP, GRU and TCN models show better prediction performance.
[0224] However, these models fail to incorporate spatial features. Spatial feature extraction is introduced into the GRU-TCN model, but time and spatial features are processed separately. This separation limits its ability to effectively fuse time and spatial features, resulting in interference and reduction in prediction performance compared to standalone time models. The STGCN model improves prediction performance by considering the interaction between time and spatial features. ONT-GCN combines gating mechanisms to optimize time and spatial features, further improving performance. However, it remains challenging for ONT-GCN to fully capture complex spatio-temporal relationships. The MSIFN model proposed in this embodiment addresses these challenges, comprehensively considering comprehensive spatio-temporal features and their interactions. These features are effectively fused, integrated, and processed, achieving the best prediction performance in the TE model. Although other models achieve excellent fitting performance, their prediction performance is insufficient due to overfitting and limited generalization ability. The MSIFN model can alleviate these problems by using the channel attention mechanism to reduce overfitting and dependence on noise in the training set. In addition, multi-scale processing is used to capture information at different levels, enhancing adaptability and generalization ability.
[0225] Table 3 Comparison of Prediction Performance
[0226]
[0227] 4.1.3, Ablation Experiments
[0228] An ablation study of the key design elements of the MSIFN framework is conducted to evaluate their contribution to the model's prediction performance. All model training parameters are kept consistent with the previous experiment, and the results are as Figure 12 shown, and the evaluation results are listed in Table 4. The baseline model excludes feature fusion, spatial information, and feature processing, denoted as MSIFN1. By adding feature fusion to MSIFN1, the model becomes MSIFN2. Further adding spatial information and feature processing, MSIFN3 and MSIFN4 are obtained respectively.
[0229] Table 4 Ablation Study in MSIFN
[0230]
[0231] The ablation study reveals the impact of feature fusion, spatial information, and feature processing on the prediction performance of the MSIFN model. Horizontally, MSIFN1, as the baseline model without these components, exhibits the worst prediction performance, with the highest RMSE (1.2054), MSE (1.4531), and MAE (0.9113), indicating significant prediction errors. MSIFN2 incorporates feature fusion, and compared with MSIFN1, the RMSE is reduced by 24.1% and the MAE is reduced by 22.3%, confirming the effectiveness of feature integration. MSIFN3 further adds feature processing, and compared with MSIFN2, the RMSE is reduced by 9.6% and the MAE is reduced by 11.4%, demonstrating its ability to enhance key features and suppress noise. MSIFN4, which includes spatial information, has slightly stronger prediction performance than MSIFN3, with further reduction in RMSE and MAE, highlighting the importance of capturing spatio-temporal dependencies. Vertically, the complete MSIFN model integrating all components achieves the best results, with an RMSE of 0.7369, an MAE of 0.5629, and an R 2 value of 0.9976. Compared with MSIFN1, the RMSE is reduced by 38.9% and the MAE is reduced by 38.2%. This comparison confirms that the combination of feature fusion, spatial information, and feature processing can significantly improve the prediction accuracy, robustness, and generalization ability of the model.
[0232] By replacing the original stacking relationship with a feature fusion module, the effect of the feature fusion module was analyzed. This led to a significant improvement in RMSE and MAE, confirming that integrated features are superior to simple stacking. By introducing a spatial component into the model that already includes a feature fusion module, the effect of adding spatial information was examined. As shown in Table 4, RMSE decreased by 7% and MAE decreased by 8%, demonstrating the ability of this module to effectively capture spatio-temporal dependencies in thermal information data. The effect of feature processing was evaluated by developing EMSENet, which enhanced key features and reduced noise. The results in Table 4 show that RMSE decreased by 10% and MAE decreased by 16%, indicating that focusing on key features and minimizing noise can improve generalization ability. The dynamic time correlation extracted from multi-scale features with different receptive fields further enhanced this ability. The complete MSIFN model integrating the spatial component, EMSENet, and interaction layer achieved the best prediction accuracy, with an RMSE of 0.7369 and an MAE of 0.5629. This demonstrates the effectiveness of the model in making accurate predictions. The validation results show that the complete MSIFN model exhibits more superior prediction and generalization abilities compared to the ablation version. This confirms the importance of adding feature processing, spatial information, and spatio-temporal integration in capturing complex key features and improving prediction accuracy.
[0233] In summary, comprehensive spatial information was captured by adding a spatial component, the interaction layer enhanced the utilization of spatio-temporal features, and the EMSENet model strengthened key feature representation and reduced noise interference. These findings highlight the ability of the MSIFN model in capturing complex spatio-temporal relationships, making accurate predictions, and ensuring robust generalization.
[0234] 4.1.4, Cross-validation
[0235] In this embodiment, a cross-validation experiment was conducted to verify the robustness of the proposed MSIFN model. In this experiment, the roles of the test set and the validation set were swapped to achieve the goal of cross-validation. The prediction results are as Figure 13 shown, and the corresponding evaluation results are shown in Table 5. The cross-validation results show that the MSIFN model has more superior performance compared to other models. Horizontally, MSIFN achieved the lowest RMSE (0.6664), MSE (0.4441), MAE (0.5482), and the highest R 2 (0.9939), indicating its strong prediction accuracy and robustness. In contrast, MLP performed the worst, with the highest RMSE (1.5653), MSE (2.4503), and MAE (1.1744), and R 2(0.9667) is the lowest, showing its limitations in processing complex time series data. GRU and TCN perform moderately, with their RMSE values being 0.9770 and 1.0250 respectively, and their 2 R values being 0.9870 and 0.9854 respectively, reflecting their ability to capture time dependencies but having limitations in dealing with spatio-temporal features. Vertically, GRU-TCN improves the prediction performance compared to GRU and TCN, but due to its separate processing of time and space features, its RMSE (1.1021) is relatively high and its 2 R (0.9835) is relatively low. STGCN performs better, with its RMSE (0.9181) and 2 R (0.9885) benefiting from the simultaneous spatio-temporal feature extraction and fusion. The analysis of the prediction data and evaluation metrics shows the advantages of the MSIFN model. The conclusion is that the MSIFN model achieves the best prediction performance through feature fusion, spatial information, and feature processing, enabling it to capture complex spatio-temporal relationships with high precision and strong robustness. This verifies the effectiveness and robustness of the MSIFN model in predicting TE.
[0236] Table 5 Evaluation Metrics of Cross-Validation
[0237]
[0238] The key advantages of the MSIFN model are demonstrated by the cross-validation results. Its effectiveness in various working environments is proven, and its ability to seamlessly switch between different settings is also verified. The evaluation results show that the MSIFN model achieves high prediction accuracy and strong adaptability. Its robustness within the spatio-temporal framework is particularly evident, as the proposed MSIFN model can effectively capture spatio-temporal relationships even with a small sample size. These findings confirm the excellent performance of the MSIFN model in solving complex prediction tasks.
[0239] 4.2, Verification of System Real-Time Performance
[0240] To evaluate the performance, two system frameworks were defined: the perception control-edge-cloud framework and the fog-cloud framework. Temperature and TE are both slow variables. The sampling frequency of temperature and TE data was set to 0.01 Hz. A total of nine temperature sensors and five displacement sensors were used. The data volume collected in six months reached 19.6 GB. In this embodiment, DTTECS was developed using the perception control-edge-cloud framework to improve the execution efficiency of the entire system. The data was processed by different system frameworks, and then the processed data volume was obtained, as shown in Table 6. The perception control layer is designed to perform data collection and verification. It processed a total data volume of 19.6 GB. The edge layer processed a total data volume of 19.6 GB and was designed for data preprocessing. The cloud layer processed 55.6 GB of data and was designed for model training and update. DTTECS adopted the fog-cloud and perception control-edge-cloud frameworks and processed a total data volume of 95.8 GB.
[0241] Table 6 Data Volume Processed by the System
[0242]
[0243] Based on the execution time and the contributions of each layer, the efficiencies of the perception control-edge-cloud and fog-cloud frameworks were analyzed, as shown in Table 7. The perception control-edge-cloud framework demonstrated excellent performance, with a total execution time of 196.3 seconds, significantly shorter than the 394 seconds required by the fog-cloud framework. The data transmission in the perception control-edge-cloud framework only took 26.3 seconds, while it was 124 seconds in the fog-cloud framework, indicating a reduction in communication latency. The perception control-edge-cloud framework utilized the edge layer for local processing, spending 111 s at this layer, while the fog-cloud framework did not utilize the edge layer and relied entirely on the cloud layer. This reliance resulted in a cloud layer processing time of 254 seconds for the fog-cloud framework, while it was 43 s for the perception control-edge-cloud framework. The fog layer of the perception control-edge-cloud framework and the perception control layer in the fog-cloud framework took the same time (26 seconds). These results highlight the efficiency of the perception control-edge-cloud framework, achieved by reducing the dependence on the cloud, faster data transmission, and effective local processing at the edge layer. The execution time of the TE compensation system using the perception control-edge-cloud framework was reduced by 50.2% compared to the fog-cloud framework.
[0244] Table 7 Execution Time and Efficiency of Different System Frameworks
[0245]
[0246] 4.3. Actual Machining Verification
[0247] Standard specimens were machined according to the ISO 10791-7 standard, as Figure 14As shown. The machining process parameters of the four-axis machining center include cutting parameters, tool selection, machining path, cooling method, and machining accuracy. For the cutting parameters, the spindle speed is 10,000 r / min, and the feed rate is 200 mm / min. The cutting depth for rough machining is 2 mm, and for finish machining is 0.2 mm. The cutting width for rough machining is set at 50% of the tool diameter, and for finish machining is 10%. The tool material includes cemented carbide, and the tool diameter is 10 mm. The tool type is an end mill. The machining path uses a zigzag pattern for rough machining and down milling for finish machining. Four-axis linkage uses uniform indexing or dynamic linkage to process complex surfaces. The cooling method uses emulsified coolant with a pressure of 4 bar to control the cutting temperature through spraying or internal cooling. The specific four-axis parameters include an indexing angle of 5° and a rotational axis feed rate of 10° / s, combined with an indexing table to ensure the rigidity and stability of the clamping.
[0248] According to Table 8, the machining error data shows that error compensation has a significant effect on improving accuracy under initial and thermal conditions. Without compensation, the machining errors are relatively high, especially under thermal conditions where thermal expansion exacerbates the inaccuracy. For example, the hole distances 1 and 2 improve from 104.013 mm without compensation to 104.005 mm with compensation under initial conditions, and from 104.018 mm to 104.005 mm under thermal conditions. Similarly, the square side 1 improves from 110.015 mm to 110.004 mm under initial conditions and from 110.020 mm to 110.005 mm under thermal conditions. In all measurements, compensation consistently reduces the error to a level close to the target dimension, with consistent results for hole distances (104.003 - 104.006 mm) and square sides (110.002 - 110.005 mm). This highlights the reliability and robustness of DTTECS in reducing initial and thermal inaccuracies, ensuring precise and consistent machining results. The reduction rate of machining errors is 61.5% to 83.33% under initial conditions and 82.2% to 83.3% under thermal conditions.
[0249] Table 8 Error Compensation (mm)
[0250]
[0251]
[0252] 5. Conclusions
[0253] This embodiment proposes a precision machine tool thermal error compensation system based on the MSIFN network. This system is based on the perception control-edge-cloud framework and aims to improve the machining accuracy of precision machine tools. By introducing the MSIFN model for prediction and embedding it into a lightweight TE compensation system, the thermal errors of precision machine tools are compensated with high precision. The main conclusions are as follows:
[0254] (1) A lightweight DTTECS framework is proposed to ensure high adaptability and execution efficiency in a dynamic machining environment. Experimental results show that MSIFN has superior prediction performance, with the RMSE reduced by 38.9% compared to the baseline model and enhanced robustness. The results show that the total execution time of the TE compensation system based on the perception control-edge-cloud framework is reduced by 50.2% compared to the TE compensation system based on the fog-cloud framework, and the machining error ranges in the initial and hot states are reduced by [61.5%, 83.33%] and [82.2%, 83.3%] respectively. This embodiment provides a powerful solution for improving machining accuracy in complex industrial environments.
[0255] (2) The MSIFN model is proposed, which effectively captures and integrates spatio-temporal features by combining the EMSENet, SGCN, and GRU-TCN modules, improving the prediction accuracy and robustness of small-sample thermal datasets. To ensure accuracy and robustness, a feature extraction module, EMSENet, is designed. The concept of multi-scale and channel attention is used to capture broader and more important temporal features. The STCN module is used for more comprehensive spatial feature capture. In addition, a new architecture model is established, where GRU is used for data with temporal features and TCN is used for data with spatial features. Their outputs are fused to achieve the comprehensive utilization of spatio-temporal features. The prediction accuracy of the MSIFN model exceeds its comparison models, including MLP, GRU, TCN, GRU-TCN, and STGCN, with the MSE dropping to 0.5431, the MAE dropping to 0.5629, and the R2 reaching 0.9976. Based on this, the digital twin system combined with this model can effectively achieve TE compensation. Experimental results show that the prediction accuracy is significantly improved, with the RMSE reduced by 38.9%, and it shows robust performance under different operating conditions. Real-time machining tests confirm effective TE mitigation, achieving machining accuracy within the ISO 10791-7 standard.
[0256] The proposed method addresses the challenges in TE modeling, including noise resistance, small-sample limitations, and real-time adaptability. Future work will focus on expanding the system to other machine tool types and exploring federated learning techniques for broader industrial integration.
[0257] The above-described embodiments are merely preferred embodiments given to fully illustrate the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or transformations made by those skilled in the art on the basis of the present invention are all within the protection scope of the present invention. The protection scope of the present invention shall be subject to the claims.
Claims
1. A precision machine tool thermal error compensation system based on the MSIFN network, characterized in that: It includes a perception control layer, a function layer, and an application layer; The perception control layer includes a temperature sensor and a displacement sensor deployed on the machine tool, as well as a Raspberry Pi, a gateway, and a numerical control system, which are used to collect the temperature and displacement data of the machine tool in real time; The function layer includes an edge layer and a cloud layer, where: The edge layer embeds the MSIFN model, which is used to predict thermal errors based on real-time short-term thermal data; The cloud layer is used to train and update the MSIFN model through long-term historical thermal data; The application layer includes a decision support module, which is used to generate a compensation strategy according to the predicted thermal error and control the numerical control system to execute the compensation; The MSIFN model includes the following modules: The EMSENet module enhances key features and suppresses noise through a multi-scale channel attention mechanism; The SGCN module models the spatial relationship across time stamps through a fully connected sensor network and an attenuation matrix; The GRU-TCN module fuses the short-term dependence capture ability of GRU and the long-term dependence modeling ability of TCN, and integrates spatio-temporal features through a feature fusion block.
2. The precision machine tool thermal error compensation system based on the MSIFN network according to claim 1, characterized in that: The EMSENet network includes: Three parallel branches, which respectively perform global average pooling, channel dimension pooling, and local time window aggregation; A cross-time information aggregation module, which dynamically weights spatio-temporal features at different scales through a Sigmoid gating function.
3. The precision machine tool thermal error compensation system based on the MSIFN network according to claim 2, characterized in that: Among the three parallel branches, two of the parallel branches respectively perform global average pooling operations along the time dimension and the channel dimension: Where: X1 and X2 are the data obtained after performing global average pooling operations along the time dimension and the channel dimension respectively; X represents the input time series data, and L is the length of the time series data, and D is the number of channels; The third parallel branch aggregates local temporal window information by performing a 1×3 convolutional operation along the temporal dimension to generate an output 4. The precision machine tool thermal error compensation system based on the MSIFN network according to claim 3, wherein: Two tensors are introduced in the cross-time information aggregation module, namely the global representation and the local representation The global average pooling layer is used to encode the time information of the global representation and the local representation: Where: X′1 and X′2 respectively represent the information for encoding global time and local time; a normalized channel descriptor is obtained for its application: Multiply the channel descriptor X′1 with the local representation X S to obtain the global temporal attention representation: Multiply the channel descriptor X′2 with the global representation X C to obtain the global temporal attention representation: Where: Y1 and Y2 are global time attention representations; Two global time attention mechanisms retain time information at different scales and are aggregated, and a weighted representation is derived using the Sigmoid gating function: Y = Y1 + Y2 W = sigmoid(Y) Where: W is the weighted aggregation representation of the global time attention representation.
5. The precision machine tool thermal error compensation system based on the MSIFN network according to claim 1, characterized in that: The SGCN module constructs the spatial relationship through the following steps: Segment the sensor signals and add position encoding; Generate a dynamic adjacency matrix based on a neural network, and adjust the cross-time stamp sensor influence weight in combination with a time decay factor; Use a graph convolutional network to aggregate neighborhood information of node features.
6. The precision machine tool thermal error compensation system based on the MSIFN network according to claim 5, characterized in that: Divide the signal using a fixed segment size f into a series of segments Each segment contains the segmented signals from n sensors; the number of segments N is L / f, resulting in Extract features from the sensor signals of each segment using 1×1 Conv to obtain x′ t,i ; Position encoding is introduced, and the position encoding is adjusted through position t using sine and cosine functions to enhance the node feature expression of each sensor.
7. The precision machine tool thermal error compensation system based on the MSIFN network according to claim 5, characterized in that: The input node features are linearly transformed through a fully connected layer: X′ = WX + b Where: X represents the input matrix of node features; W and b respectively correspond to the weights and biases of the fully connected layer; Calculate the dot product between node features using matrix multiplication to generate an initial adjacency matrix Adj: Adj=X′X′ T where: X′ T is the transpose of X′; Construct an identity matrix and expand it to each batch. After multiplying the identity matrix by a large number, subtract the adjacency matrix Adj from the expanded matrix, and apply an activation function to the resulting adjacency matrix to introduce non-linearity and eliminate negative weights: Adj = LeakyReLU(Adj - I×1e8) Where: I is the identity matrix; Normalize each row of the adjacency matrix to ensure that the sum of the output connection weights of each node is equal to one: Adj = softmax(Adj, axis=-1) To ensure that each node has at least a self-connection, the identity matrix is re-added to the adjusted adjacency matrix: Adj = adj + I Introduce a time decay mask matrix to consider the dynamic interaction between nodes at different time steps; given that the influence of adjacent time points is abrupt, while the influence of time points farther away on both sides is smaller, a decay factor is formulated: where: i represents the time step before or after the current moment; Create a matrix based on this decay factor: A i = A × decay where: A is a matrix with all elements equal to 1; Multiply this matrix by the adjacency matrix after adding the identity matrix to generate the final adjacency matrix: Adj = Adj × A i .
8. The precision machine tool thermal error compensation system based on the MSIFN network according to claim 1, characterized in that: The feature fusion block of the GRU-TCN module includes: Concatenate the temporal features output by GRU and the spatial features output by TCN along the channel dimension: Z = Concat(X G , X T ) Wherein: is the data obtained by splicing; and are the temporal features output by GRU and the spatial features output by TCN, respectively; Extract the fused features through a convolutional layer and a ReLU activation function: [Z′ = ReLU(Conv(Z))] where: Z′ is the fused feature extracted; Introduce a residual connection to avoid gradient vanishing: [Z″ = Z + Conv(Z′)] where: Z″ is the feature obtained after introducing the residual.
9. The precision machine tool thermal error compensation system based on the MSIFN network according to claim 1, characterized in that: The edge layer includes: A data cleaning module for removing duplicate data and handling missing values; A data screening module for performing data quality assessment and sensitivity analysis.
10. The precision machine tool thermal error compensation system based on the MSIFN network according to claim 1, characterized in that: The cloud layer adopts a federated learning system to jointly train the MSIFN model through multi-source data without sharing sensitive data.
Citation Information
Cited By
Dynamic error compensation method and system for main shaft of gantry machining center
CN121028678A
A machine tool spindle thermal error modeling method based on simulation data and transfer learning
CN122528569A