课件6

advertisement
2.6 Programming of CNC lathe
2.6.1 The characteristics of CNC lathe programming
The most basic lathe operations are:
facing
turning
grooving
parting
drilling
boring
threading
(1) Coordinate system
programming basic two-axis motions:
Z and X axes
Positive +Z: the motion away from spindle
Negative –Z: the motion toward the spindle
X axis controls the cross-slide movement
Programming zero:
on right end plane
left end plane
the intersection point of chuck front plane and
work-piece centerline
(2) Types of positioning modes
movement of tool in modes:
absolute,incremental,
or mixed (incremental and absolute)
X axis must be programmed in terms of the
diameter
Address U: indicate incremental X axis motion
Address W: specify incremental Z axis movement
(3) The functions of tool compensation
CNC lathes have tool length compensation
and tool nose radius compensation.
It is useful to finish machining,
adjusting setting up tool error,
and adjusting abrasive tools.
• Tool-nose radius compensation: compensate for the
diameter of the tool by offsetting the tool path by the
radius of the tool diameter.
↓
program the part just as it appears on the part print
When we set the X and Z axes of the tool, we
create a square point on the tool. Most of the
tools we use for turning have radii.
an error: apparent when use the tool edges to set
coordinate position
↓
need to use TNR compensation (saves from
mathematically calculating the cutter path)
↓
TNR compensation also lets us use the same
program for a variety of tool types. With TNR
compensation capabilities, the insert radius size
can be ignored and the part profile can be
programmed.
Tool-nose radius compensation can be to the
right or left of the part profile.
The exact size of the cutting tool to be used is
entered into the offset file, and when the offset
is called, the tool path will automatically be
offset by the tool radius.
need to specify how much the controller is to
offset. The size of the radius is placed in the
nose radius offset table, which is typically
located adjacent to the tool file under the tool
number being used.
Other information: the tool nose direction vector.
The tool tip or imaginary tool tip has a specific
location or direction from the center of the toolnose radius.
The tool nose vector: tells the control which
direction it must compensate
The direction vector number is usually placed in
the same tool offset table as the radius value.
(4) Spindle speed control
constant surface speed control: to speed up
and slow down as the part diameter changes,
important for:
efficient use of cutting tools,
tool life,
and proper surface finish.
Command constant surface speed:
Cancel constant surface speed:
e.g.
G50 S2000; /*max. spindle speed (r/min)
G96 S150;
G01 X10.;
G97 S800;
……
2.6.2 Programming codes for CNC lathe
(1) workpiece coordinate setting
X0: spindle or workpiece center
Z0: the right end of the workpiece
or the chuck face
Workpiece coordinate
zero setting
Workpiece coordinate
zero setting
Part
G92 (G50) X... Z... ;
P is the tool start point,
XOZ to be set: G50 X121.8 Z33.9;
X’O’Z to be set: G50 X121.8 Z109.7;
(2) Tool change and tool call
T-code is sufficient to tell the control which tool turret
position the tool is in.
T 
刀具号

刀具 补偿组号
The tool call is accompanied by the offset call
Return the axis to home or a safe position before
calling a new tool.
Correspond the tool offset number and the tool
number to eliminate mistakes in machining and
damage to equipment.
11
 2 0
 4 0
 6 2
20
50
8
 6
6
50
 1 4
R
X
24
5 2 .7
O
Z
X
50
6
5 2 .7
11
 6
 2 0
 1 4
R
 4 0
 6 2
• O0302;
N001 G50 X100.0 Z52.7;
N002 S800 M03;
N003 G00 X6.0 Z2.0;
N004 G01 Z-20.0 F1.3;
N005 G02 X14.0 Z-24.0 R4.0;
N006 G01 W-8.0;
N007 G03 X20.0 W-3.0 R3.0;
N008 G01 W-37.0;
N009 G02 U20.0 W-10.0 R10.0;
N010 G01 W-20.0;
N011 G03 X52.0 W-6.0 R6.0;
N012 G02 U10.0 W-5.0 R5.0;
N013 G00 X100.0 Z52.7;
N014 M05;
N015 M02;
20
50
O
8
24
Z
(3) Thread cutting
To cut a thread, the tool makes many passes, taking
shallow cuts down the angle of the plunge.
The spindle speed must remain constant from rough
cutting through finish cutting. (If not inaccurate thread
lead will occur) →δ1 and δ2
depth of each pass:
the depth of each pass gets smaller as approach
the final thread depth (the minor diameter)
As the tool gets deeper into the thread, the area of
contact increases→Taking more shallow cuts
allows for increase in contact and reduces the
chance for work hardening
Format: G32 X Z Q F ;
• X, Z: end point coordinate; F: pitch;
feedrate (in/min) =pitch (in/rev) × spindle speed (rev/min)
• G32 just does the single move
biggest advantages to G32:
can control the depth of each
thread pass
and the exact plunge
angle.
X
Â Ý ÎÆ ³ ¤ ¶ È
Ò ý È볤 ¶È
³¬ Ô ½
³¤ ¶È
O
Z
加工实例:螺距为4 mm,第一次和第二次单边切削量均为1 mm,
引入长度为3 mm,超越长度为1.5 mm。
锥螺纹切削: 螺距1.5mm, δ1=2mm,δ2=1mm。
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
O0013
G92 X80.0 Z150.0 S160 M03 ;
G90 G00 X50.0 Z122.0 M08 ;
X13.2 ; 查表3-3, ap1 = 0.8 mm
G91 G32 X29.0 Z −43.0 F1.5 ; 车螺纹第1刀(增量方式)
G00 X7.0 ; 退刀至X= 50处
Z43.0 ; 退刀至Z=122.0处
G90 X12.6 ; 吃刀ap2 = 0.6 mm
G32 X41.6 Z79.0 ; 车螺纹第2刀
G00 X50.0 ;
Z122.0 ;
X12.2 ;
G32 X41.2 Z79.0 ; ap3 = 0.4 mm
G00 X50.0;
Z122.0;
X12.04; ap4 = 0.16 mm
G32 X41.04 Z79.0;
G00 X50.0;
Z122.0;
X80.0 Z150.0 M09;
M05 M03;
锥螺纹加工:  1  3 mm
 2  2 mm
A点:x=19.5mm,z=3mm
B点:x=25.3mm,z=-34mm
1
、
2
提示:加工圆锥螺纹时,
要特别注意受影响后的
螺纹切削起点与终点坐标
• 查表得双边切深分五刀切削,分别为0.9mm、0.6mm、
0.6mm、0.4mm和0.1mm。
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
N10 G40 G97 G99 S400 M03
主轴正转
N20 T0404
选4号螺纹刀
N30 G00 X27.0 Z3.0
螺纹加工起点
N40
X18.6
进第一刀,切深0.9mm
N50 G32 X24.4 Z-34.0 F2.0
螺纹车削第一刀,螺距为2mm
N60 G00 X27.0
X向退刀
N70
Z3.0
Z向退刀
N80
X18.0
进第二刀,切深0.6mm
N90 G32 X23.8 Z-34.0 F2.0
螺纹车削第二刀,螺距为2mm
N100 G00 X27.0
X向退刀
N110
Z3.0
Z向退刀
N120
X17.4
进第三刀,切深0.6mm
N130 G32 X23.2 Z-34.0 F2.0 螺纹车削第三刀,螺距为2mm
N140 G00 X27.0
X向退刀
N150
Z3.0
Z向退刀
N160
X17.0
进第四刀,切深0.4mm
N170 G32 X22.8 Z-34.0 F2.0
螺纹车削第四刀,螺距为2mm
N180 G00 X27.0
X向退刀
N190
Z3.0
Z向退刀
N200
X16.9
进第五刀,切深0.1mm
N210 G32 X22.7 Z-34.0 F2.0
螺纹车削第五刀,螺距为2mm
N220 G00 X27.0
X向退刀
N230
Z3.0
Z向退刀
N240
X16.9
光一刀,切深为0
N250 G32 X22.7 Z-34.0 F2.0
光一刀,螺距为2mm
N260 G00 X200.0
X向退刀
N270
Z100.0
Z向退刀,回换刀点
N280 M30
程序结束
(5) Canned cycles
fixed cycles: used to simplify the programming of
repetitive turning operations
↓
( rough turning, threading, grooving)
Programming without the use of a canned cycle
can take up to four or five times the number of
lines needed for a part with canned cycles.
Standard canned cycles, are common to
most CNC machines.
① longitudinal turning cycle (内外径切削循环 )
Format: G90 X(U)___ Z(W)___ R___ F___ ;
X(U) , Z(W) : X, Z coordinate at the end point;
F : cutting speed.
R- : When cutting from the start point to X+ direction;
R+ : When cutting from the start point to X- direction;
φ50mm的工件,
固定循环的起始点
(X55.0,Z3.0),
•
•
•
•
•
•
•
•
•
•
O2009
N05 G50 X80.0 Z100.0;
N10 M03 S600 T0101;
N15 G00 X55.0 Z3.0;
N20 G90 X46.0 Z-45.0 F0.3;
N25 X42.0;
N30 X40.0;
N35 G00 X80.0 Z100.0 T0100;
N40 M05;
N45 M30;
加工一个φ60mm的工件,固定循环的起始点为
(X65.0,Z2.0), 背吃刀量为5mm
• ……
•
•
•
•
•
G00 X65.0 Z2.0
G90 X60.0 Z-35.0 R-5.0 F0.2
X50.0
G00 X200.0 Z100.0
M30
• N10 G40 G97 G99 M03 S600
主轴正转,
转速600r/min
• N20 T0101
换1号刀
• N30 G42 G00 X65.0 Z2.0 建立刀具半径右补
偿,快速进刀至循环起点
• N40 G90 X60.0 Z-35.0 R-5.0 F0.2 锥面切削循
环第一次
• N50 X50.0
锥面切削循环第二次
•
N60 G40 G00 X200.0 Z100.0
取消刀具
半径补偿,快速回换刀点
• N70 M30
程序结束
② Thread cutting cycle G92
By using G92 in one block, a cycle of four
individual movements can be obtained.
These movements are:
1)rapid traverse to a given diameter;
2)thread cutting with programmed feed rate;
3)rapid withdrawal;
4)rapid return traverse to the starting point.
• G92 X(U)__ Z(W)__ F__ ; (straight thread)
X、Z为螺纹终点坐标值(U、W为螺纹起点坐标到终点坐标的增量值)
R为锥螺纹大端和小端的半径差,该值采用半径编程
切削完螺纹后退刀按照45°退出
• G92 X(U)__ Z(W)__ I(R)__ F__ ;
(taper thread; Value of I(R) is the radius
difference between end and start point of the
cut )
•
•
•
•
•
•
•
•
•
•
•
•
•
•
O0009;
N1 G50 X60 Z28;
N2 S100 M03;
N3 G00 X29.1 Z2;G00 X32. Z5.;
N4 G32 Z-23 F2;G92 X29.1 Z-23 F2.0;
N5 G00 X32;
N6 Z2;
N7 X28.5;X28.5;
N8 G32 Z-23 F2;
N9 G00 X32;
N10 Z2;
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
N11 X27.9; X27.9;
N12 G32 Z-23 F2;
N13 G00 X32;
N14 Z2;
N15 X27.5;X27.5;
N16 G32 Z-23 F2;
N17 G00 X32;
N18 Z2;
N19 X27.4; X27.4;
N20 G32 Z-23 F2;
N21 G00 X32;
N22 X60 Z28;
N23 M02;
G76: Compound type thread cycle
FORMAT:
G76 P ( m )( r )(  )
Q (  d min ) R (d )
G76 X (U ) Z (W ) R (i ) P (k ) Q (  d )
F(f )
m为精车重复次数,从1~99次,该值为模态值;
r 为螺纹尾部倒角量(斜向退刀),是螺纹导程(L)的0.1~9.9倍,
以0.1为一挡逐步增加,设定时用00~99之间的两位整数来表示;
 为刀尖角度,常用60°、55°和30°三个角度;
 d min
切削时的最小背吃刀量
d为精车余量,用半径编程 ;
X(U)、Z(W)为螺纹终点坐标;
i为螺纹半径差,与G92中的R相同;
k为螺纹高度,用半径值指定 ;
 d 为第一次车削深度,用半径值指定
f为螺距
;
例:螺纹外径已车至  29 . 8 mm ,
用G76编写螺纹的加工程序。
m  2
r  1 .1L
 d min  0 . 1mm
d  0 . 05 mm
  60

P 021160
单位变成 um → Q 100
→ R 50
螺纹终点坐标 X=27.4mm, Z=-30mm
螺纹高度 k=0.65P=1.3mm,表示为 P1300
螺距 f=2mm,表示为 F=2.0
第一次车削深度  d 取 1.0mm,表示为 Q1000
•
•
•
•
N10
N20
N40
N50
•
•
•
N60 G76 X27.4 Z-30.0 P1300 Q1000 F2.0 螺纹车削复合循环
N70 G00 X200.0 Z100.0
回换刀点
N80 M30
程序结束
G40 G97 G99 S400 M03
主轴正转,转速400r/min
T0404
螺纹刀T04
G00 X32.0 Z5.0
螺纹加工循环起点
G76 P021160 Q100 R50
螺纹车削复合循环
③ Stock removal cycle in facing G94
G94 is a function similar in application to function G90.
It is used for facing.
G94与G90指令的使用方法类似,可以互相代替。G90主要用于轴类零件的切
削,G94主要用于大小径之差较大而轴向台阶长度较短的盘类工件端面切削,
G94的特点是选用刀具的端面切削刃作为主切削刃,以车端面的方式进行循环
加工。
a)圆柱面切削循环G90 b)圆锥面切削循环G90(R)
c)平端面切削循环G94 d)斜端面切削循环G94(R)
Format:
G94 X(U)__ Z(W)__ F__ ;
G94 X(U)__ Z(W)__ K__ F__ ;
↓
Tapered cuts may be programmed by inclusion
of address K,
which is the value of difference between the
starting and ending point in Z direction
( K=Zstart - Zend )
加工一个φ30mm的工件,
固定循环的起始点为(X85.0,Z5.0)
背吃刀量为5mm
……
N30
N40
N50
N60
N70
N80
G00 X85.0 Z5.0
G94 X30.0 Z-5.0 F0.2
Z-10.0
Z-15.0
G00 X200.0 Z100.0
M30
O3014
N05 G50 X100.0 Z150.0;
N10 M03 S600 T0101;
N15 G00 X80.0 Z32.0;
N20 G94 X20.0 Z26.0 R-4.0 F0.3;
N25 Z23.0;
N30 Z20.0;
N35 G00 X100.0 Z150.0 T0100;
N40 M05;
N45 M30;
④ STOCK REMOVAL IN TURNING (G71)
rough cutting cycle that removes metal along the
direction of the Z axis.
In a case where there is a lot of material to be
removed, it has been necessary to employ many
blocks for roughing.
By using G71, programming of the final shape of the
workpiece is defined.
↓
Material is removed automatically, in each pass.
一般用于加工轴向尺寸较长的零件(圆柱毛坯料粗车外径和圆筒毛坯料粗车内径)
在切削循环过程中,刀具是沿X方向进刀,平行于Z轴切削。
Cutting is through parallel moves in the Z axis direction
A certain procedure needs to be followed:
the tool needs to be positioned to the rough
stock boundaries.
two-fold purpose: to tell the control how big the
stock is, to create a Z clearance position that
the tool rapids back to on each pass.
The G71 cycle reads a specified number of
blocks to determine the part profile and
determines each pass, the depth of cut for
each pass, and the number of repeat passes
for the cycle.
Format:
G71 U(d) R(e);
G71 P(ns) Q(nf) U(u) W(w) F(f) S(s) T(t);
N(ns)……………….
……………………..
……………………..
N(nf)…………….…
d:the depth of each roughing cut per side, (no sign) ;
e: the amount of retract, along the X axis ;
ns:the sequence number of the first block in the program, which
defines the finish profile
nf:the sequence number of the last block in the program
u:the stock allowance to be left for a finishing pass in the X axis
direction ;
w:the stock allowance to be left for a finishing pass in the Z
axis direction ;
• f、s、t:only valid for G71,Changes in F,S
between blocks P and Q will be ignored in G71;
• the first tool path move of the cycle cannot
include any displacement in the direction of the
Z axis
u为负?
e.g.: S=500r/min, F=150mm/min, cutting depth =5 mm,
stock allowance is 2mm in X axis and 1mm in Z ;
amount of retract is 1mm. The tool number is 1.
•
•
•
•
•
•
•
•
•
•
•
•
•
•
O2015
N5 G50 X100.0 Z100.0;
N10 M03 S640 T0101;
N15 G00 X65.0 Z2.0;
N20 G71 U5.0 R1.0;
N25 G71 P30 Q55 U2.0 W1.0 F0.3;
N30 G00 X20.0;
N35 G01 Z-15.0;
N40 G02 X40.0 Z-46.0 R35.0;
N45 G01 Z-67.0;
N50 X60.0 Z-85.0;
N55 Z-110.0;
N60 G00 X100.0 Z100.0 T0100 M05;
N65 M30;
⑤ Finishing cycle (G70)
Stock allowances for finishing (U, W) to be
removed;
G70 allows for removal of the remaining stock
allowance (without repetitive passed, along the contour).
• Format: G70 P__ Q__ ;
Where
P=number of the first block of the finished profile
Q=number of the last block of the finished profile
⑥ STOCK REMOVAL IN FACING ( G72 )
similar to G71, the only difference: change of the cutting direction
(一般用于加工盘类零件;
在切削循环过程中,
刀具沿Z方向进刀,平行于X轴切削)
Format:
G72 W (d) R (e);
G72 P(ns) Q(nf) U(u) W(w) F(f) S(s) T(t);
N(ns)……………….
……………………..
……………………..
N(nf)…………….…
parameters have the same meaning as those for G71
Note: the first block of the cycle should not
include any displacement in direction of the X
axis.
慎用G72, 对刀损害大
e.g.: S=640r/min, F=0.3mm/r,
cutting depth=2 mm,
stock allowance is
1mm in X axis and
0.5mm in Z,
amount of retract is 0.5mm,
The tool number is 1.
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
O2016
N5 G50 X200.0 Z100.0;
N10 M03 S640 T0101;
N15 G00 X170.0 Z2.0;
N20 G72 W2.0 R0.5;
N25 G72 P30 Q60 U1.0 W0.5 F0.3;
N30 G00 Z-70.0;
N35 G01 X160.0;
N40 X120.0 Z60.0;
N45 Z-50.0;
N50 X80.0 Z-40.0;
N55 Z-20.0;
N60 X40.0 Z0;
N65 G00 X200.0 Z100.0 T0100 M05;
N70 M30;
⑦ PATTEN REPEATING (G73)
G73 permits the repeated cutting of a fixed pattern,
with displacement of the axes position by an amount,
divided by the number of passes desired.
This cycle is well suited for previously formed
castings, forgings or rough machined materials
↓
the best scenario is when the finished contour closely
matches the casting, forging or rough material shape.
G73 U(i) W(k) R(d);
G73 P(ns) Q(nf) U(u) W(w) F(f) S(s) T(t);
N(ns)……………….
……………………..
……………………..
N(nf)…………….…
i:total displacement in the direction of X axis
k:total displacement in the direction of Z axis
d:the number of rough cutting passes
Other addresses have similar meaning as in G71
N010 G00 X220.0 Z40.0 ;
N012 G73 U14.0 W14.0 R3 ;
N013 G73 P014 Q020 U4.0 W2.0 F0.3 S180 ;
N014 G00 G42 X80.0 Z2.0 ;
N015 G01 W-20.0 F0.15 S600 ;
N016 X120.0 W-10.0 ;
N017 W-20.0 S400 ;
N018 G02 X160.0 W-20.0 R20.0 ;
N019 G01 X180.0 W-10.0 S280 ;
N020 G40;
N021 G70 P014 Q020 ;
N022 G00 X260.0 Z80.0 ;
N023 M30 ;
2.6.3 Examples for Turning Operations
Example 1:
O0006 ; Program number
N005 G50 X200. Z350. ; Establish workpiece coordinate
system
N010 S500 M03 T01 M08 ; Start spindle (CW) at 500rpm.
Change to tool 1 and coolant on
N015 G00 X54. Z102. ; Rapid to the start point
N020 G90 X44. Z50. F60. ; Execute multiple-pass straight
cutting cycle: rapid to 1; cut to 2; and 3 at feed rate 60 mm/min,
rapid to start point
N025 X34. ; Rapid to 4;cut to 5 and 3 at feed rate 60 mm/min;
rapid to start point
N030 X24. ; Rapid to 6;cut to 7 and 3 at feed rate 60 mm/min;
rapid to start point
N0035 G00 X200. Z350. ; Rapid to reference point
N0040 M05; Spindle off
N0045 M03; End of program
Example 2 :
Operation :
Chamfering,
cutting the outside circle of thread Φ48mm,
cutting conical surface,
cutting the outside circleΦ62mm,
chamfering,
cutting the outside circleΦ80mm,
cutting the arc surface,
cutting the outside circleΦ80
Grooving
Threading
Download