What is stepper motor

STEPPER MOTOR CONTROLLER

Stepper motors are widely used in robots and other automation applications where precise positioning is required. A stepper motor, unlike ordinary motors, runs in a number of single steps to complete the required rotations.
    Here is a simple program written in 'C' language for controlling a-lead stepper motor, used in TVS dot-matrix printers, through the parallel port of a PC. The program can control the number of rotations, direction of rotation ( clockwise or anticlockwise ) and rotational speed of the motor.
    
Basics of the parallel port
   
The parallel port of the PC is 25-pin, D- type connector, commonly known as LPT ( line printer terminal ) port. It has three different ports, namely data port, control port and status port. The parallel port can be accessed via 25-pin, D-type female connector (DB25). This female connector is normally available at the back side of your PC.
    In order to access any port, you should  have ports id, i.e, the base address of the port. Here, the data port is '0378' in hex format. The address of the three ports are in sequential order. So if the address of the data port is '0*378', the address of the status port and the control port  port will be '0*378+1' and  '0*378+2 respectively.
     In dos, you can use the debug. exe program to check the port address of  your PC. DOS Debug is a byte editor that allows files to be  viewed and modified at the  byte level. It is a standard feature of many  modern DOS versions, including  MD-DOS version7. While MS-DOS  is not commonly used today, it can still be accessed from windows98 by clicking 'Star'/'Run' buttons followed by typing 'command' or 'cmd' in windows NT/200/XP.
    Run the debug program by typing 'debug' against the DOS prompt and then type 'd40;0008' against the '_' prompt ( debug prompt). You will get something like '78 03 00 00 00 00 00 00'. Here,'78 03' stands for the port address in reverse order of '378' in hexadecimal. Press 'Q' to exit the debug program.

Comments

Popular Posts