OK, I admit I was sceptical.
I had learned about building a CNC machine by building an x-carve. I had no problems with noise, but I did use capacitors to filter noise on the limit switches following Ben Harper's suggestion here:
https://www.instructables.com/id/End-Stop-Limit-Switch-Problems/So when I built my new machine, I thought it was just a matter of scaling up: Bigger, stronger aluminium extrusions, proper linear guides, nice big stepper motors, beefy timing belts and a smarter interface than Arduino, hence the Gecko 540 and the PMDX 411.
Steve from PMDX said it was likely noise.
12strings, you were right! It's taken me a while, but I have completely rewired my machine and the problems are all solved.
Here's what I did:
1. replaced all stepper wiring with 4-core shielded microphone cable
2. replaced all limit switch wiring with 2-core shielded microphone cable
3. grounded all cable shielding to the machine frame in such a way that all the machine rails and gantry are connected to earth and all the cable shields are grounded at one end
4. inside the control box I moved all the AC wiring over to one side away from the power supply to the Gecko and any Gecko wiring
5. took particular care to keep the AC supply to the router separated from all the other wiring and laid it against the edge of the metal control box (kind of tucked into a recess). The control box is also connected to earth.
6. kept the AC to the router outside the cable ducts, allowing further separation.
7. where I couldn't use shielded cable, for example, the last little bit to the steppers, I used twisted pair wiring
In short, I did everything I could to reduce/isolate any potential sources of noise and to shield out as much noise as I could from the control side.
And it works a treat now!!!!
Thanks for all your help.