1. SPEED CONTROL OF STEPPER MOTOR USING
MICROCONTROLLER
Mr. Rahul Runthala1
Ashish Karol2
Bhuwnesh Gupta3
1Assistant professor, Department of electronics Engineering, B.K.Birla Institute of Engineering and Technology, Pilani
2 Student of electrical Engineering, B.K.Birla Institute of Engineering and Technology, Pilani
3 Student of electrical Engineering, B.K.Birla Institute of Engineering and Technology, Pilani
Abstract- A stepper motor is a special type of electricmotor that moves in increments, or steps, rather than turning smoothly
as a conventional motordoes. Typical increments are 0.9 or 1.8 degrees, with 400 or 200 increments thus representing a full circle. The
speed of the motor is determined by the time delay between each incremental movement. Inside the device, sets of coils produce
magnetic fields that interact with the fields of permanent magnets.
The coils are switched on and off in a specificsequence to cause the motor shaft to turn through the desired angle. The motor
can operate in either direction (clockwise or counterclockwise). When the coils of a stepper motor receive current , the rotor shaft
turns to a certain position and then stays there unless or until different coils are energized. This resistance is called holding torque.
Stepper motors have been used in computer hard drives, because they can be moved and positioned with precision.
I. INTRODUCTION
A microcontroller is a small computer (SOC) on a
single integrated circuit containing a processor core, memory,
programmable input/output peripherals.
AT89C52 has an endurance of 1000 Write/Erase
cycles which means that it can be erased and programmed to a
maximum of 1000 times. The AT89C52 is a low-power, high-
performance CMOS 8-bit microcontroller with 8K bytes of in-
system programmable Flash memory. The device is
manufactured using Atmel’s high-density nonvolatile memory
technology and is compatible with the industry-standard
80C51 instruction set and pin out. The on-chip Flash allows
the program memory to be reprogrammed in-system or by a
conventional nonvolatile memory programmer. By combining
a versatile 8-bit CPU with in-system programmable Flash on a
monolithic chip, the Atmel AT89C52 is a powerful
microcontroller which provides a highly-flexible and cost-
effective solution to many embedded control applications.[3]
The 89C52 has 4 different ports, each one having 8
Input/output lines providing a total of 32 I/O lines. Those ports
can be used to output DATA and orders do other devices, or to
read the state of a sensor, or a switch.
Atmel Corporation is an American-based designer
and manufacturer of semiconductors, founded in 1984. The
company focuses on embedded systems built
around microcontrollers. Its products include microcontrollers
(8-bit AVR, 32-bit AVR, 32-bit ARM-based, automotive
grade, and 8-bit Intel 8051 derivatives) radio frequency (RF)
device including Wi-Fi, EEPROM, and flash memory devices,
symmetric and asymmetric security chips, touch sensors and
controllers, and application-specific products.[6]
A. Block diagram of 8051
Figure 1 Block diagram of 8051
B. Comparison between 8051 and 8031
Table 1 Comparison between 8051 and 8031
S. no. Feature 8051 8031
1 ROM 4K 0K
2 RAM 128 128
3 TIMER 2 2
4 I/O PINS 32 32
5 Serial port 1 1
2. C. Comparison between AT89C52 and AT89C51
Table 2 Comparison between AT89C52 and AT89C51
Parameters AT89C52 AT89C51
RAM 256 Bytes 128 Bytes
Flash 8 KB 4 KB
Number of
Timers/Counters
3 (16-bit each) 2(16-bit each)
Number of Interrupt
Sources
8 6
II. OTHER CRITERIA’S FOR SELECTION
A. At-89c52 flash micro controller reliability data
B. 125c operating life test
C. 125c operating life test (plastic)
D. 150c data retention bakes (plastic)
E. 15 psig pressure pot
F. 131°c/85% relative humidity hast test
G. Extended temperature cycle
III. MICROCONTROLLERS PIN CONFIGURATION OF
AT89C52
Figure 2 Pin diagram AT89C52
TheAT89C52 has 4 different ports,each one having 8
Input/output lines providing a total of 32 I/O lines. There are
40 pins in this single chip for different purpose. Maximum
peak voltage provides 6.6 V to Vcc terminal.
IV. FEATURES OF AT89C52
Table 3 Feature of AT89C52
Core Processor- 8051
Speed 24MHz
Number Of I /o 32
Program Memory Type FLASH
Voltage - Supply (vcc/vdd) 4 V ~ 6 V
Operating Temperature 0°C ~70°C
Core Size 8-Bit
Connectivity SIO,UART/USART
Program Memory Size 8KB (8K x 8)
Ram Size 256 x 8
Oscillator Type Internal
V. STEPPER MOTOR
A stepper motor is a brushless DC electric motor
that divides a full rotation into a number of equal steps. The
motor's position can then be commanded to move and hold at
one of these steps without any feedback sensor (an open-loop
controller). A stepper motor is an electromechanical device
which converts electrical pulses into discrete mechanical
movements. The shaft or spindle of a stepper motor rotates in
discrete step increments when electrical command pulses are
applied to it in the proper sequence. The motors rotation has
several direct relationships to these applied input pulses. The
sequence of the applied pulses is directly related to the
direction of motor shafts rotation.
The speed of the motor shafts rotation is directly
related to the frequency of the input pulses and the length of
rotation is directly related to the number of input pulses
applied. The Stepper Motors therefore are manufactured with
steps per revolution of 12, 24, 72, 144, 180, and 200, resulting
in stepping angles of 30, 15, 5, 2.5, 2, and 1.8 degrees per step.
The stepper motor can be controlled with or without
feedback.[2]
VI. ADVANTAGES OF STEPPER MOTOR
A. The rotation angle of the motor is proportional to the input
pulse.
B. The motor has full torque at standstill.
C. It is excellent response to starting, stopping and reversing.
3. D. It is Very reliable since there are no contact brushes in the
motor.
E. The motors response to digital input pulses provides open-
loop control, making the motor simpler and less costly to
control.
F. It is possible to achieve very low speed synchronous
rotation with a load that is directly coupled to the shaft.
G. A wide range of rotational speeds can be realized as the
speed is proportional to the frequency of the input pulses.
VII. WORKING OF STEPPER MOTOR
DC brushed motors rotate continuously when DC
voltage is applied to their terminals. The stepper motor is
known by its property to convert a train of input pulses
(typically square wave pulses) into a precisely defined
increment in the shaft position. Each pulse moves the shaft
through a fixed angle.
Stepper motors effectively have multiple "toothed"
electromagnets arranged around a central gear-shaped piece of
iron. The electromagnets are energized by an external driver
circuit or a microcontroller. To make the motor shaft turn,
first, one electromagnet is given power, which magnetically
attracts the gear's teeth. When the gear's teeth are aligned to
the first electromagnet, they are slightly offset from the next
electromagnet. This means that when the next electromagnet is
turned on and the first is turned off, the gear rotates slightly to
align with the next one. From there the process is repeated.
Each of those rotations is called a "step", with an integer
number of steps making a full rotation. In that way, the motor
can be turned by a precise angle.
VIII. STEPPING MODES OF STEPPER MOTOR
There are four types of these stepping modes.
However, only three of the excitation modes are common in
most stepper drivers. Stepper motor drivers often have
different modes of operation. These different modes determine
in what sequence the coils are energized to make the motor
shaft move appropriately.
The following are the most common drive modes.
A. Wave Drive (1 phase on)
B. Full Step Drive (2 phases on)
C. Half Step Drive (1 & 2 phases on)
D. Micro stepping (Continuously varying motor currents)
A. Wave Drive
This method of stepping the motor energizes one
phase at a time. This method is rarely used and most likely
will not be on modern drivers. This method is very inefficient
and produces less torque than other methods.
Only one coil is energized in a rotator fashion. The
bit pattern is 0001, 0010, 0100, 1000. The disadvantage of this
drive mode is that in the uni polar wound motor you are only
using 25% and in the bipolar motor only 50% of the total
motor winding at any given time. This means that you are not
getting the maximum torque output from the motor. This
method is very inefficient and produces less torque than other
methods. This method is rarely used and most likely will not
be on modern drivers.
Figure 3 Wave drive
B. Full wave drive
This method of stepping the motor energizes both
phases constantly to achieve full rated torque at all positions
of the motor.
Two adjacent coils are energized successively in a rotary
fashion. The bit pattern will be 0011, 0110 ,1100, 1000,1001 ,
0001.
Figure 4 Full wav drive
4. C. Half wave drive
The Half step mode energizes a single coil then two
coils then one again. Alternating between energizing a single
phase and both phases together gives the motor its higher
resolution.
The stepper motor operates at half the given steeper
solution. The bit pattern is 0001, 0011, 0010, 0100, 1100,
1000, 1001and 0001. Stepper motor drivers often have
different modes of operation. These different modes determine
in what sequence the coils are energized to make the motor
shaft move appropriately.
Figure 5 Half step drives
IX. MAIN CIRCUIT DIAGRAM AND POWER SUPPLY
Figure 6 Main circuit
Figure 7 Power supply
A. Stepper motor drive ULN2003
The ULN2003A is an array of seven NPN Darlington
transistors capable of 500mA, 50V output. It features
common-cathode fly back diodes for switching inductive
loads.ULN2003 is a high voltage and high current Darlington
array IC. It contains seven open collector Darlington pairs
with common emitters. A Darlington pair is an arrangement of
two bipolar transistors each channel or Darlington pair
in ULN2003 is rated at 500mA and can withstand peak current
600 mA.
Figure 8 Pin diagram of ULN2003A
B. AC VOLTAGE REGULATING ICS 7812
7812 is a famous IC which is being widely used in
12V voltage regulator circuits. Truly speaking it is a complete
standalone voltage regulator. We only need to use two
capacitors, one on the input and second one on the output of
7812 in order to achieve clean voltage output and even these
capacitors are optional to use. To achieve 12V 1A current,
7812 should be mounted on a good heat sink plate.
5. Figure 9 AC voltage regulating ICs 7812
C. AC voltage regulated IC 7805
A LM7805 Voltage Regulator is a voltage regulator
that outputs +5 volts. The LM7805, like most other regulators,
is a three-pin IC.
Pin 1 (Input Pin): The Input pin is the pin that accepts the
incoming DC voltage, which the voltage regulator will
eventually regulate down to 5 volts.
Pin 2 (Ground): Ground pin establishes the ground for the
regulator.
Pin 3 (Output Pin): The Output pin is the regulated 5 volts DC.
Figure 10 AC voltage regulating ICs 7805
D. Crystal oscillator
The most common type of piezoelectric resonator
used is the quartz crystal, so oscillator circuits incorporating
them became known as crystal oscillators, but other
piezoelectric materials including polycrystalline ceramics are
used in similar circuits. A crystal oscillator is an electronic
oscillator circuit that uses the mechanical resonance of a
vibrating crystal of piezoelectric material to create an
electrical signal with a precise frequency. Quartz crystals are
manufactured for frequencies from a few tens of kilohertz to
hundreds of megahertz. More than two billion crystals are
manufactured annually.[7]
Figure 11 Crystal oscillator
X. APPLICATION
A. Robotic application
To move robotic arm in specific position, to move robot-
vehicle in specific direction at specific angle.
B. Disk drive application (CD drive, HDD)
To position reading head at specific position.
C. Defense application
To fire a shell or to launch missile at perfect angle
D. Domestic application
To open or close window shutter / curtain / blinds etc.
E. Communication application
To lock the position of satellite dish antenna at specific angle
F. Industrial Machines
Stepper motors are used in automotive gauges and machine
tooling automated production equipments.
G. Security
New surveillance products for the security industry.
H. Medical
Stepper motors are used inside medical scanners,samplers,
and also found inside digital dental photography,fluid pumps,
respirators and blood analysis machinery.
I. Consumer Electronics
Stepper motors in cameras for automatic digital camera focus
and zoom the functions.
J. Positioning application
Computer controlled stepper motors are a type of motion-
control positioning system. They are typically digitally
controlled as part of an open loop systemfor use in holding or
positioning applications.[2]
6. RESULT
Stepper motor speed control has many applications in
real life. It is used in robotics, medical, security, radar and so
many. We also studied about different ICs , which is used in
this project.
CONCLUSION
The simple construction of stepper motors makes them
ideal for applications where precise movement is required.
They are easily integral able into systems and made to meet
specifications. Different ICs is used to do work properly.
LM2003 is used to drive the stepper motor, whereas 7812
and 7805 are used as AC voltage regulator.
Reference
1. http://www.solarbotics.net/library/pdflib/pdf/motor
bas.pdf
2. http://www.imagesco.com/articles/picstepper/02.ht
ml
3. https://en.wikipedia.org/wiki/Microcontroller
4. http://www.engineersgarage.com/microcontroller
5. https://www.google.co.in/url?sa=t&rct=j&q=&esrc
=s&source=web&cd=9&sqi=2&ved=0ahUKEwjjv
4W-
wqvKAhULxI4KHWreCrkQFghMMAg&url=http
%3A%2F%2Fwww.mikroe.com%2Fchapters%2F
view%2F64%2Fchapter-1-introduction-to-
microcontrollers%2F&usg=AFQjCNEuFNgVx7b
BFu7yXuaSnGIQoDZwdw&bvm=bv.112064104,
d.c2E&cad=rja
6. http://www.atmel.com/products/microcontrollers/d
efault.aspx?src=parent
7. https://www.google.co.in/search?q=crystal+oscilla
or&oq=cr&aqs=chrome.1.69i59l2j69i57j69i60j0l2
.2739j0j4&sourceid=chrome&es_sm=93&ie=UTF
-8