Self-balancing Robot
School project — FEE 3412 Control Systems B — 2025
- Arduino Uno
- MPU6050 IMU
- L298N H-bridge
- PID Control
- MATLAB / Simulink
The problem
A two-wheeled robot is inherently unstable — an inverted pendulum that falls over the moment control stops. Built as a school project for FEE 3412 Control Systems B, it asked for the full control-engineering treatment: model the plant, design and verify a controller in simulation, then close the loop on real hardware.
What I built
The plant was linearised about the upright equilibrium as an inverted pendulum on a cart, with transfer-function and state-space models in MATLAB; a PID controller was tuned with pidtune and verified in Simulink against a 5-second settling-time requirement (impulse response, Bode margins, root locus). On hardware, an Arduino Uno reads pitch from an MPU6050 via its onboard DMP at 100 Hz, computes the PID output, and drives two DC motors through an L298N H-bridge from a 12 V battery — with a safety cutoff that stops the motors beyond a recoverable tilt.



Results
What I'd do differently
Choose a simpler mechanical design: drop the 3D-printed parts (printing isn't accessible to me yet) and build around a more COTS-ready chassis and off-the-shelf mounts instead.