Step Motor Control via PC parallel port
Date: Thursday, October 20 @ 16:06:29 EDT
Topic: Motorlar

Submitted by Technoshaman

This is a project created in a rush for an old friend of mineís small TV camera, during one of my visits to Ankara :) It can also be used for other purposes.

The circuit is pretty simple and the necessary parts can easily be found anywhere. If a 2N2222 is going to be used instead of the TIP120 in the schematic, a diode such as a 1N4001 should be used (between the Emitter and the Collector) to protect the transistors. The circuit was designed for a 5 lead unipolar stepper motor. We can see which coils are active thanks to the LEDs. A buffer IC such as a 74367 can be used to protect the port from any possible leaks.

Circuit Schematic

The program sends signals to pins 2,3,4,5 as the stepper motor requires them. 1s refer to active coils (as in 1010). Pins 2,3,4,5 have the values 1,2,4,8 in the same order. The sum of active pins are sent to the port to get the desired motion. Necessary speed and direction adjustments can easily be done thanks to the program. If desired the motor can be rotated step by step, or it can be set to sweep from left to right and vice versa. The bold parts are just comments, they are not a part of the code.

Out Port, 10: 1010 0> Pin 3,5 (218=10)
Label3.Caption = "1010"
Case 2
Out Port, 9: 1001 0> Pin 2,5 (118=9)
Label3.Caption = "1001"
Case 3
Out Port, 5: 0101 0> Pin 2,4 (114=5)
Label3.Caption = "0101"
Case 4
Out Port, 6: 0110 0> Pin 3,4 (214=6)
Label3.Caption = "0110"
End Select

The programís main window also includes a webcam screen. The status of the pins (in binary) and the direction is also provided. Neither the circuit nor the program is perfect, but they still work ;) You can leave your comments for a more detailed explanation. Click below to download project's source code


This article comes from Robotik & Elektronik

The URL for this story is: