mist & flood buttons

More
10 years 4 weeks ago #81220 by andypugh
Replied by andypugh on topic mist & flood buttons
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

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

More
10 years 3 weeks ago #81273 by lucky phil
Replied by lucky phil on topic mist & flood buttons
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

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

More
10 years 3 weeks ago #81275 by Todd Zuercher
Replied by Todd Zuercher on topic mist & flood buttons
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.

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

More
10 years 3 weeks ago #81290 by lucky phil
Replied by lucky phil on topic mist & flood buttons
Hi Todd thanks , here you go.

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

More
10 years 3 weeks ago #81299 by Todd Zuercher
Replied by Todd Zuercher on topic mist & flood buttons
Ok, for starters I'd uncomment the mist and flood connection to the parallel port pins in your main hal file.
Then in your post gui hal do something like this:
Code:
# Include your customized HAL commands here # The commands in this file are run after the AXIS GUI (including PyVCP panel) starts sets spindle-at-speed true loadrt toggle2nist names=toggle.0,toggle.1 addf toggle.0 servo-thread addf toggle.1 servo-thread ######## Probe Led ######## net probe-in => pyvcp.probe-in ######## Mist Button ######## net mist-toggle toggle.0.in <= pyvcp.coolant-mist net mist-on toggle.0.on => halui.mist.on net mist-off toggle.0.off => halui.mist.off ######## Mist Led######## net mist-control halui.mist.is-on => toggle.0.is-on => pyvcp.mist.is-on ######## Air Button ######## net flood-toggle toggle.1.in <= pyvcp.coolant-flood net flood-on toggle.1.on => halui.flood.on net flood-off toggle.1.off => halui.flood.off ######## Air Led######## net flood-control halui.flood.is-on => toggle.1.is-on => pyvcp.flood.is-on ######## Panel Jogging Button ######## # connect the X pyVCP buttons net my-jogxminus halui.jog.0.minus <= pyvcp.x-minus net my-jogxplus halui.jog.0.plus <= pyvcp.x-plus # connect the Y pyVCP buttons net my-jogyminus halui.jog.1.minus <= pyvcp.y-minus net my-jogyplus halui.jog.1.plus <= pyvcp.y-plus # connect the Z pyVCP buttons net my-jogzminus halui.jog.2.minus <= pyvcp.z-minus net my-jogzplus halui.jog.2.plus <= pyvcp.z-plus # connect the A pyVCP buttons net my-jogaminus halui.jog.3.minus <= pyvcp.a-minus net my-jogaplus halui.jog.3.plus <= pyvcp.a-plus # connect the pyVCP jog speed slider net my-jogspeed halui.jog-speed <= pyvcp.jog-speed-f ######## MDI Commands ######## net panel-cmd-00 halui.mdi-command-00 <= pyvcp.cmd-00 net panel-cmd-01 halui.mdi-command-01 <= pyvcp.cmd-01 net panel-cmd-02 halui.mdi-command-02 <= pyvcp.cmd-02 net panel-cmd-03 halui.mdi-command-03 <= pyvcp.cmd-03 net panel-cmd-04 halui.mdi-command-04 <= pyvcp.cmd-04 net panel-cmd-05 halui.mdi-command-05 <= pyvcp.cmd-05 net panel-cmd-06 halui.mdi-command-06 <= pyvcp.cmd-06 net remote-o100 halui.mdi-command-07 <= pyvcp.o100 net panel-cmd-08 halui.mdi-command-08 <= pyvcp.cmd-08 net panel-touch-x halui.mdi-command-09 <= pyvcp.touch-x net panel-touch-y halui.mdi-command-10 <= pyvcp.touch-y net panel-touch-z halui.mdi-command-11 <= pyvcp.touch-z net panel-touch-a halui.mdi-command-12 <= pyvcp.touch-a
The following user(s) said Thank You: lucky phil, ikkuh

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

More
10 years 3 weeks ago #81301 by andypugh
Replied by andypugh on topic mist & flood buttons

lucky phil wrote: 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.


There is no point hard-wiring it, my 3-way switches operate in HAL. However I have plenty of IO to interface them with.

You already have:
Code:
net coolant-mist => parport.0.pin-14-out net coolant-flood => parport.0.pin-16-out

That creates two signals (coolant-mist, coolant-flood) and connects them to parport pins. Keep that but remove any other lines using those signals.

I have just remembered that the normal mux4 does not handle bit signals. This was probably your problem. We will use mux-generic.

Now, in the postGUI hal file (and after making sure that the postgui HAL file is mentioned in the [HAL] section of the INI file add this.
Code:
loadrt mux_generic config="bb4,bb4" #This line prints out the actual names of the mux pins, just in case show pin mux-* addf mux-gen.00 servo-thread addf mux-gen.01 servo-thread net flood-manual-off pyvcp.flood-manual-off => mux-gen.01.sel-bit-00 net flood-manual-on pyvcp.flood-manual-on => mux-gen.01.sel-bit-01 net mist-manual-off pyvcp.mist-manual-off => mux-gen.01.sel-bit-00 net mist-manual-on pyvcp.mist-manual-on =>mux-gen.01.sel-bit-01 net flood-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-01 1 setp mux-gen.00.in-bit-03 0 net coolant-flood <= mux-gen.00.out-bit net mist-auto iocontrol.0.coolant.mist => mux-gen.01.in-bit-00 setp mux-gen.01.in-bit-01 0 setp mux-gen.01.in-bit-01 1 setp mux-gen.01.in-bit-03 0 net coolant-mist <= mux-gen.01.out-bit

I have not tested this, I am some distance from my LinuxCNC machine
The following user(s) said Thank You: lucky phil

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

Time to create page: 0.127 seconds
Powered by Kunena Forum