STM32F1-based dual-wheel self-balancing robot firmware using FreeRTOS (CMSIS-RTOS v2). Cascaded PID (outer speed/position, inner angle) stabilizes the robot while a Kalman filter estimates attitude ...