diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0e17ddae5..ed3b24408 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -286,7 +286,7 @@ bool target_direction; #ifdef ENABLE_AUTO_BED_LEVELING int xy_travel_speed = XY_TRAVEL_SPEED; - float zprobe_zoffset = -Z_PROBE_OFFSET_FROM_EXTRUDER; + float zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER; #endif #if defined(Z_DUAL_ENDSTOPS) && !defined(DELTA) @@ -1060,7 +1060,7 @@ static void axis_is_at_home(AxisEnum axis) { max_pos[axis] = base_max_pos(axis) + home_offset[axis]; #if defined(ENABLE_AUTO_BED_LEVELING) && Z_HOME_DIR < 0 - if (axis == Z_AXIS) current_position[Z_AXIS] += zprobe_zoffset; + if (axis == Z_AXIS) current_position[Z_AXIS] -= zprobe_zoffset; #endif } } @@ -4648,7 +4648,7 @@ inline void gcode_M400() { st_synchronize(); } #ifdef SERVO_ENDSTOPS void raise_z_for_servo() { float zpos = current_position[Z_AXIS], z_dest = Z_RAISE_BEFORE_HOMING; - z_dest += axis_known_position[Z_AXIS] ? -zprobe_zoffset : zpos; + z_dest += axis_known_position[Z_AXIS] ? zprobe_zoffset : zpos; if (zpos < z_dest) do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_dest); // also updates current_position } @@ -4869,7 +4869,7 @@ inline void gcode_M503() { if (code_seen('Z')) { value = code_value(); if (Z_PROBE_OFFSET_RANGE_MIN <= value && value <= Z_PROBE_OFFSET_RANGE_MAX) { - zprobe_zoffset = -value; + zprobe_zoffset = value; SERIAL_ECHO_START; SERIAL_ECHOLNPGM(MSG_ZPROBE_ZOFFSET " " MSG_OK); SERIAL_EOL; @@ -4886,8 +4886,8 @@ inline void gcode_M503() { } else { SERIAL_ECHO_START; - SERIAL_ECHOLNPGM(MSG_ZPROBE_ZOFFSET " : "); - SERIAL_ECHO(-zprobe_zoffset); + SERIAL_ECHOPGM(MSG_ZPROBE_ZOFFSET " : "); + SERIAL_ECHO(zprobe_zoffset); SERIAL_EOL; } } diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index b950b88cd..6974ac9a2 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -14,7 +14,7 @@ * */ -#define EEPROM_VERSION "V19" +#define EEPROM_VERSION "V20" /** * V19 EEPROM Layout: @@ -499,7 +499,7 @@ void Config_ResetDefault() { #endif #ifdef ENABLE_AUTO_BED_LEVELING - zprobe_zoffset = -Z_PROBE_OFFSET_FROM_EXTRUDER; + zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER; #endif #ifdef DELTA @@ -866,12 +866,11 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOLNPGM("Z-Probe Offset (mm):"); } CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M", (unsigned long)CUSTOM_M_CODE_SET_Z_PROBE_OFFSET); - SERIAL_ECHOPAIR(" Z", -zprobe_zoffset); + SERIAL_ECHOPAIR(" M" STRINGIFY(CUSTOM_M_CODE_SET_Z_PROBE_OFFSET), zprobe_zoffset); #else if (!forReplay) { CONFIG_ECHO_START; - SERIAL_ECHOPAIR("Z-Probe Offset (mm):", -zprobe_zoffset); + SERIAL_ECHOPAIR("Z-Probe Offset (mm):", zprobe_zoffset); } #endif SERIAL_EOL;