This paper introduces a method of design and implementation of a two-wheeled inverted pendulum (TWIP) robot with friction compensation. Friction in the drive mechanism is a critical factor of robot self-balancing and affects its performance. The friction parameters are identified based on the dynamic model of the drive mechanism. The dynamics of the whole robot system are obtained by the Lagran...