90 degree spindle, linux cnc, postprocessor for drilling horizontal holes

90 degree spindle, linux cnc, postprocessor for drilling horizontal holes

habermacher
Observer Observer
7,906 Views
33 Replies
Message 1 of 34

90 degree spindle, linux cnc, postprocessor for drilling horizontal holes

habermacher
Observer
Observer

Dear all

 

We've been working with Fusion 360 for quite some time with our 3 axis BZT PFU router using Linux-cnc. Now for a specific project, want to add an additional axis with a 90 degree spindle which can rotate around the normal Z-Axis, in order to drill holes horizontally.

 

My question now is if there is a postprocessor available for the mentioned purpose, if not, how to adjust the postprocessor accordingly. 

 

I have followed the instructions here: https://knowledge.autodesk.com/support/fusion-360/learn-explore/caas/sfdcarticles/sfdcarticles/How-t...

& Changed the lines to as follows:

 

Capture.PNG

 

As expected this does not work, as im not having a proper rotary head, but a 90 degree spindle which can only rotate around the normal Z axis...

 

Does anyone have an Idea how to approach that issue?

A sample file with which Im testing can be downloaded here: https://a360.co/2qEvUJQ

 

Looking forward to hearing from anyone, 

regards

Timothy

 

 

 

 

0 Likes
7,907 Views
33 Replies
Replies (33)
Message 2 of 34

boopathi.sivakumar
Autodesk
Autodesk

@habermacher 

You have set the machine kinematics as rotate about X axis, What is the maximum and minimum limit of the machine. and if possible could you send me your machine setup photo.

Did you try post process the 2nd operation only.try the 2nd operation only i think you will get the output.

What is the post processor you are using?

 


Boopathi Sivakumar
Principal Technology Consultant

0 Likes
Message 3 of 34

habermacher
Observer
Observer

Dear

 

Thanks for your feedback.

The Setup is as follows:

Capture.PNG

The Horizontal Spindle can rotate around Z.

 

I adjusted the postprocessor according to your comment:

var aAxis = createAxis({coordinate:0, table:false, axis:[0, 0, 1], range:[-360, 360], preference:1});

Attached the postprocessor I use. Its te original EMC pp with the mod in line 196.

 

The postprocessing of the second operation does not work as well. I guess it is because the post processor does not take into account that the spindle is located horizontally...

 

Do you have any idea how to get this work?

 

Thanks

Timothy 

 

 

 

0 Likes
Message 4 of 34

Anonymous
Not applicable

I'm having the same problem, did you ever get an answer for your problem?

0 Likes
Message 5 of 34

bob.schultz
Alumni
Alumni

For a 90 degree head, you will need to define both an A-axis and a C-axis, so that the head can point along either the X-axis or Y-axis, so the definition of the machine should look like this.

  if (true) { // note: setup your machine here
    var aAxis = createAxis({coordinate:1, table:true, axis:[1, 0, 0], range:[-360, 360], preference:1});
    var cAxis = createAxis({coordinate:2, table:true, axis:[0, 0, 1], range:[-360, 360], preference:1});
    machineConfiguration = new MachineConfiguration(aAxis, cAxis);

    setMachineConfiguration(machineConfiguration);
    optimizeMachineAngles2(0); // TCP mode
  }

You will need to disable the output of the rotary axes also.  In the onOpen function, make the following changes.

 if (true /*!machineConfiguration.isMachineCoordinate(0)*/) {
aOutput.disable();
}
if (true /*!machineConfiguration.isMachineCoordinate(1)*/) {
bOutput.disable();
}
if (true /*!machineConfiguration.isMachineCoordinate(2)*/) {
cOutput.disable();
}

Change the following block in setWorkPlane to disable the output of the rotary axes.

  writeBlock(
    gMotionModal.format(0),
    conditional(aOutput.isEnabled(), "A" + abcFormat.format(abc.x)),
    conditional(bOutput.isEnabled(), "B" + abcFormat.format(abc.y)),
    conditional(cOutput.isEnabled(), "C" + abcFormat.format(abc.z))
  );

This should give you the basics for a 90-degree head support.



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 6 of 34

Anonymous
Not applicable

I understand that we need to make changes in post, but what tool-path do I choose in Inventor?  Do I need to choose a multi-axis tool-path (flow, which creates unpredictable results in the simulations) or can I choose a regular 3D or 2D milling tool-path?

 

0 Likes
Message 7 of 34

bob.schultz
Alumni
Alumni

For an angle head, you would choose a standard 2D operation, just as you normally do, but the tool orientation will need to setup so that the Z-axis points along the axis of the angle head.  This lets the post know the orientation of the tool.

3+2.png

 



Bob Schultz
Sr. Post Processor Developer

Message 8 of 34

Anonymous
Not applicable

Hi @bob.schultz  , Im having the same issue but im running a Haas NGC post processor.  Im trying to use a 90 head but its a manual rotation so no need to spin. Could you help me out with my post processor? i did everything you posted here but when I select that my machine has an A/C axis it just outputs as a 5 axis machine with B/C rotations. But Im trying to run everything in 3 axis. When I turn off the A/C axis when I post, it says tool orientation is not supported. Thank you!

0 Likes
Message 9 of 34

bob.schultz
Alumni
Alumni

Hello James,

 

This sounds about right if you did not create a "dummy" machine when you post for an angled head on a 3-axis configuration.  Before you modify the post you will need to explain how you are going to use the angled head, is it going to be strictly 3-axis or are you expecting to use it with multi-axis operations also?

 

Please note that the NGC post is more complicated than the Linux CNC post and will require more changes.



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 10 of 34

Anonymous
Not applicable

Thank you for the reply @bob.schultz, I plan on running it just in a 3 axis configuration.  We have a few 5 axis machines but only use this tool on our Large 3 Axis Mill where the parts don't fit in the 5 axis.  If its easier, I can PM you with all of the details and such.

0 Likes
Message 11 of 34

bob.schultz
Alumni
Alumni

It's fine to PM me with the details.  The logic will be similar, but as I mentioned there will be a bit more changes due to the complexity of the Haas NGC post.



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 12 of 34

andany22
Contributor
Contributor

Hi. Bob!
I'm having the same issue where I need to operate a right angle head ( manually rotated). The size of the plate will make it impossible for me to present it on the trunnion.
I have the tool orientated on the Y+ axis.

Thanks for your help

0 Likes
Message 13 of 34

Anonymous
Not applicable

@andany22 are you running a Haas? If so I can send you my post.

Message 14 of 34

andany22
Contributor
Contributor

Hi James,

Yes please, I'm running Haas.

That would be great!

 

0 Likes
Message 15 of 34

andany22
Contributor
Contributor

Hi @Anonymous ,

thanks for the post but unfortunately we do not have a New Generation Controller yet! 😂

I hope that our friend @bob.schultz is going to make my day a good one!😅

Thank you guys for sharing!

 

0 Likes
Message 16 of 34

mashcomDWK67
Contributor
Contributor

I also have a 3-axis CNC router with an additinal spindle 90 degrees to the Z-axis. Could you tell me if I have to use 2D or 3D milling? I'd like to make a hole for a doorlock  and I have attached a photo. The tool movement is to the X-axis. Is there a postprocessor which can change X-axis and the Z-axis in the G code. Thank you in advance!

0 Likes
Message 17 of 34

pete
Enthusiast
Enthusiast

I am wondering if there has been any progress with this as we are in a similar situation.  We have a large flatbed CNC router that is equipped with a spindle  C axis that allows an aggregate 90 degree head to be rotated so you can machine for instance both sides of a door lying flat on the router table.  We are trying to create a post that will allow this.  I have learned about the tool orientation and can adjust the tool to approach the part correctly inside Fusion360 and I have a post from another poster here that has been able to make this work. However the manufacturer of our machine has a sample code that outputs C axis positioning IE C0, C90,C180 etc.    Apparently the positioning of the C axis is a factor of both the tool setup in the control and the G code.  It seems like Fusion360 is equipped to do this I am wondering if anyone has a similar setup working with a spindle C axis and 90 or 180 degree(2 sided aggregate) head.  Thank you in advance for any assistance.  

 

Pete

 

0 Likes
Message 18 of 34

bob.schultz
Alumni
Alumni

Hello Pete,

 

If you have already added angled-head support in your post processor then it is quite simple to get the C-axis angle to be output.  You will first need to enable the C-axis output.

    aOutput.disable();
    bOutput.disable();
    // cOutput.disable(); // <<< COMMENT OUT THE LINE WHERE cOutput IS DISABLED

 

In the setWorkPlane function you will need to output the C-axis angle.

    } else {
      workSide = "XYZ";
      writeBlock(gPlaneModal.format(17));
    }
    writeBlock(cOutput.format(angledHeadAngles.z)); // <<< ADD THIS LINE
    return;
  }

 

Define the angledHeadAngles variable that contains the C-axis position.

var angledHeadAngles = new Vector(0, 0, 0); // <<< ADD THIS LINE
function getWorkPlaneAngledHead(workPlane, _setWorkPlane) {
  var W = currentSection.workPlane;

 

And finally define the C-axis angle in getWorkPlaneAngledHead.

  angledHeadAngles = new Vector(abc); // <<< ADD THIS LINE
  abc = new Vector(W.forward.x, W.forward.y, W.forward.z);

You should now see the C-axis being output to the NC file.



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 19 of 34

pete
Enthusiast
Enthusiast

bob.schultz ,

     I do not currently have a post processor that has angled head support.  I am currently trying to modify another posters post called Aggregate.cps that was posted here.  He helped me to figure out how to use the tool orientation inside fusion360 to allow the axis pivoting etc.  Is there perhaps a better post to start with that includes the angled head support?   I am going to attach a sample program that the manufacturer sent us to prove out our coding.  It includes the C data as you can see.  This is on a 5'x10' flatbed CNC router with a spindle mounted "C" axis that orients the aggregate head for rotation to any degree angle around the Z.   I helped create a post processor for Fusion360 to speak to our machines control and we have been using it for 3 axis work and it has been great but now we have need for the aggregate and the ability to machine both sides of large doors sitting flat on the bed of the machine.  I will try to digest the coding you show here but I want to start with a post that includes the best setup initially to avoid as much messing around with changes as possible.  Here is our current post processor and the sample code that the manufacturer sent us. Any help would be MOST appreciated.  Thank you.

 

Pete

0 Likes
Message 20 of 34

bob.schultz
Alumni
Alumni

I can provide the changes to the Aggregate.cps post processor to get the C-axis to be output with the initial move when an aggregate head is used.  I did not do a deep dive into your sample output, so there may be other changes that need to be made to the post.

 

First, you need to add the following code.  It can be placed just above onSection.

var abcFormat = createFormat({decimals:3, forceDecimal:true, scale:DEG});
var cOutput = createVariable({prefix:"C"}, abcFormat);
var pivotLength = 0;
function getWorkPlaneAngledHead() {
  var W = currentSection.workPlane;
  var side;
  var zAxis = W.forward;
  var abc = new Vector(0, 0, W.forward.getXYAngle());
  if (isSameDirection(zAxis, new Vector(0, 0, 1))) {
    side = "+Z";
  } else if (isSameDirection(zAxis, new Vector(-1, 0, 0))) {
    side = "-X";
  } else if (isSameDirection(zAxis, new Vector(1, 0, 0))) {
    side = "+X";
  } else if (isSameDirection(zAxis, new Vector(0, -1, 0))) {
    side = "-Y";
  } else if (isSameDirection(zAxis, new Vector(0, 1, 0))) {
    side = "+Y";
    abc.setZ(toRad(90));
  } else if (isPerpto(zAxis, new Vector(0, 0, 1))) {
    side = "C" + abcFormat.format(abc.z);
  }

  if (side != "+Z") {
    writeComment("Right angle head along " + side);
    setTranslation(Vector.product(abc, pivotLength));
  } else {
    cancelTransformation();
  }
  var tcp = true;
  if (tcp) {
    setRotation(W); // TCP mode
  } else {
    var O = machineConfiguration.getOrientation(abc);
    var R = machineConfiguration.getRemainingOrientation(abc, W);
    setRotation(R);
  }
  return abc;
}

function isPerpto(a, b) {
  return Math.abs(Vector.dot(a, b)) < (1e-7);
}

 

Next, delete the following code in onSection.

  writeComment(" Work plane check : Forward is " + remaining.forward);
// DELETE THIS CODE
  if (!isSameDirection(remaining.forward, new Vector(0, 0, -1)) &&
      !isSameDirection(remaining.forward, new Vector(0, 0, 1)) &&
      !isSameDirection(remaining.forward, new Vector(0, -1, 0)) &&
      !isSameDirection(remaining.forward, new Vector(0, 1, 0)) &&
      !isSameDirection(remaining.forward, new Vector(-1, 0, 0)) &&
      !isSameDirection(remaining.forward, new Vector(1, 0, 0))) {
    error(localize("Only XY, XZ and YZ planes allowed for tool orientation."));
    return;
  }
  setRotation(remaining);

 

And replace it with this.

  var abc = getWorkPlaneAngledHead();

 

Finally output the C-axis on the initial move.

    if (!machineConfiguration.isHeadConfiguration()) {
      writeBlock(
        gAbsIncModal.format(90),
        gMotionModal.format(0), xOutput.format(initialPosition.x), yOutput.format(initialPosition.y), cOutput.format(abc.z) // <<< ADD THE C OUTPUT
      );
      writeBlock(gMotionModal.format(0), zOutput.format(initialPosition.z));
    } else {
      writeBlock(
        gAbsIncModal.format(90),
        gMotionModal.format(0),
        xOutput.format(initialPosition.x),
        yOutput.format(initialPosition.y),
        zOutput.format(initialPosition.z)
      );
    }
  } else {
    writeBlock(
      gAbsIncModal.format(90),
      gMotionModal.format(0),
      xOutput.format(initialPosition.x),
      yOutput.format(initialPosition.y),
      cOutput.format(abc.z) // <<< ADD THE C OUTPUT
    );
  }

 



Bob Schultz
Sr. Post Processor Developer

0 Likes