科研 Skill
LLM驱动FDM打印逐层监控
llm-3d-print-monitor
Monitors an FDM print layer by layer through Klipper/Moonraker, diagnosing defects from camera images and applying safety-bounded G-code corrections. Use to watch or fix a live 3D print.
SKILL.md
LLM-3D Print monitor
Runs the closed loop from LLM-3D Print: Large language models to monitor and control 3D printing (Jadhav, Pak & Barati Farimani, Additive Manufacturing 114 (2025) 105027; code at github.com/BaratiLab/LLM-3D-Print-Large-Language-Models-To-Monitor-and-Control-3D-Printing). Each layer:
- The printer pauses and parks.
- You inspect the images.
- You gather information from the printer.
- You plan a fix.
- The fix is checked and sent.
- The print resumes.
In the paper, a team of agents did this with GPT-4o. Here you are the vision model and
the planner. scripts/printer.py is the executor and the supervisor. It enforces stage order,
blocks unsafe G-code, and logs everything.
Set up (once per printer)
- Follow
references/klipper_setup.md:- two webcams named
topandfront; [pause_resume]and[firmware_retraction];- the
LAYER_INSPECTmacro.
- two webcams named
- Insert the pauses into the sliced file:
python scripts/add_layer_pauses.py part.gcode part_mon.gcode [--every N]. - Ask the user for the printer URL, the material, and a one-line description of the part. Knowing the part stops you from flagging intended features.
- Rehearse first on the mock printer:
python scripts/mock_moonraker.py --port 7125 --fault underextrusion(orstringingornone), withMOONRAKER_URL=http://127.0.0.1:7125.
The loop
Use one session folder per job, set MOONRAKER_URL, and let P = python scripts/printer.py --session runs/<job>.
P wait # blocks until paused at the next layer (or reports the print done)
P snapshot # saves layer_N/top.jpg, front.jpg and occupancy
-> Read both images. Write detect.json. (format and guidance: references/stages.md)
P record detect detect.json
if problems:
P query extruder gcode_move firmware_retraction # pick objects that separate the causes
-> Write plan.json: 1-2 levers from references/playbook.md, each with a why.
P record plan plan.json
P apply # dry-run: shows the safety verdict for every line
P apply --live # all-or-nothing; refused plans send nothing
P resume --live
Repeat until wait reports complete, then run P report for the markdown log. Every
detect, query, plan, verdict and resume for each layer is kept in runs/<job>/session.json.
Rules
- Dry-run first. Without
--live, nothing that changes the printer is sent. On a new printer, do the first few layers in dry-run, show the userreport, and go live only once they agree. - Change little, then look. Use one or two levers per layer, within the step sizes in
the playbook. The next layer's image and its occupancy change tell you whether the fix
worked. Say so in
previous_solution. If the same lever has failed twice, stop pushing it. Name the probable hardware or material cause (clog, wet filament, worn nozzle) and tell the user. - Stop and tell the user about layer shift, spaghetti, a detached part, anything mechanical, or a fault that keeps coming back. Do not resume a print you think is lost. Ask.
safety.pyis the authority on what is sendable (references/safety.md). Never work around a refusal by sending raw requests to Moonraker. If a bound is wrong for this material, ask the user to pass--limits.- Occupancy (occupied pixels / total) is a number that supports your judgement. Your visual judgement decides.
- Respect the user's time. With
--every 1, each layer waits for you. For long prints, suggest--every 3to5after the first layers look good.
What the paper reported
- The VLM detected failures with accuracy comparable to 14 engineers, evaluated with a confusion matrix over common failure modes.
- Closed-loop corrections improved prints of the "CMU" letters and other parts across layers.
- Typical changes: speed to about 75% (
M220), flow slightly above 100% (M221), pressure advance up to 0.1, retraction about +25%, a 220 °C nozzle for TPU, and small Z offsets. - Unsafe classes (shutdown, restart, firmware) were excluded.
- Its logs also show what to avoid. Several changes per layer let speed ratchet down to 30% and retraction up to 7 mm. That is why this skill caps steps and cumulative drift.
示例提示词
打印过程中帮我逐层看摄像头图像,检测挤出不足并调整打印参数。
所属插件
安装该插件会一并获得同领域的 35 个 Skill / MCP。
同插件的其他科研 Skill
- FDM增材制造可制造性设计Checks an existing STEP part for FDM printability with the AgentsCAD method: overhang detection, reorientation, chamfers, and kernel plus visual verification. Use for DFAM review before 3D printing.
- 激光粉末床合金可打印性筛选Screens metal alloy compositions for laser powder bed fusion printability using CALPHAD or built-in thermophysical data and Rosenthal melt pools. Use when choosing or qualifying an AM alloy.
- 增材制造文献问答检索Answers additive-manufacturing questions from the user’s own PDF library with page-cited evidence via retrieval. Use for literature-grounded AM questions instead of relying on memory.
- CADSmith文本生成CADGenerates dimensionally exact CadQuery CAD from natural language using the CADSmith plan-code-validate-refine loop. Use when the user describes a part in words and wants a CAD model.
- OpenFOAM CFD仿真自动搭建Sets up, runs, diagnoses, and reports OpenFOAM CFD cases from a plain-language request using registered flow families and deterministic accept/reject validators. Use for guided OpenFOAM case setup.
- 机械设计评审文档汇编Assembles a mechanical design-review package: requirements traceability, design FMEA with RPN, costed multi-level BOM, risk register, and a PDR/CDR checklist. Use when preparing a design review.
- 面向制造的可制造性评审Reviews a part or assembly for CNC machining, sheet metal, injection molding, casting, or 3D printing manufacturability, flagging rule violations. Use when the user asks for a DFM/DFMA check.
- 工程图纸与GD&T审查Reviews mechanical drawings (PDF, image, or DXF) for dimensioning errors, GD&T misuse, datum problems, and ASME Y14.5/ISO GPS compliance. Use when checking a drawing before release.
- 工程计算报告生成Turns engineering calculations or scripts into a formal calculation report with objective, assumptions, equations, and unit-checked results. Use for a calc report ready for sign-off.
- LLM-SR方程发现Discovers interpretable equations from engineering data with the LLM-SR loop: skeleton proposals, constant fitting, and out-of-domain scoring. Use for symbolic regression on experimental data.
- 疲劳断裂寿命分析Estimates fatigue life and crack-growth life for metal parts from S-N data, load histories, and fracture-mechanics inputs. Use for Miner’s-rule damage, rainflow counting, or Paris-law crack growth.
- 图像直接生成FDM G代码Converts a photo, sketch, or slice image of a flat or near-flat part directly into FDM G-code without CAD, via silhouette and toolpath extraction. Use for sketch-to-print without modeling.
- 点阵结构刚度逆向设计Designs 3D-printable lattice unit cells for a target stiffness using TPMS cells, printability checks, and voxel homogenization. Use for lattice infill or metamaterial design.
- 平面连杆机构综合Synthesizes planar four-bar or six-bar linkages whose end-effector traces a target curve, using graph-based topology and forward-kinematics search. Use for mechanism path-generation problems.
- LLM迭代桁架优化设计Designs and optimizes 2D trusses with an LLM-in-the-loop FEM workflow where proposed members are scored by an exact truss FEM. Use for iterative truss topology or sizing optimization.
- L-PBF缺陷区间预测Predicts L-PBF defect regime (keyholing, lack of fusion, balling, or none) from process parameters and checks melt-pool dimensions against standard criteria. Use when selecting LPBF parameters.
- L-PBF熔池图像超分辨率Upscales low-cost webcam images of an L-PBF build plate to high resolution via registration and a trained diffusion or CNN model. Use for in-situ L-PBF monitoring with cheap cameras.
- 机械零件强度校核Sizes and checks machine elements: bolted joints, shafts for fatigue, bearings for L10 life, springs, welds, and gears, with shown work and safety factors. Use to size or verify a machine element.
- Ashby材料选型Selects engineering materials with the Ashby method: translate function and constraints into a performance index, then screen and rank a shortlist. Use when choosing between candidate materials.
- 产品逆向拆解分析Reverse-engineers a physical product as an engineering system: function structure, costed BOM, DFA index, should-cost, FMEA, and a printable HTML report. Use when asked to tear down a product.
- 力学教学图绘制Produces mechanics teaching figures such as Mohr’s circle, shear/moment diagrams, S-N curves, and free-body diagrams as PNG/SVG. Use when asked to draw or plot a mechanics concept.
- 增材制造熔池几何预测Predicts metal AM melt-pool depth, width, length, and mode (keyhole, lack of fusion, balling, desirable) from laser power, speed, and beam size. Use for LPBF parameter prediction.
- 自然语言参数化CAD建模Turns a plain-English or dimensioned part description into a parametric CadQuery script and exports STEP, STL, and a mass/volume report. Use when asked to model or generate a CAD part.
- FreeCAD自然语言建模Generates FreeCAD models from natural-language queries using the Query2CAD self-refinement loop: macro generation, error repair, and image-text scoring. Use for text-to-CAD in FreeCAD.
常见问题
LLM驱动FDM打印逐层监控能做什么?
Monitors an FDM print layer by layer through Klipper/Moonraker, diagnosing defects from camera images and applying safety-bounded G-code corrections. Use to watch or fix a live 3D print。
如何安装LLM驱动FDM打印逐层监控?
在科搭 Codar 左侧点击「插件」,在「组件」页签搜索「LLM驱动FDM打印逐层监控」并安装;在 Claude Code 或 Codex 中可以发送本页的安装提示词,或下载 Skill 包后解压到 ~/.claude/skills 或 ~/.codex/skills。
LLM驱动FDM打印逐层监控需要哪些权限?
该科研 Skill没有声明额外权限;执行具体操作时仍由 Agent 按自身规则请求确认。
LLM驱动FDM打印逐层监控经过官方审核吗?
是。SpeedSkills 收录的每个版本都会记录内容摘要与权限声明,当前版本已通过安全审核。