Motor shield troubleshooting
Moderators: adafruit_support_bill, adafruit

Motor shield troubleshooting

by mcgski on Mon Mar 18, 2013 8:51 pm

Hi,

I recently purchased and built a motor shield v1.2. All ran fine until one of my kids in a project they were building fried one of the L293 ICs (stepper port 2). I used the supplied sockets for just an occasion but unfortunately they melted part of the socket so I replaced it as well.

I think something is wrong with one of the other components on the board, but stepper port 1 works fine with both the supplied L293DNE and the replacement L293D driver. The L293DNE part doesn't work at all on port 2 and the replacement L293D causes the stepper to be erratic. I checked continuity of all of the socket pins from the socket to the solder. I'm guessing the 74HC595N chip is fine as it seems to work for port 1 though I don't want to assume. I'm wondering if anyone has any suggestions on where to start to minimize the amount of removing/re-soldering I have to do.

Thanks.
mcgski
 
Posts: 8
Joined: Mon Mar 18, 2013 8:42 pm

Re: Motor shield troubleshooting

by adafruit_support_bill on Tue Mar 19, 2013 6:38 am

unfortunately they melted part of the socket

Did that melt due to the same event that fried the L293D? If there was that much current flowing, it is possible that the damage might have extended to the 74HC595N too.

If you post photos of the front & back we can check the re-work on the L293D for anything suspicious.
User avatar
adafruit_support_bill
 
Posts: 31758
Joined: Sat Feb 07, 2009 10:11 am

Re: Motor shield troubleshooting

by mcgski on Tue Mar 19, 2013 10:56 pm

Hmm. That's what I thought. Yes, same event. The kids weren't able to tell me what they did but I suspect a shorted wire on a stepper motor or a careless short on the driver.

Here's the front/back images. Thanks for the help!

MotorShield-front.png
MotorShield-front.png (584.05 KiB) Viewed 1010 times


MotorShield-back.png
MotorShield-back.png (960.25 KiB) Viewed 1010 times
mcgski
 
Posts: 8
Joined: Mon Mar 18, 2013 8:42 pm

Re: Motor shield troubleshooting

by adafruit_support_bill on Wed Mar 20, 2013 5:25 am

I don't see any problems in your build. I suspect that when the melt-down event occurred on the L293D, some current propagated back into the latch via M3A, M3B, M4A and/or M4B. Replacing the latch would be my next step.

If you haven't already discovered, the easiest way to remove multi-pin devices like this is to clip all the pins and de-solder them one at a time.
User avatar
adafruit_support_bill
 
Posts: 31758
Joined: Sat Feb 07, 2009 10:11 am

Re: Motor shield troubleshooting

by mcgski on Wed Mar 20, 2013 8:06 am

Thanks for the advice. So when you say clip the pin, you mean on the back of the board, clip what is above the board and then desolder or remove the IC by clipping the pin on the top of the board?
mcgski
 
Posts: 8
Joined: Mon Mar 18, 2013 8:42 pm

Re: Motor shield troubleshooting

by adafruit_support_bill on Wed Mar 20, 2013 8:13 am

Clip all the legs on the top of the board to free the body of the chip.
User avatar
adafruit_support_bill
 
Posts: 31758
Joined: Sat Feb 07, 2009 10:11 am

Re: Motor shield troubleshooting

by mcgski on Thu Mar 21, 2013 11:21 am

Thanks. It was a real hassle to do it that way on this board. My diagonals couldn't really reach the pins on that 595 chip and the desoldering job was a bit harder than I though trying to get the pin legs out. Might have been my solder sucker tool wasn't strong enough. Anyway...

I finally got the 595 IC back in place (now socketed), but still no joy on stepper port 2. Port 1 works fine. Any other suggestions? Would a resistor or cap failure cause this to happen?
mcgski
 
Posts: 8
Joined: Mon Mar 18, 2013 8:42 pm

Re: Motor shield troubleshooting

by adafruit_support_bill on Thu Mar 21, 2013 11:47 am

With that much current flowing, most anything is possible. The resistor array RN1 and C3, C4 and C7 are all connected to the L293D. I'd probably start with the resistor array.
User avatar
adafruit_support_bill
 
Posts: 31758
Joined: Sat Feb 07, 2009 10:11 am

Re: Motor shield troubleshooting

by mcgski on Thu Mar 21, 2013 8:28 pm

Thanks. The odd thing is that if I swap the two L293D's (factory supplied and my replacement) there's at least some movement though jittery on the replacement L293D in Port 2. The factory L293D has no movement in that port. I'm assuming the "NE" designation on the factory part has something to do with that.

I'll give the updates a try and post here when I get the replacement parts in. Would probably be cheaper to buy another board, but I tend to like the troubleshooting. :)
mcgski
 
Posts: 8
Joined: Mon Mar 18, 2013 8:42 pm

Re: Motor shield troubleshooting

by adafruit_support_bill on Thu Mar 21, 2013 9:06 pm

The NE designation is for a "thermally enhanced" DIP package. I don't think the thermal performance would affect much until things had a chance to heat up.

The resistor array is used as pull-downs on the outputs of the latch (which are the control signals to the L293D). If the resistors were blown, the outputs would tend to float. Minor differences in the L293D chips might respond to the floating signals differently and account for the differences you see.

Would probably be cheaper to buy another board, but I tend to like the troubleshooting.

I'm with you on that. :D
User avatar
adafruit_support_bill
 
Posts: 31758
Joined: Sat Feb 07, 2009 10:11 am

Re: Motor shield troubleshooting

by mcgski on Fri Mar 22, 2013 7:13 pm

adafruit_support wrote:The resistor array is used as pull-downs on the outputs of the latch (which are the control signals to the L293D).


See I'm already learning something. Are the pull downs something that the L293D needs or are they there to stabilize the signal and just good best practice?

From the datasheet on that resistor array it looks like each output pin gets you 100K if I'm reading the package correctly.

Thanks again.
mcgski
 
Posts: 8
Joined: Mon Mar 18, 2013 8:42 pm

Re: Motor shield troubleshooting

by beercannon on Fri Mar 22, 2013 10:02 pm

I'm as new to this as you, but I'd guess the resistor array pull-downs are to keep the motors from jerking/twitching on power up. If that's the case, I'd say they're more of a 'best practice' than an aboslute requirement. But as a practical thing, you probably don't want to build a circuit without them.
User avatar
beercannon
 
Posts: 85
Joined: Fri Nov 16, 2012 9:16 pm
Location: Pennsylvania, USA

Re: Motor shield troubleshooting

by adafruit_support_mike on Sat Mar 23, 2013 12:23 am

The pull-downs are a bit more than just good practice.

Each circuit in a L293D is what's called a 'half bridge' or 'push-pull output stage'. It basically looks like this:

Image

PNP transistor on top, NPN transistor on the bottom.

- When the input is HIGH, it turns the NPN on and the PNP off. The result is a low-impedance path to GND.
- When the input is LOW, it turns the NPN off and the PNP on. The result is a low-impedance path to VCC.

Put one of those on either side of a motor, feed them opposite inputs, and you get something like this:

Image

It's called an 'H-bridge' because of its shape. The picture above shows current flowing from left to right, but if you reverse the inputs you can make it flow right to left. Very handy for reversing motors, driving speakers, and other need-to-go-both-ways applications.

Thing is, if the input is somewhere between HIGH and LOW, both transistors can come on at the same time:

Image

That's called 'shoot-through', and is Bad. At best, it wastes current and generates unnecessary heat. At worst, it shorts your VCC and GND rails together and things go all 'splodey.

The actual L293D circuit uses Darlington transistors, where the main transistor is driven by another one:

Image

Transistors are baiscally current amplifiers, and most transistors these days have a gain somewhere around 100. That means sending 1mA into the base of the first transistor sends 100mA into the base of the second transistor, allowing 10,000mA (10 amps) to flow through the second transistor to GND.

Darlingtons are very sensitive to small changes in input and can throw a lot of power around.. the worst possible combination for a circuit that can have shoot-through.

The pull-down resistors keep the input pinned LOW until some other part of the circuit comes along and sends it HIGH.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 10777
Joined: Thu Feb 11, 2010 2:51 pm

Re: Motor shield troubleshooting

by beercannon on Sun Mar 24, 2013 12:00 am

Thanks for the background, Mike. I've read about H-bridges but never really thought about that shoot-through scenario. Sometimes it's hard to visualize all the current flow possibilites simultaneously.
User avatar
beercannon
 
Posts: 85
Joined: Fri Nov 16, 2012 9:16 pm
Location: Pennsylvania, USA

Re: Motor shield troubleshooting

by adafruit_support_mike on Sun Mar 24, 2013 10:59 am

BeerCannon wrote:Sometimes it's hard to visualize all the current flow possibilites simultaneously.

Oh, don't even try to do them simultaneously.. a single circuit configuration usually has enough moving pieces to confuse a person.

Cultivate a habit of doing circuit analysis on paper.. notebook, sketchpad, scratch paper, whatever. It doesn't have to be pretty, just draw all the components and connections, then figure out how to associate notes with specific nodes and devices. Don't be afraid to start drawing when you still aren't sure where everything goes, and don't be afraid to say, "yeah, that's ugly" and start over again. I go through 3x5 cards, engineering paper, and copy paper at a tremendous rate.

Once you have a diagram you can work with, go through the expected inputs systematically.. here's how things should look for input pattern 1, (new drawing) here's how things should look for input pattern 2, (new drawing) etc. Then go back and do the reality check: is it possible for the inputs to do something other than the expected input patterns? If so, chunk your way through those as well.

That's far too much to do all at once, and far too much to work out in your head. The 'analysis at a glance' party trick is just a matter of having done it the slow way enough times that you can skip ahead to a specific result.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 10777
Joined: Thu Feb 11, 2010 2:51 pm