*-----shift all data according to the MCHINE ZERO indicated by the
* user in the POSTPR interaction 如果在后处理时指定了对刀点相对于编程原点的偏移量,指定坐标值如何转换。
TRANS_MATX = 0 - X_MACH ;
TRANS_MATY = 0 - Y_MACH ;
TRANS_MATZ = 0 - Z_MACH ;
*-----shift the HOME according to the MCHINE ZERO indicated by the
* user in the POSTPR interaction 如果在后处理时指定了对刀点相对于编程原点的偏移量,机床原点位置如何转换。
Xhome = X_HOME - X_MACH ;
Yhome = Y_HOME - Y_MACH ;
Zhome = Z_HOME - Z_MACH ;
*-----tool location is HOME 刀具原点
Xold = X_HOME ;
Yold = Y_HOME ;
Zold = Z_HOME ;
*-----assuming 1st tool is in the spindle, there is no need
* for tool change)
OUTPUT $ " T" CURR_TOOL ;
*-----more then one tool in this run of the Post Processor
IF_SET (NEXT_TOOL _NE_ CURR_TOOL)
OUTPUT $ " T" NEXT_TOOL ;
END_IF ;
*-----standard tool change commands. (assuming 1st tool is in
OUTPUT $ " G90 G80 G00 G17 G40 M23" ;
OUTPUT $ " G43 H" CURR_TOOL " Z" Zhome " S" SPIN_SPEED " " SPIN_DIR ;
*-----Save the first origin data for later use
IF_SET (FirstOriginChange _EQ_ YES )
XfirstOrigin = X_ORIGIN ;
YfirstOrigin = Y_ORIGIN ;
ZfirstOrigin = Z_ORIGIN ;
FirstOriginChange = NO ;
END_IF ;
*.....distance between the rotation center and the ORIGIN
TRANS_MATX = X_ORIGIN - XfirstOrigin - X_MACH ;
TRANS_MATY = Y_ORIGIN - YfirstOrigin - Y_MACH ;
TRANS_MATZ = Z_ORIGIN - ZfirstOrigin - Z_MACH ;
在这里加一行 SET_OFF CIR_INTERP ; 可以关闭圆弧插补,逼近成直线运动,精度好像默认是0.001吧,要在DFPOST里设置。五轴加工里面都要这样做的。