Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2012
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.01 KB | None | 0 0
  1. # BP Series 1
  2. loadrt trivkins
  3. loadrt motmod base_period_nsec=100000 servo_period_nsec=1000000 num_joints=[TRAJ]AXES
  4.  
  5. # hostmot2 drivers
  6. loadrt hostmot2
  7. loadrt hm2_pci config="num_encoders=6 sserial_port_0=002xxx"
  8.  
  9. # pid
  10. loadrt pid num_chan=3
  11.  
  12. setp hm2_5i25.0.watchdog.timeout_ns 10000000
  13.  
  14. # Threads
  15. addf hm2_5i25.0.read servo-thread
  16. addf motion-command-handler servo-thread
  17. addf motion-controller servo-thread
  18. addf pid.0.do-pid-calcs servo-thread
  19. addf pid.1.do-pid-calcs servo-thread
  20. addf pid.2.do-pid-calcs servo-thread
  21. addf hm2_5i25.0.write servo-thread
  22. addf hm2_5i25.0.pet_watchdog servo-thread
  23.  
  24. # MPG
  25. loadrt mux4 names=mpg-scale
  26. addf mpg-scale servo-thread
  27. loadrt or2 count=2
  28. addf or2.0 servo-thread
  29. addf or2.1 servo-thread
  30.  
  31. net jog-position <= hm2_5i25.0.encoder.05.count
  32. net jog-position => axis.0.jog-counts
  33. net jog-position => axis.1.jog-counts
  34. net jog-position => axis.2.jog-counts
  35.  
  36. setp mpg-scale.in0 0.0
  37. setp mpg-scale.in1 0.00025
  38. setp mpg-scale.in2 0.0025
  39. setp mpg-scale.in3 0.025
  40.  
  41. net scale1 or2.0.in0 <= hm2_5i25.0.7i77.0.0.input-03
  42. net scale2 or2.1.in0 <= hm2_5i25.0.7i77.0.0.input-04
  43. net scale3 or2.0.in1 or2.1.in1 <= hm2_5i25.0.7i77.0.0.input-05
  44.  
  45. net pos2 mpg-scale.sel0 <= or2.0.out
  46. net pos3 mpg-scale.sel1 <= or2.1.out
  47.  
  48. net axis-mpg-jog-scale axis.0.jog-scale <= mpg-scale.out
  49. net axis-mpg-jog-scale axis.1.jog-scale <= mpg-scale.out
  50. net axis-mpg-jog-scale axis.2.jog-scale <= mpg-scale.out
  51.  
  52. # Servo Drive
  53. net power-on hm2_5i25.0.7i77.0.0.output-00 <= motion.motion-enabled
  54. net power-on hm2_5i25.0.7i77.0.0.output-01
  55.  
  56. # X Axis
  57. setp hm2_5i25.0.encoder.00.scale -30000
  58. setp pid.0.Pgain [AXIS_0]P_GAIN
  59. setp pid.0.Igain [AXIS_0]I_GAIN
  60. setp pid.0.Dgain [AXIS_0]D_GAIN
  61. setp pid.0.FF0 [AXIS_0]FF0
  62. setp pid.0.FF1 [AXIS_0]FF1
  63. setp pid.0.FF2 [AXIS_0]FF2
  64.  
  65. net x-axis-enable pid.0.enable <= axis.0.amp-enable-out
  66. net x-axis-enable hm2_5i25.0.7i77.0.1.analogena
  67. net x-axis-fb pid.0.feedback <= hm2_5i25.0.encoder.00.position
  68. net x-axis-fb axis.0.motor-pos-fb
  69. net x-axis-pos-cmd axis.0.motor-pos-cmd => pid.0.command
  70. net x-axis-command pid.0.output => hm2_5i25.0.7i77.0.1.analogout0
  71.  
  72. net x-jog-select axis.0.jog-enable <= hm2_5i25.0.7i77.0.0.input-00
  73.  
  74. net x-limits <= hm2_5i25.0.7i77.0.0.input-09-not
  75. net x-limits => axis.0.pos-lim-sw-in axis.0.neg-lim-sw-in
  76. net x-limits => axis.0.home-sw-in
  77.  
  78. # Y Axis
  79. setp hm2_5i25.0.encoder.01.scale -30000
  80. setp pid.1.Pgain [AXIS_1]P_GAIN
  81. setp pid.1.Igain [AXIS_1]I_GAIN
  82. setp pid.1.Dgain [AXIS_1]D_GAIN
  83. setp pid.1.FF0 [AXIS_1]FF0
  84. setp pid.1.FF1 [AXIS_1]FF1
  85. setp pid.1.FF2 [AXIS_1]FF2
  86.  
  87. net y-axis-enable pid.1.enable <= axis.1.amp-enable-out
  88. net y-axis-fb axis.1.motor-pos-fb <= hm2_5i25.0.encoder.01.position
  89. net y-axis-fb pid.1.feedback <= hm2_5i25.0.encoder.01.position
  90. net y-axis-fb axis.1.motor-pos-fb
  91. net y-axis-pos-cmd axis.1.motor-pos-cmd => pid.1.command
  92. net y-axis-command pid.1.output => hm2_5i25.0.7i77.0.1.analogout1
  93.  
  94. net y-limits <= hm2_5i25.0.7i77.0.0.input-10-not
  95. net y-limits => axis.1.pos-lim-sw-in axis.1.neg-lim-sw-in
  96. net y-limits => axis.1.home-sw-in
  97.  
  98. # Z Axis
  99. setp hm2_5i25.0.encoder.02.scale -32000
  100. setp pid.2.Pgain [AXIS_2]P_GAIN
  101. setp pid.2.Igain [AXIS_2]I_GAIN
  102. setp pid.2.Dgain [AXIS_2]D_GAIN
  103. setp pid.2.FF0 [AXIS_2]FF0
  104. setp pid.2.FF1 [AXIS_2]FF1
  105. setp pid.2.FF2 [AXIS_2]FF2
  106.  
  107. net z-axis-enable pid.2.enable <= axis.2.amp-enable-out
  108. net z-axis-fb axis.2.motor-pos-fb <= hm2_5i25.0.encoder.02.position
  109. net z-axis-fb pid.2.feedback <= hm2_5i25.0.encoder.02.position
  110. net z-axis-fb axis.2.motor-pos-fb
  111. net z-axis-pos-cmd axis.2.motor-pos-cmd => pid.2.command
  112. net z-axis-command pid.2.output => hm2_5i25.0.7i77.0.1.analogout2
  113.  
  114. net z-limits <= hm2_5i25.0.7i77.0.0.input-11-not
  115. net z-limits => axis.2.pos-lim-sw-in axis.2.neg-lim-sw-in
  116. net z-limits => axis.2.home-sw-in
  117.  
  118. # estop chain
  119. net estop-out <= iocontrol.0.user-enable-out
  120. net estop-out => iocontrol.0.emc-enable-in
  121.  
  122. # Spindle Drive
  123. loadusr -Wn spindle-vfd gs2_vfd -s 2 -p none -n spindle-vfd -v
  124. # connect the spindle direction pin to the GS2
  125. net gs2-fwd spindle-vfd.spindle-fwd <= motion.spindle-forward
  126. # connect the spindle on pin to the GS2
  127. net gs2-run spindle-vfd.spindle-on <= motion.spindle-on
  128. # connect the GS2 at speed to the motion at speed
  129. net gs2-at-speed motion.spindle-at-speed <= spindle-vfd.at-speed
  130. # connect the spindle RPM to the GS2
  131. net gs2-RPM spindle-vfd.speed-command <= motion.spindle-speed-out
  132. #vfd panel fan
  133. net gs2-run => hm2_5i25.0.7i77.0.0.output-03
  134.  
  135. # Lube Pump
  136. loadrt comp
  137. addf comp.0 servo-thread
  138. setp comp.0.in0 0.0001
  139. net motion-test comp.0.in1 <= motion.current-vel
  140. net in-motion hm2_5i25.0.7i77.0.0.output-02 <= comp.0.out
  141. net in-motion hm2_5i25.0.7i77.0.0.output-04
  142.  
  143. # manual tool change
  144. loadusr -W hal_manualtoolchange
  145. net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
  146. net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
  147. net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
  148. net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement