Advertisement
Guest User

G76-1

a guest
Aug 12th, 2013
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.36 KB | None | 0 0
  1. M6 T6 G43 H6 (Single Pt Thd)
  2. M3 S400
  3. M8
  4. G0 X0.335 Z0.200
  5. G76 P0.0466 Z-0.560 I0.054 J0.006 K0.027 H3 R2 Q29.5 E0.060 L2
  6. GO X0.500 Z1.5
  7.  
  8.  
  9. Hal File
  10. # HAL config file for Pico Systems USC board
  11. #
  12. # Connect motion controller I/Os
  13. #
  14.  
  15. # connect limit/home switch outputs to motion controller
  16. newsig Xminlim bit
  17. newsig Xmaxlim bit
  18. newsig Xhome bit
  19. linksp Xminlim <= ppmc.0.din.01.in-not
  20. linksp Xminlim => axis.0.neg-lim-sw-in
  21. linksp Xmaxlim <= ppmc.0.din.02.in-not
  22. linksp Xmaxlim => axis.0.pos-lim-sw-in
  23. linksp Xhome <= ppmc.0.din.00.in
  24. linksp Xhome => axis.0.home-sw-in
  25.  
  26. #newsig Yminlim bit
  27. #newsig Ymaxlim bit
  28. #newsig Yhome bit
  29. #linksp Yminlim <= ppmc.0.din.05.in
  30. #linksp Yminlim => axis.1.neg-lim-sw-in
  31. #linksp Ymaxlim <= ppmc.0.din.06.in
  32. #linksp Ymaxlim => axis.1.pos-lim-sw-in
  33. #linksp Yhome <= ppmc.0.din.04.in
  34. #linksp Yhome => axis.1.home-sw-in
  35.  
  36. newsig Zminlim bit
  37. newsig Zmaxlim bit
  38. newsig Zhome bit
  39. linksp Zminlim <= ppmc.0.din.04.in-not
  40. #linksp Zminlim <= ppmc.0.din.09.in
  41. linksp Zminlim => axis.2.neg-lim-sw-in
  42. linksp Zmaxlim <= ppmc.0.din.05.in-not
  43. #linksp Zmaxlim <= ppmc.0.din.10.in
  44. linksp Zmaxlim => axis.2.pos-lim-sw-in
  45. linksp Zhome <= ppmc.0.din.03.in
  46. #linksp Zhome <= ppmc.0.din.08.in
  47. linksp Zhome => axis.2.home-sw-in
  48.  
  49. #newsig Aminlim bit
  50. #newsig Amaxlim bit
  51. #newsig Ahome bit
  52. #linksp Aminlim <= ppmc.0.din.12.in
  53. #linksp Aminlim => axis.3.neg-lim-sw-in
  54. #linksp Amaxlim <= ppmc.0.din.13.in
  55. #linksp Amaxlim => axis.3.pos-lim-sw-in
  56. #linksp Ahome <= ppmc.0.din.11.in
  57. #linksp Ahome => axis.3.home-sw-in
  58.  
  59.  
  60. # connect index pulses to motion controller
  61. # uncomment these lines only if you have a Rev 3 UPC board
  62. # The ppmc.x.encoder.xx.index-enable pin is ONLY exported by the driver
  63. # if the UPC has rev 3 or above firmware
  64. newsig Xindex bit
  65. #newsig Yindex bit
  66. newsig Zindex bit
  67. linksp Xindex <= ppmc.0.encoder.00.index-enable
  68. linksp Xindex => axis.0.index-enable
  69. #linksp Yindex <= ppmc.0.encoder.01.index-enable
  70. #linksp Yindex => axis.1.index-enable
  71. linksp Zindex <= ppmc.0.encoder.02.index-enable
  72. linksp Zindex => axis.2.index-enable
  73.  
  74. #
  75. # Connect I/O controller I/Os
  76. #
  77.  
  78. # connect e-stop write/sense to I/O controller
  79. # and univpwm's fault with estop's output, so estop FF is reset, but
  80. # prevent continued estop signal from univpwm from holding FF cleared
  81. newsig ppmcEstop bit
  82. linksp ppmcEstop ppmc.0.din.15.in-not
  83. linksp ppmcEstop and2.0.in0
  84. newsig EstopOkIn bit
  85. linksp EstopOkIn estop-latch.0.fault-in
  86. linksp EstopOkIn and2.0.out
  87. newsig EstopOkOut bit
  88. linksp EstopOkOut <= ppmc.0.dout.07.out
  89. linksp EstopOkOut iocontrol.0.emc-enable-in
  90. linksp EstopOkOut estop-latch.0.ok-out
  91. linksp EstopOkOut and2.0.in1
  92. newsig emc-estop-out bit
  93. linksp emc-estop-out iocontrol.0.user-enable-out
  94. linksp emc-estop-out estop-latch.0.ok-in
  95. newsig emc-estop-reset bit
  96. linksp emc-estop-reset iocontrol.0.user-request-enable
  97. linksp emc-estop-reset estop-latch.0.reset
  98.  
  99. ### TURRET ###
  100. # create signals for tool loading loopback
  101. net ToolPrep iocontrol.0.tool-prepare iocontrol.0.tool-prepared
  102. net ToolChange iocontrol.0.tool-change turret.0.position-change
  103. net ToolChanged turret.0.position-changed iocontrol.0.tool-changed
  104.  
  105. # decode turret encoder inputs
  106. newsig ones bit
  107. newsig twos bit
  108. newsig fours bit
  109. newsig eights bit
  110.  
  111. linksp ones ppmc.0.din.06.in
  112.  
  113. linksp ones wsum.0.bit.0.in
  114. linksp twos ppmc.0.din.07.in
  115. linksp twos wsum.0.bit.1.in
  116. linksp fours ppmc.0.din.08.in
  117. linksp fours wsum.0.bit.2.in
  118. linksp eights ppmc.0.din.09.in
  119. linksp eights wsum.0.bit.3.in
  120. # wsum.N.hold bit in
  121.  
  122. newsig TurretCurrentPosition s32
  123. linksp TurretCurrentPosition wsum.0.sum
  124. linksp TurretCurrentPosition turret.0.position-current
  125.  
  126. newsig TurretRequestedPosition s32
  127. linksp TurretRequestedPosition iocontrol.0.tool-prep-number
  128. linksp TurretRequestedPosition turret.0.position-requested
  129.  
  130. setp turret.0.settle-stop [TURRET]STOP_SETTLE
  131. setp turret.0.settle-park [TURRET]PARK_SETTLE
  132.  
  133. # connect turret to parallel port
  134. newsig TurretSeek bit
  135. linksp TurretSeek turret.0.seek
  136. linksp TurretSeek ppmc.0.dout.05.out
  137.  
  138. newsig TurretStop bit
  139. linksp TurretStop turret.0.stop
  140. linksp TurretStop ppmc.0.dout.06.out
  141.  
  142. #addf turret.0 servo-thread
  143.  
  144. #Turret Info End
  145.  
  146.  
  147.  
  148.  
  149.  
  150. # connect spindle fwd/rev to I/O controller
  151. newsig SpindleFwd bit
  152. newsig SpindleRev bit
  153. linksp SpindleFwd <= ppmc.0.dout.00.out
  154. linksp SpindleFwd => motion.spindle-forward
  155. linksp SpindleRev <= ppmc.0.dout.01.out
  156. linksp SpindleRev => motion.spindle-reverse
  157.  
  158. # connect spindle brake to I/O controller
  159. newsig SpindleBrakeOn bit
  160. linksp SpindleBrakeOn <= ppmc.0.dout.02.out
  161. linksp SpindleBrakeOn => motion.spindle-brake
  162.  
  163. # connect mist/flood coolant to I/O controller
  164. newsig MistOn bit
  165. newsig FloodOn bit
  166. linksp MistOn <= ppmc.0.dout.03.out
  167. linksp MistOn => iocontrol.0.coolant-mist
  168. linksp FloodOn <= parport.0.pin-02-out
  169. setp parport.0.pin-02-out-invert 1
  170. linksp FloodOn => iocontrol.0.coolant-flood
  171. # Line 159 ppmc.0.dout.04.out
  172. #parport.0.pin-02-out
  173.  
  174. setp parport.0.pin-05-out-invert 1
  175. setp parport.0.pin-06-out-invert 1
  176.  
  177. #Connect Verticle Slide switch
  178. #setp parport.0.pin-10-in
  179. net slide-input motion.digital-in-00 <= parport.0.pin-10-in
  180.  
  181.  
  182. # pull the CR-1 relay in when the Power Button is on JT
  183. net machine-power <= motion.motion-enabled =>
  184. # CR-1 Control Power
  185. net machine-power => parport.0.pin-01-out
  186. setp parport.0.pin-01-out-invert 1
  187.  
  188. net brake-off => parport.0.pin-07-out
  189. #setp parport.0.pin-07-out-invert 1
  190.  
  191.  
  192.  
  193. #File from email
  194. #set scale for 5000 RPM MAX and connect spindle speed to USC DAC
  195. setp ppmc.0.DAC8.00.scale 410.0
  196. net spinspeed motion.spindle-speed-out ppmc.0.DAC8.00.value
  197.  
  198. #new info
  199. net spinraw ppmc.0.encoder.03.delta conv-s32-float.0.in
  200. net spinfloat conv-s32-float.0.out mult2.0.in0
  201. setp mult2.0.in1 0.273066667
  202. net SpindleRPM mult2.0.out motion.spindle-speed-in
  203.  
  204.  
  205. # 4.096 0.06826667 0.273066667
  206.  
  207. #File from spin
  208. #set scale for 5000 RPM MAX and connect spindle speed to USC DAC
  209. #setp ppmc.0.DAC8.00.scale 500.0
  210. #newsig spinspeed float
  211. #linksp spinspeed <= motion.spindle-speed-out
  212. #linksp spinspeed => ppmc.0.DAC8.00.value
  213.  
  214. #File from 2.3.5
  215. #setp ppmc.0.DAC8.00.scale 390.0
  216. #net spinspeed motiom.spindle-speed-out ppmc.0.DAC8.00.value
  217. #newsig spinspeed float
  218. #linksp spinspeed <= motion.spindle-speed-out
  219. #linksp spinspeed => ppmc.0.DAC8.00.value
  220.  
  221.  
  222.  
  223. loadrt classicladder_rt
  224. addf classicladder.0.refresh servo-thread
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement