Overview
This project implements a PID control system to levitate a ping pong ball within a vertical tube. By regulating the airflow from a DC blower fan based on real-time position feedback from an ultrasonic sensor, the system achieves stable levitation at a user-defined setpoint.
Key Features
- PID Control Loop: Runs on an Arduino UNO to constantly adjust fan speed.
- Real-time Feedback: HC-SR04 ultrasonic sensor measures the ball’s position.
- Data Analysis: Python scripts collect telemetry for analysis in MATLAB.
- System Identification: Mathematical models (plants) were derived using MATLAB’s System Identification Toolbox to tune the controller.
Hardware Setup
The system consists of:
- Controller: Arduino UNO
- Actuator: 12V DC Blower Fan with L298 Motor Driver
- Sensor: HC-SR04 Ultrasonic Sensor
- Structure: Transparent vertical acrylic tube
Methodology
Control Strategy
The controller was developed in three stages:
- Manual Tuning: Initial P-I-D values were approximated experimentally to achieve semi-stable levitation.
- System Identification: Real-world input/output data was collected and imported into MATLAB to generate a transfer function for the “plant”.
- Simulation & Refinement: Simulink models (both continuous and discrete) were used to fine-tune the PID gains for optimal stability and response time.