Tool change support in G-Code

Issue #111 resolved
Juan Pablo Caram repo owner created an issue

Users have requested the option to include tool change commands in G-Code generated from Excellon.

Comments (9)

  1. Juan Pablo Caram reporter

    Suggested sequence (By Boris Popov):

    G00 Z30 (Retract to configurable level)
    T1  (Inidcate tool number)
    M5 (Spindle stop)
    M6 (Tool change)
    (MSG, Change drill bit to the size of 0.7mm)
    M0 (Temporary machine stop)
    M3 (Spindle on clockwise)
    
  2. Juan Pablo Caram reporter

    How wold we determine the "configurable level"? It would require knowing how deep the tool is in the tool holder and how far up we can move in the Z-axis.

    The user would also need to set the tool to be very close in height to the previous one. Otherwise, how do we know where Z=0 is any more?

  3. Boris Popov

    Actually, retract level is a simply user entered value which is suitable to change tool on the given machine. It may involve X and/or Y axis, so having input box accepting "30", "Z30" and "X0Y0" would be nice. User doesn't required to perfectly align new tool because after a change, he performs ether automatic or manual Z-axis zeroing sequence.

  4. Juan Pablo Caram reporter

    Is the user allowed to move the tool around (for adjustments or whatever) manually and then continue with the job? I'm not familiar with complex CNC procedures.

  5. Juan Pablo Caram reporter

    Just for the record: From the NIST G-Code Guidelines:

    3.6.3 Tool Change — M6

    To change a tool in the spindle from the tool currently in the spindle to the tool most recently selected (using a T word — see Section 3.7.3), program M6. When the tool change is complete:

    • The spindle will be stopped.

    • The tool that was selected (by a T word on the same line or on any line after the previous tool change) will be in the spindle. The T number is an integer giving the changer slot of the tool (not its id). • If the selected tool was not in the spindle before the tool change, the tool that was in thespindle (if there was one) will be in its changer slot.

    • The coordinate axes will be stopped in the same absolute position they were in before the tool change (but the spindle may be re-oriented).

    • No other changes will be made. For example, coolant will continue to flow during the tool change unless it has been turned off by an M9.

    The tool change may include axis motion while it is in progress. It is OK (but not useful) to program a change to the tool already in the spindle. It is OK if there is no tool in the selected slot; in that case, the spindle will be empty after the tool change. If slot zero was last selected, there will definitely be no tool in the spindle after a tool change.

    3.7.3 Select Tool — T

    To select a tool, program T…, where the T number is the carousel slot for the tool. The tool is not changed until an M6 is programmed (see Section 3.6.3). The T word may appear on the same line as the M6 or on a previous line. It is OK, but not normally useful, if T words appear on two or more lines with no tool change. The carousel may move a lot, but only the most recent T word will take effect at the next tool change. It is OK to program T0; no tool will be selected. This is useful if you want the spindle to be empty after a tool change. It is an error if:

    • a negative T number is used,

    • a T number larger than the number of slots in the carousel is used.

    On some machines, the carousel will move when a T word is programmed, at the same time machining is occurring. On such machines, programming the T word several lines before a tool change will save time. A common programming practice for such machines is to put the T word for the next tool to be used on the line after a tool change. This maximizes the time available for the carousel to move.

  6. Juan Pablo Caram reporter

    Boris,

    It's working as you suggested. Could you give it a try?

    After reading the specifications, it seems that the T instruction specifies the location of the tool in the carousel, for automatic tool changing. Not the tool number/name in the Excellon file.

    Do you have an automatic tool changer? We would need someone who does to test it. How will this behave for machines with manual tool change?

  7. Boris Popov

    Yes, in most cases user allowed to change current coordinates as he wishes, because machine tracks them and next G00 command will return spindle to the correct position. For example, on machine with manual tool change user will have to move spindle up either using jog dial or by G00ZXX command, change the tool and recalibrate Z-axis by hand or by using the probe. On a fully automatic machine, it will change the tool and adjust Z-axis offset by measuring the new tool length.

    As for the tool number: it is up to the user to properly place tools in the changer or properly setup tool numbers in the drill file.

  8. Log in to comment