Remove prepositioning of tilted axis with G43.4

Remove prepositioning of tilted axis with G43.4

YannickDPM6
Participant Participant
1,848 Views
5 Replies
Message 1 of 6

Remove prepositioning of tilted axis with G43.4

YannickDPM6
Participant
Participant

Hi, I'm struggling with a little problem where the post-processor first tilts our B- and C-axis and then move to a XY position.

 

When we work with tilted plane (G68.2) everything works fine. The machine tilts, positions in X and Y and then Z.

 

Example:

G54

G68.2 X0. Y0. Z0. I80. J30. K-90.

G53.1

M08

G00 X31.061 Y1.102

G43 Z37.25 H12

 

When we use 5-axis simultaneous (G43.4) the machine positions the B and C-axis before the XY position and the G43.4, that line has to be removed (in red).

 

G54

G00 B25.92 C-171.537

M08

G00 X-34.189 Y-6.641

G43.4 Z15. H12

G00 B25.92 C-171.537

 

When I change the ‘true’ to ‘false’ in line 1714 of the attached post processor the output is good for 5-axis simultaneous (G43.4), but then it’s not good for tilted plane (G68.2)

 

var abc = defineWorkPlane(currentSection, true);

 

 

Any idea how to get this to work in both situations?

0 Likes
1,849 Views
5 Replies
Replies (5)
Message 2 of 6

bob.schultz
Alumni
Alumni

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

0 Likes
Message 3 of 6

YannickDPM6
Participant
Participant

Hi Bob,

 

Thanks for the quick response. I made the changes, but what do you mean exactly with 'Be sure to change the call to setWorkPlane'?

 

Kind regards,

Philip

0 Likes
Message 4 of 6

bob.schultz
Alumni
Alumni

The call to setWorkPlane in the Doosan post includes the section parameter.

setWorkPlane(currentSection, euler);

Your post does not take this parameter.

setWorkPlane(euler); // <<< remove currentSection


Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 5 of 6

YannickDPM6
Participant
Participant

Hi Bob,


The toolpaths that use the G68.2 (tilted plane) post well now.

The toolpaths which use G43.4 (5-axis simultaneous) are giving us an error at line 1773 which says 'gFormat.format(offsetCode), '

 

writeBlock(
gMotionModal.format(0),
gFormat.format(offsetCode),
zOutput.format(initialPosition.z),
hFormat.format(lengthOffset)

 

Hereby the log:

Information: Configuration: FANUC Inspection
Information: Vendor: Fanuc
Information: Posting intermediate data to 'Y:\data\nc\AX630\2003'
Information: Total number of warnings: 1
Error: Failed to post process. See below for details.
...
Code page changed to '1252 (ANSI - Latijns I)'
Start time: Monday, December 20, 2021 3:24:28 PM
Code page changed to '20127 (US-ASCII)'
Post processor engine: 4.5834.0
Configuration path: C:/Fusion360/Machines/Viktor AX-630 aangepast.cps
Security level: 1000
Include paths: C:/Fusion360/Machines
Configuration modification date: Monday, December 20, 2021 3:14:38 PM
Output path: Y:\data\nc\AX630\2003
Checksum of intermediate NC data: c280cb73327bc9ef3ed7ae7bb3a99fa7
Checksum of configuration: acda87e21247c48823282bb22b933c0b
Vendor url: http://www.fanuc.com
Legal: Copyright (C) 2012-2021 by Autodesk, Inc.
Generated by: Fusion 360 CAM 2.0.11894
...
Warning: Work offset has not been specified. Using G54

###############################################################################
Error: ReferenceError: offsetCode is not defined
Error at line: 1773
Error in operation: 'Rollen Voor trpaje maken'

Stack dump:
onSection()@C:/Fusion360/Machines/Viktor AX-630 aangepast.cps:1772
Failed while processing onSection() for record 401.
###############################################################################

Error: Failed to invoke function 'onSection'.
Error: Failed to invoke 'onSection' in the post configuration.
Error: Failed to execute configuration.
Stop time: Monday, December 20, 2021 3:24:28 PM
Post processing failed.

 

Kind regards,
Philip Jordens.

0 Likes
Message 6 of 6

bob.schultz
Alumni
Alumni

Hello Philip,

 

The code that you added from the Doosan VMC post to your post is a little bit different, as we already noticed in the call to setWorkPlane.  You should replace all references to offsetCode in the code you added to getOffsetCode().  This will solve this error.



Bob Schultz
Sr. Post Processor Developer

0 Likes