| description | Documentation for an STM32H7-based two-wheeled self-balancing robot, covering hardware design, embedded firmware, IMU sensing, motor communication, and real-time balance control. |
|---|
Built and documented by Yuyang Huang
Physical prototype (left) and CAD model (right) of the two-wheeled self-balancing robot.
- Demo video: https://vimeo.com/1180182469
- Repository: https://github.com/Apollo-kernel/mechatronics
- Project Docs: https://agile-navigator.gitbook.io/docs
This repository documents my work on a two-wheeled self-balancing robot built on an STM32H7-based control platform.
The project focuses on the core robotics stack needed to bring up a real robot system: embedded firmware, IMU integration, attitude estimation, motor communication, real-time balance control, system tuning, and hardware/software integration.
This project is intended to show that I have worked on a real robotic system beyond isolated coding tasks.
My contributions centered on:
- STM32 embedded firmware development
- IMU integration and attitude estimation
- motor driver communication and feedback parsing
- real-time balance control implementation
- system integration, debugging, tuning, and testing
- bringing the robot up as a working electromechanical system
The robot is a two-wheeled self-balancing platform that uses:
- an STM32H7 microcontroller as the main controller
- an IMU for body angle and angular rate feedback
- dual motor drivers for wheel actuation
- real-time control loops for balancing and motion regulation
The control stack includes:
- sensor acquisition
- attitude estimation
- motor communication
- balance control
- speed / turning control
- runtime debugging and parameter tuning
I want to be precise about scope.
This was not just a simulation or a small software-only class exercise. I worked on the embedded and robotics side end-to-end, including firmware, sensing, control, communication, integration, debugging, and physical system bring-up.
In particular, I worked on:
- embedded development on STM32
- IMU data handling and orientation estimation
- motor command / feedback communication
- balancing control implementation and tuning
- real-time debugging through serial tools / logging
- integration and testing on the actual robot platform
- STM32H7-based firmware
- HAL / CubeMX-based project structure
- FreeRTOS-based task organization in later versions
- UART / SPI / DMA usage for peripheral communication and debugging
- IMU integration for body angle and angular velocity
- attitude estimation for balance control
- real-time sensor processing for control feedback
- closed-loop balancing control
- speed and turning control structure
- parameter tuning for stable standing and recovery behavior
- practical debugging of oscillation, delay, and feedback issues
- communication with motor drivers over serial links
- frame parsing and feedback decoding
- handling command / response timing, errors, and robustness issues
This repository contains multiple development versions from early bring-up to later integrated revisions.
Example folders include:
H7_0.x.x_*— earlier STM32H7 development iterationsH7_1.x.x/H7_2.x.x— later control and integration revisionsL475_M0603_Feedback— related motor feedback experimentsCtrBoard-H7_ADC,H7_adc_uart,Button_LED,oled— board/peripheral tests and supporting modules
In general:
Core/contains application entry points and generated STM32 project filesDrivers/contains STM32 HAL / CMSIS driversMiddlewares/contains middleware such as FreeRTOSUser/andUser_Config/contain user logic and project-specific modules.iocfiles define STM32CubeMX configuration
Because this repository tracks many iterations, some folders are historical milestones rather than a single polished release branch.
Some of the important engineering work in this project included:
- getting stable IMU-based attitude feedback on embedded hardware
- implementing balance control that worked on the real robot, not only in theory
- integrating sensing, control, and motor actuation into one real-time system
- debugging communication and timing issues between controller and motor drivers
- tuning the robot to achieve stable balancing behavior
- iterating through multiple firmware versions to improve reliability
Lare added here so recruiters can verify the robot quickly:
- Demo video: https://vimeo.com/1180182469
- Project page / website: https://agile-navigator.gitbook.io/docs
The best way to evaluate this repository is not as a single clean software package, but as an engineering record of building and iterating on a real robot.
The main evidence of robotics work here is:
- embedded firmware for a real controller
- sensor integration
- closed-loop control
- actuator communication
- system bring-up and debugging
- iteration across multiple hardware / firmware revisions
Planned improvements for this repository:
- add architecture diagrams
- add photos and videos of the robot
- document the most representative firmware version
- summarize hardware BOM and wiring
- provide a cleaner “start here” guide for reviewers
If you are a recruiter or engineer reviewing this project and would like a short walkthrough of the architecture and my exact contributions, feel free to reach out.
Author: Yuyang Huang