# Design and Implementation of a Two-Wheeled Self-Balancing Car Using a Fuzzy Kalman Filter
## 1 Introduction  
With the advancement of science and technology, the two-wheeled self-balancing car has garnered renewed research interest and widespread application development owing to its simple structure, agile maneuverability, capacity to navigate narrow spaces and execute specialized tasks in unique environments, and adaptability to diverse terrains. Presently, various types of robots resembling the principles of the self-balancing car are ubiquitous in major venues such as shopping malls, transportation hubs, airports, and dining establishments [1]. The two-wheeled self-balancing car system resembles an inverted pendulum system, characterized by multivariable dynamics, nonlinearity, and strong coupling, rendering its study inherently complex [2]. However, in certain intricate environments, diverse interferences may induce disparate speeds between the left and right motors of the two-wheeled self-balancing car, thereby impeding the system's ability to follow its intended trajectory. Key to maintaining precision and stability in controlling the car system lies in the accuracy and real-time acquisition of the vehicle's attitude information and velocity measurements. Attitude information stands as a cornerstone for ensuring the successful operation of the entire system. However, the two-wheeled self-balancing car cannot consistently traverse smooth, disturbance-free environments. Achieving optimal attitude control solely through attitude sensors in complex environments poses a considerable challenge. The integration of filtering algorithms into the main controller ensures the integrity and accuracy of attitude information. A plethora of scholars have extensively researched this area, exploring methods such as feedback control [3], complementary filtering algorithms [4], and Kalman filtering algorithms [5]. Reference [4] presents a system design for a quadcopter based on an improved complementary filtering fusion approach, showcasing minimal static error, smooth dynamic curve transitions, and ideal real-time tracking performance. Similarly, reference [6] utilizes a complementary filtering algorithm to enhance the system's dynamiccharacteristics with low computational overhead, facilitating real-time measurement of terrain undulations during the locomotion process of intelligent agents. The Kalman filtering algorithm, pioneered by American scientist [PERSON] in 1960, initially demonstrated significant effectiveness in the field of positioning and navigation. In contrast to complementary filtering algorithms, the [PERSON] filtering algorithm cleverly integrates observed and estimated data, managing errors in a closed-loop manner and confining them within a defined range, rendering it more straightforward to implement than alternative filters. Importantly, the [PERSON] filtering algorithm does not necessitate all past observations but estimates the current signal value based on the preceding estimate and the most recent observation. Implemented through state equations and recursion methods, the Kalman filter does not impose requirements on the stationarity or time invariance of signals [7]. Reference [8] applies the [PERSON] filtering algorithm to PID control of a micro-rotorcraft system, successfully conducting experimental flight control tests. This method achieves excellent filtering effects, fulfilling the objective of stable flight for the aircraft. Similarly, reference [9] realizes real-time tracking of mobile robots using the [PERSON] filtering algorithm. References [10; 11] advocate for the use of Kalman filtering for attitude estimation in aircraft attitude control, leveraging quaternions as state variables and accelerometers as observation quantities for state updates. The Kalman filtering algorithm demonstrates commendable real-time performance and convergence. However, challenges persist due to the covariance matrix and measurement process noise inherent in the Kalman filtering model, making it difficult to accurately ascertain the statistical characteristics of the covariance matrix.