You are on page 1of 69

TS. NGUY!

N TR"#NG PHI
CAD/CAM/CNC
B! mn Cng Ngh" CTM
Vi"n C# kh
$HBK H N!i
CH%&NG TRNH H'C
! Computer-Aided Design (Auto
CAD, SolidWork, Pro
Engineer)
! Computer-Aided Manufacturing
(Master CAM)
! Computer Numerical Control
(Fanuc Series 21)
GI(I THI)U CHUNG

CAD + CAE
Figure 1.1 Product Design Cycle
Once the conceptual design has been developed, the analysis subprocess
begins with analysis and optimization of the design. An analysis model is derived
first because the analysis subprocess is applied to the model rather than the
design itself. Despite the rapid growth in the power and availability of computers
in engineering, the abstraction of analysis models will still be with us for the
foreseeable future. The analysis model is obtained by removing from the, design
unnecessary details, reducing dimensions, and recognizing and employing
symmetry. Dimensional reduction, for example, implies that a thin sheet of
material is represented by an equivalent surface with a thickness attribute or that
a long slender region is represented by a line having cross-sectional properties.
Bodies with symmetries in their geometry and loading are usually analyzed by
considering a portion of the model. In fact, you have already practiced this
abstraction process naturally when you analyzed a structure in an elementary
Chu trnh s*n ph+m
GI(I THI)U CHUNG
Dng thng tin trong mi tr,-ng CIM (Computer-integrated manufacturing)

Further, they suggest that these activities in turn feed information, together with
bill of materials information, from CAD, into an activity called computer aided
production management (CAPM). All of these manufacturing activities are
integrated through the use of computer aids and a shared database. They are
collectively known in industry as CIM, and they can be summarised in a graphical
format as shown in Figure 16.8. The computer aids the interface between design
and manufacture through the interaction between CAD and CAM, by developing
computer aided process plans. There are problems with this approach: computer
plans are trying to generate and automate process plans for manufacturing, while
the ideal scenario would be to automate the techniques of design for
manufacture and design for assembly in the CAPP system. Examples are
techniques for product/process analysis that gives the manufacturer an influence
or input into the design. CAPP systems constitute both process planning and
product/process analysis with influences from CAD and CAM.


CIM Environment
CAD
CAPP
CAM
CAPM
Geometry
Routes
G
e
o
m
e
t
r
y
B
i
l
l

o
f

m
a
t
e
r
i
a
l
s
P
r
i
o
r
i
t
y
Market
needs
Manufacturing
strategy
Manufacturing
cell capability
profile
Cell capacity
profile
Manufacturing

Figure 16.8: Data Exchange in a CIM Environment

KEYPOINT
Computer-integrated manufacturing (CIM) includes all of the engineering
functions of CAD/CAM, but it also includes the firms business functions that are
related to manufacturing.
END KEYPOINT

Comparing the scope of CIM to the more limited scope of CAD/CAM, is
instructive (see Figure 16.9). The ideal CIM system applies computer and
communications technology to all the operational functions and information
processing functions in manufacturing, from order receipt through design and
production, to product shipment. CAD/CAM, on the other hand, is not so all-
embracing, and does not cover what may loosely be termed the business
GI(I THI)U CHUNG
V. tr c/a CAD/CAM
trong h" th0ng CIM
functions of the factory. Thus, at higher levels, CIM subsumes CAD/CAM, and
adds functions of its own.


Figure 16.9: The scope of CAD/CAM and CIM

KEYPOINT
CIM has a wider scope than CAD/CAM, so that at higher levels CIM subsumes
CAD/CAM and adds functions of its own.
END KEYPOINT

A specific examination of the computerized elements of a CIM system may also
be analysed (see Figure 16.10). Here we can see the elements of CAD and CAM
being captured within the CIM remit, at different stages of design and
manufacturing. CIM adds a series of computerized business systems that
account for peripheral elements entering and exiting the manufacturing system,
proper. Customer orders are initially logged by an order entry system, with
product specifications being derived from this, and acting as initial input to the
design function, where CAD functions may occur. The output of the design
department, in its turn, serves as input to manufacturing engineering at both
control and planning levels, and both product and process planning is performed
in detail. Full implementation of CIM results in the automation of the information
flow through every aspect of the companys organization. During the process,
accounting and payroll activities ensure that personnel, product and production
considerations are fully in line with planned expenditure; while at process end,
customer billing completes the operation of the CIM architecture.

CAD
Thi1t k1?
Ch!c
n"ng
Thi$t k$
V&t th'
$i2u khi3n
Gi4
Di chuy3n
B*o v"
L,u tr4
Quy1t 5.nh cc qu trnh hnh
thnh v6t th3
Hnh dng
Ch7c n8ng
Kch th,9c
Thi1t k1 l t6p h:p cc quy1t
5.nh c/a qu trnh hnh thnh
v6t th3 nh;m th<c hi"n cc ch7c
n8ng theo yu c=u c/a ng,-i s>
d?ng.
CAD
Qu trnh thi1t k1 s*n ph+m
1. Yu c=u c/a s*n ph+m
2. Thi1t k1 cc ch7c n8ng
3. Thi1t k1 s# b!
4. $.nh d@ng thi1t k1
5. Phn tch, 5nh gi, t0i ,u thi1t k1
6. Thi1t k1 chi ti1t

CAD
$.nh gi qu trnh thi1t k1
CAD
Tc 5!ng c/a thi1 k1 51n chi ph s*n xuAt
CAD
$nh gi thi1t k1
R!t t"t Khng t"t Khng bi$t
C lm vi(c )ng
ch!c n"ng khng
98 1 1
Tu*i th+ 95 3 2
D, s-a ch.a 93 6 1
B/t m/t 58 39 3
Tch h0p cng ngh(
m!i nh1t
57 39 4
S2 l30ng ch!c n"ng 48 47 5
CAD
Cng nghi"p thi1t k1
CAD
V d? cc s*n ph+m thi1t k1 cng nghi"p
CAD
Cc ph,#ng php thi1t k1 m hnh
1. Mi tr,-ng thi1t k1 2D
- $,-ng thBng
- Cung
- $,-ng trn
- Rnh then
2. Mi tr,-ng thi1t k1 3D
- Khung dy
- MCt phBng
- Kh0i 5Cc
CAD
CAM
III. CNC
! 3.1. L.ch s> pht tri3n
! 3.2. TDng quan cc h" th0ng 5i2u khi3n s0
! 3.3. Cc 5Cc tr,ng c/a my CNC
! 3.4. L6p trnh gia cng trn my CNC
3.1. LECH SF PHT TRIGN
John T.Parsons
1913-2007
First CNC machine at MIT (1951~1953)
1
N C
1 9 6 0 9 5 0 1 9 7 0 1 9 8 0 1 9 9 0
C N C
F M S
C A D
C A D / C A M
C I M
3.1. LECH SF PHT TRIGN
3.2. CC H) THHNG $IIU KHIGN SH
Hnh trnh 5i2u khi3n theo s0
MJi thng tin 7n v9i m!t d.ch chuy3n gin 5o@n c/a
c# cAu chAp hnh (L=q.N)
Cc thnh ph=n c# b*n: Ch,#ng trnh, h" th0ng 5i2u
khi3n, my cng c?
3.2. CC H) THHNG $IIU KHIGN SH
a. H! NC (Numerical Control)
$#n gi*n v9i s0 l,:ng knh thng tin h@n ch1
Thng s0 hnh hKc, l"nh 5i2u khi3n cho d,9i d@ng cc
con s0.
ML my: 2 l"nh 5,:c 5Kc vo RAM, l"nh th7 ti1p theo
5Kc vo RAM khi l"nh tr,9c gi*i phng
Gia cng chi ti1t ti1p theo 5Kc l@i ton b! l"nh, c th3
gCp sai st do b! tnh ton!ph1 ph+m
Dng b8ng 5?c lJ, b8ng tM !dMng ch,#ng trnh
Thi1t b. nh9 cNng k2nh: cu!n giAy,

3.2. CC H) THHNG $IIU KHIGN SH
a. H! NC (Numerical Control)


3.2. CC H) THHNG $IIU KHIGN SH
b. H! DNC (Direct Numerical Control)


3.2. CC H) THHNG $IIU KHIGN SH
c. H! CNC (Computer Numerical Control)
Tch h:p my tnh
Thay 5Di nhanh ch,#ng trnh
CTGC 5,:c ghi l@i: 5Oa tM
CTGC n@p vo cng 1 lc hay tMng l"nh
L"nh 5i2u khi3n vi1t cho nhi2u chuy3n
5!ng cng lc !gi*m cu l"nh !nng
cao 5! tin c6y lm vi"c
Kch th,9c nhP h#n, gi thAp h#n


3.2. CC H) THHNG $IIU KHIGN SH
d. H! DNC (Distributed Numerical control)


3.2. CC H) THHNG $IIU KHIGN SH
e. FMS (Flexible Manufacturing System)


3.2. CC H) THHNG $IIU KHIGN SH
f. CIM (Computer Integrated Manufacturing)


3.3. CC $QC TR%NG CRA MY CNC
Khng c sai s0 do 5Kc kch th,9c sai.
C kh* n8ng gia cng cc bin d@ng ph7c t@p
$! chnh xc gia cng cao, Dn 5.nh
T< 5!ng ho cao. M!t cng nhn c th3 v6n
hnh 5,:c nhi2u my
Chi ph cho trang b. cng ngh" thAp v khng
c=n nhi2u 5N g nhAt.
C th3 d< 5on chnh xc th-i gian gia cng.
Qu trnh gia cng c th3 lCp l@i
Tnh linh ho@t cao
Kh* n8ng t6p trung nguyn cng cao
T0c 5! ch@y dao v t0c 5! cSt l9n, N8ng suAt
gia cng cao


3.3. CC $QC TR%NG CRA MY CNC
a. H! t"a #$

Khi l6p trnh quy ,9c d?ng c? chuy3n 5!ng t,#ng
50i so v9i h" th0ng tKa 5!, cn chi ti1t 57ng yn.
3.3. CC $QC TR%NG CRA MY CNC
a. H! t"a #$

3.3. CC $QC TR%NG CRA MY CNC
b. Cc #i%m chu&n
3.3. CC $QC TR%NG CRA MY CNC
b. Cc #i%m chu&n
'i%m chu&n M
! G0c h" tKa 5! my
! Nh ch1 t@o qui 5.nh
! Gi9i h@n vng lm vi"c c/a my khi d.ch chuy3n c# cAu my
theo chi2u d,#ng h" tKa 5!

3.3. CC $QC TR%NG CRA MY CNC
b. Cc #i%m chu&n
'i%m 0 c(a chi ti)t (W)
! Do ng,-i l6p trnh chKn (,u tin 3T)
3.3. CC $QC TR%NG CRA MY CNC
b. Cc #i%m chu&n
'i%m 0 c(a chi ti)t (W)
3.3. CC $QC TR%NG CRA MY CNC
b. Cc #i%m chu&n
'i%m tham chi)u R: $i3m chu+n ny c m!t kho*ng
cch xc 5.nh so v9i 5i3m 0 c/a my v 5 5,:c 5nh
dAu trn cc bn tr,:t c/a my.
'i%m hi!u ch*nh dao E: Khi s> d?ng nhi2u dao, cc
kch th,9c c/a dao ph*i 5,:c xc 5.nh tr,9c trn thi1t b.
5i2u chTnh dao 53 c thng tin 5,a vo h" th0ng 5i2u
khi3n nh;m hi"u chTnh t< 5!ng kch th,9c dao.

3.3. CC $QC TR%NG CRA MY CNC
c. D+ng #i,u khi%n
'i,u khi%n #i%m #i%m
'i,u khi%n theo #-.ng th/ng
3.3. CC $QC TR%NG CRA MY CNC
c. D+ng #i,u khi%n
'i,u khi%n theo countour 2D

3.3. CC $QC TR%NG CRA MY CNC
c. D+ng #i,u khi%n
'i,u khi%n theo countour

2
1
2
D
3.3. CC $QC TR%NG CRA MY CNC
c. D+ng #i,u khi%n
'i,u khi%n theo countour 3D

3.3. CC $QC TR%NG CRA MY CNC
3.4. LUP TRNH GIA CNG CNC
a. Cch ghi kch th-0c
Tuy"t 50i: Cc kch th,9c 5,:c ghi xuAt pht tM W
T,#ng 50i (gia t8ng)
3.4. LUP TRNH GIA CNG CNC
b. Cc nhm l!nh c1 b2n
Cc ch7c n8ng G (geometric Functions)
Cc ch7c n8ng M (miscellaneous Functions)
18 - BASIC PROGRAMMING
BLOCK
CONFIGURATION.
The sequence in which address codes appear in each
block should remain consistent throughout the program.
It is recommended that the order of these address codes
follows the example shown below :
N G X. Y. Z. F M S T ;
Interpolation
function.
Feedrate
function.
Miscellaneous
function.
Spindle
function.
Tool
function.
Block
sequence
number.
Preparatory
function.
NOTE 1.
Each block may not necessarily contain all these items.
End of
block
signal.
G CODES
(PREPARATORY
FUNCTIONS).
Preparatory functions, called G codes, are used to
determine the geometry of tool movements and
operating state of the machine controller; functions
such as linear cutting movements, drilling operations
and specifying the units of measurement.
They are normally programmed at the start of a block.
A G code is defined using the G address letter and a
two digit number as follows,
G
Address. Two digit number.
3.4. LUP TRNH GIA CNG CNC
3.4. LUP TRNH GIA CNG CNC
b. Cc nhm l!nh c1 b2n
Nhm l"nh ch@y dao: G00; G01; G02; G03; G04; G09/
G61; G60.
Nhm l"nh to@ 5!: G15; G16; G17; G18; G19; G68; G69
Nhm l"nh cSt ren: G33; G34
Nhm l"nh b dao: G40; G41; G42; G43; G44; G49
Nhm l"nh h" tKa 5! 5.a ph,#ng: G52~G59
Nhm l"nh chu trnh: G80~G89
Cc l"nh khc: G64; G20; G21; G28; G90; G91; G94; G95
3.4. LUP TRNH GIA CNG CNC
b. Cc nhm l!nh c1 b2n
F: L,:ng ch@y dao
I: L"nh to@ 5! tm theo X (dng khi n!i suy cung trn)
J: L"nh to@ 5! tm theo Y (dng khi n!i suy cung trn)
K: L"nh to@ 5! tm theo Z (dng khi n!i suy cung trn)
S: Khai bo t0c 5! tr?c chnh
T: L"nh gKi dao
U: To@ 5! t,#ng 50i Theo ph,#ng X
V: To@ 5! t,#ng 50i Theo ph,#ng Y
W: To@ 5! t,#ng 50i Theo ph,#ng Z
X: To@ 5! tuy"t 50i - Theo ph,#ng X
Y: To@ 5! tuy"t 50i - Theo ph,#ng Y
Z: To@ 5! tuy"t 50i - Theo ph,#ng Z


3.4. LUP TRNH GIA CNG CNC
Nhm l!nh ch+y dao: G00; G01; G02; G03; G04; G09/
G61; G60
G00: Chay dao nhanh
N G00 XYZ
N50 G00 X40 Y56
N51 G00 U-30 V-30.5

3.4. LUP TRNH GIA CNG CNC
Nhm l!nh ch+y dao: G00; G01; G02; G03; G04; G09/
G61; G60
G01: N!i suy 5,-ng thBng
N...G01 X...Y Z....S F...
N100 G00 X20 Z46
N101 G01 X40 Z20.1 S1000 F0.1


3.4. LUP TRNH GIA CNG CNC
Nhm l!nh ch+y dao: G00; G01; G02; G03; G04; G09/
G61; G60
Chn vt mp hoCc v gc (Ch$ c tc d%ng v&i G00, G01)
N100 G01 X26 Z53
N101 G01 X26 Z27 R6
N102 G01 X86 Z27 C3
N103 G01 X86 Z0

3.4. LUP TRNH GIA CNG CNC
Nhm l!nh ch+y dao: G00; G01; G02; G03; G04; G09/
G61; G60
G02: N!i suy cung trn theo chi2u kim 5Nng hN
G03: N!i suy cung trn ng,:c chi2u kim 5Nng hN
N... G02/G03 XYZIJKF
N... G02/G03 XYZRF

3.4. LUP TRNH GIA CNG CNC
Nhm l!nh ch+y dao: G00; G01; G02; G03; G04; G09/
G61; G60

G04: DMng ch,#ng trnh theo th-i gian
N..G04 P/X (P- milliseconds; X-Seconds)

! BV phoi khi ti"n, khoan, khot, doa
! Kh> qun tnh khi phay
! $:i my v2 tr@ng thi Dn 5.nh (m!t s0 h" 5i2u hnh (Fanuc) khng
c=n c tham s0 theo sau l"nh G04)
3.4. LUP TRNH GIA CNG CNC
Nhm l!nh ch+y dao: G00; G01; G02; G03; G04; G09/
G61; G60

G09/G61: DMng chnh xc
N...G09 X Y Z
N...G61....
.
.
.
N... G64

3.4. LUP TRNH GIA CNG CNC
Nhm l!nh ch+y dao: G00; G01; G02; G03; G04; G09/
G61; G60

G60: Di chuy3n m!t pha (Anti-Backlash)
N...G60 X /Y/ Z
3.4. LUP TRNH GIA CNG CNC
Nhm l!nh to+ #$: G15; G16; G17; G18; G19; G68; G69

G15: H/y n!i suy theo tKa 5! 5!c c<c
G16: N!i suy theo tKa 5! 5!c c<c
N...G15/G16;
3.4. LUP TRNH GIA CNG CNC
Nhm l!nh to+ #$: G15; G16; G17; G18; G19; G68; G69

G17:ChKn mCt X-Y
G18: ChKn mCt X-Z
G19: ChKn mCt Y-Z

N...G17/G18/G19;
3.4. LUP TRNH GIA CNG CNC
Nhm l!nh to+ #$: G15; G16; G17; G18; G19; G68; G69

G68: Quay h" tKa 5!
G69: DMng quay h" tKa 5!
G19: ChKn mCt Y-Z

N... G68 ".. #... R
N... G69

3.4. LUP TRNH GIA CNG CNC
Nhm l!nh c3t ren: G33; G34
G33: CSt ren
NG33 XZK(b,9c ren)
NG33 XZI(gc cn)K(b,9c ren)


3.4. LUP TRNH GIA CNG CNC
Nhm l!nh c3t ren: G33; G34
G33: CSt ren



LNC Lathe
Syntax of G code

LNC Technology Co., Ltd. 37

Example:
Self-defined departure angle and departure speed cutting (peroform cutting only once)
T0707;--------------------------------------------------------------------------------------------------- Call for #7 tool
G00 X4.5 Z2.; ----------------------------------------- X axis, Z axis rapidly move to cutting start position
G33 Z-12. F1; ------------------------------------------------------- 1
st
section of threading, thread pith 1mm
G33 X11.43 Z-14; -----------------------------------2
nd
section of threading, departure angle 60 degrees
G00 Z2; -------------------------------------------------------------------------------------- Z axis rapid movement
M30; ------------------------------------------------------------------------------------------------------Program ends


G33
G
3
3
G00
5 !
12 2 2
60


LNC Lathe
Syntax of G code

LNC Technology Co., Ltd. 37

Example:
Self-defined departure angle and departure speed cutting (peroform cutting only once)
T0707;--------------------------------------------------------------------------------------------------- Call for #7 tool
G00 X4.5 Z2.; ----------------------------------------- X axis, Z axis rapidly move to cutting start position
G33 Z-12. F1; ------------------------------------------------------- 1
st
section of threading, thread pith 1mm
G33 X11.43 Z-14; -----------------------------------2
nd
section of threading, departure angle 60 degrees
G00 Z2; -------------------------------------------------------------------------------------- Z axis rapid movement
M30; ------------------------------------------------------------------------------------------------------Program ends


G33
G
3
3
G00
5 !
12 2 2
60

3.4. LUP TRNH GIA CNG CNC
Nhm l!nh c3t ren: G33; G34
G34: CSt ren c b,9c thay 5Di
NG34 XZK(b,9c ren 5=u)Q (l,:ng thay 5Di)
NG34 XZKI (gc cn)...Q


LNC Lathe
Syntax of G code

LNC Technology Co., Ltd. 39
G33 U2 F4;Use G33 thread pitch 8mm for departure (F=4mmis used to increase departure speed)
G0 W15; --------------------------------------------------------------use G00 to rapidly return to start position
M99; ------------------------------------------------------------------------------------------------- subprogram ends
W15
W-15
U2 U-2
5 15 3
!5


3.4. LUP TRNH GIA CNG CNC
Nhm l!nh b dao: G40; G41; G42; G43; G44; G49
G40: H/y b bn knh dao
G41: B bn knh dao sang tri
G42: B bn knh dao sang ph*i


LNC Lathe
Syntax of G code

LNC Technology Co., Ltd. 45

G40, G41, G42: Tool nose radius compensation
Format:

G40;

G42
G41

G19
G18
G17
!
"
#
$
%
&
!
!
!
"
#
$
$
$
%
&


Argument:
G40 : Tool nose radius compensation. (Cancel)
G41 : Tool nose radius compensation. (Left)
G42: : Tool nose radius compensation. (Right)
Action:
Blocks in which tool radius compensation value begins and cancels must be linear command ( G00
or G01), not arc command (G02 or G03).
Tool radius compensation can be divided into Type A and Type B, which is decided by parameter
0131.
Illustration:

G41: When face to tool movement direction,
tool shifts to the left for a radius.
G42: When face to tool movement
direction, tool shifts to the right
for a radius.


3.4. LUP TRNH GIA CNG CNC
Nhm l!nh b dao: G40; G41; G42; G43; G44; G49
G43: B d,#ng chi2u di dao
G44: B m chi2u di dao
G49: H/y b chi2u di dao

NG43/G44 H01

3.4. LUP TRNH GIA CNG CNC
Nhm l!nh h! t"a #$ #4a ph-1ng: G52~G59
G52: $Ct h" tKa 5! 5.a ph,#ng (NG52 X... Y... Z...)
G53: Quay v2 h" tKa 5! my (NG52 )
G54~G59: Cc 5i3m g0c chi ti1t
('(t b)i l*nh G10)


LNC Lathe
Syntax of G code

LNC Technology Co., Ltd. 49

G54 ~ G59: Selection of work coordinate system
Format:

!
!
!
!
!
!
!
!
"
#
$
$
$
$
$
$
$
$
%
&
G59;
G58;
G57;
G56;
G55;
G54;


Action:
The workpiece coordinate system adopts G54~G59 to represent 6 different coordinate systems.
Users can select among them according to manufacturing needs.
Each coordinate systems original position offset can be set in!OFFSET" !coordinate system
setting"; refer to operation manual for detailed instructions. Besides, it can also be set by G10
command, and please refer to G10 command for detailed instructions.
The relationship between each coordinate system is as the following: (default coordinate system
when system starts is G54 coordinate system)


G54
G55 Offset
G56 Offset
G57 Offset
G58 Offset
G59 Offset
00 Offset
G54 Offset
G55
G56
G57
G58
G59
00 Work coordinate
Zero point

LNC Lathe
Syntax of G code

50 LNC Technology Co., Ltd.

Example:
G90 G54 G00 X100. Z100.;
G55 X100. Z100.; ------------------------------------------------------------------------------------------------ A B

G53 Coordinate
+X
+Z
G54
G55
100
100
100
B(100,100)
100
A(100,100)
+X
+X
+Z
+Z


LNC Lathe
Syntax of G code

50 LNC Technology Co., Ltd.

Example:
G90 G54 G00 X100. Z100.;
G55 X100. Z100.; ------------------------------------------------------------------------------------------------ A B

G53 Coordinate
+X
+Z
G54
G55
100
100
100
B(100,100)
100
A(100,100)
+X
+X
+Z
+Z

3.4. LUP TRNH GIA CNG CNC
Nhm l!nh chu trnh: G80~G89
G80: H/y chu trnh 5 chKn (NG80 )
G83: Chu trnh khoan lJ
NG83 X... Y... Z... R... Q... P... D... F... K...
X, Y: TKa 5! tm
Z: Chi2u su
R: Kho*ng cch rt dao
Q: Chi2u su mJi l=n khoan
P: Th-i gian dMng t@i 5y lJ
D: Chi2u di 5o@n trng nhau
F: L,:ng ti1n dao
K: S0 l=n lCp l@i (G90: Khoan t+i 1 v, tr; G91: Khoan h* l-)
3.4. LUP TRNH GIA CNG CNC
Nhm l!nh chu trnh: G80~G89
G80: H/y chu trnh 5 chKn (NG80 )
G83: Chu trnh khoan lJ
NG83 X... Y... Z... R... Q... P... D... F... K...

LNC Lathe
Syntax of G code

78 LNC Technology Co., Ltd.
Illustration:
Parameter description :
TYPE I : High speed mode. (Parameter P1044 =0)
A : Start point.
M : M code for spindle clamp.
M+1 : M code for spindle unclamp.
D : Retraction distance specified in parameter P0150.
P2 : Dwell time specified in parameter P1045.
Z
D
P
P2
A
M
W
D
Q Q
R
A
G98
TYPE I
M+1

For G98, TYPE I (Parameter P1044=0)

P2
M+1
G99
TYPE I
R
Q Q
D
W
P
D
Z
M
A

For G99, TYPE I (Parameter P1044=0)
High Speed
3.4. LUP TRNH GIA CNG CNC
Nhm l!nh chu trnh: G80~G89
G80: H/y chu trnh 5 chKn (NG80 )
G83: Chu trnh khoan lJ
NG83 X... Y... Z... R... Q... P... D... F... K...

LNC Lathe
Syntax of G code

LNC Technology Co., Ltd. 79

Parameter description :
TYPE II: Normal speed mode. (Parameter P1044 =1)
A : Start point.
M : M code for spindle clamp.
M+1 : M code for spindle unclamp.
D : Retraction distance specified in parameter P0150.
P2 : Dwell time specified in parameter P1045.
P
Z
R
D D
W
Q Q Q Q
M
A
P2
M+1
A
G98 TYPE II

For G98, TYPE II (Parameter P1044=1)

P
Z
R
D D
W
Q Q Q Q
M
A
P2
M+1
G99 TYPE II

For G99, TYPE II (Parameter P1044=1)
Normal Speed
3.4. LUP TRNH GIA CNG CNC
Nhm l!nh chu trnh: G80~G89
G80: H/y chu trnh 5 chKn (NG80 )
G83: Chu trnh khoan lJ
NG83 X... Y... Z... R... Q... P... D... F... K...

LNC Lathe
Syntax of G code

80 LNC Technology Co., Ltd.
Parameter description :
TYPE III : Q__ vacant
A : Start point.
M : M code for spindle clamp.
M+1 : M code for spindle unclamp.
P2 : Dwell time specified in parameter P1045.
W
R
M
A
A
G98
TYPE III
M+1
Z
P
P2

For G98, TYPE III (Q__ vacant)
W
R
M
A
G99
TYPE III
M+1
Z
P
P2

For G99, TYPE III (Q__ vacant)
3.4. LUP TRNH GIA CNG CNC
Nhm l!nh chu trnh: G80~G89
G80: H/y chu trnh 5 chKn (NG80 )
G84: Chu trnh taro
NG84 X... Y... Z... R... P... F... K...D
D: Chi2u quay (Khng c D Quay cng chi2u kim
5Nng hN; D0-Quay cng chi2u kim 5Nng hN; D1-
Quay ng,:c chi2u kim 5Nng hN)



LNC Lathe
Syntax of G code

82 LNC Technology Co., Ltd.
Example:
Direction of tapping

G84; ------------------------------------------------------------------------------------------- Tapping using M03.
G84; ------------------------------------------------------------------------------------------- Tapping using M03.
G84D1;---------------------------------------------------------------------------------------- Tapping using M04.
G84; -------------------------------------------------------------------------- Tapping using M04. (Inheritance)
G84; -------------------------------------------------------------------------- Tapping using M04. (Inheritance)
G84D0;---------------------------------------------------------------------------------------- Tapping using M03.

Illustration:
Parameter description :
A : Start point.
M : M code for spindle clamp.
M+1 : M code for spindle unclamp.
P2 : Dwell time specified in parameter P1045.
CW : M03
CCW : M04
spindle
stop
M
A
G98
A
M+1
P2
R
Z
P
W
CCW(D=1 CW)
CW(D=1 CCW)

G98 mode

Spindle
stop
M
A
G99
M+1
P2
R
Z
P
W
CCW(D=1 CW)
CW(D=1 CCW)

G99 mode
3.4. LUP TRNH GIA CNG CNC
Nhm l!nh chu trnh: G80~G89
G80: H/y chu trnh 5 chKn (NG80 )
G85: Chu trnh khot
NG85 X... Y... Z... R... P... F... K



LNC Lathe
Syntax of G code

84 LNC Technology Co., Ltd.

M
A
P2
M+1
W
P
Z
R
G99

G99 mode

3.4. LUP TRNH GIA CNG CNC
Cc l!nh khc: G64; G20; G21; G28; G90; G91; G94;
G95
G64: T0i ,u ha chuy3n 5!ng
G20: Dng 5#n v. inch
G21: Dng 5#n v. mm
G28: TrL v2 5i3m tham chi1u
G90: Dng h" tKa 5! tuy"t 50i
G91: Dng h" tKa 5! gia t8ng
G94: L,:ng ch@y dao mm/pht
G95: L,:ng ch@y dao mm/vng


3.4. LUP TRNH GIA CNG CNC
M$t s5 ch6c n7ng M
M00: DMng khng 5i2u ki"n
M03: B6t tr?c chnh quay cng chi2u kim 5Nng hN
M04: B6t tr?c chnh quay ng,:c chi2u kim 5Nng hN
M05: DMng tr?c chnh
M06: Thay dao
M07: B6t dung d.ch tr#n ngu!i (Mist)
M08: B6t dung d.ch tr#n ngu!i (Flood)
M09: TSt dung d.ch tr#n ngu!i
M30: K1t thc ch,#ng trnh
TO BE CONTINUED...