Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; parameter: last_slot
- o<tool_put_move> sub
- M66 P05 L3 Q1 (check if carousel is out and does not interfere with spindle)
- o1001 if [#5399 NE 1]
- (MSG, Carousel is not out, will try to do that)
- M64 P06 (move carousel out)
- G04 P0.2
- M65 P06
- M66 P05 L3 Q4 (check if carousel is out and does not interfere with spindle)
- o10011 if [#5399 EQ -1]
- (MSG, Carousel is not out, cycle paused)
- M0
- o10011 endif
- o1001 else
- G04 P0.1
- o1001 endif
- ;o100 if [#2 EQ 1] (current tool remains in spindle)
- ; G04 P0.5 (stop for 0.5 seconds and then skip to end of this file)
- ;o100 elseif [#1 EQ 0]
- ; G04 P0.5
- ;o100 elseif [#1 GE 1 AND #1 LE 7]
- o100 if [#1 GE 1 AND #1 LE 7]
- M64 P00 (raise spindle up midway)
- M64 P04
- G04 P0.2
- M65 P00
- M65 P04
- M66 P00 L3 Q1 (check if spindle is up in middle position)
- o1002 if [#5399 EQ -1]
- (MSG, Spindle is not lifted up, will try to do that)
- M64 P00
- M64 P04 (raise spindle up in middle position)
- G04 P0.2
- M65 P00
- M65 P04
- M66 P00 L3 Q4 (check if spindle is up in middle position)
- o10021 if [#5399 EQ -1]
- (MSG, Spindle is not lifted up, cycle paused)
- M0
- o10021 endif
- o1002 else
- G04 P0.1
- o1002 endif
- ;o110 if [#1 EQ 1]
- ; G53 G0 C205.7 (move carousel slot under tool presence sensor)
- ;o110 elseif [#1 EQ 2]
- ; G53 G0 C154.1
- ;o110 elseif [#1 EQ 3]
- ; G53 G0 C102.7
- ;o110 elseif [#1 EQ 4]
- ; G53 G0 C51.5
- ;o110 elseif [#1 EQ 5]
- ; G53 G0 C-0.7
- ;o110 elseif [#1 EQ 6]
- ; G53 G0 C308.3
- ;o110 elseif [#1 EQ 7]
- ; G53 G0 C256.9
- ;o110 endif
- ; M66 P06 L3 Q1 (check if carousel slot is empty)
- ;o111 if [#5399 NE 0]
- ; (DEBUG, Tool slot is not empty, cycle paused)
- ; M0
- ;o111 else
- ; G04 P0.2
- ;o111 endif
- o120 if [#1 EQ 1]
- G53 G0 C264.810 (move carousel slot to match the spindle)
- o120 elseif [#1 EQ 2]
- G53 G0 C213.394
- o120 elseif [#1 EQ 3]
- G53 G0 C162.407
- o120 elseif [#1 EQ 4]
- G53 G0 C110.910
- o120 elseif [#1 EQ 5]
- G53 G0 C59.390
- o120 elseif [#1 EQ 6]
- G53 G0 C7.852
- o120 elseif [#1 EQ 7]
- G53 G0 C316.352
- o120 endif
- M64 P07 (raise chip guard)
- G04 P0.2
- M65 P07
- M66 P03 L3 Q2 (check if chip guard is raised)
- o121 if [#5399 EQ -1]
- (DEBUG, Chip guard is not raised, cycle paused)
- M0
- o121 else
- G04 P0.2
- o121 endif
- M64 P05 (move carousel in)
- G04 P0.2
- M65 P05
- M66 P04 L3 Q2 (check if carousel is in)
- o122 if [#5399 EQ -1]
- (DEBUG, Carousel is not in position to take the tool from spindle, cycle paused)
- M0
- o122 else
- G04 P0.2
- o122 endif
- M64 P10 (release the tool)
- G04 P0.2
- M65 P10
- M66 P16 L3 Q2 (check if tool is released)
- o123 if [#5399 EQ -1]
- (DEBUG, Tool is not released, cycle paused)
- M0
- o123 else
- G04 P0.1
- o123 endif
- M64 P03 (lift spindle to top)
- G04 P0.2
- M65 P03
- M66 P02 L3 Q2 (check if spindle is raised to top)
- o124 if [#5399 EQ -1]
- (DEBUG, Spindle is not raised to top, cycle paused)
- M0
- o124 else
- G04 P0.2
- o124 endif
- M64 P11 (lock spindle for safety)
- G04 P0.2
- M65 P11
- o125 if [#2 EQ 1]
- M64 P06 (move carousel out)
- G04 P0.5
- M65 P06
- M66 P05 L3 Q3 (check if carousel is out and does not interfere with spindle)
- o1251 if [#5399 NE 1]
- (MSG, Carousel is not out, will try to do that)
- M64 P06 (move carousel out)
- G04 P0.5
- M65 P06
- M66 P05 L3 Q4 (check if carousel is out and does not interfere with spindle)
- o12511 if [#5399 EQ -1]
- (MSG, Carousel is not out, cycle paused)
- M0
- o12511 endif
- o1251 else
- G04 P0.1
- o125 endif
- o100 elseif [#1 GE 51 AND #1 LE 84]
- M65 P[#1 - 30]
- (M65 P55)
- o100 else
- G53 G0 Z95
- G53 G0 Y20
- (DEBUG, Remove tool #1 from spindle, cycle paused)
- M0
- o100 endif
- o<tool_put_move> endsub
- M2
Advertisement
Add Comment
Please, Sign In to add comment