Advertisement
Guest User

Untitled

a guest
Feb 14th, 2015
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.77 KB | None | 0 0
  1. # Generated by PNCconf at Sat Feb 14 01:30:03 2015
  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=6 num_pwmgens=0 num_3pwmgens=0 num_stepgens=0 sserial_port_0=000xx "
  10. setp hm2_5i25.0.watchdog.timeout_ns 10000000
  11. loadrt pid names=pid.x,pid.y,pid.z,pid.s
  12. loadrt near
  13.  
  14. addf hm2_5i25.0.read servo-thread
  15. addf motion-command-handler servo-thread
  16. addf motion-controller servo-thread
  17. addf pid.x.do-pid-calcs servo-thread
  18. addf pid.y.do-pid-calcs servo-thread
  19. addf pid.z.do-pid-calcs servo-thread
  20. addf pid.s.do-pid-calcs servo-thread
  21. addf near.0 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. # external input signals
  29.  
  30.  
  31. # --- ESTOP-EXT ---
  32. net estop-ext <= hm2_5i25.0.7i77.0.0.input-00
  33.  
  34. # --- MIN-X ---
  35. net min-x <= hm2_5i25.0.7i77.0.0.input-01-not
  36.  
  37. # --- MAX-HOME-X ---
  38. net max-home-x <= hm2_5i25.0.7i77.0.0.input-02
  39.  
  40. # --- MIN-Y ---
  41. net min-y <= hm2_5i25.0.7i77.0.0.input-03-not
  42.  
  43. # --- MAX-HOME-Y ---
  44. net max-home-y <= hm2_5i25.0.7i77.0.0.input-04-not
  45.  
  46. # --- MIN-Z ---
  47. net min-z <= hm2_5i25.0.7i77.0.0.input-05-not
  48.  
  49. # --- MAX-HOME-Z ---
  50. net max-home-z <= hm2_5i25.0.7i77.0.0.input-06-not
  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 max-home-x => axis.0.home-sw-in
  103. net min-x => axis.0.neg-lim-sw-in
  104. net max-home-x => 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 max-home-y => axis.1.home-sw-in
  155. net min-y => axis.1.neg-lim-sw-in
  156. net max-home-y => 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 max-home-z => axis.2.home-sw-in
  207. net min-z => axis.2.neg-lim-sw-in
  208. net max-home-z => axis.2.pos-lim-sw-in
  209.  
  210. #*******************
  211. # SPINDLE S
  212. #*******************
  213.  
  214. # ---Encoder feedback signals/setup---
  215.  
  216. setp hm2_5i25.0.encoder.05.counter-mode 0
  217. setp hm2_5i25.0.encoder.05.filter 1
  218. setp hm2_5i25.0.encoder.05.index-invert 0
  219. setp hm2_5i25.0.encoder.05.index-mask 0
  220. setp hm2_5i25.0.encoder.05.index-mask-invert 0
  221. setp hm2_5i25.0.encoder.05.scale [SPINDLE_9]ENCODER_SCALE
  222.  
  223. net spindle-revs <= hm2_5i25.0.encoder.05.position
  224. net spindle-vel-fb <= hm2_5i25.0.encoder.05.velocity
  225. net spindle-index-enable <=> hm2_5i25.0.encoder.05.index-enable
  226.  
  227. # ---setup spindle control signals---
  228.  
  229. net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps
  230. net spindle-vel-cmd-rps-abs <= motion.spindle-speed-out-rps-abs
  231. net spindle-vel-cmd <= motion.spindle-speed-out
  232. net spindle-vel-cmd-rpm-abs <= motion.spindle-speed-out-abs
  233. net spindle-on <= motion.spindle-on
  234. net spindle-cw <= motion.spindle-forward
  235. net spindle-ccw <= motion.spindle-reverse
  236. net spindle-brake <= motion.spindle-brake
  237. net spindle-revs => motion.spindle-revs
  238. net spindle-at-speed => motion.spindle-at-speed
  239. net spindle-vel-fb => motion.spindle-speed-in
  240. net spindle-index-enable <=> motion.spindle-index-enable
  241.  
  242. # ---Setup spindle at speed signals---
  243.  
  244. net spindle-vel-cmd-rps => near.0.in1
  245. net spindle-vel-fb => near.0.in2
  246. net spindle-at-speed <= near.0.out
  247. setp near.0.scale 1.000000
  248. setp near.0.difference 3.333333
  249.  
  250.  
  251. #******************************
  252. # connect miscellaneous signals
  253. #******************************
  254.  
  255. # ---HALUI signals---
  256.  
  257. net joint-select-a halui.joint.0.select
  258. net x-is-homed halui.joint.0.is-homed
  259. net jog-x-pos halui.jog.0.plus
  260. net jog-x-neg halui.jog.0.minus
  261. net jog-x-analog halui.jog.0.analog
  262. net joint-select-b halui.joint.1.select
  263. net y-is-homed halui.joint.1.is-homed
  264. net jog-y-pos halui.jog.1.plus
  265. net jog-y-neg halui.jog.1.minus
  266. net jog-y-analog halui.jog.1.analog
  267. net joint-select-c halui.joint.2.select
  268. net z-is-homed halui.joint.2.is-homed
  269. net jog-z-pos halui.jog.2.plus
  270. net jog-z-neg halui.jog.2.minus
  271. net jog-z-analog halui.jog.2.analog
  272. net jog-selected-pos halui.jog.selected.plus
  273. net jog-selected-neg halui.jog.selected.minus
  274. net spindle-manual-cw halui.spindle.forward
  275. net spindle-manual-ccw halui.spindle.reverse
  276. net spindle-manual-stop halui.spindle.stop
  277. net machine-is-on halui.machine.is-on
  278. net jog-speed halui.jog-speed
  279. net MDI-mode halui.mode.is-mdi
  280.  
  281. # ---coolant signals---
  282.  
  283. net coolant-mist <= iocontrol.0.coolant-mist
  284. net coolant-flood <= iocontrol.0.coolant-flood
  285.  
  286. # ---probe signal---
  287.  
  288. net probe-in => motion.probe-input
  289.  
  290. # ---motion control signals---
  291.  
  292. net in-position <= motion.in-position
  293. net machine-is-enabled <= motion.motion-enabled
  294.  
  295. # ---digital in / out signals---
  296.  
  297. # ---estop signals---
  298.  
  299. net estop-out <= iocontrol.0.user-enable-out
  300. net estop-ext => iocontrol.0.emc-enable-in
  301.  
  302. # ---manual tool change signals---
  303.  
  304. loadusr -W hal_manualtoolchange
  305. net tool-change-request iocontrol.0.tool-change => hal_manualtoolchange.change
  306. net tool-change-confirmed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
  307. net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
  308. net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement