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
 
286
 
287
 #ifdef ENABLE_AUTO_BED_LEVELING
287
 #ifdef ENABLE_AUTO_BED_LEVELING
288
   int xy_travel_speed = XY_TRAVEL_SPEED;
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
 #endif
290
 #endif
291
 
291
 
292
 #if defined(Z_DUAL_ENDSTOPS) && !defined(DELTA)
292
 #if defined(Z_DUAL_ENDSTOPS) && !defined(DELTA)
1060
     max_pos[axis] = base_max_pos(axis) + home_offset[axis];
1060
     max_pos[axis] = base_max_pos(axis) + home_offset[axis];
1061
 
1061
 
1062
     #if defined(ENABLE_AUTO_BED_LEVELING) && Z_HOME_DIR < 0
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
     #endif
1064
     #endif
1065
   }
1065
   }
1066
 }
1066
 }
4648
   #ifdef SERVO_ENDSTOPS
4648
   #ifdef SERVO_ENDSTOPS
4649
     void raise_z_for_servo() {
4649
     void raise_z_for_servo() {
4650
       float zpos = current_position[Z_AXIS], z_dest = Z_RAISE_BEFORE_HOMING;
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
       if (zpos < z_dest)
4652
       if (zpos < z_dest)
4653
         do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_dest); // also updates current_position
4653
         do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_dest); // also updates current_position
4654
     }
4654
     }
4869
     if (code_seen('Z')) {
4869
     if (code_seen('Z')) {
4870
       value = code_value();
4870
       value = code_value();
4871
       if (Z_PROBE_OFFSET_RANGE_MIN <= value && value <= Z_PROBE_OFFSET_RANGE_MAX) {
4871
       if (Z_PROBE_OFFSET_RANGE_MIN <= value && value <= Z_PROBE_OFFSET_RANGE_MAX) {
4872
-        zprobe_zoffset = -value;
4872
+        zprobe_zoffset = value;
4873
         SERIAL_ECHO_START;
4873
         SERIAL_ECHO_START;
4874
         SERIAL_ECHOLNPGM(MSG_ZPROBE_ZOFFSET " " MSG_OK);
4874
         SERIAL_ECHOLNPGM(MSG_ZPROBE_ZOFFSET " " MSG_OK);
4875
         SERIAL_EOL;
4875
         SERIAL_EOL;
4886
     }
4886
     }
4887
     else {
4887
     else {
4888
       SERIAL_ECHO_START;
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
       SERIAL_EOL;
4891
       SERIAL_EOL;
4892
     }
4892
     }
4893
   }
4893
   }

+ 4
- 5
Marlin/configuration_store.cpp View File

14
  *
14
  *
15
  */
15
  */
16
 
16
 
17
-#define EEPROM_VERSION "V19"
17
+#define EEPROM_VERSION "V20"
18
 
18
 
19
 /**
19
 /**
20
  * V19 EEPROM Layout:
20
  * V19 EEPROM Layout:
499
   #endif
499
   #endif
500
 
500
 
501
   #ifdef ENABLE_AUTO_BED_LEVELING
501
   #ifdef ENABLE_AUTO_BED_LEVELING
502
-    zprobe_zoffset = -Z_PROBE_OFFSET_FROM_EXTRUDER;
502
+    zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER;
503
   #endif
503
   #endif
504
 
504
 
505
   #ifdef DELTA
505
   #ifdef DELTA
866
         SERIAL_ECHOLNPGM("Z-Probe Offset (mm):");
866
         SERIAL_ECHOLNPGM("Z-Probe Offset (mm):");
867
       }
867
       }
868
       CONFIG_ECHO_START;
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
     #else
870
     #else
872
       if (!forReplay) {
871
       if (!forReplay) {
873
         CONFIG_ECHO_START;
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
     #endif
875
     #endif
877
     SERIAL_EOL;
876
     SERIAL_EOL;

Loading…
Cancel
Save