Motion digital output value on stop

More
5 years 3 months ago #214611 by andypugh

Is it possible to trigger a script or gcode when a HAL pin changes? I haven't seen anything in my search of the docs but I could be missing something.
You could look at the "flipflop" HAL component. That has separate inputs that turn on the output, or turn off the output. 
Actually, toggle2nist might work too. 

linuxcnc.org/docs/2.8/html/man/man9/flipflop.9.html
linuxcnc.org/docs/2.8/html/man/man9/toggle2nist.9.html
 

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

More
5 years 3 months ago - 5 years 3 months ago #214654 by bevins
Have your dust collector output follow your spindle. No need to run the dust collector unless the spindle is running.

something like this maybe:

net spindle-enable <= spindle.0.on  => hm2_7i92.0.7i76.0.0.output-01
Last edit: 5 years 3 months ago by bevins.

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

More
5 years 3 months ago #214659 by rodw

Have your dust collector output follow your spindle. No need to run the dust collector unless the spindle is running.

something like this maybe:

net spindle-enable <= spindle.0.on  => hm2_7i92.0.7i76.0.0.output-01
I like this approach. I don't know much about wood dust but perhaps you might want the fan to come on before the spindle so it gets up to speed. I guess it has some time to do that before the spindle is at speed but if needs a bit more time, you could add a timedelay component between spindle.0.on and your spindle relay

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

More
5 years 3 months ago - 5 years 3 months ago #214699 by bevins

Have your dust collector output follow your spindle. No need to run the dust collector unless the spindle is running.

something like this maybe:

net spindle-enable <= spindle.0.on  => hm2_7i92.0.7i76.0.0.output-01
I like this approach. I don't know much about wood dust but perhaps you might want the fan to come on before the spindle so it gets up to speed. I guess it has some time to do that before the spindle is at speed but if needs a bit more time, you could add a timedelay component between spindle.0.on and your spindle relay



 
I dont think that will be an issue. The dust collector will come up faster than the spindle for sure. The only issue I had was the dust collector would stop during tool changes. That is expected behaviour though. I fixed that by putting a relay in parallel during a toolchange that kept the dust collector running.
Last edit: 5 years 3 months ago by bevins.
The following user(s) said Thank You: rodw

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

More
2 years 5 months ago #301472 by engineer
This topic seems to be old but no straight forward answer has been given. Maybe someone still looks for similar answer.

In my opinion the easiest solution is to use "ON_ABORT_COMMAND" please refer to paragraf 5.8 of below link:

linuxcnc.org/docs/devel/html/remap/remap...g_dealing_with_abort

After creation of yours "on_abort" function you must include in it any M65 (output off) to previously called M64 (output on) of an output you want to go off.

I have tested that also with user M-codes where I have one M-code switching pin on TRUE (with use of setp HAL command) so in order to reset I had another M-code that switches pin to FALSE. For all the crucial pins I need to reset back to FALSE I include proper M-command in my "on_abort" subroutine.

The only thing that can cause some issue is PAUSE command on program depending how and for what you use the pins. But that is probably different topic.
 
The following user(s) said Thank You: tommylight

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

Time to create page: 0.121 seconds
Powered by Kunena Forum