Stepper motor running uneven
Forums:
I'm experementing with a stepper motor and the zeroborg.
When I use the included zbStepper.py script and run the motor for a lot of sequential steps the speed of the motor varies. I'm using a motor I bought of amazon: https://www.amazon.co.uk/dp/B011NRMXYO/ref=pe_385721_140927991_TE_dp_1
And I use a 2A power supply.
Here is a video that shows the problem:
https://www.youtube.com/watch?v=5fsmmr1uiJg
You can hear it more then see it.
piborg
Mon, 07/18/2016 - 11:16
Permalink
Stepper motor speeds
There are two different likely explanations for this problem:
In the case of #1 you should try increasing the
stepDelay
value and see if it helps.I would start by doubling it and see what effect that has.
In the case of #2 the Raspberry Pi is probably trying to do other things at the same time.
The example uses
time.sleep
to perform the delay.This can be a problem as it only guarantees the delay to be at least that long, it can be longer if it wants.
To help with sleep delays first try setting things up so that nothing else is running.
If this still does not help you can try
pygame.time.delay(stepDelay)
instead to get a more accurate delay time.