Self-Balancing
Robot
A two-wheeled robot is inherently unstable โ it is a classic inverted pendulum that will fall within milliseconds without active control. The system must sense its tilt angle with high precision, reject gravitational pull and external disturbances in real time, and do so at control loop frequencies fast enough to prevent any perceptible wobble or fall.
Designed a cascaded PID control architecture operating on three nested loops โ angle stabilisation (innermost), angular velocity damping, and translational position hold (outermost). Sensor fusion combines IMU accelerometer and gyroscope readings through a complementary filter to produce a drift-free tilt estimate at high frequency. Wheel encoder feedback closes the position loop, preventing the robot from drifting while maintaining balance.
The control firmware runs on an STM32 microcontroller at a 1 kHz loop rate, ensuring sub-millisecond response to disturbances. The complementary filter blends accelerometer tilt (accurate over long periods but noisy) with integrated gyroscope rate (smooth but subject to drift) using a tuned time constant. The cascaded PID structure allows each loop to be tuned independently โ the inner angle loop runs fastest for stability, while the outer position loop operates at a slower rate to prevent translational drift without interfering with the balance dynamics. Motor drivers receive PWM commands directly from the controller with minimal latency.
Thoroughly documented parametric CAD modelling and hardware selection. Passed with high marks for practical structural stability and feasibility.
Successfully demonstrated the integrated sensor fusion and control system on breadboard prototypes and a scaled-down chassis, clearing the proof round.
The robot maintains continuous inverted pendulum balance, recovering from external disturbances within fractions of a second. The cascaded PID architecture with sensor fusion proved robust enough to pass both competition stages โ validating the control design under real-world conditions with noise, vibration, and surface irregularities.