Nothing Special   »   [go: up one dir, main page]

Interfacing of A Stepper Motor With An 8051 Microcontroller

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 33

SUMMER TRAINING REPORT

ON

INTERFACING OF A STEPPER MOTOR


WITH AN 8051 MICROCONTROLLER
TO
NORTHERN INDIA ENGINEERING COLLEGE,
NEW DELHI
for the degree
Of
Bachelor in Technology
In
Electronics & Communication

Department of Electronics & Communication Engg.


NORTHERN INDIA ENGINEERING COLLEGE,
FC-26, SHASTRI PARK, NEW DELHI-53
MAY 2010

SUBMITTED BY:
YOGENDER KUMAR ARYA – 0931562808 (ECE-S3)

ANUJ SIROHI – 0961562808 (ECE-S3)

AMIT KUMAR - 1071562808(ECE-S3)

CERTIFICATE
This is to certify that Project Report titled “INTERFACING OF A
STEPPER MOTOR WITH AN 8051 MICROCONTROLLER”,
which is submitted by following students of Bachelors in Technology
in Electronics and Communication Engg. Of NORTHERN INDIA
ENGINEERING COLLEGE, NEW DELHI, under my supervision.

Projectee:

YOGENDER KUMAR ARYA – 0931562808

ANUJ SIROHI – 0961562808

AMIT KUMAR - 1071562808

Head of the department Supervisor/Guide

ACKNOWLEDGEMENT
We feel highly privileged to express our deep sense of gratitude to
all those who helped us during our project work. We would like to
express our grateful thanks for the help and advice given to us by
………… , HOD ECE Dept., for their valuable guidance in our
project.

We express our gratitude and reverence to the preceptor and


project Guide ..……. for his advice, guidance and support which
helped us in completing our project.

We are also highly thankful to the management of NORTHERN


INDIA ENGINEERING COLLEGE, for providing necessary
facilities and infrastructure.

Date:

APPROVED BY:
HOD……

OVERVIEW
In our project we have explained how to control and run a stepper motor
through microcontroller interfacing. The circuit incorporates a small high
quality stepper motor combined with a series of driver IC to enable
P89V51RD2FN microcontroller in controlling of the stepper motor.

PART 1
INTRODUCTION
Stepper motors are used in a variety of applications, including high and low
propulsion technology, computer peripherals, machine tools, robotics, etc.
The interest in this system has been steadily increasing requirements for
accuracy and repeatability while at the same time placing ever tighter
demands on the maximum and constancy of speed as well as position
resolution. However it has a non-linear and coupled dynamic structure so we
could use different control schemes to make the stepper more competitive to
use in different levels of application.

Motion Control means to accurately control the movement of an object


based on speed, distance, load, inertia, direction or a combination of all these
factors. There are numerous types of motion control systems, including;
Stepper Motor, Linear Step Motor, DC Brush, Brushless, Servo, Brushless
Servo and more. This document concentrates upon Step Motor technology.

In Theory, a Stepper motor is a marvel in simplicity. It has no brushes, or


contacts. Basically it's a synchronous motor with the magnetic field
electronically switched to rotate the armature magnet around.

A Stepping Motor System consists of three basic elements, often combined


with some type of user interface (Host Computer):

STEP PULSES
MOTOR CURRENT

INDEXER DRIVER MOTOR

FIG-1: BLOCK DIAGRAM OF STEPPING MOTOR SYSTEM


The Indexer is a micro-controller capable of generating step pulses and
direction signals for the driver. In addition, the indexer is typically required
to perform many other sophisticated command functions.

The Driver (or Amplifier) converts the indexer command signals into the
power necessary to energize the motor windings. There are numerous types
of drivers, with different current/amperage ratings and construction
technology. Not all drivers are suitable to run all motors, so when designing
a Motion Control System the driver selection process is critical.

The Step Motor is an electromagnetic device that converts digital pulses


into mechanical shaft rotation.

Advantages of step motors are low cost, high reliability, high torque at low
speeds and a simple, rugged construction that operates in almost any
environment. The main disadvantages in using a step motor is the resonance
effect often exhibited at low speeds and decreasing torque with increasing
speed.

IMPORTANCE

The importances of this design over the conventional designs are


summarized below:

• To provide remote & easy access to a system.


• It is less time consuming, easy to control.
• Controlling can be done easily by just using keyboard.
• Comparatively low cost.
• Low maintenance required.
• Remarkable accuracy can be achieved.
• High Reliability.
• Low capacity motors can be used.
• Low-power position control applications.

REQUIREMENTS
 Unipolar stepper motor
 P89V51RD2FN Microcontroller
 L293D Driver IC
 Computer Interfacing

PART 2
STEPPER MOTOR

2.1 INTRODUCTION:
A stepper motor is a brushless, synchronous electric motor
that can divide a full rotation into a large number of steps. The motor's
position can be controlled precisely, without any feedback mechanism (open
loop control).
Most electric motors are controlled by a simple on/off, and the reverse
circuitry. On some there is an attempt to roughly control rotational
speed. But a handful of motors use sophisticated control electronics to
enable precise control of rotation, not just of speed but of actual rotational
position. First is the computer controlled stepper motor, and the second is
the computer controlled servo motor.
These two systems are capable of accurate rotational positioning to
within a few degrees; both are used with small motors that can act low
power actuators. The difference between the two is a question of whether the
control loop that determines the positioning is open or closed. The stepper
motor uses an open loop with no feedback, position being determined by a
software counter in the controlling computer.
Stepper motors translate digital switching signals into motion. They
are in consequences widely used in motion, automated machine tools, disk
drives, and a variety of other applications requiring precise motion under
computer control.

A stepper motor has the following performance characteristics:

1. Rotation in both directions, STATOR


2. Precision angular incremental changes,
ROTOR
3. Repetition of accurate motion,

4. A holding torque at zero speed, TEETH


5. Capability for digital control.
A stepper motor can move in accurate angular increments know as
steps in response to the application of digital pulses to an electric drive
circuit from a digital controller. The number and rate of the pulses control
the position and speed of the motor shaft. Generally, stepper motors are
manufactured with steps per revolution of 12, 24, 72, 144, 180, and 200,
resulting in shaft increments of 30, 15, 5, 2.5, 2, and 1.8 degrees per step.
Steppers require that their power source be continuously pumped in
specific patterns. These patterns or step sequences, determine the speed and
direction of a stepper’s motion. For each pulse or step input, the stepper
motor rotates a fixed angular increment; typically 1.8 or 7.5 degrees.
The fixed stepping angle gives steppers their precision. As long as
the motors maximum limits of speed or torque are not exceeded, the
controlling program knows a steppers precise position at any given time.
Steppers are driven by the interaction (attraction and repulsion) of
magnetic fields. The driving magnetic field rotates. As strategically coils are
switched on and off. This pushes and pulls the permanent magnets arranged
around the edge of a rotor that drives the output shaft. When the on off
pattern of the magnetic fields is in the proper sequence, the stepper turns
(when its not, the stepper sits and quivers).
During start, higher than normal current can be expected to be
drawn. This momentary current rise is a function of the static friction within
the motor and associated machine as well as any load the machine may be
under at the time of startup. If starting current exceeds acceptable values, the
motor is disconnected from the supply voltage to prevent damage to both the
motor and drive devices. Control of this parameter is usually not seen in
small motor applications, but can be significant on larger machines.
In many applications, it is unsafe or undesirable to allow a motor
to coast to a stop. Dynamic braking can be used to eliminate this problem. In
dynamic braking, the motor is loaded with an external resistor after
electric power has been removed. This external resistance dissipates the
mechanical energy of the motor to bring it to a quicker slowdown. Dynamic
braking is most effective when motor speeds are high. Regenerative braking
is an alternate form of dynamic braking. In regenerative braking, mechanical
energy is converted back to electrical energy and returned to the energy
source instead of being dissipated. Regenerative braking is effective to
speeds of zero.
Reversing motor rotational direction may be desirable in many
applications. Depending on the type of motor, reversing rotational direction
is easily accomplished. Exchanging power leads in an AC machine,
reversing power polarity of a DC machine, or reversing input pulse
sequences for a stepper motor will accomplish rotational reversal. In the first
two cases, reversal can be implemented through an extra set of contacts in
the controller while stepper reversal is software based. In many applications,
this is incorporated within the dynamic braking system.
Velocity control is depended on the type of motor being used. The
velocity of DC motors can be controlled by varying the voltage at the
terminals of the motor. Synchronous AC machines respond to changes in
frequency of the power supply. Stepper motor velocity is controlled in the
frequency of the input pulses. There are two methods to implement speed
control, open and closed loop. In closed loop, information about motor speed
is machines respond to changes in frequency of the power supply. Stepper
motor velocity is controlled in the frequency of the input pulses. There are
two methods to implement speed control, open and closed loop. In closed
loop, information about motor speed is feed into the control circuit which
makes appropriate changes to regulate motor speed.
Open loop control does not feed any information from motor to controller.
Open loop control is most often seen in stepper motors.
The motor’s speed depends upon how fast the controller runs
through the step sequence. At any time the controller can stop in the mid
sequence. If it leaves power to any of the energized coils on, the motor is
locked in the place by their magnetic fields. This point’s out another stepper
motor benefit: built-in-brakes.
To effectively drive a machine, all of the functions distinguished
above may need to be applied to each motor on a given machine. Not only
do each motor need to be controlled, but also the relationship between
motors. As such, control systems may quickly grow in size and complexity.

2.2 Common Characteristics of Stepper Motors:


Stepper motors are not just rated by voltage. The following elements
characterize a given stepper motor:

Voltage:
Stepper motors usually have a voltage rating. This is either printed
directly on the unit, or is specified in the motor's datasheet. Exceeding the
rated voltage is sometimes necessary to obtain the desired torque from a
given motor, but doing so may produce excessive heat and/or shorten the life
of the motor.

Resistance:
Resistance-per-winding is another characteristic of a stepper motor.
This resistance will determine current draw of the motor, as well as affect
the motor's torque curve and maximum operating speed.

Degrees per step:


This is often the most important factor in choosing a stepper motor
for a given application. This factor specifies the number of degrees the shaft
will rotate for each full step. Half step operation of the motor will double the
number of steps/revolution, and cut the degrees-per-step in half. For
unmarked motors, it is often possible to carefully count, by hand, the
number of steps per revolution of the motor. The degrees per step can be
calculated by dividing 360 by the number of steps in 1 complete revolution
Common degree/step numbers include: 0.72, 1.8, 3.6, 7.5, 15, and even 90.
Degrees per step are often referred to as the resolution of the motor. As in
the case of an unmarked motor, if a motor has only the number of
steps/revolution printed on it, dividing 360 by this number will yield the
degree/step value.

2.3 Types of Stepper Motors:


There are basically three types of stepping motors:
1) Variable reluctance type stepper motor
2) Permanent magnet type stepper motor
3) Hybrid type stepper motor
They differ in terms of construction based on the use of permanent magnets
and/or iron rotors with laminated steel stators.

VARIABLE RELUCTANCE:
The variable reluctance motor does not use a permanent
magnet. This type of construction is good in non industrial applications that
do not require a high degree of motor torque.

The variable reluctance motor in the above illustration has four "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.
PERMANENT MAGNET:
The permanent magnet motor, also referred to as a "canstack" motor, has, as
the name implies, a permanent magnet rotor. It is a relatively low speed, low
torque device with large step angles of either 45 or 90 degrees. It's simple
construction and low cost make it an ideal choice for non industrial
applications.

Unlike the other stepping motors, the PM 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 PM 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. It has a 90degree /pulse
step angle.

HYBRID:
Hybrid motors combine the best characteristics of the variable reluctance
and permanent magnet motors.
They are constructed with multi-toothed stator poles and a permanent
magnet rotor. Standard hybrid motors have 200 rotor teeth and rotate at 1.80
step angles. Other hybrid motors are available in 0.9º and 3.6º step angle
configurations. Because they exhibit high static and dynamic torque and run
at very high step rates, hybrid motors are used in a wide variety of industrial
applications.
The type of motor determines the type of drivers, and the type of translator
used. Of the permanent magnet stepper motors, there are several "sub
flavors" available.

These include the Unipolar and Bipolar.

 Unipolar Stepper Motors:


Unipolar motors are relatively easy to control. A simple 1-of-'n'
counter circuit can generate the proper stepping sequence, and drivers as
simple as 1 transistor per winding are possible with unipolar motors.
Unipolar stepper motors are characterized by their center-tapped windings.
A common wiring scheme is to take all the taps of the center-tapped
windings and feed them +MV (Motor voltage). The driver circuit would then
ground each winding to energize it.

In this project we use unipolar stepper motor which has five or six
wires and four coils (actually two coils divided by center connections on
each coil). The center connections of the coils are tied together and used as
the power connection. They are called unipolar steppers because power
always comes in on this one pole.
 Bipolar Stepper Motors:
Unlike unipolar stepper motors, bipolar units require more complex
driver circuitry. Bipolar motors are known for their excellent size/torque
ratio, and provide more torque for their size than unipolar motors.

Bipolar motors are designed with separate coils that need to be driven in
either direction (the polarity needs to be reversed during operation) for
proper stepping to occur. This presents a driver challenge. Bipolar stepper
motors use the same binary drive pattern as a unipolar motor, only the '0' and
'1' signals correspond to the polarity of the voltage applied to the coils, not
simply 'on-off' signals. Figure 5.1 shows a basic 4-phase bipolar motor's coil
setup and drive sequence.
 Variable Reluctance Stepper Motors:
Sometimes referred to as Hybrid motors, variable reluctance
stepper motors are the simplest to control over other types of stepper motors.
Their drive sequence is simply to energize each of the windings in order, one
after the other (see drive pattern table below) This type of stepper motor will
often have only one lead, which is the common lead for all the other leads.
This type of motor feels like a
DC motor when the shaft is spun by hand; it turns freely and you cannot feel
the steps. This type of stepper motor is not permanently magnetized like it’s
unipolar and bipolar counterparts.
2.4 How Stepper Motors Work:
Operation principle of a stepper motor is when we energize a coil
of stepper motor, the shaft of stepper motor (which is actually a permanent
magnet) align itself according to poles of energized coil. So when motor
coils are energized in a particular sequence, motor shaft tend to align itself
according to pole of coils and hence rotates.
Stepper motors, however, behave differently than standard DC motors. First
of all, they cannot run freely by themselves. Stepper motors do as their name
suggests -- they "step" a little bit at a time. Stepper motors also differ from
DC motors in their torque-speed relationship. DC motors generally are not
very good at producing high torque at low speeds, without the aid of a
gearing mechanism. Stepper motors, on the other hand, work in the opposite
manner. They produce the highest torque at low speeds. Stepper motors also
have another characteristic, holding torque, which is not present in DC
motors.
Holding torque allows a stepper motor to hold its position firmly when not
turning. This can be useful for applications where the motor may be starting
and stopping, while the force acting against the motor remains present. This
eliminates the need for a mechanical brake mechanism. Steppers don't
simply respond to a clock signal, they have several windings which need to
be energized in the correct sequence before the motor's shaft will rotate.
Reversing the order of the sequence will cause the motor to rotate the other
way. If the control signals are not sent in the correct order, the motor will not
turn properly. It may simply buzz and not move, or it may actually turn, but
in a rough or jerky manner. A circuit which is responsible for converting
step and direction signals into winding energization patterns is called a
translator. Most stepper motor control systems include a driver in addition
to the translator, to handle the current drawn by the motor's windings.

2.5 STEP MODES:

Stepper motor "step modes" include Full, Half and Micro step. The
type of step mode output of any motor is dependent on the design of the
driver.

FULL STEP:
Standard (hybrid) stepping motors have 200 rotor teeth, or 200 full
steps per revolution of the motor shaft. Dividing the 200 steps into the 360º's
rotation equals a 1.8º full step angle. Normally, full step mode is achieved
by energizing both windings while reversing the current alternately.
Essentially one digital input from the driver is equivalent to one step.

HALF STEP:
Half step simply means that the motor is rotating at 400 steps per
revolution. In this mode, one winding is energized and then two windings
are energized alternately, causing the rotor to rotate at half the distance, or
0.9º's. (The same effect can be achieved by operating in full step mode with
a 400 step per revolution motor). Half stepping is a more practical solution
however, in industrial applications. Although it provides slightly less torque,
half step mode reduces the amount "jumpiness" inherent in running in a full
step mode.

MICROSTEP:
Micro stepping is a relatively new stepper motor technology that
controls the current in the motor winding to a degree that further subdivides
the number of positions between poles. AMS micro steppers are capable of
rotating at 1/256 of a step (per step), or over 50,000 steps per revolution.

Micro stepping is typically used in applications that require accurate


positioning and a fine resolution over a wide range of speeds.
MAX-2000 micro steppers integrate state-of-the-art hardware with "VRMC"
(Variable Resolution Micro step Control) technology developed by AMS. At
slow shaft speeds, VRMCs produces high resolution micro step positioning
for silent, resonance-free operation. As shaft speed increases, the output step
resolution is expanded using "on-motor-pole" synchronization. At the
completion of a coarse index, the target micro position is trimmed to 1/100
of a (command) step to achieve and maintain precise positioning.

2.6 ADVANTAGES:
Stepper motors have several advantages:

a) They can be operated in open loop systems


b) Position error is that of a single step.
c) Error is non-cumulative between steps
d) Discrete pulses control motor position
e) Interface well to digital and microcontroller systems
f) Mechanically simple, no brushes, highly reliable
g) Step motors are low cost, high reliability, high torque at low speeds and a
simple, rugged construction that operates in almost any environment.

2.7 DISADVANTAGES:

Disadvantages are:
a) Fixed increments of motion
b) Low efficiency, driver choice important
c) High oscillation and overshoot to a step input
d) Limited power output
e) Limited ability to handle large inertial loads
f) Friction errors can increase position error
g) Step motor is the resonance effect often exhibited at low speeds and
decreasing torque with increasing speed.

PART 3
MICROCONTROLLER

3.1 INTRODUCTION:
Microcontrollers are "special purpose computers." Microcontrollers do one
thing well. There are a number of other common characteristics that define
microcontrollers. If a computer matches a majority of these characteristics,
then you can call it a "microcontroller":
Microcontrollers are "embedded" inside some other device (often
a consumer product) so that they can control the features or actions of the
product. Another name for a microcontroller, therefore, is "embedded
controller."
Microcontrollers are dedicated to one task and run one specific
program. The program is stored in (read-only memory) and generally
does not change.
Microcontrollers are often low-power devices. A desktop computer
is almost always plugged into a wall socket and might consume 50 watts of
electricity. A battery-operated microcontroller might consume 50 milliwatts.
A microcontroller has a dedicated input device and often (but not
always) has a small LED or LCD display for output. A microcontroller
also takes input from the device it is controlling and controls the device by
sending signals to different components in the device.
In our project we are using P89C51RD2 MICROCONTROLLER.

3.2 P89V51RD2FN
MICROCONTROLLER
The P89C51RD2 is a low-power, high-performance CMOS 8-bit
microcontroller with 8K bytes of Flash programmable and erasable read
only memory (PEROM). The device is manufactured using Philips’ high-
density nonvolatile memory technology and is compatible with the industry-
standard MCS-51 instruction set and pinout. 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
Flash on a monolithic chip, the Philips P89V51RD2FN is a powerful
microcomputer which provides a highly-flexible and cost-effective solution
to many embedded control applications.

The P89V51RD2FN provides the following standard features: 8 kB


flash microcontroller with 256 byte RAM; Clock type: 12-clk (6-clk opt.) ;
External interrupt: 2; I/O pins: 32 ; Memory type: FLASH ; Number of pins:
40 ; Operating frequency: 0~20/40 (6clk/12clk) MHz; Operating
temperature: -40~85 Cel; Power supply: 4.5~5.5V ; Program security: yes;
Serial interface: UART ; Series: 80C51 family

3.3 PIN DIAGRAM


3.4 PIN DESCRIPTION
VCC:
Supply voltage.
GND:
Ground.

Port 0:
Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each
pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins
can be used as high impedance inputs.
Port 0 may also be configured to be the multiplexed low order address/data
bus during accesses to external program and data memory. In this mode P0
has internal pull ups.
Port 0 also receives the code bytes during Flash programming, and outputs
the code bytes during program verification. External pull ups are required
during program verification.

Port 1:
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1
pins are pulled high by the internal pull-ups when ‘1’s are written to them
and can be used as inputs in this state. As inputs, Port 1 pins that are
externally pulled LOW will source current (IIL) because of the internal pull-
ups. P1.5, P1.6, P1.7 have high current drive of 16 mA. Port 1 also receives
the low-order address bytes during the external host mode programming and
verification.

Port 2:
Port 2 is an 8-bit bi-directional I/O port with internal pull ups. The Port 2
output buffers can sink/source four TTL inputs. When 1s are written to Port
2 pins they are pulled high by the internal pull ups and can be used as inputs.
As inputs, Port 2 pins that are externally being pulled low will source current
(IIL) because of the internal pull ups. Port 2 emits the high-order address
byte during fetches from external program memory and during accesses to
external data memory that use 16-bit addresses. In this application, it uses
strong internal pull ups when emitting 1s. During accesses to external data
memory that use 8-bit addresses (MOVX @ RI), Port 2 emits the contents of
the P2 Special Function Register. Port 2 also receives the high-order address
bits and some control signals during Flash programming and verification.

Port 3:
Port 3 is an 8-bit bi-directional I/O port with internal pull ups. The Port 3
output buffers can sink/source four TTL inputs. When 1s are written to Port
3 pins they are pulled high by the internal pull ups and can be used as inputs.
As inputs, Port 3 pins that are externally being pulled low will source current
(IIL) because of the pull ups. Port 3 also serves the functions of various
special features of the AT89C51 as listed below:

Port 3 also receives some control signals for Flash programming and
verification.

RST:
Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device.

ALE/PROG:
Address Latch Enable output pulse for latching the low byte of the address
during accesses to external memory. This pin is also the program pulse input
(PROG) during Flash programming. In normal operation ALE is emitted at a
constant rate of 1/6 the oscillator frequency, and may be used for external
timing or clocking purposes. Note, however, that one ALE pulse is skipped
during each access to external Data Memory.
If desired, ALE operation can be disabled by setting bit 0 of SFR location
8EH. With the bit set, ALE is active only during a MOVX or MOVC
instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-
disable bit has no effect if the microcontroller is in external execution mode.

PSEN:
Program Store Enable is the read strobe to external program memory. When
the microcontroller is executing code from external program memory, PSEN
is activated twice each machine cycle, except that two PSEN activations are
skipped during each access to external data memory.
EA/VPP:
External Access Enable. EA must be strapped to GND in order to enable the
device to fetch code from external program memory locations starting at
0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA
will be internally latched on reset.
EA should be strapped to VCC for internal program executions. This pin
also receives the 12-volt programming enable voltage(VPP) during Flash
programming, for parts that require12-volt VPP.

XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.

XTAL2:
Output from the inverting oscillator amplifier.

PART 4
L293D DRIVER IC

4.1 INTRODUCTION:
The Device is a monolithic integrated high voltage, high current four
channel driver designed to accept standard DTL or TTL logic levels and
drive inductive loads (such as relays solenoides, DC and stepping motors)
and switching power transistors. To simplify use as two bridges each pair of
channels is equipped with an enable input. A separate supply input is
provided for the logic, allowing operation at a lower voltage and internal
clamp diodes are included. This device is suitable for use in switching
applications at frequencies up to 5 kHz..

L293D is high voltage, high current Quadruple half - H-Bridge driver ic .


Each channel rated at 600mAand can withstand peak currents of
1.2A.Flyback diodes are included for inductive load driving and the enable
inputs and output are placed side by side to facilitate the use.
These versatile devices are useful for driving a wide range of loads including
solenoids, relays DC motors, LED displays filament lamps, thermal print
heads and high power buffers.
The are supplied in 16 pin plastic DIP packages with a copper lead frame to
reduce thermal resistance.
4.2 PIN CONNECTION:
4.3 FEATURES:
 TTL, DTL, Compatible Inputs
 Output current to 600 mA
 Maximum output voltage to 36 V
 Transient-Protected Outputs
 Dual In-Line Plastic Package or Small-Outline IC Package

PART 5
OVER ALL SYSTEM
5.1 BLOCK DIAGRAM

5.2 HARDWARE
Interfacing
Interfacing is an important task to be accomplished in almost all
automation applications. The digital signals are to be generated to make the
hardware run as per the instructions of program.
In the present application, the programming is done in .C. programming
language. .C. is chosen for its simplicity and ruggedness. It offers simple
methods to interact with the serial port through which the interfacing is
done.
The driver circuit used for the purpose of interfacing consists of Quadruple
half - H-bridge L293D driver IC.
The signals from the µ-controller are amplified by the L293D which can
drive loads up to 600mA. It's input is TTL as well as DTL compatible and
the output is up to 36VDC. The stepper motor is driven in full step mode, for
every step single windings is energised.

PROGRAMMING
#include <REG2051.H>.
#define s0 P1^1
#define s1 P1^2
#define s2 P1^3
#define s3 P1^4
#define en12 P1^0
#define en34 P1^6
void delay();

void main()
{
en12=en34=1;
        while(1)
{
s3=s2=1;
s1=s0=0;
                delay();
                s3=s0=0;
s2=s1=1;
delay();
                s3=s2=0;
s1=s0=1;
                delay();
                s3=s0=1;
s2=s1=0;
                delay();
    }
}

void delay()
{
        unsigned int i;
        for(i=0;i<3000;i++);
}

CONCLUSION
The project was successfully completed after a lot of efforts and work hours.
This project underwent controlling of stepper motor, compiling, debugging,
removing errors, make it bug free, adding more facilities & interactivity,
make it more reliable and user friendly.
Guidance was taken from faculty; help from the friend were accepted at the
various project development phases. Many books related to controlling of
microcontroller were referred to get the desired results.

REFERENCES

SITES:
http://www.google.com

http://www.wikipedia.com

BOOKS:

The 8051 microcontroller & Embedded system-Muhammad Ali Mazidi

Control System - I.J. Nagrath & kothari

TOOLS AND DEVELOPMENT

Hardware: The hardware used to develop our project includes:


1. Stepper motor.
2. L293D Driver IC.
3. A P89V51RD2FN microcontroller.

Software: C language, KEIL Compiler

You might also like