Updating .cps code for Laguna HHC - 4th Axis compatability

Updating .cps code for Laguna HHC - 4th Axis compatability

maanma
Community Visitor Community Visitor
540 Views
1 Reply
Message 1 of 2

Updating .cps code for Laguna HHC - 4th Axis compatability

maanma
Community Visitor
Community Visitor

Hello there, 

 

First time posting actually, so I'm unsure if people already have answered this or not, but I'm trying to rewrite the .cps code to make it compatible with our 4th axis machine. There are a few tutorials and step-by-step guides, but it's been a while since I've coded anything and I was wondering if there was an updated version of the work-around because the lines and the words definitely don't line up. I can search for the key words that are in the current post, but I wanted to make sure that I had a current version of the code work around or if someone has tested the current one prior to myself. 

 

Or if there are other key words that I can pick out just to get the 4th axis up and running for a trial run.

 

https://forums.autodesk.com/t5/hsm-post-processor-forum/how-to-set-up-a-4-5-axis-machine-configurati...

 

This is the one I'm currently working through, which I'm assuming is a generic one to cover most of the varying g-code exports.

 

I would really like to use Fusion for the entire process. I've used both SolidCam and RhinoCam, Mach exports and configurations, and I don't really want to keep going back and forth from one system to another. Fusion has worked out beautifully for the 2 and 3 Axis modeling and milling that I've been doing. The problem is just that I can't seem to find the A-axis (spindle turning axis) and turn on the function within the .cps code. 

 

For the first step I'm just trying to set up a 4th-axis indexing. That's how my toolpaths are set up, it's just giving me a tool orientation error every time I try to export. and Laguna does not naturally come with a 4th axis extension (it's an additional part that some have to also custom install).

 

I would really like to do it myself and test it as need be rather than send it off to a company, wait, and then test to see if it has worked or not. 

 

Anything would really help and it is incredibly appreciated. 

 

Please note: The simulation, and the toolpaths are all checking out, no errors marked, and I've been doing this for the past 5 years now. Laguna pointed me over here and to the post-processor "how to set up a 4/5 axis machine configuration" to rewrite the .cps code. 

 

 

Cheers, and thank you so much in advance

 

Lonny

0 Likes
541 Views
1 Reply
Reply (1)
Message 2 of 2

bob.schultz
Alumni
Alumni

Hello Lonny,

 

The Laguna post does have code for adding a 4th and 5th axis.  It simply needs to be modified to create only a 4th axis.  It is important that the table is setup to rotate around the correct axis (X,Y).  You can make the sample modifications to the creation of the rotary axes in the onOpen function in the post and this should add support for the 4th axis.  The sample code is setup for a table that rotates around X.

 

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

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

If your machine has a B-axis table, then switch to 'coordinate:1' and 'axis:[0, 1, 0]'.

 

You mention that you are getting a tool orientation error when you run your post.  Make sure that the Setup WCS orientation is the same as you use for a 3-axis operation and that the 3+1 tool orientation just rotates around the same axis that that the table rotates about, in the sample code above it would be the X-axis.  This means that the tool axis must always have 0 as the X-axis component, otherwise you will get the error.



Bob Schultz
Sr. Post Processor Developer