By default the step commands have a delay of 1 milli second in that sample code, and I tried to decrease that as much as possible in order to increase the speed of the motor. Now the motor’s datasheet says maximum speed is 34RPM. I can only decrease the delays down to about 400 microseconds which gives me about 3RPM. If I put any number below 400, the motor no longer moves and it just makes a high pitched buzzing sound.
My MS1,2,3 are all set to LOW.
for(x= 1; x<10000; x++) //Loop the forward stepping enough times for motion to be visible
{
digitalWrite(stp,HIGH); //Trigger one step forward
delayMicroseconds(400);
digitalWrite(stp,LOW); //Pull step pin low so it can be triggered again
delayMicroseconds(400);
}
Thanks for the reply. Ok so I changed up my code a bit so I can make the motor accelerate. here is what i did:
for(x= 1; x<30000; x++) //Loop the forward stepping enough times for motion to be visible
{
digitalWrite(stp,HIGH); //Trigger one step forward
delayMicroseconds(350-(x/200));
digitalWrite(stp,LOW); //Pull step pin low so it can be triggered again
delayMicroseconds(350-(x/200));
}
What the above does is graudally decrease the delay hence speeding up the pulses. With this I am able to get to a lower delay time than I could before but once I reach about 220microseconds, the motor stalls again and I cannot go lower than that number. The motor does actually do 2-3 RPM more, but I am not able to achieve what I want as the speed is still very slow.
Btw, I even tried to use the <AccelStepper.h> library instead of manually controlling the pins but my motor still stalls.
Even when I set very low max speed and max acceleration. What am I doing wrong here, is it okay for MS1,2,3 to all be off so the stepper is on full step instead of 1/8 or 1/16?
What motor voltage are you using? How much current is available?
Has this combination of stepper and driver been recommended to you? On first glance, looks like you need a higher drive voltage, usually 5 or so to 1 to get good acceleration. Your driver can’t handle that much. Probably designed for 4-8V steppers (a guess).