Hello, my project goal is to rotate a stepper motor at a constant speed to a set position and then reverse back to the starting point. Repeating this cycle hundreds of times. I am using the AccelStepper library, when the speed is set to a positive value the motor operates as expected at the constant speed. However, when the speed is set to a negative value to return back to the original location the motor operates at a much slower rate and vibrates heavily. To try and trouble shoot I attempted just sending the motor in the negative direction to simplify my code. Still running into the same problem though.
Try not changing speed, just direction.. Example 2 motors back and fourth..
In the above example we were actually trying to get them to be out of sink slightly..
Also uses non-blocking routines..
Same issue unfortunately, I tried using my second posted code but changing the speed to positive since it is going to a 'negative' position. But yah same issue
Please show a schematic and a picture of your actual setup. How is the motor powered? What motor (datasheet, Nema14 tells nothing about the electrical data)? Did you setup the motor current accordingly?
A schematic is still missing. And the picture doesn't show your complete setup. A link to the full datasheet would be more helpful. Are you sure the coils are connected correctly?
9V is a minimum for your stepper and board - more would be better. How many amps can your PSU deliver.
Something is very wrong if the driver is set to 2.2A and not heating up. Normally, the driver would simply overheat and shut down. It is completely unrealistic to expect 2.2A/winding from a hobby DRV8825 module, and the little heat sink shown in the photo is just for show.
You definitely have problems with your stepper setup. Please provide a wiring diagram (hand drawn is preferred), with pins, connections and part clearly labeled.
As a test, carefully follow the instructions in the DRV8825 data sheet to set the current limit to 1.0A/winding, and test the operation with no load on the motors.
Finally, keep in mind that it is unrealistic to expect any motor to instantly reverse direction while turning. Stop it completely before changing direction.
Do you have a DMM to check the wiring of the coils and that they are connected correctly to the DRV8825 ( A1/A2 to one coil and B1/B2 to the other and not crossed)?