vibrating and squeaky sound from stepper motor

Hi!

Im trying to run a Nema 17 stepper motor with the driver board Polulu DRV8825, but the stepper is vibrating and makes a squeaky sound for a few sec and then it stops.
I've tried to make a paint-image to show my schematics:

I'm using the code from here: http://forum.arduino.cc/index.php?topic=277692.0

// testing a stepper motor with a Pololu A4988 driver board or equivalent
// on an Uno the onboard led will flash with each step
// this version uses delay() to manage timing

byte directionPin = 9;
byte stepPin = 8;
int numberOfSteps = 100;
byte ledPin = 13;
int pulseWidthMicros = 20;  // microseconds
int millisbetweenSteps = 25; // milliseconds


void setup() { 

  Serial.begin(9600);
  Serial.println("Starting StepperTest");
  digitalWrite(ledPin, LOW);
  
  delay(2000);

  pinMode(directionPin, OUTPUT);
  pinMode(stepPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  
 
  digitalWrite(directionPin, HIGH);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(pulseWidthMicros); // this line is probably unnecessary
    digitalWrite(stepPin, LOW);
    
    delay(millisbetweenSteps);
    
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
  
  delay(3000);
  

  digitalWrite(directionPin, LOW);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    // delayMicroseconds(pulseWidthMicros); // probably not needed
    digitalWrite(stepPin, LOW);
    
    delay(millisbetweenSteps);
    
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
}

void loop() { 
}

Any ideas of whats going on?

Ive set the potentiometer to 0.8V to get 1.6A, using multimeter from GND to the top of potentiometer.

Used this equation: Current Limit = VREF × 2 from Pololu - DRV8825 Stepper Motor Driver Carrier, High Current

My stepper is 1.7A

thanks for any answers!

The Pololu DRV8825 web page has a good wiring diagram. I don’t see a large capacitor in your picture.

Sorry, I can’t make sense of the wiring in your photos. Just make a simple pencil drawing and post a photo of that.

The Pololu page also explains how to set the current limit. There is a special reference point on their boards for measuring the voltage. If your board is different please post a link to its datasheet.

Also, post a link to the datasheet for your motor. There are hundreds of different Nema 17 sized motors.

…R
Stepper Motor Basics
Simple Stepper Code

The Pololu DRV8825 cannot supply 1.6 A steady state, without extra cooling. Set the current limit below 1.5 A for reliable operation.

Thanks for replies! I can't find any data sheet for my stepper, how do I know which wire from the motor is A+, A-, B+ and B- ?

It doesn't matter how the wires are connected, as long as the two A and two B connections are made. To pair As and Bs, check for continuity with a multimeter. While you are at it, measure the winding resistance and tell us what it is.

If the direction of rotation is wrong, reverse the connections on one of the A or B pair.

You can find out the pairs of your motor without measuring:

  1. disconnect the motor from driver
  2. turn the shaft - it will go without too much resistance
  3. now connect one pair of wires (let's say red and green) and repeat turning the shaft 3a. if there is same kind of resistance like before (in 2.) - keep the one wire in your hand and connect it with another wire (the white one or the black one) 3b. turn the shaft - if there is a bigger resistance you got one pair which belongs to one coil
  4. the remaining two wires are connected with the second coil of the motor

jremington: While you are at it, measure the winding resistance and tell us what it is.

Rated Current: 1.7A (A)

Phase Resistance 1.5 (Ohm)

Phase Inductance 2.8 (mH)

Does these numbers help in any way?

These are pretty good values for a NEMA17 stepper.
I would suggest, use the Accelstepper library to test your stepper as this library is easy to use (you will find a lot of information in this forum where people used this library);

The library takes care of more than one stepper, comes with acceleration, for a dir/step driver just use the declaration like so:

#include <AccelStepper.h>
AccelStepper stepper1(1, 3, 4);  // Define stepper and the pins we will use

This tells the library to use a “step/dir controlled” driver like the drv8825.

Have a look at the examples which come with the library.

You have to make sure that you wire your drv8825 as follows:
drv8825 wiring.jpg

Important: don’t forget the connections of the sleep and reset pins of drv8825 (to VDD = +5V of Arduino)

Hi, Imfao. It is mandatory to have a capacitor in your circuit that is wired to both Vin and GND terminals. I had the same problem with this DRV8825 driver (stepper produced squeaky sound, but did not rotate) until I added a capacitor as rpt007 showed with the hook-up diagram.

Just in case, here a nice guide for adjusting the potentiometer, where you can see the wiring of the driver to the microcontroller. https://www.youtube.com/watch?v=89BHS9hfSUk

And also some explanation for the necessity of a capacitor (from http://www.instructables.com/id/Stepper-Motor-Module/?ALLSTEPS): " If you like the electricity-as-water analogies - your motor going on and off and moving is going to create a lot of waves and the capacitors act as mini-flood planes to help smooth out the flow. 10 uF for the motor side. 1 uF for the logic side."

Note that it is recommended to use 100 uF capacitors with DRV8825 driver (look at https://github.com/laurb9/StepperDriver or the image of the circuit that rpt007 provided).

Have fun)

For a motor supply 100uF is the bare minimum decoupling - more if you can.