3 g codes part 1 cnc
TRANSCRIPT
-
8/10/2019 3 G Codes Part 1 CNC
1/23
1995
UMY
UniversitasMuhammadiyah
Yogyakarta
www.umy.ac.id
CNC/CAM#3 G Codes Part 1
Tutik Sriani, S.T., M.Eng, PhD
1
-
8/10/2019 3 G Codes Part 1 CNC
2/23
1995
Word Characters
2
Address DefinitionN Address if block number
G Preparatory function
X, Y, Z Positional data
I, J, K Interpolation parameters
F Feed
S Spindle speed
T Tool number
D Tool offset number
M Miscellaneous function
H Auxiliary function
SPOS/A Spindle position
L Subprogram call
P Number of program passes
Address DefinitionR Arithmetic parameter
: Main block
AX Axis value (variable axis program)
ACC Axial acceleration
FA Axial feed
FL Axial feed limit
IP Interpolation parameter
OVRA Axial override
PO Polynomial coefficient
POS Positioning axis
POSA Positioning axis across block
boundary
-
8/10/2019 3 G Codes Part 1 CNC
3/23
1995
Operators
3
Operator Definition
+ Addition
- Subtraction
* Multiplication
/ Division (ex: = 0.75): Chain operator
Sin() Sine
COS() Cosine
TAN() Tangent
ASIN() Arcsine
SQRT() Square root
ABS() Absolute number
POT() 2ndpower (square)
TRUNC() Truncate to integer
Address Definition
ROUND() Round to integer
LN() Natural logarithm
EXP() Exponential function
== Equal to Not equal to
> Greater than
< Less than
>= Greater than or equal to
-
8/10/2019 3 G Codes Part 1 CNC
4/23
1995
Some of G Codes for Milling
4
-
8/10/2019 3 G Codes Part 1 CNC
5/23
1995
Some of G Codes for Milling
5
-
8/10/2019 3 G Codes Part 1 CNC
6/23
1995
Some of G Codes for Turning
6
-
8/10/2019 3 G Codes Part 1 CNC
7/23
1995
Some of G Codes for Turning
7
-
8/10/2019 3 G Codes Part 1 CNC
8/23
1995
Plane Designation
8
It is advisable to define the working plane at the beginning of the program. The working
plane must be specified when the tool path compensation G41/G42 is called so that the
control can correct the tool length and radius. In the initial setting, G17(X/Y plane) is defined
for millingand G18(Z/X plane) is defined for turning.
-
8/10/2019 3 G Codes Part 1 CNC
9/23
1995
0. Positional Data
9
Seq. Code Explanation
N01 G90G00 X45 Y60 T1 S2000 M3 Absolute dimensioning, rapid traverse to YZ, tool, spindle
on clockwise
N02 G21G01 Z-5 F500 Enter positions in metric (mm), tool infeed
N03 G02 X20 Y35 I=AC(45) J=AC(35) Circle center point in absolute dimensions
(0,0) : G90(absolute) or
G91(incremental)
Dimension: G20/G70(imperial) or G21/G71(metric)
-
8/10/2019 3 G Codes Part 1 CNC
10/23
1995
1. G00, Rapid Traverse Movement
Program: G0 X Y Z
X,Y,Z: endpoint in Cartesian coordinates
G00 is used for approaching starting positions or tool
change locations, retracting the tool, etc.
Use the rapid traverse movements to position the tool
rapidly, to travel round the workpiece or to approach tool
change locations. This function is not suitable for workpiece machining!
10
-
8/10/2019 3 G Codes Part 1 CNC
11/23
1995
1. G00, Milling Sample
11
Seq Code Explanation
N01 G90 G 21 S400
M3
Absolute dimensioning,
metric, spindle on CW
N02 G00X30 Y20 Z2 Approach start position
N03 G01 Z-5 F1000 Tool infeed
N04 X80 Y 65 Travel on straight line
N05 G00Z2 Retract tool
N06 G00X-20 Y100
Z100 M30
Retract tool, end of
program
-
8/10/2019 3 G Codes Part 1 CNC
12/23
1995
1. G00, Turning Sample
12
Seq Code Explanation
N01 G90 G21 S400 M3 Absolute dimensioning,
metric, spindle on CW
N02 G00X25 Z5 Approach start position
N03 G01 G94 Z0F1000
Tool infeed
N04 G95 Z-7.5 F0.2
N05 X60 Z-35 Travel on straight line
N06 Z-50
N07 G00X62
N08 G00X80 Z20 Retract tool
N09 M30 End of program
-
8/10/2019 3 G Codes Part 1 CNC
13/23
1995
2. G01, Linear Interpolation (Milling)
Program: G01 X Y Z F
X,Y,Z: endpoint (Cartesian), F = feed-rate (mm/min)
1313
Seq Code Explanation
N01 G90 G21 Absolute dimensioning,
metric
N02 G17 S400 M3 Select working plane
(X/Y), spindle CW
N03 G00 X20 Y20 Z2 Approach start position
N04 G01Z-2 F40 Tool infeed
N05 X80 Y80 Z-15 Travel along inclined
straight line
N06 G00 Z100 M30 Retract to tool change
location, end of program
-
8/10/2019 3 G Codes Part 1 CNC
14/23
1995
2. G01, Linear Interpolation (Straight-Turning)
Seq Code Explanation
N01 G90 G21 S400 M3 Absolute dimensioning,
metric, spindle on CW
N02 G00X25 Z5 Approach start position
N03 G01G94 Z0F1000
Tool infeed
N04 G95Z-7.5 F0.2
N05 X60 Z-35 Travel on straight line
N06 Z-50
N07 G00X62
N08 G00X80 Z20 Retract tool
N09 M30 End of program
-
8/10/2019 3 G Codes Part 1 CNC
15/23
1995
Class Exercise #1.1-1.2
15
-
8/10/2019 3 G Codes Part 1 CNC
16/23
1995
3. G02/G03, Circular Interpolation
Program: G02/G03 X Y Z I J K
G02 Travel on a circular path in clockwise direction
G03 Travel on a circular path in counterclockwise direction
X Y Z End point in Cartesian coordinates
I J K Circle center point in Cartesian coordinates (in X,Y,Z)
Enables machining full circle/arc.
The control needs the working plane parameter (G17 to G19) inorder to calculate the direction of rotation for the circle G02 isclockwise/G03 is counterclockwise. It is generally advisable tospecify the working plane.
16
-
8/10/2019 3 G Codes Part 1 CNC
17/23
1995
3.1 G02/G03 with Center & End Point
17
Seq Code Explanation
N01 G00 X67.5 Y80.211 Positioning @start point
N02 G03X17.203Y38.029 I17.5
J30.211 F500
Infeed CCW, XY @endpoint, IJ center point
Incremental mode:
Absolute mode:
Seq Code Explanation
N01 G00 X67.5 Y80.211 Positioning @start point
N02 G03X17.203
Y38.029 I=AC(50)
J=AC(50)
Infeed CCW, XY @end
point, IJ center point
Able to mill full circle
MILLING
-
8/10/2019 3 G Codes Part 1 CNC
18/23
1995
3.1 G02/G03 with Center & End PointTURNING
Seq Code Explanation
N01 G00 X12 Z0 Positioning @start point
N02 G01 X40 Z-25 F0.2 Tool infeed
N03 G03X70 Z-75 I-3.335 K-29.25
Tool infeed CCW, XZ@end point, IK@center
N04 G1 Z-95 Straight turning
Incremental mode:
Absolute mode:
Seq Code Explanation
N01 G00 X12 Z0 Positioning @startpoint
N02 G01 X40 Z-25 F0.2 Tool infeed
N03 G03X70 Z-75
I=AC(33.33) K=AC(54.25)
Tool infeed CCW, XZ
@end, IK@center
N04 G01 Z-95 Straight turning
-
8/10/2019 3 G Codes Part 1 CNC
19/23
1995
3.2 G02/G03 with Radius & End Point
1919
Seq Code Explanation
N01 G00 X67.5 Y80.211 Positioning @start point
N02 G03X17.203Y38.029 CR=34.913
F500
Infeed CCW, XY @endpoint, circle radius value
Can not mill full circle
MILLING
-
8/10/2019 3 G Codes Part 1 CNC
20/23
-
8/10/2019 3 G Codes Part 1 CNC
21/23
1995
3.3 G02/G03 with Arc Angle & End Point/Center Point
21
Seq Code Explanation
N01 G00 X67.5 Y80.211 Positioning @start point
N02 G03X17.203Y38.029
AR=140.134 F500
Infeed CCW, XY @endpoint, arc angle value
Seq Code Explanation
N01 G00 X67.5 Y80.211 Positioning @start point
N02 G03I17.5 J30.211
AR=140.134 F500
Infeed CCW, IJ @center
point, arc angle value
MILLING
-
8/10/2019 3 G Codes Part 1 CNC
22/23
1995
3.3 G02/G03 with Arc Angle & End Point/Center Point
22
TURNINGSeq Code Explanation
N01 G00 X12 Z0 Positioning @start point
N02 G01 X40 Z-25 F0.2 Tool infeed
N03 G03X70 Z-75
AR=135.944
Tool infeed CCW, XZ
@end point, arc angle
Seq Code Explanation
N01 G00 X12 Z0 Positioning @start point
N02 G01 X40 Z-25 F0.2 Tool infeed
N03 G03I-3.335 K-29.25
AR=135.944
Tool infeed CCW, IK
@center point, arc angle
Seq Code Explanation
N01 G00 X12 Z0 Positioning @start
N02 G01 X40 Z-25 F0.2 Tool infeed
N03 G03I=AC(33.33)
K=AC(-54.25)AR=135.944
Tool infeed CCW, IK
@center point
-
8/10/2019 3 G Codes Part 1 CNC
23/23
1995
Class Exercise #1.3-1.4
23