Stepper motor control
Stepper motor
The Stepper motor is a brushless DC motor that divides the
full rotation angle of 360° into a number of equal steps.
The motor is rotated by applying a certain sequence of
control signals.
The speed of rotation can be changed by changing the rate
at which the control signals are applied.
Various stepper motors with different step angles and
torque ratings are available in the market.
A microcontroller can be used to apply different control
signals to the motor to make it rotate according to the need
of the application.
Stepper motor
Stepper motors are used to translate electrical pulses
into mechanical movements.
In some disk drives, dot matrix printers, and some
other different places the stepper motors are used.
The main advantage of using the stepper motor is the
position control.
Stepper motors generally have a permanent magnet
shaft (rotor), and it is surrounded by a stator.
Stepper motor
Generally stepper motor use 200 steps to complete 360
degree rotation, means its rotate 1.8 degree per step.
Stepper motor used in many devices which needs
precise rotational movement like robots, antennas,
hard drives etc.
We can rotate stepper motor to any particular angle by
giving it proper instructions.
Stepper motor
Stepper motor
Stepper motor rotates in steps. To
understand its principle, consider the
logical diagram of its construction given
below.
Two winding, A and B are the stator of
motor. Permanent magnet having North
and South poles is rotor of the motor.
The basic arrangement of stator and rotor
in stepper motor is shown in figure below.
Stepper motor
Stepper motor
Stepper motors are basically two types: Unipolar and
Bipolar.
Unipolar stepper motor generally has five or six wire, in
which four wires are one end of four stator coils, and other
end of the all four coils is tied together which represents
fifth wire, this is called common wire (common point).
Generally there are two common wire, formed by
connecting one end of the two-two coils as shown in below
figure.
Unipolar stepper motor is very common and popular
because of its ease of use.
In Bipolar stepper motor there is just four wires coming
out from two sets of coils, means there are no common
wire.
Stepper motor
Stepper motor
Normal motor shafts can move freely but the stepper motor
shafts move in fixed repeatable increments.
Some parameters of stepper motors −
Step Angle − The step angle is the angle in which the rotor
moves when one pulse is applied as an input of the stator. This
parameter is used to determine the positioning of a stepper
motor.
Steps per Revolution − This is the number of step angles
required for a complete revolution. So the formula is 360° /Step
Angle.
Stepper motor
Steps per Second − This parameter is
used to measure a number of steps
covered in each second.
RPM − The RPM is the Revolution Per
Minute. It measures the frequency of
rotation. By this parameter, we can
measure the number of rotations in one
minute.
The relation between RPM, steps per
revolution, and steps per second is like
below:
Steps per Second = rpm x steps per
revolution / 60
Stepper motor
Wave Drive Mode − In this mode, one coil is energized at a
time. So all four coils are energized one after another.
This mode produces less torque than full step drive mode.
Steps Winding A Winding B Winding C Winding D
1 1 0 0 0
2 0 1 0 0
3 0 0 1 0
4 0 0 0 1
Stepper motor
Full Drive Mode − In this mode, two coils are
energized at the same time. This mode produces
more torque. Here the power consumption is also
high
Steps Winding A Winding B Winding C Winding D
1 1 1 0 0
2 0 1 1 0
3 0 0 1 1
4 1 0 0 1
Half Drive Mode − In this mode, one and two
coils are energized alternately. At first, one coil is
energized then two coils are energized. This is
basically a combination of wave and full drive
mode.
StepsIt increases
Winding A the angular
Winding rotation
B Winding of theD
C Winding
motor.
1 1 0 0 0
2 1 1 0 0
3 0 1 0 0
4 0 1 1 0
5 0 0 1 0
6 0 0 1 1
7 0 0 0 1
8 1 0 0 1
Interfacing Stepper Motor with 8051 Microcontroller
Interfacing with 8051 is very easy we just
need to give the 0 and 1 to the four wires
of stepper motor according to the above
tables depending on which mode we want
to run the stepper motor.
And rest two wires should be connected to
a proper 12v supply (depending on the
stepper motor).
Interfacing Stepper Motor with 8051 Microcontroller
Interfacing Stepper Motor with 8051 Microcontroller
8051 doesn’t provide enough current to drive the coils
so we need to use a current driver IC that is
ULN2003A.
ULN2003A is the array of seven NPN Darlington
transistor pairs.
Darlington pair is constructed by connecting two
bipolar transistors to achieve high current amplification.
In ULN2003A, 7 pins are input pins and 7 pins are
output pins, two pins are for Vcc (power supply) and
Ground.
Here we are using four input and four output pins.
We can also use L293D IC in place of ULN2003A for
current amplification.
Traffic Light Control
Traffic light system was one of the
fascinating applications of Embedded
systems and have been using the same till
this day.
The four way traffic light system using
embedded systems which was bit complex
in nature as we need to consider the traffic
flow in four different directions providing
appropriate timings to each of the lights.
This system uses 8085 microprocessor , 7-
segments and LED’s for indication.
Traffic Light Control
The normal function of traffic lights requires
sophisticated control and coordination to ensure that
traffic moves as smoothly and safely as possible and
that pedestrians are protected when they cross the
roads.
A variety of different control systems are used to
accomplish this, ranging from simple clockwork
mechanisms to sophisticated computerized control and
coordination systems that self-adjust to minimize delay
to people using the road.
Traffic Light Control
Traffic Light Control
Traffic Light Control
The various control signals such as red,
green, orange, forward arrow, right arrow
and left arrow are used in this scheme. The
forward, right and left arrows are used to
indicate forward, right and left movement
respectively.
The red (R) signal is used to stop the traffic
in the required lane and the yellow (Y)
signal is used as standby, which indicates
that the traffic must wait for the next
signal.
The green (G) light for a particular lane
remains ON for DELAY-1 seconds followed
Traffic Light Control
However, at a time for 3 out of the four roads, the
left signal or the left arrow remains on even though
that lane may have a red signal.
Each signal is controlled by a separate pin of I/O
ports. The total number of logic signals required for
this arrangement is twenty-four.
The programmable peripheral interface device 8255
is used to interface these 24 logic signals with the
lamps.
The logic ‘0’ and ‘1’ represent the state of the lamp.
Logic ‘1’ represents ON and ‘0’ represents OFF.
All ports of 8255 are used as output ports.
Traffic Light Control
Step 1 Initialize all ports of the 8255 as output ports.
Step 2 Determine the required status of Port A, Port B and
Port C of 8255 for north to south traffic movement. Load
data into accumulator and send to Port A, Port B and Port C
for north to south traffic movement.
Step 3 Call delay subroutine -1.
Step 4 Before starting east to west traffic movement,
north to south traffic movement will be ready to stop, and
east to west traffic must be ready for movement.
Therefore, determine the required status of Port A, Port B
and Port C for this operation. Then load data into
accumulator and send to Port A, Port B and Port C for north
to south traffic movement which will be ready to stop and
east to west traffic must be ready for movement.
Traffic Light Control
Step 5 Call delay subroutine-2.
Step 6 For east to west traffic movement, determine
the required status of Port A, Port B and Port C of 8255.
Load data into accumulator and send to Port A, Port B
and Port C for east to west traffic movement.
Step 7 Call delay subroutine-1.
Step 8 Prior to starting south to north traffic
movement, east to west traffic will be ready to stop,
and south to north traffic must be ready for
movement. For this operation, determine the status of
Port A, Port B and Port C of 8255. Load required data
into accumulator and send to Port A, Port B and Port C
for east to west traffic will be ready to stop and south
to north traffic must be ready for movement.
Traffic Light Control
Step 9 Call delay subroutine-2.
Step 10 Determine the status of Port A, Port B and Port
C for south to north traffic movement. Load required
data into accumulator and send to Port A, Port B and
Port C for south to north movement.
Step 11 Call delay subroutine-1.
Step 12 Before starting west to east traffic movement,
south to north traffic movement will be ready to stop
and west to cast traffic must he ready for movement.
Find out the status of Port A, Port B and Port C for this
operation. Load required data into accumulator and
send to Port A, Port B and Port C for south to north traffic
movement which will be ready to stop and west to east
traffic must be ready for movement.
Traffic Light Control
Step 13 Call delay subroutine-2.
Step 14 For west to east traffic movement, determine the
status of Port A, Port B and Port C of 8255. Load necessary
data into accumulator and send to Port A, Port B and Port C
for west to east traffic movement.
Step 15 Call delay subroutine-1.
Step 16 Subsequently, west to east traffic movement will be
ready to stop and north to south traffic must be ready for
movement. Determine the status of Port A, Port B and Port C
for this operation. Load needed data into accumulator and
send to Port A, Port B and Port C west to east traffic
movement will be ready to stop and north to south traffic
must be ready for movement.
Step 17 Call delay subroutine-2.
Step 18 Jump to step-2.
Traffic Light Control
The chart shows the bit assignment of ports.
Putting 0s and 1s in the required position, the
data byte for each port can be derived. For
example, during north to south traffic
movement, the statuses of Port A, Port B and
port C are as follows:
Traffic Light Control
When north to south traffic movement will be
ready to stop and east to west traffic must be
ready for movement, the statuses of Port A,
Port B and Port C are as follows: