OK, assuming you are getting to the last line of your GCode (M30) when it is run then my opinion is that the problem is within your controller rather than Mach or your setup. The M30 should terminate any pulses from Mach so what could be driving your Y axis ?
Tweakie.