Using TMC2660 drivers as endstops

Hello everyone, I have a new project for you! I have been doing alot of research on Trinamic TMC2660 stepper driver chips as are being newly used on the Azteeg X5 GT, and I see tons of potential with using their StallGuard feature paired with STI connection as a great and simple replacement for endstop switches on most machines.
I wanted to throw it out to the community as I myself am a bit rusty on the specifics of smoothieware and whether or not it would be feasible to make this a reality, but I certainly see the potential and absolutely need this feature to exist as to simplify the machine’s wiring.

I came upon the “Smoothieboard Advanced Driver Support” page and it got me thinking that if smoothieware is already reading the SPI pins and stopping the machine’s movement in the event of a StallGuard collision then it could also be rerouted to making the event of a StallGuard collision act as the triggering of an endstop switch.

Thanks everyone, and I hope that we can figure this out!


Advanced Motor Driver- smoothieware. org/advancedmotordriver

Panucatt Azteeg X5 GT with support for TMC2660- panucatt. com/azteeg_X5_GT_reprap_3d_printer_controller_p/ax5gt.htm

Trinamic TMC 2660 info- trinamic. com/products/integrated-circuits/details/tmc2660-pa/#pinout-35

Bigfoot version of TMC2660- panucattdevices.freshdesk. com/support/solutions/articles/1000227573-bigfoot-bsd2660

(remove spaces for links)

Imported from wikidot

I was doing a bit of research and I was thinking it may be possible to reassign the endstop pin as the StallGuard pin of the TMC. I’m pretty sure that when it stalls it just raises that pin to the HIGH state. If so would that work as a functional ensstop?

It could work, somebody needs to try it.

Do you know how one would go about reading the StallGuard from the spi pins and making it where when error bits are received, such as a stall, an endstop is triggered? Currently there is the option in the firmware to read the spi pins for error data and if a stall is detected it sends a halt command to the machine. Would there be a way to reallocate that to trigger an endstop instead of stopping the machine? If so, how?

Anything like that would definitely involve quite a lot of new code, and I’m not sure how to actually do it efficiently or in a way that works well, reading data via SPI while homing to figure out a signal from the drivers sounds *very* difficult.

Do you think it would be more effective to solder a pin on the SG-TST Pin of a trinamic TMC2660? This pin reads high when stall guard is triggered. Theoretically one could connect this pin directly to an endstop input. Do you think that would work? Isn’t the board already reading the SPI pins for error bits anyway? In the config file for the SPI drivers there is the “motor_driver_control.alpha.alarm” configuration, using that doesn’t that mean that the board is already checking for stalls? Would it be simple to bridge this feature over to triggering an endstop? I am not very fluent in the coding aspect, so please inform me.

That would be extremely easier/simpler, and *should* work

I will be doing some testing with the chips today, confirming that that works as expected, and I will let you know my findings.

Okay, So now I have the pin reading 3.3 volts when the motor stalls, but I am not sure of the settings that I need to change to make the endstop pin trigger when 3.3 volts is applied. What should i do?

Just try it. If it doesn’t work try inverting the pin, same process as with any endstop really.

I have tried all of the settings that I know and when I connect the endstop pin to 3.3v It does nothing. When I ground the pin it detects the trigger, but no matter what setting I try I can’t get it to work. any advice? I need the endstop pin to trigger when 3.3 volts is applied.

have you tried o ?

What is that?

Found it, Open Drain. I’m about to try it.


Any luck on this?