Skip to content

clog_detect: Adds nozzle clog detection#887

Open
EllaFoxo wants to merge 10 commits into
KalicoCrew:mainfrom
EllaFoxo:clog-detection
Open

clog_detect: Adds nozzle clog detection#887
EllaFoxo wants to merge 10 commits into
KalicoCrew:mainfrom
EllaFoxo:clog-detection

Conversation

@EllaFoxo

@EllaFoxo EllaFoxo commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Adds support for nozzle clog detection, by watching the extruder TMC stepper for stall events, and combining this with load cell force readings. The important factor here is the load cell force. Without it, the TMC stepper alone may incur false positives.

This is a standalone module, that works for both single extruder, and multi-tool/multi-extruder setups.

In order for users to enable this, they need to configure TMC StallGuard for their extruder motor. Documentation has been updated to reflect this.

This still needs further testing from the real-world testing I have already done.
Therefore, it is marked as a danger feature ⚠️ until we are happy with what we see.

Checklist

  • pr title makes sense
  • added a test case if possible
  • if new feature, added to the readme
  • ci is happy and green

@EllaFoxo EllaFoxo changed the title [WIP] clog_detect: Initial implementation of clog detection [WIP] clog_detect: Initial implementation of nozzle clog detection Jun 3, 2026
@EllaFoxo EllaFoxo changed the title [WIP] clog_detect: Initial implementation of nozzle clog detection clog_detect: Initial implementation of nozzle clog detection Jun 4, 2026
@EllaFoxo EllaFoxo changed the title clog_detect: Initial implementation of nozzle clog detection clog_detect: Adds nozzle clog detection Jun 4, 2026
@EllaFoxo
EllaFoxo marked this pull request as ready for review June 4, 2026 11:55
@EllaFoxo

EllaFoxo commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

In my own testing, this has been working great.

I have been simulating a clog by slowly reducing the hotend temp below what the material typically expects. I normally do ABS at 260C- adjusted this to 200C for testing.

Extruder skips a couple of steps, TMC DIAG is then enabled, print pauses.

[clog_detect]
force: 3000
clog_detected_gcode:
    RESPOND TYPE=error MSG="Clog detected! Printing paused."
    PAUSE
image image

@rogerlz

rogerlz commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Nice feature. Three things block it right now:

  • The diag pin lookup only reads diag_pin, but tmc2130/tmc5160/tmc2240 use diag0_pin/diag1_pin. Your own TMC5160 example in the docs uses diag1_pin, so following it hits the "no diag_pin found" error.
  • gcode.run_script() in _trigger_clog has no try/except. A bad clog_detected_gcode macro would crash klippy. See how filament_switch_sensor.py handles this.
  • The driver list includes tmc2208, which has no StallGuard/DIAG output, and tmc2262 does not exist in the tree. Better to trim the list and the docs to drivers that actually work.

A klippy test with a tmc2209 extruder plus a load_cell would catch the diag pin issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants