1 引言
2 WAM336數(shù)控磨床電器系統(tǒng)技術(shù)改造
3 加工宏程序的編制
- 磨削直線面的宏程序
- 磨削直線面的宏程序(9011)如下:
- %LINE,MX,
- (SUB 9011)
- (WRITE G54)
- (WRITE G90 G0 XP21)
- (WRITE G90 G0 CP0)
- (WRITE G90 G0 BP11)
- (P25 = P1 + 1)
- (WRITE G90 G0 XP25)
- (P15 = P1 + ORGX54*(1-1 / COS(P11)))
- (WRITE G90 G1 XP15 FP20)
- (WRITE G4 KP23)
- (WRITE G90 G0 XP21)
- (WRITE G91 G0 CP2)
- (WIRTE G90 G0 BP12)
- (P24 = P3 + 1)
- (WRITE G90 G0 XP24)
- (P16 = P3 + ORGX54*(1-1 / COS(P12)))
- (WRITE G90 G1 XP16 FP20)
- (WRITE G4 KP23)
- (WRITE G90 G0XP21)
- (WRITE G91 G0 CP4)
- (WRITE G90 G0 BP13)
- (P22 = P5 + 1)
- (WRITE G90 G0 XP22)
- (P17 = P5 + ORGX*(1-1 / COS(P13)))
- (WRITE G90 G1 XP5 FP20)
- (WRITE G4 KP23)
- (WRITE G90 G0 XP21)
- (WRITE G91 G0 CP6)
- (WRITE G90 G0 BP14)
- (P19 = P7 + 1)
- (WRITE G90 G0 XP19)
- (P17 = P7 + ORGX54*91-1 / COS(P14)))
- (WRITE G90 G1 XP17 FP20)
- (WRITE G4 KP23)
- (P0 = 0,P1 = 0,P2 = 0,P3 = 0,P4 = 0,P5 = 0,P6 = 0,P7 =0,P8 = 0,P9 = 0,P10 = 0,P11 = 0,P12 = 0,P13 = 0,P14 =0,P15 = 0,P16 = 0,P17 = 0,P18 = 0,P19 = 0,P20 = 0,P21= 0,P22 = 0,P23 = 0,P24 = 0,P25 = 0)
- (RET)
- 呼叫一次SUB9011 宏程序可完成磨削四個直線面的加工程序編制。在實際應(yīng)用中,可根據(jù)圖紙和工藝要求,通過在演算子程序中連續(xù)呼叫SUB9011宏程序來完成磨削任意直線面的加工編程。為此,首先需要建立一個演算子程序(即呼叫子程序),然后在該程序中對參數(shù)進(jìn)行賦值,即可完成加工程序的編制。需要賦值的參變量包括:初始上料角度P0,磨床*邊半徑尺寸P1,磨削第二邊外夾角P2,磨削第二邊半徑尺寸P3,磨削第三邊夾角P4,磨削第三邊半徑尺寸P5,磨削第四邊外夾角P6,磨削第四邊半徑尺寸P7,*邊到第四邊的后角P11~P14,磨削速度P20,外接圓半徑P21,空磨時間P23。
- 磨削圓弧面的宏程序
- 磨削圓弧面的宏程序(9010)如下:
- %CYCLE,MX,
- (SUB 9010)
- (WRITE M7)
- (WRITE G5)
- (WRITE G90 G1)
- (P24 = P0)
- (P25 = SQRT (P1*P1 + P2*P2))
- (P23 = P7)
- (P19 = P23)
- N10(P20 = P3 - P25)
- (IF P20 GT 0 G0T0 N30)
- (P23 = - P7 - ACOS(P1 / P25))
- (P19 = P23)
- N20(P22 = P25*COS(P23)+ P3)
- (WRITE F10)
- (WRITE XP22)
- (WRITE F100)
- (WRITE CP24)
- N25(P22 = P25*COS(P23)+ P3)
- (WRITE XP22 CP24)
- (P23 = P23 + P12)
- (P24 = P24 + P12)
- (IF P23 LE(P19 + P4)GOTO N25)
- (RET)
- N30(P23 = P7)
- (P19 = P23)
- (P22 = - P25*COS(P23 + P3)
- (WRITE F10)
- (WRITE XP22)
- (P18 = P24 + 90 + P7)
- (WRITE F100)
- (WRITE CP18)
- N35(P22 = - P25*COS(P23)+ P3)
- (WRITE XP22 CP18)
- (P23 = P23 + P12)
- (P18 = P18 = P12)
- (IF P23 LE(P19 + P4)GOTO N35)
- (P0 = 0,P1 = 0,P2 = 0,P3 = 0,P4 = 0,P5 = 0,P6 = 0,P7 =0,P8 = 0,P9 = 0,P10 = 0,P11 = 0,P12 = 0,P13 = 0,P14 =0,P15 = 0,P16 = 0,P17 = 0,P18 = 0,P19 = 0,P20 = 0,P21= 0,P22 = 0,P23 = 0,P24 = 0,P25 = 0)
- (RET)
- 通過呼叫SUB9010 宏程序,可實現(xiàn)磨削任意形狀圓弧面的加工程序編制。使用時,通過對參數(shù)賦值即可完成加工程序編制。需賦值的參變量包括:初始磨圓角P0,X 中心坐標(biāo)P1,Y 中心坐標(biāo)P2,圓弧半徑P3,圓弧轉(zhuǎn)角P4,切線角度P7,圓弧分度P12,圓弧速度P20,外接圓半徑P21。
圖
- 加工實例
- 現(xiàn)以磨削加工如圖所示刀片為例,說明如何調(diào)用宏程序SUB9010、SUB9011 和建立演算子程序。
- 該刀片需要加工的尺寸包括二個直線面(14mm×7mm)和四個圓弧面(4-R2mm)。根據(jù)工藝要求,首先磨削直線面,再依次磨削圓弧面。刀片初始上料角度為0°。編制演算子程序如下:
- (OPEN P8000,D)
- (WRITE(SUB 8000))
- (PCAL9011,P0 = 0,P1 = 3. 50,P2 = 90°,P3 = 7. 00,P4 =90,P5 = 3. 50,P6 = 90°,P7 = 7. 00,P20 = 8,P21 = 12,P23= 100°)
- (PCALL9010,P0 = 270°,P1 = 5. 00,P2 = 1. 5,P3 = 2,P4 =90°,P7 = 0,P12 = 0.1,P20 = 100,P21 = 12°)
- (PCALL9010,P0 = 360,P1 = 1. 5,P2 = 5,P3 = 2,P4 = 90,P7 = 0,P12 = 0.1,P20 = 100,P21 = 12°)
- (PCALL 9010,P0 = 450°,P1 = 5.00,P2 = 1. 5,P3 = 2,P4 =90°,P7 = 0,P12 = 0.1,P20 = 100,P21 = 12°)
- (PCALL 9010,P0 = 540°,P1 = 1. 5,P2 = 5,P3 = 2,P4 =90°,P7 = 0,P12 = 0.1,P20 = 100,P21 = 12°)
- (WRITE(RET))
- M30
- 將編制好的演算子程序在機床中運行,生成一個新的磨削子程序P8000。在實際加工中,將P8000連接到主程序中即可實現(xiàn)刀片的磨削。
- %LINE,MX,