|
|
|
@ -809,14 +809,10 @@ static void set_bed_level_equation_lsq(double *plane_equation_coefficients)
|
|
|
|
|
plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal);
|
|
|
|
|
//bedLevel.debug("bedLevel");
|
|
|
|
|
|
|
|
|
|
plan_bed_level_matrix.debug("bed level before");
|
|
|
|
|
//plan_bed_level_matrix.debug("bed level before");
|
|
|
|
|
//vector_3 uncorrected_position = plan_get_position_mm();
|
|
|
|
|
//uncorrected_position.debug("position before");
|
|
|
|
|
|
|
|
|
|
// and set our bed level equation to do the right thing
|
|
|
|
|
// plan_bed_level_matrix = matrix_3x3::create_inverse(bedLevel);
|
|
|
|
|
// plan_bed_level_matrix.debug("bed level after");
|
|
|
|
|
|
|
|
|
|
vector_3 corrected_position = plan_get_position();
|
|
|
|
|
// corrected_position.debug("position after");
|
|
|
|
|
current_position[X_AXIS] = corrected_position.x;
|
|
|
|
@ -824,7 +820,7 @@ static void set_bed_level_equation_lsq(double *plane_equation_coefficients)
|
|
|
|
|
current_position[Z_AXIS] = corrected_position.z;
|
|
|
|
|
|
|
|
|
|
// but the bed at 0 so we don't go below it.
|
|
|
|
|
current_position[Z_AXIS] = -Z_PROBE_OFFSET_FROM_EXTRUDER; // in the lsq we reach here after raising the extruder due to the loop structure
|
|
|
|
|
current_position[Z_AXIS] = -Z_PROBE_OFFSET_FROM_EXTRUDER;
|
|
|
|
|
|
|
|
|
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
|
|
}
|
|
|
|
|