Advertisement
Guest User

Untitled

a guest
Aug 20th, 2020
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. o<rack_change> sub
  2.  
  3. M73 (auto-restore modal settings on return)
  4.  
  5. ;(print, rack_change: loaded tool=#<_current_tool> current pocket: #<_current_pocket>)
  6. ;(print, rack_change: selected tool=#<_selected_tool> selected pocket: #<_selected_pocket>)
  7.  
  8.  
  9. ; unload previous tool
  10. o300 if [#<_current_pocket> GT 0]
  11. o<tool_getput_move> call [#<_current_pocket>]
  12. M62 P #<_ini[pins]lock> ; set lock pin
  13. G4 P #<_ini[dwell]lock_time>
  14. o<tool_holder_clear_move> call
  15. G4 P #<_ini[dwell]mystery> ; unsure what this is for
  16. o300 endif
  17.  
  18. ; go to new tool
  19. o<tool_getput_move> call [#<_selected_pocket>]
  20. M64 P #<_ini[pins]lock> ; set lock pin
  21. M64 P #<_ini[pins]flush> ; set flush pin
  22. G4 P #<_ini[dwell]new_tool>
  23. M65 P #<_ini[pins]flush> ; drop flush pin
  24.  
  25. ; the purpose of this move is unclear to me
  26. ; micges - please explain!
  27. o400 if [#<_absolute>]
  28. G91
  29. G0 Z-6
  30. G90
  31. o400 else
  32. G0 Z-6
  33. o400 endif
  34. M65 P #<_ini[pins]lock> ; drop lock pin
  35. G4 P #<_ini[dwell]post_unlock>
  36.  
  37. ; NB: this is reordered wrt micges patch:
  38. ; tool_holder_clear_move came after load_tool_msg
  39. o<tool_holder_clear_move> call
  40.  
  41. ; succeed by returning a positive value
  42. o<rack_change> endsub [1]
  43. m2
  44.  
  45.  
  46. ; parameter: last_slot
  47. o<tool_getput_move> sub
  48. o100 if [EXISTS[#<_ini[change_position]x>]]
  49. g53 g0 X #<_ini[change_position]x>
  50. g53 g0 Y [#<_ini[change_position]y> + #1 * #<_ini[tool_slot_delta]y>]
  51. g53 g0 Z #<_ini[change_position]z>
  52. o100 endif
  53. o<tool_getput_move> endsub
  54.  
  55. m2
  56.  
  57.  
  58. ; no parameters
  59. o<tool_holder_clear_move> sub
  60. o200 if [EXISTS[#<_ini[tool_holder_clear]x>]]
  61. g53 g0 Z #<_ini[tool_holder_clear]z>
  62. g53 g0 X #<_ini[tool_holder_clear]x>
  63. g53 g0 Y #<_ini[tool_holder_clear]y>
  64. o200 endif
  65. o<tool_holder_clear_move> endsub
  66.  
  67. m2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement