I finally avec my DIY CNC working! But I've another problem now lol
I send a Job by Gsender and after probably 40% of the job I had a Hard Limit Error! I've look all my limite switch and everything is ok on this side and even the cnc give me this error will center on my cnc! no limit switch have been it there.
I unplug all limit switch from my Arduino and the job complet at 100%. so do we have a way to decrease the sensibility of those switch?
I assume these are connected to Arduino inputs, expecting if a switch is triggered it opens the circuit and the input goes high. Or if the switch is use normally open it goes low. Do you have physical pullups on the inputs or have you just set the inputs to use INPUT_PULLUP? If the latter be aware that the internal pullups are quite weak (= high resistance) and the inputs can be vulnerable to noise pickup. It is good practice in this sort of case to fit physical pullups, and I would suggest 1k ohms would be a good value.
Are the limit switches normally closed? This is safest so if a wire breaks the controller interprets it as hitting the limit.
A limit switch should be wired such that if it is removed, or a wire breaks, then it should trigger an error. If your system is not wired like this then it is a bit rubbish.
This means that the switch should use the normally closed contacts and the software should react to the contacts becoming open, or removed is treated as an error.
It sounds like you have not got things configured correctly.
From the symptom you describe it sounds like a limit switch is spuriously activating during a run. This kind of problem usually arises from the wiring picking up a noise spike, often from the spindle wiring. Pickup is much reduced is the limit switches can be wired NORMALLY CLOSED (NC) which means that they have a low impedance to earth making them much less susceptible to picking up spikes. In addition, as I said above and Mike reinforced, this arrangement is fail safe if a wires breaks or becomes unplugged. I can't readily find data on your shield and don't know how you have GRBL configured but if you can I would change to a NC switch config. If it is currently NO and you can't change it then adding 1k pullups may improve matters.
I don't know because you have posted no link from where you got them from. The only thing you posted was a picture, and not a very good one at that.
I can see four wires coming from the board but only three are used by the cable. I suspect that you are using the wrong connector on the board, but you will have to check.
Do this with your digital volt meter set to resistance. Put one probe on where the black wire would be connected, and the other probe in turn on each of the connectors on the board. You should find that one connector breaks when you press the switch, and the other makes when you press the switch.
Use the one that breaks when you press the switch. You can simply un-hook the wire from the cable and move it over. Also make sure your CNC controller is expecting this sort of behavior.
The photograph of the cables clearly show three wires, are you saying this is not what you have?
However, the picture of the back of the PCB shows the output of the switch. I have put numbers on this switch 1, 2 & 3.
It is likely that pin number 2 is the common, and 1 & 3 are the connections. So use your meter to find out which of the these are the normally open and which the normally closed. Make sure the normally closed is the other pin connected to the Arduino board.
Then you simply connect the common, that is Pin 2 that I marked, and the normally closed connector, Pin 1 or 3. It doesn't matter which way round you have them, that is the + or - pin.
Yes there will be a setting somewhere in the software, make sure it is set for normally closed.
There are a series of GRBL settings, the fifth row down is for limit switches. Text says:
"This refers to the limit switch pins which by default are set to high using the Arduino's
internal pull up resistors. Grounding the pin tells GRBL the limit switch is tripped. For the
opposite behavior use the setting $5=1 which tells the system that a high is the limit
switch trigger. You must also install external pull down resistor with the $5=1 setting. "
If you want to use the NC (fail safe) option for the switches you would use $5 = 1 but you don't need pull downs because that is done by the switch itself. The text also indicates that GRBL is configuring the inputs with internal pullups, which isn't ideal as those are not very strong. I suggest you wire the limit switches NC, set $5 = 1, and check if that solves your problem.
The possible saving grace is that with NC switches the inputs will have a hard ground which is a very strong pull down! At least there should not be any spurious triggers when all is operating normally, but if a switch is opened just when there's a lot of interference it may not be recognised quickly. Ideally external pullups should be added as well, from each limit input to +Vcc.