Oswald, the Robot Controller

Link to eagle schematic and board layout files

 

Update 6/7/14

Got the new boards back from OSHPark and assembled one Friday evening. I'm happy to report a resounding success thus far.  Microcontroller programmed, motor driver is turning motors, and next it goes on a robot chassis for experimentation.

Plans for the next board, tentatively named Harvey, will be an atmega328 with a 3-axis accelerometer.  This one will act as a controller for my wild thumper.

---------------------------------------------------------------------------------------------------------------------------

 

Oswald, the name of my avatar up there in the corner. Seemed like a good name for the board. Better than adding -duino to something. :)

 

This is pretty much an accounting of my failures thus far. And successes too! But mostly failures. But sometimes it's the best way to learn. Before I go into everything I did wrong, and why you shouldn't make the same mistakes, let me show what I was working on.

 

OswaldV1Board.jpg

Version 1.0

 

An ATMega328P, 5V 3A 500ma (doh!) LDO regulator, and Texas Instruments DRV8833 motor driver.  All the standard analog pins are broken out, as well as unused digital pins. Each with a voltage and ground pin. Voltage on each side is selectable via jumper to come from the 5V regulator, or from the battery. A user controlable LED is connected to pin 13, like a standard arduino. Power input circuitry is straight from Oddbot's tutorial, and can come in through the 3.5mm screw terminals, or the 0.1" header just below. A reset button is in the top left corner. And last is the DRV8833 motor controller in the bottom right corner. The board is right at 2" x 2".

 

It's not much smaller than an arduino, and nearly twice as wide as a micro magician. But that was never the point. It was my first attempt with SMD components, and I wanted to know if I could make it work myself. And neither of those two come in purple. :)

 

What I did wrong

 

I trusted existing SMD footprints, both in Eagle's libraries, and in Sparkfun's. Most if not all of these footprints are intended for pick n place machines, and other automated processes. Some of them are far too small to properly get a soldering iron on. In particular the 16 MHz crystal I used, the exposed pad doesn't extend much more than half a mm from the device, maybe less. I was constantly questioning wether I made a good connection on these parts. In addition, the pads for the motor driver and vreg were extremely small, and fragile. I destroyed at least one, and probably more. Which might explain the boards current status as a failure. (More on that later)

 

The solution?  In some cases I modified or created my own footprints for the parts.  Some I was able to find with already larger pads, primarily the passives from adafruit's library. Resistors, capacitors, and LED's weren't too hard to solder, but the wider pads will make it that much simpler. I made the pads on the vreg and motor driver come out another mm from the device, and widened them as much as I felt was safe.  The crystal I've added another mm at least to the length of each pad. These improvements will all be in the next version of the board.

 

I didn't do my research on flashing the bootloader to the microcontroller.  I thought I would simply need an FTDI breakout or cable, and it would all be so simple. Afterall, I'd reflashed the bootloader to my Pro Micro's before, what could be simpler? Well for one, I would need an ISP programmer to load the arduino bootloader, not an FTDI. (Though I've read it can be done...) As it would happen, I ordered a Pocket AVR programmer from Sparkfun along with the FTDI breakout, so at least I inadvertantly stumbled into the solution. Or so I thought.

 

I couldn't get the ISP programmer to communicate with the microcontroller. Reading countless tutorials, failing each time, and each one suggesting a problem with the microcontroller or improper connections. And with the issues I had soldering the crystal to the board, I began to believe it. Assembling a second board resulted in more of the same. Is my design fundamentally flawed? Is my soldering that terrible? Is the ISP programmer at fault? Am I hooking it up correctly? This had me going back and forth for a whole week. I even tried an arduino as ISP programmer without success. Then I decided to step back, and look at the schematics and board layout of an arduino. And I found one difference. The reset pin in the ICSP header didn't have a capacitor between it and the microcontroller. Was it really this simple? It's worth a try at this point. I soldered a pin where the reset switch would be, which I fortuneatly had not put on the board yet. Connected the programmer and fired up avrdude one last time. It can read the signature of the controller! Eureka! Off to the arduino IDE to burn the bootloader, and within minutes I had an LED blinking. Success at last I thought. But it was short lived. The next version will have a reset pin broken out however, lesson learned.

 

Several of my traces were too thin.  End result, the motor driver is non-responsive. Taking the meter to the pins and tracing them out shows several are not connected. And it varies which pins between the two boards I populated. I suspect the traces were damaged during soldering, prime suspect the far too small pads with which I had to work with. I was constantly uncertain that I'd made a good connection, and would make another pass with the iron and solder wick. Alignment of the part was also tricky and took several times to tack it in just the right spot. Result, more heat on the fragile thin traces. In some cases I was able to take an xacto knife and scrape away some of the solder mask to make a connection. But in the end far too many were like this, and it was becoming a mess. As a result i've increased the width of all my traces, including the data traces I didn't think would need to be very wide. Also as above I increased SMD pad sizes to make hand soldering easier and more confident. Lesson being, consider all aspects of making a board. Not just the design on your screen, but also the physical limitations of the copper, and your eye-hand coordination. (20 years of video games, woo! Practically a surgeon.)

 

And last but most heinous, I missed a ground trace.  I know right? How bad can I be? Under the guise of sound advice, I turned off the display of all the ground airwires while routing the board. It's just in the way, and that stuff will all just work itself out with a polygon fill, amiright? Oh wait... what's that island over there unto itself?  You might notice a small jumper wire I had to put in on the cover photo. That was to connect an isolated island of ground to a nearby ground via. Yeah, oops. Those airwires are staying on from now on. Otherwise I'll forget them. And the DRC won't catch what's not displayed as I found.

 

What I got right

Or as I'm calling it, the things that worked. This was the first time I'd worked with a bare microcontroller and got it working from the ground up. I hadn't even breadboarded one. Actually,... that should probably go in the things I did wrong section. But it worked! So I'm calling it a success.

 

The power circuitry I'm very happy with. It's the one thing I didn't have any trouble getting working. With a 6V battery connected the regulator puts out 4.9V. I've yet to test the amperage it sustains, or how hot it gets under load however. Servo testing to come next.

 

While sloppy, my SMD soldering seems to have worked out. It was pretty easy to pick up the basic hand techniques watching various tutorial videos online. (Go EEVBlog!)

 

 

Well that's about it for now. I've put everything I learned into making the version of Oswald, v1.3  I should have the new boards in about two weeks, and I'll report back with my success (and/or failures!).  TTFN

Thanks for sharing your

Thanks for sharing your story of success and mild fail… this is just the thing that helps others learn, I’m keeping this for reference when I try to make a board! And, I agree, the purple color rules!

Nice board. I’m actually

Nice board. I’m actually just putting the final touches on a board with two DRV8833’s, each setup up to run its’ outputs in parallel, that a pro-mini can plug into. Hand soldering these drivers is near impossible with the thermal ground pad underneath it. How did you solve that problem? Luckily I’ll be using my reflow toaster on mine, but larger pads for SMD components would be very handy for your hand soldering pleasure. Good tips and nice write-up overall.

Out of curiosity, what size were the traces that failed. I hope to avoid the same situation.

The thermal pad underneath

is also supposed to be “perferated” too, right? If I recall correctly, you need as much copper for a heatsink as you can manage.

Yeah, the datasheet

Yeah, the datasheet specifies the via stitching to be like 4 in a square. And ditto on the “more copper the better” for the thermal pad. The chip has thermal protection and having it constantly shut off would be annoying at best.

Put me on the list of first to buy one of your excess boards!!!

Big fan of the Pro Mini… bought a gross of them!

Cheers!

 

Beautiful job! I loved your Pro-Micro through hole version…

This one is is awesome!  Talk to Ladvien though, he’s got the “upside down clothes iron” soldering technique down to a science.

 

The traces that failed were

The traces that failed were all 0.012" wide. I’ve made my minimum width 0.016" now, and on any critical parts I’ve increased the width as much as was feasible.

 

As for the ground pad, I made a few ground via’s right on the pad to transfer heat from the other side of the board. Warmed up the spot with a blow dryer first, laid down some flux on the pad, and put a small amount of solder on the pad. Then applied heat from below until the solder flowed and placed the chip on the pad.  It’s slightly nightmarish when you think about it, Ladvien’s ironing technique sounds a bit simpler.

I am definitely going to

I am definitely going to show this to my son.  I know nothing about Eagle, and he has been jumping into it trying to create his own boards.  This must have been an awesome learning experience.  Very cool and quite the adventure getting there I imagine that you finally got it working.

Regards,

 

Bill