Advertisement
Guest User

Untitled

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