Hardware button to reset spindle / feed override

More
14 Mar 2015 18:13 #56804 by pippin88
I've put together a new electronics box for my router (and mill, and lathe, it will be exchangeable between them).

As part of this I've put a number of hardware buttons on the front.
I've got Estop, cycle start, pause/ resume, Stop all working fine.

Today I implemented spindle speed and feed overrides.
I've got four buttons for each, interfaced using HALUI:
Increase
Decrease
Shift
Reset

Increase and decrease default to changing the speed by 10%. If I hold the shift button, then increase or decrease work in 5% increments. I've done this using mux2.9 to select between the two values for scale.

What I can't find how to do is have the fourth button ('reset') clear the override / set speeds back to 100%. Gmoccapy has a button on screen to do this, but I can't find how it works. There doesn't seem to be a HALUI pin to do this.

My code:
#*******************
# Front Panel
#*******************

loadrt mux2 count=2
addf mux2.0 servo-thread
addf mux2.1 servo-thread

# Spindle override 
#mux allows us to choose between the two values. mux2.n.out defaults to .in0 if mux2.n.sel is not called
setp mux2.0.in0 0.1
setp mux2.0.in1 0.05
net spinshift mux2.0.sel <= hm2_7i43.0.7i76.0.0.input-02 #shift white
net spinoverride halui.spindle-override.scale <= mux2.0.out
net spinup <= hm2_7i43.0.7i76.0.0.input-00 #up orange 
net spindown <= hm2_7i43.0.7i76.0.0.input-01 #down blue
net spinup => halui.spindle-override.increase
net spindown => halui.spindle-override.decrease

#setp halui.spindle-override.direct-value 0
#net spinreset <= hm2_7i43.0.7i76.0.0.input-03 #reset white
#net spinreset => halui.spindle-override.direct-value 0

# Feed override
setp mux2.1.in0 0.1
setp mux2.1.in1 0.05
net feedshift mux2.1.sel <= hm2_7i43.0.7i76.0.0.input-10 #shift white
net feedup <= hm2_7i43.0.7i76.0.0.input-08 #up orange
net feeddown <= hm2_7i43.0.7i76.0.0.input-09 #down blue
net feedoverride halui.feed-override.scale <= mux2.1.out
net feedup => halui.feed-override.increase
net feeddown => halui.feed-override.decrease 

#net feedreset hm2_7i43.0.7i76.0.0.input-11 #reset white

# Estop
net estop-ext hm2_7i43.0.7i76.0.0.input-24
net estop-out     <=  iocontrol.0.user-enable-out
net estop-ext     =>  iocontrol.0.emc-enable-in

# Cycle Start/pause/stop
loadrt and2 count=4
loadrt or2 count=1
loadrt toggle count=1
loadrt toggle2nist count=1
addf and2.0 servo-thread
addf and2.1 servo-thread
addf and2.2 servo-thread
addf and2.3 servo-thread
addf or2.0 servo-thread
addf toggle.0 servo-thread
addf toggle2nist.0 servo-thread

net stop-btn halui.program.stop <= hm2_7i43.0.7i76.0.0.input-25-not #stop red
net start-btn hm2_7i43.0.7i76.0.0.input-27 => halui.mode.auto halui.program.run #start green

# External Program Pause/Resume Button
net pause-resume-btn and2.0.in0 and2.1.in0 <= hm2_7i43.0.7i76.0.0.input-26 #pause yellow
net pause-on toggle2nist.0.is-on and2.0.in1 <= halui.program.is-paused
net run-on and2.1.in1 <= halui.program.is-running
net pause-sig or2.0.in0 <= and2.0.out
net resume-sig or2.0.in1 <= and2.1.out
net toggle-ok toggle.0.in <= or2.0.out
net togglesig toggle2nist.0.in <= toggle.0.out
net toggleon halui.program.pause <= toggle2nist.0.on
net toggleoff halui.program.resume <= toggle2nist.0.off

Help is appreciated.

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

More
15 Mar 2015 01:52 - 15 Mar 2015 01:52 #56819 by newbynobi
Hallo pippin88,

if you use gmoccapy, it is very simple, as gmoccapy offers a corresponding hal pin:
net feedreset    hm2_7i43.0.7i76.0.0.input-11   =>  gmoccapy.reset-feed-override

Just place it in your postgui halfile.

I do recommend also to use gmoccapy hal pins instead of the halui pin, gmoccapy offers most pins by itselfs.

Norbert
Last edit: 15 Mar 2015 01:52 by newbynobi.

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

Time to create page: 0.081 seconds
Powered by Kunena Forum