I have been hunting this now for several days. I still can find no apparent flaw in the encoder, no injected electrical noise , no lost teeth etc, no lash in the couplers, no lash in the ballscrew, no lash in the end support bearings, I can measure in the machine in any meaningful amount. if I push on the carriage with a 20 ton jack I get 0.0005 lash in Z axis lead screw where the error is occurring. I can also short run the Z axis lead screw with no obvious error accumulation IE 6 8 10 inches. However, I suspect the problem is a bit deeper. I can run the X axis back and forth along it's 12 inches of travel and it repeats to 0.00005 -+ every time but that is a much shorter travel path. The current encoder logic, it just count'sedges, and , this is patently the wrong way to use the encoder signals. there are 4 signal patterns on the encoder and they are all used to error check each other. you have AB 1 and AB0 and A1B0 and A0B1, these are all sine/cosine. The problem with the current method of counting, is that, it requires a perfect machine to work correctly by extrapolating tooth counts out 4x from the 4 tooth edges. What it doesn't do is any form of robust error checking to filter for noise in the mechanics of the machine or randomly miscounted teeth. at 76khz, which is 300ipm at 4096ppr, things are going to get difficult to count accurately over long distances if there is no noise handling in the code. There is currently no noise filtering comparison against the Z pulse ?index? there's no rationality check, If there were chronically undercounted teeth just doing a snap measurement every time the ABZ was true count = 4096, then you'd see the error immediately, the current code makes assumptions about a perfect machine that doesn't exist, it lack robust counting mechanism, counting edges is not the way the encoder is designed to work. it is a differential binary switch with 4 distinctly separate states, those states exist purely to ensure that there is a way to reduce noise. I'll be working on a new version of the encoder reading code and probably look at the firmware if it's available. at the Very least I am adding some sanity error checking to the encoder code, this is nuts. I also order a replacement encoder just to test with. what's another $200 at this point. here is a gif that illustrates what I am saying about the encoders operation and why it is currently being done wrong
en.wikipedia.org/wiki/Incremental_encode...ectional_encoder.gif
image missing https://en.wikipedia.org/wiki/Incremental_encoder#/media/File:Incremental_directional_encoder.gif