Stepper motor NEMA 17 doesn't move

Hello,

I'm using the stepper motor NEMA17 (a 6-lead motor) and a DRV8834 motor driver from Pololu. I want to use the stepper motor as a bipolar motor, so I connected only four leads to the DRV8834 as suggested by Pololu. The motor driver supports a control with two pins (step & direction)
My problem is that my stepper doesn't make a single move, except for the turn off. During the disconnection from the external motor power supply you can feel a something like a short vibration.

Stepper: http://www.pololu.com/product/1200
Driver: Pololu - DRV8834 Low-Voltage Stepper Motor Driver Carrier

I copied the proposed wiring from Pololu (it is attached) and tried two different codes to make my motor run - without success.

First I wanted to use the stepper library provided on this homepage:

#include <Stepper.h>
#define STEPS 200

Stepper stepper(STEPS,36,38);


void setup()
{
stepper.setSpeed(30);
  
}

void loop()
{
stepper.step(100);
delay(500);
}

Later on, I found an example for a two pin control in an other thread. They used an A4988 motor driver which is pretty similar to the DRV8834:

int stp = 13;  //connect pin 13 to step
int dir = 12;  // connect pin 12 to dir
int a = 0;     //  gen counter

void setup() 
{                
  pinMode(stp, OUTPUT);
  pinMode(dir, OUTPUT);       
}


void loop() 
{
  if (a <  200)  //sweep 200 step in dir 1
   {
    a++;
    digitalWrite(stp, HIGH);   
    delay(10);               
    digitalWrite(stp, LOW);  
    delay(10);              
   }
  else 
   {
    digitalWrite(dir, HIGH);
    a++;
    digitalWrite(stp, HIGH);  
    delay(10);               
    digitalWrite(stp, LOW);  
    delay(10);
    
    if (a>400)    //sweep 200 in dir 2
     {
      a = 0;
      digitalWrite(dir, LOW);
     }
    }
}

I am sure my wiring is correct. Therefore I think my code is not working.
Can anyone find the mistake in or could my circuit also cause the problem?

circuit.png

Try the very simple no-frills code in this demo - the first part.

Why have you chosen a low voltage stepper driver. In general it is best to use high voltages with stepper motors.

...R

Thanks for your answer and your example codes. It works pretty well with one stepper motor. Now I want to try to control two stepper motors with one microcontroller.

Actually, it's the first time I am working with stepper motors and I chose the DRV8834 for two reasons.

  1. it works with the needed 4V and 1.2A that are necessary for this Pololu stepper
  2. the price

Can you tell me the advantages of high voltage drivers for future projects?

mixmax1213:
Can you tell me the advantages of high voltage drivers for future projects?

As the motor turns faster it generates a higher back-emf and there is less time between pulses for the current to rise against the inductance of the coils. A higher drive voltage is necessary to get to the full rated current as quickly as possible and for the longest part of the step period in order to achieve high torque. The stepper driver board can be adjusted to control the maximum current so the high voltage does not overheat the motor by forcing too much current through the coils.

By the way, if your motor is nominally rated at 4v and 1.2A that does not prevent it from being driven at 35v (or higher) by a suitable stepper driver that can limit the current to 1.2A. In general the nominal voltage ratings are irrelevant. It is the current rating that matters.

...R

Please tell us what you are using for a motor power supply -- voltage and current rating. This is critical information.

Thank you for your advices Robin2, I#ll regard them next time!

Hope your problem is OK now.