Tuesday, November 16, 2010

Stepper Motor Control In Linux

In this post I am going to explain how to program and control your stepper motor in GNU/Linux. Parallel port of your computer is used for interfacing. Programming is done in C. The interfacing circuit is shown below.
Circuit Explanation

Data from the PC is available at the lower nibble of the parallel port's data port i.e. pins 2,3,4,5. This output is given to 74HCT541. This is a tristate octal buffer for safe guarding your parallel port. The buffered data from the buffer IC is given to the popular stepper motor driver. The stepper motor which I used here is FDK J58A832T. This is a six wire, 12v, Unipolar, stepper motor with a stepping angle of 7.5 degrees.For details on the sequence of the drive you may follow the above link. 

Components Required:

Stepper Motor
DB25 Male connector
IC - 74HCT541   
IC - ULN2003A

Programming

Once you are get ready with your hardware we need to write a program to control the rotation of the motor. Here the program is written in C and is compiled using GCC. Program is so simple so that a person who knows the basics of C can quickly grasp the code. The program will turn your stepper in clockwise direction for 80 steps and then in anti clockwise direction for 80 steps and then stops. Download source code

Resources


   

3 comments:

Anonymous said...

abraham.k bit

Anonymous said...

you have deleted my question without answering!

Unknown said...

Dear
Source code not found ...

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | coupon codes