Kalman Filter-Based PID and Nonlinear Counter-Steering for Low-Cost Self-Balancing

Authors

  • Chung-Hsing Chao Department of Intelligent Vehicle and Energy, Minth University of Science and Technology, Hsinchu 30743, Taiwan
  • Jenn-Jong Shieh Department of Electrical Engineering, Feng Chia University, Taichung 40724, Taiwan
  • Xiang-Jun Zhang Department of Electrical Engineering, Feng Chia University, Taichung 40724, Taiwan

DOI:

https://doi.org/10.37256/jeee.5120269976

Keywords:

two-wheeled vehicles, self-balancing electric motorcycle, Proportional-Integral Derivative (PID), Inertial Measurement Unit (IMU), Kalman filter

Abstract

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.

Downloads

Published

2026-05-27

How to Cite

[1]
C.-H. Chao, J.-J. Shieh, and X.-J. Zhang, “Kalman Filter-Based PID and Nonlinear Counter-Steering for Low-Cost Self-Balancing”, J. Electron. Electric. Eng., vol. 5, no. 1, pp. 203–223, May 2026.