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