| written 9.4 years ago by |
A CNC part programming begins with a %MPF file which signifies the beginning of a program. A part program is a series of coded instructions required to produce a part. It controls the movement of the machine tool and the on/off control of auxiliary functions such as spindle rotation and coolant. The coded instructions are composed of letters, numbers and symbols and are arranged in a format of functional blocks representing an operation to be carried out in the machining of a part.
G Codes: Preparatory Functions
It involves the actual tool movement. It is followed by a two digit number e.g. G00, G90, etc. The preparatory functions instruct the machines what to do via the customer’s CNC program. Some of the common G codes are listed below.
| Code | Operation | Function |
|---|---|---|
| G17,G18,G19 | Plane Selection | This function identifies on which plane the machining is to be carried out. G17: x-y plane G18: x-z plane G19: y-z plane |
| G94 | Feed rate | The feed rate is specified in mm/min or inch/min. |
| G01 | Linear Interpolation | With G01 the tool travels along a straight line in which the velocity is held constant. |
M codes: Miscellaneous functions
The perform a variety of auxiliary commands such as stopping the program, stopping and starting the spindle, tool changes coolant on/off etc. they are used at the beginning or the end of the cycle and are identified by the letter address “M” followed by a two digit number.
| Code | Operation | Function |
|---|---|---|
| M00 | Program stop | It cancels the spindle and coolant functions |
| M06 | Tool change | Stops spindle and coolant and then changes the tool at the set point. |
| M08 | Coolant “ON” | Witches on the coolant system |

and 2 others joined a min ago.