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:

Removing G95 from tap cycle?


Guest Burnt
 Share

Recommended Posts

Guest Burnt

I know this may be a stupid question but I can figure out how to remove the G95 from my tapping cycle. Our Matsuura's are older with Yasnac controllers and they read G95 as an invalid g code but the rigid tap m code puts the machine in rev per pitch anyways.

ptap$            #Canned Tap Cycle
      pdrlcommonb
	  if peck2$ <> zero, pbld, n$, "M0 (LUBE TAP)", e$		# CK 3/27/17
	  pbld, n$, sgfeed, e$		#Added for Lube Tap M0 - CK 3/27/17
      #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

I would assume that it is in ptap$ else statement somewhere but I just can't put on finger on it. Is it possibly in pdrlcommonb?

Link to comment
Share on other sites
6 minutes ago, civicegg said:

:ph34r:

use_pitch   : 0     #0 = Use feed for tapping, 1 = Use pitch for tapping

Please read the question. He wants pitch output, but the machine doesn't like G95.

Quote

Our Matsuura's are older with Yasnac controllers and they read G95 as an invalid g code but the rigid tap m code puts the machine in rev per pitch anyways.

Here is where it is called:

# --------------------------------------------------------------------------
# Feed mode G code selection
sg94    : "G94"      #UPM
sg94d   : "G94"      #DPM, See pfcalc_deg if you use another gcode
sg93    : "G93"      #Inverse
sg95    : "G95"      #UPR        #set with mi6$
sgfeed : ""          #Target for string

fstrsel sg94 ipr_type sgfeed 4 -1

You could just delete the G95 and leave "" and that would work.

Or you can search for the mi6$ and see where it is used.

pfcalc_u_min    #Feedrate unit/min
      ipr_type = zero
      feed = fr_pos$
      if feed > maxfeedpm, feed = maxfeedpm
      if feed < minfeedpm, feed = minfeedpm
      prvfrdeg = feed
      if mi6$ = 1 | ((opcode$ = 3 | opcode$ = 16) & drillcyc$ = 3 & use_pitch),
        [
        ipr_type = 3
        result = newfs(two,feed)
        feed = feed/speed
        ]
      else, result = newfs(15,feed)

If one rabbit doesn't take you where you need you follow the next rabbit. That is the wrong rabbit following mi6$

If we follow the original rabbit of sgfeed. If you follow it all the way through the post we find it here at the bottom.

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 num_pts = 1 & zabs <> refht_a & drillref = 1 & sav_dgcode <> 100 & opcode$ = 3,
        [
        zabs = refht$
        zinc = refht$ - 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$

I am thinking if you put a # in front of that last line the G95 wouldn't be output since seems to be the line where the post outputs the G95 when used. Without using the debugger and making sure I am guessing at this point, but hopefully have given a good way to hunt down the process to figure it out.

Link to comment
Share on other sites

Still wanting to use the pitch for tapping, just don't need the G95. Setting use_pitch = 0 won't fix the issue since the machine automatically puts itself into feed per rev with its G93 for rigid tapping anyways. For some reason that spits out a G94 to cancel rigid tapping immediately followed by a G93 to put it back into rigid tapping. Definitely seems tied to use_pitch though since it didn't output a G95.

 

Edit: You were quicker then me C^Millman:) but I'll start down that bread crumb trail.

Link to comment
Share on other sites

Took the easy way out and just set sg95 to "". Blocking the "pbld, n$, sgfeed, e$" line just moved the G95 to the end of the tapping cycle so that rabbit hole is going to go even deeper and setting sg95 to "" works fine. Thanks for the guidance guys!

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...