Variable | Description | Corollary info |
---|---|---|
A | Absolute or incremental position of A axis (rotational axis around X axis) | Positive rotation is defined as a counterclockwise rotation looking from X positive towards X negative. |
B | Absolute or incremental position of B axis (rotational axis around Y axis) | |
C | Absolute or incremental position of C axis (rotational axis around Z axis) | |
D | Defines diameter or radial offset used for cutter compensation. D is used for depth of cut on lathes. It is used for aperture selection and commands on photoplotters. | G41: left cutter compensation, G42: right cutter compensation |
E | Precision feedrate for threading on lathes | |
F | Defines feed rate | Common units are distance per time for mills (inches per minute, IPM, or millimeters per minute, mm/min) and distance per revolution for lathes (inches per revolution, IPR, or millimeters per revolution, mm/rev) |
G | Address for preparatory commands | G commands often tell the control what kind of motion is wanted (e.g., rapid positioning, linear feed, circular feed, fixed cycle) or what offset value to use. |
H | Defines tool length offset; Incremental axis corresponding to C axis (e.g., on a turn-mill) |
G43: Negative tool length compensation, G44: Positive tool length compensation |
I | Defines arc center in X axis for G02 or G03 arc commands. Also used as a parameter within some fixed cycles. |
The arc center is the relative distance from the current position to the arc center, not the absolute distance from the work coordinate system (WCS). |
J | Defines arc center in Y axis for G02 or G03 arc commands. Also used as a parameter within some fixed cycles. |
Same corollary info as I above. |
K | Defines arc center in Z axis for G02 or G03 arc commands. Also used as a parameter within some fixed cycles, equal to L address. |
Same corollary info as I above. |
L | Fixed cycle loop count; Specification of what register to edit using G10 |
Fixed cycle loop count: Defines number of repetitions ("loops") of a fixed cycle at each position. Assumed to be 1 unless programmed with another integer. Sometimes the K address is used instead of L. With incremental positioning (G91), a series of equally spaced holes can be programmed as a loop rather than as individual positions. G10 use: Specification of what register to edit (work offsets, tool radius offsets, tool length offsets, etc.). |
M | Miscellaneous function | Action code, auxiliary command; descriptions vary. Many M-codes call for machine functions, which is why people often say that the "M" stands for "machine", although it was not intended to. |
N | Line (block) number in program; System parameter number to change using G10 |
Line (block) numbers: Optional, so often omitted. Necessary for certain tasks, such as M99 P address (to tell the control which block of the program to return to if not the default) or GoTo statements (if the control supports those). N numbering need not increment by 1 (for example, it can increment by 10, 20, or 1000) and can be used on every block or only in certain spots throughout a program. System parameter number: G10 allows changing of system parameters under program control.[8] |
O | Program name | For example, O4501. For many years it was common for CNC control displays to use slashed zero glyphs to ensure effortless distinction of letter "O" from digit "0". Today's GUI controls often have a choice of fonts, like a PC does. |
P | Serves as parameter address for various G and M codes |
|
Q | Peck increment in canned cycles | For example, G73, G83 (peck drilling cycles) |
R | Defines size of arc radius, or defines retract height in milling canned cycles | For radii, not all controls support the R address for G02 and G03, in which case IJK vectors are used. For retract height, the "R level", as it's called, is returned to if G99 is programmed. |
S | Defines speed, either spindle speed or surface speed depending on mode | Data type = integer. In G97 mode (which is usually the default), an integer after S is interpreted as a number of rev/min (rpm). In G96 mode (CSS), an integer after S is interpreted as surface speed—sfm (G20) or m/min (G21). See also Speeds and feeds. On multifunction (turn-mill or mill-turn) machines, which spindle gets the input (main spindle or subspindles) is determined by other M codes. |
T | Tool selection | To understand how the T address works and how it interacts (or not) with M06, one must study the various methods, such as lathe turret programming, ATC fixed tool selection, ATC random memory tool selection, the concept of "next tool waiting", and empty tools.[5] Programming on any particular machine tool requires knowing which method that machine uses.[5] |
U | Incremental axis corresponding to X axis (typically only lathe group A controls) Also defines dwell time on some machines (instead of "P" or "X"). |
In these controls, X and U obviate G90 and G91, respectively. On these lathes, G90 is instead a fixed cycle address for roughing. |
V | Incremental axis corresponding to Y axis | Until the 2000s, the V address was very rarely used, because most lathes that used U and W didn't have a Y-axis, so they didn't use V. (Green et al. 1996[7] did not even list V in their table of addresses.) That is still often the case, although the proliferation of live lathe tooling and turn-mill machining has made V address usage less rare than it used to be (Smid 2008[5] shows an example). See also G18. |
W | Incremental axis corresponding to Z axis (typically only lathe group A controls) | In these controls, Z and W obviate G90 and G91, respectively. On these lathes, G90 is instead a fixed cycle address for roughing. |
X | Absolute or incremental position of X axis. Also defines dwell time on some machines (instead of "P" or "U"). |
|
Y | Absolute or incremental position of Y axis | |
Z | Absolute or incremental position of Z axis | The main spindle's axis of rotation often determines which axis of a machine tool is labeled as Z. |
Code | Function | Notes |
---|---|---|
G00 | Move in a straight line at rapids speed. | XYZ of endpoint |
G01 | Move in a straight line at last speed commanded by a (F)eedrate | XYZ of endpoint |
G02 | Clockwise circular arc at (F)eedrate | XYZ of endpoint IJK relative to center R for radius |
G03 | Counter-clockwise circular arc at (F)eedrate | XYZ of endpoint IJK relative to center R for radius |
G04 | Dwell: Stop for a specified time. | P for milliseconds X for seconds |
G05 | FADAL Non-Modal Rapids | |
G09 | Exact stop check | |
G10 | Programmable parameter input | |
G15 | Turn Polar Coordinates OFF, return to Cartesian Coordinates | |
G16 | Turn Polar Coordinates ON | |
G17 | Select X-Y plane | |
G18 | Select X-Z plane | |
G19 | Select Y-Z plane | |
G20 | Program coordinates are inches | |
G21 | Program coordinates are mm | |
G27 | Reference point return check | |
G28 | Return to home position | |
G29 | Return from the reference position | |
G30 | Return to the 2nd, 3rd, and 4th reference point | |
G32 | Constant lead threading (like G01 synchronized with spindle) | |
G40 | Tool cutter compensation off (radius comp.) | |
G41 | Tool cutter compensation left (radius comp.) | |
G42 | Tool cutter compensation right (radius comp.) | |
G43 | Apply tool length compensation (plus) | |
G44 | Apply tool length compensation (minus) | |
G49 | Tool length compensation cancel | |
G50 | Reset all scale factors to 1.0 | |
G51 | Turn on scale factors | |
G52 | Local workshift for all coordinate systems: add XYZ offsets | |
G53 | Machine coordinate system (cancel work offsets) | |
G54 | Work coordinate system (1st Workpiece) | |
G55 | Work coordinate system (2nd Workpiece) | |
G56 | Work coordinate system (3rd Workpiece) | |
G57 | Work coordinate system (4th Workpiece) | |
G58 | Work coordinate system (5th Workpiece) | |
G59 | Work coordinate system (6th Workpiece) | |
G61 | Exact stop check mode | |
G62 | Automatic corner override | |
G63 | Tapping mode | |
G64 | Best speed path | |
G65 | Custom macro simple call | |
G68 | Coordinate System Rotation | |
G69 | Cancel Coordinate System Rotation | |
G73 | High speed drilling cycle (small retract) | |
G74 | Left hand tapping cycle | |
G76 | Fine boring cyle | |
G80 | Cancel canned cycle | |
G81 | Simple drilling cycle | |
G82 | Drilling cycle with dwell (counterboring) | |
G83 | Peck drilling cycle (full retract) | |
G84 | Tapping cycle | |
G85 | Boring canned cycle, no dwell, feed out | |
G86 | Boring canned cycle, spindle stop, rapid out | |
G87 | Back boring canned cycle | |
G88 | Boring canned cycle, spindle stop, manual out | |
G89 | Boring canned cycle, dwell, feed out |
Comments
0 comments
Please sign in to leave a comment.