Vous êtes sur la page 1sur 4

Program:

To run the stepper motor with various speed using 8085:


MEMORY
ADDRESS
4100
4103
4105
4106
4108
410B
410C
410D
410E
4111
4112
4113
4116

LABEL
START
NEXT

DELAY

MNEMONICS

OP CODE
& OPERAND
21, 00, 42
0E, 04
7E
D3, C0
11, 10, 10
1B
7B
B2
C2, 0B, 41
23
0D
C2, 05, 41
C3, 00, 41

LXI H, 4200H
MVI C, 04H
MOV A, M
OUT C0H
LXI D, 1010H
DCX D
MOV A, E
ORA D
JNZ DELAY
INX H
DCR C
JNZ NEXT
JMP START

To run the stepper motor in required steps using 8085


MEMORY
ADDRESS
4100
4102
4105
4107
4108
410A
410B
410E
4112
4113
4114
4115
4118
4119
411A
411D
4120

LABEL

START
NEXT

DELAY

STOP

MNEMONICS

OP CODE
& OPERAND
06, 32
21, 00, 42
0E, 04
7E
D3, C0
05
CA, 20, 41
11, 10, 10
1B
7B
B2
C2, 12, 41
23
0D
C2, 07, 41
C3, 02, 41
76

MVI B, 32H
LXI H, 4200H
MVI C, 04H
MOV A, M
OUT C0H
DCR B
JZ STOP
LXI D, 1010H
DCX D
MOV A, E
ORA D
JNZ DELAY
INX H
DCR C
JNZ NEXT
JMP START
HLT

INPUT SEQUENCE

A
1
0
0
1

Anti clock wise


C
B
D
0
0
1
1
0
1
1
1
0
0
1
0

Code
09H
05H
06H
0AH

A
1
0
0
1

C
0
1
1
0

Clock wise
B
1
1
0
0

D
0
0
1
1

Code
0AH
06H
05H
09H

Ex.No.1 Interfacing Stepper Motor using 8085

Microprocessor
AIM
To control the speed & direction of rotation of a stepper motor and to control the
direction of rotation for required angle using 8085.
THEORY
A motor in which the rotor is able to assume only discrete stationary angular
position is called a stepper motor. The rotation occurs in a step wise manner from an
equilibrium position to the next. Stepper motor are widely used in (simple position control
systems in the open closed loop mode) a variety of applications such as computer
peripherals (printer, disk drivers etc) and in the areas of process control machine tools,
robotics. A stepper motor could be either of the reluctance type or permanent magnet
type. The basic two phase stepper motor consists of two pairs of stator poles. Each of the
four poles has its own winding. The excitation of any one winding generates a north pole
(N), a south pole (S) gets induced at the diametrically opposite side.
Here a 4 winding stepper motor is used. Giving the switching pulse to the
windings in a uniform manner controls the rotation of the stepper motor. As indicated in
diagram the switching sequence is first given to windings AB, BC, CD and DA. This
procedure is called two phase sequence. For a single pulse the motor rotates 1.8 degree.
In between every pulse a delay routine is called. By changing the switching sequence the
direction of rotation cab be changed and the speed can be varied by delay value. The
above said procedure is repeated with a code to run the motor for required angle.
ALGORITHM

For Speed & direction control:


1. Start the program execution.
2. Initialize the memory pointer to give the offset address of input sequence.
3. Initialize a counter to represent the number of input sequence.
4. Give the switching pulse pointed out by the memory pointer to the stepper
motor.
5. Call delay.
6. Increment the memory pointer by one to point out the next input sequence.
7. Decrement the counter by one.
8. Check the status of counter. If it is not zero go to step 4 else go to next step.
9. Go to step 2.

STEPPER MOTOR

OBSERVATION
Hex Code

Angle of rotation

32H
64H
96H
C8H

Calculation of code for required angle


Code in decimal

= Required angle/angle for 1 step

For 90 degree

= 90/1.8

Code in hexadecimal

= 32H

= 50

For Speed & direction control:


1. Start the program execution.
2. Initialize B register by a count value for required rotation.

3. Initialize the memory pointer to give the offset address of input sequence.
4. Initialize a counter to represent the number of input sequence.
5. Give the switching pulse pointed out by the memory pointer to the stepper
motor.
6. Decrement the count value in B register.
7. Check the status of counter. If it is zero go to step 13 else go to next step.
8. Call delay.
9. Increment the memory pointer by one to point out the next input sequence.
10.

Decrement the counter by one.

11.

Check the status of counter. If it is not zero go to step 5 else go to next


step.

12.

Go to step 3.

13.

Stop the execution.

RESULT
The program to control the speed & direction of stepper motor rotation and to
operate the stepper motor for required angle is executed and the result is verified.

Vous aimerez peut-être aussi