Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: wvancura on October 31, 2006, 10:53:44 AM

Title: Limit Switch Request
Post by: wvancura on October 31, 2006, 10:53:44 AM
I recently installed limit switches on my table. They seemed to work just fine until I included them as a part of the homing limits. One of them keeps tripping during a job (according to the status report), well away from the limits. It is usually unrelated to large or particularly fast motion, so it is probably noise. I bumped up the debounce from 1 to 2 milliseconds, and it still trips about as often. I could probably safely go to 10ms on the debounce, but I wonder if that will help. I installed 0.1 UF caps on them but have not tested them yet.

Program change suggestion:
It would be nice if the program status indicated which limit switch tripped, so I had a starting place to look, or if there was any consistency involved.
It would also be nice if the reports indicated which line of G-Code was being executed when it tripped.

Any ideas?
Thanks.
Bill
Title: Re: Limit Switch Request
Post by: Chaoticone on October 31, 2006, 11:22:08 AM
Hello Bill,
    What kind of switches are you using? Are they mechanical contacts, proximity, etc.? Can you give us a screen shot of you ports and pins, and Homeing/Limits?

Brett
Title: Re: Limit Switch Request
Post by: xray_man on October 31, 2006, 11:23:09 AM
Hi wvancura....  I had a similar problem that you are having, and  I placed .047uF caps across all my limit switch inputs to eliminate noise from the steppers. This worked just fine for me.

How were you able to change the debounce delay? Is that function in MACH?

Thanks!
Title: Re: Limit Switch Request
Post by: Chaoticone on October 31, 2006, 11:46:24 AM
You can change the debounce in Mach. It depends on the version you are running as to where it is at. In the latest, it is in config., general config. I run the 1.84 lock down. I think it is in config., logic in this one. I have mine set to 1000 although I had no problems at 0.

Brett
Title: Re: Limit Switch Request
Post by: wvancura on October 31, 2006, 01:52:00 PM
Hi,
I am using version 2.0 as of about a week ago. I am using new mechanical snap action microswitches with an 8 oz activating force.  The software has a debounce function in it accepting a number times 40 microseconds. I started with 25 (1 millisecond) and then went to 50 (2 ms).  I have a strong electronics background and understand its purpose, and I do not want to delay more than 10ms before tripping. These switches should be very reliable at 1 ms debounce, providing the debounce algorithm is good. Unfortunately, all of the switches are mounted on mobile surfaces. Both Y and Z should be impervious to shock and vibration because of their orientation with respect to their activating axis and sources of vibration. X is mounted with a worst case orientation and is located near the screw where acceleration would be maximized. I will look here first. I operate using the constant velocity mode and was running this job at 40IPM cutting wood with a 3/32 bit

I ran a small number of jobs without also using the switches as homing switches. When I enabled homing and limit to the same switches, troubles seemed to begin. It is possible that the other jobs did not have as many hard turns in it. As I said before, I have not had a chance to test the capacitors I have added, nor have I reverted to eliminating the homing function.

The attachments should show that the setup is pretty mundane.
If the software were to indicate which switch tripped, then I could validate my theory about switch X.

Capacitors should cut down a lot of motor noise, but I think if motor noise was the culprit, that the switches, depending on the debounce algorithm, may never trip because the debounce circuit might never validate.
Title: Re: Limit Switch Request
Post by: Chaoticone on October 31, 2006, 02:05:25 PM
Is your backlash comp. enabled? Mach does not like CV mode and backlash comp. Have you tried the run with soft limits disabled?
Title: Re: Limit Switch Request
Post by: wvancura on October 31, 2006, 02:20:21 PM
Backlash is OFF. I can't see any advantage to using it. There is a little slop in the system (0.001) but it is not enough to worry about yet. Flexing is a bigger problem that backlash wont fix.

Title: Re: Limit Switch Request
Post by: Chip on October 31, 2006, 04:14:44 PM
Hi, Bill

I see your using NC switche's, that's good, once you get this straitened out you can connect them all in NC- series (NO - parrel)  and save 2 Input pin's, Mach nows the diff. .

As far as trouble shooting, Disable 2 of your axis inputs, xy test z, xz test y, yz test x.

Disable Port's Pins Input's, by  setting Port #'s  to 0, check Emulated for axise's to disable.

Or Gnd the input pin's 2 at a time and check.

Checked the Resistance at the connector for possibly a hi-Resistance switch / wire, ref Gnd. ?

Swap to different input pin #, flaky printer port.

Doesn't make sense to me just adding Home feature would do this. 

Are you using a Opto-Isolated interface board or Direct-connect. ?

Hope this Helps, Chip
Title: Re: Limit Switch Request
Post by: wvancura on October 31, 2006, 10:57:42 PM
Ran a small test run this evening and the 0.1uf capacitors seem to have helped. I could feel the head doing a lot of hard turns. The X axis relay was probably chattering. I am surprised that the digital debounce didn't handle it better.

Normally closed is the only safe way to go. I require it of all of my process controll customers.

If I use only one relay, can it also do a homing correctly?

The cube was my test run. It is made out of pine, one inch square, cut with a 3/32 bit, and is poorly centered. I need more practice. on alignment

One more question, is it possible to have a single push button do RUN/PAUSE? Hold it down for RUN, let go for PAUSE.
Thanks
Bill
Title: Re: Limit Switch Request
Post by: Chip on November 01, 2006, 12:58:08 AM
Hi Bill

Glad to see you got it running, Yes for 3 axis 1 pin using 3 micro-switches, NC in series works for Limit's and homing.

When homing generally the sequence is Z then Y then X, Mach's just looking for a switch to open then moves to the next axis.

After homing thay revert back to limit function.

Yes you can use 1 pin for 2 functions (certain function's)

For a remote jog pendent I use the following.

I use pin 10 to select MPG Mode (327) and Step Jog Mode (275), switch closed one function, switch open the other, and pin 11 NO swithc to toggle MPG 1 (175) through X,Y,Z,A, Axis's.

Go to Tutorials / Documentation / scroll down to MachCustomizeWiki / scroll down Contents / 9,3 OEM Buttons, you'll See Function and OEM Code #'s

Are you talking about Start (1000) and FeedHold (1001) 

Explane exactly what you want to do, If I can't help someone else will, there are so-many features with this program it's hard to be on-top of all of it.

Hope this Helps, Chip


Title: Re: Limit Switch Request
Post by: wvancura on November 01, 2006, 10:25:02 AM
Thanks everyone for all of the help.

It looks it is time to hit the books again and graduate from rank amateur to the next level in the field of CNC.

As I told Chaoticone, I have this very nice single button pendant (NO), and that it would be really nice to use it as a run/pause during setup. I currently have a touch screen and keyboard and my reaction time is terrible when using them. So I'm looking for a single hand control that may allow me to react faster to the situation at hand. I also need to use a better video layout to be more touch screen friendly. The default mill screen isn't bad, but some of the important features are on small buttons.

It seems that I have this incredible natural ability to break bits.   

This is one project in my life where I have developed a strong religion to wearing safety glasses and hearing protection. At the end of each day, I count my fingers and eyes, and after finding them all there, wonder how that happened.

Thanks.

Bill