Raspberry Pi PID Loop
Standard ping-pong balls have 40mm diameter. Acrylic tubes come in all sizes, but there is a standard 45mm OD tube, with 2mm walls, which leaves 41mm ID (Inside Diameter). Just enough for a ball to travel inside. So we took the challenge of floating the ball at constant height, using a 12V computer fan and an adjustable power supply.
Easier said than done. Even with a fine adjustable power supply, the ball either stays down, or shoots all the way up the tube.
We replaced the human eye with an ultrasonic distance sensor, and the human hand with a Raspberry Pi, added by an Industrial Automation Card. (this experiment is using the first version of the Industrial Automation Card)
Let’s see if a Raspberry Pi PID Controller can do the job.
For the high level interface we used CODESYS, with the available drivers for the MegaIO-Industrial Card. To show the difference, we implemented both a manual and automated control in the CODESYS interface.
Here is the setup, including the CODESYS interface:
Watch the the experiment here:
or, in abbreviated version, here: