摘要

In this paper, a software-based geometric error compensation method using the machining method template is proposed to modify the long and complicated G-code file with multiple machining features. Firstly, an error model is established to evaluate the error distribution. Then, a new segmentation method is proposed to split the long multi-axis line into several parts with the same length to eliminate the nonlinear effect. Furthermore, a compensation scheme according to the machining method is presented to determine which segments and axes should be compensated when facing with a long and complicated G-code file. In addition, a framework is developed to process the G-code file with high efficiency. The G-code file is firstly separated into the motion and non-motion command files, which are then merged together to form a new G-code file after the motion commands are modified by an error compensation module. Finally, a machining experiment with a test workpiece containing multiple features is conducted on a five-axis machining center to validate the effectiveness and correctness of the proposed method.