All work

Self-balancing Robot

School project — FEE 3412 Control Systems B — 2025

RoleHardware & Firmware Engineer
Timeline[ timeline ]
Tools & tech
  • Arduino Uno
  • MPU6050 IMU
  • L298N H-bridge
  • PID Control
  • MATLAB / Simulink
Hero image — finished device / app screenshot

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.

Control architecture — PID loop around the state-space plant model.
Control architecture — PID loop around the state-space plant model.
Firmware flow — MPU6050 DMP read, PID compute, and motor drive at 100 Hz.
Firmware flow — MPU6050 DMP read, PID compute, and motor drive at 100 Hz.
Wiring — Arduino Uno, MPU6050 (I²C), L298N H-bridge, and 12 V supply.
Wiring — Arduino Uno, MPU6050 (I²C), L298N H-bridge, and 12 V supply.

Results

[ Placeholder — add measurable outcomes: performance numbers, latency, accuracy, users, cost. ]

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.