Selaa lähdekoodia

Screen out `G29 E` for sled and allen key, allow single probe

Scott Lahteine 9 vuotta sitten
vanhempi
commit
5158bd6e93
1 muutettua tiedostoa jossa 36 lisäystä ja 26 poistoa
  1. 36
    26
      Marlin/Marlin_main.cpp

+ 36
- 26
Marlin/Marlin_main.cpp Näytä tiedosto

2173
     // this also updates current_position
2173
     // this also updates current_position
2174
     do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER));
2174
     do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER));
2175
 
2175
 
2176
-    // Z Sled and Allen Key should never deploy-and-stow
2177
-    #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY)
2178
-      if (probe_action == ProbeDeployAndStow) probe_action == ProbeStay;
2179
-    #endif
2180
-
2181
     if (probe_action & ProbeDeploy) {
2176
     if (probe_action & ProbeDeploy) {
2182
       #if ENABLED(DEBUG_LEVELING_FEATURE)
2177
       #if ENABLED(DEBUG_LEVELING_FEATURE)
2183
         if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> ProbeDeploy");
2178
         if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> ProbeDeploy");
3370
       return;
3365
       return;
3371
     }
3366
     }
3372
 
3367
 
3373
-    bool dryrun = code_seen('D'),
3374
-         deploy_probe_for_each_reading = code_seen('E');
3368
+    bool dryrun = code_seen('D');
3369
+
3370
+    #if DISABLED(Z_PROBE_SLED) && DISABLED(Z_PROBE_ALLEN_KEY)
3371
+      bool deploy_probe_for_each_reading = code_seen('E');
3372
+    #endif
3375
 
3373
 
3376
     #if ENABLED(AUTO_BED_LEVELING_GRID)
3374
     #if ENABLED(AUTO_BED_LEVELING_GRID)
3377
 
3375
 
3470
 
3468
 
3471
     setup_for_endstop_or_probe_move();
3469
     setup_for_endstop_or_probe_move();
3472
 
3470
 
3473
-    #if HAS_BED_PROBE
3474
-      deploy_z_probe();
3475
-    #endif
3471
+    // Deploy the probe. Servo will raise if needed.
3472
+    deploy_z_probe();
3476
 
3473
 
3477
     feedrate = homing_feedrate[Z_AXIS];
3474
     feedrate = homing_feedrate[Z_AXIS];
3478
 
3475
 
3551
             if (distance_from_center > DELTA_PROBEABLE_RADIUS) continue;
3548
             if (distance_from_center > DELTA_PROBEABLE_RADIUS) continue;
3552
           #endif //DELTA
3549
           #endif //DELTA
3553
 
3550
 
3554
-          ProbeAction act;
3555
-          if (deploy_probe_for_each_reading) // G29 E - Stow between probes
3556
-            act = ProbeDeployAndStow;
3557
-          else if (yCount == 0 && xCount == xStart)
3558
-            act = ProbeDeploy;
3559
-          else if (yCount == auto_bed_leveling_grid_points - 1 && xCount == xStop - xInc)
3560
-            act = ProbeStow;
3561
-          else
3562
-            act = ProbeStay;
3551
+          #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY)
3552
+            const ProbeAction act = ProbeStay;
3553
+          #else
3554
+            ProbeAction act;
3555
+            if (deploy_probe_for_each_reading) // G29 E - Stow between probes
3556
+              act = ProbeDeployAndStow;
3557
+            else if (yCount == 0 && xCount == xStart)
3558
+              act = ProbeDeploy;
3559
+            else if (yCount == auto_bed_leveling_grid_points - 1 && xCount == xStop - xInc)
3560
+              act = ProbeStow;
3561
+            else
3562
+              act = ProbeStay;
3563
+          #endif
3563
 
3564
 
3564
           measured_z = probe_pt(xProbe, yProbe, z_before, act, verbose_level);
3565
           measured_z = probe_pt(xProbe, yProbe, z_before, act, verbose_level);
3565
 
3566
 
3690
         if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> 3-point Leveling");
3691
         if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> 3-point Leveling");
3691
       #endif
3692
       #endif
3692
 
3693
 
3693
-      // Actions for each probe
3694
-      ProbeAction p1, p2, p3;
3695
-      if (deploy_probe_for_each_reading)
3696
-        p1 = p2 = p3 = ProbeDeployAndStow;
3697
-      else
3698
-        p1 = ProbeDeploy, p2 = ProbeStay, p3 = ProbeStow;
3694
+      #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY)
3695
+        const ProbeAction p1 = ProbeStay, p2 = ProbeStay, p3 = ProbeStay;
3696
+      #else
3697
+        // Actions for each probe
3698
+        ProbeAction p1, p2, p3;
3699
+        if (deploy_probe_for_each_reading)
3700
+          p1 = p2 = p3 = ProbeDeployAndStow;
3701
+        else
3702
+          p1 = ProbeDeploy, p2 = ProbeStay, p3 = ProbeStow;
3703
+      #endif
3699
 
3704
 
3700
       // Probe at 3 arbitrary points
3705
       // Probe at 3 arbitrary points
3701
       float z_at_pt_1 = probe_pt( ABL_PROBE_PT_1_X + home_offset[X_AXIS],
3706
       float z_at_pt_1 = probe_pt( ABL_PROBE_PT_1_X + home_offset[X_AXIS],
4189
     float  X_current = current_position[X_AXIS],
4194
     float  X_current = current_position[X_AXIS],
4190
            Y_current = current_position[Y_AXIS],
4195
            Y_current = current_position[Y_AXIS],
4191
            Z_start_location = current_position[Z_AXIS] + Z_RAISE_BEFORE_PROBING;
4196
            Z_start_location = current_position[Z_AXIS] + Z_RAISE_BEFORE_PROBING;
4192
-    bool deploy_probe_for_each_reading = code_seen('E');
4197
+
4198
+    #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY)
4199
+      const bool deploy_probe_for_each_reading = false;
4200
+    #else
4201
+      bool deploy_probe_for_each_reading = code_seen('E');
4202
+    #endif
4193
 
4203
 
4194
     float X_probe_location = code_seen('X') ? code_value_axis_units(X_AXIS) : X_current + X_PROBE_OFFSET_FROM_EXTRUDER;
4204
     float X_probe_location = code_seen('X') ? code_value_axis_units(X_AXIS) : X_current + X_PROBE_OFFSET_FROM_EXTRUDER;
4195
     #if DISABLED(DELTA)
4205
     #if DISABLED(DELTA)

Loading…
Peruuta
Tallenna