Stability Bot MK1

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

ESP32
Robotics
FreeRTOS
PID Control
Embedded C
3D Printing
Stability Bot MK1

Project Overview

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.

Robot Overview

Design Goals

Control System Platform

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.

Rapid Iteration

Currently uses fully 3D printable components and modular electronics to allow quick mechanical and firmware revisions during development.

Hardware Architecture

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

CAD Design Progression

V1

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.

CAD Render

V2

*coming soon*

The design will foocus on better integeration of electronics and sleeker form factor.

CAD Render

Firmware Architecture

Real-Time Control

FreeRTOS tasks separate sensor acquisition, state estimation, motor control, and debugging functions. This architecture improves maintainability while ensuring deterministic timing for balancing operations.

Control Loop

The balancing controller currently uses PID feedback derived from IMU orientation estimates. Future revisions will explore Kalman filtering and more advanced state-space approaches.

PCB & Schematic Development

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.

PCB Design

Debugging & Challenges

Noisy IMU data

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:

PCB Design

After:

PCB Design

Signal Dropout

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.

PCB Design

Testing Results

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]

Testing Videos

Videos documenting balancing tests, firmware development, and prototype evolution.

Future Improvements

  • BMI320 integration and validation
  • Kalman filter implementation
  • Custom integrated PCB
  • Wireless tuning interface
  • Higher-performance motor driver
  • Higher-current battery system