Browse Source

Add final Z raise after Delta probe

Scott Lahteine 10 years ago
parent
commit
fabf3ae4a0
1 changed files with 18 additions and 10 deletions
  1. 18
    10
      Marlin/Marlin_main.cpp

+ 18
- 10
Marlin/Marlin_main.cpp View File

1388
   inline void do_blocking_move_to_xy(float x, float y) { do_blocking_move_to(x, y, current_position[Z_AXIS]); }
1388
   inline void do_blocking_move_to_xy(float x, float y) { do_blocking_move_to(x, y, current_position[Z_AXIS]); }
1389
   inline void do_blocking_move_to_x(float x) { do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS]); }
1389
   inline void do_blocking_move_to_x(float x) { do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS]); }
1390
   inline void do_blocking_move_to_z(float z) { do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z); }
1390
   inline void do_blocking_move_to_z(float z) { do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z); }
1391
+  inline void raise_z_after_probing() { do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); }
1391
 
1392
 
1392
   static void clean_up_after_endstop_move() {
1393
   static void clean_up_after_endstop_move() {
1393
     #if ENABLED(ENDSTOPS_ONLY_FOR_HOMING)
1394
     #if ENABLED(ENDSTOPS_ONLY_FOR_HOMING)
1518
               if (marlin_debug_flags & DEBUG_LEVELING) {
1519
               if (marlin_debug_flags & DEBUG_LEVELING) {
1519
                 SERIAL_ECHOPAIR("Raise Z (after) by ", (float)Z_RAISE_AFTER_PROBING);
1520
                 SERIAL_ECHOPAIR("Raise Z (after) by ", (float)Z_RAISE_AFTER_PROBING);
1520
                 SERIAL_EOL;
1521
                 SERIAL_EOL;
1521
-                SERIAL_ECHOPAIR("> SERVO_ENDSTOPS > do_blocking_move_to_z ", current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING);
1522
+                SERIAL_ECHOPAIR("> SERVO_ENDSTOPS > raise_z_after_probing()");
1522
                 SERIAL_EOL;
1523
                 SERIAL_EOL;
1523
               }
1524
               }
1524
             #endif
1525
             #endif
1525
-            do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); // this also updates current_position
1526
+            raise_z_after_probing(); // this also updates current_position
1526
             st_synchronize();
1527
             st_synchronize();
1527
           }
1528
           }
1528
         #endif
1529
         #endif
1794
     float oldXpos = current_position[X_AXIS]; // save x position
1795
     float oldXpos = current_position[X_AXIS]; // save x position
1795
     if (dock) {
1796
     if (dock) {
1796
       #if Z_RAISE_AFTER_PROBING > 0
1797
       #if Z_RAISE_AFTER_PROBING > 0
1797
-        do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); // raise Z
1798
+        raise_z_after_probing(); // raise Z
1798
       #endif
1799
       #endif
1799
       do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET + offset - 1);  // Dock sled a bit closer to ensure proper capturing
1800
       do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET + offset - 1);  // Dock sled a bit closer to ensure proper capturing
1800
       digitalWrite(SLED_PIN, LOW); // turn off magnet
1801
       digitalWrite(SLED_PIN, LOW); // turn off magnet
3126
 
3127
 
3127
     #endif // !AUTO_BED_LEVELING_GRID
3128
     #endif // !AUTO_BED_LEVELING_GRID
3128
 
3129
 
3129
-    #if DISABLED(DELTA)
3130
+    #if ENABLED(DELTA)
3131
+      // Allen Key Probe for Delta
3132
+      #if ENABLED(Z_PROBE_ALLEN_KEY)
3133
+        stow_z_probe();
3134
+      #elif Z_RAISE_AFTER_PROBING > 0
3135
+        raise_z_after_probing();
3136
+      #endif
3137
+    #else // !DELTA
3130
       if (verbose_level > 0)
3138
       if (verbose_level > 0)
3131
         plan_bed_level_matrix.debug(" \n\nBed Level Correction Matrix:");
3139
         plan_bed_level_matrix.debug(" \n\nBed Level Correction Matrix:");
3132
 
3140
 
3187
           }
3195
           }
3188
         #endif
3196
         #endif
3189
       }
3197
       }
3190
-    #endif // !DELTA
3191
 
3198
 
3192
-    #if ENABLED(Z_PROBE_SLED)
3193
-      dock_sled(true); // dock the Z probe
3194
-    #elif ENABLED(Z_PROBE_ALLEN_KEY) //|| SERVO_LEVELING
3195
-      stow_z_probe();
3196
-    #endif
3199
+      // Sled assembly for Cartesian bots
3200
+      #if ENABLED(Z_PROBE_SLED)
3201
+        dock_sled(true); // dock the sled
3202
+      #endif
3203
+
3204
+    #endif // !DELTA
3197
 
3205
 
3198
     #ifdef Z_PROBE_END_SCRIPT
3206
     #ifdef Z_PROBE_END_SCRIPT
3199
       #if ENABLED(DEBUG_LEVELING_FEATURE)
3207
       #if ENABLED(DEBUG_LEVELING_FEATURE)

Loading…
Cancel
Save