From Segways and hoverboards, to all the maker contraptions that are somehow able to balance on two wheels, you know it’s possible for a robot to hold something up in an “inverted pendulum.” Actually automating such a task requires a careful amount of input to the wheels that’s not too weak, nor too strong.
The answer to this controls problem, as implemented in this balance bot, comes in the form of a PID — or proportional, integral, derivative scheme. These three inputs take into account the distance away from optimum (P), error accumulation over time (I), and how fast the error is changing (D) to apply just enough force through balancing motors to keep a robot upright, without having it oscillate around and eventually fail in a hilarious / catastrophic manner. The build write-up goes into how PID works in some detail, and would be a great introduction to this concept to the uninitiated.
The robot build itself looks fairly approachable, consisting of three levels on which to mount hardware. A BNO055 IMU feeds information into an Arduino Uno, which responds to the motors via an L298N driver board in a continuous loop to keep the two-wheeled bot upright.
Where things get even more interesting, however, is the plastic control chamber located at the bottom. As seen in the video below, the robotic vehicle is actually steered by an insect inside using a pair of ultrasonic sensors that determine its position and dictate the direction the bot travels. Power is currently supplied through a tether, and this, as well as wireless manual operation, is on the list of things that could be explored further.