List of G Codes: SR - NO. Code Function 1. 2. 3. 4
List of G Codes: SR - NO. Code Function 1. 2. 3. 4
List of G Codes: SR - NO. Code Function 1. 2. 3. 4
SR.NO.
1.
2.
3.
4.
5.
6.
7.
8.
9
10.
11.
12.
13.
14.
15.
16.
17.
18.
CODE
G00
G01
G02
G03
G04
G20
G21
G28
G32
G70
G71
G72
G73
G74
G90
G92
G96
G97
FUNCTION
RAPID POSITIONING
LINEAR INTERPOLATION
CLOCKWISE CIRCULAR INTERPOLATION
COUNTER CLOCKWISE CIRCULAR
INTERPOLATION
DWELL IN SECONDS
INCH PROGRAMMING
METRIC PROGRAMMING
AUTO. RETURN TO REF. POINT
THREAD CUTTING CYCLE
FINISHING CYCLE
STOCK REMOVAL IN TURNING
STOCK REMOVAL IN FACING
PATTERN REPEATING CYCLE
PECK DRILLING CANNED CYCLE
DIAMETER CUTTING CYCLE
THREADING CANNED CYCLE
CONSTANT SURFACE SPEED ON
CONSTANT SURFACE SPEED OFF
LIST OF M-CODES
SR. NO.
CODE
1.
2.
3.
4.
5.
6.
7.
8.
9.
10
M01
M02
M03
M04
M05
M07
M08
M09
M13
M14
9.
10.
11.
M30
M98
M99
FUNCTION
OPTIONAL PROGRAM STOP
PROGRAM END
SPINDLE START CLOCKWISE
SPINDLE START ANTICLOCKWISE
SPINDLE STOP
COOLANT NO. 1 ON
COOLANT NO. 2 ON
COOLANTS OFF
SPINDLE CLOCKWISE & COOLANT ON
SPINDLE ANTI-CLOCKWISE & COOLANT
ON
PROGRAM END & REWIND
START OF SUBROUTINE
END OF SUBROUTINE
Block number N :
The block number is the first word in a block. The
block number has no influence on the execution of the individual
blocks since they are invoked following the order in which they were
entered into the control.
G Function :
Together with the words for the co-ordinates. This
word essentially determines the geometrical part of the CNC program.
It consists of the address letter G & a 2 digit code.
Co-ordinates X & Z :
The co-ordinates X, Z defines the target points that
are needed to travel.
Interpolation parameters I & K :
The interpolation parameters I, K are used to
define the center of a circle for circular movements.
Feed F :
The speed at which the tool is to be moved is programmed
with the function F. This value in entered in mm/min.
Spindle Speed S :
The function S is for entering the spindle speed. It
can be directly programmed in rotations per minute.
G - CODES
G00 - RAPID TRAVERSE ( Rapid Positioning )
This motion type is used to command motion at the machine's fastest possible rate. It is
used to minimize non-productive time during the machining cycle. Common uses for
rapid motion include positioning the tool to and from cutting positions, moving to clear
clamps and other obstructions, and in general, any non-cutting motion during the
program.
The command almost all CNC machines use to initiate rapid motion is G00. Within the
G00 command, the end point for the motion is given.
The G00 command moves the tool to the position in the work piece coordinate system
with an absolute or incremental format at a rapid traverse rate.
In the Absolute format command, Coordinate value of the end point is programmed. In
Incremental format command, the distance the tool is to be moved is programmed.
In this case last command for respective axis will be considered. i.e. X command will be
ignored and U command will be executed. No Feedrate (F Word) is
required to be programmed as it is taken from internally set values.
Format : G00 X __ Z __
NOTE : The rapid traverse rate in the G00 command is set internally for each axis
drive. In the Positioning mode actuated by G00, the tool is accelerated to a
predetermined speed at the start of block and it is then decelerated at the end of the
block.
Here F is feed rate (tool movement speed) given in mm/min. As this code is used for
cutting operation the value of F is very less that has to be decided according to the
material of job.
The
G21
NOTE : The definition of dimensioning system is to be done only once in the part
program in first block. If it is specified more than one time the preprocessor will
invoke the ERROR ALARM showing that this is the violation of programming
code. It is not possible to switch from G20 to G21 in the program.
Format : G70 P __ Q __
Here ,
P= starting block of the roughing cycle.
Q= end block of roughing cycle.
This cycle is used after G71,G72 & G73 codes. The finishing
allowances values are taken from the above codes.
Here ,
W(d) = Depth of Cut ( For trainer machine it is 1mm).
R(e) = Escaping amount ( After depth of cut, this is the return path
for the tool in X + Direction)
P
= Starting block no. of the program for the required shape
Q
= Final block no. of the program for the required shape
U(u) = Finishing allowance in X direction.
W(w) = Finishing allowance in Z direction.
F
= Feed-rate for cutting.
Format :
Where ,
U(i) = Distance of relief in X direction
This U(i) = (Job. Diameter Min. Diameter in the program) / 2
W(k) = Distance of relief in Z direction
R(d) = No. of divisions for the pattern.
This R = ( U(i) / Max. Depth of Cut) + 1
P
= Starting block no. of the program for the required shape
Q
= Final block no. of the program for the required shape
U(u) = Finishing allowance in X direction.
W(w) = Finishing allowance in Z direction.
F
= Feed-rate for cutting.
Where,
X&Z = Final respective coordinates
Q = Depth of cut.
R = Return amount .
F = Feed in mm/min
where,
X = Threading diameter.
Z = Thread length.
F = Thread Pitch.
NOTE :
While the execution of thread cutting cycle, Spindle Speed is
nonprogrammable, Controller will automatically adjust it to proper value and
after completing the threading operation the original Spindle Speed will be
restored.
Where,
S = Surface speed in meter/min.
G97= This command will cancel the Constant surface speed option
set by the G96 command.
M CODES
M00 PROGRAM HAULT
This command is useful to check the job in between the program. With this
command the axis & the spindle will be stopped. After checking the job parameters rest
program will be executed by pressing the ENTER key. The spindle will be automatically
started with the previous speed.
Format : M00
Format : M01
In this case Auto. Mode Operation will be Stopped. User can continue the Operation
after Pressing the <Enter> Key.
M02 - PROGRAM END
The M02 is used to END the Operation in Auto. Mode. After a block specifying the
end of program is executed, control returns to the start of program.
Format : M02
In this case spindle will start rotating in Clockwise direction with S speed in rpm. Speed
of rotation is specified in S word (i.e. S600). But S word is not mandatory. If not
specified, default maximum speed set internally is used for operation.
M04 - SPINDLE ON ANTICLOCKWISE
This command is used to start the Spindle in anticlockwise Direction.
In this case spindle will start rotating in anticlockwise direction with the S speed..
M05 - SPINDLE STOP
This command is used to STOP the Spindle rotation.
Format : M05
M08 - COOLANT ON
This command is used to ON the Coolant Pump provided. If two pumps are provided,
M08 command will start the Pump
Format : M08
Format : M09
Format :
Where,
P = subroutine repetitions.
R = subroutine label ( alphabetical as well as numerical).
M98 is followed by P i.e. No. of repetitions & then by label which can
be either name or no.
N001 G21
|
|
|
|
|
N040 M98 P1 ABC
N041 G00 X30
|
|
|
N100 M30
ABC
N105 G00 U40 W0
|
|
N135 M98 P1 XYZ
N140 G00 W1
|
|
|
N150 M99
XYZ
N155 G01 U20
|
|
|
|
|
N170 M99