  A two-wheeled self-balancing robot (TWSBR) is non-linear and unstable system.
This study compares the performance of model-based and data-based control
strategies for TWSBRs, with an explicit practical educational approach.
Model-based control (MBC) algorithms such as Lead-Lag and PID control require a
proficient dynamic modeling and mathematical manipulation to drive the
linearized equations of motions and develop the appropriate controller. On the
other side, data-based control (DBC) methods, like fuzzy control, provide a
simpler and quicker approach to designing effective controllers without needing
in-depth understanding of the system model. In this paper, the advantages and
disadvantages of both MBC and DBC using a TWSBR are illustrated. All
controllers were implemented and tested on the OSOYOO self-balancing kit,
including an Arduino microcontroller, MPU-6050 sensor, and DC motors. The
control law and the user interface are constructed using the LabVIEW-LINX
toolkit. A real-time hardware-in-loop experiment validates the results,
highlighting controllers that can be implemented on a cost-effective platform.
