Hexapod walking algorithm
October 21, 2009
October 21, 2009
Hi everyone, I am working on a hexapod, so far I have constructed one leg and now I am working on the programming. Because first I want to make sure that the programming will succeed and for that I need to solve some problems.
But first some info about the hardware, I am using multiple PIC microcontrollers with JAL as programming language. One PIC will be the “High-level” PIC which will send commands like: “move feet A to cords(X,Y,Z)”. The other PIC will receive that command and act accordingly by sending the signals to 9 servos. So for all the legs the High-Level PIC will send data to two other PICs. (The reason that I have two servo PICs is because a servo needs a signal of length 1 to 2 ms every 20 ms . So 9 * 2 = 18 ms, which gives me 2 ms of extra functions like receiving data.)
The robot will eventually have 18 servos (3 for each leg). The first goal is to have a platform that can walk, other functions like Sensors, etc. will come at a later stage.
I have two problems I can’t solve; 1) How can I send a message from the first PIC to the other without interfering with the 20ms interval of the PICs? Because when the low PIC is looking for an incoming message it will pause until it receives a message. This will interfere with the 20 ms servo interval.(I hope someone knows JAL or has a solution that applies to most languages)
I was thinking about a shared Eeprom where the High level PIC writes the data and the two low level PICs read the data. But this method probably has a lot of flaws.
2) I have programmed the Inverse kinematics part for the Servos, so when I give a coordinate the program will calculate which angels the servos must have.But I now need to make a piece of code which has makes a trajectory from the old cords to the new cords while sending the cords in between to the low level PICs. So I can slow the servo down at the new cords. Else the servos will shoot to the new angle. I have no idea how to make this part of the code..
I hope anyone has some tips or ideas to point me in the right direction.