I have seen quite a lot of Hexapod robots on the internet with high torque servos with ATOM processors, but not the amazing Arduino with 9g servos, so I thought it might be a good project building one!

I don't usually have time during the week, so I do most the theory and calculations at nights, and leave the testing, building at weekends.

I am very happy to share my code, but I don't want you to turn to me after downloading my code and say, "hey you code won't work!" So I won't publish it until I am happy with it. it's kind of messy also, and it requires a lot of tidy ups!

This robot is based on the Arduino Mega 2560, currently controlled by a WII nunchuck controller. It's got 18 3-dollar 9g servos, and is using 2 packs 4xAA batteries 4.8V. I will post any update from my project here, in the meantime don't hesitate to ask me any question you might have. I will reply if I have an answer. thanks

I wanted to make a servo interface with the shield I bought off ebay, which would making it so easy to install the servos without making a mess. In theory i could use 48 servos on a Mega board, but I only soldered 20 servo ports, just to keep wires tidy and compact. I need only 18 servos for the legs and possibly 2 for the sensors anyway. I am leaving some space on the right hand side of the board to put a adjustable voltage regulator in, as I am planning to use 8xAA batteries, or 3 lipo 11V batteries in the future.

check ServoShield.jpg

=======================================================

Update

=======================================================

29/01/2012

Found a coupld of bugs in the algorithm, thanks to my Excel spread sheet simulation! Now the pitch and roll movements finally work properly, although the legs are still quite unstable. I still don't know why that is, maybe the dimension is still not correct, or maybe there are still bugs in the algorithms.

=======================================================

Update

=======================================================

09/02/2012

I have now adapted rotation matrix in Body IK algorithm, instead of estimating coordinate changes, i will be using formula derive from rotation matrix to calculate these changes (detail could be found in my last post, IK implementation). I have also started to use micro seconds instead of degrees to write servos. I have also had a major modification on the legs. It's now doubled the length of the original. Found a problem with pin22 and pin32 when using them as servo pins. These two pins interference with each other, ie, control one of them would control the other one too. Luckily I made 20 pins, so I can just easily move up all the pins by 1, ie, now using 23 - 41. We had a water tank overflow on the roof tonight, was a bit scary and we spent hours looking at the problem, so didn't do much testing on the new setup. will try tomorrow. The main problem with it at the moment remains to be leg-end position accuracy. I don't know whether it's the hardware or the software. But since I have move all the calculation into floating point, it should give relatively good numerical results. I have started looking at Gait, might implement 6 step ripple gait first.

=======================================================

Update

=======================================================

12/02/2012

Last night, I implemented a simple 6 step ripple gait, which I will explain in a minute. Let me explain what's the problem I discovered first with the IK algorithm. When the legs are meant to move along Z axis, the front and rear legs are actually moving toward Z-X direction, which is not right. So I wrote a test program to test the leg IK algorithm by checking the actually physical change of the leg position, versus the coordinate I entered manually. Again the legs won't move solely along one particular axis (X or Z), but tend to go somewhere in between. Spent an evening thinking about it, realize the original idea of calculation IK isn't perfect for my type of hexapod robot, which each leg are in a different frame (frame - Axis system), but I have always been assuming they are in the same frame as the center of body. for example, the frame of the front right leg is rotated -30 degree from the frame of the center of body (see below picture), so before we calculate the change of angles from leg IK algorithm, we need to do coordinate transformation first, to convert it from body frame to the coxa frame. A common way would be using rotation matrix. detail please go to my IK implementation post. after the modification, the robot can finally walk like one. ; )

=======================================================

Update

=======================================================

19/02/2012

Good news from Robotshop! My parts have finally arrived their warehouse and has been already shipped to me. So I got to hurry up finishing body balance algorithm this week (probably my last implementation on IK)

3. implemented 7 more gaits (thanks to Jeroen Janssen's source code, I copied most of the stuff over)

(1) Ripple 12 steps

(2) Quadripple 9 steps

(3) Tripod 4 steps

(4) Tripod 6 steps

(5) Tripod 8 steps

(6) Wave 12 steps

(7) Wave 18 steps

4. modified code to avoid using 'delay()', but to get the time using 'millis()', so processor can do other stuff while waiting rather than just freezes there.Also brings a bit more smooth movement there.

All looking great! however because I am getting so many functions and gaits now, I am having trouble with controls... nun-chuck is simple and handy, but it's very limited in terms of control options. I might need to come up with a menu system that I can switch between modes (body rotation, walking mode), and under walking mode i can also switch between gait types... I just love the nunchuck and don't want to replace it!

Any code you have and are willing to share would be great to look at. I am no where near programming a robot with legs but store all code samples I can for future experiments. I defiantly interested in the Android program. Looking at adding blue tooth to my project soon.
The robot is looking nice. Did a good job cleaning up the wires with out restricting movement.
Thanks
Shon