Saturday, February 1, 2014

Thursday, January 30, 2014

First Legs

H-King High Torque Metal Geared Ball Bearing Waterproof Servo 58g/12.8kg cm/0.22s/60 (USA warehouse)I decided on some cheaper servos the than the Hitec servos specified by lynx motion. The specs are roughly similar and they are supposed to be a similar size. I ordered enough for two legs to test fit. Building out the first two legs these servos are a few millimeters too tall. I won't list the part number as I wouldn't recommend them for the Lynxmotion chassis. They fit but not perfect. I ended up ordering the rest. Two legs in I didn't want to tear it down and waste the servos.

Building

Building the legs is pretty easy. The assembly instructions are pretty clear. The only part that is tricky is positioning the servo wheel correctly to ensure adequate range of motion. Something familiar to RC hobbyists. You have to ensure the wheels are positioned correctly. Even then centering will be required. I'll have to solve that in software.

I built in pairs. I have 4 legs on so far before the challenge of the software distracted me.










The picture on the right shows the bearing on the leg. You can see the servo is pushing the bearing out slightly. Not good. But acceptable. I would recommend a smaller servo for the purpose.

Wednesday, January 29, 2014

High Level Software Design


High Level Design
There are two main parts to the design. A control server and the onboard robot controller.

The objective is to use the Raspberry Pi as a communication controller. The control server implementation hosts a asynchronous queue that the Raspberry Pi listens to. Allowing the control server to send command messages to the Raspberry Pi. The Pi then translates the commands into leg movement sequences.

The Raspberry Pi uses gathers information from sensors and for sending to the control server. The control server can use that information to change the instructions sent to the robot to control it's movement.

Raspberry Pi Constraints

The Raspberry Pi cannot reliably generate PWM servo control pulses. Particularly in Python the language I chose to write the Pi code. (I chose Python because it's well supported and I would like to learn more.) Given the robot requires 18 servos that increases the problem.

There is a wide range of sensors to choose from that could provide great environmental feedback to the server. However many require analog inputs. The Raspberry Pi does not include a hardware Analog to Digital converter.

Overcoming Constraints

In order to control 18 servo channels I chose to use Adafruit's 16 Channel PWM controller I2C interface. This allows using 2 boards for up to 32 channels.
It's a breakout board with onboard microcontroller for handling the PWM. It has an

Having used I2C for PWM servo control it made sense to look for a I2C Analog to Digital (ADC) controller.

I eventually decided on a AVR ATMega328. Totally overkill for the purpose but readily available and lots of documentation online.

Raspberry Pi Hex Robot Build Intro

So I got a Raspberry Pi for Christmas. The question was what to build with it. At work we are implementing an Apache Camel integration platform so I wanted to build something that utilized Camel. I decided I wanted to try and build a hex robot that used a remote server to control it rather than the typical Bluetooth controller. Lynxmotion have some amazing kits you can buy complete with full controllers, software etc. But where would be the fun in that.

Aluminum Hexapod 3-R Body Kit - Round Full Size
Lynxmotion Chassis
3DOF Alum. Leg Pair (No Servos)
3DOF Legs
I have spent a lot of time flying Radio Controlled aircraft of various type. I've always wanted to better understand how to control servos etc. What better way to learn.

I bought a chassis from Lynxmotion and 3 pairs of their 3 degrees of freedom legs. Without servos to keep down the cost.

The robot requires 18 high torque standard sized servos in total. I sourced them from hobby king to start the project with cheaper servos.

Over the next few months I'll start detailing the build and software development. I intend this project to be a learning project for a number of different technologies. It definitely will not be the optimal build of a hex robot but with a bit of luck there will be some interesting things to share.