Stepper motor not returning on its original position

Then its probably not fine :slight_smile:

Anyway you almost certainly need speed ramping for you motor (unless its ultra-tiny, which NEMA17 isnt), and you've not speed-ramped the pulses so it miss-steps and stalls etc.

The AccelStepper library allows automatic speed ramping and simplifies this greatly for you.