MechMate CNC Router Forum

MechMate CNC Router Forum (
-   70. Control Systems (
-   -   Limit Switches - optical / mechanical / proximity (

Gerald_D Sun 22 January 2006 04:14

Limit Switches - optical / mechanical / proximity
A synopsis of this thread will in future appear in this first post. This post will be edited from time to time - the date of this synopsis post is irrelevant. An experiment . . . . .

GregA Mon 21 January 2008 07:53

Limit Switches - optical / mechanical / proximity
I was going through the factorymation website, and wanted to get an opinion from someone who had a working MM. They have a wide range of sensors, and by my reckoning it would cost ~$111+shipping to add a full set of optical limit switches. Would this be a worth while investment?

Specifically, I was looking at the diffuse reflective sensors. It would just be a matter of drilling mounting holes and a few strategic holes around the MM, and wiring the circuit. Two, three hours tops to install.

But then, what do I know... I seem to have a warped sense of how long something should take...

J.R. Hatcher Mon 21 January 2008 08:08

I remember reading that wiring these optical sensors gets pretty intense. Limit switches on the other hand are a piece of cake. Mach3 can handle all homing and all limit switches with just 2 wires ......... total.

Doug_Ford Mon 21 January 2008 08:35

Gerald has posted before that he doesn't use any limit or homing switches so I'm going to try that route for a while.

J.R. Hatcher Mon 21 January 2008 09:06

I don't know how to relocate without homing switches. If I were in the middle of a job, say line 68 and lost power for whatever reason how would I start again, short of homing? In Mach3 if you rehome and jog to coordinates for line 66 you just tell mach to "start from here" example line 67 and it continues from where it stopped.
Keep in mind I have never actually ran a cnc router so all of this is pure speculation on my part :D:D. Discussion is more than welcome, so just jump right in. And no I did not wake on the wrong side of the bed this morning.:)

Doug_Ford Mon 21 January 2008 09:11


I'm right there with you Bubba. Learning to operate this thing is a challenge. Have you watched the Coordinates video tutorial on the Mach site? That helped me alot. In a few minutes, I'm going out into the garage to try to finish getting my software configured. When I figure it out, I'll post something.

Gerald D Mon 21 January 2008 09:38

If you have a power failure during a cutting job, the chances are that you are going to scrap that sheet of wood rather than try to restart the process. A machine of this size and speed needs power to come to a controlled stop - if the power drops out suddenly the motion and cutting is "wild". (gantry also out of square). However, there are rare cases when one feels that a restart chould be attempted . . . .

In our case, without switches, we can run the carriages against the hard stops and tell the machine we are now located at the hard stops . . . . a definite reference position. Sounds too simple, doesn't it? :)
(In practice, we run close to the stop, switch off the drives, move the carriages by hand up against the stops, and then switch drives back on.)

revved_up Mon 21 January 2008 09:52

The carvewright machines (more like toys) have optical sensors and they have countless trouble with them. They get covered in sawdust, they have a problem reading in less than optimal lighting and many other problems just relating to the design of the machine.

But then again thats why I for one am here to learn and to (hopefully) build a tool and not a toy.

GregA Mon 21 January 2008 10:11

JR Hatcher,

The optical limit switches are an easy circuit. They have four wires. Two of the wires are power, and two of the wires are signal. Knowing that, all you need to do is power the power wires. Then you use a 5 volt power supply on the signal wires. Then depending if the switch is NO or NC there is either a current or not. The load on the optical switch is nominal, measured in mA. You could build your own fair-child circuit but... an off the shelf switch is $30. I know I can't build one for that. With the extra inputs on the PMDX-122 you could even get down to, XYZ limit events, rather than one global limit event, for homing purposes.

Although, you might need two sensors in the X axis for the deracking operation.

I was wondering about the sawdust. I wonder if the capacitive sensors can detect a hole in the metal?

BernardR Mon 21 January 2008 10:56

Greg, I used opto home/limit switches on my mill. As with most things there are trade offs; the biggest downside as far as I am concerned was the wiring and installation.

Mine I believe are typical, they are a 5 wire device, Receiver +5V, Receiver Gnd, Receiver TTL out, IR LED Return and IR LED +5/20mA, mine came on a 10" lead terminated in a 6 pin dual in line socket. In practice you run +5V, Gnd and the TTL signal wires to each device and connect a current limiting resistor from the +5V to the LED. I connected two switches for each axis in a small box, with slots milled for the actuating blades.

With 20/20 hindsight I would not go that way again, first you can't easily have a single series switch chain that is recommended by most experts, (it is possible but involves additional logic.) The wiring gets very messy, small boards with minature wiring, and special wiring to get to the BOB. On the positive side they are very quick acting and are very reliable.

Gerald D Mon 21 January 2008 11:00

Originally Posted by J.R. Hatcher View Post
. . . you just tell mach to "start from here" example line 67 and it continues from where it stopped. . .
One must realise that when you tell Mach to "go to here" it does so in a straight line, being the shortest route. That can catch you out if the starting point, before the "go to", is different to what was last in the program.

Let's say you are cutting out a bowl and you have a power failure. You move the table to the home position at the 0,0 corner and reset it. If you now say "go to the bottom of the bowl", it will try to move in straight through the side of the bowl - it won't go up and over the lip.

Recovering from a power failure takes a lot of concentration.

smreish Mon 21 January 2008 11:24

I am glad were having this discussion again.
I did a little light reading again last night - with baby on my chest :) - and was pondering the use of proximity switches again.
The MM runs very well with out them. Heck, my MultiCAM ran well without them when I turned them off. (sometimes necessary to get the table to cut full width) Had a problem getting to 49" when you resurfaced the table!

What I am going to do once the table is up and running is experiment with limits only when the new NCpod board arrives. As of now, I don't have the right amount of inputs available to do all the functions I have set aside for the table using a single pmdx-122 card. The NcPod has 6 additional inputs for specific homing use. Pretty necessary for my end use of adding an additional rotating index axis.
The proximity sensors work VERY well and work in all environments...wet, dusty, smelly, loud, sticky, etc. They are affordable and small. The only challenge will be using a secondary source/sink module to buffer the switch between the BOB and the switch...again, easy and affordable.

I will let you in on my findings when I get there next month.


firebrick43 Sat 26 January 2008 01:15

We use a lot of optical sensors at work on all of the material movement conveyors and robot cells. Their reliability is much less that the simple limit switches on all of our machine tools. The reflectors get dirty/crack/knocked out of position. The Optical switches go bad quite frequently to. Some of the limit switches are so abused, swim in coolant, and beat upon still work, most of the time when they have to be replaced it is when they are physically destroyed. The only switches with worse reliability than optical switches is proximity switches.

When pieces of saw dust break the beam and cause an e stop, possibly scrapping a part, you will be cussing a storm

Gerald D Sat 26 January 2008 02:51

Originally Posted by firebrick43 View Post
The only switches with worse reliability than optical switches is proximity switches.
That is very unusual :confused:

Mechanical limit switches have a problem down at the 5 volt levels if connected directly to the BOB. They become very sensitive to slightly imperfect contacts and show Open when they are actually Closed.

revved_up Sat 26 January 2008 09:04

I'm not sure if this is the right place for this or not but I have been watching a sellers store on ebay, he has limit switches for sale cheap but the things I really wanted to were the power supplies he has and he has (for lack of better terminology on my part) a pass thru db25 connector that is supposed to protect your computer and it breaks out the e stop and limit switches all in one. It has USB connectivity on one of the models. If I understand it right it goes between the pmdx and the computer so does it give the ability to ouput mach to the controller via usb and does it make it easier to set up e stops and limit/homing switches?

again this loosly fits this thread but feel free to move it and if anybody with more knowledge about this would look and give their input I would apprieciate it.

firebrick43 Mon 28 January 2008 12:22

Gerald, we run everything at higher voltages, either 24 or 120 volts, 5 volt probably would be a problem

smreish Fri 01 February 2008 20:44

from the Automation Direct Help pages.
They also offer 5v versions of the 12mm Prox sensor, but I don't know if the PMDX can source/Sink that amount of current. More homework to do with Mr. Richards :O

Sensors Frequently Asked Questions

Return to the list of questions
Question Can proximity sensors be connected in series? Answer Yes. The number of proximity sensors connected in series is dependent on the available voltage to energize the PLC input or load. This voltage is calculated as the sum of voltage drops across each sensor subtracted from the available power supply voltage.

Let's use as an example three of the AutomationDirect APS24 series 3-wire NPN sensors, where the brown wire is positive, the black wire is the output, and the blue wire is the negative. The load will be a PLC input. By connecting the sensors in series, all of the sensors must be activated in order for the PLC to receive an input signal.

Start by connecting the brown wire (BN+) of each sensor in a daisy chain configuration to the positive terminal (+) of a 24 VDC power supply.

Next, connect one side of the load (PLC input module) to the first sensors's brown wire (BN+) and the other side to the black wire (BK).

Then connect that same sensor's blue wire (BU-) to the second sensor's black wire (BK).

Connect the second sensor's blue wire (BU-) to the third sensor's black wire (BK).

For the final termination, connect the third sensor's blue wire (BU-) to the negative (-) terminal on the 24 VDC power supply.

In the case of a 2-wire sensor using a sinking configuration, connect one side of the load (PLC input) to the positive terminal (+) of a 24 VDC power supply and the other side of the load to the positive (BN+) of the first sensor.

Then, connect the negative (BK or BU-) of the first sensor to the positive (BN+) of the adjacent sensor, continuing this patterns as many times as needed, staying within the voltage restrictions previously mentioned.

Gerald D Sat 02 February 2008 09:51

2 Attachment(s)

Do I understand this right? . . . .

smreish Sat 02 February 2008 10:11

the automation direct nomenclature would suggest that you wiring is correct. But, for this scenario to work, all 3 switchs have to be high to output the signal. It acts more like an and+and+and circuit. My gut feeling is, for reliability that I use the 110v version of the sensors and isolate using a multipole relay to act like the series "contact" switches and have the pros energize the coil. I will draw it up later if I have a few minutes.

Gerald D Sat 02 February 2008 10:44

The way I envisaged the proxys to work, was for them all to permanently have metal in front of them (is that what you call "high"?). ie. they must all see a rail immediately in front of them. If any rail disappears, the chain is broken and the system switches. A rail could disappear by either:
- the sensor moving over the hole at the end of the rail (limit/home), or
- a car jumping off a rail when something goes horribly wrong.

smreish Sat 02 February 2008 12:17

I agree perfectly. That's why I like the Proximities. It will cause an interupt for things that happen other than overtravel. As we know, the overtravel of an axis will hit a hard stop and has no real implications.

So, if we use proxys, and want Mach 3 logic to work, we most certainly are going to have to reverse the "sense" of the proximity with a relay to allow for the BOB to correctly see both type of events and act as a Overtravel limit switch.

I will pull up my schematic and charts tonight to review the NPN PNP logic against true TTL sensors and see if I can come up with a signal flow that works well for the Proxy's. My true concern right now, is the voltage from the BOB. I don't have any success using a voltage as low as 5volts for limit switchss of any kind. 12V minimum. It would just happen that my Antek transformer was ordered with 5V, 12V and 56V outputs so I do have some room to make 12VDC or 110V AC work with the sensors.

...more later as I dig deeper into the school books.


Gerald D Sat 02 February 2008 12:48

Sean, I would like to avoid relays if possible. Not sure why you want to "reverse the sense" . . . . the BOB can be pulled up or down, Mach3 can be set active high or active low....?

As to the voltage for inputing to the BOB, couldn't it be dropped over a resistor?

....or transistor instead of relay?

smreish Sat 02 February 2008 13:13

hmm. Good points. I like the resistor idea to get the correct voltage at the bob. I'm convinced I have a working solution using proxys and 1 pmdx input. I'll order some proxys on Monday and get to work.

Richards Sat 02 February 2008 20:01

1 Attachment(s)
Sorry guys, but I spent the day getting a rush order out, so I'm late to this discussion.

Gerald, your schematic could work, but you'll lose about 1V for each NPN transistor. A normal TTL signal has to have at least 2.2V for a HIGH signal and not more than 0.7V for a LOW signal. Typically, it's best to not daisy-chain NPN transistors.

The way that I normally use proximity sensors is to have each sensor drive its own opto-coupler device. That way, it doesn't matter whether the proximity sensor works from 5V or 24V because all that it needs to do is to turn on an L.E.D (which takes about 10mA). Then, if I wanted to use multiple proximity sensors, I would connect the output from each opto-coupler to an AND gate or NAND gate (depending on whether I wanted a HIGH or a LOW signal). Although it would take a little bit of wiring, the cost is low when each opto-coupler costs less than $1 and each AND or NAND chip costs less than $0.50. Add a few resistors at $0.10 each and you have your circuit.

smreish Sat 02 February 2008 20:27

1 Attachment(s)
all members that are better at electronics than me, please step in here. After much reading tonight, this is my understanding of how to make standard 12-24vdc proximity switches work together.
The pull down value of the resistor needs to be determined on the test bench due to the fact that the voltage reduction value for each sensor is not known and not really published. Tech support said it dropped "some".....not much of a help.

I have added to Gerald's doodle for additional comments on the subject.

Attachment 894

Richards Sun 03 February 2008 08:57

The circuit that you posted has me confused. Right now, I can't see how it would work. Let's revisit Gerald's schematic and proximity switch diagram on post #17 and use the diagram as the starting point.

The BROWN wire simply feeds the DC+ voltage to the proximity switch.

The BLACK wire is connected to the NPN transistor's collector. AND, the BLACK wire is connected between the collector and the load. That means that when the NPN transistor is OFF, a voltage reading of the BLACK wire with be almost exactly the same as a voltage reading of the BROWN wire (if we measure the voltages in relation to Ground). When the NPN transistor is ON, the voltage reading will be almost exactly the same as a voltage reading of the BLUE wire, or Zero volts.

The BLUE wire is DC Ground.

So, looking at Gerald's schematic (which exactly matches the Automation Direct FAQ sheet), the top sensor, when off, will supply a + or high voltage to the PMDX-122 input. In fact, any time any ONE of the proximity sensors is OFF (transistor not conducting), the output signal to the PMDX-122 will be High. ALL three proximity sensors must be ON (all transistors conducting) before the signal going to the PMDX-122 will be Low. Even, then, the signal may not be Low enough to actually be seen as a Low signal by the PMDX-122 because of the possible voltage drop across the two bottom proximity switches. If they turn fully ON (saturated), then the circuit would probably work; however, if each proximity switch is not saturated and only pulls the voltage down to 0.25V or 0.35V, then the sum of all voltages might be higher than allowed (0.7V maximum for a Low signal).

That reasoning is why most designers would make each proximity switch output feed a unique TTL gate. HOWEVER, if the proximity switches were running a relay (where the current being pushed into or pulled out of the coil was the only important thing), the circuit would probably work very well.

Gerald D Sun 03 February 2008 09:30

Originally Posted by Richards View Post
Although it would take a little bit of wiring, the cost is low when each opto-coupler costs less than $1 and each AND or NAND chip costs less than $0.50. Add a few resistors at $0.10 each and you have your circuit.
Thanks for taking time out of your busy schedule to look at this Mike. Have you got some some typical chip numbers for us?

I envisage that we would have to get a little printed circuit board made up and that we could post this little board out to the builders who want to go with proxies. In my minds eye I see 4 sets of 3 terminals for 4 proxies, a pair of terminals for 12VDC in and a pair of terminals for output to the PMDX. But I don't know what goes on the middle of the board yet . . . . :)

At one stage I thought the simplest was a relay per proxy - the proxy can drive a small relay directly.

Richards Sun 03 February 2008 09:52

For most people, using relays would be best. Many small relays only require the coil current to be 5 to 10mA, which should work with a proximity switch.

Building a circuit board to use 7400 AND chips and 4N25 (or similar) opto-couplers would not be hard, but I think your relay idea would be better.

Gerald D Sun 03 February 2008 10:04

For me, relays are easy to understand, troubleshoot & replace. But the key seems to be a neat little PC board with all the terminals clearly spelled out.

But, are we not reinventing the wheel here? Surely such boards are already floating around in some small CNC community? This forum has nearly 3000 members, mostly invisible_grab_plans_&_run types, but somebody must of heard of something somewhere? :)

Doug_Ford Sun 03 February 2008 11:24

If you smart guys can figure out what parts need to go into it and how they ought to be wired together, I'll be more than happy to buy the parts, assemble them, and use my machine as a test bed. Unfortunately, I have zero expertise to contribute to the design phase of the project. Sorry.

All times are GMT -6. The time now is 20:36.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.