esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
406 stars 26 forks source link

Support Trinamic stepper drivers #1479

Open nmaggioni opened 2 years ago

nmaggioni commented 2 years ago

Describe the problem you have/What new integration you would like

It would be nice to have advanced support for Trinamic's TMC series of stepper motor drivers. They would be a significant step up (pun intended) from the current generic A4988/ULN2003 component: they are all capable of driving a stepper way more silently and accurately than the aforementioned drivers, and some of them have features like sensorless stall detection that would allow for easier and improved setups for devices like roll-up blinds, other kinds of covers, and generally any mechanism that uses a stepper motor to interface something to HomeAssistant.

The TMC2209 is the prime candidate for a first integration: like any other product of the TMC series it can be already controlled by the existing component (STEP/DIR/EN pins) at a very basic level, but by interfacing with it through a UART its advanced capabilities can be taken advantage of. Among other things, the maximum stepping frequency (and thus the motor's rotational velocity) wouln't be capped by the ESP's clock frequency anymore since the driver can internally generate its own stepping signal when properly configured.

The 3D printing community is already making extensive use of these drivers and has produced extra documentation and libraries.

Please describe your use case for this integration and alternatives you've tried:

Additional context

sbasmanov commented 1 year ago

Hmm.. It seems there is fork with tmc2209, but looks like it's not maintained: https://github.com/glmnet/esphome/tree/stepper-tmc2209-new_uart But I found working config for it: https://gist.github.com/lumascet/d5a12a8ba942864726f4c34d10feba12

A roller blind

Found here: https://www.thingiverse.com/thing:5965826

UhtredTheBold commented 8 months ago

I don't know if it helps but I've managed to get the tmc2208 working with esphome, without a custom build, by using the standard A4988 component and inverting the sleep pin.

The step min and max range need to be much higher too, i've set mine to range of 400000 instead of 200 in the examples in the documentation.

Edit - Sorry, ignore. I see this feature request is more about UART and the advanced features.

swifty99 commented 8 months ago

that would be great.

However, before this is done, the stepper driver itself needs an overhaul. It is driven in SW and not reliable. See: https://github.com/esphome/issues/issues/3297#issuecomment-1344087414

So far using a dedicated ESP (not running ESPHOME) for stepper functions is my way to go.

Jan

iqubik commented 6 months ago

really need new stepper realisation

cchance27 commented 3 months ago

that would be great.

However, before this is done, the stepper driver itself needs an overhaul. It is driven in SW and not reliable. See: esphome/issues#3297 (comment)

So far using a dedicated ESP (not running ESPHOME) for stepper functions is my way to go.

Jan

Have a gist or anything showing how your doing that, new to embedded, and was really looking to use ESPhome with TMC2209 for the auto-homing for a blind broject but... ya seems that TMC support in esphome has stalled for seemingly a while.

Theres actually another fork of the fork it seems someone mentioned on reddit, pushing the tmc2209 support a bit further, but again.. its a fork, sad to see mainline not moving for this i guesss its because its a bigger undertaking but 2+ years is :(