Community
Fusion Manufacture
Talk shop with the Fusion (formerly Fusion 360) Manufacture Community. Share tool strategies, tips, get advice and solve problems together with the best minds in the industry.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Stop B moves on trunnion

21 REPLIES 21
SOLVED
Reply
Message 1 of 22
mattdlr89
810 Views, 21 Replies

Stop B moves on trunnion

Hi All

I'm new to Fusion 360 been testing it all out yesterday and altering posts. We have a Haas VF-6 with TR310 trunnion table. What I'd like to do is use fusion for a lot of 3+2 axis work. However so far the post processor will seem to move A in one direction then swing B 180 degrees rather than just move A the other way. 

For example I want to face a part at A60 and A-60 all the while B is 0. The output will go to A+60 for the first face operation then swing B180 for the second face. I really want it to go back to A-60 to face the other side. 

 

Is this functionality possible and if so what do I need to alter? I just using one coordinate system swinging around a pivot point.  We don't have DWO/TCPC.

 

I am using the Haas next gen control post. 

 

Thanks

Tags (1)
Labels (1)
21 REPLIES 21
Message 2 of 22
engineguy
in reply to: mattdlr89

@mattdlr89 

 

If you are only doing simple operations that are rotating around the A axis as in your question which is basically 3+1 operations then just turn off the B axis at point of posting and you will get the A60 and A-60, no B axis will appear ing the code.

HAAS B axis off.jpg

I am assuming you have the A axis as the Trunnion rotating around the X axis of the machine and the B axis rotating around the Y axis of the machine ???

 

Without an f3d file and more information that`s all I have for now, keeping it simple 🙂 🙂

 

Regards

Rob

Message 3 of 22
mattdlr89
in reply to: engineguy

Thanks for your response. 

We still need to use 3 + 2. As I will need to do machining passes at some B angles but what I'm trying to do is limit my B moves. We are typically machining cylinder heads so frequently have lots of features at around A+/-20. 

I don't have a file that is representative of what we will be doing to send over as I'm new to fusion and I was just messing around with a tutorial file to work out if what I explained before is possible. I'm hoping it is so that we can use Fusion going forward. 

 

What we really have is an A and C axis trunnion. It's mounted on the table so that A rotates around X and the platter would rotate around Z at A0. Our control refers to it as A and B.

 

Is there a way on an operation level to limit the B move. I also tried limiting the B range to +/-175 but I couldn't seem to get that to work in the post.

Message 4 of 22
engineguy
in reply to: mattdlr89

@mattdlr89 

 

Best I can see is to be as careful as possible with the ordering of operations, it seems that a lot will depend on just what operations you do, I can`t see any way to change that 180 deg move when going from one angle side and top to the other angle side, have a look at  the image below and the attached code, maybe it is the sort of thing that will work for you 🙂 🙂

It is reasonable, only the one B-180 move on this example at least, and I managed to keep the tool changes to a minimum which might prove more difficult for you with more complex operations in the future as you get more adventurous 🙂 🙂 🙂

File attached.

HAAS 3+2 v0.jpg

 

Regards

Rob

 

Message 5 of 22
bob.schultz
in reply to: mattdlr89

It sounds like you want the post to choose the closest rotary solution to the current rotary positions.  You can accomplish this by making the following changes to the post processor.  First, you need to let the post know that you want the closest solution by changing the following variable to true.

var closestABC = true; // choose closest machine angles

 Now you will need to add the following function that will calculate the solution with the least amount of movement between the axes.  Just paste this function into the post above the getWorkPlaneMachineABC function.

function remapToABC(currentABC, previousABC) {
  var both = machineConfiguration.getABCByDirectionBoth(machineConfiguration.getDirection(currentABC));
  var abc1 = machineConfiguration.remapToABC(both[0], previousABC);
  abc1 = machineConfiguration.remapABC(abc1);
  var abc2 = machineConfiguration.remapToABC(both[1], previousABC);
  abc2 = machineConfiguration.remapABC(abc2);
  if (Vector.diff(abc1, previousABC).length < Vector.diff(abc2, previousABC).length) {
    return abc1;
  } else {
    return abc2;
  }
}

And finally, call this function instead of the machineConfiguration version of the function inside of the getWorkPlaneMachineABC function.

  if (closestABC) {
    if (currentMachineABC) {
      abc = remapToABC(abc, currentMachineABC);  // MAKE THE CHANGE HERE
    } else {
      abc = machineConfiguration.getPreferredABC(abc);
    }
  } else {

This should get you the desired output.

 



Bob Schultz
Sr. Post Processor Developer

Message 6 of 22
mattdlr89
in reply to: bob.schultz

Hi Bob

Thanks for your response. This seems to be what I am after. I have applied it to the post as you said and it works up to A+/-30 degrees but above that it reverts to changing the B again. This is probably ok for most work but it would be nice to know if the post can be edited further to stop B moves up to 60 degrees?

 

It seems to be that above A+/-320 abc1 = abc2 in the post. 

Thanks

Message 7 of 22
bob.schultz
in reply to: mattdlr89

Yes, this would be correct if you have not changed the limits of the A-axis, since it defaults to -30, 120, so it will not go past -30 degrees.  You need to modify the limits in the post to match your machine.

 

FYI, the rule for which axis to select is in the following line in the remapToABC function.

if (Vector.diff(abc1, previousABC).length < Vector.diff(abc2, previousABC).length) {

It takes the total distance of both axes and selects the solution with the least amount of movement.  If you want to use just the B-axis to determine which solution to use, you can modify this line to read as follows.

if (Math.abs(abc1.y - previousABC.y) < Math.abs(abc2.y, previousABC.y)) {

 



Bob Schultz
Sr. Post Processor Developer

Message 8 of 22
mattdlr89
in reply to: bob.schultz

Great thanks. This is really helpful.

 

So what would the expression below evaluate to? Just trying to understand what it works out. Is it comparing angular distances in degrees?

Vector.diff(abc1, previousABC).length

 

Message 9 of 22
bob.schultz
in reply to: mattdlr89

Yes, it is comparing the angular distances.  The ABC vectors contain the rotary axes positions (a, b, c) and this conditional simply subtracts one set of angles from the other and then gets the vector length or combination of all rotary deltas, the same as if it were comparing the distance between 2 linear points.



Bob Schultz
Sr. Post Processor Developer

Message 10 of 22
mattdlr89
in reply to: bob.schultz

Hi @bob.schultz 

So I've been using this post and it works well with the mods you suggested a while back. I have just noticed some unwanted behaviour and was wondering if there is a simple fix. 


I was just trying to machine something at A20 degrees B0. If I try to post this operation on its own (I'm proving out the programs). It will go to A-20 B180. If I post it in order of the previous operation (which is at A0 B0). It will move to A20 B0 as expected. I guess when the post does the remapABC function it does not have a default A0B0 for the first operation. Is there a way to set the default A B position of the machine in the post so that when it calculates the A B move it will assume it is at A0B0 if there is no previous operation?

Message 11 of 22
bob.schultz
in reply to: mattdlr89

Looking over my past comments, it looks like I left out an important change.  Find the definition of the currentMachineABC variable and change it to default to 0,0,0.  This should resolve this issue.

var currentMachineABC = new Vector(0, 0, 0);

 



Bob Schultz
Sr. Post Processor Developer

Message 12 of 22
mattdlr89
in reply to: bob.schultz

Great thanks! That does exactly what I was looking for.

Message 13 of 22
mattdlr89
in reply to: bob.schultz

Hi @bob.schultz 

 

Resurrecting a bit of an old post but I have updated to the latest Haas post processor and wanted to implement this again, however looking at the post it looks like this might have been added as a standard feature now albeit the code slightly different. 

 

I am not getting the behaviour that I want where by it will move the shortest distance of A or B and not move both if it's not necessary. Your code in this thread made it work perfectly in my old post last year. Now I've got the latest Haas post I want to know if I just need to activate this somehow or is it a different to get it working how I had it? 

 

There is already a "remaptoABC" function at about line 1440 (latest Haas NGC post).

Message 14 of 22
bob.schultz
in reply to: mattdlr89

Hello @mattdlr89,

 

Yes, the library post has been modified to select the closest solution for the rotary axes now.  The added logic in this post is that it will honor the "preference" assigned to each axis when choosing the solution.  The preference will override the closest direction, i.e. if the preferred direction of the A-axis is defined as "preferred:1", then an A+ direction will always be selected when available.

 

The easiest way to override the preference when selecting the closest direction is to always return '0' from the getPreferenceWeight function.

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()) {
      preference += ((abcFormat.getResultingValue(abc[axis[i].getCoordinate()]) * axis[i].getPreference()) < 0) ? -1 : 1;
    }
  }
  return 0 /*preference*/; <<< ALWAYS RETURN 0 HERE
}

 Be sure to change the limits of the A-axis so that it has the same negative limit as the positive limit.



Bob Schultz
Sr. Post Processor Developer

Message 15 of 22
mattdlr89
in reply to: bob.schultz

Hi @bob.schultz 

Thanks for the quick reply. 

 

When I updated to this post I also added a machine definition for my one in line with how the UMC are defined already. I attach the code below, would setting preference to 0 on axis 1 achieve the same as what you propose?

 

We have a couple of Haas machines and my plan was to set up a case for each machine as below. 

 

 

  case "vf-6":
    var axis1 = createAxis({coordinate:0, table:true, axis:[-1, 0, 0], range:[-120, 120], preference:0, reset:0});
    var axis2 = createAxis({coordinate:1, table:true, axis:[0, 0, 1], cyclic:true});
    machineConfiguration = new MachineConfiguration(axis1, axis2);
    machineConfiguration.setHomePositionX(toPreciseUnit(-800, MM));
    machineConfiguration.setHomePositionY(toPreciseUnit(0, MM));
    machineConfiguration.setRetractPlane(toPreciseUnit(100, MM));
    setProperty("homePositionCenter", false);
    setProperty("forceHomeOnIndexing", false);
    maximumSpindleRPM = 12000;
    break;

 

Message 16 of 22
bob.schultz
in reply to: mattdlr89

Yes, specifying a preference of 0 will have the same effect.



Bob Schultz
Sr. Post Processor Developer

Message 17 of 22
mattdlr89
in reply to: bob.schultz

Hi @bob.schultz 

 

I'm trying to apply this modification to the latest Haas NGC Inspect post. It has changed a lot since you advised me on these modifications and I can't quite figure it out.

 

I have an operation level preference named aAxisPreference that is -1, 0 or 1 depending on the preference I want for my A axis to move. This allows me to set which way my trunnion will move on a per-operation level and works really well for avoiding some collisions. However I want to use transition to the inspect post for Haas and might as well use the most up to date version. 

 

How can I incorporate this operation level property to change the a axis preference in the post? I am just using the stock latest post ( Post for HAAS - Next Generation Control Inspect Surface (autodesk.com) ).

 

Thanks

Message 18 of 22
bob.schultz
in reply to: mattdlr89

Hi @mattdlr89,

 

It is now simpler to control the direction of an axis on a per-operation basis.  In the getWorkPlaneMachineABC function replace the following line ...

  var abc = machineConfiguration.getABCByPreference(W, currentABC, ABC, PREFER_PREFERENCE, ENABLE_ALL);

... with the following lines to control the A-axis direction.

  var preferences = [PREFER_NEGATIVE, PREFER_CLOSEST, PREFER_POSITIVE];
  var abc = machineConfiguration.getABCByPreference(W, currentABC, A, preferences[aAxisPreference + 1], ENABLE_ALL);

 



Bob Schultz
Sr. Post Processor Developer

Message 19 of 22
mattdlr89
in reply to: bob.schultz

I think I need a little more help please @bob.schultz 

 

I have the aAxisPreference property which I select in the operation within Fusion. This looks like this in the post

 

 

  aAxisPreference: {
    title      : "A Axis Direction",
    description: "Select which direction to move A axis for this operation only. Will then default to closest solution.",
    group      : "multiaxis",
    type       : "enum",
    values     : [
      {title:"A+", id:"1"},
      {title:"A0", id:"0"},
      {title:"A-", id:"-1"}
    ],
    value: "0",
    scope: "operation"
  }

 

 

However I cannot then use this. I tried using getProperty like so:

 

 

aAxisPreference = getProperty("aAxisPreference");

 

 

However this fails with the following error:

 

Error: Error: Mismatching arguments for invocation of 'Vector MachineConfiguration.getABCByPreference(Matrix,Vector,int,int,int) const' (Value is not an integer.).

Error at line: 1

Error in operation: 'Face1'

 

It seems my aAxisPreference variable is not being used correctly. Could you tell me how to process the property with your line of code please?

 

Thanks

Message 20 of 22
mattdlr89
in reply to: mattdlr89

@bob.schultz 

I've also noticed that the PREFER_CLOSEST doesn't seem to work on my test file. It is swinging the B axis around 180 degrees when the shortest route would be to move A and not move B at all. It's a simple file with 2 facing operations at A+40degrees and A-40 degrees. 

 

Hopefully get my first problem with the property sorted first though and I can look into this further. 

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

Post to forums  

Autodesk Design & Make Report