Pages: [1]   Go Down
Author Topic: Stepper Motor Clockwise and then Counterclockwise  (Read 2559 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have issues about the stepper motor, is it possible to program the motor to run a certain time clockwise and then after that it will run again at the same time counterclockwise? i'm not good at programming and I really need help. thanks ! I hope for your replies
Logged

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

Lots of things are possible with stepper motors.

Are you planning on using some type of motor shield? (almost mandatory for unipolar motors)
Are you planning on connecting transistors/MOSFETs to the Arduino pins? (works just fine for bipolar motors)
Are you planning on using some type of driver board? (only 2 outputs from the Arduino - Step & Direction)
Are you wanting to go for some time, or some distance?
How fast do you want to turn?
One speed or several speeds?
How long does it need to run?
Do you need it to return to some starting point?

here's some code I was working on for a stepper driver - the function for the motor will work either as an interrupt function or as a called function -
http://arduino.cc/forum/index.php/topic,84809.0.html
Logged

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

I simply want to use the stepper motor as a pusher .. ill integrate a mechanism that will serve as a pusher .. it will just go forward and then goes back to its original position whenever a button is pressed, it will just run at small rpm.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 637
Posts: 34579
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Just treat it like an LED, that is make it flash / step the motor. A simple for loop will allow you to step in one direction. Then change the direction pin on the driver and repeat that loop.
Logged

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

Still the question remains - What type of motor - Unipolar or Bipolar? That will determine what you need to "drive" the motor. discrete transistors/MOSFETs or 2 H-Bridges, or are you going to use a dedicated driver? The next question is How Fast?  and the next is How many steps?

Controlling a stepper is just a matter of supplying current to the windings in the proper sequence and the motor will step. It can be done using digitalWrite() or using direct port manipulation. Direct port manipulation is a bit faster, but it is a bit harder to program.

Without hardware all we can really reply is YES, Arduino and a stepper are capable of doing this type of operation.
Logged

Pages: [1]   Go Up
Jump to: