Guest User

Untitled

a guest
Feb 22nd, 2025
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. o<tool_change> sub
  2. G21 ; Set units to mm
  3. G17 G40 G49 ; Cancel offsets and compensation
  4. G53 G0 Z-10 ; Move to a safe Z height
  5. #<_tool> = 0
  6. ;( Drop off current tool if it's loaded )
  7. o100 if [#5400 GT 0]
  8. o101 if [#5400 EQ 1]
  9. G53 G0 X2.41 Y60
  10. o101 elseif [#5400 EQ 2]
  11. G53 G0 X9.41 Y60
  12. o101 elseif [#5400 EQ 3]
  13. G53 G0 X8.41 Y60
  14. o101 elseif [#5400 EQ 4]
  15. G53 G0 X6.41 Y60
  16. o101 endif
  17. M6 T[#5400] ; Set current tool
  18. S1600 ; Set spindle speed
  19. M4 ; Reverse spindle for tool release
  20. G4 P2 ; Wait for stabilization
  21. G91 ; Relative mode
  22. G1 Z-62.237 F2000 ; Plunge to release tool
  23. G90 ; Absolute mode
  24. G53 G0 Z-10 ; Return to safe Z height
  25. o100 endif
  26.  
  27. ;( Pick up requested tool )
  28. O200 if [#<_tool> GT 0]
  29. ( Pickup positions for each tool )
  30. O201 if [#<_tool> EQ 1]
  31. G53 G0 X2.41 Y60
  32. O201 elseif [#<_tool> EQ 2]
  33. G53 G0 X9.41 Y60
  34. O201 elseif [#<_tool> EQ 3]
  35. G53 G0 X8.41 Y60
  36. O201 elseif [#<_tool> EQ 4]
  37. G53 G0 X6.41 Y60
  38. O201 endif
  39.  
  40. M6 T[#<_tool>] ; Set requested tool
  41. S1600 ; Set spindle speed
  42. M3 ; Forward spindle to pick up tool
  43. G4 P2 ; Wait for stabilization
  44. G91 ; Relative mode
  45. G1 Z-62.237 F2000 ; Plunge to engage tool
  46. G1 Z-40 F2000 ; Lift slightly
  47. G4 P.25 ; Pause for speed recovery
  48. G1 Z-62.237 ; Full plunge to lock tool
  49. G90 ; Absolute mode
  50. G53 G0 Z-10 ; Return to safe Z height
  51. O200 endif
  52. o<tool_change> endsub
  53. M2
Advertisement
Add Comment
Please, Sign In to add comment