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

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

habermacher
Observer Observer
7,818 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,819 Views
33 Replies
Replies (33)
Message 21 of 34

pete
Enthusiast
Enthusiast

bob.Schultz,

    Thank you so much for your assistance.  I appreciate it.   

 

Anyway, I had named the aggregate.cps post to say Thermwood AG 1 to show up inside fusion360 post library that way.   I had saved it and opened it inside fusion360 successfully.  However, after I made these changes you are specifying, I tried to save it again this time as version 2 to test out inside fusion360 and it said invalid post.  Not sure what I did wrong but it did not like it. I am attaching this post here to see if you can see where I went wrong.  I think I got everything you said installed correctly.  

 

Pete

0 Likes
Message 22 of 34

bob.schultz
Alumni
Alumni

It looks like you moved the '}' character that marks the end of the onSection function.  You need to remove the following line (line 390).

  var abc = getWorkPlaneAngledHead();

  // } // <<< REMOVE THIS LINE AT LINE 390

 

And add it back at line 476.

  } else {
    writeBlock(
      gAbsIncModal.format(90),
      gMotionModal.format(0),
      xOutput.format(initialPosition.x),
      yOutput.format(initialPosition.y),
      cOutput.format(abc.z)
    );
  }
} // <<< ADD THIS LINE AT LINE 476

 

I also noticed that you forgot to place the cOutput.format(abc.z) code on the two writeBlock statements that output the initial position as described above.  You will need to add this code to see the C-axis being output.



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 23 of 34

pete
Enthusiast
Enthusiast

bob.Schultz,

     Ok I did that but I just noticed that there are actually two of the same sets of lines in the code you gave me is that correct?  

Here is what I inserted:

    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
    );
  }

 As you can see here there are two instances of the write block gAbsIncModal etc.  and the second one is where I put the cOutput.format line, does it have to be at both locations or is the second set a typo or what?   I am attaching the current file...It does not load with invalid post.    Again thank you for your assistance.

 

Pete

 

 

0 Likes
Message 24 of 34

bob.schultz
Alumni
Alumni

You entered the first cOutput.format on the wrong line, it should be on line 460.  This line is output when there is a tool change.  The C-axis will be output on line 479 when there is no tool change.

    if (!machineConfiguration.isHeadConfiguration()) {
      writeBlock(
        gAbsIncModal.format(90),
        gMotionModal.format(0), xOutput.format(initialPosition.x), yOutput.format(initialPosition.y), cOutput.format(abc.z)
      );


Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 25 of 34

pete
Enthusiast
Enthusiast

bob.Schultz,

     I am not sure why but in my Virtual code studio the line numbers are different than you are talking about here I am guessing.  I have the first cOutput on line 468 and the second one on line 477.  So from your post I am assuming I need to remove the cOutput from line 468 and insert it on line 460?  That line has the text "writeBlock(gMotionModal.format(0), zOutput.format(initialPosition.z));"  so does it go on the next line under this or after this on the same line?  

 

    I have the second cOutput on line 477, you are saying it needs to be on line 479, is that after the parentheses and semicolon etc. ?     I am unclear on where the toolchange is occurring in this part of the code.  Sorry if I am not seeing the obvious here but I am not the best at coding. 

 

   I am attaching a photo of this part of the code as it appears in VCS on my screen so we are clear on the line numbering.  Again thank you for the assistance.

 

Pete

0 Likes
Message 26 of 34

pete
Enthusiast
Enthusiast

Ok I made some changes  and the post loaded into fusion without error.  I am checking the posted code now and it appears to be working in that there are "c" commands in the code after toolchanges.  I need to post a program that machines on both sides of the door and check to see if the orientation changes from 90 to -90 degrees or whatever.  Once I look over the code I will do some testing on the machine.  Here is a screenshot of the post processor area we were discussing and the posted code...  Again thank you for your assistance.

 

Pete

 

0 Likes
Message 27 of 34

bob.schultz
Alumni
Alumni

I noticed that you put the C-axis move on the block where the Z-axis moves.  You may want to move it up a line and add it to the XY move.



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 28 of 34

pete
Enthusiast
Enthusiast

bob.Schultz,

    Ok I made those changes and we were previously having failed output post processing despite the post processor loading ok.  I made those changes and now the posted code does not show a failure.  Looking over the code it seems to set the "C" axis to zero on the initial toolchange and that is probably a good thing because we will most likely put aggregate head operations at the end of the programs because we will be doing manual toolchange to the aggregate head.  The position of the C axis is irrelevant I believe for traditional 3 axis tool holder operations but it is nice to have it sort of homed to zero upon initial programming.  I also changed up the simple door program to have operations on three sides of the door to see how the aggregate "C" output reacts to those positions. It LOOKS ok.  I tried to test the code at a slow point in the shop today and noticed the failed code that did not post all of the aggregate operations just the regular ones.  Now that it has posted without failure I will try tomorrow to see if it works correctly and also to see what changes need to be made. I am again attaching the current post and the resultant code.  Thank you again.  

0 Likes
Message 29 of 34

pete
Enthusiast
Enthusiast

Ok bob.schultz  I have been working on other things recently and finally now getting back to focusing on this.  I made the changes to the post you provided thank you and they now include the C axis commands in the posted code.  When I try to run the code I am getting axis errors because the reoriented axes are being used instead of the basic 3 axis movements inside the machining envelope.  For instance on the first machining operation I am trying to simulate machining a hinge pocket on the far side of a door sitting atop some risers on the table.  The Z axis orientation of the machining operation (not the setup origin) is being output apparently or something and the initial X axis movement goes negative by 9 and a half inches or so.  I am unsure about how the setup inside fusion360 should be in lieu of the fact that our machines tool setup supposedly accounts for the distance between the centerline of the Z axis spindle and the end of the horizontal tool tip.  I would think that the G code will just goto the programmed toolpath start point and the control compensates for the horizontal tool length offset and the rotational orientation of the spindle using the commanded "C" code in the posted code output by Fusion360.   I am a little lost here as to how this should work.  I am attaching an image of my part setup inside fusion360 showing the setup orientation and the programmed toolpath orientations.  I am attaching a bit of sample code the manufacturer sent us for reference, and I am attaching the currently posted code for the setup as depicted from fusion360 using the current state of my post processor.  I am also attaching the post processor as it is now.  ANY help here would be great.  Note that the  orientation on my parts setup inside fusion360 is with the X and Y going positive off the part, this is because of how our machine was setup from the manufacturer.  All of our 3 axis programming is working great.  I don't know if I am going in the right direction here or perhaps the post we are starting with is not ideal for this situation?   

0 Likes
Message 30 of 34

pete
Enthusiast
Enthusiast

Here are the other files..

0 Likes
Message 31 of 34

bob.schultz
Alumni
Alumni

Hello Pete,

 

The output from the post looks as I would expect it.  Per the picture you provided your setup origin is at the lower right and bottom of the part with the X-axis pointing down from the part and the Y-axis pointing to the right, both away from the part as you stated.  This places the hinges on the left side of the part in the negative X and negative Y direction.  I see the operations at approximately X-10, X-50, and X-90, corresponding to the hinge locations I see in the picture. What X-values are you expecting?

 

I also see that the Z-axis is at the bottom of the platform which coincides with Z-axis values of approximately 9 inches being output.

 

The post is currently setup to output the tool end point for the angled head.  This is controlled by the pivotLength variable which is set to 0 in the post.

 

var pivotLength = 0; // pivot length controls the adjustment from the tool tip to the center of the spindle
function getWorkPlaneAngledHead() {
  var W = currentSection.workPlane;

 

Please note that all output coordinates are based on the origin and direction of the Setup orientation.

 

You noted that the 3-axis operations are working for you.  Are you using the same Setup orientation and origin for these?

 

Looking at your sample output it looks like the C-axis may be at 0 degrees when the tool axis is pointing in the negative X direction.  For example, the first operation shows C180 when the tool axis is pointing in positive X.

(Start Of Tool T1 - Head 1   [Z] )
(Op:1 CONTOUR T001 1/2 STRAIGHT BIT AGG DIA:0.5)
M5  (Pre-toolchange Stop - Spindle Direction Change)
T100 M3
G00 X12.25 Y6. C180. (Rapid X Y) (<<< C-axis at C180 for tool axis 1,0,0)
G00 Z2. 
G00 Z.5
M31    (CHECK PRIMARY SPINDLE UP TO SPEED)
G00 X12.1
G01 X12. F50. (<<< Feeds down in X to engage part, tool axis s/b 1,0,0)
G01 Y0. F200.
G00 X12.25
G00 Z2. 

 

If this is the case, then you will have to adjust the C-axis prior to being output.  Add the following line at the end of the getWorkPlaneAngledHead function.

 

  var tcp = true;
  if (tcp) {
    setRotation(W); // TCP mode
  } else {
    var O = machineConfiguration.getOrientation(abc);
    var R = machineConfiguration.getRemainingOrientation(abc, W);
    setRotation(R);
  }
  abc.setZ(abc.z - Math.PI); // <<< ADD THIS LINE
  return abc;

 



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 32 of 34

pete
Enthusiast
Enthusiast

bob.Schultz,

    Thank you again for that well thought out response.  I apologize if I am not being as clear as possible.  I am trying to understand this information you have presented.  

 

  The regular 3 axis programs we are currently running do indeed have all toolpaths going in the negative X and Y directions as the orientation of the setup is adjusted for the machine manufacturers configuration which has the machine home at the opposite corner of the table from what our current setup/origin is.  It is also  where the pop up pins on the machine are located.  

 

  I spoke to their tech support yesterday and it appears that I had the C axis tool zeroes set to incorrect start positions. According to them the "Start" position unless commanded otherwise with a "C" command will be with the tool tip pointing in the X positive direction IE off the table as our current setup shows. I had them reversed apparently and not sure how that affects these limit errors if at all.  I have made those changes to the start positions.  

 

  In regard to the Fusion360 programmed "C" axis orientations , It appeared to me that they were correct in the software but perhaps they are not I am looking into that now.  As I said the simulation looks perfectly correct understanding that the simulation does not show both sides of the head only the current tool. I created a simple toolholder that kind of mimics the shape of the lower section of the aggregate 2 sided head.  

 

    Now if I change "start" orientation of the tool to be zeroed along the X positive direction for instance the first operation would be to rotate the head counter clockwise 90 degrees, perhaps -90 degrees in code.  I just reposted the first operation which has the tool machining the hinge pockets on the far side of the door This would mean the tool will be pointing in the negative Y direction or -90 degrees from the "start" position.  The posted code does indeed have a C-90 on the first operation.  I am also making some subtle changes to the post because some of the code it is outputting in the initial setup is not recognized by our control.  

 

   I see your point however that the initial movment of x-9 something SHOULD be correct but it is at this line that it appears to error out. I am unsure if this is due to the aforementioned initial start point (kinda doubt it) or perhaps the G18 callout is confusing the control for other axis movements?  I will need to check this.  

 

   In regards to the added line of code you mentioned.  I am assuming that since the output code now appears to orient correctly I do not need to add this code.  

 

  Our machine also uses G52 L1 codes with L being the predetermined offsets inside the control for different setup positions on the table.  I managed to get the code to output the G52 but I am unsure about the L(X)  part of it.  Do I need to create a post setup for different coordinate systems inside fusion and ifso are they able to be called by a numeric name IE G52 L1?  This is all aside from the basic aggregate head setup issues I am facing of course.  Generally we will ONLY be using G52 L1 but in case we want to use a specific setup on the table it would be nice to have the variable. 

 

  I am going to test this new version of the post processor and its output code using the same model/programming I showed you in the images and see how it works.  I believe it will still error out on the first X move but we will see. I am attaching the current state of the post and the initial operation posted code.  Thank you again for your assistance.

 

Pete

 

0 Likes
Message 33 of 34

pete
Enthusiast
Enthusiast

Oh I forgot to ask about the pivot length setting.  How is this implemented inside Fusion360?  Is this a setting we can use in the machining operations setup to create the offset distance?  The control has tool length setups which include the pivot offset for length but they are based on tool number.  I assume that the post does not need to be edited just to make this setting change?   How does the post know what the length is and make the compensation to position for correct positioning of the aggregate head?  Apologies if this is obvious to others 😉 

 

Pete 

0 Likes
Message 34 of 34

bob.schultz
Alumni
Alumni

I can answer your questions concerning the post, but I don't know why you are getting the error on the control with the X- positions.

 

You can output the WCS number with the G52 code by modifying the line where the G52 is output to include the work offset number specified in the Setup.

 

      if (workOffset != currentWorkOffset) {
        writeBlock(gFormat.format(52), "L" + workOffset); // G54->G59 <<< MODIFY THIS LINE
        currentWorkOffset = workOffset;
      }

 

You can also add the overall tool length distance (as defined in the Cutter tab of the tool definition) to the output coordinates along the direction of the tool axis by adding the following line in onSection.  This is used when the center of the main spindle has to be output instead of the tool tip.  You can also add a fixed distance from the face of the angled head to the center of the angled head attachment if necessary. 

 

  if (insertToolCall) {
    pivotLength = tool.overallLength; // <<< ADD THIS LINE
    retracted = true;
    //onCommand(COMMAND_COOLANT_OFF);

 

Once you make this change, you will notice that the output coordinates will change by this amount.  For example, if the tool axis is pointing in negative Y, then you will see the Y-axis coordinates be translated in the negative direction by the Tool Overall Length value.



Bob Schultz
Sr. Post Processor Developer

0 Likes