About the battery, is doesn't work that way, becouse the robot is an inversed pendulum and so it actually works better when the weight is high rather than down (it increase intertial and give more reaction time).

The LCD i'm using is the Picaxe LCD display, this one, datasheet here. Basically it's a standard lcd with an additional board attached. It can work serially or with I2C. As my robot was almost only I2C, i used that mode. The library is very simple, it just sends the correct i2c messages with a syntax similar to the Serial.println method.

I have build a balancing robot based on Sparkfun 5DOF acc/gyro combo, Arduino and Parallax continuous servo.I had sofar mixed results and suspect the servos have to much backslash

I want to test the AX12 route. Can you point me to some Arduino code to run these specific servos

TIAYves

-------------------------------------------------------------------------------The "looseness" you describe is a real problem with balancers. I used motors similar to yours at first, but was able to achieve much tighter and more responsive balancing by switching to zero-backlash servos (Dynamixel AX-12).

Here's a little sample movie of what a difference reduced backlash makes: ....

That demo is using the "encoder" (continuous rotation pot) integrated into the AX-12.

A friend of mine worked on a commercial balancing toy. He mentioned that it used cheap high-backlash motors, and they had to use sophisticated filtering and modeling to accommodate the backlash. It took an experienced control expert quite a while to get it working.

Well first off i did a quick test of the hardware, making a simple arduino program to read some raw values from the IMU, just to check that it was working properly.

Then i studied/implemented/adapted the Kalman filter to obtain the correct angle, which was the thing that was scaring me off the most (it would be a waste to have a complete robot and then be unable to read the value ). I proceeded by strapping the Arduino and the Imu on a wood stick. Then i did a simple pc program (with Delphi, but you can use whatever ) that reads the angle data from the serial line, and show a simple line that is (should be) oriented as the robot. That gave the best "feeling" of how precise the measuring was. At that point i spent quite some time debuggin the filter to obtain a stable and responsitive reading, mostly a work of trial and error that is unluckly very coupled with the specific hardware and setup (read: you have to adjust your own parameters )After i was satisfied with it, i designed the robot (well most of it was already on my mind), i used pen and paper and rulers and also did some 3d sketches with blender. Then went on building it. I can say: keep the design as simple as you can, becouse then just the slightest error drilling a hole or gluing something can make everything displaced and ultimately a great pain

Then i did some test, simply running the motors proportionally to the current angle. At the time i didn't know what a PID controller was That gave some results but of course it wasn't stable at all. I learned the PID controller and implemented it (which is easy) and tuned it (which is hard, as you probably already know ). The best thing you can do is to find some generic values to determine the order of magnitude and then attach three potentiometers to dinamically change the P,I and D parameters while the robot is running. Wikipedia has a good practical article on the PID that explained a couple of tecniques to find the parameters.At the end the results was the one on the videos: the robot can actually stand without fall for indefinite time, but it's not completely stable and swings back and forth quite a lot.That's possibly a combination of bad hardware, bad robot structure, and me not being an engineer

Btw i'm now planning a second version with different hardware, i'll post on this forum as soon as i've something

That was it, feel free to ask any question. The complete source is avaiable on this thread.

great if you are planning on hardware, i'll suggest making it smaller than mine. It was too heavy and the structure was barely strong enought not to break apart when falling. In my new version i'm keeping the Arduino and the IMU, and using instead a simple motor driver (an L293something), two small pololu motors and 4 AA cells.

Thank you for information! Actually I'm late for using this information, as I've already purchased the hardware.

By the way, why didn't you use a driving system based on incremental quadrature encoders? Well they have their own specially adapted Kalman filter, and I think that (at least theoretically) using them together with their KF, gives a cheaper/better/lighter/more sophisticated driving system. May be you have already tested them?

Hi my friend, this is really great, congratulations . I found in an other forum than you "burn" the MD23. I am worried, because I followed your steps and I do not want to burn my md23, do you found what was the problem?, thanks a lot.

Thanks Yes i did burnt an MD23. That was a very sad experience, my first "expensive" hardware lost.Anyway, i did it just connecting the MD23 to an unregulated power supply. Yes that's a stupid mistake, but i'm learning electronics on the go, and i was not aware.. basically the power supply shoot 15V or more to the board and a chip released its magic smoke.

If you're unaware of the issue (but you probably are ), i suggest learning it the soft way reading this:http://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=103

ironbot: uhm no, i didn't used the encoders.. I can't see how to take advantage of them. how would you use them ?