# Machsupport Forum

## Mach Discussion => General Mach Discussion => Topic started by: Lindzr on August 14, 2017, 11:56:30 PM

Title: Question about Mach3 and inductive proximity switches
Post by: Lindzr on August 14, 2017, 11:56:30 PM
I am building a router and have installed some 12v SN04 NPN NO proximity switches for limits that appear to have 10k internal pullup resistors (measure 10k between signal and +12v - black and brown leads).

The switches are powered by a 12v tap from the board, the board powered by a 24v regulated switching supply

My KL1212 board reads 5v on the inputs. I assume directly hooking up the 12v limits may fry the inputs on the board so with a bit of trial and error using resistors from my stash at my shop I have installed resistors from signal to ground that pull the signal voltage to nearly exactly 5v when the sensor not tripped, but when tripped there is about 0.7v as opposed to 0v as a low value.

I am a bit green when it comes to the inductive switches (I have used simple mechanical limits on other machines) and I am not sure how Mach determines hi and low values in terms of tripping limits in the software but I assume perfect would be 5v for hi and 0v for low but is there any leeway? Will the 0.7v reliably trip the limits as a low value? The 0.7v low voltage did not seem to appreciably change with subtle changes to the resistor values that kept the 5v reasonably in line, so I opted to use values that got me as close as possible to the board input voltage before attaching the limits.

I know I could use other components to get more perfect switching but am curious if this will work as is in Mach?

thanks!
Title: Re: Question about Mach3 and inductive proximity switches
Post by: joeaverage on August 15, 2017, 03:39:33 AM
Hi,
if using a parallel port Mach is reading TTL levels. If your PC is 5V then logic high is about 3.5V and higher and logic low about 1V and lower.
If your PC is 3.3V logic high is about 2.5V and higher and logic low about .8V and lower.

It is not necessary to get 'up to the max' nor 'down to the min', within a volt or so is good enuf. Its a good idea to think about the current
to be sourced or sunk at the PP. Most TTL will source 20mA or so but I prefer to keep it under 5mA however I like to make sure that it has
to source 1mA or so. I find noise immunity is best within these max-mins.

Craig
Title: Re: Question about Mach3 and inductive proximity switches
Post by: Lindzr on August 15, 2017, 03:24:57 PM
Thanks for the reply - that is helpful.

I assume by PC you mean the computer and the voltages you refer to are for a desktop parallel port voltage of 5v or a laptop of 3.3v?

I am using a laptop but with a UC400 ethernet smooth stepper connected to the KL-1212. I believe looking at the manual that the UC400 operates at 5v though its input voltage is 24v. Do your comments still apply since it passes through the db25 on the KL1212 to the UC400? I assume that the UC400 interprets from the 1212 as if it were a parallel port
Title: Re: Question about Mach3 and inductive proximity switches
Post by: joeaverage on August 16, 2017, 01:02:11 AM
Hi,
I guess that the BoB of KL1212 would signal the UC400 back and forth at TTL levels as described above.

The required levels at the input pins of the KL1212 are a matter for the manufacturer of the KL1212.
I have not seen a manual for it but would be looking for the circuit diagram for the input opto-isolators.
Do you have a manual?  If this is Chinese made they may not have included such a diagram, a real PITA.
US/European breakout board documentation is often better in this regard.

Having said all that it is highly probable that the voltage levels required at the KL1212 inputs are not really critical.
In fact if they are opto-isolators you're more interested in current, decrease your series dropper resistance until you see
about 10mA with the input active. Don't go too much over  10mA, it doesn't increase signalling reliablity much but
increases heat inside the optos.

Craig
Title: Re: Question about Mach3 and inductive proximity switches
Post by: Lindzr on August 16, 2017, 04:07:34 AM
No diagram but it looks like several optos on the board if I am right about and the description lists "...All of the input signal all the optical coupling isolation. P11, P12 port for high-speed optical coupling can be used for the spindle encoder, or handwheel..."

Looks like about 7 small rectangular optos where the writing is pretty microscopic and looks like it says B1624 but that does not seem to come up with anything when I google that number so I may not be reading it correctly.

I measure 15 and 18 mA with the resistor string I have now but that sits pretty much right at 5v when not tripped. How much over 5 volts do you think would be safe?

Their wiring diagram actually shows no resistors and all inputs on pin 13 (see attached) but I was hesitant to use the 12v limits on 5v inputs - everything I read about any other board it seems that people are pulling the voltage in line to roughly the input voltage so I was second guessing the diagram - maybe I am overthinking it... ha ha

Do you think the 12v straight in like the diagram would be safe? I know this might be hard to answer not having specs for the board but you seem to know your electronics more than I and might have some anecdotal evidence or at least suggest a cautious route.

I sent an email to John at Automationtechgiesinc where I got th eboard to double check but got no reply so thought I would post for some other input since I want to get this machine running.
Title: Re: Question about Mach3 and inductive proximity switches
Post by: joeaverage on August 16, 2017, 04:27:31 AM
Hi,
without a reliable diagram of the input pin circuit you have to guess and experiment. The probability of blowing it up while trying to work out
how its supposed to work is quite high. If it were mine I would probably try anyway, if I can't work out how to use it then its no bloody use
to me, and if I wreck it while trying well that's just bad luck.

I damn well know that the next BoB I buy will be US/European/Austrailian or anywhere really but a company that publishes the REQUIRED
circuit diagrams....and answer their email!

Craig