Hey, I'm trying to use stall guard with TMC2209, and a few months ago I used the following example:
https://gist.github.com/metalinspired/dcfe07ed0b9f42870eb54dcf8e29c1261
This uses the TMCStepper library and everything worked fine, but then a few weeks later when I tried that again it simply stopped working for me, I'm trying to troubleshoot that for a few months no with no results, which is why I'm desperately asking here.
Things I've tried so far:
Higher sensitivity ofc, tried to set the stall guard threshold to 255, didn't work.
Make sure that the RX, TX, EN pins are connected correctly.
Tried different arduino boards(2x nano, 2x uno).
Tried different TMC2209 drivers(I have a few, the same with all of them).
Tried to reinstall the TMCStepper library.
Tried to change the relevant parameters for stall guard(current, velocity, acceleration, TCOOLTHRS, SGTHRS).
Tried to use different motors.
As for what actually happens:
By using the monitor plotter, I can see that the SG_RESULT is indeed going below the stall guard value set by the driver.SGTHRS, and yet nothing happens when the motor stalls, DIAG pin doesn't change at all.
When checking the driver.SGTHRS() value(which should return the stall value set to it), it seems to return the correct value which I've initially set.
I can generally implement my own stall logic, but driver.SGTHRS seemed to work with the best accuracy when I first tested it and it worked.
I really have no idea what could've change, and I'm a bit lost, hopefully someone could help me troubleshoot this.
Thanks for the help.