Saturday, January 30, 2010

Unicorn-1 Arm

Time to arm the robots! No, not for world takeover. I'm talking about robotic arms. Digging through the stack of old robot stuff I ran across a photocopy of this ancient, August, 1980 series from Radio-Electronics.

The first article offers a neat, simple design for a robotic arm that seems relatively easy to build with some basic tools and careful techniques. Interesting excerpts are reproduced here for educational purposes.
The elbow-forearm actuator is comprised of a large motor and threaded rod that pulls a on the midpoint of the forearm. The shoulder is actuated, I think, from a motor within the robot. Details on the design, dimensions, etc, are given below.
To save weight, I suppose one could change the design to use aluminum tube instead of steel rod for the side rods. They're available from home improvement stores, hardware stores, and online shops.

Some parts (right) need to be machined, unless one comes up with a simpler way to fabricate them. If so, I think all that's really needed is a drill press, a way to ensure drilling a hole through the center of a rod, a cutoff saw, some hand tools, and a tap or two.

An electronics article from the 80's would be good for a chuckle. But since motor and mechanical technology haven't changed all that much, I submit that these 30 year old plans are still relevant for the modern robot builder.

Saturday, January 23, 2010

ESR Test Harness: Part 2


You may recall the original article on the ESR test harness. Well, it's been several weeks since I looked at this project and I wanted to finish it. I have a lot of capacitors to test!

Upon revisiting, I figured it best to prototype the more complex circuit from Stephen M. Powell's website before proceeding further. After working out the kinks, I reworked the original schematic and board layout and selected a larger enclosure primarily to make more room for front panel knobs and switches. So it ended up being something of a do-over.

Over the course of a few days I built up the ESR test harness, worked out a few glitches, and now have a useful, attractive, working test tool for the bench. Here's how. (And how not)

Lessons Learned

  • Prototype, use and test the entire circuit as designed before fabricating a PCB
  • Check the schematic for correctness carefully before fabricating the PCB
  • Use copper pour regions where possible so there's less copper to etch away
  • Try using thermals for pads on copper pour regions to improve soldering
  • When selecting the enclosure consider: availability, interface design and size, circuit size, and power supply size.
  • Don't be an idiot like me...
The Circuit

Here's the circuit I built from, most of it verified by prototyping and testing. For details on how the circuit works you can reference Powell's test harness article. This article focuses more on prototyping, testing, building -- and screwing up -- in hopes it will help you.

Over Voltage Diode Problems

I started with a simpler version of the circuit for prototyping, leaving out the over-voltage protection diodes and potentiometers. The circuit produced a nice 80kHz square wave.

Adding the over-voltage protection diodes created some funky ramp waveforms as if the P-N junctions were conducting--they shouldn't have been--so I fiddled with resistor R3 to drop the amplitude well below 0.6V and then the 'scope displayed a nice, happy square wave.

Screwing Up Resistors

What I didn't know at the time was that the resistors I thought were 22Ω were actually 220Ω (the brown band looked black to me). So R4 and R5/R6 dropped too much voltage, activating the diodes.
Additionally, the circuit didn't do a good job measuring ESR after I'd finished building the final product. Powell's original choice of R3 and R4 work best and once I'd replaced R3 (470Ω), R4 (22Ω) and R5/R6 (just one 6.8Ω resistor I had on hand worked as well as Powell's 10Ω) , I got the result I wanted... well, almost.

For this and several other reasons, prototyping and testing the complete circuit before fabricating is crucial. I did that, but fixed the wrong thing, tested wrong, and tested the wrong thing.

Variable Frequency, Duty Cycle

For adjustable frequency, I added in the 1MΩ potentiometer to the prototype and found I had to add a 1.8Ω resistor in series to ensure a minimum resistance. Without that minimum resistance, the waveform went funky at the potentiometer's lower extreme. Good thing I tested. Of course, you can always wire resistors in point-to-point to fix stuff if necessary. With the series resistor, frequency is indeed variable from about 1kHz to 340kHz. Cool.

Duty cycle can be changed and I built that capability into the PCB but set it at a fixed value as it wasn't all that useful.

Screwing up the Schematic

Then I discovered a pretty big error in my schematic. The 555 square wave circuit I'd drafted was very different from Powell's. Glad I caught that before I made the PCB because that would've been a serious pain in the rear.

Testing Capacitors

The circuit tests ESR by putting it in parallel with another resistor and sending a high enough frequency square wave through it that the capacitor doesn't filter or integrate the signal. The lower the ESR, the lower the voltage drop across the capacitor/resistor. If ESR is substantially more than the parallel resistor, that resistor will mostly bypass the capacitor so it sets an upper bound of ESR sensitivity. A shorted capacitor will show zero ESR but the waveform won't have a DC offset as it normally would.

From Powell's website on ESR measurement, here are some heuristics for testing the health of capacitors:
  • 1µF - 100µF : 0.7Ω ideal, up to 2Ω probably ok.
  • > 100µF : anything over about 1Ω means a degraded capacitor.
Translating ohms to voltage drop to display divisions on the 'scope uncovered an issue with sensitivity of the circuit to low ESR, mentioned earlier. It could detect ridiculously high ESR but discerning between, say, 1Ω and 2Ω was a no go. One fix was using the correct value resistors.

Screwing Up Testing

In addition to using the wrong resistors, my oscilloscope probe was set to 10X (attenuating the signal by 10). After fixing the resistors and the probe, the circuit had good sensitivity to low ESR.

Measuring ESR

How do you translate screen reading to ESR? I put together a table and graph to translate directly from waveform amplitude in 'scope divisions to ESR value.

Measuring amplitude out of pin 3 on the 555, and then calculating total resistance and thus current, it was possible to calculate voltage drop for various ESR capacitors in parallel with R5 (6.8Ω), then convert that to the number of divisions on the scope, when it's set to either 5mV/division or 10mV/divison.

The graph makes it easy to quickly read ESR based on amplitude of the waveform across a test capacitor. With the scope set to 10mV/division, here are the heuristics restated:
  • 1µF - 100µF : 1.0 - 2.2 divisions probably ok.
  • > 100µF : no more than 1.2 divisions
Be sure to adjust for your minimum test resistance by shorting your +/- probe leads. The final circuit showed a couple tenths of an ohm resistance, basically about 0.2 divisions. Just add 0.2 divisions to the above.

PCB Fabrication Tips

As before, I put together the schematic and board layout in Eagle. This time I used copper pour regions (polygons in Eagle) for ground so that less etching, and etchant, were necessary.

I found that soldering components to the big swaths of copper is tricky so next time I will try using "thermals" which adds some space around the pads to ensure most of the heat is directed at the pad (see below)

Thermal pad isolation, detail

Screwing Up PCB Fabrication

As with my prior attempts at DIY PCB etching, I found the method using magazine paper and clothes iron transfer is still a bit tough to get right. The magazine paper kept jamming in the laser printer. Also, it's important to let the transfer and board cool down before messing with it, otherwise you'll peel the magazine paper away and ruin the transfer. When ironing, the length of time and amount of pressure remains important. Too much pressure and time and the traces get blotchy. Too little time and the transfer isn't thorough. After a couple outright failures, I got a transfer that was good enough, but certainly not great.

PCB after transfer (left) and after etching (right)

The etching method using Ferric Chloride with a sponge still takes forever. Frankly for all that scrubbing, I'd just as soon dump the board in a tank and let it sit for an hour (or however long it takes). Plus there would be less risk of spilling FeCl all over the garage floor (yes, my garage floor now has giant yellow spots), my clothes, hands, etc. I'll try that approach next time.


Drilling went ok. I used the drill map approach from last time wherein my Perl script converts a drill file into a CSV that can be imported and graphed in Excel or OpenOffice Calc. I again used a scatter plot in OpenOffice Calc to draw a diagram showing what drill sizes to use for each hole.

Board Assembly

Most of the components I had on hand. For testing, I used bus wire to jumper out the variable resistors and a simple 9V connector for power. When I powered it up and connected to the scope, it displayed a waveform. As described above I had to fix some glitches to get it working right.

The finished board (left) works (right)

Screwing Up Some More

The main probe BNC, on the schematic, wires in series with a 22kΩ resistor. I think it's another overvoltage protection feature. After building everything I discovered this resistor messes up the square wave sent to the scope and jacks up the signal at higher frequencies. I never caught this because I never tested this aspect of the circuit properly.

Meanwhile, the waveform across the 6.8Ω resistor looks good (though with some ringing). A couple options exist. Either replace the 22kΩ with bus wire or relocate the probe BNC where R6 used to be (very close to the pretty signal across R5 the 6.8Ω). I took the latter approach and it worked out fine. That leaves the ringing to deal with for another time.

Enclosure Design

I find selecting the enclosure and figuring out the layout is the hardest and most tedious part of the design. Designing the ESR harness last time was a nightmare trying to figure out how to get all the controls and jacks to fit into a microscopic case. Unlike last time, I am not picking the enclosure solely based on the size of the electronics but rather one with plenty of room for switches, knobs, etc.

But selecting that enclosure still was a pain. Originally I wanted knobs to adjust duty cycle and frequency, jacks for probes, and BNC jacks for the test waveform and a trigger waveform (because the signal waveform is so small for low-ESR capacitors a separate trigger signal is helpful). That, and a power switch. But after all sorts of planning and finding the perfect case, selecting the knobs and power switch I wanted, I discovered that the case was unavailable and cases of similar dimensions cost a fortune.

So I settled on a 5"W x 2"H x 5"L cabinet, Hammond #1598-BSGY.

I redesigned the front panel again, ditching the external duty adjustment, using a smaller knob for frequency, ditching the banana jacks (a BNC t-fitting can be used to connect probe, harness, and oscilloscope), and using a smaller power switch. I also made sure the candidate power supply transformer will fit if I go that route.

Front Panel Design

Designing the front panel is easier using a nice drafting program like Visio or Inkscape (Windows) or OmniGraffle (Mac), which makes it easy to draw shapes and set their dimensions and positions precisely. Even better if you can conveniently mark the centers of all your drill holes so you can just print out the design as a template for drilling. OmniGraffle makes this ridiculously easy to do.

Because of scaling problems in trying to print the front panel in reverse on an inkjet transparency, the front panel was instead printed with a laser printer on paper, with packing tape used to cover it and affix it to the front panel metal. Yeah, it's a little cheesy but at least it's better than if I'd scrawled on the panel with a Sharpie. Installing the front panel components was fairly simple and straightforward.

Final Assembly

With the front panel in place, it was easier to locate an optimal spot for the circuit board. One option for mounting is to use plastic glue (e.g., SuperGlue), JB Weld, or another epoxy to affix plastic standoffs to the inside of the plastic case. Another option is to simply drill holes and mount the standoffs from below. That's what I did. You could also obtain the case datasheet and design your PCB to fit built in standoffs in the case.

For now I used a 9V battery mounted in a clip inside the case, but as you can see below, I left enough room for a 9VDC power supply PCB and transformer when I placed the main circuit board.

Inside Layout Detail

The front panel component wiring was a matter of following the schematic and wiring up the BNC connectors, potentiometer, and power switch. The indicator LED is simply wired in series with a 470Ω resistor to limit current from the battery and wired to the nearby switch to ensure it only comes on when the switch is on. I used some 'feet' from an old, dead CD player to finish it off, buttoned it up and tested a few dozen electrolytic capacitors. Later, after fixing the glitches above, I added a set of permanently attached probes by drilling holes in the front panel and using grommets. In the end, the device is pretty handy and useful even if not perfect.


You can find the source here on github:

Tuesday, January 12, 2010

Learning Robot from my Alma Mater

Interesting robotics story from my Alma Mater, the University of Arizona. Matt Bunting programmed his hexapod to learn:
... "...I wanted it to figure out how to walk straight forward on its own," Bunting said. "It has the ability to figure it out itself."

Friday, January 1, 2010


Downloads and display USPS Shipping Labels on Mac OS X.

The United States Postal Service offers a service to create and print shipping labels online. However, on the Mac, these labels aren't displayed correctly. This freeware AppleScript application fixes the problem. Labels are downloaded and opened automatically like they used to be. Tested under Mac OS X 10.4 and 10.5

  1. Click the download button below
  2. Unzip the downloaded
  3. Drag the PDFopener application into your Applications folder
  4. Configure your web browser to use PDFopener for PDF files*
  5. Go to your browser download folder and delete all old "LabelGenerationServlet" files
  6. If this application makes your life easier, consider donating $1 below

What's wrong? The underlying cause is that USPS shipping labels are downloaded with a file extension of LabelGenerationServlet and converted to type Document which Preview doesn't recognize. This script when used as a downloader automatically renames the file and opens it.

* Browser Instructions

Firefox 3.*
  1. Select Preferences from the Firefox menu
  2. Select the Applications tab
  3. Look for instances of "Portable Document Format" in the list
  4. For each, from the pull down menu at the right select "Always Ask"
  5. Print a sample label -- create a new label but instead of paying and printing, select print sample label
  6. When prompted, choose the PDFopener application and check the "always open" box
  7. If you have problems, contact me on via the link on this website.