I have wired ATX psu to encoder and outputs are stepped down from 12v to 5v and connected to arduino . Arduino is connected to USB.
I'm running 2 separate grounds. One goes to DC motor controller pins. But doesn't touch 12v. Other Ground is connected to A B Z outputs which are stepped down from 12v to 5v. Encoder is connected to PSU 12 and 0V, the common from encoder is connected to second GND pin to the Arduino Leonardo and stepped down 12v outputs.