UPDF AI

Real-Time LLM-MCP-Based Fault Detection Framework for Two-Wheeled Self-Balancing Robot

Pooya Zeynali,Mahmood Seyyedzadeh,2 Authors,Ali Alfayly

2025 · DOI: 10.1109/MoSICom67153.2025.11398213
0 Citations

Abstract

Two-wheeled self-balancing robots (TWSBRs) are widely used as benchmarks in control research but remain vulnerable to diverse mechanical, electrical, and sensor faults. This paper introduces a real-time fault detection framework that integrates a Large Language Model (LLM) with the Model Context Protocol (MCP). Unlike approaches that rely on static datasets or textualized sensor signals, the proposed method enables the LLM to query live numerical data, datasheets, and diagnostic logs through MCP's client-server architecture. Acting as an “AI Robot Maintenance Engineer,” the LLM dynamically selects relevant sensor inputs, reasons over evidence using chain-of-thought prompting, and executes corrective actions without retraining when new tools are added. Experiments on a simulated TWSBR with fifteen predefined fault types achieved an overall diagnostic accuracy of 92.72%, with several categories reaching 100%. The results demonstrate that combining LLM reasoning with MCP's flexible architecture provides a scalable and effective solution for robotic fault detection, offering strong potential for real-world deployment.