MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.3k stars 19.25k forks source link

[BUG] Default value of `Z_HYBRID_THRESHOLD` causes a mechanical crash when homing Z axis #27311

Open yunline opened 3 months ago

yunline commented 3 months ago

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

I was setting up my tmc2209 with sensorless_probing and hybrid_threshold enabled, When I tried to home the z axis, the nozzle crashed to the bed. I found the StallGuard is not working even though the motor is totally stall.

I read the datasheet of tmc2209 and found out why. According to TMC2209 DATASHEET (Rev. 1.09 / 2023-FEB-16) Page 59:

DIAG is pulsed by StallGuard when SG_RESULT falls below SGTHRS. It is only enabled in StealthChop mode, and when TCOOLTHRS ≥ TSTEP > TPWMTHRS

That means, Z_HYBRID_THRESHOLD should larger than the homing speed, or the StallGuard doesn't work. By default, Z_HYBRID_THRESHOLD is 3 mm/s, the homing speed of z axis is 4 mm/s. This is why the crash happened.

To fix this, I changed the Z_HYBRID_THRESHOLD to 5mm/s. It worked perfectly.

By the way, the default value of X/Y/Z_STALL_SENSITIVITY is 0. For tmc2209, this also turns the StallGuard off, causing crash when sensorless homing.

I think Marlin should change these default values to avoid crash and damage.

Bug Timeline

No response

Expected behavior

No response

Actual behavior

No response

Steps to Reproduce

No response

Version of Marlin Firmware

2.1.2.4

Printer model

No response

Electronics

No response

LCD/Controller

No response

Other add-ons

No response

Bed Leveling

None

Your Slicer

None

Host Software

None

Don't forget to include

Additional information & file uploads

config.ini.zip

yunline commented 3 months ago

The documentation is also misleading. It says "StallGuard is only active when the driver is in spreadCycle mode."

However, according to the tmc2209 data sheet, "It is only enabled in StealthChop mode".