Photo of hexapod wiring

A co-worker made me aware of a relatively inexpensive hexapod kit from Sparkfun. I have always liked hexapods and wanted to try working on one myself but all the kits I found seemed ridiculously expensive to me. So when I found out about this one I bought one on a whim. I needed a way to control it and of course I wanted to use the Stellaris microcontroller since I worked on that team. Since we had just recently introduced the Stellaris LaunchPad, I decided to make my own BoosterPack to control the 12 servos needed for the hexapod.

Here is a picture of the hexapod kit that I bought from Sparkfun:
Photo of Hexapod kit
Assembled 12-servo hexapod from Sparkfun

You can buy a controller board to go with it, but I thought it would be more interesting to make my own controller. Since I worked (until recently) at TI, I wanted to use a Stellaris microcontroller. TI had just recently come out with the Stellaris LaunchPad so I thought that was a logical choice for the controller. The LM4F microcontroller on the LaunchPad is actually a very good choice for controlling 12 servos because it has timers that are perfect for generating the servo control waveforms. The LM4F has 6 wide timers. The wide timers are 64 bit timers that can be split into 32-bit half timers. This means you can get 12 32-bit timers giving you plenty of timing resolution needed to generate the 20 ms PWM signal needed for hobby servos.

Photo of servo BoosterPack
Prototype Servo BoosterPack

I started off with some naive ideas about how to power the servos. I built a prototype using a LiPo battery and a power supply board I got from Sparkfun. As you can see in the photo, I provided a hookup for two servos and started testing with that. This arrangement was not even close to being able to supply even one moving servo without browning out.

I thought about powering the servos directly from a battery pack. But the servos need 5-6V and from what I have seen by reading about hobby servos, you should not exceed 6V. So, I could stack up some normal alkaline batteries to get 6V but I wanted to use rechargeable lithium polymer batteries and these cells are not a convenient voltage to achieve 5-6V.

So I decided I needed a power supply circuit. The best I could tell from web searches and some crude attempts at measuring the current I decided these small servos needed 100-200 mA when moving. I decided that a 5A supply should be sufficient. I also decided on 5V (instead of 6V) because then I could use the same power supply to provide 5V to the LaunchPad.

I also chose to use a 2S LiPo battery (instead of 1S or 3S). I wish I could say I did some analysis to decide on this but it was really arbitrary. A 2S pack will provide a range from 6-9V from fully drained to fully charged. A 3S will be about 12V fully charged. So I chose 6-12V as the input range for the power supply. I used TI’s power supply design tool to come up with the power supply circuit.

Now that I know I will have a battery, I thought it would be handy if the microcontroller could read the battery voltage. So I added an op-amp circuit that will translate the battery voltage (6-9V) into a range suitable for input to the Stellaris ADC (0-3.3V).

To summarize, here are the features:

  • connectors for 12 hobby servos
  • servo connectors provide 5V, ground, and wide timer signal to each servo
  • 5V/5A switching power supply
  • 6-12V battery input
  • 6-9V battery measuring circuit

Here is what the finished and assembled board looks like:
Photo of assembled BoosterPack board
Fully Assembled Servo BoosterPack

You might notice some jumper wires on the board. I had two mistakes in the power supply circuit. I have since corrected those in the board design files.

There area couple of other changes I might make in the future.

  • add a switch to turn it off and on (right now you have to plug/unplug the battery
  • use a different battery connector

I use Eagle to create the schematic and lay out the board. I had the board made at OSH Park, where I got 3 boards for $25 in a little less than 2 weeks. I don’t have any experience with other board makers like BatchPCB, but the process at OSH Park is so smooth and they make the boards in USA so I would definitely use OSH Park in the future.

I placed all the design files, including the BOM info on github at https://github.com/kroesche/lp-servo12.

I also put a servo driver at https://github.com/kroesche/stellaris_drivers

I wrote some test code and some simply tripod gait code, but at the time of the this writing it was not suitable for posting. Once I clean it up I will add it to the github as well.

Finally, here is a video I made about my BoosterPack.


Comments

There are no comments yet.

Add a comment
You can use markdown in your comment. No personal information is collected or retained. Your email address will not be posted. This site uses static comments via email. That means there is no third party tracking you. I will get an email from you and I will see whatever email address you sent it from, which I don't care about. The email contents will then be converted to a static comment and appear here.