I use an arduino mega2560 with ramps and a4988 driver plus a nema17 stepper motor.
My problem is that sometimes without changing value of direction pin, the direction of stepper changes.
And my other problem is that for example when I make a code to turn 90degrees then delay it sometimes turns about 80degrees and sometimes turns about 100degrees.
What should i do to correct these problems???