Z Axis Returning home before every 4th axis rotation, Haas post processor

Z Axis Returning home before every 4th axis rotation, Haas post processor

Anonymous
Not applicable
2,497 Views
19 Replies
Message 1 of 20

Z Axis Returning home before every 4th axis rotation, Haas post processor

Anonymous
Not applicable

I am programming for a large VMC and drilling 80 holes in a tube. The holes are at multiple degrees around the O.D. of the part. The machine doesn't rapid very fast and will waste a lot of time rapiding Z home for every 4th axis rotation. How can I make Z in the post processor retract to just the clearance plane before every rotation?

0 Likes
Accepted solutions (2)
2,498 Views
19 Replies
Replies (19)
Message 2 of 20

bob.schultz
Alumni
Alumni

You can eliminate the retract code for a work plane change by modifying the following code in the onSection function.

 

First find this code ...

    // retract to safe plane
    writeRetract(Z);
    writeBlock(gAbsIncModal.format(90));
    zOutput.reset();

... and change it to this ...

    // retract to safe plane for tool change only
if (insertToolCall || toolChecked) { writeRetract(Z); writeBlock(gAbsIncModal.format(90)); zOutput.reset();
}

You will then need to take GREAT CARE to make sure that your clearance plane at the end of an operation is high enough to avoid crashes when the table is rotated.



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 3 of 20

Anonymous
Not applicable

@bob.schultzwrote:

You can eliminate the retract code for a work plane change by modifying the following code in the onSection function.

 

First find this code ...

    // retract to safe plane
    writeRetract(Z);
    writeBlock(gAbsIncModal.format(90));
    zOutput.reset();

... and change it to this ...

    // retract to safe plane for tool change only
if (insertToolCall || toolChecked) { writeRetract(Z); writeBlock(gAbsIncModal.format(90)); zOutput.reset();
}

You will then need to take GREAT CARE to make sure that your clearance plane at the end of an operation is high enough to avoid crashes when the table is rotated.


Thank You for your response Bob! I believe I found the section that you're talking about, but it doesn't quite look the same. Here's what I found....

 

// retract to safe plane
retracted = true;
if (properties.useG28) {
writeBlock(gFormat.format(28), gAbsIncModal.format(91), "Z" + xyzFormat.format(0));
} else {
gMotionModal.reset();
writeBlock(gAbsIncModal.format(90), gFormat.format(53), gMotionModal.format(0), "Z" + xyzFormat.format(0));
}
writeBlock(gAbsIncModal.format(90));
zOutput.reset();

if (forceResetWorkPlane && newWorkPlane) {
forceWorkPlane();
setWorkPlane(new Vector(0, 0, 0)); // reset working plane
}

 

Am I in the right location??

0 Likes
Message 4 of 20

bob.schultz
Alumni
Alumni
Accepted solution

We have recently changed the retract and home positioning code in all of the stock post processors to use the writeRetract function to make it more consistent and easier to change.  You should download the latest version of the post from the online Post Processor Library and you should then see the writeRetract calls and function.



Bob Schultz
Sr. Post Processor Developer

Message 5 of 20

Anonymous
Not applicable

Thank you Bob! Made the changes and it worked perfectly!

0 Likes
Message 6 of 20

sderyck
Explorer
Explorer

Hello, this post is a few years old and I've tried to make the shown changes to the latest Haas NGC post with no luck.

Can you take another look and let me know your current solution to the same problem.

 

Regards

Scott

0 Likes
Message 7 of 20

bob.schultz
Alumni
Alumni

Hello Scott,

 

Yes, there are more places in the post now that want to make sure that the tool is retracted.  Here are the following locations in the Haas With A-axis post that require changes to disable the G53 G0 Z0 blocks from being output.

 

Make the following change towards the top of the defineWorkPlane function.

        if (false /*!retracted*/) { // CHANGE THIS LINE
          writeRetract(Z);
        }
        forceWorkPlane();

 In the onSection function make the following change.

    if (insertToolCall || operationNeedsSafeStart) { // ADD THIS LINE
      // retract to safe plane
      writeRetract(Z);
    } // ADD THIS LINE

 If you are using the Haas Next Generation post there is one more location in the onSection function that needs to be changed.

  if (/*newWorkPlane || */(insertToolCall && !retracted)) { // go to home position for safety // CHANGE THIS LINE
    if (!retracted) {
      writeRetract(Z);
    }
    if (properties.forceHomeOnIndexing && machineConfiguration.isMultiAxisConfiguration()) {
      writeRetract(X, Y);
    }
  }

 



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 8 of 20

sderyck
Explorer
Explorer

Thank you 

that helped a lot. now time to test, test, test

0 Likes
Message 9 of 20

sderyck
Explorer
Explorer

OK so it's been about a year, I made the changes and they have been working for me. In a VF2 with a 4rth axis.

 

scares a few people when I have the tool .200" above a round part and the part starts rotating but it saves a lot of time depending on the job

 

we noticed when running 3 axis work and having multiple setups with multiple UCS locations that when sorted by tool so fewer tool changes, the normal post puts out a G53Z0 before proceeding to the next UCS. so we've been using the non-G53Z0 post. Paying close attention to the retract positions of course again saving time.

 

thanks and regards

DSD

 

 

 

0 Likes
Message 10 of 20

pummerzPKLHS
Explorer
Explorer

Hi @bob.schultz,
I am currently running the HAAS next generation post version 44134.
Could you please advise what needs to be updated in that post to achieve this?
I cant find the exact same lines.

Regards,

Ben... 

0 Likes
Message 11 of 20

bob.schultz
Alumni
Alumni
Accepted solution

Hi Ben,

 

Yes, the post has changed quite a bit since the suggested changes were posted.  For the current version of the Haas NGC post you will need to make the following changes to get the same results.

 

In the onSection function make the following change.

 

function onSection() {
...
  // if ((insertToolCall && !getProperty("fastToolChange")) || newWorkOffset || newWorkPlane || toolChecked || state.tcpIsActive) { // <<< Replace this line

  if ((insertToolCall && !getProperty("fastToolChange")) || toolChecked || state.tcpIsActive) { // <<< With this line

 

 

In the positionABC function move the call to writeRetract(Z) into the IF-block that handles retracting in XY.

 

function positionABC(abc, force) {
...
  var a = aOutput.format(abc.x);
  var b = bOutput.format(abc.y);
  var c = cOutput.format(abc.z);
  if (a || b || c) {
    if (getSetting("retract.homeXY.onIndexing", false)) {
      writeRetract(Z); // <<< Move this line to inside the IF-Block
      writeRetract(settings.retract.homeXY.onIndexing);
    }

 

 

And the same change in the setWorkPlane function.

function setWorkPlane(abc) {
...
  writeStartBlocks(workplaneIsRequired, function () {
    if (getSetting("retract.homeXY.onIndexing", false)) {
      writeRetract(Z); // <<< Move this line to inside the IF-Block
      writeRetract(settings.retract.homeXY.onIndexing);
    }

 

Of course you will need to disable the Force XY home position on indexing property when running the post.  You can default this setting to No in the post by changing the following line.

  forceHomeOnIndexing: {
    title      : "Force XY home position on indexing",
    description: "Move XY to their home positions on multi-axis indexing.",
    group      : "homePositions",
    type       : "boolean",
    value      : false, // <<< Change to 'false'
    scope      : "post"
  },


Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 12 of 20

pummerzPKLHS
Explorer
Explorer

Hi @bob.schultz,

 

Thanks for the prompt response, i have made all the changes, however i am still getting the following error, when i try to create the NC Program.

Error: Safe retract option 'Clearance Height' is only supported when all operations are along the setup Z-axis.

Error at line: 2261

Error in operation: 'Rotary Parallel1'

 

Warning: -Attention- Property 'Safe Retracts' is set to 'Clearance Height'.

Ensure the clearance height will clear the part and or fixtures.

Raise the Z-axis to a safe height before starting the program.

Thanks for your time.

Ben...

0 Likes
Message 13 of 20

bob.schultz
Alumni
Alumni

Hi Ben,

 

The suggested changes assume that you still want the tool to fully retract at a tool change and the end of the program, as you only mentioned retracts with table indexing.  The changes just turn off retracts when the work plane or work offset changes (the tool will remain at the clearance plane).  You will need to set the Safe Retracts property to either G28 or G53 for these changes to take effect.



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 14 of 20

pummerzPKLHS
Explorer
Explorer

Hi @bob.schultz,

 

Outstanding, thank you so much for your help and quick responses.
All the best.

Ben...

0 Likes
Message 15 of 20

nassim_sparks
Explorer
Explorer

Hello, I am also running into the same issue with my Haas VM-2 with a trt 160 going to Z home on every index. I am just cutting 20 slots around a tube using a circular pattern. I made the changes in the post, but my machine still homes in Z before it indexes to the next operation in the pattern. 

Here is what the post produces. This is with the "Safe retracts" setting set to G53, as I get an Error when selecting "Clearance height".

I've also attached my post I modified according to this thread. It is very possible that I may have messed up somewhere as I am very green to modifying post processors.

 

(2D Pocket1 2)
N2340 G17
N2345 G53 G0 Z0.
N2350 M11
N2355 M13
N2360 G255
N2365 G0 A90. C18.

0 Likes
Message 16 of 20

bob.schultz
Alumni
Alumni

Hello @nassim_sparks,

You added the writeRetract(Z) call inside of the retract.homeXY.onIndexing conditional in the setWorkPlane and positionABC functions, but did not remove the calls before the conditional.

    // writeRetract(Z); // <<< this line needs to be removed or commented
    if (getSetting("retract.homeXY.onIndexing", false)) {
      writeRetract(Z);
      writeRetract(settings.retract.homeXY.onIndexing);
    }

 



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 17 of 20

nassim_sparks
Explorer
Explorer

Awesome, I was able to correct my post changes and got it to work properly. Thank you for your help @bob.schultz 

0 Likes
Message 18 of 20

Toymanf
Explorer
Explorer

Can you please outline the required changes for the current preNGC post(44182)

. This has without a doubt been the most insightful look at how these actions are handled.

Thank you,

Frank

0 Likes
Message 19 of 20

Toymanf
Explorer
Explorer

With no modifications to the post, checking the clearance height box in "safe retracts and home positioning", this is what I get when I try to post 2 operations with the same tool which requires the rotary to turn:

(-Attention- Property 'Safe Retracts' is set to 'Clearance Height'.)
(Ensure the clearance height will clear the part and or fixtures.)
(Raise the Z-axis to a safe height before starting the program.)
!Error: Failed to post data. See log for details.

 

MOST OF the Log

Information: Configuration: HAAS (pre-NGC)
Information: Vendor: Haas Automation
Information: Posting intermediate data to 
Information: Total number of warnings: 1
Error: Failed to post process. See below for details.
...
Code page changed to '1252  (ANSI - Latin I)'
Start time: Friday, June 27, 2025 7:48:00 PM
Code page changed to '20127 (US-ASCII)'
Post processor engine: 5.283.0
Configuration path: C:/Users/
Security level: 1000
Include paths: C:/Users/
Configuration modification date: Thursday, May 22, 2025 3:14:17 PM
Output path: C:\Users\
Checksum of intermediate NC data: 0612edf30e54296bb9901afbff485aed
Checksum of configuration: a86fc6f6cda539578f162a313c004c1d
Legal: Copyright (C) 2012-2025 by Autodesk, Inc.
Generated by: Fusion CAM 2602.1.25
...
Warning: -Attention- Property 'Safe Retracts' is set to 'Clearance Height'.
Ensure the clearance height will clear the part and or fixtures.
Raise the Z-axis to a safe height before starting the program.

###############################################################################
Error: Safe retract option 'Clearance Height' is only supported when all operations are along the setup Z-axis.
Error at line: 1794
Error in operation: 'Adaptive6'
Failed while processing onSection() for record 561.
###############################################################################

Error: Failed to invoke function 'onSection'.
Error: Failed to invoke 'onSection' in the post configuration.
Error: Failed to execute configuration.
Stop time: Friday, June 27, 2025 7:48:00 PM
Post processing failed.
0 Likes
Message 20 of 20

Toymanf
Explorer
Explorer

So I went ahead and made all the changes that you stated was for NGC controllers (in post 11 from 08-16-2024 06:45 AM). That appears to have worked. Although you never replied(less than 2 hours went by) you were still the reason I got this working. Thank you,

Frank