一 前言
二 MAHO加工中心与Mastercam软件坐标系统的转换
图1
图1
图2
三 MPMAHOXZ.pst后置处理程序中坐标变换的修正
# --------------------------------------------------------------------------
# Axis output formats – Linear [坐标轴输出格式—线性]
# --------------------------------------------------------------------------
fmt X 1 x # X Axis Pos [X轴名称不变]
fmt Z 1 y # Y Axis Pos [Z轴变为Y轴]
fmt Y 1 z # Z Axis Pos [Y轴变为Z轴]
# --------------------------------------------------------------------------
# Axis output formats – Circular [坐标轴输出格式—圆形]
# --------------------------------------------------------------------------
fmt I 1 xc # Arc Center X [圆心X坐标为I]
fmt K 1 yc # Arc Center Y [圆心Y坐标变为K]
fmt J 1 zc # Arc Center Z [圆心Z坐标变为J]
# --------------------------------------------------------------------------
# Formulas - Use : instead of = to initialize variables [坐标值的比例]
# --------------------------------------------------------------------------
scalex : -1.0 # Scaling of .NCI at input - x,y,z,i,j,k [X坐标取负]
scaley : 1.0 # Scaling of .NCI at input - x,y,z,i,j,k [Y符号不变]
scalez : 1.0 # Scaling of .NCI at input - x,y,z,i,j,k [Z符号不变]
# --------------------------------------------------------------------------
现在仅需要修改坐标值的比例部分就可以使后置出来的程序坐标系统无需另外更改了,以下为改正后的内容:
# --------------------------------------------------------------------------
scalex : 1.0 # Scaling of .NCI at input - x,y,z,i,j,k [X坐标不变]
scaley : -1.0 # Scaling of .NCI at input - x,y,z,i,j,k [Y坐标取负]
scalez : 1.0 # Scaling of .NCI at input - x,y,z,i,j,k [Z符号不变]
# --------------------------------------------------------------------------
四 后置处理程序中程序头尾的完善
fmt 9 stck_x [定义Mastercam中毛坯中心点X坐标]
fmt 9 stck_y [定义Mastercam中毛坯中心点Y坐标]
fmt 9 stck_z [定义Mastercam中毛坯中心点Z坐标]
fmt 9 stck_ht [定义Mastercam中毛坯长度]
fmt 9 stck_wdth [定义Mastercam中毛坯宽度]
fmt 9 stck_thck [定义Mastercam中毛坯高度]
fmt 9 blk_xmin [定义MAHO立式状态下毛坯起点X坐标]
fmt 9 blk_ymin [定义MAHO立式状态下毛坯起点Y坐标]
fmt 9 blk_zmin [定义MAHO立式状态下毛坯起点Z坐标]
fmt 9 blk_hztwd [定义MAHO立式状态下毛坯高度增量]
blk_xmin=stck_x-stck_ht/2 [计算MAHO立式状态下毛坯起点X坐标值]
blk_zmin=-(stck_y-stck_wdth/2) [计算MAHO立式状态下毛坯起点Z坐标值]
blk_ymin=stck_z-stck_thck [计算MAHO立式状态下毛坯起点Y坐标值]
blk_hztwd=-stck_wdth [计算MAHO立式状态下毛坯高度方向的增量]
pheader
"%PM"
progno
n, "M54" [加入立铣头回位指令]
n, "G18" [加入G18平面指令]
n, "G54" [由G52改为G54,G52只是参考点的暂存值,很容易被误修改]
n, "G98","X",blk_xmin,"Y",blk_ymin,"Z",blk_zmin,"I",stck_ht, "J",stck_thck,"K",blk_hztwd [加入切削模拟范围指令]
n, "G99","X",blk_xmin,"Y",blk_ymin,"Z",blk_zmin,"I",stck_ht, "J",stck_thck,"K",blk_hztwd [加入毛坯范围指令]
n, "G90" [加入绝对坐标指令]
psof0 # Start of file for tool zero
pinit
n, "G0 A0 B0 M13" [加入A、B坐标回零指令]
n, pcoolon
psof # Start of file for non-zero tool number
pinit
n, ss, t, "M6","(D",tldia,")" [加入刀具直径辅助说明]
n, "G0 A0 B0 M13" [换刀后A、B坐标再次回零,防止操作者换刀后检测工件后误动作A、B坐标,确保在下一刀时参考点回位]
……
n, "G53" [撤消G54参考点]
n, "G0 X780 Y450 Z450" [机床回到检测工件位置]
n, "G0 A0 B0" [在机床坐标系统下回零]
n, "M30"