Hello Guest it is March 28, 2024, 01:23:33 PM

Author Topic: Wiring Limit Switches  (Read 4375 times)

0 Members and 1 Guest are viewing this topic.

Wiring Limit Switches
« on: September 29, 2015, 01:27:53 PM »
Occasionally, I have to bite the bullet and admit how stupid I am.  Although I am a reasonably bright guy, I can't figure out electronics to save my butt.  I have spent hours reading online about limit switches and how to wire them, but even the most basic primer assumes that I know the difference between the three wires I am dealing with.  So I am going to ask some very basic questions and hope that someone will take pity on me and get me squared away.

I have 5 switches, each wired with a shielded cable.  That meaning two wires wrapped in foil and copper strands of wire wound around that.  There is a red, which I assume is for the 5v positive, a white, which I assume to be common, and the copper windings which I am pretty sure is the ground.  Red and white wires are connected to the NC terminal and it appears the copper wire is attached to the comm terminal.  I had hoped to have the switches set to X+ and X- to pin 11, Y+ and Y- to pin 12 and Z+ to pin 13.  That just seems to me to be the logical way of doing it.  I have read section 4.5 of the Mach 3 manual a couple times, and although I understand the principles, nothing there tells me which wire goes where.

I have tried connecting a single switch to pin 13 on my BOB by the following.  5v in to the red wire, ground to the copper and the white to the input pin.  I use the autoset feature in the ports and pins setup I seldom a reaction from the BOB when I trip the switch.  When I do get a reaction, it usually jumps to pin 10 or 11, instead of 13.  Not always, but as often as not.  I tested it with a 220 ohm resistor between the red and the 5v and without the resistor.  

I tested all the cables and all the switches for continuity and that does not seems to be the problem.  That pretty much narrows it down to operator error.  In this case, my stupidity in not knowing which wire does what!

I am resolved to just wiring them in series and having one pin for all the switches and letting Mach 3 decide how to handle limits.  To wire them in series, I am assuming it is like batteries, positive to negative and daisy chain them all the way to the end with 5v+ in the first switch and ground coming out of the last switch.  But is it Red, white, or both that get connected to the comm terminal on the next switch?  Which wire connects to the input pin, red or white?  Do I need a resistor to pull up the current, because it doesn't seem that 5v is passing through the switches when I have them powered?

Again, I am embarrassed by not understanding this stuff.  I really appreciate any help I can get.

Thanks
Dan

Re: Wiring Limit Switches
« Reply #1 on: September 29, 2015, 03:38:07 PM »
If you are getting input shown from pins other than the one you're connecting the switch to you have an issue you need to resolve before wiring in switches, you can do your testing with short wire links on the BOB to eliminate the variables introduced by switches on long runs of wire

Do you have a manual for your BOB?
Re: Wiring Limit Switches
« Reply #2 on: September 29, 2015, 05:09:44 PM »
If you are getting input shown from pins other than the one you're connecting the switch to you have an issue you need to resolve before wiring in switches, you can do your testing with short wire links on the BOB to eliminate the variables introduced by switches on long runs of wire

Do you have a manual for your BOB?

nope. no manual.  I think I am going to just test everything every different way possible until I figure it out.  What kind of voltage should I be getting from the switch when closed?  Because I not getting 5v. 
Re: Wiring Limit Switches
« Reply #3 on: September 29, 2015, 05:27:24 PM »
If your switch is connected to the BOB 5V and BOB input check for voltage across the switch when closed if you think it may be causing voltage drop, if there's no drop across the switch and you are getting less than 5v at the input then the input may be sinking enough current to cause the board's 5v supply to drop, kinda guessing without details for the BOB though,

 - Nick
Re: Wiring Limit Switches
« Reply #4 on: September 29, 2015, 08:27:39 PM »
Ran some more tests.  The pinouts on the BOB (11, 12, 13) all read 5v.  At NC, I get 0.0 volts on all three wires.  When I switch the lever, I get a reading of .4 volts on wither the read or the white wires.  Continuity is fine red to gnd (comm?) white to gnd, and red to white.  When I trip the switch, continuity between red and white is broken, so one of those is carrying my signal, correct?
Re: Wiring Limit Switches
« Reply #5 on: September 30, 2015, 03:32:01 AM »
That sounds like your BOB should be passing some signals to the parallel port, what's happening to the pin LEDs on the Diagnostics tab in MACH3 while you're switching on & off?

You mentioned getting signals on inputs which weren't being actuated, have you checked the readings on 12 and 13 whilst switching 11 to be sure that they are staying high?

When you actuate a switch you are making or breaking a circuit which here is pulling an input low, technically speaking both wires are carrying the signal and only convention, not functionality, dictates which way around you connect the red & white wires.

It's conventional to use common and normally closed connections on the switches and have the circuit open when the limit switch is actuated, that way in the event of a broken wire or connection you get a limit event rather than not knowing there's a problem until a crash tells you a switch isn't working,

 - Nick
Re: Wiring Limit Switches
« Reply #6 on: September 30, 2015, 12:13:29 PM »
Thanks Magiciner,

I went back and checked and, no, all the pins seem to be pulling low when I trip the switch.  All except 15, which has my estop wired to it.  My touch probe is wired to 10, and every time I get a signal from the limit switch the BOB deletes the settings for the probe.   Also, regardless of which pin I assign the switch to, the autoset always sets to pin 11 in Mach.

 I am wondering, since the pin itself is 5v+, why am I running power through the red wire directly from the source.  Now, when I hook up the white wire to the pin, I have two sources of 5 volt going in and when ever I open the switch it over powers all the pins on the BOB.

I am thinking that I run the red wire to the pin to get power from it and to pull down its power when the switch is tripped open.  I would save the white wire for hooking up the next switch in series.  The only question I have about that is which switch gets connected to ground?  Since I am running the white wire of the first switch to the comm of the second, will grounding the first switch be adequate or do I have to ground the comm on the second switch with the white wire from the first still connected?

I apologize for being so dense on this.  It just confuses the heck out of me.
« Last Edit: September 30, 2015, 12:15:52 PM by fortdick »
Re: Wiring Limit Switches
« Reply #7 on: September 30, 2015, 02:39:06 PM »
Update on my learning.  I got the home switches working.  Powering from the pin instead of the PS was the solution.  Pin # recognition works in Mach.  Now I have to figure out how to wire the limit switches in series with the home switches. 
Re: Wiring Limit Switches
« Reply #8 on: September 30, 2015, 05:29:00 PM »
all good now.  sometimes all you need is to be pointed in the right direction