Can you try swapping motors around so a different axis is controlling the X and Y? You will need to change your pins in Mach4 as well. I want to see if the problem stays on the Y axis or if it tracks a specific drive on the G540.
My gut feeling is that this is a problem with either too aggressive of an acceleration profile or too high of a speed for the given power supply voltage. What is your power supply's voltage and current rating?