Advertisement
Guest User

Untitled

a guest
May 5th, 2010
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. #Include your customized HAL commands here
  2. # The commands in this file are run after the AXIS GUI (including PyVCP panel)
  3. # starts
  4. # This file will not be overwritten when you run stepconf again
  5.  
  6. # te 5/5/10 (from dg 2/23/09)
  7. # See http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Simple_Remote_Pendant
  8. # Also make sure the .ini files contains:
  9. #[HAL]
  10. #HALFILE = EmcoF1Mill.hal
  11. #HALFILE = custom.hal
  12. #POSTGUI_HALFILE = custom_postgui.hal
  13. #HALUI = halui
  14.  
  15. # custom.hal contains a single line (without comment hash):
  16. # loadusr -W hal_input -KRAL DragonRise
  17.  
  18. # option 1--fixed jog speed:
  19. # setp halui.jog-speed 10
  20.  
  21. # option 2--default jog speed, buttons 1-3 select slow to fast when held down,
  22. # if no buttons, default speed
  23.  
  24. # load these two components--qty 2 2-input OR gates, qty 1 4-input mux
  25. loadrt or2 count=2
  26. loadrt mux4 count=1
  27.  
  28. # add these to the servo thread
  29. addf or2.0 servo-thread
  30. addf or2.1 servo-thread
  31. addf mux4.0 servo-thread
  32.  
  33. # jog speeds.  0 is the default (no button), in1, in2, and in3 correspond to
  34. # buttons 1, 2, and 3 on the right side of the game pad
  35. # set in0 to 0 to prevent any motion unless a button is pressed,
  36. # otherwise set to a default jog speed
  37. setp mux4.0.in0 10
  38. setp mux4.0.in1 1
  39. setp mux4.0.in2 20
  40. setp mux4.0.in3 45
  41.  
  42. # the following does the magic of setting the jog speeds
  43. net remote-speed-slow or2.0.in0 input.0.btn-trigger
  44. net remote-speed-medium or2.1.in0 input.0.btn-thumb
  45. net remote-speed-fast or2.0.in1 or2.1.in1 input.0.btn-thumb2
  46.  
  47. net joy-speed-1 mux4.0.sel0 <= or2.0.out
  48. net joy-speed-2 mux4.0.sel1 <= or2.1.out
  49. net joy-speed-final halui.jog-speed <= mux4.0.out
  50.  
  51.  
  52. # now process axes
  53. 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?)
  54. addf sum2.0 servo-thread # in my case I needed to reverse the Y and Z axis
  55. addf sum2.1 servo-thread
  56.  
  57. # x is fine, no need to reverse
  58. net joy-x-jog halui.jog.0.analog <= input.0.abs-x-position
  59.  
  60. # if no need to reverse, use the following line:
  61. #net joy-y-jog halui.jog.1.analog <= input.0.abs-y-position
  62. # if needed, reverse the analog so the axis will go in the expected direction
  63. setp sum2.0.gain0 -1
  64. net reverse-y sum2.0.in0 <= input.0.abs-y-position
  65. net joy-y-jog halui.jog.1.analog <= sum2.0.out
  66.  
  67. # same need to reverse z axis
  68. #net joy-z-jog halui.jog.2.analog <= input.0.abs-rz-position
  69. setp sum2.1.gain0 -1
  70. net reverse-z sum2.1.in0 <= input.0.abs-rz-position
  71. net joy-z-jog halui.jog.2.analog <= sum2.1.out
  72.  
  73. # a (rotation) axis
  74. #net joy-a-jog halui.jog.3.analog <= input.0.abs-a-position
  75.  
  76. # set up e-stop--larger right button marked "2" facing away from operator
  77. net joy-estop halui.estop.activate <= input.0.btn-pinkie
  78.  
  79. # spindle on, increase, off
  80. # spindle on is "start" button
  81. net joy-spindle-on halui.spindle.start <= input.0.btn-base4
  82. # spindle increase is button "1" on right
  83. net joy-spindle-increase halui.spindle.increase <= input.0.btn-base2
  84. # spindle decrease is button "1" on left
  85. net joy-spindle-decrease halui.spindle.decrease <= input.0.btn-base
  86. # spindle stop is button "select"
  87. net joy-spindle-stop halui.spindle.stop <= input.0.btn-base3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement