@chunibuni Here you can find small tutorial: http://transistor-man.com/flying_nimbus.html Some theory: https://en.wikipedia.org/wiki/Inverted_pendulum Some more: http://ctms.engin.umich.edu/CTMS/index.php?example=InvertedPendulum&section=SystemModeling Motor is located in wheel. OW is using gyros and accelerometers and probably Kalman filters and PID controller. Have fun building your own version! :)