Grbl endstop noise

Hello everybody,

I am really new to CNC (1 week) and im trying to upgrade my machine.
My CNC is a full sheet long, 8 x 4 feets with nema 23 motors. Arduino Uno, CNC Shield V3.0

I have been reading a lot about noise in end limit switches and I am making progress with my problems but I still cannot make it work with long cabling.

Please help!!

I am using GRBL 1.1h, today I updated it from 1.1f

I have connected switches N.C.
GRBL Config is as follows:
$5=1
$20=1
$21=1
$22=1
$23=3
$24=25
$25=150
$26=250
$27=12
$32=1

When I run homing with the switches installed on the CNC the limit switches doesn’t stop the motors, even the alarm is triggered OK I can see it triggered on the UGS Platform. The motors dont stop.

I read [Tom Traband] posts about using only one end switch (hard limit) and doing the rest with soft limits,(By the way I believe it is the best regards of using x+,x-,y+, y- and z+ and z-)

I removed the switches from the CNC, after that I use short cables (12 inches) and connected the switches to the CNC Shield (V3.0) directly and homing is working OK manually pressing the switches by hand. Si i don`t think is GRBL problem and at least the switches are OK.

I am almost sure that I have a kind of noise when using long cables.

Why do you think is a good or even the best solution, to use shielded cables? Or trying something with filters?

Is the solution is with shielded cables, 18AWG will be ok?
Or if it is with filters what kind of them do you recommend?

Thank you very much for your help.
Kind regards.

I found the ? command invaluable when troubleshooting my endstop noise issue. cnc.js did not provide endstop indicators, but by repeatedly sending the ? command from the console I could see the various endstops logically triggerring when they were not being physically triggered. This will help you verify whether your issue is noise or something else.

Pardon me if I"m on the wrong track, but I can’t tell from your post whether you have one switch per axis or two. While the CNC shield has connections labelled Min and Max (or + and -) for each axis, there’s only one Arduino pin per axis - those two pins on the shield are a single connection as far as the controller is concerned. If you have a NC switch plugged in to each of the min and max connections on an axis, both switches would need to trigger at the same time for the controller to register that axis is at the limit. If using 2 NC switches on an axis, the switches should be wired in series and only connected to one axis pin for that axis - it doesn’t matter which. That way, either switch will open the circuit.

In my case, the noise on my switch lines manifested as the NO switches I was using showing as tripped when they weren’t, which is the opposite of what you’re seeing. Small “104” ceramic capacitors slipped into the connectors at the control board end solved my noise problem.

(post edited to show correct ? command for current machine status. $# command shows offsets)

1 Like

Hello Tom,
Thank you for your help.
Yes they are Normally Closed and at the begining they were connected in series in only one pin per Axis, i have read all your posts regarding that and that is how i learned it. Also i noticed the Pin 12 for the Z Axis was changed. Right now i just have 1 switch connected per axis.
The strange thing is that they do work in short wires, and in large wires they don’t. In long runs they don’t pull off, they just continue looking for the switch even that it has been triggered and alarmed.
Let me take some photos of the switches and how i installed them, and i will upload them.
I bought 2x18 shielded cables and i will try with them but they will be delivered next week.

Kind regards!

I was editing my post while you were replying - sorry to have jumped down the wrong rabbit hole.

Have you checked the switches and long wires with a multimeter to make sure they don’t have a short somewhere in the middle, that the connection actually opens when the switch is pressed?

Jajaja, it is ok,
Yes i did checked them with the multimeter and they are ok.
An update …
I twisted the wires with a drill, it is a 12 feet long cable, and it started to work, not perfect since it has open the connection once when doing homing but at least it is getting closer !!! Maybe it requieres more twist or maybe a thicker cable.
I will continue trying and keep you posted…
Thank you!!

If your switches test out reliably but are triggering “randomly” when the machine is on then you probably are dealing with noise. Excuse me for taking this long to come around to trusting your initial assessment.

Huge apology - working from memory has fooled me again. The command to test state of end stops from the console is just a question mark “?” - not $# (which shows current offsets, useful but not for this problem). I’ll go edit my previous posts to correct this.

You can confirm by repeatedly executing the ? command from the console, while the machine is off the stops but not otherwise moving. You’ll want to disable the “hard stops” by setting $21=0 temporarily while testing so that each phantom trigger doesn’t require a complete reset of the controller. The command output will show Pn: followed by the axis letter if an end stop is triggered - on my machine this is at the very end of the output, and nothing shows if no stops are triggered. If the end stop shows triggered sometimes and not others when the machine is powered up but not moving, that’s noise. Since it is intermittent, I had to repeat the command several times, even up to 10 or 15 times, to see it trigger.

I had a handful of “104” ceramic capacitors that came with a
“Getting Started with Arduino Circuits” kit kind of like this one that I was able to use to solve my noise problem, but you can get just the few you need from an electronics supply house, or get a bigger assortment like this if you like playing with circuits. I just pushed them into the end stop connection at the board end. I didn’t even try to solder or crimp them, just pressed them in so they make contact with the metal inside the plastic connector shroud. So far this friction fit has been reliable, but my control board is not physically attached to the machine, so vibration hasn’t been an issue.

Hello again !

I will try the question mark test.
I do have 104 capacitors, i tested with them yesterday but connected in the opposite side, i put them on the switch side not on the board side, and i didn’t think they did the trick and removed them, but you are all right if i want them to work they should be on the board side, today i will put them in that end and try with them again.

Regards!

1 Like

Hello,

I tried with the “?” question mark and i don’t see nothing triggered.
Tried with the 104 capacitors and yes it did the trick, but only works when the router is off. When i try to do some work and the router turns on, the alarm triggered almost immediately.
So i will try another approach, i read a post that somebody wrote (Do yourself a huge favor. Switch the limits to 24V logic.) And i think that since 24v is less inmune to the noise, i will use a optocoupler 24v-5v to connect switches to 24v on the input of the opto and 5v from the output to the CNC Shield.
I have also been thinking about the AWG of the cables and maybe there is a voltage drop because of the large wires (12-15 feets), and of course it the voltage is dropping down at the switches and not 5v it will go worst with the electromagnetical noise when i turn the router and maybe that is triggering the alarm.
I will try to do it today or tomorrow and post again.

Kind Regards!

Why is the router going on while homing?

It is not, when i do homing everything works well and the router is off.
When i want to cut something and the router turns on, then is when the alarm triggers.
Regards.

I personally don’t dig using caps (or software delays) to reduce noise/debounce on limit switches because that can actually add a tiny bit of latency which can result in positional error. From the sounds of it I’m pretty sure the OP is dealing with inductive noise, likely from either the router power lines or the stepper motor wires (yeah the router needs to be off while homing, lol).

To reduce inductive noise in the signal line, as noted, twisting the signal wires helps, as does shielding especially if grounded on one end. Increasing wire size will not help here (resistance has nothing to do with it). Another method that works well, but requires additional circuitry, is running current through the switch to a buffer IC… with enough current the inductive noise will be drowned out by the switch signal current.

Sorry I was thinking different try rerouting the router power cord above the machine not in the wire bundle ?or twisting or shielding? This is not a V 1 cnc correct? How similar is it?

Hello to everybody,
Its fixed. I did a lot of things but right now it is working perfect !!.

  1. I changed all the cabling with shield cables.
  2. I comon grounded all the cables and the power supplies.
  3. Separated signal cables and energy cables using cable chains.
  4. I also used ferrite noise filter cable rings.
  5. Changed the switches from 5v to 24v using relays with optocouplers.

And it is ready, right now it is working absolutely perfect!

Thank you all for your help !

Glad to hear you got it solved.