It depends on your electronics whether you should be using NPN or PNP prox sensors. I bought a heap of NPN ones and then found out I should have bought PNP ones. The solution was to add a pullup resistor. This video I found very useful.
Hi guys.
I have 3 proximity sensors on my cnc gantry that are used as homing switches. They are normal closed sensors and I believe they are NPN. When they get power the led on them is on. When they sense a metal object the led goes of and the state of the input changes to give the signal. I have been using it for a year now but I have started to think that there is an issue with the way they are wired and I would like some advice.
Here is a photo of my control box.
The ribon cable from the break out board connects to an adapter like this one.
One day after working on my control box I found out that the home switches stopped working. After a lot of trial and error I found out that the reason they stopped working was a strange issue with the adapter. This adapter is glued on the side of the control box where there is also an aluminum sheet. When the metal surrounding portion of the adapter is in contact with the aluminum sheet, the switches work fine. If I push a little bit the adapter and the surrounding metal portion is not in contact with the aluminum sheet the home switches power down and seem tripped on mach3.
I measured continuity between that aluminum sheet and my -12v connection on the 12v supply.
Here is how my break out board, 5v supply, 12v supply, and proximity sensor wiring is done at the moment.
And an illustration of it on my control box too.
So from what I get the return path to -12v is done through the aluminum sheet which has continuity with the -12v and when the metal portion of the adapter loses contact with the that aluminum sheet the switches power down.
What I have temporarily done to get it more reliable at the moment is to run a cable screwed on the -12v and the little bolt on the parallel adapter.
Here is a wiring diagram of this and a photo of the actual cable. It is the grey cable.
The home switches work fine this way. But I feel that this wiring is wrong and could cause some other issues. I had some issues with a touch plate that I am using to set zero which was triggering randomly before touching the touchplate some times. I installed a 0.1uF capacitor on the input of the touch plate to fix this.
From what I understand there is already a connection between -12v and ground. When the metal portion of the adapter touches the aluminum sheet another connection with the ground occurs which could create a ground loop??
After some research I think I found that the correct way to wire my proximity sensors is to not run the ground wire from the sensor to the break out board, but to the -12v terminal? And have -5v and -12v connected together? Like this diagram?
Any help would be great guys!
Similar Threads:
It depends on your electronics whether you should be using NPN or PNP prox sensors. I bought a heap of NPN ones and then found out I should have bought PNP ones. The solution was to add a pullup resistor. This video I found very useful.
Rod Webster
www.vmn.com.au
My bob has pull up resistors internally.
to investigate why I had unexpected results while testing the same BOB
I reverse engineered it to produce this circuit diagram
the 74HC14 used to buffer the inputs connected to the printer port pins 10 to 13 & 15 does not have the +5V supply connected to the IC's supply pin 14 !!!
so its only powered by any input or output pin that's at a logic 1
(about +4V depending on the volt drop across the 10K pullup resistors)
I added a wire link to pin 14 on the next 74HC14 IC
the input 10K pull up resistors are a little high and an external 1K pull up input resistor may improve things
I would not use a screw to connect the 12V negative to the 25pin D-Type connector shell
John
Last edited by john-100; 02-11-2018 at 10:12 AM. Reason: add proximity switch wiring diagram
Thanks for he reply. i have all my input pins occupied. Isn't what you show (connect -12v to ground on bob) the same as connecting -12v to -5v directly?
yes , but the reason I would connect the 12V power supplies negative connection to the BOB's input gnd terminal instead of the 5V power supplies negative terminal
is to avoid any electrical noise from the BOB's step & direction output signals being mixed with the BOB's inputs from the Proximity Sensors & Estop
to use all 5 inputs
you could connect the negative supply wires from two of the Proximity Sensors to one of the BOBs ground terminals
( I am assuming the input ground wires are small enough for 2 wire to go into one screw terminal )
John
Hmmm
Why would any noise be mixed if the connection is made between -12v and -5v?
From what I understand ground terminal on the bob is the same as -5v terminal on the bob. Right? Or are there any components between those two terminals? I maybe thinking something wrong here. So can you explain please? Thanks in advance!
the BOB does not have an electrolytic capacitor (or two) and several ceramic capacitors decoupling the 5V supply
as the 74HC224 buffer outputs switch between 0V & 5V a current of about 12mA will flow into the stepper driver opto-isolator
with 2 or 3 axis moving at once you can have several 12mA square wave currents being taken from the BOB's 5V supply
at high frequencies the supply wires acts as an inductors
and the impedance of the wire increases as the frequency increases
and can be very large compared to the resistance you will measure with your multimeter
depending on how long the negative 5V supply wire is ,your going to have a complex voltage dropped across the wire
that can be a problem, if the proximity sensors negative supply wiring is connected to the 5V supplies negative terminal instead of the BOB's gnd terminal
John
Cool I will connect it the way you suggested then and check how it works.
The spindle ground is connected to my bob, so I have only the touch plate connected on my input pin. So there is a free ground terminal after all.
Also what is the link of the power to input 74hc14 you mentioned for?
Also for the issue with the probe triggering on before touching some times, I added a 0.1uf capacitor between its input pin and ground which fixed it. I plan to add my 4 closed loop stepper drives fault outputs to my e stop chain. If I have any random estop trigger can I add another capacitor to the e stop input? Or will there be any problem with the one already installed?
I looked and my sensors today and they have this label.
So from what I understand they are NPN type but they are wired like this on my BOB.
Almost the same as in my case except that my blue cable goes to the load bob terminal instead of -12v and common terminal on my bob is connected with -12v.
But from what I see on those pictures it seems to be correct in my case.
based on the picture with the label attached. The+12V connect to the Brown . 0V or ground connects to the Blue and the input to the BOB connects to the Black wire of the sensor , this is an NPN sensor. Black is the sensor output ,Brown and Blue power the sensor, In your original wiring diagram you show 2 black wires coming out of the sensor, and the Black wire coming out of the sensor should connect to pin 12
Last edited by sparkness; 02-13-2018 at 12:47 PM.
the wire link I added to the BOB was to connect the missing +5V supply to pin 14 of the 74HC14 IC used to buffer the 5 BOB inputs
now I have looked at the photo of the proximity switch label
I have changed the colour of the wiring to match the colour of the sensor wires
with the mains earth/ground connected to the spindle to protect you from a possible shock due to a fault in the motor or the cable
you could have a problem due to an earth loop as the BOB's ground terminals are connected to the the mains earth /ground via the PC's power supply
the addition of an opto-isolator to the touch probe is one solution
John
PS
example of ready made opto-isolator board
Last edited by john-100; 02-13-2018 at 12:48 PM. Reason: add PS
that looks correct now, many of the proximity sensors wire this way. Brown to +V Blue to -V or Gnd. Black is the switched output
that looks correct now, many of the proximity sensors wire this way. Brown to +V Blue to -V or Gnd. Black is the switched output
some of those ebay Chinese BOB's have opto inputs
Thanks for the help guys.
At the moment I do not have issues with my probe. Since I added the capacitor everything works fine.
About the connection of pin 14 to +5v, my knowledge in electronics is limited so I do not understand what means that inputs are buffered. What is the difference of buffered inputs vs non buffered?
it means your input signal connects to a buffer before it goes to the parallel port .non buffered means you connect directly you the parallel port. the buffer in your case is a the 74hxx chip which acts as a unity amplifier