A self-balancing robot built to explore embedded control systems, sensor fusion, real-time firmware architecture, and custom robotics hardware. The project combines mechanical design, electronics, and closed-loop control into a fully autonomous balancing platform.
Project start: June 2026
Status: Prototype completed
Stability Bot MK1 is a two-wheeled self-balancing robot designed to balance itself using a PID loop. The robot continuously measures body orientation using an inertial measurement unit (IMU) and dynamically adjusts motor output to maintain balance.
In the future, the project may serve as a platform for carrying objects, following waypoints, or remote control.
Create a robotics firmware framework capable of implementing and testing increasingly advanced control algorithms ranging from PID control to future Kalman-filter-based state estimation, as well as manual control.
Currently uses fully 3D printable components and modular electronics to allow quick mechanical and firmware revisions during development.
The current prototype uses readily available components to validate balancing performance before committing to a fully integrated PCB. Future revisions will improve sensing accuracy, power delivery, and system integration.
| Subsystem | Current Prototype | Planned Upgrade |
|---|---|---|
| MCU | ESP32 | ESP32 / TBD |
| IMU | MPU6050 | BMI320 |
| Motor Driver | L293D | TBD Higher-Efficiency Driver |
| Motors | TT Yellow Gear Motors | Current Motors |
| Power System | ELEGOO Battery Pack | 3S LiPo Battery |
| Electronics | Modular Prototype Wiring | Custom Integrated PCB |
The version one chassis was designed specifically for balancing performance. A high center of mass was intentionally chosen to slow rotational dynamics, making the robot easier to stabilize and tune.
The geometry remains simple and fully 3D printable while integrating custom support structures and mounting features for future electronics upgrades.
*coming soon*
The design will foocus on better integeration of electronics and sleeker form factor.
FreeRTOS tasks separate sensor acquisition, state estimation, motor control, and debugging functions. This architecture improves maintainability while ensuring deterministic timing for balancing operations.
The balancing controller currently uses PID feedback derived from IMU orientation estimates. Future revisions will explore Kalman filtering and more advanced state-space approaches.
While the current prototype relies on modular electronics, development has begun on dedicated PCB hardware. Initial work focuses on validating BMI320 integration before designing a fully integrated control board.
The final PCB is planned to consolidate sensing, motor control, power distribution, and debugging interfaces into a single compact assembly.
Early hardware setups with the MPU6050 on a breadboard revealed significant noise and instability in orientation estimates. After debugging and investigation, the problem was traced to the unstable friction fit connections, poor sensor fusion algorithms, and insufficient filtering. These casued noise in stationary angle estimates and signal dropoff during movement, making the robot difficult to balance.
Before IMU filter tuning:
After:
IMU readings would intermittently drop out during movement, causing the robot to lose balance.
This was traced back to 2 issues:
1. Watchdog timer resets due to blocking code in the main loop, which was resolved by optimizing the control loop and adding a small delay.
2. Unstable physical connections to the IMU, which will be resolved in future revisions with a custom PCB and improved mounting solutions.
See below an example of the signal dropout issue, where the IMU readings freeze during movement, causing the robot to lose balance.
Prototype testing focused on validating sensor acquisition, motor control responsiveness, and control-loop stability. Additional performance metrics will be added as tuning progresses.
| Metric | Result |
|---|---|
| Control Loop Rate | [Placeholder] |
| Balance Duration | [Placeholder] |
| IMU Sample Rate | [Placeholder] |
| Motor Response | [Placeholder] |
Videos documenting balancing tests, firmware development, and prototype evolution.