Objective:
Design and implement a closed-loop control system that autonomously balances a ball at the center of a beam using real-time sensor feedback.
Hardware:
Raspberry Pi Model B+
HC-SR04 Ultrasonic Distance Sensor
Servo Motor
Breadboard and GPIO Extension Board
Resistors and Jumper Wires
LEGO-based structural components
Software:
Python
Thonny Python IDE
Raspberry Pi GPIO libraries
Control Method:
A PID (Proportional–Integral–Derivative) controller was used to calculate the error between the measured ball position and the desired center position and adjust the beam angle accordingly. PID parameters were tuned iteratively to achieve stable and responsive system behavior.
Key Challenges:
Tuning PID gains to minimize oscillations and overshoot
Synchronizing software performance with hardware timing limitations
Debugging sensor noise, wiring issues, and mechanical alignment
Integrating software logic with physical system constraints
Outcome:
The final system successfully balances a ball at the center of the beam from varying starting positions, demonstrating effective closed-loop control, hardware–software integration, and iterative engineering problem-solving.