Pages: [1]   Go Down
Author Topic: Big easy stepper driver - motor not changing direction.  (Read 560 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Im trying to do set up like this :
http://www.schmalzhaus.com/EasyDriver/Examples/EasyDriverExamples.html

...with one stepper motor like this :
http://proto-pic.co.uk/stepper-motor-with-cable/

Im sure its alle wired up corectly but its not changing direction when I run the program-
The only way I can change direction is to change the wires around on one of the coils.
But I cant get the program to do it.

Im sure this is a very stupid question - sorry - I just started.
« Last Edit: February 14, 2013, 03:32:06 am by Sjakob » Logged

Offline Offline
Edison Member
*
Karma: 57
Posts: 2191
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Im sure its alle wired up corectly but its not changing direction when I run the program-

Does that mean that you're reverse the counting in the program or what?
one direction: 00, 01, 11, 10,...
other direction: 00, 10, 11, 01,...
Logged

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Dubuque, Iowa, USA
Offline Offline
Edison Member
*
Karma: 31
Posts: 2265
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Im sure its alle wired up corectly but its not changing direction when I run the program-

Does that mean that you're reverse the counting in the program or what?
one direction: 00, 01, 11, 10,...
other direction: 00, 10, 11, 01,...
BigEasyDriver has a step/dir two wire interface.

OP, what program are you using to drive it?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Im using this sketch :
#include <AccelStepper.h>

// Define a stepper and the pins it will use
AccelStepper stepper(1, 9, 8 );

int pos = 3600;

void setup()
{  
  stepper.setMaxSpeed(3000);
  stepper.setAcceleration(1000);
}

void loop()
{
  if (stepper.distanceToGo() == 0)
  {
    delay(500);
    pos = -pos;
    stepper.moveTo(pos);
  }
  stepper.run();
}

Witch is suposed to make the motor go back and forth. But it runs the same way - pauses and go same direction.
I do have step and direction pins conectet to 8 and 9 on the arduino.
« Last Edit: February 14, 2013, 04:25:56 am by Sjakob » Logged

Offline Offline
Edison Member
*
Karma: 57
Posts: 2191
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't know anything about that AccelStepper library.
Any details?
Either way, I would check (voltmeter) the "step" and "dir" pins' status and connection.
Logged

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok. I will try that. Its the same with this sketch :

int Distance = 0;  // Record the number of steps we've taken

void setup() {               
  pinMode(8, OUTPUT);     
  pinMode(9, OUTPUT);
  digitalWrite(8, LOW);
  digitalWrite(9, LOW);
}

void loop() {
  digitalWrite(9, HIGH);
  delayMicroseconds(100);         
  digitalWrite(9, LOW);
  delayMicroseconds(100);
  Distance = Distance + 1;   // record this step
 
  // Check to see if we are at the end of our move
  if (Distance == 3600)
  {
    // We are! Reverse direction (invert DIR signal)
    if (digitalRead(smiley-cool == LOW)
    {
      digitalWrite(8, HIGH);
    }
    else
    {
      digitalWrite(8, LOW);
    }
    // Reset our distance back to zero since we're
    // starting a new move
    Distance = 0;
    // Now pause for half a second
    delay(500);
  }
}

I tried with another motor and its the same - so you are prop right. Must be the wires.
Logged

Pages: [1]   Go Up
Jump to: