Community
HSM Post Processor Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Tool Breakage Control Datron

15 REPLIES 15
SOLVED
Reply
Message 1 of 16
U.Uhl
975 Views, 15 Replies

Tool Breakage Control Datron

Hello everyone,

 

I have a question or problem again.

 

It's about the tool breakage control for a Datron.

 

Unfortunately, nothing is stored in the PP, and if I store the following command, it checks the breakage of every tool or outputs it incorrectly.

 

 

  case COMMAND_BREAK_CONTROL:
  writeBlock("Wzkontr 0, 1, 0, 0, 0.05, 0, 0, 0, 0.06, 0, 0, 0;");
  return;

 

 

The whole thing then appears in the machine program as follows:

 

 

.
.
.
Axyz 0, 56.48511, 16.06038, -7.6, 0, 0;
Axyz 1, 56.48511, 16.06038, 15, 0, 0;
Wzkontr 0, 1, 0, 0, 0.05, 0, 0, 0, 0.06, 0, 0, 0;
) Sm_2d_kontur1__1;
Wzkontr 0, 1, 0, 0, 0.05, 0, 0, 0, 0.06, 0, 0, 0;
(
T3d 0, 0, 1, 15, 17, 10, 10, 10, 10, 10, 10;
Konturglaettung 1, 0.012, 0.1, 110, 1;
Axyz 1, -4.8, 204.03, z6p, 0, 0;
.
.
.
Axyz 1, 515.79999, 163.2196, 15, 0, 0;
Wzkontr 0, 1, 0, 0, 0.05, 0, 0, 0, 0.06, 0, 0, 0;
) Sm_2d_kontur7__2;

 

 

 

The command between " ) Sm_2d_kontur1__1;
Wzkontr 0, 1, 0, 0, 0.05, 0, 0, 0, 0.06, 0, 0, 0;
( " is wrongly positione and the machine shows an error when opening.

 

Even after the second tool, no breakage check should be carried out.

(Program the whole thing only once in Fusion after Tool-D4, see image)

 

Someone a suggestion

15 REPLIES 15
Message 2 of 16
U.Uhl
in reply to: U.Uhl

Here are also the Test Programm (changed .mcr to .txt)

Message 3 of 16
U.Uhl
in reply to: U.Uhl

None a hint ?

 

It cannot be standard that if I select the tool breakage control for one tool, this is permanently valid in the program on the machine for all tools.

Message 4 of 16
U.Uhl
in reply to: U.Uhl

So, I made another attempt after searching here in the forum.

The following code doesn't work either, despite everything, it writes the break check in the code several times.

 

  if (tool.breakControl){
    if (((getCurrentSectionId() + 1) >= getNumberOfSections()) ||
        (tool.number != getNextSection().getTool().number)) {
      onCommand(COMMAND_BREAK_CONTROL);
    }
  }
Message 5 of 16
U.Uhl
in reply to: U.Uhl

Ok, a little more tinkering with the whole thing. now he writes me the command only once, but in the "wrong section".

 

 

   if (((getCurrentSectionId() + 1) >= getNumberOfSections()) ||
   (tool.number != getNextSection().getTool().number &&
   (tool.breakControl))) {
 writeBlock("Wzkontr 0, 1, 0, 0, 0.05, 0, 0, 0, 0.06, 0, 0, 0;");
} else {}

 

 

In other words, the breakage check is not in the section or for the tool where it is actually supposed to be. but in the next or for the next tool.

Message 6 of 16
AchimN
in reply to: U.Uhl

Hello @U.Uhl ,

to control the place of the output of manual NC commands is a bit tricky, and even more in the Datron post.
To get the break contol command into your desired place, please do the following into your postprocessor:

1. Add the following code into your post:

var manualNC = [];
function onManualNC(command, value) {
  manualNC.push({command:command, value:value});
}

function executeManualNC(command) {
  for (var i = 0; i < manualNC.length; ++i) {
    if (!command || (command == manualNC[i].command)) {
      switch (manualNC[i].command) {
      case COMMAND_BREAK_CONTROL:
        writeBlock("Wzkontr 0, 1, 0, 0, 0.05, 0, 0, 0, 0.06, 0, 0, 0;");
        break;
      default:
        expandManualNC(manualNC[i].command, manualNC[i].value);
      }
    }
  }
  for (var i = manualNC.length - 1; i >= 0; --i) {
    if (!command || (command == manualNC[i].command)) {
      manualNC.splice(i, 1);
    }
  }
}

 

2. Remove the code in onSectionEnd where COMMAND_BREAK_CONTROL is called (in case you dont want a tool break control at every tool change)

 

3. Add
executeManualNC();
into the desired place where you would like to output the manual NC commands, for example somewhere in onSection() or onSectionEnd().

You can also refer to the postprocessor training guide https://cam.autodesk.com/posts/posts/guides/Post%20Processor%20Training%20Guide.pdf where this is explained in chapter 5.1.2 "Delay Processing of Manual NC Commands"



Achim.N
Principal Technology Consultant
Message 7 of 16
U.Uhl
in reply to: AchimN

Hello Achim,

Many thanks for the help. I was able to test your code today, so far it works. However, there is also the problem that he gives me the "output" in the wrong section.


I place the Manual NC Output (broken tool control), after the "Machining Process". However, the postprocessor throws out the command for the "Machining process" afterwards. Say another "section" further.

 

 

I am attaching the file as well as the postprocessor. (Don't be surprised, this is a test postprocessor)

Message 8 of 16
AchimN
in reply to: U.Uhl

Hello @U.Uhl,

 

not exactly sure if I understood what you mean but by looking into your sample file and your post the output is as expected. You placed a manual NC 'tool break control' before the last operation and in your post you added executeManualNC to onSectionEnd.
This will result in having the tool break control at the end of the last operation. When you want the tool break control command to show up at the beginning of the operation next to your manual NC command you need to move the executeManualNC call to the beginning of onSection.



Achim.N
Principal Technology Consultant
Message 9 of 16
U.Uhl
in reply to: AchimN

This is a bit tricky with Datron or Vector control. The code is processed according to program sections or internal subprograms.

Example of a section is (T3d 0,0..........Axyz........) Sm_comment_3;


In the sample file I placed the manual NC "Tool Brake Control" after the last operation with the " Mit WZB (2) FRS-ALU-D2" so that this tool is checked after processing. (We are used to it from the Siemens controls/posts, for example).

 

However, the post processor does not place the whole thing in the area "(T3d....Axyz....) Sm_mitwzb2__2;"
but in the area "(........)Sm_ohnewzb__3;" which would be the wrong area or the wrong tool is checked.

 

If I activate :

 

     if (tool.breakControl) {
        if (!isFirstSection() ||
        (tool.number != getNextSection().getTool().number &&
        (tool.breakControl))) {
         //writeBlock("Wzkontr 0, 1, 0, 0, 0.05, 0, 0, 0, 0.06, 0, 0, 0;");
         writeWords("TAST");
         onCommand(COMMAND_BREAK_CONTROL);
     } else {}
   }

 

 

and use in the tool library the check box for the break control, then he sets me  "ToolBreakControl Command" in the right Area.

 

But this would be every time activated. I find the ManualNC output more convenient and individual.

Message 10 of 16
AchimN
in reply to: U.Uhl

Hmm perhaps I dont see what you mean but its still correct to me as explained before:

AchimN_0-1677851716884.png

Command "TEDE" is output inside of the subprogram at the end of operation "Ohne WZB". If you want to change that location you either have to move your executeManualNC around into your post or move the manual NC operation in Fusion to your desired place.



Achim.N
Principal Technology Consultant
Message 11 of 16
U.Uhl
in reply to: AchimN

MitWZB = with ToolBreakControl
OhneWZB = Without ToolBreakControl

 

With the Siemens Control or PostProcessor I am used to inserting, in Fusion360, the "manual NC command (tool breakage)" after processing and it then checks this tool.

 

In this case, I would like the tool breakage check to be carried out after processing  "MitWZB".

 

So in Fusion 360 the position is correct (for me and my habit) but in the postprocessor it is output in the wrong section.

 

 

Moving the "manual NC operation" would be the simplest solution, but since I also program other controls in the CAM, that would be a change for me or the other programmer.

 

In the datron post or the Vector control it is a bit more complicated than expected 😓🙈

Message 12 of 16
AchimN
in reply to: U.Uhl

Ok, that indeed needs extra handling in the datron post. Where do you want the command to show up? In main or subprogram?



Achim.N
Principal Technology Consultant
Message 13 of 16
U.Uhl
in reply to: AchimN

I tested it manually on the machine.

In the main program it would be enough

 

Sample:

; !##########Mit WZB (2)__2##########!
; ! ZMIN = 6!
Werkzeug T2, 0, 0, 1, 0;
Drehzahl 3, 38, 0, 30;
Dynamik 3;
Schlichten = 0.95;!m/min!
Entry = 0.75;!m/min!
Exit = 0.75;!m/min!
Eintauchen = 0.75;!m/min!
Submakro Sm_mitwzb2__2;
Wzkontr 0, 1, 0, 0, 0.05, 0, 0, 0, 0.06, 0, 0, 0;
Message 14 of 16
AchimN
in reply to: U.Uhl

Ok, then please add the following code to your post:

var manualNC = [];
function onManualNC(command, value) {
  var section = typeof currentSection == "undefined" ? getSection(0) : currentSection;
  manualNC.push({command:command, value:value, sectionID:section.getId()});
}

function executeManualNC(command, section) {
  for (var i = 0; i < manualNC.length; ++i) {
    if (manualNC[i].sectionID == section.getId()) {
      if (!command || (command == manualNC[i].command)) {
        switch (manualNC[i].command) {
        case COMMAND_BREAK_CONTROL:
          var upperTol = xyzFormat.format(toPreciseUnit(0.05, MM));
          var lowerTol = xyzFormat.format(toPreciseUnit(0.06, MM));
          writeBlock(translate("Tcheck") + " 0, 1, 0, 0, " + upperTol + ", 0, 0, 0, " + lowerTol + ", 0, 0, 0;");
          break;
        default:
          expandManualNC(manualNC[i].command, manualNC[i].value);
        }
      }
    }
  }
  for (var i = manualNC.length - 1; i >= 0; --i) {
    if (manualNC[i].sectionID == section.getId()) {
      if (!command || (command == manualNC[i].command)) {
        manualNC.splice(i, 1);
      }
    }
  }
}

 

and add this code into the desired place where you want the manual NC code to be output:

executeManualNC(undefined, section);

 

With your example, you may want to place the executeManualNC call to the writeMainProgram() function at this place:

AchimN_1-1678290934927.png

 

 



Achim.N
Principal Technology Consultant
Message 15 of 16
U.Uhl
in reply to: AchimN

Thanks again for the help. So far the command works now.

 

I have an additional question, is it possible to reduce the whole thing at once when using a Pattern.

 

In other words, if I use the break control on a multiple pattern, it throws the command out to me multiple times.

 

Thanks and Regards from Germany

Message 16 of 16
U.Uhl
in reply to: U.Uhl

Is there a way to reduce the NC output of the tool break for a pattern?

 

In the case of a pattern with 4 parts, it gives me the tool break command 4 times. But that's counterproductive in that regard.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report