Closed-loop control method of lathe numerical control system fused with cam wear compensation

By synchronously collecting multi-source time-series data under lathe no-load conditions and using a pre-trained model for cam wear compensation, the problem of accuracy degradation caused by wear of traditional cam pairs is solved, realizing online precise compensation and safety control, and improving machining accuracy and equipment safety.

CN122044084APending Publication Date: 2026-05-15NANJING KAITONG AUTOMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING KAITONG AUTOMATION TECH CO LTD
Filing Date
2026-03-16
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Traditional mechanical cam pairs suffer from wear during long-term, high-load, and high-frequency operation, leading to irreversible deviations in the motion pattern of the follower. Existing technologies cannot achieve online prediction and compensation for wear, affecting the dimensional accuracy and surface quality of the workpiece.

Method used

By synchronously collecting multi-source time-series data under no-load operation of the lathe, and using a pre-trained geometric feature extraction model and control parameter compensation model, the profile height correction amount of the corrected electronic cam is generated. Feasibility verification and safety limits are then performed using the lathe's digital twin performance boundary model, thereby achieving online compensation for cam wear.

Benefits of technology

It enables accurate identification and intelligent compensation of cam wear conditions, improves the stability of machining accuracy, reduces maintenance costs, and enhances equipment safety and production continuity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122044084A_ABST
    Figure CN122044084A_ABST
Patent Text Reader

Abstract

The invention discloses a closed-loop control method of a lathe numerical control system fused with cam wear compensation, and relates to the field of industrial control systems.The method comprises the steps that under the no-load running state of a lathe, multi-source time sequence data are collected; calculating a no-load contour error based on the multi-source time sequence data, inputting the no-load contour error and the temperature signal into the geometric feature extraction model, and outputting a comprehensive contour distortion coefficient; the comprehensive contour distortion coefficient and the current machining process parameters are jointly input into a control parameter compensation model, and the contour height correction amount used for correcting the electronic cam is generated; inputting the contour height correction into a lathe digital twinning performance boundary model for feasibility verification and safety amplitude limiting, and generating a safety compensation instruction; and executing a safety compensation instruction, and optimizing the geometric feature extraction model and the control parameter compensation model according to a processing result. The problems that in the prior art, due to abrasion of an electronic cam pair, instruction execution is distorted, precision is degraded, and accurate recognition of abrasion errors is disturbed are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial control systems, and more specifically to a closed-loop control method for a lathe CNC system that integrates cam wear compensation. Background Technology

[0002] A cam mechanism is a common type of motion mechanism, consisting of a cam, a follower, and a frame. It is widely used in various automatic machines, instruments, and control devices. Traditional mechanical cams convert the rotational motion of the spindle into specific reciprocating or feed motions of the follower through their inherent physical profile.

[0003] However, this rigid mechanical coupling method has inherent drawbacks: cam pairs inevitably experience wear under long-term high load and high-frequency operation, manifesting in various forms such as fatigue pitting, abrasive wear, and overall profile distortion. This wear leads to irreversible deviations in the motion of the follower, resulting in dimensional errors and decreased surface quality. Traditional countermeasures mainly rely on periodic inspection and replacement, which are reactive and cannot achieve online prediction and compensation for wear.

[0004] With the development of CNC technology, electronic cam (or electronic cam table) technology has become a standard configuration of CNC systems. Electronic cam technology replaces physical cams by using a software-defined spindle-driven axis position mapping table, i.e., the electronic cam table, achieving the digitization and flexibility of motion laws. Motion curves can be flexibly adjusted by modifying the electronic cam table without replacing hardware, greatly improving the program adaptability of the equipment. However, the output commands of the electronic cam still ultimately need to drive the actuator through servo drives and mechanical transmission chains. Therefore, its final execution accuracy depends not only on the interpolation and control accuracy of the CNC system itself, but also on the back-end mechanical transmission mechanism, especially the motion accuracy of the cam pair. When the mechanical cam pair wears, the precise commands issued by the electronic cam table will be distorted in the mechanical components.

[0005] In summary, there is a need for an intelligent compensation method that can sense the wear state of the cam pair online, make intelligent decision-making compensation strategies, and be safely integrated into the CNC closed-loop control system, so as to fundamentally solve the problem of accuracy degradation caused by the wear of the mechanical cam pair on which electronic cams depend. Summary of the Invention

[0006] This application provides a closed-loop control method for lathe CNC systems that integrates cam wear compensation, addressing the problems of distorted command execution, accuracy degradation, and accurate identification of interference wear errors caused by wear of electronic cam pairs in existing technologies.

[0007] In view of the above problems, this application provides a closed-loop control method for lathe CNC system that integrates cam wear compensation.

[0008] This application provides a closed-loop control method for a lathe CNC system incorporating cam wear compensation, the method comprising:

[0009] When the lathe is running under no-load conditions, multi-source time-series data are collected synchronously, including the spindle encoder phase signal, the actual position feedback signal of the feed axis, and the temperature signal.

[0010] The unloaded contour error is calculated based on the multi-source time-series data, and the unloaded contour error and the temperature signal are input into a pre-trained geometric feature extraction model to output the comprehensive contour distortion coefficient.

[0011] The comprehensive contour distortion coefficient and the current machining process parameters are input into the pre-trained control parameter compensation model to generate the contour height correction amount for correcting the electronic cam.

[0012] The contour height correction amount is input into the lathe digital twin performance boundary model for feasibility verification and safety limit, and a safety compensation command is generated.

[0013] The safety compensation instruction is executed, and the geometric feature extraction model and the control parameter compensation model are optimized based on the processing results.

[0014] One or more technical solutions provided in this application have at least the following technical effects or advantages:

[0015] This application firstly collects multi-source time-series data synchronously during the lathe's no-load operation to ensure data input reliability. Synchronization processing ensures data temporal consistency, guaranteeing the accuracy of subsequent feature extraction and model calculation. Secondly, by constructing a geometric feature extraction model, a comprehensive contour distortion coefficient is output to quantify the degree of cam contour distortion, providing a scientific basis for subsequent compensation calculations. The geometric feature extraction model ensures comprehensive wear feature capture, and the adaptive fusion layer improves quantification accuracy under different temperature conditions. Thirdly, through a control parameter compensation model, a contour height correction amount for the corrected electronic cam is generated, achieving intelligent adaptation of the compensation amount. This ensures that the compensation parameters match the cam wear state, adapt to the stress characteristics of the current machining process, avoid machining accuracy fluctuations caused by a single compensation scheme, and meet the requirements of online real-time compensation. Finally, the feasibility of the contour height correction amount is verified and safety limits are set using the lathe's digital twin performance boundary model, generating safe compensation commands to mitigate operational risks, ensure the safety of the machine tool's mechanical structure and servo system, and prevent equipment damage or machining failures caused by improper compensation commands. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a flowchart illustrating the closed-loop control method for a lathe CNC system that integrates cam wear compensation, as described in this application.

[0018] Figure 2 This is a flowchart illustrating the process of outputting a safety compensation command as part of the closed-loop control method for a lathe CNC system that integrates cam wear compensation in this application. Detailed Implementation

[0019] This application provides a closed-loop control method for lathe CNC systems that integrates cam wear compensation. By supplementing missing components, it solves the problems of instruction execution distortion, accuracy degradation, and accurate identification of interference wear errors caused by wear of electronic cam pairs.

[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0021] It should be noted that the terms "comprising" and "having" are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or modules that are not explicitly listed or that are inherent to these processes, methods, products, or devices.

[0022] The present invention will now be described in detail with reference to the accompanying drawings.

[0023] In an embodiment, such as Figure 1 As shown, this application provides a closed-loop control method for a lathe CNC system that integrates cam wear compensation, the method comprising:

[0024] S10: When the lathe is running under no-load conditions, multi-source timing data is collected synchronously, including the spindle encoder phase signal, the actual position feedback signal of the feed axis, and the temperature signal.

[0025] The no-load operation state refers to the lathe's operation when no workpiece is installed, the cutting tool is not performing cutting operations, and only the spindle drives the camshaft to rotate. Multi-source time-series data consists of various correlated data collected at the same time dimension, including the spindle encoder phase signal, the feed axis actual position feedback signal, and the temperature signal. The spindle encoder phase signal is a continuous electrical signal collected by the spindle encoder, reflecting the spindle's rotation angle and speed, and is the core basis for positioning the cam's rotation angle. The feed axis actual position feedback signal is a signal collected by the position sensor on the feed axis, reflecting the actual displacement of the feed axis. The temperature signal is temperature data of key parts of the machine tool collected by temperature sensors, used to correct the impact of thermal deformation on errors. Synchronous acquisition aligns the data collected by different sensors using a unified time scale, ensuring that multi-source data at the same moment can be correlated and analyzed.

[0026] First, the lathe is set to an unloaded state to avoid interference factors such as cutting force and workpiece clamping errors. Then, the spindle is controlled to drive the camshaft to rotate at a constant speed for at least one revolution. The phase signal is collected in real time through the spindle encoder, the actual position signal is collected through the feed axis position sensor, and the temperature data is collected through the temperature sensors distributed in the spindle box, guide rail, and tool post. Finally, the three sets of data are matched by timestamps using time stamp alignment technology to form a synchronized multi-source time-series dataset.

[0027] Step S10 in the method provided in this application embodiment includes:

[0028] The lathe spindle is controlled to drive the camshaft to rotate at a constant speed for at least one revolution. During the rotation, the spindle encoder phase signal is continuously acquired in real time through the spindle encoder, and the actual position feedback signal of the feed shaft is continuously acquired in real time through the position sensor installed on the feed shaft.

[0029] Temperature signals are collected by temperature sensors arranged on the machine tool spindle box, guide rails and tool post;

[0030] The spindle encoder phase signal, feed axis actual position feedback signal and temperature signal are time-aligned to form synchronized multi-source timing data.

[0031] In this embodiment, the lathe spindle is first controlled to drive the camshaft to rotate at a constant speed for at least one revolution. During this rotation, the spindle encoder continuously acquires phase signals in real time, and the position sensor mounted on the feed axis continuously acquires actual position feedback signals of the feed axis in real time. The spindle encoder is a high-precision angle / position measurement sensor mounted on the lathe spindle, which converts the mechanical angle of the spindle rotation into an electrical signal, realizing real-time feedback of rotational position and speed. The feed axis is the actuation axis in the lathe that realizes the linear feed motion of the tool or worktable, and its position accuracy directly affects the workpiece machining dimensions. The position sensor is a displacement measurement element mounted on the feed axis, which can detect the actual movement position of the feed axis in real time and convert it into an electrical signal, providing feedback for closed-loop control. The actual position feedback signal of the feed axis is an electrical signal reflecting the true position of the feed axis by the position sensor, and is the core data for judging mechanical transmission errors.

[0032] First, the lathe spindle is controlled to drive the camshaft to rotate at a constant speed, requiring at least one revolution to ensure a complete motion cycle covering the cam's contour. During rotation, continuous pulse signals are acquired in real time via the spindle encoder; position signals, i.e., the actual position feedback signal of the feed axis, are acquired in real time via the linear encoder on the feed axis.

[0033] For example, using a 2000P / R incremental grating encoder, the spindle outputs approximately 5.56 pulses per 1° rotation. During forward rotation, phase A pulses lead phase B by 90°, and during reverse rotation, phase B pulses lead phase A by 90°. The spindle rotation angle can be accurately calculated through pulse counting and phase relationship. The grating ruler has a resolution of 0.001mm, and outputs 1 pulse for every 0.001mm movement, reflecting the actual displacement of the feed axis in real time.

[0034] Secondly, temperature signals are collected by temperature sensors arranged on the machine tool spindle box, guide rails, and tool post. Temperature sensors: Temperature sensing elements based on the principle of resistance temperature detectors (RTDs) or thermocouples can convert temperature changes into measurable electrical signals with an accuracy of ±0.1℃.

[0035] One high-precision temperature sensor is installed at each of the three key locations: the camshaft mounting position, the feed shaft motion guide surface, and the feed shaft actuator end. The sensor is activated synchronously with the spindle rotation to collect temperature data in real time. The sampling frequency is set to record the temperature values ​​and trends of each part during no-load operation.

[0036] For example, PT100 resistance temperature sensors are installed on the lathe spindle box, guide rail, and tool post, respectively. The measurement range is -50℃ to 200℃, and the accuracy is ±0.1℃. During 0.12 seconds of no-load operation, the sensors collect data once every 0.1 seconds, recording that the spindle box temperature rises from 25.0℃ to 25.2℃, the guide rail temperature remains at 25.0℃, and the tool post temperature rises from 25.1℃ to 25.3℃, forming a continuous temperature signal.

[0037] Finally, the spindle encoder phase signal, feed axis actual position feedback signal, and temperature signal are time-stamped to form synchronized multi-source time-series data. Time-stamp alignment is achieved by using hardware or software to unify data collected by different sensors onto the same time base, ensuring that the same timestamp corresponds to the same machine tool state. The multi-source time-series data is a dataset containing three types of information: spindle rotation angle, feed axis actual position, and temperature of key components, with unified timestamps. It forms the basis for subsequent calculation of contour errors and extraction of wear features.

[0038] Time stamp alignment is achieved through hardware synchronization and software calibration. First, hardware synchronization: the synchronization pulse from the spindle encoder is used as a trigger signal to control the position and temperature sensors to simultaneously start data acquisition, ensuring consistent acquisition start times. Second, software calibration: high-precision timestamps are added to the three types of acquired data. For differences in sampling frequency, interpolation algorithms are used to supplement the time points of low-sampling-rate data, ultimately forming a data set corresponding to the spindle rotation angle, feed axis position, and temperature of each part for each timestamp.

[0039] For example, the synchronous pulse of the spindle encoder triggers the simultaneous start of three types of sensors, and the PTP protocol is used to achieve clock synchronization with a timestamp accuracy of ±1 microsecond. The 1Hz data of the temperature sensor is linearly interpolated to supplement the sampling frequency of 10kHz, and finally the synchronization data is formed, where the timestamp is [0,100,…,11990], the spindle angle is [0,0.6,…,720], the actual position of the feed axis is [0,0.005,…,12], and the spindle box temperature is [25.0,25.0,…,25.2].

[0040] In this embodiment, by synchronously acquiring the spindle encoder phase signal, feed axis position signal, and temperature signal under no-load conditions, and combining them with time-scale alignment technology, thermal deformation and mechanical wear errors are accurately separated, enabling online sensing of cam wear and providing a high-quality data foundation for online identification of cam wear status. Simultaneously, multi-source synchronous data ensures the accuracy of contour error calculation, making the subsequently generated correction amount more closely match the actual wear situation, effectively compensating for the accuracy degradation of the electronic cam caused by mechanical wear. Furthermore, it reduces maintenance costs, improves production efficiency, enhances production continuity and equipment utilization, and strengthens system operational safety.

[0041] S20: Calculate the unloaded contour error based on the multi-source time-series data, and input the unloaded contour error and the temperature signal into the pre-trained geometric feature extraction model to output the comprehensive contour distortion coefficient;

[0042] The no-load profile error is the difference between the theoretical and actual positions of the feed axis under no-load conditions, directly reflecting the motion deviation caused by cam wear. The geometric feature extraction model is a pre-trained deep learning model, which includes an adaptive weighted fusion layer and three parallel feature extraction branches, used to extract wear-related features from error and temperature data. The comprehensive profile distortion coefficient is the core indicator for quantifying the degree of cam profile wear, which integrates time domain, frequency domain, time-frequency domain features and temperature influence, with a value range of 0-1.

[0043] Based on the synchronized spindle encoder phase signal, the theoretical rotation angle of the cam at each sampling moment is determined; then, the theoretical target position of the feed axis is obtained by querying the electronic cam table pre-stored in the CNC system; then, the no-load profile error is calculated; finally, the profile error and temperature signal are input into the pre-trained geometric feature extraction model, and after the model is calculated, the comprehensive profile distortion coefficient is output.

[0044] Step S20 in the method provided in this application embodiment includes:

[0045] Based on the synchronized spindle encoder phase signal, determine the theoretical rotation angle position of the cam at the current sampling moment;

[0046] Based on the theoretical rotation angle position, the corresponding theoretical feed axis target position is obtained by querying the electronic cam table pre-stored in the CNC system.

[0047] Based on the actual position feedback signal of the feed axis, the actual position of the feed axis at the current sampling time is obtained;

[0048] Calculate the difference between the target position and the actual position of the feed axis to obtain the no-load profile error at the current moment.

[0049] In this embodiment, the theoretical rotation angle position of the cam at the current sampling moment is first determined based on the synchronized spindle encoder phase signal. The theoretical rotation angle position is the rotation angle value of the cam under ideal, wear-free conditions, calculated based on the spindle encoder phase signal, and is the core index parameter of the mapping electronic cam table. The current sampling moment corresponds to the state of each unified timestamp in the multi-source time-series data, ensuring the time synchronization of the rotation angle position with other data.

[0050] Read the synchronized spindle encoder phase signal and extract the pulse accumulation value and AB phase relationship at each sampling moment. Calculate the pulse equivalent based on the encoder resolution. Divide the pulse accumulation value by the pulse equivalent to obtain the absolute angle of spindle rotation. Then, verify the rotation direction by combining the AB phase relationship. The spindle rotation angle position is the theoretical rotation angle position of the cam.

[0051] For example, the lathe spindle encoder has a resolution of 2000 P / R, and a pulse equivalent of 2000 / 360≈5.56 P / °. At a certain sampling moment, the synchronized phase signal shows a cumulative pulse value of 56, with phase A leading phase B by 90°. Therefore, the theoretical cam rotation angle position = 56 / 5.56≈10.07°. Similarly, at a timestamp of 2000 microseconds, the cumulative pulse value is 111, and the theoretical rotation angle position = 111÷5.56≈20.00°.

[0052] Secondly, based on the theoretical rotation angle position, the corresponding theoretical feed axis target position is obtained by querying the pre-stored electronic cam table in the CNC system. The electronic cam table is a mapping data table pre-stored in the CNC system, indexed by the cam rotation angle and outputting the feed axis target position. It contains the ideal position data of the feed axis corresponding to the full contour of the cam. The theoretical feed axis target position is the design position that the feed axis should reach when the cam rotates to a certain theoretical rotation angle under ideal conditions of no wear and no thermal deformation. It is the benchmark value for judging the actual position deviation.

[0053] The pre-stored electronic cam table in the CNC system is calibrated according to the cam design profile. The data table uses the cam rotation angle as the index and the corresponding feed axis target position as the column data. After obtaining the theoretical cam rotation angle position at the current sampling moment: if the theoretical rotation angle position perfectly matches the index step size of the electronic cam table, the corresponding feed axis position data is directly used as the theoretical feed axis target position; if there is a slight deviation, linear interpolation is used to calculate the theoretical feed axis target position.

[0054] Linear interpolation is a simple and efficient numerical estimation method used to predict unknown values ​​between known data points. First, two known data points (x1, y1) and (x2, y2) are determined. Then, the slope m = (y2 - y1) / (x2 - x1) is calculated. For the x-value of the unknown data point to be estimated, the estimated y-value is calculated using the formula y = y1 + m × (x - x1). Setting the target position as the y-value and the theoretical cam rotation angle position as the x-value, substituting these values ​​into the formula yields the corresponding theoretical feed axis target position.

[0055] For example, the pre-stored electronic cam index step size in the CNC system is 0.01°, where 10.06° corresponds to a feed axis target position of 2.5000mm, and 10.08° corresponds to a target position of 2.5010mm. At a certain sampling moment, the theoretical cam rotation angle is 10.07°. Through linear interpolation, the target position is calculated as: Target Position = 2.5000 + (10.07 - 10.06) × (2.5010 - 2.5000) / (10.08 - 10.06) = 2.5005mm. That is, the theoretical feed axis target position at the current moment is 2.5005mm.

[0056] Next, based on the actual position feedback signal of the feed axis, the actual position of the feed axis at the current sampling moment is obtained. The actual position feedback signal of the feed axis is an electrical signal output by the position sensor on the feed axis after time-stamp alignment, which contains the true displacement data of the feed axis at each sampling moment; the actual position of the feed axis is the true physical position of the feed axis at the current sampling moment, reflecting the actual execution result of the cam-driven feed axis movement, and is affected by factors such as cam wear and thermal deformation.

[0057] Read the actual position feedback signal of the synchronized feed axis and extract the position data corresponding to the current sampling time: the output signal is a pulse sequence through the position sensor; then accumulate the total number of pulses before the current sampling time, multiply it by the resolution to obtain the absolute actual position of the feed axis; combine the signal polarity to determine whether the movement direction is forward feed or reverse retraction, to ensure the accuracy of the directionality of the actual position calculation.

[0058] For example, if the feed axis grating ruler has a resolution of 0.001mm, a timestamp of 1000 microseconds, and a corresponding theoretical cam rotation angle of 10.07°, and the synchronous feedback signal at a certain sampling moment displays a cumulative pulse value of 2500, with the signal polarity being positive, then the actual position of the feed axis = 2500 × 0.001 = 2.500mm.

[0059] Finally, the difference between the target position and the actual position of the feed axis is calculated to obtain the no-load profile error at the current moment. The no-load profile error is the difference between the theoretical target position and the actual position of the feed axis at the same sampling moment. Numerical calculations are performed on the theoretical target position and the actual position of the feed axis at the current sampling moment, and the no-load profile error is calculated using the absolute difference. Here, no-load profile error = theoretical feed axis target position - actual feed axis position. A positive difference indicates that the actual position lags behind the target position, and a negative difference indicates that the actual position leads the target position.

[0060] For example, at a certain sampling moment, the theoretical target position of the feed axis is 2.5005mm, and the actual position is 2.5000mm. The calculated no-load profile error is 2.5005 - 2.5000 = +0.0005mm, indicating possible cam wear. At another sampling moment, the theoretical target position is 5.0000mm, and the actual position is 5.0009mm. The no-load profile error is 5.0000 - 5.0009 = -0.0009mm, indicating possible thermal deformation. Through continuous calculation, a sequence of no-load profile errors for 1200 sampling moments is finally formed.

[0061] In step S20 of the method provided in this application embodiment, the unloaded contour error and the temperature signal are input to a pre-trained geometric feature extraction model, and the comprehensive contour distortion coefficient is output, including:

[0062] Invoke a pre-trained geometric feature extraction model, wherein the geometric feature extraction model includes an adaptive weighted fusion layer and three parallel feature extraction branches;

[0063] The empty contour error and the temperature signal are input into the geometric feature extraction model;

[0064] The geometric feature extraction model extracts time-domain statistical features, frequency-domain harmonic features, and time-frequency-domain morphological features through three parallel feature extraction branches, and outputs a first feature vector, a second feature vector, and a third feature vector.

[0065] The first feature vector, the second feature vector, and the third feature vector are input to the adaptive weighted fusion layer along with the temperature signal for fusion calculation, and the comprehensive contour distortion coefficient is output.

[0066] In this embodiment, a pre-trained geometric feature extraction model is first invoked. This model includes an adaptive weighted fusion layer and three parallel feature extraction branches. The geometric feature extraction model is built on a deep learning framework, trained and validated for convergence using a large amount of historical data. It is a neural network model specifically designed to extract features related to cam wear from unloaded contour errors and temperature signals, and output quantitative evaluation metrics. The adaptive weighted fusion layer is the core module in the model used to integrate features from multiple branches. It can dynamically adjust the weight ratio of each branch feature according to the features of the input data, achieving intelligent feature fusion. The parallel feature extraction branches are three independent and simultaneously running feature processing channels in the model, extracting features from different dimensions to ensure comprehensive feature coverage. These branches include a time-domain statistical feature branch, a frequency-domain harmonic feature branch, and a time-frequency domain morphological feature branch.

[0067] When the CNC system initiates the feature extraction process, it first calls the geometric feature extraction model pre-stored in the system's computing module. The model is trained and its parameters are fixed. This results in a geometric feature extraction model architecture consisting of an adaptive weighted fusion layer and three parallel feature extraction branches. Each of the three branches independently receives input data, performs feature processing, and outputs its own feature vector. The adaptive weighted fusion layer receives the outputs from the three branches and the temperature signal, achieving feature fusion through dynamic weight allocation, and ultimately outputs a comprehensive contour distortion coefficient.

[0068] Next, the unloaded contour error and temperature signal are input into the geometric feature extraction model. The input data is the calculated synchronous multi-source data, including the unloaded contour error sequence and the corresponding temperature signal sequence at the sampling time. Before input, it needs to be normalized and mapped to the [-1,1] interval to eliminate the influence of dimensional differences on the model.

[0069] Based on the extreme values ​​of historical data, the linear normalization formula y=(xx) is used. min ) / (x max -x min The error values ​​of the unloaded contour error sequence are mapped to the interval [-1, 1] using the formula 1×2-1. Then, based on the machine tool standard temperature reference value and historical temperature fluctuation range, the temperature values ​​are mapped to the interval [-1, 1] using the same linear normalization formula. The normalized unloaded contour error sequence and temperature signal sequence are then concatenated into an input vector, which is input to the three parallel feature extraction branches and the adaptive weighted fusion layer of the geometric feature extraction model.

[0070] For example, in the obtained unloaded profile error sequence and temperature signal sequence, the range of the unloaded profile error value is -0.0009mm to +0.0005mm, and the range of the temperature signal is 25.0℃ to 25.3℃. During normalization, the x-axis of the error sequence... min =-0.0009mm, x max =0.0005mm, a certain error value of 0.0005mm, after normalization, is (0.0005-(-0.0009)) / (0.0005-(-0.0009))×2-1=1; the x of the temperature series min =25.0℃, x max =25.3℃. A certain temperature value of 25.3℃, after normalization, is (25.3-25.0) / (25.3-25.0)×2-1=1. Finally, these are concatenated into an input vector, which is then input into the geometric feature extraction model.

[0071] Furthermore, the geometric feature extraction model extracts time-domain statistical features, frequency-domain harmonic features, and time-frequency-domain morphological features through three parallel feature extraction branches, and outputs a first feature vector, a second feature vector, and a third feature vector. The time-domain statistical features are statistical characteristics extracted from the time series of the unloaded contour error, including mean, variance, peak value, peak factor, kurtosis, and skewness, reflecting the overall distribution and extreme value characteristics of the error over time. The frequency-domain harmonic features are features such as harmonic amplitude, harmonic frequency, and harmonic phase extracted after transforming the unloaded contour error sequence to the frequency domain using Fourier transform, reflecting the law of error variation with frequency. The time-frequency-domain morphological features are features such as component amplitude, energy proportion, and abrupt change location extracted by decomposing the unloaded contour error sequence into time-frequency components of different scales using wavelet transform, reflecting the local variation characteristics of the error in the time and frequency domains. The first feature vector is the feature vector output by the time-domain statistical feature branch; the second feature vector is the feature vector output by the frequency-domain harmonic feature branch; and the third feature vector is the feature vector output by the time-frequency-domain morphological feature branch.

[0072] Three parallel feature extraction branches process the input data simultaneously. The first feature extraction branch performs sliding window processing on the empty contour error sequence, calculates statistics within each window, and then reduces the dimensionality through a fully connected layer to output the first feature vector. The second feature extraction branch performs a Fast Fourier Transform on the empty contour error sequence to obtain the frequency domain spectrum, extracts the amplitude and frequency features of harmonics through a convolutional layer, and then expands it through a fully connected layer to output the second feature vector. The third feature extraction branch uses the db4 wavelet to decompose the empty contour error sequence, extracting energy proportions and peak values, and outputting the third feature vector.

[0073] For example, the first feature extraction branch calculates the mean of the unloaded contour error sequence to be -0.0001 mm and the variance to be 2.3 × 10⁻⁶ mm. -8 Sixteen statistical quantities, including mm² and peak value of 0.0005 mm, are used to reduce the dimensionality of the data through a fully connected layer, resulting in a 1×32 first feature vector. The second feature extraction branch obtains the harmonics with a main frequency of 16.67 Hz through FFT transformation, extracts the amplitude and frequency of the first 32 harmonics, and outputs a 1×64 second feature vector. The third feature extraction branch obtains eight time-frequency components through db4 wavelet decomposition, extracts the energy proportion of each component, and outputs a third feature vector.

[0074] Finally, the first, second, and third feature vectors, along with the temperature signal, are input into an adaptive weighted fusion layer for fusion calculation, outputting a comprehensive profile distortion coefficient. The comprehensive profile distortion coefficient is a quantitative index obtained by adaptively weighting and fusing the feature vectors of the three branches. It directly reflects the wear degree of the cam profile; the closer the coefficient is to 1, the more severe the wear, and the closer it is to 0, the less severe or no wear.

[0075] The adaptive weighted fusion layer receives the first feature vector, the second feature vector, and the third feature vector, as well as the temperature signal. It calculates the temperature difference value based on the temperature signal. Then, it calculates the dynamic weights of the three feature vectors based on the temperature difference value. The three feature vectors are then mapped to scalar values ​​through a linear projection layer. Finally, the comprehensive contour distortion coefficient is calculated by weighting and summing the dynamic weights, where the contour distortion coefficient = first feature vector × weight + second feature vector × weight + third feature vector × weight.

[0076] In step S20 of the method provided in this application embodiment, the process of constructing the geometric feature extraction model includes:

[0077] Based on a fully connected neural network, a first feature extraction branch for temporal statistical feature extraction is constructed.

[0078] A second feature extraction branch for frequency domain harmonic feature extraction is constructed based on convolutional neural networks and fully connected networks.

[0079] Based on wavelet transform layer and fully connected network, a third feature extraction branch is constructed for time-frequency domain morphological feature extraction;

[0080] An adaptive weighted fusion layer is constructed based on a fully connected neural network;

[0081] Collect no-load profile error data and temperature data of historical lathes under different wear conditions to form a sample training dataset;

[0082] Obtain the measured and calibrated actual contour distortion reference values ​​corresponding to the empty contour error data and temperature data in the sample training dataset to form a sample supervision label set;

[0083] Using the data in the sample training dataset as input and the actual contour distortion reference value in the corresponding sample supervision label set as the training target, the geometric feature extraction model is trained under supervision until it is verified to converge, thus obtaining the trained geometric feature extraction model.

[0084] In this embodiment, a first feature extraction branch for temporal statistical feature extraction is first constructed based on a fully connected neural network. A fully connected neural network (FCN) consists of an input layer, hidden layers, and an output layer. Each neuron in the FCN is fully connected to all neurons in the next layer. It excels at learning the global statistical patterns of data and is suitable for the integration and dimensionality reduction of temporal statistical features.

[0085] The first feature extraction branch is constructed using a fully connected neural network containing an input layer, hidden layers, and an output layer. The input dimension is an empty contour error sequence, the activation function of the hidden layer is ReLU, and the output layer is the corresponding temporal statistical feature. A regularization technique, namely the dropout layer, is used to randomly select a certain proportion of neurons in each training batch to drop them, thereby preventing overfitting.

[0086] The first feature extraction branch takes an empty contour error sequence as input, calculates it through a hidden layer, filters effective features using the ReLU activation function, reduces the dimensionality through another hidden layer, and finally outputs temporal features.

[0087] Secondly, a second feature extraction branch for frequency domain harmonic feature extraction is constructed based on convolutional neural networks (CNNs) and fully connected networks. A CNN, consisting of convolutional layers, pooling layers, and fully connected layers, extracts local spatial / frequency features of data through local receptive fields and weight sharing, making it suitable for capturing harmonic distribution patterns from the frequency spectrum. The second feature extraction branch is constructed using a combination of a CNN with convolutional layers, pooling layers, and fully connected networks. The convolutional layers are adapted to the frequency domain data, while the fully connected layers output frequency domain harmonic feature vectors. The LeakyReLU activation function is used to avoid gradient vanishing.

[0088] The second feature extraction branch extracts local harmonic features from the frequency domain data after FFT transformation through a convolutional layer. After compression of the dimension by max pooling, the frequency domain feature vector is output by a fully connected layer.

[0089] Furthermore, a third feature extraction branch for time-frequency domain morphological feature extraction is constructed based on a wavelet transform layer and a fully connected network. The wavelet transform layer, a neural network layer based on wavelet analysis theory, can decompose time-series data into time-frequency components of different scales while preserving local information in both time and frequency dimensions, and is adept at extracting abrupt changes in non-stationary signals. The third feature extraction branch is constructed using a wavelet transform layer containing a db4 wavelet transform layer and a fully connected layer, outputting a time-frequency domain morphological feature vector. A BatchNorm layer is also introduced to optimize training stability.

[0090] The third feature extraction branch decomposes the time-frequency components of the error sequence using db4 wavelet transform, and then integrates them through a fully connected layer to output a time-frequency domain feature vector.

[0091] Simultaneously, an adaptive weighted fusion layer is constructed based on a fully connected neural network. This layer is a model module that dynamically adjusts the weights of the three branch features according to the input temperature signal, using a fully connected neural network as its foundation. The adaptive weighted fusion layer, constructed using a fully connected neural network, includes an input layer, a hidden layer, and an output layer. The input layer takes into account the total dimension of the three branch feature vectors and the dimension of the temperature signal sequence. The hidden layer uses a sigmoid activation function to map the output values ​​to 0-1 and adapts the weights accordingly. The output layer corresponds to the dynamic weight coefficients of the three feature vectors, with the weights summing to 1. Finally, a temperature difference calculation module is embedded, using the difference between the temperature signal and the standard temperature as the basis for weight adjustment.

[0092] The adaptive weighted fusion layer takes time-domain features, frequency-domain features, time-frequency-domain features, and temperature signals as input. After calculation by the hidden layer, it outputs three weight coefficients. When the temperature difference increases, the hidden layer adjusts its parameters using the sigmoid function, increasing the weights of the time-domain and frequency-domain features and decreasing the weights of the time-frequency-domain features, thus achieving interference adaptation.

[0093] Furthermore, no-load profile error data and temperature data of historical lathes under different wear conditions were collected to form a sample training dataset. The sample training dataset is a collection of no-load profile error data and temperature data under different wear conditions, covering the entire wear range and multiple working environments. The different wear conditions are the cam wear gradients simulated through artificial accelerated wear experiments, including four levels: no wear, light wear, moderate wear, and heavy wear.

[0094] Select equipment of the same model as the target lathe, replace the cams with different wear levels, and build a temperature-controlled experimental environment; under each wear condition, set 3 spindle speeds and 3 temperature conditions, and collect 3 sets of synchronous data for each condition, namely the no-load profile error sequence and temperature signal sequence; then, the collected data are denoised by moving average filtering, normalized to [-1,1], and outliers are removed, finally forming a training dataset of effective samples.

[0095] For example, the wear of a lightly worn cam is 0.0003 mm. Under operating conditions of a spindle speed of 1000 r / min and an ambient temperature of 25℃, one set of synchronous data was collected: 1200 no-load profile error values ​​ranging from -0.0002 to 0.0003 mm, and a temperature sequence ranging from 24.8 to 25.2℃. After noise reduction by moving average filtering, the data was normalized to the interval [-1,1] and used as one sample in the training dataset. Similarly, data collection and preprocessing were completed under all operating conditions to form a training dataset of 108 samples.

[0096] Furthermore, the actual contour distortion reference values ​​corresponding to the unloaded contour error data and temperature data in the sample training dataset, after measurement and calibration, are obtained to form the sample supervision label set. The actual contour distortion reference values ​​are the quantified values ​​of cam contour wear directly calibrated by high-precision measuring equipment, which are the supervision targets for model training and correspond one-to-one with the comprehensive contour distortion coefficients; the sample supervision label set is a collection composed of the actual contour distortion reference values ​​corresponding to each training sample.

[0097] A laser interferometer and a coordinate measuring machine were used to scan the contours of cams under different wear conditions in the experiment. The entire contour of each cam was scanned, and the actual wear amount at each scan point was calculated. The normalized maximum value of the wear amount of the entire contour was taken as the actual contour distortion reference value of the cam. Each training sample was then associated with the corresponding actual contour distortion reference value to form a sample supervision label set containing labels. The label values ​​ranged from 0 to 0.8.

[0098] For example, a lightly worn cam with a wear amount of 0.0003 mm, after scanning with a laser interferometer, has a maximum wear amount of 0.0003 mm and a maximum allowable wear amount of 0.005 mm. The actual contour distortion reference value is 0.0003 / 0.005 = 0.06. A moderately worn cam with a wear amount of 0.0008 mm has an actual contour distortion reference value of 0.0008 / 0.005 = 0.16. A heavily worn cam with a wear amount of 0.004 mm has an actual contour distortion reference value of 0.004 / 0.005 = 0.8. These reference values ​​are matched with the corresponding training samples to form a sample supervision label set.

[0099] Furthermore, using the data in the sample training dataset as input and the actual contour distortion reference values ​​in the corresponding sample supervision label set as training targets, the geometric feature extraction model is trained under supervision until it is verified to converge, thus obtaining the trained geometric feature extraction model.

[0100] The training dataset was split into training and validation sets in an 8:2 ratio to ensure consistent data distribution. The Adam optimizer was used with an initial learning rate of 0.001, which was then reduced to 0.9 every 10 iterations. The training set was input into the model, and the output values ​​were calculated via forward propagation. The mean squared error (MSE) function was used to calculate the mean squared difference between the model's output composite contour distortion coefficient and the actual contour distortion reference value, measuring the model's prediction error. Backpropagation was used to adjust the network parameters of the three feature extraction branches and the adaptive fusion layer. After each iteration, the model performance was evaluated using the validation set, and the loss value was recorded. Training was stopped when the validation set loss value was ≤0.001 for 10 consecutive iterations, the current model parameters were saved, and the trained geometric feature extraction model was obtained.

[0101] In step S20 of the method provided in this application embodiment, the first feature vector, the second feature vector, and the third feature vector are input with the temperature signal to the adaptive weighted fusion layer of the geometric feature extraction model for fusion calculation, and a comprehensive contour distortion coefficient is output, including:

[0102] Call the pre-stored machine tool standard temperature reference value, wherein the machine tool standard temperature reference value is the average temperature value of the spindle box, guide rail and tool post position when the machine tool is in thermal equilibrium stable operation state;

[0103] The temperature difference value is obtained by calculating the difference between the input temperature signal and the machine tool's standard temperature reference value.

[0104] Based on the temperature difference value, the dynamic weight coefficients corresponding to the first feature vector, the second feature vector, and the third feature vector are calculated respectively through a preset weight adjustment algorithm. The larger the temperature difference value, the higher the weight coefficients corresponding to the first feature vector and the second feature vector, and the lower the weight coefficient corresponding to the third feature vector.

[0105] The first feature vector, the second feature vector, and the third feature vector are each mapped to three scalar values ​​through a learnable linear projection layer.

[0106] The three scalar values ​​are weighted and summed using the dynamic weighting coefficients to obtain the comprehensive profile distortion coefficient.

[0107] In this embodiment, a pre-stored machine tool standard temperature reference value is first invoked. This reference value is the average temperature of the spindle box, guide rails, and tool post when the machine tool is in a thermally balanced and stable operating state. Specifically, the standard temperature reference value is the arithmetic mean of the temperatures of the three key components—spindle box, guide rails, and tool post—under thermally balanced and stable operating conditions, serving as a benchmark for determining if the current temperature deviates from normal operating conditions. Thermally balanced and stable operating conditions refer to a state where the heating and cooling of the machine tool's various mechanical components reach dynamic equilibrium, and the temperature no longer changes significantly with operating time. At this point, the influence of temperature on mechanical accuracy is at a stable level.

[0108] Before performing fusion calculations, the CNC system reads pre-stored machine tool standard temperature reference values ​​from the database via parameter call commands. These reference values ​​are determined through factory calibration and periodic calibration. During factory calibration, the machine tool runs continuously without load for 30 minutes, collecting temperature data from the spindle box, guideways, and tool post every minute. The maximum and minimum values ​​are removed, and the arithmetic mean of the remaining data is calculated as the initial standard temperature reference value. Subsequent calibrations are performed quarterly, updating the reference values ​​using the same method to ensure they match the actual operating conditions of the machine tool.

[0109] For example, during the factory calibration of a certain model of lathe, the temperature data after 30 minutes of thermal balance operation shows that the spindle box temperature range is 24.8~25.2℃, the guide rail temperature range is 24.7~25.1℃, and the tool post temperature range is 24.9~25.3℃. After removing the maximum and minimum values ​​for each part, the average temperature of the spindle box is 25.0℃, the average temperature of the guide rail is 24.9℃, and the average temperature of the tool post is 25.1℃. The standard reference temperature value for the machine tool is (25.0+24.9+25.1) / 3=25.0℃, which is pre-stored in the CNC system.

[0110] Secondly, the difference between the input temperature signal and the machine tool's standard temperature reference value is calculated to obtain the temperature difference value. The temperature difference value, expressed in °C, reflects the degree of deviation of the current temperature from the thermal equilibrium state. A positive difference indicates that the temperature is higher than the standard value, while a negative difference indicates that the temperature is lower than the standard value.

[0111] Calculate the average value of the temperature signal within the current sampling period: Take the average of the temperature data of the spindle box, guide rail, and tool holder at the sampling time to obtain the average temperature of each part, and then calculate the arithmetic mean of the three as the representative value of the current temperature signal; then calculate the temperature difference value, where the temperature difference value = the average temperature of the current temperature signal - the reference value of the machine tool standard temperature; retain the positive or negative sign of the difference value for subsequent weight adjustment algorithm to determine the direction of temperature deviation.

[0112] Exemplarily, within the current sampling period, the average temperature of the spindle box at 1200 sampling moments is 25.2 °C, the average temperature of the guide rail is 25.0 °C, and the average temperature of the tool rest is 25.3 °C. The average temperature of the current temperature signal = (25.2 + 25.0 + 25.3) / 3 = 25.17 °C. The reference value of the standard temperature of the machine tool is 25.0 °C, so the temperature difference value = 25.17 - 25.0 = +0.17 °C, indicating that the current temperature is slightly higher than the thermal equilibrium state.

[0113] Again, based on the temperature difference value, through a preset weight adjustment algorithm, the dynamic weight coefficients corresponding to the first eigenvector, the second eigenvector, and the third eigenvector are calculated respectively. Among them, the greater the temperature difference value, the higher the weight coefficients corresponding to the first eigenvector and the second eigenvector, and the lower the weight coefficient corresponding to the third eigenvector. The weight adjustment algorithm is an algorithm preset in the adaptive weighted fusion layer, which is used to dynamically allocate the weight coefficients of the three eigenvectors according to the temperature difference value. Among them, the stronger the temperature interference, the greater the difference value, and the more the weight of the eigenvector with higher stability is increased. The dynamic weight coefficient is the weight ratio calculated in real time according to the temperature difference value and assigned to the first eigenvector, the second eigenvector, and the third eigenvector, corresponding to the contribution degrees of the time-domain statistical features, the frequency-domain harmonic features, and the time-frequency domain morphological features respectively. Among them, the sum of the weights is 1.

[0114] Preset weight adjustment algorithm: An improved Sigmoid saturation activation function is used for preset weight adjustment. Among them, w1 = 0.3 + 0.1 × Sigmoid(k × |ΔT|), w2 = 0.4 + 0.1 × Sigmoid(k × |ΔT|), w3 = 0.3 - 0.2 × Sigmoid(k × |ΔT|). w1, w2, and w3 are the weight coefficients of the first eigenvector, the second eigenvector, and the third eigenvector respectively. ΔT is the absolute value of the temperature difference value, and k is the adjustment coefficient with a value of 5, which is used to control the slope of the Sigmoid function. The output range of the Sigmoid function is (0, 1), ensuring that the weight coefficients satisfy 0 < w1 < 0.4, 0 < w2 < 0.5, 0 < w3 < 0.3, and w1 + w2 + w3 = 1; substitute the absolute value of the temperature difference value to calculate the weight coefficients. First, calculate |ΔT|, and substitute it into the preset weight adjustment formula to obtain the three weight coefficients, ensuring that the greater the temperature difference value, the greater w1 and w2, and the smaller w3.

[0115] Simultaneously, the first, second, and third feature vectors are mapped to three scalar values ​​through a learnable linear projection layer. The learnable linear projection layer is a network module consisting of a single fully connected layer. Its weight parameters are optimized through model training. Its core function is to map high-dimensional feature vectors to single scalar values, achieving dimensionality normalization of the feature vectors for easier weighted summation. The scalar values ​​are the output of the linear projection layer, representing a comprehensive quantitative expression of the high-dimensional feature vectors and reflecting the intensity of information related to cam wear within the corresponding feature vectors.

[0116] Each feature vector corresponds to an independent linear projection layer. The input dimensions of the projection layer are the first feature vector, the second feature vector, and the third feature vector, respectively, and the output dimension is 1 for each feature vector. The calculation process of the projection layer is as follows: scalar value = feature vector × projection weight matrix + bias term. The projection weight matrix and bias term are the optimal parameters learned during model training to ensure that the scalar value can reflect the wear information in the feature vector to the greatest extent. The projected scalar value is normalized and mapped to the range of 0 to 1 to avoid the difference in the range of scalar values ​​caused by different feature vector dimensions.

[0117] For example, the first feature vector is 32-dimensional, with a corresponding linear projection layer weight matrix of 1×32 and a bias term of 0.01, yielding an original scalar value of 0.65, which is normalized to 0.65. The second feature vector is 64-dimensional, yielding an original scalar value of 0.72 after projection, which is normalized to 0.72. The third feature vector is 48-dimensional, yielding an original scalar value of 0.58 after projection, which is normalized to 0.58. All three scalar values ​​are in the range of 0 to 1, reflecting the intensity of wear information in each feature vector.

[0118] Finally, the three scalar values ​​are weighted and summed using dynamic weighting coefficients to obtain the comprehensive profile distortion coefficient. The comprehensive profile distortion coefficient is the result of the dynamic weighted summation of the three scalar values, with a value ranging from 0 to 1. It is the final quantitative indicator of the cam wear state. The closer the coefficient is to 0, the less severe the cam wear; the closer it is to 1, the more severe the cam wear. It is used as input for the subsequent control parameter compensation model.

[0119] The overall profile distortion coefficient = w1 × scalar value 1 + w2 × scalar value 2 + w3 × scalar value 3, where w1, w2, and w3 are the dynamic weighting coefficients calculated in step 3, and scalar values ​​1, 2, and 3 are the normalized projection results. After the calculation is completed, the results are subjected to amplitude limiting to ensure that they are in the range of 0 to 1, so as to avoid exceeding the range due to calculation errors.

[0120] For example, the dynamic weighting coefficients w1=0.37, w2=0.47, and w3=0.16, and their normalized scalar values ​​are 0.65, 0.72, and 0.58, respectively. The comprehensive profile distortion coefficient = 0.37×0.65+0.47×0.72+0.16×0.58=0.6717, which is 0.67 after amplitude limiting, indicating that the cam is in a moderately severe wear state, providing a clear quantitative basis for wear for subsequent compensation models.

[0121] In this embodiment, the error is calculated by synchronizing the spindle rotation angle and feed axis position data, and the position deviation related to cam wear is accurately extracted to quantify the accuracy. Time-scale alignment technology is used to ensure that the theoretical position and the actual position are synchronized in time, ensuring the accuracy of error calculation. An unloaded profile error time sequence covering the entire profile of the cam is formed, which can accurately identify the wear degree of different phases of the cam, provide a basis for targeted compensation, ensure the accuracy of the calculation of the comprehensive profile distortion coefficient, and thus improve the accuracy of subsequent compensation commands.

[0122] By extracting features through three parallel branches in the time domain, frequency domain, and time-frequency domain, different forms of cam wear can be accurately identified. By dynamically adjusting the feature weights through temperature signals, the weights of easily disturbed time-frequency domain features are reduced when there are large temperature differences, thereby improving the anti-interference capability of wear assessment. Furthermore, the adaptive weighted fusion layer can dynamically adjust the feature weights according to the working conditions to achieve accurate quantification of wear status, accurately reflect the gradual process of cam wear, and provide a reliable basis for the compensation model.

[0123] S30: Input the comprehensive contour distortion coefficient and the current machining process parameters into the pre-trained control parameter compensation model to generate the contour height correction amount for correcting the electronic cam.

[0124] Process parameters are key parameters for the current machining task, including workpiece material, spindle speed, feed rate, and depth of cut, which directly affect the adaptability of cam force and wear compensation. The control parameter compensation model is a pre-trained model built on a deep neural network, which can output targeted compensation parameters according to the degree of wear and process conditions. The profile height correction amount is the core parameter used to correct the electronic cam gauge, that is, according to the degree of cam wear, the target position of the feed axis at the corresponding rotation angle in the electronic cam gauge is adjusted to offset the displacement deviation caused by wear.

[0125] Obtain the process parameters for the current machining task, then combine the comprehensive contour distortion coefficient with the process parameters into an input vector, input it into the pre-trained control parameter compensation model, and the model outputs the contour height correction amount corresponding to each cam rotation angle by learning the mapping relationship.

[0126] Step S30 in the method provided in this application embodiment includes:

[0127] A control parameter compensation model is constructed based on a deep neural network.

[0128] In the historical database, the actual contour distortion coefficients and historical process parameters of the lathe during machining under different wear conditions are collected to form the training dataset for the compensation model.

[0129] For each data sample in the training dataset of the compensation model, obtain the corresponding, verified, and effective contour height correction amount to form the compensation target dataset.

[0130] Using the actual contour distortion coefficients and historical process parameters in the training dataset of the compensation model as input samples, and the corresponding effective contour height correction amount in the compensation target dataset as the training target, the control parameter compensation model is supervised and trained until it is verified to converge, thus obtaining the pre-trained control parameter compensation model.

[0131] In this embodiment, a control parameter compensation model is first constructed based on a deep neural network. The deep neural network (DNN) is a neural network architecture containing multiple hidden layers, possessing powerful nonlinear mapping capabilities. It can learn the complex relationships between wear states, process parameters, and compensation amounts, making it more suitable for time-varying and nonlinear cam wear compensation scenarios compared to shallow networks. The control parameter compensation model, with the deep neural network at its core, is a predictive model specifically designed to receive the comprehensive profile distortion coefficient and machining process parameters, and output a precise profile height correction amount. It is the core decision-making module for achieving wear compensation.

[0132] A deep neural network is constructed as the control parameter compensation model. The specific architecture includes an input layer, hidden layers, an output layer, and regularization design. The input layer contains the comprehensive profile distortion coefficients and core process parameters, namely spindle speed, feed rate, depth of cut, workpiece material hardness, and tool type encoding. The activation function of the hidden layer uses Gaussian error linear units (GELU) to solve the gradient vanishing problem of the ReLU activation function in the negative interval, improving the model's sensitivity to minute wear changes. The output layer corresponds to the profile height correction sequence for one revolution of the cam, and the output value uses a Sigmoid activation function to limit the output range. The regularization design involves inserting dropout layers and LayerNorm layers between the hidden layers to suppress overfitting and improve generalization ability; the dropout rate is 0.25.

[0133] The Gaussian Error Linear Unit (GELU) is a high-performance activation function widely used in deep learning models, especially in Transformer-based architectures. Compared to traditional activation functions like ReLU and LeakyReLU, GELU offers a smoother curve and higher model performance. GELU determines the activation probability of a neuron using the cumulative distribution function (CDF) of a standard normal distribution. The larger the input value, the higher the activation probability; the smaller the input value, the lower the activation probability. The cumulative distribution function is the integral of the probability density function, fully describing the probability distribution of the real random variable X.

[0134] For example, the input to the control parameter compensation model is a comprehensive profile distortion coefficient of 0.67 and process parameters: [spindle speed 1000 r / min, feed rate 0.1 mm / r, depth of cut 0.2 mm, workpiece material hardness HRC30, carbide tool code [1,0,0]]. After calculation by 4 hidden layers, the output is a sequence of profile height correction values ​​at 1200 sampling times, with a correction value range of 0.0003~0.0008 mm, which is consistent with the cam wear distribution trend.

[0135] Secondly, in the historical database, the actual contour distortion coefficients and historical process parameters of the lathe under different wear conditions are collected to form the training dataset for the compensation model.

[0136] The data collection scope involved extracting machining records from the lathe's historical machining database over the past year. Valid record filtering involved removing records with missing process parameters or machining anomalies, retaining only valid data. Data normalization mapped continuous parameters such as spindle speed, feed rate, and depth of cut to the [0,1] interval, while workpiece material hardness was linearly normalized to HRC20=0 and HRC45=1. Data partitioning involved splitting the data into training and validation sets in an 8:2 ratio to ensure consistent distribution of process parameters between the two sets. The final training dataset had 5760 dimensions, and the validation dataset had 1440 dimensions.

[0137] For example, a valid record in the historical database has the following characteristics: a comprehensive profile distortion coefficient of 0.65, indicating moderate wear; process parameters: spindle speed 1000 r / min, feed rate 0.1 mm / r, depth of cut 0.2 mm, workpiece material hardness HRC30, and carbide cutting tool. After normalization, the spindle speed 1000 r / min is mapped to 0.5, the workpiece material hardness HRC30 is mapped to 0.4, and the tool code is [1,0,0]. The final input vector for this sample is [0.65,0.5,0.25,0.25,0.4,1,0,0].

[0138] Next, for each data sample in the compensation model training dataset, the corresponding verified effective contour height correction amount is obtained to form the compensation target dataset. The effective contour height correction amount is a sequence of correction amounts verified through actual processing, capable of accurately compensating for cam contour errors under corresponding wear conditions and process parameters, keeping workpiece dimensional errors within allowable ranges; it serves as the supervised target for model training. The compensation target dataset is a collection composed of the effective contour height correction amount sequences corresponding to each training sample, with each sample's target output correction amount sequence corresponding one-to-one with the training dataset.

[0139] For each sample in the training dataset, actual machining calibration experiments were conducted. Cams corresponding to the wear state were matched and installed according to the distortion coefficient, and the process parameters in the sample were set for workpiece machining. A coordinate measuring machine (CMM) was used to measure the critical dimensional errors of the machined workpiece, and the dimensional deviation corresponding to each cam rotation position was recorded. The required contour height correction was calculated in reverse based on the dimensional deviation, forming a correction sequence at the sampling time, where the correction equals the absolute value of the dimensional deviation, and the direction is opposite to the deviation. Machining was repeated, and the average value of the correction sequence was taken as the effective contour height correction for that sample to ensure data reliability. Target dataset construction: The effective correction sequences corresponding to the samples were integrated to form a training target set and a validation target set.

[0140] For example, for the sample in the previous example, with a distortion coefficient of 0.65 and process parameters [1000 r / min, 0.1 mm / r, 0.2 mm, HRC30, carbide tool], after three machining calibrations: the correction sequence range for the first machining is 0.0002~0.0007 mm; the second is 0.0003~0.0008 mm; and the third is 0.0002~0.0007 mm. After averaging, the effective contour height correction sequence range is 0.00023~0.00077 mm. At the 500th sampling time, the correction for the cam rotation angle of 41.67° is 0.0005 mm, which precisely matches the wear level at that position.

[0141] Finally, the actual contour distortion coefficients and historical process parameters in the compensation model training dataset are used as input samples, and the corresponding effective contour height correction amount in the compensation target dataset is used as the training target. The control parameter compensation model is trained under supervision until the verification convergence is achieved, and the pre-trained control parameter compensation model is obtained.

[0142] The AdamW optimizer was used with an initial learning rate of 0.0005 and a weight decay factor of 1e. -5, to suppress overfitting, the hyperparameter is set to 16, and the total number of training iterations is 200 times. First, the training set is input into the model, the predicted correction amount sequence is calculated through forward propagation, the error between the predicted value and the true value is calculated using the RMSE loss function, and the weight parameters of each layer of the model are adjusted through the backpropagation algorithm to minimize the loss value; after each epoch, the model performance is evaluated using the validation set, and the RMSE is recorded; if the RMSE of the validation set does not decrease for 15 consecutive epochs, the training is automatically stopped, and the current model parameters are saved to avoid overtraining. After convergence, the average RMSE of the validation set is calculated. If it is ≤ 0.0001 mm, the model is determined to be qualified. After solidifying the parameters, they are pre-stored in the numerical control system as the control parameter compensation model completed by pre-training.

[0143] Exemplarily, the initial RMSE of the validation set is 0.0005 mm; after 50 epochs, the RMSE drops to 0.0002 mm; at the 120th epoch, the RMSE drops to 0.00009 mm; in the subsequent 15 epochs, the RMSE stabilizes between 0.00008 and 0.00009 mm, without obvious decrease, and the model is determined to converge; the model parameters are saved. The RMSE of the predicted correction amount sequence and the true sequence of a certain sample in the validation set by this model is 0.000085 mm, and the predicted correction amount at the 500th sampling moment is 0.00049 mm, with a deviation of only 0.00001 mm from the true value of 0.0005 mm, meeting the accuracy requirements.

[0144] In the embodiment of the present application, by combining a deep neural network with a GELU activation function, the strong non-linear relationship between the wear state, process parameters and compensation amount can be accurately captured. Compared with the traditional linear model, the compensation accuracy is improved, the generalization ability of the model is significantly enhanced, the effective correction amount sequence is synchronized with the cam rotation period, and each sampling moment corresponds to an independent correction amount, realizing point-by-point accurate compensation. At the same time, it adapts to the real-time control period of the lathe numerical control system to meet the real-time control requirements.

[0145] S40: Input the profile height correction amount into the lathe digital twin performance boundary model for feasibility verification and safety limiting, and generate a safety compensation instruction;

[0146] The lathe digital twin performance boundary model is a virtual simulation model built based on the physical characteristics of the machine tool. It can simulate the machine tool's operating state and verify the feasibility of control commands. The performance boundary is the physical operating limit of the machine tool, including the maximum output torque of the feed axis servo motor, the maximum allowable speed, the maximum allowable acceleration of the mechanical transmission components, and the machine tool's natural frequency. Feasibility verification is conducted through digital twin simulation to verify whether the motion command corresponding to the correction amount exceeds the machine tool's performance boundary. The safety limit is to adjust the correction amount that exceeds the performance boundary to ensure that the command is within the safe operating range of the machine tool. The safety compensation command is an electronic cam gauge correction command that can be directly executed after simulation verification and limit processing.

[0147] The contour height correction amount is sorted according to the sampling time of the spindle encoder phase signal to form a correction amount sequence synchronized with the cam rotation cycle; input the lathe digital twin performance boundary model, call the pre-stored machine tool physical limit parameters for dynamic simulation; after simulation, it is determined whether the motion corresponding to the correction amount meets all limit parameters: if it does, the correction amount sequence is directly used as the safety compensation command; if it does not, amplitude limiting and smoothing processing are performed, and finally the safety compensation command is output.

[0148] Step S40 in the method provided in this application embodiment includes:

[0149] The profile height correction amount is arranged in the order of the sampling time corresponding to the phase signal of the main shaft encoder to form a profile height correction amount sequence synchronized with the cam rotation cycle;

[0150] The contour height correction sequence is input into a pre-configured lathe digital twin performance boundary model;

[0151] The lathe digital twin performance boundary model performs dynamic simulation verification on the contour height correction sequence based on the pre-stored machine tool physical limit parameters. The machine tool physical limit parameters include the maximum output torque of the feed axis servo motor, the maximum allowable speed, the maximum allowable acceleration of the mechanical transmission components, and the natural frequency of the machine tool mechanical structure.

[0152] The lathe digital twin performance boundary model determines whether the dynamic simulation verification result meets all machine tool physical limit parameters. If the dynamic simulation verification result meets all machine tool physical limit parameters, the contour height correction amount is directly output as a safety compensation command.

[0153] If the dynamic simulation verification result does not meet any of the machine tool physical limit parameters, then the amplitude limiting and smoothing processing is performed on the contour height correction amount, and the processed correction amount sequence is output as a safety compensation command.

[0154] In this embodiment, the contour height correction sequence is first input into a pre-configured lathe digital twin performance boundary model. The contour height correction sequence is a one-dimensional data sequence formed by arranging the contour height correction values ​​output from the control parameter compensation model according to the sampling time sequence of the corresponding spindle encoder phase signal. Its length is consistent with the number of sampling points per revolution of the cam, ensuring a one-to-one correspondence between the correction value and the cam's rotation angle position. Synchronization ensures that each data point in the correction sequence is strictly aligned with the sampling time of the spindle encoder phase signal; that is, the nth correction value corresponds to the cam's rotation angle position at the nth sampling time, achieving real-time synchronization between the compensation action and the cam movement.

[0155] The correspondence between the correction amount and the phase signal is extracted. Each correction amount output by the control parameter compensation model carries a corresponding sampling timestamp, which is completely consistent with the sampling timestamp of the spindle encoder phase signal. Then, the correction amounts are sorted according to the sampling timestamp, forming a continuous correction amount sequence from 0° cam rotation angle to 360° cam rotation angle. After sorting, the length of the correction amount sequence is checked to see if it is equal to the number of correction amounts. If there is missing or duplicate data, linear interpolation is automatically used to fill in the missing values ​​or retain the first occurrence of the correction amount to ensure the integrity of the sequence.

[0156] For example, the control parameter compensation model outputs 1200 correction values. Each correction value carries a timestamp consistent with the sampling time of the spindle encoder. The first timestamp corresponds to a 0° cam rotation angle, the 600th timestamp corresponds to a 180° rotation angle, and the 1200th timestamp corresponds to a 360° rotation angle. After sorting by timestamp, the correction value sequence is [0.0003, 0.00032, ..., 0.0008, ..., 0.0003], which is completely synchronized with the angular position of one revolution of the cam. The 500th correction value corresponds to a 41.67° cam rotation angle, and the correction value is 0.0005mm.

[0157] Secondly, the lathe digital twin performance boundary model dynamically simulates and verifies the contour height correction sequence based on pre-stored machine tool physical limit parameters. These machine tool physical limit parameters include the maximum output torque and maximum permissible speed of the feed axis servo motors, the maximum permissible acceleration of the mechanical transmission components, and the natural frequencies of the machine tool's mechanical structure. The lathe digital twin performance boundary model is a virtual model constructed using 3D modeling and multibody dynamics simulation technology, recreating the lathe's mechanical structure and physical characteristics, and simulating the lathe's motion state and performance limits during actual machining. Pre-configuration means the model has all the target lathe's physical parameters, geometric dimensions, and performance limit data pre-stored; no real-time configuration is required, only the correction sequence needs to be input to start the simulation.

[0158] The CNC system calls the digital twin model pre-stored in the industrial server through the interface protocol to start the simulation service; the sorted contour height correction sequence is used as input parameters and synchronously transmitted to the compensation command interface of the model, while the current machining process parameters are input as simulation environment parameters; then the model performs simulation initialization according to the input process parameters, initializes the running state of the virtual lathe, and ensures that the simulation environment is consistent with the actual machining environment.

[0159] For example, the aforementioned correction sequence consists of 1200 data points, ranging from 0.0003 to 0.0008 mm, with process parameters including a spindle speed of 1000 r / min and a feed rate of 0.1 mm / r. The aforementioned correction sequence and process parameters are synchronously input into the digital twin model. After model initialization, the virtual lathe's cam mechanism rotates at 1000 r / min, and the feed axis adjusts its position in real time according to the correction sequence, simulating the compensated machining process.

[0160] Next, a digital twin performance boundary model of the lathe is constructed to determine whether the dynamic simulation verification results meet all machine tool physical limit parameters. If the dynamic simulation verification results meet all machine tool physical limit parameters, the contour height correction amount is directly output as a safety compensation command. The machine tool physical limit parameters are the safe operating boundary parameters determined during the design and manufacturing process of the lathe. They are key indicators to ensure equipment safety and machining accuracy, including: the maximum output torque of the feed axis servo motor, the maximum allowable speed of the feed axis, the maximum allowable acceleration of the mechanical transmission components, the natural frequency of the machine tool mechanical structure, and dynamic simulation verification.

[0161] Among them, the maximum output torque of the feed axis servo motor is the maximum driving torque that the motor can provide; exceeding this will cause the motor to overload and burn out. The maximum allowable speed of the feed axis is the highest speed at which the feed axis can operate; exceeding this will lead to increased vibration or mechanical wear. The maximum allowable acceleration of mechanical transmission components is the maximum acceleration that transmission components such as gears and lead screws can withstand; exceeding this will lead to fatigue damage of the components. The natural frequency of the machine tool's mechanical structure is the resonant frequency of the machine tool structure; if the compensation action triggers resonance, it will cause a serious decrease in machining accuracy. Dynamic simulation verification is the compensation action corresponding to the sequence of corrections simulated by the digital twin model, which monitors in real time whether the motion parameters of the virtual lathe exceed the physical limit parameters, and at the same time determines whether resonance is triggered.

[0162] The model drives the virtual feed axis according to the correction sequence, collecting servo motor torque, feed axis speed, and transmission component acceleration data every 1ms, while simultaneously calculating the vibration frequency of the computer tool structure. Then, a limit parameter comparison is performed: the real-time collected parameters are compared with pre-stored physical limit parameters to determine if any of the following exceedances exist: servo motor torque > 4 N·m; feed axis speed > 3000 r / min; transmission component acceleration > 5 m / s²; vibration frequency close to 50 Hz (±2 Hz). Verification results are recorded: after the simulation, a verification report is generated, recording whether any exceedances exist, the type of exceedance parameter, the time of exceedance, and the corresponding correction value.

[0163] If the dynamic simulation verification report shows that all real-time monitored parameters do not exceed the physical limit parameters and no resonance is triggered, the verification result is deemed qualified. The original contour height correction sequence is then directly encapsulated into a safety compensation command, the command format conforming to the communication protocol of the lathe CNC system. Subsequently, the command is output, and through the CNC system's output interface, the safety compensation command is sent to the feed axis servo driver, ready to execute the compensation action.

[0164] For example, if the correction sequence passes verification, it is directly encapsulated into a security compensation instruction in G-code extended format: G92 P1 X0.0003 P2 X0.00032 ... P1200 X0.0003. The instruction is sent to the feed axis servo driver via CNC, waiting to be executed synchronously with the cam movement.

[0165] Finally, if the dynamic simulation verification results do not meet any of the machine tool's physical limit parameters, amplitude limiting and smoothing processing are performed on the contour height correction amount, and the processed correction amount sequence is output as a safety compensation command. Amplitude limiting truncates correction amounts exceeding the allowable range, adjusting the excessive correction amount to the maximum allowable amplitude to ensure that the compensation action does not exceed the equipment's physical limits. Smoothing uses moving average filtering or spline interpolation to smooth the amplitude-limited correction amount sequence, eliminating impacts on transmission components caused by abrupt changes in correction amounts and ensuring smooth motion.

[0166] Based on the verification report, the location and value of the excess correction amount are identified; the excess correction amount is adjusted to the maximum allowable amplitude, while ensuring that the adjusted correction amount is not less than 0; subsequently, a 5-point moving average filtering method is used to smooth the amplitude-limited correction amount sequence; the processed correction amount sequence is re-input into the digital twin model for secondary simulation verification. If excesses still exist, the amplitude-limiting and smoothing process is repeated until the verification is successful. Finally, an output instruction is generated, which encapsulates the correction amount sequence that has passed the secondary verification into a safety compensation instruction and sends it to the actuator. During the smoothing process, the calculation formula is: y(n)=[x(n-2)+x(n-1)+x(n)+x(n+1)+x(n+2)] / 5 (where n is the correction amount sequence index, and edge data is completed using a mirror expansion method).

[0167] For example, the 800th correction in a certain correction sequence is 0.0012mm, and the acceleration of the transmission component reaches 5.8m / s², which exceeds the limit of 5m / s². The correction is adjusted to the maximum allowable amplitude of 0.001mm. Using a 5-point moving average filter, the filtering result of the 800th correction is [y(800)=(x(798)+x(799)+0.001+x(801)+x(802)) / 5]. The maximum acceleration of the processed correction sequence is 4.9m / s², which is <5m / s². There are no other exceedances, and it is encapsulated as a safety compensation command output.

[0168] In step S40 of the method provided in this application embodiment, amplitude limiting and smoothing processing is performed on the contour height correction amount, and the processed correction amount sequence is output as a safety compensation instruction, including:

[0169] Based on the torque limit of the servo motor of the lathe feed axis, the reduction ratio and transmission efficiency parameters of the mechanical transmission system, the contour height correction is converted into an additional motion requirement for the tool post and the theoretical maximum allowable value of the contour height correction is calculated under the premise of not exceeding the torque limit of the servo motor.

[0170] The theoretical maximum amplitude value is compared with the preset maximum correction amount allowed by the machining accuracy, and the smaller value between the two is taken as the upper limit threshold of the amplitude, while the lower limit threshold of the amplitude is set to zero.

[0171] Traverse the contour height correction value sequence, set the correction value greater than the amplitude upper limit threshold to the amplitude upper limit threshold, and set the correction value less than zero to zero to obtain the processed correction value sequence, and output the processed correction value sequence as a safety compensation instruction.

[0172] like Figure 2As shown in the embodiment of this application, firstly, based on the torque limit of the servo motor of the lathe feed axis, the reduction ratio and transmission efficiency parameters of the mechanical transmission system, the contour height correction amount is converted into additional motion requirements for the tool post and the theoretical maximum allowable value of the contour height correction amount is calculated under the premise of not exceeding the torque limit of the servo motor.

[0173] Among them, the servo motor torque limit is the maximum rated output torque of the feed axis servo motor, which is the core boundary parameter for safe operation of the motor. Exceeding this value will lead to motor overload, overheating and burnout, or triggering protection shutdown. The reduction ratio of the mechanical transmission system is the speed ratio of the transmission mechanism between the servo motor output shaft and the feed axis, reflecting the conversion relationship between torque and speed. The mechanical transmission efficiency is the effective degree of power transmission of the transmission system. It is affected by gear meshing clearance, lead screw friction, etc., and characterizes the proportion of torque loss during transmission. The theoretical maximum amplitude is the maximum contour height correction that the feed axis can achieve without exceeding the servo motor torque limit. It is the core constraint value to ensure motor safety.

[0174] Key parameters are retrieved from the pre-stored equipment parameter library of the CNC system: servo motor torque limit, mechanical transmission system reduction ratio, mechanical transmission efficiency, and feed axis transmission stiffness.

[0175] Under the premise of not exceeding the torque limit of the servo motor, based on the maximum allowable displacement corresponding to the thrust and combined with the dynamic characteristics of the correction amount, the theoretical maximum amplitude is finally calculated. The formula for calculating the theoretical maximum amplitude is A = (T... max ×i×η×P) / (2π×m×a max ), where the torque limit of the servo motor is T max The mechanical transmission system has a reduction ratio of i and a mechanical transmission efficiency of η. The driving torque is converted into a thrust of the feed shaft, F = (2πT) / P. The ball screw lead is P, and the equivalent mass of the tool holder is m. The servo motor torque T must satisfy this condition relationship with the thrust of the feed shaft converted from the driving torque and the ball screw lead. After substituting the parameters for calculation, if the result exceeds the actual requirement range for cam wear compensation, the actual requirement range is taken as a temporary upper limit to ensure that the calculation result conforms to the machining scenario.

[0176] For example, T max =4N·m, i=10, η=0.9, P=100mm, m=5kg, a max=5m / s². Substituting into the formula: T=4×10×0.9=36N·m; F=(2×π×36) / 0.1≈2262N; Theoretical maximum amplitude A=(4×10×0.9×0.01) / (2×π×5×5)≈0.0229mm. After acceleration compensation, the theoretical maximum amplitude A=1.5mm, which far exceeds the actual compensation requirement. Since the actual maximum requirement for cam wear compensation is 0.005mm, the final theoretical maximum amplitude is determined to be 0.005mm.

[0177] Secondly, the theoretical maximum amplitude is compared with the preset maximum allowable correction amount for machining accuracy, and the smaller of the two is taken as the upper limit threshold of amplitude, while the lower limit threshold of amplitude is set to zero. The maximum allowable correction amount for machining accuracy is the preset maximum compensation amount for the dimensional error of the machined workpiece within the tolerance range, and is the core constraint value to ensure machining quality; the upper limit threshold of amplitude is the smaller of the theoretical maximum amplitude and the maximum allowable correction amount for machining accuracy, and is the final safe upper limit of the correction amount; the lower limit threshold of amplitude is the minimum allowable value of the correction amount. Since cam wear only causes the contour dimension to be smaller, negative correction has no practical significance and will lead to machining dimensions exceeding tolerance.

[0178] Read the maximum allowable correction amount (A) for the machining accuracy corresponding to the current machining task from the process parameter database. 修正量 Then, the theoretical maximum amplitude is compared with the maximum correction amount, and the smaller value is taken as the upper limit threshold A of the amplitude. 上限 Subsequently, the lower limit threshold A of the amplitude was set. 下限 The correction amount is explicitly allowed only in [0, A]. 下限 The value is taken within the interval.

[0179] For example, the final theoretical maximum amplitude A is 0.005mm, and the workpiece dimensional tolerance of the current machining task is ±0.001mm, therefore A 修正量 =0.001mm. Comparing 0.005mm and 0.001mm, the smaller value is taken as the upper limit threshold of amplitude (0.001mm), and the lower limit threshold is 0mm. The valid range for the correction is [0, 0.001mm].

[0180] Finally, the contour height correction sequence is traversed, and corrections greater than the upper amplitude threshold are set to the upper amplitude threshold, while corrections less than zero are set to zero, resulting in a processed correction sequence. This processed correction sequence is then output as a safety compensation command. The traversal process involves judging and adjusting each data point in the contour height correction sequence to ensure that each data point is within a valid range. The processed correction sequence is a sequence where all data points satisfy 0 ≤ correction ≤ lower amplitude threshold, and it is the core data for the final executable safety compensation command.

[0181] The algorithm iterates through each data point in the correction sequence. If the correction amount is greater than the upper amplitude threshold, it adjusts the correction amount to the upper amplitude threshold; if the correction amount is less than the lower amplitude threshold, it adjusts the correction amount to the lower amplitude threshold; if the correction amount is within the range of [0, upper amplitude threshold], it remains unchanged. The adjusted sequence is smoothed using a 3-point moving average method. The average of every three points in the correction sequence (excluding edge values) is used as one adjustment correction amount, with the two edge values ​​serving as the final correction amount. This eliminates potential abrupt changes after adjustment, ensuring smooth feed axis movement. Finally, the processed correction sequence is encapsulated into a safety compensation command conforming to the CNC system protocol and sent to the feed axis servo drive via the output interface for synchronous compensation.

[0182] For example, in a certain correction sequence, there are 3 out-of-specification data points: the 800th data point A 800 =0.0012mm>0.001mm, the 900th data point A 900 =-0.0001mm<0mm, the 1000th data point A 1000 =0.0015mm>0.001mm. (Place A) 800 Adjusted to 0.001mmA 900 Adjust to 0mm, A 1000 Adjust to 0.001mm; with A 800 For example, A' 800 =(A 799 +0.001+A 801 ) / 3, eliminate mutations; after final processing, all data points of the sequence are in the range [0, 0.001 mm], encapsulated as a safety compensation instruction, and sent to the servo driver for execution.

[0183] In this embodiment, compensation commands are verified in advance to identify compensation actions exceeding physical limits, ensuring equipment operational safety and precise synchronization of compensation actions. Smoothing processes eliminate abrupt changes in correction amounts, reducing mechanical shock and wear. Virtual simulation verification replaces physical trial cutting, significantly reducing trial-and-error costs. A secondary verification mechanism ensures the safety and effectiveness of processed commands, improving system automation. Simultaneously, based on motor torque limits and accuracy requirements, both equipment safety and processing quality are met, avoiding failure due to a single constraint on safety compensation.

[0184] S50: Execute the safety compensation instruction and optimize the geometric feature extraction model and the control parameter compensation model based on the processing results.

[0185] Executing safety compensation instructions involves writing them into the CNC system and updating the electronic cam table online, thereby correcting the theoretical motion trajectory of the cam. The machining result evaluation signal is the workpiece's key dimensional error or surface roughness data obtained through measuring instruments, used to evaluate the compensation effect.

[0186] The safety compensation command is written into the lathe CNC system to update the target position of the feed axis corresponding to each rotation angle in the electronic cam table; then the lathe executes the machining task; after machining is completed, the key dimensions of the workpiece are measured using a coordinate measuring machine, and the surface roughness is measured to form a machining result evaluation signal; finally, the no-load contour error, temperature signal, comprehensive contour distortion coefficient, safety compensation command and machining result evaluation signal are associated and stored as training samples, stored in the learning sample database, and the network parameters of the geometric feature extraction model and control parameter compensation model are fine-tuned periodically using new samples.

[0187] Step S50 in the method provided in this application embodiment includes:

[0188] The safety compensation command is written into the lathe CNC system, the electronic cam gauge is updated online, and the lathe is controlled based on the updated electronic cam gauge wheel to perform subsequent machining tasks;

[0189] After the subsequent processing tasks are completed, the measured key dimension error or surface roughness data of the processed workpiece are obtained by measuring instruments as evaluation signals for the processing results.

[0190] The unloaded contour error data is associated with the temperature signal, the comprehensive contour distortion coefficient, the safety compensation command, and the processing result evaluation signal and stored as a training sample, and the training sample is stored in a dedicated learning sample database.

[0191] The network parameters of the control parameter compensation model and the geometric feature extraction model are periodically fine-tuned and updated using the learning sample database.

[0192] In this embodiment, the safety compensation command is first written into the lathe CNC system, the electronic cam table is updated online, and the lathe is controlled based on the updated electronic cam to execute subsequent machining tasks. The electronic cam table is a digital table in the CNC system that stores the mapping relationship between the spindle and driven axis positions. It replaces the function of a traditional physical cam by defining motion laws through software, and the motion curve can be flexibly adjusted by modifying the table data. The measured critical dimension error is the difference between the core dimension detected by a precision measuring instrument and the theoretical design dimension after the workpiece is machined; it is a core indicator for evaluating machining accuracy. Surface roughness data is the microscopic unevenness parameter of the workpiece surface measured by a roughness meter, reflecting the surface quality of the workpiece and serving as an important basis for evaluating machining effects. The learning sample database is a database specifically storing the associated data of "input data-compensation command-machining result," providing data support for model iterative optimization. The data must include temporal integrity and working condition correlation. Network parameter fine-tuning and updating involves making small adjustments to the model's weight coefficients, bias terms, and other parameters based on the pre-trained model using newly added training samples, without reconstructing the model structure, thus achieving adaptive optimization of the model to actual working conditions.

[0193] Through the communication interface of the CNC system, the safety compensation instructions verified by the digital twin model are written into the system memory; the spindle phase-feed axis position mapping entries corresponding to the current machining task in the electronic cam table are automatically located, and the target position of each phase point is superimposed and corrected according to the correction amount sequence; after the update is completed, the CNC system generates feed axis control instructions in real time based on the corrected electronic cam table and the spindle encoder signal, and drives the servo driver to drive the tool holder, feeding mechanism and other actuators to complete the machining action, and completes the fine-tuning and updating of network parameters.

[0194] For example, in the machining of a cam-type workpiece on an automatic lathe, the workpiece diameter is 10mm. After long-term operation, the cam pair experiences a wear of 0.02mm, resulting in the actual diameter of the workpiece being 0.02mm smaller than expected. Through this step, the safety compensation instruction with a contour height correction sequence of +0.02mm is written into the CNC system, and the target position of the feed axis in the electronic cam table is increased by 0.02mm. After the update, during machining, the deviation between the actual position of the feed axis and the theoretical position is reduced to ±0.001mm under the effect of wear compensation, and the workpiece diameter is restored to the design requirement of 10mm ±0.002mm.

[0195] Secondly, after the subsequent processing tasks are completed, the measured key dimension error or surface roughness data of the processed workpiece is obtained by measuring instruments as an evaluation signal for the processing results.

[0196] After the machining task is completed, representative workpieces are selected and inspected using high-precision measuring instruments: for dimensional accuracy, the key dimensions of the workpiece are measured, and the difference between the measured value and the theoretical value is calculated to obtain the key dimension error; for surface quality, multiple data points are collected at different positions on the machined surface of the workpiece using a roughness meter, and the average value is taken as the surface roughness data; after these test data are standardized, they are used as the evaluation signal of the machining result to provide feedback on the execution effect of the compensation command.

[0197] For example, after the shaft workpiece is machined, five workpieces are randomly selected, and their diameters are measured using a coordinate measuring machine. The measured values ​​are 10.001 mm, 10.002 mm, 9.999 mm, 10.000 mm, and 10.001 mm, respectively. The critical dimension error is calculated to be ±0.002 mm. The outer surface of the workpiece is measured using a roughness tester, and the average roughness is 0.8 μm, which is used as the evaluation signal for the machining result.

[0198] Next, the no-load contour error data, temperature signal, comprehensive contour distortion coefficient, safety compensation command, and processing result evaluation signal are associated and stored as a training sample, and the training sample is stored in a dedicated learning sample database. Multi-source data collected during the processing cycle are associated and integrated to form a complete training sample: no-load contour error data and temperature signal are used as model input data, comprehensive contour distortion coefficient is used as intermediate feature data, safety compensation command is used as model output data, and processing result evaluation signal is used as effect feedback data; working condition labels and timestamps are added to the samples to ensure data traceability; the integrated training sample is stored in a dedicated learning sample database according to a preset data format. The database adopts a distributed storage architecture, supporting efficient retrieval and retrieval of massive samples.

[0199] For example, the training sample includes: no-load profile error data: the error at a certain sampling time is 0.018mm, temperature signal: spindle box temperature 38℃, guide rail temperature 35℃, comprehensive profile distortion coefficient 0.021, safety compensation instruction: a correction amount sequence of +0.02mm, machining result evaluation signal: dimensional error ±0.002mm, average roughness = 0.8μm), and is labeled with working condition tags: machining material 45 steel, spindle speed 2000r / min, feed rate 0.1mm / r. This sample is stored in the learning sample database and forms a data set with historical samples of the same working condition.

[0200] Finally, the network parameters of the control parameter compensation model and the geometric feature extraction model are periodically fine-tuned and updated using the learning sample database. A fixed model update cycle is set; recently added training samples are extracted from the learning sample database and divided into training and validation sets in a 7:3 ratio; the training set is input into the geometric feature extraction model and the control parameter compensation model, and the gradient descent algorithm is used to make small adjustments to the network parameters such as the weight coefficients and bias terms of the models. During the adjustment process, the mean squared error (MSE) is used to monitor the prediction error of the validation set in real time; when the validation set error converges to the preset threshold MSE≤0.0001, fine-tuning is stopped, the updated model parameters are saved, and the original model is put into use; if the error does not converge, the number of training samples is increased or the learning rate is adjusted and fine-tuning is repeated.

[0201] After processing 1000 workpieces, a model fine-tuning update is triggered. The most recent 100 training samples are extracted from the database and divided into 70 training sets and 30 validation sets. The training sets are input into the control parameters to compensate the model, and the weight coefficients of the fully connected layers are adjusted using the gradient descent algorithm. After fine-tuning, the mean square error of the validation set is reduced from 0.0003 to 0.00008, meeting the convergence threshold requirement. In subsequent processing, the updated model reduces the prediction error of cam wear to ±0.001mm, and the compensated workpiece size error is further controlled within ±0.0015mm, continuously improving processing accuracy.

[0202] In this embodiment, multi-source information can comprehensively reflect the mapping relationship between cam wear state, compensation strategy and processing effect, avoiding the one-sidedness of model optimization caused by a single data dimension; the structured storage of the database provides efficient data support for subsequent model fine-tuning; at the same time, fine-tuning and updating through network parameters realizes adaptive iterative optimization of the model, enabling the model to continuously learn the time-varying law of cam wear and the feedback information of compensation effect, avoiding the accuracy degradation of the model due to long-term use.

[0203] The embodiments of this application, through the above specific implementation methods, achieve the following technical effects:

[0204] In this embodiment, the phase signal of the spindle encoder, the position signal of the feed axis, and the temperature signal are first synchronously acquired under no-load conditions. Combined with time-scale alignment technology, thermal deformation and mechanical wear errors are accurately separated, enabling online sensing of cam wear and providing a high-quality data foundation for online identification of cam wear status. At the same time, multi-source synchronous data ensures the accuracy of contour error calculation, making the subsequently generated correction amount more consistent with the actual wear situation, effectively compensating for the accuracy degradation of the electronic cam caused by mechanical wear. In addition, it reduces maintenance costs and improves production efficiency, enhances production continuity and equipment utilization, and strengthens system operation safety.

[0205] Secondly, by calculating the error using the synchronized spindle angle and feed axis position data, the positional deviation related to cam wear is accurately extracted, and the accuracy is quantified. Time-scale alignment technology is used to ensure that the theoretical position and the actual position are synchronized in time, ensuring the accuracy of error calculation. An unloaded profile error time sequence covering the entire cam profile is formed, which can accurately identify the wear degree of different phases of the cam, providing a basis for targeted compensation, ensuring the accuracy of the calculation of the comprehensive profile distortion coefficient, and thus improving the accuracy of subsequent compensation commands.

[0206] By extracting features through three parallel branches in the time domain, frequency domain, and time-frequency domain, different forms of cam wear are accurately identified. The feature weights are dynamically adjusted by temperature signals. When there are large temperature differences, the weights of the easily disturbed time-frequency domain features are reduced to improve the anti-interference ability of wear assessment. The adaptive weighted fusion layer can dynamically adjust the feature weights according to the working conditions to achieve accurate quantification of wear status and accurately reflect the gradual process of cam wear, providing a reliable basis for the compensation model.

[0207] Furthermore, by using a deep neural network with the GELU activation function, the strong nonlinear correlation between wear state, process parameters and compensation amount can be accurately captured. Compared with the traditional linear model, the compensation accuracy is improved, the model generalization ability is significantly enhanced, the effective correction amount sequence is synchronized with the cam rotation cycle, and each sampling moment corresponds to an independent correction amount, realizing point-by-point accurate compensation. At the same time, it is adapted to the real-time control cycle of the lathe CNC system to meet the real-time control requirements.

[0208] Simultaneously, compensation commands are verified in advance to identify compensation actions exceeding physical limits, ensuring equipment operational safety and precise synchronization of compensation actions. Smoothing processes eliminate abrupt changes in correction amounts, reducing mechanical shock and wear. Virtual simulation verification replaces physical trial cutting, significantly reducing trial-and-error costs. A secondary verification mechanism ensures the safety and effectiveness of processed commands, improving system automation. Furthermore, based on motor torque limits and accuracy requirements, both equipment safety and processing quality are simultaneously met, avoiding failures due to a single constraint on safety compensation.

[0209] Ultimately, multi-source information can comprehensively reflect the mapping relationship between cam wear state, compensation strategy and processing effect, avoiding the one-sidedness of model optimization caused by a single data dimension; the structured storage of the database provides efficient data support for subsequent model fine-tuning; at the same time, fine-tuning and updating through network parameters realizes adaptive iterative optimization of the model, enabling the model to continuously learn the time-varying law of cam wear and the feedback information of compensation effect, avoiding the accuracy degradation of the model due to long-term use.

[0210] Compared to existing technologies, this application overcomes the limitations of traditional post-maintenance and manual parameter adjustment. Through synchronous acquisition and fusion analysis of multi-source time-series data under no-load conditions, combined with a geometric feature extraction model capable of extracting features in the time, frequency, and time-frequency domains, it achieves online and accurate perception of cam pair wear status, effectively avoiding the limitations of single-data monitoring and temperature interference. A control parameter compensation model is constructed, deeply coupling the comprehensive contour distortion coefficient with real-time process parameters to generate a contour height correction amount suitable for the working conditions, solving the problem of insufficient adaptability of traditional fixed compensation strategies. Furthermore, through the lathe's digital twin performance boundary... The model performs physical limit verification and safety limiting on the correction amount, ensuring the feasibility of the compensation command and the safety of equipment operation, and avoiding the risk of mechanical shock and component damage. A closed-loop control system is constructed, and the model is continuously fine-tuned and updated based on the machining results, enabling the system to adapt to the time-varying nonlinear characteristics of cam wear, which significantly improves the long-term stability of machining accuracy. This not only greatly extends the service life of the cam pair and reduces maintenance costs and downtime losses, but also eliminates the need for large-scale modification of the machine tool's mechanical structure. It has strong compatibility, low upgrade costs, and effectively solves the problem of accuracy degradation caused by mechanical cam pair wear in electronic cam systems.

[0211] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this specification. Additionally, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are possible or may be advantageous.

[0212] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

[0213] This specification and accompanying drawings are merely illustrative examples of this application and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from its scope. Therefore, if such modifications and variations fall within the scope of this application and its equivalents, this application intends to include such modifications and variations.

Claims

1. A closed-loop control method for a lathe CNC system integrating cam wear compensation, characterized in that, The method, applied to a CNC system for lathes that has or can be upgraded to have electronic cam control functionality, includes: When the lathe is running under no-load conditions, multi-source time-series data are collected synchronously, including the spindle encoder phase signal, the actual position feedback signal of the feed axis, and the temperature signal. The unloaded contour error is calculated based on the multi-source time-series data, and the unloaded contour error and the temperature signal are input into a pre-trained geometric feature extraction model to output the comprehensive contour distortion coefficient. The comprehensive contour distortion coefficient and the current machining process parameters are input into the pre-trained control parameter compensation model to generate the contour height correction amount for correcting the electronic cam. The contour height correction amount is input into the lathe digital twin performance boundary model for feasibility verification and safety limit, and a safety compensation command is generated. The safety compensation instruction is executed, and the geometric feature extraction model and the control parameter compensation model are optimized based on the processing results.

2. The closed-loop control method for a lathe CNC system with integrated cam wear compensation according to claim 1, characterized in that, While the lathe is running unloaded, multi-source time-series data is collected synchronously, including: The lathe spindle is controlled to drive the camshaft to rotate at a constant speed for at least one revolution. During the rotation, the spindle encoder phase signal is continuously acquired in real time through the spindle encoder, and the actual position feedback signal of the feed shaft is continuously acquired in real time through the position sensor installed on the feed shaft. Temperature signals are collected by temperature sensors arranged on the machine tool spindle box, guide rails and tool post; The spindle encoder phase signal, feed axis actual position feedback signal and temperature signal are time-aligned to form synchronized multi-source timing data.

3. The closed-loop control method for a lathe CNC system with integrated cam wear compensation according to claim 1, characterized in that, The unloaded profile error is calculated based on the multi-source time-series data, including: Based on the synchronized spindle encoder phase signal, determine the theoretical rotation angle position of the cam at the current sampling moment; Based on the theoretical rotation angle position, the corresponding theoretical feed axis target position is obtained by querying the electronic cam table pre-stored in the CNC system. Based on the actual position feedback signal of the feed axis, the actual position of the feed axis at the current sampling time is obtained; Calculate the difference between the target position and the actual position of the feed axis to obtain the no-load profile error at the current moment.

4. The closed-loop control method for a lathe CNC system with integrated cam wear compensation according to claim 1, characterized in that, The unloaded contour error and the temperature signal are input into a pre-trained geometric feature extraction model, and the comprehensive contour distortion coefficients are output, including: Invoke a pre-trained geometric feature extraction model, wherein the geometric feature extraction model includes an adaptive weighted fusion layer and three parallel feature extraction branches; The unloaded contour error and the temperature signal are input into the geometric feature extraction model; The geometric feature extraction model extracts time-domain statistical features, frequency-domain harmonic features, and time-frequency-domain morphological features through three parallel feature extraction branches, and outputs a first feature vector, a second feature vector, and a third feature vector. The first feature vector, the second feature vector, and the third feature vector are input to the adaptive weighted fusion layer along with the temperature signal for fusion calculation, and the comprehensive contour distortion coefficient is output.

5. The closed-loop control method for a lathe CNC system with integrated cam wear compensation according to claim 4, characterized in that, The process of constructing a geometric feature extraction model includes: Based on a fully connected neural network, a first feature extraction branch for temporal statistical feature extraction is constructed. A second feature extraction branch for frequency domain harmonic feature extraction is constructed based on convolutional neural networks and fully connected networks. Based on wavelet transform layer and fully connected network, a third feature extraction branch is constructed for time-frequency domain morphological feature extraction; An adaptive weighted fusion layer is constructed based on a fully connected neural network; Collect no-load profile error data and temperature data of historical lathes under different wear conditions to form a sample training dataset; Obtain the measured and calibrated actual contour distortion reference values ​​corresponding to the empty contour error data and temperature data in the sample training dataset to form a sample supervision label set; Using the data in the sample training dataset as input and the actual contour distortion reference value in the corresponding sample supervision label set as the training target, the geometric feature extraction model is trained under supervision until it is verified to converge, thus obtaining the trained geometric feature extraction model.

6. The closed-loop control method for a lathe CNC system with integrated cam wear compensation according to claim 5, characterized in that, The first feature vector, the second feature vector, and the third feature vector are input with the temperature signal to the adaptive weighted fusion layer of the geometric feature extraction model for fusion calculation, and the comprehensive contour distortion coefficient is output, including: Call the pre-stored machine tool standard temperature reference value, wherein the machine tool standard temperature reference value is the average temperature value of the spindle box, guide rail and tool post position when the machine tool is in thermal equilibrium stable operation state; The temperature difference value is obtained by calculating the difference between the input temperature signal and the machine tool's standard temperature reference value. Based on the temperature difference value, the dynamic weight coefficients corresponding to the first feature vector, the second feature vector, and the third feature vector are calculated respectively through a preset weight adjustment algorithm. The larger the temperature difference value, the higher the weight coefficients corresponding to the first feature vector and the second feature vector, and the lower the weight coefficient corresponding to the third feature vector. The first feature vector, the second feature vector, and the third feature vector are each mapped to three scalar values ​​through a learnable linear projection layer. The three scalar values ​​are weighted and summed using the dynamic weighting coefficients to obtain the comprehensive profile distortion coefficient.

7. The closed-loop control method for a lathe CNC system with integrated cam wear compensation according to claim 1, characterized in that, The process of constructing the control parameter compensation model includes: A control parameter compensation model is constructed based on a deep neural network. In the historical database, the actual contour distortion coefficients and historical process parameters of the lathe during machining under different wear conditions are collected to form the training dataset for the compensation model. For each data sample in the training dataset of the compensation model, obtain the corresponding, verified, and effective contour height correction amount to form the compensation target dataset. Using the actual contour distortion coefficients and historical process parameters in the training dataset of the compensation model as input samples, and the corresponding effective contour height correction amount in the compensation target dataset as the training target, the control parameter compensation model is supervised and trained until it is verified to converge, thus obtaining the pre-trained control parameter compensation model.

8. The closed-loop control method for a lathe CNC system with integrated cam wear compensation according to claim 1, characterized in that, The contour height correction amount is input into the lathe digital twin performance boundary model for feasibility verification and safety limiting, and a safety compensation instruction is generated, including: The profile height correction amount is arranged in the order of the sampling time corresponding to the phase signal of the main shaft encoder to form a profile height correction amount sequence synchronized with the cam rotation cycle; The contour height correction sequence is input into a pre-configured lathe digital twin performance boundary model; The lathe digital twin performance boundary model performs dynamic simulation verification on the contour height correction sequence based on the pre-stored machine tool physical limit parameters. The machine tool physical limit parameters include the maximum output torque of the feed axis servo motor, the maximum allowable speed, the maximum allowable acceleration of the mechanical transmission components, and the natural frequency of the machine tool mechanical structure. The lathe digital twin performance boundary model determines whether the dynamic simulation verification result meets all machine tool physical limit parameters. If the dynamic simulation verification result meets all machine tool physical limit parameters, the contour height correction amount is directly output as a safety compensation command. If the dynamic simulation verification result does not meet any of the machine tool physical limit parameters, then the amplitude limiting and smoothing processing is performed on the contour height correction amount, and the processed correction amount sequence is output as a safety compensation command.

9. The closed-loop control method for a lathe CNC system with integrated cam wear compensation according to claim 8, characterized in that, The contour height correction amount is subjected to amplitude limiting and smoothing processing, and the processed correction amount sequence is output as a safety compensation command, including: Based on the torque limit of the servo motor of the lathe feed axis, the reduction ratio and transmission efficiency parameters of the mechanical transmission system, the contour height correction is converted into an additional motion requirement for the tool post and the theoretical maximum allowable value of the contour height correction is calculated under the premise of not exceeding the torque limit of the servo motor. The theoretical maximum amplitude value is compared with the preset maximum correction amount allowed by the machining accuracy, and the smaller value between the two is taken as the upper limit threshold of the amplitude, while the lower limit threshold of the amplitude is set to zero. Traverse the contour height correction value sequence, set the correction value greater than the amplitude upper limit threshold to the amplitude upper limit threshold, and set the correction value less than zero to zero to obtain the processed correction value sequence, and output the processed correction value sequence as a safety compensation instruction.

10. The closed-loop control method for a lathe CNC system with integrated cam wear compensation according to claim 1, characterized in that, Executing the safety compensation instruction and optimizing the geometric feature extraction model and the control parameter compensation model based on the processing results includes: The safety compensation command is written into the lathe CNC system, the electronic cam gauge is updated online, and the lathe is controlled based on the updated electronic cam gauge wheel to perform subsequent machining tasks; After the subsequent processing tasks are completed, the measured key dimension error or surface roughness data of the processed workpiece are obtained by measuring instruments as evaluation signals for the processing results. The unloaded contour error data is associated with the temperature signal, the comprehensive contour distortion coefficient, the safety compensation command, and the processing result evaluation signal and stored as a training sample, and the training sample is stored in a dedicated learning sample database. The network parameters of the control parameter compensation model and the geometric feature extraction model are periodically fine-tuned and updated using the learning sample database.