A YouTuber I follow made one of these, and I thought it could be a cool desk toy to have, though I wanted to try to get it to work with a different microcontroller. I got the STLs from this page. Basic principle involves reading the position of a ball on a resistive touch panel and using PID to control stepper motors to angle the ball back to the center.
The instructables specifies a Teensy 4.1 microcontroller for this project. I wanted to use the Portenta H7 instead which I had on hand, and is a much more powerful microcontroller
Teensy 4.1
Portenta H7
As a result, the pinout was completely different but after careful diagramming, I was able to wire everything correctly.
Top view of perfboard with headers
Bottom view of perfboard
Complete electronics, made modifications for fan
Here's the video of the system working. Though the video doesn't show it, the balancer was able to "catch" balls that were lightly tossed onto the platform, and also move the ball around in geometric patterns.
Problem: Default Arduino libraries for the Teensy did not work with the Portenta H7
Solution: Had to manually modify certain functions to get accurate position readings from the resistive touch panel and then send correct signals to the stepper motors.
Problem: Platform would toss the ball straight off even though it was level with no ball
Solution: The input for one of the axes was swapped compared to the data sheet. This took a lot of debugging to figure out even though the solution was simple.
Problem: One motor would just stop functioning after 30-45 seconds of balancing
Solution: This turned out to be a heat management/current problem. I had to set the limits on the stepper motor drivers correctly (which ended up shorting one of them) and also drill holes and wire up an external fan to keep the stepper drivers cool. This extended the balancing life but never completely fixed the issue.