Pages: [1]   Go Down
Author Topic: Gecko Stepper Driver Control  (Read 3419 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm new to Arduino.  I need a large stepper motor to drive a barrel, (wheel).  My plan is to buy a suitable stepper motor and a Gecko motor controller.    A Gecko like this one. 
http://www.geckodrive.com/g203v-p-34.html

I'm wondering if anyone has programmed an Arduino to drive a Gecko stepper driver?   Can you lead me to some interesting threads?   This seems like an easy task for the Arduino.   Is there a How-To manual for creating this program? 
Thanks,
Dave
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8940
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The drive, like most, takes Step, Direction, and Enable inputs.  Hook those to three pins on the Arduino and use the File>Examples>Stepper examples.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

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

John,
Thanks for the reply.   

Humm.  File>Examples>Stepper examples.....    I think I'm missing some software.     For the record, I currently don't own an Arduino yet.    Is the address you specifiec File>Examples>Stepper examples found in this forum, or is it found in some Arduino software? 

Thanks again,
Dave
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8940
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The examples are installed along with the Arduino IDE (Integrated Development Environment).  You can install it and start programming even if you don't have an Arduino board.  Click on the 'Verify' button at the top of the sketch window to see if your sketch compiles without error.  If you see the message "Binary sketch size:..." then at least it compiles. 

When you get an Arduino you connect it with a USB cable, select the USB serial port from the Tools>Serial Port menu, select the board type from the Tools>Board menu and click on the Upload button at the top of the sketch window.  Your sketch will compile, upload, and start running on the Arduino.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

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

John,
Thanks, that explains it.   I'll download the software and continue my exploration.
Dave
Logged

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

John,
I downloaded the software and investigated the Example programs just as you suggest.   I think there are 4 or 5 samples.  In each sample the following line initializes the stepper using pins 8 through 11.   

// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8,9,10,11);
     

My problem is I don't know what the pins do.   I assume they are:  Enable, direction, step, ground.   But I don't know which is which.   Can you provide any help?
I also found this help page about Steppers, but it didn't clarify my pin identification either.  file:///C:/Program%20Files%20%28x86%29/arduino-0022/arduino-0022/reference/StepperConstructor.html  or maybe I just don't understand what it's saying.
Thanks,
Dave
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8940
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My mistake.  I thought the Stepper library would work with a "step and direction" controller.  It will work with a 2-wire setup where the two inputs are quadrature: (LOW,LOW), (LOW,HIGH), (HIGH,HIGH), (HIGH,LOW)    See this page for wiring and examples:
http://www.tigoe.net/pcomp/code/circuits/motors/stepper-motors

I guess for a Step and Direction controller you just set the bits yourself.  Something like:

Code:
const int stepPin = 8;
const int dirPin = 9;
const int enablePin = 10;

// Prepare to take some steps
digitalWrite(enablePin, HIGH);
digitalWrite(dirPin, HIGH);  // One direction
//  Take 100 steps in one direction
for (int i=0; i<100; i++)
    {
    digitalWrite(stepPin, HIGH);
    digitalWrite(stepPin, LOW);
    delay(1);
    }
// Change direction
digitalWrite(dirPin, LOW);  // The other direction
//  Take 100 steps in the other direction
for (int i=0; i<100; i++)
    {
    digitalWrite(stepPin, HIGH);
    digitalWrite(stepPin, LOW);
    delay(1);
    }
// Turn off the motor to keep it from getting overheated (or to allow manual motion)
digitalWrite(enablePin, LOW);
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

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

John,
Thank you for taking time to write that code up.   That's above the call of duty, and I appreciate it a lot. 

Great job.
Dave

Logged

Pages: [1]   Go Up
Jump to: