This is the thrid post in a series about common G & M codes that started with the common G codes for CNC turning / CNC lathe work.
This Milling G Code information is excerpted from the 7 Easy Steps to CNC Programming series of books. Books are available in hard copy and downloadable electronic versions.
Most Common CNC Milling G Codes
Code |
Group |
Parameters |
What it does / usage |
G0 / G00 |
01 |
Modal. Initiates rapid travel. Causes the machine to move the tool to the programmed coordinate at the machines maximum speed. |
|
G1 / G01 |
01 |
F |
Modal. Initiates linear feed. Moves the tool in a straight line at the programmed feed rate as specified by F. |
G2 / G02 |
01 |
I, J, K, R, F |
Modal. Initiates clockwise interpolation. Moves the tool to a specified endpoint in a clockwise direction. The parameters I, J, K and R define the size of the arc. I, J, K define the center of the arc and are generally used together. These parameters allow programming of arcs from 0-360 degrees The R command is a shortcut for defining the arc radius and is never used on the same line with I, J, or K. The R command can be used to program arcs up to 360 degrees but not including 360 degrees. |
G3 / G03 |
01 |
I, J, K, R, F |
Modal. Initiates counterclockwise interpolation. Moves the tool to a specified endpoint in a counterclockwise direction. The parameters I, J, K and R define the size of the arc. I, J, K define the center of the arc and are generally used together. These parameters allow programming of arcs from 0-360 degrees. The R command is a shortcut for defining the arc radius and is never used on the same line with I, J, or K. The R command can be used to program arcs up to 360 degrees but not including 360 degrees. |
G4 / G04 |
00 |
X, P |
Non-modal. Commands the machine to dwell or sit still for X seconds or P miliseconds. For example G04 X3 would cause the machine to dwell for 3 seconds. To dwell for 3 seconds using the P parameter, the command would be G04 P3000
|
G4 / G04 contd. |
00 |
X, P |
This is useful for having the machine while coolant comes on or the spindle gets up to speed, etc. |
G17 |
16 |
Modal. Sets active plane to the X, Y plane. |
|
G18 |
16 |
Modal. Sets active plane to the X, Z plane (most common plane for turning). |
|
G19 |
16 |
Modal. Sets active plane to the Y, Z plane. |
|
|
06 |
Modal. Sets the machine to operate in inch mode. |
|
G21 / G95 |
06 |
Modal. Sets the machine to operate in metric mode |
|
G28 |
00 |
Non-Modal. Commands the machine to move to the machine zero-reference point through an intermediate point. |
|
G40 |
07 |
Modal. Cancels cuter compensation. |
|
G41 |
07 |
D |
Modal. Cutter compensation left. This command tells the machine to move the cutter to the left of the programmed path by the amount specified in the offset identified by the D word. For example G41 X-3.000 D23 commands the machine to move to X-3 but to keep the tool to the left of the programmed path by amount in offset register 23. Left and Right are determined by looking down the tool path from start point to end point. As you imagine looking down that path, the compensation will be to the left. |
G42 |
07 |
D |
Modal. Cutter compensation Right. This command tells the machine to move the cutter to the right of the programmed path by the amount specified in the offset identified by the D word. For example G41 X-3.000 D23 commands the machine to move to X-3 but to keep the tool to the right of the programmed path by amount in offset register 23. Left and Right are determined by looking down the tool path from start point to end point. As you imagine looking down that path, the compensation will be to the right. |
G50 |
00 |
X, Y, Z |
Modal. Used to program the absolute zero. The X and Z would be programmed as the distance and direction from the desired absolute zero point to the current tool position. |
G70 |
00 |
Modal. The ANSI/EIA RS-274-D standard command for inch programming. |
|
G73 |
01 |
X, Y, Z, R, |
Modal. High Speed Chip Breaking. This canned cycle: * moves to the programmed X, Y location |
G74 |
01 |
X, Y, Z, F, R |
Modal. Left Hand Tapping. This canned cycle: * Starts the spindle in counter-clockwise |
G76 |
01 |
X, Y, Z, F, R |
Modal. Fine Boring. This canned cycle: * moves to the programmed X, Y location |
G80 |
01 |
Cancels Canned Cycles. |
|
G81 |
01 |
X, Y, Z, R, F |
Modal. Drill. This canned cycle: * moves to the programmed X, Y location |
G82 |
01 |
X, Y, Z, F, |
Modal. Counter-Boring This canned cycle: * moves to the programmed X, Y location |
G83 |
01 |
X, Y, Z, F, R, Q |
Modal. Full Retract Peck Drilling. This canned cycle works the same way as G73 except this command causes the tool to retract all the way out of the hole instead of just enough to break the chip. |
G84 |
01 |
X, Y, Z, F, R |
Modal. Right Hand Tapping. This canned cycle: * moves to the programmed X, Y location |
G85 |
01 |
X, Y, Z, F, R |
Modal. Boring. This canned cycle: * moves to the programmed X, Y location |
G86 |
01 |
X, Y, Z, F, R |
Modal. Boring This canned cycle: * moves to the programmed X, Y location |
G90 |
03 |
Modal. The ANSI/EIA RS-274-D standard command for absolute programming. |
|
G91 |
03 |
Modal. The ANSI/EIA RS-274-D standard command for incremental programming. |
|
G98 |
10 |
Modal. Return to Initial level. |
|
G99 |
10 |
Modal. Return to R Level. In the canned cycle command when you program an R parameter you tell the machine to rapid from the initial level to the R level before starting the canned cycle. This can be handy when you drill holes down in a pocket and then you want to retract the tool and Rapid to a level above the part but not out to the initial level between holes. By programming the G99 with a Z level you can keep the tool close to the work piece. Remember though, on the last hole, you should add the G98 to force the cycle to return to the initial level. This may keep the tool from crashing into the part as it rapids home or to a new location. |
Watch for upcoming post on the most common M Codes used in CNC Milling applications. These tables are excerpted from the 7 Easy Steps to CNC Programming series of books.
[…] Common G Codes for Milling: G00, G01, G02 and G03, G83 […]
By: The CNC Project on October 3, 2015
at 10:31 am
[…] Common G Codes for Milling: G00, G01, G02 and G03, G83 […]
By: Introduction to CNC Programming, Chapter 9: G and M codes used to make cribbage board | The CNC Project on October 3, 2015
at 10:41 am
[…] brief video only mentions the G17, G40, G80 as the commands used for a safe start line. Other G codes recommended for a safe start line […]
By: Introduction to CNC Programming, Chapter 10, Modal Commands and the Safe Start Line | The CNC Project on October 6, 2015
at 5:40 pm
nice article,it is useful to me and others,please just keep it….
By: http://www.sage-academy.co.uk/css/20151118/how_to_recover_permanently_deleted_pdf_files_619.html on November 24, 2015
at 3:44 am