TMC2209 stall guard help

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.

Hi,
Assume we know nothing, what is "stall guard" and what is it used for?

Thanks.. Tom... :slight_smile:

TomGeorge:
Hi,
Assume we know nothing, what is "stall guard" and what is it used for?

Thanks.. Tom... :slight_smile:

Sorry, I assumed that only someone familiar with it would be able to assist me, but ofc, I'll try!
I'm using a stepper motor driver board by trinamic - TMC2209.
This driver has 2 very cool features which are stall guard and coolstep(this is based on stall guard).

In short - the driver can measure when a stepper motor stalls and then 'let you know' about it.
A different driver, but the principle can be much better explained here:

So I'm trying to make that work with my TMC2209(using UART), I managed to make it work in the past a few months ago, using the example I shared above(didn't change anything), then put it aside for a week and when I tried to use it again, it just never worked ever since.
I've stated above the things I've tried, I don't know...I guess something changed but I have no idea what and I believe I tried everything I can think of myself.
The complete datasheet of the TMC2209 can be found here:

Thanks for the help :slight_smile:

Got to 3rd page already, anyone possibly? :sweat_smile:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.