Limit Switch Troubles - HAL Debounce

More
15 Aug 2017 17:06 #97524 by andypugh
It should work.

It can go in any HAL file, but ina secondary HAL file you might need to unlink some nets made in the primary HAL file.

There is no documentation for home-x etc, and never can be, as the signal names are entirely arbitrary and can be freely chosen. It is the HAL pin names that matter.

The HAL pins of all components are described here:
linuxcnc.org/docs/2.7/html/
Click on "expand man pages" and pay special attention to "motion" "iocontrol" and "halui"

Please Log in or Create an account to join the conversation.

More
20 Jan 2020 21:20 #155275 by ytiuqibu
It seems we may have this issue and I would like to investigate possibly increasing the voltage on our NC switches. As our breakout board inputs are 5V we would need to use something like opto couplers at the breakout board end. Is this what you did to increase voltage?
As we now think individual home switches may be the way to go since we have no other use for three of the five input pins would increasing the voltage for a single switch and homing on that axis be a suitable diagnostic test?

Please Log in or Create an account to join the conversation.

More
26 Jan 2020 11:05 #155784 by ytiuqibu
Although we still have joint error issues we did alter the wiring to put home and limit switches for individual axes on separate pins. After talking to the BOB designer we have installed 0.1 microfarad capacitors on those input pins which has eliminated some of the interference and made the homing action smooth and reasonably fast with no random stopping without error messages (as occurred before).
While I don't know if using HAL debounce will have any effect on our errors I will follow some of the recommendations in this thread and see if it helps.
Our current problems are occasional and apparently random J0 errors including when the machine is motionless plus more persistent J2 errors . The Y axis is free of errors itself although, of course, affected by the other axis errors.

Please Log in or Create an account to join the conversation.

More
26 Jan 2020 12:15 #155792 by andypugh
The HAL debounce can be used to provide different levels of filtering for the same signal.
I typically use a 1-2mS filtered version for homing, and a 10mS version for limit switches.
The machine doesn’t travel _that_ far in 10mS compared to the inconvenience of nuisance tripping.

I would suggest removing the hardware filter that you added.

Please Log in or Create an account to join the conversation.

More
28 Jan 2020 13:08 #156004 by ytiuqibu
Thanks Andy we can try this next week when I next have access to the machine. At the moment it is homing satisfactorily using just Home on the X and Z axes and we are relying on the soft limits rather than the limit switches. With this setup we eliminate the joint errors and can run jobs while we investigate options.

Please Log in or Create an account to join the conversation.

More
17 Apr 2020 02:20 #164223 by jay.perez1
Hi Andy,

Do you know if there's another thread that explains how to add this filter to my shared home & limit switches in layman's language ? I current have all of my NC switches connected to a single input pin on my parallel port breakout board.

Thanks in advance for any help.

Jay

Please Log in or Create an account to join the conversation.

More
17 Apr 2020 12:44 - 17 Apr 2020 12:44 #164267 by andypugh
Is this a layman who is happy to edit the HAL file?

You have a choice of using a single filter for both home and limit or choosing a slightly longer filter for limits to allow for more accurate homing. But as you are running a p-port and have a base thread, you can probably debounce in the base thread and then this distinction does not apply

Sample code. Note that you won't be able to use this as-is, it will need to be worked in to our HAL using the pin names and signal names from your HAL.
loadrt debounce cgf=1
...
addf debounce.0 base-thread
setp debounce.0.time 20 
...
net limit_raw parport.0.pin-00-in => debounce.0.0.in
net limit_filt debounce.0.0.out
...
net limit_filt axis.0.neg−lim−sw−in axis.0.pos-lim-sw-in
net limit_filt axis.0.home-sw-in
...
net limit_filt axis.1.neg−lim−sw−in axis.1.pos-lim-sw-in
net limit_filt axis.1.home-sw-in
...
net limit_filt axis.2.neg−lim−sw−in axis.2.pos-lim-sw-in
net limit_filt axis.2.home-sw-in
Last edit: 17 Apr 2020 12:44 by andypugh.
The following user(s) said Thank You: jay.perez1

Please Log in or Create an account to join the conversation.

More
17 Apr 2020 22:19 #164345 by jay.perez1
Hi Andy,

Calling myself a Layman was way overstating my abilities, at least when it comes to HAL files and such ... ;-)

I'm certainly capable of cutting & pasting info into the file but I'm nowhere even close to being able to intelligently make changes without specific detailed information being fed to me.

Is the example you included setup for my situation where I have all of the NC switches on a single input pin on the BOB?

Something else I noticed, there's quite a bit more lines of code in the automatic email I received when you replied than there is in your message on the forum, and, a couple of the lines are Blue text on my phone but not here.

Jay

Please Log in or Create an account to join the conversation.

More
17 Apr 2020 22:22 #164346 by andypugh
I forgot the [code] tags initially.

And, for some random reason, the emails get code and pictures and some other stuff stripped out.

If you log in to the forum there should be a code sample to pick from.

Please Log in or Create an account to join the conversation.

More
26 Apr 2020 20:37 #165696 by jay.perez1
Hello Andy,

Thanks again for your earlier reply and the debounce sample you provided.

LCNC is tripping my limit switches when I turn on the spindle. All of the cables are physically separated and the limit switch cables are all shielded and grounded at the BOB end. Everything is fine when I power up the VFD but as soon as I command the spindle to rotate it trips the system. I'd like to try using the debounce to see if it resolves this.

The example you posted includes lines for all three axes. However, not sure if that's or necessary/preferred for my situation where I have all of the NC switches in series on a single input pin on the BOB. Would you please comment on that ?

Also, in your most recent reply to ytiuqibu below you mention having two separate values for Homing and Limit Switch tripping. Can I request/beg/cajole you to point me to or post an example on how to do that when using the combined switches ?

Regards.

Jay

Please Log in or Create an account to join the conversation.

Time to create page: 0.086 seconds
Powered by Kunena Forum