There are a lot of Balancing Robots out there with examples and tutorials, but they are often not easy to understand, or are based on a library. The source code is full of math and not good structured.
I’ve tried to build a simple but very stable balancer without any libraries, that you can understand easily. Components I’ve used:
- Arduino UNO
- Arduino Motor Shield
- MPU 6050
- 2 Lego NXT Mindstorms Motors
- 11,1V Lipo Battery (3s)
I’ve written the whole code in less than 400 lines of code.