I have been playing around with my Hexy robot kit (http://arcbotics.com/products/hexy/) lately and decided to make a robot controller for it using the Galileo. Hexy has an Arduino-compatible board that controls the servos. The firmware that comes with it is pretty simple and just takes serial commands to set the servo positions. Normally it is possible to control over USB or the included Bluetooth serial module with a python program named PoMoCo. PoMoCo does the real work of figuring out where the servos should move to control the robot. The firmware just links the serial commands to the servos.
The PoMoCo program has servo calibration and a few pre-programmed moves available. However, some clever people on the Arcbotics forums developed inverse kinematics code where the software calculates how to move the legs. For a while I ran this on a Pengpod tablet before deciding on creating a robot controller. Intel Galileo was a pretty good match for what I wanted to do.
Here are my parts:
- Intel Galileo
- Intel Centrino PCIe card
- 2x stick-on antennas (http://www.mouser.com/Search/ProductDetail.aspx?R=2118060-1virtualkey58190000virtualkey571-2118060-1)
- Engrained Product's Galaxy Sport Case (http://www.engrainedproducts.com/galileo-galaxy-sport-case/)
- Seeed Protoshield kit (http://www.seeedstudio.com/depot/Protoshield-Kit-for-Arduino-p-318.html)
- Parallax Gimbal Joystick (http://www.parallax.com/product/27808)
- Monoprice 8000mAh battery pack (http://www.monoprice.com/Product?c_id=108&cp_id=10831&cs_id=1083110&p_id=10392&seq=1&format=2)
- 5-way navigation switch (https://www.adafruit.com/products/504)
- Several buttons, wood, metal and hardware
The 8000mAh battery pack was way overkill for this project but I wanted something large enough to use for other purposes. While it is designed for recharging cell-phones it is Li-Ion, 5V and has a built-in charger so it made sense for making the controller wireless. While I tried to be careful to avoid shorting it out, I did a couple of times and was glad to see that the over-current protection kicked in perfectly. Initially, I was wiring the battery pack to a barrel jack plug and plugging it in the same port as the normal power supply. I had mechanical problems with this and switched to a direct solder to the VIN pin.
I wasn't happy with the way the shield turned out. I figured a few switches shouldn't be a problem. However I ended up having to do a bunch of re-work. I had problems with Galileo's pull-ups. I prototyped on an Arduino for simplicity and they worked fine there, but once I soldered it and tried it on Galileo the port acted as if the pull-ups didn't engage. So I had to re-work a bunch and ended up shoving pull-up resistors under the board soldered to wires. I also had to re-work the headers to get sit on the Galileo board the way I wanted. I cut off half of the shield PCB as it was overhanging the case in the wrong direction. Without cutting it, it fits fine normally on an Arduino but on the Galileo it goes off the edge of the board rather than over towards the network jack. I should have scrapped the board half way through. Now I have a board that works, but I am not proud of the workmanship.
The joystick holder was made entirely with a Dremel to cut the wood and joystick hole. I glued it to the Sport Case with epoxy as wood glue wasn't strong enough.
The Sport Case had machine screws to hold it together. I replaced them with longer ones that would go down past the bottom of the case to the end of the battery pack. I attached some brass straps that I cut with the Dremel to hold the battery pack in place -- while being careful to not crush it. I am very happy with this wooden Galileo Sport Case. It looks great, and has proven to be versatile. I guess the only bad thing is it makes my Dremel work look crude in comparison to laser-cut wood.
The coin-cell battery is there just-because. I don't use the RTC for this project but I created it already so I figured I would plug it in.
Initially, I had the antennas inside the Sport Case stuck to the bottom. I was using the case for my LCD project so this made sense. For this project, I moved them to the joystick box so the battery pack wouldn't get in the way of reception.
I am using the WiFi / Bluetooth PCIe card for the Bluetooth to talk to the Hexy. As PoMoCo is in python, I used Clay Hofrock's python library to talk to the GPIO pins for the joystick pots as well as the buttons. I had to strip out the Tk GUI code in PoMoCo but for the most part I was able to use a fork of it with the inverse kinematics code combined with my GPIO calls to build the software.
The joystick moves the robot forward and backwards along with rotate left / right. The 5-way switch controls crab-left and crab-right. It is possible to move in all 3 directions at the same time. The buttons run pre-programmed moves and dances. I have a couple slide switches to select which set of moves the buttons map to.
Overall I am happy with how it turned out. The hardest part was something that should have been simple -- getting the buttons working. I still don't know why the built-in pull-ups didn't work.
I hold the controller with my right-hand on the joystick and my left over the shield. I added an USB right-angle adapter to make it easier to hold.