Go Down

Topic: Stepper motor connections.... plz help (Read 2 times) previous topic - next topic

remo0101

Sep 07, 2012, 10:53 pm Last Edit: Sep 08, 2012, 01:38 am by remo0101 Reason: 1
Hello, its first time i get on this forum, i just bought arduino mega 2560. i was wondering how can drive stepper motor using it, i bought easy driver as well. i found code on arduino site  "http://www.arduino.cc/en/Tutorial/StepperBipolar " but they using ULN2003A driver, is anybody has an ideal how can i use the same program but with the easy driver which is in the website "http://www.trossenrobotics.com/easydriver-v3-stepper-motor-driver.aspx?relatedid=1261". thanks alot. i need pic of how to connect the wires.

Runaway Pancake

You wouldn't use the sketch from that tutorial with the Easy Driver module.
Instead, you send step pulses to "Step", to change the speed, it's like a clock pin; you change direction by taking "Dir" high or low.
It has a lot of other control pins, most of which could be "hard-wired" high or low if on-the-fly configurability isn't needed.

Your Trossen link is titled having something to do with a "V3", but it directs to a page featuring the "V4".
Other than "Step" and "Dir", the "V3" has none of the features of the "V4".
http://schmalzhaus.com/EasyDriver/
"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?"

remo0101

first of all, thanks alot for ur help. i found drawing that could help me but i dont know if it will work with my program that i got from the link i showed you. the drawing in the attachment. i wonder if that is the connection that would work. the only thing is the program use 4 pins in this drawing it used 2 pins , i wish u understand me. i wish that you can help me with that.

Runaway Pancake

#3
Sep 11, 2012, 01:48 am Last Edit: Sep 11, 2012, 01:52 am by Runaway Pancake Reason: 1
That drawing looks like it is for the Version 3.
Not much to it.
The ATX power supply might be "over-kill".

Quote
the only thing is the program use 4 pins in this drawing it used 2 pins... i wish u understand me

I think I understand you.
But which "program"?  Don't use the sketch from the tutorial, that is for a different situation (different set-up).

Your sketch should simply:
Make "DIR" HIGH or LOW (that determines the direction of rotation)

Pulse the Step pin to make the motor advance.
I suppose that something like this
Code: [Select]

void motor_go ()
{  
  for (int spin = 0; spin < 20; spin ++)
  {
    digitalWrite(step_pin, HIGH);
    delay (100);   // try different values
    digitalWrite(step_pin, LOW);
    delay (500);   // try different values
  }
}

will make it "go".

* * * *
I am not sure whether the Easy Driver needs 5V from the Arduino.
The drawing does not show a connection, but I am not so convinced.
I'm guessing that it may.
"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?"

remo0101

thanks alot for the simple program, but i wonder how can i connect the easy driver with the stepper motor. because im sure that arduino will burn right away if i try to run the stepper motor from the board, so i need to use the easy driver. how can i connect the 3 devices together. also regard the program, what is the difference between the program in this link "http://www.arduino.cc/en/Tutorial/StepperBipolar " and the program you wrote for me 

Runaway Pancake

Do you have an Easy Driver (which version) or are you just planning on getting one?


i wonder how can i connect the easy driver with the stepper motor. because im sure that arduino will burn right away if i try to run the stepper motor from the board, so i need to use the easy driver. how can i connect the 3 devices together.

By 3 devices you mean: Arduino, Easy Driver, and stepper motor?
If so, the drawing that you posted shows how.

what is the difference between the program in this link "http://www.arduino.cc/en/Tutorial/StepperBipolar " and the program you wrote for me 

The sketch in the tutorial is meant to be used with a darlington driver for its output section.  The sketch generates the Gray code series for energising the stepper coils in turn right. 
The IC on the Easy Driver board does that "Gray coding" for you - all it needs is a pulse to advance to the next step (faster pulse rate = faster rotation).  That is what puts the Easy in Easy Driver.
"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?"

remo0101

i have the easy driver already which in this link "http://www.trossenrobotics.com/easydriver-v3-stepper-motor-driver.aspx?relatedid=1261", yes i meant by the 3 devices stepper motor, board and easy driver, but the drawing shows that im using 2 pins which are 4,and 5, i thought we need to use 4 pins. also regard your program, how can i include that in my code. cuz i have long pogram, what should be introduce to make ur program work, and is your program let me stop the stepper motor after specific time !!! finally, thanks so much. 

Runaway Pancake

You are right, the V4+ does have more pins.
I'm supposing, now, but the extra connections for the enhanced features are likely pulled high (or low) as default.  So, not connecting them ought not to result a catastrophe.

I can't say how you should include this or that into your existing sketch.  As I see it, you should try to get the Easy Driver (etc.) working on its own and get a firm understanding of it.

Have your tried
http://forums.trossenrobotics.com/forum.php
? ? ?
"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?"

remo0101

so away of connection, what is my program from A to Z if i want to let the stepper motor run for t time , or for a specific angle !!!!!! plz help me with that

Runaway Pancake

#9
Sep 14, 2012, 03:09 am Last Edit: Sep 14, 2012, 03:13 am by Runaway Pancake Reason: 1
Most of that you'll have to hammer out yourself.  Take ownership.
This sketch should start you down the "Road of Discovery".
The motor runs slowly for 4 seconds or so, takes a break, runs quickly for 4 seconds, takes a another break, and starts the process over again.

Code: [Select]

/*
   easy driver
   demo sketch
   Step pin connects to
   Arduino pin D2
*/    
   
byte step_pin = 2;  // pin alias

void setup()
{
 pinMode (step_pin, OUTPUT);
}

void loop ()
{  
  // speed 1
  for (int spin = 0; spin < 40; spin ++)
  {
    digitalWrite(step_pin, HIGH);
    delay (2);   // try different values
    digitalWrite(step_pin, LOW);
    delay (100);   // try different values
  }
  delay (1000);   // pause 1 sec
 
  // speed 2
  for (int spin = 0; spin < 80; spin ++)
  {
    digitalWrite(step_pin, HIGH);
    delay (2);   // try different values
    digitalWrite(step_pin, LOW);
    delay (50);   // try different values
  }
  delay (1000);   // pause 1 sec
}


* * * *
changed values of "spin"
"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?"


Go Up