This is a ball balancing test rig for experimenting with PID tuning. PID is a control loop feedback system. A Ping Pong ball is balanced on an aluminum angle. The angle is tipped side to side supported by a pivot. A hobby servo is used to move the angle. The caps on the angle have mounting holes for a Adafruit VL53L0X breakout board (laser distance sensor). Included in the files are the pivot, end caps, and servo base.
The pivot supports a 1", 1/8" thick aluminum angle. My angle is approximately 500mm in length. This length is the maximum reliable range for the VL53L0X using a white ping pong ball target.
Also included are the Fusion 360, and Step design files if you wish to make modifications.
See my instructable project here: https://www.instructables.com/id/Ball-Balancer-and-PID-Fiddler/
Saddle was printed on end, the other parts were printed with the largest flat side down. Two sensor brackets were printed for both ends of the angle, one to hold the sensor, the other to keep the ball from falling off.
Attached the support to the base. This fit snug for me and required no modification or glue.
The saddle pivots on two screws. The support holes were drilled slightly larger for the screws to freely pivot.
The sensor brackets fit snug on the 1/8 thick angle. The sensor is attached with two mounting screws with nuts. The mounting holes are slotted to align with the center of a ping pong ball when mounted to the top of the slots. When mounted to the bottom of the slots, the sensor is aligned to the center of a foose ball. The square slot is aligned with the sensor pins for wiring to the sensor.
A hobby servo is mounted to the servo base, and is free standing. I connected the servo to the sensor bracket with a stiff wire. I drilled a small screw hole for attaching the wire around the screw.
Tips: Paint the inside of the angle with flat black paint to reduce reflection of the VL53L0X laser. This gave me more accurate distance readings. The laser is not a narrow beam, its more like a beam from a flashlight. The light is not visible to the eye, but can be seen using a camera (smart phone) as a monitor.
Place the pivot off center of the aluminum angle so slight force is always down on your servo. This keeps your servo from bouncing up when pulling the angle down.