CNC Programming For CNC Machinists
CNC Programming For CNC Machinists
by Helman Jr.
CNC Programming is not that difficult to learn and master, specially cnc programming for cnc lathe
machines. Because cnc lathe machines have only two axis to work with X-axis and Z-axis.
To learn cnc programming you better start from the easy to program drawings.
To start cnc programming for a cnc lathe machine the process is under.
You first have to call the proper cutting tool for the machining. This step is cnc machine dependent but on
fanuc cnc control you will use following cnc programming command,
T5 or T0505
Now load workshift value, the following cnc programming commands are used to load the workshift,
G10 , G54
Rotate the main spindle of cnc lathe machine. The cnc programming command to rotate the main spindle is
under,
G97 S1000
The above cnc programming command will not make the spindle to rotate this will actually only tell the
cnc machine that I want to rotate the main spindle at 1000RPM (Revolution Per Minute),
but to actually rotate to spindle you have to give another cnc programming command or M-Code or M-
Function to tell cnc machine to rotate the spindle in CW (Clockwise rotation) or CCW (Counter-Clockwise
rotation).
M03 (Rotate spindle in CW ditection)
M04 (Rotate spindle in CCW direction)
M05 (Stop the spindle)
To turn the cnc machine Coolant ON, so our tool insert and component can’t get hot you need to turn on
the coolant, the cnc programming commands or M functions are as under
Now the time to actually move the tool, there are multiple cnc programming commands (G-codes) to travel
the tool.
To travel the tool at a fast feed or in cnc words we say it Rapid Traverse the tool we will use following cnc
programming command or G-code,
The X and Z values with G00 are the destination coordinates for the tool.
To travel the tool at a control feed or to Linear Traverse the tool, we will use following cnc programming
command or G-Code,
The X and Z values with G01 are destination coordinated in X and Z axis. The F value is the tool feed,
This might be G95 (Feed Per Revolution).
To machine Arc or Circular Interpolation on component, the following cnc programming commands or G-
codes are used,
G02 cnc programming g-code is used to program a Clock-wise Arc, and G03 G-code is used to program a
Counter-Clockwise Arc. The X and Z values are destination coordinates and R is the Arc Radius.
To make an end to the cnc program you will use following cnc programming command or M-code,
M30
M30 End the cnc program and brings the cursor to the program start.
CNC G Codes
CNC G Code in a broader way are instructions to the cnc machine tools.
CNC G-code are instructions to cnc machine tools like
which way to go whether
to travel in a straight line (G01)
or in a curve (G02, G03)
or in taper (G01)
and with what feed (G94, G95).
Whether to travel at full feed (G00)
or with a controlled feed (G94, G95).
and if there is a stay how long will the stay be a cnc programmer calls this stay Dwell Time. (G04)
The G codes also provide some very crucial data at program start and at run time like
Tool-Offsetting data (G10)
and CNC Workpiece-Zero-Point or CNC Workshift Setting, (G10, G54, G55)
as without this data running a cnc machine is just a dream.
So after reading the above paragraph you might have understood the power of the G codes.
They provide crucial and sensitive data at run time and instruct the cnc machine tools to run on
the given path with a controlled feed but keeping that crucial data in mind all the time.
If I fully translate the above paragraph in cnc G code then I will say that the cnc machine will read
machine zero offset with G54 and Tool-Offset with G10 and run on a path which is carved with
G00 G01 G02 G03 and run with a control feed the feed is controlled with G94 G95 G96.
Important G Codes
G00
The G00 G code of cnc machine tell the cnc machine to bring the tool to a given point given with
G00 at the full feed, the feed of the G00 is given in the cnc machine parameters and normally
never changed, but can be changed if really needed.
G01
The G01 G-code of cnc machine tell the cnc machine to bring the tool with a controlled feed,
unlike G00 whose feed is buried in cnc machine parameters the feed of the G01 code is given in
the same program block or in the prior blocks. To control the feed another G code is used which
is G95.
Fanuc G71 for Boring Opertaion
This programming example also illustrate how G71 turning cycle can be used for internal
machining (boring operation). So if you want to remove extra stock from inside of a component,
you can use Fanuc G71 turning cycle for internal stock removal as well.
Fanuc Programming Example