-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit Switch Wiring #96
Comments
@tklus : I'd like to see this as well, but I'm not an electrical engineer and don't want to give bad advice. |
Well. i just connected my switches between the pin 9 ,10,12 and ground. No resistor needed because off the internal pullup. Maybe the switch is false triggered because of motor wire induction. I soldered in some small capacitor to handle this. |
and where did you install the small cap? schematic? |
I think i did it somehow like this (i cannot go to my nc right now to check it ):
source: http://www.instructables.com/id/End-Stop-Limit-Switch-Problems/?ALLSTEPS#intro |
BTW: some people add the capacitor close to the switch, which is useful to debounce the switch. I would prefer to have it close to the arduino to reduce noise AND to debounce. Whenever the switching wires are running close to the motor wires they will pick up some induction and this might be large enough to trigger the limit pin. |
The best solution is to add opto couplers (like TLP185 http://uk.farnell.com/toshiba/tlp185-y-se/optocoupler-phototrans-3-75kv/dp/2524262): |
capacitor close to the MCU pin, series resistor to the switch, it offers a bit of protection against ESD and makes a lowpass with capacitor. A pullup sized so that the switch current at least a few mA, the low impendance is less senstitive to interference and most switches need a minium current to be reliable |
You might want to read this about debouncing: http://www.labbookpages.co.uk/electronics/debounce.html |
@luben111, that is a nice shield. are they available for sale? |
@tklus, I could organize some small production of these modules. Let me know do you have interest, I'll calculate what I could achieve as price for assembled module and for a kit. This is not the last version of the board. The new version has hardware ENABLE protection - after power up the Enable signal stays non active for 1.5s (independently from Arduino board) to avoid spontaneous motor movement. Sometimes after power up you can hear the machine with GRBL to make short noise like "grrr" which can burn your drivers (caused by the initial floating of the pins of the controller after power up) - after adding hardware to hold ENABLE in non active state for 1.5s things are OK. |
BTW, some thoughts about capacitors in parallel to switches:
|
@luben111 , maybe add a resister in series to limit the hi current when a cap is discharge? |
Old dot matrix has limit switch parallel with 103 small capacitor. Having large capacitor is not good to reduce noise. |
@parnz - adding serial resistor will increase the life of the switch and reduce the noises but will make much worse the problem with slow moving voltage levels on digital pins without Schmitt trigger. When the voltage changes slowly while passing the 0-1 threshold the inpur works as good analog amplifier (will amplify all high frequency noises around) plus the current consumption of controller jumps. Also not on last place you'll get delay in switches reaction, for high speeds it might be a problem. I would not recommend adding resistors on large electrolytic capacitors. |
@luben111 actually the ATmega328 does have schmitt trigger on all digital inputs, but I agree that the capacitors should definitely not be electrolytic, but ideally ceramic with a value in the order of 100nF. |
@electrokean - I'm not sure that Atmel I/O have Schmitt triggers (except for TWI CLK and DATA) I used to work many years in Atmel developing their capacitive sensors and we relied on the absence of Schmitt trigger on the inputs to get the QTouch technology running. In the data sheet you can see the gap between low and high input levels - this is not the Schmitt hysteresis but exactly the dangerous area where the input works as analog amplifier. You need to see explicitly Schmitt trigger features listed for the pin. There in one more reason to believe there is no Schmitt trigger on inputs - Atmel silicons are very fast (20MHz) and Schmitt trigger design is not compatible with high speed architecture because of different delays on falling/rising edges |
@luben111 OK, but that link is related to AVR32 which is a different class of mcu. |
@electrokean I have to agree with you that Atmega328 has Schmitt triggers inside - Figure 33-27 is related to the Schmitt characteristics (the hysteresis). |
Wasn't the original question about connecting up the limit switches using the NC pole in order to eliminate all the noise and adding caps and resistor? Also seems that you get a little more protection against broken wires. So where is the discussion about connection of limit switches using NC technique and what's the set up in GRBL. |
chamnit created a caption in the wiki for limit switch wiring. Maybe some of the experts here could help to make a (or some options) description to make a good limit switch wiring? |
@Lemonhawk, thanks for getting this back on subject. As I understand it, you wouldn't need capacitors and resistors in a normally closed system. And grbl has settings to run in a normally closed system. I would like to know how this should be wired and what settings should be changed in grbl. Thanks! |
NO vs NC doesn't reduce noise, it just changes what the noise causes. With NO, noise sometimes makes the switch look like it's pushed with it's not. With NC, noise sometimes makes the switch look like it's not pushed with it is. |
i use to have alot false triggers, I dont know how you guys have wired but i have my NC switches with the internal pullup and a external pullup with 1k resistor conected to the arduino IOREF pin and a capacitor betwen the arduino swuitchitcitch pin and GND and never had false triggers again |
But like @tklus asked would be nice to have this type off information on wiki page with the correct schematics for NC switches. |
@vMeph, is yours hooked up like the schematic I posted above? although I don't have the resistors drawn in. |
@tklus your schematic shows wired to NO Switch i have set all machine with shielded cables and i have wired my switches has NC like this, and on grbl settings changed like $5=1, never add problems again with false triggers One off the reasons i changed to NC switches was cause the noise issues and also cause it seems to me that NC switches are a better choise, cause lets supose a switch goes bad if they wired in NC the machine will stop, if is with NO machine will not stop i would agree with what @chamnit saied " but I'm not an electrical engineer and don't want to give bad advice" Would be great to have someone that is a electrical engineer and undestands what would be the better choise for plug in NC switches and provide information with clear schematics on wiki page, cause it seems that there is alot debates on this subject and some says is like this and other says is like that, and becomes a litle unclear in what to do |
@vMeph just for clarification and learning, see the attached markup of your pic |
VMeph, I don't think you need the resistor or cap in your diagram. The limit switch ports are set to use the internal pullup and in normal operation the pin is held to ground, thus preventing noise triggering the limit actuation. If all we need is to set $5=1 then we're done. I think we're all looking for agreement on this. I would really be weary of putting a 47uf cap on one of the Arduino pins - I think one of the above diagrams showed 0.47 uf, but typical noise caps would be 0.01 or 0.001 to kill HF noise. With an NC I think the caps are worthless. |
@Lemonhawk, that is what I was hoping for as well. |
Thanks @ukprinter, But the board was designed by @luben111 and he did an awesome job. I just produce them and sell them. I have been selling the boards now since 2017 and have had no issues. I get regular orders from a guy that sells huge machines running with this board. Only issue is that shipping from South Africa is quite expensive. Welcome to visit the website to place an order, just let me know your shipping address and I will get a quote for you. Ruben |
I already have 3 brands of CNC shields mate but cant find out the
connections as they documentation is very very limited.
It might well be something for the future but for now I am confused enough
with what I already have lol.
The main issue I have is finding out how to connect NC limit switches using
the protoneer 2.60 board with the raspberry Pi.
If I am forced to switch to Arduino completely I will bear you in mind.
what sort of documentation come with your boards??
Regards Andy T
…On Sat, Oct 3, 2020 at 11:50 AM Ruben ***@***.***> wrote:
Thanks @ukprinter <https://github.com/ukprinter>,
But the board was designed by @luben111 <https://github.com/luben111> and
he did an awesome job. I just produce them and sell them. I have been
selling the boards now since 2017 and have had no issues. I get regular
orders from a guy that sells huge machines running with this board.
Only issue is that shipping from South Africa is quite expensive.
Welcome to visit the website to place an order, just let me know your
shipping address and I will get a quote for you.
YRCNC.com <http://yrcnc.com>
Ruben
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#96 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKE5UWJTJDIJZNS66HCHHTTSI36XLANCNFSM4C44GGJQ>
.
|
I already have 3 brands of CNC shields mate but cant find out the connections as they documentation is very very limited. It might well be something for the future but for now I am confused enough with what I already have lol. The main issue I have is finding out how to connect NC limit switches using the protoneer 2.60 board with the raspberry Pi. If I am forced to switch to Arduino completely I will bear you in mind. what sort of documentation come with your boards?? |
For each axis you will connect the NC limit switches to the limit switch terminal for that axis and the GND terminal |
Cheers mate. Thats the way I assumed it should work but I was not sure if it could work with NC switches as the wiki says its NO switches 👍 https://wiki.protoneer.co.nz/Raspberry_Pi_CNC#Wiring_Diagram see the section on end stops. Its so frustrating that the basics are not even updated. :( |
You will need to invert the limit pins.
Because the NC switch connects the input to GND when not triggered, it will be normally low. |
Hi - I've implemented the limit switch opto-isolation circuit shown here: https://github.com/gnea/grbl/wiki/Wiring-Limit-Switches. My switches are held normally closed. I've added an LED "activation" indicator to the circuit. I've tested this circuit on a breadboard and it works - when the "switch" is opened (by pulling a wire out of the ground bus on the breadboard), the led lights. I'm wondering if any of you electronics geniuses out there have any advice for me on potential issues with this design before I commit it to a pcb: Note that the 1K pull up is acting as the current limiter on the LED, so it's not quite a bright as it would be with a 220-470 ohm resistor, but hey - beggers can't be choosers. :) One potential problem I noticed was that without the LED, the voltage drop between the output pin and ground is what you'd expect - 5 volts. But with the LED in place, the voltage drop becomes something closer to 2V - that is the LED is sucking the other three. Now, normally, the output pin is feeding voltage into the circuit as well if it's being held high as the grbl docs state, which makes me wonder if, when this is hooked up to an arduino, we'll be drawing current through both the 1K and the internal pull-up. It's more complicated than I originally thought. Gonna have to consider this more... |
@jcalcote what's the design goal? fwiw - I think you may be using an opto-isolator as a switch, but not really isolated. I think a genuine isolation circuit would use separate power supplies and not share the resistors. Also as a reminder, this won't be a debouncer. |
@gojimmypi you are correct of course. There's no true electrical isolation here and that was never the point, as the rest of this thread states in many comments. The point is, however to effectively debounce the switch in hardware. The combination of the optical connection, which has been shown to be slow enough to lose the noise, and a normally closed end stop solution is supposed to accomplish that. The point of my post was to get advice on how to add an LED indicator to the circuit, but I've since realized the only good way to accomplish this without a fair amount of extra hardware is to use the NO contact on the switch as several other designs do. Sadly, this requires me to run another wire to the switches which I really don't want to do, so I've given up on the idea for now. |
The LED limit the hi voltage output to 2~3 V.
If not needed omit them on the pcb.
El El vie, 11 de dic. de 2020 a la(s) 04:10, John Calcote <
[email protected]> escribió:
… @gojimmypi <https://github.com/gojimmypi> you are correct of course.
There's no true electrical isolation here and that was never the point, as
the rest of this thread states in many comments. The point is, however to
effectively debounce the switch in hardware. The combination of the optical
connection, which has been shown to be slow enough to lose the noise, and a
normally closed end stop solution is supposed to accomplish that.
The point of my post was to get advice on how to add an LED indicator to
the circuit, but I've since realized the only good way to accomplish this
without a fair amount of extra hardware is to use the NO contact on the
switch as several other designs do. Sadly, this requires me to run another
wire to the switches which I really don't want to do, so I've given up on
the idea for now.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#96 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACXBW4NNZKMRZSVO3WSJLZDSUHAVLANCNFSM4C44GGJQ>
.
|
Also the LED current may be insufficient. |
modern LEDs are usually quite bright at 3mA and the Vf of a blue LED is well above the Vih threshold (typical 2.6V @ 5V) |
@jcalcote sorry, I didn't mean to be discouraging. I agree it would be best to use a normally closed switch, and to not run any additional wires to the switch. Debounce: depending on the specific software, this may be irrelevant. I learned on my tiny 3080 desktop that once the switch is triggered, the software is locked until reset. That makes sense, as once an undesired limit is breached, the only course is manual adjustment, and then the software has lost track of where the cutting tool is located. I'm not very well versed in CNC machines in general; I don't know how the full size ones act. If you really wanted just a clean on/off, perhaps a latching flip-flop that is cleared with the same reset button that resets the software? Isolation: I do however - think it would be best to actually have the opto-isolator actually doing isolation. Maybe this could be effectively accomplished with another wall-wart power supply? Interesting that you wanted the opto-isolator to work slowly. This stackexchange thread mentions a PS2506 with a whopping 100us rise and fall time! (although I wonder if the output continues to move in the original direction if the input is still changing) Indicator LED: In any case, the LEDs in your circuit could be driven by transistors. The ULN2064B is one possible option: quad darlingtons in a single through-hole 16 pin package. This would separate and serve to supply more consistent current to each illuminated LED. (although as @langwadt noted, modern LEDs can be crazy bright with just a little current). |
In GRBL mega : M7 is turning on pin D9 and M8 is turning on pin D8. |
By default M7 and M8 activate air mist and flood coolant. M9 turns off all
coolants.
Are you trying to use these pins for controlling something other than
coolant ?
Or, do you have a special need to have both types on at the same time and
then want to turn only one of them off ?
Jay.
…On Tue, Aug 31, 2021, 1:35 AM ecncshopInd ***@***.***> wrote:
In GRBL mega : M7 is turning on pin Dx and M8 is turning on pin Dy.
But M9 is turning off both pins.
Is there any command to switch off only Dx ?
Is there any command to switch off only Dy ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#96 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHL2HSDW6UJ66ZVTWNUG7I3T7RSYXANCNFSM4C44GGJQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@JayPerez1 |
You can implement M62-M65. Perhaps there is a Mega port available that supports those M-codes? There are 32-bit ports that does. FYI coolant prins can be controlled individually with real-time commands (toggle only). |
So, a kinda gross solution is to switch both off and immediately switch on the one you want to keep on.
|
Hello guys, this place may be the better place to ask help. Any idea on my issue? |
Hello I must say that I am not an expert in electronics, apologies in advance for my lack of knowledge. I have made a DIY CNC and I am using an Arduino uno with cnc shield, I started perfectly when I already had the kinematics ready, I connected everything and managed to make it work, when I began to arrange my cables to do this in an orderly manner I realized that my limit switches are blocked and do not allow movement, investigating I came to the conclusion that apparently noise is filtering since I put all the cables together to remove them so that they looked organized, I bought the module i tried to connect it directly, but obviously this didn't work, could someone help me with a connection diagram, i think i must power it somehow, but i'm not an expert in electronics |
The terminals labeled “g” are the negative side of the input diodes. The
intent is probably to connect voltage to one side of your switches, ground
to each G terminal, and the IN1…IN4 terminals to the other terminal of each
switch.
On Wed, Jul 19, 2023 at 10:38 PM Thaylor Mosquera Castro < ***@***.***> wrote:
Hello I must say that I am not an expert in electronics, apologies in
advance for my lack of knowledge.
I have made a DIY CNC and I am using an Arduino uno with cnc shield, I
started perfectly when I already had the kinematics ready, I connected
everything and managed to make it work, when I began to arrange my cables
to do this in an orderly manner I realized that my limit switches are
blocked and do not allow movement, investigating I came to the conclusion
that apparently noise is filtering since I put all the cables together to
remove them so that they looked organized, I bought the module
[image: Module 817]
<https://camo.githubusercontent.com/9462da1e6733dc356f91d3f3e8785a019bb1ba629632f63b889083be22dff9dc/68747470733a2f2f726f626f746f6f6c732e696e2f77702d636f6e74656e742f75706c6f6164732f323032322f31302f50433831372d342d43482d4f70746f636f75706c65722d49736f6c6174696f6e2d4d6f64756c652d342d3132303078313230312e706e67>
i tried to connect it directly, but obviously this didn't work, could
someone help me with a connection diagram, i think i must power it somehow,
but i'm not an expert in electronics
—
Reply to this email directly, view it on GitHub
<#96 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANHF4K2Y6OSRQ5RHEXZXZLXRCKZFANCNFSM4C44GGJQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Stephen Culpepper
ph: (404) 213-4038
***@***.***
|
Good day all, please help with a couple of questions. Can I use the setup as shown in this pic with a V3.00 shield and grbl 1.1h? Would the blue, orange and pink wires connect to the X+, Y+ and Z+ terminals leaving all the other connections as shown? Could the frame of the machine be used for a ground or should all the switches be wired back to the shield black strip. |
Generally, it is best to have a dedicated ground wire for each signal path. So the best is to have each switch pair have a ground wire back to the control board, with the capacitor and resistor near the control board. Grounding the machine frame, as well, is good; but generally should not be used as the primary signal path. |
Thanks for that. Can you say whether wiring the switches to the X, Y and Z
connectors on the shield is correct?
From: MechaSteve ***@***.***>
Sent: Monday, September 25, 2023 10:21 AM
To: gnea/grbl ***@***.***>
Cc: dougmake ***@***.***>; Comment ***@***.***>
Subject: Re: [gnea/grbl] Limit Switch Wiring (#96)
Generally, it is best to have a dedicated ground wire for each signal path.
So the best is to have each switch pair have a ground wire back to the
control board, with the capacitor and resistor near the control board.
Grounding the machine frame, as well, is good; but generally should not be
used as the primary signal path.
-
Reply to this email directly, view it on GitHub
<#96 (comment)> , or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/A5NWIYXOJMTBWFJSLBQLRYTX4
GHNPANCNFSM4C44GGJQ> .
You are receiving this because you commented.
<https://github.com/notifications/beacon/A5NWIYQAALDB6VCDAXR6QO3X4GHNPA5CNFS
M4C44GGJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOM5L5RRQ
.gif> Message ID: ***@***.***
***@***.***> >
|
Yes, the other wire from the switches would go to the x/y/z terminals on the shield. |
The best, asu used on microphone wires is to have the signal in 2 wires
inside the shield , an only connect the siheld to ground on one end.
El El lun, 25 de set. de 2023 a la(s) 11:52, MechaSteve <
***@***.***> escribió:
… Yes, the other wire from the switches would go to the x/y/z terminals on
the shield.
—
Reply to this email directly, view it on GitHub
<#96 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACXBW4IH54PZ2ECQBLXNMTTX4GLDVANCNFSM4C44GGJQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Tks, Eduardo, I have heard of this method. The shielding is high quality.
Doug
From: Eduardo Spremolla ***@***.***>
Sent: Monday, September 25, 2023 12:46 PM
To: gnea/grbl ***@***.***>
Cc: dougmake ***@***.***>; Comment ***@***.***>
Subject: Re: [gnea/grbl] Limit Switch Wiring (#96)
The best, asu used on microphone wires is to have the signal in 2 wires
inside the shield , an only connect the siheld to ground on one end.
El El lun, 25 de set. de 2023 a la(s) 11:52, MechaSteve <
***@***.*** <mailto:***@***.***> > escribió:
Yes, the other wire from the switches would go to the x/y/z terminals on
the shield.
—
Reply to this email directly, view it on GitHub
<#96 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACXBW4IH54PZ2ECQBLXNMTTX4GLDVANCNFSM4C44GGJQ>
.
You are receiving this because you commented.Message ID:
***@***.*** <mailto:***@***.***> >
—
Reply to this email directly, view it on GitHub <#96 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/A5NWIYVYWTQAUNANK5R5YWDX4GYKXANCNFSM4C44GGJQ> .
You are receiving this because you commented. <https://github.com/notifications/beacon/A5NWIYQWSNGKEAWRC47GF23X4GYKXA5CNFSM4C44GGJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOM5OINRA.gif> Message ID: ***@***.*** ***@***.***> >
|
Thanks MechaSteve
From: MechaSteve ***@***.***>
Sent: Monday, September 25, 2023 10:53 AM
To: gnea/grbl ***@***.***>
Cc: dougmake ***@***.***>; Comment ***@***.***>
Subject: Re: [gnea/grbl] Limit Switch Wiring (#96)
Yes, the other wire from the switches would go to the x/y/z terminals on the
shield.
-
Reply to this email directly, view it on GitHub
<#96 (comment)> , or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/A5NWIYXUSMHLY5EK425PVCLX4
GLD3ANCNFSM4C44GGJQ> .
You are receiving this because you commented.
<https://github.com/notifications/beacon/A5NWIYWLM3RMABBLLDN6U3LX4GLD3A5CNFS
M4C44GGJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOM5MOOOQ
.gif> Message ID: ***@***.***
***@***.***> >
|
Good Morning all,
Would it be possible for someone to add a page to the Wiki that explains the correct way to wire NC limit switches. maybe with a schematic drawn up. I have been confused about this for some time and there is limited info out there that I have seen that shows how to properly connect NC limit switches to GRBL. also it would be nice to know what resistors are required as well. and what GRBL settings need to change.
I had limit switches set up NO and had nothing but problems with false triggers. I would like to get limit switches working in the NC setup.
Thanks!
Tim
The text was updated successfully, but these errors were encountered: