Pages: [1]   Go Down
Author Topic: SparkFun Easy Driver stepper motor gone crazy !  (Read 653 times)
0 Members and 1 Guest are viewing this topic.
Israel
Offline Offline
Newbie
*
Karma: 0
Posts: 38
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey,

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

Code:
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?
Logged

Southern California
Offline Offline
God Member
*****
Karma: 5
Posts: 539
I like blinky lights
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

Israel
Offline Offline
Newbie
*
Karma: 0
Posts: 38
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: December 04, 2012, 04:21:49 pm by Danpe » Logged

Southern California
Offline Offline
God Member
*****
Karma: 5
Posts: 539
I like blinky lights
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you have a common ground between the Arduino, stepper driver, and stepper motor power supply?
Logged

http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1023
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: