Kalman Filter-Based PID and Nonlinear Counter-Steering for Low-Cost Self-Balancing - Chao, Chung-Hsing; Shieh, Jenn-Jong; Zhang, Xiang-Jun (Journal of Electronics and Electrical Engineering, 2026)
Two-wheeled vehicles present a significant stability challenge, particularly at low or zero velocity. This paper presents the design, implementation, and validation of a low-cost, open-source self-balancing electric motorcycle prototype that addresses this challenge. The system is based on the inverted pendulum model, employing a Proportional-Integral-Derivative (PID) controller for longitudinal (pitch) stability and a novel counter-steering strategy for lateral (roll) stability. An Inertial Measurement Unit (IMU) provides attitude data, which is processed by a Kalman filter to yield a robust and accurate estimate of the vehicle's tilt angle by effectively fusing noisy accelerometer data and drifting gyroscope data. The entire system is managed by an STM32 microcontroller, demonstrating that advanced control can be implemented on accessible hardware. Experimental results validate the effectiveness of the proposed controller, showing rapid balance recovery within 1–2 s from external disturbances of up to ±5◦ with less than 15% overshoot. This work not only provides a practical implementation of a self-balancing system but also serves as a valuable and replicable platform for further research in intelligent transportation and robotics education.