Smoke Sensor Module
Smoke Sensor Module
INTRODUCTION
1
Figure 1.1: Position of the six-pole rotor and four-pole
stator of a typical stepper motor
When no power is applied to the motor, the residual magnetism in the rotor magnets will
cause the rotor to detent or align one set of its magnetic poles with the magnetic poles of
one of the stator magnets. This means that the rotor will have 12 possible detent positions.
When the rotor is in a detent position, it will have enough magnetic force to keep the shaft
from moving to the next position. This is what makes the rotor feel like it is clicking from
one position to the next when rotated manually.
When power is applied, it is directed to only one of the stator pairs of windings, which
will cause that winding pair to become a magnetized. One of the coils for the pair will
become the north pole, and the other will become the south pole. When this occurs, the
stator coil that is the north pole will attract the closest rotor tooth that has the opposite
polarity, and the stator coil that is the south pole will attract the closest rotor tooth that has
the opposite polarity. When current is flowing through these poles, the rotor will now
have a much stronger attraction to the stator winding, and the increased torque is called
holding torque.
By changing the current flow to the next stator winding, the magnetic field will be
changed 90°. The rotor will only move 30° before its magnetic fields will again align with
the change in the stator field. The magnetic field in the stator is continually changed as
the rotor moves through the 12 steps to move a total of 360°.
2
Figure 1.2: Movement of the stepper motor rotor as current is pulsed to the stator.
(a) Current is applied to the top and bottom windings, so the top winding
is north, (b) Current is applied to left and right windings, so the left
winding is north, (c) Current is applied to the top and bottom windings,
so the bottom winding is north, (d) Current is applied to the left and right
windings so the right winding is north.
In Figure 1.2a it ca be noted that when current is applied to the top and bottom stator
windings, they will be magnetized with the top part of the winding being the north pole,
and the bottom part of the winding being the south pole. 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), and the opposite end of the rotor pole, which is the north pole, will align with the
south pole of the stator (at the bottom). A line is placed on the south-pole piece that is
located at the 12 o'clock position in Figure 1.2a so that to enable the rotation to be noted
as current is moved from one stator winding to the next.
In Figure 1.2b current has been turned off to the top and bottom windings, and current is
now applied to the stator windings shown at the right and left sides of the motor. When
this occurs, the stator winding at the 3 o'clock position will have the polarity for the south
3
pole of the stator magnet, and the winding at the 9 o'clock position will have the north-
pole polarity. 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
itself so that it attracts the stator poles.
In Figure 1.2c it can be noted that the top and bottom stator windings are energized again,
but this time the top winding is the south pole of the magnetic field and the bottom
winding is the north pole. This change in magnetic field will cause the rotor to again
move 30° in the clockwise position until its poles will align with the top and bottom stator
poles. The original rotor pole that was at the 12 o'clock position when the motor first
started has now moved three steps in the clockwise position.
In Figure 1.2d it can be noted that the two side stator windings are energized again, but
this time the winding at the 3 o'clock position is the north pole. This change in polarity
will cause the rotor to move another 30° in the clockwise direction. 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 that is located in the 3 o'clock position.
Characteristics
• Holding Torque – Stepper motors have very good low speed and holding torque.
They are usually rated in terms of their holding force (oz/in) and can even hold a position
(to a lesser degree) without power applied, using magnetic 'detent' torque.
• Open loop positioning - Perhaps the most valuable and interesting feature of a
stepper motor is the ability to position the shaft in fine predictable increments, without
need to query the motor as to its position. Stepper motors can run 'open-loop' without the
need for any kind of encoder to determine the shaft position. Closed loop systems-
systems that feed back position information, are known as servo systems. Compared to
servos, stepper motors are very easy to control; the position of the shaft is guaranteed as
long as the torque of the motor is sufficient for the load, under all its operating conditions.
4
• Load Independent - The rotation speed of a stepper motor is independent of load,
provided it has sufficient torque to overcome slipping. The higher rpm a stepper motor is
driven, the more torque it needs, so all steppers eventually poop out at some rpm and start
slipping. Slipping is usually a disaster for steppers, because the position of the shaft
becomes unknown. For this reason, software usually keeps the stepping rate within a
maximum top rate. In applications where a known rpm is needed under a varying load,
steppers can be very handy.
5
Figure 1.3: Variable Reluctance Motor
The variable reluctance motor in the above illustration has three "stator pole sets" (A, B,
C,), set 15 degrees apart. Current applied to pole A through the motor winding causes a
magnetic attraction that aligns the rotor (tooth) to pole A. Energizing stator pole B causes
the rotor to rotate 15 degrees in alignment with pole B. This process will continue with
pole C and back to A in a clockwise direction. Reversing the procedure (C to A) would
result in a counterclockwise rotation.
6
Figure 1.4: Permanent magnet motor
Unlike the other stepping motors, the permanent magnet motor rotor has no teeth and is
designed to be magnetized at a right angle to its axis. The above illustration shows a
simple, 90 degree permanent magnet motor with four phases (A-D). Applying current to
each phase in sequence will cause the rotor to rotate by adjusting to the changing
magnetic fields. Although it operates at fairly low speed the PM motor has a relatively
high torque characteristic.
7
Figure 1.5: Hybrid motor
Unipolar stepper motors are composed of two windings, each with a center tap. The
center taps are either brought outside the motor as two separate wires (as shown in Figure
1.6) or connected to each other internally and brought outside the motor as one wire. As a
result, unipolar motors have 5 or 6 wires. Regardless of the number of wires, unipolar
motors are driven in the same way. The center tap wire(s) is tied to a power supply and
the ends of the coils are alternately grounded. Unipolar stepper motors, like all permanent
magnet and hybrid motors, operate differently from variable reluctance motors. Rather
than operating by minimizing the length of the flux path between the stator poles and the
rotor teeth, where the direction of current flow through the stator windings is irrelevant,
these motors operate by attracting the north or south poles of the permanently magnetized
rotor to the stator poles. Thus, in these motors, the direction of the current through the
stator windings determines which rotor poles will be attracted to which stator poles.
Current direction in unipolar motors is dependent on which half of a winding is
energized. Physically, the halves of the windings are wound parallel to one another.
Therefore, one winding acts as either a north or south pole depending on which half is
powered. Figure 1.6 shows the cross section of a 30 degree per step unipolar motor.
Motor winding number 1 is distributed between the top and bottom stator poles, while
8
motor winding number 2 is distributed between the left and right motor poles. The rotor is
a permanent magnet with six poles, three north and three south.
Bipolar stepper motors are composed of two windings and have four wires. Unlike
unipolar motors, bipolar motors have no center taps. The advantage to not having center
taps is that current runs through an entire winding at a time instead of just half of the
winding. As a result, bipolar motors produce more torque than unipolar motors of the
same size. The draw back of bipolar motors, compared to unipolar motors, is that more
complex control circuitry is required by bipolar motors. Current flow in the winding of a
bipolar motor is bidirectional. This requires changing the polarity of each end of the
windings. As shown in Figure 1.7, current will flow from left to right in winding 1 when
1a is positive and 1b is negative. Current will flow in the opposite direction when the
polarity on each end is swapped.
9
1.4: DC MOTORS VS. STEPPER MOTORS
Stepper motors are operated open loop, while most DC motors are operated closed
loop.
Stepper motors are easily controlled with microprocessors; however logic and
drive electronics are more complex.
Stepper motors are brushless and brushes contribute several problems, e.g., wear,
sparks, electrical transients.
DC motors have a continuous displacement and can be accurately positioned,
whereas stepper motor motion is incremental and its resolution is limited to the
step size.
Stepper motors can slip if overloaded and the error can go undetected.
Feedback control with DC motors gives a much faster response time compared to
stepper motors.
Advantages
Accuracy & Repeatability – Ability to position accurately.
Responsiveness & Quick Acceleration – Step motors have low rotor inertia,
allowing them to get up to speed quickly. This makes step motors an excellent
choice for short, quick moves.
Excellent torque for their size – Step motors have the highest torque per cubic
inch of any motor.
Positioning Stability – Unlike other types of motors, step motors can be held
completely motionless in their stopped position.
Open Loop Control – Open loop control is simpler, more reliable and less
expensive than closed loop control. In closed loop systems, encoders are used to
count the number of steps taken by the motor. The number of steps taken is
compared to the number of step commands given. This feedback is used to make
position corrections or initiate alarm signals. Encoders and their associated
electronics add additional cost to a motion control system. Assuming that a step
motor is properly sized for its load, it should never miss a step, making an encoder
unnecessary.
10
Cost and Reliability – Step motor technology is reliable and proven. It is the most
cost effective method of precision position control.
Disadvantages
Resonances can occur if not properly controlled.
Not easy to operate at extremely high speeds.
The 8051 UARTs make it simple to use the chip as a serial communications interface.
External pins can be configured to connect to internal shift registers in a variety of ways,
and the internal timers can also be used, allowing serial communications in a number of
modes, both synchronous and asynchronous. Some modes allow communications with no
external components.
Once a UART has been configured, the programmer needs only to write a simple
interrupt routine to refill the 'send' shift register whenever the last bit is shifted out by the
UART and/or empty the full 'receive' shift register (copy the data somewhere else). The
main program then performs serial reads and writes simply by reading and writing 8-bit
data to stacks.
8051 based microcontrollers typically include one or two UARTs, two or three timers,
128 or 256 bytes of internal data RAM (16 bytes of which are bit-addressable), up to 128
bytes of I/O, 512 bytes to 64 kB of internal program memory, and sometimes a quantity
of extended data RAM (ERAM) located in the external data space. The original 8051 core
ran at 12 clock cycles per machine cycle, with most instructions executing in one or two
11
machine cycles. With a 12 MHz clock frequency, the 8051 could thus execute 1 million
one-cycle instructions per second or 500,000 two-cycle instructions per second. Enhanced
8051 cores are now commonly used which run at six, four, two, or even one clock per
machine cycle, and have clock frequencies of up to 100 MHz, and are thus capable of an
even greater number of instructions per second. All SILabs, some Dallas and a few Atmel
devices have single cycle cores.
Common features included in modern 8051 based microcontrollers include built-in reset
timers with brown-out detection, on-chip oscillators, self-programmable Flash ROM
program memory, bootloader code in ROM, EEPROM non-volatile data storage, I²C,
SPI, and USB host interfaces, PWM generators, analog comparators, A/D and D/A
converters, RTCs, extra counters and timers, in-circuit debugging facilities, more
interrupt sources, and extra power saving modes.
Several assembly compilers are available for the 8051, most of which feature extensions
that allow the programmer to specify where each variable should be stored in its six types
of memory, and provide access to 8051 specific hardware features such as the multiple
register banks and bit manipulation instructions. Other high level languages such as Forth,
BASIC, Pascal/Object Pascal, PL/M and Modula 2 are available for the 8051, but they are
less widely used than C and assembly.
12
CHAPTER 2
THEORY OF THE STEPPER MOTOR
Again, for an ideal 2 winding permanent magnet motor, this can be mathematically
expressed as:
Where:
T -- torque
h -- holding torque
S -- step angle, in radians
Theta = shaft angle, in radians
13
But remember, subtle departures from the ideal sinusoid described here are very common.
The single-winding holding torque of a stepping motor is the peak value of the torque
versus position curve when the maximum allowed current is flowing through one motor
winding. If you attempt to apply a torque greater than this to the motor rotor while
maintaining power to one winding, it will rotate freely.
Assuming that the torque versus angular position curve is a good approximation of a
sinusoid, as long as the torque remains below the holding torque of the motor, the rotor
will remain within 1/4 period of the equilibrium position. For a two-winding permanent
magnet or hybrid motor, this means the rotor will remain within one step of the
equilibrium position.
With no power to any of the motor windings, the torque does not always fall to zero. In
variable reluctance stepping motors, residual magnetization in the magnetic circuits of the
motor may lead to a small residual torque, and in permanent magnet and hybrid stepping
motors, the combination of pole geometry and the permanently magnetized rotor may
lead to significant torque with no applied power.
The residual torque in a permanent magnet or hybrid stepping motor is frequently referred
to as the cogging torque or detent torque of the motor because a naive observer will
frequently guess that there is a detent mechanism of some kind inside the motor. The
most common motor designs yield a detent torque that varies sinusoidally with rotor
angle, with an equilibrium position at every step and an amplitude of roughly 10% of the
rated holding torque of the motor,
14
Figure 2.2: Torque vs. angle
The first thing to note about the process of taking one step is that the maximum available
torque is at a minimum when the rotor is halfway from one step to the next. This
minimum determines the running torque, the maximum torque the motor can drive as it
steps slowly forward. For common two-winding permanent magnet motors with ideal
sinusoidal torque versus position curves and holding torque h, this will be h/(2 0.5). If the
motor is stepped by powering two windings at a time, the running torque of an ideal two-
winding permanent magnet motor will be the same as the single-winding holding torque.
It should be noted that at higher stepping speeds, the running torque is sometimes defined
as the pull-out torque. That is, it is the maximum frictional torque the motor can
overcome on a rotating load before the load is pulled out of step by the friction. The pull-
in torque, is the maximum frictional torque that the motor can overcome to accelerate a
stopped load to synchronous speed.
In practice, there is always some friction, so after the equilibrium position moves one
step, the rotor is likely to oscillate briefly about the new equilibrium position. The
resulting trajectory may resemble the one shown in Figure 2.3:
Here, the trajectory of the equilibrium position is shown as a dotted line, while the solid
curve shows the trajectory of the motor rotor.
15
2.1.2: Torque / Speed Curves
It is very important to know how to read a torque/speed curve because it describes what a
motor can and cannot do. It is also important to keep in mind that a torque/speed curve is
for a given motor and a given driver. Torque is dependent on the driver type and voltage.
The same motor can have a very different torque/speed curve when used with a different
driver. The same motor with a similar drive, similar voltage and similar current should
give similar performance. Torque/speed charts can also be used to roughly estimate the
torque produced using different drivers at varying voltages and currents.
To get a better understanding of this curve it is useful to define the different aspect of this
curve.
Holding Torque is the amount of torque that the motor produces when it has rated
current flowing through the windings but the motor is at rest.
Stop / Start Region is the area on and underneath the pull-in curve. For any load
value in this region, the motor can start, stop, or reverse ―instantly‖ (no ramping
required) at the corresponding speed value.
16
Slew Range is the area between the pull-in and the pull-out curves, where to
maintain synchronism, the motor speed must be ramped (adjusted gradually).
17
A pole can be defined as one of the regions in a magnetized body where the magnetic flux
density is concentrated. Both the rotor and the stator of a step motor have poles. In reality
several more poles are added to both the rotor and stator structure in order to increase the
number of steps per revolution of the motor, or in other words to provide a smaller basic
(full step) stepping angle. The permanent magnet stepper motor contains an equal number
of rotor and stator pole pairs. Typically the PM motor has 12 pole pairs.
The stator has 12 pole pairs per phase. The hybrid type stepper motor has a rotor with
teeth. The rotor is split into two parts, separated by a permanant magnet—making half of
the teeth south poles and half north poles. The number of pole pairs is equal to the
number of teeth on one of the rotor halves. The stator of a hybrid motor also has teeth to
build up a higher number of equivalent poles (smaller pole pitch, number of equivalent
poles = 360/teeth pitch) compared to the main poles, on which the winding coils are
wound.
Where,
Nph = Number of equivalent poles per phase = number of rotor poles
Ph = Number of phases
N = Total number of poles for all phases together
The relationship between the number of rotor poles and the equivalent stator poles, and
the number the number of phases that determines the full-step angle of a stepper motor. If
the rotor and stator tooth pitch is unequal, a more-complicated relationship exists.
18
2.4: STEPPER MOTOR DRIVE CIRCUITS
The basic function of a motor driver is to provide the rated current to the motor windings
in the shortest possible time. Driver voltage plays a large part in a step motor’s
performance. Higher voltage forces current into the motor windings faster, helping to
maintain high speed torque.
Two of the most commonly used drivers for step motors are the following:
Constant current drivers are also known as PWM (pulse width modulated) or chopper
drives. In this type of driver, the motor current is regulated by switching voltage to the
motor on and off to achieve an average level of current. These drivers operate using a
high voltage supply, generating a high driver voltage to motor voltage ratio, giving the
motor improved high-speed performance.
Constant voltage drivers are also known as, L/R or resistance limited (RL) drivers. In this
type of driver, the amount of current a step motor receives is limited only by the
resistance/impedance of its windings. For this reason, it is important to match the motor’s
rated voltage to the voltage of the driver. Constant voltage drivers work best in low speed
and low current applications. They become inefficient at high speeds and high current
levels. In certain situations, resistors may be placed in series with the motor’s windings to
allow the motor to be operated using a driver voltage larger than the motor’s rated voltage
to increase performance at higher speeds.
Step motor drivers can be divided into two types, unipolar and bipolar.
Unipolar drivers can send current through a motor’s windings in only one direction.
Unipolar drivers tend to achieve better high-speed performance. Bipolar drivers can send
current through a motor’s windings in both directions. Step motors can be connected to
these drives in several different ways to get different motor performance, making a
bipolar drive much more flexible than a unipolar drive.
19
In a unipolar winding configuration, only half the coils of each winding are used at a time
as shown in figure 2.5a. Energizing half of the coils is beneficial because it reduces the
winding’s inductance. Inductance is an electrical property that fights changes in current
flow, particularly at higher speeds. The unipolar winding configuration tends to give
better high-speed performance. The disadvantage of this type of configuration is that at
lower speeds it tends to give less torque than configurations that use the entire winding.
In a bipolar series winding configuration, both halves of the phase are connected in series
as shown in figure 2.5b. Since the full coil is used, the same motor will produce 40%
more torque in the low to mid speed range. Unfortunately, this configuration has four
times the inductance of the same motor operated in the unipolar configuration. Although
the motor has good low speed torque, the torque will drop off rapidly at high speeds.
A bipolar half coil winding configuration can be used to achieve unipolar performance
with a bipolar drive. In this configuration, the motor’s inductance and low speed torque
are less than those in the bipolar series configuration. As in the unipolar configuration, the
half coil configuration tends to give better performance at higher speeds. Both 6 and 8
lead wire motors can be connected in the bipolar half coil configuration. This is shown in
figure 2.5c.
A bipolar parallel winding configuration can only be achieved using an 8 lead wire motor
or by internal wiring. In a parallel configuration, one half of the winding phase is placed
in parallel with the other half as shown in figure 2.5d. This allows the full winding to be
used while keeping the inductance low. This combination allows the bipolar parallel
configuration to produce 40% more torque than the unipolar winding configuration while
still performing well across a wide range of speeds. However, due to the parallel
configuration, the winding resistance is halved and the motor will require 40% more
current than the same motor run in a unipolar configuration to produce this increased
torque.
20
Figure 2.5: Winding configurations
In dual phase mode, also known as ―two-phase on, full step‖ excitation, the motor is
operated with both phases energized at the same time. This mode provides improved
torque and speed performance. Dual phase excitation provides about 30% to 40% more
torque than single phase excitation, but does require twice as much power from the driver.
Figure 2.7 shows the rotor movement in dual phase mode with the sequence of energizing
the coils given in table 2.
21
Full step sequence
1 0 1 0 0
2 0 0 1 0
3 0 0 0 1
22
Step COIL A COIL B COIL C COIL D
0 1 1 0 0
1 0 1 1 0
2 0 0 1 1
3 1 0 0 1
23
Half Step Sequence
0 1 1 0 0
1 0 1 0 0
2 0 1 1 0
3 0 0 1 0
4 0 0 1 1
5 0 0 0 1
6 1 0 0 1
7 1 0 0 0
24
2.6: STEP ANGLE
The movement associated with a single step depends on the internal construction of the
motor, in particular the number of teeth on the stator and the rotor. Step angle of the
stepper motor is defined as the angle traversed by the motor in one step. It is the
minimum degree of rotation associated with a single step. Various motors have different
step angles.
To calculate step angle, simply divide 360 by number of steps a motor takes to complete
one revolution. As we have seen that in half mode, the number of steps taken by the
motor to complete one revolution gets doubled, so step angle reduces to half.
The stepper motor rotating in full mode takes 4 steps to complete a revolution, so step
angle can be calculated as:
So this way we can calculate step angle for any stepper motor. Usually step angle is given
in the data sheet of the stepper motor you are using. Knowing stepper motor's step angle
helps you calibrate the rotation of motor also to helps you move the motor to correct
angular position.
25
CHAPTER 3
IMPLEMENTATION
3.1: INTRODUCTION
The previous chapter discussed the technical and theoretical background for a stepper
motor, and how it can be controlled. The techniques of how to control the stepper motor
is were implemented and discussed in this chapter.
The stepper motor controller will be divided into two sections, the physical circuit, using
the 8051 microcontroller to control the movement of the stepper motor and the second
part deals with appropriate software necessary to generate the control bits required for the
motor.
The diagram above shows a typical step motor based system. All of these parts must be
present in one form or another. Each component’s performance will have an effect on the
others.
First is the pulse generator, also known as a controller or indexer. The pulse generator
will output command pulses that the motor will follow. By altering the frequency of the
pulse train, the pulse generator can instruct the motor to accelerate, run at a speed,
decelerate or stop. A pulse generator must be present otherwise the motor will not move.
26
Next is the motor driver. The driver’s function is to control the magnitude and direction
of current flow into the motor windings. The driver takes the pulses from the pulse
generator and determines how and when the windings should be energized. The windings
must be energized in a specific sequence to generate motion.
27
Figure 3.2: Connections of the Quartz crystal and the Reset circuit
The 8051 microcontroller does not have sufficient drive capability on its output to drive
each coil, so there are a number of ways to drive a stepper,
However it can be noted that if transistors are used as drivers, then diodes must also be
used to take care of the inductive current generated when the coil is turned OFF. One
reason that the ULN 2003 is preferable to the use of transistors as drivers is that the ULN
2003 has an internal diode to take care of back EMF.
The ULN 2003 is a TTL-input NPN Darlington driver. It is a high voltage, high current
Darlington array containing seven open collector Darlington pairs with common emitters.
Each channel rated at 500mA and can withstand peak currents of 600mA. Suppression
diodes are included for inductive load driving and the inputs are pinned opposite the
outputs to simplify board layout.
28
Figure 3.3: The ULN 2003 Driver IC
Stepper motors do not usually have the wires labeled. Therefore to check which wire was
what was done by measuring the resistance of the leads using an ohmmeter. This
identified which was the centre-tap and which leads were connected to the coils.
29
3.3: CIRCUIT DIAGRAM
The circuit diagram in figure 3.2 shows the interfacing of a stepper motor to the
microcontroller through a driver.
30
Analyzing the circuit
The microcontroller is interfaced to the stepper motor through ports 0.0, 0.1, 0.2, and 0.3.
This is done through the ULN 2003 Driver. The input pins 1, 2, 3 and 4 of the ULN 2003
are connected to the microcontroller and the output pins 13, 14, 15 and 16 to the four
leads of the stepper motor.
The five leads of the stepper motor were distinguished as explained earlier by measuring
the resistance of the leads. Thus, the wire which was the centre tap of the motor coils was
connected to +5v supply. The stepper motor had a resistance of 120 ohms across the coils
and was connected across +5V supply. The current passing through each coil is therefore
27mA.
Three switches were connected across ports 3.0, 3.1 and 3.2 of the microcontroller.
Theses switches are known as mode switches which were programmed to control the
stepping mode of the stepper motor. Eight other switches were connected across port 2 of
the microcontroller, which are known as speed control switches and were programmed to
control the speed of the stepper motor.
31
The procedure for ―burning‖ the 8051 microcontroller was done as follows:
The microcontroller was inserted into the programmer kit
The programmer kit was connected to the parallel port of the computer
The programmer kit was then powered up to +5V d.c supply (adapter)
The assembly code was written and changed into the HEX code by the Keil
compiler
The HEX code was then loaded into the microcontroller
The 8051 microcontroller was then ready to drive and control the stepper motor
Figure 3.5: Compiling the Assembly Code using the Keil Software
32
3.4.2: Program Flow Chart
33
CHAPTER 4
RESULTS AND OBSERVATIONS
The mode switches were toggled and the rotation of the stepper motor was
observed
The speed control switches were toggled to vary the speed of the stepper motor
34
4.2: RESULTS
SWITCHES
MOTOR STATUS
P2.2, P2.1, P2.0
0 0 0 Stop
0 0 1 Forward full step (dual-phase on)
0 1 0 Reverse full step (dual-phase on)
0 1 1 Forward full step (single-phase on)
1 0 0 Reverse full step (single-phase on)
1 0 1 Forward half step
1 1 0 Reverse half step
Table 5 gives the binary number of the 8 switches, its decimal equivalent, time taken for
one revolution and the speed in revolutions per second. This was done for the different
modes.
35
1. Full Step Mode (Dual-phase on)
36
4.3: OBSERVATIONS:
It was observed that when the stepper motor was running in the full step mode, its
rotation was rough and slower than the half step mode. Therefore half step mode has a
smoother and faster movement than the half step mode. A smoother movement is
achieved if the stepper motor has a small step angle and therefore more steps per
revolution.
37
CHAPTER 5
CONCLUSION AND FUTURE WORK
5.1: CONCLUSION
The early part of the text attempted to provide a concise introduction to the technical and
mathematical principles of step motors while the latter part of the text focused on the
application of those principles and techniques in designing the stepper motor controller
along with its control program and connected circuitry.
It was an educational experience conducting this project and the stepper motor can be
used as an educational tool for introducing the basic principles of DC motors.
The project was completed successfully as both the electronic unit and the bit generating
units were successfully implemented to realize the objectives of the project. The analysis
of the results got practically matched the theoretical analysis of stepper motors. The
difference in speed and smoothness of rotation in the different modes was observed and
related correctly to the theory of stepper motors.
Improvements on the circuit can be done so that the whole kit can handle bigger
motors with greater torque and a higher current handling capacity.
Improvements can also be made such as to be able to control more motors using
one controller
LCD screen that displays the speed can be implemented
38
APPENDIX A: PROGRAM SOURCE CODE
ORG 0H
MAIN:
39
CJNE R2,#11111001B,NEXT_2 ;COMPARE VALUE 111111001 WITH
VALUE IN R2, AND JUMP TO NEXT_2
IF NOT EQUAL
LCALL DUALPHASE_FORWARD ;IF VALUE IN R2 IS EQUAL TO
1111111001, THEN CALL
DUALPHASE_FORWARD SUBROUTINE
40
NEXT_5: MOV R6,MODE_SWITCH ;LOAD INTO R6 THE MODE SWTCH
VALUE
CJNE R6,#11111101B,NEXT_6 ;COMPARE VALUE 11111101 WITH
VALUE IN R6, AND JUMP TO NEXT_6
IF NOT EQUAL
LCALL FORWARD_HALFSTEP ;IF VALUE IN R5 IS EQUAL TO
11111101, THEN CALL
FORWARD_HALFSTEP SUBROUTINE
EXIT:LJMP MAIN
;***********************************************************************
DUALPHASE_FORWARD:
41
MOV A, #00000110B ;step 1 FULL STEP SECOND SEQUENCE
NUMBER LOADED INTO ACC
MOV STEPPER,A ;NUMBER OUTPUTTED TO PORT OF STEPPER
MOTOR
LCALL DELAY ;DELAY TIME SUBROUTINE CALLED
RET
LJMP MAIN
;***********************************************************************
DUALPHASE_REVERSE:
42
MOV A, #00001100B ; step 1 FULL STEP SECOND SEQUENCE
NUMBER LOADED INTO ACC
MOV STEPPER,A ;NUMBER OUTPUTTED TO PORT OF STEPPER
MOTOR
LCALL DELAY ;DELAY TIME SUBROUTINE CALLED
RET
LJMP MAIN
;***********************************************************************
43
FORWARD_FULLSTEP:
RET
LJMP MAIN
44
;***********************************************************************
REVERSE_FULLSTEP:
45
RET
LJMP MAIN
;***********************************************************************
FORWARD_HALFSTEP:
46
MOV A,#00000110B ;step 4 FULL STEP 4TH SEQUENCE NUMBER
LOADED INTO ACC
MOV STEPPER,A ;NUMBER OUTPUTTED TO PORT OF STEPPER
MOTOR
LCALL DELAY ;DELAY TIME SUBROUTINE CALLED
47
RET
LJMP MAIN
;***********************************************************************
REVERSE_HALFSTEP:
48
MOV A,#00000100B ;step 4 FULL STEP 4TH SEQUENCE NUMBER
LOADED INTO ACC
MOV STEPPER,A ;NUMBER OUTPUTTED TO PORT OF STEPPER
MOTOR
LCALL DELAY ;DELAY TIME SUBROUTINE CALLED
49
RET
LJMP MAIN
;***********************************************************************
*
MOTOR_OFF:
NOP
LCALL DELAY ;
RET
LJMP MAIN
;***********************************************************************
*
50
DELAY: ;DELAY SUBROUTINE
MOV R7,#2
wait2:
MOV R6,32H ;32H ;DELAY NUMBER LOADED
INTO A DECREMENTNG REGISTER
wait1:
MOV R0,#150
wait:
DJNZ R5,wait
DJNZ R6,wait1
DJNZ R7,wait2 ;WAIT TILL ALL REGISTERS ARE EMPTY
RET ;GO BACK
END
;***********************************************************************
*******************
51
APPENDIX B: DATASHEET FOR 8051
MICROCONTROLLER
The datasheets given here are for the Atmel 8051 Microcontroller
52
APPENDIX C: DATASHEET FOR ULN 2003/2004
The datasheet given for the ULN 2003 Driver IC is from ST.
53
REFERENCES
Books:
1. The 8051 Microcontroller and Embedded Systems.
Pearson Education Asia, 2002.
Muhammad Ali Mazidi and Janice Gillispie Mazidi.
2. Stepping Motors: a guide to modern theory and practice.
P. P. Acarnley.
Peter Peregrinus on behalf of the IEE, 1984, c1982
3. Programming and Customizing the 8051 Microconroller.
Pearson Education Asia, 2000.
Mike Predko.
4. Lecture notes on digital electronics by Professor Mwangi.
Web sources:
1. www.ams2000.com/stepping101
2. www.motioncontrol.com
3. www.electojects.com
4. www.cs.uiowa.edu/jones : - Jones Stepper Motor Tutorial.
5. www.doc.ic.ac.uk/ih/doc/stepper : - Ian Harries on Stepping motors
6. www.atmel.com
Data sheets:
54