detect motor speed