Go Down

Topic: Big easy stepper driver - motor not changing direction. (Read 884 times) previous topic - next topic

Sjakob

Feb 13, 2013, 06:44 pm Last Edit: Feb 14, 2013, 09:32 am by Sjakob Reason: 1
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.

Runaway Pancake


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,...
"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?"

Chagrin



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?

Sjakob

#3
Feb 14, 2013, 09:28 am Last Edit: Feb 14, 2013, 10:25 am by Sjakob Reason: 1
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.

Runaway Pancake

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.
"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?"

Sjakob

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(8) == 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.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy