Haas TRT-160 Ability to force A-90 instead of A90 with C180

Haas TRT-160 Ability to force A-90 instead of A90 with C180

dynamic.machine
Enthusiast Enthusiast
5,945 Views
18 Replies
Message 1 of 19

Haas TRT-160 Ability to force A-90 instead of A90 with C180

dynamic.machine
Enthusiast
Enthusiast

Is there any way to force fusion to post an A-90?  The TRT-160 will tilt A+/- 120 degrees.  I am in a situation where I need to force the trunnion to tilt A-90 instead of remaining at A90 and rotating C180 to get to the other side of the part.  I have tried flipping the x-axis under tool orientation for the toolpath and it makes no difference at all.  The machine has DWO/TCPC and the "Use TCPC Programming" post property is set to Yes.  I have run into this issue before, but was able to work around it.  This time, I have limitations that require A-90.  In this particular situation, all I need is to be able to tilt the part A90 and A-90.  No C axis moves are needed.  Would somehow disabling the C Axis in the post get me what I need?

0 Likes
Accepted solutions (2)
5,946 Views
18 Replies
Replies (18)
Message 2 of 19

dynamic.machine
Enthusiast
Enthusiast

So setting the "Has C Axis Rotary" property to NO should work, but still curious if there is a way to force an A-90 with the C Axis enabled.  Flipping the X Axis tool orientation inside the toolpath has no effect on the posted output.

0 Likes
Message 3 of 19

KrupalVala
Autodesk
Autodesk

Hi @dynamic.machine ,

 

You need to change Rotary direction(While needed) through the Post Properties.

Haas NGC.jpg

 

Thanks,



Krupal Vala
Senior Technology Consultant - Post Processor & Machine Simulation
0 Likes
Message 4 of 19

mattdlr89
Advisor
Advisor

@dynamic.machine 

 

I've had this problem too. It seems that you cannot pick which way the axis will move within Fusion and it is determined by your post processor. It makes a difference as what angles it will go to depending on the order of programs. 

 

Are you looking to have this behaviour in all of your programs or just for this particular file. I posted a while back and got some good feedback that enabled me to make some edits to the post to get the shortest angular move each time, you can also set a preference of the axis to move so that when the angular move is the same like in your case it will pick A over C or vice versa. Partly comes down as to whether you always want this behaviour in all your programs or not?

 Link to the topic below.

https://forums.autodesk.com/t5/fusion-360-manufacture/stop-b-moves-on-trunnion/td-p/9547848

 

0 Likes
Message 5 of 19

dynamic.machine
Enthusiast
Enthusiast

Thanks... the link to the other post definitely gave me some insight.  Don't necessarily need this behavior all the time, but sometimes there are situations where part size and tool clearance becomes an issue.  There is not a whole lot of space between the edge of the platter and the casting on the TRT-160.  I played with some of the post modifications suggested in the other post, but ultimately just ended up disabling the C-Axis in the post processor properties drop-down.  When I first tried simply disabling the C-Axis, I was getting an unexplainable X-Axis overtravel alarm.  Since I was just rotating A, there was no change in the X-Axis position... and it was nowhere near the travel limit.  Not sure what changed, but I posted it again and it worked fine with the C disabled.

 

I'm guessing this is where I would define the A-Axis limitations... The TRT-160 will tilt +/-120°

if (hasA) { // A Axis - For horizontal machines and trunnions
var dir = properties.hasAAxis == "reversed" ? -1 : 1;
if (hasC || hasB) {
var aMin = (dir == 1) ? -120-0.0001 : -30-0.0001;
var aMax = (dir == 1) ? 30+0.0001 : 120+0.0001;
aAxis = createAxis({coordinate:0, table:true, axis:[dir, 0, 0], range:[aMin, aMax], preference:dir});
} else {
aAxis = createAxis({coordinate:0, table:true, axis:[dir, 0, 0], cyclic:true});
}
}

 

As you mentioned, I think just being able to specify a preference of A over C would be sufficient.  I tried to make sense of the edits in the post processor, but couldn't seem to get it to prefer A.  Probably 98% of the time, the normal post would work, but on occasion, it'd be nice to have a separate edited post that would prefer A over C.

 

Thanks... Mike

0 Likes
Message 6 of 19

mattdlr89
Advisor
Advisor

Another way around it, that I thought of a while ago and having seen this post I've just integrated it into mine. Not sure if I have done it correctly though (but seems to work on first test).

 

I've created properties for A and B min and max. So that they can b changed on a per program basis. Saves the need to go and mess with the hardcoded post. It's still a bit crude as you're just limiting the the table movements to get the desired result. Screenshot below. I can post how I edited it if interested. 

 

mattdlr89_0-1608307795768.png

 

 

 

0 Likes
Message 7 of 19

dynamic.machine
Enthusiast
Enthusiast

I'd certainly be interested in seeing the edits... That seems like it could be a handy property to have easy access to.

0 Likes
Message 8 of 19

mattdlr89
Advisor
Advisor
Accepted solution

Ok sure, make sure you check after any changes made and make backup of your existing post.  There are a fair few changes to the post you need to make I've modified the Haas Next Gen post but it is not the latest version so there could be some differences in line numbers etc. 

 

As I started explaining this I was realising there's many different ways this could be set up. So please only attempt this if you are familiar with the posts and what you're trying to achieve. Everything I have done is for an AB trunnion set up. My trunnion has a maximum limit of 120 +/- degrees in A and can go all the way round in B but I modified the post to limit it to +/-180 as a default as there is no need for it go any farther. The parameters are then used to limit this to smaller values when needed depending on the job, mainly so I have tighter control on which way Fusion moves the trunnion. 

 

DISCLAIMER: I made these mods for myself and they have worked on my limited testing so far. Welcome any feedback from someone with more experience. 

 

At around line 82. This should be the user-defined properties list. I appended to the end of this the following. The first and last line should already be there. For me I've used A and B axis as that is how my machine is set up and I've inputted the default values I want for my trunnion here.

 

  useM130ToolImages: false, // enable to include M130 pictures
  aDefinedMax: 120.0, // default degrees A Max
  aDefinedMin: -120.0, // default degrees A Min
  bDefinedMax: 180.0, // default degrees B Max
  bDefinedMin: -180.0 // default degrees B Min
};

 

 

Now you need to define the properties again so that they will appear in the NC Post Processor dialog. This should be at about line 172. I set them all to group 1 and that is where they appear in the window. 

 

  useM130ToolImages: {title:"Include M130 tool images", description:"Enable to include M130 tool images with the NC file.", group: 4, type:"boolean"},
  aDefinedMax: {title:"A Axis Max", description:"Enter in degrees the maximum A angle of rotary", group: 1, type:"spatial"},
  aDefinedMin: {title:"A Axis Min", description:"Enter in degrees the minimum A angle of rotary", group: 1, type:"spatial"},
  bDefinedMax: {title:"B Axis Max", description:"Enter in degrees the maximum B angle of rotary", group: 1, type:"spatial"},
  bDefinedMin: {title:"B Axis Min", description:"Enter in degrees the minimum A angle of rotary", group: 1, type:"spatial"}
};

 

 

After these edits have been made you need to use the parameters in the post. For this it is around line 520. This defines the axis your machine uses. As mentioned above I am using A and B. B was set to cyclic but I changed this to a range using the min and max values that can now be specified from the new parameters. There's a big chunk of code here but I've only edited 4 lines. I've commented after these lines Edit 1, 2 etc and a description. I picked these lines as they are the ones that are relevant for my machine set up. 

 

 

 

 if (properties.machineModel == "none") {
    if (hasA || hasB || hasC) { // configure machine
      var aAxis;
      var bAxis;
      var cAxis;

      if (hasA) { // A Axis - For horizontal machines and trunnions
        var dir = properties.hasAAxis == "reversed" ? -1 : 1;
        if (hasC || hasB) {
          var aMin = (dir == 1) ? properties.aDefinedMin - 0.0001 : -properties.aDefinedMin - 0.0001; //EDIT 1 - A minimum default value of -120 , -30 changed for properties.aDefinedMin variable
          var aMax = (dir == 1) ? properties.aDefinedMax + 0.0001 : -properties.aDefinedMax + 0.0001; //EDIT 2 - A maximum default value of 30 , 120 changed for properties.aDefinedMax variable
          aAxis = createAxis({coordinate:0, table:true, axis:[dir, 0, 0], range:[aMin, aMax], preference:dir});
        } else {
          aAxis = createAxis({coordinate:0, table:true, axis:[dir, 0, 0], cyclic:true});
        }
      }

      if (hasB) { // B Axis - For horizontal machines and trunnions
        var dir = properties.hasBAxis == "reversed" ? -1 : 1;
        if (hasC) {
          var bMin = (dir == 1) ? -120 - 0.0001 : -30 - 0.0001; 
          var bMax = (dir == 1) ? 30 + 0.0001 : 120 + 0.0001; 
          bAxis = createAxis({coordinate:1, table:true, axis:[0, dir, 0], range:[bMin, bMax], preference:-dir}); 
        } else if (hasA) {
          //bAxis = createAxis({coordinate:1, table:true, axis:[0, 0, dir], cyclic:true}); // EDIT 3 - original line commented out for replaced line below.
		  bAxis = createAxis({coordinate:1, table:true, axis:[0, 0, dir], range:[properties.bDefinedMin, properties.bDefinedMax]}); //EDIT 4 -B Axis parameters have been added here. It has been changed from the default cyclic axis to a range so that this can be limited. 
        } else {
          bAxis = createAxis({coordinate:1, table:true, axis:[0, dir, 0], cyclic:true});
        }
      }

      if (hasC) { // C Axis - For trunnions only
        var dir = properties.hasCAxis == "reversed" ? -1 : 1;
        cAxis = createAxis({coordinate:2, table:true, axis:[0, 0, dir], cyclic:true});
      }
    
      if (hasA && hasC) { // AC trunnion
        machineConfiguration = new MachineConfiguration(aAxis, cAxis);
      } else if (hasB && hasC) { // BC trunnion
        machineConfiguration = new MachineConfiguration(bAxis, cAxis);
      } else if (hasA && hasB) { // AB trunnion
        machineConfiguration = new MachineConfiguration(aAxis, bAxis);
      } else if (hasA) { // A rotary
        machineConfiguration = new MachineConfiguration(aAxis);
      } else if (hasB) { // B rotary - horizontal machine only
        machineConfiguration = new MachineConfiguration(bAxis);
      }

      if (hasA || hasB || hasC) {
        setMachineConfiguration(machineConfiguration);
        optimizeMachineAngles2(properties.useTCPC ? 0 : 1); // map tip mode
      }
    }
  } else {
    defineMachine();
  }

 

 

The result of this is that now when you go to the post processor dialog you have 4 new boxes that allow you to set the max and min values. 

 

Edit: corrected error in EDIT 4 of last code snippet

 

0 Likes
Message 9 of 19

bob.schultz
Alumni
Alumni
Accepted solution

@dynamic.machine wrote:

Is there any way to force fusion to post an A-90?  The TRT-160 will tilt A+/- 120 degrees.  I am in a situation where I need to force the trunnion to tilt A-90 instead of remaining at A90 and rotating C180 to get to the other side of the part.  I have tried flipping the x-axis under tool orientation for the toolpath and it makes no difference at all.  The machine has DWO/TCPC and the "Use TCPC Programming" post property is set to Yes.  I have run into this issue before, but was able to work around it.  This time, I have limitations that require A-90.  In this particular situation, all I need is to be able to tilt the part A90 and A-90.  No C axis moves are needed.  Would somehow disabling the C Axis in the post get me what I need?


It is interesting to see the creative ways that have been used to control the direction of the rotary axes in the post.  For this request I am going to give a more direct and simplified example of controlling the direction of the axes for a single 3+2 operation in the program.  The latest version of the Haas Next Generation post has logic to select the closest solution for the rotary axes based on the direction preference defined when creating the axis, so make sure that you are working with the latest version of the post (it should have the getPreferenceWeight function defined in it).

 

You will need to create a Manual NC command that determines the direction of the A-axis.  You do this by adding the following code to the onManualNC function, which defines the Action Manual NC commands "A+" and "A-".

Action.png

    } else if (String(value).toUpperCase() == "VFD_HIGH") {
      coolantPressure = "P2";
    } else if (String(value).toUpperCase() == "A+") { // <<<  ADD FROM THIS LINE
      rotaryDirection[0] = 1;
      forceWorkPlane();
    } else if (String(value).toUpperCase() == "A-") {
      rotaryDirection[0] = -1;
      writeln("direction = " + rotaryDirection[0]);
      forceWorkPlane(); // <<<  TO THIS LINE
    }
    break;

Next, at the getPreferenceWeight function make the following changes.

var closestABC = true; // choose closest machine angles
var currentMachineABC = new Vector(0, 0, 0);
var rotaryDirection = [0, 0, 0]; // <<< ADD THIS LINE

function getPreferenceWeight(_abc) {
  var axis = new Array(machineConfiguration.getAxisU(), machineConfiguration.getAxisV(), machineConfiguration.getAxisW());
  var abc = new Array(_abc.x, _abc.y, _abc.z);
  var preference = 0;
  for (var i = 0; i < 3; ++i) {
    if (axis[i].isEnabled()) {
      var axisPreference = rotaryDirection[i] == 0 ? axis[i].getPreference() : rotaryDirection[i]; // <<<  ADD THIS LINE
      preference += ((abcFormat.getResultingValue(abc[axis[i].getCoordinate()]) * axisPreference) < 0) ? -1 : 1; // <<< CHANGE TO 'axisPreference'
    }
  }
  return preference;
}

And finally if you want the A+ and A- commands to only affect the next operation and not become the default setting, then add the following line at the end of the onSectionEnd function.

  // reset for next section
  operationNeedsSafeStart = false;
  coolantPressure = properties.coolantPressure;
  cycleReverse = false;
  rotaryDirection = [0, 0, 0]; <<<  ADD THIS LINE
}

Now you can control the direction of the A-axis on an operation to operation basis for 3+2 operations.



Bob Schultz
Sr. Post Processor Developer

Message 10 of 19

dynamic.machine
Enthusiast
Enthusiast

Thank you guys so much for all the help...  This will definitely get me pointed in the right direction. 

0 Likes
Message 11 of 19

mattdlr89
Advisor
Advisor

@bob.schultz Thanks for that suggestion I'll have to look at it in a bit more detail but looks a bit cleaner than mine! 

0 Likes
Message 12 of 19

dynamic.machine
Enthusiast
Enthusiast

@bob.schultzThanks for your help on this... I have made the changes to the latest version of the Haas NGC post and I'm getting a result that is a little out of whack.  I have double checked my edits and I think I got them all right, but where I insert the Manual NC Action "A-" the post is outputting "direction = -1"

Screenshot attached.  I have also attached the f3d file and my modified post.

0 Likes
Message 13 of 19

bob.schultz
Alumni
Alumni

Sorry, I did leave some debug code in my example.  You should remove the following line in the onManualNC function.

  writeln("direction = " + rotaryDirection[0]);  // REMOVE THIS LINE

In your post there are a couple of other changes necessary to get the desired results.  In the onOpen function you need to increase the limits of the A-axis so that it can move to -90 degrees.  You can also change the default direction of the A-axis so that it still selects the positive direction by default.

      if (hasA) { // A Axis - For horizontal machines and trunnions
        var dir = properties.hasAAxis == "reversed" ? -1 : 1;
        if (hasC || hasB) {
          var aMin = (dir == 1) ? -120 - 0.0001 : -120 - 0.0001; // <<< CHANGE TO -120 (or the actual limit on your machine)
          var aMax = (dir == 1) ? 120 + 0.0001 : 120 + 0.0001; // <<< CHANGE TO -120 (or the actual limit on your machine)
          aAxis = createAxis({coordinate:0, table:true, axis:[dir, 0, 0], range:[aMin, aMax], preference:-dir, reset:(hasB ? 0 : 1)}); // <<< CHANGE TO 'preference:-1'
        } else {
          aAxis = createAxis({coordinate:0, table:true, axis:[dir, 0, 0], cyclic:true});
        }
      }

 



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 14 of 19

Anonymous
Not applicable

I have the same problem and am looking for a solution. You may uncheck the C axis to no but this creates another problem. It will not index the c axis to you work offset value. This is important since you needed this value when you indicate your fixture(vise). I too have changed all the axis values with no effect on the code values. When I use the C value to yes, it posts at C 180 and SB C0 by the axis on the part. 

0 Likes
Message 15 of 19

bob.schultz
Alumni
Alumni

Hello @Anonymous,

 

The determination of the direction of the C-axis is based on the preferred direction of the A-axis.  For example, A90 C180 has the same part orientation as A-90 C0 on the machine.  As discussed in this thread, the preference of the A-axis can be changed when it is created and by a Manual NC command if you want to change the preference for a specific operation only.

 

Have you tried modifying your post with any of the suggestions in this thread?  If not, the best place to start is when the A-axis is created.  Changing the sign of the preference variable will cause the post to choose the other solution.  For example, the following code in defineMachine ...

 

aAxis = createAxis({coordinate:0, table:true, axis:[dir, 0, 0], range:[aMin, aMax], preference:dir, reset:(hasB ? 0 : 1), tcp:useTCPC});

 

... can be changed to use -dir for the preference.  This should select the opposite solution A-90 C0 instead of the current solution A90 C180 (these angles are listed as an example, since you did not state the A-axis position in your post).

 

aAxis = createAxis({coordinate:0, table:true, axis:[dir, 0, 0], range:[aMin, aMax], preference:-dir, reset:(hasB ? 0 : 1), tcp:useTCPC});



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 16 of 19

jordon.bell
Explorer
Explorer

Hi  @bob.schultz 

 

I have reviewed your suggestions for manual inputting "A+" & "A-" It does seem to be the perfect solution for me but I am having a bit of difficulty getting things going.

 

I have noticed the new Haas NGC post does not have the function "getPreferenceWeight" you have mentioned above

 

I have tried adding it in manually from the previous posts attachment but can't seem to get things to function properly this way.

 

I am trying to control a-axis solutions with NC manual input so I can handle clearance issues with TRT160. changing post globally wont work as every operation is different and has different clearance requirements.

 

I am also curious if fusion has the capability to have post orient the rotary's based on the orientation of "tool orientation coordinate system" defined within the toolpath settings.

 

Attaching current post below.

 

Thanks!

Jordon

0 Likes
Message 17 of 19

bob.schultz
Alumni
Alumni

Hi Jordon,

 

The Haas posts have been simplified to use new post engine capabilities and the instructions in this thread do not apply to the latest version of the posts.

It is now much easier to control via a Manual NC command.  To make the changes to your post, you should first remove the following code from the post (getPreferenceWeight and remapToABC functions and associated variables).

// <<< Remove all lines from this line
var closestABC = true; // choose closest machine angles
...
// <<< To this line (but leave the forceModals function definition line)
function forceModals() {

 

Next, add the following two variables above the getWorkPlaneMachineABC function.

 

// <<< Add these 2 lines
var rotaryPreference = PREFER_PREFERENCE;
var controllingAxis = ABC;

 

Now change the following line in the getWorkPlaneMachineABC function.

 

// <<< Existing line
  var abc = machineConfiguration.getABCByPreference(W, currentABC, ABC, PREFER_PREFERENCE, ENABLE_ALL);

// <<< New line
  var abc = machineConfiguration.getABCByPreference(W, currentABC, controllingAxis, rotaryPreference, ENABLE_ALL);

 

Next, make the following changes in the onManualNC function.

 

// <<< Remove the rotaryDirection assignments and replace with the shown code
    } else if (String(value).toUpperCase() == "A+") {
      controllingAxis = A; // <<< Add this line
      rotaryPreference = PREFER_POSITIVE; // <<< Add this line
      forceWorkPlane();
    } else if (String(value).toUpperCase() == "A-") {
      controllingAxis = A; // <<< Add this line
      rotaryPreference = PREFER_NEGATIVE; // <<< Add this line
      forceWorkPlane();

 

 And finally, reset the preference to the default value in onSectionEnd.

 

  // rotaryDirection = [0, 0, 0]; // <<< Remove this line
  controllingAxis = ABC; // <<< Add this line
  rotaryPreference = PREFER_PREFERENCE; // <<< Add this line

 

It is possible to control the A-axis direction based on the tool orientation by checking the Y-axis orientation of the work plane  and basing the A-axis direction on whether the Y-axis component is positive or negative.  You will need to check the X-axis orientation if the Y-axis component is at 0.

For example, the following two work planes represent the same orientation of the rotary axes, but one flips the Y-axis direction in Fusion. 

 

  currentSection.workPlane=[[1, 0, 0], [0, 0.866025, -0.5], [0, 0.5, 0.866025]]
  currentSection.workPlane=[[-1, 0, 0], [0, -0.866025, -0.5], [0, -0.5, 0.866025]] // Y-axis is flipped

 



Bob Schultz
Sr. Post Processor Developer

Message 18 of 19

jan_krasula
Community Visitor
Community Visitor

Would it be possible to write same modification for latest 2024 posts?

 

Thank you

0 Likes
Message 19 of 19

jimcraig5615
Contributor
Contributor

Bob, I appreciate you showing the methods to modify the posts in the past. Here in January of 2026 it appears the posts have been modified once again so that the advice you have given does not hold true anymore. I will go through and outline what I see are differences in what you have suggested and what we have now.

 

This is working off of HAAS - Next Generation Control Post

$Revision: 44209 3038eea6b5766ff091fd38cd623d9bc6a35075fa $
$Date: 2026-01-07 13:44:58 $

 

Your first suggestion above states to modify the getPreferenceWeight and remapToABC functions by deleting lines of code. In this post the getPreferenceWeight and the remapToABC functions do not exist.

 

I was able to add the two variables above the getWorkPlaneMachineABC function.

 

// <<< Add these 2 lines
var rotaryPreference = PREFER_PREFERENCE;
var controllingAxis = ABC;

 

In your next modification you state to change the getWorkPlaneMachineABC function line that is as follows.

 

// <<< Existing line
  var abc = machineConfiguration.getABCByPreference(W, currentABC, ABC, PREFER_PREFERENCE, ENABLE_ALL);

however the actual current line in the post reads as follows.

// <<< Actual Existing Line in Current Post
var abc = _section.getABCByPreference(machineConfiguration, _section.workPlane, currentABC, settings.machineAngles.controllingAxis, settings.machineAngles.type, settings.machineAngles.options);

 So it appears that these things are now controlled by settings.machineAngles. but I don't see in the post where this actually comes from.

I can go ahead and change these to read as you suggested so the new line would look like the following.

// <<< New Line
var abc = _section.getABCByPreference(machineConfiguration, _section.workPlane, currentABC, controllingAxis, rotaryPreference, settings.machineAngles.options);

 So then I can add in the onManualNC modifications as you state

And I can add the two lines to the onSectionEnd as you state. 

 

But even with these changes it does not appear that this is working in the simulate with machine within Fusion. 

 

 

0 Likes