Trying to make wall avoiding robot

Thread Starter

Qaptian

Joined Oct 27, 2008
37
Since the bridge will reverse the polarity to the motors to obtain the two directions, then you are shorting the output with your diodes. You cannot use diodes as clamp connected in that way. You will burn the controller and your motors will never move! Use a RC filter connected in parrallel to the motors! And remove all diodes!
I hope this isn't true.

I did it the same way they did it in the data sheet, the only difference is that the data sheet used stepper motors.

I can't really change it now - I've got a PCB on the way.

Oh well. I guess that's one mistake I'll never make again.
 

SgtWookie

Joined Jul 17, 2007
22,230
Alberto is incorrect.

Your schematic is correct.

If your PCB is wired as shown on the schematic, it will also be correct.

The H-bridge is able to change the direction of current flow through each motor, however the bridge cannot supply a voltage that is lower than ground or higher than V+. The diodes are there to clamp the reverse-EMF that will occur due to the inductance of the motor's windings when power to the motor(s) is abruptly terminated.

I don't know why you didn't post an image of your generated PCB before you ordered it?

I hope that you have the bypass capacitors located very close to the V+/VCC and ground terminals of the ICs that they're supposed to be providing bypassing for.

If not, you could always solder them directly to the VCC/V+/GND pins on the bottom side of the board.
 
Last edited:

Thread Starter

Qaptian

Joined Oct 27, 2008
37
Alberto is incorrect.

Your schematic is correct.
That's good to hear.

I don't know why you didn't post an image of your generated PCB before you ordered it?
I'm an idiot. That's the only explanation.

The pictures are at the bottom.

I hope that you have the bypass capacitors located very close to the V+/VCC and ground terminals of the ICs that they're supposed to be providing bypassing for.
Well, everything is pretty close together - maybe I lucked out and placed them properly by accident?





 

SgtWookie

Joined Jul 17, 2007
22,230
Well, I'm afraid that you weren't quite that lucky :(

C6 and C5 are located in the opposite corner of the board from the 555 timer. This won't be a happy situation, as C5 is the "C" part of the RC time constant that determines the timer's speed. C6 keeps the control voltage constant. Placing them so far away from the timer will make them very prone to noise.

C10 is at least reasonably close to the 555 timer.

C2 should've been right next to the L298.
C1 should've been right next to the uC.

C3 and C4 should've been right next to the regulator.
Where's the fuse?
 

Thread Starter

Qaptian

Joined Oct 27, 2008
37
Well, I'm afraid that you weren't quite that lucky :(

C6 and C5 are located in the opposite corner of the board from the 555 timer. This won't be a happy situation, as C5 is the "C" part of the RC time constant that determines the timer's speed. C6 keeps the control voltage constant. Placing them so far away from the timer will make them very prone to noise.

C10 is at least reasonably close to the 555 timer.

C2 should've been right next to the L298.
C1 should've been right next to the uC.

C3 and C4 should've been right next to the regulator.
Where's the fuse?
That's OK I can just solder the caps under the board, like you said. If I did put them in their places though, would the noise be so bad that it messes with the machine? Could I solder them in their places and see how it works out?

I ended up changing fuses to try and save space, I got a 1A Slow Blow type fuse, but it's shaped differently. It's located directly to the right of the IR LED and directly under C8 Here's a link: http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=WK4248BK-ND
 

SgtWookie

Joined Jul 17, 2007
22,230
That's OK I can just solder the caps under the board, like you said. If I did put them in their places though, would the noise be so bad that it messes with the machine?
I can't tell you offhand. You have traces running everywhere. That adds a lot of parasitic inductance, capacitance, and cross-coupling between signals.
Could I solder them in their places and see how it works out?
Sure, you could try. "Your mileage will vary". It will be difficult to debug it without using an o-scope.

I ended up changing fuses to try and save space, I got a 1A Slow Blow type fuse, but it's shaped differently. It's located directly to the right of the IR LED and directly under C8
OK, as long as it's in there.
 

Thread Starter

Qaptian

Joined Oct 27, 2008
37
Hello, It's been a very long time!

Today my ISP programmer came, so I finally started building this robot.

Everything went great, my soldering iron stayed hot and most of the components fit perfectly into the PCB (aside from a few that I had to bend to fit in the holes).

This was fun, but I've run into a problem; I can't program the AVR. It turns out, after prodding the backside of the PCB with a multimeter, that a lot of pieces aren't getting power. Either that or my multimeter is screwy. I'm using this programmer. The battery is plugged in correctly, and the voltage regulator gives a reading when I prod from GND to V in but doesn't give a reading when I prod from GND to V out. The voltage regulator also gets quite warm. I'm 100% sure that each component is placed correctly.

One major problem I just noticed is that I accidentally switched a few .1uf capacitors and a few 10nf capacitors. I plan on fixing this tomorrow - I'll report back then! (I think this might be why the bot isn't getting juice)

Pictures will be inbound tomorrow as well. It's a cool looking machine!
 

SgtWookie

Joined Jul 17, 2007
22,230
Sounds like you have a short somewhere.

Look your board over very carefully to see if there are solder splashes, etc. that are shorting a couple of traces together.
 

Thread Starter

Qaptian

Joined Oct 27, 2008
37
After cleaning up the board a bit, I've come to the conclusion that I fried my voltage regulator somehow. Everything on VCC doesn't get power, while everything on V+ does get power (so V out is busted :(). I'm going to get a new one sometime today down at the local radioshack.

Here are some pictures of the robot!



 

SgtWookie

Joined Jul 17, 2007
22,230
OK. Pull the regulator out, and measure the resistance from VCC to ground. If it's less than 100 Ohms, you have a problem somewhere; time to start unsoldering things until the short goes away.

I see you have your IR LED pointing straight up. You're either going to have to re-orient it so that it's pointing in the same direction as the IR sensor by bending the leads, or using a mirror to reflect it.
 

Thread Starter

Qaptian

Joined Oct 27, 2008
37
OK. Pull the regulator out, and measure the resistance from VCC to ground. If it's less than 100 Ohms, you have a problem somewhere; time to start unsoldering things until the short goes away.
After taking out the regulator and measuring from GND to VCC on it, I get a resistance of 1 ohm. So that means there's a short somewhere, but is it before or after the regulator?

Unsoldering components is a real pain, I can never get them back through the holes after they're out! I want to try using my multimeter to find out where they are before I go unsoldering things, should I be measuring resistance or voltage?


Hopefully I'll find the source of this quickly.

I see you have your IR LED pointing straight up. You're either going to have to re-orient it so that it's pointing in the same direction as the IR sensor by bending the leads, or using a mirror to reflect it.
I'll be sure to change that after I figure out where the short is.

Thanks for helping!

EDIT: I poked around for a bit longer, and I still can't figure out where the short is. It seems that everything connected before the regulator works perfectly, but anything connected after it doesn't work. Even the component closest to the regulator, C4, doesn't give a reading. I'm thinking now that maybe the short is on the regulator, or the regulator is not working properly. I'll have to buy another regulator to be sure.

It's frustrating to have this happen - but things rarely work perfectly the first time!
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
When you removed the regulator, you isolated everything after the regulator from everything before the regulator. The regulator itself was the only connection between V+ and VCC.

I looked at your board layout again, and I don't see where the regulator is supposed to go? (eta) Found it, I'm going bug-eyed looking at your spaghetti board.

What size fuse are you using? You previously said 1A slow blow. I'm somewhat surprised it didn't blow. [eta] Actually, the 78L05 is limited to 100mA; not suprising the fuse didn't blow.

"Solder-wick" aka desoldering braid is a huge help in desoldering. MPJA.com sells it for a good price.
http://www.mpja.com/productsdirect.asp?dept=445&main=79
Get a couple of the 2mm rolls. 4mm can be helpful on really large pads, but 2mm is most useful. Radio Shack also sells desoldering braid, but it's insanely expensive there - around $4/roll.

You don't want to get your board too hot; you'll lift pads and/or traces. That makes repairs very un-fun.

Try pulling your uC out of the socket - that will help eliminate it from question. Be careful; the pins will break off quite easily.

You may have a hidden short underneath your uC socket. Don't even try to unsolder that unless you have some desoldering braid handy.
 
Last edited:

Thread Starter

Qaptian

Joined Oct 27, 2008
37
When you removed the regulator, you isolated everything after the regulator from everything before the regulator. The regulator itself was the only connection between V+ and VCC.
Does this mean the regulator isn't the problem? Maybe the board is messed up where the regulator sits.

I keep thinking the regulator is broken because I had to bend it in weird ways to make it fit.

What size fuse are you using? I'm somewhat surprised it didn't blow.
I'm using a 1a 250v fuse (this one to be specific: http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=WK4248BK-ND) I don't know if I'll be able to blow it with my small 9v.

"Solder-wick" aka desoldering braid is a huge help in desoldering. MPJA.com sells it for a good price.
http://www.mpja.com/productsdirect.asp?dept=445&main=79
Get a couple of the 2mm rolls. 4mm can be helpful on really large pads, but 2mm is most useful. Radio Shack also sells desoldering braid, but it's insanely expensive there - around $4/roll.
My soldering kit came with a roll of this! I didn't know it was used for removing solder, I'll have to try it.

You don't want to get your board too hot; you'll lift pads and/or traces. That makes repairs very un-fun.
Fortunately I haven't had any pads lift on me yet, I did have that happen to me on another project, though. I ended up soldering to a small trace with a bad soldering iron. I don't want to experience that again.

Try pulling your uC out of the socket - that will help eliminate it from question. Be careful; the pins will break off quite easily.

You may have a hidden short underneath your uC socket. Don't even try to unsolder that unless you have some desoldering braid handy.
I took the micro out of the socket and looked for shorts but couldn't find any - it's late right now and I can't get any natural light for better viewing. I'll look again tomorrow. I didn't power up the circuit without the micro in it, I didn't expect anything to happen.

Could the problem lie in the fact that I'm trying to split the 9v into 2 different supplies? Maybe all the power is going through V+ and not through the regulator?

Is flux conductive? A little bit of googling tells me that it's only conductive when it's not solid. The reason I ask is that after soldering the PCB, there's some residue that looks like dried flux. I thought maybe that caused some shorts or bridges somewhere.

I'll look over everything again in the morning, when I'm not feeling tired and have some natural light to work with.

Thanks again for your help, SgtWookie. I'd be completely lost without your expertise!
 

SgtWookie

Joined Jul 17, 2007
22,230
I think I see what's wrong.

You changed the regulator from a generic 78xx TO-220 type to a TO-92 case type, but in the process, you goofed up the wiring to the new regulator. As a result, the OUT terminal (pin 1) is hooked to GND instead of VCC.

Post an image of the schematic you created the board from.
 

SgtWookie

Joined Jul 17, 2007
22,230
I think the library model for the 78x regulator you used is not correct.

That's one of the hazards of using libraries that someone else created. :(

With the board oriented the way it was in your photos, the leftmost pad (1) for the 78L05 is ground, the middle (2) is Vout, and the rightmost (3) is Vin. So when you plugged in the 78L05, the ground and Vout connections were swapped.

Before you install a new regulator, measure the resistance between pad 1 and pad 2, with the negative test lead on pad 1. You should measure around 80 to 300 Ohms after allowing the capacitors to charge up for 10-20 seconds. If you do, then you can install a new regulator:
1) With the flat face of the regulator facing you, pins down, the leftmost pin is 1.
2) Bend the center lead (pin 2) towards you a bit.
3) Insert pin 2 into pad 1 on the board, pin 1 into pad 2, and pin 3 into pad 3. It will be easiest to do if the regulator face is in line with pads 2 and 3. Make sure that no pins touch each other.
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
91% Isopropyl alcohol works well for cleaning flux from PCBs. You can get it at drugstores. The 70% has too much water in it. Avoid getting it on your skin, as it will dry your skin out. I use "acid brushes" to apply the alcohol. You can get them at auto supply or hardware stores. They have black nylon bristles with rolled tubular metal handles.

Beware that isopropyl alcohol is quite flammable, and burns with a nearly invisible blue flame.

Flux is somewhat conductive, but has a pretty high resistance. It's best to completely remove it.
 

Thread Starter

Qaptian

Joined Oct 27, 2008
37
I think I see what's wrong.

You changed the regulator from a generic 78xx TO-220 type to a TO-92 case type, but in the process, you goofed up the wiring to the new regulator. As a result, the OUT terminal (pin 1) is hooked to GND instead of VCC.

Post an image of the schematic you created the board from.
Yes, I remember finding that after receiving the PCB. I made a mistake in eagle - instead of modifying the part, I modified the image that represents the part in the schematic and not the one for the PCB. When I first soldered the regulator in, I had bent the leads exactly like you said above - That's why I thought I might have broken it. It appears that the regulator might not be the problem, though, because I'm getting a resistance of around .8 to 1.0 when I measure from GND to Vout with my multimeter. If the flux is resistive, it could be causing the problem. I'm going to go back under the board and heat up all the solder again to try and burn off any more flux, then I'm going to clean up the board with some alcohol. If this doesn't do it, then I assume there's probably something wrong with my board.

Here's a picture of the schematic that the board was crafted from:
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
Your problem isn't flux, it's either a VCC trace overlapping a GND trace or a solder ball.

Your board is so spaghetti-ish it's very difficult to follow.
 

Thread Starter

Qaptian

Joined Oct 27, 2008
37
Your problem isn't flux, it's either a VCC trace overlapping a GND trace or a solder ball.
I'll keep looking for these - I just cleaned the board with some 91% alcohol and it didn't do anything (it's not the flux, you were right).

I'm still looking for overlapping traces and solder bridges/balls/other flaws. I don't see any on the bottom; time to check the top.

I'll hang this PCB up on the wall as art if it doesn't work out :cool:.
 

SgtWookie

Joined Jul 17, 2007
22,230
OK, do this:
1) Open up the schematic in Eagle, and do an Erc (error check). Does anything show up?
2) Open up the board in Eagle, and do a Drc (Design Rule Check). This should give warnings if you have things routed too close to each other or overlapping.
 
Top