Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Include your customized HAL commands here
- # The commands in this file are run after the AXIS GUI (including PyVCP panel)
- # starts
- # This file will not be overwritten when you run stepconf again
- # te 5/5/10 (from dg 2/23/09)
- # See http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Simple_Remote_Pendant
- # Also make sure the .ini files contains:
- #[HAL]
- #HALFILE = EmcoF1Mill.hal
- #HALFILE = custom.hal
- #POSTGUI_HALFILE = custom_postgui.hal
- #HALUI = halui
- # custom.hal contains a single line (without comment hash):
- # loadusr -W hal_input -KRAL DragonRise
- # option 1--fixed jog speed:
- # setp halui.jog-speed 10
- # option 2--default jog speed, buttons 1-3 select slow to fast when held down,
- # if no buttons, default speed
- # load these two components--qty 2 2-input OR gates, qty 1 4-input mux
- loadrt or2 count=2
- loadrt mux4 count=1
- # add these to the servo thread
- addf or2.0 servo-thread
- addf or2.1 servo-thread
- addf mux4.0 servo-thread
- # jog speeds. 0 is the default (no button), in1, in2, and in3 correspond to
- # buttons 1, 2, and 3 on the right side of the game pad
- # set in0 to 0 to prevent any motion unless a button is pressed,
- # otherwise set to a default jog speed
- setp mux4.0.in0 10
- setp mux4.0.in1 0.1
- setp mux4.0.in2 20
- setp mux4.0.in3 45
- # the following does the magic of setting the jog speeds
- net remote-speed-slow or2.0.in0 input.0.btn-trigger
- net remote-speed-medium or2.1.in0 input.0.btn-thumb
- net remote-speed-fast or2.0.in1 or2.1.in1 input.0.btn-thumb2
- net joy-speed-1 mux4.0.sel0 <= or2.0.out
- net joy-speed-2 mux4.0.sel1 <= or2.1.out
- net joy-speed-final halui.jog-speed <= mux4.0.out
- # now process axes
- loadrt sum2 count=2 # one instance for each axis you need to reverse, also check to make sure you don't already have sum2 loaded (will show up under functions in machine->show hal configuration?)
- addf sum2.0 servo-thread # in my case I needed to reverse the Y and Z axis
- addf sum2.1 servo-thread
- # x is fine, no need to reverse
- net joy-x-jog halui.jog.0.analog <= input.0.abs-x-position
- # if no need to reverse, use the following line:
- #net joy-y-jog halui.jog.1.analog <= input.0.abs-y-position
- # if needed, reverse the analog so the axis will go in the expected direction
- setp sum2.0.gain0 -1
- net reverse-y sum2.0.in0 <= input.0.abs-y-position
- net joy-y-jog halui.jog.1.analog <= sum2.0.out
- # same need to reverse z axis
- #net joy-z-jog halui.jog.2.analog <= input.0.abs-rz-position
- setp sum2.1.gain0 -1
- net reverse-z sum2.1.in0 <= input.0.abs-rz-position
- net joy-z-jog halui.jog.2.analog <= sum2.1.out
- # a (rotation) axis
- #net joy-a-jog halui.jog.3.analog <= input.0.abs-a-position
- # set up e-stop--larger right button marked "2" facing away from operator
- net joy-estop halui.estop.activate <= input.0.btn-pinkie
- # spindle on, increase, off
- # spindle on is "start" button
- net joy-spindle-on halui.spindle.start <= input.0.btn-base4
- # spindle increase is button "1" on right
- net joy-spindle-increase halui.spindle.increase <= input.0.btn-base2
- # spindle decrease is button "1" on left
- net joy-spindle-decrease halui.spindle.decrease <= input.0.btn-base
- # spindle stop is button "select"
- net joy-spindle-stop halui.spindle.stop <= input.0.btn-base3
- #AXIS display of Spindle speed
- #linksp spindle-vel-fb pyvcp.spindle-speed
- linksp spindle-vel-cmd pyvcp.spindle-speed
- #AXIS display of Work Light Control
- linksp worklight-ctl pyvcp.worklight
- #AXIS button to do a rapid home command (G53 G0 x0 y0 z0)
- net remote-rapid-to-home halui.mdi-command-00 <= pyvcp.rapid-to-home
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement