Motion digital output value on stop

More
12 Jul 2021 21:04 #214431 by rajewski
I'm using a motion.digital-out signal to control my dust collector from gcode. I got everything working well and got it all tied into my post.

I've run into one problem though. If I disable the machine or stop the program in the middle, the "M65 P3" is never run so the dust collector stays on.

Is there a way to ensure this runs or set a default value if a program is stopped or if the machine is disabled?

I know I could use an and2 component in my HAL to gate the signal if the machine is enabled but this wouldn't solve the stopped program problem. It would also start the dust collector back up if I re-enabled the machine.

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

More
12 Jul 2021 21:55 #214436 by PCW
You could gate it with a signal indicating motion
( maybe a near component looking at motion.current-vel )

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

More
12 Jul 2021 22:40 #214441 by rajewski
Gating it doesn't solve the problem of it still being "on". For example, if I was running a program that used the dust collector but stopped it then started another program that didn't use the dust collector, the dust collector would turn on when the second program started.

Is there no way to "hook" into when a program is stopped or the machine is disabled to run a script?

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

More
12 Jul 2021 22:54 - 12 Jul 2021 23:06 #214445 by PCW
You could change the default startup gcode to turn off the digital output
Or add this to you other programs

There is probably a way to launch a script maybe by monitoring 
halui.program-is-running
 
Last edit: 12 Jul 2021 23:06 by PCW.

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

More
12 Jul 2021 23:01 #214447 by tommylight
Not sure if there is a pin
program is running
as AND-ing that with the digital output would achieve what you need, namely stopping the output if the program is stopped but would remain on if the program is paused.
Pretty sure RodW used something similar for warning lights.

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

More
12 Jul 2021 23:20 - 12 Jul 2021 23:28 #214451 by rajewski
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.

If I gated the output with the machine enabled signal and was able to change the state of the motion.digital-out pin on the falling edge of halui.program.is-running I think it would do more or less everything I want.

Edit: My machine doesn't use flood coolant. Do you know if this automatically gets turned off when the program is stopped? I could repurpose this signal.

Edit again: This seems to have worked exactly as I wanted.
Last edit: 12 Jul 2021 23:28 by rajewski.

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

More
13 Jul 2021 16:36 #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
13 Jul 2021 23:06 - 13 Jul 2021 23:16 #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: 13 Jul 2021 23:16 by bevins.

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

More
14 Jul 2021 00:43 #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
14 Jul 2021 09:44 - 14 Jul 2021 09:46 #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: 14 Jul 2021 09:46 by bevins.
The following user(s) said Thank You: rodw

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

Time to create page: 0.144 seconds
Powered by Kunena Forum