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 Break detect to end of toolpath


Recommended Posts

Hello,

I'm trying to use Misc Values to create a line that, when added to toolpath, checks for tool break and pullout.

I have recently dealed with Misc values and all of my other modifications work fine, but now i'm clueless.

I have added a line to the post:

      if mi7$ = 1, n$ "G112", e$

pretract        #End of tool path, toolchange
      sav_coolant = coolant$
      coolant$ = zero
#      if nextop$ = 1003, #Uncomment this line to leave coolant on until eof unless
#       [                 #  explicitely turned off through a canned text edit
        if all_cool_off,
          [
          #all coolant off with a single off code here
          if coolant_on, pbld, n$, sall_cool_off, e$
          coolant_on = zero
          ]
        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$
              ]
            coolantx = zero
            ]
          coolant_on = zero
          ]
#       ]
      #cc_pos is reset in the toolchange here
      #cc_pos$ = zero
      gcode$ = zero
      pbld, n$, sccomp, *sm05, psub_end_mny, e$
      pbld, n$, scoolant, e$
      pbld, n$, sgabsinc, sgcode, "G53", "Z400.", e$
      if mi7$ = 1, n$ "G112", e$
      coolant$ = sav_coolant

This is the part where the tool check should be active, just before next tool and toolchange.

 

But there is a small problem.

When I add the misc value to some operation (the last done by the tool i want to check), then in some cases it displays my G112 and sometimes it is just in a very wrong place. Lets say I want to check T26, next is T5 and after that comes T11, then applying G112 to T26 it somehow goes to the end of T11, so it is very random in some cases.

 

I know that this is more less the place that this G112 should be, but why is it not with the right tool or not displaying at all...?

 

Maybe you guys can help me out - or offer a more common solution to get the tool to check itself. I know that Manual Entry is  there, but we like Misc values more and I would want to learn about post edit some more.

 

Thank you!

Link to comment
Share on other sites

Added that comma, nothing is better.

I'm using Mastercam X9 and Okuma Generic 4X post.

I have tried to add the misc to every operation by the same tool, nothing happens. Only single operation done by one tool seems to work. Like drilling, but it also has it's tweeks, when applyed to drilling, then G112 is on the drill toolpath end and previous tool toolpath end.

Tryed mi$ and mr$, both act the same.

Link to comment
Share on other sites

While it's very possible to add this in to the post to be called by misc values, we've just done it at my shop using a Manual Entry containing the tool breakage call and parameters. It literally looks like this, for our Okuma, no less:

(***TOOL BREAKAGE****)
M09
M05
G30 P2
CALL O9858

This way, we can just copy the Tool Breakage manual entry wherever we want it, and edit the parameters on a case by case basis. You said you already know about this method, so you have it in your pocket if the post option doesn't end up working out. 

  • Like 1
Link to comment
Share on other sites

In "pretract" you are "reading ahead to the next tool operation's MI and MR values.

In MPMaster, they solve this by creating 10 MI variables, and 10 MR variables, and saving the values when they are read in the Tool Change.

Since you aren't using MPMaster, a different solution is needed.

Search for the 'pmiscint$' post block. If you have one, you can edit the code inside. If you don't have one in that Post, just add it. (start in the 1st column)

Add some code to 'pmiscint$' to "update" the variables you want to "save" for use in 'pretract':

pmiscint$   #Post Block to capture MI values

    !mi7$  #Update MI7, save "current" value into previous

 

Then in 'pretract', modify your code as follows:

      pbld, n$, sgabsinc, sgcode, "G53", "Z400.", e$
      if prv_mi7$ = 1, n$ "G112", e$
      coolant$ = sav_coolant

 

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

Thank you for thinking with me!

Colin, I tried your version, works the same as always. Posts the break detect to previous tool.

 

I got it sorted actually.

ptoolend$        #End of tool path, before reading new tool data               
     !speed, !spdir2
     if mi7$ = 1,
     	[coolant$ = zero
	n$, pscool, e$
	n$, "G112", "(BREAK DETECT)" e$							# Tool break detection "G112"
	]

This posts the break detect to the required toolpath end, where it should be.

 

It's working fine, stops coolant, checks the tool.

 

Now, when i apply this in the middle of working, when it's not the last toolpath with this tool, then it posts G112 to the end of that toolpath

  *first toolpath end
N1240 G0 Z5.
N1242 M9
N1244 G112 (BREAK DETECT)
N1246 M50
N1248 Z-20.5 * last toolpath start
N1250 G1 Z-23.5 F600.
N1252 G3 X-7.717 Y3.25 I0. J3.25 F1000.
N1254 X-10.967 Y6.5 I-3.25 J0.
N1256 X-17.467 Y0. I0. J-6.5
N1258 X-10.967 Y-6.5 I6.5 J0.
N1260 X-4.467 Y0. I0. J6.5
N1262 X-10.967 Y6.5 I-6.5 J0.
N1264 X-14.217 Y3.25 I0. J-3.25
N1266 X-10.967 Y0. I3.25 J0.
N1268 G0 Z5.
N1270 M9
N1272 G112 (BREAK DETECT)
N1274 M5
N1276 G53 Z400.
NAT18

 

But if so, then spindle stops but it does not start it again to continue. Machine just stops. Is it possible to start the spindle again?

I have got the spindle started again - just toggle pspeed and pspindle and i'm fine, but when done so, it starts the spindle again and then goes for toolchange if the last operation is checked. This is really frustrating when spindle is speed up to 15k rpms and then stopped again for toolchange.

 

Thank you for your help!

 

 

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