Stepper Motor skipping/freezing on mico steps

Hello,

I am a novice working on a star tracker project. I am using this as my template and have made only a few changes.

Barn Door Tracker

This is the circuit.

Circuit

For R1, I am using a 220 ohm resistor instead of a 330 ohm due to the parts that I have on hand.

I am using this stepper motor and the DRV8825 motor driver.

For my 12V power supply I am using this battery pack.

When testing the circuit with the motor before assembly, everything worked great. I was able to fast forward, rewind, pause, and start the tracking. After assembling the entire tracker, everything still seemed to work correctly. Last night was the first time that I was able to take it out to do a field test. Things were off to an okay start while working on polar alignment. After some test shots I set it up for a 5 minute exposure. A minute or so into the exposure, the motor stopped stepping then started then stopped for good. I could still fast forward and rewind but the micro stepping for the tracking had stopped. I turned it off, restarted the process and then it happened again. I can't identify a pattern. Sometimes it will make it a few minutes before stalling, sometimes a few seconds. I can hear the motor click or buzz but no movement. If the circuit is off I can easily move the motor so there is no friction. IT's cold here so I thought that might play a role but it's been inside all night and I have the same results this morning.

I am happy to supply any more details that might be needed. Just looking for a push in the right direction. Thank you.

It's not clear from your description if the motor works properly when using full steps but fails when using microsteps.

Is it possible there is extra friction at some point in the motion that presents a too-great load for the motor?

How many steps per second do you want the motor to move? For higher speeds a higher voltage will be better. The DRV8825 can work with up to 45v. Just make sure that the current limit is set correctly for your motor.

I presume you have some timing calculation in your program. Are you using appropriate variables for the time values so that they don't overflow?

If you need more help please post your program

...R
Stepper Motor Basics
Simple Stepper Code

I am having the same issue even if the motor is running without the load on it.

I have adjusted the vref on the DRV8825 to accommodate the 0.4A rated current on the stepper motor.

(0.4 = 2 x 0.2)

I am unable to post the code as it is too long but here is a link to github.

The motor is using 1/32 micro steps. Whenever I fast forward the stepping or rewind the stepping, it moves continuously without any stutter until I release the button. But only when I start tracking does the problem arise. IT will start stepping and seconds to minutes later it will eventually click but not move and then stop moving and clicking all together. I can hear the motor making some noise but it sounds electronic not physical. I was worried that I might have destroyed the motor by running it before adjusting the vref but I feel like it wouldn't respond to the other controls if that were the case. I have also switched out drivers since then as well.

ExtraBilly:
But only when I start tracking does the problem arise. IT will start stepping and seconds to minutes later it will eventually click but not move and then stop moving and clicking all together.

Almost certainly that is a programming problem rather than a stepper motor problem. Have you taken account of my comment about variables used for timing?

Please add your long .ino file as an attachment.

Better still, write a short program that illustrates the problem.

...R

I have attached the .ino file.

The code is not mine and others have used it for this type of project.

This morning I bought brand new batteries and swapped out the others and I have not been able to recreate the issue. I didn't think it was batteries because the other functions seemed to be working. Is it just coincidence or is it possible that the batteries were causing the issue?

Thank you for all your help so far, I greatly appreciate it.

stepper_speedControl.ino (22.7 KB)

ExtraBilly:
Is it just coincidence or is it possible that the batteries were causing the issue?

It seems reasonable to assume it was the batteries unless the problem returns.

...R