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?