Made some progress on my hexapod code today. I have written a function that moves all 18 servos in little steps. I had to use the delay function though. I then made a sketch to move the body of the hexapod up and down as smoothly as possible.
You can see the result in the above video, this what’s possible with MG996R servos. These are cheap powerful Chinese servos, they don’t have the best reputation in the RC world because of their lack of accuracy. I’m quite happy with them, they seem to have lots of torque. Downside is that they are power hungry. It’s time for another Lipo recharge 🙂
Next step is to try and rewrite the code and replace the delay function with timer. Think I’ll need lots of timers to code a walking gait.
After blowing up a couple of expensive 8A UBECs I think I have found a solution to powering the 18 servos. I am now using 3 8A UBECs, each UBEC powers 2 legs / 6 servos. I have written a basic walking gait to move the hexapod forward, backward, left and right. I’m using inverse kinematics to calculate the servo angles. The code still needs a lot of improvement, I want it to move a lot smoother. For this I’ll need to move the servos in little steps. Writing that code for 18 servos is not so easy, certainly as I refuse to use the delay function. That’s to easy 🙂
I had a bit of trouble finding out how much I could move the legs and keep the hexapod stable. In the beginning I was moving the legs to far for/backward and that caused the hexapod to fall on it’s ass :p Takes quite a bit of time figuring everything out…
Future plans:
Replace all the servo horns with metal horns (are on the way from China)
Replace the original base plates with self designed laser cut acryl plates, the chassis I use now is to small, I’ll make it a little bigger so I can fit my Lipo and UBECs inside the chassis
Replace current servo PCB with new version (is on the way from China)
Replace Arduino Mega2560 with a Seeeduino Mega2560 (Seeeduino version is smaller)
Write some fancier code so the hexapod moves a lot smoother and I can control the speed of the servos (this will be very hard)
Fit a second micro controller with a nRF24L01 module so I can remote control it.
Add a shit load of LEDs and let it dance, Gangnam style 😀
About a month ago I was browsing Dangerous prototypes and read about this cheap GPS hack. Emeryth had found out that the cheapest GPS modules on Ebay could be used with a micro controller. The Ublox PCI-5S modules can be found on Ebay for less then 10$. Add an antenna for about 5$ and you have a very cheap usable GPS system. There is one catch, the GPS module comes in the form of a mini PCIe card. But Emeryth had found out how to connect it to a micro controller.
I couldn’t resist and ordered the GPS module and antenna on Ebay. I soldered some wires to the module and hooked it up to an ATmega328 running at 3.3V / 8MHz. I installed the Arduino tinygps library and uploaded one of the example sketches to the ATmega. I put my laptop, micro controller and GPS module outside and after about 10 minutes it started spitting out data. I checked the longitude and latitude on Google earth and was pointed to my garden, success 🙂
I have no direct plans with the GPS module. But maybe I built some sort of logging device for my car.