Community
HSM Post Processor Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to set up a 4/5 axis machine configuration

56 REPLIES 56
Reply
Message 1 of 57
AchimN
50638 Views, 56 Replies

How to set up a 4/5 axis machine configuration

Updated August 2023:

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

 

AchimN_3-1692283214930.jpeg


It is no longer required to add the machine kinematics to the post processor script.

Moving forward, using machine configurations in Fusion is the preferred method to specify your machine configuration, kinematics and options like home positions, axes limits and more.

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.
All available machines can be found in our online Machine Library and/or directly from within the Fusion machine library.

AchimN_2-1692282045438.png

 



The Fusion 360 Machine Configuration video explains how to create or edit a machine configuration on your own.



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 7.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
56 REPLIES 56
Message 2 of 57
zeljnik2014
in reply to: AchimN

Hello.

 

My Deckel Maho 50v whith B and C axis, has specific kinematic of table. B axis rotate under 45 degrees. I try to change millplus.cps and my intersting is where I must write this angle and specify rotation.

 

Now, I have this :

 

if (true) { // note: setup your machine here
var bAxis = createAxis({coordinate:1, table:true, axis:[0, 1, 0], range:[0,180], 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(0); // TCP mode - using G141
}

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

 

Next problem is G7 code, mashine can not read this code. Can I change this code because G07 A5=  B5=  C5=    mashine dont read, and always output alarm.

 

Best regards

Message 3 of 57
fitztu
in reply to: AchimN

Hello,

I think if you could show some examples here will be much clear.

Maybe show the examples for each different kind of machine ( table-table ,head-table,head-head)?

The most important is how to set the B,C zero for table-table machine without tcp and how to set post processor with head-table or head-head machine without tcp.

Message 4 of 57
Aadithya01
in reply to: AchimN

I was about the try the procedure which you have mentioned in the HSM forum .. But the program structure mentioned in the forum and the program structure in Mitsubishi is not the same .. Also kindly please have a look at the image in the link that I Have attached and please give us a solution.

 

 https://drive.google.com/open?id=0BzMseUdQJiwhYVBSZDEtWmxzVlE

 

Message 5 of 57
AchimN
in reply to: Aadithya01

Ok so please add this code as shown into the screenshot at the beginning of onOpen() and set it up for your needs.

 

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

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


Achim.N
Principal Technology Consultant
Message 6 of 57
Aadithya01
in reply to: AchimN

Hey AchmiN , 

 

Thankyou so much I just tried that and it worked very well .. Also I will try the codes which you have mentioned in the customer site .. that would really be very helpful for me .. Also thanks for your great work in supporting

Message 7 of 57
Kahjoo
in reply to: AchimN

Hello!

 

Any idea how to post rotational axis in radians instead of degrees ?

 

var abcFormat = createFormat({decimals:3, forceDecimal:true, scale:DEG});

 

Tried changing scale:DEG to scale:RAD, but that doesnt work.

Could also add some math to convert it, but if someone knows a better way..

 

Thank you!

 

EDIT: Solution was to completely remove scale attribute.

Message 8 of 57
Aadithya01
in reply to: Kahjoo

hey kahjoo , 

 

Try the procedure said by Achmin - autodesk software engineer ... Try the steps that he has mentioned .. cause that worked fine for me .

Message 9 of 57
LibertyMachine
in reply to: AchimN

@AchimN, could you also mention that if you are modifying a generic Fanuc post, you will need to set:

var useMultiAxisFeatures = false;

 

Default is =true and it might throw people off


Seth Madore
Owner, Liberty Machine, Inc.
Good. Fast. Cheap. Pick two.
Message 10 of 57


@LibertyMachine wrote:

@AchimN, could you also mention that if you are modifying a generic Fanuc post, you will need to set:

var useMultiAxisFeatures = false;

 

Default is =true and it might throw people off


Yeah worth mentioning that you need to look for such properties since most posts are set-up for newer controls and have options to use control options/upgrades. 

Laurens Wijnschenk
3DTechDraw

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


Message 11 of 57
dkehlet
in reply to: AchimN

I'm using a sinumeric 840D on a Mori DMG DMU 50 5-axis. After I do step one of the instructions the post fails even if I have done steps 2-5 or not. I'd really like to use the swarf cutting feature and I'm having a hard time with the 840d post. Capture.PNG

Message 12 of 57

What you see is this the fail safe for the issue described here: https://forums.autodesk.com/t5/hsm-post-processor-forum/big-warning-on-5-axis-simultaneous-heidenhai...

Laurens Wijnschenk
3DTechDraw

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


Message 13 of 57
budgen30
in reply to: AchimN

Hello,

 

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

 

IMG_1695.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I made them cnc. 

It is a table table setup: xyz bc.

 

This wabeco rotary table has a bAxis offset

- tilt (bAxis) rotates around yAxis

- bAxis is -7.5mm offset from cAxis (direction -xAxis)

- the workpiecezero point (WCS) is 99.5mm above the bAxis

 

I cannot find any postprocessors with an axis offset as an example.

I have usbcnc (edingcnc) Edingcnc. I have tried to change some PP. I now use the fusion360 MAZAK postprocessor, because i read that this post gives standard a xyzbc output. Which it does.

 

I read this post and many others and i read this info:

 

When you search for createAxis you find this: 

http://cam.autodesk.com/posts/reference/classPostProcessor.html

 

--

Constructs a new machine axis.

The supported specifiers are:

  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]"). This specifier is required.
  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"). This specifier is required.
  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.

Parameters

specifiersThe axis specifiers.
var bAxis = createAxis({coordinate:1, table:true, axis:[0, 1, 0], range:[-120,120], preference:1});
var cAxis = createAxis({coordinate:2, table:true, axis:[0, 0, 1], range:[-999.999,999.999]});

--

 

there is a offset specifier:

4. offset: Specifies the axis offset as a 3-element array (e.g. "[0, 0, 25]"). The default is [0, 0, 0].

 

I tried this in my post:

 

--

function onOpen() {

if (true) { // note: setup your machine here

var bAxis = createAxis({offset:[-7.5, 0, -99.5], coordinate:1, table:true, axis:[0, 1, 0], range:[0, 90], preference:-1, resolution:0});
var cAxis = createAxis({offset:[0, 0, 0], coordinate:2, table:true, axis:[0, 0, 1], range:[-360, 360], preference:1, resolution:0});
machineConfiguration = new MachineConfiguration(bAxis, cAxis);

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

--

 

The WCS (my work piece zero point) is located (7.5, 0, 99.5) from the bAxis in Fusion.

I get a good code with x y z b and c (no TCP)

 

The problem is,

It gives exact the same g-code when the offset is (0, 0, 0)

So the postprocessor doesn't recognize the offset..?

 

What am i doing wrong?

 

Message 14 of 57

I think at least this needs to be changed:

optimizeMachineAngles2(0); // TCP mode

to:

optimizeMachineAngles2(1); // TCP mode

Laurens Wijnschenk
3DTechDraw

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


Message 15 of 57

I just changed it. It gave the same g-code. No changes in the g-code.

 

 

Message 16 of 57

I also found this:

When you search for createFormat you find this:

 

--

Constructs the format specification for the given values. See createFormat().

Parameters

specifiersThe format specifiers.

The supported specifiers are:

  1. decimals: Specifies the number of decimals. Defaults to 6.
  2. trim: Specifies that ending zero decimals should be trimmed. Defaults to true.
  3. trimLeadZero: Specifies that the leading zero should be excluded. Eg. ".123" instead of "0.123". Defaults to false.
  4. forceSign: Specifies that the '+'-sign must be included for positive numbers. Defaults to false.
  5. forceDecimal: Specifies that the decimal symbol must be included. Defaults to false.
  6. zeropad: Specifies that zeros should be padded to the resulting string to fit the given width. Defaults to false.
  7. width: Specifies the width of the resulting string. Defaults to 0.
  8. separator: Specifies the decimal symbol. Defaults to '.'.
  9. cyclicLimit: Specifies the cyclic limit. Defaults to 0 (disabled).
  10. cyclicSign: Specifies the cyclic sign. Defaults to 0.
  11. scale: Specifies the scale. Defaults to 1.
  12. offset: Specifies the offset. Defaults to 0.
  13. prefix: Specifies the prefix. Defaults to empty string.
  14. suffix: Specifies the suffix. Defaults to empty string.
  15. inherit: Specifies the format to inherit.
var xFormat = createFormat({decimals:3, trim:false, forceSign:true});
xFormat.format(4.5); // returns "+4.500"
var yFormat = createFormat({decimals:3, forceSign:true});
yFormat.format(4.5); // returns "+4.5"
var toolFormat = createFormat({decimals:0, zeropad:true, width:2});
toolFormat.format(7); // returns "07"
var aFormat = createFormat({decimals:3, forceSign:true, forceDecimal:true, scale:DEG});
aFormat.format(Math.Pi); // returns "+180."
--
 
I see: 
12. offset: Specifies the offset. Defaults to 0.
 
Maybe... does this relate to axis-offset or tool-offset?
Message 17 of 57
JustinHoMi
in reply to: budgen30

Has that standard format for the posts changed? I'm looking at the latest tormach.cps, and it doesn't look anything like the one in this thread. 

Message 18 of 57

That one is a little different since I believe a guy from Tormach wrote the post.

 

Laurens Wijnschenk
3DTechDraw

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


Message 19 of 57
zshorn
in reply to: AchimN

Hello everyone,

 

I am new to Fusion 360 and loving it so far but am running into a problem with my 5 axis post.

 

My machine is a Quintax moveable table in the Y and have the B and C on the spindle. My controller is a Fagor 8055M so using the generic Fagor, I have altered it to look like the following:

 

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

    setMachineConfiguration(machineConfiguration);
    optimizeMachineAngles2(0); // map tip mode

 

Here are the errors I am getting:

 

Rewind handling during post processing must be specifically handled in the post.
Error: Rewind of machine is required for simultaneous multi-axis toolpath.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Failed to invoke function 'onRewindMachine'.
Error: Failed to invoke 'onRewindMachine' in the post configuration.
Error: Failed to execute configuration.

 

I have found some rewind code and tried to modify it as best I could but it seemed to create more failures than I had before. This is the code I used:

 

function onRewindMachine(_a, _b, _c) {
  // Get the current axes positions
  var currentXYZ = getCurrentPosition();
  var currentABC = getCurrentDirection();
  var toolAxis = machineConfiguration.getDirection(currentABC);
  var toolEnd = currentXYZ;
  // Calculate the retract distance
  var retractDistance = getRetractDistance(tool.fluteLength);
  // Output warning that axes take longest route
  if (retractDistance <= 0) {
    error(localize("Rotary axes are taking longest route without tool retraction."));
    return;
  } else {
    var text = localize("Tool is retracting due to rotary axes limits.");
    warning(text);
    writeComment(text);
  }
 
  // Retract along the tool axis
  var retractPos;
  if (properties.useTCPMode) {
    retractPos = Vector.sum(toolEnd, Vector.product(toolAxis, retractDistance));
  } else {
    retractPos = new Vector(toolEnd.x, toolEnd.y, toolEnd.z + retractDistance);
  }
  onLinear(retractPos.x, retractPos.y, retractPos.z, safeRetractFeed);
   
  //Position to safe table positioning location
  moveToSafeRetractPosition();
  moveToSafeIndexPosition();
 
  // Rotate axes to new position above reentry position
  writeBlock(gMotionModal.format(0), aOutput.format(_a), bOutput.format(_b), cOutput.format(_c));
 
  // Move back to position above part
  writeBlock(gMotionModal.format(0), xOutput.format(retractPos.x), yOutput.format(retractPos.y));
  writeBlock(gMotionModal.format(0), zOutput.format(retractPos.z));
 
  // Plunge tool back to original position
  onLinear(toolEnd.x, toolEnd.y, toolEnd.z, safePlungeFeed);
}
 
 
Does anyone have any thoughts how to fix this?

Thank you,

Zach
Message 20 of 57
jpershing
in reply to: AchimN

I changed the post as specified and received the error shown in the png. Not sure how to proceed. Attached is a good post. I need the header and footer to look like this. Thank you

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report