You are on page 1of 2

9 MISCELLANEOUS FUNCTIONS

The address M in a CNC program identifies a miscella- All machine tools designed for metal removal by cutting
neous function, sometimes called a machine function. Not have certain common features and capabilities. For exam-
all miscellaneous functions are related to the operation of a ple, spindle rotation can have three - and only three - possi-
CNC machine - quite a few are related to the processing of ble selections in a program:
part program. The more suitable term miscellaneous func-
tions is used throughout this handbook. Spindle normal rotation
Spindle reverse rotation
DESCRIPTION AND PURPOSE Spindle stop

Within the structure of a CNC program, programmers of- In addition to these three possibilities, there is a function
ten need some means of activating certain aspects of ma- called the spindle orientation, also a machine related func-
chine operation or controlling the program flow. Without tion. Another example is coolant. Coolant can only be con-
availability of such means, any part program would be in- trolled in a program as being either ON or OFF.
complete and impossible to run. First, let’s look at those These operations are typical to most CNC machines. All
miscellaneous functions that relate to the operation of a are programmed with an M-function, typically followed by
CNC machine - the true machine functions. two digits, although some control models allow the use of a
three digit M-function, Fanuc 16/18, for example.
Machine Related Functions
Fanuc also uses three digit M-functions in several special
Various physical operations of a CNC machine must be applications, for example, for synchronization of two inde-
controlled by the program, to ensure fully automated ma- pendent turrets on a multi-axis lathe. All these and other
chining. These functions generally use the M-address and functions are related to the operation of CNC machines and
include the following operations: belong to the group collectively known as miscellaneous
Spindle rotation CW or CCW functions or simply as the M-functions or M-codes.
Gear range change Low / Medium / High Program Related Functions
Automatic tool change ATC In addition to the machine functions, several M-functions
Automatic pallet change APC are used to control the execution of a CNC program. An in-
terruption of a program execution requires an M-function,
Coolant operation ON or OFF for example, during the change of a job setup, such as part
Tailstock or quill motion IN or OUT reversal. Another example is a situation where one pro-
gram calls one or more subprograms. In such a case, each
These operations vary between machines, due to the dif- program has to have a program call function, the number of
ferent designs by various machine manufacturers. A ma- repetitions, etc. M-functions handle these requirements.
chine design, from the engineering point of view, is based
on a certain primary machining application. A CNC mill- Based on previous examples, using miscellaneous func-
ing machine will require different functions related to this tions falls into two main groups, based on a particular ap-
type of machine than a CNC machining center or a CNC plication:
lathe. A numerically controlled EDM wire cutting machine
Control of machine functions
will have many special functions, typical to that kind of
machining, including those not found on other machines. Control of program execution
Even two machines designed for the same type of work, This handbook covers only the most common miscella-
for example, two kinds of CNC vertical machining centers, neous functions, used by the majority of controls. Unfortu-
will have functions different from each other, if they have a nately, there are many functions that vary between ma-
different control system or significantly different options. chines and control systems. These functions are called
Various machine models from the same manufacturer will machine specific functions. For this reason, always consult
also have certain unique functions, even if the CNC sys- documentation for the particular machine model and its
tems are identical. control system.

57
58 Chapter 9

TYPICAL APPLICATIONS M04 Spindle rotation reverse (CCW for R/H tools)

M05 Spindle stop


Before learning any M-functions, note the type of activ-
ity these functions do, regardless of whether such activity M07 Coolant mist ON (usually an option)
relates to the machine or the program. Also note the abun-
dance of two way toggle modes, such as ON and OFF, IN M08 Coolant ON (coolant pump motor ON)
and OUT, Forward and Backward, etc. Always check your M09 Coolant OFF (coolant pump motor OFF)
manual first - for reasons of consistency, all M-functions in
this handbook are based on the following table: M10 Chuck open

M11 Chuck close


Applications for Milling
M12 Tailstock quill IN
Function Description M13 Tailstock quill OUT
M00 Compulsory program stop
M17 Turret indexing forward
M01 Optional program stop
M18 Turret indexing reverse
M02 End of program (usually with reset, no rewind)
M19 Spindle orientation (optional)
M03 Spindle rotation normal (CW for R/H tools)
M21 Tailstock forward
M04 Spindle rotation reverse (CCW for R/H tools)
M22 Tailstock backward
M05 Spindle stop
M23 Thread gradual pull-out ON
M06 Automatic tool change (ATC)
M24 Thread gradual pull-out OFF
M07 Coolant mist ON (usually an option)
M30 Program end (always with reset and rewind)
M08 Coolant ON (coolant pump motor ON)
M41 Low gear selection
M09 Coolant OFF (coolant pump motor OFF)
M42 Medium gear selection 1
M19 Spindle orientation
M43 Medium gear selection 2
M30 Program end (always with reset and rewind)
M44 High gear selection
M48 Feedrate override cancel OFF (deactivated)
M48 Feedrate override cancel OFF (deactivated)
M49 Feedrate override cancel ON (activated)
M49 Feedrate override cancel ON (activated)
M60 Automatic pallet change (APC)
M98 Subprogram call
M78 B axis clamp (nonstandard)
M99 Subprogram end
M79 B axis unclamp (nonstandard)
M98 Subprogram call Special MDI Functions
M99 Subprogram end
Several M-functions cannot be used in a CNC program at
all. This group is used in so called Manual Data Input
Applications for Turning mode exclusively (MDI). An example of such functions is
a step by step tool change for machining centers, used for
service purposes only, never in the program. These func-
Function Description tions are outside the scope of this handbook.
M00 Compulsory program stop
Application Groups
M01 Optional program stop
The two major categories, described earlier, can further
M02 End of program (usually with reset, no rewind) be divided into several groups, based on the specific appli-
cation of the miscellaneous functions within each group. A
M03 Spindle rotation normal (CW for R/H tools)
typical distribution list is contained in the following table:

You might also like