Using n20 motors instead of Nema 17 stepper motors was a major challenge as I couldn't get it to balance for more than 5 seconds no matter how much I tuned the pid in the beginning of this project. (It would balance for 5 secs and then drift continuously and fall)
Originally I had the battery(7.4V lipo) on top and later moved it to the bottom of the robot (hence the empty space on top).
After some minor changes to the code and the battery position it now balances a lot longer.(I mean a lot ;)
submitted by