You may have a faulty encoder or wiring, there is usually one reference pulse per revolution on a separate track that is used by the control, it is sensed after the homing switch is latched, it seems it may be missing that pulse from time to time. maybe it can be stripped so the scale can be cleaned.