Using Hall-effect position sensors for rotary encoding