My application involves auto focusing a camera. Thus, I need to move the stepper motor by small angles and hold the motor in that position. However, when I try to move the motor by 1 or 2 steps, it only makes noise and does not move.
I am using DRV8825 driver. I have tried this with motors from three different suppliers.
Do you have a datasheet or any detailed specifications for the motor you are currently using? Did you set the current limit on the driver board, and if so, what did you set VREF to? What kind of power supply are you using for VMOT? Does the code you posted compile and load onto the board properly? It appears that you are using a modified version of one of the examples in the “StepperDriver” library by laurb9 we link to in the resources for the driver, but your code is missing the declaration of the “stepper” object. Can you post pictures here that show your board and all of your connections including any soldered connections you made?
The code is not giving any errors and is loading successfully. And the set up functions properly when it is programmed to move for say 5 steps at a time.
I have not soldered any connection. I have only used Jumper cables.Below is the block diagram for the set up: IMG_20170913_124507496|281x500
Thanks for the additional information. Does that code work OK if you remove the lines that toggle the nSLEEP pin? It is likely that the DRV8825 returns the step indexer to the HOME position (shown in Table 2 of the DRV8825 datasheet) when the driver wakes up, which would just move the motor back to the position it was at previously. If you are trying to save power, you might try toggling the nENABLE pin instead.
Thank you for posting those pictures. I do not see any specific problems with your connections. You might try microstepping at a higher frequency. Also, adding a load to the motor (which provides some inertia) might help as well.
Please be aware that we recommend using an electrolytic capacitor near VMOT with our DRV8825 carrier boards to prevent damage from LC spikes.
The DRV8825 board you are using does not appear to be one we manufactured. You might try to get in touch with the distributor you purchased the driver from or the board’s manufacturer for additional support.