MasterCAM9.1的刀具清单功能(最新整理)_第1页
MasterCAM9.1的刀具清单功能(最新整理)_第2页
MasterCAM9.1的刀具清单功能(最新整理)_第3页
已阅读5页,还剩16页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、mastercam9.1 后处理自动生成刀具清单,使用方法:将下面的内容复制到记事本内,并将其更名为 mpfan.pst,pst 为后缀,再将该文件 拷贝至 mastercam9.1 的安装目录 c:mcam9millposts,覆盖原文件,然后启动软件, 可以在 nc 程序开头生成刀具清单。经典版本,绝对好用!# post name: mpfan# product: mill# machine name: fanuc# control name: 6m# description: generic fanuc 6m style post# associated post:# mill/turn

2、: no # 4-axis/axis subs.: no# 5-axis: no# executable: mp 4.03 # * # *-*# *post processor intended for version 6 beta testing*# *# * d o n o t d i s t r i b u t e ! !* # *# * # #| revision log|# # programmers note:# cnc8/15/2005 - grt - updated for mill version 6 # #| features:|# # users note:# follo

3、wing misc_reals & misc_integers are used: # mi1 - work coordinate system#0 = reference return is generated and g92 with the#x, y and z home positions at file head.#1 thru 3 = reference return is generated and g92 with the #x, y and z home positions at each tool.#4 thru 9 = the wcs of g54 thru g59 re

4、spectively at each tool. # options / usage:# it is recommended to start and end cutter compensation on a linear move. # rotary axis assumes a z plunge at feed into part, position of the# substituted axis at absolute zero position and the retraction from path # by the post call to the g28 machine z h

5、ome position.# # debug/program switches, debugging and program switches # bug1: 1# 1 = output post to screen, 2 = output leader to screenbug2: 0# append postline labels, non-zero is column position?bug3: 0# append whatline no. to each nc line?bug4: 0# append nci line no. to each nc line?whatno: yes#

6、 do not perform whatline branches?strtool_v7 : 2#use version 7 toolname, 1= path components, 2=string get_1004: 1#find gcode 1004 with getnextop?rpd_typ_v7 : 1#use version 7 style contour flags?arcoutput : 2# 0 = ijk, 1 = r no sign, 2 = r signed neg. over 180 breakarcs : 0#break arcs, 0 = no, 1 = qu

7、adrants, 2 = 180deg. max arcsstagetool : 0# 0 = do not pre-stage tools, 1 = stage tools use_gear: no# set to yes to output gear range codes# # format statements - n=nonmodal, l=leading, t=trailing, i=inc, d=delta # fs10.3#decimal, absolute, 4 placefs20.4d#decimal, deltafs31 0#integer, not leadingfs4

8、2 0l#integer, two leadingfs53 0l#integer, three leadingfs64 0l#integer, four leadingfs70.1#decimal, absolute, 1 placefs80.2#decimal, absolute, 2 placefs90.3#decimal, absolute, 3 placefs10 0 4t#no decimal, absolute, four trailingfs11 0.4t#decimal, absolute, four trailing# # format assignments# # axis

9、 output formats - linear# fmtx 1 x# x axis positionfmty 1 y# y axis positionfmtz 1 z# z axis positionfmtx 1 xr# x rapid position from tool changefmty 1 yr# y rapid position from tool changefmtz 1 zr# z rapid position from tool changefmtx 1 xh# x home positionfmty 1 yh# y home positionfmtz 1 zh# z ho

10、me position# # axis output formats - circular# fmti 2 i# arc center description in xfmtj 2 j# arc center description in yfmtk 2 k# arc center description in zfmtr 1 arcrad# arc radiusfmtr- 1 arcradm# arc radius over 180 degree sweep# # axis output formats - rotary substitution# fmta 9 xs# linear to

11、rotary calculation of xfmtb 9 ys# linear to rotary calculation of y# # program & sequence number format# fmto 6 progno# program numberfmtn 3 n# sequence nos.# # tool format# fmtt 3 t# tool nofmtt 3 first_tool# first tool used (bldnxtool: yes) fmtt 3 next_tool # next tool used(bldnxtool: yes) fmtd 3

12、tloffno# diameter offset nofmth 3 tlngno# length offset nofmt t 1 tnote # note format fmt d- 1 toffnote # note format fmt h- 1 tlngnote # note format fmt dia- 2 tldia # note format# # spindle speeds & feedrate output formats# fmts 6 speed# spindle speedfmtf 8 fr# feedratefmtf 7 frdeg# feedrate for r

13、otaryfmtm 3 gear# gear range# # drill variable formats# fmtg 3 drillref# initial / reference toggle (g98/g99)fmtp 10 dwell# dwellfmtz 1 initht# initial heightfmtr 1 refht# reference heightfmtz 1 depth# depthfmtq 2 peck1# first peck increment (positive)fmt1 peck2# second or last peck (positive)fmt1 p

14、eckclr# safety distancefmt1 retr# retract heightfmtf 8 frplunge# plunge feedrate in drill cycles# # miscellaneous output formats# fmtm 5 ssrange# spindle speed rangefmtc 4 coolant# coolant# # initialize - initialize system variables and define user variables # qtoolpln: no# mp386 - enable tool plane

15、 optionqtoolopt: no# mp386 - enable tool optimizationarctype: 2# arc center 1=abs, 2=st-ctr, 3=ctr-st, 4=unsigned inc. do_full_arc : 0#allow full circle output? 0=no, 1=yeshelix_arc: 0#support helix arc output, 0=no, 1=all planes, 2=xy plane only bldnxtool : yes# build next tool tableldrcode: 65# le

16、ader character dec. equiv. (fleader outputs code) ncldr: 20# no. of leader characters (fleader outputs code) nobrk: no# omit breakup of x/y & z rapid movesomitcrlf: no# omit cr/lfomitrefht : no# dont use reference height on first non-canned z move omitseq: yes# omit sequence no.omitz: no# omit first

17、 z movement for non-canned-cycles progname: 1# use uppercase for program namescalex : 1.0 # scaling of .nci at input - x,y,z,i,j,k scaley : 1.0 # scaling of .nci at input - x,y,z,i,j,k scalez : 1.0 # scaling of .nci at input - x,y,z,i,j,k seqmax : 9999 # max. sequence no.skipmotest: no# skip motion

18、test in linearspaces : 1# no. of spaces to add between fields tooltable : 1# read for tool table and pwrttabsswp: 0# absolute sweep drlgsel: -1# drill select initializemaxfrdeg: 9999# limit for feed in deg/minabsinc: 0# absolute/incremental toggle for modality tcnt: 0# count the number of tool chang

19、esadelta: 0# calculation for deg/min ldelta: 0# calculation for deg/min zdelta: 0# calculation for deg/min alzdelta: 0# calculation for deg/min frdelta: 0# calculation for deg/min frdegcalc : 0# calculation for deg/min circum: 0# calculation for deg/min rotstrt: 1# flag for first rotary positionnewg

20、lobal : 1# error check (leave this variable set to 1)# # formulas - global formulas# ssrange= mi3# gear range selectspeed= abs ( ss )# absolute spindle speedarcradm= arcrad# negative arcradspdlsel= fsg3(ss)# spindle on selector based on pos. or neg. ss# # canned cycles - select long or short code# u

21、secandrill : yes # use canned cycle for drillusecanpeck : yes # use canned cycle for peckusecanchip: yes# use canned cycle for chip break usecantap: yes# use canned cycle for tap usecanbore1 : yes# use canned cycle for bore1 usecanbore2 : yes# use canned cycle for bore2 usecanmisc1 : yes# use canned

22、 cycle for misc1 usecanmisc2 : yes# use canned cycle for misc2# # lookup table definitions - for math functions flook and frange # flktbl13#lookup table definitions - table no. - no. entries401000# low gear range412500# med gear range425000# hi gear range# # strings - string labels must start with s

23、 - they are not pre-assigned # #select operation notesop00null# string definitionsop01end-mill#sop02end-mill#sop03drill#sop04end-mill#sop05s-mill# sop062d-swept.# sop073d-swept.# sop08revolved.# sop09loft.#sop10coons.#sop11trim .#sop12fillet.#sop13rough.#sop14op14.#sop15op15.#sopnote# target stringf

24、strselsop00 opcode sopnote# # select motion g codesg00g0# linear movement at rapid feedratesg01g1# linear movement at feedratesg02g2# circular interpolation cwsg03sgcodeg3# circular interpolation ccw# target stringfstrselsg00 gcode sgcode# # select incremental or absolute g codesg90g90# absolute g c

25、ode sg91g91# incremental g codesgabsinc# target string fstrselsg90 absinc sgabsinc# # select spindle startsm04m4# spindle reversesm05m5# spindle offsm03m3# spindle forwardspdlon# target string fstrselsm04 spdlsel spdlon# # cutter compensation codescc0# cutter compensation state not changedsg40g40# c

26、ancel cutter compensationsg41g41# cutter compensation leftsg42g42# cutter compensation rightsg140g40# last linear move cancel cutter comp (see note)# note: to cancel comp after last move, remove g40 stringsccomp# with sg140 and remove # at the postline call pcancelcc# target stringfstrselscc0 ccomp

27、sccomp# # select work plane g codesg17g17# xy plane codesg19g19# xz plane codesg18g18# yz plane code sgplane# target string fstrselsg17 plane sgplane# # work coordinate systemsg50g92# work coordinate system g codesg51g92#sg52g92#sg53g92#sg54g54#sg55g55#sg56g56#sg57g57#sg58g58#sg59g59#sgwcs# target s

28、tring fstrselsg50 mi1 sgwcs# # canned drill cycle string selectsg81g81#drill- no dwellsg81dg82#drill- with dwellsg83g83#peck drill - no dwellsg83dg83#peck drill - with dwellsg73g73#chip break - no dwellsg73dg73#chip break - with dwellsg84g84#tap- no dwellsg84dg74#tap- with dwell (selects left hand)s

29、g85g85#bore #1- no dwellsg85dg89#bore #1- with dwellsg86g86#bore #2- no dwellsg86dg86#bore #2- with dwellsgm1g81#misc #1- no dwellsgm1dg82#misc #1- with dwellsgm2g81#misc #2- no dwellsgm2dg82#misc #2- with dwellsgdrill#target stringdrlgsel = drillcyc * 2 + fsg2 ( dwell )# 16 possible combinations:#d

30、rillcyc = 0.7#dwell= 0 or non-zero (2 states)fstrselsg81 drlgsel sgdrill# # generate sgear stringsgear0m*# auto gear rangesgear1m41# low gear rangesgear2m42# med gear rangesgear3m43# high gear range - selected in parameters by mi3sgearfstrsel sgear0 gear sgear# # postlines, user-defined -postline la

31、bels start with p. # end a line with , to continue on the next line.# end a line with , e to generate carriage return and linefeed.# # program general output control, user defined# pinit# initialize varsprv_fr = 999.999prv_frdeg = 999.999prv_frplunge = 999.999linarc = 0rotstrt = 1pabs# absolute g co

32、de output absinc = 0sgabsincpinc# incremental g code output absinc = 1sgabsincpcooloff# coolant off m code outputif prv_coolant 0, m09pcoolon# coolant off m code outputif coolant = 1, m08# flood if coolant = 2, m07# mistpcoolnl# coolant off m code outputif coolant = 0, m09# offif coolant = 1, m08# f

33、lood if coolant = 2, m07# mistpfr# feedrate w/o negative feedrates if fr 0, frpcan# canned text - cantext = 0, 1, 2, 3if cantext = 1, m01#optional stopif cantext = 2, #user optionif cantext = 3, #user option# # work coordinate output, user defined# pg92_sof# g92 coordinate setting at start/, n, pinc

34、, g28, z0., e/, n, g28, x0., y0., e/, n, *sgwcs, *xh, *yh, *zh, epg92_out# g92 coordinate setting at tool change/, n, g28, x0., y0., eif gcode 1003, /, n, *sgwcs, *xh, *yh, *zh, epwcs# g54+ coordinate setting if mi1 = 4, *sgwcs# # gear selection control, user defined# pgear# find spindle rangegear =

35、 frange ( 1, speed )*gearprange# find spindle rangeif use_gear = 1, pgear# # cutter comp. output control, user defined# pccdia2# cutter compensation2if ccomp 4, tloffnopccdia# cutter compensationif ccomp 0, pccdia2# # axis substitution motion, user defined# pdrlxyrot# substitute axis x/y with rotary

36、 axis w/ drillingif rotaxis = 0, x, y if rotaxis = 1, y, xs if rotaxis = 2, x, yspfrd# feedrate w/o negative feedrates (deg/min) if frdeg maxfrdeg, frdeg = maxfrdegif frdelta .5, *frdeg#value to exceed to output frdegprotaxis1a # substitute axis x/y with rotary axisif rotstrt = 0, n, sgcode, y, z, *

37、xs, pfrd, pcan, e if rotstrt = 1, n, xs, eif rotstrt = 1, n, sgcode, y, z, pfrd, pcan, eprotaxis1# substitute axis x/y with rotary axisif gcode = 0, n, sgcode, y, z, *xs, pcan, e if gcode = 1, protaxis1aprotaxis2a # substitute axis x/y with rotary axisif rotstrt = 0, n, sgcode, x, z, *ys, pfrd, pcan

38、, e if rotstrt = 1, n, ys, eif rotstrt = 1, n, sgcode, x, z, pfrd, pcan, eprotaxis2# substitute axis x/y with rotary axisif gcode = 0, n, sgcode, x, z, *ys, pcan, e if gcode = 1, protaxis2aprotaxis# substitute axis x/y with rotary axis if rotstrt = 1, !frif fr 0, fr = prv_fr!frif rotaxis = 1, ldelta

39、 = abs ( y - prv_y ) if rotaxis = 2, ldelta = abs ( x - prv_x ) zdelta = abs ( z - prv_z )if rotaxis = 1, adelta = ( ( abs ( xs - prv_xs ) ) / 360 ) * circum if rotaxis = 2, adelta = ( ( abs ( ys - prv_ys ) ) / 360 ) * circum alzdelta = sqrt ( adelta2 + ldelta2 + zdelta2 )frdegcalc =fr * ( 360 / cir

40、cum )if alzdelta 0, frdeg = ( adelta / alzdelta ) * frdegcalc if adelta = 0, frdeg = frfrdelta = abs ( frdeg - prv_frdeg ) if rotaxis = 1, protaxis1if rotaxis = 2, protaxis2 if gcode = 1, rotstrt = 0!x, !y, !zprotary # rotary moveif rotaxis = 1, xr = 0 #force x to zero if rotaxis = 2, yr = 0 #force

41、y to zero if rotaxis 0, linarc = 1circum = rotdia * pi# # axis linear/circular motion, user defined# parctyp2# arc output for r w/ sign over 180 degree sweepabsswp = abs ( sweep )!absswpif absswp 180, *arcradmparctyp1# arc output for r w/ no sign*arcradparctyp0 # arc output for ijkif plane = 0, *i,

42、*j, k if plane = 1, i, *j, *k if plane = 2, *i, j, *kparctyp # select the arc outputif arcoutput = 0, parctyp0 if arcoutput = 1, parctyp1 if arcoutput = 2, parctyp2prapidm # linear line movement - at rapid feedraten, sgplane, sccomp, pccdia, sgcode, x, y, z, pcanplinm# linear line movement - at feed

43、raten, sccomp, pccdia, sgcode, x, y, z, pfr, pcanpcirm# circular interpolationn,sgplane, sccomp, pccdia, sgcode, x, y, z, parctyp, pfr, pcan# # drilling, user defined# pdrillref# determine g98 or g99if initht refht, drillref = 98 if initht = refht, drillref = 99pdwell# determine whether to output dw

44、ellif dwell 0, *dwellptlchg0dr2 # null tool change for drilling gcode = 0if zr prv_zr, n, sgcode, *xr, *yr, e n, sgcode, *zr, eptlchg0drl # null tool change for drillingif prv_opcode = 3 & zr prv_zr, ptlchg0dr2# # postlines, pre-defined - postline names are pre-assigned. # lines do not need to end w

45、ith , e for carriage return and linefeed. # pcomment # manual entry - comments (on a block by itself) 1005,1006 (, scomm, )pheader# file header%(, progname,.nc)(20,year,-,month,-,day, time, )psof0# start of file for tool zeropsofpsof# start of file for non-zero tool numberpinit!opcode, !coolantif tc

46、nt = 1, stagetool = 2 prognocommentn, g40 g49 g80 g17 g21n, go g91 g28 z0.# if stagetool = 0, n, *t, m6 protaryn, *t, m6if stagetool = 0, n, *next_tooln, *sg00,*sg90,*sg54,pabs, *xr, *yr n,*speed, *spdlon, prangen, g43, tlngno, *zr, pcoolonptlchg0# null tool changeif opcode = 3, ptlchg0drlif prv_spe

47、ed speed, n, speedif coolant prv_coolant, n, pcoolnl!opcode, !coolantptlchg# tool change pinit!opcoden, pcooloff n,*sm05n, pinc, g28, z0.if stagetool = 0, n, *t, m6 if stagetool = 0, n, *next_tool n, m01comment protaryn, *sg00,pabs,*sg54, *xr, *yr n,*speed, *spdlon, prange n, g43, tlngno, *zr, pcool

48、on!coolantpeof0# end of file for tool zero peofpeof# end of file for non-zero tool n, pcooloffn, *sm05# n, pinc, g30, z0.n, g91 g28 z0.n, g91 g28 y0.if stagetool = 0, n, *first_tool, m6 n, m30%# # axis motion# prot0# toolplane postline - custom post requiredprot# toolplane postline - custom post req

49、uired prapid# linear line movement - at rapid feedrateif rotaxis 0, protaxis else, prapidmpzrapid# linear movement in z axis only - at rapid feedrate n, sgcode, zplin1# first linear movement after sof, whatno must be set plin2# second linear movement after sof, whatno must be set plin# linear line m

50、ovement - at feedrateif rotaxis 0, protaxis else, plinmpz# linear movement in z axis only - at feedrate n, sgcode, z, pfrpcir1# first circular movement after sof, whatno must be set pcir2# second circular movement after sof, whatno must be set pcir# circular interpolationif rotaxis 0, protaxis else,

51、 pcirm# # drilling# pdrill# canned drill cyclepdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, pdwell, *frplungeppeck# canned peck drill cycle pdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, *peck1, *frplungepchpbrk# canned chip break cycle pdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, *peck1, *frplungeptap# canned tap cycle pdrillrefn, *drillref, *sgdrill, pdrlxyrot,

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论