Advertisement
georgenz

Untitled

Feb 26th, 2015
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.24 KB | None | 0 0
  1.  
  2. # Generated by PNCconf at Thu Feb 26 20:18:06 2015
  3. # If you make changes to this file, they will be
  4. # overwritten when you run PNCconf again
  5.  
  6. loadrt trivkins
  7. loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
  8. loadrt probe_parport
  9. loadrt hostmot2
  10. loadrt hm2_pci config=" num_encoders=6 num_pwmgens=0 num_3pwmgens=0 num_stepgens=0 sserial_port_0=000xx "
  11. setp hm2_5i25.0.watchdog.timeout_ns 10000000
  12. loadrt pid names=pid.x,pid.y,pid.z
  13. loadrt mux16 names=jogincr
  14.  
  15. addf hm2_5i25.0.read servo-thread
  16. addf motion-command-handler servo-thread
  17. addf motion-controller servo-thread
  18. addf pid.x.do-pid-calcs servo-thread
  19. addf pid.y.do-pid-calcs servo-thread
  20. addf pid.z.do-pid-calcs servo-thread
  21. addf jogincr servo-thread
  22. addf hm2_5i25.0.write servo-thread
  23. addf hm2_5i25.0.pet_watchdog servo-thread
  24.  
  25. # external output signals
  26.  
  27.  
  28. # --- COOLANT-FLOOD ---
  29. net coolant-flood hm2_5i25.0.7i77.0.0.output-00
  30.  
  31. # --- SPINDLE-CW ---
  32. net spindle-cw hm2_5i25.0.7i77.0.0.output-01
  33.  
  34. # --- SPINDLE-CCW ---
  35. net spindle-ccw hm2_5i25.0.7i77.0.0.output-02
  36.  
  37. # external input signals
  38.  
  39.  
  40. # --- ESTOP-EXT ---
  41. net estop-ext <= hm2_5i25.0.7i77.0.0.input-00
  42.  
  43. # --- HOME-X ---
  44. net home-x <= hm2_5i25.0.7i77.0.0.input-01
  45.  
  46. # --- HOME-Y ---
  47. net home-y <= hm2_5i25.0.7i77.0.0.input-02
  48.  
  49. # --- HOME-Z ---
  50. net home-z <= hm2_5i25.0.7i77.0.0.input-03
  51.  
  52. #*******************
  53. # AXIS X
  54. #*******************
  55.  
  56. setp pid.x.Pgain [AXIS_0]P
  57. setp pid.x.Igain [AXIS_0]I
  58. setp pid.x.Dgain [AXIS_0]D
  59. setp pid.x.bias [AXIS_0]BIAS
  60. setp pid.x.FF0 [AXIS_0]FF0
  61. setp pid.x.FF1 [AXIS_0]FF1
  62. setp pid.x.FF2 [AXIS_0]FF2
  63. setp pid.x.deadband [AXIS_0]DEADBAND
  64. setp pid.x.maxoutput [AXIS_0]MAX_OUTPUT
  65.  
  66. net x-index-enable <=> pid.x.index-enable
  67. net x-enable => pid.x.enable
  68. net x-output => pid.x.output
  69. net x-pos-cmd => pid.x.command
  70. net x-vel-fb => pid.x.feedback-deriv
  71. net x-pos-fb => pid.x.feedback
  72.  
  73. # ---PWM Generator signals/setup---
  74.  
  75. setp hm2_5i25.0.7i77.0.1.analogout0-scalemax [AXIS_0]OUTPUT_SCALE
  76. setp hm2_5i25.0.7i77.0.1.analogout0-minlim [AXIS_0]OUTPUT_MIN_LIMIT
  77. setp hm2_5i25.0.7i77.0.1.analogout0-maxlim [AXIS_0]OUTPUT_MAX_LIMIT
  78.  
  79. net x-output => hm2_5i25.0.7i77.0.1.analogout0
  80. net x-pos-cmd axis.0.motor-pos-cmd
  81. net x-enable axis.0.amp-enable-out
  82. # enable _all_ sserial pwmgens
  83. net x-enable hm2_5i25.0.7i77.0.1.analogena
  84.  
  85. # ---Encoder feedback signals/setup---
  86.  
  87. setp hm2_5i25.0.encoder.00.counter-mode 0
  88. setp hm2_5i25.0.encoder.00.filter 1
  89. setp hm2_5i25.0.encoder.00.index-invert 0
  90. setp hm2_5i25.0.encoder.00.index-mask 0
  91. setp hm2_5i25.0.encoder.00.index-mask-invert 0
  92. setp hm2_5i25.0.encoder.00.scale [AXIS_0]ENCODER_SCALE
  93.  
  94. net x-pos-fb <= hm2_5i25.0.encoder.00.position
  95. net x-vel-fb <= hm2_5i25.0.encoder.00.velocity
  96. net x-pos-fb => axis.0.motor-pos-fb
  97. net x-index-enable axis.0.index-enable <=> hm2_5i25.0.encoder.00.index-enable
  98. net x-pos-rawcounts <= hm2_5i25.0.encoder.00.rawcounts
  99.  
  100. # ---setup home / limit switch signals---
  101.  
  102. net home-x => axis.0.home-sw-in
  103. net x-neg-limit => axis.0.neg-lim-sw-in
  104. net x-pos-limit => axis.0.pos-lim-sw-in
  105.  
  106. #*******************
  107. # AXIS Y
  108. #*******************
  109.  
  110. setp pid.y.Pgain [AXIS_1]P
  111. setp pid.y.Igain [AXIS_1]I
  112. setp pid.y.Dgain [AXIS_1]D
  113. setp pid.y.bias [AXIS_1]BIAS
  114. setp pid.y.FF0 [AXIS_1]FF0
  115. setp pid.y.FF1 [AXIS_1]FF1
  116. setp pid.y.FF2 [AXIS_1]FF2
  117. setp pid.y.deadband [AXIS_1]DEADBAND
  118. setp pid.y.maxoutput [AXIS_1]MAX_OUTPUT
  119.  
  120. net y-index-enable <=> pid.y.index-enable
  121. net y-enable => pid.y.enable
  122. net y-output => pid.y.output
  123. net y-pos-cmd => pid.y.command
  124. net y-vel-fb => pid.y.feedback-deriv
  125. net y-pos-fb => pid.y.feedback
  126.  
  127. # ---PWM Generator signals/setup---
  128.  
  129. setp hm2_5i25.0.7i77.0.1.analogout1-scalemax [AXIS_1]OUTPUT_SCALE
  130. setp hm2_5i25.0.7i77.0.1.analogout1-minlim [AXIS_1]OUTPUT_MIN_LIMIT
  131. setp hm2_5i25.0.7i77.0.1.analogout1-maxlim [AXIS_1]OUTPUT_MAX_LIMIT
  132.  
  133. net y-output => hm2_5i25.0.7i77.0.1.analogout1
  134. net y-pos-cmd axis.1.motor-pos-cmd
  135. net y-enable axis.1.amp-enable-out
  136.  
  137. # ---Encoder feedback signals/setup---
  138.  
  139. setp hm2_5i25.0.encoder.01.counter-mode 0
  140. setp hm2_5i25.0.encoder.01.filter 1
  141. setp hm2_5i25.0.encoder.01.index-invert 0
  142. setp hm2_5i25.0.encoder.01.index-mask 0
  143. setp hm2_5i25.0.encoder.01.index-mask-invert 0
  144. setp hm2_5i25.0.encoder.01.scale [AXIS_1]ENCODER_SCALE
  145.  
  146. net y-pos-fb <= hm2_5i25.0.encoder.01.position
  147. net y-vel-fb <= hm2_5i25.0.encoder.01.velocity
  148. net y-pos-fb => axis.1.motor-pos-fb
  149. net y-index-enable axis.1.index-enable <=> hm2_5i25.0.encoder.01.index-enable
  150. net y-pos-rawcounts <= hm2_5i25.0.encoder.01.rawcounts
  151.  
  152. # ---setup home / limit switch signals---
  153.  
  154. net home-y => axis.1.home-sw-in
  155. net y-neg-limit => axis.1.neg-lim-sw-in
  156. net y-pos-limit => axis.1.pos-lim-sw-in
  157.  
  158. #*******************
  159. # AXIS Z
  160. #*******************
  161.  
  162. setp pid.z.Pgain [AXIS_2]P
  163. setp pid.z.Igain [AXIS_2]I
  164. setp pid.z.Dgain [AXIS_2]D
  165. setp pid.z.bias [AXIS_2]BIAS
  166. setp pid.z.FF0 [AXIS_2]FF0
  167. setp pid.z.FF1 [AXIS_2]FF1
  168. setp pid.z.FF2 [AXIS_2]FF2
  169. setp pid.z.deadband [AXIS_2]DEADBAND
  170. setp pid.z.maxoutput [AXIS_2]MAX_OUTPUT
  171.  
  172. net z-index-enable <=> pid.z.index-enable
  173. net z-enable => pid.z.enable
  174. net z-output => pid.z.output
  175. net z-pos-cmd => pid.z.command
  176. net z-vel-fb => pid.z.feedback-deriv
  177. net z-pos-fb => pid.z.feedback
  178.  
  179. # ---PWM Generator signals/setup---
  180.  
  181. setp hm2_5i25.0.7i77.0.1.analogout2-scalemax [AXIS_2]OUTPUT_SCALE
  182. setp hm2_5i25.0.7i77.0.1.analogout2-minlim [AXIS_2]OUTPUT_MIN_LIMIT
  183. setp hm2_5i25.0.7i77.0.1.analogout2-maxlim [AXIS_2]OUTPUT_MAX_LIMIT
  184.  
  185. net z-output => hm2_5i25.0.7i77.0.1.analogout2
  186. net z-pos-cmd axis.2.motor-pos-cmd
  187. net z-enable axis.2.amp-enable-out
  188.  
  189. # ---Encoder feedback signals/setup---
  190.  
  191. setp hm2_5i25.0.encoder.02.counter-mode 0
  192. setp hm2_5i25.0.encoder.02.filter 1
  193. setp hm2_5i25.0.encoder.02.index-invert 0
  194. setp hm2_5i25.0.encoder.02.index-mask 0
  195. setp hm2_5i25.0.encoder.02.index-mask-invert 0
  196. setp hm2_5i25.0.encoder.02.scale [AXIS_2]ENCODER_SCALE
  197.  
  198. net z-pos-fb <= hm2_5i25.0.encoder.02.position
  199. net z-vel-fb <= hm2_5i25.0.encoder.02.velocity
  200. net z-pos-fb => axis.2.motor-pos-fb
  201. net z-index-enable axis.2.index-enable <=> hm2_5i25.0.encoder.02.index-enable
  202. net z-pos-rawcounts <= hm2_5i25.0.encoder.02.rawcounts
  203.  
  204. # ---setup home / limit switch signals---
  205.  
  206. net home-z => axis.2.home-sw-in
  207. net z-neg-limit => axis.2.neg-lim-sw-in
  208. net z-pos-limit => axis.2.pos-lim-sw-in
  209.  
  210. #*******************
  211. # SPINDLE S
  212. #*******************
  213.  
  214. # ---PWM Generator signals/setup---
  215.  
  216. setp hm2_5i25.0.7i77.0.1.analogout5-scalemax [SPINDLE_9]OUTPUT_SCALE
  217. setp hm2_5i25.0.7i77.0.1.analogout5-minlim [SPINDLE_9]OUTPUT_MIN_LIMIT
  218. setp hm2_5i25.0.7i77.0.1.analogout5-maxlim [SPINDLE_9]OUTPUT_MAX_LIMIT
  219.  
  220.  
  221. net spindle-vel-cmd-abs => hm2_5i25.0.7i77.0.1.analogout5
  222. net machine-is-enabled => hm2_5i25.0.7i77.0.1.spinena
  223. net machine-is-enabled => hm2_5i25.0.7i77.0.1.spinena
  224.  
  225. # ---setup spindle control signals---
  226.  
  227. net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps
  228. net spindle-vel-cmd-rps-abs <= motion.spindle-speed-out-rps-abs
  229. net spindle-vel-cmd <= motion.spindle-speed-out
  230. net spindle-vel-cmd-rpm-abs <= motion.spindle-speed-out-abs
  231. net spindle-on <= motion.spindle-on
  232. net spindle-cw <= motion.spindle-forward
  233. net spindle-ccw <= motion.spindle-reverse
  234. net spindle-brake <= motion.spindle-brake
  235. net spindle-revs => motion.spindle-revs
  236. net spindle-at-speed => motion.spindle-at-speed
  237. net spindle-vel-fb => motion.spindle-speed-in
  238. net spindle-index-enable <=> motion.spindle-index-enable
  239.  
  240. # ---Setup spindle at speed signals---
  241.  
  242. sets spindle-at-speed true
  243.  
  244.  
  245. #******************************
  246. # connect miscellaneous signals
  247. #******************************
  248.  
  249. # ---HALUI signals---
  250.  
  251. net joint-select-a halui.joint.0.select
  252. net x-is-homed halui.joint.0.is-homed
  253. net jog-x-pos halui.jog.0.plus
  254. net jog-x-neg halui.jog.0.minus
  255. net jog-x-analog halui.jog.0.analog
  256. net joint-select-b halui.joint.1.select
  257. net y-is-homed halui.joint.1.is-homed
  258. net jog-y-pos halui.jog.1.plus
  259. net jog-y-neg halui.jog.1.minus
  260. net jog-y-analog halui.jog.1.analog
  261. net joint-select-c halui.joint.2.select
  262. net z-is-homed halui.joint.2.is-homed
  263. net jog-z-pos halui.jog.2.plus
  264. net jog-z-neg halui.jog.2.minus
  265. net jog-z-analog halui.jog.2.analog
  266. net jog-selected-pos halui.jog.selected.plus
  267. net jog-selected-neg halui.jog.selected.minus
  268. net spindle-manual-cw halui.spindle.forward
  269. net spindle-manual-ccw halui.spindle.reverse
  270. net spindle-manual-stop halui.spindle.stop
  271. net machine-is-on halui.machine.is-on
  272. net jog-speed halui.jog-speed
  273. net MDI-mode halui.mode.is-mdi
  274.  
  275. # ---coolant signals---
  276.  
  277. net coolant-mist <= iocontrol.0.coolant-mist
  278. net coolant-flood <= iocontrol.0.coolant-flood
  279.  
  280. # ---probe signal---
  281.  
  282. net probe-in => motion.probe-input
  283.  
  284. # ---jogwheel signals to mesa encoder - shared MPG---
  285.  
  286. net joint-selected-count <= hm2_5i25.0.encoder.04.count
  287.  
  288. # ---mpg signals---
  289.  
  290. # for axis x MPG
  291. setp axis.0.jog-vel-mode 0
  292. net selected-jog-incr => axis.0.jog-scale
  293. net joint-select-a => axis.0.jog-enable
  294. net joint-selected-count => axis.0.jog-counts
  295.  
  296. # for axis y MPG
  297. setp axis.1.jog-vel-mode 0
  298. net selected-jog-incr => axis.1.jog-scale
  299. net joint-select-b => axis.1.jog-enable
  300. net joint-selected-count => axis.1.jog-counts
  301.  
  302. # for axis z MPG
  303. setp axis.2.jog-vel-mode 0
  304. net selected-jog-incr => axis.2.jog-scale
  305. net joint-select-c => axis.2.jog-enable
  306. net joint-selected-count => axis.2.jog-counts
  307.  
  308.  
  309. sets selected-jog-incr 0.000000
  310.  
  311. # ---motion control signals---
  312.  
  313. net in-position <= motion.in-position
  314. net machine-is-enabled <= motion.motion-enabled
  315.  
  316. # ---digital in / out signals---
  317.  
  318. # ---estop signals---
  319.  
  320. net estop-out <= iocontrol.0.user-enable-out
  321. net estop-ext => iocontrol.0.emc-enable-in
  322.  
  323. # ---manual tool change signals---
  324.  
  325. loadusr -W hal_manualtoolchange
  326. net tool-change-request iocontrol.0.tool-change => hal_manualtoolchange.change
  327. net tool-change-confirmed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
  328. net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
  329. net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement