Stepper Motor with Motor Shield: motor turns, then shakes

Hi all,

I’m a beginner and this is my first post, so I apologize in advance if I don’t follow the forum guidelines correctly.

I’m trying to power a stepper motor with an Arduino Uno and the Arduino Motor Shield Rev3. Here are the technical specifications of the motor:

I’m using a 12V/4A power supply for the motor shield, and powering the Arduino from the USB cable.

I’m running a simple test program just to try and turn the motor for the first time. I’ve copied it from this Makerguides tutorial.

/* Example sketch to control a stepper motor with Arduino Motor Shield Rev3, Arduino UNO and Stepper.h library. More info: https://www.makerguides.com */
// Include the Stepper library:
#include <Stepper.h>
// Define number of steps per revolution:
const int stepsPerRevolution = 200;
// Give the motor control pins names:
#define pwmA 3
#define pwmB 11
#define brakeA 9
#define brakeB 8
#define dirA 12
#define dirB 13
// Initialize the stepper library on the motor shield:
Stepper myStepper = Stepper(stepsPerRevolution, dirA, dirB);
void setup() {
  // Set the PWM and brake pins so that the direction pins can be used to control the motor:
  pinMode(pwmA, OUTPUT);
  pinMode(pwmB, OUTPUT);
  pinMode(brakeA, OUTPUT);
  pinMode(brakeB, OUTPUT);
  digitalWrite(pwmA, HIGH);
  digitalWrite(pwmB, HIGH);
  digitalWrite(brakeA, LOW);
  digitalWrite(brakeB, LOW);
  // Set the motor speed (RPMs):
  myStepper.setSpeed(20);
}
void loop() {
  // Step one revolution in one direction:
  myStepper.step(200);
  delay(2000);
  //Step on revolution in the other direction:
  myStepper.step(-200);
  delay(2000);
}

When I run the code, the motor will make one or two good turns, then quickly degenerate into stuttering and shaking. When this happens I quickly unplug it because I’m nervous about damaging my boards.

I’ve double checked the wiring, since the motor turns well initially, I don’t think I’ve made a mistake here.

Two potentially important points are, I set the wires wrong at first - two positives to one coil and two grounds to the other - and then fixed it when I realized my mistake. I’ve cut the Vin bridge on the back of the motor shield, but I tried it a few times before I did that. I hope that one of these hasn’t somehow damaged my boards!

Thanks in advance for any advice for what could be causing this problem.

EDIT: fixed the code snippet, it didn’t paste properly at first

Rated voltage is really 2.4V? It doesn't seem like a good idea to give it 12V if that is the case.

You need a modern, current limiting stepper driver for that motor (the Arduino Motor Shield Rev 3 is for brushed DC motors and only low power, high impedance steppers).

If you want full power from that motor, I would recommend one of Pololu's drivers capable of 1.5 A without extra cooling. This one would work fine. Be sure to follow Pololu's instructions to set the current limit. Edit: link fixed

Note: the cheap A4988 drivers won't handle your motor.

jremington:
You need a modern, current limiting stepper driver for that motor (the Arduino Motor Shield Rev 3 is for brushed DC motors and only low power, high impedance steppers).

If you want full power from that motor, I would recommend one of Pololu's drivers capable of 1.5 A without extra cooling. [This one](http://Arduino Motor Shield Rev3) would work fine. Be sure to follow Pololu's instructions to set the current limit.

Note: the cheap A4988 drivers won't handle your motor.

Thanks for your reply. Only problem is, I can't follow your link.

For my immediate project, it doesn't matter too much to get max power. Can I get the motor to turn smoothly at all with my current setup, or is it not worth trying?

I fixed the link, sorry.

If you apply 12V to that motor, each winding will attempt to draw about 12V/1.6Ohm = 7.5 Amperes.

The Motor Shield can handle 1 Ampere/winding, continuous, before it overheats and shuts down. See the problem?

A fix to make it all work with the Motor Shield and a 12V power supply would be to add a 6 to 10 Ohm, 20 Watt resistor in series with each motor winding, as they used to do in the old days. But your power supply must be easily capable of delivering more than 2 Amperes.

jremington:
I fixed the link, sorry.

If you apply 12V to that motor, each winding will attempt to draw about 12V/1.6Ohm = 7.5 Amperes.

The Motor Shield can handle 1 Ampere/winding, continuous, before it overheats and shuts down. See the problem?

A fix to make it all work with the Motor Shield and a 12V power supply would be to add a 6 to 10 Ohm, 20 Watt resistor in series with each motor winding, as they used to do in the old days. But your power supply must be easily capable of delivering more than 2 Amperes.

Thanks for your explanation. Forums are awesome.
To make sure I understand completely, if I buy a correct power supply, I can run the motor, but it won't be at full power without a driver like the one you linked?

matt_johnson1253:
To make sure I understand completely, if I buy a correct power supply, I can run the motor, but it won't be at full power without a driver like the one you linked?

You need a suitable driver. A DRV8825 would also be suitable.

The nominal voltage of the motor is 2.4v but it would be unlikely to do any useful work with such a low voltage. And your motor shield probably would not work at that low voltage.

Stepper motors work better with higher voltages. But then you need a specialised stepper motor driver that can limit the current to protect the motor.

...R
Stepper Motor Basics
Simple Stepper Code

matt_johnson1253:
Thanks for your explanation. Forums are awesome.
To make sure I understand completely, if I buy a correct power supply, I can run the motor, but it won't be at full power without a driver like the one you linked?

Low impedance stepper motors like the one you have are designed only for current drive, give up
on the hope of using anything but a current driver like the DRV8825.

Thanks for the replies and the links guys, now I know what I need!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.