Professional Documents
Culture Documents
CHAPTER ONE
1 INTRODUCTION
A stepper motor is a brushless, synchronous electric motor that converts electrical pulses into
mechanical movement. Every revolution of the stepper motor is divided into a discrete number of
steps, and the motor must be sent a separate pulse for each step. The stepper motor can only take
one step at a time and each step is the same size. Since each pulse causes the motor to rotate a
precise angle, the motor’s position can be controlled without any feedback mechanism. As the
electrical pulses increase in frequency, the step movement changes into continuous rotation, with
the speed of rotation directly proportional to the frequency of the pulses. Step motors are used
every day in both industrial and commercial applications because of their low cost, high
reliability, high torque at low speeds and a simple, rugged construction that operates in almost
any environment.
1.4 Methodology
This project has two phases the first phase is related with a paper work and analytical
determination of the different electrical quantities that are going to be installed on the final work
and the second phase is related with simulation and physical implementation of the project. In
this project we are going to choose the stepper motor controller which suits our requirement for
the project. Design and implement microcontroller based stepper motor speed and position
control is carried out. For the overall design and implementation of this project we require both
software and hardware resources. We used proteus, multism and other relevant software for
simulating, designing and testing.
PIC16F84A Microcontroller
Stepper motor
Capacitor
Push button
Diode
Ammeter
Volt meter
Crystal
Resistor
Logic gates
Battery
Inductor
For completing and testing this thesis we used proteus, multism and other relevant software for
simulating, designing and testing.
ULN2003A, PIC16F84A Microcontroller and stepper motor. For fulfill this need diode rectifier
is used in bridge connected configuration for changing AC to DC for all the components. The
Microcontroller pins are connected to a frequency oscillator for frequency stability purposes. The
non-electrolytic capacitors are connected with this crystal oscillator for changing the triangular
pulse to rectangular pulse. The ULN2003A driver circuit is connected with six wire unipolar,
bipolar stepper motors required control pulses on its input pins for operation which receives
from the Microcontroller. We use drivers because the microcontroller output is not sufficient to
drive the stepper motor.
CHAPTER TWO
2 LITERATURE REVIEW
Stepper motors and microcontrollers are used in many applications like position control, speed
control and measurement applications. Different applications and controlling techniques are
described by different authors in this literature review. T.S. Weerakoon described a novel drive
topology for a three phase stepper motor in detail. This paper presents that a low cost, standard
stepper motor drive IC are used to derive a novel drive topology for three phase stepper motor
which enables closed loop speed and position control powered by inner current control loop. The
designed driver have full-step, half-step, clockwise and counter clockwise drive modes with the
speed control and current control [1]. S.G. Abeyratne gave simplification about how we can
transfer the stored energy in the inductance winding of uni-polar stepper motor when
semiconductor switches are off. T h e Author designed a circuit having no zener suppressors and
condensers which are used mostly in uni- polar drive circuit in industries for the protection of
driving circuit from over voltages due this stored energy. T h e Author implemented fast
recovery diodes which are capable of transferring this stored energy back to the system and also
enhances the torque capability of motor [2]. Xiahua Zhangx etal presented a stepper motor
control system is adopted high-performance AVR microcontroller Atmega128 and serial
communication. The system mainly consists of host computer, console and a stepper motor. The
data is interacted by the serial port between PC and console. Ultimately, the direct control of
stepper motor by the PC is achieved. After debugging of the designed control system, the results
demonstrate that the control circuit and program are simple and practical [3]. Archan Patel etal
proposed the design and hardware implementation of bipolar micro-stepping drive for disc rotor
type stepper motor. This type of motor has advantages like high torque at high speed, very low
moment of inertia and low power consumption. The micro-stepping control improves the
positioning accuracy; eliminate low speed ripples and resonance effects [4]. Marceno etal
presented a novel fully integrated 65W stepper motor driver IC. It is capable of control up-to two
stepper motors and four DC motors. This IC is fully protected and programmable and reduces the
need of external components for protection due to in built protection facility with high flexibility
[5]. There are also a number of projects that are done on this topic in most of the design
procedure varies on the selection and implementation of the control circuit. In our case we use
both bipolar and unipolar stepper motors to control speed and position with the microcontroller
and switch sensor. In this case the microcontroller is to control all the processes of bipolar,
unipolar and switch sensors of the process for the purpose of controlling the speed and direction
of the target.
CHAPTER THREE
PIC16F84A
Stepper
Microcontroller motor
Power supply
Control switch
(Sensor)
Due to various disadvantages of DC motors in some applications they are increasingly begin
replaced by servo motors or stepper motors. Both types of motors offer similar opportunities for
precise positioning but they differ in a number of ways. Servo motors require analog feedback
control systems of some type while stepper motors can run open loop. When making a choice
between them, a number of issues that are application specific must be considered. From a
control engineer’s perspective, the development of open loop or closed loop control involves
modeling, and simulation of any system (a stepper motor in this case) requires a thorough
understanding of the system dynamics. This chapter will provide a brief overview of the
electromechanical behavior of the stepper motor and its principle of operation. Below in Fig 3.3
we see the basic components of a stepper motor.
(a)
(b)
In Fig 3.4 a bellow we can see that when current is applied to the top and bottom stator windings,
they will become a magnet with the top part of the winding being the North Pole, and the bottom
part of the winding is the South Pole. We should notice that this will cause the rotor to move a
small amount so that one of its south poles is aligned with the north stator pole (at the top). The
opposite end of the rotor pole, which is the North Pole, will align with the south pole of the stator
(at the bottom). So that we can follow its movement as current is moved from one stator winding
to the next. In Fig 3.4 b current has been turned off the top and bottom windings, and current is
now applied to the stator windings shown at the right and left sides of the motor.
In this condition, the next rotor pole that will be able to align with the stator magnets is the next
pole in the clockwise position to the previous pole. This means that the rotor will only need to
rotate 30° in the clockwise position for this set of poles to align with the stator poles.
We should notice that the rotor has moved four steps of 30° each, which means the rotor has
moved a total of 120° from its original position. This can be verified by the position of the rotor
pole that has the line on it, which is now pointing at the stator winding.
Inductance
Stepper motors are rated with a varying degree of inductance. A high inductance motor will
provide a greater amount of torque at low speeds and lower torque at high speeds.
Motor Stiffness
Stepper motor runs stiffly due to the design. By reducing the current flow to the motor by small
Percentage will smooth the operation and by increasing current will increase the stiffness but
Also provide more torque.
Motor Heat
Stepper motors are designed to run hot between the ranges of 50-90 degree. But many times
Current may cause excessive heating and damage to the motor insulation and winding.
A unipolar stepper motor has two windings per phase, one for each direction of magnetic field.
Since in this arrangement a magnetic pole can be reversed without switching the direction of
Current, the commutation circuit can be mad very simple i n a single transistor for each
winding. Typically, given a phase, one end of each winding is made common: giving three leads
per phase and six leads for a typical two phase motor.
Bipolar motors have a single winding per phase. The current in a winding needs to be reversed in
Order to reverse a magnetic pole, so the driving circuit must be more complicated; typically with
an H-bridge arrangement (however there are several off the shelf driver chips available to make
this a simple affair). There are two leads per phase, none are common. Static friction effects
using an H-bridge have been observed with certain drive topologies. Because windings are better
utilized, they are more power full than a unipolar motor of the same weight. This is due to the
physical space occupied by the windings. A unipolar motor has twice the amount of wire in the
same space, but only half used at any point in time, hence is 50% efficient (or approximately
70% of the torque output available). Though bipolar is more complicated to drive, the abundance
of driver chip means this is much less difficult to achieve. This type of motor is more efficient
than a unipolar stepper motor.
Timer interrupt
step-cou( )
Deceler Accele
ate rate
Move ( ) Setup
calculation Run
This switching function is provided by the driver circuit which arranges, distributes and amplifies
pulse trains from the signal circuit. The windings of the stepper motor are excited at specified
sequence. The availability of integrated circuit drivers has made the building of circuits using
discrete components unnecessary for small stepper motors of rating less than 3 amperes.
Unipolar drive
R/L drive
Bipolar chopper drive
A stepper motor is driven from a low voltage dc source. The dc power supply to drive circuits
should be as freer from harmonics as possible. For optimum torque output from a stepper motor,
the drive circuits should possess the following features. During turn on the current in the phase
winding should rise from zero to desired level in short duration. During turn off the current in the
phase winding should be forced to zero in short duration.
Unipolar drive
The facts drive is named unipolar because the fact that the current flow is limited to one
direction. The switch set of unipolar drive is fairly simple and expensive. The drawback to using
unipolar drive is its limited capability to energize all the windings at any one time. In unipolar
stepper motor the torque is proportional to the square of current, the direction of current in phase
winding for operating this motor is an important.
In this manner the four phase windings are excited in appropriate manner. The phase windings
have large inductance, there for in series in each phase winding a forcing resistance is inserted so
to reduce the circuit time constant. A resistance is also placed in series with the freewheeling
diode in order to dissipate the energy stored in the phase winding inductance.
Resistance/Limited drive
These drives are tools as compared to the today driver’s technology. They only exist in some
applications because they are simple and in expensive. The drawback to using these drives is that
these drives rely on “dropping resistor” to get almost 10 times the amount of motor current rating
necessary to maintain a useful increase in speed. This process produces an excessive amount of
Heat and must rely on Dc power supply for its current source.
Bipolar drive
These drives are mostly used in the industrial applications. These drives are more expensive but
they offer high performance and efficiency. In bipolar stepper motors the torque is proportional
to phase current. The direction of rotation in the motors is dependent on the direction of current
in phase windings. For rotation in one direction therefore bi-polar drive circuit for each phase is
required. Here T1 to T4 are controllable switches. These switches may be any semiconductor
switch depends on the current to be handled by them. When the switches are closed, current
flows in the direction of arrows associated with them. The diodes in parallel with each of the
semiconductor controllable switch protect these controllable switches from voltage spikes
produced from the switching of the inductor.
However, for high precision positioning applications, even this position resolution may be
inadequate. Certain equipment now being used to produce electronic integrated circuits may
require mechanical motion precisely controlled in steps of only about 0.1 micrometer. Since the
minimum step that can be produced by a stepper motor is determined by its mechanical design
(mainly the number of poles or teeth in the stator and the rotor), a limit is soon reached where
other means must be employed to subdivide the steep angle in order to improve the resolution.
This paper describes one approach to achieve the improved resolution electronically. Essential to
the operation of the stepper motor is the stator current timing sequence. By appropriately
controlling this stator current timing sequence, the stepper motor would be driven into the
required position resolution. The most important benefit of micro stepping is improved position
resolution. Other positive feature is the reduction in ripple torque, especially at lower motor
speeds. By micro stepping, with its higher frequency pulse rates and smaller step angles, the
overshoot is reduced and resonance is not triggered. Stepper Motor Switching Sequence To
enable rotation of the rotor the magnetic field generated by the stator windings has to interact and
drive the rotor flux, which is achieved by switching the direction of current flow through each
winding. The switching sequences for the stepper motor are as described below. The stepper
motor uses a four-step switching sequence, which is called a full-step switching sequence.
(a)
(b)
Fig 3.10 Switching Circuit and Sequence Table for Full Step Mode
During the first step of the sequence, switches SW1 and SW3 are on and the other two are off.
During the second step of the sequence, switches SW1 and SW4 are on and the other two are off.
During the third step of the sequence, SW2 and SW4 are on and the other two are off. During the
fourth step of the sequence, SW2 and SW3 are on and the other two are off. This sequence
continues through four steps, and then the same four steps are repeated again. These steps cause
the motor to rotate one step or tooth on the rotor when a pulse is applied by closing two of the
switches. This “Two Phase On” method gives 41.4 % more torque compared to “One Phase On”
method. Another switching sequence for the stepper motor is called an eight-step or half-step
sequence. The switching diagram for the half-step sequence is shown in Fig 3.11 bellow. The
main feature of this switching sequence is that you can double the resolution of the stepper motor
by causing the rotor to move half the distance it does when the full-step switching sequence is
used. This means that a 200-step motor, which has a resolution of 1.8°, will have a resolution of
400 steps and 0.9°. The way the controller gets the motor to reach the half-step is to energize both
phases at the same time with equal current.
Fig 3.11 Switching Circuit and Sequence Table for Half Step Mode
In this sequence the first step has SW1 and SW3 on, and SW2 and SW4 are off. The sequence for
the first step is the same as the full-step sequence. The second step has SW1 on and all of the
remaining switches are off. This configuration of switches causes the rotor to move an additional
half-step. The third step has SW1 and SW4 on, and SW2 and SW3 are off, which is the same as
step 2 of the full-step sequence. The sequence continues for eight steps and then repeats. The
main difference between this sequence and the full-step sequence is that steps 2, 4, 6, and 8 are
added to the full-step sequence to create the half-step moves. The amount of resolution is also
limited by the number of physical poles that the rotor can have. The amount of resolution
(number of steps) can be increased by manipulating the current that the controller sends to the
motor during each step. Also we can reduce the resonance problem using micro-stepping at a low
step rate. For that the current can be adjusted so that it looks similar to a sine wave.
T= torque in Oz-in
I= the moment of inertia in Ib-in2
a=angular acceleration in rad/s2
1/24= conversion factor for converting gravitational units (/s2)
Frictional and Rotational Acceleration Considerations
The formula for calculating the torque required to rotationally accelerate an inertia load is
1) Computer Peripherals
Floppy disk
Printer
Tape Reader
Plotter
2) Business Machines
Card Reader
Copy Machine
Banking systems
Type Writer
Card sorter
3) Process Control
Valve control
Conveyor
Assembly lines
Laser trimming
Mail handling system
4) Machine Tools
Milling Machine
Drilling Machine
Grinding Machine
Laser Cutting
Sewing
Stepper motor and microcontroller are used in cattle feed mixing with the aim of optimizing the
efficiency and consistency of mixing in order to improve the quality of feed for producing best
quality and quantity of milk. Peristaltic pumps and stepper motors control the quantities of liquid
nutrient additives and actuators vary the feed rate of the mix and extension of the feed conveyor.
To The stepper motors are used for storing the kinetic energy of the vehicles by minimizing the
fuel consumption and emissions by the regeneration of braking energy and by minimizing the
inefficient part of load operation of the engine. The stepper motor is used in color non-impact
printers and in computer disk drivers. Microcontrollers are used in many sectors due to
programmable capability. The microcontrollers are used to control the remotely located stepper
motors. Stepper motor drive is used as on load tap changer in electric locomotive.
Microcontroller with stepper motor is used for pipe lining control. Stepper motors are used in
CNC mills and robotics. Stepper motors are used in spaces satellites for the purposes of solar
array drive. Stepper motors are used in automatic camera steering and in space craft applications.
Steppers motors are used in thrust control in marines and in aviation applications.
Microcontrollers are used in induction motors drives and with stepper motor it is used in
automotive fuel pumps. Microcontroller and stepper motors are used in surveillance system to
protect forests from fire. The surveillance system has a capacity for detecting fires and other
ecological crimes. The system uses a digital camera that is controlled remotely by a
microcontroller. In positioning the camera, the system uses a stepper motor for the vertical
movement of the camera and a DC motor for the horizontal movement. The system also captures
information about the temperature, humidity, wind speed and direction. A stepper motor and
microcontroller is used for measuring water level. A microcontroller and stepper motor are used
in solar tracing applications for automatically movement of solar panel towards the sun for
increasing the efficiency of photovoltaic cells. Stepper motors and microcontrollers are used in
making turn tables and antenna positioning system for testing the electromagnetic radiation
emitted by the electronic and electrical component in open area test site.
In the PM type stepper motor, a permanent magnet is used for rotor and mils are put on stator.
The stepper motor model which has 4-poles is shown in the Figure 3.13 above. In case of this
motor, steep angle of the rotor is 90 degrees. As for four poles, the top and the bottom and either
side are a pair X coil, and Xˉ coil, correspond respectively. Y coil and Yˉ coil are put to the upper
and lower pole. Y coil and Yˉ coil are rolled up for the direction of the pole to become opposite
when applying an electric current to the Y coil and applying an electric current to the Yˉ coil. It is
similar about x and, too. The turn of the motor is controlled by the electric current which pours
into X, Xˉ, Y and Yˉ. The rotor rotational speed and the direction of the turn can be controlled by
this control.
3.14 Microcontroller
The mainly function of microcontroller was used to generated a step pulse signal to operate the
Stepper Motor which either in clockwise or counterclockwise rotation. And also the speed of the
motor can controlled by increased or decreased the period generated the step signal by
voltage regulation to the connected system. A heat sinker for heat dissipation is also connected at
the top of the IC. Many times fixed output voltage makes it use full for many applications.
InthepresentworkLM7805isusedforregulationpurposesandfor changing 12V DC to 5V DC.
Block diagram
In the block given below the voltage regulator provides fixed or adjustable voltages and
Protections like short circuit protection, over temperature and also filter the harmonics due to the
presence of series pass element at the output terminal.
Pin configuration
Pin diagram
VO Output voltage 50 V
IC Continuous 500 MA
collector
current
IB Continuous 25 MA
base current
T am Operating 20-85 0C
ambient
temperature
range
Tj Junction 150 0C
temperature
CHAPTER FOUR
Fig 4.3 output of PIC16F84A microcontroller for unipolar stepper motor control
Fig 4.4 output of PIC16F84A microcontroller for bipolar control of stepper motor
CHAPTER FIVE
5.1 Conclusion
Different controlling techniques are used for controlling position and speed of stepper motor.
Different microcontroller techniques used for controlling the speed and position of a stepper
motors .Out of all the techniques Microcontroller is one of the easiest technique for controlling
the speed and position of stepper motor. The speed of the stepper motor is controlled by
changing the delay time of pulses and control over the position is done by control the number of
pulses. Also unipolar stepper motor is better than a bipolar stepper motor because of the reduced
step angle and there is no need of reversal the current in the unipolar drive for changing the
rotation of stepper motor. As in microcontroller we can change the control program according to
the need with serial port programming by a personal computer. The applications of permanent
magnet stepper motors have grown significantly in recently years in the appliance industry and
the automotive industry, among others. These motors are used in a variety of industries, including
high and low propulsion technology, computer peripherals, machine tools, robotics, etc. Sensor
less permanent magnet motors are preferable because of compactness, low cost, low
maintenance, and higher liability.
5.2 Recommendation
In our project we used only discrete sensors by on and off the switches for the purpose of rotating
the motor, for the future adding PIR sensor makes more accurate for motor speed and direction
control system.
REFERENCES
[1] JIEBINZHU AND GAOHUALIAO “Design of multi-axis motion control system for
Stepping Motor”. WASE international conference on information engineering, pp. 23-26, 2010.
[2] JIEBINZHU “Design of multi axis control system for stepping motor”. World international
conference on information engineering, pp. 34-37, 2010.
[4] V. MARCENO AND D.ARRIGO “N ov el fully integrated 65W stepper motor driver IC”.
SPEED A M2 006, ISPE, electric driver, automation and motion, pp. 12-16, 2006.
[5] MOHANUNDEL AND ANDRIOBBINS “Power electronics” chapter7. Page no.17, 79-100,
2007.
Appendix
// C code
sbitwinde at rc1_bit;
int on=1,num_of_turns=10,i,j;
intstepps[]={9,8,10,2,6,4,5,1};
void main() {
trisb=0;
trisc=3;
trisd=0;
portd=0;
portb=0;
while(1)
if(power == 0 ){portd=0;}
if(power == on)
portd=2;
if(winde == on)
portd=3;
for(i=0;i<num_of_turns;i++)
for(j=0;j<8;j++)
portb=stepps[j];
delay_ms(25);
//ARDUINO CODE
void setup( ) {
void loop ( ) {
if (serial. available ( ) ) {
if ( in byte = = 'a' | | in byte = = 'A') { // anti clock wise direction write U Int (280);
blink (2);
blink (3);
else if (in byte= = 'w' || in byte = = 'W') { // speed up write U Int (282);
blink (4);
else if ( in byte = = 's' || in byte = = 'S') { // speed down write U Int (283);
blink (5);
else if ( in byte = = 'r' || in byte = = 'R' ) { // re set all write U Int (284);
blink (6);