0
\$\begingroup\$

I've been stuck on this for a few days now and I can't seem to get my stepper to work.

Last week, I bought a stepper motor (nema 17 size, 1.5A) and an A4988 driver to play around with. I hooked it all up and was working great. The other day I decided to remove the pins from the driver and solder wires to it instead, which I don't think damaged it. When I hook everything up, the motor just vibrates and doesn't turn (It looks like it's moving a step forwared then one back constantly).

I've seen lots of similar questions on this site and none of the answers written there work for me. I have tried: switching the polarity of one of the coils, tested for continuity on the coils, tried a different power supply and grounded the MS pins (so that the driver is in full step mode).

I've got the driver configured to deliver about 1A to the motor and I'm using an arduino to control the step pin.

Below is my circuit digagram (Please Note, the switch is actually a toggle switch which either connects reset to ground or 5v, and the step pin of A4988 is actually connected to pin 9 on arduino):

Stepper Diagram

And here is my code for arduino:

  void setup() {
    pinMode(9, OUTPUT);
    digitalWrite(9, LOW);
  }

  void loop() {
    digitalWrite(9, HIGH);
    delay(10);
    digitalWrite(9, LOW);
    delay(10);
  }

Thanks for any help.

EDIT: Here is the link to some photos of my setup as requested by @Jakob Halskov http://imgur.com/a/QDqxh7W

EDIT 2: So after re-soldering alot of the connections on the driver (I also switched coil a and b around) and changing the 5v input pin on arduino (as suggested by @Jakob Halskov), the motor is now running, albeit with an extremely small amount of torque (It only takes a light touch to stop it). Later on I will test the motor at different speeds but I can't verify it works at the moment. The current delay is 10ms.

EDIT 3: Motor decided to stop working and vibrate again

\$\endgroup\$
7
  • \$\begingroup\$ Please add a good photo of your setup - maybe we will catch something:) \$\endgroup\$ Commented Aug 5, 2020 at 12:07
  • \$\begingroup\$ @Jacob Halskov I've added a link to some pictures. \$\endgroup\$
    – user248702
    Commented Aug 5, 2020 at 12:42
  • \$\begingroup\$ Do you really have 5V connected to "Vin" on the Arduino? \$\endgroup\$
    – JRE
    Commented Aug 5, 2020 at 13:46
  • \$\begingroup\$ Yes, 5v is connected to Vin \$\endgroup\$
    – user248702
    Commented Aug 5, 2020 at 13:50
  • \$\begingroup\$ Well, that's a problem. Vin goes to a 5V regulator. If you feed 5V to a 5V regulator, you get less than 5V out and it isn't properly regulated. Your Arduino is running on less than 5V, and what it gets may be unsteady enough to cause the Arduino to reset. \$\endgroup\$
    – JRE
    Commented Aug 5, 2020 at 14:32

2 Answers 2

1
\$\begingroup\$

I ordered a new A4988 board and it arrived today, I switched out the old one with it and the circuit now works great.

The problem must have been a faulty/damaged board or a bad connection.

\$\endgroup\$
0
\$\begingroup\$

If it was stopped the work after soldering upgrade, you should check all connections, especially motor's coil pins. Also, you should recheck with connectors instead of soldering to see if it is working with the previous setup. Another thing you can test is Pin9 of the Arduino. Is it really generating a pulse? because sometimes delay function not working properly.

\$\endgroup\$
7
  • \$\begingroup\$ Thanks for the reply, Ive checked arduino and it's definatly generating a pulse. I've also re-soldered the motor wires to be sure of any connection problem and still the same results. \$\endgroup\$
    – user248702
    Commented Aug 5, 2020 at 12:39
  • \$\begingroup\$ @Niall895 what is happening if you disconnect Arduino Pin9 and STEP pin connection. Is motor act the same? or stop buzzing. \$\endgroup\$ Commented Aug 5, 2020 at 12:53
  • \$\begingroup\$ When I disconnect it, buzzing seems more erratic. When step is connected to ground, the motor stays still and has a good holding torque \$\endgroup\$
    – user248702
    Commented Aug 5, 2020 at 12:56
  • \$\begingroup\$ I am not sure but maybe you need pull up for RESET pin. But interesting thing is, it was working with connectors with the same code and the same connections so it must be a soldering issue if nothing else was changed. \$\endgroup\$ Commented Aug 5, 2020 at 13:00
  • \$\begingroup\$ I suppose so, one thing I did change was that the reset and sleep were connected together. This shouldnt be an issue though. \$\endgroup\$
    – user248702
    Commented Aug 5, 2020 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.