Guest User

Tool_put_move.ngc

a guest
Nov 19th, 2026
24
0
27 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 KB | None | 0 0
  1. ; parameter: last_slot
  2. o<tool_put_move> sub
  3.  
  4.  
  5.  
  6. M66 P05 L3 Q1 (check if carousel is out and does not interfere with spindle)
  7. o1001 if [#5399 NE 1]
  8. (MSG, Carousel is not out, will try to do that)
  9. M64 P06 (move carousel out)
  10. G04 P0.2
  11. M65 P06
  12. M66 P05 L3 Q4 (check if carousel is out and does not interfere with spindle)
  13. o10011 if [#5399 EQ -1]
  14. (MSG, Carousel is not out, cycle paused)
  15. M0
  16. o10011 endif
  17. o1001 else
  18. G04 P0.1
  19. o1001 endif
  20.  
  21. ;o100 if [#2 EQ 1] (current tool remains in spindle)
  22. ; G04 P0.5 (stop for 0.5 seconds and then skip to end of this file)
  23.  
  24. ;o100 elseif [#1 EQ 0]
  25. ; G04 P0.5
  26.  
  27.  
  28. ;o100 elseif [#1 GE 1 AND #1 LE 7]
  29. o100 if [#1 GE 1 AND #1 LE 7]
  30.  
  31. M64 P00 (raise spindle up midway)
  32. M64 P04
  33. G04 P0.2
  34. M65 P00
  35. M65 P04
  36.  
  37. M66 P00 L3 Q1 (check if spindle is up in middle position)
  38. o1002 if [#5399 EQ -1]
  39. (MSG, Spindle is not lifted up, will try to do that)
  40. M64 P00
  41. M64 P04 (raise spindle up in middle position)
  42. G04 P0.2
  43. M65 P00
  44. M65 P04
  45. M66 P00 L3 Q4 (check if spindle is up in middle position)
  46. o10021 if [#5399 EQ -1]
  47. (MSG, Spindle is not lifted up, cycle paused)
  48. M0
  49. o10021 endif
  50. o1002 else
  51. G04 P0.1
  52. o1002 endif
  53.  
  54.  
  55.  
  56. ;o110 if [#1 EQ 1]
  57. ; G53 G0 C205.7 (move carousel slot under tool presence sensor)
  58. ;o110 elseif [#1 EQ 2]
  59. ; G53 G0 C154.1
  60. ;o110 elseif [#1 EQ 3]
  61. ; G53 G0 C102.7
  62. ;o110 elseif [#1 EQ 4]
  63. ; G53 G0 C51.5
  64. ;o110 elseif [#1 EQ 5]
  65. ; G53 G0 C-0.7
  66. ;o110 elseif [#1 EQ 6]
  67. ; G53 G0 C308.3
  68. ;o110 elseif [#1 EQ 7]
  69. ; G53 G0 C256.9
  70. ;o110 endif
  71.  
  72. ; M66 P06 L3 Q1 (check if carousel slot is empty)
  73.  
  74. ;o111 if [#5399 NE 0]
  75. ; (DEBUG, Tool slot is not empty, cycle paused)
  76. ; M0
  77. ;o111 else
  78. ; G04 P0.2
  79. ;o111 endif
  80.  
  81. o120 if [#1 EQ 1]
  82. G53 G0 C264.810 (move carousel slot to match the spindle)
  83. o120 elseif [#1 EQ 2]
  84. G53 G0 C213.394
  85. o120 elseif [#1 EQ 3]
  86. G53 G0 C162.407
  87. o120 elseif [#1 EQ 4]
  88. G53 G0 C110.910
  89. o120 elseif [#1 EQ 5]
  90. G53 G0 C59.390
  91. o120 elseif [#1 EQ 6]
  92. G53 G0 C7.852
  93. o120 elseif [#1 EQ 7]
  94. G53 G0 C316.352
  95. o120 endif
  96.  
  97.  
  98. M64 P07 (raise chip guard)
  99. G04 P0.2
  100. M65 P07
  101. M66 P03 L3 Q2 (check if chip guard is raised)
  102. o121 if [#5399 EQ -1]
  103. (DEBUG, Chip guard is not raised, cycle paused)
  104. M0
  105. o121 else
  106. G04 P0.2
  107. o121 endif
  108.  
  109. M64 P05 (move carousel in)
  110. G04 P0.2
  111. M65 P05
  112. M66 P04 L3 Q2 (check if carousel is in)
  113. o122 if [#5399 EQ -1]
  114. (DEBUG, Carousel is not in position to take the tool from spindle, cycle paused)
  115. M0
  116. o122 else
  117. G04 P0.2
  118. o122 endif
  119.  
  120. M64 P10 (release the tool)
  121. G04 P0.2
  122. M65 P10
  123.  
  124. M66 P16 L3 Q2 (check if tool is released)
  125. o123 if [#5399 EQ -1]
  126. (DEBUG, Tool is not released, cycle paused)
  127. M0
  128. o123 else
  129. G04 P0.1
  130. o123 endif
  131.  
  132. M64 P03 (lift spindle to top)
  133. G04 P0.2
  134. M65 P03
  135. M66 P02 L3 Q2 (check if spindle is raised to top)
  136. o124 if [#5399 EQ -1]
  137. (DEBUG, Spindle is not raised to top, cycle paused)
  138. M0
  139. o124 else
  140. G04 P0.2
  141. o124 endif
  142.  
  143. M64 P11 (lock spindle for safety)
  144. G04 P0.2
  145. M65 P11
  146.  
  147. o125 if [#2 EQ 1]
  148.  
  149. M64 P06 (move carousel out)
  150. G04 P0.5
  151. M65 P06
  152.  
  153. M66 P05 L3 Q3 (check if carousel is out and does not interfere with spindle)
  154. o1251 if [#5399 NE 1]
  155. (MSG, Carousel is not out, will try to do that)
  156. M64 P06 (move carousel out)
  157. G04 P0.5
  158. M65 P06
  159. M66 P05 L3 Q4 (check if carousel is out and does not interfere with spindle)
  160. o12511 if [#5399 EQ -1]
  161. (MSG, Carousel is not out, cycle paused)
  162. M0
  163. o12511 endif
  164. o1251 else
  165. G04 P0.1
  166. o125 endif
  167.  
  168.  
  169. o100 elseif [#1 GE 51 AND #1 LE 84]
  170. M65 P[#1 - 30]
  171. (M65 P55)
  172.  
  173.  
  174. o100 else
  175. G53 G0 Z95
  176. G53 G0 Y20
  177. (DEBUG, Remove tool #1 from spindle, cycle paused)
  178. M0
  179. o100 endif
  180. o<tool_put_move> endsub
  181.  
  182. M2
  183.  
Advertisement
Add Comment
Please, Sign In to add comment