This is w00dBoB, my attempt at creating a BoB the Biped. I was so impressed with all the printed BoBs on LMR, I felt an irresistable urge to add yet another member to the ever growing army of our small cuboid friends :)
Since I don’t have access to a 3D printer I decided to craft my tiny friend from balsa wood: great strength to weight ratio, easy to process and (personal opinion) a lovely natural appearance. However, I was not too confident with getting the leg-angles glued strong enough together to hold the head, so I ordered those from a remote printing service, them turning out to be the most expensive part of the entire rig.
I started out creating a box as the head, a lid for tops and an undercarriage containing the four servos.
I glued two transversal bars to both the head lid and the bottom to clamp the head box.
Since I held on to the dimensions in the STL files I was facing quit a challenge fitting the wiring, the HC-SR04 and the nano board inside the head box. I dared not to bother with the power supply at that time J
"Are those my brains, doctor?". "They are after I've flashed your mind onto them."
A tethered test run proved the legs were mounted too close together and the feet were too small. It kept toppling over and would just flip the feet instead off tilting itself. So I had its thigh gap widened and put on some funny flappy feet.
I decided to mount the nano board on the back and to fit the batteries inside the head box to keep the center of gravity within the confines of the feet. The blurry black thing on the upper right is an on/off switch.
Top view showing the batteries fitted inside and the board outside on the back. I cut up a USB plug and connected the 5V and GND leads to the battery pack. Plugged into the nano board it delivers a nice and flat 4.8V (using rechargeable cells) to the board and the servos.
The wiring is as straightforward as it can get I suppose. It might be worth noting the Vcc line from the battery pack to the servos: feeding the servos from the nano board was not a good idea; the servos would behave in a rather spastic manner more often than not.
After I was confident with the balance it was time to clip its toenails.
I used bajdi’s code for the walking gait (with some very minor tweaking to account for cheap servo irregularities) and put up a bit off code to implement a pet-like behaviour: it wanders around a bit avoiding obstacles, goes to rest, wakes up, wanders some more, goes to sleep again ad infinitum until the batteries run out. Cute enough to really entertain my family J.
Finally, I fitted an LED on top. It blinks a single blink any time w00dBob changes direction and starts blinking continuously when the power supply drops below 4.4 volts, telling me the batteries are about to kick the bucket.
The next thing I want to do is to make w00dBob scan forward terrain for heights so he can steer clear of cliffs, abysses and ends-of-table-tops. I guess this should be doable without any extra sensors or other hardware and all in software; some clever timing while reading the sonar should do the trick. After all, w00dBob is looking quite downwardish when either both left or both right servos are at their respective max/min angles. A reading at that exact moment of more than 20 cm or such should be a clear indication of a nearing end-of-surface, telling w00dBob it is time to change direction. Any comments on this are really welcome!
Attached the source code. For some reason it won't let me upload .ino files so I zipped the entire folder.