Ver código fonte

Have run_probe() return probe Z, not nozzle Z

Scott Lahteine 8 anos atrás
pai
commit
a5e085cbea
3 arquivos alterados com 8 adições e 11 exclusões
  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 Ver arquivo

@@ -2233,7 +2233,7 @@ static void clean_up_after_endstop_or_probe_move() {
2233 2233
         SERIAL_ECHOLNPAIR(" Discrepancy:", first_probe_z - current_position[Z_AXIS]);
2234 2234
       }
2235 2235
     #endif
2236
-    return current_position[Z_AXIS];
2236
+    return current_position[Z_AXIS] + zprobe_zoffset;
2237 2237
   }
2238 2238
 
2239 2239
   //
@@ -2287,7 +2287,7 @@ static void clean_up_after_endstop_or_probe_move() {
2287 2287
       SERIAL_PROTOCOLPGM(" Y: ");
2288 2288
       SERIAL_PROTOCOL_F(y, 3);
2289 2289
       SERIAL_PROTOCOLPGM(" Z: ");
2290
-      SERIAL_PROTOCOL_F(FIXFLOAT(measured_z - -zprobe_zoffset), 3);
2290
+      SERIAL_PROTOCOL_F(FIXFLOAT(measured_z), 3);
2291 2291
       SERIAL_EOL;
2292 2292
     }
2293 2293
 
@@ -4408,7 +4408,7 @@ inline void gcode_G28() {
4408 4408
         if ( NEAR(current_position[X_AXIS], xProbe - (X_PROBE_OFFSET_FROM_EXTRUDER))
4409 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 4412
           #if ENABLED(DEBUG_LEVELING_FEATURE)
4413 4413
             if (DEBUGGING(LEVELING)) {
4414 4414
               SERIAL_ECHOPAIR("Z from Probe:", simple_z);
@@ -4503,7 +4503,7 @@ inline void gcode_G28() {
4503 4503
     SERIAL_PROTOCOLPGM(" Y: ");
4504 4504
     SERIAL_PROTOCOL(FIXFLOAT(Y_probe_location));
4505 4505
     SERIAL_PROTOCOLPGM(" Z: ");
4506
-    SERIAL_PROTOCOLLN(FIXFLOAT(measured_z - -zprobe_zoffset));
4506
+    SERIAL_PROTOCOLLN(FIXFLOAT(measured_z));
4507 4507
 
4508 4508
     clean_up_after_endstop_or_probe_move();
4509 4509
 

+ 4
- 5
Marlin/UBL_G29.cpp Ver arquivo

@@ -49,7 +49,6 @@
49 49
   extern bool code_value_bool();
50 50
   extern bool code_has_value();
51 51
   extern float probe_pt(float x, float y, bool, int);
52
-  extern float zprobe_zoffset;
53 52
   extern bool set_probe_deployed(bool);
54 53
   #define DEPLOY_PROBE() set_probe_deployed(true)
55 54
   #define STOW_PROBE() set_probe_deployed(false)
@@ -516,9 +515,9 @@
516 515
     }
517 516
 
518 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 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 523
       //  the Mesh is tilted!  (We need to compensate each probe point by what the Mesh says that location's height is)
@@ -761,7 +760,7 @@
761 760
           goto LEAVE;
762 761
         }
763 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 766
       if (do_ubl_mesh_map) ubl.display_map(map_type);

+ 0
- 2
Marlin/ultralcd.cpp Ver arquivo

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

Carregando…
Cancelar
Salvar