Combination Homing/Limit Switch Circuit Schematic

I’ve got an idea, maybe someone here can tell me just how bad it really is. :smile:

My base understanding of the homing switches is that the default programming sets them so that their circuits are hot ONLY when the homing sequence is activated. At any other time, the wires could be shorted, cut, mangled, mauled, or eaten without the software or hardware noticing it. My idea rests on this assumption, which seems to be reasonable since I have gotten bored and started typing morse code into a limit switch while there was a cut in progress.

The switches are wired up such that the homing circuit uses the common © and normally open (NO) contacts on them. What if the normally closed (NC) contact was wired into the arduino where a limit switch would go, and a switch was built in to allow the user to choose whether the homing switches were powered from either the homing switch wires (pins D9, D10, or D12) or from another pin on the arduino used for limit switches?

I drew up a quick schematic to help explain what I’m thinking:

I see two problems that I can’t easily fix in my head, since it’s 12:30 at night:

  1. There might be a momentary open in the limit circuit when switching between “homing” and “limit”. This may be a non-issue, or may require some electronics to be designed to ensure continuity.
  2. There may be issues with multiple switches being in different positions (e.g. X-axis switch set to “homing” while Y-axis switch set to “limit”). Further in-depth modeling may show whether this is a non-issue, or how to work around it. One solution may be to figure out how to use a single switch to control all 3 axes at once, but that would take a lot more work.

Does this seem like a feasible idea? Or am I just wasting my valuable sleeping time by coming up with something like this?

I don’t think that you need to do anything like this. There is a lot of functionality in the current setup and it can probably do what you want it to with just the right settings for the grbl parameters.

If you don’t have soft limits or hard limits enabled in grbl then you are correct. The homing switches are just for the homing cycle and then they are ignored after that.

For soft limits the homing switches are used to home the machine and establish machine zero. Once that is done then the switches are ignored, but if you issue a G-code command that would take the spindle outside the work area then grbl will not process that command and will alarm.

If you enable hard limits grbl will stop processing commands if a switch is tripped.

This is the short answer. A more detailed response is available if this is not clear.


Most of my ideas are based for users at the “Easel-only” level, kind of like me. I haven’t played with UGS, and while I would like to I want to get good at the first level. Without going in and adjusting settings in the Machine Inspector after each homing cycle, is there a way to do use the switches for both purposes?

I’m also interested in protecting the machine from slamming rails. There shouldn’t be many more problems from spindle noise causing wacky behavior (I hope), but I’ve accidentally moved 1" instead of .1" before and have slammed up and right a couple times. Not bad enough to break anything, but still something I’d like to avoid if possible.

All of the functionality that I mentioned above is at the grbl level so Easel users would benefit from all of it. You just have to set up the grbl parameters properly based on what you want to do.

You can use the homing switches for both homing and limits. You would have to add three switches to implement limit switches.

To prevent the spindle from going out of bounds, all you need is to have homing switches that work for the homing cycle and then turn on soft limits in grbl.

With soft limits enabled, after the homing cycle is complete, grbl ignores the homing switches and just examines the G-code commands prior to executing them to see if they would move the spindle out of bounds. If the test detects an out of bounds condition grbl does not execute the command, but goes into an alarm state.

1 Like

Would that require changing grbl parameters each time, or could it be a “one-time” setting? I know I’m lazy enough that I’d stop doing it if I had to go in and change parameters twice on each project, but I could easily reach over and flip 3 switches set off to the side.

I know we’d have to add 2 more limit switches (+X, +Y), but I’m not sure how the Z-down would work. By the time it hit something, the bit is likely broken unless it’s constantly adjusted for each project, which nobody would do. It shouldn’t hang under the machine too far and be able to trip by accidentally hitting the clamps or clamp screws. Is there a good “zero-maintenance” idea for a Z-down switch that would allow full depth cuts, but still trip before breaking a bit?

Once the grbl parameters are tuned you don’t change them unless something about your machine changes or your Arduino dies. So, one time setup.

I don’t know of a way to prevent bit damage. The way that I use soft limits and a way that a far end Z limit switch could help is to prevent your Z carriage from coming off the bottom of the makerslide. My machine uses the ACME rod and it has enough travel for the carriage to come right off.

Lazy Robert likes one-time setups. I never thought about driving the Z carriage off the bottom, my secondary wasteboard adds too much height to allow that. Good thinking though, I’ll have to see if I can find a cheap and easy way to add one. Because Lazy Robert likes cheap and easy too. :smile:

Lazy, cheap Robert would just use soft limits. :grin:

So, I think that Learned Larry is saying that if you use soft limits on the Z-axis, then you should (at least while gCode is going on) get the spindle to stop before it brings your bit to the waste board?
What if you’re using the PC software buttons to Jog the spindle, are soft limits still active? (I’m asking as a confirmation that you really meant that the ONLY time soft limits are inactive is during homing sequence.)

Robert, Inquisitive Russ would like to know, wouldn’t a well positioned limit switch on the Z-Axis RAIL, along with a well positioned activation pin placed on the Spindle carriage allow for a solution to the Z-Axis + limit?


Think about that for a moment.

Ok, PC software buttons jog your machine using G-code. :grinning:

ONLY time soft limits are inactive is during homing sequence

The only times that soft limits are inactive is during the homing sequence and before the homing sequence is activated. That’s why grbl initializes in the alarm state and will not do anything until you either home the machine, or force the alarm off with the $X command. If the $X command is used to cancel the alarm, grbl still doesn’t know where your spindle is located so soft limits don’t help in that case.

You could change your Z soft limit to prevent the bit from touching the waste board, but that would require you to set a different Z soft limit each time you changed your tool. Russ [Edit: I meant Rob] didn’t want to do a change to grbl for each tool change so I didn’t mention that before.

Oh, by the way, Learned Larry is just “learning Larry”. :grin:

Generally there are 3 pins on a Break out Board for the 3 inputs from switches. In control software these 3 pins can be configured 3 different ways. 1 all 3 as homing or reference switches, normally open or normally closed. 2 3 switches as home or reference and the same 3 switches as limit switches. again normally open or normally closed.
Now you can use 5 or 6 switches 2 in series as normally closed per axis. They are configured in control software as 1 switch is homing or reference AND limit for the direction and position the machine homes or references in. The other switch is positioned at the other end of axis travel and is configured as limit for that axis direction.

So it would look like this

Z home ++ pin 1
Z limit ++ pin 1

X home – pin 2
X limit – pin 2
X limit ++ pin 2

Y home – pin 3
Y limit – pin 3
Y limit++ pin 3

The – and ++ refer to the direction.

On most CNC machines they do not configure a Z-- limit switch but it can be done.

Z limit-- pin 1

It is very important that you use shielded wiring on all of there switches to keep any electric noise in the machine from giving false positives and causing the machine to stop where is should not.

You also configure the machine so you can back off of the limit switch and reset the machine. You also have to home or reference the machine after a limit trip.

Hope this helps


I don’t know about Russ, but Rob didn’t want to change +Z settings each time either. :smile:

I definitely want the soft limits, at first, but hard limits without doing anything other than flipping a couple switches would be good. Easy to implement, and then the only thing to do would be to remember to flip the switches before and after each homing session.

Would it be possible to implement it such that the hard limits shut off the steppers and the spindle, but don’t necessarily scram the whole project? If I fat fingered the controls and accidentally tripped a switch, it would be nice to not have to re-home.

Is a Break out Board the same as the Arduino or g-shield?

Any time a limit is tripped you have to home or reference the machine. A limit trip looses homing.
See my post above on how to set the machine up so you do not have to remember to flip any switches or do any thing other than run you code.

Thousands and thousands of CNC machines of all configurations and mfgs. are set up this way and it works.

Hope this helps


Yes the board that has the pins of input.

Sorry Rob. Got the name wrong. Yep, I was talking about you.

You can use the homing switches, soft limits, and hard limits, with the appropriate switches hooked up, all at the same time without any additional changes.

The point that I try to make in this discussion is why go to that trouble for almost no gain.

If you use the Arduino/gShield alone to implement your preferred protection scheme, true limit switches and hard limits offer no better protection than soft limits alone. In fact, unless there is a hardware/software failure, soft limits will prevent you from ever getting a trip on your “hard limits” switches. With hard limits on, you are still using the Arduino to detect a tripped switch so if the software doesn’t work neither soft limits nor hard limits will work.

The down side to hard limits is if you get a false trigger with hard limits on, your machine stops. False triggers do not happen with soft limits, ever.

For true limit switches to provide you with any additional protection you would have to use an external circuit to cut power when a limit switch was tripped.

It would be possible, but that would require a significant change to grbl. Limit switches are really intended to shutdown the machine for serious failures, not as a temporary work stoppage.

@LarryM and @DavidSohlstrom, thank you both for your help with this. I’m still on the fence with this mod, the only reason I’m seriously considering it is that after 2 bad spindles and 3 broken belts, I have to assume that problems will happen. If I lose steps one direction for any reason, I don’t want to be slamming into the opposite rail, and possibly break the homing switch. From the various discussions in these forums, it seems like the 611 may add enough weight to cause occasional loss of steps if the stars align and you’re using the wrong program at the wrong speed. Hell, I’ve caught my handheld vacuum attachment under the bit and caused a loss of steps when it suddenly move somewhere I didn’t expect it to.

My preference/tendency is to over-engineer and add safeguards that will never be used, rather than have the machine shut down for a week or 2 waiting for parts because of bad luck or stupidity on my part.

David, are your pins D9, D10, and D12 on the Arduino, the ones the homing switches are currently connected to?

For both of you, what changes would you input into Easel’s Machine Inspector to allow you to use the switches for both homing and limit? I see the following options:

  • $5=0 (limit pins invert, bool)
  • $20=0 (soft limits, bool)
  • $21=0 (hard limits, bool)
  • $22=1 (homing cycle, bool)
  • $23=3 (homing dir invert mask:00000011)
  • $24=25.000 (homing feed, mm/min)
  • $25=750.000 (homing seek, mm/min)
  • $26=250 (homing bounce, msec)
  • $27=1.000 (homing pull-off, mm)

Would having $21=1 cause a limit-trip shutdown whenever the homing cycle is run and the “homing” switches are tripped?

I used those pin number just as examples. Not tied to any machine. So if D9,D10 and D12 are the pins Arduino uses than yes use those pins.
I don’t use Arduino or Easel just going from years of running CNC machines.


Ok, here is the whole enchilada. Without implementing an external disconnect you can’t CYA any better than this.

Don’t change these:

$23=3 (homing dir invert mask:00000011)
$24=25.000 (homing feed, mm/min)
$25=750.000 (homing seek, mm/min)
$26=250 (homing bounce, msec)
$27=1.000 (homing pull-off, mm)

And change these:

$5=1 (limit pins invert, bool)

$20=1 (soft limits, bool)
$21=1 (hard limits, bool)
$22=1 (homing cycle, bool)

Maybe change these [soft limit values] (these are the default values for the 500mm machine)

$130=290.000 (x max travel, mm)
$131=290.000 (y max travel, mm)
$132=100.000 (z max travel, mm)

I can’t test these, but this is what it should be for Homing AND Soft Limits AND Hard Limits using NC switches. There are some assumptions with this setup, but if you are going to use the basic setup that Easel does, then this should be Ok for you.

Using normally closed switches gives you:

  1. less chance for false trips (but still can have false trips)
    2)if a wire breaks or comes loose you get a trip
    3)lets you use a series circuit for your switches

Using this configuration, quality grounding is helpful in avoiding false trips from your switches.

1 Like