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
79,098 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
79,099 Views
56 Replies
Replies (56)
Message 41 of 57

Anonymous
Not applicable
Hi

Did you see my correction
Reply
Reply
0 Likes
Message 42 of 57

Anonymous
Not applicable

Looks like my correction had to come through.

 

All the changers before OnOpen you have made DELETE.

Well done your correction from A-B and B-C are correct.

 

You also got the Axis correct (0,1,0) for B and (0,0,1) for c

 

What is it not doing correctly now after you delete the lines prior to OnOpen

Reply
Reply
0 Likes
Message 43 of 57

splintWFYFX
Participant
Participant

Hi Colin,

 

Thanks for that. Can you please check over the code here. the text in red has been added but nothing else has been changed and all code prior to the onopen statement is the original code downloaded from https://cam.autodesk.com/hsmposts. This code produces A and B axis not B and C.

 

Thanks

 

 

function onOpen() {
if (properties.useRadius) {
maximumCircularSweep = toRad(90); // avoid potential center calculation errors for CNC
}
if (true) {
var bAxis = createAxis({coordinate:0, table:true, axis:[0, 1, 0], preference:0});
var cAxis = createAxis({coordinate:1, table:true, axis:[0, 0, 1], preference:0});
machineConfiguration = new MachineConfiguration(bAxis, cAxis);

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

if (properties.fourthAxisAround != "none") {
var aAxis = createAxis({coordinate:0, table:true, axis:[(properties.fourthAxisAround == "x") ? -1 : 0, (properties.fourthAxisAround == "y") ? -1 : 0, 0], cyclic:true, preference:0});
machineConfiguration = new MachineConfiguration(aAxis);

setMachineConfiguration(machineConfiguration);
optimizeMachineAngles2(1); // map tip mode
}

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

 

Reply
Reply
0 Likes
Message 44 of 57

scottmoyse
Mentor
Mentor
This is the wrong thread to be having this conversation in. Please start your own thread.

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
Message 45 of 57

jwilkof
Participant
Participant

I followed all the instructions in the original post, but I am still getting A, B, and C in my output.  See below post config and output.  Thanks!

Post config:

function onOpen() {
if (properties.useRadius) {
maximumCircularSweep = toRad(90); // avoid potential center calculation errors for CNC
}
gRotationModal.format(69); // Default to G69 Rotation Off

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

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

 

Output:

O1001
(T1 D=0.0785 CR=0. TAPER=118DEG - DRILL)
G90 G94 G17 G49
G20
G53 G0 Z0.

(DRILL2)
T1 M6
S10000 M3
G54
G68.2 X0. Y0. Z0. A97.094 B50.912 C-101.165
G53.1
M8
G0 X0.752 Y0.9027
G43 Z6.9568 H1
G0 Z6.5568
G98 G82 X0.752 Y0.9027 Z1.6693 R2.2522 F19.6 D0
G80
G0 Z6.9568

M5
M9
G53 Z0.
G69
G53.1
M99

Reply
Reply
0 Likes
Message 46 of 57

dreyfusduke
Contributor
Contributor

I have question about the first line of the explanation.......

 

 "actuator: Specifies that the actuator type (ie. either "linear" or "rotational"). The default is "rotational"."

 

If someone did have a linear axis as part of this.... where would this be changed?

Reply
Reply
0 Likes
Message 47 of 57

Anonymous
Not applicable

sir, 

I have a n error when I create the  code by power mill post processor by  fanuc .

the screen print is attached .

 

waiting to hear rom you soon.

 

regard

 marinin

Reply
Reply
0 Likes
Message 48 of 57

lubos.ulovec
Contributor
Contributor

Hello Achim,

is there a way how to setup siemens-840d.cps post for 5 axis AC head configuration machine that it would not use the cycle800 at all but generates AC values instead? The machine we have has not cycle800 activated and manufacturer is saying they don't use/support this cycle. The machine uses TRAORI and AC values for anything where it needs to swivel the head. Any help appreciated, thanks.

Sorry if it is off topic.

Reply
Reply
Message 49 of 57

Sinnsvak
Explorer
Explorer

I am having the same problem. I have not been able to get the post for 840D to use TRAORI in positional work, and our reseller refuses to help us, or help us finding help. It would be great if someone could aid us in the right direction here.

 

Much appreciated.

Reply
Reply
0 Likes
Message 50 of 57

scottmoyse
Mentor
Mentor

@Sinnsvak wrote:

I am having the same problem. I have not been able to get the post for 840D to use TRAORI in positional work, and our reseller refuses to help us, or help us finding help. It would be great if someone could aid us in the right direction here.


Hi @Sinnsvak we help people in Australia, New Zealand and the USA. We can help further afield if need be. It's a shame to hear your reseller isn't willing to help, we certainly would but have to charge for our services. If you are interested, please email me at scott.m at cadpro.co.nz 


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
Message 51 of 57

lubos.ulovec
Contributor
Contributor

This postprocessor generates AC values instead of using cycle800 and worked for me:

https://cam.autodesk.com/hsmposts?p=belotti_siemens-840d

Don't thank me, some good soul pointed me to that soulution 😉

Good Luck,

Lubos

Reply
Reply
Message 52 of 57

Sinnsvak
Explorer
Explorer

Thank you, it also pointed me in the right direction. I will be sure to do the same.

Reply
Reply
Message 53 of 57

joaoguarconi
Observer
Observer

Hey, I'm using Fusion 360 CAM, but I'm not able to post processing to Mach 3. I tried to modify the Mach3 post processor and tried to use the PocketCNC post processor, but didn't work either. My machine has a rotary table, with this relation: B (Z) and A (X). Could someone help me?

Reply
Reply
0 Likes
Message 54 of 57

Anonymous
Not applicable
Hi

Are you using the Hobby version (free version) of Fusion 360? If so they have removed 5 Axis from this version. you can only do 3 Axis now. It use to but not anymore. To get 5 Axis you have to pay for this now.

Colin
Reply
Reply
0 Likes
Message 55 of 57

joaoguarconi
Observer
Observer
Actually, I think that the problem is where I'm placing the WCS in addition
to the setup of the rotation radius of the 4th axis (A - X). I'm using
mach3 and the Gcode seems to be almost right, but the translation of the
plan when A axis moves insn't.
Reply
Reply
0 Likes
Message 56 of 57

Anonymous
Not applicable
Sorry miss read, I thought there was no output of A,B or C.

Yes the setup takes a while to sort out. Some good You Tube vids on setting up table and alignment.

Colin
Reply
Reply
0 Likes
Message 57 of 57

Anonymous
Not applicable

Good afternoon, my name is David, I write because I have a problem with the 4-axis machine I work with. My machine is configured on Linux, I use Fusion 360 for both CAD and CAM. My problem is that I make a 4-axis movement of a concave curve but my machine makes the convex curve. Attached photo of my 4-axis machine built into the head, photo how I have configured the post 360 fusion linux processor. Thank you very much I hope someone can help me because I can't find the problem.

anafo_0-1612206732851.jpeg

 

anafo_1-1612206732885.jpeg

 

anafo_2-1612206732896.jpeg

 

anafo_3-1612206732900.jpeg

 

Reply
Reply