Sfoglia il codice sorgente

Pass the z for after probing to retract_z_probe

A `z_before` value is passed to probe_pt, but the `retract_z_probe`
function assumes that Z is 0, doesn’t add `current_position[Z_AXIS]` as
other cases do. This may be superfluous, so this is a test, and will be
reverted if it has no effect.
Scott Lahteine 10 anni fa
parent
commit
41d258697a
1 ha cambiato i file con 8 aggiunte e 8 eliminazioni
  1. 8
    8
      Marlin/Marlin_main.cpp

+ 8
- 8
Marlin/Marlin_main.cpp Vedi File

@@ -1138,7 +1138,7 @@ inline void sync_plan_position() {
1138 1138
         feedrate = homing_feedrate[Z_AXIS] / homing_bump_divisor[Z_AXIS];
1139 1139
       else {
1140 1140
         feedrate = homing_feedrate[Z_AXIS] / 10;
1141
-        SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1");
1141
+        SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less than 1");
1142 1142
       }
1143 1143
 
1144 1144
       zPosition -= home_retract_mm(Z_AXIS) * 2;
@@ -1255,17 +1255,17 @@ inline void sync_plan_position() {
1255 1255
 
1256 1256
   }
1257 1257
 
1258
-  static void retract_z_probe() {
1258
+  static void retract_z_probe(const float z_after=Z_RAISE_AFTER_PROBING) {
1259 1259
 
1260 1260
     #ifdef SERVO_ENDSTOPS
1261 1261
 
1262 1262
       // Retract Z Servo endstop if enabled
1263 1263
       if (servo_endstops[Z_AXIS] >= 0) {
1264 1264
 
1265
-        #if Z_RAISE_AFTER_PROBING > 0
1266
-          do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING);
1265
+        if (z_after > 0) {
1266
+          do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_after);
1267 1267
           st_synchronize();
1268
-        #endif
1268
+        }
1269 1269
       
1270 1270
         #if SERVO_LEVELING
1271 1271
           servos[servo_endstops[Z_AXIS]].attach(0);
@@ -1345,7 +1345,7 @@ inline void sync_plan_position() {
1345 1345
     float measured_z = current_position[Z_AXIS];
1346 1346
 
1347 1347
     #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY)
1348
-      if (retract_action & ProbeRetract) retract_z_probe();
1348
+      if (retract_action & ProbeRetract) retract_z_probe(z_before);
1349 1349
     #endif
1350 1350
 
1351 1351
     if (verbose_level > 2) {
@@ -1481,7 +1481,7 @@ static void homeaxis(int axis) {
1481 1481
       feedrate = homing_feedrate[axis] / homing_bump_divisor[axis];
1482 1482
     else {
1483 1483
       feedrate = homing_feedrate[axis] / 10;
1484
-      SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1");
1484
+      SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less than 1");
1485 1485
     }
1486 1486
 
1487 1487
     line_to_destination();
@@ -2315,7 +2315,7 @@ inline void gcode_G28() {
2315 2315
 
2316 2316
           // raise extruder
2317 2317
           float measured_z,
2318
-                z_before = probePointCounter == 0 ? Z_RAISE_BEFORE_PROBING : current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS;
2318
+                z_before = Z_RAISE_BETWEEN_PROBINGS + (probePointCounter ? current_position[Z_AXIS] : 0);
2319 2319
 
2320 2320
           #ifdef DELTA
2321 2321
             // Avoid probing the corners (outside the round or hexagon print surface) on a delta printer.

Loading…
Annulla
Salva