Limit Switch Wiring?

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

Re: Limit Switch Wiring?

Post by cvoinescu » Tue Oct 06, 2015 10:44 pm

I'd connect GND to the GND terminal of the limit switch connector: it's easier. Connect all 5 V from all switches together, and to the "+5V" pin of the "5V OUTPUT" connector.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

rodcar125
Posts: 67
Joined: Fri Feb 06, 2015 5:00 pm

Re: Limit Switch Wiring?

Post by rodcar125 » Wed Oct 07, 2015 7:28 pm

Thanks! I'll be installing them after work, hope everything goes without problems

bbbbspam
Posts: 1
Joined: Wed Nov 18, 2015 12:55 am

Re: Limit Switch Wiring?

Post by bbbbspam » Wed Nov 18, 2015 4:45 am

Hello everyone. I have found all of your posts to be very helpful and informative. My compliments and thanks.

I am still having incredible trouble getting my limit switches/homing switches to work correctly. Can I please get some help?

I have a Shapeoko 2, arduino uno r3 smd edition with a gshield v5b. i have flashed grbl 0.9j onto my arduino. I first tried using Hall Effect Sensors for switches because they are supposed to be more accurate. These switches were normally closed and gave a high signal all the time and triggered to low when in the proximity of a magnet. As a switch worked it was fine. I couldn't get grbl to co-operate with it. for example, as the arduino/gshield were unpowered by external power, the limit switches worked beautifully. As soon as I powered the supply on to power the stepper motors, the hard limit alarm sounded and not allow me to proceed.
I then tried mechanical switches which gave the same results.
''
My limited experience makes me think that i may have interference problems with my set up. I am in the process of replacing all the wiring with shielded wiring and have already done the proper step building a filter board as described in this forum.

I will say the switches all work beautifully while the stepper motors are not powered. I have tried to isolate individual stepper motor but have found that any combination of stepper motors will send an immediate limit alarm and gum up the works.

I have tried inverting the limit pins with not visible difference in its performance.

my filter board is just as described above ad=nd it seems to work beautifully. Thank you

I have tried to include all the information i could to help diagnose theses problems. please feel free top point out basic stupid mistakes. i am quiet green at all of this. My thanks for your knowledge and patients is greatly appreciated. Any help will be gratefully accepted.

Thanks again.

yours truly,'
Brad

olmec
Posts: 1
Joined: Mon Nov 23, 2015 7:27 am

Re: Limit Switch Wiring?

Post by olmec » Tue Nov 24, 2015 7:15 am

IMG_2276.jpg
IMG_2276.jpg (274.52 KiB) Viewed 16869 times
Hi all.

I just wanted to say thank you to Catalin for the schematics on this. I did not have a Schmitt trigger but it works very well.
I also used CAT6 shielded ethernet cable with it. Homing and limits works perfectly. I also added an additional 3 for when I wire in my reset, feed hold, resume buttons.
I connected it to the 5v terminal and not IOREF, I don't know if this is a problem, but I had to use an external source to power the arduino because it would reset if a switch was triggered.

Regards
Pierre

grep
Posts: 37
Joined: Tue Sep 29, 2015 8:16 pm

Re: Limit Switch Wiring?

Post by grep » Thu Dec 03, 2015 7:44 am

rodcar125 wrote:
Beemer533 wrote:Nice wiring job!

Assuming you have an S03 with the CM board, you only need the C and NC terminals wired from each limit switch... No separate 5v connection.
Thanks, took me a while.
Yes, forgot to mention that, I have an S3 and CM board...

But as I mentioned, I followed cvoinecsu diagram (6 posts above) where it connects 5V, common and GND to the switches, wiring it that way makes the signal cable see 5V in a normal state and if either switch is tripped it sees GND but im confused as where to connect them... I'm thinking that all the 5V and GNDs could be connected to the 5V output connector at the top left of the image below and just connect the single signal wire from the switches to the left pin of the input pins for X, Y and Z but could please someone confirm?
I have a shapeoko 3, i used this method :
I checked in this pdf, and guessed he connects the switches to their NO and C connections, as you can read here :

Code: Select all

To use hard limits with Grbl, the limit pins are held high with an internal pull-up resistor, so all you have to do is wire in a normally-open switch
from https://github.com/grbl/grbl/wiki/Configuring-Grbl-v0.9

Switches on the X (and Y) axis are wired in parralel.

It works well! ;)

Hope it helps,

G.

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

Re: Limit Switch Wiring?

Post by cvoinescu » Thu Dec 03, 2015 2:00 pm

I apologize, I should have clarified this earlier.

Please do not follow my advice to use the +5 V output on the Carbide Motion board. The Carbide Motion board already has filters and buffers on its inputs, so there's less of a need to do that; and you could fry the said buffers if they're a 3.3 V chip that does not have 5 V-compatible inputs (which I can't confirm without a schematic or an actual board).

You should use the +5 V (or IOREF) if your control board is an Arduino Uno. Yes, I know what the GRBL wiki says, but the internal pull-up are weak, and, for many users, in a noisy environment with a spindle and stepper motors nearby, they're not enough to avoid false limit switch triggering. Connecting the +5 V like I suggested makes a big difference, and costs next to nothing.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

Auarhau
Posts: 243
Joined: Tue Feb 25, 2014 8:46 pm

Re: Limit Switch Wiring?

Post by Auarhau » Thu Feb 04, 2016 9:40 pm

So it's been ages since I asked about this. But life finally gave me a free weekend to try and sort this out. And thanks to Cat, I managed to get homing and limit switches working. Thanks! I only had one crash, when I goofed up the Z and Y pins :mrgreen:

I'm a little unsure about my wiring still, but It works, so I guess I got it right. However I immediately started getting false triggers. They happen very frequent and very fast. I have some capasitors and that Schmidt trigger IC thing on order, so I will try to build the filter circuit when those arrives. What exactly does the Schmidt trigger do?
ShapeOko 2. Nema 17 74 oz·in. GAUPS shield on Arduino Uno. DRV8825 Drivers x4 . Kress 1050 FME-1. Z Acme Screw. Threaded inserts table.

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

Re: Limit Switch Wiring?

Post by cvoinescu » Thu Feb 04, 2016 11:32 pm

Auarhau wrote:What exactly does the Schmidt trigger do?
It has a thing called hysteresis.

Normal logic gates (and microcontroller inputs) have a voltage level below which the input is reliably considered a zero, and another voltage level above which the input is read as a one. Between these levels, the input may count as a zero, as a one, flip back and forth between them, or count as an invalid, indeterminate state that leads to invalid results. The actual levels depend on the logic type (or "family"). For instance, CMOS circuits tend to interpret anything below one-third of the supply voltage as zero, anything above two-thirds of the supply voltage as a one. Intermediate input voltages cause incorrect behavior, excessive current consumption, and even damage to the circuits if present more than briefly.

A Schmitt trigger solves this by eliminating the indeterminate region, and then some. A Schmitt trigger input will transition from registering a zero to registering a one at a certain threshold voltage; but it will not transition back to a zero unless the voltage decreased below a different, lower threshold. Above the high threshold, the input is always a one; below the low threshold, it's always a zero; and between the thresholds, it keeps the state it was in, either zero or one. The difference between the two voltage thresholds is the hysteresis. There is no undefined voltage region, and any change in input state needs a voltage swing at least as large as the hysteresis. This is much better at dealing with noise than a regular input.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

Auarhau
Posts: 243
Joined: Tue Feb 25, 2014 8:46 pm

Re: Limit Switch Wiring?

Post by Auarhau » Tue Feb 16, 2016 10:15 am

cvoinescu wrote:Here's more or less how I have my limit switches wired. I'm leaving the three spare inverting buffers unused (they could be used for a probe, for instance). I've only shown the two X axis switches: Y and Z connect the same way.
Filter_bb.png
Please note that the switches I found in Fritzing have their pins in this order: NO, common, NC. Most microswitches would be common, NO, NC. Almost all are labelled on the body of the switch. The red wire goes to NO on both switches, yellow is C on the left-hand switch, the black wire is NC on the right-hand switch, and orange connects NC of the left-hand switch to C of the other. This does not match my schematic exactly: I have flipped the +5V and GND connections to the switches, so that, after the 74HC14 inverts their signals, they appear normally open to GRBL.
I have begun to "decipher" the schematics and breadboard view now. It's a little hard, but I think I am slowly understanding. But I don't understand why the pin inputs 13, 11 and 9 on the IC is connected to ground? Those pins are not being used as far as I can tell. Also the capacitor in the top left corner is not in the schematics. What is the function and value of it?
ShapeOko 2. Nema 17 74 oz·in. GAUPS shield on Arduino Uno. DRV8825 Drivers x4 . Kress 1050 FME-1. Z Acme Screw. Threaded inserts table.

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

Re: Limit Switch Wiring?

Post by cvoinescu » Tue Feb 16, 2016 1:23 pm

The capacitor is a 0.1 µF decoupling capacitor. It's connected between +5V and GND near the IC. It's needed to suppress transient currents in the ground and supply lines, often caused by the outputs of the circuit switching capacitive loads. It's good practice to have one per IC, although some logic families don't need that many (one per board may be enough).

CMOS circuits need all inputs to be at a definite level, so they must be connected to something. They can't be left open. This may not be strictly necessary for Schmitt trigger inputs, but it's good practice to connect them too. (This is different from TTL logic, where unconnected inputs are safe, and they reliably read high.)
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

Post Reply