多层飞面宏程序

%O1000(刷面)(四面分中;对顶为零)(华中)

G54G90G40G80G21G94

G91G28Z0

#0=3(刀具号)

#12=3500(主轴转速)

#13=1500(切削速度)

#1=10(刀具半径)

#2=10(每刀步距Ae)

#3=1(每刀切深Ap)

#4=3(总深)

#5=30(X向长度)

#6=40(Y向长度)

(以下自变量无需更改)

#7=#1*2(刀具直径)

#8=#5/2+#7(下刀点X)

#9=#6/2+#7(下刀点Y)

#10=0(已铣深度)

#11=0(已铣长度Y)

#14=-#9+#1(Y长度初始点)

(判断是否有残留)

IF[#2GE#7]

GOTO91

ENDW

T#0 M06

M03S#12

G90G0X0Y0

Z100

X-#8 Y-#9

G1Z50F2000

Z10F1000

Z1

G1Y#14

Z0F500

WHILE[#10LT#4]

#10=#10+#3

G90G1Z-#10F1000

WHILE[#11LT#6]

#11=#11+#2

G91G1Y#2F#13

X#8*2

IF[#11GT#6]

GOTO101

ENDIF

#11=#11+#2

G91G1Y#2F#13

X-#8*2

ENDW

N101G90G0Z20

#11=0

IF[#10GE#4]

GOTO91

ENDIF

G90 G0 Y-#9

X-#8

Z5

G1Z1F800

G1Y#14F#13

G1Z-#10F800

ENDW

N91 G91G28Z0

G28 Y0

M05

M30

%