I think I have finally solved all the bugs in my hexapod code, well at least the walking gait part of the code. The servos now move in 15 steps from one position to the other. The time between these steps determines how fast the hexapod walks. I can change the speed with my remote control. Every walking gait is divided in 4 parts. During each part the servos are moved in 15 steps. I use the millis timer to keep track of the time. My biggest problem was coding the value that the legs should move. While this is a simple subtract function it was very difficult to calculate it at the right moment and making sure that this value didn’t change when I didn’t want it. It sounds very simple but I have absolutely no coding background and it took me hours to figure out. Since all the code is based on one timer (millis) you can’t have any blocking functions. I found out that the RF24 library sometimes caused a hick up in my code. This resulted in the legs going crazy. After that was solved I can finally say that the basic walking gaits are finished.
There are still some other functions that I want to implement. So the coding is far from finished.
As you can see in the video I have removed the bottom plate of the chassis. I removed it so I could measure it. Then I started designing a new chassis in Autocad. This is the latest version:
It consists of 3 plates, I’ll have them laser cut from acrylic. The design is far from finished. The bottom plate will hold the 3S Lipo, the power servo PCB and the UBECs. The middle plate will hold the electronics. I will use a Seeeduino Mega to control the servos and probably another micro controller for the rest. The design has mounting holes for all my Bajduino PCB’s. I haven’t decided which one I will fit.
My first plan to power the hexapod was to use 2 UBECs. So I had designed a PCB where I could power 18 servos with 2 separate power supplies. Unfortunately the UBECs were not strong enough for my power hungry MG996R servos. So I had to resort to using 3 8A UBECs. I designed a new PCB so I could easily connect the 3 UBECs to the servos and micro controller. This is it:
The 3 8A UBECs are connected to the servo PCB. 18 wires with Dupont connectors connect the Seeeduino Mega with the servo power PCB. I chose the Seeeduino Mega as it is a lot smaller then the standard Arduino Mega. It’s about the same size as an Arduino Uno.
I have also received my metal servo horns. So I will fit these when I have the new chassis made.