Skip to content
GcodeDoc.py 52.6 KiB
Newer Older
Fabrice Salvaire's avatar
Fabrice Salvaire committed
    3. Distance mode is set to MODE_ABSOLUTE (like G90).
    4. Feed rate mode is set to UNITS_PER_MINUTE (like G94).
    5. Feed and speed overrides are set to ON (like M48).
    6. Cutter compensation is turned off (like G40).
    7. The spindle is stopped (like M5).
    8. The current motion mode is set to G_1 (like G1).
    9. Coolant is turned off (like M9).

    No more lines of code in an RS274/NGC file will be executed after the M2 or M30 command is
    executed. Pressing cycle start will start the program back at the beginning of the file.

    """

####################################################################################################

class M3_M4_M5:

    """**Spindle Control — M3, M4, M5**

    To start the spindle turning clockwise at the currently programmed speed, program M3.

    To start the spindle turning counterclockwise at the currently programmed speed, program M4.

    To stop the spindle from turning, program M5.

    It is OK to use M3 or M4 if the spindle speed is set to zero. If this is done (or if the speed
    override switch is enabled and set to zero), the spindle will not start turning.  If, later, the
    spindle speed is set above zero (or the override switch is turned up), the spindle will start
    turning. It is OK to use

    M3 or M4 when the spindle is already turning or to use M5 when the spindle is already stopped.

    """

####################################################################################################

class M6:

    """**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 the
      spindle (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.

    """

####################################################################################################

class M7_M8_M9:

    """**Coolant Control — M7, M8, M9**

    * To turn mist coolant on, program M7.
    * To turn flood coolant on, program M8.
    * To turn all coolant off, program M9.

    It is always OK to use any of these commands, regardless of what coolant is on or off.

    """

####################################################################################################

class M48_M48:

    """**Override Control — M48 and M49**

    To enable the speed and feed override switches, program M48. To disable both switches, program
    M49. See Section 2.2.1 for more details. It is OK to enable or disable the switches when they
    are already enabled or disabled.

    """

####################################################################################################

# **Other Input Codes**

####################################################################################################

class F:

    """**Set Feed Rate — F**

    To set the feed rate, program F… . The application of the feed rate is as described in Section
    2.1.2.5, unless inverse time feed rate mode is in effect, in which case the feed rate is as
    described in Section 3.5.19.

    """

####################################################################################################

class S:

    """**Set Spindle Speed — S**

    To set the speed in revolutions per minute (rpm) of the spindle, program S… . The spindle will
    turn at that speed when it has been programmed to start turning. It is OK to program an S word
    whether the spindle is turning or not. If the speed override switch is enabled and not set at
    100%, the speed will be different from what is programmed. It is OK to program S0; the spindle
    will not turn if that is done.

    **It is an error if:**

    * the S number is negative.

    As described in Section 3.5.16.5, if a G84 (tapping) canned cycle is active and the feed and
    speed override switches are enabled, the one set at the lower setting will take effect. The
    speed and feed rates will still be synchronized. In this case, the speed may differ from what is
    programmed, even if the speed override switch is set at 100%.

    """

####################################################################################################

class T:

    """**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.

    """