PDA

View Full Version : Touch probe woe's



Smokie555
25-01-2023, 07:24 PM
Hi, I hope someone can help me,.. I was trying to setup a cheap touch probe with my 6040/Gecko 540 CNC.

I have a height touch plate connected and working great through a 2.1mm connector jack on the front of my control box so I wanted to use the same plug in connection to work with the touch probe.

Problem is the touch plate simply grounds the centre input pin when the cutter contacts an earthed metal surface, were as the touch probes output wire switches its high 5v signal down to 0v when it touches something.

I thought I had it sorted by building a circuit using a 4011 NAND gate to invert this action (low to high) and then switch a mosfet module like a fast relay to act like the touch plate by simply grounding the Gecko’s input pin across the 0V in and -V out on the mosfet module.

Worked great on the bench with a meter set to buzzer but unfortunately when I tried it on the machine the Gecko pin stays in the earthed state (mosfet relay connected) regardless of the touch probes state (high or low). Maybe a mosfet leaks a little? But I’m no expert on the electronics.

Can anyone suggest what's wrong or think of a better solution. Cheers Ross

m_c
26-01-2023, 12:27 PM
That probe shouldn't need any inverting.

As it stands, the G540 input pin must float/be pulled high (I couldn't find the exact details from a quick scan over the gecko site).
Having the probe pull that input to 5V should be fine, as even if it's not opto-isolated a PP should be 5V tolerant.
The probe will then simple switch it to ground when activated.

Smokie555
26-01-2023, 02:13 PM
Thanks for the help m_c and I hope I can follow this.

My Gecko input pin currently reads 12v, when I earth this pin to the Gecko it triggers Mach3’s LED correctly for my touch plate, so do I connect the touch probe output to the 12v input pin? And does the touch probe need to be on the same power supply as the Gecko for a common earth?

Sorry if I sound a bit dumb but I’m better with the mechical stuff

Cheers
Ross

m_c
26-01-2023, 11:40 PM
I did wonder what voltage the G540 pulled the input pin up to.

In that case I think you'd get away with only connecting two wires to the probe, assuming it is as simple as that circuit diagram shows for it (i.e. only a pull up resistor)
Assuming there is no fancy electronics in the probe itself (I doubt it), the only purpose of the 5-24V, is to pull the probe output high.

So if you connect the probe ground, and output in a similar way you connected your touch plate, it should work.

The only thing to be aware of, is what is the rated current of the probe output?
I'd hope it'll be good for at least 20mA, but I'd also just double check how much current the G540 takes to pull the input low.

Smokie555
27-01-2023, 12:35 AM
Cheers m_c, I think you've got it right, the probe has a tiny circuit board inside with two LEDs (green open and red for a touch indication) so I think the power + wire is mainly to supply these so maybe the earth and signal hooked up to the Gecko pin is all I need. You won't believe what I have done this passed week to try a get this working, here's a video but don't laugh. I'll give it a try tomorrow.

https://youtu.be/Ph3E028JaNc

m_c
27-01-2023, 01:42 AM
That complicates things somewhat.
The diagram for the probe is just a basic functional diagram then, and there's a bit more going on in it.

Have you measured the output voltage on the probe pin?
It might work by simply connecting the probe output (and GND) to the G540, but there's a potential the two might conflict with each other.
I would think given the probe is designed to accept 5-24V and with a NO output, it's output circuit should handle the 12V from the G540.
My concern would be if the probe voltage is grossly higher or lower than the 12V, but it all depends on the exact circuit in the probe.

This is the problem when there's a lack of documentation.

If needed, I'd implement a basic NPN transistor setup.

JohnHaine
27-01-2023, 02:01 PM
These probes are basically to the original Renishaw design, which in effect have a pair of contacts that are closed before triggered and open when the probe moves the slightest amount. So this is the opposite logic to a touch plate that is grounded on touch. The probe incorporates an inverter so the output is active low.

I have the same probe that I use with Mach3 on a 5V BoB supplied by 5V from a USB wall wart - the probe connector is basically USB-C and I assume the electronics is designed for a 5V supply so I'd be wary about connecting the output to a higher voltage. If you can change the sense of the probe signal in your config, the easiest thing would be to just drive the gate of your MOSFET from the probe output and have a pullup to the Gecko +ve supply (which may be internal anyway). I'd just use a standard logic level MOSFET - or just an NPN transistor. The probes work great by the way.

Smokie555
27-01-2023, 07:25 PM
The output voltage from the probe seems to match the input voltage so it can be 5v to 24v. I opened my CNC control box today to try the probe output and earth idea but had forgot my Gecko power supply is 48v which complacated things again. I did try dropping the voltage to the probe to 12v with a buck convertor inline with the 48v supply but no joy.

I’m just doing something wrong and as John Haine says his works great.

I just need to get this probe output that drops to less than 1v when triggered to earth the gecko pin but my Mosfet setup didn’t work on the machine. Can you give me a guide on this NPN transistor setup as it sounds like the answer. Thank again for the great advice.

m_c
27-01-2023, 10:52 PM
Something like this -
31681

JohnHaine
28-01-2023, 01:39 PM
That's the sort of thing, but you need to know more about the Gecko inputs. Their manual is silent on the input config except to say that they expect to be grounded by a switch which implies there's a pullup resistor. Two things are needed, the internal voltage to which they are pulled up (which determines the max Vcc of the transistor needed) and the value of the resistor (which sets the transistor on current), It may well be that the voltage is 48v as you mention which would be OK for the 2n3904 m_c suggests. You could measure the on current by just connecting your multimeter on the current range between the input and Gnd. The maximum collector current for the 2n3904 is 200mA.

Then really the transistor needs a series resistor between the probe output and its base to limit the base current (as we don't know what the internal pullup in the probe is). In practice probably a 4k7 (4.7 k, 4700 ohms) would probably be fine to make sure the transistor saturates to pull down the input to ground.

Alternatively you could use a logic level MOSFET such as the IRLZ34N. This is reasonably beefy and would easily handle the voltage and any reasonable current. You just need to connect the probe output to the gate, the drain to the Gecko input, and the source to ground. Good practice would be a 100k resistor from gate to Gnd just to make sure the device is switched off when disconnected.

Smokie555
28-01-2023, 08:09 PM
This is just the info I need guys to get this thing working. Thanks to both of you for the time. I've just gone on a weeks holiday so won't be able to try this stuff until I get back but it will give me lots to think about until then. Cheers Ross

m_c
28-01-2023, 09:00 PM
Oops, I never realised that diagram had a transistor part number on it.
I just used the first online circuit diagram creator I found, and picked the NPN transistor. I did delete the resistor value, but never noticed the transistor had a part number.

The other option would be a micro-relay.
I've used DIP packaged relays in the past. Something like this - https://uk.rs-online.com/web/p/solid-state-relays/4801188 (that's just the first one I found)

Smokie555
29-01-2023, 09:11 AM
never seen a micro relay! Sounds nice and simple so I may try that, cheers

JohnHaine
29-01-2023, 04:39 PM
I would be slightly wary of a relay (assuming that it's electromagnetically operated) because of the possible extra delay.

m_c
29-01-2023, 05:42 PM
I would be slightly wary of a relay (assuming that it's electromagnetically operated) because of the possible extra delay.

For that one I linked to, typical turn on time is 0.1ms, and turn off 1ms.

On a typical home brew machine, those times are going to be negligible in the grand scheme of things.

JohnHaine
29-01-2023, 06:09 PM
It is actually a "solid state relay" so may be similar to what you were trying to use anyway.

Smokie555
29-01-2023, 06:43 PM
That tiny solid state relay sounds fast enough for me if it works, looking at John's transistor circuit its clear my wiring of the mosfet setup was all wrong. The input voltage on the gecko pin is 12v but I will check the current when I get back. I doubt it will be much as the microswitches for my limit switches on the other 3 gecko inputs would probibly arc a bit. All good stuff

Smokie555
30-01-2023, 09:56 PM
Just be looking at IRLZ34N online John, looks like a great solution. Just not sure how I power the probe, does it need to be from the Gecko's 48v supply and if so what is the best way to achieve this? If its ok to run it off a 5v USB supply or a 12v wall wart and do I need to connect the earths of the two supplies?

Cheers
Ross

JohnHaine
30-01-2023, 10:29 PM
Use an old phone charger with USB output, butcher a USB lead to get at the power conductors. Yes you MUST connect the earths. Probe is specced for 5V I think so you should use that.

Smokie555
05-02-2023, 01:28 PM
Well isn’t it funny the total pleasure a switching LED in Mach3 can bring!

Arrived home from the holidays and made up the circuit below on a bread board and what do you know it works!!

Thanks a million m-c and John for sorting this out for me. I had to uncheck the active low setting in Mach3 to have it work the correct way around but I’m sure I can add my 4011 gate IC to invert this signal on the touch probe so both my touch probe and Z tool height plate work with the same Mach settings and the same 2.1mm plug jack on my panel, if not I’ll just live with having to switch the active low setting depending on which probe I’m using. Thanks again for your patience help and advice, and look forward to making a nice printed circuit of this for the finished item.

Cheers
31727

JohnHaine
05-02-2023, 01:38 PM
Great, well done! MOSFETs are nice devices.

Neale
05-02-2023, 05:30 PM
It is a little-known and barely documented fact that there is one version of Mach3 that is able to support two probe inputs with independently-set parameters (active low, etc). It might well be easier to combine the two inputs electronically as already described here, but I bought a second-hand CNC mill whose control box had separate inputs for touch probe and height setter, so I needed to explore how it was done - particularly as I wanted to modify the probing routines to suit. I did consider the electronic signal combiner, but on my machine the input sockets were directly connected to a custom motherboard that would have been difficult to modify, and an outboard box would just have been a bit of a fiddle. And the existing machine ran with the "two input" configuration, so it needed exploration! By going through the provided probing routines, I found that they used an undocumented Mach3 feature that allowed a macro to switch between inputs to select an appropriate probe and I was able to adopt this to use in my own probing code. I wrote it up here (http://www.mycncuk.com/threads/14215-ESS-and-multiple-probe-inputs).

If you feel happier with electronics than code, then the external signal combiner is probably the way to go, but I like fiddling with both and was happy to find a software solution!

Then I scrapped the ESS and replaced it with a UC300ETH and UCCNC software, which support two probe inputs out of the box, so the problem just went away!

Smokie555
06-02-2023, 12:55 PM
That interesting on the Mach 3 versions. I've been fiddling with this on and off for a while and must have got a little muddled up as once I finally got a setup that Mach3 could see (above) it turns out the active low setting is working just fine with both the probe and touch plate which is great. Now using each probe is just a matter of plugging in the one you want and off you go, fantastic. Thanks for the link to your write up, all interesting stuff.