Stepper diagnostics

Hello,

I was wondering if anyone knows of any good information on diagnosing problems with stepper motors and drivers when hooked up to an Arduino?

I have a small NEMA 17 stepper hooked up via Big Easy Driver to an Arduino, the driver light it on but stepper was chirping but now does nothing since I played with the current pot. I have measured Tip current through the pot and played with it from 0.4 to 2.8 V but no change. Can't get the thing to work properly. So my question is - is there any way to diagnose problems/understand what may be at fault? Can I test voltages/where etc to determine the BED is working? I have found them to be problematic and not that easy to work, a bit temperamental. I have ensured the stepper is connected correctly by verifying the resistance across the coils etc.The actual circuit is pretty simple, connected to Arduino is GND, Dir and Step pins, and stepper is powered by 12 V 1 A wall wort.

Anyway, hoping someone can point me in the direction of some good information.

tks

I had no end of trouble trying to get my Big Easy Driver to behave with the same setup as you had.

I solved this problem by ditching the Big Easy Driver in favour of an Adafruit motor shield.

Works perfectly with no current setting to fiddle with.

Ken

Those Adafruit shields look awesome! A little more expensive than the BED though. I have had the BED drivers working with multiple steppers but this is a new project. Point is, when it doesn't work it's not clear (to me at least) what is wrong so I was wondering if there was any way to test outputs to determine if the driver is working or stepper is working etc. Playing with the pot seems potentially dangerous especially if you're heavy handed and I'm not confident I haven't damaged it. Although as I said, have checked the current across it, does that mean it's working fine? If the BED light is on, does that mean the driver is working fine? Can one check voltage or current across the driver output pins and see that it's working correctly? If so, how would this be done and what would one look for?

Those Adafruit shields look awesome! A little more expensive than the BED though. I have had the BED drivers working with multiple steppers but this is a new project. Point is, when it doesn't work it's not clear (to me at least) what is wrong so I was wondering if there was any way to test outputs to determine if the driver is working or stepper is working etc. Playing with the pot seems potentially dangerous especially if you're heavy handed and I'm not confident I haven't damaged it. Although as I said, have checked the current across it, does that mean it's working fine? If the BED light is on, does that mean the driver is working fine? Can one check voltage or current across the driver output pins and see that it's working correctly? If so, how would this be done and what would one look for?

Awesomness:
Hello,

I was wondering if anyone knows of any good information on diagnosing problems with stepper motors and drivers when hooked up to an Arduino?

I have a small NEMA 17 stepper hooked up via Big Easy Driver to an Arduino, the driver light it on but stepper was chirping but now does nothing since I played with the current pot. I have measured Tip current through the pot and played with it from 0.4 to 2.8 V but no change. Can't get the thing to work properly. So my question is - is there any way to diagnose problems/understand what may be at fault? Can I test voltages/where etc to determine the BED is working? I have found them to be problematic and not that easy to work, a bit temperamental. I have ensured the stepper is connected correctly by verifying the resistance across the coils etc.The actual circuit is pretty simple, connected to Arduino is GND, Dir and Step pins, and stepper is powered by 12 V 1 A wall wort.

Anyway, hoping someone can point me in the direction of some good information.

tks

Please post your fully schematic and code - otherwise we can only guess.

Have a look at Stepper Motor Basics and this Simple Stepper Code

Assuming the motor requires less than about 1.5 amps a BigEasyDriver would be a good choice.

A motor shield that is intended for DC motors is not a good choice.

Post a link to the datasheet for your motor.
And the schematic that @MarkT requested. Please don't waste time with a Fritzing diagram. A photo of a pencil drawing is much easier to understand.

...R

Hello,

Really appreciate the interest and assistance you guys give someone new to electronics like me.

Couldn't find a DS for the stepper but the below link has a good detail of specs on the stepper - A longs 17HD4401N stepper.

http://edistri.be/eshop/index.php?route=product/product&product_id=58

I can't easily scan in a circuit diagram so have attached the simple fritzing one which is similar to my circuit. All wires are the same except the colours of the 4 stepper wires. They are red/blue and green/black, I have tested them with a multimeter.

The code I am using is as follows. I know it works because I have used it in other circuits. My original query which seems to have been a little lost judging from some of the replies is whether there are ay ways to diagnose problems with a stepper or stepper driver, perhaps by measuring current or voltage at certain points which might indicate the stepper is functioning or not. Anyway, any assistance is great. And thanks for the link to the stepper basics, they were good to read again but I have previously reviewed them.

/*
Test code using a stepper motor with a Pololu A4988 driver board or Sparkfun Big Easy Driver on an Arduino Uno using the on-board led which will flash with each step This code uses the delay() function to manage the timing.
Note must have Arduino pin 2 connected to the dir pin on driver
Note must have Arduino pin 3 connected to the step pin on driver
*/

byte directionPin = 2; // set dir pin to Arduino pin 2
byte stepPin = 3; // set step pin to Arduino pin 3
int numberOfSteps = 100;
byte ledPin = 13;
int pulseWidthMicros = 20; // pulsewidth of 20 microseconds
int delaybetweenSteps = 25; // delay between steps of 25 ms

void setup()
{

digitalWrite(ledPin, LOW);

delay(2000);

pinMode(directionPin, OUTPUT);
pinMode(stepPin, OUTPUT);
pinMode(ledPin, OUTPUT);

digitalWrite(directionPin, HIGH);
for(int x = 0; x < numberOfSteps; x++)
{
digitalWrite(stepPin, HIGH);
digitalWrite(stepPin, LOW);

delay(delaybetweenSteps);
digitalWrite(ledPin, !digitalRead(ledPin));
}

delay(1000); // delay of 1 second

digitalWrite(directionPin, LOW);
for(int x = 0; x < numberOfSteps; x++)
{
digitalWrite(stepPin, HIGH);
digitalWrite(stepPin, LOW);

delay(delaybetweenSteps);

digitalWrite(ledPin, !digitalRead(ledPin));
}
}

void loop() { }

You are relying on the slowness of digitialWrite() to ensure a wide enough step pulse:

    digitalWrite(stepPin, HIGH);
    digitalWrite(stepPin, LOW);

Better to do

    digitalWrite(stepPin, HIGH);
    delayMicroseconds (1) ;
    digitalWrite(stepPin, LOW);

for the B.E.Driver, or for opto-coupled stepper drivers do this:

    digitalWrite(stepPin, HIGH);
    delayMicroseconds (10) ;
    digitalWrite(stepPin, LOW);

Do you know the current setting you are using - that motor wants a lot of current, suggest set for a
minimum of 1A (yes the A4988 will struggle and get hot). If it still doesn't work I'd suspect a blown
driver.

You didn't make/break the winding connections with the B.E.Driver powered up did you? That's a big risk
and can pop a driver really easily.

Thanks @MarkT, great information. I can see you are saying that rather than an (unknown) delays between switching the STEP pin high/low, it's better to control it to a certain time. I will tinker with different settings, I now have two codes that work, one really fast and one not so fast so I will analyse the difference.

Have dialled the stepper driver pot down to just over 1A, doesn't run hot and stepper runs smoothly. Good tip here is to measure the Tip current and ensure it's not too high.