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:

Tool Inspection for Generic Lathe Post


Recommended Posts

Hello and for those who want to use the Tool inspection in lathe I have found an issue I wanted to make other user aware of. When you used even the generic process and are using CCS you will not get that carried over. You will only get RPM output. However I have found an easy fix and wanted to share that. As always use at your own risk and 5th Axis CG Inc. takes no responsibility or implies any warranty with this information.

Generic Fanuc 4X MT Lathe Post Tool Inspection point:

ptool_insp      #Tool inspection point
      #Modify following lines to customize output for tool inspection points
      if posttype$ = two, #Lathe tool inspection point
        [
        "(TOOL INSPECTION POINT - POST CUSTOMIZATION MAY BE REQUIRED)", e$
        if prmcode$ = 29999, #Only output tool insp comment if one was entered with this insp point
          [
          sparameter$ = ucase(sparameter$)
          pbld, n$, *sm00, sopen_prn, sparameter$, sclose_prn, e$
          ]
        else, pbld, n$, *sm00, e$      #Output just the stop if no comment
        pbld, n$, *sgcode, *toolno, e$ #Restate tool number
        pbld, n$, pfsgplane, e$        #Restate plane code
        prpm # Output programmed RPM   #Restate spindle
        prv_feed = c9k                 #Set prv_values to c9k to force them out with next moves
        prv_gcode$ = c9k
        prv_workofs$ = c9k
        if coolant$, prv_coolant$ = c9k
        ]
      else, #Mill tool inspection point
        pbld, n$, *sm00, "(TOOL INSPECTION POINT - POST CUSTOMIZATION REQUIRED)", e$

Here is what was changed to support CCS and RPM if used in an operation with Tool inspection:

ptool_insp      #Tool inspection point
      #Modify following lines to customize output for tool inspection points
      "(TOOL INSPECTION POINT)", e$
      if prmcode$ = 29999, #Only output tool insp comment if one was entered with this insp point
        [
        sparameter$ = ucase(sparameter$)
        pbld, n$, *sm00, "(", sparameter$, ")", e$
        ]
      else, pbld, n$, *sm00, e$      #Output just the stop if no comment
      pbld, n$, *sgcode, *toolno, e$ #Restate tool number
      if css_actv$, #Output RPM Limit and CCS or RPM if used in operation at Tool inspection point
        [
        pbld, pcssg50
        pcss
        ]
      else, # Direct RPM was programmed
        [
        prpm # Output programmed RPM
        ]
      prv_feed = c9k                 #Set prv_values to c9k to force them out with next moves
      prv_gcode$ = c9k
      prv_workofs$ = c9k
      if coolant$, prv_coolant$ = c9k

 

  • Like 2
Link to comment
Share on other sites

Below is some of the modifications that I have made to my generic lathe post.

Maybe someone will find it useful.

 

I have incorporated logic so that the post will output all of the information needed to do a complete restart even after hitting the reset button on the control.   

 

My basic lathe post outputs block numbers based upon the Operation number from Mastercam.  In combination with my setup sheets, the operator can restart the program from the beginning of almost any operation (if force tool change is checked)

Inside the roughing operation that has the tool inspection turned on, I have reinitialized the block numbers so that for that roughing operation the block numbers will start at N1, but will revert back to the block numbers matching the Operation number.

I added a comment so that the operation number can be verified by the operator

 image.png.255962f6f0cc97c68c2da814a4ad313c.png

 

I also have logic in this post so that the turret will rotate up or down by a variable in the post so that the operator can easily access the insert and inspect and change it if needed.

 

As posted:

image.thumb.png.ecbb1fb9362af1d72c5cd6d1d9a3b1e0.png

 

 

 

Here is the code from the post:

ptool_insp      #Tool inspection point

      #Modify following lines to customize output for tool inspection points

      if posttype$ = two, #Lathe tool inspection point

        [

        n_insp  = n_insp + 1,

 

        "(TOOL INSPECTION POINT)", e$

        "G28 U0", e$

        "G28 W0", e$

 

          pturinsp

           

 

        if prmcode$ = 29999, #Only output tool insp comment if one was entered with this insp point

          sparameter$ = ucase(sparameter$)

         

 

          *e$  #blank line

          *e$

          *e$

 

          pbld, n$, *sm00, "(", sparameter$, ")", e$

 

          *e$

          *n_insp, "( BLOCK NUMBER FOR RESTART INSIDE OP ", *op_no,  ") ", e$

          !spaces$

          spaces$ = zero

          scomm_str, sopcomm, scomm_end, e$

 

          *e$

          *e$

          *e$

 

        pbld, n$, "G0" *toolno, e$ #Restate tool number

        pbld, n$, pfsgplane, e$        #Restate plane code

        prpm, pfspindle_l, e$   #

        pspindle ,  e$  # Output programmed RPM   #Restate spindle

 

        pcss, e$

        pbld, n$, "G99 ", e$

        *Scoolantx, e$

 

        prv_feed = c9k                 #Set prv_values to c9k to force them out with next moves

        prv_gcode$ = c9k

        prv_workofs$ = c9k

        if coolant$, prv_coolant$ = c9k

        ]

      else, #Mill tool inspection point

        pbld, n$, *sm00, "(TOOL INSPECTION POINT - POST CUSTOMIZATION REQUIRED)", e$

 

 

pturinsp

 

          tur_insp = (t$ + tur_insp_no) * 100

          if tur_insp_no > 0,

             [

          if tur_insp >= tur_loc, tur_insp = tur_insp - tur_loc

          *tur_insp,  e$

          else, *tur_insp,  e$

             ]

          else,

             [

          if tur_insp <= zero , tur_insp = tur_insp + tur_loc

          *tur_insp,  e$

          else, *tur_insp, e$

             ]

 

There are several variables that need to be initialized.

image.png.0a8a28314c5d1aad63c770022a3b92e4.png

 

 image.png.f7e308f57939de5552a1725b1161afeb.png

If the tur_insp_no is minus, the turret will rotate up, if it is positive the turret will rotate down.

            

  • Like 3
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...