Professional Documents
Culture Documents
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)