PDA

View Full Version : 3 wire proximity switch help



mikem
30-09-2015, 11:14 PM
Hi guy's been reading this forum for a while now and it's been very informative. I built a 5 x 10 plasma table everything is running but the switches. I need some help on wiring a 3 wire proximity switch to a this BOBhttp://www.mycncuk.com/attachment.php?attachmentid=10760&d=1402504764&thumb=1The model switch is a LMP1-3005NA What I need to know is what wires go where.

Any help would be greatly appreciated


I'm using M542 drivers.
Motors

* Manufacturer Part Number: 23HS45-4204S
* Motor Type: Bipolar Stepper
* Step Angle: 1.8 deg.
* Holding Torque: 3.0Nm(425oz.in)
* Rated Current/phase: 4.2A
* Phase Resistance: 0.9ohms
* Inductance: 3.8mH+/-20%(1KHz)
BOB http://www.ebay.com/itm/Upgrade-Usb-5-Axis-Cnc-Breakout-Board-Interface-Adapter-For-Stepper-Motor-Driver-/181710794651?hash=item2a4eceaf9b

Thanks

Mike

komatias
01-10-2015, 09:33 AM
Hi Mike,

You will not be able to wire the proximity switches directly to this BOB unless they are 5V. They will not connect to your motor drivers either.

The simplest diagram I can find is here: http://www.cnczone.com/forums/gecko-drives/112349-cnc.html
It shows a 4 wire version but that is only because the sensor there is more advanced.

It will also help if you have a look at "Transistor" in wikipedia and such.

Can you point us in the direction of a datasheet for your sensors?

JAZZCNC
01-10-2015, 04:20 PM
You can do this but will need a resistor or two.! . . . Thou can't help any more without knowing the switch type. ie NPN or PNP and date sheet on the switch.
Also what voltage you want to power the switch with.? Ie 12V, 24V most prox switch will take between 6 - 36v

mikem
01-10-2015, 08:39 PM
First of all thank you guys for replying.

it's a 6 - 36v switch the wiring diagram that came with the switch is attached and I also included a picture of the switch. Since I'm not and electronics person I'm trying to find which wires go to what pin numbers and if a transistor is needed which one and how to connect it. I
Im using a 12v transformer to power the switch.

Thanks again for the help if you need me to list something else I missed let me know.

bobby
01-10-2015, 10:23 PM
First of all thank you guys for replying.

it's a 6 - 36v switch the wiring diagram that came with the switch is attached and I also included a picture of the switch. Since I'm not and electronics person I'm trying to find which wires go to what pin numbers and if a transistor is needed which one and how to connect it. I
Im using a 12v transformer to power the switch.

Thanks again for the help if you need me to list something else I missed let me know.

I thinks they are simply a +, - and a 'switch' wire.

I had a similier type, Brown to +5v, Blue to Ground (-5v), and the black wire to the 'Limit switch' terminal on my controller....
I used NC Studio.

cropwell
01-10-2015, 10:45 PM
First of all you will need a 12v DC power supply.

The sensor is designed to work from a supply of 6 to 36v +V (Brown wire). 0V (ground) is connected to the Blue wire and the black wire is the sensor output, which switches to ground when triggered. When not triggered the black wire can be considered as not connected to anything internally in the sensor.

You will need a load resistor connected from 5v on the BoB to the black wire and to the input pin on the BoB. I use 10k ohm, the value is not critical but ideally should not be less than 1k or greater than 47k. The blue wire from the sensor should also be connected to ground on the BoB. The BoB must be supplied with a separate 5v power supply and I do not recommend using USB from the computer. This type of sensor acts as a switch between the black and blue wires. I have found that though rated 6-36v they do not work reliably below 10v.

Mach3 sees the input as triggered when it is at 0v.

http://www.mycncuk.com/image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAToAAAC/CAIAAADhKofUAAAM60lEQVR4nO2dW47kthmFuS4tSOvQErQa7W JsN9r2NFozjbbdMJx44CRGnME4MZQHShRvokoqqn4d1vnABw11 qb8H9RWvItVACAFBSQdACLkU6koIDNT13PRtpTyqtpeOighBXc 9N31aq7uycrlZeDrkbqOu5CXUdupoF7L1CXc9NtHTVGX1bVXVd qbGwnavNWmbrzr6tTImsZe/bStXtdAftR4G6nptI23Wyy5bQriJPh7OvXV1VlZG4ant97/gc1q5xoK7nJixd 7bSopkD/7KptjyqOXR11XZtZSu8eC85NdT13MTbrl7p6bVnzQlT8a27sQ4 91aTte6krDtT13CS6mhaVm93talW3VhnbWu1e6goIdT03gUtzN dZX1G 76mOn1TodU1dQqOu5iXQ1LWjm9wzPmZbGsfYqdcWBuhICA3UlB AbqSggM1JUQGKgrITBQV0JgoK6EwEBdCYGBuhICA3UlBAbqSgg M1JUQGKgrITBoXc36P4PzDsi0TIjzvgZX9iJECDV0tfNalmXue Gi77P/LepBqd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rvvftPJfGntTDv/PAT/wcZG 8DyNTrf0f7DTvhHkixoIaNaJk6dE2NmOJCzoqvV6 tvBTgMg9Ptuzq3eHvYYTDVPLMqmFK1MP9xt67iw hMFyZbSJ0uOSWeFr/3qnl8/PT4 CnUVeeHpyYpjACTpnouoTf0Gg7G5iCiq7Wpwzz0Y2rG0V8KT9d NKc/fQQ4mdPKSU7Kkv3ihlnZmVNf4979vq7oztoRyrnX3bvmLlgOyP nfMTX0u9SuewirDDw9/N0l/de0cnendFRdgzA2L1WEYspatF7Vdx2x3tyRyl5TU1eTJGaZI2T NOPprou86e6NvVqu46b0 xrMqs9gzbufmazKREgOpWSjVff/1LOl3Sdg1m4Zvpg4dssIvze0hOzx3outAz7HQMq7qzZhFn7Rum riQbWLq e/dzOp3wz6GuJBsn/H4vQV3JvXPC7/cSoKOM1JVk44Tf78KgriQb1PVoqCvJBnU9GupKskFdj4a6kmxQ 16OhriQb1PVoqCvJBnU9GupKskFdj4a6kmxQ16OhriQb1PVoqC vZwNalQs48oQ8R6kqyQSePhroSAgN1JQQG6kr2wPaqCNSVEBio KyEwUFdCYKCu5CrYZL0l/wewWTrWUXDN gAAAABJRU5ErkJggg==

cropwell
01-10-2015, 10:49 PM
The Blue wire label should be underneath pointing to the 0v (ground) line.
I put a circuit diagram in here, but it got lost in the post. :disillusionment:http://www.mycncuk.com/attachment.php?attachmentid=16197&stc=1

Clive S
01-10-2015, 11:00 PM
That's an excellent answer Doc Cropwell:beer:

mikem
01-10-2015, 11:59 PM
I'd like to thank all you guys for the help. When I get home saturday I'll hook them up the way explained.

Mike

mikem
05-10-2015, 06:48 PM
cropwell (http://www.mycncuk.com/members/8561-cropwell)

I connected them the way you said and it works. I conected the black wire to the imput and the 5v on the BOB. Now I'm trying to connect them in a junction box and the Y+ will trip but the Y- won't when there conected together. Can you tell what you think is wrong.

I used 1 4300 ohm transistor on the end at the BOB for both switches. I'm wondering if all the switches have to be run back to the board with seperate transistors.

They are the two blue switches on the bottom of the picture.

cropwell
05-10-2015, 07:22 PM
Yes, each BoB input has to have its own resistor. The resistor pulls up the input to 5v (logic 'high') as its' normal state. When triggered the proximity switch pulls the input to 0v (logic low), so Mach3 has to see the input as 'active low'. Without the resistor you have a 'floating' input and the voltage on it could be anywhere, so it would not be predictable or reliable, and probably not work at all.

It is possible to configure switches as groups, but unless I was struggling for input pins, I wouldn't go there unless I had to.

Cheers,

Rob-T

JAZZCNC
05-10-2015, 07:33 PM
Now I'm trying to connect them in a junction box and the Y+ will trip but the Y- won't when there conected together.

If those switches are traveling with the gantry then you only need one switch. Just put targets at each end to trip the switch.
Then Set Y++ and Y-- input to the same pin number.!

mikem
05-10-2015, 09:21 PM
JAZZCNC

I read what your saying as use two switches but conect them to the same input pin on the BOB like cropwell sugestead. Is that what your saying?

cropwell
05-10-2015, 10:00 PM
Hi

JAZZ and I are saying different things.

JAZZ says that the two ends of travel actually only need one switch, but with a trigger point at each end. in the Mach3 config screen the ++ and -- inputs for that axis will have the same pin settings. Mach3 knows which direction it is travelling so it will recognise as ++ or -- accordingly.

What I am saying is that if you are using two switches it is a simpler practice to use two inputs on the BoB. Each input pin needs a pull-up resistor.http://www.mycncuk.com/attachment.php?attachmentid=16220&stc=1&thumb=1

Here is a useful document - if you can't see it PM me with your email address and I will send it to you.

Cheers,

Rob

JAZZCNC
05-10-2015, 10:34 PM
JAZZCNC

I read what your saying as use two switches but conect them to the same input pin on the BOB like cropwell sugestead. Is that what your saying?

No I'm saying just use One switch. These switches sense a metal object for the trigger so just place trigger at each end using only one switch and one input.
Then set the limit Inputs for both ends to the same pin number. Mach doesn't care or even Know which switch tripped it just watches the designated input.

You can even Share the same Switch and one end trigger for Home function if you like by just setting Mach Home input for that axis to same pin number. Then turn off the Home SW option in General config so turns off Limits while it's homing and you don't get a limit trip. After homing Mach turns limits back on so your safe again.

Doing this means you only need 3 inputs for all axis including homing.

Edit: Doh didn't see Rob beat me to reply.

mikem
05-10-2015, 10:48 PM
Jazz

That's exactly what I'm trying to do us 3 imputs for all axis. If I just use one swithh for the Y axis the switch is facing one way and picks up the metal object. What is going to trigger it going the other way if the switch isn't going to come in contact with the metal stop? How do I get to trigger it going the other way?
Mike

Neale
05-10-2015, 11:02 PM
Make the switch point down, not sideways, and set the trigger pieces of metal just below it at each end of travel. It sounds as if this wouldn't give such accurate results but Jazz did some experiments a little while ago that showed this to work well.

mikem
05-10-2015, 11:07 PM
Ok thanks make a lot of sence that way. I'll try it and see how it works.

Thanks Again

JAZZCNC
05-10-2015, 11:12 PM
Make the switch point down, not sideways, and set the trigger pieces of metal just below it at each end of travel. It sounds as if this wouldn't give such accurate results but Jazz did some experiments a little while ago that showed this to work well.

Yes sorry I didn't look closely at the way you had the switches pointed. Neal is correct it does work very well I use the round type switch like this all the time.
Also saves the switches getting smashed by riding over the target rather than into end stops.

Keep the sensing distance small has possible for best accurecy.

mikem
06-10-2015, 12:23 AM
So why I got you I have another question. When I hook up on switch to the 5V on the BOB and to the imput lets say on the y it works.Then when I hook up the X and add another transistor to the 5v neither will work. just when it's a single resistor on the 5v do they work as soom as I add another nothing works.

Any thoughts?

cropwell
06-10-2015, 01:19 AM
Are you powering up the BoB from the USB input or a separate power supply? The reason I ask is that USB supplies a limited current and you might not have enough power to work the BoB and more than 1 resistor. You may remember that I recommended that you did not use the USB port on the computer to power the BoB !

cropwell
06-10-2015, 01:21 AM
Also saves the switches getting smashed by riding over the target rather than into end stops.

.

Been there, done that :stupid:

mikem
06-10-2015, 01:25 AM
No I'm using a separate 5v PS. The lights don't light up when it makes contact either. But when I put the Blue wire on the 12v ps with the + it's lights up brite

cropwell
06-10-2015, 02:23 AM
I think we have the problem !

The earth return paths are not connected. The blue wire from the sensor should be connected to the 0v (gnd) terminals on both power supplies and also (of course) to the 0v ground on the BoB. This is the most likely explanation of the symptoms.

mikem
06-10-2015, 03:24 AM
cropwell (http://www.mycncuk.com/members/8561-cropwell)
I ran the brown + wire to the positive on the 12v transformer. Then I ran the blue - to the Ground on the 12v transformer and the BOB gnd then I put the black on the input signal and the switch lit up but wouldn't trigger. So I disconnected the blue just from the transformer to the BOB and it now works like it should. It's more sensitive and works great.

So no transistors.

Thanks Mike