Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Fanuc 0-T tool change position

Danvil9226
Enthusiast

Fanuc 0-T tool change position

Danvil9226
Enthusiast
Enthusiast

Hey  guys  i have  a  Topper lathe  running  an  old fanuc  o-t control.

It  doesnt  accept  G53, only uses  G28.

Is it  possible to adjust  the  post so my  tool  change  position is U0.0 W-8.O ( X0.  Z-8.0 ), so  it doesnt go all  the  way  home each  time?

I  attempted  to do it  myself and  changed  the  safe home position in the  post, but  it didnt work, just went  to  z-8.0 and then returned to home again.

I  tried  doing  it in the  user defined properties when posting  as  well,  but it  just  posts out a 0.0

 

While im at it,  I'll  throw  one more question in the  loop.

I have a 12" chuck on the lathe,  its oversized for the  machine, so i cant ramp  up from a dead stop.

Ive gotten around this by inputting a small  manual pass  through at the  front of my program  that ramps up slowly to  speed. Not sure  if there is  a different solution, if that something that  can   be  done in  the  post or not.

 

Appreciate  your guys  help  or  input.

Ive  attached my post

 

 

0 Likes
Reply
Accepted solutions (2)
715 Views
8 Replies
Replies (8)

serge.quiblier
Autodesk
Autodesk

Hi @Danvil9226 

 

It's because of the default behavior in the post.

When using G28, it will by default uses Z0 X0 always.

If you edit the post with a text editor, and serach for the function writeRetract, you can this this code piece:

  if (method == "G28") {
    _xHome = toPreciseUnit(0, MM);
    _yHome = toPreciseUnit(0, MM);
    _zHome = toPreciseUnit(0, MM);
  } else {
    _xHome = machineConfiguration.hasHomePositionX() ? machineConfiguration.getHomePositionX() : getProperty("homePositionX");
    _yHome = machineConfiguration.hasHomePositionY() ? machineConfiguration.getHomePositionY() : toPreciseUnit(0, MM);
    _zHome = machineConfiguration.getRetractPlane() != 0 ? machineConfiguration.getRetractPlane() : getProperty("homePositionZ");
  }

 

That means G28 is always X0 Y0 Z0.

You can replace all the code to this simpler version, allowing to define your home position in the properties and use it.

 

  _xHome = machineConfiguration.hasHomePositionX() ? machineConfiguration.getHomePositionX() : getProperty("homePositionX");
  _yHome = machineConfiguration.hasHomePositionY() ? machineConfiguration.getHomePositionY() : toPreciseUnit(0, MM);
  _zHome = machineConfiguration.getRetractPlane() != 0 ? machineConfiguration.getRetractPlane() : getProperty("homePositionZ");

 

Regards


______________________________________________________________

If my post answers your question, please click the "Accept Solution" button. This helps everyone find answers more quickly!



Serge.Q
Technical Consultant
cam.autodesk.com
0 Likes

Danvil9226
Enthusiast
Enthusiast

/** Output block to do safe retract and/or move to home position. */
var XZ = 4;
function writeRetract() {
var words = []; // store all retracted axes in an array
var singleLineRetract = false;
var retractAxes = []; // axes to retract
var method = getProperty("safePositionMethod");

// define home positions
var _xHome;
var _yHome;
var _zHome;
if (method == "G28") {
_xHome = toPreciseUnit(0, MM);
_yHome = toPreciseUnit(0, MM);
_zHome = toPreciseUnit(0, MM);
} else {
_xHome = machineConfiguration.hasHomePositionX() ? machineConfiguration.getHomePositionX() : getProperty("homePositionX");
_yHome = machineConfiguration.hasHomePositionY() ? machineConfiguration.getHomePositionY() : toPreciseUnit(0, MM);
_zHome = machineConfiguration.getRetractPlane() != 0 ? machineConfiguration.getRetractPlane() : getProperty("homePositionZ");
}

 

Thanks for the response Serge!

Above is my post what should I remove.

I tried deleting and keeping as you suggested but kept getting invalid post

0 Likes

serge.quiblier
Autodesk
Autodesk
Accepted solution
/** Output block to do safe retract and/or move to home position. */
var XZ = 4;
function writeRetract() {
  var words = []; // store all retracted axes in an array
  var singleLineRetract = false;
  var retractAxes = []; // axes to retract
  var method = getProperty("safePositionMethod");

  // define home positions
  var _xHome;
  var _yHome;
  var _zHome;
 
//Start of changes
    _xHome = machineConfiguration.hasHomePositionX() ? machineConfiguration.getHomePositionX() : getProperty("homePositionX");
    _yHome = machineConfiguration.hasHomePositionY() ? machineConfiguration.getHomePositionY() : toPreciseUnit(0, MM);
    _zHome = machineConfiguration.getRetractPlane() != 0 ? machineConfiguration.getRetractPlane() : getProperty("homePositionZ");
// end of changes

  if (arguments.length > 0) {
    for (var i in arguments) {
      retractAxes.push(arguments[i]);
      singleLineRetract = arguments[i] == XZ ? true : singleLineRetract;
    }
  } else {
    switch (getProperty("safePositionStyle")) {
    case "X":
      retractAxes.push(X);
      break;
    case "Z":
      retractAxes.push(Z);
      break;
    case "XZ":
      retractAxes.push(X, Z);
      break;
    case "ZX":
      retractAxes.push(Z, X);
      break;
    case "singleLineXZ":
      singleLineRetract = true;
      retractAxes.push(X, Z);
      break;
    }
  }

  // format home positions
  for (var i = 0; i < retractAxes.length; ++i) {
    switch (retractAxes[i]) {
    case X:
      words.push((method == "G28" ? "U" : "X") + xFormat.format(_xHome));
      retracted[X] = true;
      xOutput.reset();
      break;
    case Y:
      if (yOutput.isEnabled()) {
        words.push((method == "G28" ? "V" : "Y") + yFormat.format(_yHome));
        yOutput.reset();
      }
      break;
    case Z:
      words.push((method == "G28" ? "W" : "Z") + zFormat.format(_zHome));
      retracted[Z] = true;
      zOutput.reset();
      break;
    case XZ:
      words.push((method == "G28" ? "U" : "X") + xFormat.format(_xHome));
      words.push((method == "G28" ? "W" : "Z") + zFormat.format(_zHome));
      retracted[X] = true;
      retracted[Z] = true;
      xOutput.reset();
      zOutput.reset();
      break;
    default:
      error(localize("Unsupported axis specified for writeRetract()."));
      return;
    }
  }
  for (var i = 0; i < words.length; ++i) {
    switch (method) {
    case "G28":
      gAbsIncModal.reset();
      writeBlock(gFormat.format(28), singleLineRetract ? words : words[i]);
      break;
    case "G53":
      gMotionModal.reset();
      writeBlock(gFormat.format(53), gMotionModal.format(0), singleLineRetract ? words : words[i]);
      break;
    default:
      error(localize("Unsupported safe position method."));
      return;
    }
    if (singleLineRetract) {
      break;
    }
  }
  singleLineRetract = false; // singleLineRetract reset
}


Serge.Q
Technical Consultant
cam.autodesk.com
0 Likes

Danvil9226
Enthusiast
Enthusiast

Okay that worked.

I'm able to modify the G28 in Post properties via preferences.

Its still not doing what i want though, I spent all day trying to Fiddle change and figure it out, Im missing something.

 

Is it possible to post G28 Just at the start of the Program and at the Very End, and then G00 to a defined Toolchange position instead of G28

0 Likes

Danvil9226
Enthusiast
Enthusiast
Accepted solution

Oooookay what a learning curve:upside_down_face: , First time editing a post, but I got it.

Here is the post, works great, but obviously use at your own caution.

Gives you an option in Preferences for a Tool change via G28 or G0 in X or Z.

G28 defaults to U0. W0. 

G00 you can edit both distances.

 

I used the WriteRetract function as a template, re labelled it and made seperate functions for functions for X and Z

 

If anyone has a solution for my Big chuck problem that would be awesome haha

right now i Manual pass through the following code at the beginning of my program to help bring the chuck to speed.

 

(SPINDLE STARTUP)

G97 S300 M3

G04P1000

G97 S400 M3

G04P1000

G97 S500 M3

G04P1000

G97 S600 M3

G04P1000

G97 S700 M3

G04 P1000

G97 S750 M3

G04 P2000

0 Likes

serge.quiblier
Autodesk
Autodesk

Hi @Danvil9226 

 

Open your post with a text editor.

Search for the startSpindle function.

Inside the startSpindle function, in the branch outputting the G97 command, we can change the code.
Piece of code before the change :

  if (getSpindle(true) == SPINDLE_SECONDARY) {
    writeBlock(
      spindleMode,
      sOutput.format(_spindleSpeed),
      spindleDir
    );
  } else {
    writeBlock(
      spindleMode,
      sOutput.format(_spindleSpeed),
      spindleDir
    );
  }

 

Let's add some logic for gradually speed up the spindle.

After the change, the same piece of code is now:

.  if (getSpindle(true) == SPINDLE_SECONDARY) {
    writeBlock(
      spindleMode,
      sOutput.format(_spindleSpeed),
      spindleDir
    );
  } else {
    var startSpindleSpeed = 300;
    var spindleIncrement = 100;
    var tempSpindleSpeed = startSpindleSpeed;

    while (tempSpindleSpeed < _spindleSpeed+spindleIncrement) {
      writeBlock(
        spindleMode,
        sOutput.format(tempSpindleSpeed),
        spindleDir
      );
      writeBlock(gFormat.format(4), "P" + milliFormat.format(1000));
      tempSpindleSpeed +=spindleIncrement;
    }
    writeBlock(
      spindleMode,
      sOutput.format(_spindleSpeed),
      spindleDir
    );
  }

 

Regards.


______________________________________________________________

If my post answers your question, please click the "Accept Solution" button. This helps everyone find answers more quickly!

 



Serge.Q
Technical Consultant
cam.autodesk.com
0 Likes

Danvil9226
Enthusiast
Enthusiast

Thanks Serge! Its all working ! nice not having to remember to input the manual lines.

 

It Drops the spindle speed down to 300 and ramps up on every tool change, is it possible to only ramp up only when the programmed Rpm is dropped, so its constant through out all tool changes? if that's out of reach I can understand.

0 Likes

serge.quiblier
Autodesk
Autodesk

Hi @Danvil9226 

 

Can you share a small gcode showing your intent?

Just the few lines around the tool change, with the ramp up or down showing?

 

Regards.



Serge.Q
Technical Consultant
cam.autodesk.com
0 Likes