Speed Control of Stepper Motor Using 8051 Microcontroller

Only available on StudyMode
  • Download(s) : 440
  • Published : December 24, 2012
Open Document
Text Preview
cc o s ts u c t uoc t i o n
onn rt r i n

stEPPEr Motor controL usinG
89c51 MicrocontroLLEr
Mandeep Singh Walia

H

ere’s a stepper motor controller
based on 89C51 microcontroller to
control the rotation of a DC stepper motor in clockwise and anti-clockwise directions. The controller is simple and
easy-to-construct, and can be used in many
applications including machine control and
robotics for controlling the axial rotation in
XY plane. A similar circuit can be added to
control the rotation of the motor in either
XZ or YZ plane.
Fig. 1 shows the block diagram of the
stepper motor control system. The power
supply section (in Fig. 2) consists of a stepdown transformer (7.5V AC, 1A), bridge rectifier (comprising diodes D1 through
D4), filter capacitors (C1 and C2) and
regulator IC 7805.
We have used here an Atmel make
low-power, high-performance, 8-bit CMOS
microcontroller AT89C51 with 4 kB of Flash
p rogrammable and erasable read-only
memory (PEROM). It has a 128x8-bit internal RAM, 32 programmable input/output (I/O) lines and two 16-bit timer/counters.
The on-chip Flash allows the program
memory to be reprogrammed in-system
or by a conventional non-volatile memory
programmer.

By combining a versatile 8-bit CPU
with Flash on a monolithic chip, Atmel
AT89C51 is a powerful, highly flexible and
cost-effective solution to many embedded
control applications. From traffic control
equipment to input devices, computer
networking products and stepper motor
controllers, 89C51 microcontrollers deliver
a high performance with a choice of configurations and options matched to the specific needs of each application.
IC AT89C51 features:
1. 8-bit CPU with math registers A
and B
2. 16-bit program counter (PC) and
data pointer (DPTR)
3. 8-bit program status word (PSW)
4. 8-bit stack pointer (SP)
The control switches for the motor are
connected to Reset and Port P0.7 pins of the
microcontroller.

Circuit description

Fig. 2 shows the complete circuit of the
stepper motor controller. When power
supply switch S1 is closed, LED1 glows
to indicate the presence of power in the
circuit. Capacitor C3 connected to pin 9
(RST) provides the power-on reset to the
microcontroller.
The stepper motor
is connected to port
p ins P2.4 through
P2.7 of the microcontroller (IC2) through
t h e m o t o r - d r i ve r
circuit consisting of
four Darlington pairs
c omprising transis tors BC548 and SL100
(T1-T2, T3-T4, T5-T6
a nd T7-T8). Coils
Fig. 1: Block diagram of the stepper motor control system
1 through 4 are the
tabLe i
Power Consumption of Microcontrollers
iC

Voh

ioh

CMOS
NMOS

2.4V
2.4V

–60 µA 0.45V
–80 µA 0.45V

electronics for you

Voi

october 2004

ioi

Vil

iil

Vih

1.7 mA
1.7 mA

0.9V
0.8V

10 µA
1.9V
–800 mA 2.0V

iih

Pt

10 µA
10 µA

50 mW
800 mW

O

I THE

sAN

Parts List
Semiconductors:
IC1
IC2
T1, T3, T5, T7
T2, T4, T6, T8
D1-D8
LED1

-

7805 5V regulator
AT89C51 microcontroller
BC548 npn transistors
SL100 npn transistors
1N4001 rectifier diodes
Red LED (5mm dia.)

Resistors (all ¼-watt, ±5% carbon):
R1
- 100-ohm
R2
- 10-kilo-ohm
R3, R5, R7, R9 - 1-kilo-ohm
R4, R6, R8, R10 - 470-ohm
Capacitors:
C1
C2
C3
C4, C5
C6
Miscellaneous:
X1

-

220µF, 25V electrolytic
100µF, 16V electrolytic
10µF, 16V electrolytic
33pF ceramic disk
100µF, 16V electrolytic

- 230VAC primary to 0-7.5V,
1A secondary step-down
transformer
- 5V DC stepper motor

stepper motor coils.
When transistors conduct, 5V (Vcc) is
applied to the coils and the currents flowing through them create magnetic fields and the motor starts rotating. The magnetic
field energy thus created is stored in the
coils.
When transistors stop conducting,
power to the coils is cut off, the magnetic
field collapses and a reverse voltage (called
inductive kickback or back emf) is generated in the coils. The back emf can...
tracking img