Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - o<tool_change> sub
 - G21 ; Set units to mm
 - G17 G40 G49 ; Cancel offsets and compensation
 - G53 G0 Z-10 ; Move to a safe Z height
 - #<_tool> = 0
 - ;( Drop off current tool if it's loaded )
 - o100 if [#5400 GT 0]
 - o101 if [#5400 EQ 1]
 - G53 G0 X2.41 Y60
 - o101 elseif [#5400 EQ 2]
 - G53 G0 X9.41 Y60
 - o101 elseif [#5400 EQ 3]
 - G53 G0 X8.41 Y60
 - o101 elseif [#5400 EQ 4]
 - G53 G0 X6.41 Y60
 - o101 endif
 - M6 T[#5400] ; Set current tool
 - S1600 ; Set spindle speed
 - M4 ; Reverse spindle for tool release
 - G4 P2 ; Wait for stabilization
 - G91 ; Relative mode
 - G1 Z-62.237 F2000 ; Plunge to release tool
 - G90 ; Absolute mode
 - G53 G0 Z-10 ; Return to safe Z height
 - o100 endif
 - ;( Pick up requested tool )
 - O200 if [#<_tool> GT 0]
 - ( Pickup positions for each tool )
 - O201 if [#<_tool> EQ 1]
 - G53 G0 X2.41 Y60
 - O201 elseif [#<_tool> EQ 2]
 - G53 G0 X9.41 Y60
 - O201 elseif [#<_tool> EQ 3]
 - G53 G0 X8.41 Y60
 - O201 elseif [#<_tool> EQ 4]
 - G53 G0 X6.41 Y60
 - O201 endif
 - M6 T[#<_tool>] ; Set requested tool
 - S1600 ; Set spindle speed
 - M3 ; Forward spindle to pick up tool
 - G4 P2 ; Wait for stabilization
 - G91 ; Relative mode
 - G1 Z-62.237 F2000 ; Plunge to engage tool
 - G1 Z-40 F2000 ; Lift slightly
 - G4 P.25 ; Pause for speed recovery
 - G1 Z-62.237 ; Full plunge to lock tool
 - G90 ; Absolute mode
 - G53 G0 Z-10 ; Return to safe Z height
 - O200 endif
 - o<tool_change> endsub
 - M2
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment