A two-wheeled balancing robot stabilization problem is the scope of this research. A mathematical model of such robot is developed using differential equations and a state space. Applying this model, PID-controller and LQR-controller parameters are calculated to solve the problem under consideration. In addition to this, a neural network controller is developed, which is trained both in offline and online modes. A state variable 'pitch angle' is chosen to be used as a control error for the neural network online training, and a condition is defined when the training is to be made. A comparative modeling for all developed controllers is conducted using the robot mathematical model. Its results show that application of the neural network controller with the online training allows to reduce the energy consumption to stabilize the robot by 30.4% and 27.9% in comparison with the LQR-controller and the PID-controller respectively. Considering the overshoot for a state variable of derivative of angular positions of the left and right wheels, this controller also improves the transients quality by 10% and 7.4% comparing to the same controllers.