Additional hardware-button for coolant

More
22 Oct 2025 12:50 #336874 by TripleM
Hello,
I would like to add a hardware button for cooling, for example.
Currently, my *.hal entry looks like this:
net coolant-flood     <=  iocontrol.0.coolant-flood => hm2_7i96s.0.7i84.0.0.output-11

This allows me to switch the coolant on and off via the GUI.

How can I add the hardware button (push button)?
I want to be able to continue switching it on and off in the GUI and see that the cooling is switched on. 

Thanks   

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

More
22 Oct 2025 13:01 #336875 by zz912

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

More
22 Oct 2025 13:20 - 22 Oct 2025 13:24 #336876 by andypugh
Replied by andypugh on topic Additional hardware-button for coolant
On my lathe I fitted a 3-position switch, labelled with "on - auto - off". This allows me to override the G-code if required, to either on or off.

The HAL to do this looks like this:
net coolant-off hm2_7i84.008a.input-25
net coolant-on hm2_7i84.008a.input-26

loadrt mux_generic config="bb4"
addf mux-gen.00 servo-thread
net coolant-off mux-gen.00.sel-bit-00
net coolant-on mux-gen.00.sel-bit-01
net coolant-flood mux-gen.00.out-bit => hm2_7i84.008a.output-08
net coolant-auto iocontrol.0.coolant-flood mux-gen.00.in-bit-00
setp mux-gen.00.in-bit-01 0
setp mux-gen.00.in-bit-02 1
setp mux-gen.00.in-bit-03 0

Possibly not the simplest way, I suppose that it could have been done with simple AND and NOT components

coolant-out = (coolant _flood OR coolant_on) AND (NOT coolant_off)

Or even LUT5.
Truth-table for LUT5
coolant_flood | 0 1 0 1 0 1 0 1
coolant_on    | 0 0 1 1 0 0 1 1
coolant_off   | 0 0 0 0 1 1 1 1

coolant_out   | 0 1 1 1 0 0 0 0

LUT5 Mask = 14 (0x0E)
Last edit: 22 Oct 2025 13:24 by andypugh.

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

  • newbynobi
  • newbynobi's Avatar
  • Away
  • Moderator
  • Moderator
More
22 Oct 2025 13:26 #336877 by newbynobi
Replied by newbynobi on topic Additional hardware-button for coolant
You may also just use the halui pin,

linuxcnc.org/docs/html/gui/halui.html#_flood

 

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

Moderators: newbynobiHansU
Time to create page: 0.065 seconds
Powered by Kunena Forum