Balancing code v2.0 has been developed and tested successfully! :)
Main differences between previous standing and this version:
- balancing in standing phase (in previous post) was a fake mode because the gyro provided rotation values were used directly: added to standing leg degree parameter and set as shoulder servo angle
- this version uses gyro data as just one of the inputs of walking calculations. A primitive model of robot body is rotated in 3D around X and Z axis to simulate rotated body orientation. All calculations are done by Arduino in real-time. Knowing the rotated coordinates of all key points of the model leg by leg v2.0 walking code can make the necessary amendments on body height level. Based on actual leg body height and step phase the real servo angles can be calculated. So there no direct connection between the gyro provided data and the final servo position. The bonus of this code version is that the shoulder servos are not even used and can provide more degree of freedom later when I need to change mass center for complex balancing scenarios…
Let’s see the video where we should see almost the same as in the case of standing/balancing except that this is done by the walking code. Actually Little Johnny is not walking because the speed was set to zero :)
First sensor mounted on Little Johnny: a simple gyro which is used to estimate orientation and increase stability this time only for standing. Doing the same in walking phase is the real fun but requires 5-10 times more coding…
Finally the driver is ok and v2.0 walking code can be used in Little Johnny. Only few modifications were required: proper upper and lower leg size setup, smaller body height and small change of usable range of degrees.
Few pictures about the servo bus building:
Breadboard was used to hold the 3 line pin header while I soldered everything :)
Maybe it is just my paranoid schizophrenia but I always want to measure the result before use. I found only one problematic leg but that could have caused more fun in production later. Sometimes I check the resistors value in both directions. Who knows if electrons can go through the wire the same way they come?The real test if Arduino can control all the servos:
Used Arduino code (just raw position control):
This is little Johnny: totally offline it is able to stand and wears an Arduino on its back. The question is simple: how the 12 servos can be connected to the Arduino and to the power source without using cable jungle?
A possible solution can be to use a 3 row pin header as power and control sign bus:
Only the common ground and 5V line need to be soldered with the help of prototype PCB. 3rd line will be used to provide PWM by servo (the only complicated part where additional wire and one line 90 degree pin header is required). The result could be a 100% servo terminal compatible connector.
Very cheap headers: http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=31589
Last time we used simple toy rubber balls for leg protection but this time my brother wanted to have professional solution using very high quality 2 component Polyurethane Casting Resin. This requires a mold so a brand new mold was designed and manufactured.
In my opinion the technology is much more interesting than the result itself. These are amazing photos and I think the last one really looks like an alien hatching device :)