The encoder is on the top of the motor.
Thus there is a mechanical issue between the encoder and the quill.
I wold be focused at the mechanics between the motor and quill because that is where you are working against the forces of gravity. I would check the belt first. Both for tightness and quality of the teeth. A machine with a TNC145 is probably 30 years old. And as Gus said (thank you!) it could be the pulley on the motor as this has a taper lock on it.
Doubtful if it is a loose encoder disk but cannot rule it out.
George
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)