PowerMILL后处理修改教程

2026/4/26 16:41:55

z vector 3rd rotation axis error 代码(codes)

代码是一个预定义的元素,它的值不发生改变并驻留在代码定义段 ( 和上面的关键字定义段相似 )。 它们用来输出机床控制器代码到tape文件上,它们通常有标准的G和M地址字母。 每个代码需要和一个输出字和值相对应。 (例如,G1 0 表示快速移动代码输出 ( G0 )。 它们以以下方式定义 :- define codes function name = word format label function code value end define 范例 :-

define codes rapid = G1 0 linear = G1 1 comp on left = G2 41 comp on right = G2 42 comp off = G2 40 spindle on cw = M1 3

coolant on = M2 8 end define

G1 和G2 是G代码的标准组名称,M1 和 M2 是M代码的标准组名称。 每行中可以有一个以上的G 或M 代码,因此,在需要多个G代码和M代码时,就会出现G1 G2。

这样代码G0, G1 即代表快进和线性移动,而 G41, G42, G40 为刀具补偿。 ( 注 :- 不允许在一行中具有相同组的两个G代码 [例如,G2 40 ; G3 17 ; G2 80 ] 因为 G2 80 将覆盖 G2 40 ) 完整列表 :-

以下是后处理器可识别的功能代码名称,如果将它们设置在源代码中或定义在选项文件中,它们将输出合适的G 代码 :- absolute data bore 1 bore 2 bore 3 bore 4 bore 5 break chip change tool circle ccw circle cw clamp off

clamp on compensation off compensation on left compensation on right constant surface speed coolant off coolant on coolant on flood coolant on mist coolant on tap cycle retract deep drill drill dwell end of drill end of prog end of tape feedrate per minute feedrate per rev from gear range 1 gear range 2 gear range 3 imperial data incremental data linear metric data opt stop rapid

spin coolant off

spin cool on ccw spin cool on cw spindle on cc spindle on cw spindle off spindle rpm spline stop tap

tool length offset xy plane xz plane zy plane

以上就是后处理文件中最基本的也是最重要的元素的解释。

下面我们通过一个完整的后处理文件具体的介绍是如何来定义word、format、keys、codes的,并且对各种语法作出具体的解释。 一个完整的后处理文件通常有:定义字符段、定义字符格式段、定义键值段、定义指令值段、变量定义、程序格式段等部分组成。 machine fanucom —————— 后处理文件头

======================= 第一部分是定义字符段 define word TN ---------------------------- 定义字段; address letter = \:- \定义字段的返回值 address width = 13 field width = 25 end define 具体解释: address letter = \:- \————— 定义字段的返回值,比如在后处理文件里有“MS =C ; TN ToolType ; EM =C”,而在写程式的时候选用的是端铣刀,那么在CNC程式里就会有(TOOL TYPE:- ENDMILL); address width = 13 ——————————— 定义字符宽度,如上\:- \,从T开始算起一共13位,包括空格; field width = 25 ——————————定义返回字的宽度,如上\,如果field width = 2,那\TYPE:- \就返回EN;如果field width = 25,那\TYPE:- \就返回ENDMILL。 end define ====================== 第二段是定义字符的格式 define format ( / G6 S T M1 M2 L P D E H O ) address width = 1------------定义字符宽度

field width = 2 -------------定义返回字的宽度 exponent width = 0 ----------指数的宽度 scale factor = 1 -------------比例因子:值乘以1 scale divisor = 1 ------------比例因子:值被1除 tape position = 1-----------字前留一个空格 print position = 1 -----------打印位置 sign = none----- 用于不需要G代码和进给率。

sign = if negative 仅标识负坐标, sign = always 如果需要 + / - 号。 not permanent --------不需要行号 not

modal ------------ 仅当改变时需要重复的字为modal (模态)。 通常 G 代码和 X, Y 和 Z 坐标为modal, 但圆心通常使用的 I, J, K 代码通常不是,因此它们为not modal .(非模态) metric formats ---------------公制 leading zeros = false -----------前导0 trailing zeros = true ------------后导0 decimal point = false ------不需要小数点 decimal places = 2--------小数点后2位 imperial formats -------------英制 leading zeros = false trailing zeros = true decimal point = false decimal places = 0

end define word order = ( OP N G1 G2 G3 G4 G5 ) word order = ( + G6 G7 X Y Z B C ) word order = ( + I J K R D S T ) word order = ( + H M1 M2 MS msg EM Q )

word order = ( + Q1 Z2 R2 ID F ) word order = ( + TN TD TR DY MT YR PM ) ==========================第三段是定义键值 define keys blocknumber = N —————定义程序段号 preparatory function = G1 ——定义准备功能指令 aux function = M1 ---- 定义辅助功能指令 x feedrate not used ----定义X进给率指令 y feedrate not used ----定义Y进给率指令 z feedrate not used ——定义Z进给率指令 circle angle not used ————— 圆周角度 x coordinate = X —————定义X坐标轴 y coordinate = Y —————定义Y坐标轴 z coordinate = Z —————定义Z坐标轴 key i = I —————定义X轴矢量I键 key j = J —————定义Y轴矢量J键

key k = K —————定义Z轴矢量K键 feedrate = F —————定义进给率指令 feedrate per revolution = F--------定义每转进给率指令 spindle = S —————— 定义主轴指令 tool number = T ——————定义刀具指令 cycle dwell not used dwell = X ————— 定义暂停时间键值 tool length = H ——定义刀具长度补偿指令 tool radius = D ——定义刀具半径补偿指令 drill peck depth = Q1 ————钻孔的啄钻深度 drill hole depth = Z2 —————定义钻孔深度 clearplane = R2 ———定义安全平面高度 message start = MS ——定义注释的开始符 message end = EM ——定义注释的结束符 opskip = OP ———— 定义跳段符号 radius = R ————— 定义半径R键 program id = ID ————— 定义程序号 azimuth axis = B ----在多轴加工中,定义方位轴 elevation axis = C ——在多轴加工中,定义仰角轴 3rd rotation axis = null 在多轴加工中,定义第三旋转轴 leader not used x vector not used

y vector not used z vector not used error not used end define

=================== 定义指令值 define codes rapid = G1 0 ===== 快速点定位 linear = G1 1 ===== 直线插补 circle cw = G1 2 ===== 顺圆插补 circle ccw = G1 3 ===== 逆圆插补 dwell = G6 4 ===暂停、准确停止 xy plane = G3 17 ====== XY平面 zy plane = G3 19 ===== YZ平面 xz plane = G3 18 ===== ZX平面 compensation off = G2 40 ==取消刀具半径补偿 compensation on left = G2 41 ====刀具半径左补偿 compensation on right = G2 42 ===刀具半径右补偿 imperial data = G4 20 ===== 英寸输入 metric data = G4 21 =======毫米输入 absolute data = G5 90 ====指定绝对坐标编程 incremental data = G5 91 ====指定增量坐标


PowerMILL后处理修改教程.doc 将本文的Word文档下载到电脑
搜索更多关于: PowerMILL后处理修改教程 的文档
相关推荐
相关阅读
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 10

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219