Browse Source

Have run_probe() return probe Z, not nozzle Z

Scott Lahteine 8 years ago
parent
commit
a5e085cbea
3 changed files with 8 additions and 11 deletions
  1. 4
    4
      Marlin/Marlin_main.cpp
  2. 4
    5
      Marlin/UBL_G29.cpp
  3. 0
    2
      Marlin/ultralcd.cpp

+ 4
- 4
Marlin/Marlin_main.cpp View File

2233
         SERIAL_ECHOLNPAIR(" Discrepancy:", first_probe_z - current_position[Z_AXIS]);
2233
         SERIAL_ECHOLNPAIR(" Discrepancy:", first_probe_z - current_position[Z_AXIS]);
2234
       }
2234
       }
2235
     #endif
2235
     #endif
2236
-    return current_position[Z_AXIS];
2236
+    return current_position[Z_AXIS] + zprobe_zoffset;
2237
   }
2237
   }
2238
 
2238
 
2239
   //
2239
   //
2287
       SERIAL_PROTOCOLPGM(" Y: ");
2287
       SERIAL_PROTOCOLPGM(" Y: ");
2288
       SERIAL_PROTOCOL_F(y, 3);
2288
       SERIAL_PROTOCOL_F(y, 3);
2289
       SERIAL_PROTOCOLPGM(" Z: ");
2289
       SERIAL_PROTOCOLPGM(" Z: ");
2290
-      SERIAL_PROTOCOL_F(FIXFLOAT(measured_z - -zprobe_zoffset), 3);
2290
+      SERIAL_PROTOCOL_F(FIXFLOAT(measured_z), 3);
2291
       SERIAL_EOL;
2291
       SERIAL_EOL;
2292
     }
2292
     }
2293
 
2293
 
4408
         if ( NEAR(current_position[X_AXIS], xProbe - (X_PROBE_OFFSET_FROM_EXTRUDER))
4408
         if ( NEAR(current_position[X_AXIS], xProbe - (X_PROBE_OFFSET_FROM_EXTRUDER))
4409
           && NEAR(current_position[Y_AXIS], yProbe - (Y_PROBE_OFFSET_FROM_EXTRUDER))
4409
           && NEAR(current_position[Y_AXIS], yProbe - (Y_PROBE_OFFSET_FROM_EXTRUDER))
4410
         ) {
4410
         ) {
4411
-          float simple_z = current_position[Z_AXIS] - (measured_z - (-zprobe_zoffset));
4411
+          float simple_z = current_position[Z_AXIS] - measured_z;
4412
           #if ENABLED(DEBUG_LEVELING_FEATURE)
4412
           #if ENABLED(DEBUG_LEVELING_FEATURE)
4413
             if (DEBUGGING(LEVELING)) {
4413
             if (DEBUGGING(LEVELING)) {
4414
               SERIAL_ECHOPAIR("Z from Probe:", simple_z);
4414
               SERIAL_ECHOPAIR("Z from Probe:", simple_z);
4503
     SERIAL_PROTOCOLPGM(" Y: ");
4503
     SERIAL_PROTOCOLPGM(" Y: ");
4504
     SERIAL_PROTOCOL(FIXFLOAT(Y_probe_location));
4504
     SERIAL_PROTOCOL(FIXFLOAT(Y_probe_location));
4505
     SERIAL_PROTOCOLPGM(" Z: ");
4505
     SERIAL_PROTOCOLPGM(" Z: ");
4506
-    SERIAL_PROTOCOLLN(FIXFLOAT(measured_z - -zprobe_zoffset));
4506
+    SERIAL_PROTOCOLLN(FIXFLOAT(measured_z));
4507
 
4507
 
4508
     clean_up_after_endstop_or_probe_move();
4508
     clean_up_after_endstop_or_probe_move();
4509
 
4509
 

+ 4
- 5
Marlin/UBL_G29.cpp View File

49
   extern bool code_value_bool();
49
   extern bool code_value_bool();
50
   extern bool code_has_value();
50
   extern bool code_has_value();
51
   extern float probe_pt(float x, float y, bool, int);
51
   extern float probe_pt(float x, float y, bool, int);
52
-  extern float zprobe_zoffset;
53
   extern bool set_probe_deployed(bool);
52
   extern bool set_probe_deployed(bool);
54
   #define DEPLOY_PROBE() set_probe_deployed(true)
53
   #define DEPLOY_PROBE() set_probe_deployed(true)
55
   #define STOW_PROBE() set_probe_deployed(false)
54
   #define STOW_PROBE() set_probe_deployed(false)
516
     }
515
     }
517
 
516
 
518
     if (code_seen('T')) {
517
     if (code_seen('T')) {
519
-      float z1 = probe_pt(ubl_3_point_1_X, ubl_3_point_1_Y, false /*Stow Flag*/, g29_verbose_level) + zprobe_zoffset,
520
-            z2 = probe_pt(ubl_3_point_2_X, ubl_3_point_2_Y, false /*Stow Flag*/, g29_verbose_level) + zprobe_zoffset,
521
-            z3 = probe_pt(ubl_3_point_3_X, ubl_3_point_3_Y, true  /*Stow Flag*/, g29_verbose_level) + zprobe_zoffset;
518
+      float z1 = probe_pt(ubl_3_point_1_X, ubl_3_point_1_Y, false /*Stow Flag*/, g29_verbose_level),
519
+            z2 = probe_pt(ubl_3_point_2_X, ubl_3_point_2_Y, false /*Stow Flag*/, g29_verbose_level),
520
+            z3 = probe_pt(ubl_3_point_3_X, ubl_3_point_3_Y, true  /*Stow Flag*/, g29_verbose_level);
522
 
521
 
523
       //  We need to adjust z1, z2, z3 by the Mesh Height at these points. Just because they are non-zero doesn't mean
522
       //  We need to adjust z1, z2, z3 by the Mesh Height at these points. Just because they are non-zero doesn't mean
524
       //  the Mesh is tilted!  (We need to compensate each probe point by what the Mesh says that location's height is)
523
       //  the Mesh is tilted!  (We need to compensate each probe point by what the Mesh says that location's height is)
761
           goto LEAVE;
760
           goto LEAVE;
762
         }
761
         }
763
         const float measured_z = probe_pt(LOGICAL_X_POSITION(rawx), LOGICAL_Y_POSITION(rawy), stow_probe, g29_verbose_level);
762
         const float measured_z = probe_pt(LOGICAL_X_POSITION(rawx), LOGICAL_Y_POSITION(rawy), stow_probe, g29_verbose_level);
764
-        ubl.z_values[location.x_index][location.y_index] = measured_z + zprobe_zoffset;
763
+        ubl.z_values[location.x_index][location.y_index] = measured_z;
765
       }
764
       }
766
 
765
 
767
       if (do_ubl_mesh_map) ubl.display_map(map_type);
766
       if (do_ubl_mesh_map) ubl.display_map(map_type);

+ 0
- 2
Marlin/ultralcd.cpp View File

30
 #include "configuration_store.h"
30
 #include "configuration_store.h"
31
 #include "utility.h"
31
 #include "utility.h"
32
 
32
 
33
-extern float zprobe_zoffset;
34
-
35
 #if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER)
33
 #if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER)
36
   #include "buzzer.h"
34
   #include "buzzer.h"
37
 #endif
35
 #endif

Loading…
Cancel
Save