Go Down

Topic: SparkFun Easy Driver stepper motor gone crazy ! (Read 782 times) previous topic - next topic

Danpe

Hey,

I'm using https://www.sparkfun.com/products/10267 SparkFun EasyDriver with the following code:

Code: [Select]
void setup()
{
 pinMode(9, OUTPUT);
 pinMode(10, OUTPUT);
 pinMode(7, OUTPUT);
 pinMode(8, OUTPUT);
 pinMode(6, OUTPUT);
 pinMode(12, OUTPUT);
   
 Serial.begin(9600);
 Serial.println("start");
}

void loop()
{
 stepper(9 ,10, 1000, HIGH);
 stepper(7 ,8, 1000, HIGH);
 stepper(6 ,12, 1000, HIGH);
}

void stepper(int StepPin, int DirPin, int Steps, int Direction)
{
   Serial.print("In stepper ");
   Serial.println(StepPin);
   int i;
   digitalWrite(DirPin, Direction);
   for (i=0; i < Steps; i++)
   {
       digitalWrite(StepPin, HIGH);
       delayMicroseconds(1000);
       digitalWrite(StepPin, LOW);
       delayMicroseconds(1000);
   }
}


It used to work good but suddenly without making any changes
The motors just shaking, i mean it looks like it goes 1 step forward then 1 backward very fast...
I tried changing delay, pins, direction but nothing changes it...

The motor just going crazy...

Any ideas?

magagna

Has the power supply changed? Have you tried adjusting the current regulator potentiometer on the Easy Driver board?
http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

Danpe

#2
Dec 04, 2012, 10:09 pm Last Edit: Dec 04, 2012, 10:21 pm by Danpe Reason: 1

Has the power supply changed? Have you tried adjusting the current regulator potentiometer on the Easy Driver board?


Nothing changed in the power supply.. and i tried adjustingthe potentiometer...
Nothing seems to work..

The only thing that changed is a new Mega 2560 and also tried with a new Uno..
I also got a new 10 meter USB cable.

magagna

Do you have a common ground between the Arduino, stepper driver, and stepper motor power supply?
http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

kf2qd

Check motor wiring. And check it again. That is also what happens when the phases aren't wired correctly.

Go Up