Browse Source

Merge pull request #2167 from thinkyhead/reverse_zoffset_sign

Reverse the sign of zprobe_zoffset
Richard Wackerbarth 9 years ago
parent
commit
d8e2f5d333
2 changed files with 10 additions and 11 deletions
  1. 6
    6
      Marlin/Marlin_main.cpp
  2. 4
    5
      Marlin/configuration_store.cpp

+ 6
- 6
Marlin/Marlin_main.cpp View File

@@ -286,7 +286,7 @@ bool target_direction;
286 286
 
287 287
 #ifdef ENABLE_AUTO_BED_LEVELING
288 288
   int xy_travel_speed = XY_TRAVEL_SPEED;
289
-  float zprobe_zoffset = -Z_PROBE_OFFSET_FROM_EXTRUDER;
289
+  float zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER;
290 290
 #endif
291 291
 
292 292
 #if defined(Z_DUAL_ENDSTOPS) && !defined(DELTA)
@@ -1060,7 +1060,7 @@ static void axis_is_at_home(AxisEnum axis) {
1060 1060
     max_pos[axis] = base_max_pos(axis) + home_offset[axis];
1061 1061
 
1062 1062
     #if defined(ENABLE_AUTO_BED_LEVELING) && Z_HOME_DIR < 0
1063
-      if (axis == Z_AXIS) current_position[Z_AXIS] += zprobe_zoffset;
1063
+      if (axis == Z_AXIS) current_position[Z_AXIS] -= zprobe_zoffset;
1064 1064
     #endif
1065 1065
   }
1066 1066
 }
@@ -4648,7 +4648,7 @@ inline void gcode_M400() { st_synchronize(); }
4648 4648
   #ifdef SERVO_ENDSTOPS
4649 4649
     void raise_z_for_servo() {
4650 4650
       float zpos = current_position[Z_AXIS], z_dest = Z_RAISE_BEFORE_HOMING;
4651
-      z_dest += axis_known_position[Z_AXIS] ? -zprobe_zoffset : zpos;
4651
+      z_dest += axis_known_position[Z_AXIS] ? zprobe_zoffset : zpos;
4652 4652
       if (zpos < z_dest)
4653 4653
         do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_dest); // also updates current_position
4654 4654
     }
@@ -4869,7 +4869,7 @@ inline void gcode_M503() {
4869 4869
     if (code_seen('Z')) {
4870 4870
       value = code_value();
4871 4871
       if (Z_PROBE_OFFSET_RANGE_MIN <= value && value <= Z_PROBE_OFFSET_RANGE_MAX) {
4872
-        zprobe_zoffset = -value;
4872
+        zprobe_zoffset = value;
4873 4873
         SERIAL_ECHO_START;
4874 4874
         SERIAL_ECHOLNPGM(MSG_ZPROBE_ZOFFSET " " MSG_OK);
4875 4875
         SERIAL_EOL;
@@ -4886,8 +4886,8 @@ inline void gcode_M503() {
4886 4886
     }
4887 4887
     else {
4888 4888
       SERIAL_ECHO_START;
4889
-      SERIAL_ECHOLNPGM(MSG_ZPROBE_ZOFFSET " : ");
4890
-      SERIAL_ECHO(-zprobe_zoffset);
4889
+      SERIAL_ECHOPGM(MSG_ZPROBE_ZOFFSET " : ");
4890
+      SERIAL_ECHO(zprobe_zoffset);
4891 4891
       SERIAL_EOL;
4892 4892
     }
4893 4893
   }

+ 4
- 5
Marlin/configuration_store.cpp View File

@@ -14,7 +14,7 @@
14 14
  *
15 15
  */
16 16
 
17
-#define EEPROM_VERSION "V19"
17
+#define EEPROM_VERSION "V20"
18 18
 
19 19
 /**
20 20
  * V19 EEPROM Layout:
@@ -499,7 +499,7 @@ void Config_ResetDefault() {
499 499
   #endif
500 500
 
501 501
   #ifdef ENABLE_AUTO_BED_LEVELING
502
-    zprobe_zoffset = -Z_PROBE_OFFSET_FROM_EXTRUDER;
502
+    zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER;
503 503
   #endif
504 504
 
505 505
   #ifdef DELTA
@@ -866,12 +866,11 @@ void Config_PrintSettings(bool forReplay) {
866 866
         SERIAL_ECHOLNPGM("Z-Probe Offset (mm):");
867 867
       }
868 868
       CONFIG_ECHO_START;
869
-      SERIAL_ECHOPAIR("  M", (unsigned long)CUSTOM_M_CODE_SET_Z_PROBE_OFFSET);
870
-      SERIAL_ECHOPAIR(" Z", -zprobe_zoffset);
869
+      SERIAL_ECHOPAIR("  M" STRINGIFY(CUSTOM_M_CODE_SET_Z_PROBE_OFFSET) " Z", zprobe_zoffset);
871 870
     #else
872 871
       if (!forReplay) {
873 872
         CONFIG_ECHO_START;
874
-        SERIAL_ECHOPAIR("Z-Probe Offset (mm):", -zprobe_zoffset);
873
+        SERIAL_ECHOPAIR("Z-Probe Offset (mm):", zprobe_zoffset);
875 874
       }
876 875
     #endif
877 876
     SERIAL_EOL;

Loading…
Cancel
Save