Hello @YannickDPM6,
This is a known issue in some of our post processors and we are currently working on updating them to position correctly for multi-axis operations. One post that already has this logic implemented is the Doosan VMC Fanuc post processor. You can copy the code from this post into your post.
Find the following code in the Doosan post and copy it to your post, just after the call to disableLengthCompensation and prior to the check of if the machine has a rotary head (line 1749). Be sure to change the call to setWorkPlane.
var isPrePositioned = false;
if (currentSection.isMultiAxis() && useMultiAxisFeatures) {
var W;
if (machineConfiguration.isMultiAxisConfiguration()) {
W = machineConfiguration.getOrientation(abc);
} else {
W = Matrix.getOrientationFromDirection(currentSection.getGlobalInitialToolAxis());
}
var euler = W.getEuler2(eulerConvention);
if (euler.isNonZero()) {
// <<< your setWorkPlane function does not have 'currentSection', so remove it here
setWorkPlane(currentSection, euler);
var prePosition = W.getTransposed().multiply(initialPosition);
writeBlock(
gAbsIncModal.format(90), gMotionModal.format(0),
xOutput.format(prePosition.x), yOutput.format(prePosition.y)
);
cancelWorkPlane();
writeBlock(
gMotionModal.format(0),
gFormat.format(offsetCode),
zOutput.format(initialPosition.z),
hFormat.format(lengthOffset)
);
lengthCompensationActive = true;
zIsOutput = true;
isPrePositioned = true;
}
}
if (!isPrePositioned) {
// <<< the initialPosition code gets placed inside of this if-block
if (!machineConfiguration.isHeadConfiguration()) {
...
}
You will need to include this definition in the fixed settings of the post.
// fixed settings
var eulerConvention = EULER_ZXZ_R;
And you will need to include this function in its entirety.
Matrix.getOrientationFromDirection = function (ijk) {
var forward = ijk;
var unitZ = new Vector(0, 0, 1);
var W;
if (Math.abs(Vector.dot(forward, unitZ)) < 0.5) {
var imX = Vector.cross(forward, unitZ).getNormalized();
W = new Matrix(imX, Vector.cross(forward, imX), forward);
} else {
var imX = Vector.cross(new Vector(0, 1, 0), forward).getNormalized();
W = new Matrix(imX, Vector.cross(forward, imX), forward);
}
return W;
};

Bob Schultz
Sr. Post Processor Developer