Torque compensation for levitation effect of motor