Go Down

Topic: Stepper motor NEMA 17 doesn't move (Read 4363 times) previous topic - next topic

mixmax1213

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:   http://www.pololu.com/product/2134

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:
Code: [Select]
#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:

Code: [Select]
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?

Robin2

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
Two or three hours spent thinking and reading documentation solves most programming problems.

mixmax1213

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?

Robin2

#3
Nov 18, 2014, 02:38 pm Last Edit: Nov 18, 2014, 02:41 pm by Robin2
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
Two or three hours spent thinking and reading documentation solves most programming problems.

jremington

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

mixmax1213

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

3dp2go


Go Up