DRV8825 - Enable vs Sleep

Hi,

I‘m currently working on a 5-axes camera robot based on an ESP32 and 5 stepper motors (1x Nema23, 2xNema17, 2x Nema14). I use ¼ microstepping on all axes. The Nema23 is driven by a TB6560 driver (no issues), all others by DRV8825 (with issues). Since the final product should be mobile and driven by a big battery, I want to save power whenever the motors are not needed. Currently I use the „Sleep“ pin on the DRV8825, which works, but seems to have unwanted side effects. After disabling „Sleep“ mode the motors jerk for a short moment. It seems, that they are searching for their last microstepping home position. This is a no-go for a cam bot.

The alternative would be to use the „Enable“ pin of the stepper drivers. Does anyone know if this would prevent the twitching when waking up? Unfortunately, the data sheet of the driver does not help. This question is asked again and again on the Internet, but I have not found one satisfying answer yet.

If you look my setup, you can see why I prefer to ask before I change the wiring.

Thanx for all help,

Thomas

===
EDIT: Couldn't upload my jpg picture of my setup because of this: "Your attachment has failed security checks and cannot be uploaded. Please consult the forum administrator."

From a quick read of the DRV8825 datasheet I get the impression that SLEEP uses less power than DISABLE - i.e. it turns off more of the internal circuits and that their effect on motor position will be the same.

I suspect that both SLEEP and DISABLE will run the risk that when control is re-established the motor will move to the nearest whole-step position. There is also the risk that the external load on the motor might move it while motor power is off.

The sad reality is that stepper motors are very inefficient and not really suited to battery powered operation.

Maybe if you could ensure that the motor is at a full-step position before motor power is shut off there would be less likelihood of a move when the power returns.

...R

Hi Robin,

yes, Sleep disables more than Enable does. My hope was, that Sleep might disable the microstepping indexing table, but Enable might not.

The idea of stopping the motor at a full step location is excellent. I'll give it a try.

Demokrit:
The idea of stopping the motor at a full step location is excellent. I'll give it a try.

I will be interested to hear your results.

...R

Stepper drivers usually start at a particular 1/2 step position. The datasheet explains it, "the home state is 45 degrees". This should not matter as the starting position zero from your code's point of view is this home position. Be sure to stop at a multiple of 4 full steps from the home position to get the same electrical angle.

Note that once the motor is de-energized it won't hold position.

I‘ve now made three tests:

  1. Changed one driver to be enabled by "Enable" instead of "Sleep": Result: It still twitches, but a little less from my feelings. But here my feelings might be wrong. Still too much for a non-forgiving camera lens.

  2. Stopping at random full-step positions: Result: It twitches on re-enable as before.

  3. Stopping at full-step positions divisible by 4: Result: Absolutely smooth start without any shake or twitching. Perfect!

By the way, I only switch off the motors if gravity allows it (using tilt sensors). With the tilt axis this would only work in the lowest position (Limit 1), but pan, zoom and focus axis are not critical here.

Thanks for your help, Mark and Robin.