The paper presents a sliding mode control strategy for a two-wheeled inverted pendulum, which is a challenging nonlinear control problem. It details the development of a practical controller and the simulation and experimental validation of its effectiveness. Key components include a model of the system dynamics and the design of the control law based on Ackermann's formula to ensure tracking error convergence to zero.