Skip to content

Commit

Permalink
Fix XYZ calibration for non Bondtech LGX extruders (hopefully)
Browse files Browse the repository at this point in the history
  • Loading branch information
shyblower committed Oct 16, 2022
1 parent 0e4b027 commit 8e7dea5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
25 changes: 18 additions & 7 deletions Firmware/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2340,10 +2340,17 @@ bool calibrate_z_auto()
plan_buffer_line_destinationXYZE(feedrate / 60);
st_synchronize();
enable_endstops(endstops_enabled);
#ifdef BONDTECH_LGX_SC
#if defined(BONDTECH_LGX_SC)
current_position[Z_AXIS] = Z_MAX_POS + 4.0;
#else
#elif defined(BONDTECH_LGX_SM)
current_position[Z_AXIS] = Z_MAX_POS + 7.0;
#else
if (PRINTER_TYPE == PRINTER_MK3) {
current_position[Z_AXIS] = Z_MAX_POS + 2.0;
}
else {
current_position[Z_AXIS] = Z_MAX_POS + 9.0;
}
#endif
plan_set_position_curposXYZE();
return true;
Expand Down Expand Up @@ -3889,19 +3896,23 @@ void gcode_M701()
#endif //FSENSOR_QUALITY

lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT));
#ifdef BONDTECH_LGX_SC
#if defined(BONDTECH_LGX_SC)
current_position[E_AXIS] += 20;
#else
#elif defined(BONDTECH_LGX_SM)
current_position[E_AXIS] += 23;
#else
current_position[E_AXIS] += 40;
#endif
plan_buffer_line_curposXYZE(400 / 60); //fast sequence
st_synchronize();

raise_z_above(MIN_Z_FOR_LOAD, false);
#ifdef BONDTECH_LGX_SC
raise_z_above(MIN_Z_FOR_LOAD, false);
#if defined(BONDTECH_LGX_SC)
current_position[E_AXIS] += 20;
#else
#elif defined(BONDTECH_LGX_SM)
current_position[E_AXIS] += 23;
#else
current_position[E_AXIS] += 30;
#endif
plan_buffer_line_curposXYZE(400 / 60); //fast sequence

Expand Down
11 changes: 9 additions & 2 deletions Firmware/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3353,10 +3353,17 @@ bool lcd_calibrate_z_end_stop_manual(bool only_z)
calibrated:
// Let the machine think the Z axis is a bit higher than it is, so it will not home into the bed
// during the search for the induction points.
#ifndef BONDTECH_LGX_SC
#if defined(BONDTECH_LGX_SC)
current_position[Z_AXIS] = Z_MAX_POS-1.f;
#else
#elif defined(BONDTECH_LGX_SM)
current_position[Z_AXIS] = Z_MAX_POS+2.f;
#else
if ((PRINTER_TYPE == PRINTER_MK25) || (PRINTER_TYPE == PRINTER_MK2) || (PRINTER_TYPE == PRINTER_MK2_SNMM)) {
current_position[Z_AXIS] = Z_MAX_POS-3.f;
}
else {
current_position[Z_AXIS] = Z_MAX_POS+4.f;
}
#endif

plan_set_position_curposXYZE();
Expand Down

0 comments on commit 8e7dea5

Please sign in to comment.