Inventables Community Forum

[Guide] Using Grbl to debug your homing switches

The test will give us more information to work with. Hard to say at this point what a solution might be as grounding issues and stray signals are tough to deal with.

I think an important fact for you to consider, @PhilJohnson, is that the limit switches go to digital pins that are not useable as external interrupts. What this means is that the limit switches are monitored by the single processor that is also communicating over UART with your PC and controlling three axis of stepper motors by polling. This means that when your Arduino Uno has time it will check on the status of those switches. If there were noise on the limit switch wires intermittently causing very, very short voltage spikes, it’s quite possible that your Arduino wouldn’t see them because it usually isn’t watching because it’s doing so much between each poll of those inputs. Then during homing, I wouldn’t be surprised if GRBL checked those inputs at a much higher rate, for accuracy, increasing the likelihood that you’ll see a noise voltage spike, incorrectly triggering that input. Does your machine occasionally incorrectly hit a limit switch trigger while running?

That’s the homing debounce in ms… Meaning your Uno is programmed to watch the limit switch close for over a quarter of a second before it registers as closed. If anything, I’d imagine your settings would do the opposite of trigger early. I wonder if setting them to 255 does something different, like setting them to normal closed mode? Like how setting your motor hold time to 255 makes them always-on to lock your steppers.

1 Like


Here’s how it works in version 0.9j

When the homing cycle runs, grbl approaches the homing switch(s) at the homing seek rate ($25). Once the homing switch(s) has/have been triggered, grbl will wait for the homing debounce time in milliseconds ($26), then grbl will approach the homing switch(s) at the feed rate ($24) to fine tune the home position, then grbl will pull the axes off the switch(s) by the homing pull-off amont ($27).

The value for $26 is just the number of milliseconds to wait. No magic numbers.

I’m not too surprised. One of the reasons that I generally ask for the $$ output at the beginning of any troubleshooting session is because many times the problem is located in the settings.

As far as I know, version 0.9j is the most recent “released” version. It is stable in that it is not actively in development, but bug fixes do occur.

Version 1.0c is the hot bed of development as we speak and is where the new changes/features/updates are being made.

I think someone said that the X-controller is running 1.0c which did surprise me a little.

Everybody has their opinion, let me just say that I’m running version 0.9j on my X-carve and I have 1.0c installed on a spare Arduino, in case someone needs help there.

I believe you said you are using Windows XP.

This works on Windows 7 and may work for you. Give it a try. It is pretty simple and if it works it might also clear up some of the weirdness you are seeing with your system.

Not a problem.

Yes, that one should work. You may have to change the x and y extents for the 1000mm ($130,$131).

Leave the homing switch shield grounded.

If you didn’t get an error from the upload then it worked. The $$ settings are stored in EEPROM which is not affected by the program load.

If you want to load the default $$ settings from the new file enter $RST=$ in the serial monitor or UGCS.

If you have them try a 0.47 uF cap (careful with the polarity) from the homing switch connection at the gShield to power supply common.

Later then.

1 Like

Every machine needs a little TLC. :smiley:

1 Like

Ceramic is your friend. Ceramic capacitors, as opposed to tantalum or electrolytic, are very low ESR, or equivalent series resistance. This translates to faster response time in your circuit, which means better noise rejection. Ceramic capacitors derate at DC voltage biases, so a 5V or 6V rated ceramic cap won’t do wouldn’t be as good. Find a ceramic capacitor rated to 10V or more and you’ll be golden. They also have the added bonus of not being directional, so you won’t have to worry about wiring it backwards.

Found some. These actually look like a pretty good deal, though I’d honestly suggest you get yourself a nice through hole ceramic capacitor kit with a bunch of different values.

1 Like

Go with Nathan’s suggestion.

Since you have to order them, if we have to go to the next step you would need a 100 uF 50 volt Electrolytic at that time.

Something like this:

1 Like

What would your reasoning be to go with an electrolytic?

Which capacitors? Electrolytics do have a positive and negative leg. On an electrolytic cap, there is an arrow pointing toward the cathod, which is the negative leg. On many electrolytics, the body of the capacitor is black and the arrow is white.

I guess the first reason would be that a 100 uF 50 VDC ceramic capacitor is $32 each.

lol oh, 100. I misread that as 1.00, thinking you’d just doubled the capacitance of the first attempt. Yeah, 100uF ceramics are hard to come by. Keeping the 0.47uF ceramic for the second test and putting it in parallel with the 100uF would be a good idea, though.

Hopefully, we want go there. There’s another option if needed.

1 Like

Well yes, but only if you mean “ground” as in “GND” on the Arduino, which is actually DC Common or 0V.

1 Like

Yup, that’ll work just fine. The capacitors go between the red and black wire, each red gets its own going to the GND pin.

1 Like