Haas Lathe sub spindle orient M119 R...

Haas Lathe sub spindle orient M119 R...

peter
Participant Participant
1,598 Views
10 Replies
Message 1 of 11

Haas Lathe sub spindle orient M119 R...

peter
Participant
Participant

would it be possible to have a predefined R-value for the sub spindle output. something like an R-offset value from the machine orientation and the desired orientation of the machining face.

 

currently G14 M19 R0

desired G14 M19 R (value entered in the post dialogue box )

 

0 Likes
Accepted solutions (3)
1,599 Views
10 Replies
Replies (10)
Message 2 of 11

aju_augustine
Autodesk
Autodesk

Hi @peter ,

 

I checked with Haas ST-30Y, if I set Got secondary spindle as Positioning only as shown in screenshot below:

7.png

 

I am getting the following output:

 

8.png

 

G14 and G0 M19 R0 will be in different line.

Does your current post output in G14 M19 R0? if yes could you share the post that you are using.



Aju Augustine
Technology Consultant
Message 3 of 11

peter
Participant
Participant
Yes, I believe both machines share the same post. When I checked I saw that my latest post was used on several different haas lathe including the st20y. I am not near my computer and cannot tell you the version number but my output is the same as the one you described
0 Likes
Message 4 of 11

peter
Participant
Participant

Hi AJU,

I have the same output as you, see below

I gladly send you my post, but it is the one available from fusion for ST20Y version 44114 which i believe is the same post you are using for the ST30Y. i never modified anything and as you pointed out, i also select, positioning only.

I am not sure what your issue is with the post, but my issue is the radial output being an R-value selected by fusion, whilst i don't have an offset option for that spindle. lacking the offset, i was hoping to have my post modified to give me the option to enter a value to be added to the R-output as way of compensation.

 

(rear boss)
G14
G101 Y0.
T303
G98
G17
G97
P4000 M133
G55
M8
M15
G0 M19 R0.
M14
G0 Z11.
X-23.725 Y-2.75
Z1.
G1 Z-1. F400.
X-17.725
Y-1.4

0 Likes
Message 5 of 11

aju_augustine
Autodesk
Autodesk
Accepted solution

Hi @peter ,

 

I hope you're doing well. According to your need, you'll need to make 4 key modifications to your post. I'll walk you through them.

 

Modification 1:

 

_1.png

 

First, you want to add the following code in the designated area (please refer to the attached screenshot for the precise location):

 

 

 

 

rValueOffset: {
  title: "R-Value Offset",
  description: "Compensate R Value to Secondary Spindle",
  group: "configuration",
  type: "real",
  range: [-360, 360],
  value: 0,
  scope: "post"
},

 

 

 

Modification 2:

 

_2.png

 

Next, you'll want to add another block of code (again, refer to the second screenshot for the exact location):

 

 

 

 

var rOffsetFormat = createFormat({ decimals: 3, type: FORMAT_REAL, scale: DEG });
var rOffsetOutput = createOutputVariable(rOffsetFormat);

 

 

 

Modification 3:

 

_3.png

 

You'll need to replace an existing block of code with the following one (please see the third screenshot for the correct location):

 

 

 

//Condition to add R Offset Value
if (getProperty("gotSecondarySpindle") == "true") {
  var newRValue
  newRValue = Number(rOffsetOutput.format(abc.z)) + Number(getProperty("rValueOffset"))
  // Normalize newRValue to be within 0-360
  if (newRValue < 0) {
    newRValue += 360;
  } else if (newRValue >= 360) {
    newRValue -= 360;
  }
  skipBlock = _skipBlock;
  writeBlock(
    gMotionModal.format(0),
    conditional(machineConfiguration.isMachineCoordinate(0), aOutput.format(abc.x)),
    conditional(machineConfiguration.isMachineCoordinate(1), bOutput.format(getB(abc, currentSection))),
    conditional(machineConfiguration.isMachineCoordinate(2), "M19 R" + zFormat.format(newRValue))
  );
} else {
  skipBlock = _skipBlock;
  writeBlock(
    gMotionModal.format(0),
    conditional(machineConfiguration.isMachineCoordinate(0), aOutput.format(abc.x)),
    conditional(machineConfiguration.isMachineCoordinate(1), bOutput.format(getB(abc, currentSection))),
    conditional(machineConfiguration.isMachineCoordinate(2), cOutput.format(abc.z)))
}

 

 

 

 Modification 4:

 

_4.png

 

Finally, add this last block of code into your post (check the fourth screenshot for the specific location):

 

 

 

 

  rOffsetFormat.setScale(-DEG)
  rOffsetOutput.setCyclicLimit(360);
  rOffsetOutput.setCyclicSign(1);
  rOffsetOutput.setFormat(rOffsetFormat)

 

 

 

After you've made these modifications, select the post again. You should now be able to see a new Variable called "R Offset value". Any values added in the field will be included in the output as shown in the final screenshot.

 

I hope this helps! Please do not hesitate to reach out if you have any more questions or face any difficulties.

 

14.png

 



Aju Augustine
Technology Consultant
Message 6 of 11

peter
Participant
Participant

Hi AJU,

I made all the changes you suggested. Thank you for all your efforts.

there is one small problem,

your changes impacted the main spindle also.

the post properties was set to " got secondary spindle"   "positioning only"

if i set it to contouring i get a C-output for both main and sub. which does not work

 

before post changes: (that is correct for main spindle)

M15

G0 C0.

M14

 

after changes 

M15

G0 M19 R0

M14

 

when i enter an offset value, it applied this to the main spindle also.

 

 

 

 

 

0 Likes
Message 7 of 11

aju_augustine
Autodesk
Autodesk
Accepted solution

Hi @peter ,

 

To address the issue, you can modify the codes in the post as shown below:

 

Original:

//Condition to add R Offset Value
if (getProperty("gotSecondarySpindle") == "true") {
  var newRValue
  newRValue = Number(rOffsetOutput.format(abc.z)) + Number(getProperty("rValueOffset"))
  // Normalize newRValue to be within 0-360

 

Modified:

  //Condition to add R Offset Value
  if (getProperty("gotSecondarySpindle") == "true" && currentSection.spindle == SPINDLE_SECONDARY) {
    var newRValue
    newRValue = Number(rOffsetOutput.format(abc.z)) + Number(getProperty("rValueOffset"))
    // Normalize newRValue to be within 0-360

 

This modification should resolve your issue, and the R Offset Value will only be added when the got Secondary Spindle property is set to "Positioning Only" and if the Secondary Spindle is selected.

 

I hope this helps! 



Aju Augustine
Technology Consultant
0 Likes
Message 8 of 11

peter
Participant
Participant

Hi AJU,

Thank you very much, this works great now

0 Likes
Message 9 of 11

peter
Participant
Participant

I would like to enter an R-Value containing a decimal place. right now i am limited to whole numbers.

how can the post be changed to allow that ? the lines in the post are:

 

var rOffsetFormat = createFormat({ decimals: 3, type: FORMAT_REAL, scale: DEG });
var rOffsetOutput = createOutputVariable(rOffsetFormat);

 

Thanks

Peter

 

0 Likes
Message 10 of 11

aju_augustine
Autodesk
Autodesk
Accepted solution

Hi @peter ,

 

You can change the type of rOffsetValue definition as shown below:

 

Original:

 

  rValueOffset: {
    title: "R-Value Offset",
    description: "Compensate R Value to Secondary Spindle",
    group: "configuration",
    type: "real",
    range: [-360, 360],
    value: 0,
    scope: "post"
  },
};

 

 

Modified:

 

  rValueOffset: {
    title: "R-Value Offset",
    description: "Compensate R Value to Secondary Spindle",
    group: "configuration",
    type: "number",
    range: [-360, 360],
    value: 0,
    scope: "post"
  },
};

 

 

Output will display as shown in the screenshot:

_5.png

 

I hope this helps!

 



Aju Augustine
Technology Consultant
0 Likes
Message 11 of 11

peter
Participant
Participant

Thank you AJU

0 Likes