Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Tranform/Translate drill toolpath


Recommended Posts

I'm stuck... If I create a drill toolpath in Toolpath Group #1 and post it posts as expected. Now if I create a Toolpath Group #2 and Transform/Translate the previous drill toolpath it does not post out correctly. I think the issue is in the pdrlcommonb section. I know it is not retaining the clearance plane, but I just cant find where. Thank you for your help in advance.

 

How it should look

(CENTER DRILL)
X-3.525 Y0. Z2.
G94
G98 G81 X-3.525 Y0. Z0.73 R1.0051 F10.
G80

How it posts

(CENTER DRILL)
X-3.525 Y0. Z2.
G00 Z9999.
G94
G98 G81 X-3.525 Y0. Z0.73 R9999. F10.
G80
# --------------------------------------------------------------------------
# Drilling
# --------------------------------------------------------------------------
pdrill0$         #Pre-process before drill call
      sav_dgcode = gcode$ #Capture gcode for 5 axis drill

pdrlcommonb     #Canned Drill Cycle common call, before
      if sav_dgcode = 81,
        [
        if drillcyc$ = three, drlgsel = fsg1(-ss$) + drillcyc$ * two
        else, drlgsel = fsg2(dwell$) + drillcyc$ * two
        if clearflg = one & clearstrt = zero, drillref = zero
        else, drillref = one
        if absinc$, result = force(refht_i, refht_i)
        else, result = force(refht_a, refht_a)
        ]
      result = newfs (two, zinc)

      if drillcyc$ = 3,
        [
        if mi6$, use_pitch = 1
        else, use_pitch = sav_use_pitch
        ]

      pcom_moveb
      feed = fr_pos$
      comment$
      pcan
      pbld, n$, sgabsinc, e$

      #ABSOLUTE
      if cuttype = one,
        [
        initht_a = initht$ + (rotdia$ / two)   #Initial Height Abs
        refht_a = refht$ + (rotdia$ / two)     #Reference Height Abs
        tosz_a = tosz$ + (rotdia$ / two)       #Top of Stock Abs
        ]
      if cuttype = three,          #W is the current position during Gcode 11, it give refht for drill5ax
        [
        initht_a = w$ + (initht$ - refht$)     #Top of Stock Abs
        refht_a = w$                           #Initial Height Abs
        tosz_a = w$ + (tosz$ - refht$)         #Reference Height Abs
        ]
      if cuttype = zero | cuttype = two,
        [
        initht_a = initht$                     #Initial Height Abs
        refht_a = refht$                       #Reference Height Abs
        tosz_a = tosz$                         #Top of Stock Abs
        ]
      if sav_dgcode <> 100 & fmtrnd(initht_a) <> fmtrnd(prv_zabs) & opcode$ = 3,   #if using a ref point you need to update the XYZ coord before calling the drill cycle
        [                                                                        #this applies to ref points with opcode 3 only
        zabs = initht$
        zinc = initht$ - prv_zabs
        sav_gcode = gcode$
        if convert_rpd$ = one,
          [
          gcode$ = one
          feed = maxfeedpm
          ipr_type = zero
          ]
        else, gcode$ = zero
        pbld, n$, sgabsinc, *sgcode, pxout, pyout, pfzout, e$
        gcode$ = sav_gcode
        ]
      if cuttype = one, zabs = depth$ + (rotdia$ / two)          #Depth Abs
      if cuttype = three, zabs = w$ + (depth$ - refht$)          #Depth Abs
      if cuttype = zero | cuttype = two, zabs = depth$           #Depth Abs

      #INCREMENTAL (references absolute calcs)
      if drillref = 1,       #(Inc from refth)
        [
        initht_i = initht_a - refht_a                              #Initial Height Inc
        refht_i = 0                                                #Reference Height Inc
        tosz_i = tosz_a - refht_a                                  #Top of Stock Inc
        ]
      else,                  #(Inc from initht)
        [
        initht_i = 0                                               #Initial Height Inc
        refht_i = refht_a - initht_a                               #Ref Height Inc
        tosz_i = tosz_a - initht_a                                 #Top of Stock Inc
        ]
      zinc = zabs - refht_a                                                    #Depth Inc  

      if haas,
        [
        result = nwadrs(stri,peck1$)
        result = nwadrs(strj,peck2$)
        result = nwadrs(strk,peckclr$)
        ]

    pbld, n$, sgfeed, e$

prdrlout        #R drill position
      if absinc$ = zero, refht_a, !refht_i
      else, refht_i, !refht_a

pdrlxy          #Drill XY coordinates
      if force_dpts, pfxout, pfyout
      else, pxout, pyout

pdrill$          #Canned Drill Cycle
      pdrlcommonb
      pcan1, pbld, n$, *sgdrlref, *sgdrill, pdrlxy, pfzout, pcout, pindexdrl,
        prdrlout, [if dwell$, *dwell$], *feed, strcantext, e$
      pcom_movea

ppeck$           #Canned Peck Drill Cycle
      pdrlcommonb
      pcan1, pbld, n$, *sgdrlref, *sgdrill, pdrlxy, pfzout, pcout, pindexdrl,
        prdrlout, *peck1$, [if haas, *peck2$, *peckclr$], *feed, strcantext, e$
      pcom_movea

pchpbrk$         #Canned Chip Break Cycle
      pdrlcommonb
      pcan1, pbld, n$, *sgdrlref, *sgdrill, pdrlxy, pfzout, pcout, pindexdrl,
        prdrlout, *peck1$, *feed, strcantext, e$
      pcom_movea

ptap$            #Canned Tap Cycle
      pdrlcommonb
      #RH/LH based on spindle direction
      if rigid_tap, pbld, n$, *sm29, *speed, e$           #Rigid Tapping
      if use_pitch = 0,
        [
        pcan1, pbld, n$, *sgdrlref, *sgdrill, pdrlxy, pfzout, pcout, pindexdrl,
          prdrlout, [if peck1$, *peck1$], *feed, strcantext, e$
        ]
      else,
        [
        if metvals, pitch = n_tap_thds$  # Tap pitch (mm  per thread)
        else, pitch = 1/n_tap_thds$       # Tap pitch (inches per thread)
        pcan1, pbld, n$, *sgdrlref, *sgdrill, pdrlxy, pfzout, pcout, pindexdrl,
          prdrlout, [if peck1$, *peck1$], *pitch, !feed, strcantext, e$
        ]
      pcom_movea

pbore1$          #Canned Bore #1 Cycle
      pdrlcommonb
      pcan1, pbld, n$, *sgdrlref, *sgdrill, pdrlxy, pfzout, pcout, pindexdrl,
        prdrlout, [if dwell$, *dwell$], *feed, strcantext, e$
      pcom_movea

pbore2$          #Canned Bore #2 Cycle
      pdrlcommonb
      pcan1, pbld, n$, *sgdrlref, *sgdrill, pdrlxy, pfzout, pcout, pindexdrl,
        prdrlout, *feed, strcantext, e$
      pcom_movea

pmisc1$          #Canned Misc #1 Cycle
      pdrlcommonb
      pcan1, pbld, n$, *sgdrlref, *sgdrill, pdrlxy, pfzout, pcout, pindexdrl,
        prdrlout, shftdrl$, [if dwell$, *dwell$], *feed, strcantext, e$
      pcom_movea

pmisc2$          #Canned Misc #2 Cycle (User Option)
      pdrill$

pdrill_2$        #Canned Drill Cycle, additional points
      pdrlcommonb
      pcan1, pbld, n$, pdrlxy, pzout, pcout, pindexdrl, prdrlout, dwell$,
        feed, strcantext, e$
      pcom_movea

ppeck_2$         #Canned Peck Drill Cycle
      pdrlcommonb
      pcan1, pbld, n$, pdrlxy, pzout, pcout, pindexdrl, prdrlout, feed, strcantext, e$
      pcom_movea

pchpbrk_2$       #Canned Chip Break Cycle
      ppeck_2$

ptap_2$          #Canned Tap Cycle
      pdrlcommonb
      pcan1, pbld, n$, pdrlxy, pzout, pcout, pindexdrl, prdrlout, strcantext, e$
      pcom_movea

pbore1_2$        #Canned Bore #1 Cycle
      pdrill_2$

pbore2_2$        #Canned Bore #2 Cycle
      pdrill_2$

pmisc1_2$        #Canned Misc #1 Cycle
      pdrill_2$

pmisc2_2$        #Canned Misc #2 Cycle
      pdrill_2$

pdrlcst$         #Custom drill cycles 8 - 19 (user option)
      #Use this postblock to customize drilling cycles 8 - 19
      pdrlcommonb
      #if drillcyc = 8, pcan1, pbld, n$, *sgdrlref, *sgdrill, pdrlxy, pfzout, pcout, pindexdrl,
      #  prdrlout, dwell, *feed, strcantext, e$
      if drillcyc$ = 8,
        [
        sub_prg_call = peck1$
        pcan1, pbld, n$, *sg00, *sgabsinc, pfxout, pfyout, pfcout, pindexdrl, strcantext, e$
        pbld, n$, "M98", *sub_prg_call, e$
        ]
      else, "CUSTOMIZABLE DRILL CYCLE ", pfxout, pfyout, pfzout, pfcout, pindexdrl, e$
      pcom_movea

pdrlcst_2$       #Custom drill cycles 8 - 19, additional points (user option)     
      #Use this postblock to customize drilling cycles 8 - 19
      pdrlcommonb
      #if drillcyc = 8, pcan1, pbld, n$, pdrlxy, pzout, pcout, pindexdrl, prdrlout, dwell,
      #  feed, strcantext, e$
      if drillcyc$ = 8,
        [
        sub_prg_call = peck1$
        pcan1, pbld, n$, *sg00, *sgabsinc, pfxout, pfyout, pfcout, pindexdrl, strcantext, e$
        pbld, n$, "M98", *sub_prg_call, e$
        ]
      else, "CUSTOMIZABLE DRILL CYCLE ", pfxout, pfyout, pfzout, pfcout, pindexdrl, e$
      pcom_movea

pcanceldc$       #Cancel canned drill cycle
      result = newfs (three, zinc)
      if drillref = 0, zabs = initht_a               #Make the initht the modal Z value
      else, zabs = refht_a
      prv_zia = zabs
      !zabs
      ps_inc_calc
      prv_gcode$ = zero
      if cool_zmove = yes$ & (nextop$=1003 | (nextop$=1011 & t$<>abs(nexttool))), coolant$ = zero
      pcan
      if drillcyc$ <> 8, pcan1, pbld, n$, "G80", scoolant, strcantext, e$
      pbld, n$, sgfeed, e$
      pcan2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...