Stepper Motor Idle Current

The motor driver box on my Sherline mill started out as a stock unit, but I’ve tweaked the circuitry to improve the analog performance. Those adventures formed the basis of my Above the Ground Plane columns in Circuit Cellar magazine columns for August & October 2004.

Because the firmware for the PIC microcontrollers wasn’t available, I wrote a clean-room version so I could show how it all worked for the column. My code won’t run on a stock Sherline board, though, so it’s not a drop-in replacement for the stock firmware.

One of the reasons I attacked the controller was to reduce the audible noise coming from the motors. That’s an inescapable part of chopped-current stepper motor drive circuitry, but the noise was modulated by all manner of things that shouldn’t have affected it; just touching the box shouldn’t make any difference at all. The fact that it did meant the circuit board had some, well, infelicitous layouts.

Although the final result was much more stable, I decided to turn off each motor if it didn’t move for at least five seconds; that’s a simple firmware tweak when you write your own code. As a result, the shop was quiet when I wasn’t actively milling.

Solar Measurements Circuit Board - Top Side
Solar Measurements Circuit Board - Top Side

Now, having a motor be completely turned off while milling is going on isn’t generally a good idea, because milling forces from the other axes can push the table against the leadscrew and, perhaps, turn the screw against the unresisting motor. I figured that on a Sherline mill, what with the sissy little cuts I take, that wouldn’t be a problem.

And I was right for the better part of four years!

A benefit of turning the driver circuitry off was that I could easily twist the knobs by hand to fine-tune the XYZ position during setup. That worked out really well.

However, drilling the seemingly simple circuit board pattern you see here (for my February 2009 CC column) produced exactly the right collection of forces (while drilling? Huh?), vibration (maybe) and motor pauses (for sure) to introduce an absolutely repeatable positioning error that Went Away when I tweaked the firmware to keep the motors enabled at all times.

I’ve since made another tweak that reduces the current to an idle level after five seconds. That both reduces the audible noise and drills the board correctly, so I’ll keep an eye on it for a while before declaring victory.

The PCB has a few unused (in my code, anyway) chip-to-chip connections that I could employ to let them all decide when nobody’s moving. I think turning the motors off 20 seconds after the last axis stops moving should work Just fine; my G-code doesn’t wait around that long except for manual tool changes.

Update: More on PCB drilling there.