Arduino Mega restarts after a few moves of Stepper Motor

Hello Experts,

I am fairly new to Arduino, I have a NEMA 23 Stepper Motor (12V 2.8A) powered through a Seedstudio Motor Shield V2.0 and programmed on Mega. The issue that I am facing is that the motor would move for a few minutes, after which the Arduino resets (restarts?) and goes back to init() and then loop() functions. I am using a 12V 5Ah sealed lead acid battery to power both the motor as well as Arduino board and I have a 47uF electrolyte capacitor across the power source.

Would appreciate if you can give me any pointers on how should I debug this issue - thanks in advance!

-Mrinabh

I have a 47uF electrolyte capacitor across the power source.

You might try a large capacitor between the mega 5v and ground to minimize voltage dips.

The Seedstudio Motor Shield V2.0 uses the ancient L298 motor driver chip, which is entirely unsuitable for a 2.8 amp stepping motor. Even if you solve the reset problem, you will have nothing but trouble with the current setup.

You should be using a modern motor driver like the DRV8825 from Pololu, although be aware that not even it can supply 2.8 amps/winding. Be sure to follow the instructions to adjust the current limit to 1.5 amps/winding.

Thank you very much for your responses - I appreciate it!

I tried with 1000uF and then 2200uF capacitors across power input. Though it improved (I think - I do not have comparable data though) on endurance (i.e. the system died after relatively longer time of operation), it did not resolve the issue.

I had initially planned on using DRV8825 based pololu driver, but the board which I have does not have heat sink on it - I will give it a try and let you know if I am able to get around the problem.

Once again appreciate your prompt responses.

-Mrinabh

You may find some useful stuff in stepper motor basics

A DRV8825 is not intended for a 2.8amp motor. You need a more powerful stepper driver that can manage 3 amps or more - and, unfortunately, more expensive. Gecko and Leadshine are some of the brands.

...R

Do you have separate ground wiring for motor and Arduino? If not then
you need to. Choose a single common ground point (most likely on the motor driver),
and wire separately from this to

  1. Arduino
  2. motor supply
  3. anything else you are powering.

In particular the motor currents should never flow along any piece of wire that carries
supply or ground current to the Arduino. Look up "star grounding"

Appreciate all your responses - very good points. I separated out the power supplies (Mega and Stepper lines separated) and ordered stepper driver from Pololu.

I forgot to mention that I had set motor speed at 60. When I changed it to 200 it looks like the setup is not tripping at motor movement.

I tried with 1000uF and then 2200uF capacitors across power input.

That is not electrically the same as between the mega 5v and ground. There should be a diode on the external power input that will prevent the capacitor from back feeding the motor when between 5v and ground.