Tool Inspection

Started by gcode, April 12, 2022, 11:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gcode

I've been using Tool Inspection in mpmaster posts for years.
Apparently CNC Software changes something in MC2021, because MC2020 is the last year
my posts with Tool Inspection work properly

My 202O posts tool inspection section looks like this look like this

prapidout       #Output to NC of linear movement - rapid
      sav_gcode = gcode$
      if convert_rpd$ = one,
        [
        gcode$ = one
        feed = maxfeedpm
        ipr_type = zero
        ]
      pcan1, pbld, n$, sgplane, `sgcode, [if gcode$ = 1, sgfeed], sgabsinc, pccdia,
        pxout, pyout, pzout, pcout, [if gcode$ = 1, `feed], strcantext, scoolant, e$
        if cur_cflg$ = 70000, tool_chk = 1
      if cur_cflg$ = 70000,
              [
              pbld, "M09" ,e$
              pretract0, e$
              pbld, "M00", "(TOOL INSPECTION POINT)", e$
              pbld, n$, *sgcode, sgabsinc, pwcs, pfxout, pfyout,e$
              pfspindleout, e$
              pbld, n$, "G43", *tlngno$, pfzout, e$
              pbld,*feed, *scoolant,e$
              tool_chk = 0
              ]
      gcode$ = sav_gcode

as stated this will not work in MC2021 or 22

I have cut this out of a generic 5X Haas Mastercam post
It outputs a Z rapid to clearance then goes right back to work
It will not post any of the text 

ptool_insp   #Tool Inspection Point Customization Required
      #Modify following line to customize tool inspection points
      pcool_off #Coolant off before tool inspection
      sav_absinc = absinc$
      absinc$ = one
      pbld, n$, sm05, e$ #Spindle off
      pbld, n$, sm00,"(CAUTION POST GENERATING MOTION FOR TOOL INSPECTION)", e$
      pbld, n$, *sgabsinc, *sg28, "Z0.", scoolant, e$
      pbld, n$, *sg28, "X0.", "Y0.", e$
      pbld, n$, sm00, "(INSPECT TOOL)", e$
      absinc$ = sav_absinc
      pbld, n$, *sgcode, *sgabsinc, pwcs, *xabs, *yabs, *speed, *spindle, pgear, e$
      pinsp_cool_on #Coolant on after tool inspection
      pbld, n$, "G43", *tlngno$, *zabs, scoolant, e$   
 
   
   

prapidout       #Output to NC of linear movement - rapid
      sav_gcode = gcode$
      if convert_rpd$ = one,
        [
       gcode$ = one
        feed = maxfeedpm
        ipr_type = zero
        ]
      pcan1, pbld, n$, `sgplane, `sgcode, [if gcode$ = 1, sgfeed], sgabsinc, pccdia,
        pxout, pyout, pzout, pcout, [if gcode$ = 1, `feed], strcantext, scoolant, e$
       #  if rpd_typ = 7 , inspect_delay = one #Delay tool inspection until null tool change
          if rpd_typ_v7$ = 7, ptool_insp #Tool Inspection Point
     
any idea what I need to do to get this working

gcode

Quote from: gcode on April 12, 2022, 11:18 AMas stated this will not work in MC2021 or 22

I have cut this out of a generic 5X Haas Mastercam post
It outputs a Z rapid to clearance then goes right back to work
It will not post any of the code from ptool_insp 

ptool_insp   #Tool Inspection Point Customization Required
      #Modify following line to customize tool inspection points
      pcool_off #Coolant off before tool inspection
      sav_absinc = absinc$
      absinc$ = one
      pbld, n$, sm05, e$ #Spindle off
      pbld, n$, sm00,"(CAUTION POST GENERATING MOTION FOR TOOL INSPECTION)", e$
      pbld, n$, *sgabsinc, *sg28, "Z0.", scoolant, e$
      pbld, n$, *sg28, "X0.", "Y0.", e$
      pbld, n$, sm00, "(INSPECT TOOL)", e$
      absinc$ = sav_absinc
      pbld, n$, *sgcode, *sgabsinc, pwcs, *xabs, *yabs, *speed, *spindle, pgear, e$
      pinsp_cool_on #Coolant on after tool inspection
      pbld, n$, "G43", *tlngno$, *zabs, scoolant, e$   
 
   
   

prapidout       #Output to NC of linear movement - rapid
      sav_gcode = gcode$
      if convert_rpd$ = one,
        [
       gcode$ = one
        feed = maxfeedpm
        ipr_type = zero
        ]
      pcan1, pbld, n$, `sgplane, `sgcode, [if gcode$ = 1, sgfeed], sgabsinc, pccdia,
        pxout, pyout, pzout, pcout, [if gcode$ = 1, `feed], strcantext, scoolant, e$
       #  if rpd_typ = 7 , inspect_delay = one #Delay tool inspection until null tool change
          if rpd_typ_v7$ = 7, ptool_insp #Tool Inspection Point
     
any idea what I need to do to get this working

neurosis

#2
It's been a while since I've played with posts. 

I don't know where that cur_cflg$ = 70000 comes from? There is a bit of a gap between some of my post reference guides so I'm probably missing some information. 

If you search through the newer mpfan post you can see calls for ptool_insp in the prapidout and plinout.  You may be able to use that help get this implemented in to your post. 

This definitely looks cleaner than the old way. 

referencing the guide:  rpd_typ$ = 7  Pause for automatic tool inspection (introduced in X2). This is the only value for this variable that applies to Mill/Router toolpaths; the other values apply to Lathe only.
 


prapidout       #Output to NC of linear movement - rapid
      pcan1, pbld, n$, [if gcode$, `sgfeed], sgplane, `sgcode, sgabsinc, pccdia,
        pxout, pyout, pzout, pcout, [if gcode$, `feed], strcantext, pscool, e$
      if force_feed, result = force(feed)  # Force output of feed next time it's called for output
      if rpd_typ$ = 7, ptool_insp #Tool Inspection Point



plinout        #Output to NC of linear movement - feed
      pcan1, pbld, n$, sgfeed, sgplane, `sgcode, sgabsinc, pccdia,
        pxout, pyout, pzout, pcout, [if motst$, feed], strcantext, pscool, e$
      if rpd_typ$ = 7, ptool_insp #Tool Inspection Point

I'll go back to being a conservative, when conservatives go back to being conservative.

gcode

It turns out that this is a bug
The toolpath in question was a 3d high speed waterline
With the secondary lead in being used,tool inspection fails
Turn it off and it works as expected

neurosis

If you ever get ambitious, you may want to consider setting it up the other way. Someone like Colin may be a better person to ask about this, but that cur_cflg$ = 70000 may cause more problems in the future?

I think that you could change over pretty easily.  Copy your current code that's between the brackets and use that as your ptool_insp. Then just add the ptool_insp calls in the prapidout and plinout and it should work and will probably be more future proof.

I wonder it it would even work with the secondary lead in since it's not using a contour flag to fire the tool inspect. 
I'll go back to being a conservative, when conservatives go back to being conservative.