Turn off coils in servo library after stepping

41 views
Skip to first unread message

Sean Brennan

unread,
Sep 23, 2016, 4:42:46 PM9/23/16
to Developers
Hello, servo motors sometimes have small resistance. The step current and the holding current are usually different, and some applications, like horizontal turntables, require no holding current.  To that end I suggest a new parameter for the servo library called "zero_hold", which when true, will depower servo coils after stepping.  If false or not present, existing behavior, leaving coils powered between operations, will preserve existing behavior.  A nice goal would be a timer interrupt to pwm the holding current between steps but interrupts are limited and would need more documentation about such limitations.  Simply allowing the coils to take no power between stepping is enough for now I think.
It's a pretty easy change to:
 And I'd be happy to do it but the main git page suggests discussing here first so what do the stepper people think?
Thank you,
Sean

Adrian Godwin

unread,
Sep 23, 2016, 4:53:08 PM9/23/16
to devel...@arduino.cc
I'm not sure you want to depower them between steps, though that could be useful if you were moving them really slowly.

Between moves is the more common requirement .. but isn't this best done by the application code - since the library doesn't allow for sequences of moves, just single moves.

--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+unsubscribe@arduino.cc.

Sean Brennan

unread,
Sep 29, 2016, 11:44:39 AM9/29/16
to devel...@arduino.cc
Depowering the stepper coils when not stepping adds a wee bit of intelligence to the stepper library.  Actual stepper motor controllers can be configured with separate step and hold currents.  They also shape the stepping current into a more sinusoidal wave instead of square, but I digress.  The important thing is that when not stepping and powered, the motor is stalled, and high currents in a stalled motor can be straight up harmful.  I actually wrote my own stepper library that used PWM to have different currents but again I digress, sorry.

There are many applications that require no holding current after stepping, chiefly horizontal positioning like turntables for solar tracking (depowering is a bonus in solar apps) or 3D printer build table positioning.

I have a simple approach, just turn output off at the end of the step() routine:
Then a user could do something like:
foo.step(90);
do_heavy_lifting();
foo.step(-90);

And the motors will simply be depowered during the do_heavy_lifting() routine. If do_heavy_lifting() takes seconds it could keep the motors cool and reduce power.
Cheers,
Sean



Reply all
Reply to author
Forward
0 new messages