Problem: when change the direction after stopping, the motor vibrates but doesn´t really move. When I help the motor with my finger in the right direction, the motor drives correct with the full torque. Sometimes the motor will catch the speed until the it has to stop an changes the direction.
SETUP: An Atmega2560 delivers a PWM (1kHz, 50%) all the time. The Direction pin is changed after about 1000 steps. The !Enable pin determines if the next step should be performed.
(I have to control 15 motors simultaneously with a direction- and enablepin for every motor an one step (PWM) line for all motors)
An Atmega328P delivers per SPI the values vor the next step. This happens while the PWM pin is High. While the PWM pin is low the values are handed over to the !Enable and Direction Pins.
Motor: Nema 17 - 17HS4401-S, 1.7A, 42Ncm Vmot = 24V, Driver: DRV8825
I set the VRef to 0.85V.
Code: I don´t use the arduino libraries, it´s plan C, C++;
The Code seems OK, as the image shows.
I even tried a simple ramp. (1 Step, 10 steps disabled, 1 Step 9 steps disabld …)
All settings are only changed when the PWM pin is low and the enable pin is high to not interfere with the
Change of Direction with PWM (Step) Low:
Change of Enable with PWM (step) Low:
The PWM with 1kHz and the SPI communication while PWM is High.
Video of motor behavior:
I tried to change the PWM (Dutycycle, frequency), directionchange with ramps - without them, checked all the wiring many times, read manuals, forums, …
I am really stuck here since a view days.