The Self balancing robot will be prevented from falling by giving acceleration to the wheels according to its inclination from the vertical. If the pot gets tilts by an angle, than in the frame of the wheels, the centre of mass of the pot will experience a pseudo force which will apply a torque
opposite to the direction of tilt.