MasterCAM编程后处理二次开发 ( 3轴)

技术小编 5037 0




在模具、航空航天等行业中,数控铣削加工中的三轴联动切削应用最为广泛。

MasterCAM系统提供了如FANUCMAHOHeidenhaneCentury6X等众多数控系统的三轴铣削编程后处理程序,但是由于在程序起始控制、刀具说明、输出格式、程序传输等方面各数控系统有所差异,且企业为实现其程序的可读性、简洁性、可复用性、易管理性、减少手工的修改量等方面的要求,必须对后处理程序进行二次开发。


下面为针对典型的数控系统,如FANUCCentury6X等对象,在输出格式、程序起始、刀具等方面介绍了如何修改其后处理程序,并以实例的形式进行了说明。


 (1)字符输出格式的控制

下面的内容主要用于单位输出和精度等方面的控制,系统可以mmμm为单位输出,同时对小数点后的输出精度、绝对值和增量值进行输出控制。

系统参数变量fs2存储不同的数字115,实现其输出格式的控制。

        # Formatstatements - n=nonmodal, l=leading, t=trailing, i=inc, d=delta
        #Default english/metric position format statements
        fs2 10.7 0.6  #Decimal, absolute, 7 place, default for initialize (:)
        fs2 20.4 0.3  #Decimal, absolute, 4/3 place
        fs2 30.4 0.3d #Decimal, delta, 4/3 place
        #Common format statements
        fs2 41 0 1 0  #Integer, not leading
        fs2 52 0 2 0l #Integer, force two leading
        fs2 63 0 3 0l #Integer, force three leading
        fs2 74 0 4 0l #Integer, force four leading
        fs2 90.1 0.1  #Decimal, absolute, 1 place

 

(2)程序起始说明与控制

 主要用于实现其程序起始在加工产品对象、坐标系定义等方面的规范控制。

# Startof File and Toolchange Setup
        psof0  #Start of file for tool zero
        ……
        "%", e
        # *progno, e
        "", sprogname, "", e
        "(Product:)", e
        pbld,"", *smetric, e
        pbld,"", "", "", "", "","", "", e
        ……
        if stagetool>= zero, pbld,"", *t,"M6","(Tools:)", e
        pindex
        if mi1 > one, absinc = zero
        pcan1, pbld,"", "G00 G17 G40 G49 G80 G54", *sgabsinc, pwcs,pfxout, pfyout,
        "", *speed, *spindle, pgear, strcantext, e
        pbld,"", "G43", *tlngno, pfzout, scoolant, next_tool, e
        ……
        c_msng #Single tool subprogram call


 (3)刀具交换与注释说明

用于刀具交换及返回参考点等方面的控制功能。

 ptlchg #Tool change
         pcuttype
         toolchng = one
         if mi1 = one, #Work coordinate system
         [   pfbld, "", *sg28ref, "", "Y200.", e   pfbld, "", "G92", *xh, *yh, *zh, e  ]
         pbld,"", "M01", e
         pcom_moveb
         c_mmlt #Multiple tool subprogram call
         ptoolcomment

 comment
         pcan
         pbld,"", *t, "M6","(Toolnotes:)", e
         ……
         c_msng #Single tool subprogram call 


   (4)程序结束输出控制

不同的数控系统在程序结束时有所不同,下述代码为例。
        pretract  #End of tool path, toolchange 

        ……
        pcan
        pbld,"", sccomp, psub_end_mny, e
        pcan1, pbld,"", "", "G00 G49", "G30Z250.M05", scoolant, strcantext, e
        pbld,"", *sg28ref, "", "Y50.", "", e
        pcan2
        absinc = sav_absinc
        coolant = sav_coolant


    (5)数据传输与系统设置

下面的参数分别用于数控程序传输和系统参数的设置。例如,程序传输方面实现波特率为1200,数字位7位,2位停止位,偶校验,ACSII码输出控制等。

容许旋转工作台联动,机床回原点和参考点为激活状态,采用绝对坐标方式,G54为工作坐标系,以G28方式回参考点。

         80. Communicationsport number for receive and transmit (1 or 2) ? 2
         81. Data rate (600,1200,2400,4800,9600,14400,19200,38400)? 1200
         82. Parity (E/O/N)? E
         83. Data bits (7 or 8)? 7
         84. Stop bits (1 or 2)? 2
         85. Strip line feeds? N
         86. Delay after end of line (seconds)? 0
         87. Ascii, Eia, or Binary (A/E/B)? A

         161. Enable Home Position button? y
         162. Enable Reference Point button? y

        163.Enable Misc. Values button? y
         164. Enable Rotary Axis button? Y
         301. Work Coordinates [0-1=G92, 2=G54's] (mi1)? 2
         302. Absolute or Incremental [0=ABS, 1=INC] (mi2)? 0
         303. Reference Return [0=G28, 1=G30] (mi3)? 0


下图为某零件的三轴数控铣削加工刀具轨迹示意图,根据FANUC 6MCentury 6X数控系统的特点,分别修改其后处理程序,实现数控程序输出的零手工修改,从而提高数控程序的编制及输出的质量和效率。

三轴铣削加工轨迹示意图


下图分别是与相应 数控系统匹配的程序代码。


FANUC 6M数控系统程序代码


Century 6X数控系统程序代码


四、结束语





抱歉,评论功能暂时关闭!