How to set up a 4/5 axis machine configuration

How to set up a 4/5 axis machine configuration

AchimN
Community Manager Community Manager
78,783 Views
56 Replies
Message 1 of 57

How to set up a 4/5 axis machine configuration

AchimN
Community Manager
Community Manager

Updated August 2023:

In recent versions of Fusion, we now support machine definitions in almost all of our milling post processors, which means that the machine kinematics and options can be easily defined using the Machine Definition dialog.

This means it is no longer required to add the machine kinematics to the post processor script.

 

Moving forward, using machine definitions in Fusion is the preferred method to specify your machine configuration, kinematics and options like home positions, axes limits, TCP settings and more. It is also important to note that this is the only way to utilize machine simulation, as machine simulation does not function with post processor scripts that have embedded kinematics.

 

For more information on creating or editing machine definitions,
please refer to the Machine Definition in Fusion learning videos 

 

2025-08-27_10-38-17.png

 

We made significant changes to most of our library milling posts so that they fully support machine configurations as well as machine simulation. We have also added a lot of predefined machines to our machine library, many of them also have full simulation models associated with them.
You can access all available machines directly from within the Fusion machine library or through our online Machine Library.

2025-08-27_10-19-39.png

 

 

 

Of course, you can still define your kinematics in the postprocessor itself.
In earlier versions of the post processors this was possible within the onOpen function.
This has been moved to the defineMachine function in the latest posts which have multi-axis machine support where you can now make your desired adjustments.
Please refer to chapter 8.1.3 Creating a Hardcoded Multi-Axis Machine Configuration in the Post Processor Training Guide for instructions on how to do this.


Note that you can only EITHER use a machine configuration in Fusion OR define the machine within your postprocessor.
When a postprocessor with a hardcoded machine configuration is used together with a machine configuration in Fusion a warning/error will be generated, and the hardcoded configuration will take precedence.


Note that you cannot import latest machine configurations into Inventor CAM and HSMWorks directly.
For post processing purposes you can still make use of these machine configurations by downloading a packaged post from the online Machine Library.
When you click download, the following download dialog will show up. Select For Inventor/HSMWorks.

AchimN_1-1692281173514.png


You can then select the post processor you want to use with that machine configuration.
By clicking download, a *.CPSZ file will get downloaded.
This is a package that contains both the post processor you specified as well as the machine configuration file. This file can be selected directly in the post processing dialog.

 

If you need assistance, you can ask for help here:
1) Contact your local reseller/ service provider: HSM post adjustments needed? Find your right contact here
2) Ask the community: HSM Post Processor forum

 

 

 


Previous content:

Most of the generic posts have 5 axis capabilities already implemented but disabled by default since it is required to set the right machine configuration for the ABC axis for the specific machine you want to use.

The machine configuration can be found into the onOpen() function:

 

machine config.PNG

Step 1:

 

The very first step is to change (for this example, line 173):

  • if (false) to this: if (true)

to activate the machine configuration code below.

 

Step 2:


Now you can go ahead and start to customize the ABC axis to your needs with the options as described below:

 

  1. actuator: Specifies that the actuator type (ie. either "linear" or "rotational").
    The default is "rotational".
  2. table: Specifies that the axis is located in the table or the head. The default is true for table.
  3. axis: Specifies the axis vector as a 3-element array (e.g. "[0, 0, 1]").
    [Axis rotates around X, Axis rotates around Y, Axis rotates around Z]
    Example: A-axis rotating around the X-axis would be this: [1, 0, 0]
  4. offset: Specifies the axis offset as a 3-element array (e.g. "[0, 0, 25]").
    The default is [0, 0, 0].
  5. coordinate: Specifies the coordinate used in the ABC vectors (ie. "X", "Y", or "Z"). The given number will define the letter for the axis:
    0 = “A”
    1 = “B”
    2 = “C”
    Note: This is the only way to influence the axis letter for the output.
  6. cyclic: Specifies that the axis is cyclic. Only supported for rotational axes.
    Only used when a range is specified. The default is false.
  7. range: Specifies the angular range for the axis in degrees as a 2-element array (e.g. "[-120, 120]"). You can also specify a single number to create an axis for an aggregate.
    The default is unbound.
  8. preference: Specifies the preferred angles (-1:negative angles, 0:don't care, and 1:positive angles). The default is don't care.
  9. resolution: Specifies the resolution. In degrees for rotational actuator. The default is 0.

Please note:
If you only need a 4 axis setup, you can either delete the other axis beginning with

"var bAxis” and  “var cAxis” or you can just disable them by typing two slashes “//” in front of the line which you want to disable.


Don´t forget to remove the disabled axis variable out of the code as explained in Step 3.

 

 

Step 3:

 

machineConfiguration = new MachineConfiguration(aAxis, cAxis);

 

  • This line creates a new machine configuration as defined above by using the given variables for each axis (in that case: aAxis, cAxis).
  • You can only use the variables inside the brackets which are defined above.

Examples:

 

4 axis setup, A rotates around X, direction is positive:

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

machineConfiguration = new MachineConfiguration(aAxis);

 

4 axis setup, A rotates around X, direction is negative:

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

machineConfiguration = new MachineConfiguration(aAxis);

 

 

5 axis, B rotates around Y, C rotates around Z, directions both positive:

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

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

machineConfiguration = new MachineConfiguration(bAxis, cAxis);

 

 

Step 4:

 

setMachineConfiguration(machineConfiguration);

 

  • This line enables the machine configuration, no need to change something here.

 

 

Step 5:


optimizeMachineAngles2(0); // TCP enabled (eg. M128, TRAORI, G43.4, G243)
optimizeMachineAngles2(1); // TCP disabled (eg. M128, TRAORI, G43.4, G243)

 

  • With this option you can decide if your machine has TCP capabilities for 5 axis simultaneous machining or not.


Achim.N
Principal Technology Consultant
Reply
Reply
78,784 Views
56 Replies
Replies (56)
Message 21 of 57

Anonymous
Not applicable

Hey jpershing,

 

I know the DMS post is almost identical to the quintax one I need, especially since yours is turning g48 on.

 

Is there any chance I could have you send me yours, please?

 

Thank you,

Zach

Reply
Reply
0 Likes
Message 22 of 57

Anonymous
Not applicable

I don't have a good one yet. I will when I do

Reply
Reply
0 Likes
Message 23 of 57

Anonymous
Not applicable

Thanks, jpershing. I'm looking forward to it.

Reply
Reply
0 Likes
Message 24 of 57

Anonymous
Not applicable

jpershing,


Any luck with your DMS post yet? I've been hacking through my generic Fagor and there are quite a few things that still aren't working.

Reply
Reply
0 Likes
Message 25 of 57

ci3jk4
Enthusiast
Enthusiast

Im having some difficulties setting up my machine.

I have started using fusion 360 around one week ago and been using it for a Kimla bpf2030 5d router with an a/c axis on the head.

Problem is that I'm not sure which is the correct post for my machine. For now I have been using Fanuc generic with good results.

I tried to edit it and it kind of works.

When milling a swarf on a hole the problem is that the flute is either miling with its face, or dragging the face over the chamfer, resulting with a round'ish chamfer.

It seems that the A axis should be moving around Y instead of X, or the C axis should have a 90degrees offset...

 

My setup is: 

 

var useMultiAxisFeatures = false;

 

...

 

function onOpen() {

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

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

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

 

tried changing the tcp mode to 1 as well as setting axis to -[1,0,0] and all other variations, any ideas where should I look now?

 

Thanks

Reply
Reply
0 Likes
Message 26 of 57

scottmoyse
Mentor
Mentor

@AchimN wrote:

 

If you have any problems, you can ask for help here:

1) Contact your local reseller: http://cam.autodesk.com/buy/
2) Ask the community: http://forums.autodesk.com/t5/post-processors/bd-p/218

 


@AchimN Could you update the local reseller link to this please, since that one doesn't work anymore? https://forums.autodesk.com/t5/hsm-post-processor-forum/hsm-post-adjustments-needed-find-your-right-...


Scott Moyse
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


EESignature


RevOps Strategy Manager at Toolpath. New Zealand based.

Co-founder of the Grumpy Sloth full aluminium billet mechanical keyboard project

Reply
Reply
0 Likes
Message 27 of 57

CCarreiras
Mentor
Mentor

HI!

 

Now my post is able to output based in G43,4 and (A,C) coordinates.

 

But, the machine (Robodrill post) needs to read "P" function.

 

How can i turn on this?

 

Example Code:

 

%
000000
G21
G00G17G40G49G52G80G90G69
G91G28Z0.
G90
T2M6
G90G54
G0X3.017Y-28.248A0C0
S17000M03
(/M21)
(/M22)
G00 G43.4 L1  P3 H2 Z-17.74
G01A-34.333C101.419F30000
G01X2.91Y-26.861F15000
X2.853Y-26.786
X2.793Y-26.706
X2.307Y-26.064
X2.241Y-25.992Z-17.746A-33.901C101.373
X2.175Y-25.919Z-17.753A-33.471C101.366   

 

By now, i have this:

 


(SWARF1)
N1615 G00 G43.4 X55.604 Y36.302 Z15. H01 (No P instructions)
N1620 G00 A-335.727 C-130.222
N1625 Z-4.555
N1630 G01 X55.595 Y36.275 Z-4.806 F1000.
N1635 X55.549 Y36.211 Z-5.045

 

Thank you.

 

CCarreiras

EESignature

Reply
Reply
0 Likes
Message 28 of 57

WallaceLau
Participant
Participant

Has the question of "B axis rotate under 45 degrees" been answered?  It's the first reply to this thread, but it looks to have been skipped over (while other questions have been addressed).  The older DMG DMU have their "B" axis rotation flange mounted at 45 degrees, but if you issue G7 commands it will move both the B/C axis to correctly angle the plane, and then compensate X/Y movement to work with the unorthodox kinematic.  However the generic Millplus PP doesn't seem to work correctly with this setup.

 

Thanks in advance for the assist!

 

 

 

W.

Reply
Reply
0 Likes
Message 29 of 57

dudukovic_goran
Participant
Participant

Hello...can some one help!?

Its old maho machine with 4 axis and philips 432 , B axis around y

I try edit post es it explame in frst post , but no luck

I know that this machine have reverse axis y/z, but I use b axis only when set up machine in vertikal setup, so then is regular xyz orientation

This is what I do, and what I have frop pp is error that toll orientation is not support!

Reply
Reply
0 Likes
Message 30 of 57

rcrdesign
Participant
Participant

Thank you - your post solved my issue (G68.2)... Definitely needs to be mentioned, only if I saw this earlier. Yahoo

Reply
Reply
0 Likes
Message 31 of 57

Anonymous
Not applicable
Re: How to set up a 4/5 axis machine configuration

Hello,

 

I have a wabeco milling machine with a wabeco 2 axis rotary table."

 

Hi, did you get the offset sorted out because I am in the same situation after making my AB axis addition.

 

Rgeards Colin Wood

Reply
Reply
0 Likes
Message 32 of 57

Anonymous
Not applicable

Hello,

I have a PilotPro 5 axis.

I have the 5axisMaker post and I need to edit it for my B Head C Table setup.

I want to limit the rotation of the B Head, CW.

~original~

    var bAxis = createAxis({coordinate:1, table:false, axis:[1, 0, 0], range:[-180.00, 180.00]});
    var cAxis = createAxis({coordinate:2, table:false, axis:[0, 0, 1], offset:[cAxisOffset, 0, 0], range:[-360.00, 360.00], cyclic:false});

 

~my edit~

    var bAxis = createAxis({coordinate:1, table:false, axis:[1, 0, 0], range:[-5.00, 100.00], preference:1});
    var cAxis = createAxis({coordinate:2, table:true, axis:[0, 0, 1], offset:[cAxisOffset, 0, 0, 0], range:[-360.00, 360.00], cyclic:false, preference:1});

 

Should I turn Off TCP?

 

I have no Jave Script karate skills, so I hope somebody can let me know if I got this correct.

Thank you

Reply
Reply
0 Likes
Message 33 of 57

Anonymous
Not applicable

Also,

My C Table is a Sherline Rotary and can be continuous, but if I understand Fusion360, it is not, correct?

So do I want to set range to:

var cAxis.......range:[-360.00, 360.00]

var cAxis.......range:[-999.00, 999.00]

or remove it from text so it is the default, Unbound?

 

Thank you

Reply
Reply
0 Likes
Message 34 of 57

FTKnur
Collaborator
Collaborator

When you turn the table are you over 360° or everytime between 0° and 360°?

Haidenhain has the M94 command to change this.

 

In your PP you can use [0,360].

 

 

Edit: I have used the wrong "reply" button - I've replied the last on site 1 😄

Reply
Reply
0 Likes
Message 35 of 57

Laurens-3DTechDraw
Mentor
Mentor

@Anonymous wrote:

Also,

My C Table is a Sherline Rotary and can be continuous, but if I understand Fusion360, it is not, correct?

So do I want to set range to:

var cAxis.......range:[-360.00, 360.00]

var cAxis.......range:[-999.00, 999.00]

or remove it from text so it is the default, Unbound?

 

Thank you


You have to set the cyclic command to true.

Laurens Wijnschenk
3DTechDraw

AutoDesk CAM user & Post editor.
René for Legend.


Reply
Reply
Message 36 of 57

Anonymous
Not applicable

Thank you both,

 

I'm also having trouble with "exploded" paths in Mach3.

I am using a file that worked successfully on the PocketNC using the PocketNC post processor in Generic.

Its a 3+2 solution on their 5 axis table on table unit.

 

When using the 5axisMaker PostProcessor with the original edits above, a group of Four paths, that are part of a Pattern, repeating every 90degrees, will "explode" away from the object center on all axis in a non uniform manner.

 

Loading the older PocketNC file that were successful, yielded incorrect orientation and stacking of all four paths that were in the Pattern.

 

I have no idea where to even start looking.

Reply
Reply
0 Likes
Message 37 of 57

Anonymous
Not applicable

Thanks for the great info! 

I am editing the mazak post to support our 5 axis (B and C) machine.

Here is what I have so far BUT I still get a axis code when I post. 

What am I missing?

 

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

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

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

 

Thank you for the help

Reply
Reply
0 Likes
Message 38 of 57

splintWFYFX
Participant
Participant

Hi,

 

I' trying to modify the generic mach3mill.cps post for a table/table machine with b tilting about y and c rotating about z.

 

In step 1 it references the onopen function which needs to be changes from false to true,  the only time in this post onopen appears the syntax is substantially different from what post processor training guide indicates, no true false option that I can see, no range option. Can you please advise on how to go about this? Screen shot attached.

Reply
Reply
0 Likes
Message 39 of 57

Anonymous
Not applicable
Hi,

Not sure if you have found this in the forum. Here is a great page to read.

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


I see it has changed a bit.

Here is my suggestion



function onOpen() {
if (properties.useRadius) {
maximumCircularSweep = toRad(90); // avoid potential center calculation errors for CNC
}

// My edits here
// You can put is range as in website above explained
// the offsets were not working, not sure if they do now
if (true) {
var aAxis = createAxis({coordinate:0, table:true, axis:[1, 0, 0], preference:0});
var bAxis = createAxis({coordinate:1, table:true, axis:[0, 1, 0], preference:0});
machineConfiguration = new MachineConfiguration(aAxis, bAxis);

setMachineConfiguration(machineConfiguration);
optimizeMachineAngles2(1); // 0= Enabled, 1=disabled TCP enabled (eg. M128, TRAORI, G43.4, G243)
}


// No edits below here


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

if (!properties.separateWordsWithSpace) {
setWordSeparator("");
}

sequenceNumber = properties.sequenceNumberStart;

if (programName) {
writeComment(programName);
}
if (programComment) {
writeComment(programComment);
}

Any thing else don’t hesitate to contact me.
Regards
Colin
Reply
Reply
0 Likes
Message 40 of 57

splintWFYFX
Participant
Participant

Thanks Colin, 

 

That's definitely a step in the right direction. I did modify the code as you indicated but substituted the values a and b for b and c as it is tilting around y and rotating around z not x and z.

 

The post processor does produce 5 axis code that Mach 3 will run (run only on the software at this stage with the machine not connected) but it produces a and b rather than b and c.

 

I did a little extra modification to the code because it looked like the pp was set for fourth axis only, not sure if it was required but it doesn't appear to do any harm. The code changes are as follows:

 

Line 55: fourthAxisAround: "none", // specifies the fourth axis if mounted
Added the following in line 56: fifthAxisAround: "none", // specifies the fifth axis if mounted

 

Line 71 contains references to both x and y, I’m unclear on how this works: fourthAxisAround: {title:"Fourth axis mounted along", description:"Specifies which axis the fourth axis is mounted on.", type:"enum", values:[{id:"none", title:"None"}, {id:"x", title:"Along X"}, {id:"y", title:"Along Y"}]},


Added the following in line 72: fifthAxisAround: {title:"Fifth axis mounted along", description:"Specifies which axis the fifth axis is mounted on.", type:"enum", values:[{id:"none", title:"None"}, {id:"Y", title:"Along Y"}, {id:"Z", title:"Along Z"}]},

 

Added the following immediately after the onopen statement:

var bAxis = createAxis({coordinate:1, table:true, axis:[0, 1, 0], preference:0});

var cAxis = createAxis({coordinate:0, table:true, axis:[0, 0, 1], preference:0});

machineConfiguration = new MachineConfiguration(bAxis, cAxis);

 

I'm not a coder so I could be way off with this. Any idea how to get the post making bc rather than ab code?

 

Thanks

David

 

Reply
Reply
0 Likes