Hi freaks,
I completed the new board for my balancing robot, wrote some quick software, assembled the stuff and there's something to show. I made a little video.
Larger version (32Mb) is here:
http://www.sensi.org/~svo/rakipaki/akipaki-rev2.mpg
Smaller (5mb) but poor quality here:
http://www.sensi.org/~svo/rakipaki/akipaki-rev2.wmv
Let me explain the construction.
The chassis is based on a cover of 3.5" floppy drive. Two fully lobotomized RC servos (HS-311) are mounted on sides. The wheels are cut from remains of floor cork boards, wrapped with duct tape for better friction.
There are two boards (the gallery on site shows older construction). One is motor logic, h-bridges and voltage regulator for logic circuit. Motor logic accepts PWM stream + direction for 2 motors and drives h-bridges.
Another is the main board with ATmega32 running at 10MHz, some complementary stuff and a daughterboard with MMA6260Q dual-axis accelerometer. This a-meter gives 2 voltages proportional to g (when mounted vertically) that are measured by ATmega builtin ADC. Three pots also allow input of PID coefficients for tuning. There's also an i2c LCD display that can show some debug information, like the actual values of coefficients and important startup message saying "AKIPAKI".
So far it doesn't carry its own batteries. I'm not sure that these motors can generate enough torque to balance bigger mass between them. The first version of Akipaki actually could carry its batteries, but it could not stand very well too. First version used only half-lobotomized servos (only feedback broken, control circuitry intact) and pic16f876 as the main controller. I burned the PIC and I'm now happy.
The robot shows some juggling in the beginning of video. I tuned the D part of PID down a notch, the juggling disappeared. But in general it seems that the construction is very very sensitive to P and D terms, lesser to the I-term. A little less P, and it can't stand up. A little more P and it goes haywire, no D can stabilize it. BTW, the loop runs at 500Hz. I couldn't make it stable enough with slower frequency and I feel I could make it even better if I could make the loop run faster.
How would you fix this beast if it was yours?
Where would you put batteries? I'm going to use two 4-AA battery holders.
Or just anything you think of when seeing this, any comments are welcome.