You definitely don't want to be passing logic signals across high current power supply and motor wiring like you have. Reposition the Arduino well away from the motor(s) and power supplies. Place the CNC shield between the motor(s) and Arduino, route all the logic signals direct between it and Arduino with ground return wires (preferably several of them). Don't make loops between a signal and the nearest ground return, that will pick up interference.
The high current motor wiring route the other side of the CNC shield to keep it away from the logic wiring. Each motors wires should be kept in a single bundle or ideally twisted together, and wiring between PSU and load should be twisted pair of supply rail and ground.
Just placing all the wires in a pile on top of each other will create strong magnetic and capacitive coupling between everything.
Pretty please with bells on clean that up and re-route your wires.
Move the mains supply away from the other items.
Move the PSU's away from the rest of the electronics.
Use SHIELDED cables wherever possible.
Move either the stepper or the electronics away from each other.
If you have to cross wires over try avoid where possible doing it at right angles to a different wire but instead try to route DIAGONAL for crossings.
Move the relay shield away from the other electronics and use shielded cables from the electronics to the relays.
And that's just the easy to spot things.
That thing must be full of parasitic noise as you could get it without actually mounting an antenna on it and a sign that says "All radio signals gratefully accepted"
Bob.
PS. Don't feel too bad most of us have probably some something silly like that...My hand is up anyway.
Some additional tips for errant behaviour in CNC type applications
Two common methods of grounding.
Common ground can be broken out as two types. (simplified)
Both are known as GROUND.
In most cases you will probably use something similar to the post from Perry
However if you are planning a CNC, multiple motors, servos, actuators etc. type of project there is another method to consider.
STAR GROUNDING
In its most simplistic it is a central point where all grounds meet using a "star" formation.
Often also used in audio, musical instrument situations to name just two.
Electrically there can be multiple differences in the way both schemes work even though it may on the surface look like the grounds are all just connected to each other.
Simple GROUND tips.
Try to keep ground and signal leads as short as you can.
The current return paths must also be kept short.
Long wires can pick up noise and should be kept as short as possible or shielded.
Any grounds that present high frequency signals should not be shared with other more sensitive grounds.
Try to avoid introducing inductance with coiled wires or similar.
Better to avoid ground loops that can be a source of interference into your ground or transmission of your signals to other parts of the circuit.
Literally anything you can shield in these types of setup the better.
It took me about two weeks to sort all my CNC noise issues out one bit at a time.
The problems seemed quite random with one cnc cut working great and exactly the same cut failing at some random point the next.
I also used ferrite rings and decoupling capacitors as well to further mitigate noise issues.
If you look at a lot of commercial electrical cable galley ways they often have metal dividers to seperate power runs from signal runs.
Small metal angle such as that used for drywall corners may help if you want.
It would also offer you cable tie points.
ballscrewbob:
Literally anything you can shield in these types of setup the better.
It took me about two weeks to sort all my CNC noise issues out one bit at a time.
The problems seemed quite random with one cnc cut working great and exactly the same cut failing at some random point the next.
I also used ferrite rings and decoupling capacitors as well to further mitigate noise issues.
If you look at a lot of commercial electrical cable galley ways they often have metal dividers to seperate power runs from signal runs.
Small metal angle such as that used for drywall corners may help if you want.
It would also offer you cable tie points.
First testing and working then ofcourse tie the cables.
I will have a look for shielding, thanks for your feedback
Hi Patrick,
First off, don't take this as in any way derogatory, looks like you have an interesting project and are making progress, but...
As a general rule if the physical layout of your project looks a mess then you are going to have problems. Your layout looks... you get the idea. If you lay things out neatly they not only look better they tend to work better.
Keep wires doing similar things together; power with power, signals with signals and away from power as much as possible.
(I wish I had a photo of the first audio amplifier I built, it was a good example of how NOT to lay out a circuit. Howled like mad all by itself).