Identification of Defective Toolpath Points in Five-Axis Machining G-Code in the Machine Coordinate System

2026-99-1268

9/4/2026

Authors
Abstract
Content
Due to imperfections in CAD models of parts and CAM post-processing algorithms, G-code generated by CAM often contains densely clustered toolpath points, which reduce machining efficiency and accuracy. Existing research primarily focuses on detecting and optimizing such defects in the workpiece coordinate system (WCS). However, for five-axis machine tools, discrepancies between the tool tip point and the feed axis control point cause tool path trajectories in the WCS to deviate significantly from those in the machine coordinate system (MCS). This discrepancy leads to low accuracy and poor effectiveness when identifying defective tool positions in the workpiece coordinate system. This paper proposes a method for identifying defective toolpath points within the MCS. Firstly, the kinematic transformation model is constructed to map G-code tool positions from the WCS to the MCS. Median absolute deviation (MAD)–based anomaly detection, combined with NURBS curve fitting, is then used to localize densely clustered defect points. A section of G-code for an automotive hub component is used as a case study to compare toolpath trajectories in the WCS and MCS and to evaluate the effectiveness of defect detection and subsequent correction. The results demonstrate that MCS-based identification yields more accurate detection of defective toolpath points than WCS-based methods. After correcting the G-code according to the detected defects, there is a significant reduction in fluctuations in the machine feed speed and a marked decrease in contour error of the interpolated trajectory.
Meta TagsDetails
DOI
https://doi.org/10.4271/2026-99-1268
Citation
Yu, H., Liu, S., He, Y., and Lyu, D., "Identification of Defective Toolpath Points in Five-Axis Machining G-Code in the Machine Coordinate System," 2025 6th International Conference on Applied Mechanics and Mechanical Engineering (ICAMME 2025), Beijing, China, December 12, 2025, https://doi.org/10.4271/2026-99-1268.
Additional Details
Publisher
Published
Sep 04
Product Code
2026-99-1268
Content Type
Technical Paper
Language
English