Advertisement
Guest User

Raptor.hal

a guest
Mar 31st, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.67 KB | None | 0 0
  1. # Generated by PNCconf at Thu Mar 20 16:47:43 2014
  2. # If you make changes to this file, they will be
  3. # overwritten when you run PNCconf again
  4.  
  5. loadrt trivkins
  6. loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
  7. loadrt probe_parport
  8. loadrt hostmot2
  9. loadrt hm2_pci config=" num_encoders=1 num_pwmgens=0 num_3pwmgens=0 num_stepgens=4 sserial_port_0=00xxxxxx "
  10. setp hm2_5i25.0.watchdog.timeout_ns 10000000
  11.  
  12. addf hm2_5i25.0.read servo-thread
  13. addf motion-command-handler servo-thread
  14. addf motion-controller servo-thread
  15. addf hm2_5i25.0.write servo-thread
  16. addf hm2_5i25.0.pet_watchdog servo-thread
  17.  
  18. # external output signals
  19.  
  20.  
  21. # --- DOUT-00 ---
  22. net dout-00 hm2_5i25.0.7i76.0.0.output-00
  23.  
  24. # --- DOUT-01 ---
  25. #net dout-01 hm2_5i25.0.7i76.0.0.output-01
  26.  
  27. # --- DOUT-02 ---
  28. #net dout-02 hm2_5i25.0.7i76.0.0.output-02
  29.  
  30. # --- DOUT-03 ---
  31. net dout-03 hm2_5i25.0.7i76.0.0.output-03
  32.  
  33. # external input signals
  34.  
  35.  
  36. # --- MIN-HOME-X ---
  37. net min-home-x <= hm2_5i25.0.7i76.0.0.input-01-not
  38.  
  39. # --- MIN-X ---
  40. net min-x <= hm2_5i25.0.7i76.0.0.input-02-not
  41.  
  42. # --- MIN-HOME-Y ---
  43. net min-home-y <= hm2_5i25.0.7i76.0.0.input-04-not
  44.  
  45. # --- MAX-Y ---
  46. net max-y <= hm2_5i25.0.7i76.0.0.input-05-not
  47.  
  48. # --- MAX-HOME-Z ---
  49. net max-home-z <= hm2_5i25.0.7i76.0.0.input-07-not
  50.  
  51. # --- MIN-Z ---
  52. net min-z <= hm2_5i25.0.7i76.0.0.input-08
  53.  
  54. # --- MAX-A ---
  55. net max-a <= hm2_5i25.0.7i76.0.0.input-11-not
  56.  
  57. # --- HOME-A ---
  58. net home-a <= hm2_5i25.0.7i76.0.0.input-12-not
  59.  
  60. # --- MIN-A ---
  61. net min-a <= hm2_5i25.0.7i76.0.0.input-13-not
  62.  
  63. # --- ESTOP-EXT ---
  64. net estop-ext <= hm2_5i25.0.7i76.0.0.input-14-not
  65.  
  66. # --- CYCLE-START ---
  67. net cycle-start <= hm2_5i25.0.7i76.0.0.input-15
  68.  
  69. #*******************
  70. # AXIS X
  71. #*******************
  72.  
  73. # Step Gen signals/setup
  74.  
  75. setp hm2_5i25.0.stepgen.00.dirsetup [AXIS_0]DIRSETUP
  76. setp hm2_5i25.0.stepgen.00.dirhold [AXIS_0]DIRHOLD
  77. setp hm2_5i25.0.stepgen.00.steplen [AXIS_0]STEPLEN
  78. setp hm2_5i25.0.stepgen.00.stepspace [AXIS_0]STEPSPACE
  79. setp hm2_5i25.0.stepgen.00.position-scale [AXIS_0]STEP_SCALE
  80. setp hm2_5i25.0.stepgen.00.step_type 0
  81. setp hm2_5i25.0.stepgen.00.control-type 0
  82. setp hm2_5i25.0.stepgen.00.maxaccel 5000.0
  83. setp hm2_5i25.0.stepgen.00.maxvel 312.5
  84.  
  85. net x-pos-fb axis.0.motor-pos-fb <= hm2_5i25.0.stepgen.00.position-fb
  86. net x-pos-cmd axis.0.motor-pos-cmd => hm2_5i25.0.stepgen.00.position-cmd
  87. net x-enable axis.0.amp-enable-out => hm2_5i25.0.stepgen.00.enable
  88.  
  89. # ---setup home / limit switch signals---
  90.  
  91. net min-home-x => axis.0.home-sw-in
  92. net min-home-x => axis.0.neg-lim-sw-in
  93. net x-pos-limit => axis.0.pos-lim-sw-in
  94.  
  95. #*******************
  96. # AXIS Y
  97. #*******************
  98.  
  99. # Step Gen signals/setup
  100.  
  101. setp hm2_5i25.0.stepgen.01.dirsetup [AXIS_1]DIRSETUP
  102. setp hm2_5i25.0.stepgen.01.dirhold [AXIS_1]DIRHOLD
  103. setp hm2_5i25.0.stepgen.01.steplen [AXIS_1]STEPLEN
  104. setp hm2_5i25.0.stepgen.01.stepspace [AXIS_1]STEPSPACE
  105. setp hm2_5i25.0.stepgen.01.position-scale [AXIS_1]STEP_SCALE
  106. setp hm2_5i25.0.stepgen.01.step_type 0
  107. setp hm2_5i25.0.stepgen.01.control-type 0
  108. setp hm2_5i25.0.stepgen.01.maxaccel 5000.0
  109. setp hm2_5i25.0.stepgen.01.maxvel 312.5
  110.  
  111. net y-pos-fb axis.1.motor-pos-fb <= hm2_5i25.0.stepgen.01.position-fb
  112. net y-pos-cmd axis.1.motor-pos-cmd => hm2_5i25.0.stepgen.01.position-cmd
  113. net y-enable axis.1.amp-enable-out => hm2_5i25.0.stepgen.01.enable
  114.  
  115. # ---setup home / limit switch signals---
  116.  
  117. net min-home-y => axis.1.home-sw-in
  118. net min-home-y => axis.1.neg-lim-sw-in
  119. net max-y => axis.1.pos-lim-sw-in
  120.  
  121. #*******************
  122. # AXIS Z
  123. #*******************
  124.  
  125. # Step Gen signals/setup
  126.  
  127. setp hm2_5i25.0.stepgen.02.dirsetup [AXIS_2]DIRSETUP
  128. setp hm2_5i25.0.stepgen.02.dirhold [AXIS_2]DIRHOLD
  129. setp hm2_5i25.0.stepgen.02.steplen [AXIS_2]STEPLEN
  130. setp hm2_5i25.0.stepgen.02.stepspace [AXIS_2]STEPSPACE
  131. setp hm2_5i25.0.stepgen.02.position-scale [AXIS_2]STEP_SCALE
  132. setp hm2_5i25.0.stepgen.02.step_type 0
  133. setp hm2_5i25.0.stepgen.02.control-type 0
  134. setp hm2_5i25.0.stepgen.02.maxaccel 5000.0
  135. setp hm2_5i25.0.stepgen.02.maxvel 104.2
  136.  
  137. net z-pos-fb axis.2.motor-pos-fb <= hm2_5i25.0.stepgen.02.position-fb
  138. net z-pos-cmd axis.2.motor-pos-cmd => hm2_5i25.0.stepgen.02.position-cmd
  139. net z-enable axis.2.amp-enable-out => hm2_5i25.0.stepgen.02.enable
  140.  
  141. # ---setup home / limit switch signals---
  142.  
  143. net max-home-z => axis.2.home-sw-in
  144. net min-z => axis.2.neg-lim-sw-in
  145. net max-home-z => axis.2.pos-lim-sw-in
  146.  
  147. #*******************
  148. # SPINDLE S
  149. #*******************
  150.  
  151. # ---setup spindle control signals---
  152.  
  153. net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps
  154. net spindle-vel-cmd <= motion.spindle-speed-out
  155. net spindle-enable <= motion.spindle-on
  156. net spindle-cw <= motion.spindle-forward
  157. net spindle-ccw <= motion.spindle-reverse
  158. net spindle-brake <= motion.spindle-brake
  159. net spindle-revs => motion.spindle-revs
  160. net spindle-at-speed => motion.spindle-at-speed
  161. net spindle-vel-fb => motion.spindle-speed-in
  162. net spindle-index-enable <=> motion.spindle-index-enable
  163.  
  164. setp hm2_5i25.0.7i76.0.0.spinout-minlim [SPINDLE_9]OUTPUT_MIN_LIMIT
  165. setp hm2_5i25.0.7i76.0.0.spinout-maxlim [SPINDLE_9]OUTPUT_MAX_LIMIT
  166. setp hm2_5i25.0.7i76.0.0.spinout-scalemax [SPINDLE_9]OUTPUT_SCALE
  167.  
  168. net spindle-enable => hm2_5i25.0.7i76.0.0.spinena
  169. net spindle-ccw => hm2_5i25.0.7i76.0.0.spindir
  170. net spindle-vel-cmd => hm2_5i25.0.7i76.0.0.spinout
  171. # ---Setup spindle at speed signals---
  172.  
  173. sets spindle-at-speed true
  174.  
  175.  
  176. #******************************
  177. # connect miscellaneous signals
  178. #******************************
  179.  
  180. # ---HALUI signals---
  181.  
  182. net joint-select-a halui.joint.0.select
  183. net x-is-homed halui.joint.0.is-homed
  184. net jog-x-pos halui.jog.0.plus
  185. net jog-x-neg halui.jog.0.minus
  186. net jog-x-analog halui.jog.0.analog
  187. net joint-select-b halui.joint.1.select
  188. net y-is-homed halui.joint.1.is-homed
  189. net jog-y-pos halui.jog.1.plus
  190. net jog-y-neg halui.jog.1.minus
  191. net jog-y-analog halui.jog.1.analog
  192. net joint-select-c halui.joint.2.select
  193. net z-is-homed halui.joint.2.is-homed
  194. net jog-z-pos halui.jog.2.plus
  195. net jog-z-neg halui.jog.2.minus
  196. net jog-z-analog halui.jog.2.analog
  197. net jog-selected-pos halui.jog.selected.plus
  198. net jog-selected-neg halui.jog.selected.minus
  199. net spindle-manual-cw halui.spindle.forward
  200. net spindle-manual-ccw halui.spindle.reverse
  201. net spindle-manual-stop halui.spindle.stop
  202. net machine-is-on halui.machine.is-on
  203. net jog-speed halui.jog-speed
  204. net MDI-mode halui.mode.is-mdi
  205.  
  206. # ---coolant signals---
  207.  
  208. net coolant-mist <= iocontrol.0.coolant-mist
  209. net coolant-flood <= iocontrol.0.coolant-flood
  210.  
  211. # ---probe signal---
  212.  
  213. net probe-in => motion.probe-input
  214.  
  215. # ---motion control signals---
  216.  
  217. net in-position <= motion.in-position
  218. net machine-is-enabled <= motion.motion-enabled
  219.  
  220. # ---digital in / out signals---
  221.  
  222. net dout-00 <= motion.digital-out-00
  223. #net dout-01 <= motion.digital-out-01
  224. #net dout-02 <= motion.digital-out-02
  225. net dout-03 <= motion.digital-out-03
  226. # ---estop signals---
  227.  
  228. net estop-out <= iocontrol.0.user-enable-out
  229. net estop-ext => iocontrol.0.emc-enable-in
  230.  
  231. # ---manual tool change signals---
  232.  
  233. #loadusr -W hal_manualtoolchange
  234. #net tool-change-request iocontrol.0.tool-change => hal_manualtoolchange.change
  235. #net tool-change-confirmed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
  236. #net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
  237. loadusr -W hal_racktoolchange
  238. #net tool-change-request iocontrol.0.tool-change => hal_racktoolchange.change
  239. #net tool-change-confirmed iocontrol.0.tool-changed <= hal_racktoolchange.changed
  240. net tool-number iocontrol.0.tool-prep-number => hal_racktoolchange.toolnumber
  241. net pdb_valve hm2_5i25.0.7i76.0.0.output-01 <= hal_racktoolchange.blow
  242. net spindle_tool_secure hm2_5i25.0.7i76.0.0.input-09 => hal_racktoolchange.tool_secure
  243. net spindle_tool_released hm2_5i25.0.7i76.0.0.input-10 => hal_racktoolchange.tool_released
  244. #
  245. net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
  246. net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement