Uln2803 Stepper Motor Driver Circuit

Part of Stepping Motors
by Douglas W. Jones
THE UNIVERSITYOF IOWADepartment of Computer Science

Uln2803 stepper motor driver circuit tester
  • Introduction
  • Practical Unipolar and Variable Reluctance Drivers

Introduction

I am using a Bipolar Motor Rated at 4.5V 1.2Amperes and coil resistance at 3.8Ohms at a standard step angle of 1.8 degree. I wish to overdrive the motors at 9.6V using L297 - L298 Driver Circuit. The circuit provided by L297/L298 data sheet as a reference I want to design the motor driver. Relay Driver Circuit using IC ULN2003. It is difficult to use a number of relays with transistors, so, relay driver IC ULN2003A can be used for availing more relays. We can use seven relays with relay driver circuit using ULN2003 and the relay driver circuit using ULN2803 enables to use eight relays.

This section of the stepper tutorial deals with the basic final stagedrive circuitry for stepping motors. This circuitry is centered on a singleissue, switching the current in each motor winding on and off, and controllingits direction. The circuitry discussed in this section is connected directlyto the motor windings and the motor power supply, and this circuitry iscontrolled by a digital system that determines when the switches are turnedon or off.

This section covers all types of motors, from the elementary circuitry neededto control a variable reluctance motor, to the H-bridge circuitry needed tocontrol a bipolar permanent magnet motor. Each class of drive circuit isillustrated with practical examples, but these examples are not intended asan exhaustive catalog of the commercially available control circuits, nor isthe information given here intended to substitute for the information foundon the manufacturer's component data sheets for the parts mentioned.

This section only covers the most elementary control circuitry for eachclass of motor. All of these circuits assume that the motor power supplyprovides a drive voltage no greater than the motor's rated voltage, and thissignificantly limits motor performance. The next section, on current limiteddrive circuitry, covers practical high-performance drive circuits.

Variable Reluctance Motors

Typical controllers for variable reluctance stepping motors are variations on the outline shown in Figure 3.1:In Figure 3.1, boxes are used to represent switches; a controlunit, not shown, is responsible for providing the control signals to openand close the switches at the appropriate times in order to spin the motors.In many cases, the control unit will be a computer or programmable interfacecontroller, with software directly generating the outputs needed to controlthe switches, but in other cases, additional control circuitry is introduced,sometimes gratuitously!

Motor windings, solenoids and similar devices are all inductive loads. Assuch, the current through the motor winding cannot be turned on or offinstantaneously without involving infinite voltages! When the switchcontrolling a motor winding is closed, allowing current to flow, the resultof this is a slow rise in current. When the switch controlling a motorwinding is opened, the result of this is a voltage spike that can seriouslydamage the switch unless care is taken to deal with it appropriately.

There are two basic ways of dealing with this voltage spike. One is tobridge the motor winding with a diode, and the other is to bridge the motorwinding with a capacitor. Figure 3.2 illustrates both approaches:The diode shown in Figure 3.2 must be able to conduct the full currentthrough the motor winding, but it will only conduct briefly each time theswitch is turned off, as the current through the winding decays. Ifrelatively slow diodes such as the common 1N400X family are used togetherwith a fast switch, it may be necessary to add a small capacitor inparallel with the diode.

The capacitor shown in Figure 3.2 poses more complex design problems!When the switch is closed, the capacitor will discharge through the switchto ground, and the switch must be able to handle this brief spike ofdischarge current. A resistor in series with the capacitor or in serieswith the power supply will limit this current. When the switch is opened,the stored energy in the motor winding will charge the capacitor up to avoltage significantly above the supply voltage, and the switch must beable to tolerate this voltage. To solve for the size of the capacitor,we equate the two formulas for the stored energy in a resonant circuit:

P = C V2 / 2
P = L I2 / 2
Where:
P -- stored energy, in watt seconds or coulomb volts
C -- capacity, in farads
V -- voltage across capacitor
L -- inductance of motor winding, in henrys
I -- current through motor winding
Solving for the minimum size of capacitor required to prevent overvoltageon the switch is fairly easy:
C > L I2 / (Vb - Vs)2
Where:Stepper
Vb -- the breakdown voltage of the switch
Vs -- the supply voltage
Variable reluctance motors have variable inductance that depends on theshaft angle. Therefore, worst-case design must be used to select thecapacitor. Furthermore, motor inductances are frequently poorly documented,if at all.

The capacitor and motor winding, in combination, form a resonant circuit.If the control system drives the motor at frequencies near the resonantfrequency of this circuit, the motor current through the motor windings,and therefore, the torque exerted by the motor, will be quite differentfrom the steady state torque at the nominal operating voltage! The resonantfrequency is:

f = 1 / ( 2π (L C)0.5 )
Again, the electrical resonant frequency for a variable reluctance motorwill depend on shaft angle! When a variable reluctance motors is operatedwith the exciting pulses near resonance, the oscillating current inthe motor winding will lead to a magnetic field that goes to zero at twicethe resonant frequency, and this can severely reduce the available torque!MotorCircuit

Unipolar Permanent Magnet and Hybrid Motors

Typical controllers for unipolar stepping motors are variations on the outline shown in Figure 3.3:In Figure 3.3, as in Figure 3.1, boxes are used to represent switches;a control unit, not shown, is responsible for providing the control signalsto open and close the switches at the appropriate times in order to spinthe motors. The control unit is commonly a computer or programmableinterface controller, with software directly generating the outputs neededto control the switches. Coreldraw 2019 crack gratis.

As with drive circuitry for variable reluctance motors, we must deal withthe inductive kick produced when each of these switches is turned off.Again, we may shunt the inductive kick using diodes, but now, 4 diodesare required, as shown in Figure 3.4:The extra diodes are required because the motor winding is not two independentinductors, it is a single center-tapped inductor with the center tap at afixed voltage. This acts as an autotransformer! When one end of the motorwinding is pulled down, the other end will fly up, and visa versa. When aswitch opens, the inductive kickback will drive that end of the motor windingto the positive supply, where it is clamped by the diode. The opposite endwill fly downward, and if it was not floating at the supply voltage at thetime, it will fall below ground, reversing the voltage across the switch atthat end. Some switches are immune to such reversals, but others can beseriously damaged.

A capacitor may also be used to limit the kickback voltage, as shown inFigure 3.5:The rules for sizing the capacitor shown in Figure 3.5 are the same as therules for sizing the capacitor shown in Figure 3.2, but the effect ofresonance is quite different! With a permanent magnet motor, if the capacitoris driven at or near the resonant frequency, the torque will increase to asmuch as twice the low-speed torque! The resulting torque versus speed curvemay be quite complex, as illustrated in Figure 3.6:Figure 3.6 shows a peak in the available torque at the electrical resonantfrequency, and a valley at the mechanical resonant frequency. If theelectrical resonant frequency is placed appropriately above what would havebeen the cutoff speed for the motor using a diode-based driver, the effectcan be a considerable increase in the effective cutoff speed.

The mechanical resonant frequency depends on the torque, so if themechanical resonant frequency is anywhere near the electrical resonance,it will be shifted by the electrical resonance! Furthermore, thewidth of the mechanical resonance depends on the local slope of thetorque versus speed curve; if the torque drops with speed, the mechanicalresonance will be sharper, while if the torque climbs with speed, it willbe broader or even split into multiple resonant frequencies.

Practical Unipolar and Variable Reluctance Drivers

In the above circuits, the details of the necessary switches have beendeliberately ignored. Any switching technology, from toggle switches topower MOSFETS will work! Figure 3.7 contains some suggestions forimplementing each switch, with a motor winding and protection diodeincluded for orientation purposes:Each of the switches shown in Figure 3.7 is compatible with a TTL input.The 5 volt supply used for the logic, including the 7407 open-collectordriver used in the figure, should be well regulated. The motor power,typically between 5 and 24 volts, needs only minimal regulation. It isworth noting that these power switching circuits are appropriate fordriving solenoids, DC motors and other inductive loads as well as for drivingstepping motors.

The SK3180 transistor shown in Figure 3.7 is a power darlington with acurrent gain over 1000; thus, the 10 milliamps flowing through the 470 ohmbias resistor is more than enough to allow the transistor to switch a fewamps current through the motor winding. The 7407 buffer used to drive thedarlington may be replaced with any high-voltage open collector chip thatcan sink at least 10 milliamps. In the event that the transistor fails,the high-voltage open collector driver serves to protects therest of the logic circuitry from the motor power supply.

The IRC IRL540 shown in Figure 3.7 is a power field effect transistor.This can handle currents of up to about 20 amps, and it breaks downnondestructively at 100 volts; as a result, this chip can absorb inductivespikes without protection diodes if it is attached to a large enough heatsink. This transistor has a very fast switching time, so the protectiondiodes must be comparably fast or bypassed by small capacitors. This isparticularly essential with the diodes used to protect the transistoragainst reverse bias! In the event that the transistor fails, the zenerdiode and 100 ohm resistor protect the TTL circuitry. The 100 ohm resistoralso acts to somewhat slow the switching times on the transistor.

For applications where each motor winding draws under 500 milliamps,theULN200xfamily of darlington arrays fromAllegro Microsystems,also available as theDS200xfromNational Semiconductor and as theMotorola MC1413 darlington array will drivemultiple motor windings or other inductive loads directly from logic inputs.Figure 3.8 shows the pinout of the widely available ULN2003 chip, an arrayof 7 darlington transistors with TTL compatible inputs:The base resistor on each darlington transistor is matched to standardbipolar TTL outputs. Each NPN darlington is wired with its emitterconnected to pin 8, intended as a ground pin, Eachtransistor in this package is protected by two diodes, one shorting theemitter to the collector, protecting against reverse voltages across thetransistor, and one connecting the collector to pin 9; if pin 9 is wiredto the positive motor supply, this diode will protect the transistor againstinductive spikes.

The ULN2803 chip is essentially the same as the ULN2003 chip describedabove, except that it is in an 18-pin package, and contains 8 darlingtons,allowing one chip to be used to drive a pair of common unipolarpermanent-magnet or variable-reluctance motors.

For motors drawing under 600 milliamps per winding, theUDN2547Bquad power driver made byAllegro Microsystemswill handle all 4 windings of common unipolarstepping motors. For motors drawing under 300 milliamps per winding,Texas Instruments SN7541, 7542 and 7543 dual powerdrivers are a good choice; both of these alternatives include some logicwith the power drivers.

Bipolar Motors and H-Bridges

Things are more complex for bipolar permanent magnet stepping motorsbecause these have no center taps on their windings. Therefore, to reversethe direction of the field produced by a motor winding, we need to reversethe current through the winding. We could use a double-pole double throwswitch to do this electromechanically; the electronic equivalent of such aswitch is called an H-bridge and is outlined in Figure 3.9:As with the unipolar drive circuits discussed previously, the switches usedin the H-bridge must be protected from the voltage spikes caused by turningthe power off in a motor winding. This is usually done with diodes, as shownin Figure 3.9.

It is worth noting that H-bridges are applicable not only to the control ofbipolar stepping motors, but also to the control of DC motors, push-pullsolenoids (those with permanent magnet plungers) and many other applications.

With 4 switches, the basic H-bridge offers 16 possibleoperating modes, 7 of which short out the power supply! The followingoperating modes are of interest:

Forward mode, switches A and D closed.
Reverse mode, switches B and C closed.
These are the usual operating modes, allowing current to flow from thesupply, through the motor winding and onward to ground.Figure 3.10 illustrates forward mode:
Fast decay mode or coasting mode, all switches open.
Any current flowing through the motor winding will be working againstthe full supply voltage, plus two diode drops, so current will decayquickly. This mode provides little or no dynamic braking effect on themotor rotor, so the rotor will coast freely if all motor windings arepowered in this mode.Figure 3.11 illustrates the current flow immediately after switching fromforward running mode to fast decay mode.
Slow decay modes or dynamic braking modes.
In these modes, current may recirculate through the motor windingwith minimum resistance. As a result, if current is flowing in a motorwinding when one of these modes is entered, the current will decay slowly,and if the motor rotor is turning, it will induce a current that will actas a brake on the rotor. Figure 3.12 illustrates one of the many usefulslow-decay modes, with switch D closed; if the motor winding has recentlybeen in forward running mode, the state of switch B may be either open orclosed:
MotorMost H-bridges are designed so that the logic necessary to prevent a shortcircuit is included at a very low level in the design. Figure 3.13illustrates what is probably the best arrangement:Here, the following operating modes are available:
XYABCDMode
000000fast decay
011001forward
100110reverse
110101slow decay
The advantage of this arrangement is that all of the useful operating modesare preserved, and they are encoded with a minimum number of bits; the latteris important when using a microcontroller or computer system to drive theH-bridge because many such systems have only limited numbers of bits availablefor parallel output. Sadly, few of the integrated H-bridge chips on themarket have such a simple control scheme.

Uln2803 Stepper Motor Driver Circuit Tester

Practical Bipolar Drive Circuits

There are a number of integrated H-bridge drivers on the market, but it isstill useful to look at discrete component implementations for an understandingof how an H-bridge works. Antonio Raposo(ajr@cybill.inesc.pt) suggested the H-bridge circuit shown in Figure 3.14;The X and Y inputs to this circuit can be driven by open collectorTTL outputs as in the darlington-based unipolar drive circuitin Figure 3.7. The motor winding will be energised if exactly one ofthe X and Y inputs is high and exactly one of them is low. If bothare low, both pull-down transistors will be off.If both are high, both pull-up transistors will be off.As a result, this simple circuit puts the motor in dynamic braking modein both the 11 and 00 states, and does not offer a coasting mode.

The circuit in Figure 3.14 consists of two identical halves, each of whichmay be properly described as a push-pull driver. The term half H-bridgeis sometimes applied to these circuits! It is also worth noting thata half H-bridge has a circuit quite similar to the output drive circuitused in TTL logic. In fact, TTL tri-state line drivers such as the 74LS125Aand the 74LS244 can be used as half H-bridges for small loads, as illustratedin Figure 3.15:This circuit is effective for driving motors with up to about 50 ohms perwinding at voltages up to about 4.5 volts using a 5 volt supply.Each tri-state buffer in the LS244 can sink about twice the current itcan source, and the internal resistance of the buffers is sufficient, whensourcing current, to evenly divide the current between the drivers thatare run in parallel. This motor drive allows for all of the useful statesachieved by the driver in Figure 3.13, but these states are not encoded asefficiently:

XYEMode
--1fast decay
000slower decay
010forward
100reverse
110slow decay
The second dynamic braking mode, XYE=110, provides a slightly weaker brakingeffect than the first because of the fact that the LS244 drivers can sink morecurrent than they can source.

The Microchip (formerly Telcom Semiconductor)TC4467Quad CMOS driver is another example of a general purpose driverthat can be used as 4 independent half H-bridges. Unlike earlier drivers,the data sheet for this driver even suggests using it for motor controlapplicatons, with supply voltages up to 18 volts andup to 250 milliamps per motor winding.

Uln2803 Stepper Motor Driver Circuit

One of the problems with commercially available stepping motor controlchips is that many of them have relatively short market lifetimes. Forexample, the Seagate IPxMxx series of dual H-bridge chips (IP1M10 throughIP3M12) were very well thought out, but unfortunately, it appears thatSeagate only made these when they used stepping motors for head positioningin Seagate disk drives. The Toshiba TA7279 dual H-bridge driver would beanother another excellent choice for motors under 1 amp, but again, itappears to have been made for internal use only.

TheSGS-Thompson(and others)L293dual H-bridge is a close competitorfor the above chips, but unlike them, it does not include protection diodes.The L293Dchip, introduced later, is pin compatible and includes these diodes.If the earlier L293 is used, each motor winding must be set across a bridgerectifier (1N4001 equivalent). The use of external diodes allows a seriesresistor to be put in the current recirculation path to speed the decay ofthe current in a motor winding when it is turned off; this may be desirablein some applications. The L293 family offers excellent choices for drivingsmall bipolar steppers drawing up to one amp per motor winding at up to 36volts. Figure 3.16 shows the pinout common to the L293B and L293D chips:This chip may be viewed as 4 independent half H-bridges, enabled in pairs,or as two full H-bridges. This is a power DIP package, with pins 4, 5, 12and 13 designed to conduct heat to the PC board or to an external heat sink.

TheSGS-Thompson(and others)L298dual H-bridge is quite similar to theabove, but is able to handle up to 2-amps per channel and is packaged asa power component; as with the LS244, it is safe to wire the two H-bridgesin the L298 package into one 4-amp H-bridge (the data sheet for this chipprovides specific advice on how to do this). One warning is appropriateconcerning the L298; this chip very fast switches, fast enough thatcommonplace protection diodes (1N400X equivalent) don't work. Instead,use a diode such as the BYV27. The National Semiconductor LMD18200H-bridge is another good example; this handles up to 3 amps and has integralprotection diodes.

While integrated H-bridges are not available for very high currents or veryhigh voltages, there are well designed components on the market to simplifythe construction of H-bridges from discrete switches. For example,International Rectifier sells a line ofhalf H-bridge drivers; two of these chips plus 4 MOSFET switching transistorssuffice to build an H-bridge. TheIR2101,IR2102andIR2103are basic half H-bridge drivers. Each of these chips has 2 logic inputs todirectly control the two switching transistors on one leg of an H-bridge.The IR2104andIR2111have similar output-side logic for controlling the switches of an H-bridge, butthey also include input-side logic that, in some applications, may reduce theneed for external logic. In particular, the 2104 includes an enable input, sothat 4 2104 chips plus 8 switching transistors can replace an L293 with noneed for additional logic.

Uln2803 Stepper Motor Driver Circuit Breaker

The data sheet for theMicrochip (formerly Telcom Semiconductor)TC4467family of quad CMOS drivers includes information on how to use drivers in thisfamily to drive the power MOSFETs of H-bridges running at up to 15 volts.

A number of manufacturers make complex H-bridge chips that include currentlimiting circuitry; these are the subject of the next section.It is also worth noting that there are a number of 3-phase bridge drivers onthe market, appropriate for driving Y or delta configured 3-phase permanentmagnet steppers. Few such motors are available, and these chips were notdeveloped with steppers in mind. Nonetheless, the Toshiba TA7288P,the GL7438, the TA8400 and TA8405 are clean designs, and 2 such chips, withone of the 6 half-bridges ignored, will cleanly control a 5-winding 10step per revolution motor.