An open API service indexing awesome lists of open source software.

https://github.com/inhald/self_balancing_robot

Self-Balancing Robot using Multithreaded PID-Control.
https://github.com/inhald/self_balancing_robot

mbed-os multithreading pid-control self-balancing-robot

Last synced: 7 months ago
JSON representation

Self-Balancing Robot using Multithreaded PID-Control.

Awesome Lists containing this project

README

          

# Self-Balancing Robot

A real-time self-balancing two-wheeled robot powered by an STM32 microcontroller. The robot actively corrects its tilt using feedback from inertial sensors and a cascaded PID controller, restoring its upright posture within milliseconds of disturbance.


Balancing Robot

## Hardware Overview

- **Microcontroller:** STM32 DISCO Board
- **Sensors:**
- On-board IMU (gyroscope + accelerometer)
- External ADXL345 accelerometer (for redundancy/testing)
- **Actuators:**
- Two DC motors (differential drive)
- **Motor Drivers:** H-Bridge motor driver (not shown in schematic)

## Control System

The robot uses a **cascaded PID controller** implemented in C++ with Mbed RTOS:

1. **Angle Estimation:**
Sensor fusion combines gyroscope and accelerometer data to compute pitch angle via complementary filtering.
2. **Inner Loop:**
A fast-acting PID controller adjusts motor torque to correct tilt angle in real time.

## Performance

- Stabilizes from ±15° tilt in < 100 ms
- Maintains balance on flat and mildly uneven surfaces
- Real-time operation under Mbed RTOS on bare-metal STM32