Long-term thermal error modeling and compensation for CNC machine tools based on enhanced autoformer
摘要
Thermal error in CNC machine tools exhibits significant nonlinearity and time variability, particularly under complex operating conditions, thereby presenting substantial challenges to the accuracy and robustness of thermal error modeling and compensation. To address this issue, this study proposes a long-term prediction and real-time compensation method based on Enhanced Autoformer. Three key optimizations are introduced into the original architecture: removal of temporal positional encoding to strengthen the correlation between temperature features and thermal error responses; incorporation of historical thermal error to enhance trend modeling capabilities; and integration of a local attention mechanism within the decoder to improve perception around sequence concatenation regions. Prediction results show that the Enhanced Autoformer model significantly outperforms the Transformer, Reformer, and Autoformer models across all evaluation metrics, including MSE, MAE, MAPE, and R2, and achieves 100% prediction accuracy within an error tolerance of ± 3 μm. A real-time compensation system is developed on the Siemens 840D CNC machine tool, and experimental validation is conducted under both stepwise and random spindle speed conditions. The average compensation rate in four trials exceeds 80%, confirming the effectiveness and robustness of the proposed method in long-term thermal error prediction and real-time compensation tasks. This study provides a viable reference for advanced thermal error modeling and compensation in high-precision CNC machining applications.