Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: avecnc on December 09, 2015, 07:50:22 PM

Title: The solutions to my false limit switch triggering issues
Post by: avecnc on December 09, 2015, 07:50:22 PM
Hello All, just setting up my first DIY CNC machine with 4-axis and ran into issues with limit switches triggering falsely.  I finally solved these but it was really tough and time consuming, so thought I'd share what fixed the problems to help others who may have the same issues.

First off, I'm not into electronics.  I know some basic things, but not much about circuits and such.

I built a 4 axis hot wire cutter machine.  I installed 8 limit/home switches, one at the end of each axis.  These are setup as Normally Open (NO), and only complete a signal/ground when physically triggered.

After setting up my hardware and wiring the servos and switches in place the motors worked fine, no issues.  Once I setup the limit switches in Mach3 they almost immediately triggered a STOP/RESET.  Sometimes I could start everything ok, but as soon, or shortly after, moving a motor they would trigger again.

When Mach3 is in STOP/RESET it will not show the current values of the inputs for these, but what I did figure out is if I only enabled the HOME setting for the switches it would not trigger a RESET and I could watch the input LEDs on the Diagnostic page.  This finally allowed me to see the switch signals randomly triggering.

I tried the debounce setting, up to 4000, but it had very little effect, if any.  One thing that did help significantly was to separate my limit switch wiring from my servo motor wiring by at least 10-12" +  Then I could almost use a high debounce setting, but eventually it would still trigger, just took a lot longer.  If this was a solution it would have been extremely tough to rewire successfully!

I won't go through all the troubleshooting I did, but the three separate things I found, which each caused the issue on it's own are below:

1)  The two limit switches for each axis were wired together to a single input pin.  Because of this the wiring loom for them created a kind of loop between the two switches and the hardware case they plugged into.  I am aware of electromagnetic induction, but just didn't pay attention and ran a servo wiring loom through this loop.  Keep in mind the loop is an odd shape and very large so it's not as obvious as you might think to see.  Obviously when the servo was triggered using 24v signals it induced a signal in the 5v limit switch wiring.  That was the easy one... to fix.

2)  I used shielded cable for the limit switches, however, I did not GROUND the shielding to anything.  Once I went back and grounded ALL the segments of shielded wire together and to the hardware case (earth ground) that solved another of the causes of false signals.  This one wouldn't have been so bad except I had to figure it out after my wiring was all done.  It took hours to rewire and fix.

3)  The third and probably least obvious, to me anway, issue was that I found unless I ran a ground wire from EACH servo housing to the hardware case (earth ground) it would also trigger the limit switches/wiring.  BTW, the servo case ground also grounded all the metal parts in my machine's hardware.

After ALL three of those were done I have no false signaling at all, I even ran the wires tightly wrapped together parallel for nearly 10ft.

Other useless things I tried or was going to try:

-Debounce setting, did nothing
-Tried tying the negative terminals of my two INDEPENDENT power supplies (one 24v and another 12/5v) together.  Bad idea, one power supply got pretty warm before I quickly disconnected them.  I would not recommend this!  People in other posts recommended... so I tried and learned not to do it.
-Tried the above three solutions independent of each other.  This did not work, obviously, and led to very long troubleshooting time.
-Probably a lot more I'm not remembering right now!

The final lesson I learned was to check your wiring, look for ground loops, or maybe just make sure all components (everything electrical or not) are well grounded and not causing induction in other wires!
Title: Re: The solutions to my false limit switch triggering issues
Post by: Fastest1 on December 09, 2015, 10:12:07 PM
Great, always nice when it starts coming together.

You forgot a few other options, caps on the inputs and or ferrites on the wires. They wouldnt have changed anything. It is just methodical slow elimination of 1 thing at a time.
Title: Re: The solutions to my false limit switch triggering issues
Post by: avecnc on December 09, 2015, 10:41:40 PM
Yes, I have some 0.1 uF Caps which arrived today, but I fixed the issue at the root before they came.  I'm happy to have solved it at the source without the band aids!  I'm amazed at how many forums and threads I read which only suggested the workarounds instead of finding the root source of the problem.
Title: Re: The solutions to my false limit switch triggering issues
Post by: Tweakie.CNC on December 10, 2015, 01:17:48 AM
Nice work Avecnc - the methodical approach.  8)

Thanks for sharing the information, I am sure it will help others that follow.

Tweakie.
Title: The solutions to my false limit switch triggering issues
Post by: Fastest1 on December 10, 2015, 08:14:33 AM
I definitely understand that information on this issue is hard to comprehend. I have chased those problems too. In fact you probably wasted some time reading my posts.


Sent from my iPhone using Tapatalk
Title: Re: The solutions to my false limit switch triggering issues
Post by: Tweakie.CNC on December 10, 2015, 08:26:38 AM
I definitely understand that information on this issue is hard to comprehend. I have chased those problems too. In fact you probably wasted some time reading my posts.

I am sure time was never wasted, everything was just added to the knowledge base.  ;)

Tweakie.
Title: Re: The solutions to my false limit switch triggering issues
Post by: Fastest1 on December 10, 2015, 09:05:48 AM
Tweakie, I only hope it has been remembered. Or did I ever figure out why the problem went away? But my wiring techniques improved some ;-)
Title: Re: The solutions to my false limit switch triggering issues
Post by: Tweakie.CNC on December 10, 2015, 11:00:31 AM
I Must admit, I did try writing a guide (for beginners) to wiring a CNC machine about a year ago. http://openbuilds.com/threads/electronics-101.693/

The further I got into it the more I realized just how much of a grey area it really is. Sadly, few of the newcomers to that forum took much notice and all the same wiring mistakes are still being made and re-discovered all over again.  ;D

Tweakie.
Title: Re: The solutions to my false limit switch triggering issues
Post by: Fastest1 on December 10, 2015, 12:59:49 PM
Then if Al the Man gives me an answer and it is most likely correct, somehow I dont understand that either. There is still too much misunderstanding on my part about Earth/Ground/Negative. For some reason I can only think - and + no matter if it is AC or DC. That is just the beginning of how wrong I can be. I bet trying to write that guide helped clarify it too.
Title: Re: The solutions to my false limit switch triggering issues
Post by: Chaoticone on December 10, 2015, 01:20:19 PM
I Must admit, I did try writing a guide (for beginners) to wiring a CNC machine about a year ago. http://openbuilds.com/threads/electronics-101.693/

The further I got into it the more I realized just how much of a grey area it really is. Sadly, few of the newcomers to that forum took much notice and all the same wiring mistakes are still being made and re-discovered all over again.  ;D

Tweakie.

I know exactly what your saying Tweakie. This was my attempt at prevention. http://www.machsupport.com/forum/index.php/topic,25616.0.html

I would like to think it has helped some but I think it is one of those things that we just have to go through to learn about it. Wisdom is something no one can take from you. Unfortunately no one can give it to you either. Hind site is 20/20 and while a lot of information is available I think an awful lot of it only makes sense if viewed in the rearview mirror.
Title: Re: The solutions to my false limit switch triggering issues
Post by: bfgstew on December 10, 2015, 03:11:51 PM
Electrics/electronics is a definite dark art, being mechanical all my life and now only getting into electrics I have found this out.
Working with electricians who have been at it for all their lives they too find hard with ground loops, feedback, earth impedances, shielding and so on, especially with modern day control equipment. It has become a very scientific art to make every component work together without interference of some form or fashion. Following the manufacturers guidelines is a must, but for some people decide they know better and go their own way. Good test equipment again is a must but unfortunately this is financially beyond some. So it boils down to advise from guys who have been there and done it, for that I take my hat off to you and thank you for the time, patience and effort you put in to helping us lesser mortals through the dark art of electrics and electronics. Definitely without Tweakies help I would not have Scrappy up and running.

Stewart
Title: Re: The solutions to my false limit switch triggering issues
Post by: avecnc on December 10, 2015, 08:50:38 PM
I Must admit, I did try writing a guide (for beginners) to wiring a CNC machine about a year ago. http://openbuilds.com/threads/electronics-101.693/

The further I got into it the more I realized just how much of a grey area it really is. Sadly, few of the newcomers to that forum took much notice and all the same wiring mistakes are still being made and re-discovered all over again.  ;D

Tweakie.

This would have been nice to have read before I started!  I did read Chaoticone's post though.  Everything everyone posted helped, even the misleading stuff lead to learning more about how things worked or didn't work as it were, hehe.  I'm happy to have those issue solved, moving forward with the tuning and cutting!

It sure felt like Gremlins were in my system with the troubles that were happening!  lol
Title: Re: The solutions to my false limit switch triggering issues
Post by: ozymax on December 10, 2015, 09:07:42 PM
The thing that gets me is, you can do all the correct things by the book and still have problems.
I don't run any shielded cable on my machine. I run all my motor wires and switch wires through the same cable tray. Initialy I had false triggers happening, but simply installing some 0.1uf caps on my switch input terminals, all has been good for years now.
I must admit that I delibrately didn't run my spindle to VFD cabling in the same run though. I have those cables and my camera cable coming down from above the router spindle.
My rebounce setting is set to 200.
Title: Re: The solutions to my false limit switch triggering issues
Post by: Tweakie.CNC on December 11, 2015, 03:20:50 AM
All this, I think, goes to highlight the benefits of our forum dwelling. We all learn from each other (sometimes from the mistakes and sometimes from the explanations) and the vast pool of knowledge we have all helped to create here has made our forum what it is today.

Keep up the good work guys.

Tweakie.
Title: Re: The solutions to my false limit switch triggering issues
Post by: avecnc on December 11, 2015, 03:27:21 AM
Here was another really good link I had found in my searching...    http://www.cnccookbook.com/CCCNCNoise.html
Title: Re: The solutions to my false limit switch triggering issues
Post by: Chaoticone on December 11, 2015, 10:10:02 AM
Tweakie, I got started reading yours last night. I did not finish but what I have seen so far is better than great!

Quote
Here was another really good link I had found in my searching...    http://www.cnccookbook.com/CCCNCNoise.html

Yes it is. Having been down this road do you think I should put a link to Tweakie's and the CNC cookbook in my attempt at prevention as the first 2 links?
Title: Re: The solutions to my false limit switch triggering issues
Post by: truckeic on April 18, 2019, 02:55:24 PM
All this, I think, goes to highlight the benefits of our forum dwelling. We all learn from each other (sometimes from the mistakes and sometimes from the explanations) and the vast pool of knowledge we have all helped to create here has made our forum what it is today.



Keep up the good work guys.

Tweakie.


Tweakie Have read many post from you and always appreciate the input. I thought maybe you could either point me or teach me a couple things.

I am running MACH3 and right now just using Parallel port the CNC4PC C11G rev.9 board. Having issue on spindle control. I have it all working but when the BOB is not in Green status one of the Relays (relay 2) chatters and is on. This is an issue cause I am using that relay to control spindle light.
Artuo says its an ground loop, which I agree. I can disconnect my analog 12 volts from the BOB or from the aviation connector which feeds my speed control. I have a HF mill the speed board is the FC350BJ. Any Ideas?

Also, I stumbled across this post and I am having limit switch and estop false triggers. Would it be better to ground the lines from these switches to chassis or use the .1uF cap plan?

Thanks in advance
Title: Re: The solutions to my false limit switch triggering issues
Post by: reuelt on April 18, 2019, 03:43:09 PM
"I am having limit switch and estop false triggers"

This thread shows a fundamental mistake.
Limit/home switches should be wired NORMALLY CLOSED and NOT Normally OPEN as done by the author of this thread. So his "solution" is a just a waste of time and effort.
You cannot have any false trigger if voltage is NORMALLY already high and current is already flowing in the limit switches.
Noise cannot turn what is already normally voltage high, "falsely on'.
Title: Re: The solutions to my false limit switch triggering issues
Post by: Tweakie.CNC on April 19, 2019, 01:37:06 AM
Hi Truckeic,

Because there are so many variables, unfortunately, there is no one solution that suits every situation.

Initially check that you have set a Debounce Interval (config. – General Config.) of at least 100 (up to 500 max.).
For your inputs (limit,home,estop,etc) they should be wired using good quality twin core shielded cable with the shield connected to a single point Earth connection at the controller end only (not chassis). Also check that you do not have any Earth loops within your machine wiring layout. If problems persist then fit 0.1uF caps. connected between each used input and GND.

Hope this helps.
Title: Re: The solutions to my false limit switch triggering issues
Post by: reuelt on April 20, 2019, 04:54:48 AM
[quote
any Ideas?
[/quote]

1. If you limit/home switches are wired Normally Open (NO) - change it to NC (Normally Closed).
This will eliminate/minimize ALL "false limit switch triggering issues". Debounce more than 50 is ABNORMAL.
It is also better for safety because M/C won't even start if any limit switch wire is broken.
In the NO wiring, a broken wire could go unnoticed until M/C crashed HARD when limit switch didn't work because a wire had been broken for a long time.
2. Earthing should be done at the negative terminal of the DC (24V?) power and the ground of the limit switch wiring.
3. The ANALOG 0-10V controlling spindle speed is the usual trouble spot. This is because the Analog ground is isolated from the digital or DC & m/c ground.
So install ferrite core (aka chokes) on both wires of the 0-10V out of the BOB that controls the spindle speed. Put wire through as many turns as possible. This will make spindle speed more accurate and stable.
4. AC Power source should have AC "EMI filters". This is even more crucial if you upgrade to VFD Spindle and inverter.
5. I would NEVER use a USB Motion Controller. I would go from parallel port to an Ethernet motion Controller. USB Motion Controller are too sensitive to EMI noise.