Reaction wheel inverted pendulum