A spindle thermal error compensation system and method
By combining an eddy current measurement module and a multi-level threshold fault-tolerant sampling algorithm, high-precision automated compensation for the thermal error of CNC machine tool spindles is achieved, solving the problems of poor adaptability and high energy consumption in existing technologies, and improving machining accuracy and consistency.
Patent Information
- Application Number
- CN202611577925.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-13
- Publication Date
- 2026-11-17
AI Technical Summary
Existing CNC machine tool spindle thermal error compensation technology suffers from poor adaptability, high energy consumption, and weak mass production compatibility. It cannot adapt to complex machining conditions with varying speeds and loads, and it is difficult to meet the precision stability requirements of continuous mass production of precision parts.
The spindle thermal deformation is directly measured using an eddy current measurement module, coupled with a multi-level threshold fault-tolerant sampling algorithm. Measurement compensation is automatically triggered by tool change commands, enabling real-time compensation without human intervention. Data processing and compensation amount writing are performed using a macro program control module and a CNC main control module.
It achieves high-precision and highly automated spindle thermal error compensation, adapts to different working conditions, improves the precision machining accuracy and batch size consistency of CNC machine tools, and reduces equipment modification costs and maintenance difficulties.
Smart Images

Figure CN123103443A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of precision machining error compensation technology for CNC machine tools, and in particular to a spindle thermal error compensation system and method. Background Technology
[0002] With the increasing demands for precision and dimensional consistency in parts manufacturing in the high-end equipment manufacturing sector, stable machining capabilities at the micron and sub-micron levels have become core performance indicators for high-speed CNC machine tools. CNC machine tool machining errors mainly include geometric errors, load deformation errors, cutting force errors, and thermal errors. Among these, thermal errors account for 40% to 70% of the total machining errors, and can reach over 75% under high-speed spindle conditions, making it a core bottleneck restricting the improvement of precision machining accuracy.
[0003] During the operation of a high-speed spindle, the coupling effect of multiple heat sources, such as electromagnetic heating of the motor, high-speed friction of the bearings, agitation and loss of lubricating oil, and backflow of cutting heat, can cause uneven temperature rise in the spindle body and surrounding structures. This can lead to thermal deformation problems such as axial elongation, radial displacement, and axis tilting of the spindle, ultimately resulting in production defects such as tool positioning zero point offset, workpiece contour dimension out-of-tolerance, and poor batch processing consistency.
[0004] Currently, industry solutions for suppressing and compensating for machine tool spindle thermal errors can be categorized into three main types: passive thermal suppression technology, indirect modeling compensation technology based on temperature sensing, and active compensation technology based on direct measurement using displacement sensors. These technologies exhibit significant differences in theoretical maturity, industrial application scenarios, and inherent limitations. Their specific application status is as follows: Passive thermal suppression is a fundamental method commonly found in high-end machine tools. Its core idea is to reduce temperature rise and slow down thermal deformation accumulation at the source, without requiring real-time correction of machining coordinates. Existing passive thermal suppression solutions mainly include four categories: constant temperature workshop temperature control, forced liquid cooling / oil-air lubrication of the spindle, low thermal expansion coefficient structural design, and long-term preheating before startup. For example, current technologies typically use forced circulation cooling and thermally symmetrical housing structures as standard configurations; or they incorporate built-in cooling water channels for high-end spindles to control the steady-state temperature rise of the spindle below 8°C. However, these passive thermal suppression solutions have significant shortcomings: they can only slightly alleviate the spindle temperature rise and cannot effectively counteract the dynamic thermal expansion of the spindle in real time; under conditions of frequent spindle speed changes and intermittent cutting, the spindle axis will still experience a dynamic drift of 5~30μm; at the same time, the infrastructure and maintenance costs of constant temperature workshops and high-power cooling systems are high, and the preheating process before startup significantly reduces equipment uptime, failing to meet the long-term, uninterrupted submicron-level mass production requirements of fields such as aerospace and optical components. Therefore, existing passive heat suppression technology has defects such as poor adaptability, high energy consumption, weak mass production compatibility, and inability to adapt to complex processing conditions with variable speed and variable load. It is difficult to meet the precision stability requirements of continuous mass production of precision parts. It is usually only used as an auxiliary means and needs to be used in conjunction with active compensation technology.
[0005] Indirect modeling compensation based on temperature sensors is currently the mainstream active compensation solution in industry. The core logic of this solution is as follows: PT100 and thin-film RTD temperature measuring points are arranged in parts such as the spindle housing and bearing housing to collect multi-point temperature data. A mathematical model is used to fit the temperature-thermal deformation mapping relationship, and the compensation value is calculated in real time and sent to the CNC system to correct the Z-axis coordinate. In existing technologies, some high-end machine tools integrate multi-channel temperature sensor arrays on five-axis machining centers and gear grinding machines, using a multivariate linear regression offline modeling method, achieving a steady-state compensation accuracy of ±3μm. Some studies have introduced BP and RBF neural networks into thermal error prediction, which can fit the nonlinear coupling relationship between temperature and deformation; other studies have used digital twins and LSTM time-series networks for thermal state prediction, but these methods consume a lot of computational power and are currently mostly in the laboratory verification stage, not yet widely used in mass production. Domestic research has also conducted considerable work on measurement point optimization and intelligent modeling, proposing optimized machine learning models such as grey relational clustering for measurement point selection, SSA-Elman, and DE-GWO-SVR, which can control prediction errors within 2μm under no-load conditions. Furthermore, some high-end CNC systems have built-in macro program interfaces for thermal error compensation, supporting users to import offline trained models to achieve coordinate offset compensation. However, the aforementioned indirect modeling compensation schemes based on temperature sensors still have inherent technical drawbacks: temperature conduction exhibits thermal inertia hysteresis, leading to significant attenuation of prediction accuracy under transient conditions such as cold start-up and sudden speed changes; the models have weak generalization ability, only adapting to calibration conditions and easily failing under unfamiliar conditions; and they require the deployment of multiple sets of temperature measurement points and rely on massive sample training, resulting in high hardware costs and cumbersome debugging processes.
[0006] Direct measurement thermal error compensation using displacement sensors, representing a cutting-edge high-precision approach, is the research direction of this invention. To avoid the time lag and generalization defects of indirect temperature modeling, the industry has gradually developed direct measurement compensation schemes centered on eddy current displacement sensors. These schemes do not rely on temperature field calculations and non-contactly acquire the actual axial thermal elongation of the spindle mandrel in real time. The measured values are directly used to calculate the compensation amount, representing a cutting-edge technology for micron and submicron precision machining. However, existing eddy current measurement compensation technologies only achieve simple displacement acquisition. The measurement data is easily disturbed, the compensation accuracy is low, and unattended automatic compensation cannot be achieved. A mature engineering compensation system has not yet been formed.
[0007] Therefore, this invention urgently needs to design a spindle thermal error active compensation technology to solve the above-mentioned technical defects. Summary of the Invention
[0008] The purpose of this invention is to overcome the shortcomings of the prior art and provide a spindle thermal error compensation system and method with high measurement accuracy, high degree of automation, strong adaptability to working conditions, and mass production application, thereby realizing automatic triggering of machine tool tool changing and real-time compensation without human intervention, significantly improving the precision machining accuracy and batch size consistency of CNC machine tools, and reducing equipment modification costs and maintenance difficulties.
[0009] The technical solution of this invention is: A spindle thermal error compensation method according to the present invention includes the following steps: S1: Under cold conditions, spindle displacement data is collected at a preset spindle measurement orientation angle, and the spindle displacement data is used as reference data; S2: Set automatic and manual working modes, with a preset minimum acquisition interval as the trigger constraint. In automatic working mode, the acquisition cycle is triggered when the machine tool tool change command is responded to and the acquisition trigger condition with the minimum acquisition interval as the constraint is met; in manual working mode, the acquisition cycle is triggered in response to manual triggering operation. S3: In response to the triggered acquisition cycle, perform multi-level fault-tolerant sampling to obtain the effective value of thermal deformation in this acquisition cycle; wherein, the first acquisition cycle is based on the reference data to perform multiple sampling values, and the regular acquisition cycle is based on the difference between the current sampled value and the final measured value of the previous acquisition cycle, and performs threshold judgment and selective additional sampling according to a preset error threshold; S4: Perform a difference calculation between the effective value of thermal deformation in this acquisition cycle and the reference data to obtain the axial thermal error of the spindle; generate a reverse compensation amount based on the axial thermal error, and write the reverse compensation amount into the corresponding Z-axis compensation channel of the CNC system in real time to compensate for the tool tip offset error caused by the thermal elongation of the spindle.
[0010] Further, step S1 specifically includes: placing the machine tool in a cold state; powering on and preheating the displacement sensor used to collect spindle displacement data for a preset time; configuring the spindle measurement orientation angle; collecting spindle displacement data in the cold state; and using the spindle displacement data as the reference zero point.
[0011] Furthermore, step S2 specifically includes: Set the automatic and manual working modes, and set the minimum data acquisition interval; In the automatic working mode, when a tool change command is detected, it is determined whether the acquisition trigger condition is met; the acquisition trigger condition includes at least: the time elapsed since the completion of the last acquisition cycle is not less than the minimum acquisition interval; if the acquisition trigger condition is met, an acquisition cycle is triggered; wherein, the first acquisition cycle is calculated from the power-on time. In the manual working mode, the data acquisition cycle is triggered in response to the operator's manual triggering operation.
[0012] Further, in step S3, the multi-level fault-tolerant sampling step includes: S31: Determine whether the current data collection cycle is the first data collection cycle; S32: If it is the first acquisition cycle, multiple sets of displacement measurement data will be continuously acquired, and the sampled value with the smallest deviation from the chiller reference data within the current acquisition cycle will be used as the final measurement value of the current acquisition cycle. S33: If it is a regular acquisition cycle, determine whether the difference between the current sampled value and the final measurement value of the previous acquisition cycle exceeds a preset error threshold; if the difference exceeds the preset error threshold, add sampling until the difference is less than the preset error threshold or the number of samplings reaches a preset target number, and obtain the sampled value with the smallest deviation from the previous acquisition cycle in the current acquisition cycle as the final measurement value of the current acquisition cycle; if the difference is less than the preset error threshold, directly obtain the sampled value with the smallest deviation from the previous acquisition cycle in the current acquisition cycle as the final measurement value of the current acquisition cycle. S34: Determine whether the final measurement value of this acquisition cycle is within a preset specified range; if it is, determine the final measurement value of this acquisition cycle as the effective value of thermal deformation in this acquisition cycle and output it; if it is not, discard the final measurement value of this acquisition cycle and output an abnormal flag.
[0013] Further, step S4 specifically includes: S41: Perform a difference calculation between the effective value of thermal deformation in this acquisition cycle and the reference data to obtain the axial thermal error of the spindle; S42: Generate a reverse compensation amount based on the spindle axial thermal error, wherein the reverse compensation amount is similar in magnitude and opposite in direction to the spindle axial thermal error; S43: The reverse compensation amount is written into the Z-axis compensation channel of the CNC system in real time, and the reverse compensation amount is superimposed on the Z-axis position command through the Z-axis compensation channel to offset the tool tip offset error caused by spindle thermal elongation in real time.
[0014] Furthermore, S3 also includes an abnormal fault-tolerant protection step: during the data acquisition process, after each current sample value is acquired, it is determined whether the current sample value is within ±0.1mm of the chiller reference value; if it is not within this range, it is automatically discarded and the fault flag is set; if it is within this range, it participates in the multi-level fault-tolerant sampling step.
[0015] Furthermore, it also includes step S5: during the machine tool's heating stage, steady-state stage, speed change stage, and shutdown cooling stage, data acquisition and compensation calculations are continuously performed, and the reverse compensation amount is dynamically updated according to the real-time updated effective value of thermal deformation in this acquisition cycle, so as to adapt to the asymmetric heating and cooling thermal deformation characteristics of the spindle and achieve uninterrupted adaptive compensation.
[0016] A spindle thermal error compensation system according to the present invention includes: Eddy current measurement module, used to acquire spindle displacement data; The macro program control module is used to set the minimum acquisition interval and the spindle measurement orientation angle; to trigger the acquisition cycle based on tool change commands and acquisition trigger conditions in automatic working mode; and to trigger the acquisition cycle in response to manual triggering operations by the operator in manual working mode; the acquisition trigger conditions include at least: the time elapsed since the completion of the last acquisition cycle is not less than the minimum acquisition interval, wherein the first acquisition cycle is calculated from the power-on time; and to output an acquisition cycle trigger request to the CNC main control module after triggering the acquisition cycle. The CNC main control module receives machine tool change commands and notifies the macro program control module; responds to the acquisition cycle triggered by the macro program control module, controls the spindle to rotate to the spindle measurement orientation angle, and receives spindle displacement data output by the eddy current measurement module after spindle orientation is completed; performs multi-level fault-tolerant sampling and validity verification to obtain the effective value of thermal deformation in this acquisition cycle; performs difference calculation between the effective value of thermal deformation in this acquisition cycle and the pre-stored reference data under cold machine conditions to obtain the spindle axial thermal error; generates a reverse compensation amount based on the spindle axial thermal error, and writes the reverse compensation amount into the corresponding Z-axis compensation channel of the CNC system in real time; The data communication module is used to realize data interaction between the eddy current measurement module and the CNC main control module.
[0017] Furthermore, the CNC main control module is specifically configured as follows: Receive the machine tool tool change command and use the tool change command as a trigger source to notify the macro program control module; In response to the acquisition cycle triggered by the macro program control module, a spindle orientation command is sent to the machine tool to control the spindle to rotate to the spindle measurement orientation angle; After the spindle orientation is completed, the spindle displacement data transmitted by the eddy current measurement module through the data communication module is received; Multi-level fault-tolerant sampling is performed based on the spindle displacement data, including: determining whether the current acquisition cycle is the first acquisition cycle; if it is the first acquisition cycle, multiple sets of displacement measurement data are continuously acquired, and the sampled value with the smallest deviation from the chiller reference data within the current acquisition cycle is obtained as the final measurement value of the current acquisition cycle; if it is a regular acquisition cycle, it is determined whether the difference between the current sampled value and the final measurement value of the previous acquisition cycle exceeds a preset error threshold; if the difference exceeds the preset error threshold, additional sampling is performed until the difference is less than the preset error threshold or the number of samplings reaches a preset target number, and the sampled value with the smallest deviation from the previous acquisition cycle within the current acquisition cycle is obtained as the final measurement value of the current acquisition cycle; if the difference is less than the preset error threshold, the sampled value with the smallest deviation from the previous acquisition cycle within the current acquisition cycle is directly obtained as the final measurement value of the current acquisition cycle. Determine whether the final measurement value of this acquisition cycle is within a preset specified range; if it is, determine the final measurement value of this acquisition cycle as the effective value of thermal deformation for this acquisition cycle and output it; if it is not, discard the final measurement value of this acquisition cycle and output an abnormality flag. The effective value of thermal deformation in this acquisition cycle is calculated by difference with the pre-stored reference data to obtain the spindle axial thermal error, and a reverse compensation amount is generated based on the spindle axial thermal error; the reverse compensation amount is then written into the Z-axis compensation channel of the CNC system. During the machine tool's heating, steady-state, speed-changing, and shutdown cooling phases, data acquisition and compensation calculations are continuously performed, and the reverse compensation amount is dynamically updated based on the real-time updated effective value of thermal deformation in the current acquisition cycle.
[0018] Furthermore, the eddy current measurement module includes a probe and a controller; the axis of the probe is parallel to the thermal elongation direction of the spindle, so that the full-range thermal deformation of the spindle is within the effective measurement range of the eddy current measurement module; the detection diameter of the end face of the spindle to be measured corresponding to the probe is not less than 3 times the diameter of the probe, and the surface roughness Ra of the end face of the spindle to be measured is ≤1.6μm; a heat dissipation space of not less than 50mm is reserved around the controller.
[0019] The beneficial effects of this invention are: 1. The eddy current measurement module is used to directly measure the thermal deformation of the spindle, eliminating the thermal inertia hysteresis and model mismatch error of traditional temperature modeling; combined with a multi-level threshold fault-tolerant sampling algorithm, it effectively avoids industrial vibration and environmental interference, and the measurement accuracy and compensation stability are greatly improved.
[0020] 2. It can perfectly adapt to different speed ranges and is compatible with all time-series working conditions such as cold start-up, high-speed steady state, speed switching, and shutdown cooling. It adapts to the asymmetric thermal response characteristics of spindle heating and cooling, solving the technical shortcomings of traditional models that can only adapt to a single working condition.
[0021] 3. Based on the tool change command, measurement compensation is automatically triggered, eliminating the need for manual calibration, equipment preheating, and dedicated personnel. It supports custom cycle sampling, enabling fully automatic error compensation for uninterrupted mass production of machine tools, and significantly improving production efficiency and product batch consistency.
[0022] 4. The hardware structure is simple and easy to install. The sensor is resistant to oil, dust and electromagnetic interference, and can be adapted to the harsh working environment of machine tools for a long time. There is no need to build a constant temperature workshop or modify the cooling system. The hardware modification cost is low, the operation and maintenance are simple, and the project implementation and promotion are extremely strong.
[0023] 5. Set up a data anomaly detection and protection mechanism to automatically remove abnormal data that exceeds the limit, eliminate safety risks such as overcompensation and machine tool collisions, and balance compensation accuracy with equipment operation stability.
[0024] 6. It is particularly suitable for real-time correction of spindle axial thermal elongation error in CNC equipment such as high-speed drilling and tapping centers and precision machining centers, and can meet the batch stable processing needs of high-precision parts such as aerospace, precision molds, and optical components. Attached Figure Description
[0025] Figure 1 This is a system principle block diagram of Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the method flow of Embodiment 2 of the present invention. Detailed Implementation
[0026] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0027] Example 1 like Figure 1 The diagram illustrates a spindle thermal error compensation system, comprising an eddy current measurement module, a CNC (Computer Numerical Control) main control module, a temperature acquisition module, a data communication module, and a macro program control module. The CNC main control module serves as the system's main control unit and is electrically connected to the temperature acquisition module, data communication module, and macro program control module. Furthermore, the CNC main control module is connected to the eddy current measurement module via the data communication module. The modules work together to achieve fully automated operation of the entire process, including thermal deformation acquisition and compensation calculations.
[0028] In this embodiment, the eddy current measurement module is preferably an eddy current displacement sensor, which is a non-contact measurement device based on the eddy current effect. When the magnetic lines of force of the measuring coil act on the surface of the metal workpiece, eddy currents are induced on its surface. The magnitude of the eddy current is closely related to the gap between the workpiece and the measuring coil. Changes in the gap will cause changes in the eddy current and the induced electromotive force. The controller of the sensor converts the reverse electromagnetic field strength into a measurable signal, thereby obtaining the distance between the sensor and the workpiece.
[0029] The eddy current displacement sensor includes a probe, a controller, and an external cable. The probe is connected to the controller via a coaxial shielded cable, and the controller establishes data interaction with the CNC main control module via an RS485 communication interface and the external cable. The external cable provides power supply and communication functions. The probe is used to collect spindle displacement data; the controller is used to excite the probe, amplify and process the signal output by the probe, and interact with the CNC main control module.
[0030] Preferably, the relevant parameters of the eddy current displacement sensor are: measuring range 0.1~0.6mm, resolution 0.5μm, linearity 99.7%, input voltage +24 V±5%, and dual output modes of RS485 digital signal and 0.5V~9.5V analog signal; the probe size is: length 12mm × width 10mm × thickness 4.5mm; the sensor housing size is: diameter 12mm and length 102mm.
[0031] The probe is installed as follows: the axis of the probe is parallel to the thermal expansion direction of the spindle, ensuring that the full-range thermal deformation of the spindle is within the effective measurement range of 0.1 to 0.6 mm of the sensor; the detection diameter of the end face of the spindle being measured is not less than 3 times the probe diameter, and the surface roughness Ra≤1.6μm to ensure the stability of the eddy current field; the probe is fixed to the stationary housing of the spindle, completely decoupled from the spindle rotation parts and feed motion parts, avoiding mechanical motion interference, eliminating motion error coupling, and can penetrate harsh media such as dust and cutting fluid, thereby achieving stable measurement of the axial displacement of the metal spindle.
[0032] The controller is installed in an area away from strong electromagnetic interference equipment such as frequency converters and contactors, with a minimum of 50mm of ventilation space around it to avoid measurement drift caused by poor heat dissipation and electromagnetic interference. The device is powered by a stable +24V±5% voltage and comes with a 10m standard shielded cable to ensure stable signal transmission.
[0033] In short, this embodiment optimizes the sensor installation layout, physically isolates the probe and controller from machine tool movement and strong interference devices, and incorporates a heat dissipation design. It achieves micron-level precision measurement without physical contact, is unaffected by oil, dust, or other media, and can be used long-term in harsh industrial environments such as metallurgy and chemical industries. Furthermore, it can measure various metal conductors, including iron, stainless steel, aluminum, and copper, and can penetrate insulation layers to detect the internal metal. It also supports multiple signal outputs and is compatible with PLC, DCS, and other control systems. Therefore, this system can operate stably for extended periods in harsh industrial machine tool environments, with low hardware modification costs, simple maintenance, and strong engineering feasibility.
[0034] In this embodiment, the temperature acquisition module includes a first temperature sensor and a second temperature sensor. The first temperature sensor is located at the front bearing of the spindle housing and is used to acquire the temperature of the spindle body. The detection probe of the second temperature sensor is oriented towards the ambient air and is used to acquire the ambient temperature. The entire temperature acquisition module can be used to assist in verifying the thermal deformation law and distinguishing between ambient temperature change and spindle body temperature rise error, thereby ensuring the reliability of compensation data.
[0035] In this embodiment, the data communication module uses the RS485 communication protocol to realize data interaction between the controller of the eddy current displacement sensor and the CNC main control module. It offers stable transmission, strong anti-interference capabilities, and is suitable for the complex electromagnetic environment of industrial machine tools. Preferably, the data communication module includes a USB-to-RS485 conversion module and an RS485 bus; the USB-to-RS485 conversion module converts the USB interface of the CNC main control module into an RS485 bus interface, and the RS485 bus connects the USB-to-RS485 conversion module to the controller of the eddy current measurement module.
[0036] In this embodiment, the macro program control module is connected to or integrated into the CNC main control module. It is used to configure the minimum acquisition interval and the spindle measurement orientation angle; determine whether the acquisition cycle trigger condition is met; if so, send an acquisition cycle trigger request to the CNC main control module; and perform a status reset after compensation execution is completed or after exception handling.
[0037] Specifically, the macro program control module has a built-in dedicated automatic measurement macro program that can perform the following operations: Parameter configuration: Supports users to flexibly configure the minimum acquisition interval (e.g., default value 3 minutes) to effectively avoid frequent data acquisition, and receives user input of the spindle measurement orientation angle (e.g., default value 45°) to unify the measurement posture and eliminate system errors introduced by the rotation angle; Timing reference reading: By reading the system variables in the CNC system that represent the machine tool's startup time, the cumulative running time of the machine tool after this startup is obtained and used as the timing reference; Acquisition cycle determination: In automatic mode, based on the tool change command received from the CNC main control module, it is determined whether the acquisition trigger condition is met; in manual mode, it responds to the operator's manual triggering operation; the acquisition trigger condition includes at least: the time since the completion of the last acquisition cycle is not less than the minimum acquisition interval, wherein the first acquisition cycle is calculated from the power-on time; if the acquisition trigger condition is met, an acquisition cycle trigger request is sent to the CNC main control module, causing the CNC main control module to respond to the acquisition cycle trigger request and send a spindle orientation command to the spindle driver, which controls the spindle to rotate to the user-defined spindle measurement orientation angle to unify the measurement posture and eliminate system errors introduced by the rotation angle; Status Reset: After the compensation is completed, the command to restore the original machining speed of the spindle is output to the CNC main control module, and the measurement timestamp is updated to form a closed-loop compensation process; Self-locking judgment: The process will jump directly to the end during non-collection periods to minimize unnecessary computing power consumption.
[0038] In this embodiment, the CNC main control module receives the machine tool tool change command and uses the tool change command as a trigger source to notify the macro program control module; according to the acquisition cycle trigger request output by the macro program control module, it sends a spindle orientation command to the CNC system of the machine tool to control the spindle to rotate to the spindle measurement orientation angle, and triggers the eddy current measurement module to acquire spindle displacement data after the spindle orientation is completed; it receives the spindle displacement data transmitted by the eddy current measurement module through the data communication module, and executes multi-level fault-tolerant sampling and value determination logic according to the spindle displacement data and the current acquisition cycle to obtain the effective value of thermal deformation in this acquisition cycle; it performs a difference calculation between the effective value of thermal deformation in this acquisition cycle and the pre-stored cold machine reference value to obtain the spindle axial thermal error; it generates a reverse compensation amount according to the spindle axial thermal error, and writes the reverse compensation amount into the Z-axis compensation channel of the CNC system to compensate for the tool tip offset error caused by Z-axis thermal elongation.
[0039] Furthermore, the CNC main control module is also used to receive the spindle body temperature and ambient temperature collected by the temperature acquisition module. Based on the spindle body temperature and ambient temperature, the data relationship between the spindle thermal elongation and the spindle body temperature and ambient temperature can be analyzed during the experiment. However, the two temperature values do not need to be included in the calculation in the compensation algorithm.
[0040] Furthermore, the CNC main control module is also used to store the cold machine reference value, which is the spindle displacement data collected in the cold state of the machine tool during the equipment pre-calibration process.
[0041] A preferred workflow of the CNC main control module in this embodiment is as follows: At the end of each acquisition cycle, the CNC main control module sends a spindle orientation command to the spindle driver, locking the spindle to a specified measurement angle. Subsequently, the CNC main control module sends a reading command at a preset acquisition cycle, for example, once every 50 seconds. The reading command is converted into an RS485 signal by a USB to RS485 converter module and then sent to the controller of the eddy current displacement sensor via the RS485 bus. After receiving the reading command, the controller drives the probe to acquire the spindle thermal deformation value and packages the acquired measurement data. The packaged measurement data is transmitted back via the RS485 bus and uploaded to the CNC main control module via the USB to RS485 converter module. After receiving the measurement data, the CNC main control module executes a multi-level fault-tolerant sampling and value determination logic to obtain the effective value of thermal deformation in this acquisition cycle. The difference between the effective value of thermal deformation in this acquisition cycle and the cold machine reference value is used to calculate the compensation amount, and the compensation amount is written into the Z-axis compensation channel to compensate for the tool tip offset error caused by spindle thermal expansion.
[0042] In this embodiment, the macro program control module is responsible for determining the acquisition cycle, spindle orientation, and data acquisition triggering; the CNC main control module is responsible for parsing the acquired data, judging the legality of the compensation value, and executing the compensation function. The cooperation between the two can improve the real-time performance, accuracy, and consistency of data acquisition and compensation.
[0043] Example 2 like Figure 2 As shown: Based on the spindle thermal error compensation system described in Embodiment 1, this embodiment designs a fully automatic, highly fault-tolerant spindle thermal error compensation method, which specifically includes the following steps: Step 1, Pre-calibration of equipment: Place the machine tool in a cold state, configure the spindle to measure the orientation angle, and power on the eddy current displacement sensor for a preset warm-up time; collect the spindle displacement data as the reference zero point under the cold state to complete the initial calibration.
[0044] Specifically, the machine tool is left to stand still until it reaches a completely cold state; the eddy current displacement sensor is preheated for 10 minutes to eliminate start-up drift; the spindle measurement orientation angle is configured, with a default value of 45°; by setting the spindle measurement orientation angle, the spindle can stop at the same angular position during each displacement data acquisition, thereby eliminating the influence of the spindle's own geometric errors and angle changes on the measurement results, so that the measured displacement changes can truly reflect the spindle's thermal deformation; the spindle displacement data is collected in a cold state as a reference value to complete the initial calibration.
[0045] This step in this embodiment, by acquiring the reference zero position according to the preset spindle measurement orientation angle under cold and sensor preheating conditions, can effectively eliminate the influence of power-on drift, ambient temperature change and spindle attitude change on the measurement, and provide a consistent, reliable and comparable initial reference for subsequent thermal error calculation.
[0046] Step 2, Dual-mode trigger determination: Set an automatic working mode and a manual working mode. In the automatic working mode, the acquisition cycle is triggered when a tool change command is detected and the preset trigger conditions are met. In the manual working mode, the acquisition cycle is triggered in response to the operator's manual triggering operation.
[0047] Specifically, the dual-mode trigger determination steps include: Set automatic and manual working modes; In the automatic working mode, when the CNC main control module detects the M6 tool change command, it sends it to the macro program control module, and enters the automatic measurement mode under the execution of the automatic measurement macro program. For the first acquisition cycle, the startup duration variable is obtained, and it is determined whether the startup duration variable has reached the preset acquisition time, which is set by the user, such as a default value of 3 minutes, so as to avoid data redundancy caused by high-frequency repeated acquisition. If it is determined that the preset acquisition time has been reached, it is determined whether to perform a tool change. If a tool change is performed, the acquisition cycle is triggered without manual intervention. If the preset acquisition time has not been reached or a tool change has not been performed, the process continues to wait. The startup duration variable is the cumulative running time of the machine tool after this startup. In the manual operating mode, the acquisition cycle is triggered in response to the operator manually invoking the measurement subroutine.
[0048] This step in the embodiment links the automatic mode with the tool change command, retains manual triggering in the manual mode, and constrains the triggering frequency with the minimum acquisition interval. This not only adapts to unmanned batch processing, but also avoids data redundancy and computing power waste caused by high-frequency repeated acquisition, thereby improving the degree of automation and adaptability to working conditions.
[0049] Step 3, Multi-level fault-tolerant sampling and value acquisition: In response to the acquisition cycle triggered in Step 2, the data acquisition steps are executed: it is determined whether the current acquisition cycle is the first acquisition cycle; if it is the first acquisition cycle, multiple sets of displacement data are continuously acquired, and the data with the smallest deviation from the chiller reference value is selected as the final measurement value of the current acquisition cycle; if it is not the first acquisition cycle, multi-level fault-tolerant sampling is performed based on the deviation between the current sampled value and the final measurement value of the previous acquisition cycle to obtain the final measurement value of the current acquisition cycle; it is determined whether the final measurement value of the current acquisition cycle is within a preset specified range; if it is, the final measurement value is used as the effective value of thermal deformation for this acquisition cycle and output; if it is not, it is discarded and an abnormal flag is output.
[0050] Specifically, the data acquisition steps include: S301: Collect the current sampled value; S302: Determine whether the current acquisition cycle is the first acquisition cycle; S303: If the current acquisition cycle is the first acquisition cycle, then determine whether the current measurement is the first measurement within the current acquisition cycle; if the current acquisition cycle is not the first acquisition cycle, then determine whether the difference between the current sampled value and the final measurement value of the previous acquisition cycle is not less than a preset error threshold; wherein, the preset error threshold is configurable, for example, it is set to 5μm by default; S304: If this measurement is the first measurement within the current acquisition cycle, record the current sampled value and return to step S301; if this measurement is not the first measurement within the current acquisition cycle, obtain the sampled value with the smallest deviation from the chiller reference value within the current acquisition cycle as the final measurement value of the current acquisition cycle; preferably, two sets of displacement data are continuously acquired within the first acquisition cycle, and the data with the smallest difference from the chiller reference value is selected as the final measurement value of the current acquisition cycle. S305: If the difference is not less than the preset error threshold, i.e. ≥5μm, then determine whether the number of samplings in the current sampling period is not less than the preset target number; wherein, the preset target number is 3 times, i.e., a maximum of 3 samplings per period, i.e., determine whether the number of samplings is ≥3; if the difference is <5μm, then obtain the sampling value with the smallest deviation from the previous sampling period in the current sampling period, as the final measurement value of the current sampling period; S306: If the number of samplings is ≥3, then the sampled value with the smallest deviation from the previous sampling period in the current sampling period is obtained as the final measurement value of the current sampling period; if the number of samplings is <3, then return to step S301 until the difference between the current sampled value and the final measurement value of the previous sampling period is <5μm, or the number of samplings is ≥3, and the sampled value with the smallest deviation from the previous sampling period in the current sampling period is obtained as the final measurement value of the current sampling period. S307: Determine whether the final measurement value of the current acquisition cycle is within a preset specified range; S308: If the final measurement value of the current acquisition cycle is within the preset specified range (i.e., the cold machine reference value ±0.1mm), then the final measurement value is the sampled value with the smallest fluctuation and the best continuity in the current acquisition cycle, and it is used as the effective value of thermal deformation in this acquisition cycle; if the final measurement value of the current acquisition cycle is not within the preset specified range, then the final measurement value of the current acquisition cycle is discarded and an abnormal flag is output.
[0051] Furthermore, step three also includes fault tolerance protection: during data acquisition, after each sampled value is acquired, it is determined whether the current sampled value is within ±0.1mm of the chiller reference value; if not, it is automatically discarded and a fault flag is set; if it is, it participates in the multi-level fault-tolerant sampling steps. This avoids risks such as over-compensation and collisions caused by data anomalies, ensuring safe equipment operation.
[0052] This step in the embodiment, through multiple optimizations during the initial acquisition cycle, threshold judgment during the regular acquisition cycle, and selective additional sampling, combined with range verification, can effectively eliminate abnormal data and industrial interference, ensuring the stability, continuity, and reliability of the effective value of thermal deformation during the acquisition cycle, and enhancing the system's anti-interference capability. Specifically, by continuously acquiring multiple sets of displacement data within the initial acquisition cycle and selecting the data with the smallest deviation from the reference zero point as the effective initial value, the influence of sensor drift and accidental interference in the initial stage of startup can be eliminated, establishing a stable and reliable initial reference and providing a consistent comparison basis for subsequent regular acquisition cycles. By comparing the current sampled value with the final measurement value of the previous acquisition cycle and selectively adding samples, and preferably selecting a maximum of 3 fault-tolerant samples per cycle, the measurement data jumps caused by machine tool vibration and environmental interference can be effectively avoided, solving the defects of large fluctuations and poor stability of traditional direct measurement compensation data, and significantly improving measurement accuracy. After various logical judgments, the sampled value with the smallest fluctuation and the best continuity in this acquisition cycle is selected as the final measurement value of this acquisition cycle. The most stable data can be extracted from multiple sets of samples, effectively suppressing random errors caused by industrial vibration and environmental interference, and improving the continuity and reliability of the effective value of thermal deformation. Through range verification and abnormal flag output, out-of-limit data can be prevented from entering the compensation stage, avoiding overcompensation or erroneous compensation, and improving system safety. Through abnormal fault-tolerant protection, abnormal data can be prevented from participating in subsequent calculations in a timely manner, ensuring the stability of the compensation process and equipment safety.
[0053] Step 4: Real-time error compensation calculation: In response to the effective value of thermal deformation in this acquisition cycle output in Step 3, perform a difference calculation with the cold machine reference value to obtain the axial thermal error of the spindle; generate a reverse compensation amount based on the axial thermal error of the spindle and write it into the Z-axis compensation channel of the CNC system to compensate for the tool tip offset error caused by the thermal expansion of the spindle.
[0054] Specifically, the effective value of thermal deformation is the real-time thermal elongation of the spindle after screening. This value is then compared with the cold start reference value to calculate the spindle axial thermal error. A reverse compensation amount is generated based on this axial thermal error; this reverse compensation amount is similar in magnitude but opposite in direction to the spindle axial thermal error. During subsequent machining operations, the reverse compensation amount is output in real-time through the Z-axis compensation channel to offset the tool tip offset error caused by the spindle thermal elongation.
[0055] In this embodiment, the spindle axial thermal error is obtained by subtracting the effective value of thermal deformation in the current acquisition cycle from the reference value, and a reverse compensation amount is generated and written into the Z-axis compensation channel in real time, forming an acquisition-judgment-compensation closed loop. This can directly offset the tool tip offset caused by spindle thermal elongation, improve submicron-level machining accuracy and all-condition adaptive compensation capability.
[0056] Step 5, Full-condition adaptive compensation: During the machine tool's heating, steady-state, speed change, and shutdown cooling phases, data acquisition and compensation calculations are continuously performed. The reverse compensation amount is dynamically updated based on the real-time updated effective value of thermal deformation in the current acquisition cycle to adapt to the asymmetric heating and cooling thermal deformation characteristics of the spindle and achieve uninterrupted adaptive compensation.
[0057] This step in the embodiment overcomes the shortcomings of traditional temperature modeling schemes, which are only applicable to a single working condition and have poor generalization ability under dynamic changing working conditions. It achieves uninterrupted adaptive compensation throughout the entire process without the need for manual switching of working conditions or interruption of processing. This effectively improves the compensation accuracy, generalization ability, and long-term operational stability under dynamic changing working conditions, making it suitable for continuous processing scenarios in mass production lines. Furthermore, by using an eddy current displacement sensor to directly measure the actual thermal deformation of the spindle, it can accurately adapt to the above-mentioned full-sequence working conditions of cold start-up, speed switching, thermal steady-state operation, and natural cooling after shutdown. It perfectly matches the asymmetric thermal response characteristics of spindle heating and cooling, and its working condition generalization ability far exceeds that of traditional modeling schemes.
[0058] Example 3 Based on Embodiments 1 and 2, this embodiment uses a vertical drilling and tapping machine to verify the aforementioned spindle thermal error compensation. The machine tool starts processing in a partially cooled state, and tests are performed under both compensated and uncompensated operating conditions.
[0059] Specifically, the same workpiece was divided into an upper and lower region along the Y-axis of the machine tool. The upper region was used to enable spindle thermal error compensation testing, and the lower region was used to disable spindle thermal error compensation testing. Milling was performed using an 8mm tool, with a total of 14 cuts and a 4mm overlap between adjacent toolpaths. The spindle was warmed up at 15000 rpm between each toolpath, with each warm-up lasting 4 minutes, for a total running time of 56 minutes. The effectiveness of the compensation method was verified by comparing the machining errors in the upper and lower regions. Basic data are shown in Table 1. Table 1 Basic Data
[0060] Test Results: After cutting, a dial indicator was used for measurement. First, the surface was positioned to the reference surface, and the dial indicator reading was set to 0. After each cut, the Z-axis height difference between the machined surface and the reference surface was measured. The target cutting depth was -0.272 mm, and the reference surface measurement was 0.002 mm. Without compensation, the Z-axis dimension of the machined surface ranged from -0.273 mm to -0.292 mm, and the overall flatness was 0.019 mm. With compensation enabled, the Z-axis dimension of the machined surface ranged from -0.263 mm to -0.273 mm, and the overall flatness was 0.010 mm.
[0061] Experiments show that when running at a speed of 15000 r / min, the overall flatness of the Z-axis dimension is 0.019 mm without compensation, and 0.010 mm after compensation is enabled. The comparison shows that the Z-axis dimension is closer to the target value after compensation is enabled, and the flatness is reduced from 0.019 mm to 0.010 mm, with a significant improvement in accuracy.
[0062] In summary, through cutting trials, this invention accurately captures the axial thermal deformation patterns of high-speed spindles at different speeds. The higher the speed, the greater the steady-state thermal deformation and the faster the temperature rise response; this system can achieve real-time compensation for all of these. Comparison of milling dimensions of cold and hot workpieces shows that the eddy current measurement values are highly consistent with the actual thermal elongation of the spindle, with deviations on the order of micrometers, accurately characterizing the true thermal error of the spindle. This invention completely solves the industry pain points of insufficient accuracy and lag mismatch in active modeling compensation of traditional passive thermal error suppression methods. It achieves low-cost, high-precision, fully automated, and all-condition adaptable spindle thermal error compensation, significantly improving the precision machining accuracy and batch production pass rate of CNC machine tools, possessing extremely high engineering promotion value and market application prospects.
Claims
1. A method for compensating for spindle thermal errors, characterized in that, Includes the following steps: S1: Under cold conditions, spindle displacement data is collected at a preset spindle measurement orientation angle, and the spindle displacement data is used as reference data; S2: Set automatic and manual working modes, with a preset minimum acquisition interval as the trigger constraint. In automatic working mode, the acquisition cycle is triggered when the machine tool tool change command is responded to and the acquisition trigger condition with the minimum acquisition interval as the constraint is met; in manual working mode, the acquisition cycle is triggered in response to manual triggering operation. S3: In response to the triggered acquisition cycle, perform multi-level fault-tolerant sampling to obtain the effective value of thermal deformation in this acquisition cycle; wherein, the first acquisition cycle is based on the reference data to perform multiple sampling values, and the regular acquisition cycle is based on the difference between the current sampled value and the final measured value of the previous acquisition cycle, and performs threshold judgment and selective additional sampling according to a preset error threshold; S4: Perform a difference calculation between the effective value of thermal deformation in this acquisition cycle and the reference data to obtain the axial thermal error of the spindle; generate a reverse compensation amount based on the axial thermal error, and write the reverse compensation amount into the corresponding Z-axis compensation channel of the CNC system in real time to compensate for the tool tip offset error caused by the thermal elongation of the spindle.
2. The spindle thermal error compensation method according to claim 1, characterized in that, Step S1 specifically includes: placing the machine tool in a cold state; powering on and preheating the displacement sensor used to collect spindle displacement data for a preset time; configuring the spindle measurement orientation angle; collecting spindle displacement data in the cold state; and using the spindle displacement data as the reference zero point.
3. The spindle thermal error compensation method according to claim 1, characterized in that, Step S2 specifically includes: Set the automatic and manual working modes, and set the minimum data acquisition interval; In the automatic working mode, when a tool change command is detected, it is determined whether the acquisition trigger condition is met; the acquisition trigger condition includes at least: the time elapsed since the completion of the last acquisition cycle is not less than the minimum acquisition interval; if the acquisition trigger condition is met, an acquisition cycle is triggered; wherein, the first acquisition cycle is calculated from the power-on time. In the manual working mode, the data acquisition cycle is triggered in response to the operator's manual triggering operation.
4. The spindle thermal error compensation method according to claim 1, characterized in that, In step S3, the multi-level fault-tolerant sampling step includes: S31: Determine whether the current data collection cycle is the first data collection cycle; S32: If it is the first acquisition cycle, multiple sets of displacement measurement data will be continuously acquired, and the sampled value with the smallest deviation from the chiller reference data within the current acquisition cycle will be used as the final measurement value of the current acquisition cycle. S33: If it is a regular acquisition cycle, determine whether the difference between the current sampled value and the final measurement value of the previous acquisition cycle exceeds a preset error threshold; if the difference exceeds the preset error threshold, add sampling until the difference is less than the preset error threshold or the number of samplings reaches a preset target number, and obtain the sampled value with the smallest deviation from the previous acquisition cycle in the current acquisition cycle as the final measurement value of the current acquisition cycle; if the difference is less than the preset error threshold, directly obtain the sampled value with the smallest deviation from the previous acquisition cycle in the current acquisition cycle as the final measurement value of the current acquisition cycle. S34: Determine whether the final measurement value of this acquisition cycle is within a preset specified range; if it is, determine the final measurement value of this acquisition cycle as the effective value of thermal deformation in this acquisition cycle and output it; if it is not, discard the final measurement value of this acquisition cycle and output an abnormal flag.
5. The spindle thermal error compensation method according to claim 1, characterized in that, Step S4 specifically includes: S41: Perform a difference calculation between the effective value of thermal deformation in this acquisition cycle and the reference data to obtain the axial thermal error of the spindle; S42: Generate a reverse compensation amount based on the spindle axial thermal error, wherein the reverse compensation amount is similar in magnitude and opposite in direction to the spindle axial thermal error; S43: The reverse compensation amount is written into the Z-axis compensation channel of the CNC system in real time, and the reverse compensation amount is superimposed on the Z-axis position command through the Z-axis compensation channel to offset the tool tip offset error caused by spindle thermal elongation in real time.
6. The spindle thermal error compensation method according to claim 1, characterized in that, S3 also includes an abnormal fault-tolerant protection step: during the data acquisition process, after each current sample value is acquired, it is determined whether the current sample value is within ±0.1mm of the chiller reference value; if it is not within the range, it is automatically discarded and the fault flag is set; if it is within the range, it participates in the multi-level fault-tolerant sampling step.
7. The spindle thermal error compensation method according to claim 1, characterized in that, It also includes step S5: during the machine tool's heating phase, steady-state phase, speed change phase, and shutdown cooling phase, data acquisition and compensation calculations are continuously performed, and the reverse compensation amount is dynamically updated based on the real-time updated effective value of thermal deformation in this acquisition cycle, so as to adapt to the asymmetric heating and cooling thermal deformation characteristics of the spindle and achieve uninterrupted adaptive compensation.
8. A spindle thermal error compensation system, characterized in that, include: Eddy current measurement module, used to acquire spindle displacement data; The macro program control module is used to set the minimum acquisition interval and the spindle measurement orientation angle; it is also used to trigger the acquisition cycle based on tool change commands and acquisition trigger conditions in automatic working mode. In manual mode, the data collection cycle is triggered in response to manual actions by the operator. The acquisition triggering conditions include at least the following: the time elapsed since the completion of the last acquisition cycle is not less than the minimum acquisition interval, wherein the first acquisition cycle is calculated from the power-on time; it is also used to output an acquisition cycle trigger request to the CNC main control module after the acquisition cycle is triggered. The CNC main control module receives machine tool change commands and notifies the macro program control module; responds to the acquisition cycle triggered by the macro program control module, controls the spindle to rotate to the spindle measurement orientation angle, and receives spindle displacement data output by the eddy current measurement module after spindle orientation is completed; performs multi-level fault-tolerant sampling and validity verification to obtain the effective value of thermal deformation in this acquisition cycle; performs difference calculation between the effective value of thermal deformation in this acquisition cycle and the pre-stored reference data under cold machine conditions to obtain the spindle axial thermal error; generates a reverse compensation amount based on the spindle axial thermal error, and writes the reverse compensation amount into the corresponding Z-axis compensation channel of the CNC system in real time; The data communication module is used to realize data interaction between the eddy current measurement module and the CNC main control module.
9. The spindle thermal error compensation system according to claim 8, characterized in that, The CNC main control module is specifically configured as follows: Receive the machine tool tool change command and use the tool change command as a trigger source to notify the macro program control module; In response to the acquisition cycle triggered by the macro program control module, a spindle orientation command is sent to the machine tool to control the spindle to rotate to the spindle measurement orientation angle; After the spindle orientation is completed, the spindle displacement data transmitted by the eddy current measurement module through the data communication module is received; Multi-level fault-tolerant sampling is performed based on the spindle displacement data, including: determining whether the current acquisition cycle is the first acquisition cycle; if it is the first acquisition cycle, multiple sets of displacement measurement data are continuously acquired, and the sampled value with the smallest deviation from the chiller reference data within the current acquisition cycle is obtained as the final measurement value of the current acquisition cycle; if it is a regular acquisition cycle, it is determined whether the difference between the current sampled value and the final measurement value of the previous acquisition cycle exceeds a preset error threshold; if the difference exceeds the preset error threshold, additional sampling is performed until the difference is less than the preset error threshold or the number of samplings reaches a preset target number, and the sampled value with the smallest deviation from the previous acquisition cycle within the current acquisition cycle is obtained as the final measurement value of the current acquisition cycle; if the difference is less than the preset error threshold, the sampled value with the smallest deviation from the previous acquisition cycle within the current acquisition cycle is directly obtained as the final measurement value of the current acquisition cycle. Determine whether the final measurement value of this acquisition cycle is within a preset specified range; if it is, determine the final measurement value of this acquisition cycle as the effective value of thermal deformation for this acquisition cycle and output it; if it is not, discard the final measurement value of this acquisition cycle and output an abnormality flag. The effective value of thermal deformation in this acquisition cycle is calculated by difference with the pre-stored reference data to obtain the spindle axial thermal error, and a reverse compensation amount is generated based on the spindle axial thermal error; the reverse compensation amount is then written into the Z-axis compensation channel of the CNC system. During the machine tool's heating, steady-state, speed-changing, and shutdown cooling phases, data acquisition and compensation calculations are continuously performed, and the reverse compensation amount is dynamically updated based on the real-time updated effective value of thermal deformation in the current acquisition cycle.
10. The spindle thermal error compensation system according to claim 8 or 9, characterized in that, The eddy current measurement module includes a probe and a controller; the axis of the probe is parallel to the thermal elongation direction of the spindle, so that the full-range thermal deformation of the spindle is within the effective measurement range of the eddy current measurement module; the detection diameter of the end face of the spindle to be measured corresponding to the probe is not less than 3 times the diameter of the probe, and the surface roughness Ra of the end face of the spindle to be measured is ≤1.6μm; a heat dissipation space of not less than 50mm is reserved around the controller.
