As part of the Electromechanical system design class at the University of Warwick we designed and built a self balancing robot. In this project I took part in designing the robot, and wrote and tuned the PID algorithm that made it stay up.
The robot is composed of 3D-printed components, including a box to house the electronics, two angled legs , motor mounts.
The Battery and the Arduino are housed in the top of the robot to raise its center of mass. This strategic placement helps improve balance by reducing angular displacements.
The mounts securely hold the motors, and a connecting bridge between the legs prevents bending during motion, ensuring better stability.
PID Controller: A Proportional-Integral-Derivative (PID) controller calculates the necessary motor velocities based on angular displacement. Through the tuning of proportional (Kp), integral (Ki), and derivative (Kd) gains, the system adjusts motor speeds to reduce error and maintain balance.
Low-Pass Filter (LPF): A first-order low-pass filter was implemented to reduce noise from the sensor readings, ensuring more accurate control inputs for the PID system.Â
Red: Filtered Signal
Blue: Original Signal