I am trying to control a stepper motor with a Raspberry PI-3A running Python code using the DRV882 stepper controller IC. The problem is the sleep command is only good to 0.001 seconds, any smaller value it goes out the window. So I am thinking about using an Arduino micro board to achieve the microsecond step pulses ( **delayMicroseconds** command ) I just do not know which one t to use. The unit needs to have a min of 16 pGPIO pins and a supply voltage of 5VDC. Also, a way to burn the code into the board so I do not have to reload the code every time it boots up.
Any suggestions on what high-speed stepper motor I could use? The one I am using is very slow.
Actually, TORQUE is what is important. You need to use the highest voltage your controller is rated for and then set the current maximum for your motor.
For example, I have a stepper motor rated at 4.2 volts, But in a functioning commercial product with a custom controller, the power supply is 42 volts at 2 amps. They needed maximum torque for pumping drywall mud.
If your controller does not have a voltage limit of over 24 volts, get a different controller!
Do have an understand of what happens with your stepper motor if you request a new step while the current step is in progress? Nothing! That is why you need maximum torque and acceleration.
Here is the Python code that generates the step pulses with a 50% duty cycle.
while True:
GPIO.output(Step_Pin, not(GPIO.input(Step_Pin)))
sleep(Delay)
Here is a link to the motor Stepper Motor Data Sheet I do not see the torque value you talking about.
Yes, I do understand the request for a new step before the old step is not completed nothing will happen. Looking at pulses with an O-Scope the pulses are all over the place (not constant). I expected the sleep function not being constant, that's why I am looking for an Arduino board to do the required precise timing. This board will be controlled by Raspberry with a busy output so the Raspberry knows when the stepping is completed.
Any Arduino board will do and the appropriate stepper controller. You have a good PSU.
Remember, PYTHON is ALL interpreted code, not compiled code. And it changes with every new release! Still need to accelerate the stepper motor!
I am looking at the Adafruit ItsyBitsy 32u4 - 3V board. This unit will need to interface with, a Raspberry PI, thus the logic pins can not be over 3.3 VDC.
Does anyone know how much current it draws so I can design a power supply?