Hovering a ping-pong ball: A demonstration setup for teaching PID control

29 April 2025, Version 1
This content is a preprint and has not undergone peer review at the time of posting.

Abstract

Proportional-Integral-Derivative (PID) controllers are essential in ensuring the stability and efficiency of numerous scientific, industrial and medical processes. However, teaching the principles of PID control can be challenging, especially when the introduction focusses on the underlying mathematical framework. To address this, we developed the PingPongPID - a visually engaging and interactive demonstration instrument designed to make the concepts of PID control more accessible to students. The PingPongPID features a colored ping-pong ball suspended within a transparent plastic tube by a fan whose voltage is controlled by a microcontroller running a PID algorithm. The ball’s height is measured in real-time by a laser distance sensor and the system continuously adjusts the fan voltage to maintain a set target height. The PingPongPID also connects to a computer allowing real-time data logging and visualization through a custom-built Python graphical user interface (GUI). The process of obtaining the three PID gain constants using both the trial-and-error and Ziegler-Nichols methods can be illustrated very nicely with the PingPongPID. In summary, the PingPongPID serves as a powerful educational tool allowing students to explore both the conceptual and practical aspects of PID control before delving into its mathematical foundations. We provide a complete assembly and user guide for the PingPongPID as well as the codes for the microcontroller and the Python GUI.

Keywords

PID control
demonstration setup
control systems
Ziegler-Nichols method
microcontrollers

Supplementary materials

Title
Description
Actions
Title
Assembly & user guide for the PingPongPID instrument
Description
Complete assembly and user guide for the PingPongPID including the codes for the microcontroller and the Python graphical user interface.
Actions

Comments

Comments are not moderated before they are posted, but they can be removed by the site moderators if they are found to be in contravention of our Commenting Policy [opens in a new tab] - please read this policy before you post. Comments should be used for scholarly discussion of the content in question. You can find more information about how to use the commenting feature here [opens in a new tab] .
This site is protected by reCAPTCHA and the Google Privacy Policy [opens in a new tab] and Terms of Service [opens in a new tab] apply.