Inverted pendulum stabilization