Enable / Disable Output when Spindle is ON /OFF

More
05 Aug 2025 20:34 - 05 Aug 2025 20:35 #332921 by tsaG
Hi,

I do have a ATC spindle that requires bearing air. For this, I can enable the solenoid via M64 P05 and disable it via M65 P05. How can I automate it so that it activates the air when the spindle is active (as I understood, every time the M3 command is run)? 
My first idea is remapping the M3 command and add the M64 in it but I do not know how to enable the spindle then in the remapped M3...
Last edit: 05 Aug 2025 20:35 by tsaG.

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

More
05 Aug 2025 20:52 #332922 by PCW
If it only needs to be on when the spindle is on,
you could do it all in hal with  single statement:

net spindle-air spindle.0.on air-solenoid-drive

(with names other than spindle.0.on changed as desired)


 

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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
05 Aug 2025 20:55 #332923 by tommylight
Replied by tommylight on topic Enable / Disable Output when Spindle is ON /OFF
In hal, add the air output pin to spindle-on signal
No remap required.

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

More
05 Aug 2025 21:53 #332927 by tsaG
Ah, even easier. Thanks!

Like so ( I would also like to use manually using code, thus mapped to motion pin)?
net solenoid-bearing_air spindle.0.on hm2_7i76e.0.7i76.0.0.output-11 <= motion.digital-out-05

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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
05 Aug 2025 22:09 #332929 by tommylight
Replied by tommylight on topic Enable / Disable Output when Spindle is ON /OFF
Pretty sure this is all you need
net spindle.0.on hm2_7i76e.0.7i76.0.0.output-11
or this
net solenoid-bearing_air spindle.0.on hm2_7i76e.0.7i76.0.0.output-11

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

More
06 Aug 2025 08:44 #332945 by rodw
Sometimes you might need to use a timedelay on the spindle.0.on to ensure the air circuit gets up to pressure before the spindle actually spins.

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

More
06 Aug 2025 09:49 #332951 by tsaG
Thanks for the tips! 

I applied it to my setup and realized that the 
xhc-whb04b-6 Hal code already used the spindle valve signal.
"
net pdnt.spindle.is-on whb.halui.spindle.is-on spindle.0.on"
After fiddling for some time, I came up with 
"net pdnt.spindle.is-on => hm2_7i76e.0.7i76.0.0.output-11" 

In my Hal file. Everything is working now. Thanks! :)
The following user(s) said Thank You: tommylight

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

Time to create page: 0.089 seconds
Powered by Kunena Forum