3+2 Axis Prepositioning error Fanuc 31i

3+2 Axis Prepositioning error Fanuc 31i

dcsDHNS6
Enthusiast Enthusiast
3,826 Views
23 Replies
Message 1 of 24

3+2 Axis Prepositioning error Fanuc 31i

dcsDHNS6
Enthusiast
Enthusiast

@bob.schultz 

 

After having spend multiple days and hours editing this Post Processor for a Danibrum 5 axis machine (Head/Head) using a Syntec controller, i got stuck. My limits are A(130/-130) and C(360/-360). Talking to the Machinebuilder they advised me to use only ABC moves for 3+2 Positioning. 

 

I tried activating the ABC Prepositioning, but this seemed to not have any effect.

 

Doing 5 axis machining works perfectly fine and simulates it nicely(in Fusion)

Doing 3+2 Axis machining works fine also IF: it is only 1 operation in 1 program. (Simulation is complelety wrong side).

 

The machine has RTCP and can read G68.2 and G53.1.

If there are multiple 3+2 operations it seems to add the Coordinates, even if a G49 is used. Resulting in a software limit exceed error.

 

Here is an example:

%
O1001
(MACHINE)
( VENDOR DANIBRUM)
( MODEL BCM2130)
( DESCRIPTION 5 AXIS HEAD HEAD)
(T2 D=11.8 CR=0. - FLAT END MILL)
N10 G00 G53 Z0.
N15 G00 G91 G28 A0. C0.
N20 G90

(2D ADAPTIVE1)
N25 M06 T2
N30 M03 S18000
N35 G17 G90 G94
N40 G54
N45 G00 G53 Z0.
N50 G68.2 X0. Y0. Z0. I90. J90. K0.
N55 G53.1
N60 G43.4 H02 G54 Z172.5
N65 G90 G00 G54 X35.682 Y-38.329
N70 G00 Z162.5
N75 Z148.68
N80 G01 Z147.5 F6000.
N85 Z145.5
N90 G03 X29.455 Y-36.5 I-6.683 J-11.241

(....)

N4140 X22.979 Y-7.074 Z138.18
N4145 G00 Z172.5
N4150 G49
N4155 G00 G53 Z0.
N4160 G90                                           //works fine until here

 

(SLOT1)
N4165 G69
N4170 G68.2 X0. Y0. Z0. I-90. J90. K0.
N4175 G53.1                                                                     //Here i get an error that it's exceeding my software limits
N4180 G43.4 H02 G54 Z172.5
N4185 G00 G54 X-9. Y-18.25
N4190 G00 Z162.5
N4195 G01 Z160. F6000.
(....)
N4260 G00 Z172.5
N4265 G49
N4270 G00 G53 Z0.
N4275 G90

 

(2D POCKET2)
N4280 G69
N4285 G68.2 X0. Y0. Z0. I0. J90. K0.
N4290 G53.1                                                                               //Here again i get an error message
N4295 G43.4 H02 G54 Z38.5
N4300 G00 G54 X-117.652 Y-17.65
N4305 G00 Z28.5
(...)
N4425 G00 Z38.5
N4430 G17

N4435 M05
N4440 G49
N4445 G00 G53 Z0.
N4450 G90
N4455 G69
N4460 M30
%

 

If i execute each one in sepparate Programs, they all work fine.

 

Thank you for your time, honestly much appreciated.

If you can guide me in the right direction, i'm honestly stuck here.

 

0 Likes
Accepted solutions (3)
3,827 Views
23 Replies
Replies (23)
Message 2 of 24

bob.schultz
Alumni
Alumni

Thanks for supplying the post processor.  I notice that this post processor is based on the CR Onsrud post processor, which enables TCP for 3+2 operations.  I believe this post is the only one that does this and it is probably not needed on your machine.

N60 G68.2 X0. Y0. Z0. I0. J30. K0.
N65 G53.1
N70 G43.4 H02 G54 Z27.5 (<<< CHANGE G43.4 to G43 for 3+2 operations)


Other than this, tool length compensation (G49) and the tilted work plane (G69) are both canceled between operations so these should not be a factor when running multiple 3+2 operations, though I did notice that neither of these are cancelled prior to the first operation.  If disabling TCP does not do the trick, you may want to cancel these prior to the first operation to see if this causes the program to fail at the first operation.

(2D-FACE1)
N25 M06 T2
N30 M03 S5000
N35 G17 G90 G94
N40 G54
N45 G00 G53 Z0.
N50 G49 G69 (<<< ADD THIS BLOCK after the retract in the first operation)
N55 G17
N60 G68.2 X0. Y0. Z0. I0. J30. K0.
N65 G53.1


Lastly, since multi-axis operations are working, you can modify 3+2 operations so that they are output in the same manner as multi-axis operations (TCP enabled and no G68.2).



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 3 of 24

dcsDHNS6
Enthusiast
Enthusiast

@bob.schultz 

"Lastly, since multi-axis operations are working, you can modify 3+2 operations so that they are output in the same manner as multi-axis operations (TCP enabled and no G68.2)."

 

I believe this to be the only correct solution. 

 

even though i tried modifying the:

 onCommand(COMMAND_UNLOCK_MULTI_AXIS);

 

I did not manage to find out where the 3+2 and the 5 axis are sepparated.

 

Can you show me how to modify this post so it uses G43.4 for all multi axis operations?

 

Thank you for your time and effort.

0 Likes
Message 4 of 24

bob.schultz
Alumni
Alumni

Changing the following setting to false where it is defined towards the top of the file will generate 3+2 operations using TCP.

// fixed settings
var firstFeedParameter = 500;
var useMultiAxisFeatures = false; // <<< CHANGE TO false


Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 5 of 24

dcsDHNS6
Enthusiast
Enthusiast

@bob.schultz 

Thank you very much for your fast response.

 

If it were that simple. I tired that before, but it throws me an error "unable to invoke onSecion".

 

here is the Message:

 

Error: Failed to post process. See below for details.
...
Code page changed to '1252  (ANSI - Latin I)'
Command-line: C:\Users\DCS\AppData\Local\Autodesk\webdeploy\production\fd081b4c15f2fc37998034adb20de16163fc298f\Applications\CAM360\post.exe "c:\Users\DCS\Desktop\Danibrum 5 axis Syntec 610m Lucian Craciun V9 Sim.cps" "c:\Users\DCS\.vscode\extensions\autodesk.hsm-post-processor-4.1.3\res\CNC files\Milling\3+2\b-30.cnc" C:\Users\DCS\AppData\Local\Temp\AutodeskPostUtility\OutputFiles\debuggedfile.nc --noeditor --debugall --property unit 1 --property programName 1001
Start time: Friday, November 3, 2023 6:08:48 AM
!DEBUG: 1 Danibrum 5 axis Syntec 610m Lucian Craciun V9 Sim.cps:24
Code page changed to '20127 (US-ASCII)'
Post processor engine: 5.10.0
Configuration path: c:\Users\DCS\Desktop\Danibrum 5 axis Syntec 610m Lucian Craciun V9 Sim.cps
Include paths: c:\Users\DCS\Desktop
Configuration modification date: Friday, November 3, 2023 6:08:47 AM
Output path: C:\Users\DCS\AppData\Local\Temp\AutodeskPostUtility\OutputFiles\debuggedfile.nc
Checksum of intermediate NC data: 4bf7bc1a3b45383c655b2b5f652cb2c2
Checksum of configuration: 268d3bd0bd487f0629bf4450c1f5a62a
Legal: Copyright (C) 2012-2023 by Autodesk, Inc.
Generated by: Fusion 360 CAM 2.0.8156
...

###############################################################################
Error: Direction is not supported for machine configuration.
Error at line: 1027 (Danibrum 5 axis Syntec 610m Lucian Craciun V9 Sim.cps)
Error in operation: '2D-Face4'
Failed while processing onSection() for record 325.
###############################################################################

Error: Failed to invoke function 'onSection'.
Error: Failed to invoke 'onSection' in the post configuration.
Error: Failed to execute configuration.
Stop time: Friday, November 3, 2023 6:08:48 AM
Post processing failed.
0 Likes
Message 6 of 24

bob.schultz
Alumni
Alumni

Are you using a machine configuration with rotary axes defined or is the post outputting IJK tool axis vectors for multi-axis operations?



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 7 of 24

dcsDHNS6
Enthusiast
Enthusiast
I believe it's the latter.

The Post was modified to go with Machine simulation. No configuration axis
configuration is made.

And yes, it outputs IJK Vectors for 5 axis machining. Is this the error
source?

There has to be a way around this to use G43.4 for 3+2 as is used for 5
axis simultaneous machining.

If that's not possible at least to make it ABC -coordinates without G68.2
and G53.1.

I tried inserting var abc in the OnCommand instead of the G68.2 and G53.1,
but the output was without any positioning at all.

I really tried all kinds of combinations.


0 Likes
Message 8 of 24

bob.schultz
Alumni
Alumni

Yes, the error is output because there are no rotary axes defined.  The tilted work plane logic in the post only supports machine configurations with the rotary axes defined.  You can add support for 3+2 output with the tool axis vector (IJK) to the post if this is what you are looking for.

I did notice that you have a nested setWorkPlane function in the onSection function.  You should remove this.

 

  function setWorkPlane(abc) {
    // setCurrentABC() does send back the calculated ABC angles for indexing operations to the simulation.
    setCurrentABC(abc); // required for machine simulation
  }

 

Further down in onSection you will need to add the following logic.

 

  isTiltedWorkPlane = false; // <<< ADD THIS LINE
  if (forceMultiAxisIndexing || !is3D() || machineConfiguration.isMultiAxisConfiguration()) { // use 5-axis indexing for multi-axis mode
    // set working plane after datum shift
    if (currentSection.isMultiAxis()) {
      forceWorkPlane();
      cancelTransformation();
// <<< ADD THESE LINES
    } else if (!machineConfiguration.isMultiAxisConfiguration() && !isSameDirection(currentSection.workPlane.forward, machineConfiguration.getSpindleAxis())) {
      isTiltedWorkPlane = true;
      var abc = currentSection.getGlobalInitialToolAxis();
      setRotation(currentSection.workPlane);
// <<< TO HERE
    } else {

 

In the onRapid function add the following code.

function onRapid(_x, _y, _z) {
  if (isTiltedWorkPlane) {
    var toolAxis = currentSection.workPlane.forward;
    onRapid5D(_x, _y, _z, toolAxis.x, toolAxis.y, toolAxis.z);
    return;
  }

 

And finally add the following code to the onLinear function.

function onLinear(_x, _y, _z, feed) {
  if (isTiltedWorkPlane) {
    var toolAxis = currentSection.workPlane.forward;
    onLinear5D(_x, _y, _z, toolAxis.x, toolAxis.y, toolAxis.z, feed);
    return;
  }

 



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 9 of 24

dcsDHNS6
Enthusiast
Enthusiast

Wow. thank you. I'd have never come up with that.

 

I'll test it right away and come back with Feedback.

 

Thank you again enormously.

0 Likes
Message 10 of 24

dcsDHNS6
Enthusiast
Enthusiast

Good day,

 

I've been testing it. It keeps throwing me an error stating:

 

Error: ReferenceError: isTiltedWorkPlane is not defined

Error at line: 1654

Error in operation: '2D Adaptive1'

 

This is how the line looks like:

 

function onRapid(_x, _y, _z) {
  var x = xOutput.format(_x);
  var y = yOutput.format(_y);
  var z = zOutput.format(_z);
  if (x || y || z) {
    if (pendingRadiusCompensation >= 0) {
      error(localize("Radius compensation mode cannot be changed at rapid traversal."));
      return;
    }
    writeBlock(gMotionModal.format(0), x, y, z);
    forceFeed();
  }
  if (isTiltedWorkPlane) {
    var toolAxis = currentSection.workPlane.forward;
    onRapid5D(_x, _y, _z, toolAxis.x, toolAxis.y, toolAxis.z);
    return;
  }
}
 

I've added the Post with the changes made.

 

0 Likes
Message 11 of 24

bob.schultz
Alumni
Alumni
Accepted solution

The definition of isTiltedWorkplane at line 1209 uses a lower case 'plane', but should be 'Plane'.

  isTiltedWorkPlane = false;

 



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 12 of 24

dcsDHNS6
Enthusiast
Enthusiast

Good day, I've applied all your suggestions. It works greatly. It took me some time to test all operations.

 

My C axis home position is at -90 Degrees from the Fusion standard position. Even though i have it all set up in Kinematics, It seems to ignore the "home position" settings for the C axis. Am i missing something?

0 Likes
Message 13 of 24

dcsDHNS6
Enthusiast
Enthusiast

@Anonymous.schulz

 

can you help me out?

 

Thank you very much beforehand.

0 Likes
Message 14 of 24

bob.schultz
Alumni
Alumni

@dcsDHNS6 I am not quite sure what you are asking here.  The modifications that you made all have to deal with outputting IJK vectors instead of ABC rotary angles, so I don't see the C-axis being referenced in the output.  Can you provide more detail (sample output with notes, etc.) about your issue.

Thanks.



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 15 of 24

dcsDHNS6
Enthusiast
Enthusiast
@Anonymous.schulz

Sure, i've attached a picture.

My machine is -90 degrees offon the C axis. With my older post processors,
this option from the kinematics was taken into account, if i modify this
option, it works and the output code is modified also.

Now, with the applied modifications, it outputs all codes perfectly fine,
except my C axis is rotated 90° Degrees.

i've tried modifying this kinematics windows in all directions.

It seems like the Post processor modifications made the post in a way to
ignore these kinematic settings. The output code is the same no matter what
it says there.

Thank you for your time.
0 Likes
Message 16 of 24

bob.schultz
Alumni
Alumni

I am not seeing the picture.  The post processor that you provided does not have rotary axis positions (ABC), but rather outputs the tool axis vector (IJK), unless you have a Machine Definition that defines the kinematics of the machine attached to the Setup in Fusion.  Do you have a Machine Definition?  If so, then the rotational axis for the A (or B) axis is not correct.  If it is rotating about the X-axis, then it should be around the Y-axis.  This is what will cause the C-axis to be off by 90 degrees.

Trying to cover all bases, are you still outputting IJK vectors and not ABC angles?  If this is the case, then the definition of the rotary axis kinematics in the control is not correct and the A/B axis rotates about the wrong vector. 


When changing the direction of the rotary axis in either case, make sure that you change the A/B axis and not the C-axis.

You say that your "old post processor" takes this into account.  Is this a Fusion post processor or one from another CAM system?



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 17 of 24

dcsDHNS6
Enthusiast
Enthusiast

@bob.schultz 

 

"I am not seeing the picture.  The post processor that you provided does not have rotary axis positions (ABC), but rather outputs the tool axis vector (IJK), unless you have a Machine Definition that defines the kinematics of the machine attached to the Setup in Fusion.  Do you have a Machine Definition?  If so, then the rotational axis for the A (or B) axis is not correct.  If it is rotating about the X-axis, then it should be around the Y-axis.  This is what will cause the C-axis to be off by 90 degrees."

 

IMG-20231118-WA0004.jpg

 it's a head/head machine. 

 

I've used the Post processor that was sent at the beginning of the topic. Doing programs in 5 axis IJK- coordinate system worked fine with the above Machine Definitions. 

 

Now, after modifying what you suggested in the Post processor, it outputs everything perfectly, except my C axis is looking 90°Degrees off.

 

meaning, if i face mill a Cube on his frontal side, it's doing what it should do(incl. simulation and so on) but physically the motor is looking to the X-- side (90 degrees turned away).

 

The Machine Definition from this picture should be right, but why the Home Position value is not taken into account, i have no clue.

 

I'm sorry to take up so much of your time, up until now.

 

0 Likes
Message 18 of 24

bob.schultz
Alumni
Alumni

The post does not use the home position for the rotary axes and even if it did, it would not be used to offset the C-axis by 90 degrees, but would move the C-axis to C-90 when it is moved to its home position.  I will say again that if the C-axis is off by 90 degrees, then the rotation axis for the A-axis is not correct.  For example, if it is set to rotate around the X-axis now, you should change it to rotate around the Y-axis, like the following picture shows.

bobschultz_0-1701815827903.png

 

This should be the first thing that you try.  If it is not working for you, then a translation can be added to the C-axis to compensate for the -90 degrees.

 



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 19 of 24

dcsDHNS6
Enthusiast
Enthusiast

@bob.schultz 

 

Good day, i checked them values: the A Axis is oriented on the Y-1 axis.

 

I`ve tried modifying it to Y1, to X-1 and X1. The results are the following:

 

If i use Y1 and X1 are working 180 degrees (like with the back of the spindle)

 

and X-1 worked 90 degrees off.

 

Could you give me some indication as to how to add the translation?

 

 

 Thank you very much

0 Likes
Message 20 of 24

bob.schultz
Alumni
Alumni
Accepted solution

To add a translation to the C-axis you will need to add the following line where the formats are defined.

var cFormat = createFormat({decimals:3, forceDecimal:true, scale:DEG, offset:-90});

And change the definition of cOutput to look like the following.

var cOutput = createVariable({prefix:"C"}, cFormat);

 



Bob Schultz
Sr. Post Processor Developer

0 Likes