Additional hardware-button for coolant

More
1 year 1 week ago #336874 by TripleM
Hello,
I would like to add a hardware button for cooling, for example.
Currently, my *.hal entry looks like this:
Code:
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
1 year 1 week ago #336875 by zz912

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

More
1 year 1 week ago - 1 year 1 week ago #336876 by andypugh
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:
Code:
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
Code:
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: 1 year 1 week ago by andypugh.

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

More
1 year 1 week ago #336877 by newbynobi
You may also just use the halui pin,

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

 
The following user(s) said Thank You: rodw

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

More
1 year 1 week ago #337041 by TripleM
The halui pin works.
nfortunately, it is currently very sensitive. If you press the button for too long, the pump switches off again or toggles between on and off.

I would need to add something that checks whether the button has been pressed again. 
Does anyone have any ideas?
Code:
loadrt not names=not.coolant loadrt and2 names=and.coolanton,and.coolantoff addf not.coolant    servo-thread addf and.coolanton     servo-thread addf and.coolantoff servo-thread net coolant_on     not.coolant.in     and.coolantoff.in0    <= halui.flood.is-on net and1_in_1    and.coolanton.in1    and.coolantoff.in1    <= emcopanel.coolant net and1_in_0    and.coolanton.in0     <= not.coolant.out net and1_out    and.coolanton.out     => halui.flood.on net and2_out    and.coolantoff.out    => halui.flood.off

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

More
1 year 1 week ago #337042 by rodw
try toggle or toggle2nist components.

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

Moderators: newbynobi, HansU
Time to create page: 0.088 seconds
Powered by Kunena Forum