CNC Codes
CNC Codes
In the early days of CNC machines, the input or instructions were fed to the CNC
machine using punch tapes or magnetic tapes. However, due to technological
advancement, computers have replaced them. A computerized CNC controller is
shown below.
Each code has a particular preset function and by using various codes together a
workpiece is machined accordingly.
We have already covered CNC, its working, types, advantages, and applications in
detail in our previous post, you can refer to this for a good idea about CNC and its
related terms:
What is a CNC machine? its working, types, advantages, uses with PDF
Before starting with G codes and M codes in a CNC part program, other codes or
words are also used to complete the whole machining process. So let’s take a look at
the different codes or words used in CNC.
N-words
These words represent the sequence number, it helps identify the block (each line of
instruction is termed as a block). In short, it’s like when we write something in steps,
we give each step a number.
Like point no 1, point no 2, and so on. Similarly in the CNC part programming, each
line or block of code is given a number like N100, N110, N120, and so on. They are
usually written in steps of 10 or 5.
In addition to these linear axes, angular positions are specified using I, J, and K
words.
Each tool present in the tool magazine or tool library has a specific address.
Take for eg, if the tool currently being used is a taper tool and now the operator
requires to drill a hole, so he uses the tool selection command and calls the drill bit at
position 4 by using T04.
G codes for CNC milling
The following are some of the commonly used G codes and their description in CNC
milling.
By using this code the tool moves with the maximum velocity. This velocity is
specified by the manufacturer.
During the traveling of the tool, no cutting operation is performed. This command is
usually used when the tool is far away from the workpiece.
When we usually call the tool at a point it traverses at a slower rate. This increases the
time which eventually results in losses. Thus the G00 code is used.
First, the code G01 is called then the X, Y, and Z coordinates of the destination are
specified.
Along with this, the feed rate is also provided. For eg. G01 X30 Y15 Z2 F120.
The feed rate can either be in mm/min (G94) or mm/rev (G95), this depends upon the
design of the workpiece and the operator
G04 – Dwell
This code is used when no machining is required. The tool remains idle during dwell.
First, the code is written, then the time for dwell is specified. Here X stands for
seconds and P for milliseconds.
This was a small explanation of the G codes. For more information about G codes and
M codes and their explanation visit: cnccookbook.com
Here is an example of an actual part program used to produce the finished workpiece.
That’s an overview of G codes and M codes used in CNC machines. If you like this
post or have any suggestions do let us know in the comments we would love to hear it
from you.
Also do join our Telegram Channel to stay updated on Mechanical engineering. We’ll
be back soon with another interesting article, till then Keep reading!