repetier / Repetier-Firmware

Firmware for Arduino based RepRap 3D printer.
815 stars 734 forks source link

ZHOME_PRE_RAISE value #1068

Closed nukem closed 3 years ago

nukem commented 3 years ago

Setting ZHOME_PRE_RAISE = 1 does nothing and you need to set the value to 2 to make it work. The code doesn't use the value 1, it's confusing. I am using dev2

repetier commented 3 years ago

From the docs homing page: https://docfirmwarev2.repetier.com/config/homing So with ZHOME_PRE_RAISE you define if and when you want to raise the tool before homing axes. 0 disables it, 1 will raise only if z min end stop is triggered and 2 will always raise.

So unless you had z min triggered that behaviour is correct.

Code is

#if ZHOME_PRE_RAISE
    // float zAmountRaised = 0;
    if (ZHOME_PRE_RAISE == 2
        || (Motion1::minAxisEndstops[Z_AXIS] && Motion1::minAxisEndstops[Z_AXIS]->update())) {
        if (!isAxisHomed(Z_AXIS) || currentPosition[Z_AXIS] + ZHOME_PRE_RAISE_DISTANCE < maxPos[Z_AXIS]) {
            setTmpPositionXYZ(IGNORE_COORDINATE, IGNORE_COORDINATE, ZHOME_PRE_RAISE_DISTANCE);
            moveRelativeByOfficial(tmpPosition, homingFeedrate[Z_AXIS], false);
            waitForEndOfMoves();
            // zAmountRaised = ZHOME_PRE_RAISE_DISTANCE;
        }
    }
#endif 

And you see 1 is needed to come inside the #if condition.