I built a CNC router about a year back and have had intermittent limit switch triggering for a good while.
After doing everything I could to remove any EM interference from the system (run the signals through optocouplers with isolated PSUs, shield all wires, star connect all earths, etc. etc.) I then got to the point where I gave up as it only triggered when doing heavier cutting, so I just ran the machine at half feed and got on with my day.
But I had a brainwave the other day and realised that it might just be mechanical vibration causing the intermittent triggering rather than interference... So I got to testing (tapping each switch with the back of a screwdriver) and it seemed my theory was right!
At this point, my switches are NC microswitches, so I thought I'd get some slightly better switches more suited (they're still cheap but they at least they're called limit switches).
But, same problem, when I tap them, they trigger. Then I realised that because they're NC, it only needs to slightly break contact to trigger (whereas if they were NO, the contact would have to move the entire way to the other contact inside the switch). So I tested this by wiring as NO and it seemed that tapping the switch didn't cause it to trigger anymore.
But the reason I chose to wire as NC in the first place, was because if they fail, they would trigger (and apparently they're less prone to EM interference).
So, here's my 2 options (sorry about the backstory, I thought it might help):
Option 1:
Remain as NC and buy high quality switches? (The problem is the switches I've seen are easily £50 each and I need 6... The switches I currently have about £1.50 each...
Option 2:
Rewire as NO, (This solves the mechanical shock issue, but has no failsafe if they go wrong). The only other issue is that I also have a NC touch sensor which would be in series with one of these NO switches, so I would have to invert that somehow, and have a NC and NO switch in series which I don't know how to do.
Thanks in advance and sorry for the long explanation but more often than not, when you explain the whole problem, people sometimes come up with a much better solution that I hadn't even considered!