"Calibrate Z" was redefined to let the user move the X axis up
to the Z end stoppers and to re-calibrate the 9 bed point reference values after the printer has been re-seated or transported. New "Mesh Bed Leveling" function was added to the menu, doing what the "Calibrate Z" was doing before.
This commit is contained in:
parent
f9f9912fff
commit
32c8e9c2dc
|
|
@ -235,11 +235,6 @@ byte b[2];
|
||||||
int value;
|
int value;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BABYSTEP_LOADZ_BY_PLANNER
|
|
||||||
|
|
||||||
// Number of baby steps applied
|
|
||||||
int babystepLoadZ = 0;
|
|
||||||
|
|
||||||
float homing_feedrate[] = HOMING_FEEDRATE;
|
float homing_feedrate[] = HOMING_FEEDRATE;
|
||||||
// Currently only the extruder axis may be switched to a relative mode.
|
// Currently only the extruder axis may be switched to a relative mode.
|
||||||
// Other axes are always absolute or relative based on the common relative_mode flag.
|
// Other axes are always absolute or relative based on the common relative_mode flag.
|
||||||
|
|
@ -1921,12 +1916,7 @@ void process_commands()
|
||||||
|
|
||||||
// Reset baby stepping to zero, if the babystepping has already been loaded before. The babystepsTodo value will be
|
// Reset baby stepping to zero, if the babystepping has already been loaded before. The babystepsTodo value will be
|
||||||
// consumed during the first movements following this statement.
|
// consumed during the first movements following this statement.
|
||||||
#ifdef BABYSTEP_LOADZ_BY_PLANNER
|
babystep_undo();
|
||||||
shift_z(float(babystepLoadZ) / float(axis_steps_per_unit[Z_AXIS]));
|
|
||||||
#else
|
|
||||||
babystepsTodoZsubtract(babystepLoadZ);
|
|
||||||
#endif /* BABYSTEP_LOADZ_BY_PLANNER */
|
|
||||||
babystepLoadZ = 0;
|
|
||||||
|
|
||||||
saved_feedrate = feedrate;
|
saved_feedrate = feedrate;
|
||||||
saved_feedmultiply = feedmultiply;
|
saved_feedmultiply = feedmultiply;
|
||||||
|
|
@ -2103,11 +2093,8 @@ void process_commands()
|
||||||
#ifndef MESH_BED_LEVELING
|
#ifndef MESH_BED_LEVELING
|
||||||
// If MESH_BED_LEVELING is not active, then it is the original Prusa i3.
|
// If MESH_BED_LEVELING is not active, then it is the original Prusa i3.
|
||||||
// Offer the user to load the baby step value, which has been adjusted at the previous print session.
|
// Offer the user to load the baby step value, which has been adjusted at the previous print session.
|
||||||
if(card.sdprinting) {
|
if(card.sdprinting && eeprom_read_word((uint16_t *)EEPROM_BABYSTEP_Z))
|
||||||
EEPROM_read_B(EEPROM_BABYSTEP_Z,&babystepLoadZ);
|
|
||||||
if(babystepLoadZ != 0)
|
|
||||||
lcd_adjust_z();
|
lcd_adjust_z();
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Load the machine correction matrix
|
// Load the machine correction matrix
|
||||||
|
|
@ -2368,12 +2355,7 @@ void process_commands()
|
||||||
|
|
||||||
// Reset baby stepping to zero, if the babystepping has already been loaded before. The babystepsTodo value will be
|
// Reset baby stepping to zero, if the babystepping has already been loaded before. The babystepsTodo value will be
|
||||||
// consumed during the first movements following this statement.
|
// consumed during the first movements following this statement.
|
||||||
#ifdef BABYSTEP_LOADZ_BY_PLANNER
|
babystep_undo();
|
||||||
shift_z(float(babystepLoadZ) / float(axis_steps_per_unit[Z_AXIS]));
|
|
||||||
#else
|
|
||||||
babystepsTodoZsubtract(babystepLoadZ);
|
|
||||||
#endif /* BABYSTEP_LOADZ_BY_PLANNER */
|
|
||||||
babystepLoadZ = 0;
|
|
||||||
|
|
||||||
// Cycle through all points and probe them
|
// Cycle through all points and probe them
|
||||||
// First move up. During this first movement, the babystepping will be reverted.
|
// First move up. During this first movement, the babystepping will be reverted.
|
||||||
|
|
@ -2460,28 +2442,7 @@ void process_commands()
|
||||||
clean_up_after_endstop_move();
|
clean_up_after_endstop_move();
|
||||||
|
|
||||||
// Apply Z height correction aka baby stepping before mesh bed leveing gets activated.
|
// Apply Z height correction aka baby stepping before mesh bed leveing gets activated.
|
||||||
if(card.sdprinting || is_usb_printing )
|
babystep_apply();
|
||||||
{
|
|
||||||
if(eeprom_read_byte((unsigned char*)EEPROM_BABYSTEP_Z_SET) == 0x01)
|
|
||||||
{
|
|
||||||
// End of G80: Apply the baby stepping value.
|
|
||||||
EEPROM_read_B(EEPROM_BABYSTEP_Z,&babystepLoadZ);
|
|
||||||
#if 0
|
|
||||||
SERIAL_ECHO("Z baby step: ");
|
|
||||||
SERIAL_ECHO(babystepLoadZ);
|
|
||||||
SERIAL_ECHO(", current Z: ");
|
|
||||||
SERIAL_ECHO(current_position[Z_AXIS]);
|
|
||||||
SERIAL_ECHO("correction: ");
|
|
||||||
SERIAL_ECHO(float(babystepLoadZ) / float(axis_steps_per_unit[Z_AXIS]));
|
|
||||||
SERIAL_ECHOLN("");
|
|
||||||
#endif
|
|
||||||
#ifdef BABYSTEP_LOADZ_BY_PLANNER
|
|
||||||
shift_z(- float(babystepLoadZ) / float(axis_steps_per_unit[Z_AXIS]));
|
|
||||||
#else
|
|
||||||
babystepsTodoZadd(babystepLoadZ);
|
|
||||||
#endif /* BABYSTEP_LOADZ_BY_PLANNER */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool eeprom_bed_correction_valid = eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1;
|
bool eeprom_bed_correction_valid = eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1;
|
||||||
for (uint8_t i = 0; i < 4; ++ i) {
|
for (uint8_t i = 0; i < 4; ++ i) {
|
||||||
|
|
@ -2938,46 +2899,68 @@ void process_commands()
|
||||||
// the planner will not perform any adjustments in the XY plane.
|
// the planner will not perform any adjustments in the XY plane.
|
||||||
// Wait for the motors to stop and update the current position with the absolute values.
|
// Wait for the motors to stop and update the current position with the absolute values.
|
||||||
world2machine_revert_to_uncorrected();
|
world2machine_revert_to_uncorrected();
|
||||||
|
// Reset the baby step value applied without moving the axes.
|
||||||
|
babystep_reset();
|
||||||
|
// Mark all axes as in a need for homing.
|
||||||
|
memset(axis_known_position, 0, sizeof(axis_known_position));
|
||||||
// Let the user move the Z axes up to the end stoppers.
|
// Let the user move the Z axes up to the end stoppers.
|
||||||
if (lcd_calibrate_z_end_stop_manual()) {
|
if (lcd_calibrate_z_end_stop_manual()) {
|
||||||
refresh_cmd_timeout();
|
refresh_cmd_timeout();
|
||||||
|
|
||||||
// Move the print head close to the bed.
|
// Move the print head close to the bed.
|
||||||
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
||||||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS],current_position[Z_AXIS] , current_position[E_AXIS], homing_feedrate[Z_AXIS]/40, active_extruder);
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS],current_position[Z_AXIS] , current_position[E_AXIS], homing_feedrate[Z_AXIS]/40, active_extruder);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
// Home in the XY plane.
|
// Home in the XY plane.
|
||||||
set_destination_to_current();
|
set_destination_to_current();
|
||||||
setup_for_endstop_move();
|
setup_for_endstop_move();
|
||||||
home_xy();
|
home_xy();
|
||||||
|
|
||||||
int8_t verbosity_level = 0;
|
int8_t verbosity_level = 0;
|
||||||
if (code_seen('V')) {
|
if (code_seen('V')) {
|
||||||
// Just 'V' without a number counts as V1.
|
// Just 'V' without a number counts as V1.
|
||||||
char c = strchr_pointer[1];
|
char c = strchr_pointer[1];
|
||||||
verbosity_level = (c == ' ' || c == '\t' || c == 0) ? 1 : code_value_short();
|
verbosity_level = (c == ' ' || c == '\t' || c == 0) ? 1 : code_value_short();
|
||||||
}
|
}
|
||||||
BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level);
|
|
||||||
uint8_t point_too_far_mask = 0;
|
if (code_seen('Z')) {
|
||||||
clean_up_after_endstop_move();
|
clean_up_after_endstop_move();
|
||||||
// Print head up.
|
// Z only calibration.
|
||||||
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
// Load the machine correction matrix
|
||||||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS],current_position[Z_AXIS] , current_position[E_AXIS], homing_feedrate[Z_AXIS]/40, active_extruder);
|
world2machine_initialize();
|
||||||
st_synchronize();
|
// and correct the current_position to match the transformed coordinate system.
|
||||||
if (result >= 0) {
|
world2machine_update_current();
|
||||||
// Second half: The fine adjustment.
|
//FIXME
|
||||||
// Let the planner use the uncorrected coordinates.
|
bool result = sample_mesh_and_store_reference();
|
||||||
mbl.reset();
|
// if (result) babystep_apply();
|
||||||
world2machine_reset();
|
} else {
|
||||||
// Home in the XY plane.
|
// Complete XYZ calibration.
|
||||||
setup_for_endstop_move();
|
BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level);
|
||||||
home_xy();
|
uint8_t point_too_far_mask = 0;
|
||||||
result = improve_bed_offset_and_skew(1, verbosity_level, point_too_far_mask);
|
|
||||||
clean_up_after_endstop_move();
|
clean_up_after_endstop_move();
|
||||||
// Print head up.
|
// Print head up.
|
||||||
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
||||||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS],current_position[Z_AXIS] , current_position[E_AXIS], homing_feedrate[Z_AXIS]/40, active_extruder);
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS],current_position[Z_AXIS] , current_position[E_AXIS], homing_feedrate[Z_AXIS]/40, active_extruder);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
if (result >= 0) {
|
||||||
|
// Second half: The fine adjustment.
|
||||||
|
// Let the planner use the uncorrected coordinates.
|
||||||
|
mbl.reset();
|
||||||
|
world2machine_reset();
|
||||||
|
// Home in the XY plane.
|
||||||
|
setup_for_endstop_move();
|
||||||
|
home_xy();
|
||||||
|
result = improve_bed_offset_and_skew(1, verbosity_level, point_too_far_mask);
|
||||||
|
clean_up_after_endstop_move();
|
||||||
|
// Print head up.
|
||||||
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
||||||
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS],current_position[Z_AXIS] , current_position[E_AXIS], homing_feedrate[Z_AXIS]/40, active_extruder);
|
||||||
|
st_synchronize();
|
||||||
|
// if (result >= 0) babystep_apply();
|
||||||
|
}
|
||||||
|
lcd_bed_calibration_show_result(result, point_too_far_mask);
|
||||||
}
|
}
|
||||||
lcd_bed_calibration_show_result(result, point_too_far_mask);
|
|
||||||
} else {
|
} else {
|
||||||
// Timeouted.
|
// Timeouted.
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1085,6 +1085,11 @@ const char * const MSG_MAX_LANG_TABLE[1] PROGMEM = {
|
||||||
MSG_MAX_EN
|
MSG_MAX_EN
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const char MSG_MESH_BED_LEVELING_EN[] PROGMEM = "Mesh Bed Leveling";
|
||||||
|
const char * const MSG_MESH_BED_LEVELING_LANG_TABLE[1] PROGMEM = {
|
||||||
|
MSG_MESH_BED_LEVELING_EN
|
||||||
|
};
|
||||||
|
|
||||||
const char MSG_MIN_EN[] PROGMEM = " \002 Min";
|
const char MSG_MIN_EN[] PROGMEM = " \002 Min";
|
||||||
const char * const MSG_MIN_LANG_TABLE[1] PROGMEM = {
|
const char * const MSG_MIN_LANG_TABLE[1] PROGMEM = {
|
||||||
MSG_MIN_EN
|
MSG_MIN_EN
|
||||||
|
|
|
||||||
|
|
@ -286,6 +286,8 @@ extern const char* const MSG_MAIN_LANG_TABLE[LANG_NUM];
|
||||||
#define MSG_MAIN LANG_TABLE_SELECT(MSG_MAIN_LANG_TABLE)
|
#define MSG_MAIN LANG_TABLE_SELECT(MSG_MAIN_LANG_TABLE)
|
||||||
extern const char* const MSG_MAX_LANG_TABLE[1];
|
extern const char* const MSG_MAX_LANG_TABLE[1];
|
||||||
#define MSG_MAX LANG_TABLE_SELECT_EXPLICIT(MSG_MAX_LANG_TABLE, 0)
|
#define MSG_MAX LANG_TABLE_SELECT_EXPLICIT(MSG_MAX_LANG_TABLE, 0)
|
||||||
|
extern const char* const MSG_MESH_BED_LEVELING_LANG_TABLE[1];
|
||||||
|
#define MSG_MESH_BED_LEVELING LANG_TABLE_SELECT_EXPLICIT(MSG_MESH_BED_LEVELING_LANG_TABLE, 0)
|
||||||
extern const char* const MSG_MIN_LANG_TABLE[1];
|
extern const char* const MSG_MIN_LANG_TABLE[1];
|
||||||
#define MSG_MIN LANG_TABLE_SELECT_EXPLICIT(MSG_MIN_LANG_TABLE, 0)
|
#define MSG_MIN LANG_TABLE_SELECT_EXPLICIT(MSG_MIN_LANG_TABLE, 0)
|
||||||
extern const char* const MSG_MOTION_LANG_TABLE[LANG_NUM];
|
extern const char* const MSG_MOTION_LANG_TABLE[LANG_NUM];
|
||||||
|
|
|
||||||
|
|
@ -314,4 +314,8 @@
|
||||||
#define MSG_BED_CORRECTION_REAR "Rear side um"
|
#define MSG_BED_CORRECTION_REAR "Rear side um"
|
||||||
#define MSG_BED_CORRECTION_RESET "Reset"
|
#define MSG_BED_CORRECTION_RESET "Reset"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define MSG_MESH_BED_LEVELING "Mesh Bed Leveling"
|
||||||
|
|
||||||
#endif // LANGUAGE_EN_H
|
#endif // LANGUAGE_EN_H
|
||||||
|
|
|
||||||
|
|
@ -1908,6 +1908,42 @@ BedSkewOffsetDetectionResultType improve_bed_offset_and_skew(int8_t method, int8
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sample Z heights for the mesh bed leveling.
|
||||||
|
// In addition, store the results into an eeprom, to be used later for verification of the bed leveling process.
|
||||||
|
if (! sample_mesh_and_store_reference())
|
||||||
|
goto canceled;
|
||||||
|
|
||||||
|
enable_endstops(endstops_enabled);
|
||||||
|
enable_z_endstop(endstop_z_enabled);
|
||||||
|
// Don't let the manage_inactivity() function remove power from the motors.
|
||||||
|
refresh_cmd_timeout();
|
||||||
|
return result;
|
||||||
|
|
||||||
|
canceled:
|
||||||
|
// Don't let the manage_inactivity() function remove power from the motors.
|
||||||
|
refresh_cmd_timeout();
|
||||||
|
// Print head up.
|
||||||
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
||||||
|
go_to_current(homing_feedrate[Z_AXIS]/60);
|
||||||
|
// Store the identity matrix to EEPROM.
|
||||||
|
reset_bed_offset_and_skew();
|
||||||
|
enable_endstops(endstops_enabled);
|
||||||
|
enable_z_endstop(endstop_z_enabled);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sample the 9 points of the bed and store them into the EEPROM as a reference.
|
||||||
|
// When calling this function, the X, Y, Z axes should be already homed,
|
||||||
|
// and the world2machine correction matrix should be active.
|
||||||
|
// Returns false if the reference values are more than 3mm far away.
|
||||||
|
bool sample_mesh_and_store_reference()
|
||||||
|
{
|
||||||
|
bool endstops_enabled = enable_endstops(false);
|
||||||
|
bool endstop_z_enabled = enable_z_endstop(false);
|
||||||
|
|
||||||
|
// Don't let the manage_inactivity() function remove power from the motors.
|
||||||
|
refresh_cmd_timeout();
|
||||||
|
|
||||||
// Sample Z heights for the mesh bed leveling.
|
// Sample Z heights for the mesh bed leveling.
|
||||||
// In addition, store the results into an eeprom, to be used later for verification of the bed leveling process.
|
// In addition, store the results into an eeprom, to be used later for verification of the bed leveling process.
|
||||||
{
|
{
|
||||||
|
|
@ -1952,7 +1988,7 @@ BedSkewOffsetDetectionResultType improve_bed_offset_and_skew(int8_t method, int8
|
||||||
// The span of the Z offsets is extreme. Give up.
|
// The span of the Z offsets is extreme. Give up.
|
||||||
// Homing failed on some of the points.
|
// Homing failed on some of the points.
|
||||||
SERIAL_PROTOCOLLNPGM("Exreme span of the Z values!");
|
SERIAL_PROTOCOLLNPGM("Exreme span of the Z values!");
|
||||||
goto canceled;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2003,21 +2039,7 @@ BedSkewOffsetDetectionResultType improve_bed_offset_and_skew(int8_t method, int8
|
||||||
|
|
||||||
enable_endstops(endstops_enabled);
|
enable_endstops(endstops_enabled);
|
||||||
enable_z_endstop(endstop_z_enabled);
|
enable_z_endstop(endstop_z_enabled);
|
||||||
// Don't let the manage_inactivity() function remove power from the motors.
|
return true;
|
||||||
refresh_cmd_timeout();
|
|
||||||
return result;
|
|
||||||
|
|
||||||
canceled:
|
|
||||||
// Don't let the manage_inactivity() function remove power from the motors.
|
|
||||||
refresh_cmd_timeout();
|
|
||||||
// Print head up.
|
|
||||||
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
|
||||||
go_to_current(homing_feedrate[Z_AXIS]/60);
|
|
||||||
// Store the identity matrix to EEPROM.
|
|
||||||
reset_bed_offset_and_skew();
|
|
||||||
enable_endstops(endstops_enabled);
|
|
||||||
enable_z_endstop(endstop_z_enabled);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool scan_bed_induction_points(int8_t verbosity_level)
|
bool scan_bed_induction_points(int8_t verbosity_level)
|
||||||
|
|
@ -2083,9 +2105,54 @@ bool scan_bed_induction_points(int8_t verbosity_level)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shift a Z axis by a given delta.
|
// Shift a Z axis by a given delta.
|
||||||
void shift_z(float delta)
|
// To replace loading of the babystep correction.
|
||||||
|
static void shift_z(float delta)
|
||||||
{
|
{
|
||||||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] - delta, current_position[E_AXIS], homing_feedrate[Z_AXIS]/40, active_extruder);
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] - delta, current_position[E_AXIS], homing_feedrate[Z_AXIS]/40, active_extruder);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
plan_set_z_position(current_position[Z_AXIS]);
|
plan_set_z_position(current_position[Z_AXIS]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define BABYSTEP_LOADZ_BY_PLANNER
|
||||||
|
|
||||||
|
// Number of baby steps applied
|
||||||
|
static int babystepLoadZ = 0;
|
||||||
|
|
||||||
|
void babystep_apply()
|
||||||
|
{
|
||||||
|
// Apply Z height correction aka baby stepping before mesh bed leveing gets activated.
|
||||||
|
if(eeprom_read_byte((unsigned char*)EEPROM_BABYSTEP_Z_SET) == 0x01)
|
||||||
|
{
|
||||||
|
// End of G80: Apply the baby stepping value.
|
||||||
|
EEPROM_read_B(EEPROM_BABYSTEP_Z,&babystepLoadZ);
|
||||||
|
#if 0
|
||||||
|
SERIAL_ECHO("Z baby step: ");
|
||||||
|
SERIAL_ECHO(babystepLoadZ);
|
||||||
|
SERIAL_ECHO(", current Z: ");
|
||||||
|
SERIAL_ECHO(current_position[Z_AXIS]);
|
||||||
|
SERIAL_ECHO("correction: ");
|
||||||
|
SERIAL_ECHO(float(babystepLoadZ) / float(axis_steps_per_unit[Z_AXIS]));
|
||||||
|
SERIAL_ECHOLN("");
|
||||||
|
#endif
|
||||||
|
#ifdef BABYSTEP_LOADZ_BY_PLANNER
|
||||||
|
shift_z(- float(babystepLoadZ) / float(axis_steps_per_unit[Z_AXIS]));
|
||||||
|
#else
|
||||||
|
babystepsTodoZadd(babystepLoadZ);
|
||||||
|
#endif /* BABYSTEP_LOADZ_BY_PLANNER */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void babystep_undo()
|
||||||
|
{
|
||||||
|
#ifdef BABYSTEP_LOADZ_BY_PLANNER
|
||||||
|
shift_z(float(babystepLoadZ) / float(axis_steps_per_unit[Z_AXIS]));
|
||||||
|
#else
|
||||||
|
babystepsTodoZsubtract(babystepLoadZ);
|
||||||
|
#endif /* BABYSTEP_LOADZ_BY_PLANNER */
|
||||||
|
babystepLoadZ = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void babystep_reset()
|
||||||
|
{
|
||||||
|
babystepLoadZ = 0;
|
||||||
|
}
|
||||||
|
|
@ -159,6 +159,8 @@ enum BedSkewOffsetDetectionResultType {
|
||||||
extern BedSkewOffsetDetectionResultType find_bed_offset_and_skew(int8_t verbosity_level);
|
extern BedSkewOffsetDetectionResultType find_bed_offset_and_skew(int8_t verbosity_level);
|
||||||
extern BedSkewOffsetDetectionResultType improve_bed_offset_and_skew(int8_t method, int8_t verbosity_level, uint8_t &too_far_mask);
|
extern BedSkewOffsetDetectionResultType improve_bed_offset_and_skew(int8_t method, int8_t verbosity_level, uint8_t &too_far_mask);
|
||||||
|
|
||||||
|
extern bool sample_mesh_and_store_reference();
|
||||||
|
|
||||||
extern void reset_bed_offset_and_skew();
|
extern void reset_bed_offset_and_skew();
|
||||||
extern bool is_bed_z_jitter_data_valid();
|
extern bool is_bed_z_jitter_data_valid();
|
||||||
|
|
||||||
|
|
@ -167,7 +169,13 @@ extern bool is_bed_z_jitter_data_valid();
|
||||||
// Useful for visualizing the behavior of the bed induction detector.
|
// Useful for visualizing the behavior of the bed induction detector.
|
||||||
extern bool scan_bed_induction_points(int8_t verbosity_level);
|
extern bool scan_bed_induction_points(int8_t verbosity_level);
|
||||||
|
|
||||||
// To replace loading of the babystep correction.
|
// Apply Z babystep value from the EEPROM through the planner.
|
||||||
extern void shift_z(float delta);
|
extern void babystep_apply();
|
||||||
|
|
||||||
|
// Undo the current Z babystep value.
|
||||||
|
extern void babystep_undo();
|
||||||
|
|
||||||
|
// Reset the current babystep counter without moving the axes.
|
||||||
|
extern void babystep_reset();
|
||||||
|
|
||||||
#endif /* MESH_BED_CALIBRATION_H */
|
#endif /* MESH_BED_CALIBRATION_H */
|
||||||
|
|
|
||||||
|
|
@ -1446,19 +1446,16 @@ bool lcd_calibrate_z_end_stop_manual()
|
||||||
previous_millis_cmd = millis();
|
previous_millis_cmd = millis();
|
||||||
encoderPosition += abs(encoderDiff / ENCODER_PULSES_PER_STEP);
|
encoderPosition += abs(encoderDiff / ENCODER_PULSES_PER_STEP);
|
||||||
encoderDiff = 0;
|
encoderDiff = 0;
|
||||||
// Only move up, whatever the user does.
|
if (! planner_queue_full()) {
|
||||||
current_position[Z_AXIS] += fabs(encoderPosition);
|
// Only move up, whatever direction the user rotates the encoder.
|
||||||
encoderPosition = 0;
|
current_position[Z_AXIS] += fabs(encoderPosition);
|
||||||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[Z_AXIS] / 60, active_extruder);
|
encoderPosition = 0;
|
||||||
// Wait for the motors to stop.
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[Z_AXIS] / 60, active_extruder);
|
||||||
st_synchronize();
|
}
|
||||||
// Claim we are at Z=0, so the soft end stop will not trigger.
|
|
||||||
current_position[Z_AXIS] = 0;
|
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
||||||
}
|
}
|
||||||
if (lcd_clicked()) {
|
if (lcd_clicked()) {
|
||||||
// Wait until the Z up movement is finished.
|
// Abort a move if in progress.
|
||||||
st_synchronize();
|
planner_abort_hard();
|
||||||
while (lcd_clicked()) ;
|
while (lcd_clicked()) ;
|
||||||
delay(10);
|
delay(10);
|
||||||
while (lcd_clicked()) ;
|
while (lcd_clicked()) ;
|
||||||
|
|
@ -2022,7 +2019,7 @@ static void lcd_set_lang(unsigned char lang) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_force_language_selection() {
|
void lcd_force_language_selection() {
|
||||||
eeprom_update_byte((unsigned char *)EEPROM_LANG, LANGUAGE_ID_FORCE_SELECTION);
|
eeprom_update_byte((unsigned char *)EEPROM_LANG, LANG_ID_FORCE_SELECTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lcd_language_menu()
|
static void lcd_language_menu()
|
||||||
|
|
@ -2052,6 +2049,12 @@ void lcd_mesh_calibration()
|
||||||
lcd_return_to_status();
|
lcd_return_to_status();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void lcd_mesh_calibration_z()
|
||||||
|
{
|
||||||
|
enquecommand_P(PSTR("M45 Z"));
|
||||||
|
lcd_return_to_status();
|
||||||
|
}
|
||||||
|
|
||||||
static void lcd_settings_menu()
|
static void lcd_settings_menu()
|
||||||
{
|
{
|
||||||
EEPROM_read(EEPROM_SILENT, (uint8_t*)&SilentModeMenu, sizeof(SilentModeMenu));
|
EEPROM_read(EEPROM_SILENT, (uint8_t*)&SilentModeMenu, sizeof(SilentModeMenu));
|
||||||
|
|
@ -2065,9 +2068,13 @@ static void lcd_settings_menu()
|
||||||
if (!isPrintPaused)
|
if (!isPrintPaused)
|
||||||
{
|
{
|
||||||
#ifndef MESH_BED_LEVELING
|
#ifndef MESH_BED_LEVELING
|
||||||
|
// "Calibrate Z"
|
||||||
MENU_ITEM(gcode, MSG_HOMEYZ, PSTR("G28 Z"));
|
MENU_ITEM(gcode, MSG_HOMEYZ, PSTR("G28 Z"));
|
||||||
#else
|
#else
|
||||||
MENU_ITEM(submenu, MSG_HOMEYZ, lcd_mesh_bedleveling);
|
// "Calibrate Z" with storing the reference values to EEPROM.
|
||||||
|
MENU_ITEM(submenu, MSG_HOMEYZ, lcd_mesh_calibration_z);
|
||||||
|
// "Mesh Bed Leveling"
|
||||||
|
MENU_ITEM(submenu, MSG_MESH_BED_LEVELING, lcd_mesh_bedleveling);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue