What are G Codes in CNC & CNC Turning G-Code List | CNC Programming Language

2020/1/23 14:56:32

CNC turning operation is executed by the numerically controlled machine tool according to program codes and instructions created by specific software. As the most popular CNC programming language, what are G codes in CNC? Dajinprecision.com now presents the CNC turning G-code list and functions, basics. 

cnc turning g code.png

What are G Codes in CNC Machining?

G code, also called preparatory codes or G command, refers to any word begins with the letter G in CNC programs, it is a numerical control program language widely used in computer-aided manufacturing, to instruct the automated machine tools (like lathe or mill) the what motion to perform, including where to move, how fast to move and what path to follow. The cutting tool will move according to the instructions through a tool path and remove materials to get finished workpiece.

CNC Turning G-Code List - G-Codes for CNC Lathe Machines

Here is the list of common g-codes and corresponding functions for CNC turning and lathes. 

G00: Linear move at rapid speed

G01: Linear move at the speed commanded by Feedrate

G02: Circular interpolation, clockwise

G03: Circular interpolation, counterclockwise

G04: Dwell: stop for a specified time

G09: Exact stop check, non-modal

G10: Programmable parameter input

G11: Data write cancel

G18: ZX plane selection

G20: Programming in inches

G21: Programming in millimeters (mm)

G28: Return to home position (machine zero, aka machine reference point)

G30: Return to the 2nd, 3rd, and 4th reference point (machine zero, aka machine reference point)

G32: Single-point threading, longhand style

G40: Tool radius compensation off

G41: Tool radius compensation left

G42: Tool radius compensation right

G50: Reset all scale factors to 1.0

G53: Machine coordinate system (cancel work offsets)

G54 to G59: Work coordinate systems

G61: Exact stop check, modal

G62: Automatic corner override

G64: Default cutting mode (cancel exact stop check mode)

G70: Fixed cycle, multiple repetitive cycles, for finishing (including contours)

G71: Fixed cycle, multiple repetitive cycle, for roughing (Z-axis emphasis)

G72: Fixed cycle, multiple repetitive cycle, for roughing (X-axis emphasis)

G73: Fixed cycle, multiple repetitive cycle, for roughing, with pattern repetition

G74: Peck Drilling Cycle

G75: Peck grooving cycle for turning

G76: Threading cycle for turning, multiple repetitive cycle

G80: Cancel canned cycle

G90: T(B) - Absolute programming, T(A) - Fixed cycle, simple cycle, for roughing (Z-axis emphasis)

G91: T(B) - Incremental programming

G92: T(B) - Position register (programming of vector from part zero to tool tip), T(A) - Threading cycle, simple cycle

G94: T(B) - Feedrate per minute, T(A) - Fixed cycle, simple cycle, for roughing (X-axis emphasis)

G95: T(B) - Feedrate per revolution

G96: Constant surface speed

G97: Constant spindle speed

G98: Feedrate per minute (group type A)

G99: Feedrate per revolution (group type A)

What is Different in G71 and G73 in CNC Turning

G71 and G73 are both fixed cycle for roughing, while the G71 cycle generally roughs the profile moving in a straight line along the Z-axis, and the G73 pattern repeating cycle is used when machining a profile has been cut. 

Get Started with G-Code

A line of g-code is called block, which is the basic unit of a g-code part program, so the first thing we should know is how to create blocks.

How to write g-code? Writing g codes needs in a specific format. The format of rapid positioning (G00) is G00 X(U)__Z(W)__, for example, you can write as G00 X75 Z100. G00 can be written as G0, G01 can be written as G1. 

Please note that it's better to run the sample programs in the machine manual before a big program.

WE'D LIKE TO HEAR FROM YOU

DAJIN provides excellent quality turning services, precision turned parts, offering professional machining services at competitive price and on timely delivery. With our extensive machining capabilities, we produce the most challenging precision machining parts covering all Industries especially in mass production in automotive industry.