Download - G-Code instructions
-
8/20/2019 G-Code instructions
1/55
Introduction to G-Code
ProgrammingComputer Integrated Manufacturing
Unit 2: CNC Machining
-
8/20/2019 G-Code instructions
2/55
In this lesson:
Review Coordinate Geometry Basics
Identify common Terminoogy!"amine G and M # Code anguage
$rovide opportunities for Review and$ractice
-
8/20/2019 G-Code instructions
3/55
Rectangular Coordinate System
%#a"is
a"is
'rigin
()2* inch spacing
+ ,%-&.
,)-(/0*.
-
8/20/2019 G-Code instructions
4/55
,)(111-)(111.,#)()2*-(2*.
,#(30*-#(*11.
,(0*1-#)(111.
Ordered Pairs +
B
C
4
-
8/20/2019 G-Code instructions
5/55
3D Coordinate System (X,,!"
%#a"is
5#
a"isa"is
-
8/20/2019 G-Code instructions
6/55
#asic $achine %&es: 3 a&is
Miing Machines: 3 a"is
% 6 a"is ,ta7e eft and
right.& 6 a"is ,ta7e in and out.
5 6 a"is ,usuay the
spinde a"is.
-
8/20/2019 G-Code instructions
7/55
%dditional %&es
+ 6 a"is ,anguar a"is a7out % # a"is.
B 6 a"is ,anguar a"is a7out & 6 a"is.
C 6 a"is ,anguar a"is a7out 5 6 a"is.
U 6 a"is ,secondary a"is parae to %.8 6 a"is ,secondary a"is parae to &.
9 6 a"is ,secondary a"is parae to 5.
-
8/20/2019 G-Code instructions
8/55
$illing $achines: ' a&is
-
8/20/2019 G-Code instructions
9/55
erminology
NC 6 Numerica Contro
CNC 6 Computer Numerica Contro
4NC 6 4irect Numerica Contro +$T 6 +utomatic $rogrammed Too
C+4 6 Computer +ided 4esign
C+M 6 Computer +ided Manufacturing
CIM 6 Computer Integrated Manufacturing
-
8/20/2019 G-Code instructions
10/55
Do)nload Code Sheet
Cic here to open Code ;heet
-
8/20/2019 G-Code instructions
11/55
G - Code Programming
G 6 Code $rogramming
'riginay caed the uentiay(
-
8/20/2019 G-Code instructions
12/55
Common *ormat o+ a #loc
;e>uence
?
$reparatory
@unction
4imension
9ords
@eed
Rate
;pinde
@unction
Too
@unction
Misc(
@unction
N*1 GA1 G1) %)(1&2(2* @)1 ;)*11 T1) M13
Individua 9ords
-
8/20/2019 G-Code instructions
13/55
ord %ddress .
N 6 ;e>uence or ine num7er
+ tag that identifies the 7eginning of a 7oc ofcode( It is used 7y operators to ocate specific
ines of a program when entering data or verifyingthe program operation(
G 6 $reparatory functionG words specify the mode in which the miingmachine is to move aong its programmed a"es(
ResN 6 ;
G 6 $r
Dim% 6
& 6
5 6
-
8/20/2019 G-Code instructions
14/55
ord %ddress 0
4imension 9ords
% 6 4istance or position in % direction
& 6 4istance or position in & direction
5 6 4istance or position in 5 direction
M 6 Misceaneous functions
M words specify CNC machine functions notreated to dimensions or a"ia movements(
-
8/20/2019 G-Code instructions
15/55
@ 6 @eed rate ,inches per minute or miimeters perminute.
Rate at which cutting too moves aong an a"is(
; 6 ;pinde speed ,rpm 6 revoutions per minute.
Contros spinde rotation speed(
T 6 Too num7er
;pecifies too to 7e seected(
ord %ddress 3
-
8/20/2019 G-Code instructions
16/55
I 6 Circuar cutting reference for " a"is
6 Circuar cutting reference for y a"is
D 6 Circuar cutting reference for E a"is
ord %ddress '
-
8/20/2019 G-Code instructions
17/55
G ord
G words or codes te the machine to
perform certain functions( Most G
words are moda which means theyremain in effect unti repaced 7y
another moda G code(
-
8/20/2019 G-Code instructions
18/55
Common G Codes
G11 6 Rapid positioning mode
Too is moved aong the shortest route toprogrammed %-&-5 position( Usuay N'Tused for cutting(
G1) 6 Finear Interpoation mode
Too is moved aong a straight#ine path at
programmed rate of speed(
G12 6 Circuar motion cocwise ,cw.
G13 6 Circuar motion counter cocwise
,ccw.
-
8/20/2019 G-Code instructions
19/55
Common G Codes, con1,
G)0 6 %& pane
G)/ 6 %5 pane
G)A 6 &5 pane
G21 6 Inch Mode
G2) 6 Metric ModeG2/ 6 Return to a"is machine 5ero
,ome.
-
8/20/2019 G-Code instructions
20/55
G Codes: G2, G2.
GA1 6 +7soute Coordinate Reference
References the ne"t position from an a7souteEero point which is set once for the entire
program(
GA) 6 Incrementa Coordinate Reference
References the ne"t position from the previous
position(
-
8/20/2019 G-Code instructions
21/55
G Codes: Canned Cycles
G/1 6 Cance canned cyce
G/) 6 4riing cyce
G/3 6 $ec driing cyceG/ 6 Tapping cyce
G/* 6 Boring cyce
G/ 6 Boring cyce
N'T!: + canned cyce stays in effect unticanceed 7y a G/1(
-
8/20/2019 G-Code instructions
22/55
Canned Cycles: G4.
G/) 6 4riing Cyce
@eed to depth- rapid return
!"ampe of program code:
N3* G/) %(*11&(*115#)(111 R()11 @)(*1
N3 %)(111&)(*11
N30 %)(*11&2(111
N3/ G/1
-
8/20/2019 G-Code instructions
23/55
Canned Cycles: G43, G4'
G/3 6 $ec 4riing Cyce
@eed to an intermediate depth- rapid out- rapid7ac to Hust a7ove previous depth- feed to ne"t
depth- rapid out- repeat unti reaching fu depth(
G/ 6 Tapping Cyce
This cyce creates interna threads in an e"istinghoe( N'T!: 'ne cannot over#ride the feed rate(
-
8/20/2019 G-Code instructions
24/55
Canned Cycles: G45, G46
G/* # Boring Cyce
@eed to depth- feed 7ac out(
G/ 6 Boring Cyce
@eed to depth- rapid out(
-
8/20/2019 G-Code instructions
25/55
G Codes: Cutter Com7ensation
G1 6 Cance cutter diameter
compensation(
G) 6 Cutter compensation eft(
G2 6 Cutter compensation right(
-
8/20/2019 G-Code instructions
26/55
$ ord
M words te the machine to perform
certain machine reated functions-
such as: turn spinde onoff- cooantonoff- or stopend program(
Pro+essional De/elo7ment ID Code: 66
-
8/20/2019 G-Code instructions
27/55
Common $ )ords
M11 6 $rogrammed pause
+utomaticay stops machine unti operator pushes a 7utton toresume program(
M1) 6 'ptiona stop
+ stop acted upon 7y the machine when operator hassignaed this command 7y pushing a 7utton(
M12 6 !nd of program
;tops program when a ines of code are competed( Must 7east command in program(
-
8/20/2019 G-Code instructions
28/55
M13 6 Turn spinde on In cocwise direction
M1 6 Turn spinde on In counter cocwise direction
M1* 6 ;top spinde
Usuay used prior to too change or at end of program(
M1 6 Too change;tops program and cas for a too change- eitherautomaticay or manuay(
Common $ )ords
-
8/20/2019 G-Code instructions
29/55
M1/ 6 Turns +ccessory ) on(
M1A 6 Turns +ccessory ) off(
M)1 6 Turns +ccessory 2 on(
M)) 6 Turns +ccessory 2 off(
M31 6 !nd of program
;imiar to M12 7ut M31 wi aso
-
8/20/2019 G-Code instructions
30/55
!ero Points
$art 5ero 6 Used for a7soute programming mode(
6Usuay a position on the part that a a7soutecoordinates are referenced to(
6 Changes with different parts and programs(
Machine 5ero or Machine ome $osition 6 @i"ed for each machine from the manufacturer( 6 Not changea7e(
-
8/20/2019 G-Code instructions
31/55
Cutter Path Generation
Cutter path is generated 7y moving the
too from point to point( The points are
previousy defined from the partdrawing dimensions(
!ach ine of code wi show the
destination point of where the too wi
go to(
-
8/20/2019 G-Code instructions
32/55
Inter7olation
Method of determining intermediate
points aong a cutting path(
Two methods:J Finear interpoation 6 cut a path aong a
specified ange at a specified feed rate(
J Circuar interpoation 6 cut a path aong an arc
or circe at a specified feed rate(
-
8/20/2019 G-Code instructions
33/55
%&is mo/ements: Caution8
Mutipe a"is movements are possi7e(
-
8/20/2019 G-Code instructions
34/55
9&am7le .: C #loc
-
8/20/2019 G-Code instructions
35/55
o7 ;ie) C #loc()2* GRI4
;$+C!;
'rigin,1-1.
-
8/20/2019 G-Code instructions
36/55
Do)nload orsheet
Cic here to open $ractice !"ercises
-
8/20/2019 G-Code instructions
37/55
orsheet Pro
-
8/20/2019 G-Code instructions
38/55
Pause =esson
-
8/20/2019 G-Code instructions
39/55
9&am7le .: Program C
N1) GA1 G/1 T11
N12 G11 %1 &3(111 5)(111
N13 M13 ;)111
-
8/20/2019 G-Code instructions
40/55
9&am7le .: Program C
N1) GA1 G/1 T11
N12 G11 %1 &3(111 5)(111
N13 M13 ;)111
N1 %(30* &(2*1 5)(111
N1* 5()11
N1 G1) 5#()11 @*(11
N10 &)(0*1
-
8/20/2019 G-Code instructions
41/55
9&am7le .: Program cont>d
N1/ %)(2*1 &(2*1
N1A &)(0*1
N)1 G11 5()11
N)) %2(2* &(*11
N)2 G') 5#()11N)3 %2(30* &2(*1
N) %2(111
-
8/20/2019 G-Code instructions
42/55
9&am7le .: Program cont>d
N)* %)(0*1 &(*11
N) &)(*11
N)0 %2(111 &)(0*1
N)/ %2(30*
N)A %2(2* &)(*11
-
8/20/2019 G-Code instructions
43/55
9&am7le ., con1,
N21 G11 5)(111
N2) %1 &3(111
N22 M1*
N23 M31
-
8/20/2019 G-Code instructions
44/55
9&am7le 0: P= #loc
-
8/20/2019 G-Code instructions
45/55
orsheet Pro
-
8/20/2019 G-Code instructions
46/55
9&am7le 0: o7 ;ie)
'rigin
+, -
.
!, -
.
4, -
.
C, -
.
B, -
.
I, - .
, -
.
G, - .
@, -.
(2*1 Grid ;pace
F, -
.
D, -.
, - .
$, -
.
', -
.
N, -
.
M, -
.
L, -
.
-
8/20/2019 G-Code instructions
47/55
Pause =esson
-
8/20/2019 G-Code instructions
48/55
9&am7le 0: P=
N1) GA1 G/1 T1)
N12 G11 %1 &1 5)(111
N13 M13 ;)111N1 %(0*1 &(*11 5)(111
N1* 5()11
N1 G1) 5#(2*1 @*(11
N10 &2(*11
-
8/20/2019 G-Code instructions
49/55
9&am7le 0: P= cont>d
N1/ %)(2*1
N1A G12 %)(2*1 &)(*11 I)(2*1 2(111
N)1 G1) %(0*1N)) G11 5()11
N)2 %2(2*1 &2(*11
N)3 G1) 5#(2*1
N) &(*11
-
8/20/2019 G-Code instructions
50/55
9&am7le 0: Program cont>d
N)* %3(2*1
N) G11 5()11
N)0 %(111
N)/ G1) 5#(2*1
N)A &2(*11N21 %3(*11
N2) %(*11
-
8/20/2019 G-Code instructions
51/55
9&am7le 0: P= cont>d
N22 G11 5()11
N23 %*(111 &2(*11
N2 G1) 5#(2*1
N2* %*(*11 &(*11
N2 %*(0*1 &)(*11N20 %(111 &(*11
N2/ %(*11 &2(*11
-
8/20/2019 G-Code instructions
52/55
9&am7le 0: P= cont>d
N2A G11 5)(111
N31 %1 &1
N3) M1*
N32 M31
-
8/20/2019 G-Code instructions
53/55
Curriculum %lignment:
Unit 2: CNC Machining
;ection 2(3 6 CNC Machining
$ower$oint 6 Introduction to CNC
$ower$oint 6 CNC $rogramming
-
8/20/2019 G-Code instructions
54/55
Re+erences:
'7erg- !( ones @( 4( orton- ( F( Ryffe-
( ( ,2111.( Machinery’s Handbook, 26 th
ed., New &or- N&: Industria $ress Inc(
8aentino- (8( Goden7erg- ( ,2113.(
Introduction to Computer Numerical Control
(CNC), rd ed (- Upper ;adde River- N: $rentice
a
-
8/20/2019 G-Code instructions
55/55
Credits:
9riter: Bo7 +rrendondo
Content !ditor: 4onna !( ;cri7ner
Narration: 4onna !( ;cri7ner
$FT9 !ditor: !d ughes
$roduction: C +marosa
8ideo $roduction: C +marosa
+udio: C +marosa
$roHect Manager: 4onna !( ;cri7ner