May be the problem is caused because I do only one cycle at a time (but doing 3 times the G32 via starting script.
I crawled into the source code, adding a maxdiff with "do no correction under 0.05 maxdiff" and multiplying the h2 and h3 - height correction for the motors, by 1.5.
And I use the direct measured values for h1, h2, h3 (declared in global scope):
Works for me, but is not very elegant. Should have used at least the EEProm instead of h1,h2,h3.
Seems that there is no way to mask a ZMin-Endstop-before-Z-Probe-Event. With badly distorted bed's one probably need a switch to bypass the Z-min endstop. (yeah, we should all home to zmax. I dont't want to. Homing Z min after G32 and having a good adjustable endstop is just to nice to have).
Here the changed snipplets form BedLevelling.cpp:
#if BED_LEVELING_METHOD == 0 // 3 point
float h;
Printer::moveTo(EEPROM::zProbeX1(),EEPROM::zProbeY1(),IGNORE_COORDINATE,IGNORE_COORDINATE,EEPROM::zProbeXYSpeed());
h = Printer::runZProbe(false,false);
if(h == ILLEGAL_Z_PROBE)
return false;
builder.addPoint(EEPROM::zProbeX1(),EEPROM::zProbeY1(),h);
h2=h;
Printer::moveTo(EEPROM::zProbeX2(),EEPROM::zProbeY2(),IGNORE_COORDINATE,IGNORE_COORDINATE,EEPROM::zProbeXYSpeed());
h = Printer::runZProbe(false,false);
if(h == ILLEGAL_Z_PROBE)
return false;
builder.addPoint(EEPROM::zProbeX2(),EEPROM::zProbeY2(),h);
h3=h;
Printer::moveTo(EEPROM::zProbeX3(),EEPROM::zProbeY3(),IGNORE_COORDINATE,IGNORE_COORDINATE,EEPROM::zProbeXYSpeed());
h = Printer::runZProbe(false,false);
if(h == ILLEGAL_Z_PROBE)
return false;
h1=h;
[...]
void correctAutolevel(GCode *code,Plane &plane) {
#if BED_CORRECTION_METHOD == 0 // rotation matrix
//Printer::buildTransformationMatrix(plane.z(EEPROM::zProbeX1(),EEPROM::zProbeY1()),plane.z(EEPROM::zProbeX2(),EEPROM::zProbeY2()),plane.z(EEPROM::zProbeX3(),EEPROM::zProbeY3()));
Printer::buildTransformationMatrix(plane);
#elif BED_CORRECTION_METHOD == 1 // motorized correction
#if !defined(NUM_MOTOR_DRIVERS) || NUM_MOTOR_DRIVERS < 2
#error You need to define 2 motors for motorized bed correction
#endif
Commands::waitUntilEndOfAllMoves(); // move steppers might be leveling steppers as well !
//the usual way, but not to overwrite our h1, h2, h3:
float h11 = plane.z(BED_MOTOR_1_X,BED_MOTOR_1_Y);
float h22 = plane.z(BED_MOTOR_2_X,BED_MOTOR_2_Y);
float h32 = plane.z(BED_MOTOR_3_X,BED_MOTOR_3_Y);
h22 -= h11;
h32 -= h11;
//Com::printFLN(PSTR(" h1 plane = "),h11,4);
//Com::printFLN(PSTR(" h2 plane = "),h22,4);
//Com::printFLN(PSTR(" h3 plane = "),h32,4);
// h1 is reference heights, h2 => motor 0, h3 => motor 1
h2 -= h1;
h3 -= h1;
//h2=h22;
//h3=h32;
h2=h2+h2/2.0;
h3=h3+h3/2.0;
Com::printFLN(PSTR(" h1 = "),h1,4);
Com::printFLN(PSTR(" h2 = "),h2,4);
Com::printFLN(PSTR(" h3 = "),h3,4);
float maxdiff;
float absh2 = abs(h2);
float absh3 = abs(h3);
if (absh3>absh2) maxdiff= absh3;
else maxdiff = absh2;
Com::printFLN(PSTR(" MaxDiff left: = "),maxdiff,4);
if (maxdiff<0.06) { //ready!
Com::printFLN(PSTR(" Ready, diff left: = "),maxdiff,4);
return;
}