first thing I would do is check all cables. With the power off. Unplug the cables and plug them back up making sure they are tight. If you do not have the motor cables screwed into the G540, screw them in. If they come unplugged whiled powered up it can damage the G540.
If that doesnt help, run a back up of the XML. Mach 3 keeps periodic backups, you can specify how many days or so you want to go back.
When mach3 does funky stuff, I re-setup a new XML and that typically solves it. As mentioned in many threads its a good idea to keep a backup of your working xml on a memory stick. I also like to take screenshots of all the settings that way i can quickly reset back up if the XML ever goes south.