I am trying to control Stepper motors which has a pulse input driver.
I have a speed of 1000pps, and I want to move 1 pulse at a time. So that means 1 pulse will take 1ms.
After I send a command to move 1pulse, I sleep for 1ms so the pulse can be completed before I can send another pulse
Below is my pseudocode
while(1)// loop forever
speed = 1000pps
pulses = 1;
move(pulses) //move the motor 1 pulse
sleep(1 millisecond) //sleep for 1ms
How ever when when I specify a distance of say 10000 pulses and instruct the motor to move at once, I get a perfect square pulse train with a period of 1.
Expectation I am expecting to see a square pulse train on the oscilloscope, where the on time will be equal to the off time. But instead the on time is 0.5ms and the off time is becoming 1ms. Is it possible to have the off time and off time both at 0.5ms while moving one pulse at a time?
say 10000 pulses
, then... you move(10000) and sleep 1 millisecond? Please edit your question to include the actual code. Please also report what happens when you move 1000 pulses, or just 1 pulse. $\endgroup$