Two-wheeled driying mobild robots are precise controlled in terms of linear contol methods without considering the nonlinear dynamical characteristics. However, in the high maneuvering situations such as fast turn and abrupt start and stop, such neglected terms become dominant and heavy influence the overall driving performance. This study describes the nonlinear optimal control method to take advantage of the exact nonlinear dynamics of the balancing robot. Simulation results indicate that the optimal control outperforms in the respect of transient performance and required wheel torques. A design example is suggested for the state matrix that provides design flexibility in the control. It is shown that a well-planned state matrix by reflecting the physics of a balancing robot greatly conrtibutes to the driving performance and stability.