Need Help with Mechanical Limit Switch Wiring for homing

Discussion of tinyG control platform
Post Reply
jininjin
Posts: 33
Joined: Thu Oct 30, 2014 12:40 am

Need Help with Mechanical Limit Switch Wiring for homing

Post by jininjin » Wed Jun 01, 2016 3:51 am

For a NO homing switch how does the wiring work? Does Com wire go to X,Y min? Then the NO wire to ground or 3.3v?
Shapeoko 2
X,Y,Z Nema 23's 140 in-oz, ACME Z Axis, Quiet Cut Spindle 400w
ChiliPeppr, TinyG V8

WillAdams
Posts: 8562
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: Need Help with Mechanical Limit Switch Wiring for homing

Post by WillAdams » Wed Jun 01, 2016 10:58 am

Shapeoko 3XL #0006 w/ Carbide Compact Router w/0.125″ and ¼″ Carbide 3D precision collets
Nomad 883 Pro #596 (bamboo)

cmcgrath5035
Posts: 61
Joined: Thu Oct 31, 2013 6:56 pm
Location: Florida, USA

Re: Need Help with Mechanical Limit Switch Wiring for homing

Post by cmcgrath5035 » Wed Jun 01, 2016 12:19 pm

Wil's reference is rather comprehensive on the topic-should answer your question.

My general suggestions:
1. Always use shielded cable
2. Ground shield at tinyG end Only.
3. One wire to tinyG Ground
4. Other wire to tinyG Port Pin (e.g. Xmin, Ymin).
5 COM lead on switch to the grounded wire(NOT to Shield or the metal of the machine)
6. NO or NC lead on switch to Port-Pin-Wire

If you are using a purely mechanical switch, it is just a closure and polarity does not matter.

If you are using an electronic switch (Hall effect, proximity, etc.) typically they are polarity sensitive.

Good luck with your project
ShapeOko (V1) SN 1462
Dual 820mm Y, Double X, ACMEZ. V2 Motor Plates
TinyG V7 Controller; DUE and tinyGV9 test bed for tinyG2

jininjin
Posts: 33
Joined: Thu Oct 30, 2014 12:40 am

Re: Need Help with Mechanical Limit Switch Wiring for homing

Post by jininjin » Wed Jun 01, 2016 1:14 pm

Thanks, I did read through the Github but if I am not mistaken the line "To connect a switch to an input pin simply wire the switch across the ground and the input." is the only reference to wiring. I just wanted to clarify a bit more.

Just to clarify cmcgrath5035 I am using a simple mechanical switch in NO condition that has Com(s), VCC(+)(NO) and Grd(NC):

1. Always use shielded cable Is the dielectric insulator good enough or is it best to have that metal shield foil as well? I just reread your 2nd recommendation so I think that answers this question
2. Ground shield at tinyG end Only. This wire is from the shielded cable? Like this? https://ilesj.files.wordpress.com/2012/ ... rk-pin.jpg

Please let me know if I am wrong:
Switch Com(s) to TinyG Ground
Switch NO(VCC+) to TinyG corresponding x,y min for homing
Switch NC(grd) is this needed?
Shapeoko 2
X,Y,Z Nema 23's 140 in-oz, ACME Z Axis, Quiet Cut Spindle 400w
ChiliPeppr, TinyG V8

cmcgrath5035
Posts: 61
Joined: Thu Oct 31, 2013 6:56 pm
Location: Florida, USA

Re: Need Help with Mechanical Limit Switch Wiring for homing

Post by cmcgrath5035 » Wed Jun 01, 2016 3:46 pm

jininjin wrote:Thanks, I did read through the Github but if I am not mistaken the line "To connect a switch to an input pin simply wire the switch across the ground and the input." is the only reference to wiring. I just wanted to clarify a bit more.

Just to clarify cmcgrath5035 I am using a simple mechanical switch in NO condition that has Com(s), VCC(+)(NO) and Grd(NC):

1. Always use shielded cable Is the dielectric insulator good enough or is it best to have that metal shield foil as well? I just reread your 2nd recommendation so I think that answers this question
2. Ground shield at tinyG end Only. This wire is from the shielded cable? Like this? https://ilesj.files.wordpress.com/2012/ ... rk-pin.jpg

Please let me know if I am wrong:
Switch Com(s) to TinyG Ground
Switch NO(VCC+) to TinyG corresponding x,y min for homing
Switch NC(grd) is this needed?
Some shielded cable is a foil wrap with a drain wire, some is just a braid. You appear to have a braid.
Ground the braid, as you show in picture.

I find the marking on your switch to be somewhat confusing - are you sure it is a mechanical switch, not proximity(electronic)?

The port pins on tinyG are pulled to VCC with a resistor on board.
If you are configuring the port to have NO switches, the connect the NO connection on the switch to the Port pin, and Com to gnd.

Under Normal (non-operated) conditions, the port pin should measure 3.3V with a VOM.
If you manually (finger) operate the switch, Port should measure 0V (gnd).

Hope that helps.
ShapeOko (V1) SN 1462
Dual 820mm Y, Double X, ACMEZ. V2 Motor Plates
TinyG V7 Controller; DUE and tinyGV9 test bed for tinyG2

jininjin
Posts: 33
Joined: Thu Oct 30, 2014 12:40 am

Re: Need Help with Mechanical Limit Switch Wiring for homing

Post by jininjin » Wed Jun 01, 2016 4:12 pm

So any ground is fine for the braided wire? Just for more info I do not have the wire yet It was just a random google image to confirm type of wire I should get.

The switch I have actually reads NO, NC and Com. Disregard other markings I mentioned. It is a simple black switch with no LED or board attached. Im away so I cannot upload a picture.

Port pin is the 3.3v correct?

Thanks again for your help.
Shapeoko 2
X,Y,Z Nema 23's 140 in-oz, ACME Z Axis, Quiet Cut Spindle 400w
ChiliPeppr, TinyG V8

cmcgrath5035
Posts: 61
Joined: Thu Oct 31, 2013 6:56 pm
Location: Florida, USA

Re: Need Help with Mechanical Limit Switch Wiring for homing

Post by cmcgrath5035 » Wed Jun 01, 2016 5:51 pm

jininjin wrote:So any ground is fine for the braided wire? Just for more info I do not have the wire yet It was just a random google image to confirm type of wire I should get.

The switch I have actually reads NO, NC and Com. Disregard other markings I mentioned. It is a simple black switch with no LED or board attached. Im away so I cannot upload a picture.

Port pin is the 3.3v correct?

Thanks again for your help.
When I say Port pin, I mean Xmax, Xmin, Ymax, Ymin, etc, not the 3.3V connection.
Those screw terminals connect to a "Port" on the tinyG microController device.

The connection header on tinyG has 3.3V available, but you do not need it for this application..

I use the Vmot " - " screw for Power Supply Gnd as well as shield Gnd and Gnd for the wire out to the switch.
ShapeOko (V1) SN 1462
Dual 820mm Y, Double X, ACMEZ. V2 Motor Plates
TinyG V7 Controller; DUE and tinyGV9 test bed for tinyG2

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: Need Help with Mechanical Limit Switch Wiring for homing

Post by cvoinescu » Wed Jun 01, 2016 7:51 pm

cmcgrath5035 wrote:I use the Vmot " - " screw for Power Supply Gnd as well as shield Gnd and Gnd for the wire out to the switch.
That's not a great idea. If the wires somehow work themselves loose from the screw terminals, or the solder fails, you can end up applying the full Vmot through the limit switch inputs. Your TinyG will not survive long enough to hate you for that.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

Post Reply