Unfortunately I double and triple checked that they were using the same z invert settings. I'll do another test later and take a video to show how it's moving.
In the meantime, I was reading through the leveling code but was having a hard time pulling the math involved out of the code because all the pointers and function calls involved. Would you be able to explain using variable names how you expect the math to work?
Observing the leveling function run it seemed to measure the 9 points in the 3x3 grid I defined staring at the front left of my machine and ending in the back right. Then, while still in the back right it begins adjusting the individual z screws seemingly at the same time but maybe it's just switching very quickly. My confusion comes because for the way in which the bed is unlevel, it's adjustments are moving z screws that were out of line, further out of line rather than closer. At first I thought I may have put an invert signal in incorrectly but I'm now sure that isn't the case so I'm thinking maybe I'm pointing to the screws incorrectly for how the math is defined. For example maybe I've mistakenly told your code that my front right screw is the back left screw which I imagine would cause issues with the math. Here's the current copy of my correctAutoLevel function after adding the 4th screw definitions. Maybe you'll be able to see whatever mistake it is I'm making. I'll attach the full BedLeveling.cpp just in case but I believe I've only made changes to this one function.
void correctAutolevel(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 < 3
#error You need to define 3 motors for 4 screw motorized bed correction
#endif
Commands::waitUntilEndOfAllMoves(); // move steppers might be leveling steppers as well !
float h1 = plane.z(BED_MOTOR_1_X,BED_MOTOR_1_Y);
float h2 = plane.z(BED_MOTOR_2_X,BED_MOTOR_2_Y);
float h3 = plane.z(BED_MOTOR_3_X,BED_MOTOR_3_Y);
float h4 = plane.z(BED_MOTOR_4_X,BED_MOTOR_4_Y);
// h1 is reference heights, h2 => motor 0, h3 => motor 1, h4 => motor 2
h2 -= h1;
h3 -= h1;
h4 -= h1;
#if defined(LIMIT_MOTORIZED_CORRECTION)
if(h2 < -LIMIT_MOTORIZED_CORRECTION) h2 = -LIMIT_MOTORIZED_CORRECTION;
if(h2 > LIMIT_MOTORIZED_CORRECTION) h2 = LIMIT_MOTORIZED_CORRECTION;
if(h3 < -LIMIT_MOTORIZED_CORRECTION) h3 = -LIMIT_MOTORIZED_CORRECTION;
if(h3 > LIMIT_MOTORIZED_CORRECTION) h3 = LIMIT_MOTORIZED_CORRECTION;
if(h4 < -LIMIT_MOTORIZED_CORRECTION) h4 = -LIMIT_MOTORIZED_CORRECTION;
if(h4 > LIMIT_MOTORIZED_CORRECTION) h4 = LIMIT_MOTORIZED_CORRECTION;
#endif
MotorDriverInterface *motor2 = getMotorDriver(0);
MotorDriverInterface *motor3 = getMotorDriver(1);
MotorDriverInterface *motor4 = getMotorDriver(2);
motor2->setCurrentAs(0);
motor3->setCurrentAs(0);
motor4->setCurrentAs(0);
motor2->gotoPosition(h2);
motor3->gotoPosition(h3);
motor4->gotoPosition(h4);
motor2->disable();
motor3->disable();
motor4->disable(); // now bed is even
Printer::currentPositionSteps[Z_AXIS] = h1 * Printer::axisStepsPerMM[Z_AXIS];
#if NONLINEAR_SYSTEM
transformCartesianStepsToDeltaSteps(Printer::currentPositionSteps, Printer::currentNonlinearPositionSteps);
#endif
#else
#error Unknown bed correction method set
#endif
}
And here's the Z-Probing section of my Configuration.h, I believe everything here is defined properly.
// #################### Z-Probing #####################
#define Z_PROBE_Z_OFFSET 0
#define Z_PROBE_Z_OFFSET_MODE 0
#define UI_BED_COATING 1
#define FEATURE_Z_PROBE 1
#define EXTRUDER_IS_Z_PROBE 0
#define Z_PROBE_DISABLE_HEATERS 0
#define Z_PROBE_BED_DISTANCE 10
#define Z_PROBE_PIN ORIG_Z_MIN_PIN
#define Z_PROBE_PULLUP 0
#define Z_PROBE_ON_HIGH 1
#define Z_PROBE_X_OFFSET -38
#define Z_PROBE_Y_OFFSET 0
#define Z_PROBE_WAIT_BEFORE_TEST 0
#define Z_PROBE_SPEED 3
#define Z_PROBE_XY_SPEED 100
#define Z_PROBE_SWITCHING_DISTANCE 8
#define Z_PROBE_REPETITIONS 3
#define Z_PROBE_USE_MEDIAN 0
#define Z_PROBE_HEIGHT 0
#define Z_PROBE_DELAY 0
#define Z_PROBE_START_SCRIPT ""
#define Z_PROBE_FINISHED_SCRIPT ""
#define Z_PROBE_RUN_AFTER_EVERY_PROBE ""
#define Z_PROBE_REQUIRES_HEATING 0
#define Z_PROBE_MIN_TEMPERATURE 150
#define FEATURE_AUTOLEVEL 1
#define FEATURE_SOFTWARE_LEVELING 0
#define Z_PROBE_X1 25
#define Z_PROBE_Y1 25
#define Z_PROBE_X2 280
#define Z_PROBE_Y2 25
#define Z_PROBE_X3 25
#define Z_PROBE_Y3 280
#define BED_LEVELING_METHOD 1
#define BED_CORRECTION_METHOD 1
#define BED_LEVELING_GRID_SIZE 3
#define BED_LEVELING_REPETITIONS 5
#define BED_MOTOR_1_X -57.087
#define BED_MOTOR_1_Y -73.47
#define BED_MOTOR_2_X -57.087
#define BED_MOTOR_2_Y 378.397
#define BED_MOTOR_3_X 362.014
#define BED_MOTOR_3_Y 378.397
#define BED_MOTOR_4_X 362.014
#define BED_MOTOR_4_Y -73.470
#define BENDING_CORRECTION_A 0
#define BENDING_CORRECTION_B 0
#define BENDING_CORRECTION_C 0
#define FEATURE_AXISCOMP 0
#define AXISCOMP_TANXY 0
#define AXISCOMP_TANYZ 0
#define AXISCOMP_TANXZ 0
and here's the full BedLeveling.cpp