Add logic to deal with magnetic encoder variation