Using artificial intelligence to optimize gcode files for FFF/FDM technology
More details
Hide details
1
Cracow University of Technology, Faculty of Electrical and Computer Engineering
These authors had equal contribution to this work
KEYWORDS
TOPICS
ABSTRACT
3D printing technology—particularly thermoplastic-based methods such as Fused Filament Fabrication (FFF) and Fused Deposition Modeling (FDM)—has gained popularity in both industrial and home settings. A key element of the 3D-printing process is the preparation of the printer’s batch files—so-called g-code files—which contain all the information needed for correct execution of the print. Traditional methods of generating g-code rely on deterministic algorithms that do not always yield optimal results in terms of print quality (dimensional accuracy of the geometry), build time, material consumption, and functional parameters such as the mechanical strength of the printed part.
In recent years, interest has grown in using artificial intelligence (AI) to optimize these processes. AI algorithms, including machine learning and deep learning, have the potential to analyse and optimize g-code in ways that surpass traditional approaches, offering higher print quality, greater energy efficiency, and shorter production times.
This work explores the modification of print parameters recorded in g-code files through the use of AI, demonstrating that the modified files produce prints with improved mechanical strength. A large language model (ChatGPT-4o) was used to selectively modify nozzle temperature parameters in g-code files, based on prompt engineering and filament datasheets. Tensile samples made from Easy PLA and Easy PET-G filaments were printed and tested in three-point bending, in accordance with ISO 14125. The samples were divided into three groups: unmodified (reference), modified every 2 layers, and modified every 3 layers.
The results showed an increase in the average breaking force for PLA samples by 2.7% and 3.0%, and for PET-G samples by 4.3% and 9.9%, respectively. Comparative analysis of the g-code files confirmed that the AI introduced cyclic temperature changes (increase in M104 commands from 3 to 30), improving interlayer adhesion. The flexural strength improvements were consistent with these modifications.
In conclusion, AI-driven g-code optimization offers a simple and effective way to improve the mechanical properties of printed objects without altering geometry or increasing material usage. This approach holds great potential for advancing additive manufacturing processes, particularly in the context of Industry 4.0.