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

Okuma Generic post modifications for M560-V OSP 300

22 REPLIES 22
Reply
Message 1 of 23
jlatorella
2386 Views, 22 Replies

Okuma Generic post modifications for M560-V OSP 300

Hello all,

 

I was hoping to get some modifications made to the Okuma generic post. We have recently acquired a Genos M560 milling machine. The requested changes are as followed:

 

- I do not want to output the program name as the first line of the code

- Instead of using M6 for tool changes I would like to use G116.

- G30 P1 called before tool changes instead of using G0 z400.

- G30 P1 called at the end of the program instead of G0 moves

- M01 to be called after tool change instead of before

- HA and DA to be called instead of H+tool number

 

 

Let me know if there is anything I can help clarify.

 

Thanks,

 

Justin

22 REPLIES 22
Message 2 of 23

Hi,

I don't have much time right now but I'll help you with first two requests.

Open your postprocessor.

 

1. Search for 

writeln("O" + programName);

change it to:

//writeln("O" + programName);

2. At the beginning of your post add this:

var g1Format = createFormat({prefix:"G", width:3, zeropad:true, decimals:0});

search for:

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

change it to:

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

As for your other requests, please show me the example from your nc code and if somebody else doesn't help you in the meantime, I'll take a look maybe tomorrow. 



Ivan Stanojevic


Message 3 of 23

To get the G116 to work the way I wanted to I used the following code:

 

    if (properties.preloadTool && !isFirstSection()) {					//changed by justin 22/03/2017
      writeComment("T" + toolFormat.format(tool.number));				//changed by justin 22/03/2017
      writeBlock(g1Format.format(116), "T" + toolFormat.format(tool.number));		//changed by justin 22/03/2017
    } else {										//changed by justin 22/03/2017
      writeBlock(g1Format.format(116), "T" + toolFormat.format(tool.number));		//changed by justin 22/03/2017
    }											//changed by justin 22/03/2017

I need the G116 to come before the tool number. I also need the G116 to come for all tool changes even if the tool is preloaded.

 

Examples of other things I would like changed to come.

 

Thanks for the help so far!

Message 4 of 23

 

Examples of remaining changes I would like made commented

(SWAC Threaded Plate x 1) (T53 D=0.404 CR=0. TAPER=118deg - ZMIN=-0.7214 - drill) (T84 D=0.4724 CR=0. - ZMIN=-0.65 - right hand tap) N1 G40 G80 G90 G94 G17 N2 G20 N3 G00 Z400. (10.2 Carbide Drilling) N4 M09 N5 G116 T53 N6 T84 N7 S2458 M03 N8 G15 H01 N9 M08 N11 G00 X3.0906 Y-2.9685 N12 G56 Z0.6 H53 //I would want HA used instead of H53 N14 Z0.2 //this would be the same for diamter offset calls N15 G71 Z0.2 N16 G90 G81 X3.0906 Y-2.9685 Z-0.7214 R0.2 F13.52 M53 N17 Y-0.9685 N18 X6.0906 N19 Y-2.9685 N20 G00 Z0.2 N21 Z0.6 N22 M05 N23 Z400. //to be changed to G30 P1 (M12 Tapping ) N24 M09 N25 M01 //M01 to be moved after line N26 (T84) N26 G116 T84 N27 T53 N28 S647 M03 N29 G15 H01 N30 M08 N32 G00 X3.0906 Y-2.9685 N33 G56 Z0.6 H84 //HA again N35 Z0.2 N36 G71 Z0.2 N37 G90 G84 X3.0906 Y-2.9685 Z-0.65 R0.2 F44.563 M53 N38 Y-0.9685 N39 X6.0906 N40 Y-2.9685 N41 G00 Z0.2 N42 Z0.6 N43 M05 N44 M09 N45 Z400. //to be changed to G30 P1 N46 X400. Y400. //not necessary if G30 is called N47 M02

 

 

Message 5 of 23

Regarding the preloaded tool, search for:

 

 if (properties.preloadTool) {
var nextTool = getNextTool(tool.number);
if (nextTool) {
writeBlock("T" + toolFormat.format(nextTool.number));
} else {
// preload first tool
var section = getSection(0);
var firstToolNumber = section.getTool().number;
if (tool.number != firstToolNumber) {
writeBlock("T" + toolFormat.format(firstToolNumber));

change to

 

 if (properties.preloadTool) {
      var nextTool = getNextTool(tool.number);
      if (nextTool) {
        writeBlock(g1Format.format(116), "T" + toolFormat.format(nextTool.number));
      } else {
        // preload first tool
        var section = getSection(0);
        var firstToolNumber = section.getTool().number;
        if (tool.number != firstToolNumber) {
          writeBlock(g1Format.format(116), "T" + toolFormat.format(firstToolNumber));

cheers



Ivan Stanojevic


Message 6 of 23

Sorry for being unclear. There was no problem with the preloaded tool. The issue I was having was it was calling the tool before the G116 and it wouldn't call the tool number if there already was a tool preloaded. I was able to fix this on my own with the modification i made to your suggestion which I posted above. By calling G116 on the preload line it would do two tool changes in a row. G116 is a tool change macro that acts as M6 essentially.

 

Thanks

Message 7 of 23

Ok, no problem that was a misunderstanding.

 

For HA, search for

writeBlock(gMotionModal.format(0), gFormat.format(56), zOutput.format(initialPosition.z), hFormat.format(lengthOffset)); 

change to:

writeBlock(gMotionModal.format(0), gFormat.format(56), zOutput.format(initialPosition.z), "HA");

for G30 P1:

 

search for (be noted that this line is located on two places in the post - in onSection() and in onClose() functions) 

writeBlock(gMotionModal.format(0), "Z" + xyzFormat.format(machineConfiguration.getRetractPlane()));

change to

writeBlock(gMotionModal.format(0), "G" + "30" +  " P1");

 



Ivan Stanojevic


Message 8 of 23

Thanks everything is working great so far.

 

For the HA I also changed after the else condition:

 

zOutput.format(initialPosition.z), hFormat.format(lengthOffset)

  to 

 

 

zOutput.format(initialPosition.z), "HA"

for good measure. Will this cause me any problems?

 

The last few things I would like to change as mentioned before is:

-Have the G30 P1 at the end of the program instead of the G0 moves. 

-Move M01 to after the tool change

 

A change I haven't yet mentioned would be to add for example NO1 in front of the comment that describes the  operation. We doing a mid cycle start on the OSP 300 control you need to call a N line number so instead of having to search the program for the line number that operation we could just call NO1, NO2 etc. (N "O"peration 1)

 

Thanks again for the great help so far!

 

Justin

 

 

Message 9 of 23

I don't think that it will cause you problems, but this change wasn't necessary as far as I can tell.
For G30 P1, I told you that it is located also at the end of the post, so you should be able to find it.

 

For optional stop, search for:

 

 if (!isFirstSection() && properties.optionalStop) {
      onCommand(COMMAND_OPTIONAL_STOP);
    }

right click - select - cut and paste it below G116 tool change code that you modified before.

 

As for N0 comment, do do you want it to look something like this: N01 (2D Contour1)

Or?

 

cheers

 

 

 



Ivan Stanojevic


Message 10 of 23

I missed your instructions before on the G30 P1 at the end of the program.

 

I got that and the optional stop working perfectly. I commented out the following lines as sending the machine to x and y limits would be redundant.

 

 if (properties.useG16) {
    if (homeX || homeY) {
      //writeBlock(gFormat.format(16), hFormat.format(0), gMotionModal.format(0), homeX, homeY);
    } else {
      //writeBlock(gFormat.format(16), hFormat.format(0), gMotionModal.format(0), "X" + xyzFormat.format(0), "Y" + xyzFormat.format(0)); // return to home
    }
  } else {
    // must move to outer limit - since coordinates are still in WCS
    if (homeX || homeY) {
      //writeBlock(gMotionModal.format(0), homeX, homeY);
    }

 As far as I am able to understand this shouldn't cause any problem elsewhere.

 

The way you explain the NO comment it is perfect. 

 

Thanks,

 

Justin

Message 11 of 23

You did good with commenting out x and y home position lines.
For the NO comment, it should take a bit more time which I don't have right now.

Maybe someone else from the community might help you.



Ivan Stanojevic


Message 12 of 23

No worries. I am not in a particular rush to get the NO comment working. There are a couple things i would also like changed:

 

-Default to ISO milling file type when opening the editor.

-Have a different retract when using multiple WCS. I would just need a G0 Z40. instead of the G30 P1.

-Be able to post with a program name that contains 16 alpha numerics and - instead of just 4 numbers

 

Thanks!

 

Justin

Message 13 of 23

Which software do you use? InvHSM or HSMWorks?

Could you attach your post? I have one idea regarding the NO comments.


Ivan Stanojevic


Message 14 of 23

I am using HSM Works.

 

 

Message 15 of 23

Hi @jlatorella

 

check the attached post where I added N0 lines.

 

If you want Iso milling to be default in editor you have to follow this procedure:

dadadaddada.png



Ivan Stanojevic


Message 16 of 23

Thanks for that! I'll give it a shot on the machine to see if will work when I search. 

 

I suppose the last two things i would like to change at the moment would be to allow program names to use letters and to have a different retract plane when using multiple WCS instead of using the G30 P1 in between moves between different WCS.

 

Thanks again,

 

Justin

Message 17 of 23

 

If you want your program name to print out letters just comment out this line of code:

 //error(localize("Program name contains invalid character(s)."));

 

For the different retract planes, upload the example of the gcode how you would like it too look like and I'll have a look when I've got time.



Ivan Stanojevic


Message 18 of 23

The easiest thing for me would be to have G30 P2 instead of G30 P1 when moving between different WCS.

I still want G30 P1 to come before tool changes and at the end of the program.

 

I would have to eliminate the space in between the NO and the operation number as shown below.

 

N4 NO 1(FACE (1))           //eliminate space EX: NO1 (FACE (1))
N5 M09
N6 G116 T2
N7 T200
N8 S955 M03
N9 G15 H02
N10 M08
N12 G00 X5.5178 Y0.7106
N13 G56 Z1.8038 HA
N14 Z1.4038
N15 G01 Z1.2038 F28.648
N16 X4.4178
N17 X2.6507
N18 X1.7871
N19 X0.02
N20 X-0.98
N21 G00 Z1.8038
N22 G30 P1                // G30 P2 here

N23 NO 2(FACE (1))
N24 G15 H03
N25 M08
N27 G00 X5.5178 Y0.7106
N28 G56 Z1.8038 HA
N29 Z1.4038
N30 G01 Z1.2038 F28.648
N31 X4.4178
N32 X2.6507
N33 X1.7871
N34 X0.02
N35 X-0.98
N36 G00 Z1.8038
N37 G30 P1
Message 19 of 23

According to your example I see that both operations are in G56, is that right?


Ivan Stanojevic


Message 20 of 23

G56 does not call the work offset. That is done with G15 H02 and G15 H03 for example. 

 

This is where Okuma differs from Fanuc.

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

Post to forums  

Autodesk Design & Make Report