Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: iqbal on October 08, 2013, 10:21:56 PM

Title: Newbee limit switch false trigger problem
Post by: iqbal on October 08, 2013, 10:21:56 PM
I am having false triggers with the limit switches.

I have 6 switches, 2 on each axis wired in series. They are wired normally closed. So they are grounded when they are inactive.
Each of the switch functions normally when tested manually on the diagnostic page.
As soon as i enable the limit switches, the Mach3 flashes error "Limit switch triggered" and wont jog.
The diagnostic page has none of the limits lit.
The inputs are normally grounded, the motors are not running, the debounce is set to 1000x40us, i dont think there can be any noise.

What am i doing wrong ? i have attached the xml.
Please help i am stuck.
Title: Newbee limit switch false trigger problem
Post by: Fastest1 on October 08, 2013, 11:02:24 PM
Why don't you suspect noise? What happens if  you raise the debounce to 2000 or 3000 as a test.
Shielded wire on your switches? Is the shield connected only at the controller to the star ground? Do you have the V- of your power supply landed there also?
Title: Re: Newbee limit switch false trigger problem
Post by: Chaoticone on October 08, 2013, 11:03:49 PM
I just loaded your xml and it sure looks like noise to me. What kind of hardware are your running? XP, 7, 32 bit, 64 bit, what breakout board? Have you tried setting your debounce to 2000? Why do you think there can't be any noise? Is your cable a straight thru or is it a standard printer cable? Are you running any anti virus?

This link may help.
http://www.machsupport.com/forum/index.php/topic,25616.0.html#new

Brett
Title: Re: Newbee limit switch false trigger problem
Post by: iqbal on October 08, 2013, 11:21:00 PM
I am running Windows7 64 bit. No anti virus.
WARP3 USB smooth stepper.
The motor driver is opto isolated to the smooth stepper.

The wires are not shielded. But they are shorted to ground when they are inactive. So I didn't suspect any noise
I have a 300 MHz scope hooked on the input lines to watch for noise, I didn't see any.

I am going to use a shielded wire and try again.
If that works, I am going to kick myself for being a such smart ass.

Iqbal
Title: Re: Newbee limit switch false trigger problem
Post by: Chaoticone on October 08, 2013, 11:22:46 PM
Hold on, did you try setting any noise filtering in the SS plugin? Set it low and see if ti helps.

Brett
Title: Re: Newbee limit switch false trigger problem
Post by: iqbal on October 08, 2013, 11:40:31 PM
Didn't know about SS settings, will try that first.
Title: Re: Newbee limit switch false trigger problem
Post by: iqbal on October 09, 2013, 12:04:12 AM
!!! SUCCESS !!!

SS settings for 500 us on each input works.
Strangely the debounce in Mach3 didn't do any good. I am going to remove those. Since they are driven by the SS i am sure the input to Mach3 is noise free. its the noise seen by the SS thats causing the problem.

The power to the entire drive is off, but it would still trigger the limits, so i cannot not understand where the noise is coming from.
I am going to bypass the input limit lines with a 1 uf capacitor, the pull up is 4k, so it should be fast enough. Would like your comment on the bypass cap.
 
Title: Re: Newbee limit switch false trigger problem
Post by: Chaoticone on October 09, 2013, 12:57:13 AM
 :) Debounce in Mach has no effect when running the SS.

I think you will be fine with the 1uf cap but not 100% sure. Sounds like you've done your math so I'll trust your judgement. Been up for a while and not thinking............. at all, much less remembering that formula. T=RC? I honestly just cant remember right now. I guess really wont matter so much as long as its consistent and snubs it. Just don't borrow one from your 40 HP phase converter.......... might break a hard stop.  :o Seriously though, wait for confirmation for anything I said........... I'm beat.

You may want to check on the Warp9 site/forum. Seems there were some models that breaking a resistor off would help some. Might try running a ground from SS to PC case too. I'm convinced suppressing noise involves a little crows foot, frogs breath, hens teeth black magic at times but I think you know that already.  ;)


Brett
Title: Re: Newbee limit switch false trigger problem
Post by: Hood on October 09, 2013, 03:40:28 AM
500 for the filtering in the SS will be far too high and will delays your signals greately. I suggest you use a small amount (it is 1.43 increments) If you need more than 10 then you have serious problems that need to be sorted.
Hood
Title: Re: Newbee limit switch false trigger problem
Post by: Picengraver on October 09, 2013, 06:23:56 AM
If you use a cap, typically .1 uf is sufficient. 
John Champlain
Title: Re: Newbee limit switch false trigger problem
Post by: Chaoticone on October 09, 2013, 07:02:43 AM
Thanks Hood and John!

iqbal, listen to Hood and John, they give as solid advice as you will find.

Brett
Title: Newbee limit switch false trigger problem
Post by: Fastest1 on October 09, 2013, 08:27:39 AM
Brett does too. Even when dead tired solving the rest of our problems!
Title: Re: Newbee limit switch false trigger problem
Post by: iqbal on October 10, 2013, 12:45:07 PM
So finally
Removed the debounce from Mach3
Changed the debounce in SS from 500 us to 10 us.
Added four 0.1 uf caps to each of the inputs.

The system is able to home correctly on all 3 axis.


One small thing that would have really helped, if the limits lights on the diagnostic page were sticky. That is, once its set, it remains set until its cleared.
A small momentary noise spike will trigger the limit, but there is no visual indication on the panel that such an event has occurred . That kept me wondering as to what the problem could be.

Title: Re: Newbee limit switch false trigger problem
Post by: Chaoticone on October 10, 2013, 03:16:13 PM
Quote
One small thing that would have really helped, if the limits lights on the diagnostic page were sticky. That is, once its set, it remains set until its cleared.
A small momentary noise spike will trigger the limit, but there is no visual indication on the panel that such an event has occurred . That kept me wondering as to what the problem could be.



That's exactly how they work now. The led comes on when the input is active and turns off when it is deactivated. The problem is you either have bouncy switches or your picking up noise. This can have the same effect as turning the input on and off faster than you can see and/or faster than your graphics can update. Kind of hard to program for something that doesn't work as it should. If you had to add 4 caps to each input and set the debounce to 10 in the SS you need to look at the link in my first reply.

Brett
Title: Re: Newbee limit switch false trigger problem
Post by: iqbal on October 10, 2013, 04:21:47 PM
The switches have mechanical hysteresis, they are certainly not bouncy.
They have contact noise, but once they change state they stay set.

The diagnostic page is limited as a visual guide. A trace file recording the events can also help. Especially if some event like that is triggered during a long job run.



Iqbal


Title: Re: Newbee limit switch false trigger problem
Post by: Overloaded on October 10, 2013, 04:57:23 PM

 One small thing that would have really helped, if the limits lights on the diagnostic page were sticky. That is, once its set, it remains set until its cleared.
A small momentary noise spike will trigger the limit, but there is no visual indication on the panel that such an event has occurred . That kept me wondering as to what the problem could be.


I don't think it is necessary to "latch" the LED's on.
The message ticker on the main screen notifies you as to what the fault condition was.
External E-Stop requested ... or ... Limit Switch triggered Mach goes into E-Stop either way then requires a RESET.
The ticker is a great diagnostic tool.
IIRC,
Russ
 :)
Title: Re: Newbee limit switch false trigger problem
Post by: iqbal on October 10, 2013, 05:29:37 PM
Yes, both of you are right. And this is good learning experience for me.

The limit switch was triggered continuously and immediately after enabling the limits, without the yellow lights lighting up even once.
I was trusting the yellow light more than the ticker.

In hindsight since the ticker is sticky, its much more reliable than the flicker of the yellow light.


Iqbal