Saturday, September 10, 2011

Physical assembly

Physical assembly

The robot is built around a piece of 1/8" thick waterjet-cut steel plate, provided by Big Blue Saw.  All the major structural elements - the leg mounts and the outer shell - attach to this center piece.  Earlier versions of the robot were completely handmade.  Investing in a waterjet-cut frame helped tremendously - everything was actually aligned properly and held securely, which can't be said for some of the handmade frames.

The power indicator is semi-permanently attached to the front of the frame.  The indicator assembly is mostly built up from copper wire, which is wrapped around part of the steel frame at the front and soldered to itself to stay in place.

Physical assembly of the robot actually starts by securing the servo wires to the leg structure.

The servo wires are routed through some steel spring material I found in a scrapyard.  I don't know what this stuff was originally used for, but it makes a decent wire loom, and looks better than just using zip-ties or heat-shrink on the servo leads.  The two servo leads from each leg are run through a sleeve that is also slipped over part of that leg's support structure, and then all four leads from each side run together through a sleeve before plugging into the Pololu SSC board.

The shell of the robot's main body is made from a three inch copper tank float from McMaster-carr, caved up with my trusty Dremel tool.  Each shell half mounts to the main structure at three points, connecting with hand-cut right-angle aluminum blocks.  The mounting hole at the front of the frame is occupied by the robot's main power switch.

Actually getting all of the electrical parts inside the shell is challenging.  The battery just barely fits into the available space, and all the other parts need to be placed in just the right locations for everything to fit.  I haven't quite got the wires run properly in this shot.

Here I almost have everything in place.  You can see the charging jack, attached to the upper half of the shell which is upside-down on the right side here.  That will need to be carefully routed around the battery to the back of the robot.

The top half of the shell is attached now.  On the back of the shell, above the charging jack, is the connector for an external antenna.  I almost never actually run the robot with an external antenna, as even with just the jack the radio range is more than enough for the distances I usually let the robot get from me.

Flipped upside down and with the bottom cover removed, you can see the antenna lead connecting to the Xbee radio, mounted on the Xbee explorer board attached to the Pololu SSC.  Once I manage to get the robot assembled, everything is very tightly packed.  Other than the power switch, charging jack, and external radio connector, nothing is actually physically mounted.  Everything is just wedged together so tightly that nothing can move or get loose.  This is not actually the best practice, but there's really no room for mounting hardware inside the robot, and I take some care not to have anything rubbing against sharp edges or having wires with no slack that can get pulled loose.

Once the central body has been assembled, I can move on to the legs.

Each leg is made up of two servos, a 'knee' segment, and an outer leg and foot assembly.  Assembly starts by mounting the inner servo, the one which moves each leg forwards and backwards, to the frame.  On some of the earlier robots I built I'd cut the mounting tabs off the servos and glued them in place.  That was a bad idea for multiple reasons.  Not only did the glued joints fail too often and make it hard to maintain the servos, but the direct connection didn't offer any cushioning.  Here I've made a point of using good quality rubber isolators and brass ferrules at all four mounting points on each servo.  I'm hoping this will help prevent both broken gears and cracked mounting tabs by spreading out the loads and providing some degree of impact cushioning.

Here the 'knee' segment and the second servo is attached.  The knee segment is cut from a piece of 2 inch aluminum tubing.  I designed this piece in Autocad, initially as a 3D object, from which I generated a 2D pattern that I then printed out and wrapped around a tube, taping it in place.  I then used a drill press to drill the holes for mounting hardware and axle points, and then cut out the openings again using my dremel tool.  This design has worked very well.

Here you can see how the second shaft I've added to the servo fits into the knee segment.  Having a second pivot point on the back of the servo in-line with the main servo axle makes the legs far more rigid.  Servos made specifically for robot use often come with this feature built-in.  Here I've carefully modified the cheap hobby servos to have a pivot, hopefully in a way that won't compromise the structural integrity of the servo case too much.

The last step is to attach the outer leg/foot assembly to the second servo.  Each of these is made of up several pieces of metal.  A waterjet-cut steel frame is attached to the servo, again using four screws to attach to the servo mounting points.  Welded to that is a short length of half-inch diameter steel tubing.  Inside the tube, at the end, is a oil-impregnated bronze bushing retained by a welded-on washer capping off the end of the tube.  The foot is a brass drawer knob, which along with a spring and a shoulder screw that slides freely in and out of the bushing makes for a crude shock absorber mechanism.

The choice of the material for the foot came after a long period of trial and error.  This robot walks with a somewhat sloppy ambling gait, where the legs move forwards and backwards in diagonally opposite pairs.  At most points in the walking gait two legs are pushing backwards, one is raised and moving forwards, and one is moving forwards while sliding along the ground.  Early versions of this robot had square rubber pads for feet.  Those tended to get stuck on anything but very smooth surfaces.  For walking on carpet, I found that smooth, round, slightly slippery feet worked best - the robot needed to be able to push against the ground yet not have the forward-moving feet catch on anything.  I used nylon balls on the 2007 version of the robot, and those worked well, but for this version I decided I wanted a more steampunk look, with brass and copper parts, and went with some nice little brass knobs for feet.

That's the basics of the physical assembly.  Still a bit of an annoying problem is what to do with the loops of excess servo lead leaking out of the leg joints.  In the past I've looped these up and anchored them in place with a bit of tape or a zip-tie, but neither of those solutions really fits with the design philosophy of the robot.
Electrical and Mechanical

The electrical system of the robot is built up around a Pololu 8-channel Serial Servo Controller.  The SSC receives a serial signal from an XBee Pro radio modem, and drives all eight servos on the robot.

The XBee radio is mounted to a Sparkfun Xbee Explorer board.  This regulates the 5V from the Pololu board down to 3.3V, and provides a handful of useful status LEDs.  The whole thing is assembled in a rather inelegant dead-bug style.  I've also attached tantalum capacitors onto all the power supply outputs to make it a bit more tolerant of noise on the power supply rails.

Power comes from a 2 cell, 1mAH LiPoly battery.  The battery is directly connected to a management board which disconnects it in case of shorts, overvoltage, or undervoltage conditions.  That keeps the robot from bursting into flames if I accidentally short the main battery connections.  There's a jack on the back of the shell for charging, and a power switch to switch power to the rest of the robot.

The battery provides about 8V when fully charged, which is too high for the servos which don't run long on more than 6V.  I use a Turnigy 15A ubec to drop this down to something the servos can handle.  There's an additional and rather large power switch hanging off the ubec.  I really should cut this off and solder the wires together, since it's really not needed.  I really didn't want to put a regulator on the robot for a long time, not confident that it could handle the current draw of eight servos running at once, but it's actually worked out quite well.

The green blob wrapped in wire is a ferrite which reduces the noise coming from the switching regulator.

The only other electrical component on the robot is the power and direction indicator.  This is made from a uranium-glass marble, surrounded by six ultrabright, ultraviolet LEDs.  The LEDS are all aimed inwards at the marble, the UV light from the LEDs making the marble fluoresce green.  The net effect is to make the marble seem to glow with its own internal light.  I can excuse this even with my 'no purely cosmetic components' rule.  It shows me that the robot is completely switched on, and unambiguously indicates which end of the robot is the front.  As the design is roughly radially symmetrical, this is important.

Here's a everything electrically complete, being bench-tested.  Now to assemble it.

Servos for a cheap walker

This robot has always been built on a limited budget.  The original used entirely leftover parts, and even when I started buying parts specifically for the walker I tried to keep the budget down.  I can't afford to use the servos that are made specifically for robotics use, so I have learned to work with common hobby servos.

For a while, I used the Hitec HS-5645MG servos.  These were ultimately disappointing - the gearbox was not robust enough, with the second largest gear being particularly prone to failure.  I tried using the notoriously cheap HX-12K, which is actually a relabeled TowerPro MG995 servos.  Those had more robust gears, but terrible position control and motors that rapidly burned out under load.  I built up some hybrid servos using the motors and electronics from the HS-5645MG and the gearboxes from the HX-12K servos.  Those worked well for a while, until the HX-12K cases simply disintegrated from the load.

As I was rebuilding the robot this year, I looked at options for replacing all the servos.  I considered the Dynamixel AX-12A, but using it would require major structural redesign, and I was concerned with how much torque it could actual produce.  I eventually bough eight of the new TowerPro MG996R servos, the replacement for the discontinued MG995.  I knew they were cheap junk, and resigned myself to replacing them after every hour or so of run-time and coming back from GenCon with a completely broken robot.

I was very surprised with how much better the MG996 were than the HX-12K.  It's still a cheap $12 hobby servo, but they seem to have redesigned every common fault or failure point in it.  The biggest surprise was this:

The MG995 servos consistently failed as the central gearbox shaft gouged out its retaining hole, causing the gears to shift out of place and jam.  Seven of the eight MG996 servos I bought had brass bushing inserts in the case where the two smaller shafts are held.  The eighth still had the old plastic bushings.  There was no indication on the outside of the servo as to which ones had the brass inserts and which didn't, so it may be a matter of luck whether servos you buy have these or not.

The MG996 servos also have a completely redesigned controller board, internal wiring secured with dabs of glue, and generally better quality of construction compared to the AX-12A/MG995.

I ran the robot for the entire GenCon weekend, putting an estimated two hours of run time on the servos.  The only servo to have any problem was the one which lacked brass inserts.  That servo is starting to show signs of classic servo case degeneration.  The rest of them are still working smoothly.

Now these are still cheap $12 servos, with all the limitations you'd expect:
  • Not programmable
  • No feedback to your controller
  • Poor repeatability and centering
  • Limited to 6V max, so you need a voltage regulator if you're using LiPoly cells
  • Cheap potentiometer feedback
  • No rear shaft (I added one to all of mine)
  • Some degree of jitter and overshoot, although nowhere near as bad as the MG995
I wouldn't use these on a biped, or any robot where balance or precision is important.  I wouldn't use them on a helicopter or airplane, or any vehicle where a momentary loss of control can mean disaster.  I wouldn't use them in any competition robot.  But for a cheap, just-for-fun quad walker, these are pretty good servos.

Little Walking Robot, AKA 'Puppybot'

History and Origins

This robot started out as something fun to do with spare parts. I used to compete in robot combat competitions, starting with the original non-televised Robot Wars events in San Francisco, and then later BattleBots, as well as several other smaller events held around the country. I used to use cheap RC airplane radios to control the combat robots, and those radios always came with three or four cheap hobby servos, as well as a small battery for the servos and receivers. The servos were nearly useless for those robots, far too small and fragile, and after a few years I replaced the standard receiver and battery with a micro receiver and voltage regulator off the robot’s main batteries.

One slow weekend I took a receiver, battery, eight servos, and some silicone adhesive and scrap plastic, and built something that could limp around the workshop, slowly. It was fun enough for me to rebuild it a few times and tweak the design, eventually adding a microcontroller to automate the walking cycle. With that I ended up with something that worked well enough to show off to people. The main limitation was severely limited battery life. The little receiver battery I was using to power the robot, basically four rechargeable AA batteries, couldn’t handle running 8 servos under constant load for more than a few minutes. Switching to five heavy-duty sub-C sized cells, leftovers from combat robot battery packs, vastly increased the run time, and the additional voltage and current capacity made the robot much faster.

At this point the robot had passed beyond the point of begin something to do with leftover parts to where I was spending time and money specifically on it. I took the robot with me to one of the robot competitions, not as a competitor but simply to show off, had more fun with that than I’d had actually competing, and took home the ‘coolest robot’ award despite not actually being entered in the contest.

In 2004, my wife and I began attending GenCon. This was after the smaller local convention we had been attending (CastleCon) shut down - going from a 300-person local convention to a 30,000+ person national one. We’ve attended every year since. One early year - either 2005 or 2006, I’m not sure - I decided to bring the robot along, to show off to some friends. I had a lot of fun, not just with friends we were meeting but also walking the robot around the convention.

Since then the robot has been a fun way for me to show off my engineering skills, meet and entertain people at conventions and shows, and to experiment and learn with different ways of building it. Learning what breaks on the robot, fixing it, and then finding the next weak point has taught me a lot, that’s I’ve used at work and in other projects.

Overall design philosophy

  • Simplicity. The robot is made from as few parts as possible. Every part that is added is another part that can fail. It is easy to solve a problem by adding more components. It’s harder but far better to do so while also simplifying the design.
  • No purely cosmetic parts. As per the previous rule, the robot isn’t allowed any parts which are there purely to make the robot look better. Every part is required to in some way make the robot better in a functional way - more reliable, more durable, easier to control or more versatile, etc.
  • Every functional part has to be designed with aesthetics in mind. As I am not letting myself hide the functional parts of the robot behind cosmetic covers, I try to make the visible parts look good. This usually follows from good workmanship, and not taking cheap and easy solutions to little engineering issues like insulation and anchoring components in place.
  • No structural joins made with glue. The early versions of the robot were held together with silicone gel. The servos were glued to the sides of battery, the microcontroller board and radio were glued to the top of that, and the feet were glued to the outermost servo on the legs. This was easy but unsatisfactory - the glued joints would fail unpredictably while walking, had to be pried or cut apart to replace servos, and took hours to set after being repaired. Now I make all mechanical joins with easily detachable, reusable fasteners - screws and bolts - while mechanical joints I never need to detach are welded or soldered.
  • Ease of repair. Wherever possible, parts can be easily accessed and replaced in the field. I can rebuild the servos - replacing gears and electronics - without even removing them from the robot. I can’t replace the battery or other electrical parts as easily, but I don’t have spares for those anyway.
  • Crowd-friendliness. At conventions, the robot can come into direct physical contact with people. Children will poke it, people may pick it up or trip over it. I needed to design it to not injure anyone accidentally. The robot has no sharp points or edges, but uses spheres and large-radius curves wherever possible. I’ve also tried to design the joints to be open and have no tight finger-crushing pinch points, although it’s still possible to catch a finger painfully in some leg positions.
  • Smooth and accurate translation of stick position to leg motion. The earliest versions of the robot had no mixing, just straight connections from the radio receiver to the servos. Motion of the sticks were translated directly to motion of the legs. It was very difficult to control, but I found I could get a lot of expressive motion and gesturing with different stick positions. Later I experimented with automated walking cycles. I’d just have to push the joystick in the direction I wanted the robot to move, and it would walk itself that way. This was a lot easier, but a lot less expressive and entertaining. I switched back to direct control over the legs, but I also added custom mixing algorithms to make walking easier.  Key to making the robot appear lifelike is accurately translating the motion of the joysticks to the movement of the legs. Getting the right joysticks is important. The joysticks on the old RC airplane radios I started with were lovely - very smooth motion, independently adjustable spring centering on both axis, and mechanically adjustable center point trims. When I decided to move away from the RC airplane radio and use an Xbee serial modem instead, I tried using a pair of Wii Nunchuk controllers. These were nicely compact, fitting in the palms of my hands, but the joysticks were terrible, having very limited range of motion, zero adjustability, and a plastic housing that gave them an octagonal range of motion. Walking with the Wii controllers was a lot jerkier, lacking the fluidity or ability for fine gestures that I had before. This year I took the joysticks out of the old airplane radios and built custom-made controllers around them, which gave me a lot of the old fluid motion back.  Also important is that the leg joints themselves can move smoothly over their entire range of motion. This means no bodywork to hang up or impair free motion, and servo wires routed in such a way as to not get caught or pinched as the legs move. The last has been tricky, and a perpetual challenge to the design.


These were not taken by my, but by other people at the conventions, whose names I didn't get, but who kindly took videos of my robot and put them up on Youtube.

GenCon 2011

GenCon 2007

Tuesday, August 9, 2011

Quick GenCon update

I just attended GenCon Indianapolis 2011 with the robot. Over the course of the three main convention days (Thursday, Friday, and Saturday) I took the robot from fully charged to fully depleted batteries five times without a single mechanical failure - a new record, and actually quite astonishing considering I'm still using $12 cheap import servos. This translated to over two hours accumulated time walking the robot around the convention and entertaining the crowds.

With the new 60mW Xbee Pro radios I did not have a single incident of control failure, even when the robot was 30+ feet away and surrounded by people with cell phones. I didn't even need to use the external antenna on the robot itself.

The MG996 servos held up well, but a few are starting to sound rough. Quick examination reveals that while most of the MG996 servos have brass bushings on their secondary gear shafts, a few still have plastic bushings. I can't see any indication from the outside to tell which is which. When I get back from vacation next week I'll do a thorough teardown and inspection of the entire robot.

Sunday, April 17, 2011

Adding a second hinge point to a common hobby servo

When using servos as joints in robot limbs it is helpful to have a second axle point on the rear of the servo, opposite the servo output shaft, to increase the rigidity of the joint and reduce stress on the servo shaft bearings. Many high-end servos meant for robotics come with rear axles points built in, but I don't have the budget to afford those servos. There are a few alternatives that work with common hobby servos.

Attempt #1: Lynx Motion press-on plates

The first thing I tried, and where I got the initial idea from, was the Lynx Motion injection molded servo hinge. This is a plastic case that presses on to the back of any standard servo and adds a hinge point. It's fairly cheap and easy to use, and I used it on a few servos, but ultimately I found it unsatisfactory. There are several basic flaws here. The press-on hinge adds significant thickness to the servo, making it hard to retrofit into an existing design. The press-on plastic plate covers two of the servo case screws, so you have to remove it to open the servo up to replace broken gears or re-grease the gearbox. The piece is pressed on with pressure-sensitive adhesive, so you have to rip it off to open the servo. The adhesive isn't very strong, so the piece can tear loose by itself, and the plastic pin that makes up the hinge point also breaks or wears away easily. It's a good idea, but it's possible to do much better.

Attempt #2: Cutoff epoxied screw head

My first idea for making my own hinges was to cut the head off a self-tapping wood screw, then epoxy the head to the back of a servo. I used a phillips head, flat countersunk finishing screw, with the widest surface I could find, and sanded the plastic surface where it attached to the servo to try and make the epoxy joint as strong as possible. This seemed to work well enough, but I didn't test very long with this design before having a new idea.

Attempt #3: Weld nut epoxied to servo case.

The problem I found was that having a fixed post as a second servo hinge made it hard to assemble the servo into a single-piece bracket. A hinge that could be attached to the servo after the servo was placed in the hinge would make assembly easier, so I bought some weld nuts and epoxied them to make second hinge points on servos. I could then place the servo in the bracket, and then insert a screw and sleeve bearing through the hinge hole on the bracket into the weld nut. The sleeve bearing made for a smooth wear-resistant second hinge point. This design worked very well for several versions of my quadruped robot.

The failing of this design was the epoxy joint between the weld nut and the servo. Even with sanding the servo case and experimenting with several different kinds of epoxy and cement, a weekend of running the robot at a convention would result in several broken hinge joints as the weld nuts came free from the servo cases. I was also having a lot of problems with epoxied structural joints elsewhere in that version of the robot breaking. When I set out to redesign and rebuild my quadruped again, I set out to have no load-bearing epoxy joints anywhere in the design.

Attempt #4: Weld nut inside the servo case.

I have just recently purchased a full set of MG996 servos to rebuild my demo walker robot. I had expected these to be similar to the MG995 servos I'd used previously: barely usable crap needing lots of rework before I could use them. I was therefore very surprised to discover that the MG996 servos were a vast improvement on the prior model. Better electronics, better quality plastic and tighter construction, glue securing every wire, and most astonishingly brass bushings on the intermediate gear shafts, where the MG995 servos had been so prone to failing. They still don't have rear hinge points, of course, so I set about adding them.

I didn't want to epoxy a weld nut to the outside of the case, so I'd have to put it inside the case, with the barrel of the weld nut extending through the servo case. I hadn't wanted to use any solution that meant intrusion through the servo case, but I didn't see any other way to securely attach the hinge. I disassembled the servo and carefully measured the interior to make sure I'd have room to fir the weld nut without interfering with the motor, control PCB, or any other part inside the servo.

Here's the rear case, drilled out, and with a trimmed weld nut.

I used a larger weld nut than before, one with a 5/16 inch barrel diameter, mostly because it was what I had on hand. This one was slightly too large to fit inside the servo rear case, so I had to slightly trim it with a Dremel to fit snugly inside. I then pressed it in and used two-part epoxy to secure it in place. This does not violate the rule of no load-bearing epoxy, as the epoxy is only being used to hold the weld nut in place until the hinge is fully assembled.

On the left: Servo case inside with a weld nut epoxied in place. Middle: same thing, seen from the outside. On the right is the fully assembled hinge point, with washer to spread the load across the plastic case, bushing pressed around the weld nut barrel, and 1/4-20 machine screw holding the whole assembly together. Last step in assembly before putting the servo back together is to place a small piece of tape over the inside of the weld nut as a final step to prevent it from shorting out any exposed electrical conductors inside the servo.

Finally, a fully assembled servo with a very heavy-duty rear hinge point, inline with the servo output shaft. This can be used to make a mechanically rigid hinge in a robot leg, which I'll be showing next update as I reassemble my quadruped walker.