Stabilization of Rotary Inverted Pendulum