Electronic – Stepper motor troubleshooting with Pololu DRV8825 Driver

driverpower supplystepper motor

I salvaged a bipolar stepper motor (QH4-4242), and a power supply from an old printer that I'd like to tinker with before scaling up to larger motors. With the limited knowledge about the stepper (such as current rating), but knowing that the power adapter has a 24V/.55A and 5V/.2A supply, I'd assume the stepper must have a rating equal to or less than .55A. I've found coil wire pairs by measuring resistance (found to be ~8.5ohms).

Using a Pololu board built around the DRV8825, I've followed the instructions on their website connecting the correct pins A1,A2,B1,B2, to the corresponding coil pairs. I've supplied the motor with the 24V/.55A output and tuned the current limiting trim pot while measuring the Amps in a single phase while the Step pin was high such that the current was .29A (since the phases only get 70% of the current at full stepping). And I've set the sleep and reset to high as instructed.

Using a FEZ Panda II as the microcontroller, I wrote a simple code that turns high the step pin and sleep pin for 1 s, then low for 1 s. The stepper motor makes a high pitch noise (as I've read is fairly normal for a chopper driver) and the shaft becomes difficult to turn, however it does not rotate. While the pins are low, if I slightly move the shaft from the 'cogged' location, when the pins are back to high the shaft rotates slightly as if to snap back into place. However it will not rotate nor step on its own.

I would very much appreciate any input or suggestions for debugging this issue.


Sorry for the confusion responders, I thought one thing and wrote another last night.
My high and low for stepping is 1000ms or 1 second.

Pseudo code would look like:


Update 2:

Per Richman's suggestion, I've added back to back LED's to monitor the switching of the polarity when a Step pulse is sent this appears to [pun] shed some light [/pun] on the problem. And indeed found the issue. The polarity was not switching when the Step signal was being sent. This was because in addition to sending a pulse to the Step pin, I was also toggling the sleep pin which enables/disables the power to the motor. I read this was done to minimize any high pitched noise, but I think I misunderstood and that enabling/disabling is done after ALL of the steps are carried out. That's sorted out now.
Sorry to the responders for the confusion with the timing, I'd give you all the right answer since I explained it wrong if I could.

One unknown consequence is that the stepper steps on its own when the Step pin is left at low. I am curious if this is because of noise in the signal which is perhaps causing the Step pin to toggle high/low even though my logic isn't telling it to? Or perhaps there is a grounding/shielding issue because if I touch the motor casing, wiring, or even just put my hand near it, it begins to step faster and faster eventually becoming erratic.

Any thoughts on this new conundrum?

Best Answer

I think you're driving the stepper motor too fast.

With a 1000uSec high and a 1000uSec low, you're producing a 500 Hz square wave. As such, you're trying to step 500 time a second.

Try slowing things down to maybe 50 steps/second (make your low duration 20 mS, or 20,000 uSec).

Related Topic