Shaft part machining error compensation system fusing machine intelligence and digital twinning

By constructing a machining error compensation system for shaft parts that integrates machine intelligence and digital twins, the system can collect signals in real time and generate a comprehensive compensation command sequence, thus solving the precision control problem caused by multi-source error coupling and achieving high-precision, low-cost machining results.

CN122632732APending Publication Date: 2026-08-25CHONGQING HUICHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611043974.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-14
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

During the machining of shaft parts, multiple sources of errors, such as thermal deformation, tool wear, elastic deformation caused by cutting force, and geometric errors, are coupled with each other, which increases the difficulty of precision control. Traditional methods that rely on offline detection cannot achieve real-time compensation.

Method used

A machining error compensation system for shaft-type parts integrating machine intelligence and digital twins is constructed. The system uses a CNN-Transformer hybrid model to collect signals in real time for feature extraction and temporal dependency capture, generates a comprehensive compensation instruction sequence, and injects it into the machine tool servo control system in real time to execute closed-loop error compensation.

Benefits of technology

It has achieved a significant improvement in the machining accuracy of shaft parts, reduced production costs, and real-time dynamic compensation without hysteresis deviation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122632732A_ABST
    Figure CN122632732A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of numerical control machining, and discloses a shaft part machining error compensation system fusing machine intelligence and digital twinning, a digital twinning model construction module, which is used for constructing a multi-source error coupling digital twinning model of a shaft part machining process; a synchronous correction module, which is used for collecting machining process signals in real time, outputting time-varying parameters under a current machining state through a model, and synchronously correcting the digital twinning model; a compensation amount calculation module, which is used for carrying out real-time deduction of machining errors along a preset tool path based on the updated digital twinning model, calculating tool position compensation amount, tool posture compensation amount and feed rate adjustment amount, and generating a comprehensive compensation instruction sequence; and a closed-loop compensation module, which is used for injecting the comprehensive compensation instruction sequence into a machine tool servo control system in real time to execute closed-loop error compensation and continuously evolve the digital twinning model; the machining precision is significantly improved, the production cost is greatly reduced, real-time dynamic compensation is achieved, and there is no lagging deviation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of CNC machining technology, specifically to a machining error compensation system for shaft parts that integrates machine intelligence and digital twins. Background Technology

[0002] Shaft parts are core components in mechanical equipment, and their machining accuracy directly affects the service performance and service life of the entire machine. As high-end equipment manufacturing develops towards precision and complexity, shaft parts exhibit characteristics such as thin walls, irregular cavity structures on the shaft surface, and non-rotating surfaces, significantly increasing the difficulty of machining. During the machining process of shaft parts, multiple sources of errors, such as thermal deformation, tool wear, elastic deformation caused by cutting forces, geometric errors, and interpolation errors, are coupled with each other, exacerbating the difficulty of precision control. Traditional methods rely on offline inspection after machining for error feedback, which has significant lag and makes it difficult to achieve real-time compensation. Summary of the Invention

[0003] The purpose of this invention is to solve the above-mentioned problems by designing a machining error compensation system for shaft parts that integrates machine intelligence and digital twins.

[0004] This invention provides a method for compensating for machining errors in shaft-type parts by integrating machine intelligence and digital twins. The system includes: The digital twin model construction module is used to construct a multi-source error coupled digital twin model that couples thermally induced errors, force-induced deformation errors, tracking errors, and tool wear errors during the machining of shaft parts; The synchronous correction module is used to acquire processing signals in real time, extract spatial features and capture temporal dependencies of the acquired signals through a CNN-Transformer hybrid model, output time-varying parameters under the current processing state, and synchronously correct them to the digital twin model. The compensation calculation module is used to perform real-time simulation of machining errors along the preset tool path based on the updated digital twin model, and calculate the corresponding tool position compensation, tool attitude compensation and feed rate adjustment, and generate a comprehensive compensation instruction sequence. The closed-loop compensation module is used to inject the comprehensive compensation command sequence into the machine tool servo control system in real time to perform closed-loop error compensation and continuously evolve the digital twin model.

[0005] Optionally, in a first implementation of the present invention, the digital twin model construction module includes: The initial model building submodule is used to read the 3D design model and material property data of shaft parts and generate an initial digital twin of the workpiece. The mesh refinement submodule is used to traverse the geometric surface of the initial workpiece digital twin to calculate the rate of curvature change, refine the mesh in the corner area and thin-walled area of ​​the irregular cavity, and output a workpiece digital twin model with differentiated mesh density. The first sub-model establishment sub-module is used to read the structural parameters and kinematic transmission chain data of each feed axis of the CNC machine tool, establish the kinematic mapping relationship from the servo motor to the center point of the tool, and at the same time establish the vibration characteristic sub-model of the spindle and tool system. The second sub-model building sub-module is used to build the thermal error mechanism sub-model, the cutting force deformation error mechanism sub-model, the contour error mechanism model, and the tool wear error mechanism sub-model, respectively. The model generation submodule is used to fit the error source coupling coefficient matrix through multiple linear regression, and then integrate the coupling coefficient matrix with the four error sub-models, the workpiece digital twin model, and the vibration characteristic sub-model to generate a multi-source error coupled digital twin model.

[0006] Optionally, in a second implementation of the present invention, the second sub-model building sub-module includes: A heat generation model of the spindle motor, lead screw and nut pair and guide rail slider is established, and a heat transfer path model is constructed to conduct heat along the machine tool structural components to the center point of the tool. The models are then combined to form a heat-induced error mechanism sub-model with position command and spindle speed as input and heat-induced position deviation as output. An instantaneous cutting force calculation model is established based on the tool geometry parameters and cutting parameters. An elastic deformation transfer function from the point of application of the cutting force to the center point of the tool is established in combination with the stiffness distribution, and a sub-model of the deformation error mechanism caused by the cutting force is obtained. The control parameters of the servo drive system of each feed axis are obtained, the dynamic response transfer function of each feed axis to the position command is established, the tracking error of each axis is calculated along the discrete tool position point, and the contour error mechanism sub-model is established based on the geometric coupling relationship of multi-axis linkage.

[0007] Based on the combination of tool material, workpiece material, and cutting parameters, an evolution model of tool flank wear over cutting time is established, and the influence of wear on the actual geometry of the tool is established, which are then combined to form a sub-model with wear error mechanism.

[0008] Optionally, in a third implementation of the present invention, the synchronization correction module includes: The preprocessing submodule is used to acquire processing signals in real time and splice them into a time series matrix. It performs mean removal, low-pass filtering and normalization preprocessing operations on each channel in the time series matrix. The model processing submodule is used to input the preprocessed time series matrix into the CNN module and Transformer encoder of the CNN-Transformer hybrid model for processing. The fully connected sub-network processing module is used to input the high-dimensional feature sequence output by the Transformer encoder into four parallel fully connected sub-networks, and output the time-varying parameters under the current processing state, and synchronously correct them to the digital twin model.

[0009] Optionally, in a fourth implementation of the present invention, the model processing submodule includes: The output spatial feature sequence is generated after multi-layer convolution, batch normalization, ReLU activation and max pooling operations of the CNN module; The encoding submodule is used to calculate the sine and cosine position encoding values ​​of each feature vector in the spatial feature sequence according to the time position, and add the position encoding vector to the feature vector element by element to obtain the position encoded feature sequence including the temporal position information. The nonlinear transformation submodule is used to input the position-encoded feature sequence into the Transformer encoder, calculate the long-range dependency weights between each feature through multi-head self-attention, and output the encoded high-dimensional feature sequence after nonlinear transformation by the feedforward network.

[0010] Optionally, in a fifth implementation of the present invention, the fully connected sub-network processing submodule includes: The fully connected subnetwork sequentially calculates and outputs the predicted value sequence of four time-varying parameters: tangential stiffness coefficient, cutting force mode coefficient, thermal deformation coefficient, and tool wear rate. The vector composition relationship of the three-dimensional cutting force components is verified based on the principle of force balance, and the predicted values ​​that exceed the physical constraint threshold are corrected along the direction of decreasing physical loss function. Replace the initial parameters in the sub-model of the deformation error mechanism caused by cutting force with the corrected tangential system stiffness coefficient and cutting force mode coefficient; Replace the thermal conduction parameter in the thermal error mechanism sub-model with the thermal deformation coefficient, and replace the wear accumulation rate parameter with the tool wear rate; The coupling coefficient matrix is ​​updated by interpolation from the pre-stored coupling coefficient lookup table based on the current time-varying parameters, thus completing the synchronous correction of the digital twin model.

[0011] Optionally, in a sixth implementation of the present invention, the compensation amount calculation module includes: The discrete sampling submodule is used to discretely sample along the preset tool path and traverse each tool position point. After calculating four error vectors, it multiplies them with the coupling coefficient matrix to obtain the comprehensive machining error value in the X, Y, and Z directions of each tool position point. The marking submodule is used to mark regions with a curvature change rate of the irregular cavity boundary and a wall thickness below a threshold as feature-sensitive regions, divide sub-regions according to spatial adjacency and calculate the comprehensive error gradient of each sub-region, and mark sub-regions with gradient magnitude exceeding a preset threshold as sub-regions that need optimization. The optimization iteration submodule is used to perform optimization iteration on the feed rate and depth of cut of the sub-region to be optimized using the TVAC-PSO algorithm, output the optimal adjustment coefficient, and calculate the tool axis direction angle correction and feed path curvature correction for the contour error deviation vector of the non-rotating surface feature region. The integration submodule is used to output a comprehensive compensation command sequence based on the tool axis direction angle correction and the feed path curvature correction.

[0012] Optionally, in the seventh implementation of the present invention, the optimization iteration submodule includes: Initialize the particle swarm, including the feed rate adjustment coefficient and the depth of cut adjustment coefficient, iteratively calculate the fitness value of each particle, and update the individual optimal and global optimal positions; The particle velocity and position are updated based on the time-varying acceleration coefficient. After reaching the maximum number of iterations, the optimal adjustment coefficient is output and applied to the sub-region that needs to be optimized.

[0013] Optionally, in an eighth implementation of the present invention, the integration submodule includes: The combined error of each tool position point is reversed and used as the position compensation amount, the tool axis direction angle correction amount is used as the attitude compensation amount, and the difference between the optimized feed rate and the original value is used as the rate adjustment amount. These are integrated into a comprehensive compensation command sequence according to the machining sequence.

[0014] Optionally, in a ninth implementation of the present invention, a method for implementing a machining error compensation system for shaft-type parts that integrates machine intelligence and digital twins is provided, the method comprising: Construct a multi-source error coupling digital twin model that couples thermally induced error, force-induced deformation error, tracking error, and tool wear error during the machining of shaft parts; The processing signals are acquired in real time, and the spatial features and temporal dependencies of the acquired signals are extracted by the CNN-Transformer hybrid model. The output is the time-varying parameters under the current processing state, and the data is synchronously corrected to the digital twin model. Based on the updated digital twin model, the machining error is simulated in real time along the preset tool path, and the corresponding tool position compensation, tool attitude compensation and feed rate adjustment are calculated to generate a comprehensive compensation command sequence. The comprehensive compensation command sequence is injected into the machine tool servo control system in real time to perform closed-loop error compensation, and the digital twin model is continuously evolved.

[0015] The technical solution provided by this invention constructs a multi-source error coupled digital twin model that couples thermally induced errors, force-induced deformation errors, tracking errors, and tool wear errors during the machining of shaft parts. Machining process signals are acquired in real time, and spatial features are extracted and temporal dependencies are captured using a CNN-Transformer hybrid model. The output is time-varying parameters under the current machining state, which are then synchronously corrected to the digital twin model. Based on the updated digital twin model, machining errors are extrapolated in real time along a preset tool path, and corresponding tool position compensation, tool attitude compensation, and feed rate adjustment are calculated to generate a comprehensive compensation command sequence. This comprehensive compensation command sequence is injected into the machine tool servo control system in real time to execute closed-loop error compensation, and the digital twin model is continuously evolved. This invention significantly improves machining accuracy, greatly reduces production costs, provides real-time dynamic compensation, and eliminates hysteresis deviations. Attached Figure Description

[0016] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention.

[0017] Figure 1 A schematic diagram of the structure of the shaft part machining error compensation system that integrates machine intelligence and digital twins provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of the digital twin model construction module provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the synchronous correction module provided in an embodiment of the present invention. Detailed Implementation

[0018] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0019] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1A schematic diagram of the structure of the shaft part machining error compensation system integrating machine intelligence and digital twin provided in this embodiment of the invention. The system includes: The digital twin model construction module is used to construct a multi-source error coupled digital twin model that couples thermally induced errors, force-induced deformation errors, tracking errors, and tool wear errors during the machining of shaft parts; The synchronous correction module is used to acquire processing signals in real time, extract spatial features and capture temporal dependencies of the acquired signals through a CNN-Transformer hybrid model, output time-varying parameters under the current processing state, and synchronously correct them to the digital twin model. The compensation calculation module is used to perform real-time simulation of machining errors along the preset tool path based on the updated digital twin model, and calculate the corresponding tool position compensation, tool attitude compensation and feed rate adjustment, and generate a comprehensive compensation instruction sequence. The closed-loop compensation module is used to inject the comprehensive compensation command sequence into the machine tool servo control system in real time to perform closed-loop error compensation and continuously evolve the digital twin model.

[0020] In this embodiment, please refer to Figure 2 The digital twin model building module includes: The initial model building submodule is used to read the 3D design model and material property data of shaft parts and generate an initial digital twin of the workpiece. The mesh refinement submodule is used to traverse the geometric surface of the initial workpiece digital twin to calculate the rate of curvature change, refine the mesh in the corner area and thin-walled area of ​​the irregular cavity, and output a workpiece digital twin model with differentiated mesh density. The first sub-model establishment sub-module is used to read the structural parameters and kinematic transmission chain data of each feed axis of the CNC machine tool, establish the kinematic mapping relationship from the servo motor to the center point of the tool, and at the same time establish the vibration characteristic sub-model of the spindle and tool system. The second sub-model building sub-module is used to build the thermal error mechanism sub-model, the cutting force deformation error mechanism sub-model, the contour error mechanism model, and the tool wear error mechanism sub-model, respectively. The model generation submodule is used to fit the error source coupling coefficient matrix through multiple linear regression, and then integrate the coupling coefficient matrix with the four error sub-models, the workpiece digital twin model, and the vibration characteristic sub-model to generate a multi-source error coupled digital twin model.

[0021] In this embodiment, an initial digital twin model of the workpiece geometry and materials is established. The 3D design model file of the shaft-type part is read, and the outer contour geometry information, boundary coordinate data of the irregular cavity structure, thickness distribution data of the thin-walled region, and spatial location data of the non-rotational surface features are extracted. Simultaneously, the material property data of the part, including elastic modulus, Poisson's ratio, coefficient of thermal expansion, density, specific heat capacity, and thermal conductivity, are read. The above geometric and material data are fused in virtual space to form an initial digital twin of the workpiece. All geometric surfaces of the workpiece digital twin are traversed, and the rate of change of geometric curvature for each local region is calculated. For the corner and thin-walled regions of the irregular cavity structure, the mesh cells are automatically subdivided and refined according to the magnitude of the rate of change of curvature; for non-sensitive areas, a relatively sparse mesh density is maintained. A digital twin model of the workpiece containing differentiated mesh densities is output.

[0022] In this embodiment, the structural parameters of each feed axis of the CNC machine tool are read, including the motion direction vector of each axis, the lead screw lead, the motor encoder resolution, the travel limit of each axis, and the backlash value. Based on the machine tool topology, a kinematic transmission chain from the servo motor to the tool center point is established for each feed axis, and the mapping relationship between the position command value of each axis and the actual spatial position of the tool center point is stored in the kinematic sub-model. Simultaneously, a vibration characteristic sub-model of the spindle-tool system is established, recording the vibration modal parameters of the spindle at different speeds.

[0023] In this embodiment, the main heat sources of the machine tool are identified, including the spindle motor, the leadscrew and nut assembly, and the guide rail slider. A quantitative relationship is established between the heat output per unit time of each heat source and the spindle speed and feed rate. A heat transfer path model is established, showing the heat transfer from each heat source through the machine tool structural components to the tool center point. A model is established to show the influence of ambient temperature changes on the thermal expansion of the machine tool structural components. These three sub-models are then combined to obtain a thermal error sub-model that takes the feed axis position command values ​​and spindle speed as inputs and the thermally induced position deviation of the tool center point as the output.

[0024] In this embodiment, a calculation model for instantaneous cutting force is established based on the tool's geometric parameters and cutting parameters. Based on the stiffness distribution of the process system composed of the workpiece and the tool, an elastic deformation transfer function is established from the point of application of the cutting force to the center point of the tool. This transfer function is decomposed in each direction of the workpiece coordinate system to obtain a calculation model for the tool displacement deviation caused by the cutting force.

[0025] In this embodiment, the control parameters of the servo drive system for each feed axis of the machine tool are read, including proportional gain, integral gain, derivative gain, speed feedforward coefficient, and acceleration feedforward coefficient. Based on these control parameters, a dynamic response transfer function for each feed axis to position commands is established. The toolpath is discretized into a continuous sequence of tool position points, and the commanded speed, commanded acceleration, and commanded jerk of each feed axis at each tool position point are calculated. These values ​​are then substituted into the servo system's dynamic response transfer function to calculate the tracking error of each axis at each tool position point. Furthermore, based on the geometric coupling relationship between the contour error and the tracking error of each axis during multi-axis linkage, a contour error calculation model is established.

[0026] In this embodiment, a cumulative model of the evolution of tool flank wear over cutting time is established based on the combination of tool material, workpiece material, and cutting parameters. A model is also established to demonstrate the influence of tool wear on the actual cutting radius and cutting edge position. By merging the evolution model and the influence model, a tool wear error sub-model is obtained, taking cutting time as input and the actual change in tool geometry as output.

[0027] In this embodiment, a 4x4 coupling coefficient matrix is ​​initialized, with rows and columns corresponding to four error sources: thermally induced error, force-induced deformation error, tracking error, and tool wear error. Multiple sets of error data under the individual effects of each error source and the combined error data under their combined effects are extracted from a historical machining database. Using multiple linear regression, the main effect coefficients of each error source and the pairwise interaction effect coefficients are calculated and filled into the corresponding positions in the coupling coefficient matrix. The coupling coefficient matrix is ​​combined with the four error sub-models to form a complete multi-source error coupling mechanism model. The workpiece digital twin model, the machine tool kinematics sub-model, and the multi-source error coupling mechanism model containing the coupling coefficient matrix are associated within a unified data framework, enabling the digital twin model to output predicted comprehensive machining errors at various positions along the entire tool path when given a tool path and machining parameter inputs.

[0028] In this embodiment, a multi-source sensor network is configured and acquisition parameters are set. Accelerometers and power sensors are installed in the X, Y, and Z directions of the spindle, respectively. Temperature sensors are installed near the motors of each feed axis. Three-dimensional cutting force sensors and thermocouple temperature sensors are installed near the workpiece. A displacement sensor is installed at the end of the spindle. The sampling frequency of all sensors is set to collect at least 50 data points per revolution of the tool. All sensors are aggregated to an edge computing node via a data acquisition card, establishing a unified timestamp synchronization mechanism. After machining starts, each sensor continuously acquires signals according to the set sampling frequency. The acquired signal channels include: spindle X-axis acceleration signal, spindle Y-axis acceleration signal, spindle Z-axis acceleration signal, and X-axis feed force signal. The following signals are provided: Y-axis acceleration signal, Z-axis acceleration signal, spindle power signal, X-axis cutting force signal, Y-axis cutting force signal, Z-axis cutting force signal, spindle near-field temperature signal, leadscrew near-field temperature signal, workpiece near-field temperature signal, servo position deviation signal of each feed axis, and spindle load signal. These signals are aligned according to timestamps and concatenated into a multivariate time series matrix of dimension T×N, where T is the time window length and N is the total number of signal channels. Each column of this time series matrix is ​​subjected to mean removal, low-pass filtering to remove high-frequency noise, and normalization to uniformly scale the signals of each channel to the [0,1] interval.

[0029] In this embodiment, the preprocessed multivariate time series matrix is ​​input into a one-dimensional convolutional neural network module. The first convolutional layer of this module uses a 3×N kernel to perform sliding convolution along the time dimension, extracting the spatial coupling features between signal channels within a local time window. The output of the first convolutional layer is then passed through the second and third convolutional layers sequentially, with batch normalization and ReLU nonlinear activation performed after each convolution. Max pooling is performed after the third convolutional layer to downsample the feature map along the time dimension, reducing the length of the feature sequence. The high-dimensional feature map output after multiple convolution-pooling operations is used as the output of the CNN module. Obtain the feature sequence output by the CNN module, where each feature vector corresponds to a time segment in the original signal time series. Calculate the absolute position index of each feature vector within the sequence. For each position index, calculate its sine and cosine position code values, and concatenate them to form the position code vector for that position. Add the position code vector element-wise to the corresponding feature vector to obtain the position-encoded feature sequence carrying temporal position information. The position-encoded feature sequence is input into the Transformer encoder layer. This encoder layer first performs a multi-head self-attention operation: the input feature sequence is multiplied by the query weight matrix, key weight matrix, and value weight matrix respectively, resulting in a query vector sequence, a key vector sequence, and a value vector sequence. Each query vector in the query vector sequence is multiplied by all key vectors in the key vector sequence, and the result is scaled by the square root of the dimension, then processed by the Softmax function to obtain the attention weight distribution. This attention weight distribution is then weighted and summed with the value vector sequence to obtain the self-attention output of that head. The self-attention calculations for multiple heads are performed in parallel, and the outputs of each head are concatenated along the feature dimension and then linearly transformed to obtain the multi-head self-attention output. The multi-head self-attention output is added to the original input via a residual connection, then normalized, and fed into a feedforward network for processing. The feedforward network contains two fully connected layers and an intermediate ReLU activation layer. The feedforward network output is then normalized again via a residual connection to obtain the final output of the Transformer encoder.

[0030] In this embodiment, the feature sequence output by the Transformer encoder is input into multiple parallel fully connected networks in the output layer. The output layer contains four parallel fully connected sub-networks: a tangential system stiffness coefficient prediction sub-network, a cutting force mode coefficient prediction sub-network, a thermal deformation coefficient prediction sub-network, and a tool wear rate prediction sub-network. Each sub-network consists of an input layer, two hidden layers, and an output layer. The feature sequence is input into the four sub-networks, and the output values ​​of each sub-network are calculated, namely, the tangential system stiffness coefficient sequence, cutting force mode coefficient sequence, thermal deformation coefficient sequence, and tool wear rate sequence within the current time window.

[0031] In this embodiment, the current value of the four predicted time-varying parameter sequences is taken and denoted as the predicted stiffness coefficient, predicted force mode coefficient, predicted thermal deformation coefficient, and predicted wear rate, respectively. Based on the principle of energy conservation, the theoretical value of the cutting power should be equal to the product of the cutting force and the cutting speed. This product value should be consistent with the spindle power value measured by the sensor. If the relative deviation between the two exceeds a preset threshold, a correction mechanism is activated to fine-tune the predicted value in the direction that reduces the physical loss function. Based on the principle of force balance, the resultant force of the three-axis cutting forces should satisfy the vector synthesis relationship with the cutting force mode coefficients of each axis. If the synthesis deviation exceeds the threshold, corresponding corrections are made. The time-varying parameters after physical consistency verification and correction are output as the final identification result.

[0032] In this embodiment, the current time-varying parameter values ​​of the final output are obtained, including the tangential system stiffness coefficient, cutting force mode coefficient, thermal deformation coefficient, and tool wear rate. The tangential system stiffness coefficient and cutting force mode coefficient are substituted into the constructed cutting force-induced deformation error sub-model to replace the original initial stiffness coefficient and initial force mode coefficient values ​​of the model. The thermal deformation coefficient is substituted into the constructed thermally induced error sub-model to adjust the parameter values ​​of heat conduction rate and thermal expansion sensitivity in the model. The tool wear rate is substituted into the constructed tool wear error sub-model to update the wear accumulation rate parameter in the model. At the same time, the above four time-varying parameter values ​​are input into the coupling coefficient matrix to trigger the recalculation of the coupling coefficient matrix: based on the current time-varying parameters, the latest coupling coefficient matching the current machining state is obtained by interpolation from the pre-stored multi-condition coupling coefficient lookup table and the original coupling coefficient value is replaced. After all the above parameter replacements are completed, the parameter field of the digital twin model is synchronized with the current state of the physical machining process.

[0033] In this embodiment, please refer to Figure 3 The synchronous correction module includes: The preprocessing submodule is used to acquire processing signals in real time and splice them into a time series matrix. It performs mean removal, low-pass filtering and normalization preprocessing operations on each channel in the time series matrix. The model processing submodule is used to input the preprocessed time series matrix into the CNN module and Transformer encoder of the CNN-Transformer hybrid model for processing. The fully connected sub-network processing module is used to input the high-dimensional feature sequence output by the Transformer encoder into four parallel fully connected sub-networks, and output the time-varying parameters under the current processing state, and synchronously correct them to the digital twin model.

[0034] In this embodiment, preset toolpath data from the CNC machining program is acquired, including a series of theoretical tool position coordinates in the workpiece coordinate system and the tool axis direction vector corresponding to each tool position. Discrete sampling is performed along the toolpath direction at equal arc length intervals, dividing the path into several tool positions. The sequence number, spatial coordinates, tool posture, feed rate, and spindle speed of each tool position are recorded. All tool positions are traversed sequentially starting from the first tool position. For each tool position, the feed rate, spindle speed, coordinate position, and tool posture at that point are input into the established thermally induced error sub-model to calculate the thermally induced error vector at that point. The cutting depth, feed rate, spindle speed, and the currently identified tangential system stiffness coefficient and cutting force mode coefficient at that tool position are input into the force-induced deformation error sub-model to calculate the force-induced deformation error vector. The feed rate, acceleration, and servo control parameters of each axis at that tool position are input into the tracking error and contour error sub-model to calculate the tracking error vector and contour error vector. The cumulative cutting time at that tool position is input into the tool wear error sub-model to calculate the tool wear error vector.

[0035] In this embodiment, the four calculated error vectors are arranged in the row direction to form a four-row, one-column error column vector. The coupling coefficient value of the current state is extracted from the established coupling coefficient matrix, and the four-row, four-column coupling coefficient matrix is ​​multiplied by the error column vector to obtain the coupled comprehensive error column vector. The final comprehensive machining error value, including the comprehensive error in the X direction, the comprehensive error in the Y direction, and the comprehensive error in the Z direction, is read from this comprehensive error column vector. All geometric surfaces of the workpiece digital twin model are traversed, and each surface is checked to see whether it is the inner surface of the irregular cavity structure or the outer surface of the thin-walled region. For the irregular cavity structure, the spatial coordinate data of its boundary line is extracted, and the geometric curvature change rate near the boundary line is calculated. For the thin-walled region, the corresponding points of its inner and outer surfaces are extracted, and the wall thickness value at each position is calculated. Local areas in the region near the boundary of the irregular cavity where the curvature change rate exceeds the preset curvature threshold are marked as feature-sensitive regions. Local areas in the thin-walled region where the wall thickness value is lower than the preset wall thickness threshold are marked as feature-sensitive regions. At the same time, the overlapping region that simultaneously meets the dual conditions of irregular cavity boundary and thin wall is marked as the highest priority feature-sensitive region.

[0036] In this embodiment, for each marked feature-sensitive region, all tool positions contained within that region and their corresponding calculated comprehensive machining error values ​​are extracted. The tool positions within the sensitive region are divided into multiple sub-regions according to spatial adjacency. Within each sub-region, the gradient values ​​of the error in the X, Y, and Z directions as a function of spatial position are calculated. For each direction, the error change between adjacent tool positions within the sub-region is divided by the corresponding spatial distance change to obtain the error gradient estimate in that direction. The error gradient estimates in each direction are combined into a comprehensive error gradient vector. The magnitude of the calculated comprehensive error gradient vector for each sub-region is taken and compared with a pre-set gradient threshold. If the magnitude is less than or equal to the gradient threshold, local optimization is not triggered for that sub-region. If the magnitude is greater than the gradient threshold, the sub-region is marked as a sub-region requiring optimization, and local process parameter optimization is performed.

[0037] In this embodiment, the particle swarm is initialized with a size of 30 particles. Each particle's position vector is a two-dimensional vector, representing the feed rate adjustment coefficient and the depth of cut adjustment coefficient, respectively. The position and velocity values ​​of each particle are randomly initialized. The maximum number of iterations is set to 200. The range of time-varying acceleration coefficients is defined: the cognitive acceleration coefficient decreases linearly from 2.5 to 0.5 with each iteration, while the social acceleration coefficient increases linearly from 0.5 to 2.5 with each iteration. For each iteration: the fitness value of each particle is calculated. The fitness function is the weighted sum of the comprehensive machining errors within the feature-sensitive region obtained by recalculating under the corresponding feed rate and depth of cut adjustment coefficients. The current fitness value of each particle is compared with its historical best fitness value; if better, the historical best position is replaced. The individual fitness values ​​of all particles are compared. The minimum of the historical best fitness value is taken as the global historical best position. The current cognitive acceleration coefficient and social acceleration coefficient are calculated based on the current iteration number. The velocity value of each particle is updated according to the particle swarm velocity update equation, in which the inertia weight multiplied by the current velocity, the cognitive acceleration coefficient multiplied by the random number and the product of the individual's best position and the current position, and the social acceleration coefficient multiplied by the random number and the product of the global best position and the current position are added together to obtain the new velocity. The position value of each particle is updated according to the velocity update result. It is checked whether the position value exceeds the allowable range of feed rate and cutting depth. If it does, it is constrained to the boundary value. The above iterative process is repeated until the maximum number of iterations is reached. The feed rate adjustment coefficient and cutting depth adjustment coefficient corresponding to the global historical best position are used as the final optimization result output and applied to the sub-region to be optimized.

[0038] In this embodiment, non-rotational surface feature regions on shaft-type parts are identified, including flat planes, keyway sidewalls, and spline sidewalls; theoretical contour geometric data of these non-rotational surface features are obtained; for each tool position point within the non-rotational surface feature region, the contour error value at that tool position point is extracted from the calculation results. This contour error value reflects the deviation vector between the actual and theoretical positions of the tool caused by multi-axis linkage tracking errors; based on the components of this deviation vector on each coordinate axis, the correction amount for the tool axis direction angle and the correction amount for the feed path curvature required to eliminate the contour error are calculated respectively; the tool axis direction angle correction amount and the feed path curvature correction amount are added to the original tool path data of that tool position point.

[0039] In this embodiment, the comprehensive error values ​​in the X, Y, and Z directions at each tool position point are summarized, along with the feed rate adjustment coefficient and depth of cut adjustment coefficient of the output feature-sensitive sub-regions that need optimization, and the tool axis direction angle correction and feed path curvature correction of each tool position point in the output non-rotating surface feature region. For each tool position point: the comprehensive error values ​​in the X, Y, and Z directions are reversed and used as the tool position compensation amount for that tool position point; the tool axis direction angle correction amount is used as the tool attitude compensation amount for that tool position point; the feed rate adjustment coefficient is multiplied by the original feed rate of that tool position point to obtain the optimized feed rate, and the difference between the optimized feed rate and the original feed rate is used as the feed rate adjustment amount for that tool position point; the above compensation amounts are arranged according to the machining sequence of the tool positions to generate a comprehensive compensation command sequence synchronized with the tool path.

[0040] In this embodiment, the compensation calculation module includes: The discrete sampling submodule is used to discretely sample along the preset tool path and traverse each tool position point. After calculating four error vectors, it multiplies them with the coupling coefficient matrix to obtain the comprehensive machining error value in the X, Y, and Z directions of each tool position point. The marking submodule is used to mark regions with a curvature change rate of the irregular cavity boundary and a wall thickness below a threshold as feature-sensitive regions, divide sub-regions according to spatial adjacency and calculate the comprehensive error gradient of each sub-region, and mark sub-regions with gradient magnitude exceeding a preset threshold as sub-regions that need optimization. The optimization iteration submodule is used to perform optimization iteration on the feed rate and depth of cut of the sub-region to be optimized using the TVAC-PSO algorithm, output the optimal adjustment coefficient, and calculate the tool axis direction angle correction and feed path curvature correction for the contour error deviation vector of the non-rotating surface feature region. The integration submodule is used to output a comprehensive compensation command sequence based on the tool axis direction angle correction and the feed path curvature correction.

[0041] In this embodiment, a generated comprehensive compensation command sequence is obtained. Each tool position point in the sequence records the tool position compensation amount, tool attitude compensation amount, and feed rate adjustment amount at that point. At the start of the CNC system interpolation cycle, the theoretical position command and theoretical tool attitude command of the current interpolation cycle are read, and the compensation amounts corresponding to the current tool position point are found from the comprehensive compensation command sequence. The theoretical position command is added to the tool position compensation amount to obtain the corrected position command. The theoretical tool attitude command is added to the tool attitude compensation amount to obtain the corrected tool attitude command. The theoretical feed rate is added to the feed rate adjustment amount to obtain the corrected feed rate command. The corrected position command, attitude command, and feed rate command are sent as actual command values ​​to the servo drivers and spindle drivers of each feed axis to execute the machining motion of the interpolation cycle. The above process is repeated in the next interpolation cycle until all commands of the entire toolpath have been executed.

[0042] In this embodiment, after processing is completed, the control machine's in-machine probe or laser measuring device automatically measures the processed workpiece according to a preset measurement path. The measurement points cover key contour points of irregular cavity structures, wall thickness measurement points of thin-walled areas, contour measurement points of non-rotating surface features, and main shaft diameter measurement points of shaft parts. The actual spatial coordinate values ​​of each measurement point are obtained, and the difference between the actual coordinate values ​​and the theoretical coordinate values ​​of the corresponding points is calculated point by point to obtain the measured error value of each measurement point in each coordinate axis direction. The comprehensive processing error prediction value calculated at the tool position point with the same spatial position or nearest neighbor to each measurement point is extracted from the digital twin model. At each measurement point, the predicted error value of the digital twin model is subtracted from the measured error value of the point to obtain the predicted deviation value at that point. The predicted deviation values ​​at all measurement points are statistically analyzed according to the error direction, and the mean and standard deviation of the predicted deviation in each direction are calculated. If the mean of the predicted deviation in a certain direction exceeds the preset accuracy threshold, it is determined that there is a systematic deviation in the digital twin model in that direction, and the model needs to be updated.

[0043] In this embodiment, all data from the current machining process is encapsulated into a new sample. The input of this sample is the collected and preprocessed multivariate time series signal data, and the label of this sample is the continuous deviation distribution data along the entire tool path after interpolation expansion of the predicted deviation values ​​at each measurement point. All historical samples under this part type are retrieved from the historical machining database. The historical samples are used as source domain data, and the new sample is used as target domain data. All network weight parameters of the already trained CNN-Transformer model are used as initial weights. Some samples are randomly selected from the historical samples and mixed with the new sample to form a fine-tuning training set. The model is further trained using the fine-tuning training set. During the training process, a smaller learning rate than the initial training is used. While retaining the general features already learned by the model, the weight parameters of the higher layers are fine-tuned so that the model can adapt to the drift characteristics of the current machining state. After the fine-tuning training is completed, the updated model replaces the original CNN-Transformer model.

[0044] In this embodiment, the following data is extracted from the entire processing process: workpiece identification number and type code, heat treatment status data, actual processing parameter combinations used, complete multi-source sensor signal time series collected, complete sequence of the evolution of each time-varying parameter over processing time identified, generated comprehensive compensation instruction sequence, collected measured error data, calculated predicted deviation data, and updated model parameter version number. The above data is encapsulated into a complete record entry for this processing according to a unified data structure. This entry is stored in a cloud database. Simultaneously, key information is extracted from this entry to construct new nodes and connections in a knowledge graph: a processing record node is created, which stores the processing parameter set. Summary of combined and measured results; creation of a node for this part type; establishment of a relational connection between this part type node and the current machining record node; establishment of an inclusion relational connection between the current machining record node and the sequence data of each time-varying parameter; establishment of an adoption relational connection between the current machining record node and the compensation instruction sequence; establishment of a generation relational connection between the current machining record node and the measured error data; after accumulating multiple machining records of similar parts in the database, by querying the historical records of the same part type and similar machining parameter conditions in this knowledge graph, the corresponding machining parameters and compensation effects are extracted, providing a reference for the initial selection of machining parameters and the formulation of compensation strategies for subsequent similar parts.

[0045] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.

Claims

1. A machining error compensation system for shaft parts integrating machine intelligence and digital twins, characterized in that, The system includes: The digital twin model construction module is used to construct a multi-source error coupled digital twin model that couples thermally induced errors, force-induced deformation errors, tracking errors, and tool wear errors during the machining of shaft parts; The synchronous correction module is used to acquire processing signals in real time, extract spatial features and capture temporal dependencies of the acquired signals through a CNN-Transformer hybrid model, output time-varying parameters under the current processing state, and synchronously correct them to the digital twin model. The compensation calculation module is used to perform real-time simulation of machining errors along the preset tool path based on the updated digital twin model, and calculate the corresponding tool position compensation, tool attitude compensation and feed rate adjustment, and generate a comprehensive compensation instruction sequence. The closed-loop compensation module is used to inject the comprehensive compensation command sequence into the machine tool servo control system in real time to perform closed-loop error compensation and continuously evolve the digital twin model.

2. The shaft-type parts machining error compensation system integrating machine intelligence and digital twins as described in claim 1, characterized in that, The digital twin model construction module includes: The initial model building submodule is used to read the 3D design model and material property data of shaft parts and generate an initial digital twin of the workpiece. The mesh refinement submodule is used to traverse the geometric surface of the initial workpiece digital twin to calculate the rate of curvature change, refine the mesh in the corner area and thin-walled area of ​​the irregular cavity, and output a workpiece digital twin model with differentiated mesh density. The first sub-model establishment sub-module is used to read the structural parameters and kinematic transmission chain data of each feed axis of the CNC machine tool, establish the kinematic mapping relationship from the servo motor to the center point of the tool, and at the same time establish the vibration characteristic sub-model of the spindle and tool system. The second sub-model building sub-module is used to build the thermal error mechanism sub-model, the cutting force deformation error mechanism sub-model, the contour error mechanism model, and the tool wear error mechanism sub-model, respectively. The model generation submodule is used to fit the error source coupling coefficient matrix through multiple linear regression, and then integrate the coupling coefficient matrix with the four error sub-models, the workpiece digital twin model, and the vibration characteristic sub-model to generate a multi-source error coupled digital twin model.

3. The shaft-type parts machining error compensation system integrating machine intelligence and digital twins as described in claim 2, characterized in that, The second sub-model building sub-module includes: A heat generation model of the spindle motor, lead screw and nut pair and guide rail slider is established, and a heat transfer path model is constructed to conduct heat along the machine tool structural components to the center point of the tool. The models are then combined to form a heat-induced error mechanism sub-model with position command and spindle speed as input and heat-induced position deviation as output. An instantaneous cutting force calculation model is established based on the tool geometry parameters and cutting parameters. An elastic deformation transfer function from the point of application of the cutting force to the center point of the tool is established in combination with the stiffness distribution, and a sub-model of the deformation error mechanism caused by the cutting force is obtained. The control parameters of the servo drive system of each feed axis are obtained, the dynamic response transfer function of each feed axis to the position command is established, the tracking error of each axis is calculated along the discrete tool position point, and the contour error mechanism sub-model is established based on the geometric coupling relationship of multi-axis linkage. Based on the combination of tool material, workpiece material, and cutting parameters, an evolution model of tool flank wear over cutting time is established, and the influence of wear on the actual geometry of the tool is established, which are then combined to form a sub-model with wear error mechanism.

4. The shaft-type parts machining error compensation system integrating machine intelligence and digital twins as described in claim 1, characterized in that, The synchronization correction module includes: The preprocessing submodule is used to acquire processing signals in real time and splice them into a time series matrix. It performs mean removal, low-pass filtering and normalization preprocessing operations on each channel in the time series matrix. The model processing submodule is used to input the preprocessed time series matrix into the CNN module and Transformer encoder of the CNN-Transformer hybrid model for processing. The fully connected sub-network processing module is used to input the high-dimensional feature sequence output by the Transformer encoder into four parallel fully connected sub-networks, and output the time-varying parameters under the current processing state, and synchronously correct them to the digital twin model.

5. The shaft-type parts machining error compensation system integrating machine intelligence and digital twins as described in claim 4, characterized in that, The model processing submodule includes: The output spatial feature sequence is obtained after multi-layer convolution, batch normalization, ReLU activation and max pooling operations of the CNN module; The encoding submodule is used to calculate the sine and cosine position encoding values ​​of each feature vector in the spatial feature sequence according to the time position, and add the position encoding vector to the feature vector element by element to obtain the position encoded feature sequence including the temporal position information. The nonlinear transformation submodule is used to input the position-encoded feature sequence into the Transformer encoder, calculate the long-range dependency weights between each feature through multi-head self-attention, and output the encoded high-dimensional feature sequence after nonlinear transformation by the feedforward network.

6. The shaft-type parts machining error compensation system integrating machine intelligence and digital twins as described in claim 4, characterized in that, The fully connected sub-network processing submodule includes: The fully connected subnetwork sequentially calculates and outputs the predicted value sequence of four time-varying parameters: tangential stiffness coefficient, cutting force mode coefficient, thermal deformation coefficient, and tool wear rate. The vector composition relationship of the three-dimensional cutting force components is verified based on the principle of force balance, and the predicted values ​​that exceed the physical constraint threshold are corrected along the direction of decreasing physical loss function. Replace the initial parameters in the sub-model of the cutting force-induced deformation error mechanism with the corrected tangential system stiffness coefficient and cutting force mode coefficient; Replace the thermal conduction parameter in the thermal error mechanism sub-model with the thermal deformation coefficient, and replace the wear accumulation rate parameter with the tool wear rate; The coupling coefficient matrix is ​​updated by interpolation from the pre-stored coupling coefficient lookup table based on the current time-varying parameters, thus completing the synchronous correction of the digital twin model.

7. The shaft-type parts machining error compensation system integrating machine intelligence and digital twins as described in claim 1, characterized in that, The compensation calculation module includes: The discrete sampling submodule is used to discretely sample along the preset tool path and traverse each tool position point. After calculating four error vectors, it multiplies them with the coupling coefficient matrix to obtain the comprehensive machining error value in the X, Y, and Z directions of each tool position point. The marking submodule is used to mark regions with a curvature change rate of the irregular cavity boundary and a wall thickness below a threshold as feature-sensitive regions, divide sub-regions according to spatial adjacency and calculate the comprehensive error gradient of each sub-region, and mark sub-regions with gradient magnitude exceeding a preset threshold as sub-regions that need optimization. The optimization iteration submodule is used to perform optimization iteration on the feed rate and depth of cut of the sub-region to be optimized using the TVAC-PSO algorithm, output the optimal adjustment coefficient, and calculate the tool axis direction angle correction and feed path curvature correction for the contour error deviation vector of the non-rotating surface feature region. The integration submodule is used to output a comprehensive compensation command sequence based on the tool axis direction angle correction and the feed path curvature correction.

8. The shaft-type parts machining error compensation system integrating machine intelligence and digital twins as described in claim 7, characterized in that, The optimization iteration submodule includes: Initialize the particle swarm, including the feed rate adjustment coefficient and the depth of cut adjustment coefficient, iteratively calculate the fitness value of each particle, and update the individual optimal and global optimal positions; The particle velocity and position are updated based on the time-varying acceleration coefficient. After reaching the maximum number of iterations, the optimal adjustment coefficient is output and applied to the sub-region that needs to be optimized.

9. The shaft-type parts machining error compensation system integrating machine intelligence and digital twins as described in claim 7, characterized in that, The integration submodule includes: The combined error of each tool position point is reversed and used as the position compensation amount, the tool axis direction angle correction amount is used as the attitude compensation amount, and the difference between the optimized feed rate and the original value is used as the rate adjustment amount. These are integrated into a comprehensive compensation command sequence according to the machining sequence.

10. A method for implementing the machining error compensation system for shaft parts integrating machine intelligence and digital twins as described in claim 1, characterized in that, The method includes: Construct a multi-source error coupling digital twin model that couples thermally induced error, force-induced deformation error, tracking error, and tool wear error during the machining of shaft parts; The processing signals are acquired in real time, and the spatial features and temporal dependencies of the acquired signals are extracted by the CNN-Transformer hybrid model. The output is the time-varying parameters under the current processing state, and the data is synchronously corrected to the digital twin model. Based on the updated digital twin model, the machining error is simulated in real time along the preset tool path, and the corresponding tool position compensation, tool attitude compensation and feed rate adjustment are calculated to generate a comprehensive compensation command sequence. The comprehensive compensation command sequence is injected into the machine tool servo control system in real time to perform closed-loop error compensation, and the digital twin model is continuously evolved.