Source-linked AI summary

LLM-3D Print: Large Language Models To Monitor and Control 3D Printing

Yayati Jadhav, Peter Pak, Amir Barati Farimani

arXiv:2408.14307v3cs.CLcs.AIcs.LG

TL;DR

Material-extrusion defects can be hard to detect, while deep-learning approaches need labeled data and may not adapt across tasks. This paper introduces an LLM framework for detecting printing issues, and reports defect recognition closely matching human evaluations alongside dynamic parameter adjustment.

  • Problem

    Some print defects lack strong sensor signatures, while deep-learning methods require large labeled datasets and may not adapt across tasks or scenarios.

    Source: Introduction · pp. 4, 6
  • Method

    The paper introduces a framework that leverages LLM multimodal capabilities to detect issues during 3D printing.

    Source: Introduction · p. 8
  • Results

    The framework identified major defects closely matching human evaluations and dynamically adjusted print parameters.

    Source: Conclusion · p. 34
  • Takeaways & Limitations

    In the evaluated workflow, LLM agents combined defect recognition with dynamic print-parameter adjustment.

    Source: Conclusion · p. 34

    The LLM may sometimes generalize or conflate closely related print anomalies.

    Source: LLM Identified Defects · p. 30

Abstract

from arXiv · show

Industry 4.0 has revolutionized manufacturing by driving digitalization and shifting the paradigm toward additive manufacturing (AM). Fused Deposition Modeling (FDM), a key AM technology, enables the creation of highly customized, cost-effective products with minimal material waste through layer-by-layer extrusion, posing a significant challenge to traditional subtractive methods. However, the susceptibility of material extrusion techniques to errors often requires expert intervention to detect and mitigate defects that can severely compromise product quality. While automated error detection and machine learning models exist, their generalizability across diverse 3D printer setups, firmware, and sensors is limited, and deep learning methods require extensive labeled datasets, hindering scalability and adaptability. To address these challenges, we present a process monitoring and control framework that leverages pre-trained Large Language Models (LLMs) alongside 3D printers to detect and address printing defects. The LLM evaluates print quality by analyzing images captured after each layer or print segment, identifying failure modes and querying the printer for relevant parameters. It then generates and executes a corrective action plan. We validated the effectiveness of the proposed framework in identifying defects by comparing it against a control group of engineers with diverse AM expertise. Our evaluation demonstrated that LLM-based agents not only accurately identify common 3D printing errors, such as inconsistent extrusion, stringing, warping, and layer adhesion, but also effectively determine the parameters causing these failures and autonomously correct them without any need for human intervention.

Introduction

The introduction motivates pre-trained LLM supervision by highlighting the error-prone nature of material extrusion and the limits of existing monitoring and correction approaches. It presents a multi-agent framework to monitor 3D prints, diagnose defects, apply corrective actions, and support printer and part adaptability without pre-existing datasets, alongside process documentation for quality assurance and traceability.

Introduction

  • Pre-trained LLMs are presented as a potential response: supervisor agents evaluate print quality, identify failures, gather relevant information, and plan parameter adjustments.The introduction points to LLM instruction-following and emergent reasoning as relevant capabilities (71,72; 73,74).Source: Introduction · pp. 3, 6
  • 20% of PLA prints fail, ABS prints have a 34% material waste rate, and overall failures reach 41.1%, with human error accounting for 26.3%.Such failures waste material, energy, and time and limit AM use in end-use products, particularly safety-critical applications.Source: Introduction · p. 4
  • Sensor-based monitoring can miss defects without strong physical signatures, while sensor cost and complexity and computer-vision calibration needs hinder broad adoption and generalization.The introduction also notes that simulation-based optimization can be computationally expensive and impractical for production compared with per-layer LLM inference in seconds rather than hours.Source: Introduction · pp. 4–5
  • Many machine-learning approaches address limited modalities or parameters, lack real-time recovery, and require large labeled datasets while struggling to adapt across tasks and setups.The introduction frames this flexibility gap as a challenge for detecting multiple defects and optimizing parameters across printers and parts.Source: Introduction · p. 6
  • The framework assigns print monitoring and defect resolution to specialized LLM agents coordinated by a supervisory LLM.The system identifies errors, qualitatively assesses print quality, gathers information, and addresses issues.Source: Introduction · p. 8
  • Correcting defects in subsequent layers can avoid discarding the entire part, improving efficiency and reducing material waste.Source: Introduction · p. 8
  • After each layer, top- and front-view images and the part description are analyzed by an LLM to evaluate print quality and identify defects.The print is paused for image capture after the extruder moves to its home position.Source: Introduction · p. 8
  • When an issue is found, agents plan diagnostic queries, retrieve printer data through its API, generate and execute a solution, and verify parameters before resuming the print.A supervisory LLM invokes the information and solution planners and tracks the agents’ conversation to coordinate their actions.Source: Introduction · pp. 8–9
  • The supervisory LLM tracks communication among agents and orchestrates their actions to coordinate the workflow.Agents are invoked when needed to support system coordination and efficiency.Source: Introduction · pp. 9–10
  • The framework adapts print parameters across printers, parts, materials, geometries, and settings without requiring a pre-existing dataset.It dynamically fine-tunes process parameters for each part.Source: Introduction · p. 10
  • Process commentary supports quality assurance and traceability by documenting manufacturing, aiding certification, and reducing the need for destructive integrity testing.The paper also connects this commentary with compliance with industry standards and regulations.Source: Introduction · p. 10

Methodology

The methodology organizes image-based defect detection, information gathering, corrective planning, and printer interaction into coordinated modules. The agents share state, adapt plans to detected failures, and check printer responses while executing actions.

Methodology

  • Seven coordinated modules divide defect analysis, information gathering, solution planning, printer execution, and supervision.The Supervisor Module maintains shared state and activates modules as needed.Source: Methodology · p. 10

Error Detection

  • After each layer, two camera views and the previous layer’s images are provided to the VLM to assess print quality and identify visible failures.A prompt instructs the model to return structured, actionable observations.Source: Error Detection · p. 12

Supervisor Agent

  • The Supervisor Agent stores module updates and printer interactions in a shared state dictionary, coordinating which module runs next.Modules update their status so later stages have current information.Source: Supervisor Agent · p. 12

Planning Agent

  • An adapter tailors reasoning prompts to detected failures, and the planner uses them to form an actionable plan for printer API interactions.Executor agents collect data and implement solutions through the printer API.Source: Planning Agent · p. 13

Executor Agent

  • The executor uses ReAct to monitor printer responses and revise endpoints or G-code when an action is insufficient, repeating until the desired outcome.The executor evaluates each command’s output and adapts its next action based on feedback.Source: Executor Agent · p. 13

Experimental Setup

The experimental setup connects a camera-equipped printer to LLM agents that can query and adjust operating parameters. Tests used two model versions and two filament materials, with safeguards on the commands available to the model.

Experimental Setup

  • A modified desktop printer setup uses Klipper and two cameras to stream top and front views of the ongoing print to the multimodal LLM.The top camera captures in-situ images for defect evaluation; the Moonraker API exposes printer parameter changes.Source: Experimental Setup · p. 14
  • The framework was evaluated with ChatGPT-4o and ChatGPT-4.1 using PLA and TPU filaments.TPU was included to test adaptability to a more flexible, mechanically demanding material.Source: Experimental Setup · pp. 14–15
  • Because full firmware documentation exceeded the model’s 128k-token context limit, the LLM received a curated list of modifiable G-code objects.The summary excluded potentially destabilizing commands such as shutdown, restart, and permanent firmware modification.Source: Experimental Setup · p. 15
  • Layer shift was excluded from evaluation because it is catastrophic and cannot be corrected without discarding the print.The printer API provides access to settings including toolhead temperature, print speed, extrusion rate, and fan speed.Source: Experimental Setup · pp. 14–15

Result

The results assess parameter-based corrections for print defects across single- and multi-layer prints, printer configurations, toolpaths, and geometries. Print quality and compression performance improved in the tested settings, though stringing remained difficult to eliminate under tested multi-layer conditions.

Result

  • Evaluation covered multi-layer wrench and raised-text prints, plus single-layer tests divided into four segments and analyzed after each segment.Source: Result · p. 16

Multi Layer Prints

  • LLM-optimized multi-layer prints had cleaner edges, smoother surfaces, consistent extrusion, and uniform layer adhesion, unlike baseline prints with deposition skips, under-extrusion, and poor bonding.Source: Figure 3 · p. 17, Multi Layer Prints · p. 18
  • Layer-wise analysis showed improving layer quality and infill patterns in LLM-optimized prints, while baseline quality deteriorated as printing progressed.Source: Multi Layer Prints · pp. 18–19
  • Stringing from pausing and homing persisted despite retraction adjustments, as high flow, low speed, and elevated temperature made it difficult to eliminate.Source: Multi Layer Prints · p. 19

Parameter Optimization

  • For PLA, reducing speed to 75% and slightly raising flow above 100% smoothed deposition, addressed under-extrusion, and increased occupancy throughout the single-layer print.Source: Parameter Optimization · p. 20
  • For PLA, pressure advance up to 0.1 reduced stringing and blobs, while retraction flow around 25% mitigated oozing and stringing between travel moves.Source: Parameter Optimization · p. 20
  • For TPU, raising nozzle temperature to 220°C improved melting, flow, and layer adhesion while reducing stringing and improving layer consistency.Source: Parameter Optimization · p. 20
  • For the multi-layer wrench, the LLM identified off-nominal speed and extrusion rate, monitored Z position, and persistently tried to correct a misalignment detected at Layer 10.Source: Parameter Optimization · pp. 20–21
  • For raised text, the LLM responded to signs of under-extrusion with parameter adjustments and fine-tuning that eliminated stringing between letters in the final print.The optimization process targeted print speed and flow rate.Source: Parameter Optimization · p. 21

Cross-Platform Validation

  • After approximately 5 iterations, the system identified manifestations as under-extrusion and corrected them by adjusting extruder speed, temperature, and extrusion multiplier to compensate for fixed toolpath limitations.Baseline samples showed seam gaps and incomplete infill–perimeter bonding, while LLM-optimized prints showed consolidated features; measurable improvements included seam quality, bonding, and surface consistency.Source: Figure 5 · p. 22, Cross-Platform Validation · p. 23

Experimental Validation

  • Peak load capacity increased 5.06× for square, 1.60× for hexagonal, 1.34× for hemisphere, and 2.46× for auxetic structures.The square samples rose from approximately 0.8 kN in baseline prints to over 4.0 kN in LLM-optimized prints.Source: Figure 6 · p. 24, Experimental Validation · p. 25
  • LLM-optimized samples also showed higher peak loads, smoother load progression, and more predictable failure patterns than baseline samples.Baseline samples exhibited premature failure and erratic load-displacement relationships, corresponding to visual defects observed during printing.Source: Experimental Validation · p. 25

Discussion

The discussion examines how LLMs detect print defects and use live printer data to guide corrective adjustments, including performance relative to human evaluators and challenges with subtle or visually similar defects. It also describes the framework’s unsupervised, adaptable monitoring approach and safeguards for runtime control and security-sensitive deployment choices.

Analysis of LLM-generated Response

  • The LLM did not flag a blob artifact, suggesting limitations in recognizing less distinct defects, though it correctly identified blobs and zits in layers 10 and 14.The blob visually resembled stringing, which may have led to its misclassification.Source: Analysis of LLM-generated Response · p. 26, LLM Identified Defects · p. 30
  • Using live flow, retraction, fan-speed, and Z-offset data, the LLM linked stringing, poor adhesion, and under-extrusion to relevant process variables and issued corrections.It increased retraction to reduce stringing, adjusted Z-offset for adhesion, and raised the extrusion multiplier for under-extrusion.Source: Analysis of LLM-generated Response · pp. 26–27
  • After earlier changes only partly improved the print, the LLM increased flow from 105% to 110% and retraction speed from 50 to 55 mm/s.It connected stringing to retraction behavior, poor adhesion to a manually introduced Z-offset perturbation, and under-extrusion to insufficient flow.Source: Analysis of LLM-generated Response · p. 27

LLM Identified Defects

  • On single-layer prints, the LLM identified common failures from visual cues, proposed plausible causes and targeted actions, and aligned strongly with expert annotations without retraining.Detected issues included stringing, under-extrusion, nozzle clogs, inconsistent print speeds, and bed-leveling issues.Source: LLM Identified Defects · pp. 27–28
  • In multi-layer prints, the study compared LLM detection with participant responses and expert annotations, reporting near-human-level diagnostic capabilities in common error scenarios and naming bed adhesion failures, warping, and layer separation as complex defects.The user study involved a diverse cohort of 14 engineers.Source: LLM Identified Defects · p. 29
  • Subtle defects were not always labeled consistently, and compressed image resolution may have limited detection of anomalies requiring high visual fidelity.Some participants reported cracks, ghosting, ringing, and elephant foot that expert annotations did not confirm, underscoring the value of expert-labeled ground truth.Source: LLM Identified Defects · pp. 30–31
  • The LLM showed strong precision and recall for extrusion issues and stringing/oozing, while human respondents more often over-identified subtle defects, producing more false positives.The comparison used confusion matrices against expert annotations.Source: LLM Identified Defects · p. 31

Generalization Without Supervision

  • Without fine-tuning or labeled examples, the framework uses prompt-based reasoning to diagnose diverse defects, link them to printer parameters, and propose corrective actions.It was demonstrated on a consumer-grade MEX printer without device-specific tuning; occasional per-layer misattribution was reported, but aggregate performance improved structural outcomes.Source: Generalization Without Supervision · pp. 31–32

Data Security

  • The system changes runtime parameters but never overwrites slicer-generated G-code; external reasoning uses abstract defect descriptors and machine metrics, not design files or toolpaths.This partitioning is described as posing minimal risk of sensitive-data leakage.Source: Data Security · pp. 33–34
  • Sensitive vision and control modules can run locally, while general reasoning can use external services; full local deployment is also supported for confidentiality needs.This modular deployment lets organizations balance model capacity, resource constraints, and confidentiality.Source: Data Security · pp. 33–34

Conclusion

The GPT-4o framework detects printing defects, identifies related parameters, and adjusts them during printing. It identifies major defects, closely matches human evaluations, and reports improved print quality and reduced material waste.

  • The framework identifies major defects including stringing, oozing, layer separation, and inconsistent extrusion, closely matching human evaluations.The conclusion describes the defect detections as closely matching human evaluations.Source: Conclusion · p. 34
  • Dynamic parameter adjustments improve print quality and reduce material waste, while the proactive approach aims to minimize defect recurrence.Source: Conclusion · p. 34
  • After recognizing a defect, the LLM analyzes print speed, flow rate, temperature, and retraction settings to identify contributing parameters.It then initiates an optimization process and adjusts parameters to address detected issues in subsequent layers.Source: Conclusion · p. 34
  • The framework generates manufacturing commentary and defect reports that support traceability and automated documentation of issues and adjustments.The conclusion also links the documentation to root-cause identification and streamlined quality control.Source: Conclusion · pp. 34–35
  • The conclusion presents detailed process records as aiding part certification and compliance with industry standards.Source: Conclusion · p. 35

Supplementary Information

The supplementary information identifies materials for image-based defect detection, reasoning, and the planning and execution agents.

SI 1: Image prompt

SI 2: Reasoning Modules

SI 3: Planning agent prompts

SI 3: Executor agent prompts

SI 4: Expert annotations

The expert annotations record LLM and human defect labels alongside comments on individual print layers. The examples include both shared and differing defect classifications.

Loading 2408.14307v3…