Need only positive A values - 4th Axis Fanuc

Need only positive A values - 4th Axis Fanuc

Aadithya01
Advisor Advisor
1,326 Views
5 Replies
Message 1 of 6

Need only positive A values - 4th Axis Fanuc

Aadithya01
Advisor
Advisor

Hey Guys ,

 

I would need help in getting only positive 4th axis head rotation - A values from the FANUC post processor. 

 

My customer has a CNC Router with A axis head rotation support ... His machine limits are 

 

Machine specifications

X  Axis: 2500 mm

Y  Axis: 1250 mm

Z Axis: 200 mm

A Axis - head : +60° & -60° (300°)

 

Note : His micro controller does not support negative A values ... - Hence this is where the problem is ... Please see the below video link (with audio output) and kindly support me ... Also I have attached the corresponding post processor and the inventor hSM files ... 

 

 

 

 

 

 

Kindly help me

 

Regards

Aadithya

Application Engineer ,

USAM Coimbatore

0 Likes
Accepted solutions (2)
1,327 Views
5 Replies
Replies (5)
Message 2 of 6

AchimN
Community Manager
Community Manager

Thanks for your feedback, we will look into it one come back to you asap.



Achim.N
Principal Technology Consultant
0 Likes
Message 3 of 6

bob.schultz
Alumni
Alumni
Accepted solution

Hello Aadithya,

 

The problem here is that you setup the machine hard limits to be 0,360 so the post processor will try to rewind the A-axis when the limits are reached, including retracting the tool, rewinding the A-axis, and repositioning the tool.  This is not the style of output you are looking for and could cause problems even it did not generate an error.  There are two methods to get around this issue.  First you can set the axis to 'cyclic', which will cause the A-axis range to be a "soft" limit and no rewinds would be generated.

 

 

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

 This will generate the output you are looking for, but the limits of the machine would no longer be checked by the post processor.  The second method is to set the hard limits of the A-axis to -60,60 and add a function that will output negative A-axis positions as positive values.

 

 

 

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

 

function getA(a) { // add this function
  if (abcFormat.getResultingValue(a) < 0) {
    return a + Math.PI * 2.0;
  }
  return a;
}

You will then have to call this function every time the A-axis is output.

 

// examples of the code you will need to change
conditional(machineConfiguration.isMachineCoordinate(0), "A" + abcFormat.format(getA(abc.x))),
...
var a = aOutput.format(getA(_a));

This will ensure that the limits of the A-axis are checked and you will get an error if they are exceeded.

 

Hope this helps.

 

 



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 4 of 6

Aadithya01
Advisor
Advisor

Hi @bob.schultz

 

thanks for your reply . Can you tell me after which line should I add this

 

function getA(a) { // add this function
  if (abcFormat.getResultingValue(a) < 0) {
    return a + Math.PI * 2.0;
  }
  return a;
}

 

and this

 

// examples of the code you will need to change
conditional(machineConfiguration.isMachineCoordinate(0), "A" + abcFormat.format(getA(abc.x))),
...
var a = aOutput.format(getA(_a));

 

 

looking forward for your reply

 

Regards

Aadithya

0 Likes
Message 5 of 6

bob.schultz
Alumni
Alumni
Accepted solution

Hello Aadithya,

 

The function 'getA(a)' can be added between any two functions in the post.  I placed it prior to onOpen in my case.

 

/**
  Output a comment.
*/
function writeComment(text) {
  writeln(formatComment(text));
}

function getA(a) {
  if (abcFormat.getResultingValue(a) < 0) {
    return a + Math.PI * 2.0;
  }
  return a;
}

function onOpen() {

 

The calls to 'getA(a)' have to be added wherever the A-axis is output.  For the first example ...

 

conditional(machineConfiguration.isMachineCoordinate(0), "A" + abcFormat.format(getA(abc.x))),

... you will need to search for all occurrences of '"A" + abcFormat', which you will find in 'defineWorkPlane' and 'setWorkPlane'.  For the second example ...

 

var a = aOutput.format(getA(_a));

... you should search for all calls to aOutput.format.  You will find this in 'onRapid5D' and 'onLinear5D'.

 

 

 



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 6 of 6

Aadithya01
Advisor
Advisor

Hey Bob ,

 

Now the A axis is working fine .... Thanks for your support

 

Regards

Aadithya

0 Likes