I have heard of such things. The encoder inputs on the 7i77 are muxed, so that they need half as many input pins on the FPGA. If the 7i77 encoder input is damaged you can get this result. Can you try connecting the Z-axis encoder to another encoder input on the 7i77 (just swap the plug) if you have an unused one. A problem with the mux signal between the 7i77 and 5i25 can cause this and Peter also mention a grounding problem with the encoder on another thread. So check your wiring, reseat the plugs and parallel cable, and see if things are better.