ESP-StepperMotor-Server icon indicating copy to clipboard operation
ESP-StepperMotor-Server copied to clipboard

Possibility to control enable pin on the A4988 driver module. Otherwise the motor uses power when not rotating.

Open amigafan opened this issue 2 years ago • 6 comments

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

amigafan avatar May 26 '22 08:05 amigafan

@amigafan can you please provide some details on your feature request?

pkerspe avatar May 27 '22 08:05 pkerspe

My idea is to use an A4988 driver module together with a DRV8825 expansion board module. This expandion module requires Step signal, Direction signal and an enabled signal. When enable signal is low the driver is enabled. If the enable signal is low all the time, the step motor uses power even when it is not rotating. I like the ability to configure stepper motor, limit switch and rotary encoder. Br. amigafan

amigafan avatar May 27 '22 12:05 amigafan

Not sure why to combine those two boards but doesn't matter. So if I get you right, you do not want manual control over the IO connected to the enable pin but simply want it to get pulled low whenever a move is in progress and pulled high when the movement stopped? Correct?

pkerspe avatar May 27 '22 14:05 pkerspe

Yes, that is correctly understood. For some reason, the motor draws power as soon as the enable pin is low.

amigafan avatar May 27 '22 16:05 amigafan

Probably the driver powers the coils to keep the motor from spinning freely, in order to maintain its position. If you remove power, depending on your setup and use case, you might loose absolute precision.

pkerspe avatar May 28 '22 01:05 pkerspe

That sounds like a good explanation, without power the shaft is easy to turn around with your fingers. For my use, though, it's no problem.

amigafan avatar May 28 '22 14:05 amigafan

so for everyone having this issue you can now use the motor break function to control a driver enable pin. Basically instead of using it to activate a brake you use it to control the state of the enable pin when the motor is not moving: void setBrakePin(signed char brakePin, byte activeState = ESP_FlexyStepper::ACTIVE_HIGH);

pkerspe avatar Jun 30 '23 12:06 pkerspe