Finding the right approach angle a Raspberry Pi the project can be difficult. And yet, manufacturer and developer Parisiancyclist, as it is known in Reddit, has found a happy balance with this mesmerizing ball on a draft plate (opens in a new section). With the Raspberry Pi, it automatically tilts the plate if necessary to prevent the ball from falling over the edge.
According to Parisiancyclist, the project took about a week and a half to develop from scratch. He not only developed the physical device for tilting the plate, but also coded the project to use AI to estimate the location of the ball and determine how much to tilt the plate so that it does not fall.
A quick look at the profile of Parisiancyclist shows little in the ways of microelectronics projects beyond this development of ball on plate. As the name of his profile suggests, he has experience with things that spin, as he often shares content related to cycling. However, this Pi-based project proved to be an impressive first foray into the world of AI and microelectronics.
Fortunately, Parisiancyclist was kind enough to share many juicy details about the design of the project, including the hardware used to drive the slab. Three servomotors with three PID controllers are used to move the plate to the appropriate angle. In addition, the Raspberry Pi camera module works to monitor the board and helps track the ball in real time.
The main tool used by the software is OpenCV. It helps to decide what to set the angles of the servo, using the X and Y coordinates of the ball and where it is next to the edge of the plate. Parisiancyclist configures the angle using PWM often between 85 and 175 degrees, although you can adjust the servos anywhere between 0 and 180.
If you want to recreate this Raspberry Pi projectit is best to study the original thread shared in Reddit (opens in a new section) to get a better idea of how it all goes together. There you will also find a demonstration video of the project in action. Be sure to follow Parisiancyclist for future projects and updates for this one as it is still in the works.
https://www.tomshardware.com/news/raspberry-pi-ball-on-a-plate