G28 First home after power on/reset VS Second home REPETIER_VERSION "1.0.2"

Hi,

I'm using v 1.0.2 and while trying to get a custom homing sequence to work I notice it would fail on the first try.

Basically I have hijacked the G28 command to call the original G28 command (renamed to G2828).
The idea is to;
HOME X
Move X30
HOME Y
Move Y250
HOME Z
Move Z30

I need to do this otherwise the bed crashes into the nozzles (converting a Stratasys uPrint).

I have tried multiple methods and below you can see three of them, "GCode::executeFString(PSTR(""));" as a string and separate commands to call G28 with the parameters or "Printer::homeAxis(,,);" directly.

On the first power on/reset G28;
-The X homes correctly but does not move to X30.
-The Y homes correctly but does not move to Y250 (Tried different values and speeds, doesn't matter where the home action started or how many commands are sent, it will not move).
-The Z homes (crashes into nozzles) and moves to a fake Z30.

On the second G28;
-X homes and moves to X30
-Y homes and moves to Y250
-Z homes and moves to Z30

Why can I issue a G1 to the Z axis after homing but not the X and Y axis on the first Power on/reset?
All three axis are configured the same except for Steps/mm.
Basically I'm homing them sequentially so why can I send the G1 only after all 3 axis have been homed?

Video of the issue (Ignore the jerky moves, those are extra commands I've been testing to try go move the XY axis) https://www.youtube.com/watch?v=U21lkp9twa8
 
    case 28: { //G28 Home all Axis one at a time

//GCode::executeFString(PSTR("G2828 X0\nG1 X30\nG2828 Y0\nG1 Y200\nG2828 Z0\nG1 Z30"));

//GCode::executeFString(PSTR("G2828 X0"));
//GCode::executeFString(PSTR("G1 X30"));

//GCode::executeFString(PSTR("G2828 Y0"));
//GCode::executeFString(PSTR("G1 Y200"));

//GCode::executeFString(PSTR("G2828 Z0"));
//GCode::executeFString(PSTR("G1 Z30"));*/

Printer::homeAxis(1,0,0);
GCode::executeFString(PSTR("G1 X130"));

Printer::homeAxis(0,1,0);
GCode::executeFString(PSTR("G1 Y250"));

Printer::homeAxis(0,0,1);
GCode::executeFString(PSTR("G1 Z30"));
}
break;
case 2828: { //G28 Home all Axis one at a time
uint8_t homeAllAxis = (com->hasNoXYZ() && !com->hasE());
if(com->hasE())
Printer::currentPositionSteps[E_AXIS] = 0;
if(homeAllAxis || !com->hasNoXYZ())
Printer::homeAxis(homeAllAxis || com->hasX(), homeAllAxis || com->hasY(), homeAllAxis || com->hasZ());
}
break;
Thanks for any input with this!





Comments

  • Check that you have
    #define MOVE_X_WHEN_HOMED 0
    #define MOVE_Y_WHEN_HOMED 0
    #define MOVE_Z_WHEN_HOMED 0

    so moves are possible without homing.
    Also add S1 to G1 moves to disable boundary check. Enable it after homing.

    Are these coordinates within official boundaries? If not that would explain why they get ignored.
  • Hi,

    Tried the setting the MOVE_*_WHEN_HOMED but had no effect. Also tested calling "void setXHomed(", "void updateHomedAll(" but still no effect.
    Tried setting G1 S1 before and disabling after homing and worked a charm!

    All coordinates are normal and not outside of boundaries or endstops. I really need to force the printer to home in a certain sequence or it will snap the Z probe and/or the nozzle toggle mechanism levers;

        case 28: { //G28 Home all Axis one at a time
    uint8_t homeAllAxis = (com->hasNoXYZ() && !com->hasE());
    if(com->hasE())
    Printer::currentPositionSteps[E_AXIS] = 0;
    if(homeAllAxis || !com->hasNoXYZ()){
    GCode::executeFString(PSTR("G1 S1"));
    Printer::homeAxis(1,0,0);
    GCode::executeFString(PSTR("G1 X30"));
    Printer::homeAxis(0,1,0);
    GCode::executeFString(PSTR("G1 Y250"));
    Printer::homeAxis(0,0,1);
    GCode::executeFString(PSTR("G1 Z30"));
    GCode::executeFString(PSTR("G1 S0"));
    //Printer::homeAxis(homeAllAxis || com->hasX(), homeAllAxis || com->hasY(), homeAllAxis || com->hasZ());
    }
    }
    break;

    Thanks the quick and great help as usual!
Sign In or Register to comment.