Google Search

Tuesday, June 28, 2011

MICROCONTROLLER BASED SYSTEM DESIGN


MICROCONTROLLER BASED SYSTEM DESIGN


AIM:

To interface a stepper motor with 8051 micro controller and operate it.

APPARATUS REQUIRED:
                    
          1.8051 micro controller kit
            2. Stepper motor
            3. Interface card

THEORY:
         
          A motor in which the rotor is able to assume only discrete stationary angular position is a stepper motor. They are used in printer, disk drive process control machine tools etc.
            Two-phase stepper motor has two pairs of stator poles. Stepper motor windings A1, A2, B1, B2 are cyclically excited with a DC current to run the motor in clockwise direction and reverse phase sequence A1, B2, A2, B1 in anticlockwise stepping

Two-phase switching scheme:
            In this scheme, any two adjacent stator windings are energized.

Anticlockwise
Clockwise
Step
A1
A2
B1
B2
Data
Step
A1
A2
B1
B2
Data
1
1
0
0
1
9 H
1
1
0
1
0
A H
2
0
1
0
1
5 H
2
0
1
1
0
6 H
3
0
1
1
0
6 H
3
0
1
0
1
5 H
4
1
0
1
0
A H
4
1
0
0
1
9 H


Address Decoding logic:

            The 74138 chip is used for generating the address decoding logic to generate the device select pulses CS1 and CS2 for selecting the IC 74175 in which latches the data bus to stepper motor driving circuitry.



PROGRAM:

Address
Opcode
Label
Mnemonics                       
Operand
Comments
4100
90 41 1F
START
MOV
DPTR # TABLE
Load the start address of switching scheme  data TABLE into Data pointer.
4103
78 04

MOV
R0, #04
Load the count in R0
4105
F0
LOOP
MOV X
A, @ DPTR
Load the number in TABLE into A
4106
C0 83

PUSH
DPH
Push DPTR Value to stack
4108
C0 82

PUSH
DPL

410A
90 FF C0

MOV
DPTR, # 0FFFC0
Load the motor port address into DPTR.
410D
F0

MOV X
@ DPTR, A
Send the value in A to stepper motor port address
410F
7C FF

MOV
R4,#0FFH
Delay loop to cause a specific amount of time delay before next data item is sent to the motor
4110
7D FF
DELAY
MOV
R5,#0FFH

4112
DD FE
DELAY1
DNZ
R4, DELAY 1

4114
DC FA

DJNZ
R4,DELAY

4116
D0 82

POP
DPL
POP back DPTR value from stack
4118
D0 83

POP
DPH

411A
A3

INC
DPTR
Increment DPTR to point to next item in the TABLE
411B
D8 E8

DJNZ
R0, LOOP
Decrement R0, if not zero repeat the loop
411D
80 E1

SJMP
START
Short jump to start of the program to make the motor rotate continuosly.
411F
09 05 06 0AH
TABLE
DB
09 05 06 0AH
Value as per two phase switching scheme.

RESULT:

            Enter the above program starting from location 4100 and execute the same, stepper motor rotates. Varying the count at R4 and R5 can vary the speed. Entering the data in the look-up TABLE in the reverse order can vary the direction of rotation.
           




0 comments:

Post a Comment