Hello Guest it is April 19, 2024, 11:04:37 AM

Author Topic: Limit Switch Noise Triggering  (Read 8595 times)

0 Members and 1 Guest are viewing this topic.

Limit Switch Noise Triggering
« on: August 04, 2008, 09:41:33 AM »
I'm having a problem with Mach3 recognizing noise comming in through my limit switches as a limit trigger for estop. Basically I'm using rather high power servo motors which are causing periodic noise (at a frequency of 4khz) which is contantly triggering the limit estop in mach. I have methods in place to prevent the noise affecting any other systems. The easiest thing it seems would be to use low pass filters because I don't need instantaneous estop's in mach just something fast enough, like a tenth of a second really. Is there any way in place for mach to ignore the noise on the line, or is there already some sort of low pass filter in place or something else to help not so much remove but ignore the noise? I just want something simple. I don't want to have to buy a bunch of capacitors and have to install them for filtering. Something software based would be much cheaper I think.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Limit Switch Noise Triggering
« Reply #1 on: August 04, 2008, 09:45:40 AM »
Config menu then General Config, set the debounce to 2000 and then if it helps drop it down a bit at a time until the triggering reapears then bump up slightly.
 Would be better to get rid of the noise by shielding but as you have stated you are not too bothered about the effects debounce can have on delaying the signal then you should be ok.
Hood
Re: Limit Switch Noise Triggering
« Reply #2 on: August 04, 2008, 11:07:32 AM »
I thought it was too good to be true, and it was. Perhaps it was Karma.
I did what you suggested hood, and noticed mach wasn't switching back to estop. For about 3 seconds.
I tried several times with a debounce of 2000 but each time mach went back to estop within a few seconds.
I tried setting the debounce to 10,000 but that only stopped it for at most 29seconds.
I would set it higher but the kernel speed is 25khz so that would be getting closer to 1 second response time.
Would it be possible to alter the way debounce works through scripting? I was thinking I could take an average of whether mach detected the limit signal or not and compare it against a 'tollerance' constant.
But if you have any other ideas that would help.
There's also a chance it could be related to the periodic nature of the noise, but at 4khz versus 25khz, I would hardly think that debounce would get stuck given the odd-ish number.
More help?

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Limit Switch Noise Triggering
« Reply #3 on: August 04, 2008, 11:35:11 AM »
Are your cables shielded?
 If it still happens with a debounce of 2,000 let alone 10,000 then I think I would be looking into getting it sorted via shielding or better switches. Other thing you could do is supply your switches with 24V and work them through relays so that the noise doesn't affect them (presuming they can handle 24v)
 If your cables are shielded make sure there is no chance of a ground loop, I have heard of a few that had problems and only had the shielding connected at the control end like they should but later found the shielding was intermittently touching at the switch end due to a few strands of it being loose.
 Don't know of any way to script to sample, it may be possible but afraid I don't know.

Hood
Re: Limit Switch Noise Triggering
« Reply #4 on: August 04, 2008, 01:27:46 PM »
I actually am already using 24 volts with relays because the limits also send a signal to my servo amplifiers. The cnc machine is in another room from where the computer is for safety, noise and cleanliness reasons. The ground looping is something i've been looking into, and I'm finding it hard to get a plain english explaination as to how to check for it quickly. It reads like a lot back to future, flux capacitor, unhappy-doom. If anyone can help with a quick way of checking that'd be great. The problem with checking is the wires are in the wall and the ceiling so it's hard to recheck the wiring. The cables are not shielded, not for the limit switches to mach anyway, but since the noise was expected, I was really just hoping low pass filtering would fix the problem. Also, I was wondering if anyone, most likely the admins etc. could tell me more about the way the debouncing is implemented. If I had to guess I'd say it wasn't really done in low pass filtering kind of way (I mean mathematical low pass filtering) and done more in an ad-hoc sort of easy fix way.
Anything, no matter how small, will help.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Limit Switch Noise Triggering
« Reply #5 on: August 04, 2008, 01:45:26 PM »
I think it would be possible to set your Limits up as Inputs rather than specifically as Limits. You could then write a macropump or a Brain to look at them and compare to your constant as you say and if outwith the parameter to trigger an E-Stop. How exactly you would do that I dont know as if debounce isnt working then.....
Hood

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Limit Switch Noise Triggering
« Reply #6 on: August 04, 2008, 01:58:57 PM »
Just reading your post again and you say your limits go to your drives as well. What is the purpose of this? Does it stop the operation of all of your drives if one limit is tripped?

Hood
Re: Limit Switch Noise Triggering
« Reply #7 on: August 05, 2008, 01:09:23 PM »
Yes is does.
Acutally what I did was I looked into making a brain but it wasn't, at least as far as I could tell, robust enough to work with the parallel port the way I wanted it to. Also I found that I didn't like the way the brains worked in general, not intuitive for me. So what I did is I looked into writing a VB script for a macropump. I know vb, but nothing to do with interfacing with ports. But after a bunch of research I was able to write a script that can take a user defined number of samples of each pin and average them out to a percentage of whether it was active or not, and compare that to another user defined tollerance. I was able to get on the lower end, about 95% accuracy, so I set the tollerance for 80%. It works fine now thanks.
If you hadn't suggested it, I wouldn't have tried it and I learned a lot about interfacing on the side.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Limit Switch Noise Triggering
« Reply #8 on: August 05, 2008, 01:37:26 PM »
It seems you have it sorted but  if you do get problems again then another option may be doing away with the limits going back to Mach, you could then just use the limits to stop your drives and have a signal from the drive to tell Mach its stopped. How you implement this in Mach is dependant on what you have set up already and what outputs your drives have available. If you had the signal connected to Input 1 Mach would stop any programme if this signal was present. Another option would be to use any Input and just have a macropump or Brain look for this signal then if present do the Stop button and possibly even have a message box pop up to tell you what happened.

Hood