G50 value always higher than G97

G50 value always higher than G97

arminooo
Contributor Contributor
1,133 Views
4 Replies
Message 1 of 5

G50 value always higher than G97

arminooo
Contributor
Contributor

Hi,

I'm using the generic PP for " OSP-300 control"

https://cam.autodesk.com/hsmposts?p=okuma_lb3000_mill-turn

Three modifications I need help with, please : )

 

First tweak:

I'm running a heavy machine and the spindle mass is quite high (plus the mass of workpiece). when the program starts reving up the spindle, it sometimes passes the spindle speed limit by 3 to 5 RPM more than what G50 limited to. Then I get the error "Spindle Over Revolution Error"

This can be easily solved by forcing G97 value to be, lets say 5% lower than G50. or 2%. Just slightly lower

 

Like the code below.

(The green one on the right works just fine)

arminooo_0-1594215707179.png

 

 

 

Second tweak:

Whenever the programs ends with milling or drilling cycles, the spindle remains locked and I need to add M109 manually. Can you please help me to put it there automatically?

 

Annotation 2020-07-08 160449.jpg

 

 

Third tweak:

I want to omit redundant X Z coordinates from REPEATED drilling, not from the first line of the cycle itself.

After I commented out ' xOutput.reset(); ' and ' zOutput.reset(); ' I'm getting redundant X Z on repeated cycles at different C location.


In the below code (and any other cycles), If the line starts with G cycles, then the line must have all the necessary commands (which has and works just fine). But the following lines only needs parameters that changes (in this example only C changes)

Annotation 2020-07-08 160451.jpg

@Arun.rs Already helped me alot with PP modifications and I did bunch of tweaks to mine. But I still can't figure out how to solve this.

 

I really appropriate if you can guide me with any of the 3 above 

0 Likes
Accepted solutions (2)
1,134 Views
4 Replies
Replies (4)
Message 2 of 5

Laurens-3DTechDraw
Mentor
Mentor
Accepted solution

Hi.,

 

The G97 value is calculated with the surface speed and the initial position. Therefore it feels a little weird to just lower it in the code because the moment you turn on G96 it still needs to go to that set RPM.

Though if you still want to this could be a fix, find this piece of code:

  if (forceRPMMode) { // RPM mode is forced until move to initial position
      if (xFormat.getResultingValue(initialPosition.x) == 0) {
        _spindleSpeed = maximumSpindleSpeed;
      } else {
        _spindleSpeed = Math.min((_spindleSpeed * ((unit == MM) ? 1000.0 : 12.0) / (Math.PI * Math.abs(initialPosition.x * 2))), maximumSpindleSpeed);
      }
      spindleMode = gSpindleModeModal.format(getCode("CONSTANT_SURFACE_SPEED_OFF", getSpindle(false)));
    } else {
      spindleMode = gSpindleModeModal.format(getCode("CONSTANT_SURFACE_SPEED_ON", getSpindle(false)));
    }

Change to:

  if (forceRPMMode) { // RPM mode is forced until move to initial position
      if (xFormat.getResultingValue(initialPosition.x) == 0) {
        _spindleSpeed = maximumSpindleSpeed*0.98;
      } else {
        _spindleSpeed = Math.min((_spindleSpeed * ((unit == MM) ? 1000.0 : 12.0) / (Math.PI * Math.abs(initialPosition.x * 2))), maximumSpindleSpeed*0.98);
      }
      spindleMode = gSpindleModeModal.format(getCode("CONSTANT_SURFACE_SPEED_OFF", getSpindle(false)));
    } else {
      spindleMode = gSpindleModeModal.format(getCode("CONSTANT_SURFACE_SPEED_ON", getSpindle(false)));
    }

 

About the unclamp.

I think you have removed the G270 code? That is to enable turning and do all the unclamping etc.

In the same location you can add back:

onCommand(COMMAND_UNLOCK_MULTI_AXIS);
writeBlock(cAxisEngageModal.format(getCode("DISABLE_C_AXIS", getSpindle(true))));

 

 

Is there a problem with the extra outputted codes on cycles? Or do you just not like the way it looks?

Laurens Wijnschenk
3DTechDraw

AutoDesk CAM user & Post editor.
Found out the hard way is the best way to win.


Message 3 of 5

arminooo
Contributor
Contributor

Thanks Laurens for your reply 🙂

I indeed deleted G270 for whatever reason I can't remember now! Thanks for the hint! I put it back in the PP and it solved the problem.

 

The problem with redundant code is, the machine has 106KB usable memory and I'm trying to save some bits whenever possible. Otherwise the code runs just fine

 

Thanks again for your help : )

0 Likes
Message 4 of 5

Laurens-3DTechDraw
Mentor
Mentor
Accepted solution

About the redundant codes in drilling, some machines do always need those value's that's why they are in the post.

So you had tried changing this:

function getCommonCycle(x, y, z, r) {
  if (machineState.useXZCMode) {
    var currentC = getCClosest(x, y, cOutput.getCurrent());
    // setCAxisDirection(cOutput.getCurrent(), currentC); // causes extra hole to be drilled & manual recommends using a single direction for accuracy
    xOutput.reset();
    zOutput.reset();
    cOutput.reset();
    return [xOutput.format(getModulus(x, y)), cOutput.format(currentC),
      zOutput.format(z),
      conditional(r != 0, (gPlaneModal.getCurrent() == 17 ? "K" : "I") + spatialFormat.format(r))];
  } else {
    return [xOutput.format(x), yOutput.format(y),
      zOutput.format(z),
      conditional(r != 0, (gPlaneModal.getCurrent() == 17 ? "K" : "I") + spatialFormat.format(r))];
  }
}

 

To this:

function getCommonCycle(x, y, z, r) {
  if (machineState.useXZCMode) {
    var currentC = getCClosest(x, y, cOutput.getCurrent());
    // setCAxisDirection(cOutput.getCurrent(), currentC); // causes extra hole to be drilled & manual recommends using a single direction for accuracy
  if (isFirstCyclePoint()) {
    xOutput.reset();
    zOutput.reset();
    cOutput.reset();
}
    return [xOutput.format(getModulus(x, y)), cOutput.format(currentC),
      zOutput.format(z),
      conditional(r != 0, (gPlaneModal.getCurrent() == 17 ? "K" : "I") + spatialFormat.format(r))];
  } else {
    return [xOutput.format(x), yOutput.format(y),
      zOutput.format(z),
      conditional(r != 0, (gPlaneModal.getCurrent() == 17 ? "K" : "I") + spatialFormat.format(r))];
  }
}

 

What is nice about this is that for the first cycle point the post does reset the XZC output but not for the other times getCommonCycle is being called.

Laurens Wijnschenk
3DTechDraw

AutoDesk CAM user & Post editor.
Found out the hard way is the best way to win.


Message 5 of 5

arminooo
Contributor
Contributor

You are amazing!

0 Likes