Sunteți pe pagina 1din 23

UMY

CNC/CAM
#3 G Codes Part 1

Tutik Sriani, S.T., M.Eng, PhD

Universitas
Muhammadiyah
Yogyakarta
www.umy.ac.id

1995
1

Word Characters
Address

Definition

Address

Definition

Address if block number

Arithmetic parameter

Preparatory function

Main block

X, Y, Z

Positional data

AX

Axis value (variable axis program)

I, J, K

Interpolation parameters

ACC

Axial acceleration

Feed

FA

Axial feed

Spindle speed

FL

Axial feed limit

Tool number

IP

Interpolation parameter

Tool offset number

OVRA

Axial override

Miscellaneous function

PO

Polynomial coefficient

Auxiliary function

POS

Positioning axis

SPOS/A

Spindle position

POSA

Subprogram call

Positioning axis across block


boundary

Number of program passes

1995
2

Operators
Operator

Definition

Address

Definition

Addition

ROUND()

Round to integer

Subtraction

LN()

Natural logarithm

Multiplication

EXP()

Exponential function

Division (ex: = 0.75)

==

Equal to

Chain operator

<>

Not equal to

Sin()

Sine

>

Greater than

COS()

Cosine

<

Less than

TAN()

Tangent

>=

Greater than or equal to

ASIN()

Arcsine

<=

Less than or equal to

SQRT()

Square root

AND

AND

ABS()

Absolute number

OR

OR

POT()

2nd power (square)

NOT

Negation

XOR

Exclusive OR

TRUNC() Truncate to integer

1995

Some of G Codes for Milling

1995
4

Some of G Codes for Milling

1995
5

Some of G Codes for Turning

1995
6

Some of G Codes for Turning

1995
7

Plane Designation
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 milling and G18 (Z/X plane) is defined for turning.

1995
8

0. Positional Data

Seq.

Code

(0,0) :

G90 (absolute)
G91 (incremental)

or

Dimension:

G20/G70 (imperial) or
G21/G71 (metric)

Explanation

N01

G90 G00 X45 Y60 T1 S2000 M3

Absolute dimensioning, rapid traverse to YZ, tool, spindle


on clockwise

N02

G21 G01 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
9

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!
1995
10

1. G00, Milling Sample


Seq

Code

Explanation

N01 G90 G 21 S400


M3

Absolute dimensioning,
metric, spindle on CW

N02 G00 X30 Y20 Z2

Approach start position

N03 G01 Z-5 F1000

Tool infeed

N04 X80 Y 65

Travel on straight line

N05 G00 Z2

Retract tool

N06 G00 X-20 Y100


Z100 M30

Retract tool, end of


program

1995
11

1. G00, Turning Sample


Seq

Code

Explanation

N01 G90 G21 S400 M3

Absolute dimensioning,
metric, spindle on CW

N02 G00 X25 Z5

Approach start position

N03 G01 G94 Z0


F1000

Tool infeed

N04 G95 Z-7.5 F0.2


N05 X60 Z-35

Travel on straight line

N06 Z-50
N07 G00 X62
N08 G00 X80 Z20

Retract tool

N09 M30

End of program
1995

12

2. G01, Linear Interpolation (Milling)


Program:
G01 X Y Z F
X,Y,Z: endpoint (Cartesian), F = feed-rate (mm/min)
Seq

13

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 G01 Z-2 F40

Tool infeed

N05 X80 Y80 Z-15

Travel along inclined


straight line

N06 G00 Z100 M30

1995
Retract to tool change
location, end of program

2. G01, Linear Interpolation (Straight-Turning)


Seq

Code

Explanation

N01 G90 G21 S400 M3

Absolute dimensioning,
metric, spindle on CW

N02 G00 X25 Z5

Approach start position

N03 G01 G94 Z0


F1000

Tool infeed

N04 G95 Z-7.5 F0.2


N05 X60 Z-35

Travel on straight line

N06 Z-50
N07 G00 X62
N08 G00 X80 Z20

Retract tool

N09 M30

End of program
1995

Class Exercise #1.1-1.2

1995
15

3. G02/G03, Circular Interpolation


Program:

G02
G03
XYZ
IJK

G02/G03 X Y Z I J K

Travel on a circular path in clockwise direction


Travel on a circular path in counterclockwise direction
End point in Cartesian coordinates
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) in
order to calculate the direction of rotation for the circle G02 is
clockwise/G03 is counterclockwise. It is generally advisable to
specify the working plane.
1995
16

3.1 G02/G03 with Center & End Point


MILLING

Incremental mode:
Seq

Code

Explanation

N01 G00 X67.5 Y80.211

Positioning @start point

N02 G03 X17.203


Y38.029 I17.5
J30.211 F500

Infeed CCW, XY @end


point, IJ center point

Absolute mode:
Seq

Code

N01 G00 X67.5 Y80.211

Positioning @start point

N02 G03 X17.203


Y38.029 I=AC(50)
J=AC(50)

Infeed CCW, XY @end


point, IJ center point

Able to mill full circle


17

Explanation

1995

3.1 G02/G03 with Center & End Point


TURNING

Incremental mode:
Seq

Code

Explanation

N01 G00 X12 Z0

Positioning @start point

N02 G01 X40 Z-25 F0.2

Tool infeed

N03 G03 X70 Z-75 I3.335 K-29.25

Tool infeed CCW, XZ


@end point, IK@center

N04 G1 Z-95

Straight turning

Absolute mode:
Seq

Code

Explanation

N01 G00 X12 Z0

Positioning @start
point

N02 G01 X40 Z-25 F0.2

Tool infeed

N03 G03 X70 Z-75


Tool infeed CCW, XZ
I=AC(33.33) K=AC(54.25) @end, IK@center
N04 G01 Z-95

1995

Straight turning

3.2 G02/G03 with Radius & End Point


MILLING

Seq

Code

N01 G00 X67.5 Y80.211

Positioning @start point

N02 G03 X17.203


Y38.029 CR=34.913
F500

Infeed CCW, XY @end


point, circle radius value

Can not mill full circle


19

Explanation

1995

3.2 G02/G03 with Radius & End Point


TURNING

Seq

Code

Explanation

N01 G00 X12 Z0

Positioning @start point

N02 G01 X40 Z-25 F0.2

Tool infeed

N03 G03 X70 Z-75


CR=30

Tool infeed CCW, XZ


@end point, radius value

N04 G01 Z-95

Straight turning

1995
20

3.3 G02/G03 with Arc Angle & End Point/Center Point


MILLING

Seq

Code

Explanation

N01 G00 X67.5 Y80.211

Positioning @start point

N02 G03 X17.203


Y38.029
AR=140.134 F500

Infeed CCW, XY @end


point, arc angle value

Seq

Code

Explanation

N01 G00 X67.5 Y80.211

Positioning @start point

N02 G03 I17.5 J30.211


AR=140.134 F500

Infeed CCW, IJ @center


point, arc angle value
1995

21

3.3 G02/G03 with Arc Angle & End Point/Center Point


TURNING

Seq

Explanation

N01 G00 X12 Z0

Positioning @start point

N02 G01 X40 Z-25 F0.2

Tool infeed

N03 G03 X70 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 G03 I-3.335 K-29.25


AR=135.944

Tool infeed CCW, IK


@center point, arc angle

Seq

22

Code

Code

Explanation

N01 G00 X12 Z0

Positioning @start

N02 G01 X40 Z-25 F0.2

Tool infeed

N03 G03 I=AC(33.33)


K=AC(-54.25)
AR=135.944

1995 IK
Tool infeed CCW,
@center point

Class Exercise #1.3-1.4

1995
23

S-ar putea să vă placă și