Selfbalancing robot (Arduino)


In the video you can see that the robot stays at roughly the same spot on the floor and handles a lighter push without any problem. To achieve this I have two cascade PID controllers and low pass filter on both wheel speed and the robot's angle.

Source code, component list and more info

[Update 2012-07-27]

I programmed a simple moving average filter. This will remove the rapid changes and make the robot calmer and with less overshoots. It also handles pushes much better than before. Video here.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Looking at the video you seem to have a lot of flex in the frame that is making it difficult for the robot to balance. If you can make your frame more ridgid with some diagonal cross members then it should improve the performance greatly.

Moving your batteries higher up will also reduce the inertia the motors need to overcome when changing speed / direction. With balancing robots, the more top heavy they are, the better they balance.

I think the video makes it seem there is more flex than it actually is but I am thinking about adding another plate between the top plate and the middle. That would probably make it more rigid.

You are right. Moving the battery up is probably a good idea. And if I add one more plate it would be an easy change.

Nice work, Sebastian. The code is understandable and makes a good starting point for an equal self-balancing robot using an Arduino. Collected!

Thank you for bringing the built-in EEPROM back into my mind. Forgot about it... but is useful.

I also like this project of you. Keep up the good work.

And welcome to LMR.

Thank you! :)