1 引言
2 WAM336数控磨床电器系统技术改造
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 宏程序可完成磨削四个直线面的加工程序编制。在实际应用中,可根据图纸和工艺要求,通过在演算子程序中连续呼叫SUB9011宏程序来完成磨削任意直线面的加工编程。为此,首先需要建立一个演算子程序(即呼叫子程序),然后在该程序中对参数进行赋值,即可完成加工程序的编制。需要赋值的参变量包括:初始上料角度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 宏程序,可实现磨削任意形状圆弧面的加工程序编制。使用时,通过对参数赋值即可完成加工程序编制。需赋值的参变量包括:初始磨圆角P0,X 中心坐标P1,Y 中心坐标P2,圆弧半径P3,圆弧转角P4,切线角度P7,圆弧分度P12,圆弧速度P20,外接圆半径P21。
图
- 加工实例
- 现以磨削加工如图所示刀片为例,说明如何调用宏程序SUB9010、SUB9011 和建立演算子程序。
- 该刀片需要加工的尺寸包括二个直线面(14mm×7mm)和四个圆弧面(4-R2mm)。根据工艺要求,首先磨削直线面,再依次磨削圆弧面。刀片初始上料角度为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连接到主程序中即可实现刀片的磨削。
- %LINE,MX,