Ball and Beam Balance
For a course in mechanical design, I designed a ball and beam balance system using a servo motor, an ultrasonic sensor, and an Arduino Uno to control the system.


The position where the ball was supposed to stop along the beam was set by turning a potentiometer within the circuit. This was mapped to a distance along the beam, where the highest resistance was the farthest point that the ball could be on the beam and the lowest value of resistance was the closest distance. The distance was read by an ultrasonic sensor, and this value was used in the PID controller that I made to have the ball stop at the desired point along the beam. Most of the system parts were created by laser cutting 14-inch thick wood. The vertical wooden pieces were attached to the base plate by drilling holes in the plates and putting brackets there. Bolts were used to connect the brackets to the wood and to connect the two pieces that made up the beam to the vertical pieces. The bolts for the bracket were not countersunk, so I propped up the system with four wooden blocks to make it level. The pieces attached to the servo motor and beam were printed with a 3D printer. The model I made was originally going to have a ping pong ball stop at a distance set from the potentiometer. However, my ultrasonic sensor was not reading the ping pong ball very well, so I 3D printed a cylinder to enable the ultrasonic sensor to provide more reliable readings. The cardboard track attached to the beam is so that the larger cylinder does not fall off of the track.
