Hardware button to control qtdragon_hd

More
2 years 9 months ago - 2 years 9 months ago #292176 by echristley
Got it to work. In my main HAL file I have

# --- SPINDLE-MANUAL-CCW ---
net spindle-manual-ccw     <=  [HMOT](CARD0).inm.00.input-03
# --- SPINDLE-MANUAL-CW ---
net spindle-manual-cw     <=  [HMOT](CARD0).inm.00.input-04

net spindle-manual-cw halui.spindle.0.forward
net spindle-manual-ccw halui.spindle.0.reverse
net spindle-manual-stop halui.spindle.0.stop

I'm pretty sure that was there from the original configuration. In my custom_postgui.hal, I have

loadrt mux4 count=1
loadrt and2 count=5

# --- spindle control box setup ---
addf mux4.0 servo-thread

#use mux to send one of four values to vfd
#stop
setp mux4.0.in0 5
#forward
setp mux4.0.in1 1
#reverse
setp mux4.0.in2 2
#fault reset
setp mux4.0.in3 7

net spindle_forward_button halui.spindle.0.runs-forward => mux4.0.sel0
net spindle_rev_button halui.spindle.0.runs-backward => mux4.0.sel1
addf and2.4 servo-thread
net spindle_manual_ccw_stop and2.4.in0 <= [HMOT](CARD0).inm.00.input-03-not
net spindle_manual_cw_stop and2.4.in1 <= [HMOT](CARD0).inm.00.input-04-not
net spindle-manual-stop <= and2.4.out


I'll post a video of it working "real soon now".
Last edit: 2 years 9 months ago by echristley.

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

Moderators: cmorley
Time to create page: 0.050 seconds
Powered by Kunena Forum