View Full Version : Limit switch's - best configuration?

12-08-2009, 10:15 PM
I need to add some limit/home switch's to my machine, what are the best switch's and mounting arrangement to go for so that I get decent accuracy when homing / referencing the machine and also whats the best way to wire them for mach3?

I have read the mach3 instructions and it says that wiring them all in series will work but not so sure as I have not tried it, surely wiring each one indepently to an input would be better but I presume that would need another LPT connector.


12-08-2009, 10:30 PM
If you've got 3 axes, and limit and home switches for each of them, it'll add up to 9 switches in total - so you would need an extra parallel port.

But since you shouldn't ever really hit your limits, you should be able to get away with all the limit switches to one input, and you could put the home to three other inputs.

I can't comment on the Mach3 side of it though, but you can wire them in either series or parallel - series is the traditional way of doing it, as there's less wiring to go wrong (and it also means there's a fail-safe, so if your wiring breaks, it'll end up thinking the limit's been hit).

To me, microswitches are the obvious choice, but I'm toying with the idea of a magnetic switch of some sort, so there's no physical contact (I'm vaguely looking for an optical solution for home switches though). Get ones with rollers on, and make sure there's a gradual slope for them to switch (otherwise if there's a bit of momentum, you could bend the lever).

The advantage with microswitches is that they generally have normally-open and normally-closed connections, which means you can choose between series and parallel connections (normally-closed connections are used for series, normally-open for parallel).

John S
12-08-2009, 10:31 PM
The short answer is no........


12-08-2009, 11:00 PM
The short answer is no........


Make your bloody mind up......

John S
12-08-2009, 11:14 PM
It's a good news, bad news answer.
First off you only need 3 inputs if you want to keep them separate which is a good idea.
If you are using Roy's Uniport board stuff the e-stop into pin 10 input 1.
don't link them as Roy shows in his manual.

Linking will work but they will only work as limits.

Bad news is Mach sees both switches on one axis as just a limit, it can't differentiate between the two.
this is a problem with Mach that I have been trying to get altered for ages but Brian just don't seem interested. The new mach4 is supposed to be able to see both switches so it may filter down into Mach3 ?

If you hit a limit switch it knows but not which one so it's possible to jog further onto the switch. Knowing which one would allow you to only jog off and not further on.

Good news is it can use one switch as a home [ that's the annoying bit in Mach, it know which switch is the home but not limit plus or minus ????? ]

This is why you need 3 inputs, two switches daisy chained for X,Y and Z input into pins 11,12 and 13, inputs 2,3 and 4 on Roys board.

Then go into config > ports and pins> input signals and tick them all down to Z home.

Set the port number to 1 and all the pin numbers on X to 11, Y to 12 and Z to 13.

that sets limits up.

Then go to Config > homing> and use home neg to set which switch you want to home at. Ticked is one switch, cross is the other.

PS Done with my bits yet ?

13-08-2009, 01:31 AM
PS Done with my bits yet ?

Nope..... Hang on....what bits????

Just watched video on mach3 website about limits and homing (http://machsupport.com/videos/), god that blokes got a boring voice, fell to sleep after 5 mins and only just woke up!

But in the dream I had whilst sub-limily listening to him, he did seem to make out that it was possible to have switch's working both as home and limits. But did not go into the wiring in too much detail.

What about using 2 inputs, 1 for the X+ Y+ Z+ and one for X- Y- Z-, would this get round the jogging off problem?

Found some limit switch's, bit big but they will do.

13-08-2009, 07:01 AM
What about using 2 inputs, 1 for the X+ Y+ Z+ and one for X- Y- Z-, would this get round the jogging off problem?

That don't sound a bad idea Steve might try that myself


John S
13-08-2009, 09:34 AM
What about using 2 inputs, 1 for the X+ Y+ Z+ and one for X- Y- Z-, would this get round the jogging off problem?

Sorry no it's internal in Machs core that it sees a switch, no idea which switch.
If you keep Z+ and Z- to one input at least you can see what the problem is on the diagnostics page if you have problems.

Link Z-, Y- and Z- to one input will work but if it stops it shows the input has triggered but which one ?


13-08-2009, 09:45 AM
The way I have wired my home switches and limits is that if it hits a limit at the home switch end the home switch is made at the same time, so could a bit of script be used that checks to see if a home switch is made then get Mach to drive that axis away from the home/limit then back onto the home? Then any axis thats not seeing a home switch drive it in the oppisite direction?

(hope that makes sense)


John S
13-08-2009, 09:55 AM
Only way for this to work is to use 6 inputs and then get a Brain command to check and do the necessary work.
Problem here is you need another PP

In the normal method of one input for Z+ and Z- one switch can be home as well. It will work as you say hits the switch backs off and touches back onto the switch, that's part of Mach

And that's the most infuriating part, it knows this and can do this but Brian can't be arsed to get it to do the same with limits, preferring instead to piss about with fancy gee gaws that other 'want' and never use whereas this is a basic CNC application and should have been in years ago.

'Rant over '

13-08-2009, 12:01 PM
Right, I am getting really confused now....

The guy in the mach3 video (that sent me to sleep) talking about limits and home switch's shows mach with 4 limit switch's wired (2 axis) and then goes through the mach3 configuration, can't remember how many inputs he has them wired to. I will watch it again and try and stay awake this time, see if I missed something.

He uses the limit switch's as overtravel limits but also as home switch's, one limit switch doing both jobs. When he press's the machine ref button on the screen the axis jog one at a time to the limit then jog off then auto zero (if you have set auto zero function). Then he goes into how to set up soft limits, looks straightforward and exactly what I want.

Surely it would not matter which overtravel limit switch it hit as long as it stops, the soft limits should cut in before the actual limit switch's as the limit switch's should only be your last line of defence before the machine decides to break itself. You should be able to see which switch has been activated and sort it accordingly.

I want to get them on before my lad starts using the machine, safety first and all that!

Tell you what, instead of ranting on about it, tonight I will mount some switch's on my machine and try it for myself.


Forget about the wiring and configuration for a min, what switch's have you tried and work well? Got some of those honeywell ones (pic above) but they are a bit big for the Y and Z axis, should be ok for the X though.

13-08-2009, 12:18 PM
Hi Steve

My limit switches are same or similar to these (RS 362-3167) for my home switches I have used inductive proxy's all of which work fine for me.


(ps you are right if the soft limits are set up correctly the actual limit switch is a last resort)

13-08-2009, 12:38 PM
Hi Andy

Thought you had a modbus board, surely using that you have enough i/o to get any combination you want as far as limits and homes are concerned.

I'm still at beginner stage with mach3 so just put me right if i've got the wrong end of the stick!


13-08-2009, 12:57 PM
Hi Dave

I do have a modbus board,but it's still in its box! Not used it yet, I am just about to finish the upgrade to my machine (mechanical build wise) then hopefully build a control box with PC and Modbus PLC all in one, so yes you are right once I get it sorted the I/O should not be a problem, but it will be a steep learning curve!


13-08-2009, 01:12 PM
OK, just been reading through the Mach3 online instructions and found this -

"Repeatability is very important for a switch used for the Home function. Each axis could therefore need three switches (i.e. two Limit switches at the two ends of travel and a Home switch). Even a basic mill would require nine parallel port inputs for them. This is not practical, as a parallel port has only five inputs! The problem of insufficient inputs can be solved in three ways:

1. Connect the limit switches to external logic (perhaps in the drive electronics), and use this logic to switch off the drives when a limit is reached rather than interfacing them to Mach3. Separate refer-ence switches would still be connected inputs to Mach3.

2. Use one pin to share all the inputs for an axis, and make Mach3 responsible for controlling both limits and detecting Home. For example, if Mach3 was instructed to "move to Home" on a milling machine, it could move the X axis to the left (table to the right) until a switch was triggered. In context, that would be interpreted as "Home." If that same switch was triggered while machining, however, it would be interpreted as "exceeded Limit."

3. Interface the switches by a keyboard emulator.

The first method is best and mandatory for a very large, expensive, or fast machine where you cannot trust software and its configuration to prevent mechanical damage. Switches connected to the drive electronics can be intelligent and only allow motion away from a switch when the limit is hit. This is safer than disabling the limits so a user can jog the machine off the limits, but it does rely on having a sophisticated drive. The second method is suitable for smaller machines with direct operator control. With this setup, it is possible to use only three inputs to Mach3 for a three-axis mill (four for a gantry type machine - see Slaving). Since you (or the operator) are present and can take appropriate action based on the situation, only two switches are required per axis. Both Limit switches can be tied together, and the Home posi-tion can share functionality with one of the Limit switches. All the two switches need to do is signal Stop! The operator can then figure out what to do for recovery."

I'm going for option 2!

13-08-2009, 01:19 PM
Option 2 would work if:

1) Your home position is one of your limits

2) You do not do any movements which causes the axis to go over the home position

Otherwise, the switch would be trigged when home was reached (crossed), and that would be interpreted as exeeding a limit...

ETA: Although if it homed, and then moved by a known offset, then you wouldn't have this problem

13-08-2009, 01:26 PM
Yes home position will be one of my axis travel limits.

All home/limit switch's will be positioned at the end of the safe travel for X,Y and Z.

So, should be ok then. (famous last words... I can see a late night coming on!)