This answer is a little late but slowly losing position often indicates an encoder problem. The problem could be the encoder itself but is more likely electrical noise getting to the encoder signals. It can also be that one encoder line is not switching. If one of the differential signals is not switching the count may appear to be working but counts will be missed.