Table of Contents
Standard G Code and M Code | CNC programming basics
CNC part Programming :
The part programming contains the list of coordinate values along the X, Y and Z directions of the entire tool path to finish the component. The program should also contain information, such as feed and speed. Each of the necessary instructions for a particular operation given in the part program is known as an NC word. A group of such NC words constitutes a complete NC instruction, known as block. The commonly used words are N, G, F, S, T, and M. The same is explained later on through examples.
Hence the methods of part programming can be of two types depending upon the two techniques as below
(a) Manual part programming,and
(b) Computer aided part programming
Read more : Bobcad CAM – CNC programming software for Machining ,Turning
STANDARD G AND M CODES
The most common codes used when programming NC machines tools are G-codes (preparatory functions), and M codes (miscellaneous functions). Other codes such as F, S, D, and T are used for machine functions such as feed, speed, cutter diameter offset, tool number, etc. G-codes are sometimes called cycle codes because they refer to some action occurring on the X, Y, and/or Z-axis of a machine tool. The G-codes are grouped into categories such as Group 01, containing codes G00, G01, G02, G03, which cause some movement of the machine table or head. Group 03 includes either absolute or incremental programming. A G00 code rapidly positions the cutting tool while it is above the work piece from one point to another point on a job. During the rapid traverse movement, either the X or Y-axis can be moved individually or both axes can be moved at the same time. The rate of rapid travel varies from machine to machine.
The total numbers of these codes are 100, out of which some of important codes are given as under with their functions :
G-Codes (Preparatory Functions)
- G00 Rapid positioning
- G01 Linear interpolation
- G02 Circular interpolation clockwise (CW)
- G03 Circular interpolation counterclockwise (CCW)
- G20 Inch input (in.)
- G21 Metric input (mm)
- G24 Radius programming
- G28 Return to reference point
- G29 Return from reference point
- G32 Thread cutting
- G40 Cutter compensation cancel
- G41 Cutter compensation left
- G42 Cutter compensation right
- G43 Tool length compensation positive (+) direction
- G44 Tool length compensation minus (-) direction
- G49 Tool length compensation cancels
- G 53 Zero offset or M/c reference
- G54 Settable zero offset
- G84 canned turn cycle
- G90 Absolute programming
- G91 Incremental programming
M-Codes (Miscellaneous Functions)
M or miscellaneous codes are used to either turn ON or OFF different functions, which control certain machine tool operations. M-codes are not grouped into categories, although several codes may control the same type of operations such as M03, M04, and M05, which control the machine tool spindle. Some of important codes are given as under with their functions
- M00 Program stop
- M02 End of program
- M03 Spindle start (forward CW)
- M04 Spindle start (reverse CCW)
- M05 Spindle stop
- M06 Tool change
- M08 Coolant on
- M09 Coolant off
- M10 Chuck – clamping
- M11 Chuck – unclamping
- M12 Tailstock spindle out
- M13 Tailstock spindle in
- M17 Tool post rotation normal
- M18 Tool post rotations reverse
- M30 End of tape and rewind or main program end
- M98 Transfer to subprogram
- M99 End of subprogram
Recent Posts
Mechanical Engineering is an essential discipline of engineering encompassing many specializations, with each contributing its unique aspect to the dynamic and inventive nature of this field. With...
The Ram Lalla idol, which is installed at Ayodhya's Ram temple has many significant religious symbols from Hinduism. All 10 incarnations of Lord Vishnu are engraved on the idol. Notably, Lord Ram is...