PID Ping-Pong Ball Levitation
Build and/or program a Proportional Integral Differential (PID) controller to maintain the height of a ping-pong ball in a clear plastic tube. We've had reasonably good success with this using an optical rangefinder as the control signal, and a variable-speed PWM-controlled fan as the output signal.The apparatus was built by Eric Ayars, using a heavily-modified idea from John Gastineau at Vernier. It has been tested and works reliably, with some caveats.
- 1) the optical sensor does not work over the entire tube length. Limit the travel of the ball to a region in the center of the tube for best results.
- 2) It's been tested with LabVIEW's PID controller vi, as of October 2016. In previous years it was made to work with an Arduino and a sonar sensor; haven't tried it with this optical sensor and Arduino yet but that should work also.
Connections:
- Motor: Black: Ground, Yellow: 12V, Red: 5V pwm, Blue: NC
- Sensor: Black: Ground, Red: 5V, Yellow: analog signal (higher when closer)
Reading
- More than you ever want to know about this topic, by John Bechhoefer
Location
Room 108, to left of door
Additional equipment needed
- 12V 1A power supply.
- ELVIS II board, if using LabVIEW for control.
- Arduino or other microcontroller, if using microcontroller PID control.
- 5V PWM signal (from either ELVIS II or microcontroller)
Cautions
- Do not attempt to swallow the ping-pong ball.