Help adding tool Breakage detection to post

Help adding tool Breakage detection to post

Anonymous
Not applicable
1,625 Views
13 Replies
Message 1 of 14

Help adding tool Breakage detection to post

Anonymous
Not applicable

Hello, I was hoping someone could help me.  I'd like to add tool breakage detection to my post.  I'm using the standard okuma milling post and my machine has a blum laser.  I would like my post to automatically add some code before every tool change the check for tool breakage.  The code needed would be

 

M3 S2000

CALL O9608 PH=50. PX=0. PM=1. PQ=0.02 PW=0.

M5 

I've made many simple post changes in the past, but this is a bit over my head.

One thing to note the PH=50. is call up the tool offset to use when checking so this would need to be driven off of whatever tool is in the spindle. For example tool 8 would be PH=8.

 

Any help would be greatly appreciated

0 Likes
Accepted solutions (3)
1,626 Views
13 Replies
Replies (13)
Message 2 of 14

bob.schultz
Alumni
Alumni

It is pretty straight forward to get this output.  First add the following function to the post, you can place it in front of onSection.

 

function checkTool(_tool) {
  writeBlock(mFormat.format(3), sOutput.format(2000));
  writeBlock("CALL", "O9608", "PH="+_tool.number, "PX=0.", "PM=1.", "PQ=0.02", "PW=0.");
  writeBlock(mFormat.format(5));
}

Next add the following line in onSection just prior to the tool change.

    checkTool(tool);
    if (properties.preloadTool && !isFirstSection()) {
      writeComment("T" + toolFormat.format(tool.number));
      writeBlock(mFormat.format(6));
    } else {
      writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6));
    }

This should get you the desired output.



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 3 of 14

Anonymous
Not applicable
Thank you Bob, this is really close, the only thing is that it's outputting the height offset for the tool that it is about to change to, not the tool in the spindle. Did I do something wrong or does something else need changing?


Thank you again
0 Likes
Message 4 of 14

bob.schultz
Alumni
Alumni

Yep, I should have noticed that the tool check is being done before the tool change.  Modify the call to checkTool that you added to onSection to look like this to check the tool currently loaded into the spindle.

    if (!isFirstSection()) {
      checkTool(getPreviousSection().getTool());
    }


Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 5 of 14

Anonymous
Not applicable
Sorry, I'm still having some issues I think I'm missing something as to how to put this in the post. Whenever I add this part in it won't post and gives me an error. One other thing I noticed is that it does this at the beginning of the program before the first tool change, I could see this causing some major issues, is there a way to get it to not check in the beginning before the first tool change?


Thank you so much for the help
0 Likes
Message 6 of 14

bob.schultz
Alumni
Alumni

Your code should look like the following after inserting the new code.  You will notice that there is a check for the first operation.

 

    if (!isFirstSection()) { // don't check tool on first operation
checkTool(getPreviousSection().getTool());
} if (properties.preloadTool && !isFirstSection()) { writeComment("T" + toolFormat.format(tool.number)); writeBlock(mFormat.format(6)); } else { writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6)); }

 



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 7 of 14

Anonymous
Not applicable
Thank you Bob, this is closer its outputting the proper code but is still outputting the code with the tool its about to change to.

(2D Adaptive1)
M09
M01
M03 S2000
CALL O9608 PH=3 PX=0. PM=1. PQ=0.02 PW=0.
M05
M03 S2000
CALL O9608 PH=1 PX=0. PM=1. PQ=0.02 PW=0.
M05
(T3)
M06
G30 P1
(T3)
G116 T3
T60
S5500 M03

This is an example of what I get, it first run the tool breakage check with the wrong tool offset, the one its changing too, and then the proper one.

Thanks so much

0 Likes
Message 8 of 14

bob.schultz
Alumni
Alumni
Accepted solution

I think you left the original call to checkTool in your code.  There should only be one call and it should be the one in the isFirstSection() conditional.



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 9 of 14

Anonymous
Not applicable
Accepted solution

Thank you, yes I had forgotten to take out the one check tool.  It works perfectly now.

 

Thank you for all your help

0 Likes
Message 10 of 14

Anonymous
Not applicable
Hello I've run into another problem with this on my Laser side, it looks like certain tools also need a VC115=1.0 added in the post. It would need to look like this


M3 S2000

VC115=1.0

CALL O9608 PH=14. PX=0. PM=1. PQ=0.02 PW=0.

M5


Any help is greatly appreciated.


Thank you
0 Likes
Message 11 of 14

bob.schultz
Alumni
Alumni
Accepted solution

You can enter the following conditional in the checkTool function to output this line.  If you take a look at this code you can see how easy it is to add output to the NC file.  Since you state that "some" tools need this value, I included a conditional that you will have to add so that the line is not output with all tools.  If you want it output with all tools you can simply replace conditional with true.

function checkTool(_tool) {
  writeBlock(mFormat.format(3), sOutput.format(2000));
if (conditional) {
writeBlock("VC115=1.0");
}
writeBlock("CALL", "O9608", "PH="+_tool.number, "PX=0.", "PM=1.", "PQ=0.02", "PW=0."); writeBlock(mFormat.format(5)); }


Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 12 of 14

Anonymous
Not applicable

Thank you that gives me everything I need

0 Likes
Message 13 of 14

s.noke71
Collaborator
Collaborator

Hi Guys,

will this work with the standard siemens 840d post i would love tool breakage detection for my machines

0 Likes
Message 14 of 14

bob.schultz
Alumni
Alumni

The basic logic would work, but the actual output would have to be modified to match the Siemens 840D requirements.



Bob Schultz
Sr. Post Processor Developer

0 Likes