The tinniest Arduino quadruped robot.
I get a lot of questions about how long can those tiny robots go on a single battery charge. And I never know what to say, because it depends on what they are doing and the calculations are difficult. So I decided to try and see.
I've set the pure-arduino one, with 180mAh battery, to walk around the table leg in circles at full speed (which is actually pretty slow, with its tiny short legs), and waited until the battery overcharge protection kicked it.
Took exactly 20 minutes -- which is what I gave as a guesstimate to the people before.
I also noticed one nice thing in the process. The robot kept on walking around that table leg, and repeated the same circle for those 20 minutes, without spiraling away in any direction, as I expected it to. This means that whatever inaccuracies it has in its measurements, leg inverse kinematics calculations and mechanical skewing of legs, they are all relatively constant and repeatable. That bodes well for implementing navigation for it.
Now I need to make a similar test with the VoCore version, with video streaming running. The VoCore can suck up to 300mA, but that one has a 350mAh battery, so maybe the time will be similar...
UPDATE: 21 minutes with low-resolution streaming, walking in circles.
So, it seems to be a good decision to use the working gait code from Arduino, and just send high-level commands over the serial to it. At least it gave me a working robot.
Below you can see it exploring my room with its webcam. It's a little dark under the table, and my screen's refresh rate interferes with the camera, but it feels almost like Doom.
I finally got to rebuilding the VoCore version of pKubik using the new printed circuit board. On the photo, starting from the top, you can see:
I also compiled a new OpenWRT image for it, and made sure everything works as it did before. So now I am where I was a week ago, except with a sturdier and more modular construction.
I also have the gait implementation I wrote for the Arduino-only version, and I'm tempted to drop the Micropython version. Instead just accept commands for the Arduino-controlled gait on the serial, and echo those through ssh from the VoCore.
Oh, I also finally found a good source of rubber for the feet. Old-school bicycle valves used pieces of a small rubber hose. You can still buy them in bike shops today, and they make excellent feet for the robots.
So I worked a little bit on the gait of the minimal version, and also added a piezo buzzer and some sounds (after a while I made it start up muted, the sounds need to be explicitly enabled with the remote, as they are quite annoying). You can also turn while walking and rotate in place, adjust the height of the robot and the spread of its legs, etc.
So here's the minimal version of the robot -- only the servos, an Arduino and an IR sensor for control with a TV remote. The gait still needs a little bit of tweaking (and I didn't adjust the trims on the servos), but it still walks pretty well. I also need to add rotation.
This can be used as is, bascially a remote-controlled toy, or you can attach various things to the Arduino (both the serial and the I²C pins are free) to control it in a little bit more intelligent way (like the VoCore + webcam version that I started with). In particular, I'm looking forward to getting that OpenMV board to put it on this thing.
The progress on this guy has been kind of slow, and mostly in software. The current status is that I have the video streaming from camera to the web browser working, and I resolved the issue with noise on the serial line that made it impossible for the robot to walk properly (it turned out to be some kernel logs still being output to the serial). There still seems to be some problem either with the leg inverse kinematics, or the walking algorithm, as the legs move a little strange -- this requires further investigation.
As for the twin brother, I'm trying to program it entirely in Arduino, so that it's the cheapest quadruped robot around. If that works, I will add a basic "laser tag" gun to it and try to talk some friends into making their own version, so that we can have a cheap version of the Mech Warfare battles. It will probably be a separate project, though.
And here it is, an assembled robot, using once of the PCBs. This one only has the Arduino and an IR receiver, no VoCore. I will make a simple remote controlled toy out of it. The vertical board is a battery charger.
The PCBs that I ordered from Dirty PCBs just arrived, and they are beautiful! I got 11 of them, and I'm going to try one right away.
The whole robot building thing is supposed to be a learning experience. So after fumbling with the wires and prototype boards for a while, I decided it's time to try and design an printed circuit board for the robot. The advantage, apart from much better handling the tiny 1.27mm spacing, would be that it could also double as a base for the robot.
After trying my skills with a number of available PCB-designing software (Egale and KiCad, among others), I finally decided to use... Fritzing. Maybe it's not as advanced as the others, but at least has user interface from this millennium, and can generate Gerber files without too much hassle. It's also the only one where I found how to place elements on the board and connect them first, and then create the schematic -- which is much better if I have a choice for using multiple pins for the same thing, and can choose the closest one. It also already came with an Arduino Pro Mini footprint.
The board is pretty simple, it's just has a place to put your Arduino in, and sockets for the servos. There is also room for a big capacitor, a power switch, a battery voltage monitoring circuit, and an optional IR receiver. It can then use just the Arduino for some simple behaviors, or have something smarter (like the VoCore) connected through the UART or I²C.
Finally, I got the streaming from camera to work! Look:
The video is rotated by 90° and quite slow, but that's details that I can handle. The trick was to use an older version of mjpeg-streamer that doesn't segfault in YUV mode.
I also worked on the physical body of the robot a little bit. Instead of a transparent piece of plastic with everything glued to it, I now have a prototype board with a bunch of sockets and all the wires connecting them. The VoCore, Arduino, camera and battery just plug into that. And the PCB is exactly the right size to serve as a lid for a transparent plastic box. I just have to shave a couple of mm off the top of the camera module...
Solder all the electronic components, except for the capacitor, onto the printed circuit board. Make sure to make the right connections: the servo plugs should go with the yellow wire towards inside, and the brown towards outside, and the IR sensor may have a completely different order of legs than on the board, you might need to bend the wires a little to get them in the right order.
Set all the servos to the zero position (in the middle of their movement range). Then attach the single-arm horn at 90°. You will need six servos with the horn in one direction, and six servos with the opposite. Fasten the horns with the smallest screws (make sure you un-power the servo before you do that).
Put the legs together. You will need two right legs, and two left ones, that are their mirror images. Use the bigger screws to screw the servo arms together. Use glue to attach the double-armed horn and to bind the two servos.