4
Sukkur Institute of Business Administration Department of Electrical Engineering Microprocessor & Interfacing Techniques (BE IV) Experiment # 05 S No. Name Signature Interfacing Stepper Motor Components: AT89C51 Microcontroller 11.059-MHz Crystal Oscillator 4-Phase, 6-wire stepper motor FT5754, four Darlington Pairs 74LS244, octal 3-state buffer/ line driver IC 33-pf Mica Capacitors 10-uf Capacitor 10 K Resistors 4x4 16 keys matrix keyboard Resistor 470 Ohm IC programmer +5 V Voltage Supply Discussion: The driver circuit of the stepper motor is shown in figure below. The FT5754 contains four Darlington pair transistors acting as electronic switches to switch motor coils on and off. The 74LS244 used to invert the input signal and to promote the driving capability of the 8051 I/O port. The port 1 lines P1.0, P1.1, P1.2, P1.3 are connected to A, B, ~A, ~B coils of the stepper motor, respectively. Since 74LS244 is an inverter, the corresponding coil will be energized if the switching signal is zero. Stepper motors are electromagnetic incremental motion actuators, which convert digital pulse inputs into analog output motion. One pulse advances the rotor shaft one step increment (step angle) and latches it magnetically at the precise point to which it is stepped. The 4-phase, 6-wire step motor or uni-polar stepper motor is shown in figure below.

Interfacing Stepper Motor Using MicroController

Embed Size (px)

DESCRIPTION

This program contains the information how interface with the stepper using 8051 MicroController. Document also contains the information about circuit diagram using Proteus[A software simulation tool].

Citation preview

Page 1: Interfacing Stepper Motor Using MicroController

Sukkur Institute of Business Administration Department of Electrical Engineering

Microprocessor & Interfacing Techniques (BE IV)

Experiment # 05

S No. Name Signature

Interfacing Stepper Motor

Components:

AT89C51 Microcontroller

11.059-MHz Crystal Oscillator

4-Phase, 6-wire stepper motor

FT5754, four Darlington Pairs

74LS244, octal 3-state buffer/ line driver IC

33-pf Mica Capacitors

10-uf Capacitor

10 K Resistors

4x4 16 keys matrix keyboard

Resistor 470 Ohm

IC programmer

+5 V Voltage Supply

Discussion:

The driver circuit of the stepper motor is shown in figure below. The FT5754 contains four

Darlington pair transistors acting as electronic switches to switch motor coils on and off. The

74LS244 used to invert the input signal and to promote the driving capability of the 8051 I/O

port. The port 1 lines P1.0, P1.1, P1.2, P1.3 are connected to A, B, ~A, ~B coils of the stepper

motor, respectively. Since 74LS244 is an inverter, the corresponding coil will be energized if the

switching signal is zero.

Stepper motors are electromagnetic incremental motion actuators, which convert digital pulse

inputs into analog output motion. One pulse advances the rotor shaft one step increment (step

angle) and latches it magnetically at the precise point to which it is stepped. The 4-phase, 6-wire

step motor or uni-polar stepper motor is shown in figure below.

Page 2: Interfacing Stepper Motor Using MicroController

Table shows the truth table of 2-phase-on switching. In this scheme one pulse advances the rotor

one step angle. As the sequence of the 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.

It must be noted that, we can start with any sequences given in rows of tables, once we start with

any of the sequence we must continue in the proper order.

Step Angle: how much movement is associated with a single step. The step angle is the

minimum degree of rotation with the single step. Various motors have different step angles.

Table shows step angles for various motors. Since step angle of the motor is 1.8º, therefore 200

steps are required for one revolution.

Page 3: Interfacing Stepper Motor Using MicroController

Example:

Derive the stepper motor to rotate CW using 2-phase on switching scheme

ORG 000H

START:

MOV P2, #00110011B

CALL DELAY

MOV P2, #10011001B

CALL DELAY

MOV P2, #11001100B

CALL DELAY

MOV P2, #01100110B

CALL DELAY

JMP START

DELAY:

MOV R6, #40

DL1: MOV R7, #249

DJNZ R7, $

DJNZ R6, DL1

RET

END

Program description:

This program sends the switching data on port 2 to drive the stepper motor. Since infinite loop

resides in the program, stepper motor rotates continuously

Example:

When key”1” is pressed, the stepper motor rotates one step CW.

When key”0” is pressed, the stepper motor rotates one step CCW.

ORG 000H

JMP MAIN

ORG 003H

JMP INT0

ORG 100H

MAIN:

MOV IE, #10000001B

SETB IT0

MOV P1, #0FFH

MOVA, #00110011B

MOV P2,A

JMP $

INT0:

Page 4: Interfacing Stepper Motor Using MicroController

PUSH A

CLR EA

MOV A,P1

ANL A,#0FH

JZ TURNL

SUBB A,#1

JZ TURNR

POP A

SETB EA

RETI

TURNL:

POP A

RL A

MOV P2,A

CALL DELAY

SETB EA

RETI

TURNR:

POP A

RRA

MOV P2,A

CALL DELAY

SETB EA

RETI

DELAY 0.5mS

DELAY:

MOV R7,#249

DJNZ R7,$

RET

END

Program description:

Interrupt service routine INT0 reads and checks the key value of A. If A=0, CPU jumps to ISR

TURNL and derives the stepper motor one step CCW. If A=1, CPU jumps to the ISR TURNR

and derives the stepper motor rotating one step CW.

Activity#01:

Key 0 to 7 control the stepper motor rotating CW 1 to 8 revolutions, respectively.

Key 8 to F control the stepper motor, rotating CCW 1 to 8 revolutions, respectively. Put

comments in front of each instruction.

Activity#02:

Using 1-F keys to control the stepper motor as follows:

1- Key “1” pressed highest speed.

2- Key “2” pressed, ½ of the highest speed

3- Key “3” pressed, 1/3 of the highest speed

4- Key ‘F’ is pressed, lowest speed is achieved

5- Key “0”, stops