############################################### # # Implementing XHC-HB04 Pendant for RMD # Files needed to be modified to use this # /etc/udev/rules.d/99-xhc.rules # xhc-hb04.cc as part of base linuxcnc # # Written by Chad Woitas For RMD Engineering # October 2019 # ############################################## # Button mapping for reference # BUTTON=01:button-reset # BUTTON=02:button-stop # BUTTON=03:button-start-pause #TEST # BUTTON=04:button-feed_up # Macro 1 #TEST # BUTTON=05:button-feed_down # Macro 2 #TEST # BUTTON=06:button-spindle_up # Macro 3 #Function? # BUTTON=07:button-spindle_down # Macro 4 #Function? # BUTTON=08:button-machine-home # Macro 5 # BUTTON=09:button-safe-z #?? # Macro 6 # BUTTON=0A:button-work-home # Macro 7 # BUTTON=0B:button-spindle # Macro 8 # BUTTON=0C:button-fn # BUTTON=0D:button-probe-z # Macro 9 # BUTTON=0E:button-continous # BUTTON=0F:button-step # BUTTON=10:button-macro-10 # load our driver # config files are stored in the machine INI # -H is to run in real time mode loadusr -W xhc-hb04 -I xhc-hb04-layout1.ini -H loadrt flipflop names=flipflop_resume,flipflop_pause,flipflop_run,flipflop_icon,flipflop_spindle_start,flipflop_spindle_stop # pins for start/pause button 3 addf flipflop_resume servo-thread addf flipflop_pause servo-thread addf flipflop_run servo-thread # ??? addf flipflop_icon servo-thread # pins for spindle start stop addf flipflop_spindle_start servo-thread addf flipflop_spindle_stop servo-thread # SETUP pins # Clicks declared in button order loadrt multiclick names=click_reset,click_estop,click_start_pause,click_feed_up,click_feed_dn,click_spindle_up,click_spindle_dn,click_m_home,click_safe_z,click_w_home,click_spindle loadrt not names=not_spin addf not_spin servo-thread # BUTTON=01:button-reset addf click_reset servo-thread net xhc-reset xhc-hb04.button-reset => click_reset.in net estop-reset halui.estop.reset <= click_reset.single-click # BUTTON=02:button-stop addf click_estop servo-thread net estop-xhbutton xhc-hb04.button-stop => click_estop.in net estop-activated halui.estop.activate <= click_estop.single-click # BUTTON=03:button-start-pause addf click_start_pause servo-thread net xhc-start_pause xhc-hb04.button-start-pause => flipflop_pause.clk flipflop_resume.clk flipflop_run.clk net is-paused halui.program.is-paused => flipflop_resume.data flipflop_pause.reset net is-running halui.program.is-running => flipflop_pause.data flipflop_run.reset flipflop_resume.reset net is-idle halui.program.is-idle => flipflop_run.data net resume flipflop_resume.out => halui.program.resume net pause flipflop_pause.out => halui.program.pause net run flipflop_run.out => halui.mode.auto halui.program.run # BUTTON=04:button-feed_up # Macro 1 addf click_feed_up servo-thread net sig_feed_inu xhc-hb04.button-feed_up => click_feed_up.in net sig_feed_up halui.feed-override.increase <= click_feed_up.single-click # BUTTON=05:button-feed_down # Macro 2 addf click_feed_dn servo-thread net sig_feed_ind xhc-hb04.button-feed_down => click_feed_dn.in net sig_feed_dn halui.feed-override.decrease <= click_feed_dn.single-click # BUTTON=06:button-spindle_up # Macro 3 addf click_spindle_up servo-thread net sig_spin_inu xhc-hb04.button-spindle_up => click_spindle_up.in net sig_spin_up halui.spindle.0.override.increase <= click_spindle_up.single-click # BUTTON=07:button-spindle_down # Macro 4 addf click_spindle_dn servo-thread net sig_spin_ind xhc-hb04.button-spindle_down => click_spindle_dn.in net sig_spin_dn halui.spindle.0.override.decrease <= click_spindle_dn.single-click # BUTTON=08:button-machine-home # Macro 5 addf click_m_home servo-thread net sig_m_home_in xhc-hb04.button-machine-home => click_m_home.in # net sig_m_home or2.0.in0 <= click_m_home.single-click # BUTTON=09:button-safe-z # Macro 6 addf click_safe_z servo-thread net sig_safe_z_in xhc-hb04.button-safe-z => click_safe_z.in # TODO Send this to mdi g53? # BUTTON=0A:button-work-home # Macro 7 addf click_w_home servo-thread net sig_w_home_in xhc-hb04.button-work-home => click_w_home.in # net sig_w_home or2.0.in1 <= click_w_home.single-click # BUTTON=0B:button-spindle # Macro 8 addf click_spindle servo-thread net sig_spin_in xhc-hb04.button-spindle => flipflop_spindle_start.clk flipflop_spindle_stop.clk net is-on_spindle halui.spindle.0.is-on => flipflop_spindle_stop.data flipflop_spindle_start.reset not_spin.in net is-off_spindle not_spin.out => flipflop_spindle_start.data flipflop_spindle_stop.reset #net start_spindle flipflop_spindle_start.out => halui.mdi-command-09 #net stop_spindle flipflop_spindle_stop.out => halui.mdi-command-08 # BUTTON=0C:button-fn # BUTTON=0D:button-probe-z # Macro 9 # BUTTON=0E:button-continous # BUTTON=0F:button-step # BUTTON=10:button-macro-10 # LCD net Xpos => xhc-hb04.x.pos-absolute net Ypos => xhc-hb04.y.pos-absolute net Zpos => xhc-hb04.z.pos-absolute #net spindle-rps spindle.0.speed-out-abs => xhc-hb04.spindle-rps net feedrate halui.feed-override.value => xhc-hb04.feed-value # Jog wheel and axis selection button net jog-x joint.0.jog-enable <= xhc-hb04.jog.enable-x net jog-y joint.1.jog-enable <= xhc-hb04.jog.enable-y net jog-z joint.2.jog-enable <= xhc-hb04.jog.enable-z net jog-counts xhc-hb04.jog.counts => joint.0.jog-counts joint.1.jog-counts joint.2.jog-counts #net jog-counts-neg xhc-hb04.jog.counts-neg => joint.0.jog-counts joint.1.jog-counts joint.2.jog-counts # Jog wheel and axis selection button net jog-x axis.x.jog-enable <= xhc-hb04.jog.enable-x #net jog-y axis.y.jog-enable <= xhc-hb04.jog.enable-y #net jog-z axis.z.jog-enable <= xhc-hb04.jog.enable-z net jog-counts xhc-hb04.jog.counts => axis.x.jog-counts axis.y.jog-counts #net jog-counts-neg xhc-hb04.jog.counts-neg => axis.z.jog-counts # Step Size selector loadrt mux_generic config=ff256 addf mux-gen.00 servo-thread setp mux-gen.00.in-float-01 0.02 setp mux-gen.00.in-float-02 0.05 setp mux-gen.00.in-float-04 0.10 setp mux-gen.00.in-float-08 0.30 setp mux-gen.00.in-float-16 0.60 setp mux-gen.00.in-float-32 1.00 setp mux-gen.00.in-float-64 1.00 net step0 mux-gen.00.sel-bit-00 <= xhc-hb04.stepsize0 net step1 mux-gen.00.sel-bit-01 <= xhc-hb04.stepsize1 net step2 mux-gen.00.sel-bit-02 <= xhc-hb04.stepsize2 net step3 mux-gen.00.sel-bit-03 <= xhc-hb04.stepsize3 net step4 mux-gen.00.sel-bit-04 <= xhc-hb04.stepsize4 net step5 mux-gen.00.sel-bit-05 <= xhc-hb04.stepsize5 net step6 mux-gen.00.sel-bit-06 <= xhc-hb04.stepsize6 net step_all mux-gen.00.out-float => joint.0.jog-scale joint.1.jog-scale joint.2.jog-scale