矩形型腔开粗宏程序
坐标系建立:四面分中,顶面为零
在此说明:#13表示拐角处R(10)值
完整程序内容:
O8090
G90 G17 G40 G49 G80 G69
G91 G28 Z0.
#1=100
#12=80
#2=1.5
#13=10
#3=10
#20=3
#19=6500
#9=3500
#26=0
#17=0.5
#108=0.3
#109=0.3
#6=[#3*0.75]
#117=#1-#3-[#108*2]
#118=#12-#3-[#108*2]
#119=#2-#109
#16=[#3*0.6]
T#20 M6
G90 G54
G0 X0. Y#16 S#19 M3
G43 Z10. H#20
/M8
#126=#26+0.3
G1 Z#126 F2500.
Y#16
#26=#26+#17
WHILE[#26LT#119]DO1
G3 J-#16 Z-#26 F1600.
#14=FIX[#118/#6]
#15=FIX[#14/2]
WHILE[#15GE#105]DO2
#24=[#117/2]-[#15*#6]
#25=[#118/2]-[#15*#6]
G1 Y#25 F#9
X-#24
Y-#25
X#24
Y#25
X0.
#15=#15-1
#105=FIX[[[#13-#108-[#3/2]]/#6]+1]
END2
#18=#13-#108-[#3/2]-#6
IF[#18LE0]GOTO100
IF[#18GT0]GOTO200
N100
#18=#13-#108-[#3/2]
N200
WHILE[#15GE0]DO3
#24=[#117/2]-[#15*#6]
#25=[#118/2]-[#15*#6]
G1 Y#25 F#9
X-[#24-#18]
G3 X-#24 Y[#25-#18] J-#18
G1 Y-[#25-#18]
G3 X-[#24-#18] Y-#25 I#18
G1 X[#24-#18]
G3 X#24 Y-[#25-#18] J#18
G1 Y[#25-#18]
G3 X[#24-#18] Y#25 I-#18
G1 X0.
#15=#15-1
#18=#18+#6
END3
#126=[-#26]+1
G1 Z#126
Y#16
#126=[-#26]+0.3
Z#126
#26=#26+#17
END01
#126=-[#2-#17-0.3]
G1 Z#126 F2500.
Y#16
G3 J-#16 Z-#119 F1600.
#14=FIX[#118/#6]
#15=FIX[#14/2]
WHILE[#15GE#105]DO1
#24=[#117/2]-[#15*#6]
#25=[#118/2]-[#15*#6]
G1 Y#25 F#9
X-#24
Y-#25
X#24
Y#25
X0.
#15=#15-1
#105=FIX[[[#13-#108-[#3/2]]/#6]+1]
END01
#18=#13-#108-[#3/2]-#6
IF[#18LE0]GOTO300
IF[#18GT0]GOTO400
N300
#18=#13-#108-[#3/2]
N400
WHILE[#15GE0]DO2
#24=[#117/2]-[#15*#6]
#25=[#118/2]-[#15*#6]
G1 Y#25 F#9
X-[#24-#18]
G3 X-#24 Y[#25-#18] J-#18
G1 Y-[#25-#18]
G3 X-[#24-#18] Y-#25 I#18
G1 X[#24-#18]
G3 X#24 Y-[#25-#18] J#18
G1 Y[#25-#18]
G3 X[#24-#18] Y#25 I-#18
G1 X0.
#15=#15-1
#18=#18+#6
END02
G1 Z10.
M9
M5
G91 G28 Z0.
G28 Y0.
M30
%