# BALL BALANCING WHEEL PUTS A SPIN ON INVERTED PENDULUMS

If you march sufficiently deep into the wilderness of control theory, you’ll no doubt encounter the inverted pendulum problem. These balancing acts have emerged with a number of variants over the years, but just because it’s been done before doesn’t mean there’s no space for something new. Here, [David Gonzalez], has taken this classic problem and given it an original own spin–literally–where the balancing act is now a ball balanced precariously upon a spinning wheel. (Video, embedded below.) Mix in a little computer vision for sensing, a dash of brushless motor control, a bit of math, and you have yourself a closed-loop system that’s bound to turn a few heads.

[David’s] implementation is a healthy mix of classic control theory with some modern electronics. From the theory bucket, there’s a state-space controller to drive both the angle and angular velocity of the ball to zero. The “state” is a combination of four terms: the ball angle, the ball’s angular velocity, the wheel angle, and the wheel’s angular velocity. [David] weights each of these terms and sums them together to create an input value to adjust the motor velocity driving the wheel and balance the ball.

From the electronics bin, [David] opted for an ESP32 running Arduino, the custom Janus Brushless Motor Controller running SimpleFOC, and a Maix Bit Microcontroller with an added camera running MicroPython to compute the ball angle. Finally, if you’re curious to dig into the source code, [David] has kindly posted the firmware on Github.

We love seeing folks mix a bit of control theory into an amalgamation of familiar electronics. And as both precision sensors and motor controllers continue to improve, we’re excited to see how the landscape of projects changes yet again. Hungry for more folks closing the loop on unstable systems? Look no further than [UFactory’s] ball balancing robot and [Gear Down for What’s] two wheeled speedster.

Scroll to Top
Scroll to Top