Im using a Nema 17 stepper motor model: 17HS4401S. its running from a A4988 stepper driver.
When i run it from home assistant it doesnt move smoothly. it vibrates and sounds like its skipping steps. making the torque pretty bad too. At first i thought it was the wiring but i diconnected the step and dir pin, plugged it into a arduino and ran it and it was quite and smooth with no issues. is there something wrong with my code? or soemthing im msising when it coems to running steppers on ESPhome? its with a ESP8266 btw (D1 mini version)
Had to check and it is not running pwm but just giving high pulses.
How do you power the motor, driver board and the esp? If you take 3.3V from esp to the driver it may be that esp 3.3v regulator is not powerfull enough.
How long is the wire for the step pin and did you change it for arduino test?
That may be it, cause the Arduino does out put logic levels of 5V where as ESP is 3.3V. As for wires they arent any more than 3 inches. they should be causing any issues.
If you don’t have separate 3.3v regulator you can power the driver board from arduino and have the esp connected to driver itself with signals.
Just connect the grounds to each other’s between arduino and esp.
Arduino 3.3 regulator is not good either so alternatively you can power the driver board with 5 voltage but have a diode in series so it will make a small voltage drop. Then the 3.3v signal from esp to ~4.3 v powered driver board will more reliably follow the high pulses.