Added get encoder position function