Kronos Robotics and Electronics
Site Map
 
Home Zeus Projects App Notes Downloads Dios Athena Forums
 

AAN101

Interfacing the Athena to the SN754410

for DC Motor Control

  By Michael Simpson

I was in the process of building a robot and was wiring up the relays when I decided to do something different.  I did a bit of research and found that there were all kinds of solid state options available to me.  One of the most popular options was to use a L293.  I searched and searched and could not find any of these.  Finally I found a L293DNE from Texas Instruments at one of my dealers.  I ordered one.  While it was on the way I pulled down the data sheet from the web to get a head start.  I soon found that not all L293 chips are created equal.  Here are just a few of my findings.

  • L293D from SGS-THOMSON is rated at 600ma and includes internal clamp diodes to prevent induction transients..

  • L293B from SGS-THOMSON is rated at 1A but does not include the clamp diodes.  You will have to include them yourself to prevent the transients.

  • L293 from Texas Instruments is rated at 1A but does not include the diodes.

  • L293D from Texas Instruments is rated at 600ma and includes the diodes

  • SN754410 from Texas Instruments is rated at 1A and does have the clamping diodes.

When my L293 from TI arrived I started to experiment but promptly ordered a few of the SN754410 chips.  I liked the SN754410 so well I decided to carry them on my site.

Lets take a look at the SN754410 features first.

  • 4 Drivers or 2 bipolar channels

  • 1A per channel

  • Supports 4.5-36v

  • Build in clamping diodes

  • Logic and input supplies may be separate if you wish.

  • Thermal shutdown

  • Input hysteretic improves noise immunity

  • Sink/Source interlocks prevents simultaneous conduction

  • No output glitch during power up or power down

You can set up the SN754410 like a relay and just set the ports of your microcontroller and move on to other things while the SN754410 does its job.  You can also use PWM on the Enable pin of each motor to vary the speed.

Schematic 1

 

In the configuration shown in Schematic 1 you can use the same power supply to power the motors and Athena.   The catch is the the battery source must not exceed 5.5 volts or so.    With many other microprocessors they may have problems with this configuration because of the drop out voltage.   Since the Athena will run with a voltage all the way down to 2.7 volts the voltage drop when the motors are engaged are not a problem. 

Just tie the Vcc2 lead to Vcc and connect a second Vss lead from the driver chip to the negative side of the battery.  The 39 ohm resistor will keep any ground loops from getting out of hand.  For single power sources this configuration works quit well.

Now a word about the 5 resistors.  These keep any connection or motor problems from blowing your Athena.  Since I have been doing this on my motor controllers I have yet to blow a microcontroller.

Please check out my motor controller interfacing application note.

Each motor must have noise suppression capacitors.  If you fail to do this again you could blow the controller or Athena.  Check out my motor noise application note.

The concept behind the motor drivers is quite simple.  There are 4 drivers built into the chip.  Each driver can be set to source or sink based on its input pin.  You could drive 4 motors with just on or off and no direction control, but by connecting the two leads of the motor to the two output leads we can control which lead gets sourced or sunk.

For instance, by setting the M1 input A High the M1 output A goes to +Motor Power.  If the M1 input B is Low then the M1 output B is at ground.  This will cause the motor to spin in one direction.

Setting the M1 input A Low causes the M1 output A to ground.  And with the M1 input B High the M1 output B goes to +Motor Power.  This will cause the motor to spin in the opposite direction.

If both the input pins are set the same then both the output pins will be set to ground or +Motor Power.  This in effect causes the motor to short causing dynamic breaking.

All this only works if the Motor Enable pin is high.  If it is low both output pins go into a tri-state condition.  We are going to take the enable pins and tie them to an signal generator.  The amount of time the signal is high will determine how much actual on time each motor gets.  If we do it fast enough – for example at 1000 times a second - there will be no herky-jerky motion and everything will run smoothly.

We now know it takes three leads to gain total control of each motor.  Lets look at the truth table to recap what kind of control we have on each motor.

Enable A B  
0 - - Coast
1 0 0 Dynamic Breaking
1 1 1 Dynamic Breaking
1 1 0 Motor Forward
1 0 1 Motor Reverse

Any time the A and B inputs are set the same dynamic breaking is enabled on the motor.

Lets do some simple things first.  

 

In this program we ties tthe two motor enable ports to the hardware pwm generator on the Athena.  Its set to 1000Hz and we set the duty cycle to control the speed.  A value between 170 and 255 works well.  255 is full speed.

Program 1 (download it here)

'754410 Demo

   dim speed

   const mot2a 5
   const mot2b 4
   const mot1a 8
   const mot1b 7

   speed = 200

   output mot2a
   output mot2b
   output mot1a
   output mot1b

   gosub mot1stop
   gosub mot2stop

loop:
   gosub botfwd
   longpause 255,4
   gosub botrev
   longpause 255,4
   goto loop

botfwd:
   gosub mot1fwd
   gosub mot2fwd
   return

botrev:
   gosub mot1rev
   gosub mot2rev
   return

botright:
   gosub mot1fwd
   gosub mot1rev
   return

botleft:
   gosub mot1rev
   gosub mot2fwd
   return

botstop:
   gosub mot1stop
   gosub mot2stop
   return

mot1stop:
   low mot1a
   low mot1b
   return

mot1fwd:
   low mot1a
   high mot1b
   return

mot1rev:
   high mot1a
   low mot1b
   return

mot2stop:
   low mot2a
   low mot2b
   return

mot2fwd:
   low mot2a
   high mot2b
   return

mot2rev:
   high mot2a
   low mot2b
   return

setspeed:
   hwpwm 1,255,speed '1Khz
   output 6
   return

 

Now let me talk a bit about the SN754410 a bit more.  I said earlier that the chip can handle 1Amp per channel.   In order to get the full 1Amp you will need to add a dip heat sink.  

Now say you want to handle a bigger motor. 

  How bout this you can stack the SN754410 chips.  Just solder one on top of the other or connect them all to a circuit board and run all the leads in parallel.

One final note.  The SN754410 can also be used to control stepper motors and solenoids.  I will be creating more papers on these topics in the future.

Parts

Easy RS232 Driver  

Athena

SN754410 Motor Controller

16 Pin Dip Heat Sink

Easy Motor PCB

6 Cell Battery Holder

9v Battery Clip

7805

 

 

 

Copyright © 2001 - 2007 Kronos Robotics