If you have the right motors with encoders the encoder just connects to the driver, I don't think Mach4 has anything to do with it.