Copyright Goodheart-Willcox Co., Inc. 186 CNC Manufacturing Technology 9.4.2 M Codes The program address M is commonly referred to as a machine function. The M code can best be described as a switch. For example, M8 turns on the coolant, and M9 turns off the coolant. These commands literally turn on and off the electrical switch for the coolant pump. M codes can be machine or machine-type specific, although many M codes are the same for lathes and mills. Many machines also come with “open M codes,” which can be tapped into for optional equipment. Unlike G codes, only one M code can be used on each line of the program. Figure 9-6 lists the most commonly used M codes and their functions, which can be used to produce most programs. There are more M codes available, including machine-specific M codes for special functions. For specific codes for different controls, refer to your user’s manual. As with G codes, the list of M codes can be sorted by functional cat- egory for use with future programs. M00 is a mandatory program stop used for forcing a stop mid-cycle. M01 is an optional stop turned on and off by a switch. M03, M04, and M05 control spindle on and off M03 will be used in most cases to turn the spindle on and M05 to turn the spindle off. M06 initiates a tool change. M10 and M11 are only used on multi-axis machines to clamp/ unclamp the rotary or table. Commonly Used G Codes (continued) G Code Function G42 Tool cutter compensation right. G43 Apply tool length compensation. G54 Work coordinate system (1st workpiece). G55 Work coordinate system (2nd workpiece). G56 Work coordinate system (3rd workpiece). G57 Work coordinate system (4th workpiece). G58 Work coordinate system (5th workpiece). G59 Work coordinate system (6th workpiece). G73 High-speed drilling cycle. G76 Fine boring cycle. G80 Cancel canned cycle. G81 Spot-drilling cycle. G82 Drilling cycle with dwell (counterboring). G83 Full retract peck drilling cycle. G84 Tapping cycle. G85 Boring canned cycle, no dwell, feed out. G86 Boring canned cycle, spindle stop, rapid out. G90 Absolute programming of XYZ. G91 Incremental programming of XYZ. G98 Return to initial Z plane after canned cycle. G99 Return to initial R plane after canned cycle. Goodheart-Willcox Publisher Figure 9-5. (Continued)
Previous Page Next Page