Real-time compensation method for thermal error of mold steel machining CNC spindle fused with vibration spectrum
Patent Information
- Application Number
- CN202611038268.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-13
- Publication Date
- 2026-08-21
AI Technical Summary
尤其是在模具钢等难加工材料工况中,当主轴振动频谱特征表现出强烈突变时,现有热误差补偿模型无法利用振动信号中直接反映的“状态跃迁指征”进行实时参数调整,导致关键时刻的误差补偿失准
(1)针对传统CNC主轴热误差补偿模型在动态工况下面临的适应性差、重训练延迟高、实时响应能力不足等共性技术缺陷,本方案创新性地将振动频谱特征作为主轴热-力耦合状态演化的“生理指征”,通过构建“振动主导模态组合—热变形响应方向”映射机制,实现了对主轴热变形趋势的物理意义明确、响应灵敏度高的在线判别与定向引导。相较于现有技术中普遍依赖时间滑动窗口累积数据后进行全模型重训练或递推滤波更新的方式,本方法避免了大量历史数据存储与重复计算开销,有效克服了因建模滞后导致的补偿盲区问题;尤其在模具钢高精度加工过程中频繁启停、变速、变载等典型非稳态条件下,能够显著提前对热误差突变趋势的识别时机,提升模型对工况跃迁的感知粒度与响应速度,保障微米级加工精度的持续稳定性。
Smart Images

Figure CN122606383A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of thermal error compensation technology for high-precision CNC machine tools, and in particular to a real-time thermal error compensation method for CNC spindles used in mold steel machining that incorporates vibration spectrum. Background Technology
[0002] Currently, thermal error compensation technology for high-precision CNC machine tools has become one of the key factors restricting the dimensional stability of high-precision workpieces such as mold steel. For CNC spindle thermal errors, existing compensation schemes generally employ multi-point data acquisition based on temperature sensor arrays, describing the functional relationship between spindle temperature and thermal deformation through offline modeling or online adaptive algorithms. Mainstream technical approaches include static linear regression models, support vector regression, neural network prediction, recursive least squares filtering, Kalman filtering, and the recently emerging time-series deep learning models such as LSTM and TCN. The development trend of these methods is to improve error compensation accuracy, enhance dynamic working condition adaptability, and continuously pursue lightweight models and high real-time performance to meet the high response rate requirements of modern CNC systems.
[0003] In typical CNC thermal error modeling applications, thermal error prediction models often rely on static or quasi-static temperature data acquired by temperature sensors deployed at key parts of the spindle. Samples are collected through a sliding time window, and parameters are updated periodically or in a rolling manner to achieve a certain degree of adaptive operation. However, most existing methods do not fully consider the highly time-varying vibration state of the spindle under dynamic conditions such as heavy cutting, variable speed, and interference. Especially in high-load scenarios such as mold steel machining, the dynamic characteristics of the spindle-bearing-box system change frequently, and the excitation of vibration modes and energy distribution fluctuate drastically, leading to a significant enhancement of the thermo-mechanical coupling effect. This further exacerbates the time lag and incompleteness of temperature sampling in characterizing the overall state.
[0004] The existing publicly available solutions in the industry have the following typical applications and shortcomings: I. Static Parameters or Periodically Retrained Models: These methods typically establish a global fitting model based on historical temperature-deformation data, or update parameters by periodically backtracking to recent samples to predict and compensate for temperature-driven thermal errors. A typical advantage is their simple structural implementation and controllable computational resource consumption. However, when faced with the heat flow distribution and deformation mechanism transfer induced by abrupt changes in vibration modes during actual spindle operation, these models are slow to respond, easily causing error compensation lag, and cannot meet the stringent requirements for dynamic model tracking and rapid switching in micron-level precision machining scenarios.
[0005] II. Full-parameter Online Fine-tuning and Complex Temporal Network Models: Some high-end products or research systems attempt to introduce deep temporal networks such as LSTM and TCN to access temperature and other sensor signals in real time. They then improve the model's adaptability to dynamic operating conditions by recursively adjusting the full weights or integrating multiple model outputs. While this approach improves accuracy, its drawbacks include structural redundancy, high online training iteration time, and difficulty in guaranteeing sub-second response times for thermal error prediction model adjustments. This poses extremely high challenges to the computational resources and reliability of embedded CNC control systems.
[0006] III. Multimodal Signal Driving Model Integrating Infrared, Torque, and Current Signals: Some studies focus on multi-source data fusion, integrating multimodal sensing parameters such as temperature, infrared, spindle current, and servo driving force to create digital twin programmable control models. While this approach expands the data dimensions and enhances the overall state characterization capability, it introduces high-cost, easily failing sensors in real-world industrial environments, significantly increasing system stability and maintenance costs. Furthermore, it struggles to achieve accurate and real-time responses in mapping the actual vibration-thermal-deformation coupling state.
[0007] Due to the aforementioned shortcomings, the main problems currently facing the industry are concentrated in the following aspects: First, traditional thermal error compensation models that rely solely on temperature data lack dynamic adaptability and cannot respond in real time to thermo-mechanical coupling state transitions caused by abrupt changes in spindle vibration modes. Spindle temperature data inherently suffers from sampling delays and coverage blind spots in response to dynamic state changes, resulting in a significant time lag between model predictions and actual thermal deformation.
[0008] Secondly, existing model parameter update mechanisms mostly use fixed time window sliding or full recursion, which leads to slow model adjustment when the actual working conditions of the spindle undergo structural changes (such as the dominant frequency of the vibration mode or rapid transfer of energy distribution), easily resulting in "absolute overcompensation" or "complete lag", and the machining accuracy and robustness cannot be guaranteed.
[0009] Furthermore, while the introduction of complex network structures and multimodal signals can improve the prediction accuracy in some specific scenarios, it also brings a series of practical limitations, such as high consumption of computing resources, long online discrimination time, and high difficulty in system implementation and maintenance, making it difficult to operate stably in actual spindle closed-loop compensation systems.
[0010] The industry urgently needs a new thermal error modeling and compensation method that can accurately and timely detect changes in the dynamic state of the spindle, facilitating flexible switching and rapid convergence to optimal parameters under limited computing resources. Especially in the case of difficult-to-machine materials such as mold steel, when the vibration spectrum characteristics of the spindle exhibit strong abrupt changes, existing thermal error compensation models cannot utilize the "state transition indicators" directly reflected in the vibration signal for real-time parameter adjustment, leading to inaccurate error compensation at critical moments. Summary of the Invention
[0011] This application provides a real-time thermal error compensation method for CNC spindles used in mold steel machining based on fused vibration spectrum, aiming to solve one of the problems or issues of the prior art mentioned in the background section above.
[0012] The method for real-time thermal error compensation of CNC spindle in mold steel machining based on fused vibration spectrum provided in this application specifically includes: S1: Acquire the original vibration signal and perform short-time Fourier transform processing on the original vibration signal to generate a time-frequency energy matrix; S2: Based on the time-frequency energy matrix, perform modal energy clustering analysis to identify the dominant vibration mode frequency band and extract the vibration spectrum feature vector; S3: Construct a mapping table between the vibration dominant mode combination and the thermal deformation response direction, and use the vibration dominant mode frequency band combination in the vibration spectrum feature vector as the index key to establish a thermal error prediction model; S4: Perform abrupt change detection calculation on the vibration spectrum feature vector, and use the calculation results to make a judgment and generate a state transition trigger signal; S5: In response to the state transition trigger signal, retrieve the initial value of the local parameter corresponding to the current vibration dominant mode frequency band combination according to the mapping table of vibration dominant mode combination and thermal deformation response direction, and determine the initial value of the local parameter as a candidate set of temperature sensitive point weight coefficients to be reset; S6: Based on the measured thermal error residual data within the most recent time window, perform a single-step gradient correction operation on the candidate set of temperature sensitive point weight coefficients to be reset, so as to generate updated temperature sensitive point weight coefficients and complete the sparse reset operation of thermal error prediction model parameters. S7: Input the updated temperature-sensitive point weight coefficients into the thermal error prediction model and solve them in combination with real-time temperature data to generate real-time thermal error compensation.
[0013] The real-time thermal error compensation method for CNC spindle machining of mold steel based on fused vibration spectrum provided in this application has the following beneficial effects: (1) In response to the common technical defects of traditional CNC spindle thermal error compensation models under dynamic working conditions, such as poor adaptability, high retraining delay, and insufficient real-time response capability, this solution innovatively uses vibration spectrum characteristics as the "physiological indicator" of the evolution of the spindle's thermo-mechanical coupling state. By constructing a mapping mechanism of "vibration dominant mode combination - thermal deformation response direction", it realizes online discrimination and directional guidance with clear physical meaning and high response sensitivity of the spindle thermal deformation trend. Compared with the existing technology that generally relies on the accumulation of data through a time sliding window for full model retraining or recursive filtering update, this method avoids the overhead of storing a large amount of historical data and repeated calculations, and effectively overcomes the problem of compensation blind spots caused by modeling lag. Especially in the high-precision machining of mold steel, under typical unsteady conditions such as frequent start-stop, speed change, and load change, it can significantly advance the identification time of thermal error sudden change trend, improve the model's perception granularity and response speed to working condition transitions, and ensure the continuous stability of micron-level machining accuracy.
[0014] (2) Furthermore, this scheme proposes a "sparse reset mechanism," which dynamically adjusts the weight parameters of a few temperature-sensitive points only for the thermal deformation sensitive directions associated with the current dominant vibration mode, while keeping the other model parameters frozen. This greatly reduces the dimensionality and computational complexity of online optimization while ensuring local adaptability. This mechanism abandons the high-cost strategies commonly used in traditional online learning, such as end-to-end fine-tuning, attention reallocation, or multi-source information fusion modeling. It does not require the introduction of additional sensor signals or the construction of complex digital twins for multi-model assimilation, nor does it rely on deep temporal networks such as LSTM and TCN for long-term state memory and prediction. Instead, the initial values of parameter reset are directly derived from the offline mapping table established in the previous calibration experiment, and single-step gradient correction is implemented in combination with short-time measured residuals to achieve rapid convergence. This keeps the time for a single model adjustment within 20 milliseconds, fully meeting the stringent requirements of the closed-loop control cycle of high-speed and high-precision CNC systems for low latency of the compensation algorithm, and significantly improving the engineering practicality and deployment feasibility of the thermal error compensation system.
[0015] (3) In addition, this scheme enhances the robust identification capability of structural transformation of the internal thermo-mechanical coupling state of the spindle by combining modal energy clustering with three types of frequency band features (energy ratio, centroid frequency shift, and envelope kurtosis change rate) as a joint criterion, effectively suppressing the risk of false triggering caused by random noise, transient impact, or short-term disturbance. The offline construction process of the mapping table covers a variety of typical processing conditions, ensuring the physical consistency and generalization ability of the relationship between different modal combinations and thermal deformation response directions, providing reliable prior support for the online stage. The entire compensation logic chain forms a closed-loop adaptive architecture of "spectrum triggering - modal discrimination - direction mapping - parameter sparse reset", which achieves synergistic optimization between model accuracy, dynamic response, and computational efficiency without increasing system complexity. It has good interpretability and scalability and is suitable for various precision processing scenarios with extremely high requirements for thermal stability.
[0016] In summary, this method focuses on the intrinsic semantic information of the vibration spectrum to construct a lightweight, high-response, and robust dynamic compensation mechanism for thermal errors. It effectively solves the technical bottlenecks of traditional models, such as slow updates, heavy computational burden, and excessive reliance on external variables and complex structures. While ensuring modeling accuracy, it significantly reduces online adjustment latency, providing an efficient and reliable solution for achieving sub-micron level machining accuracy in high-end manufacturing fields such as mold steel. Attached Figure Description
[0017] Figure 1 This is the main flowchart of a real-time thermal error compensation method for CNC spindles in mold steel machining that integrates vibration spectrum.
[0018] Figure 2 This is a sub-flowchart of a method for real-time thermal error compensation of CNC spindles in mold steel machining that integrates vibration spectrum.
[0019] Figure 3 This is another sub-flowchart of the method for real-time thermal error compensation of CNC spindle in mold steel machining by integrating vibration spectrum. Detailed Implementation
[0020] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0021] The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the invention. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0022] like Figure 1 As shown, this application provides a real-time thermal error compensation method for CNC spindles used in mold steel machining by incorporating vibration spectra, specifically including: S1: Acquire the original vibration signal and perform short-time Fourier transform processing on the original vibration signal to generate a time-frequency energy matrix; S2: Based on the time-frequency energy matrix, perform modal energy clustering analysis to identify the dominant vibration mode frequency band and extract the vibration spectrum feature vector; S3: Construct a mapping table between the vibration dominant mode combination and the thermal deformation response direction, and use the vibration dominant mode frequency band combination in the vibration spectrum feature vector as the index key to establish a thermal error prediction model; S4: Perform abrupt change detection calculation on the vibration spectrum feature vector, and use the calculation results to make a judgment and generate a state transition trigger signal; S5: In response to the state transition trigger signal, retrieve the initial value of the local parameter corresponding to the current vibration dominant mode frequency band combination according to the mapping table of vibration dominant mode combination and thermal deformation response direction, and determine the initial value of the local parameter as a candidate set of temperature sensitive point weight coefficients to be reset; S6: Based on the measured thermal error residual data within the most recent time window, perform a single-step gradient correction operation on the candidate set of temperature sensitive point weight coefficients to be reset, so as to generate updated temperature sensitive point weight coefficients and complete the sparse reset operation of thermal error prediction model parameters. S7: Input the updated temperature-sensitive point weight coefficients into the thermal error prediction model and solve them in combination with real-time temperature data to generate real-time thermal error compensation.
[0023] Step S1: Acquire the original vibration signal and perform a short-time Fourier transform on the original vibration signal to generate a time-frequency energy matrix. Specifically, this includes: S1.1: Perform high-speed analog-to-digital conversion on the analog voltage signal output by the high signal-to-noise ratio accelerometers deployed at key locations in the spindle bearing housing and housing to generate a discrete original vibration signal sequence with millisecond-level time resolution.
[0024] Multi-stage signal conditioning is performed on the analog voltage signal output from the high signal-to-noise ratio accelerometers deployed at key locations in the spindle bearing housing and housing. This includes pre-amplification with low noise to match the dynamic range of the analog-to-digital converter (ADC) input, and bandpass filtering to limit the effective spectral range and improve signal quality. The conditioned analog voltage signal is then input to a high-speed ADC module, where synchronous sampling is performed at a preset sampling frequency with millisecond-level time resolution to ensure the vibration signal's temporal precision meets the window requirements for short-time Fourier transform analysis. Utilizing the ADC's internal quantization mechanism, the continuous analog waveform is decomposed into an amplitude sequence of equally spaced sampling points, and the digital precision of each sample value is determined based on the quantization bit depth. Offset correction is performed on the sampled values to eliminate baseline offset introduced by the sensor's DC drift, ensuring accurate zero-point positioning of subsequent digital signals. The offset-corrected sampling sequence is stored in a cache and timestamped to construct a discretized original vibration signal sequence suitable for time-series analysis. Through this processing, the sensor's analog output is converted into digital vibration data with millisecond-level time resolution, achieving initial digital input of the vibration signal in the time-frequency analysis chain.
[0025] For example, in a high-speed precision machining scenario for mold steel, the accelerometer installed on the spindle bearing housing is configured as a piezoelectric type with a sensitivity of 100mV / g, a bandwidth range of 0.5Hz to 20kHz, and a signal-to-noise ratio of 90dB. During signal conditioning, the low-noise amplifier gain is set to 10x, and the bandpass filter cutoff frequency range is set to 50Hz to 15kHz to filter out low-frequency disturbances and high-frequency noise from the external environment. The high-speed analog-to-digital converter sampling frequency is set to 10kHz, i.e., 10 sampling points are acquired every millisecond, and the quantization accuracy is configured to 24 bits to ensure effective capture of minute vibration amplitudes. During bias correction, the baseline drift value is measured to be 2.3mV. After subtraction correction, the zero-point alignment accuracy of the sampling sequence is improved to ±0.1mV. The length of the discretized original vibration signal sequence generated in the cache is 5000 points, corresponding to a real-time acquisition time window of 0.5 seconds. When the Hanning window is used for subsequent windowing operations, it is ensured that each frame contains short frames with overlapping sampling points. Finally, in the FFT analysis, it can accurately reflect the instantaneous vibration state of the main shaft and significantly improve the construction accuracy of the signal time-frequency energy matrix.
[0026] S1.2: Based on the discretized original vibration signal sequence, perform a windowing truncation operation using the Hanning window function to generate a set of short-time vibration signal frames containing overlapping sampling points, thereby suppressing the spectral leakage effect and establishing a local time window for time-frequency analysis.
[0027] Based on the discretized original vibration signal sequence obtained through high-speed analog-to-digital conversion, the effective range parameters of the window function are determined for each signal interval to be analyzed, and a Hanning window weight coefficient matrix is loaded to form a set of signal segments constrained by time locality. A sample-by-sample multiplication operation is performed on the window function coefficient matrix, and the amplitude of the corresponding sampling point of the discretized original vibration signal sequence is algebraically multiplied with the Hanning window coefficients to achieve a gradual attenuation of the signal amplitude at the boundaries, thereby reducing spectral leakage. Using preset frame length and frame shift parameters, a truncation and slicing operation is performed to divide the windowed signal sequence into multiple sets of overlapping short-time signal frames. During the truncation process, some overlapping sampling points between each frame are retained to enhance the continuity of the time-frequency analysis results. By combining windowing and overlapping truncation, each short-time signal frame exhibits smooth transition characteristics in the frequency domain, and the temporal correlation between frames is maintained, thus establishing the local time window structure required for subsequent instantaneous spectrum calculations. By using the Hanning window truncation method described above, the discretized original vibration signal sequence from the previous step is transformed into a set of short-time vibration signal frames that suppress spectral leakage and have overlapping sampling characteristics. This achieves stable construction of the time-frequency analysis window and provides high-quality input for subsequent instantaneous spectrum generation.
[0028] For example, in the scenario of vibration monitoring of a high-speed precision machining spindle for mold steel, the sampling rate of the discretized original vibration signal sequence is set to 20000Hz, the Hanning window length is set to 256 points, and the frame shift is set to 128 points. After windowing, the signal amplitude approaches zero at the window endpoints, and the short-time signal frame set generated by overlapping truncation contains approximately 156 frames per second, with an inter-frame overlap rate of 50%. In the spectral leakage evaluation before FFT processing, the signal peak sidelobe level after Hanning window truncation is significantly reduced, and the main lobe width of the peak stabilizes at approximately 0.015kHz, ensuring stable and reliable energy estimation of the instantaneous spectral vector in the high-frequency band, and providing a high-precision time-frequency energy matrix input for subsequent modal energy clustering analysis.
[0029] S1.3: Perform a Fast Fourier Transform algorithm operation on each frame of data in the short-time vibration signal frame set to generate an instantaneous spectrum vector array that characterizes the amplitude distribution of frequency components within each time segment.
[0030] Each frame of data in the short-time vibration signal frame set formed by windowing and truncation through the Hanning window is loaded into the Fast Fourier Transform (FFT) calculation module, and the frame data is filled with a sequence according to the preset number of FFT calculation points to make the sampling length match the frequency domain resolution requirements.
[0031] The padded frame data is converted into a corresponding set of frequency domain complex coefficients through a weighted operation in complex form. The set of coefficients is then decomposed to separate the real and imaginary parts to construct the basic data required for amplitude calculation.
[0032] For each complex coefficient, perform square and square root operations, arrange the above amplitude calculation results in frequency axis order, generate an instantaneous spectrum vector that characterizes the amplitude distribution of each frequency component within the frame time segment, and perform a zero frequency component shift operation on it to achieve spectrum symmetry.
[0033] The instantaneous spectrum vectors of all frames are concatenated in time sequence to form an instantaneous spectrum vector array, which serves as the direct input for subsequent energy calculation and frequency mapping. Through the above processing method, short-time vibration signal frames are transformed into quantitatively analyzable frequency component amplitude data, thereby achieving high time-resolution frequency domain characterization of the spindle vibration.
[0034] For example, in the high-precision milling of mold steel, the sampling frequency is set to 20000Hz, the Hanning window length is 256 points, and the frame shift is 128 points. After FFT transformation, 256 complex coefficients are obtained for each frame. After calculating the amplitude using the formula, an instantaneous spectrum covering 0-10000Hz can be obtained. In a certain frame, the amplitude at 3200Hz is observed to be significantly higher than that of neighboring frequencies. This feature remains stable across multiple consecutive frames, indicating the presence of a corresponding modal resonance at the main bearing during machining. This instantaneous spectrum vector array, after being spliced and input into the subsequent power spectrum calculation module, can significantly improve the identification confidence of modal energy clustering analysis in this frequency band and provide accurate vibration basis data for the directional mapping of the thermal error prediction model.
[0035] S1.4: Perform amplitude square calculation and frequency axis mapping operation based on the instantaneous spectrum vector array to generate a two-dimensional power spectral density matrix that reflects the energy intensity distribution of each frequency band at each time.
[0036] S1.5: Perform time-axis continuous splicing and normalization processing on the two-dimensional power spectral density matrix to generate the final time-frequency energy matrix characterizing the time-frequency energy distribution of the principal shaft vibration, which serves as the direct input object for subsequent modal feature extraction.
[0037] Step S2: Based on the time-frequency energy matrix, perform modal energy clustering analysis to identify the dominant vibration mode frequency band and extract the vibration spectrum feature vector. Specifically, this includes: S2.1: Perform peak search processing on the full-band energy distribution data in the time-frequency energy matrix to obtain a set of candidate mode frequencies containing all local maxima, which will serve as the initial data source for subsequent screening of real physical modes.
[0038] S2.2: Perform spectral peak significance verification operation based on the candidate modal frequency set. By comparing the energy difference between adjacent frequency points with the background noise floor threshold, false spectral peaks are eliminated and a list of effective modal frequencies containing only the true mechanical resonance frequencies is generated.
[0039] S2.3: The effective modal frequency list is used to divide the time-frequency energy matrix into frequency bands and calculate energy integration to generate a modal energy ratio sequence that characterizes the intensity of each independent vibration mode, and the top three dominant vibration mode frequency bands in terms of energy contribution are identified accordingly.
[0040] Based on the effective modal frequency list, the energy distribution data at the corresponding frequency index position is extracted from the time-frequency energy matrix as the reference input for frequency band division.
[0041] For each frequency value in the effective modal frequency list, a bandwidth delimitation operation is performed to calibrate the center frequency and its upper and lower offset ranges, forming an independent set of frequency intervals.
[0042] Integral calculations are performed on the energy spectrum curve of the time-frequency energy matrix within each frequency interval, and the total energy value of that frequency band is quantified by numerical accumulation.
[0043] The total energy value of each frequency band is compared with the cumulative energy value of the entire frequency band to generate a modal energy percentage sequence.
[0044] The modal energy proportion sequence is sorted in descending order, and the top three dominant vibrational mode bands are selected based on energy contribution.
[0045] By using the frequency range division and energy integration processing described above, the effective modal frequency list from the previous step is transformed into a quantitative index characterizing the intensity of each independent vibration mode. This enables accurate identification of the frequency band with the highest energy contribution under the current operating condition of the spindle, providing a target frequency band range for subsequent calculation of the center of gravity frequency offset and envelope kurtosis change rate.
[0046] For example, in the high-speed precision machining scenario of mold steel, the effective modal frequency list includes three center frequencies: 320Hz, 480Hz, and 920Hz. A bandwidth of ±20Hz is set for the 320Hz center frequency, forming a frequency range of 300Hz to 340Hz; a bandwidth of ±15Hz is set for the 480Hz center frequency, forming a frequency range of 465Hz to 495Hz; and a bandwidth of ±25Hz is set for the 920Hz center frequency, forming a frequency range of 895Hz to 945Hz. The energy spectrum curves of each range are extracted from the time-frequency energy matrix, and integration is performed to obtain a total frequency band energy value of 2.35 × 10⁻⁶. 6 1.80×10 6 3.10×10 6 The total energy value across the entire frequency band is 9.00 × 10⁻⁶. 6Substituting the total energy values of each interval into the formula, the modal energy proportions were calculated to be 0.261, 0.200, and 0.344, respectively. After sorting, the top three dominant modal frequency bands in terms of energy contribution were identified as 920Hz, 320Hz, and 480Hz. This identification result was fixed as the target frequency band set. During the verification process, by limiting the input frequency band range in the subsequent feature solving stage, the calculation accuracy and stability of the centroid frequency offset and envelope kurtosis change rate features were significantly improved.
[0047] S2.4: Perform a centroid frequency offset calculation operation on the spectral envelope within the frequency band of the dominant vibration mode. Calculate the displacement of the energy distribution center relative to the calibrated reference frequency using a weighted average algorithm, thereby generating a centroid frequency offset characteristic parameter that reflects the change in spindle stiffness.
[0048] For the top three dominant vibration modes in terms of energy contribution output from the preceding sub-step S2.3, the corresponding frequency band amplitude sequence of the power spectral density matrix is used as the input for spectral envelope calculation. This spectral envelope is discretized along the frequency axis, and a correspondence between amplitude and frequency is established for each sampled frequency point to form a set of feature points that can be used for center position calculation. Amplitude normalization is performed on the formed feature point set to eliminate the interference of absolute energy differences between different mode bands on the center position calculation, thus ensuring that the center position is evaluated solely based on the energy distribution pattern. A weighted average calculation is performed based on the normalized amplitude sequence, using frequency values as weights. The center-of-gravity frequency offset is obtained using the centroid frequency formula. The difference between the calculated centroid frequency and the reference frequency value pre-stored during system calibration is calculated, and the centroid frequency offset is determined using the centroid frequency offset formula. The obtained offset is output as a feature parameter reflecting the change in principal shaft stiffness, and together with other features such as energy proportion, constitutes the vibration spectrum feature vector. By using a centroid frequency offset calculation method based on the spectral envelope, the frequency band energy data from the previous step is transformed into a stiffness change index that can be used to determine the thermo-mechanical coupling state, thereby achieving high-precision perception of the dynamic change trend of the main shaft structure.
[0049] S2.5: Based on the instantaneous amplitude sequence of the dominant vibration mode frequency band, perform envelope kurtosis rate of change derivation processing, quantify the growth trend of the impact component by statistically analyzing the higher-order moment characteristics, and finally generate envelope kurtosis rate of change characteristic parameters that characterize early bearing damage or deterioration of lubrication condition, and together with the aforementioned features, constitute the vibration spectrum feature vector.
[0050] Based on the instantaneous amplitude sequence of the dominant vibration mode frequency band obtained from the previous steps, the signal envelope extraction and operation module is called to perform Hilbert transform on each mode amplitude sequence to generate the corresponding analytical signal and obtain its mode time sequence as the envelope signal input object.
[0051] The envelope signal input object is subjected to centering and standardization preprocessing operations to reduce the signal mean to zero and scale it to unit variance, so as to eliminate the influence of amplitude dimension differences on higher-order moment statistics.
[0052] A kurtosis calculation formula is constructed using the fourth-order central distance and the second-order central distance, and the instantaneous kurtosis value is calculated for each time segment.
[0053] Perform a sliding window difference operation on the kurtosis value sequence of each modal band, calculate the rate of change of kurtosis values between adjacent time segments, perform outlier detection on the rate of change sequence, filter out modal bands with a continuous growth trend exceeding the preset envelope kurtosis change threshold, and record the corresponding rate of change as the envelope kurtosis change rate feature parameter.
[0054] By employing the aforementioned Hilbert envelope extraction, center distance statistics, difference ratio derivation, and anomaly detection processing methods, the dominant mode amplitude sequence from the previous step is transformed into an envelope kurtosis change rate index that can quantify the growth trend of impact components, thereby enabling the extraction of sensitive features for early bearing damage or deterioration of lubrication condition.
[0055] like Figure 2 As shown, step S3 involves constructing a mapping table between the dominant vibration mode combination and the thermal deformation response direction, using the dominant vibration mode frequency band combination in the vibration spectrum feature vector as the index key to establish a thermal error prediction model. Specifically, this includes: S3.1: Acquire the historical vibration original signal sequence and the corresponding three-dimensional thermal deformation measurement data sequence of the spindle under various typical mold steel processing conditions. Perform short-time Fourier transform processing on the historical vibration original signal sequence to generate a historical time-frequency energy matrix set. Perform temperature-deformation correlation analysis on the three-dimensional thermal deformation measurement data sequence of the spindle to screen out several key temperature-sensitive point location identifiers that contribute the most to thermal deformation.
[0056] This method acquires historical vibration raw signal sequences and corresponding measured three-dimensional thermal deformation data sequences of the spindle under various typical mold steel machining conditions. The targets include analog voltage signals output by high signal-to-noise ratio accelerometers located at key positions on the spindle bearing housing and housing, as well as deformation data sequences output by temperature sensors and laser interferometers or high-precision displacement sensors located at various temperature measurement points on the spindle. High-speed analog-to-digital conversion is performed on the historical vibration raw signal sequences to generate a discretized historical vibration signal data stream with millisecond-level time resolution. Based on this discretized historical vibration signal data stream, a Hanning window truncation operation is performed to form a short-time vibration signal frame set. A fast Fourier transform operation is then performed on each frame to generate an instantaneous spectrum vector array representing the amplitude distribution of frequency components. The instantaneous spectrum vector array is then mapped to the frequency axis using amplitude squares to generate a two-dimensional power spectral density matrix. Time axis splicing and normalization are then performed to form a historical time-frequency energy matrix set, which serves as the direct input for subsequent correlation analysis. A correlation analysis was performed on the measured data sequence of the three-dimensional thermal deformation of the main shaft and the synchronously acquired temperature sensor data to construct a correlation coefficient matrix representing the correspondence between temperature variables and thermal deformation variables. The Pearson correlation coefficient calculation method was used to quantify the linear correlation strength between temperature-sensitive points and thermal deformation. The correlation coefficients of all temperature-sensitive points were sorted, and the group of key temperature-sensitive point location identifiers with the largest absolute values of correlation coefficients was selected and output as input for the construction of historical vibration state features in subsequent step S3.2. Through the above time-frequency matrix generation and temperature-deformation correlation screening process, the vibration spectrum data obtained in the previous main step was transformed into a key temperature-sensitive point index that can be used to construct a mapping table, thus solidifying the basic data for static correlation relationships.
[0057] For example, in the precision machining scenario of mold steel, eight high signal-to-noise ratio accelerometers and twelve temperature sensors are deployed, with a sampling frequency of 20kHz and an analog-to-digital conversion resolution of 16 bits. Hanning window processing is applied to the acquired historical vibration signals, with a window length of 256 points, a frame shift of 128 points, and an FFT of 512 points, generating a historical time-frequency energy matrix set with a spectral resolution of 39Hz per frame. Temperature and thermal deformation data are acquired at a period of 1ms, and Pearson correlation coefficients are used for calculation. Three correlation coefficients are calculated for each temperature-sensitive point and the X / Y / Z triaxial thermal deformation data, and the absolute values are sorted. Temperature-sensitive point location identifiers with absolute values greater than 0.85 are included in the key set. In this scenario, three temperature-sensitive points located at the front end of the bearing housing, the middle section of the spindle, and the tail end are selected as high-contribution points. Substituting into the formula, the correlation coefficient between the temperature at the front end of the bearing housing and the thermal deformation in the X direction is 0.91, the correlation coefficient between the temperature in the middle section of the spindle and the thermal deformation in the Y direction is 0.88, and the correlation coefficient between the temperature at the tail end and the thermal deformation in the Z direction is 0.86. The set of key temperature sensitive point location identifiers is output, and it is verified that this set always contains the temperature measurement point with the highest contribution to thermal deformation under different operating conditions of the spindle, which significantly improves the accuracy and stability of the subsequent mapping table construction.
[0058] S3.2: Based on the historical time-frequency energy matrix set, perform modal energy clustering analysis to identify the dominant historical vibration mode frequency band combination for each set of working condition data, and extract the historical energy proportion, historical centroid frequency offset and historical envelope kurtosis change rate in each frequency band as historical vibration spectrum feature vectors, thereby generating a historical vibration state sample library containing working condition labels.
[0059] Modal clustering preprocessing is performed on each set of operating condition data in the historical time-frequency energy matrix. The full-band energy distribution within the matrix is divided into fixed-width frequency bands according to a preset frequency resolution, and significant energy fluctuation segments are selected as preliminary modal candidates based on energy intensity thresholds. K-means clustering is performed on the energy curves within the preliminary modal candidate segments, using energy peak position, bandwidth, and peak amplitude as clustering features to form a set of cluster centers, ensuring the physical separability of different mechanical resonance modes. Based on the set of cluster centers, the historical energy proportion of each modal band is calculated. By dividing the energy integral value of the band by the total energy of the entire frequency band, a ratio index quantifying its relative intensity is obtained. For each identified modal band, the historical centroid frequency index is extracted. A weighted average formula is used to sum the products of the band's energy value and the corresponding frequency, and then divided by the total energy of the band. The kurtosis rate of change is derived for the time-domain envelope signal within the modal band, and higher-order moment features are calculated to quantify the trend of impact component changes, thereby generating historical envelope kurtosis rate of change feature values. The historical energy proportion, historical centroid frequency offset, and historical envelope kurtosis change rate are combined according to modal frequency band index to form a complete historical vibration spectrum feature vector. Each feature vector is then labeled with its source operating condition, constructing a historical vibration state sample library containing vibration modal features and operating condition information. Through the above modal clustering and feature extraction processing, the historical time-frequency energy matrix set is transformed into a structured historical vibration spectrum feature vector, achieving high-precision archiving and labeling of modal information under multiple operating conditions. This provides high-confidence input data for subsequent establishment of vibration dominant mode combinations and thermal deformation response direction mapping.
[0060] S3.3: Using the historical vibration spectrum feature vector in the historical vibration state sample library and the measured thermal deformation data corresponding to the key temperature sensitive point location identifier, perform multivariate regression modeling calculation to quantify the influence weight of each historical vibration dominant mode frequency band combination on the thermal deformation sensitivity of the principal axis in the three directions of X-axis, Y-axis and Z-axis, so as to generate a three-dimensional sensitivity ranking vector characterizing the coupling strength between vibration mode and thermal deformation direction.
[0061] The dimensionality analysis process is performed on the historical vibration spectrum feature vectors in the historical vibration state sample library. The three types of features, namely energy proportion, centroid frequency offset and envelope kurtosis change rate, are mapped to the numerical sequences of the corresponding modes, so as to establish an input matrix that matches the frequency band combination of each dominant vibration mode.
[0062] The measured thermal deformation data corresponding to the location identifiers of key temperature-sensitive points are processed by triaxial component separation. The deformation of the X-axis, Y-axis and Z-axis are extracted into independent output vectors. The mean center and variance normalization are performed on each output vector to eliminate the influence of the difference in physical dimensions of different measurement points on the regression results.
[0063] Based on the above input matrix and output vector, a multivariate linear regression design matrix is constructed. By using column vectors to correspond to vibration spectrum features and row vectors to correspond to time samples, the time-to-time correlation between features and thermal deformation is realized.
[0064] The design matrix and output vector are solved by least squares. The regression operation is performed on each historical vibration dominant mode frequency band combination. The absolute values of the regression coefficients in the X, Y and Z axes are extracted and sorted by numerical value to generate the three-dimensional sensitivity sorting vector of the combination.
[0065] The three-dimensional sensitivity sorting vector is stored in the intermediate result cache area to provide a quantitative basis for the subsequent inversion of the initial value of the optimal parameter.
[0066] By using multivariate regression modeling and coefficient sorting, the historical vibration spectrum characteristics and thermal deformation data from the previous step are transformed into a three-dimensional sensitivity sorting vector that characterizes the coupling strength between vibration modes and thermal deformation directions, thereby achieving static quantification of the thermo-mechanical coupling relationship.
[0067] For example, under the high-speed milling condition of a certain mold steel, the historical vibration state sample library contains 500 samples. The vibration spectrum feature vector of each sample has a dimension of 9, including a 3-dimensional energy proportion feature, a 3-dimensional centroid frequency shift feature, and a 3-dimensional envelope kurtosis change rate feature. The key temperature sensitive point location identifiers correspond to the measured thermal deformation data in the X, Y, and Z axes, in micrometers. The 500 features are used to construct a design matrix X with 500 rows and 9 columns; the corresponding thermal deformation data are used to construct an output vector Y. x Y y Y z Mean centering and variance normalization are performed on all values. Least squares are then performed on each axis; for example, β is calculated along the X-axis. x , the obtained β x The absolute values of the vectors are 0.42, 0.35, 0.28, etc., and sorted by magnitude, we obtain the sensitivity sequence {0.42, 0.35, 0.28}; similarly, β is calculated. y β z The corresponding sensitivity sequence was then obtained. Finally, the triaxial sensitivity sequence was encapsulated into a three-dimensional sensitivity sorting vector (0.42, 0.38, 0.36) to characterize the coupling strength of the current mode combination to triaxial thermal deformation. The verification results show that the sequence has stability under different working conditions and significantly improves the accuracy of subsequent initial parameter matching.
[0068] S3.4: Based on the three-dimensional sensitivity sorting vector, perform optimal parameter inversion derivation processing. For each unique historical dominant mode frequency band combination, traverse and search the set of initial values of local temperature sensitive point weight coefficients that minimize the thermal error prediction residual, so as to generate the optimal local parameter initial value data block that precisely matches the specific vibration mode combination.
[0069] The three-dimensional sensitivity ranking vector is obtained as a quantitative reference for the coupling strength in the thermal deformation direction. For each unique historical dominant vibration mode frequency band combination, the three-dimensional sensitivity ranking vector is initialized by matrix mapping with the corresponding key temperature sensitive point location identifier, constructing a parameter search space containing thermal error prediction residual evaluation. Within the parameter search space, an objective function is established based on a preset residual minimization criterion. Candidate parameter sets are generated by traversing different weight coefficient combinations, and the difference between the thermal error prediction model output and the measured data is calculated for each candidate set to form a residual sequence. The residual sequence is input into the error sum of squares calculation module to derive the optimal parameter combination. Using a combination of gradient descent and global traversal, the set of initial weight coefficient values that minimizes E in the candidate set is searched. The searched set of initial weight coefficient values is sorted by the sensitivity in the corresponding thermal deformation direction and reorganized to generate an optimal local parameter initial value data block that precisely matches the specific vibration mode combination. Through the above derivation and search processing, the sensitivity ranking vector of the previous step is transformed into optimal local parameter initial values that can be directly used for online sparse reset, thereby improving the model's ability to quickly match dynamic working conditions.
[0070] For example, in high-speed milling of mold steel, the dominant frequency band combination of historical vibration modes is [320Hz, 540Hz, 860Hz], and its corresponding three-dimensional sensitivity ranking vector is [0.72, 0.15, 0.13]. The key temperature sensitive point location identifiers are T1, T3, and T5. When constructing the parameter search space, the weight coefficient of each temperature sensitive point is limited to the range of 0 to 1, with a step size of 0.01, forming approximately 1 million sets of candidate parameters. The mean square error of each set of candidate parameters is calculated using the above formula, where N is set to 200, y is the measured spindle thermal deformation data of the laser interferometer, and y′ is the output data of the thermal error prediction model. For example, in one set of candidate parameters [0.68, 0.14, 0.12], the calculated value of E is 0.0024, while in another set of candidate parameters [0.72, 0.15, 0.13], E is 0.0019. The latter is smaller, therefore the latter is determined to be the optimal set of initial local parameter values. By reorganizing this set according to the X / Y / Z axis sensitivity order, an optimal set of initial local parameter values is generated. In subsequent online compensation, it is verified that this can significantly reduce the residual to a stable value at the micrometer level, thereby achieving a significant improvement in the model compensation accuracy under dynamic conditions.
[0071] S3.5: Encapsulate the historical dominant vibration mode frequency band combination into an index key value, and use the corresponding optimal local parameter initial value data block and the three-dimensional sensitivity sorting vector as associated values to perform a hash mapping table construction operation to generate a final mapping table of dominant vibration mode combination and thermal deformation response direction that can be used for online real-time retrieval, thus completing the solidification and storage of static association relationships.
[0072] S3.6: Real-time acquisition of spindle vibration signals, temperature data of key temperature-sensitive points, and operating condition information from the access device; real-time replication of the online lightweight algorithms of S3.1 and S3.2; rapid calculation of the dominant vibration mode combination under the current operating condition, serving as the index for the mapping table retrieval. Secondly, through real-time matching of the index, the corresponding triaxial sensitivity sorting vector and optimal local temperature weight initial parameters are retrieved from the mapping table, completing the rapid initialization of the model's pre-parameters. By integrating multiple linear regression logic, combined with normalized real-time temperature data and multidimensional vibration modal characteristics, regression coefficients and weighting coefficients are substituted to establish a vibration-temperature coupled triaxial thermal deformation calculation equation. A residual correction mechanism is introduced to continuously optimize the weighting coefficients with measured deformation data, correct model output deviations, and form a closed-loop correction logic. Finally, the entire process algorithm, including modal matching, parameter lookup, coupled calculation, and error correction, is integrated and encapsulated into a complete thermal error prediction model. This model can output the thermal deformation error values of the X / Y / Z axes in real time, enabling accurate calculation of dynamic thermal errors under different machining conditions and providing core model support for machine tool thermal error compensation and machining accuracy optimization.
[0073] like Figure 3 As shown, step S4 involves performing abrupt change detection calculations on the vibration spectrum feature vector, using the calculation results for judgment, and generating a state transition trigger signal. Specifically, this includes: S4.1: Obtain the vibration spectrum feature vector of the current frame generated in the previous step and the vibration spectrum feature vectors of the first two frames stored in the historical cache queue. Perform time series alignment processing on the three consecutive vibration spectrum feature vectors to construct a three-dimensional state monitoring data window containing the energy proportion time series trajectory, the centroid frequency offset time series trajectory, and the envelope kurtosis change rate time series trajectory.
[0074] Obtain the vibration spectrum feature vector of the current frame output by the previous steps and the vibration spectrum feature vectors of the previous two frames stored in the historical cache queue. Perform precise matching and positioning of the three frames of data according to the time index to ensure that the correspondence of each feature component on the time axis is consistent.
[0075] The aligned three-frame vibration spectrum feature vectors are grouped according to feature category. The energy proportion feature is formed into an independent time series, the centroid frequency offset feature is formed into an independent time series, and the envelope kurtosis change rate feature is formed into an independent time series.
[0076] Interpolation smoothing is performed on the energy percentage time series to fill in any missing points that may occur during the sampling process, suppress instantaneous noise interference, and preserve the actual operating condition trend.
[0077] Perform a leading synchronization check on the centroid frequency offset time series to eliminate phase misalignment caused by delayed acquisition and ensure that the offset of each frequency band can be accurately compared within the same state window.
[0078] Amplitude normalization is performed on the time series of envelope kurtosis change rate to convert the statistics of impact components in different frequency bands to a unified dimension, which facilitates cross-feature collaborative judgment in subsequent mutation detection.
[0079] Through the above processing, the feature vectors of three consecutive vibration spectra are transformed into a three-dimensional state monitoring data window containing the energy proportion time-series trajectory, the centroid frequency shift time-series trajectory, and the envelope kurtosis change rate time-series trajectory, thereby realizing multi-feature parallel perception of the thermal-mechanical coupling state changes of the main axis.
[0080] For example, during the precision machining of mold steel, a high signal-to-noise ratio accelerometer with a sampling frequency of 2000Hz is configured. In the current frame's vibration spectrum feature vector, the dominant mode energy proportion is 0.38, the centroid frequency offset is 1.25Hz, and the envelope kurtosis change rate is 0.014. The corresponding values for the two historical frames are (0.35, 1.18Hz, 0.013) and (0.33, 1.15Hz, 0.012), respectively. The three frames of data are aligned according to their time indices, and cubic spline interpolation is performed on the energy proportion sequence to obtain a smoothed value sequence (0.33, 0.35, 0.38). A phase synchronization check is performed on the centroid frequency offset sequence to confirm that the offset feature is valid under the same working condition. The envelope kurtosis change rate sequence is normalized to (0.012, 0.013, 0.014). The final constructed three-dimensional state monitoring data window can provide continuous, comparable, and consistent input data in the subsequent mutation detection sub-step, effectively supporting the comparison calculation of mutation values and thresholds, and improving the accuracy of the generation of principal axis state transition trigger signals.
[0081] S4.2: Based on the energy proportion time-series trajectory in the three-dimensional state monitoring data window, perform differential slope calculation operation for each dominant vibration mode frequency band to generate a sequence of energy proportion abrupt change values that characterize the intensity of energy distribution in the dominant vibration mode frequency band.
[0082] Based on the energy proportion time-series trajectory in the three-dimensional condition monitoring data window, the aligned three-frame continuous vibration spectrum feature vectors are used as the input dataset.
[0083] For each dominant vibration mode frequency band, its energy proportion sequence is extracted, and the difference between adjacent time points is calculated to obtain the energy change of the frequency band between consecutive frames.
[0084] Using the aforementioned energy change matrix as input for the difference operation, a difference slope calculation is performed along the time axis. The intensity of the change is quantified by calculating the rate of change of the energy percentage per unit time.
[0085] The energy proportion time-series trajectory is calculated using the differential slope formula. The differential slope results are then normalized to the frequency band reference energy level to eliminate the differences in energy dimensions between different frequency bands.
[0086] Perform absolute value operation on the normalized difference slope sequence to generate a sequence of energy percentage mutation values that characterize the degree of drastic change in energy distribution.
[0087] By calculating the differential slope and normalizing the data, the energy trajectory of the three-dimensional state monitoring data window is transformed into a mutation value index that can be directly used to determine state transitions, thereby quantifying the degree of drastic change in vibration mode energy.
[0088] For example, in a mold steel precision machining scenario, the monitoring window contains three frames with energy percentage values of 0.35, 0.42, and 0.60, respectively, with a sampling frame interval of 5 milliseconds. Differential calculation yields a first differential component of 0.07 and a second differential component of 0.18. The slope calculated using the energy percentages of the start and end frames is 25. After normalization to a frequency band reference energy of 0.50, the result is 50, and the absolute value of this result is also 50. This result is significantly higher than the set threshold of 20, indicating that the energy distribution in this frequency band changes drastically. The sequence of abrupt changes will be used to generate subsequent state transition trigger signals, verifying the high sensitivity of the differential slope calculation method in identifying rapid energy changes.
[0089] S4.3: Based on the centroid frequency offset time-series trajectory in the three-dimensional state monitoring data window, a step detection algorithm is executed for each dominant vibration mode frequency band to generate the extreme value of the centroid frequency offset that characterizes the instantaneous jump of the center frequency of the dominant vibration mode frequency band.
[0090] For the centroid frequency offset time-series trajectory in the 3D state monitoring data window, the centroid frequency data of each dominant vibration mode frequency band, generated by the previous sub-step and arranged in time sequence, are loaded to establish a frequency offset vector set indexed by the sampling time. This frequency offset vector set is then subjected to mean benchmarking processing, subtracting the reference frequency value within the window from the centroid frequency value at each time point to obtain a normalized frequency offset reference difference sequence. A sliding difference operation is performed on the normalized frequency offset reference difference sequence, calculating the difference between two adjacent sampling points at each time point to form an instantaneous difference sequence used to determine the rate of change of the frequency trajectory. Utilizing the edge integral characteristics of the step detection algorithm, a modular accumulation operation is performed on the instantaneous difference sequence. When the accumulated value exceeds a set step judgment threshold within a single sampling interval, the sampling point is recorded as a jump candidate point. An extreme value search is performed on the centroid frequency offset value at the time of the jump candidate point to locate the instantaneous maximum or minimum absolute value of the frequency offset for that vibration mode frequency band within the window, and this extreme value is encapsulated as a centroid frequency offset extreme value output parameter. This processing method transforms the centroid frequency offset time-series trajectory from the previous step into an instantaneous frequency jump variable technical indicator that can be directly used for subsequent state transition determination, thereby achieving accurate capture of structural frequency transitions in the thermal-mechanical coupling state of the main shaft.
[0091] For example, in a high-speed precision machining scenario for mold steel, the 3D state monitoring data window is set to a sampling time of 30 milliseconds, containing three frames of centroid frequency data for the dominant vibration mode band. The reference frequency for a certain mode band is 1250Hz, and the normalized frequency offset reference difference sequences are 0Hz, 15Hz, and 220Hz, with sliding difference values of 15Hz and 205Hz, respectively. In the step detection algorithm, the judgment threshold is set to 200Hz. The accumulated value reaches 205Hz at the second difference position, exceeding the threshold, and the time corresponding to the second difference position is recorded as a candidate point for a jump. At this time, the centroid frequency offset is 220Hz. Extreme value search confirms it as the extreme value of the centroid frequency offset within the current window, resulting in a 220Hz result. This jump variable is output as the extreme value of the centroid frequency offset. The application effect is to significantly improve the accuracy of state transition triggering in a very short time and control the detection error within the range of ±5Hz of the frequency offset.
[0092] S4.4: Using a preset state transition threshold library, perform logical and threshold comparison operations on the energy proportion mutation value sequence and the extreme value of the center of gravity frequency offset to determine whether there is any dynamic index of the dominant vibration mode frequency band that exceeds the preset tolerance range, thereby generating an initial state discrimination result that reflects the structural transformation of the main shaft thermo-mechanical coupling state.
[0093] Based on the energy percentage mutation value sequence and the extreme value of the center of gravity frequency offset, the upper limit of the tolerance for energy percentage mutation and the upper limit of the tolerance for center of gravity frequency offset set for different vibration dominant mode frequency bands are called in the preset state transition threshold library to construct a dual index threshold matrix as the judgment basis.
[0094] A frequency band threshold comparison operation is performed on the energy percentage mutation value sequence. The difference between each mutation value and the upper limit of the energy percentage mutation tolerance of the corresponding frequency band is calculated, and an energy percentage mutation over-limit flag is generated according to the sign of the difference.
[0095] Perform a band-by-band threshold comparison operation on the extreme values of the centroid frequency offset, calculate the difference between each extreme value and the upper limit of the centroid frequency offset tolerance of the corresponding band, and generate a centroid frequency offset over-limit flag based on the sign of the difference.
[0096] The energy percentage mutation limit flag and the center of gravity frequency shift limit flag are combined using a logical AND operation. Only when both types of limit flags in a certain vibration dominant mode frequency band are true at the same time, the state transition trigger unit judgment result of that frequency band is generated.
[0097] Perform a full-band scan on the state transition trigger unit judgment results of all frequency bands. If at least one frequency band is detected to satisfy the logical AND condition, generate an initial state discrimination result of true; otherwise, generate a discrimination result of false.
[0098] By using the above-mentioned dual-index threshold comparison and joint judgment processing method, the mutation calculation result of the previous step is transformed into the initial state discrimination result reflecting the structural change of the main shaft thermo-mechanical coupling state, thereby achieving the accuracy and robustness of online state detection.
[0099] S4.5: In response to the initial state discrimination result being true, mark the current time as a state transition point and encapsulate the timestamp information to generate a state transition trigger signal for driving the subsequent parameter sparse reset mechanism.
[0100] Step S5: In response to the state transition trigger signal, the optimal initial value of the local parameter corresponding to the current dominant vibration mode combination is retrieved according to the mapping table between the vibration dominant mode combination and the thermal deformation response direction, and the optimal initial value of the local parameter is determined as the candidate set of weight coefficients for the temperature sensitive points to be reset. Specifically, this includes: S5.1: The received state transition trigger signal is parsed and processed to extract the dominant vibration mode frequency band combination identifier at the current moment, thereby generating an index key value for mapping table retrieval.
[0101] S5.2: Based on the index key value, perform a precise matching query operation in the vibration dominant mode combination and thermal deformation response direction mapping table to locate the calibration record entry that is completely consistent with the vibration dominant mode frequency band combination identifier generated in the previous step, thereby obtaining the associated optimal local parameter initial value data block.
[0102] A hash location process is performed on the index key value generated by the preceding sub-step S5.1 to establish a single correspondence between the key value and the memory address of the table entry in the pre-fixed storage mapping table of vibration dominant mode combination and thermal deformation response direction.
[0103] After locating the bucket containing the potential matching record, a field-by-field comparison operation is performed on the vibration dominant mode frequency band combination identifier of all entries in the bucket to ensure that the center frequency, energy percentage and envelope kurtosis change rate of each frequency band are completely consistent with the current index key value.
[0104] For entries where the field comparison result is true and all features match, read the index of the optimal local parameter initial value data block associated with it to form the access path of the calibration parameter data block.
[0105] Memory safety checks and data block integrity hash verifications are performed on the access path to ensure that the data block with the initial value of the optimal local parameters has not been tampered with or corrupted.
[0106] The validated initial value data block of optimal local parameters is retrieved from the mapping table and stored in the cache, serving as the original data source for constructing the candidate set of weight coefficients for temperature-sensitive points to be reset. Through the aforementioned precise matching query processing method, the index key values parsed in the previous step are transformed into corresponding initial value data blocks of optimal local parameters, thus achieving the precise initial value acquisition required for the sparse reset of parameters in the thermal error prediction model.
[0107] For example, during the precision machining of mold steel, the index key value contains three dominant vibration mode frequency band identifiers: center frequency 200Hz, energy percentage 0.35, kurtosis rate 0.02; center frequency 315Hz, energy percentage 0.27, kurtosis rate 0.05; and center frequency 480Hz, energy percentage 0.20, kurtosis rate 0.01. The optimal local parameter initial value data block for the corresponding entry in the mapping table contains a vector of temperature sensitive point weight coefficients [0.85, 0.72, 0.68] that matches the X / Y / Z triaxial thermal deformation sensitivity ranking. When performing an exact match query, a field comparison algorithm is used to perform multidimensional comparison of all features of the frequency band combination. The matching status is calculated through a matching criterion function. When the matching result is true, the associated optimal local parameter initial value data block is extracted and loaded into the cache. After this processing, this retrieval only takes 8 milliseconds, successfully locating and retrieving the required local parameters, ensuring the real-time performance and initial value accuracy of the sparse reset process of the thermal error prediction model.
[0108] S5.3: Perform field separation processing on the optimal local parameter initial value data block to extract the initial vector of temperature sensitive point weight coefficients that directly correspond to the relative sorting of the three-dimensional thermal deformation sensitivity of the main axis, thereby generating a set of local parameter seeds to be activated.
[0109] The initial value data block of the optimal local parameters is input to the field parsing module for structured separation, and various parameters in the data block are stored independently according to preset identifier categories.
[0110] Perform matching and filtering on the parameter category labels in the analysis results, and select the set of temperature sensitive point weight coefficients that have a direct correspondence with the three-dimensional thermal deformation sensitivity sorting vector.
[0111] The selected set of weight coefficients is rearranged in order according to their original sequence positions to form an initial vector with a complete structure and stable index.
[0112] Perform data type validation and precision verification on the elements of the initial vector to ensure that it conforms to the double-precision floating-point specification required by the thermal error prediction model.
[0113] The initial vector, after precision verification, is encapsulated into a set of local parameter seeds, which serves as the direct input object for subsequent dimension alignment verification and sparse reset.
[0114] By using field parsing and precision verification, the initial value data block of the optimal local parameters from the previous step is transformed into a set of local parameter seeds that satisfy the structural constraints of the thermal error prediction model, thus achieving a precise correspondence with the three-dimensional thermal deformation sensitivity sorting vector.
[0115] For example, in a high-speed precision machining test of mold steel, the optimal local parameter initial value data block retrieved from the mapping table contains the initial values of the temperature sensitive point weight coefficients corresponding to the three-dimensional sensitivity sorting vector as [0.152, 0.087, 0.193]. This data block is first separated into the temperature sensitive point weight coefficient field by the field parsing module, and then matched and filtered with the direction labels of the three-dimensional sensitivity sorting vector to confirm that the three coefficients are all directly related parameters. Subsequently, they are arranged in the original sequence, and each coefficient is converted into a double-precision floating-point number format, with the value retained to 6 decimal places. After the precision verification is completed, it is encapsulated to form a local parameter seed set [0.152000, 0.087000, 0.193000]. In subsequent steps, this set will enter the dimension alignment module to verify that it is consistent with the number of temperature sensitive point input channels of the thermal error prediction model being 3, ensuring that only the corresponding direction parameters are adjusted during sparse reset. In this scenario, the local parameter seed set is directly applied to the thermal error prediction model, and the compensation effect obtained significantly reduces the mean value of the spindle thermal error residual after machining, greatly improving machining accuracy and model adaptability.
[0116] S5.4: Perform a dimension alignment verification operation based on the local parameter seed set to verify whether the number of weight coefficients in the local parameter seed set to be activated is consistent with the number of temperature-sensitive point input channels in the thermal error prediction model, thereby generating a dimension matching confirmation signal.
[0117] Based on the local parameter seed set, a dimensional description vector containing parameter quantity information is constructed, and the current temperature sensitive point input channel configuration vector is extracted from the thermal error prediction model as an alignment reference object.
[0118] An element counting operation is performed on the dimensional description vector of the local parameter seed set and the temperature sensitive point input channel configuration vector, and the parameter number matching deviation value is obtained by difference calculation.
[0119] The matching deviation value is judged by a threshold comparison method. If the matching deviation value is zero, a logical flag is generated to confirm that the dimension matching condition is met; otherwise, a warning flag is generated to indicate that the matching has failed.
[0120] In the event of a matching failure, the parameter mapping adjustment module is invoked to rearrange or supplement the weight coefficient vector in the local parameter seed set according to the input channel configuration, and the element counting operation is performed again to verify whether the number of adjusted parameters is consistent.
[0121] Based on the logical flag indicating a successful match, a dimension matching confirmation signal is output, which serves as the sole valid trigger condition for subsequent parameter assignment operations.
[0122] By using dimension alignment verification, the local parameter seed set from the previous step is transformed into a weight coefficient quantity index that is completely consistent with the input channel of the thermal error prediction model, thereby ensuring the consistency between the parameters to be activated and the model structure.
[0123] For example, in the high-speed precision machining scenario of mold steel, the local parameter seed set retrieved from the vibration-dominant mode combination mapping table has a dimension of 4, and the corresponding temperature-sensitive point input channel configuration vector dimension of the thermal error prediction model is also 4. In this embodiment, element counting is used. When the number of weight coefficients in the local parameter seed set is 4 and the number of temperature-sensitive point input channels in the error prediction model is also 4, the calculation result matching deviation value is 0, the matching is determined to be successful, and a dimension matching confirmation signal is generated. In another working condition, when the local parameter seed set retrieved from the mapping table has a dimension of 3 and the model input channel dimension is 4, the initial calculation matching deviation value is 1, triggering the mapping adjustment module to supplement a missing weight coefficient and correct the order, and the matching deviation value is calculated again to be 0, confirming successful matching. This embodiment was verified during the machining process, and the verification time does not exceed 2 milliseconds. After successful dimension matching, the model parameter assignment is accurate, avoiding thermal error prediction anomalies caused by inconsistent dimensions, and significantly improving the stability and reliability of the compensation calculation.
[0124] S5.5: In response to the dimension matching confirmation signal, the local parameter seed set is assigned to the corresponding temperature sensitive point weight coefficient variable in the thermal error prediction model to complete the construction of the candidate set of temperature sensitive point weight coefficients to be reset and freeze the remaining irrelevant parameters in the model.
[0125] Based on the dimensional matching confirmation signal, the physical location index of each element in the local parameter seed set to be activated is interactively compared with the index mapping table of the temperature sensitive point input channel inside the thermal error prediction model to obtain a one-to-one corresponding assignment path. The values of each weight coefficient in the local parameter seed set are read sequentially along this assignment path and directly written into the temperature sensitive point weight coefficient variable stored at the corresponding index position in the thermal error prediction model, achieving precise positioning of parameter replacement. During the assignment process, the memory address of the corresponding weight coefficient variable in the model computation graph is locked to ensure that the data writing operation is completed within a single thread, thereby avoiding competition conflicts during multi-threaded parallel operation. A freeze flag is set for non-associated parameter channels in the model, and the model parameter status flag is updated to "locked" to prevent any subsequent gradient update process from modifying their values. After the freeze flag is set, a consistency check is performed on the model's parameter status table to confirm that all candidate sets of temperature sensitive point weight coefficients to be reset are in a "writable" state and all frozen parameters are in a "locked" state, thus completing the dual operations of parameter candidate set construction and non-associated parameter freezing. By using the above-mentioned directional assignment and freezing processing methods, the local parameter seed set of the previous step is accurately transformed into the candidate set of weight coefficients of temperature sensitive points to be reset in the thermal error prediction model, so as to achieve the technical effect of updating the parameters in the thermal deformation sensitive direction in real time while keeping the parameters in other directions stable.
[0126] For example, in a real-time thermal error compensation system for CNC spindles used in high-precision machining of mold steel, when the number of verification parameters for dimension matching confirmation signals equals the number of temperature-sensitive point input channels in the model, the system reads three weight coefficient values from the local parameter seed set: 0.845, 0.732, and 0.690, and assigns them to the corresponding temperature-sensitive point channel index positions in the X, Y, and Z axis directions of the thermal error prediction model. The index sequence recorded in the assignment path mapping table is [2, 5, 8]. In single-threaded mode, the system sequentially writes the above values to the parameter variables corresponding to the memory address offsets. A freeze flag is set for the remaining seven temperature-sensitive point channels in the model to keep the parameters of these channels unchanged during gradient descent calculation. During the freeze status table verification process, the system confirms that the three newly assigned channels are marked as "writable," and the remaining channels are marked as "locked," and outputs a consistency verification pass signal. In this embodiment, the assignment and freeze processing takes 14 milliseconds, and the parameter writing success rate reaches 100%. Verification showed that after the sparse reset operation, the model significantly reduced the thermal error prediction deviation for the current dominant vibration mode combination, and the real-time performance of the compensation calculation remained within 20 milliseconds, meeting the real-time performance requirements of machining for micron-level error compensation.
[0127] Step S6: Based on the measured thermal error residual data within the most recent time window, perform a single-step gradient correction operation on the candidate set of temperature sensitive point weight coefficients to be reset, to generate updated temperature sensitive point weight coefficients, and complete the sparse reset operation of the thermal error prediction model parameters. Specifically, this includes: S6.1: Obtain the measured thermal deformation data of the spindle collected by the laser interferometer or displacement sensor and the predicted thermal deformation data output by the thermal error prediction model within the most recent preset time window, and perform difference calculation processing on the measured thermal deformation data of the spindle and the predicted thermal deformation data to generate a thermal error residual sequence characterizing the current prediction deviation of the model.
[0128] The measured thermal deformation data of the main shaft collected by a laser interferometer or displacement sensor within the most recent preset time window is obtained. The original analog signal is subjected to high-speed analog-to-digital conversion and physical dimension conversion is performed in combination with the equipment calibration coefficient to generate a measured thermal deformation numerical sequence for the X, Y and Z axes.
[0129] The predicted thermal deformation data output by the thermal error prediction model within the corresponding time window is read from the model cache or real-time solution module and subjected to structural dimension alignment processing to ensure a one-to-one correspondence between the predicted data sequence and the measured data sequence in terms of time index and axial component.
[0130] Based on the aligned measured and predicted data, a sample index loop is performed to calculate the thermal error residual value at each time point and in each spatial direction, using the following formula: Where e i,k Let T be the residual value of the i-th time sample in the k-th spatial direction. i,k P represents the measured thermal deformation value. i,k To predict thermal deformation values.
[0131] The residual set is processed by time-series stacking and matrixing to construct a thermal error residual matrix from the residuals of all time samples and spatial directions, which serves as the direct input data object for the subsequent construction of the loss function.
[0132] By calculating the difference and matrixing the data, the measured and predicted thermal deformation data obtained in the previous step are transformed into a thermal error residual sequence that characterizes the current prediction deviation of the model, thereby achieving a quantitative description of the model's instantaneous deviation.
[0133] For example, within a six-minute cycle of precision machining of mold steel, the measured thermal deformation data collected by the laser interferometer at a sampling frequency of 0.5 seconds ranges from 0.4μm to 2.6μm, 0.3μm to 2.2μm, and 0.5μm to 3.1μm on the X, Y, and Z axes, respectively. The predicted data output by the thermal error prediction model at the same sampling point are 0.5μm to 2.4μm, 0.4μm to 2.0μm, and 0.6μm to 2.9μm, respectively. After aligning the time index, difference calculations are performed in the three axes for each sampling moment. For example, for the 12th sampling point, the measured value of 2.1μm and the predicted value of 1.9μm on the X axis have a residual of 0.2μm. The residual matrix formed after performing the calculation on all sampling points has a mean deviation of approximately 0.18μm on the X axis, 0.14μm on the Y axis, and 0.21μm on the Z axis. In this scenario, the generated residual matrix can fully reflect the distribution of prediction bias on each axis, providing high-precision bias input for subsequent single-step gradient correction, thereby significantly improving the accuracy and real-time performance of the corrected prediction in parameter sparse reset.
[0134] S6.2: Construct a scalar loss function based on the thermal error residual sequence, and perform partial derivative calculation on the scalar loss function with respect to the weight coefficients of the temperature sensitive points to be reset in the candidate set of temperature sensitive point weight coefficients, so as to generate a local gradient vector indicating the direction and magnitude of parameter adjustment.
[0135] The thermal error residual sequence is processed by segmentation and aggregation to form a centralized residual vector for single-step optimization, ensuring a one-to-one correspondence between this vector and the candidate set of weight coefficients for temperature-sensitive points to be reset along the index dimension. The difference square operation is performed on each element of the centralized residual vector to characterize the deviation energy feature between the measured thermal deformation and the model-predicted thermal deformation, and this is incorporated into the loss evaluation system. A scalar loss function is constructed based on the difference square result, using the mean square error form, and the residual energy is normalized with respect to the sample size through fractional operations. Partial derivatives of the scalar loss function are calculated with respect to each coefficient to be reset in the candidate set of weight coefficients for temperature-sensitive points. The chain rule is used to decompose the nested calculation relationships of difference, square, and weighted summation in the loss function, forming a local gradient vector. This gradient vector is arranged in index order and output for subsequent adaptive learning rate scaling and weight correction calculations. By constructing a loss function based on residual energy and solving for partial derivatives, the residual sequence from the previous step is transformed into a local gradient vector that clearly indicates the direction and magnitude of parameter adjustment, thereby achieving quantitative optimization of the weight coefficients of the temperature-sensitive points to be reset.
[0136] For example, in the actual machining scenario of a precision-machined spindle for mold steel, the time window is set to 10 seconds, the number of residual samples n within the window is 500, and the measured thermal deformation value range is... The predicted thermal deformation value range is from 3μm to +3μm. The residual energy ranges from 2.8 μm to +2.9 μm. After squared difference processing, the mean residual energy is approximately 0.04 μm², and a scalar loss function is constructed using normalization. For the three coefficients to be reset in the candidate set of temperature-sensitive point weight coefficients, gradient values are calculated, with the first, second, and third gradients being 0.0065, ... The gradient signs of 0.0042 and 0.0058 clearly indicate the direction in which the parameters should be corrected; positive values correspond to increasing weights, and negative values correspond to decreasing weights. In this scenario, the gradient vector output from this step is directly incorporated into subsequent learning rate decay and weight correction, enabling the model to quickly approach the optimal parameter configuration in a single iteration. This significantly improves the accuracy and robustness of thermal error prediction in the compensation execution unit.
[0137] S6.3: The local gradient vector is scaled using an adaptive learning rate decay strategy to generate a weighted correction increment containing a dynamic step size factor, ensuring that the optimal solution can be quickly approximated in a single iteration while avoiding parameter oscillations.
[0138] Based on the local gradient vector input obtained from the preceding sub-steps, the adaptive learning rate decay strategy module is invoked to dynamically adjust the iteration step size coefficient.
[0139] The absolute values of each component of the local gradient vector are compared with a preset stability threshold to determine whether the learning rate decay factor update mechanism is triggered.
[0140] When the update mechanism is triggered, an iterative step size adjustment function is constructed based on the statistical variance of the thermal error residual, and the bias sensitivity is reduced by multiplying the initial learning rate by a decay factor.
[0141] The gradient after attenuation is scaled using the following mathematical formula: Where η is the initial learning rate, g is the local gradient component, λ is the decay coefficient, and k is the iteration number index.
[0142] The weighted correction increment output by the formula is used to replace the gradient values at the corresponding positions in the candidate set to construct the final correction vector containing the dynamic step size factor.
[0143] This adaptive scaling method transforms the local gradient vector from the previous step into a weighted correction increment that combines fast convergence with steady-state stability, achieving the desired technical effect of approximating precise parameter values in a single iteration while avoiding weight oscillations.
[0144] For example, under high-speed precision machining conditions of mold steel, the variance of the thermal error residual sequence in the most recent 10 seconds is 2.5 μm², the initial learning rate η is set to 0.05, the attenuation coefficient λ is set to 0.01, the number of iterations k is 4, and the local gradient vector component g is 0.12. The weighted correction increment calculated according to the above formula is 0.006. This value is used to update the weight coefficients of the corresponding temperature-sensitive points. After sparse reset, the model prediction residual is significantly reduced, the compensation calculation delay is controlled within 20 ms, and the spindle machining accuracy is improved to a stable range at the micrometer level, adapting to the thermal-mechanical coupling changes caused by sudden changes in the vibration spectrum.
[0145] S6.4: Perform an algebraic superposition operation on the weighted correction increment and the temperature sensitive point weight coefficients to be reset in the candidate set of temperature sensitive point weight coefficients to generate the updated temperature sensitive point weight coefficients after single-step fast convergence.
[0146] Based on the weighted correction increment dataset scaled using an adaptive learning rate decay strategy, a dual-channel algebraic operation path is established for each parameter to be reset in the candidate set of temperature-sensitive point weight coefficients, ensuring consistency between the correction increment and the corresponding parameter in numerical space and index dimension. Element-wise accumulation is performed on each correspondence, applying both the sign and magnitude of the correction increment to the existing weight coefficients to achieve a single-step displacement in the direction of the prediction error gradient. The accumulation result is rounded or truncated using a floating-point precision control module to eliminate accumulated calculation errors. The algebraic superposition of the weighted correction increment and the temperature-sensitive point weight coefficients is performed using the following formula: Where w is the weight coefficient of the temperature sensitive point to be reset. w represents the corresponding weighted correction increment, and w' represents the updated temperature-sensitive point weight coefficients. Boundary condition checks are performed on the generated parameter vector after superposition, remapping coefficients exceeding physically reasonable ranges to allowable intervals according to upper and lower limits to avoid model prediction instability caused by excessive instantaneous gradient magnitudes. The corrected output vectors of each parameter are then encapsulated to form a set of updated temperature-sensitive point weight coefficients that have achieved rapid single-step convergence. Through the above processing method, the weighted correction increments and candidate weight coefficients from the previous step are transformed into the latest model parameters that conform to the current thermo-mechanical coupling state, achieving rapid synchronization of the thermal error prediction model at the local parameter level.
[0147] For example, in a high-precision mold steel processing scenario, the candidate set of weight coefficients for the current temperature-sensitive points has a length of 3, with initial values of 0.85, 1.12, and 0.96, and weighted correction increments of -0.04, 0.03, and -0.02, respectively. Algebraic superposition operations yield updated values of 0.81, 1.15, and 0.94, respectively. The first channel is calculated to be 0.81, the second channel to be 1.15, and the third channel to be 0.94. Boundary condition checks show that none of the three updated values exceed 0.5. Within the allowable range of 1.5, the output is directly encapsulated. This parameter set significantly reduces the prediction residual after model loading, stabilizes the execution delay of thermal error compensation commands within 20 milliseconds, and demonstrates that the compensation effect in the grating ruler feedback is that the machining path deviation is nearly eliminated, meeting the micron-level accuracy requirements.
[0148] S6.5: Replace the corresponding historical weight parameters in the thermal error prediction model with the updated temperature-sensitive point weight coefficients to complete the sparse reset operation of the thermal error prediction model parameters for the current dominant vibration mode combination, so that the model state is synchronized to the latest thermo-mechanical coupling condition in real time.
[0149] Using the updated temperature-sensitive point weight coefficient vector output from the preceding sub-step S6.4 as input, a targeted replacement process is performed on the historical temperature-sensitive point weight parameters stored internally in the thermal error prediction model. An index mapping relationship is established between the updated temperature-sensitive point weight coefficients and the parameter units associated with the current corresponding input channel of the model to ensure that the replacement operation only applies to the parameter set directly related to the thermal deformation sensitive direction of the current dominant vibration mode combination. Type consistency and numerical range checks are performed on the parameter values involved in the replacement process. By comparing the numerical domain of the updated weight coefficients with the effective weight range defined by the model, abnormal values exceeding physical rationality limits are excluded and necessary truncation or correction is performed. The validated updated temperature-sensitive point weight coefficients are directly loaded into the weight register unit of the model's computational core, and all unrelated parameters in the model are simultaneously frozen to prevent changes in unrelated parameters due to external interference in subsequent calculation stages. Consistency verification is performed on the thermal error prediction model state after the replacement. By calculating the difference between the thermal error prediction output at the moment of replacement and the prediction output before the update, it is ensured that the replacement action does not cause damage to the model's numerical stability. Through the above-mentioned targeted replacement and freezing process, the updated temperature-sensitive point weight coefficients after single-step gradient correction are synchronized to the thermal error prediction model, so that the parameter set of the model under the current vibration dominant mode combination condition is matched with the latest thermo-mechanical coupling state in real time, realizing the sparse reset technology effect of the thermal error prediction model parameters.
[0150] For example, in the scenario of precision machining of mold steel, let the current dominant vibration mode combination be [Mode A, Mode B], with the corresponding heat deformation sensitive directions being the X-axis and Y-axis. The updated temperature sensitive point weight coefficient vector output by S6.4 is [0.812, 0.647], which is assigned to the weight units of the X-axis and Y-axis temperature channels in the model. Before the replacement, the original weight parameters of the model are [0.780, 0.655]. The replacement process first performs a numerical range verification, setting the effective weight range as [0.5, 1.0]. After the update, all weights are within the range and do not require correction. The updated weights are loaded into the model register unit, and the Z-axis channel and all additional parameters unrelated to the mode combination are frozen. In the consistency verification stage, let the model predict the heat deformation value before replacement as 3.12μm, and the instantaneous prediction value after replacement as 3.14μm, with a difference of only 0.02μm, indicating that the replacement process is stable. Finally, the model is updated to the latest state, enabling it to generate accurate thermal error compensation for the current operating conditions in the subsequent S7 step by combining real-time temperature input, significantly improving the real-time performance and robustness of the compensation.
[0151] Step S7: The updated temperature-sensitive point weight coefficients are input into the thermal error prediction model and calculated using real-time temperature data to generate real-time thermal error compensation. Specifically, this includes: S7.1: Obtain the updated temperature-sensitive point weight coefficients generated by the previous sub-steps and the original analog voltage signals output by the temperature sensors deployed at the key temperature measurement points of the spindle. Perform high-speed analog-to-digital conversion and linear calibration processing on the original analog voltage signals to generate a real-time spindle temperature data vector with physical temperature dimensions.
[0152] S7.2: Perform a multi-dimensional feature expansion operation based on the real-time spindle temperature data vector, and construct a temperature time series feature matrix containing historical temperature states by introducing a time delay term, so as to eliminate the heat conduction hysteresis effect and establish the dynamic input object of the thermal error prediction model.
[0153] Using the real-time spindle temperature data vector obtained from the preceding sub-steps as input, and based on the physical characteristic of time lag in heat conduction, a multi-dimensional time-series feature matrix containing historical temperature states is constructed. A delay index generation operation is performed on the real-time spindle temperature data vector, establishing multiple delay sequences for each temperature channel within the data vector, with each segment representing a sampling period. A sliding window mechanism is used to extract historical temperature values corresponding to the delay step size, forming a preliminary delay feature set. Matrix stacking is then performed on the preliminary delay feature set, arranging the delayed temperature values from different times sequentially along the column direction, so that each row corresponds to temperature data at different delay step sizes at the same time point, thus establishing a two-dimensional delay matrix reflecting the slow-changing trend of heat conduction. Standardization is performed on the two-dimensional delay matrix, linearly normalizing each delayed temperature value according to the calibration range of its channel, eliminating dimensional differences and compressing the numerical range to a unified interval. Feature interaction generation operations are performed on the normalized two-dimensional delay matrix, constructing higher-order feature terms reflecting the thermal coupling effects between different temperature channels through polynomial expansion or product combination, forming the final temperature time-series feature matrix.
[0154] By using delayed index generation, matrix stacking, standardization, and feature interaction processing, the real-time temperature data vector from the previous step is transformed into a temperature time-series feature matrix representing the heat conduction hysteresis effect and temperature coupling relationship, thereby realizing the construction of dynamic input objects for the thermal error prediction model.
[0155] For example, in a high-precision machining scenario for mold steel, the sampling period of temperature sensors deployed at key locations on the spindle bearing housing and housing is set to 10 milliseconds. The real-time spindle temperature data vector contains 6 temperature channels. In the delay index generation operation, delay steps are set to 1, 3, 5, and 10 sampling periods. Historical temperature values are extracted for each channel to form a preliminary delay feature set. After matrix stacking, a 6-row × 4-column two-dimensional delay matrix is obtained. Standardization is performed linearly according to the calibrated temperature range of each channel (e.g., 20℃ to 80℃), mapping the data range to the [0,1] interval. The feature interaction generation operation uses a second-order polynomial expansion, multiplying the normalized delay temperature values of any two channels to generate interactive features, resulting in a total of 36 combined feature terms. The final temperature time-series feature matrix contains 24 original delay features and 36 interactive features, totaling 60 features, which are input into the thermal error prediction model. During verification, this matrix significantly improves the model's dynamic adaptability to heat conduction hysteresis and maintains the stability and accuracy of the compensation amount during machining.
[0156] S7.3: The updated temperature-sensitive point weight coefficients are used to perform a weighted summation operation on the temperature time-series feature matrix. The eigenvalues of each temperature channel and their corresponding weight coefficients are algebraically multiplied and accumulated to generate a scalar quantity representing the comprehensive thermal deformation driving potential of the spindle under the current thermo-mechanical coupling condition.
[0157] The updated temperature-sensitive point weight coefficients and temperature time-series feature matrix generated in the preceding sub-steps are used as input objects. The algebraic product operation between the feature value of each temperature channel and the corresponding weight coefficient is performed to form a single-channel thermal deformation driving force.
[0158] The product results of all temperature channels are subjected to column vector summation, and the thermal deformation components of different channels are accumulated to form the preliminary composite value of the overall thermal deformation driving potential.
[0159] During the accumulation process, a rounding limit is implemented on the summation result of each accumulation step based on the floating-point precision control mechanism to prevent calculation drift caused by numerical accumulation.
[0160] The initial synthesized values are standardized to eliminate the influence of differences in the amplitude range of different temperature sensors on the final driving potential scalar.
[0161] Based on the standardized numerical values, a comprehensive thermal deformation driving potential scalar is constructed as the sole scalar input reflecting the current thermo-mechanical coupling condition.
[0162] The scalar calculation of the comprehensive thermal deformation driving potential is achieved using the following formula: Among them, T iw represents the eigenvalue of the i-th channel of the temperature time series feature matrix. i For the updated weighting coefficients corresponding to the temperature-sensitive points, F is the scalar of the comprehensive thermal deformation driving potential.
[0163] By using the weighted summation method described above, the result of the previous step is transformed into comprehensive thermal deformation driving potential data that quantifies the current thermal-mechanical coupling condition of the spindle, thus enabling accurate input for subsequent nonlinear transformation of the mapping function.
[0164] For example, in a high-precision machining scenario for mold steel, the temperature time-series feature matrix constructed by the outputs of six temperature sensors deployed on the spindle via step S7.2 has the eigenvalue matrix [35.2, 34.7, 33.9, 36.1, 32.8, 31.5], and the updated temperature-sensitive point weight coefficients are [0.012, 0.009, 0.015, 0.011, 0.008, 0.010]. Executing the formula, the product results are obtained sequentially [0.4224, 0.3123, 0.5085, 0.3971, 0.2624, 0.315], with a cumulative sum of 2.2177. After standardization, the comprehensive thermal deformation driving potential scalar is approximately 2.21. The driving potential scalar input is fed into the preset thermal deformation mapping function in step S7.4, which successfully generates a set of preliminary thermal error prediction values containing X / Y / Z three-axis components. These values are used in the subsequent coordinate system alignment in S7.5 and closed-loop compensation in S8. After the actual compensation is performed, the machining accuracy of the machine tool is significantly improved to a stable range at the micrometer level.
[0165] S7.4: Based on the comprehensive thermal deformation driving potential scalar input, nonlinear transformation processing is performed in the preset thermal deformation mapping function. The linear superposition result is mapped to the actual deformation range of the principal axis three-dimensional space through the activation function to generate a preliminary set of thermal error prediction values containing X / Y / Z three-axis component information.
[0166] The comprehensive thermal deformation driving potential scalar output from the preceding sub-step S7.3 is used as the input variable of the nonlinear mapping function. The thermal deformation mapping function, which has been calibrated offline and solidified into the model, is called to establish the calculation path from the driving potential to the three-dimensional thermal deformation of the principal axis.
[0167] The comprehensive thermal deformation driving potential scalar is subjected to a split-axis decomposition process, and it is projected onto the driving components in the X-axis, Y-axis and Z-axis directions respectively to form an independent set of axial driving potential input values, ensuring that subsequent nonlinear transformations can be calculated separately for the sensitivity characteristics of different axes.
[0168] For each axial driving potential input value, the corresponding nonlinear mapping sub-function is invoked. The sub-function adopts a calibrated polynomial plus Gaussian function hybrid structure. The polynomial part describes the low-order thermoelastic response trend, and the Gaussian function part captures the high-order nonlinear characteristics.
[0169] The polynomial part of the calculation results and the Gaussian function part of the calculation results are algebraically superimposed to obtain the thermal deformation prediction value for each axis, and integrated to generate a preliminary set of thermal error prediction values containing X / Y / Z three-axis component information.
[0170] By using nonlinear transformation processing, the scalar of the comprehensive thermal deformation driving potential from the previous step is transformed into triaxial componentized thermal deformation prediction data, thereby achieving an accurate mapping from the thermo-mechanical coupling driving potential to the actual deformation range.
[0171] S7.5: Perform coordinate system alignment and unit normalization processing on the preliminary thermal error prediction value set, convert it into micron-level displacement deviation data that conforms to the interpolation command format of the CNC numerical control system, and finally generate real-time thermal error compensation amount for the current spindle thermal deformation trend.
[0172] Furthermore, the present invention also includes step S8, which involves driving the CNC numerical control system to perform axial displacement correction based on the real-time thermal error compensation amount, so as to achieve closed-loop real-time compensation for spindle thermal error during mold steel processing. Specifically, this includes: S8.1: Obtain the real-time thermal error compensation data stream output by the thermal error prediction model, and perform coordinate axis mapping analysis on the real-time thermal error compensation data stream to generate a set of three-dimensional axial displacement correction target values containing X-axis, Y-axis and Z-axis component information.
[0173] S8.2: Based on the three-dimensional axial displacement correction target value set, read the current actual position feedback pulse count of each axis of the CNC numerical control system, and calculate the difference between the three-dimensional axial displacement correction target value set and the actual position feedback pulse count of each axis to generate an axial displacement deviation correction instruction sequence to be executed.
[0174] S8.3: Perform smoothing filtering and speed look-ahead planning processing on the axial displacement deviation correction command sequence to generate smooth interpolation motion trajectory parameters that conform to the dynamic response characteristics of the servo motor, so as to prevent the machine tool mechanical structure from vibrating due to sudden command.
[0175] The sequence of axial displacement deviation correction commands to be executed is input to the smoothing filter module. Based on the sampling period of the interpolated motion trajectory and the dynamic response time constant of the servo motor, the cutoff frequency of the low-pass filter is set to eliminate high-frequency spikes while ensuring trajectory fidelity. Second-order derivative rate of change analysis is performed on the filtered displacement correction data stream to filter out outliers with rates of change exceeding the preset servo tolerance threshold and replace them with interpolated values to suppress the risk of mechanical shock caused by sudden changes. The smoothed displacement correction data stream is input to the velocity look-ahead planning module. Combining the current position feedback of each axis in the CNC system with the set maximum acceleration and maximum velocity constraints, the target velocity and position of each axis within a preset time window are calculated. A trajectory generation formula based on acceleration constraints is used to convert the displacement correction amount into a piecewise acceleration curve. Based on the above velocity curves and cumulative displacement values, interpolation point insertion operations are performed to generate a set of smooth interpolated motion trajectory parameters for servo control, ensuring continuous acceleration changes for each axis and avoiding acceleration abrupt changes. By combining smoothing filtering and speed look-ahead planning, the axial displacement correction command sequence from the previous step is transformed into smooth interpolation motion trajectory parameters that conform to the dynamic response characteristics of the servo motor, thereby achieving vibration suppression of the mechanical structure and improvement of motion stability.
[0176] For example, during the precision machining of mold steel, for the axial displacement deviation correction command sequence generated by the real-time thermal error compensation, the low-pass filter cutoff frequency is set to 50Hz, the sampling period is 1ms, and the servo motor time constant is 5ms. After filtering, the high-frequency components of the displacement correction are effectively suppressed. Anomaly point elimination and interpolation replacement are performed using a second derivative rate of change threshold of 0.005mm / ms² to eliminate instantaneous impacts caused by emergency braking or environmental disturbances. In the speed look-ahead planning module, the maximum acceleration is set to 0.3m / s² and the maximum speed to 0.1m / s. The target speed and position of each axis within the next 5ms are calculated, and the speed curve is derived using the acceleration curve formula to ensure continuous speed command changes. Interpolation points are generated by combining the cumulative displacement value, resulting in a set of smooth interpolation motion trajectory parameters for the three axes. During servo drive execution, the continuous acceleration changes of each axis are verified, mechanical vibration is significantly reduced, and the machining path deviation is controlled within 2μm, effectively improving the dimensional accuracy and surface quality of mold steel machining.
[0177] S8.4: The smooth interpolation motion trajectory parameters are used to drive the servo driver of the CNC numerical control system to adjust the current loop and position loop control signals of each feed axis motor, so as to output a precise motor torque control quantity and drive the mechanical transmission components to generate the corresponding physical displacement.
[0178] S8.5: Monitor the feedback position information of each feed axis grating ruler after the motor torque control, and compare and verify the feedback position information of each feed axis grating ruler with the original machining path theoretical coordinates to confirm that the closed-loop real-time compensation action of the spindle thermal error has been completed and reached the preset accuracy threshold.
[0179] The feedback position information of each feed axis grating ruler generated after the motor torque control quantity is output by the servo driver is processed with high precision. The feedback grating ruler encoding signal of each axis is converted into digital displacement data by a high-speed analog-to-digital converter and cached in the displacement monitoring queue.
[0180] Clock synchronization and timestamp calibration correction are performed on the displacement data of each axis in the displacement monitoring queue. Cross-axis sampling delay is eliminated by comparing the system timing signal with the batch trigger time, thereby constructing a multi-axis feedback position vector with strict time consistency.
[0181] Based on the multi-axis feedback position vector and the original machining path theoretical coordinate data stored in the CNC system register, a coordinate system alignment operation is performed to convert the two to a unified machine tool Cartesian coordinate system, ensuring that the comparison process is not affected by differences in the definition of different coordinate systems.
[0182] By using the difference calculation formula, component-by-component difference calculations are performed on each axis to generate a multi-axis deviation sequence that represents the positional deviation of the principal axis.
[0183] The absolute value and maximum value extraction processing is performed on the multi-axis deviation sequence to obtain the absolute deviation peak value of each axis in the current state, and then logically compared with the preset accuracy threshold library to determine whether the deviation has been reduced to the target range after thermal error compensation.
[0184] Based on the judgment result, a closed-loop compensation status completion flag is marked, and the flag and the current deviation data are written into the process quality monitoring log to realize the real-time verification of the spindle thermal error compensation effect.
[0185] Through the above continuous processing method, the physical displacement feedback after the servo execution in the previous step is transformed into quantifiable accuracy verification data, thereby realizing closed-loop detection and compensation effect confirmation of multi-axis position error.
[0186] For example, in a high-precision machining scenario for mold steel, a grating ruler sensor with a resolution of 0.1μm is deployed along the X, Y, and Z axes, with a sampling frequency set to 2kHz. The collected data is converted into a Cartesian coordinate system position vector after clock synchronization. For instance, if the theoretical coordinates of the machining path are 250.000mm for the X-axis, 150.000mm for the Y-axis, and 100.000mm for the Z-axis, and the feedback positions are 250.002mm for the X-axis, 149.999mm for the Y-axis, and 100.000mm for the Z-axis, then a difference calculation is performed to obtain the deviation vector [+0.002mm, -0.001mm, 0.000mm], with an absolute deviation peak of 0.002mm. This deviation peak is compared with a preset accuracy threshold of 0.003mm. If all axis deviations are determined to be less than the accuracy threshold, the closed-loop compensation status is marked as complete, and the compensation execution time, deviation value, and machining batch number are recorded in the quality monitoring log, enabling immediate confirmation of the compensation effect. Under different working conditions within the processing batch, the system can maintain the deviation within 0.002mm using the above methods, which significantly improves the stability of the processing dimensions and the robustness of the compensation system.
[0187] For those skilled in the art, various other corresponding changes and modifications can be made based on the technical solutions and concepts described above, and all such changes and modifications should fall within the protection scope of the claims of this invention.
[0188] Unless otherwise defined, the technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application pertains. The terms “first,” “second,” “third,” and similar terms used in this patent application specification and claims do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms “an” or “a” and similar terms do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms “comprising” or “including” and similar terms mean that the elements or objects preceding “comprising” or “including” encompass the elements or objects listed following “comprising” or “including” and their equivalents, and do not exclude other elements or objects. The “multiple” mentioned in the embodiments of this application refers to two or more. A and / or B indicate three possibilities: A; B; and A and B.
[0189] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for real-time compensation of thermal error in CNC spindles for mold steel machining, incorporating vibration spectrum analysis, characterized in that... Includes the following steps: S1: Acquire the original vibration signal and perform short-time Fourier transform processing on the original vibration signal to generate a time-frequency energy matrix; S2: Based on the time-frequency energy matrix, perform modal energy clustering analysis to identify the dominant vibration mode frequency band and extract the vibration spectrum feature vector; S3: Construct a mapping table between the vibration dominant mode combination and the thermal deformation response direction, and use the vibration dominant mode frequency band combination in the vibration spectrum feature vector as the index key to establish a thermal error prediction model; S4: Perform abrupt change detection calculation on the vibration spectrum feature vector, and use the calculation results to make a judgment and generate a state transition trigger signal; S5: In response to the state transition trigger signal, retrieve the initial value of the local parameter corresponding to the current vibration dominant mode frequency band combination according to the mapping table of vibration dominant mode combination and thermal deformation response direction, and determine the initial value of the local parameter as a candidate set of temperature sensitive point weight coefficients to be reset; S6: Based on the measured thermal error residual data within the most recent time window, perform a single-step gradient correction operation on the candidate set of temperature sensitive point weight coefficients to be reset, so as to generate updated temperature sensitive point weight coefficients and complete the sparse reset operation of thermal error prediction model parameters. S7: Input the updated temperature-sensitive point weight coefficients into the thermal error prediction model and solve them in combination with real-time temperature data to generate real-time thermal error compensation.
2. The method for real-time compensation of thermal error of CNC spindle in mold steel machining according to claim 1, characterized in that, The process after S7 also includes: S8: Based on the real-time thermal error compensation amount, the CNC numerical control system is driven to perform axial displacement correction action to achieve closed-loop real-time compensation for spindle thermal error during mold steel processing.
3. The method for real-time compensation of thermal error of CNC spindle in mold steel machining according to claim 1, characterized in that, The S3 specifically includes: The original historical vibration signal sequence and the corresponding measured data sequence of the three-dimensional thermal deformation of the main shaft are obtained. The original historical vibration signal sequence is processed by short-time Fourier transform to generate a set of historical time-frequency energy matrices. The measured data sequence of the three-dimensional thermal deformation of the main shaft is processed by temperature-deformation correlation analysis to screen out several key temperature-sensitive point location identifiers. Based on the historical time-frequency energy matrix set, modal energy clustering analysis is performed. For each set of working condition data, the dominant historical vibration mode frequency band combination is identified, and the historical energy proportion, historical centroid frequency offset and historical envelope kurtosis change rate in each frequency band are extracted as historical vibration spectrum feature vectors, thereby generating a historical vibration state sample library containing working condition labels. Using the historical vibration spectrum feature vector in the historical vibration state sample library and the measured thermal deformation data corresponding to the key temperature sensitive point location identifier, a multivariate regression modeling calculation is performed to quantify the influence weight of each historical vibration dominant mode frequency band combination on the thermal deformation sensitivity of the principal axis in the three directions of X-axis, Y-axis and Z-axis, so as to generate a three-dimensional sensitivity ranking vector characterizing the coupling strength between vibration mode and thermal deformation direction. Based on the three-dimensional sensitivity sorting vector, the optimal parameter inversion derivation process is performed. For each unique combination of historical dominant vibration mode frequency bands, the set of initial values of local temperature sensitive point weight coefficients is traversed and searched to generate local parameter initial value data blocks. The historical dominant vibration mode frequency band combination is encapsulated as an index key value, and the corresponding local parameter initial value data block and the three-dimensional sensitivity sorting vector are used as associated values. A hash mapping table construction operation is performed to generate a final mapping table of dominant vibration mode combination and thermal deformation response direction that can be used for online real-time retrieval, and a thermal error prediction model is constructed.
4. The method for real-time compensation of thermal error of CNC spindle in mold steel machining according to claim 1, characterized in that, S5 specifically includes: parsing the received state transition trigger signal to extract the dominant vibration mode frequency band combination identifier at the current moment, thereby generating an index key value for mapping table retrieval.
5. The method for real-time compensation of thermal error of CNC spindle in mold steel machining according to claim 4, characterized in that, S5 specifically includes: performing a precise matching query operation in the vibration dominant mode combination and thermal deformation response direction mapping table based on the index key value to locate the calibration record entry of the vibration dominant mode frequency band combination identifier, thereby obtaining the associated local parameter initial value data block.
6. The method for real-time compensation of thermal error of CNC spindle in mold steel machining according to claim 5, characterized in that, S5 further includes: performing field separation processing on the local parameter initial value data block to extract the initial vector of the weight coefficient of the temperature sensitive point, thereby generating a set of local parameter seeds to be activated.
7. The method for real-time compensation of thermal error of CNC spindle in mold steel machining according to claim 6, characterized in that, S5 further includes: performing a dimension alignment verification operation based on the local parameter seed set to verify whether the number of weight coefficients in the local parameter seed set to be activated is consistent with the number of temperature-sensitive point input channels in the thermal error prediction model, thereby generating a dimension matching confirmation signal.
8. The method for real-time compensation of thermal error of CNC spindle in mold steel machining according to claim 7, characterized in that, S5 further includes: in response to the dimension matching confirmation signal, assigning the local parameter seed set to the corresponding temperature sensitive point weight coefficient variable in the thermal error prediction model, so as to complete the construction of the candidate set of temperature sensitive point weight coefficients to be reset and freeze the remaining irrelevant parameters in the model.
9. The method for real-time compensation of thermal error of CNC spindle in mold steel machining according to claim 1, characterized in that, S6 specifically includes: acquiring measured spindle thermal deformation data and predicted thermal deformation data output by the thermal error prediction model, performing difference calculation on the measured spindle thermal deformation data and the predicted thermal deformation data to generate a thermal error residual sequence characterizing the current prediction deviation of the model.
10. The method for real-time compensation of thermal error of CNC spindle in mold steel machining according to claim 9, characterized in that, S6 further includes: constructing a scalar loss function based on the thermal error residual sequence, and performing partial derivative calculations on the scalar loss function with respect to the weight coefficients of the temperature sensitive points to be reset in the candidate set of temperature sensitive point weight coefficients, so as to generate a local gradient vector indicating the direction and magnitude of parameter adjustment.