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:

lathe tool inspection


Recommended Posts

Search the post for ptool_insp

 

I have my lathe posts set up so that I can stop after a set number of minutes (controlled by Mastercam) and check and index the insert.

I also have the block number system set up so that I only output block numbers at tool changes and tool inspections.  This makes it easy for the operator to find where to restart if the insert chips and you have to stop before the tool inspection.

I also include all of the logic to restart the spindle, feed, planes, etc...  Even if they hit the reset button.

On  a Fanuc style control, you can search for the block number and then just cycle start to continue on.  

Another advantage that I found was that the operators started communicating between shifts by letting the next shift know that they finished N5, and the new operator should start with N6. 

I add a few blank lines so that when the operator looks over at the control to see why it has stopped, they can easily see that it is for a Tool Inspection.

 

Here is a sample of some of the stuff that I use for Lathe tool inspection:

 

ptool_insp      #Tool inspection point
      #Modify following lines to customize output for tool inspection points
      if posttype$ = two, #Lathe tool inspection point
        [

       "M05", e$

      "M09", e$
        "(TOOL INSPECTION POINT)", e$

        #if prmcode$ = 29999, #Only output tool insp comment if one was entered with this insp point
          sparameter$ = ucase(sparameter$)
          " ", e$
          " ", e$
          " ", e$
          " ", e$
          pbld, n$, *sm00, "( CHECK INSERT )", e$
          " ", e$
          *n$, " (BLOCK NUMBER FOR RESTART)", e$
          !spaces$
          spaces$ = zero
          scomm_str, sopcomm, scomm_end, e$

          " ", e$
          " ", e$
          " ", e$

        else, pbld, n$, *sm00, e$      #Output just the stop if no comment
        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$


        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
        ]

 


 sample output:

G0 X55.
Z1.
X70.
M05
M09
Z3.
(TOOL INSPECTION POINT)
 
 
 
 
M00 ( CHECK INSERT )
 
N6  (BLOCK NUMBER FOR RESTART)
(OP 60-7     ROUGH UNDERCUT UPPER OD FLANGE .25 BUTTON  CARBIDE)
 
 
 
G0T0202
G97S20
M03
G96S145
G99 
G0Z1.M8
X55.
Z-.6285

Edited by Bill Craven
added sample code
  • Like 2
Link to comment
Share on other sites

Hi Bill,

Thanks for posting up the sample for others to follow.

I just wanted to point out that you've got some code for outputting blank lines to the NC File, but each line actually outputs a single space character as well. You can use "*e$" to force out a blank line, while omitting the extra space.

     *e$

     *e$

That would output two empty lines to the NC File.

  • Thanks 1
Link to comment
Share on other sites
9 hours ago, Colin Gilchrist said:

Hi Bill,

Thanks for posting up the sample for others to follow.

I just wanted to point out that you've got some code for outputting blank lines to the NC File, but each line actually outputs a single space character as well. You can use "*e$" to force out a blank line, while omitting the extra space.

     *e$

     *e$

That would output two empty lines to the NC File.

Thanks Colin.  Why didn't you teach me that in one of the classes that I took from you?            (  you probably did, I just didn't absorb it  )

 

  • Like 1
Link to comment
Share on other sites
  • 3 weeks later...

I have found what I needed but coolant is not being called up after the tool inspection point. There is no M88 recalled. But it looks like there is a coolant call in the post.

(TOOL INSPECTION POINT - POST CUSTOMIZATION MAY BE REQUIRED)
M00
G00 T0101
M42
G97 S204 M3
G00 G54 Z.2
X4.9533
G01 Z.1 F.003

 

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 ((((right here, why isn't this reactivating  M88)))
        ]
      else, #Mill tool inspection point
        pbld, n$, *sm00, "(TOOL INSPECTION POINT - POST CUSTOMIZATION REQUIRED)", e$
Link to comment
Share on other sites
  • 3 weeks later...
On 3/7/2019 at 3:21 PM, Rocketmachinist said:

I have found what I needed but coolant is not being called up after the tool inspection point. There is no M88 recalled. But it looks like there is a coolant call in the post.

(TOOL INSPECTION POINT - POST CUSTOMIZATION MAY BE REQUIRED)
M00
G00 T0101
M42
G97 S204 M3
G00 G54 Z.2
X4.9533
G01 Z.1 F.003

 


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 ((((right here, why isn't this reactivating  M88)))
        ]
      else, #Mill tool inspection point
        pbld, n$, *sm00, "(TOOL INSPECTION POINT - POST CUSTOMIZATION REQUIRED)", e$

The coolant is probably not starting because using CoolantX. My work around is as follows:

 

ptool_insp      #Tool inspection point
      #Modify following lines to customize output for tool inspection points
      #Shut down coolant, M00 does not work on Fagor control
      if posttype$ = two, #Lathe tool inspection point
        [
		if all_cool_off,
          [
          #all coolant off with a single off code here
          if coolant_on, pbld, n$, sall_cool_off, e$
          ]
        else,
          [
          local_int = zero
          coolantx = zero
          while local_int < 20 & coolant_on > 0,
            [
            coolantx = and(2^local_int, coolant_on)
            local_int = local_int + one
            if coolantx > zero,
              [
              coolantx = local_int
              pbld, n$, scoolantx, e$
              ]
            ]
        ]
	pbld, n$, "M05", e$ #stop spindle
        sopen_prn, no_spc$,"MSG", no_spc$, '"', no_spc$, "TOOL INSPECTION POINT", no_spc$,'"', no_spc$, sclose_prn, 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
		sopen_prn, no_spc$,"MSG", no_spc$, '"', no_spc$, stoppcomment, no_spc$,'"', no_spc$, sclose_prn, e$ #added 24-4-2018 opperation comment on screen
        pbld, n$, *t$, *tloffno$, e$ #Restate tool number
        #pbld, n$, pfsgplane, e$        #Restate plane code
	pcss # Output programmed CSS # Restart spindle
        #prpm # Output programmed RPM   #Restate spindle, removed 24-4-2018
        prv_feed = c9k                 #Set prv_values to c9k to force them out with next moves
        prv_gcode$ = c9k
        prv_workofs$ = c9k
        #Restore coolant 2019-02-06 JHM
        if coolant$, prv_coolant$ = c9k
		
		#Restore coolant 2019-02-06 JHM
		local_int = zero
        coolantx = zero
        while local_int < 20 & coolant_on > 0,
          [
          coolantx = and(2^local_int, coolant_on)
          #
          if coolantx > zero,
            [
            coolantx = local_int
            pbld, n$, *scoolantx, e$
            ]
		  local_int = local_int + one
          ]
		
        ]
      else, #Mill tool inspection point
        pbld, n$, *sm00, "(TOOL INSPECTION POINT - POST CUSTOMIZATION REQUIRED)", e$

 

Hope this will help.

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