Monday, January 21, 2013

SN754410 motor IC issues

By this stage I had a PWM signal and line detection working.  I decided it was time to integrate the two software components and the motor driver chip so I could observe the output of the logic decisions based on sensor inputs.  For the motor driver I used a SN754410 chip.  I had used this on a previous robot (squarebot) and I had a spare chip.  For testing instead of using motors I used dual colour leds to show the direction of the motors.  When the motor is going in one direction the led colour will be red, in the other direction the colour will be green.  I find the constant motor buzz gets distracting after awhile.  Also batteries die a lot faster.

I setup the logic so that when a line edge was detected the robot would turn away (ie right sensor detects a white line, turn left) or reverse if both line sensors were activated.  This wiring between the PIC and the SN754410 was quite simple with four outputs from the PIC going to the 4 H-bridge inputs on the SN754410.  The enable pins on the SN754410 I pulled high.  The motor power input came from the regulated 5V line.

In normal go forward mode this was fine.  However when the logic was to turn right all the leds went very dull.  Then I started seeing lock ups on the microcontroller.  Also the regulated 5V line would drop to under 3.5V when the motor chip was doing a "turn right".  I wasn't expecting the two motor leds to be drawing that much current so instead of the regulated 5V line I used an external battery pack for the SN754410 motor power input.  That stopped the led dimming.  However I knew that two leds with current limiting resistors shouldn't cause this.  

I then started to try and track down, was the issue related the the led/motor chip/microcontoller/something else.  Swapping parts showed that the leds were fine, thus it was when the PIC was saying turn right and the motor chip was doing so.  Swapping around the cabling from the PIC to the SN754410 show that the issue was with just one of the H-bridges on the SN754410.  So only when the H-bridge was having a certain output pin high did I see a high current draw.  The current draw went from 55mA up to 270mA when this was occurring.  Well past the limits of what a 9V battery can provide, hence the brownouts.  Taking the SN754410 from squarebot and swapping it in, no excessive current draw issue.  I had a dud SN754410 chip.  I binned that one and ordered 5 more from ebay that night.  Just love all these China/Hong Kong sellers with free shipping.

Now with my motor chip issues sorted it was time to move onto working with the IR part of the design.