You are on page 1of 3

Experiment No:- 11

Aim: To write an assembly language program for interfacing stepper motor with 8051. Resources Used: KEIL, KB8051 base kit Theory: A stepper motor is a widely used device that translates electrical pulses into mechanical movement. In applications such as disk drives, dot matrix printers, and robotics, the stepper motor is used for position control. Stepper motors commonly have a permanent magnet rotor surrounded by a stator . There are also steppers called variable reluctance stepper motors The most common stepper motors have four stator windings that are paired with a center-tapped common. This type of stepper motor is commonly referred to as a. four-phase or unipolar stepper motor. The center tap allows a change of current direction in each of two coils when a winding is grounded, thereby resulting in a polarity change of the stator. Notice that while a conventional motor shaft runs freely, the stepper motor shaft moves in a fixed repeat-able increment, which allows one to move it to a precise position. This repeatable fixed movement is possible as a result

where poles of the same polarity repel and opposite poles attract. The direction of the rotation is dictated by the stator poles. The stator poles are determined by the current sent through the wire coils.As the direction of the current is changed, the polarity is also changed causing thereverse motion of the rotor. The stepper motor discussed here has a total of 6 leads: 4 leads representing the four stator windings and 2 commons for the center-tapped leads. As the sequence of power is applied to each stator winding,the rotor will rotate. There are several widely used sequences where each has a different degree of precision. Table below shows a 2-phase, 4-step stepping sequence.
To interface a STEPPER MOTOR to a Microcontroller

The Pins 1 to 4 of UNL2003 is connected to the microcontroller pins. Through Pins 13 to 16 of UNL2003, Stepper motor draws the control sequence for the sake of rotation.Pin 9 is common and 8 is ground. The sequence 0011(03H) ,0110(06H) ,1100(0CH) ,1001(09H) provides maximum torque in a two phase configuration .This sequence energizes two adjacent phases,which offers an improved torque-speed product and greater holding torque.

Algorithm:
Step 1: Start. Step 2: Define load step sequence . Step 3: Define issue sequence to motor. Step 4: Rotate right clockwise. Step 5: Call delay. Step 6: Go to Step 2. Step 7: Introduce a delay of 100msec. Step 8: Stop.

Conclusion:
The program to interface Stepper Motor with 8051 was developed in assembly language by using 8051 instructions. The corresponding HEX file generated was given as an input to 8051 kit . The output was observed and motor was rotating.

PROGRAM:
ORG 0000H MOV A,#66H RR A MOV P1,A ACALL DELAY SJMP BACK

BACK:

DELAY CCC: BBB: AAA: MOV R2,#CCH MOV R1,#0FFH DJNZ R1,AAA DJNZ R2,BBB RET END

You might also like