The article is on stepper motor, reaching ports, and controlling it. The article allows you to control speed, direction, and step size of a stepper motor. If you are interested in robotics, motion control, or just want to learn about this widely used motor in almost every electronic gadget like floppy drives, printer, scanner, robots, every device; then you should try building this versatile stepper motor control.
This article also provides precious information about the basics of stepper motors, as there is not much literature spread out about it. It will help you go grasp the understanding, and control the MASTER MOTOR. You will also learn how to interact between PC and external devices, (PC interface through parallel port).
Mmm.... For the circuit part, I hope you know the basics of digital electronics, so that at least the names of components look familiar to you. Not much advanced knowledge is required. As far as Parallel Port and programming is concerned, it will be better if you get a look on the article "I/O Ports Uncensored - 1 - Controlling LEDs (Light Emitting Diodes) with Parallel Port ---- By Levent S". And you should know either Visual Basic or C. I have chosen VB to program, as I think it is the most widely used and easy to understand language.
So to sum up, you should have background of:
- Either Visual Basic or C.
- Read about accessing parallel port, given in the article "I/O Ports Uncensored - 1 - Controlling LEDs (Light Emitting Diodes) with Parallel Port ---- By Levent S" published in this site itself.
- A little understanding of electronics.
Using the code
Well, I have chosen to program in Microsoft Excel VB editor and not using form, as in Excel, you can make dynamics changes, edit the code, and simply run it. No need to compile it by yourself again and again and build the exe file. Microsoft Excel VB editor is very easy to edit and understand, even easier than VB itself!!. You can reach VB editor from Excel by going to Tools Menu -> Macros -> VB editor.
Before downloading the demo project and source code, I would suggest you to download my documentation Word file which is zipped, and read the file. It's a documentation of the whole project in Word format. I have explained everything there in a very systematic manner, as dumping all the circuits here will make it look like a monster.
The Important points to understand
If you want to send some signals to the parallel port, you can easily do it. The trick lies in the macros of Excel. Yes, just record a new macro, stop it, and edit it in VB. Delete the inside of macro and type the following following code:
out 888, 255
This command requires inpout32.dll in your system32 directory which is in C:\Windows generally, as explained in the I/O Ports Uncensored - 1 - Controlling LEDs (Light Emitting Diodes) with Parallel Port ---- By Levent S" article. And you have to import the DLL file into your program. The 888 is the parallel port address in decimal number, and 255 is also a decimal number, binary equivalent of which is 11111111. That is, all the 8 data ports will become logic high. Hence by varying the number, you can regulate which number is to be kept high.
Points of Interest
Performing this project is not merely understanding the controls but it is to achieve something that is real, physical, and emotional. When I first glow an LED from Parallel Port, it was an amazing experience of giving the power to control anything through PC. So, I moved on a bit... to the stepper motor where you have external power supply to run the device. The inside feeling cannot be expressed, as after this, your imagination can make you a millionaire. It can be used in many applications like building a car robot, you can fit a web cam, or digital camera to precisely control the rotation and position of it. You can build a robotic arm by using various stepper motors, You can do a thousand things it is up to your imagination...
The work on this project was started in 4 June 2004 and completed on 8 July 2004. I made it in Indian Institute of Information Technology, Allahabad (IIITA) India, Robotics Lab during 1st year holidays. I am especially indebted to Dr. G.C.Nandi sir who took great pains in going through the problems that came in between, materials availability, and providing me right direction, and he made valuable suggestions. And I like to thank Sir Ram Kishore who taught me the basics and helped in circuit enhancements.
English is not my first language, so please excuse any mistakes. This is my first article for CodeProject, so any suggestions and/or feedback will be appreciated. Thanks for reading till here.