Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
serge.quiblier
in reply to: Danvil9226

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