Preparatory Functions
The preparatory functions are denoted by the word address 'G'. This function principally controls the geometric functions of the controller. Thus, it is mostly associated with the control of the axes. These are also called as G codes. It generally has two digits, e.g. G01, G42, and G90 as per ISO specifications. Many of the current day controllers have extended this to 3 or 4 digits. Most of these functions are standardized by ISO as follows:
Code Function
G00 Point-to-point positioning, rapid traverse
G01 Line interpolation
G02 Circular interpolation, clockwise (CW)
G03 Circular interpolation, anti-clockwise (CCW) G04 Dwell
G05 Hold/Delay
G06 Parabolic interpolation
G07 Unassigned
G08 Acceleration of feed rate
G09 Deceleration of feed rate
G10 Linear interpolation for "long dimensions" (10 inches-100 inches)
G11 Linear interpolation for "short dimensions" (up to 10 inches)
G12 Unassigned
G13-G16 Axis designation
G17 XY plane designation
G18 ZX plane designation
G19 YZ plane designation
G20 Circular interpolation, CW for "long dimensions"
G21 Circular interpolation, CW for "short dimensions"
G22-G29 Unassigned
G30 Circular interpolation, CCW for "long dimensions"
G31 Circular interpolation, CCW for "short dimensions"
G32 Unassigned
G33 Thread cutting, constant lead
G34 Thread cutting, linearly increasing lead
G35 Thread cutting, linearly decreasing lead
G36-G39 Unassigned
G40 Cutter compensation-cancels to zero
G41 Cutter radius compensation - offset left
G42 Cutter radius compensation - offset right
G43 Cutter length compensation - positive
G44 Cutter length compensation-negative
G45-G52 Unassigned
G53 Deletion of zero offset
G54-G59 Datum point/zero shift
G60 Target value, positioning tolerance 1
G61 Target value, positioning tolerance 2, or loop cycle
G62 Rapid traverse positioning
G63 Tapping cycle
G64 Change in feed rate or speed
G65-G69 Unassigned
G70 Dimensioning in inch units
G71 Dimensioning in metric units
G72-G79 Unassigned
G80 Canned cycle cancelled
G81-G89 Canned drilling and boring cycles
G90 Specifies absolute input dimensions
G91 Specifies incremental input dimensions
G92 Programmed reference point shift
G93 Unassigned
G94 Feed rate/min (inch units when combined with G70)
G95 Feed rate/rev (metric units when combined with G71)
G96 Spindle feed rate for constant surface feed
G97 Spindle speed in revolutions per minute
G98-G99 Unassigned
Most of the G codes are modal in nature, so that they need not be repeated in every block. Another point to be noted with these codes is that the G codes are divided into various groups depending upon their functionality. It is expected that only one code from each of the group should be given in any given block. It is generally possible to include more than one G address in one block, provided these functions are not mutually exclusive. In Fanuc controls upto 5 G codes can be given in one block. Some other controls have different limits, but generally upto 3 codes in a single block will be permissible.
It should also be noted that some of the G codes remain in force when the control is started or reset. These are termed as default or turn on codes. Though it is a prudent practice, to specify all the necessary G codes while writing the programs, some times it may be possible by the experienced programmers to take advantage of these default codes and reduce the length of the program.