PDA

View Full Version : Proximity limit switch problems



davrich
16-01-2014, 09:28 AM
I'll start by saying that I'm very new to all this. Chances are there is a simple solution to my problem, but as yet I haven't been able to find it.

I've built the majority of my CNC (CNC router parts Pro 4896) and I'm now looking to hook up the electronics and start the motors.

I bought the S Box control box from Marchantdice on ebay (Produced by Tonman CNC) CNC Controller 3 axis Desk top Router Mill Plasma | eBay (http://www.ebay.co.uk/itm/CNC-Controller-3-axis-Desk-top-Router-Mill-Plasma-/221246737092?pt=UK_BOI_Metalworking_Milling_Weldin g_Metalworking_Supplies_ET&hash=item3383554ac4.)

The one I bought was 4 axis and included pre wired E stop cables. The limit switches were the gate type switches as shown below (I'm sure that isnt the right description) and I have two wires per switch.

I'd already bought a set of proximity limit switches. New Inductive Proximity Sensor Detection Switch NPN DC 6-36V LJ12A3-4-Z/BX | eBay (http://www.ebay.co.uk/itm/400423784662?ru=http%3A%2F%2Fwww.ebay.co.uk%2Fsch% 2Fi.html%3F_sacat%3D0%26_from%3DR40%26_nkw%3D40042 3784662%26_rdc%3D1). As my machine has threaded limit switch holders I wanted to use that type specifically. My proximity switches have three wires, black, brown and blue. I asked Marchantdice what I needed to do to get things working. At first they suggested that I run an additional wire per switch back to the control box.

I wanted to avoid more wiring if I could, so I bought these 2 wire proximity switches, thinking that they would connect directly to my machine. LJ12A3-4-J/DZ 2-wire 4mm Tubular Inductive Proximity Sensor Switch | eBay (http://www.ebay.co.uk/itm/190837692803?ru=http%3A%2F%2Fwww.ebay.co.uk%2Fsch% 2Fi.html%3F_sacat%3D0%26_from%3DR40%26_nkw%3D19083 7692803%26_rdc%3D1)

When I connected these to my control box the light on the box for that axis' sensor did not light up. In Mach 3 diagnostics the switch was not working when I placed metal in front of it. When I reattached the gate switch the light came on and mach 3 worked.

I then tried the 3 wire proximity switches. I connected the black and blue wires to the two leads from my control box and the light on the control box lit up, but in Mach 3 diagnostics the switch was permanently on and would not trip when metal was placed in front of it. I tried switching "active low", but that made no difference.

It seems that the gate and 3 wire switches create a circuit, whereas my 2 wire ones didnt.

I asked Marchantdice again and they suggested that I buy another set of cabling from them, with proximity limit switches already attached. Having already spent approx £40 on two sets of limit switches and already having cabling obviously I'm not willing to pay out even more before I explore other possibilities.

I don't have much information re the S Box. It came with no instructions, Marchantdice web pages offer limited info and the manufacturer's website is in Chinese.

Ideally I want to use a 2 wire proximity switch to make use of the cabling I have. I really hope that someone has a quick and easy answer to this because my build has hit a brick wall.

I see that there are different types of proximity switches - NPN, NC etc. Do I just need two wire NPN limit switches by any chance?

Thanks in advance for any help.

David

EddyCurrent
16-01-2014, 02:04 PM
Try your 2 wire proximity with Blue to GND and Brown to the input.
One problem is the voltage, the inputs are probably 5v but could be 12v, your switch is 6v minimum.
I think 3 wire is better but you did not connect the 3 wire switch correctly, you need brown to +ve(12v), blue to -ve(GND), black to input.

davrich
16-01-2014, 02:13 PM
Great thanks Eddy, will try this tonight and let you know if it worked. Much appreciated.

JAZZCNC
16-01-2014, 07:14 PM
I think 3 wire is better but you did not connect the 3 wire switch correctly, you need brown to +ve(12v), blue to -ve(GND), black to input.

Eddy's correct but you'll need to make sure the input and switch share the same Dc Ground (-ve). If you Control has a 12V source then your probably sorted.

Another thing you may be having trouble with is that I'm 99% sure the Old switches will have been wired in series but with these NO (normally open) swithces you'll need to wire them in parallel. . . . . . . Chances are that's what Mechant dicey where meaning.?

Easy to way wire these 3 wire switches is to run each switch back to a box on machine and connect all switches together in there then just run a single 3 wire Cy cable back to the control box.

davrich
16-01-2014, 08:32 PM
Right I've had another go at this.

Eddy I tried wiring as per your suggestion. The lights on the S box came on and Mach 3 seems to look right too. Only thing is the switch doesn't trip when I move it towards metal or anything else for that matter.

3 of my switches don't light up the box at all when wired up in the same way as the one which seems to work. Its making me wonder whether I have a batch of duff switches?

This is how Marchantdice explained the wiring:

I've just taken one of our S-Box controllers to bits, the wiring for the limit switches and e/stop is as follows




Switches
Connector
Control Board


Prox Switch - Browns
Pin 1
VCC


Prox Switch1 - Black
Pin 2
S1


Prox Switch2 - Black
Pin 3
S2


Prox Switch3 - Black
Pin 4
S3


Not Used
Pin 5
S4


E/Stop - Yellow Prox Switch - Blues
Pin 6
Ground


Not Used
Pin 7
Not Used


E/Stop - Green
Pin 8
E-Stop




I've added a picture of what I wired together.

EddyCurrent
16-01-2014, 08:48 PM
So your picture shows the wire for a 3 wire switch + E/stop wires ?
It looks like you have the brown wire connected to black and yellow ?
You need brown to pin 1(VCC), black to either pin 2,3, or 4, blue to pin 6(Ground)
Eventually you will need 3 switches so just connect the browns together into pin1, the blacks will go one into each of pins 2,3,& 4 and the blues together into pin 6.

davrich
16-01-2014, 09:45 PM
I have 5 proximity switches in total, 2 on the x, 2 on the y and an x prime home.

Sorry I thought that all I had to do was attach the proximity switches to my cabling, but is it the case that it is just set up for E/stops? I wanted my switches to act as limit and e/stop, but will that not be possible?

Am I right in thinking that I need a length of wire to run back to the control box from each proximity switch? JAZZCNCs suggestion of a single 3 core wire would seem to make sense as it would use less wire. I can sort the wiring out, but would they negate the need for the existing wires I have which run to my switches?

EddyCurrent
16-01-2014, 10:12 PM
Time to clarify, there are limits and there are home switches.
As Jazz says it looks like your original wiring was in series with the E/stop and so are limits.
The ones I was talking about were the home switches.
Both can be wired in series but home switches sometimes have their own inputs. With this in mind it can be seen that using mechanical lever switches for limits makes life easy and for home switches that have their own inputs then proximity switches are okay too.
If proximity switches are required for limits they can be wired in parallel but only if they are the Normally Open type.

See if this thread sheds any light on it first.

http://www.mycncuk.com/forums/faqs-problems-solutions/483-wiring-home-limit-switches.html

Also see this, there are tabs across the top of the page that include series connected sensors too.
http://www.ab.com/en/epub/catalogs/12772/6543185/12041221/12041227/Parallel-Connected-Sensors.html

JAZZCNC
16-01-2014, 11:13 PM
Davrich

What I'm going to suggest will work for both HOME and LIMITS and just require single 4 core cable back to control box.

My preference is to have Home on separate Inputs to Limits so I'll describe this way.

Wire all BROWN and BLUE wires together for ALL switches at the machine (In a Box). Then wire All LIMIT Blacks Together in one connector block and all HOME Blacks in another Block.
Now on the single 4 core cable wire Pin1 at control to Brown, Pin6 to Blue, Pin2 to LIMITS Black, Pin3 to HOME Black.
Then in Mach3 set the Limit Input Signal for Limit++ and -- for all axis to PIN 2 and set the Active Low to a Tick. (Active High)
Do the same for HOME axis on all axis but set to pin3 and Active high.

Now you will have ALL limits wired in parallel and sharing same switch so if any switch trips Mach will see it.

Same for HOME switches. When Mach homes it only moves one axis at a time, starting with Z axis then Y axis lastly X axis so it doesn't need a separate input for each switch has it's only watching for one signal.

Same goes for the Limits Mach's just watching for a Signal and only needs to know where to look. Your only bothered that it stops when a limit is tripped so it's not that important that you know exactly which switch tripped only that one has.!! . . . .You'll know just by looking.

So to save wasting inputs and make life eaiser just do this.

IF you want to share HOME and LIMITS then you do exactly the same but wire ALL blacks to Input 2 and use 3 core cable. Then go into Config/General Config and turn off Home SW. safety.
Now when cutting Mach watches PIN2 and treats it has Limits. BUT when HOMING mach watches PIN2 and ignores it has a Limit and treats it has a HOME switch.
If you have never used HOME switches then what it does is ride upto the switch and trips it then backs OFF until no longer active. This way when it's finished your limits are not tripped and you have an accurate HOME location.
Mach also gives you the option to back away from the Switch a set distance and Call this Home position.

Hope this makes sense.!!!. . .Lol

EDIT: OH forgot to say that because your using LIMITS wired in Parallel using NO switches then your not has safe has the Old switches when wired in series.!! Reason being that now if a wire breaks on the limit switch you won't know until it doesn't work when hit. When wired in series you set the Active State to Low so if a wire snaps the circuit is broke and the signal state drops to Low and trips the limit.!!

You can still do this with Proximity switches but will need NC switches wired in series.

irving2008
17-01-2014, 08:21 AM
Never thought about this before, but if you are using parallel connected HOME switches you MUST configure Mach3 to back off them (unless that's the default) else it'll never home the 2nd and subsequent axis as it'll never see the switch state change.


Also, series connected NC surely only works with the 2-wire versions.

davrich
17-01-2014, 02:10 PM
I think I'm starting to get this.

JAZZCNC I've tried to map out what you've described in the PDF below. I've also attached the CNCRP diagram of where the relevant switches are located on the machine.

S1, S2 and S3 on my machine seem to relate to S1 - Y, S2 - X, S3 - X prime home. I've tried to match these up with Home 1, 2, 3 and Limit 1, 2 in the diagram. Hopefully you can offer some guidance if I've got the order wrong.

Mapping these back to the pins in the control box this leave S1 unallocated which doesn't seem right.

Would this setup eliminate the need for the mechanical e/stops I have or do I still need those on each axis? I would rather get rid of them if I could.

Thanks

JAZZCNC
17-01-2014, 07:30 PM
Never thought about this before, but if you are using parallel connected HOME switches you MUST configure Mach3 to back off them (unless that's the default) else it'll never home the 2nd and subsequent axis as it'll never see the switch state change.

Yes that's how Mach works Irving Hits the switch then backs off then Zero's the Axis before moving onto next axis.



Also, series connected NC surely only works with the 2-wire versions.

For Limits ONLY then Series wired Prox switches work just they have slower reaction times with each switch but for the few needed, esp if like me you use traveling switches that look for a target so only 1 each axis then it's not a problem.
The Link Eddy gave explains about series wired prox switches.!! Sensors - Outputs & Wiring (http://www.ab.com/en/epub/catalogs/12772/6543185/12041221/12041723/Wiring.html)

JAZZCNC
17-01-2014, 08:00 PM
Mapping these back to the pins in the control box this leave S1 unallocated which doesn't seem right.

Ok Well first of all under stand that you have 4 spare Inputs labelled S1-S4 and can use any you like for anything you like. In this case you have assigned S2 for Limits and S3 for homes. Could easily be S1 limits and S2 home doesn't matter so long has you Set the correct Pins inside Mach3 inputs. ie: S1 = pin2 so set Limit's ++ and Limits-- to pin 2.




S1, S2 and S3 on my machine seem to relate to S1 - Y, S2 - X, S3 - X prime home. I've tried to match these up with Home 1, 2, 3 and Limit 1, 2 in the diagram. Hopefully you can offer some guidance if I've got the order wrong.

Now this is were it changes regards Homing because you have 2 switches Homing one Axis to square the gantry.
So now you need to have the Second Switch (Home2) on X using it's own Input. The other switch(home Prime) can still be wired in parallel with the Y and Z axis so share same Input.

Now you wire it just the same regards Brown and Blue but will need an extra wire for the (home 2) signal (black) which will go back to it's own input.

So now you will have connections on the control will go.

All Limits = S1
HOME X(prime) Y & Z = S2
HOME X(Home1) = S3


Would this setup eliminate the need for the mechanical e/stops I have or do I still need those on each axis? I would rather get rid of them if I could.

Not sure what your meaning here about Mechanical E-stop.?

E-stop should be a Button that gets pressed and SHOULDN'T be removed under any circumstances. It should also be wired and setup in such away that it doesn't just send signals to the control software, like your doing in this instance with limits.

The E-stop should remove power to any devices that are relavant Ie drives, Vfd, spindle etc and then inform the control software an E-stop has happened. Often this is done thru the use of relays with low voltage controlling high voltage devices but this is a whole new area which I won't get into now. Just search the forum to find out more.

BUT what I will say is DONT REMOVE THE E-STOP and DONT rely on SOFTWARE controlled E-STOP.!!

davrich
27-01-2018, 08:17 PM
I decided to upgrade my cheap proximity switches and makeshift wiring for some Pepperl & Fuchs ones.

Seemed like a good idea, until now!

The ones I’ve bought are PNP https://www.pepperl-fuchs.com/global/en/classid_143.htm?view=productdetails&prodid=514.

I’ve hooked them all up and they light up when metal is placed in front of them.

Problem is, in Mach 3 th fact that the switch is tripped doesn’t register.

When I add my old Chinese cheap switch, it works fine.

Seems that the issue is that my old ones were NPN and the new ones are PNP.

can anyone tell me whether this is easily fixable by some tweaks to the wiring or am I better off just getting NPN sensors?

If any more information is needed to answer the question I’ll fill the gaps.

Thanks in advance

Doddy
18-02-2018, 01:18 PM
I decided to upgrade my cheap proximity switches and makeshift wiring for some Pepperl & Fuchs ones.

Seemed like a good idea, until now!

The ones I’ve bought are PNP https://www.pepperl-fuchs.com/global/en/classid_143.htm?view=productdetails&prodid=514.

I’ve hooked them all up and they light up when metal is placed in front of them.

Problem is, in Mach 3 th fact that the switch is tripped doesn’t register.

When I add my old Chinese cheap switch, it works fine.

Seems that the issue is that my old ones were NPN and the new ones are PNP.

can anyone tell me whether this is easily fixable by some tweaks to the wiring or am I better off just getting NPN sensors?

If any more information is needed to answer the question I’ll fill the gaps.

Thanks in advance

Sorry in a late reply to this - only found this thread by looking for information on inductive sensors.

For 3-wire sensors:-

NPN are low-side switching, so the sensor goes low impedance to ground in the presence of metal. PNP are high-side switching, so the sensor goes low impedance to supply-voltage in the presence of metal.

This has a bearing on how you wire these to your BoB, or whatever (for now, "BoB"). If the BoB's inputs are opto-coupled AND it presents both anode and cathode of the optocoupler input then you have a lot of flexibility, and either NPN or PNP can be made to work. For an NPN you'd connect the sensor output to the cathode of the optoisolator, and wire the anode to +5V (or +12V through a current limiting resistor). For a PNP, you'd wire the sensor output to the anode, and the cathode to ground (and if the sensor is powered by 12V, then probably have to include a current limiting resistor as well). More typically the BoBs (at least the couple I've come across) have the anodes of the optocouplers bonded to their own local 5V supply and you have to have low-side (i.e. NPN) switching - hence the NPN being the sensor of choice.

If you're stuck with PNPs and a low-side switching BoB, you *could* frig it a couple of ways. One to include a NPN transistor that is switched from the sensor output from the PNP - very easy, costs pennies and easily knocked up on strip board. Or, you *could* use the high-side switch to reverse-bias the LED in the optoisolator (it's naughty, but can be done) - connect the sensor output via a 470R resistor to the BoB input, connect a 220R resistor to ground (this allows the PNP to pull the cathode voltage up to reverse bias the optoisolator). In theory the cathode would sit around 4V with the PNP sensor "ON" and that's enough to stop the LED in the optoisolator illuminating. The only problem with this method is On is Off, and vice versa, that you have to invert the input in Mach3. You might have to play with the value of the 2 resistors, but keep the ratio the same (the series resistor from the sensor output having about twice the resistance of the external resistor from the BoB input to ground).

Something like

23786

(Note: I've not tried this, but it ought to work)

One word of warning - if you removed the pull-down resistor, or disconnected the 0V to it, you're going to exceed the max reverse voltage on the optoisolator and destroy that input. Either don't do this!, or place a diode - anode on the BoB input, cathode to the BoB's 5V supply to clamp the input voltage to not much more than 5V

john swift
18-02-2018, 05:31 PM
prompted by seeing Doddy's reply

I have 2 questions

1)
which BOB are you using ?
it could be one I have reverse engineered or
the BOB's circuit diagram available online

2)
what is the DC supply voltage you intend to power the
normally open PNP proximity switches ?

John

davrich
12-03-2018, 01:58 PM
Thanks for all replies on this.

Sorry, I didnt receive notifications that anyone had responded, so will check my preferences.

I ended up buying some NPN ones, so will be selling the others on.

Thanks again