The cart-pole or inverted pendulum a classic problem in control theory and reinforcement learning; a pendulum attached to a motor driven cart needs to be swung up and balanced upright. I'd seen this problem in various contexts and in some of my classes, and thought it'd be cool to make a physical version to play with. This was one of those projects that seems super doable on paper or in simulation but was a headache to implement in the real world. I had to deal with tons of issues: a microcontroller running too slow, its replacement that ran too fast to talk to the motor driver, too small of a track and too slow of a motor... In the end I got the whole system working and it's pretty dang cool to watch.
This project was especially interesting because I got to use all kinds of theory I learned while getting my MS. I had to use Lagrangian mechanics to derive the dynamics of the system, linear control theory to build the balancing controller and optimization theory for swingup trajectory optimization. Having tools like sequential convex programming or model predictive control up your sleeve gives you a ton of options for solving problems like this. I really enjoyed tackling this problem from a bunch of different perspectives.