Saturday, June 30, 2007

The Cost of R&D - Time

I have an awful confession to make: I just bought something I should be able to fabricate in my shop. I suffer from that constant problem of the home shop machinist: more time than money, and not enough time. It's almost always to my advantage to make my own stuff, not because I'd make a superior product, but because it means I can get it a lot faster that way, even if it takes a long time to make it. (Read that as "I'm broke most of the time.")

But this time I really should've been able to make this thing because I've been working on my design for so long: it's a camera rig for doing kite aerial photography. I wound up getting the one sold by Brooks Leffler:

http://www.brooxes.com/

So why'd I do it?

Because of the cost involved: time. I've spent years thinking about it and coming up with designs, but I haven't actually made one. I don't have a kite rig in hand yet, and it's already too expensive in terms of time. At this point it's cheaper for me to shell out the money and pay Brooks Leffler for his hard work and R&D, and be happy that I'm getting something that is superior to my own design in a lot of ways.

Sometimes it really is cheaper to buy the thing instead of make it.

Tom

P.S. Can't wait to start taking pictures!!

Wednesday, June 27, 2007

Tech Support

I've recently had three extremely different tech support experiences. They seriously serve to illustrate the difference between good tech support and downright crummy tech support.

It all starts with a water leak. At first I figured it was my pipes, but after a couple of tests I was convinced it was a larger problem, so I involved the water department. To make a very long, very painful, ongoing story short, it took them three months before they believed it was not my problem (despite over a gallon a minute of water leaking out from under my house) and despite having access to technologies like ground penetrating radar (which has been used on this issue), the expert wound up using a dowsing rod to "confirm" that it was my problem and not theirs. There's still water leaking out from under my house, and we're into month four. Apparently one of the nearby houses has a two and a half gallon a minute leak, so it may even get fixed some day. But not yet.

About a week ago my cable modem went fritzy. Lots of errors, lots of dropouts, DNS failures, etc. I did what troubleshooting I could, figuring I'd screwed up a DNS setting or picked up a bad set of servers off their DHCP server or something. No dice, so I sent in an issue ticket. On a Saturday. Within half an hour I had email saying my cable modem had a firmware incompatibility, and needed to be replaced. Within an hour I had a phone call to schedule service. I opted for Monday, but less than an hour after that the engineer in charge of my issue called to say he was in the area, had the hardware in-hand, and could stop by in the next ten minutes. He came, he installed, he tested, and he wished us a good day.

Finally, in developing software for the AVR, I've had a really super good experience with the AVR Studio 4 and WinAVR toolchain. But... AVR Studio likes to stick full pathnames in its project files. The relnotes for the release of AVR Studio I'm using mentions this, but I figured I'd ask to see if a bug fix was in the works. Whoa! I was contacted by Atmel shortly after placing the issue (again, on a weekend), and was asked to supply some examples that illustrated the problem. I did, and got mail the next day saying the issue was in the pipe now, my examples were attached so their developers could use them to test, and it should be in the next service pack release. WOW!

Now if only I could get the water department to respond like that... Yep, still leaking...

Tom

P.S. To tie this back to machining: I grabbed a picture of the logo off the back of the AVR Dragon, rasterized it, and used it to burn the logo into a sheet of stainless as a way of exercising the laser machining center at work. Gotta love tools like this...

Dearth of Machining Posts

I think I finally understand why I'm primarily writing electronics and programming posts rather than machining posts (despite the fact that this blog is entitled The Tiny Machine Shop): Well, ok, it's not simple enough for a single statement. It's.... complicated.

For starters I haven't been able to spend as much time as I like out in my shop. It sounds awfully cliche to say this, but work's been a bear. (And sadly, I haven't been doing machining at work much, either. Such is life.)

But more to the point, I haven't been doing any big projects recently. The machining and metalworking I've been doing has been a whole string of small things that don't make for good storytelling. A mandrel here, some sheet metal there, way too many toy repairs for the kids... it's a lot of job shopping and not a lot of project work.

(As a quick aside, I say job shopping with a great deal of respect, and in no way compare project work and job shop work with anything but complete parity. If you ever find yourself thinking otherwise, one of the best treatises on this is the Echoes from the Oil Country series of books published by Lindsay Publications. An even better one is to try it for a while!)

I'll share one story, though: When I first got into home shop machining, I proved the old adage over and over: If the only tool you have is a hammer, every job looks like a nail. I had a lathe and later added a mill. Great tools. I've still got them. But my early approach to every job was to use one, the other, or both tools. I'd crank out parts with acceptable tolerances of +/- 1/16" with a +/- 0.001" tolerance and a far better surface finish than the job required. Think I'm bragging? I'm not. It's actually a self-deprecating remark. The tradeoff, of course, was that I could take hours cranking out a part that should've taken me about fifteen minutes... if I'd thought in terms other than lathe and mill. Great looking stuff, but it was like watching the grass grow... while the glacier approaches... and the paint dries...

Over the years my list of tools has grown. A drill press and bench grinder were very early additions, along with an ever growing assortment of files, hammers, vises, screw drivers, hex wrenches, calipers, micrometers, indicators, etc. Then one day my wife bought me a scroll saw. A scroll saw? Yeah, a scroll saw. I was a little surprised, but I endeavored to get the most out of it that I could. I got a book on scrolling, picked up some good blades, and had at it.

(Another aside: If you intend to pick up scrolling, get good blades. This bears repeating: GET GOOD BLADES. I got mine from Mike's Workshop. He sells Flying Dutchman blades. The difference between the blades you pick up off the rack in the store and a high quality blade is night and day. More on this in a sec...)

Within a few months I broke the thing. More accurately, I broke the blade clamps: the things that hold the blade on the saw. Rather than let myself wallow in pity for too long, I took it as a challenge and made new blade holders, only this time I made them better, and made them so they'd hold jeweler's saw blades as well as scroll saw blades. It was a good move, and was what finally launched me into how I use my scroll saw now. Because it was this change that finally hammered home a key point: Scroll saws can cut wood, plastic, and metal.

Mmmmm... Metal. Now that is sexy. So I took the same techniques people use for scrolling wood and tried making parts in the shop. Here's what I wound up with:

For 2D work I draw the part in CAD and print 1:1 on the printer. All drill holes get crosshairs, all cut lines get the finest line my printer will print. All bend lines get lighter or dashed lines, same width. The drawing gets adhered to the metal with 3M Super 77 adhesive. Spray the drawing with adhesive and let it dry until it's tacky. Then stick it on the metal. This lets it peel off easily afterward without a lot of cleanup.

I tend to cut the part on the saw first. I wear a magnifying headset when working with metal on the saw. Pick a blade that lets you take the cuts you need. Jeweler's blades are great for really intricate work, but it's easy to wear them out if you push them. Unless I'm doing very fine work I tend to reach for the blades I got from Mike. I don't know if Flying Dutchman makes blades specifically for cutting metal, but if you choose your tooth count to match your material, it really does cut just as smooth as butter.

I use a cutting lube when cutting metal on the scroll saw. My wife's a jeweler so I beg, borrow, or steal her Riolube, which is made for jeweler's saw blades. Great stuff. I keep a cake of the stuff by the scroll saw and just touch it to the blade every now and then to keep it cutting clean.

Be aware of the kerf (thickness) of the blade, and keep the kerf on the correct side of the line. I tend to leave a little extra (a little being up to 0.010" at the most) on the free side of the line so I can file down to the line afterward. File to the line and move to the drill press.

I pre-punch my holes with a scribe under a 30x loupe (hey, I used to do a lot of 4x5 view camera photography, so I have one handy). If they don't come out dead-on, I'll drift them until they do line up with the crosshairs on the drawing. Then comes the prick punch, which sets the hole. Then comes the center punch that actually sets the right angle on the punched hole to match the angle on the drill bit. At that point it's ok to drill the holes on the drill press.

Once the part's cut and the holes are drilled, it's a simple matter of pulling off the drawing, deburring all the holes, chamfering all the edges, and cleaning things up nice and pretty. If it's a part that will show, I'll put a nice surface on it. (Ok, I tend to put a good surface on practically everything I make... for that everything still looks like a nail.)

In the end I can very quickly make fairly complex parts that are good to +/- 0.005" or so. (Tolerances get looser as my speed goes up.) This is how almost all the sheet metal work on my first robot was done, and it's how the motor mounts on my first ROV were done as well. Despite having CNC tooling available, this is often the first technique I'll turn to when prototyping a new part or simply knocking something out to get the jobs moving through my shop and out the door.

Tom

Sunday, June 17, 2007

Birth of a New Version

I just released a new version of a library I've been working on for an AVR-based robot controller. Rather for a family of robot controllers -- there are now three devices the library supports. It's still in the 0.x version range, complete with bugs, lack of functionality, and sparse documentation. Still, it's nerve-wracking to actually roll something out and say, "Here you go!"

I know it's not perfect. I'm pretty sure it's not even all that good, and that a real embedded processor professional would laugh themselves silly if they looked at it. Still, it's my fervent hope that the target audience, namely people new to the devices, will see it for what it is: a way to get going and not get too frustrated in the process.

I'm encouraged when I look at the download stats from the previous version. All together over two hundred copies were downloaded before this release came out. Still, I looked at the ratings on AVR Freaks and found the previous version had one vote, and that vote was a zero. In the hopes that PT Barnum was right, I won't take it too hard.

It's at times like this that I feel kinda like Mongo (the giant gingerbread man in Shreck 2), having cast my code out onto the internet. I find myself thinking, "Be goooooooood..." Shortly before drowning, armless, in the moat outside the castle.

Tom

P.S. I realize I have yet to write a machine shop post! My shop really is mostly for metalworking rather than electron-pushing. Still, you post what you do, and I've been wrapped up in this so much recently. Ah well, if it's all fun, it's all good.

Friday, June 15, 2007

Dragons and Squids

For someone who knows what they're doing, the AVR Dragon really is a neat tool. I've seen lots of posts where people have mentioned an interest in an AVR programmer with a ZIF socket. Buy a ZIF with your Dragon, and it's just what you've been looking for! Lots of posts from folks who want HV programming, JTAG, ISP, etc. all in one device. It's CERTAINLY what you've been looking for.

But something you can use right out of the box? (The very attractive red box with stylized Chinese and Norse dragons, that is.) Er, no.

At least not for me. But I'm new at all this. Ok, well the more I looked around the more I realized it really wasn't all that useful right out of the box.

For one thing it didn't include any way to socket an AVR device. Keeping in mind that people have been asking for an AVR programmer with a ZIF socket, this was likely done on purpose for a couple of reasons: 1 - Sockets cost money. ZIF sockets cost more than other kinds. The less that's installed, the cheaper you can offer it. More likely, 2 - If someone really wants a ZIF socket, they can install one.

For another it didn't come with any cables. This was the bugaboo for me. Considering that you only need to make seven connections in order to use the ISP programming functionality on the Dragon, this isn't a huge deal. I can make six or seven point-to-point jumper wires. But darn it, I don't want to have to. Because they're messy.

So I found a neat Instructable:

http://www.instructables.com/id/EVM00HSXH6EZ7C8ZID/

It's how someone took a Dragon and a bunch of other stuff off of Digikey, and made a pretty general-purpose useful set of cables (among other things.) I went this route.

But I took it one step further. I got connectors for the ISP header and for the HV Prog header, just like in the article. But I also picked up some connectors for a JTAG cable as well, and bumped up the quantities on the other parts to make sure I could build the rest of the JTAG cable, too. Oh, yeah, and I got the ZIF socket. Oh heck yes.

In the end I spent more on cable bits than I did on the AVR Dragon + STK500 bundle. Ah well. Such is life. Luckily one thing I didn't have to buy was a crimp tool. The tool for the pins mentioned in that article runs about $500+, depending on how "professional" you want it to be. (e.g. do you want to crimp the wire and insulation strain relief in one go, or with two squeezes of the tool?) My advice for anyone building cables for a Dragon: Get a job at a place that already owns all the tools and doesn't mind your using them.

My cable bits should be in next week. Can't wait.

The best part was that in all the reading I did on how people are cabling up their Dragons, I ran across the neatest name for cables that have a ribbon connector at one end and single-pin connectors on loose wires at the other: Squid cable. I don't know if that's "the right" term, or a technical term, or if it was just what the author came up with out of their noggin. I don't care, either. I just love the name.

So how do you connect a Dragon to a STK500? With a squid!

--or--

"I'll have the Dragon Steak with Squid."

Dinner? Or embedded processor development? YOU decide.

Tom

Thursday, June 7, 2007

Dragon Steak, Dragon's Lair... Dragons BITE!

So the AVR Dragon and the AVR STK500 arrived in the mail. I'm certainly getting in deep, but Atmel does a good job of holding your hand and making you feel better than you actually are. All of which is just a prosy way of saying I was like a kid in a candy store when the box arrived. My only disappointment was that Digikey stuck their inventory sticker on top of the Dragon's box. It's a beautiful red box with gold artwork of a Chinese and a Norse dragon going at it. Luckily the same motif is silkscreened on the back side of the board, so all's not lost.

I spent a few evenings reading, thinking, and writing down. In the end I realized the pair really is a nice set of tools. So I figured it was a perfect time to play! Out came the chip that came with the STK500, and in went an ATtiny85, the only processor I have that'll talk to both devices. So what to do? What to do?

Well blink an LED, of course! And the STK500 has these in copious quantities. What could be easier?

Funny how it didn't work. Second time, either. Or the third time. So I held my breath and put the ATtiny85 into debugWIRE mode.

Aaaaand promptly lost the ability to talk to it because it's the Dragon and not the STK500 that can do debugWIRE style debugging. Problem is once debugWIRE is enabled, the normal ISP programming doesn't work. So I futzed around trying to get the Dragon to talk debugWIRE to it before I finally gave up in disgust and read up on how to do high voltage serial programming on the STK500.

It took some jumpering, but I finally got the STK500 to talk over HV serial. debugWIRE fuse was cleared, I restored everything to defaults, and re-jumpered for ISP mode. A quick check verified everything was happy again.

That's when I looked at the path of the .hex file I'd been loading into the ATtiny85... It was set for some LCD code I'd done for an ATmega168. AAAAAARGH! I'd been loading code into the '85 that simply wouldn't couldn't ain't gonna work. I pointed the programmer at the right file, and golly gee willickers the LED blinked like crazy! Good to know I wasn't crazy that whole time. But what a pain in the rear. AVR Studio 4 strikes again.

I still need to build the two jumper cables for the Dragon to make it really useful, but already the two tools are making themselves comfy at home. This stuff really really is fun.

- Tom