Spent a lot of time working on the code of my Arduino hexapod this week. I reprogrammed the way I move the servos. The code is now based on a timer (millis) instead of using a for loop and the delay function. I can now control the speed of the walking gait. I also added a mode to move the body. There are still some glitches in the code that need further investigation. But I’m quite happy with the current result. The above video is running the last version of my code. The main hexapod sketch is now over 1000 lines code and takes up 35kb. The second micro controller on the hexapod that handles the wireless communication has 200 lines of code and is 10kb. The remote control is another 10kb sketch. So I’ve written lots of code the last weeks.
I should now spent some time on the mechanical side. The legs have very little grip at the moment so I need to find a solution to improve that. I’ve received 20 metal servo horns to replace the plastic ones. I’ll design a new chassis that is a little bigger then the current one. So I have enough room to mount the battery, UBECs and electronics inside the chassis. Currently the battery is zip tied to the bottom of the chassis. I’ll use 3 plates so I have 2 levels to mount all the electronics. The battery and servo power board in the lower deck and the micro controller in the upper deck. I’m expecting my new power servo PCB and Seeeduino Mega next week.
The hexapod consumes a lot of power. It will discharge a 3S 3000mAh Lipo battery in less then 10 minutes. I only have a small Lipo charger that charges @ 800mA. So it takes over 3 hours to charge the battery. So this morning I decided to order a fancy Imax B6AC charger. Of course I bought it on Ebay from a seller in Hongkong