i am using a stepper motor with a a4988 driver chip .
i did read the datasheet and the motor is supposed to advance one step with every low to high shift on the step pin , now that works but the behavior of the motor changes when i change the pulse length .
i can't understand why .
which means that
digitalWrite(pin,1); delay(1); digitalWrite(pin,0); delay(1);
and
digitalWrite(pin,1); delay(1); digitalWrite(pin,0); delay(10);
and
digitalWrite(pin,1); delay(10); digitalWrite(pin,0); delay(10);
looped 100 times give an unequal number of steps , what's even more confusing is that the first one gives 100 steps which is correct ,the second and the third give alot less than 100 (variable around 60 to 70)
no matter how much i read on the internet , i can't explain this
the motor is set to 4th micro-step , so 800 steps should do a 360 degrees turn .
now the code above works perfectly as it performs a 360deg turn then stops for 5 seconds and so on .
the second delay is 500us or in my real program in needs to be alot longer , if i change the function to delay and have a delay of 20ms , 30ms , 40ms , 100ms etc .. the result becomes almost always incorrect as it never performs a full turn before stopping for 5sec . the bigger the second delay get's the less the motor turns , according to the datasheet this makes no sense .
+there is an other odd thing , after a couple of minutes the motor get's so hot that i wouldn't be able to place my finger on it .
motor : 17hs2408
driver : a4988
power supply to driver : 12V dc 2A
arduino power supply : pc