mist & flood buttons

More
02 Oct 2016 09:08 #81143 by lucky phil
Hi I have configured my hal & custom postgui hal files to get my mist & flood buttons working in my py vcp, but had to disable the buttons on the main screen to get them to work.
Can someone help me get both the vcp & main screen buttons working at the same time as I would like to put a disable "m" code in my nc file to automatically turn off mist & flood at the end of the job (the "m" codes don't work if I have the buttons in the vcp working).

These lines make my buttons work on the main screen and also written in nc files.
MAXIMUS.HAL
net coolant-mist => parport.0.pin-14-out
net coolant-flood => parport.0.pin-16-out

These lines make my vcp buttons work but I have to disable previous lines.
CUSTOM POSTGUI.HAL
######## Air Button ########
net flood-toggle toggle.0.in <= pyvcp.coolant-flood

######## Air Led########
net flood-control toggle.0.out => pyvcp.flood.is-on
net flood-control toggle.0.out => parport.0.pin-16-out

######## Mist Button ########
net mist-toggle toggle.1.in <= pyvcp.coolant-mist

######## Mist Led########
net mist-control toggle.1.out => pyvcp.mist.is-on
net mist-control toggle.1.out => parport.0.pin-14-out

regards
Philip
More
02 Oct 2016 12:02 #81147 by Rick G
You could link the buttons on the panel to the proper M codes for mist and flood.
wiki.linuxcnc.org/cgi-bin/wiki.pl?Adding_Custom_MDI_Buttons

Rick G
More
02 Oct 2016 22:14 #81157 by lucky phil
Hi Rick, thanks for your reply
I was just reading this post
forum.linuxcnc.org/forum/24-hal-componen...2-hal-trigger-m-code

that Todd had answered and said that MDI doesn't work when in auto mode.
When I'm cutting or engraving aluminium I can press my panel buttons as needed (they both toggle on & off) but on some jobs I would like to be able to write it into the code but more be able to have them turn off automatically.
I haven't tried the MDI buttons for that reason, I cant find anything on writing the hal lines any other way to get both to work.
Philip
More
03 Oct 2016 01:04 #81163 by Todd Zuercher
I actually went through a similar problem a while back, and here is how I solved it (pertaining to a Glade VCP panel and some custom M-codes)
forum.linuxcnc.org/forum/48-gladevcp/30365-options
More
03 Oct 2016 06:11 #81169 by lucky phil
Todd
That's pretty much exactly what I want to do, I will start with coolant mist & flood as my mist controls a metho spray and flood controls a jet of air directed at the cutter. I manually turn the mist on & off as needed but want to disable all when the code finishes.
My buttons are toggle on/off and leds show their state.
Once I have this working and finish building a vacuum table I will add these to the panel as well.
Any chance you could send me a copy of all your config files to read through & copy snippets out of.

Philip
More
03 Oct 2016 13:33 #81184 by Todd Zuercher
I'm not sure all these hoops are necessary to jump through with the coolant/mist, as the M-codes (M7,M8,M9) are already there for that purpose and I think there are hal pins for controlling/overriding them with buttons (real or VCP), and ending your file with an M2 or M30 turns them off automatically.

But here is a config where I have implemented it. The custom M-codes for controlling the vacuum table (M111,on M112 off) actually trigger the radio buttons for vacuum on/off in the glade panel, then the glade panel controls the hal pins that turn the vacuum on/off.

File Attachment:

File Name: Digital_5.zip
File Size:14 KB


To be honest having the ability to turn the vacuum on/off while the machine was running, isn't real important (an MDI command would have been good enough). I did it more to see if I could make it work and as a proof of concept for some future plans on the back burner.
Attachments:
More
04 Oct 2016 16:26 #81220 by andypugh
Try connecting the PyVCP buttons to halui.mist.on and halui.mist.off
linuxcnc.org/docs/2.7/html/man/man1/halui.1.html

You should use momentary buttons, and you probably want an LED connected to the halui.mist.is-on output pin to indicate the current state.

An alternative is to use a 3-position switch. I have this on my lathe, and that has auto (g-code controlled) off and on positions. You could do the same with a PyVCP RadioButton control. Use a mux4 component to choose between them with in0 netted to iocontrol.0.coolant-flood, in1 setp to 1, in2 setp to 0, in3 can be ignored. Then pyvcp.manual-on to mux4.0.sel0, pyvcp.manual-off to sel1.
linuxcnc.org/docs/2.7/html/man/man9/mux4.9.html
More
05 Oct 2016 20:16 #81273 by lucky phil
Let me start by saying my Linux knowledge is limited.
Last night I enabled these lines "net coolant-mist => parport.0.pin-14-out" " net coolant-flood => parport.0.pin-16-out" in hal again to get the Axis buttons working again, M2 & M30 do turn them off in code as stated.
I have tried all different ways of writing the lines to connect my PyVCP buttons to halui as Andy has said But just can't seem to get it right.
I would like to use the panel buttons as I can simply click the mouse any time to operate, if I cant find a workaround or the exact code in the right place a three position switch might have to do.
My PP pins 14 & 16 are what is controlled by the buttons which operate relays to supply 12v to solenoids on the air & fluid tubes.

Am I right in saying:
1 leave the Axis buttons working.
2 wire the 3 position switch between relay out/solenoid in for auto operation
3 wire other side of switch with 12v supply for manual operation

I did try to use mux4 for something once before but always came up with an error saying not installed or something.

Philip
More
05 Oct 2016 20:42 #81275 by Todd Zuercher
To start with the hal connections for your pyvcp need to be done after the gui is loaded. So you need to define a postgui hal file, and that is where the net commands that will connect the buttons to the halui pins need to go. If you post copies of your post gui hal file, and the xml for the pyvcp, I'm sure we could show you where you're going wrong.
More
06 Oct 2016 05:34 #81290 by lucky phil
Hi Todd thanks , here you go.
Attachments:
Time to create page: 0.318 seconds
Powered by Kunena Forum