Browse Source

Additional cleanup of UBL code

Scott Lahteine 7 years ago
parent
commit
e244399766
35 changed files with 2167 additions and 2036 deletions
  1. 1
    1
      Marlin/Conditionals_post.h
  2. 41
    35
      Marlin/Configuration.h
  3. 167
    163
      Marlin/G26_Mesh_Validation_Tool.cpp
  4. 34
    22
      Marlin/Marlin_main.cpp
  5. 34
    26
      Marlin/SanityCheck.h
  6. 34
    34
      Marlin/UBL.h
  7. 66
    57
      Marlin/UBL_Bed_Leveling.cpp
  8. 567
    593
      Marlin/UBL_G29.cpp
  9. 290
    311
      Marlin/UBL_line_to_destination.cpp
  10. 1
    1
      Marlin/cardreader.cpp
  11. 24
    24
      Marlin/configuration_store.cpp
  12. 41
    34
      Marlin/example_configurations/Cartesio/Configuration.h
  13. 41
    34
      Marlin/example_configurations/Felix/Configuration.h
  14. 41
    34
      Marlin/example_configurations/Felix/DUAL/Configuration.h
  15. 41
    34
      Marlin/example_configurations/Hephestos/Configuration.h
  16. 41
    34
      Marlin/example_configurations/Hephestos_2/Configuration.h
  17. 41
    34
      Marlin/example_configurations/K8200/Configuration.h
  18. 41
    34
      Marlin/example_configurations/K8400/Configuration.h
  19. 41
    34
      Marlin/example_configurations/K8400/Dual-head/Configuration.h
  20. 41
    34
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  21. 41
    34
      Marlin/example_configurations/RigidBot/Configuration.h
  22. 41
    34
      Marlin/example_configurations/SCARA/Configuration.h
  23. 41
    34
      Marlin/example_configurations/TAZ4/Configuration.h
  24. 41
    34
      Marlin/example_configurations/WITBOX/Configuration.h
  25. 41
    34
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  26. 41
    34
      Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h
  27. 41
    34
      Marlin/example_configurations/delta/generic/Configuration.h
  28. 41
    34
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  29. 41
    34
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  30. 41
    34
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  31. 41
    34
      Marlin/example_configurations/makibox/Configuration.h
  32. 41
    34
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  33. 2
    2
      Marlin/servo.cpp
  34. 38
    53
      Marlin/ultralcd.cpp
  35. 7
    0
      Marlin/ultralcd.h

+ 1
- 1
Marlin/Conditionals_post.h View File

@@ -669,7 +669,7 @@
669 669
   #define ABL_GRID   (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR))
670 670
   #define HAS_ABL    (ABL_PLANAR || ABL_GRID || ENABLED(AUTO_BED_LEVELING_UBL))
671 671
 
672
-  #define PLANNER_LEVELING      (HAS_ABL || ENABLED(MESH_BED_LEVELING))
672
+  #define PLANNER_LEVELING      ((HAS_ABL && DISABLED(AUTO_BED_LEVELING_UBL)) || ENABLED(MESH_BED_LEVELING))
673 673
   #define HAS_PROBING_PROCEDURE (HAS_ABL || ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST))
674 674
 
675 675
   #if HAS_PROBING_PROCEDURE

+ 41
- 35
Marlin/Configuration.h View File

@@ -747,42 +747,48 @@
747 747
 // @section bedlevel
748 748
 
749 749
 /**
750
- * Select one form of Auto Bed Leveling below.
750
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
751
+ * and behavior of G29 will change depending on your selection.
751 752
  *
752
- *  If you're also using the Probe for Z Homing, it's
753
- *  highly recommended to enable Z_SAFE_HOMING also!
753
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
754 754
  *
755
- * - 3POINT
755
+ * - AUTO_BED_LEVELING_3POINT
756 756
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
757 757
  *   You specify the XY coordinates of all 3 points.
758 758
  *   The result is a single tilted plane. Best for a flat bed.
759 759
  *
760
- * - LINEAR
760
+ * - AUTO_BED_LEVELING_LINEAR
761 761
  *   Probe several points in a grid.
762 762
  *   You specify the rectangle and the density of sample points.
763 763
  *   The result is a single tilted plane. Best for a flat bed.
764 764
  *
765
- * - BILINEAR
765
+ * - AUTO_BED_LEVELING_BILINEAR
766 766
  *   Probe several points in a grid.
767 767
  *   You specify the rectangle and the density of sample points.
768 768
  *   The result is a mesh, best for large or uneven beds.
769 769
  *
770
- * - UBL Unified Bed Leveling
771
- *   A comprehensive bed leveling system that combines features and benefits from previous
772
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
773
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
774
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
775
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
776
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
777
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
778
- *       test on.
770
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
771
+ *   A comprehensive bed leveling system combining the features and benefits
772
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
773
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
774
+ *   for Cartesian Printers. That said, it was primarily designed to correct
775
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
776
+ *   please post an issue if something doesn't work correctly. Initially,
777
+ *   you will need to set a reduced bed size so you have a rectangular area
778
+ *   to test on.
779
+ *
780
+ * - MESH_BED_LEVELING
781
+ *   Probe a grid manually
782
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
783
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
784
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
785
+ *   With an LCD controller the process is guided step-by-step.
779 786
  */
780 787
 //#define AUTO_BED_LEVELING_3POINT
781 788
 //#define AUTO_BED_LEVELING_LINEAR
782 789
 //#define AUTO_BED_LEVELING_BILINEAR
783
-//#define MESH_BED_LEVELING
784 790
 //#define AUTO_BED_LEVELING_UBL
785
-
791
+//#define MESH_BED_LEVELING
786 792
 
787 793
 /**
788 794
  * Enable detailed logging of G28, G29, M48, etc.
@@ -841,13 +847,28 @@
841 847
   #define ABL_PROBE_PT_3_X 170
842 848
   #define ABL_PROBE_PT_3_Y 20
843 849
 
850
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
851
+
852
+  //===========================================================================
853
+  //========================= Unified Bed Leveling ============================
854
+  //===========================================================================
855
+
856
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
857
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
858
+  #define UBL_MESH_NUM_Y_POINTS 10
859
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
860
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
861
+  #define UBL_PROBE_PT_2_X 39
862
+  #define UBL_PROBE_PT_2_Y 20
863
+  #define UBL_PROBE_PT_3_X 180
864
+  #define UBL_PROBE_PT_3_Y 20
865
+
844 866
 #elif ENABLED(MESH_BED_LEVELING)
845 867
 
846 868
   //===========================================================================
847 869
   //=================================== Mesh ==================================
848 870
   //===========================================================================
849 871
 
850
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
851 872
   #define MESH_INSET 10          // Mesh inset margin on print area
852 873
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
853 874
   #define MESH_NUM_Y_POINTS 3
@@ -855,28 +876,13 @@
855 876
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
856 877
 
857 878
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
879
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
858 880
 
859 881
   #if ENABLED(MANUAL_BED_LEVELING)
860 882
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
861 883
   #endif
862 884
 
863
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
864
-
865
-  //===========================================================================
866
-  //========================= Unified Bed Leveling ============================
867
-  //===========================================================================
868
-
869
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
870
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
871
-  #define UBL_MESH_NUM_Y_POINTS 10
872
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
873
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
874
-  #define UBL_PROBE_PT_2_X 39
875
-  #define UBL_PROBE_PT_2_Y 20
876
-  #define UBL_PROBE_PT_3_X 180
877
-  #define UBL_PROBE_PT_3_Y 20
878
-
879
-#endif  // BED_LEVELING
885
+#endif // BED_LEVELING
880 886
 
881 887
 /**
882 888
  * Commands to execute at the end of G29 probing.

+ 167
- 163
Marlin/G26_Mesh_Validation_Tool.cpp View File

@@ -32,7 +32,7 @@
32 32
 #define PRIME_LENGTH 10.0           // So, we put these number in an easy to find and change place.
33 33
 #define BED_TEMP 60.0
34 34
 #define HOTEND_TEMP 205.0
35
-#define OOOOZE_AMOUNT 0.3
35
+#define OOZE_AMOUNT 0.3
36 36
 
37 37
 #include "Marlin.h"
38 38
 #include "Configuration.h"
@@ -111,7 +111,7 @@
111 111
    *   Y #  Y coordinate  Specify the starting location of the drawing activity.
112 112
    */
113 113
 
114
-  extern int UBL_has_control_of_LCD_Panel;
114
+  extern bool ubl_has_control_of_lcd_panel;
115 115
   extern float feedrate;
116 116
   //extern bool relative_mode;
117 117
   extern Planner planner;
@@ -141,12 +141,12 @@
141 141
   bool prime_nozzle();
142 142
   void chirp_at_user();
143 143
 
144
-  static uint16_t circle_flags[16], horizontal_mesh_line_flags[16], vertical_mesh_line_flags[16], Continue_with_closest = 0;
145
-  float G26_E_AXIS_feedrate = 0.020,
146
-        Random_Deviation = 0.0,
147
-        Layer_Height = LAYER_HEIGHT;
144
+  static uint16_t circle_flags[16], horizontal_mesh_line_flags[16], vertical_mesh_line_flags[16], continue_with_closest = 0;
145
+  float g26_e_axis_feedrate = 0.020,
146
+        random_deviation = 0.0,
147
+        layer_height = LAYER_HEIGHT;
148 148
 
149
-  bool G26_retracted = false; // We keep track of the state of the nozzle to know if it
149
+  bool g26_retracted = false; // We keep track of the state of the nozzle to know if it
150 150
                               // is currently retracted or not.  This allows us to be
151 151
                               // less careful because mis-matched retractions and un-retractions
152 152
                               // won't leave us in a bad state.
@@ -157,24 +157,24 @@
157 157
   float valid_trig_angle(float);
158 158
   mesh_index_pair find_closest_circle_to_print(float, float);
159 159
   void debug_current_and_destination(char *title);
160
-  void UBL_line_to_destination(const float&, const float&, const float&, const float&, const float&, uint8_t);
160
+  void ubl_line_to_destination(const float&, const float&, const float&, const float&, const float&, uint8_t);
161 161
   //uint16_t x_splits = 0xFFFF, uint16_t y_splits = 0xFFFF);  /* needed for the old mesh_buffer_line() routine */
162 162
 
163
-  static float E_Pos_Delta,
164
-               Extrusion_Multiplier = EXTRUSION_MULTIPLIER,
165
-               Retraction_Multiplier = RETRACTION_MULTIPLIER,
166
-               Nozzle = NOZZLE,
167
-               Filament = FILAMENT,
168
-               Prime_Length = PRIME_LENGTH,
169
-               X_Pos, Y_Pos,
163
+  static float extrusion_multiplier = EXTRUSION_MULTIPLIER,
164
+               retraction_multiplier = RETRACTION_MULTIPLIER,
165
+               nozzle = NOZZLE,
166
+               filament_diameter = FILAMENT,
167
+               prime_length = PRIME_LENGTH,
168
+               x_pos, y_pos,
170 169
                bed_temp = BED_TEMP,
171 170
                hotend_temp = HOTEND_TEMP,
172
-               Ooooze_Amount = OOOOZE_AMOUNT;
171
+               ooze_amount = OOZE_AMOUNT;
173 172
 
174
-  int8_t Prime_Flag = 0;
173
+  int8_t prime_flag = 0;
175 174
 
176
-  bool Keep_Heaters_On = false,
177
-       G26_Debug_flag = false;
175
+  bool keep_heaters_on = false;
176
+
177
+  bool g26_debug_flag = false;
178 178
 
179 179
   /**
180 180
    * These support functions allow the use of large bit arrays of flags that take very
@@ -217,17 +217,17 @@
217 217
     current_position[E_AXIS] = 0.0;
218 218
     sync_plan_position_e();
219 219
 
220
-    if (Prime_Flag && prime_nozzle())       // if prime_nozzle() returns an error, we just bail out.
220
+    if (prime_flag && prime_nozzle())       // if prime_nozzle() returns an error, we just bail out.
221 221
       goto LEAVE;
222 222
 
223 223
     /**
224
-     *      Bed is preheated
224
+     *  Bed is preheated
225 225
      *
226
-     *      Nozzle is at temperature
226
+     *  Nozzle is at temperature
227 227
      *
228
-     *      Filament is primed!
228
+     *  Filament is primed!
229 229
      *
230
-     *      It's  "Show Time" !!!
230
+     *  It's  "Show Time" !!!
231 231
      */
232 232
 
233 233
     // Clear all of the flags we need
@@ -239,17 +239,19 @@
239 239
     // Move nozzle to the specified height for the first layer
240 240
     //
241 241
     set_destination_to_current();
242
-    destination[Z_AXIS] = Layer_Height;
242
+    destination[Z_AXIS] = layer_height;
243 243
     move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], 0.0);
244
-    move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], Ooooze_Amount);
244
+    move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], ooze_amount);
245
+
246
+    ubl_has_control_of_lcd_panel++; // Take control of the LCD Panel!
247
+    debug_current_and_destination((char*)"Starting G26 Mesh Validation Pattern.");
245 248
 
246
-    UBL_has_control_of_LCD_Panel = 1; // Take control of the LCD Panel!
247
-    debug_current_and_destination((char *)"Starting G26 Mesh Validation Pattern.");
249
+    wait_for_user = true;
248 250
 
249 251
     do {
250
-      if (G29_lcd_clicked()) {                                 // Check if the user wants to stop the Mesh Validation
252
+
253
+      if (!wait_for_user) {                                     // Check if the user wants to stop the Mesh Validation
251 254
         strcpy(lcd_status_message, "Mesh Validation Stopped."); // We can't do lcd_setstatus() without having it continue;
252
-        while (G29_lcd_clicked()) idle(); // Debounce the switch click
253 255
         #if ENABLED(ULTRA_LCD)
254 256
           lcd_setstatus("Mesh Validation Stopped.", true);
255 257
           lcd_quick_feedback();
@@ -257,14 +259,14 @@
257 259
         goto LEAVE;
258 260
       }
259 261
 
260
-      if (Continue_with_closest)
262
+      if (continue_with_closest)
261 263
         location = find_closest_circle_to_print(current_position[X_AXIS], current_position[Y_AXIS]);
262 264
       else
263
-        location = find_closest_circle_to_print(X_Pos, Y_Pos); // Find the closest Mesh Intersection to where we are now.
265
+        location = find_closest_circle_to_print(x_pos, y_pos); // Find the closest Mesh Intersection to where we are now.
264 266
 
265 267
       if (location.x_index >= 0 && location.y_index >= 0) {
266
-        circle_x = blm.map_x_index_to_bed_location(location.x_index);
267
-        circle_y = blm.map_y_index_to_bed_location(location.y_index);
268
+        circle_x = ubl.map_x_index_to_bed_location(location.x_index);
269
+        circle_y = ubl.map_y_index_to_bed_location(location.y_index);
268 270
 
269 271
         // Let's do a couple of quick sanity checks.  We can pull this code out later if we never see it catch a problem
270 272
         #ifdef DELTA
@@ -282,7 +284,7 @@
282 284
         xi = location.x_index;  // Just to shrink the next few lines and make them easier to understand
283 285
         yi = location.y_index;
284 286
 
285
-        if (G26_Debug_flag) {
287
+        if (g26_debug_flag) {
286 288
           SERIAL_ECHOPGM("   Doing circle at: (xi=");
287 289
           SERIAL_ECHO(xi);
288 290
           SERIAL_ECHOPGM(", yi=");
@@ -322,14 +324,13 @@
322 324
          * the CPU load and make the arc drawing faster and more smooth
323 325
          */
324 326
         float sin_table[360 / 30 + 1], cos_table[360 / 30 + 1];
325
-        int tmp_div_30;
326 327
         for (i = 0; i <= 360 / 30; i++) {
327 328
           cos_table[i] = SIZE_OF_INTERSECTION_CIRCLES * cos(RADIANS(valid_trig_angle(i * 30.0)));
328 329
           sin_table[i] = SIZE_OF_INTERSECTION_CIRCLES * sin(RADIANS(valid_trig_angle(i * 30.0)));
329 330
         }
330 331
 
331 332
         for (tmp = start_angle; tmp < end_angle - 0.1; tmp += 30.0) {
332
-          tmp_div_30 = tmp / 30.0;
333
+          int tmp_div_30 = tmp / 30.0;
333 334
           if (tmp_div_30 < 0) tmp_div_30 += 360 / 30;
334 335
 
335 336
           x = circle_x + cos_table[tmp_div_30];    // for speed, these are now a lookup table entry
@@ -348,18 +349,18 @@
348 349
             ye = constrain(ye, Y_MIN_POS + 1, Y_MAX_POS - 1);
349 350
           #endif
350 351
 
351
-          if (G26_Debug_flag) {
352
+          if (g26_debug_flag) {
352 353
             char ccc, *cptr, seg_msg[50], seg_num[10];
353 354
             strcpy(seg_msg, "   segment: ");
354 355
             strcpy(seg_num, "    \n");
355
-            cptr = (char *) "01234567890ABCDEF????????";
356
+            cptr = (char*) "01234567890ABCDEF????????";
356 357
             ccc = cptr[tmp_div_30];
357 358
             seg_num[1] = ccc;
358 359
             strcat(seg_msg, seg_num);
359 360
             debug_current_and_destination(seg_msg);
360 361
           }
361 362
 
362
-          print_line_from_here_to_there(x, y, Layer_Height, xe, ye, Layer_Height);
363
+          print_line_from_here_to_there(x, y, layer_height, xe, ye, layer_height);
363 364
         }
364 365
         lcd_init_counter++;
365 366
         if (lcd_init_counter > 10) {
@@ -367,35 +368,37 @@
367 368
           lcd_init(); // Some people's LCD Displays are locking up.  This might help them
368 369
         }
369 370
 
370
-        debug_current_and_destination((char *)"Looking for lines to connect.");
371
+        debug_current_and_destination((char*)"Looking for lines to connect.");
371 372
         look_for_lines_to_connect();
372
-        debug_current_and_destination((char *)"Done with line connect.");
373
+        debug_current_and_destination((char*)"Done with line connect.");
373 374
       }
374 375
 
375
-      debug_current_and_destination((char *)"Done with current circle.");
376
+      debug_current_and_destination((char*)"Done with current circle.");
376 377
 
377 378
     }
378
-    while (location.x_index >= 0 && location.y_index >= 0) ;
379
+    while (location.x_index >= 0 && location.y_index >= 0);
379 380
 
380 381
     LEAVE:
381 382
 
383
+    wait_for_user = false;
384
+
382 385
     retract_filament();
383 386
     destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES;                             // Raise the nozzle
384 387
 
385
-    debug_current_and_destination((char *)"ready to do Z-Raise.");
388
+    debug_current_and_destination((char*)"ready to do Z-Raise.");
386 389
     move_to( destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], 0); // Raise the nozzle
387
-    debug_current_and_destination((char *)"done doing Z-Raise.");
390
+    debug_current_and_destination((char*)"done doing Z-Raise.");
388 391
 
389
-    destination[X_AXIS] = X_Pos;                                                // Move back to the starting position
390
-    destination[Y_AXIS] = Y_Pos;
392
+    destination[X_AXIS] = x_pos;                                                // Move back to the starting position
393
+    destination[Y_AXIS] = y_pos;
391 394
     destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES;                             // Keep the nozzle where it is
392 395
 
393 396
     move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], 0); // Move back to the starting position
394
-    debug_current_and_destination((char *)"done doing X/Y move.");
397
+    debug_current_and_destination((char*)"done doing X/Y move.");
395 398
 
396
-    UBL_has_control_of_LCD_Panel = 0;     // Give back control of the LCD Panel!
399
+    ubl_has_control_of_lcd_panel = false;     // Give back control of the LCD Panel!
397 400
 
398
-    if (!Keep_Heaters_On) {
401
+    if (!keep_heaters_on) {
399 402
       #if HAS_TEMP_BED
400 403
         thermalManager.setTargetBed(0.0);
401 404
       #endif
@@ -419,23 +422,23 @@
419 422
 
420 423
     for (uint8_t i = 0; i < UBL_MESH_NUM_X_POINTS; i++) {
421 424
       for (uint8_t j = 0; j < UBL_MESH_NUM_Y_POINTS; j++) {
422
-        if (!is_bit_set(circle_flags, i, j))  {
423
-          mx = blm.map_x_index_to_bed_location(i);  // We found a circle that needs to be printed
424
-          my = blm.map_y_index_to_bed_location(j);
425
+        if (!is_bit_set(circle_flags, i, j)) {
426
+          mx = ubl.map_x_index_to_bed_location(i);  // We found a circle that needs to be printed
427
+          my = ubl.map_y_index_to_bed_location(j);
425 428
 
426 429
           dx = X - mx;        // Get the distance to this intersection
427 430
           dy = Y - my;
428 431
           f = HYPOT(dx, dy);
429 432
 
430
-          dx = X_Pos - mx;                  // It is possible that we are being called with the values
431
-          dy = Y_Pos - my;                  // to let us find the closest circle to the start position.
433
+          dx = x_pos - mx;                  // It is possible that we are being called with the values
434
+          dy = y_pos - my;                  // to let us find the closest circle to the start position.
432 435
           f += HYPOT(dx, dy) / 15.0;        // But if this is not the case,
433 436
                                             // we are going to add in a small
434 437
                                             // weighting to the distance calculation to help it choose
435 438
                                             // a better place to continue.
436 439
 
437
-          if (Random_Deviation > 1.0)
438
-            f += random(0.0, Random_Deviation); // Add in the specified amount of Random Noise to our search
440
+          if (random_deviation > 1.0)
441
+            f += random(0.0, random_deviation); // Add in the specified amount of Random Noise to our search
439 442
 
440 443
           if (f < closest) {
441 444
             closest = f;              // We found a closer location that is still
@@ -457,7 +460,7 @@
457 460
       for (uint8_t j = 0; j < UBL_MESH_NUM_Y_POINTS; j++) {
458 461
 
459 462
         if (i < UBL_MESH_NUM_X_POINTS) { // We can't connect to anything to the right than UBL_MESH_NUM_X_POINTS.
460
-                                      // This is already a half circle because we are at the edge of the bed.
463
+                                         // This is already a half circle because we are at the edge of the bed.
461 464
 
462 465
           if (is_bit_set(circle_flags, i, j) && is_bit_set(circle_flags, i + 1, j)) { // check if we can do a line to the left
463 466
             if (!is_bit_set(horizontal_mesh_line_flags, i, j)) {
@@ -466,11 +469,11 @@
466 469
               // We found two circles that need a horizontal line to connect them
467 470
               // Print it!
468 471
               //
469
-              sx = blm.map_x_index_to_bed_location(i);
472
+              sx = ubl.map_x_index_to_bed_location(i);
470 473
               sx = sx + SIZE_OF_INTERSECTION_CIRCLES - SIZE_OF_CROSS_HAIRS; // get the right edge of the circle
471
-              sy = blm.map_y_index_to_bed_location(j);
474
+              sy = ubl.map_y_index_to_bed_location(j);
472 475
 
473
-              ex = blm.map_x_index_to_bed_location(i + 1);
476
+              ex = ubl.map_x_index_to_bed_location(i + 1);
474 477
               ex = ex - SIZE_OF_INTERSECTION_CIRCLES + SIZE_OF_CROSS_HAIRS; // get the left edge of the circle
475 478
               ey = sy;
476 479
 
@@ -479,7 +482,7 @@
479 482
               ex = constrain(ex, X_MIN_POS + 1, X_MAX_POS - 1);
480 483
               ey = constrain(ey, Y_MIN_POS + 1, Y_MAX_POS - 1);
481 484
 
482
-              if (G26_Debug_flag) {
485
+              if (g26_debug_flag) {
483 486
                 SERIAL_ECHOPGM(" Connecting with horizontal line (sx=");
484 487
                 SERIAL_ECHO(sx);
485 488
                 SERIAL_ECHOPGM(", sy=");
@@ -489,16 +492,16 @@
489 492
                 SERIAL_ECHOPGM(", ey=");
490 493
                 SERIAL_ECHO(ey);
491 494
                 SERIAL_ECHOLNPGM(")");
492
-                debug_current_and_destination((char *)"Connecting horizontal line.");
495
+                debug_current_and_destination((char*)"Connecting horizontal line.");
493 496
               }
494 497
 
495
-              print_line_from_here_to_there(sx, sy, Layer_Height, ex, ey, Layer_Height);
498
+              print_line_from_here_to_there(sx, sy, layer_height, ex, ey, layer_height);
496 499
               bit_set(horizontal_mesh_line_flags, i, j);   // Mark it as done so we don't do it again
497 500
             }
498 501
           }
499 502
 
500 503
           if (j < UBL_MESH_NUM_Y_POINTS) { // We can't connect to anything further back than UBL_MESH_NUM_Y_POINTS.
501
-                                        // This is already a half circle because we are at the edge  of the bed.
504
+                                           // This is already a half circle because we are at the edge  of the bed.
502 505
 
503 506
             if (is_bit_set(circle_flags, i, j) && is_bit_set(circle_flags, i, j + 1)) { // check if we can do a line straight down
504 507
               if (!is_bit_set( vertical_mesh_line_flags, i, j)) {
@@ -506,12 +509,12 @@
506 509
                 // We found two circles that need a vertical line to connect them
507 510
                 // Print it!
508 511
                 //
509
-                sx = blm.map_x_index_to_bed_location(i);
510
-                sy = blm.map_y_index_to_bed_location(j);
512
+                sx = ubl.map_x_index_to_bed_location(i);
513
+                sy = ubl.map_y_index_to_bed_location(j);
511 514
                 sy = sy + SIZE_OF_INTERSECTION_CIRCLES - SIZE_OF_CROSS_HAIRS; // get the top edge of the circle
512 515
 
513 516
                 ex = sx;
514
-                ey = blm.map_y_index_to_bed_location(j + 1);
517
+                ey = ubl.map_y_index_to_bed_location(j + 1);
515 518
                 ey = ey - SIZE_OF_INTERSECTION_CIRCLES + SIZE_OF_CROSS_HAIRS; // get the bottom edge of the circle
516 519
 
517 520
                 sx = constrain(sx, X_MIN_POS + 1, X_MAX_POS - 1);             // This keeps us from bumping the endstops
@@ -519,7 +522,7 @@
519 522
                 ex = constrain(ex, X_MIN_POS + 1, X_MAX_POS - 1);
520 523
                 ey = constrain(ey, Y_MIN_POS + 1, Y_MAX_POS - 1);
521 524
 
522
-                if (G26_Debug_flag) {
525
+                if (g26_debug_flag) {
523 526
                   SERIAL_ECHOPGM(" Connecting with vertical line (sx=");
524 527
                   SERIAL_ECHO(sx);
525 528
                   SERIAL_ECHOPGM(", sy=");
@@ -529,9 +532,9 @@
529 532
                   SERIAL_ECHOPGM(", ey=");
530 533
                   SERIAL_ECHO(ey);
531 534
                   SERIAL_ECHOLNPGM(")");
532
-                  debug_current_and_destination((char *)"Connecting vertical line.");
535
+                  debug_current_and_destination((char*)"Connecting vertical line.");
533 536
                 }
534
-                print_line_from_here_to_there(sx, sy, Layer_Height, ex, ey, Layer_Height);
537
+                print_line_from_here_to_there(sx, sy, layer_height, ex, ey, layer_height);
535 538
                 bit_set( vertical_mesh_line_flags, i, j);   // Mark it as done so we don't do it again
536 539
               }
537 540
             }
@@ -545,8 +548,8 @@
545 548
     float dx, dy, de, xy_dist, fpmm;
546 549
 
547 550
     // if the title message starts with a '!' it is so important, we are going to
548
-    // ignore the status of the G26_Debug_Flag
549
-    if (*title != '!' && !G26_Debug_flag) return;
551
+    // ignore the status of the g26_debug_flag
552
+    if (*title != '!' && !g26_debug_flag) return;
550 553
 
551 554
     dx = current_position[X_AXIS] - destination[X_AXIS];
552 555
     dy = current_position[Y_AXIS] - destination[Y_AXIS];
@@ -563,43 +566,43 @@
563 566
     else {
564 567
       SERIAL_ECHOPGM("   fpmm=");
565 568
       fpmm = de / xy_dist;
566
-      SERIAL_PROTOCOL_F(fpmm, 6);
569
+      SERIAL_ECHO_F(fpmm, 6);
567 570
     }
568 571
 
569 572
     SERIAL_ECHOPGM("    current=( ");
570
-    SERIAL_PROTOCOL_F(current_position[X_AXIS], 6);
573
+    SERIAL_ECHO_F(current_position[X_AXIS], 6);
571 574
     SERIAL_ECHOPGM(", ");
572
-    SERIAL_PROTOCOL_F(current_position[Y_AXIS], 6);
575
+    SERIAL_ECHO_F(current_position[Y_AXIS], 6);
573 576
     SERIAL_ECHOPGM(", ");
574
-    SERIAL_PROTOCOL_F(current_position[Z_AXIS], 6);
577
+    SERIAL_ECHO_F(current_position[Z_AXIS], 6);
575 578
     SERIAL_ECHOPGM(", ");
576
-    SERIAL_PROTOCOL_F(current_position[E_AXIS], 6);
579
+    SERIAL_ECHO_F(current_position[E_AXIS], 6);
577 580
     SERIAL_ECHOPGM(" )   destination=( ");
578 581
     if (current_position[X_AXIS] == destination[X_AXIS])
579 582
       SERIAL_ECHOPGM("-------------");
580 583
     else
581
-      SERIAL_PROTOCOL_F(destination[X_AXIS], 6);
584
+      SERIAL_ECHO_F(destination[X_AXIS], 6);
582 585
 
583 586
     SERIAL_ECHOPGM(", ");
584 587
 
585 588
     if (current_position[Y_AXIS] == destination[Y_AXIS])
586 589
       SERIAL_ECHOPGM("-------------");
587 590
     else
588
-      SERIAL_PROTOCOL_F(destination[Y_AXIS], 6);
591
+      SERIAL_ECHO_F(destination[Y_AXIS], 6);
589 592
 
590 593
     SERIAL_ECHOPGM(", ");
591 594
 
592 595
     if (current_position[Z_AXIS] == destination[Z_AXIS])
593 596
       SERIAL_ECHOPGM("-------------");
594 597
     else
595
-      SERIAL_PROTOCOL_F(destination[Z_AXIS], 6);
598
+      SERIAL_ECHO_F(destination[Z_AXIS], 6);
596 599
 
597 600
     SERIAL_ECHOPGM(", ");
598 601
 
599 602
     if (current_position[E_AXIS] == destination[E_AXIS])
600 603
       SERIAL_ECHOPGM("-------------");
601 604
     else
602
-      SERIAL_PROTOCOL_F(destination[E_AXIS], 6);
605
+      SERIAL_ECHO_F(destination[E_AXIS], 6);
603 606
 
604 607
     SERIAL_ECHOPGM(" )   ");
605 608
     SERIAL_ECHO(title);
@@ -617,16 +620,16 @@
617 620
     float feed_value;
618 621
     static float last_z = -999.99;
619 622
 
620
-    bool has_XY_component = (x != current_position[X_AXIS] || y != current_position[Y_AXIS]); // Check if X or Y is involved in the movement.
623
+    bool has_xy_component = (x != current_position[X_AXIS] || y != current_position[Y_AXIS]); // Check if X or Y is involved in the movement.
621 624
 
622
-    if (G26_Debug_flag) {
623
-      SERIAL_ECHOPAIR("in move_to()  has_XY_component:", (int)has_XY_component);
625
+    if (g26_debug_flag) {
626
+      SERIAL_ECHOPAIR("in move_to()  has_xy_component:", (int)has_xy_component);
624 627
       SERIAL_EOL;
625 628
     }
626 629
 
627 630
     if (z != last_z) {
628 631
 
629
-      if (G26_Debug_flag) {
632
+      if (g26_debug_flag) {
630 633
         SERIAL_ECHOPAIR("in move_to()  changing Z to ", (int)z);
631 634
         SERIAL_EOL;
632 635
       }
@@ -638,20 +641,20 @@
638 641
       destination[Z_AXIS] = z;                          // We know the last_z==z or we wouldn't be in this block of code.
639 642
       destination[E_AXIS] = current_position[E_AXIS];
640 643
 
641
-      UBL_line_to_destination(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_value, 0);
644
+      ubl_line_to_destination(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_value, 0);
642 645
 
643 646
       stepper.synchronize();
644 647
       set_destination_to_current();
645 648
 
646
-      if (G26_Debug_flag)
647
-        debug_current_and_destination((char *)" in move_to() done with Z move");
649
+      if (g26_debug_flag)
650
+        debug_current_and_destination((char*)" in move_to() done with Z move");
648 651
     }
649 652
 
650 653
     // Check if X or Y is involved in the movement.
651 654
     // Yes: a 'normal' movement. No: a retract() or un_retract()
652
-    feed_value = has_XY_component ? PLANNER_XY_FEEDRATE() / 10.0 : planner.max_feedrate_mm_s[E_AXIS] / 1.5;
655
+    feed_value = has_xy_component ? PLANNER_XY_FEEDRATE() / 10.0 : planner.max_feedrate_mm_s[E_AXIS] / 1.5;
653 656
 
654
-    if (G26_Debug_flag) {
657
+    if (g26_debug_flag) {
655 658
       SERIAL_ECHOPAIR("in move_to() feed_value for XY:", feed_value);
656 659
       SERIAL_EOL;
657 660
     }
@@ -660,32 +663,32 @@
660 663
     destination[Y_AXIS] = y;
661 664
     destination[E_AXIS] += e_delta;
662 665
 
663
-    if (G26_Debug_flag)
664
-      debug_current_and_destination((char *)" in move_to() doing last move");
666
+    if (g26_debug_flag)
667
+      debug_current_and_destination((char*)" in move_to() doing last move");
665 668
 
666
-    UBL_line_to_destination(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_value, 0);
669
+    ubl_line_to_destination(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_value, 0);
667 670
 
668
-    if (G26_Debug_flag)
669
-      debug_current_and_destination((char *)" in move_to() after last move");
671
+    if (g26_debug_flag)
672
+      debug_current_and_destination((char*)" in move_to() after last move");
670 673
 
671 674
     stepper.synchronize();
672 675
     set_destination_to_current();
673 676
   }
674 677
 
675 678
   void retract_filament() {
676
-    if (!G26_retracted) { // Only retract if we are not already retracted!
677
-      G26_retracted = true;
678
-      if (G26_Debug_flag) SERIAL_ECHOLNPGM(" Decided to do retract.");
679
-      move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], -1.0 * Retraction_Multiplier);
680
-      if (G26_Debug_flag) SERIAL_ECHOLNPGM(" Retraction done.");
679
+    if (!g26_retracted) { // Only retract if we are not already retracted!
680
+      g26_retracted = true;
681
+      if (g26_debug_flag) SERIAL_ECHOLNPGM(" Decided to do retract.");
682
+      move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], -1.0 * retraction_multiplier);
683
+      if (g26_debug_flag) SERIAL_ECHOLNPGM(" Retraction done.");
681 684
     }
682 685
   }
683 686
 
684 687
   void un_retract_filament() {
685
-    if (G26_retracted) { // Only un-retract if we are retracted.
686
-      move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], 1.2 * Retraction_Multiplier);
687
-      G26_retracted = false;
688
-      if (G26_Debug_flag) SERIAL_ECHOLNPGM(" unretract done.");
688
+    if (g26_retracted) { // Only un-retract if we are retracted.
689
+      move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], 1.2 * retraction_multiplier);
690
+      g26_retracted = false;
691
+      if (g26_debug_flag) SERIAL_ECHOLNPGM(" unretract done.");
689 692
     }
690 693
   }
691 694
 
@@ -724,7 +727,7 @@
724 727
     // On very small lines we don't do the optimization because it just isn't worth it.
725 728
     //
726 729
     if (dist_end < dist_start && (SIZE_OF_INTERSECTION_CIRCLES) < abs(Line_Length)) {
727
-      if (G26_Debug_flag)
730
+      if (g26_debug_flag)
728 731
         SERIAL_ECHOLNPGM("  Reversing start and end of print_line_from_here_to_there()");
729 732
       print_line_from_here_to_there(ex, ey, ez, sx, sy, sz);
730 733
       return;
@@ -734,19 +737,19 @@
734 737
 
735 738
     if (dist_start > 2.0) {
736 739
       retract_filament();
737
-      if (G26_Debug_flag)
740
+      if (g26_debug_flag)
738 741
         SERIAL_ECHOLNPGM("  filament retracted.");
739 742
     }
740 743
     move_to(sx, sy, sz, 0.0); // Get to the starting point with no extrusion
741 744
 
742
-    E_Pos_Delta = Line_Length * G26_E_AXIS_feedrate * Extrusion_Multiplier;
745
+    float e_pos_delta = Line_Length * g26_e_axis_feedrate * extrusion_multiplier;
743 746
 
744 747
     un_retract_filament();
745
-    if (G26_Debug_flag) {
748
+    if (g26_debug_flag) {
746 749
       SERIAL_ECHOLNPGM("  doing printing move.");
747
-      debug_current_and_destination((char *)"doing final move_to() inside print_line_from_here_to_there()");
750
+      debug_current_and_destination((char*)"doing final move_to() inside print_line_from_here_to_there()");
748 751
     }
749
-    move_to(ex, ey, ez, E_Pos_Delta);  // Get to the ending point with an appropriate amount of extrusion
752
+    move_to(ex, ey, ez, e_pos_delta);  // Get to the ending point with an appropriate amount of extrusion
750 753
   }
751 754
 
752 755
   /**
@@ -756,17 +759,17 @@
756 759
    */
757 760
   bool parse_G26_parameters() {
758 761
 
759
-    Extrusion_Multiplier  = EXTRUSION_MULTIPLIER;
760
-    Retraction_Multiplier = RETRACTION_MULTIPLIER;
761
-    Nozzle                = NOZZLE;
762
-    Filament              = FILAMENT;
763
-    Layer_Height          = LAYER_HEIGHT;
764
-    Prime_Length          = PRIME_LENGTH;
762
+    extrusion_multiplier  = EXTRUSION_MULTIPLIER;
763
+    retraction_multiplier = RETRACTION_MULTIPLIER;
764
+    nozzle                = NOZZLE;
765
+    filament_diameter     = FILAMENT;
766
+    layer_height          = LAYER_HEIGHT;
767
+    prime_length          = PRIME_LENGTH;
765 768
     bed_temp              = BED_TEMP;
766 769
     hotend_temp           = HOTEND_TEMP;
767
-    Ooooze_Amount         = OOOOZE_AMOUNT;
768
-    Prime_Flag            = 0;
769
-    Keep_Heaters_On       = false;
770
+    ooze_amount           = OOZE_AMOUNT;
771
+    prime_flag            = 0;
772
+    keep_heaters_on       = false;
770 773
 
771 774
     if (code_seen('B')) {
772 775
       bed_temp = code_value_float();
@@ -776,11 +779,11 @@
776 779
       }
777 780
     }
778 781
 
779
-    if (code_seen('C')) Continue_with_closest++;
782
+    if (code_seen('C')) continue_with_closest++;
780 783
 
781 784
     if (code_seen('L')) {
782
-      Layer_Height = code_value_float();
783
-      if (Layer_Height<0.0 || Layer_Height>2.0) {
785
+      layer_height = code_value_float();
786
+      if (layer_height < 0.0 || layer_height > 2.0) {
784 787
         SERIAL_PROTOCOLLNPGM("?Specified layer height not plausible.");
785 788
         return UBL_ERR;
786 789
       }
@@ -788,8 +791,8 @@
788 791
 
789 792
     if (code_seen('Q')) {
790 793
       if (code_has_value()) {
791
-        Retraction_Multiplier = code_value_float();
792
-        if (Retraction_Multiplier<.05 || Retraction_Multiplier>15.0) {
794
+        retraction_multiplier = code_value_float();
795
+        if (retraction_multiplier < 0.05 || retraction_multiplier > 15.0) {
793 796
           SERIAL_PROTOCOLLNPGM("?Specified Retraction Multiplier not plausible.");
794 797
           return UBL_ERR;
795 798
         }
@@ -801,25 +804,25 @@
801 804
     }
802 805
 
803 806
     if (code_seen('N')) {
804
-      Nozzle = code_value_float();
805
-      if (Nozzle < 0.1 || Nozzle > 1.0) {
807
+      nozzle = code_value_float();
808
+      if (nozzle < 0.1 || nozzle > 1.0) {
806 809
         SERIAL_PROTOCOLLNPGM("?Specified nozzle size not plausible.");
807 810
         return UBL_ERR;
808 811
       }
809 812
     }
810 813
 
811
-    if (code_seen('K')) Keep_Heaters_On++;
814
+    if (code_seen('K')) keep_heaters_on++;
812 815
 
813 816
     if (code_seen('O') && code_has_value())
814
-      Ooooze_Amount = code_value_float();
817
+      ooze_amount = code_value_float();
815 818
 
816 819
     if (code_seen('P')) {
817 820
       if (!code_has_value())
818
-        Prime_Flag = -1;
821
+        prime_flag = -1;
819 822
       else {
820
-        Prime_Flag++;
821
-        Prime_Length = code_value_float();
822
-        if (Prime_Length < 0.0 || Prime_Length > 25.0) {
823
+        prime_flag++;
824
+        prime_length = code_value_float();
825
+        if (prime_length < 0.0 || prime_length > 25.0) {
823 826
           SERIAL_PROTOCOLLNPGM("?Specified prime length not plausible.");
824 827
           return UBL_ERR;
825 828
         }
@@ -827,16 +830,17 @@
827 830
     }
828 831
 
829 832
     if (code_seen('F')) {
830
-      Filament = code_value_float();
831
-      if (Filament < 1.0 || Filament > 4.0) {
833
+      filament_diameter = code_value_float();
834
+      if (filament_diameter < 1.0 || filament_diameter > 4.0) {
832 835
         SERIAL_PROTOCOLLNPGM("?Specified filament size not plausible.");
833 836
         return UBL_ERR;
834 837
       }
835 838
     }
836
-    Extrusion_Multiplier *= sq(1.75) / sq(Filament);  // If we aren't using 1.75mm filament, we need to
837
-                                                              // scale up or down the length needed to get the
838
-                                                              // same volume of filament
839
-    Extrusion_Multiplier *= Filament * sq(Nozzle) / sq(0.3); // Scale up by nozzle size
839
+    extrusion_multiplier *= sq(1.75) / sq(filament_diameter);         // If we aren't using 1.75mm filament, we need to
840
+                                                                      // scale up or down the length needed to get the
841
+                                                                      // same volume of filament
842
+
843
+    extrusion_multiplier *= filament_diameter * sq(nozzle) / sq(0.3); // Scale up by nozzle size
840 844
 
841 845
     if (code_seen('H')) {
842 846
       hotend_temp = code_value_float();
@@ -848,15 +852,15 @@
848 852
 
849 853
     if (code_seen('R')) {
850 854
       randomSeed(millis());
851
-      Random_Deviation = code_has_value() ? code_value_float() : 50.0;
855
+      random_deviation = code_has_value() ? code_value_float() : 50.0;
852 856
     }
853 857
 
854
-    X_Pos = current_position[X_AXIS];
855
-    Y_Pos = current_position[Y_AXIS];
858
+    x_pos = current_position[X_AXIS];
859
+    y_pos = current_position[Y_AXIS];
856 860
 
857 861
     if (code_seen('X')) {
858
-      X_Pos = code_value_float();
859
-      if (X_Pos < X_MIN_POS || X_Pos > X_MAX_POS) {
862
+      x_pos = code_value_float();
863
+      if (x_pos < X_MIN_POS || x_pos > X_MAX_POS) {
860 864
         SERIAL_PROTOCOLLNPGM("?Specified X coordinate not plausible.");
861 865
         return UBL_ERR;
862 866
       }
@@ -864,8 +868,8 @@
864 868
     else
865 869
 
866 870
     if (code_seen('Y')) {
867
-      Y_Pos = code_value_float();
868
-      if (Y_Pos < Y_MIN_POS || Y_Pos > Y_MAX_POS) {
871
+      y_pos = code_value_float();
872
+      if (y_pos < Y_MIN_POS || y_pos > Y_MAX_POS) {
869 873
         SERIAL_PROTOCOLLNPGM("?Specified Y coordinate not plausible.");
870 874
         return UBL_ERR;
871 875
       }
@@ -877,7 +881,7 @@
877 881
      * alter the system's status.  We wait until we know everything is correct before altering the state
878 882
      * of the system.
879 883
      */
880
-    blm.state.active = !code_seen('D');
884
+    ubl.state.active = !code_seen('D');
881 885
 
882 886
     return UBL_OK;
883 887
   }
@@ -893,17 +897,18 @@
893 897
           lcd_setstatus("G26 Heating Bed.", true);
894 898
           lcd_quick_feedback();
895 899
       #endif
896
-          UBL_has_control_of_LCD_Panel++;
900
+          ubl_has_control_of_lcd_panel++;
897 901
           thermalManager.setTargetBed(bed_temp);
902
+          wait_for_user = true;
898 903
           while (abs(thermalManager.degBed() - bed_temp) > 3) {
899
-            if (G29_lcd_clicked()) {
904
+            if (!wait_for_user) {
900 905
               strcpy(lcd_status_message, "Leaving G26"); // We can't do lcd_setstatus() without having it continue;
901
-              while (G29_lcd_clicked()) idle();          // Debounce the switch
902 906
               lcd_setstatus("Leaving G26", true);        // Now we do it right.
903 907
               return UBL_ERR;
904 908
             }
905 909
             idle();
906 910
           }
911
+          wait_for_user = false;
907 912
       #if ENABLED(ULTRA_LCD)
908 913
         }
909 914
         lcd_setstatus("G26 Heating Nozzle.", true);
@@ -913,15 +918,16 @@
913 918
 
914 919
     // Start heating the nozzle and wait for it to reach temperature.
915 920
     thermalManager.setTargetHotend(hotend_temp, 0);
921
+    wait_for_user = true;
916 922
     while (abs(thermalManager.degHotend(0) - hotend_temp) > 3) {
917
-      if (G29_lcd_clicked()) {
923
+      if (!wait_for_user) {
918 924
         strcpy(lcd_status_message, "Leaving G26"); // We can't do lcd_setstatus() without having it continue;
919
-        while (G29_lcd_clicked()) idle();          // Debounce the switch
920 925
         lcd_setstatus("Leaving G26", true);        // Now we do it right.
921 926
         return UBL_ERR;
922 927
       }
923 928
       idle();
924 929
     }
930
+    wait_for_user = false;
925 931
 
926 932
     #if ENABLED(ULTRA_LCD)
927 933
       lcd_setstatus("", true);
@@ -936,8 +942,8 @@
936 942
   bool prime_nozzle() {
937 943
     float Total_Prime = 0.0;
938 944
 
939
-    if (Prime_Flag == -1) {  // The user wants to control how much filament gets purged
940
-      lcd_setstatus("User Controled Prime", true);
945
+    if (prime_flag == -1) {  // The user wants to control how much filament gets purged
946
+      lcd_setstatus("User-Controlled Prime", true);
941 947
       chirp_at_user();
942 948
 
943 949
       set_destination_to_current();
@@ -946,15 +952,15 @@
946 952
                                 // retracted().  We are here because we want to prime the nozzle.
947 953
                                 // So let's just unretract just to be sure.
948 954
 
949
-      UBL_has_control_of_LCD_Panel++;
950
-      while (!G29_lcd_clicked()) {
955
+      wait_for_user = true;
956
+      while (wait_for_user) {
951 957
         chirp_at_user();
952 958
         destination[E_AXIS] += 0.25;
953 959
         #ifdef PREVENT_LENGTHY_EXTRUDE
954 960
           Total_Prime += 0.25;
955 961
           if (Total_Prime >= EXTRUDE_MAXLENGTH) return UBL_ERR;
956 962
         #endif
957
-        UBL_line_to_destination(
963
+        ubl_line_to_destination(
958 964
           destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS],
959 965
           //planner.max_feedrate_mm_s[E_AXIS] / 15.0, 0, 0xFFFF, 0xFFFF);
960 966
           planner.max_feedrate_mm_s[E_AXIS] / 15.0, 0
@@ -971,10 +977,8 @@
971 977
       strcpy(lcd_status_message, "Done Priming"); // We can't do lcd_setstatus() without having it continue;
972 978
                                                   // So...  We cheat to get a message up.
973 979
 
974
-      while (G29_lcd_clicked()) idle(); // Debounce the switch
975
-
976 980
       #if ENABLED(ULTRA_LCD)
977
-        UBL_has_control_of_LCD_Panel = 0;
981
+        ubl_has_control_of_lcd_panel = false;
978 982
         lcd_setstatus("Done Priming", true);      // Now we do it right.
979 983
         lcd_quick_feedback();
980 984
       #endif
@@ -985,8 +989,8 @@
985 989
         lcd_quick_feedback();
986 990
       #endif
987 991
       set_destination_to_current();
988
-      destination[E_AXIS] += Prime_Length;
989
-      UBL_line_to_destination(
992
+      destination[E_AXIS] += prime_length;
993
+      ubl_line_to_destination(
990 994
         destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS],
991 995
         //planner.max_feedrate_mm_s[E_AXIS] / 15.0, 0, 0xFFFF, 0xFFFF);
992 996
         planner.max_feedrate_mm_s[E_AXIS] / 15.0, 0

+ 34
- 22
Marlin/Marlin_main.cpp View File

@@ -301,7 +301,7 @@
301 301
 #endif
302 302
 
303 303
 #if ENABLED(AUTO_BED_LEVELING_UBL)
304
-  bed_leveling blm;
304
+  unified_bed_leveling ubl;
305 305
 #endif
306 306
 
307 307
 bool Running = true;
@@ -2309,9 +2309,9 @@ static void clean_up_after_endstop_or_probe_move() {
2309 2309
           planner.unapply_leveling(current_position);
2310 2310
       }
2311 2311
     #elif ENABLED(AUTO_BED_LEVELING_UBL)
2312
-      if (blm.state.EEPROM_storage_slot == 0)  {
2313
-        blm.state.active = enable;
2314
-        blm.store_state();
2312
+      if (ubl.state.eeprom_storage_slot == 0)  {
2313
+        ubl.state.active = enable;
2314
+        ubl.store_state();
2315 2315
       }  
2316 2316
     #endif
2317 2317
   }
@@ -2486,7 +2486,7 @@ static void clean_up_after_endstop_or_probe_move() {
2486 2486
         SERIAL_PROTOCOLCHAR(' ');
2487 2487
         float offset = fn(x, y);
2488 2488
         if (offset != UNPROBED) {
2489
-          if (offset >= 0) SERIAL_CHAR('+');
2489
+          if (offset >= 0) SERIAL_PROTOCOLCHAR('+');
2490 2490
           SERIAL_PROTOCOL_F(offset, precision);
2491 2491
         }
2492 2492
         else
@@ -3258,7 +3258,9 @@ inline void gcode_G4() {
3258 3258
     #endif
3259 3259
 
3260 3260
     SERIAL_ECHOPGM("Probe: ");
3261
-    #if ENABLED(FIX_MOUNTED_PROBE)
3261
+    #if ENABLED(PROBE_MANUALLY)
3262
+      SERIAL_ECHOLNPGM("PROBE_MANUALLY");
3263
+    #elif ENABLED(FIX_MOUNTED_PROBE)
3262 3264
       SERIAL_ECHOLNPGM("FIX_MOUNTED_PROBE");
3263 3265
     #elif ENABLED(BLTOUCH)
3264 3266
       SERIAL_ECHOLNPGM("BLTOUCH");
@@ -3314,7 +3316,7 @@ inline void gcode_G4() {
3314 3316
       #endif
3315 3317
       if (planner.abl_enabled) {
3316 3318
         SERIAL_ECHOLNPGM(" (enabled)");
3317
-        #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL)
3319
+        #if ABL_PLANAR
3318 3320
           float diff[XYZ] = {
3319 3321
             stepper.get_axis_position_mm(X_AXIS) - current_position[X_AXIS],
3320 3322
             stepper.get_axis_position_mm(Y_AXIS) - current_position[Y_AXIS],
@@ -3329,12 +3331,19 @@ inline void gcode_G4() {
3329 3331
           SERIAL_ECHOPGM(" Z");
3330 3332
           if (diff[Z_AXIS] > 0) SERIAL_CHAR('+');
3331 3333
           SERIAL_ECHO(diff[Z_AXIS]);
3334
+        #elif ENABLED(AUTO_BED_LEVELING_UBL)
3335
+          SERIAL_ECHOPAIR("UBL Adjustment Z", stepper.get_axis_position_mm(Z_AXIS) - current_position[Z_AXIS]);
3332 3336
         #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
3333 3337
           SERIAL_ECHOPAIR("ABL Adjustment Z", bilinear_z_offset(current_position));
3334 3338
         #endif
3335 3339
       }
3340
+      else
3341
+        SERIAL_ECHOLNPGM(" (disabled)");
3342
+
3336 3343
       SERIAL_EOL;
3344
+
3337 3345
     #elif ENABLED(MESH_BED_LEVELING)
3346
+
3338 3347
       SERIAL_ECHOPGM("Mesh Bed Leveling");
3339 3348
       if (mbl.active()) {
3340 3349
         float lz = current_position[Z_AXIS];
@@ -3342,9 +3351,12 @@ inline void gcode_G4() {
3342 3351
         SERIAL_ECHOLNPGM(" (enabled)");
3343 3352
         SERIAL_ECHOPAIR("MBL Adjustment Z", lz);
3344 3353
       }
3354
+      else
3355
+        SERIAL_ECHOPGM(" (disabled)");
3356
+
3345 3357
       SERIAL_EOL;
3346
-    #endif
3347 3358
 
3359
+    #endif // MESH_BED_LEVELING
3348 3360
   }
3349 3361
 
3350 3362
 #endif // DEBUG_LEVELING_FEATURE
@@ -5354,7 +5366,7 @@ inline void gcode_M104() {
5354 5366
       SERIAL_PROTOCOL_F(thermalManager.degTargetHotend(target_extruder), 1);
5355 5367
       #if ENABLED(SHOW_TEMP_ADC_VALUES)
5356 5368
         SERIAL_PROTOCOLPAIR(" (", thermalManager.current_temperature_raw[target_extruder] / OVERSAMPLENR);
5357
-        SERIAL_CHAR(')');
5369
+        SERIAL_PROTOCOLCHAR(')');
5358 5370
       #endif
5359 5371
     #endif
5360 5372
     #if HAS_TEMP_BED
@@ -5364,7 +5376,7 @@ inline void gcode_M104() {
5364 5376
       SERIAL_PROTOCOL_F(thermalManager.degTargetBed(), 1);
5365 5377
       #if ENABLED(SHOW_TEMP_ADC_VALUES)
5366 5378
         SERIAL_PROTOCOLPAIR(" (", thermalManager.current_temperature_bed_raw / OVERSAMPLENR);
5367
-        SERIAL_CHAR(')');
5379
+        SERIAL_PROTOCOLCHAR(')');
5368 5380
       #endif
5369 5381
     #endif
5370 5382
     #if HOTENDS > 1
@@ -5376,7 +5388,7 @@ inline void gcode_M104() {
5376 5388
         SERIAL_PROTOCOL_F(thermalManager.degTargetHotend(e), 1);
5377 5389
         #if ENABLED(SHOW_TEMP_ADC_VALUES)
5378 5390
           SERIAL_PROTOCOLPAIR(" (", thermalManager.current_temperature_raw[e] / OVERSAMPLENR);
5379
-          SERIAL_CHAR(')');
5391
+          SERIAL_PROTOCOLCHAR(')');
5380 5392
         #endif
5381 5393
       }
5382 5394
     #endif
@@ -7132,7 +7144,7 @@ void quickstop_stepper() {
7132 7144
    *
7133 7145
    *       S[bool]   Turns leveling on or off
7134 7146
    *       Z[height] Sets the Z fade height (0 or none to disable)
7135
-   *       V[bool]   Verbose - Print the levelng grid
7147
+   *       V[bool]   Verbose - Print the leveling grid
7136 7148
    */
7137 7149
   inline void gcode_M420() {
7138 7150
     bool to_enable = false;
@@ -7150,7 +7162,7 @@ void quickstop_stepper() {
7150 7162
       #if ENABLED(MESH_BED_LEVELING)
7151 7163
         mbl.active()
7152 7164
       #elif ENABLED(AUTO_BED_LEVELING_UBL)
7153
-        blm.state.active
7165
+        ubl.state.active
7154 7166
       #else
7155 7167
         planner.abl_enabled
7156 7168
       #endif
@@ -7176,7 +7188,7 @@ void quickstop_stepper() {
7176 7188
           #endif
7177 7189
         }
7178 7190
       #elif ENABLED(AUTO_BED_LEVELING_UBL)
7179
-        blm.display_map(0);  // Right now, we only support one type of map
7191
+        ubl.display_map(0);  // Right now, we only support one type of map
7180 7192
       #elif ENABLED(MESH_BED_LEVELING)
7181 7193
         if (mbl.has_mesh()) {
7182 7194
           SERIAL_ECHOLNPGM("Mesh Bed Level data:");
@@ -8013,7 +8025,7 @@ inline void gcode_M999() {
8013 8025
 inline void invalid_extruder_error(const uint8_t &e) {
8014 8026
   SERIAL_ECHO_START;
8015 8027
   SERIAL_CHAR('T');
8016
-  SERIAL_PROTOCOL_F(e, DEC);
8028
+  SERIAL_ECHO_F(e, DEC);
8017 8029
   SERIAL_ECHOLN(MSG_INVALID_EXTRUDER);
8018 8030
 }
8019 8031
 
@@ -8616,13 +8628,13 @@ void process_next_command() {
8616 8628
       #endif // Z_MIN_PROBE_REPEATABILITY_TEST
8617 8629
 
8618 8630
       #if ENABLED(AUTO_BED_LEVELING_UBL)
8619
-        case 49: // M49: Turn on or off G26_Debug_flag for verbose output
8620
-    if (G26_Debug_flag) {
8631
+        case 49: // M49: Turn on or off g26_debug_flag for verbose output
8632
+    if (g26_debug_flag) {
8621 8633
             SERIAL_PROTOCOLPGM("UBL Debug Flag turned off.\n");
8622
-            G26_Debug_flag = 0; }
8634
+            g26_debug_flag = 0; }
8623 8635
     else {
8624 8636
             SERIAL_PROTOCOLPGM("UBL Debug Flag turned on.\n");
8625
-            G26_Debug_flag++; }
8637
+            g26_debug_flag++; }
8626 8638
           break;
8627 8639
       #endif // Z_MIN_PROBE_REPEATABILITY_TEST
8628 8640
 
@@ -9757,11 +9769,11 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
9757 9769
         }
9758 9770
         else
9759 9771
       #elif ENABLED(AUTO_BED_LEVELING_UBL)
9760
-        if (blm.state.active) {
9772
+        if (ubl.state.active) {
9761 9773
 
9762
-//        UBL_line_to_destination(MMS_SCALED(feedrate_mm_s));
9774
+//        ubl_line_to_destination(MMS_SCALED(feedrate_mm_s));
9763 9775
 
9764
-          UBL_line_to_destination(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS],
9776
+          ubl_line_to_destination(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS],
9765 9777
 //                      (feedrate*(1.0/60.0))*(feedrate_percentage*(1.0/100.0) ), active_extruder);
9766 9778
                       MMS_SCALED(feedrate_mm_s), active_extruder);
9767 9779
 

+ 34
- 26
Marlin/SanityCheck.h View File

@@ -576,17 +576,15 @@ static_assert(1 >= 0
576 576
   #endif
577 577
 
578 578
   /**
579
-   * Check if Probe_Offset * Grid Points is greater than Probing Range
579
+   * Check auto bed leveling sub-options, especially probe points
580 580
    */
581 581
   #if ABL_GRID
582 582
     #ifndef DELTA_PROBEABLE_RADIUS
583
-      // Be sure points are in the right order
584 583
       #if LEFT_PROBE_BED_POSITION > RIGHT_PROBE_BED_POSITION
585 584
         #error "LEFT_PROBE_BED_POSITION must be less than RIGHT_PROBE_BED_POSITION."
586 585
       #elif FRONT_PROBE_BED_POSITION > BACK_PROBE_BED_POSITION
587 586
         #error "FRONT_PROBE_BED_POSITION must be less than BACK_PROBE_BED_POSITION."
588 587
       #endif
589
-      // Make sure probing points are reachable
590 588
       #if LEFT_PROBE_BED_POSITION < MIN_PROBE_X
591 589
         #error "The given LEFT_PROBE_BED_POSITION can't be reached by the Z probe."
592 590
       #elif RIGHT_PROBE_BED_POSITION > MAX_PROBE_X
@@ -597,29 +595,39 @@ static_assert(1 >= 0
597 595
         #error "The given BACK_PROBE_BED_POSITION can't be reached by the Z probe."
598 596
       #endif
599 597
     #endif
600
-  #else // !ABL_GRID
601
-    #if ENABLED(AUTO_BED_LEVELING_UBL)
602
-      #ifndef EEPROM_SETTINGS
603
-        #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS. Please update your configuration."
604
-      #endif
605
-    #else // !UBL
606
-      // Check the triangulation points
607
-      #if ABL_PROBE_PT_1_X < MIN_PROBE_X || ABL_PROBE_PT_1_X > MAX_PROBE_X
608
-        #error "The given ABL_PROBE_PT_1_X can't be reached by the Z probe."
609
-      #elif ABL_PROBE_PT_2_X < MIN_PROBE_X || ABL_PROBE_PT_2_X > MAX_PROBE_X
610
-        #error "The given ABL_PROBE_PT_2_X can't be reached by the Z probe."
611
-      #elif ABL_PROBE_PT_3_X < MIN_PROBE_X || ABL_PROBE_PT_3_X > MAX_PROBE_X
612
-        #error "The given ABL_PROBE_PT_3_X can't be reached by the Z probe."
613
-      #elif ABL_PROBE_PT_1_Y < MIN_PROBE_Y || ABL_PROBE_PT_1_Y > MAX_PROBE_Y
614
-        #error "The given ABL_PROBE_PT_1_Y can't be reached by the Z probe."
615
-      #elif ABL_PROBE_PT_2_Y < MIN_PROBE_Y || ABL_PROBE_PT_2_Y > MAX_PROBE_Y
616
-        #error "The given ABL_PROBE_PT_2_Y can't be reached by the Z probe."
617
-      #elif ABL_PROBE_PT_3_Y < MIN_PROBE_Y || ABL_PROBE_PT_3_Y > MAX_PROBE_Y
618
-        #error "The given ABL_PROBE_PT_3_Y can't be reached by the Z probe."
619
-      #endif
620
-    #endif // !AUTO_BED_LEVEING_UBL
621
-
622
-  #endif // !ABL_GRID
598
+  #elif ENABLED(AUTO_BED_LEVELING_UBL)
599
+    #if DISABLED(EEPROM_SETTINGS)
600
+      #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS. Please update your configuration."
601
+    #elif UBL_MESH_NUM_X_POINTS < 3 || UBL_MESH_NUM_X_POINTS > 15 || UBL_MESH_NUM_Y_POINTS < 3 || UBL_MESH_NUM_Y_POINTS > 15
602
+      #error "UBL_MESH_NUM_[XY]_POINTS must be a whole number between 3 and 15."
603
+    #elif UBL_PROBE_PT_1_X < MIN_PROBE_X || UBL_PROBE_PT_1_X > MAX_PROBE_X
604
+      #error "The given UBL_PROBE_PT_1_X can't be reached by the Z probe."
605
+    #elif UBL_PROBE_PT_2_X < MIN_PROBE_X || UBL_PROBE_PT_2_X > MAX_PROBE_X
606
+      #error "The given UBL_PROBE_PT_2_X can't be reached by the Z probe."
607
+    #elif UBL_PROBE_PT_3_X < MIN_PROBE_X || UBL_PROBE_PT_3_X > MAX_PROBE_X
608
+      #error "The given UBL_PROBE_PT_3_X can't be reached by the Z probe."
609
+    #elif UBL_PROBE_PT_1_Y < MIN_PROBE_Y || UBL_PROBE_PT_1_Y > MAX_PROBE_Y
610
+      #error "The given UBL_PROBE_PT_1_Y can't be reached by the Z probe."
611
+    #elif UBL_PROBE_PT_2_Y < MIN_PROBE_Y || UBL_PROBE_PT_2_Y > MAX_PROBE_Y
612
+      #error "The given UBL_PROBE_PT_2_Y can't be reached by the Z probe."
613
+    #elif UBL_PROBE_PT_3_Y < MIN_PROBE_Y || UBL_PROBE_PT_3_Y > MAX_PROBE_Y
614
+      #error "The given UBL_PROBE_PT_3_Y can't be reached by the Z probe."
615
+    #endif
616
+  #else // AUTO_BED_LEVELING_3POINT
617
+    #if ABL_PROBE_PT_1_X < MIN_PROBE_X || ABL_PROBE_PT_1_X > MAX_PROBE_X
618
+      #error "The given ABL_PROBE_PT_1_X can't be reached by the Z probe."
619
+    #elif ABL_PROBE_PT_2_X < MIN_PROBE_X || ABL_PROBE_PT_2_X > MAX_PROBE_X
620
+      #error "The given ABL_PROBE_PT_2_X can't be reached by the Z probe."
621
+    #elif ABL_PROBE_PT_3_X < MIN_PROBE_X || ABL_PROBE_PT_3_X > MAX_PROBE_X
622
+      #error "The given ABL_PROBE_PT_3_X can't be reached by the Z probe."
623
+    #elif ABL_PROBE_PT_1_Y < MIN_PROBE_Y || ABL_PROBE_PT_1_Y > MAX_PROBE_Y
624
+      #error "The given ABL_PROBE_PT_1_Y can't be reached by the Z probe."
625
+    #elif ABL_PROBE_PT_2_Y < MIN_PROBE_Y || ABL_PROBE_PT_2_Y > MAX_PROBE_Y
626
+      #error "The given ABL_PROBE_PT_2_Y can't be reached by the Z probe."
627
+    #elif ABL_PROBE_PT_3_Y < MIN_PROBE_Y || ABL_PROBE_PT_3_Y > MAX_PROBE_Y
628
+      #error "The given ABL_PROBE_PT_3_Y can't be reached by the Z probe."
629
+    #endif
630
+  #endif // AUTO_BED_LEVELING_3POINT
623 631
 
624 632
 #endif // HAS_ABL
625 633
 

+ 34
- 34
Marlin/UBL.h View File

@@ -37,27 +37,27 @@
37 37
                       // from the search location
38 38
     } mesh_index_pair;
39 39
 
40
-    struct vector { double dx, dy, dz; };
40
+    typedef struct { double dx, dy, dz; } vector;
41 41
 
42
-    enum Mesh_Point_Type { INVALID, REAL, SET_IN_BITMAP };
42
+    enum MeshPointType { INVALID, REAL, SET_IN_BITMAP };
43 43
 
44 44
     bool axis_unhomed_error(bool, bool, bool);
45 45
     void dump(char *str, float f);
46
-    bool G29_lcd_clicked();
46
+    bool ubl_lcd_clicked();
47 47
     void probe_entire_mesh(float, float, bool, bool);
48
-    void UBL_line_to_destination(const float&, const float&, const float&, const float&, const float&, uint8_t);
48
+    void ubl_line_to_destination(const float&, const float&, const float&, const float&, const float&, uint8_t);
49 49
     void manually_probe_remaining_mesh(float, float, float, float, bool);
50
-    struct vector tilt_mesh_based_on_3pts(float, float, float);
50
+    vector tilt_mesh_based_on_3pts(float, float, float);
51 51
     void new_set_bed_level_equation_3pts(float, float, float);
52 52
     float measure_business_card_thickness(float);
53
-    mesh_index_pair find_closest_mesh_point_of_type(Mesh_Point_Type, float, float, bool, unsigned int[16]);
54
-    void Find_Mean_Mesh_Height();
55
-    void Shift_Mesh_Height();
56
-    bool G29_Parameter_Parsing();
57
-    void G29_What_Command();
58
-    void G29_EEPROM_Dump();
59
-    void G29_Kompare_Current_Mesh_to_Stored_Mesh();
60
-    void fine_tune_mesh(float, float, float, bool);
53
+    mesh_index_pair find_closest_mesh_point_of_type(MeshPointType, float, float, bool, unsigned int[16]);
54
+    void find_mean_mesh_height();
55
+    void shift_mesh_height();
56
+    bool g29_parameter_parsing();
57
+    void g29_what_command();
58
+    void g29_eeprom_dump();
59
+    void g29_compare_current_mesh_to_stored_mesh();
60
+    void fine_tune_mesh(float, float, bool);
61 61
     void bit_clear(uint16_t bits[16], uint8_t x, uint8_t y);
62 62
     void bit_set(uint16_t bits[16], uint8_t x, uint8_t y);
63 63
     bool is_bit_set(uint16_t bits[16], uint8_t x, uint8_t y);
@@ -68,8 +68,8 @@
68 68
     void gcode_G29();
69 69
     extern char conv[9];
70 70
 
71
-    void save_UBL_active_state_and_disable();
72
-    void restore_UBL_active_state_and_leave();
71
+    void save_ubl_active_state_and_disable();
72
+    void restore_ubl_active_state_and_leave();
73 73
 
74 74
     ///////////////////////////////////////////////////////////////////////////////////////////////////////
75 75
 
@@ -83,19 +83,19 @@
83 83
     #define MESH_X_DIST ((float(UBL_MESH_MAX_X) - float(UBL_MESH_MIN_X)) / (float(UBL_MESH_NUM_X_POINTS) - 1.0))
84 84
     #define MESH_Y_DIST ((float(UBL_MESH_MAX_Y) - float(UBL_MESH_MIN_Y)) / (float(UBL_MESH_NUM_Y_POINTS) - 1.0))
85 85
 
86
-    extern bool G26_Debug_flag;
86
+    extern bool g26_debug_flag;
87 87
     extern float last_specified_z;
88 88
     extern float fade_scaling_factor_for_current_height;
89 89
     extern float z_values[UBL_MESH_NUM_X_POINTS][UBL_MESH_NUM_Y_POINTS];
90
-    extern float mesh_index_to_X_location[UBL_MESH_NUM_X_POINTS + 1]; // +1 just because of paranoia that we might end up on the
91
-    extern float mesh_index_to_Y_location[UBL_MESH_NUM_Y_POINTS + 1]; // the last Mesh Line and that is the start of a whole new cell
90
+    extern float mesh_index_to_x_location[UBL_MESH_NUM_X_POINTS + 1]; // +1 just because of paranoia that we might end up on the
91
+    extern float mesh_index_to_y_location[UBL_MESH_NUM_Y_POINTS + 1]; // the last Mesh Line and that is the start of a whole new cell
92 92
 
93
-    class bed_leveling {
93
+    class unified_bed_leveling {
94 94
       public:
95 95
       struct ubl_state {
96 96
         bool active = false;
97 97
         float z_offset = 0.0;
98
-        int EEPROM_storage_slot = -1,
98
+        int eeprom_storage_slot = -1,
99 99
             n_x = UBL_MESH_NUM_X_POINTS,
100 100
             n_y = UBL_MESH_NUM_Y_POINTS;
101 101
         float mesh_x_min = UBL_MESH_MIN_X,
@@ -104,8 +104,8 @@
104 104
               mesh_y_max = UBL_MESH_MAX_Y,
105 105
               mesh_x_dist = MESH_X_DIST,
106 106
               mesh_y_dist = MESH_Y_DIST,
107
-              G29_Correction_Fade_Height = 10.0,
108
-              G29_Fade_Height_Multiplier = 1.0 / 10.0; // It is cheaper to do a floating point multiply than a floating
107
+              g29_correction_fade_height = 10.0,
108
+              g29_fade_height_multiplier = 1.0 / 10.0; // It is cheaper to do a floating point multiply than a floating
109 109
                                                        // point divide. So, we keep this number in both forms. The first
110 110
                                                        // is for the user. The second one is the one that is actually used
111 111
                                                        // again and again and again during the correction calculations.
@@ -119,8 +119,8 @@
119 119
                                     // the padding[] to keep the size the same!
120 120
       } state, pre_initialized;
121 121
 
122
-      bed_leveling();
123
-      //  ~bed_leveling();  // No destructor because this object never goes away!
122
+      unified_bed_leveling();
123
+      //  ~unified_bed_leveling();  // No destructor because this object never goes away!
124 124
 
125 125
       void display_map(int);
126 126
 
@@ -203,7 +203,7 @@
203 203
           return NAN;
204 204
         }
205 205
 
206
-        const float a0ma1diva2ma1 = (x0 - mesh_index_to_X_location[x1_i]) * (1.0 / (MESH_X_DIST)),
206
+        const float a0ma1diva2ma1 = (x0 - mesh_index_to_x_location[x1_i]) * (1.0 / (MESH_X_DIST)),
207 207
                     z1 = z_values[x1_i][yi],
208 208
                     z2 = z_values[x1_i + 1][yi],
209 209
                     dz = (z2 - z1);
@@ -224,7 +224,7 @@
224 224
           return NAN;
225 225
         }
226 226
 
227
-        const float a0ma1diva2ma1 = (y0 - mesh_index_to_Y_location[y1_i]) * (1.0 / (MESH_Y_DIST)),
227
+        const float a0ma1diva2ma1 = (y0 - mesh_index_to_y_location[y1_i]) * (1.0 / (MESH_Y_DIST)),
228 228
                     z1 = z_values[xi][y1_i],
229 229
                     z2 = z_values[xi][y1_i + 1],
230 230
                     dz = (z2 - z1);
@@ -271,20 +271,20 @@
271 271
             SERIAL_ECHOPAIR(" raw get_z_correction(", x0);
272 272
             SERIAL_ECHOPAIR(",", y0);
273 273
             SERIAL_ECHOPGM(")=");
274
-            SERIAL_PROTOCOL_F(z0, 6);
274
+            SERIAL_ECHO_F(z0, 6);
275 275
           }
276 276
         #endif
277 277
 
278 278
         #if ENABLED(DEBUG_LEVELING_FEATURE)
279 279
           if (DEBUGGING(MESH_ADJUST)) {
280 280
             SERIAL_ECHOPGM(" >>>---> ");
281
-            SERIAL_PROTOCOL_F(z0, 6);
281
+            SERIAL_ECHO_F(z0, 6);
282 282
             SERIAL_EOL;
283 283
           }
284 284
         #endif
285 285
 
286 286
         if (isnan(z0)) { // if part of the Mesh is undefined, it will show up as NAN
287
-          z0 = 0.0;      // in blm.z_values[][] and propagate through the
287
+          z0 = 0.0;      // in ubl.z_values[][] and propagate through the
288 288
                          // calculations. If our correction is NAN, we throw it out
289 289
                          // because part of the Mesh is undefined and we don't have the
290 290
                          // information we need to complete the height correction.
@@ -311,21 +311,21 @@
311 311
        * If it must do a calcuation, it will return a scaling factor of 0.0 if the UBL System is not active
312 312
        * or if the current Z Height is past the specified 'Fade Height'
313 313
        */
314
-      FORCE_INLINE float fade_scaling_factor_for_Z(float current_z) {
314
+      FORCE_INLINE float fade_scaling_factor_for_z(float current_z) {
315 315
         if (last_specified_z == current_z)
316 316
           return fade_scaling_factor_for_current_height;
317 317
 
318 318
         last_specified_z = current_z;
319 319
         fade_scaling_factor_for_current_height =
320
-          state.active && current_z < state.G29_Correction_Fade_Height
321
-          ? 1.0 - (current_z * state.G29_Fade_Height_Multiplier)
320
+          state.active && current_z < state.g29_correction_fade_height
321
+          ? 1.0 - (current_z * state.g29_fade_height_multiplier)
322 322
           : 0.0;
323 323
         return fade_scaling_factor_for_current_height;
324 324
       }
325 325
     };
326 326
 
327
-    extern bed_leveling blm;
328
-    extern int Unified_Bed_Leveling_EEPROM_start;
327
+    extern unified_bed_leveling ubl;
328
+    extern int ubl_eeprom_start;
329 329
 
330 330
 #endif // AUTO_BED_LEVELING_UBL
331 331
 #endif // UNIFIED_BED_LEVELING_H

+ 66
- 57
Marlin/UBL_Bed_Leveling.cpp View File

@@ -28,52 +28,59 @@
28 28
   #include "hex_print_routines.h"
29 29
 
30 30
   /**
31
-   * These variables used to be declared inside the bed_leveling class.  We are going to still declare
32
-   * them within the .cpp file for bed leveling.   But there is only one instance of the bed leveling
33
-   * object and we can get rid of a level of inderection by not making them 'member data'.  So, in the
34
-   * interest of speed, we do it this way.    When we move to a 32-Bit processor, they can be moved
35
-   * back inside the bed leveling class.
31
+   * These variables used to be declared inside the unified_bed_leveling class. We are going to
32
+   * still declare them within the .cpp file for bed leveling. But there is only one instance of
33
+   * the bed leveling object and we can get rid of a level of inderection by not making them
34
+   * 'member data'. So, in the interest of speed, we do it this way. On a 32-bit CPU they can be
35
+   * moved back inside the bed leveling class.
36 36
    */
37 37
   float last_specified_z,
38 38
         fade_scaling_factor_for_current_height,
39 39
         z_values[UBL_MESH_NUM_X_POINTS][UBL_MESH_NUM_Y_POINTS],
40
-        mesh_index_to_X_location[UBL_MESH_NUM_X_POINTS + 1], // +1 just because of paranoia that we might end up on the
41
-        mesh_index_to_Y_location[UBL_MESH_NUM_Y_POINTS + 1]; // the last Mesh Line and that is the start of a whole new cell
40
+        mesh_index_to_x_location[UBL_MESH_NUM_X_POINTS + 1], // +1 just because of paranoia that we might end up on the
41
+        mesh_index_to_y_location[UBL_MESH_NUM_Y_POINTS + 1]; // the last Mesh Line and that is the start of a whole new cell
42 42
 
43
-  bed_leveling::bed_leveling() {
43
+  unified_bed_leveling::unified_bed_leveling() {
44 44
     for (uint8_t i = 0; i <= UBL_MESH_NUM_X_POINTS; i++)  // We go one past what we expect to ever need for safety
45
-      mesh_index_to_X_location[i] = double(UBL_MESH_MIN_X) + double(MESH_X_DIST) * double(i);
45
+      mesh_index_to_x_location[i] = double(UBL_MESH_MIN_X) + double(MESH_X_DIST) * double(i);
46 46
 
47 47
     for (uint8_t i = 0; i <= UBL_MESH_NUM_Y_POINTS; i++)  // We go one past what we expect to ever need for safety
48
-      mesh_index_to_Y_location[i] = double(UBL_MESH_MIN_Y) + double(MESH_Y_DIST) * double(i);
48
+      mesh_index_to_y_location[i] = double(UBL_MESH_MIN_Y) + double(MESH_Y_DIST) * double(i);
49 49
 
50 50
     reset();
51 51
   }
52 52
 
53
-  void bed_leveling::store_state() {
54
-    int k = E2END - sizeof(blm.state);
55
-    eeprom_write_block((void *)&blm.state, (void *)k, sizeof(blm.state));
53
+  void unified_bed_leveling::store_state() {
54
+    int k = E2END - sizeof(ubl.state);
55
+    eeprom_write_block((void *)&ubl.state, (void *)k, sizeof(ubl.state));
56 56
   }
57 57
 
58
-  void bed_leveling::load_state() {
59
-    int k = E2END - sizeof(blm.state);
60
-    eeprom_read_block((void *)&blm.state, (void *)k, sizeof(blm.state));
58
+  void unified_bed_leveling::load_state() {
59
+    int k = E2END - sizeof(ubl.state);
60
+    eeprom_read_block((void *)&ubl.state, (void *)k, sizeof(ubl.state));
61 61
 
62 62
     if (sanity_check())
63 63
       SERIAL_PROTOCOLLNPGM("?In load_state() sanity_check() failed.\n");
64 64
 
65
-    // These lines can go away in a few weeks.  They are just
66
-    // to make sure people updating thier firmware won't be using
67
-    if (blm.state.G29_Fade_Height_Multiplier != 1.0 / blm.state.G29_Correction_Fade_Height) { // an incomplete Bed_Leveling.state structure. For speed
68
-      blm.state.G29_Fade_Height_Multiplier = 1.0 / blm.state.G29_Correction_Fade_Height;      // we now multiply by the inverse of the Fade Height instead of
69
-      store_state();   // dividing by it. Soon... all of the old structures will be
70
-    }                  // updated, but until then, we try to ease the transition
71
-                       // for our Beta testers.
65
+    /**
66
+     * These lines can go away in a few weeks.  They are just
67
+     * to make sure people updating thier firmware won't be using
68
+     * an incomplete Bed_Leveling.state structure. For speed
69
+     * we now multiply by the inverse of the Fade Height instead of
70
+     * dividing by it. Soon... all of the old structures will be
71
+     * updated, but until then, we try to ease the transition
72
+     * for our Beta testers.
73
+     */
74
+    if (ubl.state.g29_fade_height_multiplier != 1.0 / ubl.state.g29_correction_fade_height) {
75
+      ubl.state.g29_fade_height_multiplier = 1.0 / ubl.state.g29_correction_fade_height;
76
+      store_state();
77
+    }
78
+
72 79
   }
73 80
 
74
-  void bed_leveling::load_mesh(int m) {
75
-    int k = E2END - sizeof(blm.state),
76
-        j = (k - Unified_Bed_Leveling_EEPROM_start) / sizeof(z_values);
81
+  void unified_bed_leveling::load_mesh(int m) {
82
+    int k = E2END - sizeof(ubl.state),
83
+        j = (k - ubl_eeprom_start) / sizeof(z_values);
77 84
 
78 85
     if (m == -1) {
79 86
       SERIAL_PROTOCOLLNPGM("?No mesh saved in EEPROM. Zeroing mesh in memory.\n");
@@ -81,7 +88,7 @@
81 88
       return;
82 89
     }
83 90
 
84
-    if (m < 0 || m >= j || Unified_Bed_Leveling_EEPROM_start <= 0) {
91
+    if (m < 0 || m >= j || ubl_eeprom_start <= 0) {
85 92
       SERIAL_PROTOCOLLNPGM("?EEPROM storage not available to load mesh.\n");
86 93
       return;
87 94
     }
@@ -96,11 +103,11 @@
96 103
     SERIAL_EOL;
97 104
   }
98 105
 
99
-  void bed_leveling:: store_mesh(int m) {
106
+  void unified_bed_leveling:: store_mesh(int m) {
100 107
     int k = E2END - sizeof(state),
101
-        j = (k - Unified_Bed_Leveling_EEPROM_start) / sizeof(z_values);
108
+        j = (k - ubl_eeprom_start) / sizeof(z_values);
102 109
 
103
-    if (m < 0 || m >= j || Unified_Bed_Leveling_EEPROM_start <= 0) {
110
+    if (m < 0 || m >= j || ubl_eeprom_start <= 0) {
104 111
       SERIAL_PROTOCOLLNPGM("?EEPROM storage not available to load mesh.\n");
105 112
       SERIAL_PROTOCOL(m);
106 113
       SERIAL_PROTOCOLLNPGM(" mesh slots available.\n");
@@ -122,18 +129,18 @@
122 129
     SERIAL_EOL;
123 130
   }
124 131
 
125
-  void bed_leveling::reset() {
132
+  void unified_bed_leveling::reset() {
126 133
     state.active = false;
127 134
     state.z_offset = 0;
128
-    state.EEPROM_storage_slot = -1;
135
+    state.eeprom_storage_slot = -1;
129 136
 
130 137
     ZERO(z_values);
131 138
 
132
-    last_specified_z = -999.9;        // We can't pre-initialize these values in the declaration
133
-    fade_scaling_factor_for_current_height = 0.0; // due to C++11 constraints
139
+    last_specified_z = -999.9;
140
+    fade_scaling_factor_for_current_height = 0.0;
134 141
   }
135 142
 
136
-  void bed_leveling::invalidate() {
143
+  void unified_bed_leveling::invalidate() {
137 144
     prt_hex_word((unsigned int)this);
138 145
     SERIAL_EOL;
139 146
 
@@ -144,7 +151,7 @@
144 151
         z_values[x][y] = NAN;
145 152
   }
146 153
 
147
-  void bed_leveling::display_map(int map_type) {
154
+  void unified_bed_leveling::display_map(int map_type) {
148 155
     float f, current_xi, current_yi;
149 156
     int8_t i, j;
150 157
     UNUSED(map_type);
@@ -155,8 +162,8 @@
155 162
     SERIAL_ECHOPAIR(", ", UBL_MESH_NUM_Y_POINTS - 1);
156 163
     SERIAL_ECHOPGM(")    ");
157 164
 
158
-    current_xi = blm.get_cell_index_x(current_position[X_AXIS] + (MESH_X_DIST) / 2.0);
159
-    current_yi = blm.get_cell_index_y(current_position[Y_AXIS] + (MESH_Y_DIST) / 2.0);
165
+    current_xi = ubl.get_cell_index_x(current_position[X_AXIS] + (MESH_X_DIST) / 2.0);
166
+    current_yi = ubl.get_cell_index_y(current_position[Y_AXIS] + (MESH_Y_DIST) / 2.0);
160 167
 
161 168
     for (i = 0; i < UBL_MESH_NUM_X_POINTS - 1; i++)
162 169
       SERIAL_ECHOPGM("                 ");
@@ -166,16 +173,18 @@
166 173
     SERIAL_ECHOLNPGM(")");
167 174
 
168 175
     //  if (map_type || 1) {
169
-    SERIAL_ECHOPAIR("(", UBL_MESH_MIN_X);
170
-    SERIAL_ECHOPAIR(",", UBL_MESH_MAX_Y);
171
-    SERIAL_CHAR(')');
172 176
 
173
-    for (i = 0; i < UBL_MESH_NUM_X_POINTS - 1; i++)
174
-      SERIAL_ECHOPGM("                 ");
177
+      SERIAL_ECHOPAIR("(", UBL_MESH_MIN_X);
178
+      SERIAL_ECHOPAIR(",", UBL_MESH_MAX_Y);
179
+      SERIAL_CHAR(')');
180
+
181
+      for (i = 0; i < UBL_MESH_NUM_X_POINTS - 1; i++)
182
+        SERIAL_ECHOPGM("                 ");
183
+
184
+      SERIAL_ECHOPAIR("(", UBL_MESH_MAX_X);
185
+      SERIAL_ECHOPAIR(",", UBL_MESH_MAX_Y);
186
+      SERIAL_ECHOLNPGM(")");
175 187
 
176
-    SERIAL_ECHOPAIR("(", UBL_MESH_MAX_X);
177
-    SERIAL_ECHOPAIR(",", UBL_MESH_MAX_Y);
178
-    SERIAL_ECHOLNPGM(")");
179 188
     //  }
180 189
 
181 190
     for (j = UBL_MESH_NUM_Y_POINTS - 1; j >= 0; j--) {
@@ -235,51 +244,51 @@
235 244
     SERIAL_EOL;
236 245
   }
237 246
 
238
-  bool bed_leveling::sanity_check() {
247
+  bool unified_bed_leveling::sanity_check() {
239 248
     uint8_t error_flag = 0;
240 249
 
241
-    if (state.n_x !=  UBL_MESH_NUM_X_POINTS)  {
250
+    if (state.n_x !=  UBL_MESH_NUM_X_POINTS) {
242 251
       SERIAL_PROTOCOLLNPGM("?UBL_MESH_NUM_X_POINTS set wrong\n");
243 252
       error_flag++;
244 253
     }
245 254
 
246
-    if (state.n_y !=  UBL_MESH_NUM_Y_POINTS)  {
255
+    if (state.n_y !=  UBL_MESH_NUM_Y_POINTS) {
247 256
       SERIAL_PROTOCOLLNPGM("?UBL_MESH_NUM_Y_POINTS set wrong\n");
248 257
       error_flag++;
249 258
     }
250 259
 
251
-    if (state.mesh_x_min !=  UBL_MESH_MIN_X)  {
260
+    if (state.mesh_x_min !=  UBL_MESH_MIN_X) {
252 261
       SERIAL_PROTOCOLLNPGM("?UBL_MESH_MIN_X set wrong\n");
253 262
       error_flag++;
254 263
     }
255 264
 
256
-    if (state.mesh_y_min !=  UBL_MESH_MIN_Y)  {
265
+    if (state.mesh_y_min !=  UBL_MESH_MIN_Y) {
257 266
       SERIAL_PROTOCOLLNPGM("?UBL_MESH_MIN_Y set wrong\n");
258 267
       error_flag++;
259 268
     }
260 269
 
261
-    if (state.mesh_x_max !=  UBL_MESH_MAX_X)  {
270
+    if (state.mesh_x_max !=  UBL_MESH_MAX_X) {
262 271
       SERIAL_PROTOCOLLNPGM("?UBL_MESH_MAX_X set wrong\n");
263 272
       error_flag++;
264 273
     }
265 274
 
266
-    if (state.mesh_y_max !=  UBL_MESH_MAX_Y)  {
275
+    if (state.mesh_y_max !=  UBL_MESH_MAX_Y) {
267 276
       SERIAL_PROTOCOLLNPGM("?UBL_MESH_MAX_Y set wrong\n");
268 277
       error_flag++;
269 278
     }
270 279
 
271
-    if (state.mesh_x_dist !=  MESH_X_DIST)  {
280
+    if (state.mesh_x_dist !=  MESH_X_DIST) {
272 281
       SERIAL_PROTOCOLLNPGM("?MESH_X_DIST set wrong\n");
273 282
       error_flag++;
274 283
     }
275 284
 
276
-    if (state.mesh_y_dist !=  MESH_Y_DIST)  {
285
+    if (state.mesh_y_dist !=  MESH_Y_DIST) {
277 286
       SERIAL_PROTOCOLLNPGM("?MESH_Y_DIST set wrong\n");
278 287
       error_flag++;
279 288
     }
280 289
 
281
-    int k = E2END - sizeof(blm.state),
282
-        j = (k - Unified_Bed_Leveling_EEPROM_start) / sizeof(z_values);
290
+    const int k = E2END - sizeof(ubl.state),
291
+              j = (k - ubl_eeprom_start) / sizeof(z_values);
283 292
 
284 293
     if (j < 1) {
285 294
       SERIAL_PROTOCOLLNPGM("?No EEPROM storage available for a mesh of this size.\n");

+ 567
- 593
Marlin/UBL_G29.cpp
File diff suppressed because it is too large
View File


+ 290
- 311
Marlin/UBL_line_to_destination.cpp View File

@@ -19,116 +19,118 @@
19 19
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 20
  *
21 21
  */
22
-#include "Marlin.h"
22
+#include "MarlinConfig.h"
23 23
 
24 24
 #if ENABLED(AUTO_BED_LEVELING_UBL)
25 25
 
26
+  #include "Marlin.h"
26 27
   #include "UBL.h"
27 28
   #include "planner.h"
28 29
   #include <avr/io.h>
29 30
   #include <math.h>
30 31
 
31 32
   extern void set_current_to_destination();
32
-  extern bool G26_Debug_flag;
33
-  void debug_current_and_destination(char *title);
34
-
35
-  void wait_for_button_press();
36
-
37
-  void UBL_line_to_destination(const float &x_end, const float &y_end, const float &z_end, const float &e_end, const float &feed_rate, uint8_t extruder) {
38
-
39
-    int cell_start_xi, cell_start_yi, cell_dest_xi, cell_dest_yi;
40
-    int left_flag, down_flag;
41
-    int current_xi, current_yi;
42
-    int dxi, dyi, xi_cnt, yi_cnt;
43
-    bool use_X_dist, inf_normalized_flag, inf_m_flag;
44
-    float x_start, y_start;
45
-    float x, y, z1, z2, z0 /*, z_optimized */;
46
-    float next_mesh_line_x, next_mesh_line_y, a0ma1diva2ma1;
47
-    float on_axis_distance, e_normalized_dist, e_position, e_start, z_normalized_dist, z_position, z_start;
48
-    float dx, dy, adx, ady, m, c;
49
-
50
-    //
51
-    // Much of the nozzle movement will be within the same cell.  So we will do as little computation
52
-    // as possible to determine if this is the case.  If this move is within the same cell, we will
53
-    // just do the required Z-Height correction, call the Planner's buffer_line() routine, and leave
54
-    //
33
+  extern void debug_current_and_destination(char *title);
34
+
35
+  void ubl_line_to_destination(const float &x_end, const float &y_end, const float &z_end, const float &e_end, const float &feed_rate, uint8_t extruder) {
36
+
37
+    int cell_start_xi, cell_start_yi, cell_dest_xi, cell_dest_yi,
38
+        current_xi, current_yi,
39
+        dxi, dyi, xi_cnt, yi_cnt;
40
+    float x_start, y_start,
41
+          x, y, z1, z2, z0 /*, z_optimized */,
42
+          next_mesh_line_x, next_mesh_line_y, a0ma1diva2ma1,
43
+          on_axis_distance, e_normalized_dist, e_position, e_start, z_normalized_dist, z_position, z_start,
44
+          dx, dy, adx, ady, m, c;
45
+
46
+    /**
47
+     * Much of the nozzle movement will be within the same cell. So we will do as little computation
48
+     * as possible to determine if this is the case. If this move is within the same cell, we will
49
+     * just do the required Z-Height correction, call the Planner's buffer_line() routine, and leave
50
+     */
55 51
 
56 52
     x_start = current_position[X_AXIS];
57 53
     y_start = current_position[Y_AXIS];
58 54
     z_start = current_position[Z_AXIS];
59 55
     e_start = current_position[E_AXIS];
60 56
 
61
-    cell_start_xi = blm.get_cell_index_x(x_start);
62
-    cell_start_yi = blm.get_cell_index_y(y_start);
63
-    cell_dest_xi  = blm.get_cell_index_x(x_end);
64
-    cell_dest_yi  = blm.get_cell_index_y(y_end);
57
+    cell_start_xi = ubl.get_cell_index_x(x_start);
58
+    cell_start_yi = ubl.get_cell_index_y(y_start);
59
+    cell_dest_xi  = ubl.get_cell_index_x(x_end);
60
+    cell_dest_yi  = ubl.get_cell_index_y(y_end);
65 61
 
66
-    if (G26_Debug_flag!=0) {
67
-      SERIAL_ECHOPGM(" UBL_line_to_destination(xe=");
62
+    if (g26_debug_flag) {
63
+      SERIAL_ECHOPGM(" ubl_line_to_destination(xe=");
68 64
       SERIAL_ECHO(x_end);
69
-      SERIAL_ECHOPGM(",ye=");
65
+      SERIAL_ECHOPGM(", ye=");
70 66
       SERIAL_ECHO(y_end);
71
-      SERIAL_ECHOPGM(",ze=");
67
+      SERIAL_ECHOPGM(", ze=");
72 68
       SERIAL_ECHO(z_end);
73
-      SERIAL_ECHOPGM(",ee=");
69
+      SERIAL_ECHOPGM(", ee=");
74 70
       SERIAL_ECHO(e_end);
75 71
       SERIAL_ECHOPGM(")\n");
76
-      debug_current_and_destination( (char *) "Start of UBL_line_to_destination()");
72
+      debug_current_and_destination((char*)"Start of ubl_line_to_destination()");
77 73
     }
78 74
 
79
-    if ((cell_start_xi == cell_dest_xi) && (cell_start_yi == cell_dest_yi)) { // if the whole move is within the same cell,
80
-      // we don't need to break up the move
81
-      //
82
-      // If we are moving off the print bed, we are going to allow the move at this level.
83
-      // But we detect it and isolate it.   For now, we just pass along the request.
84
-      //
75
+    if (cell_start_xi == cell_dest_xi && cell_start_yi == cell_dest_yi) { // if the whole move is within the same cell,
76
+      /**
77
+       * we don't need to break up the move
78
+       *
79
+       * If we are moving off the print bed, we are going to allow the move at this level.
80
+       * But we detect it and isolate it. For now, we just pass along the request.
81
+       */
85 82
 
86
-      if (cell_dest_xi<0 || cell_dest_yi<0 || cell_dest_xi >= UBL_MESH_NUM_X_POINTS || cell_dest_yi >= UBL_MESH_NUM_Y_POINTS) {
83
+      if (cell_dest_xi < 0 || cell_dest_yi < 0 || cell_dest_xi >= UBL_MESH_NUM_X_POINTS || cell_dest_yi >= UBL_MESH_NUM_Y_POINTS) {
87 84
 
88
-        // Note:  There is no Z Correction in this case.  We are off the grid and don't know what
85
+        // Note:  There is no Z Correction in this case. We are off the grid and don't know what
89 86
         // a reasonable correction would be.
90 87
 
91
-        planner.buffer_line(x_end, y_end, z_end + blm.state.z_offset, e_end, feed_rate, extruder);
88
+        planner.buffer_line(x_end, y_end, z_end + ubl.state.z_offset, e_end, feed_rate, extruder);
92 89
         set_current_to_destination();
93
-        if (G26_Debug_flag!=0) {
94
-          debug_current_and_destination( (char *) "out of bounds in UBL_line_to_destination()");
95
-        }
90
+
91
+        if (g26_debug_flag)
92
+          debug_current_and_destination((char*)"out of bounds in ubl_line_to_destination()");
93
+
96 94
         return;
97 95
       }
98 96
 
99
-      // we can optimize some floating point operations here.  We could call float get_z_correction(float x0, float y0) to
100
-      // generate the correction for us.  But we can lighten the load on the CPU by doing a modified version of the function.
101
-      // We are going to only calculate the amount we are from the first mesh line towards the second mesh line once.
102
-      // We will use this fraction in both of the original two Z Height calculations for the bi-linear interpolation.  And,
103
-      // instead of doing a generic divide of the distance, we know the distance is MESH_X_DIST so we can use the preprocessor
104
-      // to create a 1-over number for us.  That will allow us to do a floating point multiply instead of a floating point divide.
105
-
106 97
       FINAL_MOVE:
107
-      a0ma1diva2ma1 = (x_end - mesh_index_to_X_location[cell_dest_xi]) * (float) (1.0 / MESH_X_DIST);
108 98
 
109
-      z1 = z_values[cell_dest_xi][cell_dest_yi] +
110
-      (z_values[cell_dest_xi + 1][cell_dest_yi] - z_values[cell_dest_xi][cell_dest_yi]) * a0ma1diva2ma1;
99
+      /**
100
+       * Optimize some floating point operations here. We could call float get_z_correction(float x0, float y0) to
101
+       * generate the correction for us. But we can lighten the load on the CPU by doing a modified version of the function.
102
+       * We are going to only calculate the amount we are from the first mesh line towards the second mesh line once.
103
+       * We will use this fraction in both of the original two Z Height calculations for the bi-linear interpolation. And,
104
+       * instead of doing a generic divide of the distance, we know the distance is MESH_X_DIST so we can use the preprocessor
105
+       * to create a 1-over number for us. That will allow us to do a floating point multiply instead of a floating point divide.
106
+       */
107
+
108
+      a0ma1diva2ma1 = (x_end - mesh_index_to_x_location[cell_dest_xi]) * 0.1 * (MESH_X_DIST);
109
+
110
+      z1 = z_values[cell_dest_xi    ][cell_dest_yi    ] + a0ma1diva2ma1 *
111
+          (z_values[cell_dest_xi + 1][cell_dest_yi    ] - z_values[cell_dest_xi][cell_dest_yi    ]);
111 112
 
112
-      z2 = z_values[cell_dest_xi][cell_dest_yi+1] +
113
-      (z_values[cell_dest_xi+1][cell_dest_yi+1] - z_values[cell_dest_xi][cell_dest_yi+1]) * a0ma1diva2ma1;
113
+      z2 = z_values[cell_dest_xi    ][cell_dest_yi + 1] + a0ma1diva2ma1 *
114
+          (z_values[cell_dest_xi + 1][cell_dest_yi + 1] - z_values[cell_dest_xi][cell_dest_yi + 1]);
114 115
 
115
-      // we are done with the fractional X distance into the cell.  Now with the two Z-Heights we have calculated, we
116
+      // we are done with the fractional X distance into the cell. Now with the two Z-Heights we have calculated, we
116 117
       // are going to apply the Y-Distance into the cell to interpolate the final Z correction.
117 118
 
118
-      a0ma1diva2ma1 = (y_end - mesh_index_to_Y_location[cell_dest_yi]) * (float) (1.0 / MESH_Y_DIST);
119
+      a0ma1diva2ma1 = (y_end - mesh_index_to_y_location[cell_dest_yi]) * 0.1 * (MESH_Y_DIST);
119 120
 
120 121
       z0 = z1 + (z2 - z1) * a0ma1diva2ma1;
121 122
 
122
-      // debug code to use non-optimized get_z_correction() and to do a sanity check
123
-      // that the correct value is being passed to planner.buffer_line()
124
-      //
123
+      /**
124
+       * Debug code to use non-optimized get_z_correction() and to do a sanity check
125
+       * that the correct value is being passed to planner.buffer_line()
126
+       */
125 127
       /*
126 128
         z_optimized = z0;
127
-        z0 = blm.get_z_correction( x_end, y_end);
128
-        if ( fabs(z_optimized - z0) > .01 || isnan(z0) || isnan(z_optimized) )  {
129
-        debug_current_and_destination( (char *) "FINAL_MOVE: z_correction()");
130
-        if ( isnan(z0) ) SERIAL_ECHO(" z0==NAN  ");
131
-        if ( isnan(z_optimized) ) SERIAL_ECHO(" z_optimized==NAN  ");
129
+        z0 = ubl.get_z_correction( x_end, y_end);
130
+        if (fabs(z_optimized - z0) > .01 || isnan(z0) || isnan(z_optimized)) {
131
+        debug_current_and_destination((char*)"FINAL_MOVE: z_correction()");
132
+        if (isnan(z0)) SERIAL_ECHO(" z0==NAN  ");
133
+        if (isnan(z_optimized)) SERIAL_ECHO(" z_optimized==NAN  ");
132 134
         SERIAL_ECHOPAIR("  x_end=", x_end);
133 135
         SERIAL_ECHOPAIR("  y_end=", y_end);
134 136
         SERIAL_ECHOPAIR("  z0=", z0);
@@ -136,48 +138,50 @@
136 138
         SERIAL_ECHOPAIR("  err=",fabs(z_optimized - z0));
137 139
         SERIAL_EOL;
138 140
         }
139
-      */
140
-      z0 = z0 * blm.fade_scaling_factor_for_Z( z_end );
141
-
142
-      if (isnan(z0)) {  // if part of the Mesh is undefined, it will show up as NAN
143
-        z0 = 0.0; // in z_values[][] and propagate through the
144
-        // calculations. If our correction is NAN, we throw it out
145
-        // because part of the Mesh is undefined and we don't have the
146
-        // information we need to complete the height correction.
147
-      }
141
+      //*/
142
+      z0 = z0 * ubl.fade_scaling_factor_for_z(z_end);
143
+
144
+      /**
145
+       * If part of the Mesh is undefined, it will show up as NAN
146
+       * in z_values[][] and propagate through the
147
+       * calculations. If our correction is NAN, we throw it out
148
+       * because part of the Mesh is undefined and we don't have the
149
+       * information we need to complete the height correction.
150
+       */
151
+      if (isnan(z0)) z0 = 0.0;
152
+
153
+      planner.buffer_line(x_end, y_end, z_end + z0 + ubl.state.z_offset, e_end, feed_rate, extruder);
154
+
155
+      if (g26_debug_flag)
156
+        debug_current_and_destination((char*)"FINAL_MOVE in ubl_line_to_destination()");
148 157
 
149
-      planner.buffer_line(x_end, y_end, z_end + z0 + blm.state.z_offset, e_end, feed_rate, extruder);
150
-      if (G26_Debug_flag!=0) {
151
-        debug_current_and_destination( (char *) "FINAL_MOVE in UBL_line_to_destination()");
152
-      }
153 158
       set_current_to_destination();
154 159
       return;
155 160
     }
156 161
 
157
-    //
158
-    //  If we get here, we are processing a move that crosses at least one Mesh Line.   We will check
159
-    //  for the simple case of just crossing X or just crossing Y Mesh Lines after we get all the details
160
-    //  of the move figured out.  We can process the easy case of just crossing an X or Y Mesh Line with less
161
-    //  computation and in fact most lines are of this nature.  We will check for that in the following
162
-    //  blocks of code:
163
-
164
-    left_flag = 0;
165
-    down_flag = 0;
166
-    inf_m_flag = false;
167
-    inf_normalized_flag = false;
162
+    /**
163
+     * If we get here, we are processing a move that crosses at least one Mesh Line. We will check
164
+     * for the simple case of just crossing X or just crossing Y Mesh Lines after we get all the details
165
+     * of the move figured out. We can process the easy case of just crossing an X or Y Mesh Line with less
166
+     * computation and in fact most lines are of this nature. We will check for that in the following
167
+     * blocks of code:
168
+     */
168 169
 
169 170
     dx = x_end - x_start;
170 171
     dy = y_end - y_start;
171 172
 
172
-    if (dx<0.0) {     // figure out which way we need to move to get to the next cell
173
+    const int left_flag = dx < 0.0 ? 1 : 0,
174
+              down_flag = dy < 0.0 ? 1 : 0;
175
+
176
+    if (left_flag) { // figure out which way we need to move to get to the next cell
173 177
       dxi = -1;
174
-      adx = -dx;  // absolute value of dx.  We already need to check if dx and dy are negative.
178
+      adx = -dx;  // absolute value of dx. We already need to check if dx and dy are negative.
175 179
     }
176
-    else {   // We may as well generate the appropriate values for adx and ady right now
180
+    else {      // We may as well generate the appropriate values for adx and ady right now
177 181
       dxi = 1;  // to save setting up the abs() function call and actually doing the call.
178 182
       adx = dx;
179 183
     }
180
-    if (dy<0.0) {
184
+    if (dy < 0.0) {
181 185
       dyi = -1;
182 186
       ady = -dy;  // absolute value of dy
183 187
     }
@@ -186,75 +190,68 @@
186 190
       ady = dy;
187 191
     }
188 192
 
189
-    if (dx<0.0) left_flag = 1;
190
-    if (dy<0.0) down_flag = 1;
191 193
     if (cell_start_xi == cell_dest_xi) dxi = 0;
192 194
     if (cell_start_yi == cell_dest_yi) dyi = 0;
193 195
 
194
-    //
195
-    // Compute the scaling factor for the extruder for each partial move.
196
-    // We need to watch out for zero length moves because it will cause us to
197
-    // have an infinate scaling factor.  We are stuck doing a floating point
198
-    // divide to get our scaling factor, but after that, we just multiply by this
199
-    // number.   We also pick our scaling factor based on whether the X or Y
200
-    // component is larger.  We use the biggest of the two to preserve precision.
201
-    //
202
-    if ( adx > ady ) {
203
-      use_X_dist = true;
204
-      on_axis_distance   = x_end-x_start;
205
-    }
206
-    else {
207
-      use_X_dist = false;
208
-      on_axis_distance   = y_end-y_start;
209
-    }
196
+    /**
197
+     * Compute the scaling factor for the extruder for each partial move.
198
+     * We need to watch out for zero length moves because it will cause us to
199
+     * have an infinate scaling factor. We are stuck doing a floating point
200
+     * divide to get our scaling factor, but after that, we just multiply by this
201
+     * number. We also pick our scaling factor based on whether the X or Y
202
+     * component is larger. We use the biggest of the two to preserve precision.
203
+     */
204
+
205
+    const bool use_x_dist = adx > ady;
206
+
207
+    on_axis_distance = use_x_dist ? x_end - x_start : y_end - y_start;
208
+
210 209
     e_position = e_end - e_start;
211 210
     e_normalized_dist = e_position / on_axis_distance;
212 211
 
213 212
     z_position = z_end - z_start;
214 213
     z_normalized_dist = z_position / on_axis_distance;
215 214
 
216
-    if (e_normalized_dist==INFINITY || e_normalized_dist==-INFINITY) {
217
-      inf_normalized_flag = true;
218
-    }
215
+    const bool inf_normalized_flag = e_normalized_dist == INFINITY || e_normalized_dist == -INFINITY;
216
+
219 217
     current_xi = cell_start_xi;
220 218
     current_yi = cell_start_yi;
221 219
 
222 220
     m = dy / dx;
223
-    c = y_start - m*x_start;
224
-    if (m == INFINITY || m == -INFINITY) {
225
-      inf_m_flag = true;
226
-    }
227
-    //
228
-    // This block handles vertical lines.  These are lines that stay within the same
229
-    // X Cell column.  They do not need to be perfectly vertical.  They just can
230
-    // not cross into another X Cell column.
231
-    //
221
+    c = y_start - m * x_start;
222
+    const bool inf_m_flag = (m == INFINITY || m == -INFINITY);
223
+
224
+    /**
225
+     * This block handles vertical lines. These are lines that stay within the same
226
+     * X Cell column. They do not need to be perfectly vertical. They just can
227
+     * not cross into another X Cell column.
228
+     */
232 229
     if (dxi == 0) {       // Check for a vertical line
233 230
       current_yi += down_flag;  // Line is heading down, we just want to go to the bottom
234 231
       while (current_yi != cell_dest_yi + down_flag) {
235 232
         current_yi += dyi;
236
-        next_mesh_line_y = mesh_index_to_Y_location[current_yi];
237
-        if (inf_m_flag) {
238
-          x = x_start;  // if the slope of the line is infinite, we won't do the calculations
239
-        }
240
-        // we know the next X is the same so we can recover and continue!
241
-        else {
242
-          x = (next_mesh_line_y - c) / m; // Calculate X at the next Y mesh line
243
-        }
233
+        next_mesh_line_y = mesh_index_to_y_location[current_yi];
244 234
 
245
-        z0 = blm.get_z_correction_along_horizontal_mesh_line_at_specific_X(x, current_xi, current_yi);
235
+        /**
236
+         * inf_m_flag? the slope of the line is infinite, we won't do the calculations
237
+         * else, we know the next X is the same so we can recover and continue!
238
+         * Calculate X at the next Y mesh line
239
+         */
240
+        x = inf_m_flag ? x_start : (next_mesh_line_y - c) / m;
246 241
 
247
-        //
248
-        // debug code to use non-optimized get_z_correction() and to do a sanity check
249
-        // that the correct value is being passed to planner.buffer_line()
250
-        //
242
+        z0 = ubl.get_z_correction_along_horizontal_mesh_line_at_specific_X(x, current_xi, current_yi);
243
+
244
+        /**
245
+         * Debug code to use non-optimized get_z_correction() and to do a sanity check
246
+         * that the correct value is being passed to planner.buffer_line()
247
+         */
251 248
         /*
252 249
           z_optimized = z0;
253
-          z0 = blm.get_z_correction( x, next_mesh_line_y);
254
-          if ( fabs(z_optimized - z0) > .01 || isnan(z0) || isnan(z_optimized) )  {
255
-          debug_current_and_destination( (char *) "VERTICAL z_correction()");
256
-          if ( isnan(z0) ) SERIAL_ECHO(" z0==NAN  ");
257
-          if ( isnan(z_optimized) ) SERIAL_ECHO(" z_optimized==NAN  ");
250
+          z0 = ubl.get_z_correction( x, next_mesh_line_y);
251
+          if (fabs(z_optimized - z0) > .01 || isnan(z0) || isnan(z_optimized)) {
252
+            debug_current_and_destination((char*)"VERTICAL z_correction()");
253
+          if (isnan(z0)) SERIAL_ECHO(" z0==NAN  ");
254
+            if (isnan(z_optimized)) SERIAL_ECHO(" z_optimized==NAN  ");
258 255
           SERIAL_ECHOPAIR("  x=", x);
259 256
           SERIAL_ECHOPAIR("  next_mesh_line_y=", next_mesh_line_y);
260 257
           SERIAL_ECHOPAIR("  z0=", z0);
@@ -262,25 +259,30 @@
262 259
           SERIAL_ECHOPAIR("  err=",fabs(z_optimized-z0));
263 260
           SERIAL_ECHO("\n");
264 261
           }
265
-        */
266
-
267
-        z0 = z0 * blm.fade_scaling_factor_for_Z( z_end );
268
-
269
-        if (isnan(z0)) {  // if part of the Mesh is undefined, it will show up as NAN
270
-          z0 = 0.0; // in z_values[][] and propagate through the
271
-          // calculations. If our correction is NAN, we throw it out
272
-          // because part of the Mesh is undefined and we don't have the
273
-          // information we need to complete the height correction.
274
-        }
275
-        y = mesh_index_to_Y_location[current_yi];
276
-
277
-        // Without this check, it is possible for the algorythm to generate a zero length move in the case
278
-        // where the line is heading down and it is starting right on a Mesh Line boundary.  For how often that
279
-        // happens, it might be best to remove the check and always 'schedule' the move because
280
-        // the planner.buffer_line() routine will filter it if that happens.
281
-        if ( y!=y_start)   {
282
-          if ( inf_normalized_flag == false ) {
283
-            on_axis_distance   = y - y_start;       // we don't need to check if the extruder position
262
+        //*/
263
+
264
+        z0 = z0 * ubl.fade_scaling_factor_for_z(z_end);
265
+
266
+        /**
267
+         * If part of the Mesh is undefined, it will show up as NAN
268
+         * in z_values[][] and propagate through the
269
+         * calculations. If our correction is NAN, we throw it out
270
+         * because part of the Mesh is undefined and we don't have the
271
+         * information we need to complete the height correction.
272
+         */
273
+        if (isnan(z0)) z0 = 0.0;     
274
+
275
+        y = mesh_index_to_y_location[current_yi];
276
+
277
+        /**
278
+         * Without this check, it is possible for the algorithm to generate a zero length move in the case
279
+         * where the line is heading down and it is starting right on a Mesh Line boundary. For how often that
280
+         * happens, it might be best to remove the check and always 'schedule' the move because
281
+         * the planner.buffer_line() routine will filter it if that happens.
282
+         */
283
+        if (y != y_start) {
284
+          if (!inf_normalized_flag) {
285
+            on_axis_distance = y - y_start;                               // we don't need to check if the extruder position
284 286
             e_position = e_start + on_axis_distance * e_normalized_dist;  // is based on X or Y because this is a vertical move
285 287
             z_position = z_start + on_axis_distance * z_normalized_dist;
286 288
           }
@@ -289,49 +291,52 @@
289 291
             z_position = z_start;
290 292
           }
291 293
 
292
-          planner.buffer_line(x, y, z_position + z0 + blm.state.z_offset, e_position, feed_rate, extruder);
294
+          planner.buffer_line(x, y, z_position + z0 + ubl.state.z_offset, e_position, feed_rate, extruder);
293 295
         } //else printf("FIRST MOVE PRUNED  ");
294 296
       }
297
+
298
+      if (g26_debug_flag)
299
+        debug_current_and_destination((char*)"vertical move done in ubl_line_to_destination()");
300
+
295 301
       //
296
-      // Check if we are at the final destination.  Usually, we won't be, but if it is on a Y Mesh Line, we are done.
302
+      // Check if we are at the final destination. Usually, we won't be, but if it is on a Y Mesh Line, we are done.
297 303
       //
298
-      if (G26_Debug_flag!=0) {
299
-        debug_current_and_destination( (char *) "vertical move done in UBL_line_to_destination()");
300
-      }
301
-      if (current_position[X_AXIS] != x_end || current_position[Y_AXIS] != y_end) {
304
+      if (current_position[X_AXIS] != x_end || current_position[Y_AXIS] != y_end)
302 305
         goto FINAL_MOVE;
303
-      }
306
+
304 307
       set_current_to_destination();
305 308
       return;
306 309
     }
307 310
 
308
-    //
309
-    // This block handles horizontal lines.  These are lines that stay within the same
310
-    // Y Cell row.  They do not need to be perfectly horizontal.  They just can
311
-    // not cross into another Y Cell row.
312
-    //
311
+    /**
312
+     *
313
+     * This block handles horizontal lines. These are lines that stay within the same
314
+     * Y Cell row. They do not need to be perfectly horizontal. They just can
315
+     * not cross into another Y Cell row.
316
+     *
317
+     */
313 318
 
314
-    if (dyi == 0) {       // Check for a horiziontal line
319
+    if (dyi == 0) {             // Check for a horizontal line
315 320
       current_xi += left_flag;  // Line is heading left, we just want to go to the left
316
-      // edge of this cell for the first move.
321
+                                // edge of this cell for the first move.
317 322
       while (current_xi != cell_dest_xi + left_flag) {
318 323
         current_xi += dxi;
319
-        next_mesh_line_x = mesh_index_to_X_location[current_xi];
324
+        next_mesh_line_x = mesh_index_to_x_location[current_xi];
320 325
         y = m * next_mesh_line_x + c;   // Calculate X at the next Y mesh line
321 326
 
322
-        z0 = blm.get_z_correction_along_vertical_mesh_line_at_specific_Y(y, current_xi, current_yi);
327
+        z0 = ubl.get_z_correction_along_vertical_mesh_line_at_specific_Y(y, current_xi, current_yi);
323 328
 
324
-        //
325
-        // debug code to use non-optimized get_z_correction() and to do a sanity check
326
-        // that the correct value is being passed to planner.buffer_line()
327
-        //
329
+        /**
330
+         * Debug code to use non-optimized get_z_correction() and to do a sanity check
331
+         * that the correct value is being passed to planner.buffer_line()
332
+         */
328 333
         /*
329 334
           z_optimized = z0;
330
-          z0 = blm.get_z_correction( next_mesh_line_x, y);
331
-          if ( fabs(z_optimized - z0) > .01 || isnan(z0) || isnan(z_optimized) )  {
332
-          debug_current_and_destination( (char *) "HORIZONTAL z_correction()");
333
-          if ( isnan(z0) ) SERIAL_ECHO(" z0==NAN  ");
334
-          if ( isnan(z_optimized) ) SERIAL_ECHO(" z_optimized==NAN  ");
335
+          z0 = ubl.get_z_correction( next_mesh_line_x, y);
336
+          if (fabs(z_optimized - z0) > .01 || isnan(z0) || isnan(z_optimized)) {
337
+            debug_current_and_destination((char*)"HORIZONTAL z_correction()");
338
+          if (isnan(z0)) SERIAL_ECHO(" z0==NAN  ");
339
+            if (isnan(z_optimized)) SERIAL_ECHO(" z_optimized==NAN  ");
335 340
           SERIAL_ECHOPAIR("  next_mesh_line_x=", next_mesh_line_x);
336 341
           SERIAL_ECHOPAIR("  y=", y);
337 342
           SERIAL_ECHOPAIR("  z0=", z0);
@@ -339,25 +344,30 @@
339 344
           SERIAL_ECHOPAIR("  err=",fabs(z_optimized-z0));
340 345
           SERIAL_ECHO("\n");
341 346
           }
342
-        */
343
-
344
-        z0 = z0 * blm.fade_scaling_factor_for_Z( z_end );
345
-
346
-        if (isnan(z0)) {  // if part of the Mesh is undefined, it will show up as NAN
347
-          z0 = 0.0; // in z_values[][] and propagate through the
348
-          // calculations. If our correction is NAN, we throw it out
349
-          // because part of the Mesh is undefined and we don't have the
350
-          // information we need to complete the height correction.
351
-        }
352
-        x = mesh_index_to_X_location[current_xi];
353
-
354
-        // Without this check, it is possible for the algorythm to generate a zero length move in the case
355
-        // where the line is heading left and it is starting right on a Mesh Line boundary.  For how often
356
-        // that happens, it might be best to remove the check and always 'schedule' the move because
357
-        // the planner.buffer_line() routine will filter it if that happens.
358
-        if ( x!=x_start)   {
359
-          if ( inf_normalized_flag == false ) {
360
-            on_axis_distance   = x - x_start;       // we don't need to check if the extruder position
347
+        //*/
348
+
349
+        z0 = z0 * ubl.fade_scaling_factor_for_z(z_end);
350
+
351
+        /**
352
+         * If part of the Mesh is undefined, it will show up as NAN
353
+         * in z_values[][] and propagate through the
354
+         * calculations. If our correction is NAN, we throw it out
355
+         * because part of the Mesh is undefined and we don't have the
356
+         * information we need to complete the height correction.
357
+         */
358
+        if (isnan(z0)) z0 = 0.0;
359
+
360
+        x = mesh_index_to_x_location[current_xi];
361
+
362
+        /**
363
+         * Without this check, it is possible for the algorithm to generate a zero length move in the case
364
+         * where the line is heading left and it is starting right on a Mesh Line boundary. For how often
365
+         * that happens, it might be best to remove the check and always 'schedule' the move because
366
+         * the planner.buffer_line() routine will filter it if that happens.
367
+         */
368
+        if (x != x_start) {
369
+          if (!inf_normalized_flag) {
370
+            on_axis_distance = x - x_start;                               // we don't need to check if the extruder position
361 371
             e_position = e_start + on_axis_distance * e_normalized_dist;  // is based on X or Y because this is a horizontal move
362 372
             z_position = z_start + on_axis_distance * z_normalized_dist;
363 373
           }
@@ -366,74 +376,63 @@
366 376
             z_position = z_start;
367 377
           }
368 378
 
369
-          planner.buffer_line(x, y, z_position + z0 + blm.state.z_offset, e_position, feed_rate, extruder);
379
+          planner.buffer_line(x, y, z_position + z0 + ubl.state.z_offset, e_position, feed_rate, extruder);
370 380
         } //else printf("FIRST MOVE PRUNED  ");
371 381
       }
372
-      if (G26_Debug_flag!=0) {
373
-        debug_current_and_destination( (char *) "horizontal move done in UBL_line_to_destination()");
374
-      }
375
-      if (current_position[X_AXIS] != x_end || current_position[Y_AXIS] != y_end) {
382
+
383
+      if (g26_debug_flag)
384
+        debug_current_and_destination((char*)"horizontal move done in ubl_line_to_destination()");
385
+
386
+      if (current_position[X_AXIS] != x_end || current_position[Y_AXIS] != y_end)
376 387
         goto FINAL_MOVE;
377
-      }
388
+
378 389
       set_current_to_destination();
379 390
       return;
380 391
     }
381 392
 
382
-    //
383
-    //
384
-    //
385
-    //
386
-    // This block handles the generic case of a line crossing both X and Y
387
-    // Mesh lines.
388
-    //
389
-    //
390
-    //
391
-    //
393
+    /**
394
+     *
395
+     * This block handles the generic case of a line crossing both X and Y Mesh lines.
396
+     *
397
+     */
392 398
 
393 399
     xi_cnt = cell_start_xi - cell_dest_xi;
394
-    if ( xi_cnt < 0 ) {
395
-      xi_cnt = -xi_cnt;
396
-    }
400
+    if (xi_cnt < 0) xi_cnt = -xi_cnt;
397 401
 
398 402
     yi_cnt = cell_start_yi - cell_dest_yi;
399
-    if ( yi_cnt < 0 ) {
400
-      yi_cnt = -yi_cnt;
401
-    }
403
+    if (yi_cnt < 0) yi_cnt = -yi_cnt;
402 404
 
403 405
     current_xi += left_flag;
404 406
     current_yi += down_flag;
405 407
 
406
-    while ( xi_cnt>0 || yi_cnt>0 )    {
408
+    while (xi_cnt > 0 || yi_cnt > 0) {
407 409
 
408
-      next_mesh_line_x = mesh_index_to_X_location[current_xi + dxi];
409
-      next_mesh_line_y = mesh_index_to_Y_location[current_yi + dyi];
410
+      next_mesh_line_x = mesh_index_to_x_location[current_xi + dxi];
411
+      next_mesh_line_y = mesh_index_to_y_location[current_yi + dyi];
410 412
 
411 413
       y = m * next_mesh_line_x + c; // Calculate Y at the next X mesh line
412
-      x = (next_mesh_line_y-c) / m; // Calculate X at the next Y mesh line    (we don't have to worry
414
+      x = (next_mesh_line_y - c) / m; // Calculate X at the next Y mesh line    (we don't have to worry
413 415
       // about m being equal to 0.0  If this was the case, we would have
414 416
       // detected this as a vertical line move up above and we wouldn't
415 417
       // be down here doing a generic type of move.
416 418
 
417
-      if ((left_flag && (x>next_mesh_line_x)) || (!left_flag && (x<next_mesh_line_x))) { // Check if we hit the Y line first
419
+      if (left_flag == (x > next_mesh_line_x)) { // Check if we hit the Y line first
418 420
         //
419 421
         // Yes!  Crossing a Y Mesh Line next
420 422
         //
421
-        z0 = blm.get_z_correction_along_horizontal_mesh_line_at_specific_X(x, current_xi-left_flag, current_yi+dyi);
422
-
423
-        //
424
-        // debug code to use non-optimized get_z_correction() and to do a sanity check
425
-        // that the correct value is being passed to planner.buffer_line()
426
-        //
423
+        z0 = ubl.get_z_correction_along_horizontal_mesh_line_at_specific_X(x, current_xi - left_flag, current_yi + dyi);
427 424
 
425
+        /**
426
+         * Debug code to use non-optimized get_z_correction() and to do a sanity check
427
+         * that the correct value is being passed to planner.buffer_line()
428
+         */
428 429
         /*
429
-
430 430
           z_optimized = z0;
431
-
432
-          z0 = blm.get_z_correction( x, next_mesh_line_y);
433
-          if ( fabs(z_optimized - z0) > .01 || isnan(z0) || isnan(z_optimized) )  {
434
-            debug_current_and_destination( (char *) "General_1: z_correction()");
435
-            if ( isnan(z0) ) SERIAL_ECHO(" z0==NAN  ");
436
-            if ( isnan(z_optimized) ) SERIAL_ECHO(" z_optimized==NAN  "); {
431
+          z0 = ubl.get_z_correction( x, next_mesh_line_y);
432
+          if (fabs(z_optimized - z0) > .01 || isnan(z0) || isnan(z_optimized)) {
433
+            debug_current_and_destination((char*)"General_1: z_correction()");
434
+            if (isnan(z0)) SERIAL_ECHO(" z0==NAN  ");
435
+            if (isnan(z_optimized)) SERIAL_ECHO(" z_optimized==NAN  "); {
437 436
               SERIAL_ECHOPAIR("  x=", x);
438 437
             }
439 438
             SERIAL_ECHOPAIR("  next_mesh_line_y=", next_mesh_line_y);
@@ -442,23 +441,21 @@
442 441
             SERIAL_ECHOPAIR("  err=",fabs(z_optimized-z0));
443 442
             SERIAL_ECHO("\n");
444 443
           }
445
-        */
446
-
447
-        z0 = z0 * blm.fade_scaling_factor_for_Z( z_end );
448
-        if (isnan(z0)) {  // if part of the Mesh is undefined, it will show up as NAN
449
-          z0 = 0.0; // in z_values[][] and propagate through the
450
-          // calculations. If our correction is NAN, we throw it out
451
-          // because part of the Mesh is undefined and we don't have the
452
-          // information we need to complete the height correction.
453
-        }
444
+        //*/
454 445
 
455
-        if ( inf_normalized_flag == false ) {
456
-          if ( use_X_dist ) {
457
-            on_axis_distance   = x - x_start;
458
-          }
459
-          else {
460
-            on_axis_distance   = next_mesh_line_y - y_start;
461
-          }
446
+        z0 *= ubl.fade_scaling_factor_for_z(z_end);
447
+
448
+        /**
449
+         * If part of the Mesh is undefined, it will show up as NAN
450
+         * in z_values[][] and propagate through the
451
+         * calculations. If our correction is NAN, we throw it out
452
+         * because part of the Mesh is undefined and we don't have the
453
+         * information we need to complete the height correction.
454
+         */
455
+        if (isnan(z0)) z0 = 0.0;
456
+
457
+        if (!inf_normalized_flag) {
458
+          on_axis_distance = use_x_dist ? x - x_start : next_mesh_line_y - y_start;
462 459
           e_position = e_start + on_axis_distance * e_normalized_dist;
463 460
           z_position = z_start + on_axis_distance * z_normalized_dist;
464 461
         }
@@ -466,7 +463,7 @@
466 463
           e_position = e_start;
467 464
           z_position = z_start;
468 465
         }
469
-        planner.buffer_line(x, next_mesh_line_y, z_position + z0 + blm.state.z_offset, e_position, feed_rate, extruder);
466
+        planner.buffer_line(x, next_mesh_line_y, z_position + z0 + ubl.state.z_offset, e_position, feed_rate, extruder);
470 467
         current_yi += dyi;
471 468
         yi_cnt--;
472 469
       }
@@ -474,20 +471,19 @@
474 471
         //
475 472
         // Yes!  Crossing a X Mesh Line next
476 473
         //
477
-        z0 = blm.get_z_correction_along_vertical_mesh_line_at_specific_Y(y, current_xi+dxi, current_yi-down_flag);
474
+        z0 = ubl.get_z_correction_along_vertical_mesh_line_at_specific_Y(y, current_xi + dxi, current_yi - down_flag);
478 475
 
479
-
480
-        //
481
-        // debug code to use non-optimized get_z_correction() and to do a sanity check
482
-        // that the correct value is being passed to planner.buffer_line()
483
-        //
476
+        /**
477
+         * Debug code to use non-optimized get_z_correction() and to do a sanity check
478
+         * that the correct value is being passed to planner.buffer_line()
479
+         */
484 480
         /*
485 481
           z_optimized = z0;
486
-          z0 = blm.get_z_correction( next_mesh_line_x, y);
487
-          if ( fabs(z_optimized - z0) > .01 || isnan(z0) || isnan(z_optimized) )  {
488
-          debug_current_and_destination( (char *) "General_2: z_correction()");
489
-          if ( isnan(z0) ) SERIAL_ECHO(" z0==NAN  ");
490
-          if ( isnan(z_optimized) ) SERIAL_ECHO(" z_optimized==NAN  ");
482
+          z0 = ubl.get_z_correction( next_mesh_line_x, y);
483
+          if (fabs(z_optimized - z0) > .01 || isnan(z0) || isnan(z_optimized)) {
484
+          debug_current_and_destination((char*)"General_2: z_correction()");
485
+          if (isnan(z0)) SERIAL_ECHO(" z0==NAN  ");
486
+          if (isnan(z_optimized)) SERIAL_ECHO(" z_optimized==NAN  ");
491 487
           SERIAL_ECHOPAIR("  next_mesh_line_x=", next_mesh_line_x);
492 488
           SERIAL_ECHOPAIR("  y=", y);
493 489
           SERIAL_ECHOPAIR("  z0=", z0);
@@ -495,23 +491,21 @@
495 491
           SERIAL_ECHOPAIR("  err=",fabs(z_optimized-z0));
496 492
           SERIAL_ECHO("\n");
497 493
           }
498
-        */
494
+        //*/
499 495
 
500
-        z0 = z0 * blm.fade_scaling_factor_for_Z( z_end );
496
+        z0 = z0 * ubl.fade_scaling_factor_for_z(z_end);
501 497
 
502
-        if (isnan(z0)) {  // if part of the Mesh is undefined, it will show up as NAN
503
-          z0 = 0.0; // in z_values[][] and propagate through the
504
-          // calculations. If our correction is NAN, we throw it out
505
-          // because part of the Mesh is undefined and we don't have the
506
-          // information we need to complete the height correction.
507
-        }
508
-        if ( inf_normalized_flag == false ) {
509
-          if ( use_X_dist ) {
510
-            on_axis_distance   = next_mesh_line_x - x_start;
511
-          }
512
-          else {
513
-            on_axis_distance   = y - y_start;
514
-          }
498
+        /**
499
+         * If part of the Mesh is undefined, it will show up as NAN
500
+         * in z_values[][] and propagate through the
501
+         * calculations. If our correction is NAN, we throw it out
502
+         * because part of the Mesh is undefined and we don't have the
503
+         * information we need to complete the height correction.
504
+         */
505
+        if (isnan(z0)) z0 = 0.0;
506
+
507
+        if (!inf_normalized_flag) {
508
+          on_axis_distance = use_x_dist ? next_mesh_line_x - x_start : y - y_start;
515 509
           e_position = e_start + on_axis_distance * e_normalized_dist;
516 510
           z_position = z_start + on_axis_distance * z_normalized_dist;
517 511
         }
@@ -520,34 +514,19 @@
520 514
           z_position = z_start;
521 515
         }
522 516
 
523
-        planner.buffer_line(next_mesh_line_x, y, z_position + z0 + blm.state.z_offset, e_position, feed_rate, extruder);
517
+        planner.buffer_line(next_mesh_line_x, y, z_position + z0 + ubl.state.z_offset, e_position, feed_rate, extruder);
524 518
         current_xi += dxi;
525 519
         xi_cnt--;
526 520
       }
527 521
     }
528
-    if (G26_Debug_flag) {
529
-      debug_current_and_destination( (char *) "generic move done in UBL_line_to_destination()");
530
-    }
531
-    if (current_position[0] != x_end || current_position[1] != y_end)  {
532
-      goto FINAL_MOVE;
533
-    }
534
-    set_current_to_destination();
535
-    return;
536
-  }
537 522
 
538
-  void wait_for_button_press() {
539
-    //  if ( !been_to_2_6 )
540
-    //return;   // bob - I think this should be commented out
523
+    if (g26_debug_flag)
524
+      debug_current_and_destination((char*)"generic move done in ubl_line_to_destination()");
541 525
 
542
-    SET_INPUT_PULLUP(66); // Roxy's Left Switch is on pin 66.  Right Switch is on pin 65
543
-    SET_OUTPUT(64);
544
-    while (READ(66) & 0x01) idle();
526
+    if (current_position[0] != x_end || current_position[1] != y_end)
527
+      goto FINAL_MOVE;
545 528
 
546
-    delay(50);
547
-    while (!(READ(66) & 0x01)) idle();
548
-    delay(50);
529
+    set_current_to_destination();
549 530
   }
550 531
 
551 532
 #endif
552
-
553
-

+ 1
- 1
Marlin/cardreader.cpp View File

@@ -152,7 +152,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
152 152
   } // while readDir
153 153
 }
154 154
 
155
-void CardReader::ls()  {
155
+void CardReader::ls() {
156 156
   lsAction = LS_SerialPrint;
157 157
   root.rewind();
158 158
   lsDive("", root);

+ 24
- 24
Marlin/configuration_store.cpp View File

@@ -250,7 +250,7 @@ void Config_Postprocess() {
250 250
   /**
251 251
    * M500 - Store Configuration
252 252
    */
253
-  bool Config_StoreSettings()  {
253
+  bool Config_StoreSettings() {
254 254
     float dummy = 0.0f;
255 255
     char ver[4] = "000";
256 256
 
@@ -540,9 +540,9 @@ void Config_Postprocess() {
540 540
     }
541 541
 
542 542
     #if ENABLED(AUTO_BED_LEVELING_UBL)
543
-      blm.store_state();
544
-      if (blm.state.EEPROM_storage_slot >= 0)
545
-        blm.store_mesh(blm.state.EEPROM_storage_slot);
543
+      ubl.store_state();
544
+      if (ubl.state.eeprom_storage_slot >= 0)
545
+        ubl.store_mesh(ubl.state.eeprom_storage_slot);
546 546
     #endif
547 547
 
548 548
     return !eeprom_write_error;
@@ -846,39 +846,39 @@ void Config_Postprocess() {
846 846
       }
847 847
 
848 848
       #if ENABLED(AUTO_BED_LEVELING_UBL)
849
-        Unified_Bed_Leveling_EEPROM_start = (eeprom_index + 32) & 0xFFF8; // Pad the end of configuration data so it
849
+        ubl_eeprom_start = (eeprom_index + 32) & 0xFFF8; // Pad the end of configuration data so it
850 850
                                                                           // can float up or down a little bit without
851 851
                                                                           // disrupting the Unified Bed Leveling data
852
-        blm.load_state();
852
+        ubl.load_state();
853 853
 
854 854
         SERIAL_ECHOPGM(" UBL ");
855
-        if (!blm.state.active) SERIAL_ECHO("not ");
855
+        if (!ubl.state.active) SERIAL_ECHO("not ");
856 856
         SERIAL_ECHOLNPGM("active!");
857 857
 
858
-        if (!blm.sanity_check()) {
858
+        if (!ubl.sanity_check()) {
859 859
           int tmp_mesh;                                // We want to preserve whether the UBL System is Active
860 860
           bool tmp_active;                             // If it is, we want to preserve the Mesh that is being used.
861
-          tmp_mesh = blm.state.EEPROM_storage_slot;
862
-          tmp_active = blm.state.active;
861
+          tmp_mesh = ubl.state.eeprom_storage_slot;
862
+          tmp_active = ubl.state.active;
863 863
           SERIAL_ECHOLNPGM("\nInitializing Bed Leveling State to current firmware settings.\n");
864
-          blm.state = blm.pre_initialized;             // Initialize with the pre_initialized data structure
865
-          blm.state.EEPROM_storage_slot = tmp_mesh;    // But then restore some data we don't want mangled
866
-          blm.state.active = tmp_active;
864
+          ubl.state = ubl.pre_initialized;             // Initialize with the pre_initialized data structure
865
+          ubl.state.eeprom_storage_slot = tmp_mesh;    // But then restore some data we don't want mangled
866
+          ubl.state.active = tmp_active;
867 867
         }
868 868
         else {
869 869
           SERIAL_PROTOCOLPGM("?Unable to enable Unified Bed Leveling.\n");
870
-          blm.state = blm.pre_initialized;
871
-          blm.reset();
872
-          blm.store_state();
870
+          ubl.state = ubl.pre_initialized;
871
+          ubl.reset();
872
+          ubl.store_state();
873 873
         }
874 874
 
875
-        if (blm.state.EEPROM_storage_slot >= 0)  {
876
-          blm.load_mesh(blm.state.EEPROM_storage_slot);
877
-          SERIAL_ECHOPAIR("Mesh ", blm.state.EEPROM_storage_slot);
875
+        if (ubl.state.eeprom_storage_slot >= 0) {
876
+          ubl.load_mesh(ubl.state.eeprom_storage_slot);
877
+          SERIAL_ECHOPAIR("Mesh ", ubl.state.eeprom_storage_slot);
878 878
           SERIAL_ECHOLNPGM(" loaded from storage.");
879 879
         }
880 880
         else {
881
-          blm.reset();
881
+          ubl.reset();
882 882
           SERIAL_ECHOPGM("UBL System reset() \n");
883 883
         }
884 884
       #endif
@@ -1183,19 +1183,19 @@ void Config_ResetDefault() {
1183 1183
     CONFIG_ECHO_START;
1184 1184
 
1185 1185
     SERIAL_ECHOPGM("System is: ");
1186
-    if (blm.state.active)
1186
+    if (ubl.state.active)
1187 1187
        SERIAL_ECHOLNPGM("Active\n");
1188 1188
     else
1189 1189
        SERIAL_ECHOLNPGM("Deactive\n");
1190 1190
 
1191
-    SERIAL_ECHOPAIR("Active Mesh Slot: ", blm.state.EEPROM_storage_slot);
1191
+    SERIAL_ECHOPAIR("Active Mesh Slot: ", ubl.state.eeprom_storage_slot);
1192 1192
     SERIAL_EOL;
1193 1193
 
1194 1194
     SERIAL_ECHOPGM("z_offset: ");
1195
-    SERIAL_ECHO_F(blm.state.z_offset, 6);
1195
+    SERIAL_ECHO_F(ubl.state.z_offset, 6);
1196 1196
     SERIAL_EOL;
1197 1197
 
1198
-    SERIAL_ECHOPAIR("EEPROM can hold ", (int)((E2END - sizeof(blm.state) - Unified_Bed_Leveling_EEPROM_start) / sizeof(z_values)));
1198
+    SERIAL_ECHOPAIR("EEPROM can hold ", (int)((E2END - sizeof(ubl.state) - ubl_eeprom_start) / sizeof(z_values)));
1199 1199
     SERIAL_ECHOLNPGM(" meshes. \n");
1200 1200
 
1201 1201
     SERIAL_ECHOPAIR("\nUBL_MESH_NUM_X_POINTS  ", UBL_MESH_NUM_X_POINTS);

+ 41
- 34
Marlin/example_configurations/Cartesio/Configuration.h View File

@@ -748,41 +748,48 @@
748 748
 // @section bedlevel
749 749
 
750 750
 /**
751
- * Select one form of Auto Bed Leveling below.
751
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
752
+ * and behavior of G29 will change depending on your selection.
752 753
  *
753
- *  If you're also using the Probe for Z Homing, it's
754
- *  highly recommended to enable Z_SAFE_HOMING also!
754
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
755 755
  *
756
- * - 3POINT
756
+ * - AUTO_BED_LEVELING_3POINT
757 757
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
758 758
  *   You specify the XY coordinates of all 3 points.
759 759
  *   The result is a single tilted plane. Best for a flat bed.
760 760
  *
761
- * - LINEAR
761
+ * - AUTO_BED_LEVELING_LINEAR
762 762
  *   Probe several points in a grid.
763 763
  *   You specify the rectangle and the density of sample points.
764 764
  *   The result is a single tilted plane. Best for a flat bed.
765 765
  *
766
- * - BILINEAR
766
+ * - AUTO_BED_LEVELING_BILINEAR
767 767
  *   Probe several points in a grid.
768 768
  *   You specify the rectangle and the density of sample points.
769 769
  *   The result is a mesh, best for large or uneven beds.
770 770
  *
771
- * - UBL Unified Bed Leveling
772
- *   A comprehensive bed leveling system that combines features and benefits from previous
773
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
774
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
775
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
776
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
777
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
778
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
779
- *       test on.
771
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
772
+ *   A comprehensive bed leveling system combining the features and benefits
773
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
774
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
775
+ *   for Cartesian Printers. That said, it was primarily designed to correct
776
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
777
+ *   please post an issue if something doesn't work correctly. Initially,
778
+ *   you will need to set a reduced bed size so you have a rectangular area
779
+ *   to test on.
780
+ *
781
+ * - MESH_BED_LEVELING
782
+ *   Probe a grid manually
783
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
784
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
785
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
786
+ *   With an LCD controller the process is guided step-by-step.
780 787
  */
781 788
 //#define AUTO_BED_LEVELING_3POINT
782 789
 //#define AUTO_BED_LEVELING_LINEAR
783 790
 //#define AUTO_BED_LEVELING_BILINEAR
784
-//#define MESH_BED_LEVELING
785 791
 //#define AUTO_BED_LEVELING_UBL
792
+//#define MESH_BED_LEVELING
786 793
 
787 794
 /**
788 795
  * Enable detailed logging of G28, G29, M48, etc.
@@ -841,13 +848,28 @@
841 848
   #define ABL_PROBE_PT_3_X 170
842 849
   #define ABL_PROBE_PT_3_Y 20
843 850
 
851
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
852
+
853
+  //===========================================================================
854
+  //========================= Unified Bed Leveling ============================
855
+  //===========================================================================
856
+
857
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
858
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
859
+  #define UBL_MESH_NUM_Y_POINTS 10
860
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
861
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
862
+  #define UBL_PROBE_PT_2_X 39
863
+  #define UBL_PROBE_PT_2_Y 20
864
+  #define UBL_PROBE_PT_3_X 180
865
+  #define UBL_PROBE_PT_3_Y 20
866
+
844 867
 #elif ENABLED(MESH_BED_LEVELING)
845 868
 
846 869
   //===========================================================================
847 870
   //=================================== Mesh ==================================
848 871
   //===========================================================================
849 872
 
850
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
851 873
   #define MESH_INSET 10          // Mesh inset margin on print area
852 874
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
853 875
   #define MESH_NUM_Y_POINTS 3
@@ -855,28 +877,13 @@
855 877
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
856 878
 
857 879
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
880
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
858 881
 
859 882
   #if ENABLED(MANUAL_BED_LEVELING)
860 883
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
861 884
   #endif
862 885
 
863
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
864
-
865
-  //===========================================================================
866
-  //========================= Unified Bed Leveling ============================
867
-  //===========================================================================
868
-
869
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
870
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
871
-  #define UBL_MESH_NUM_Y_POINTS 10
872
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
873
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
874
-  #define UBL_PROBE_PT_2_X 39
875
-  #define UBL_PROBE_PT_2_Y 20
876
-  #define UBL_PROBE_PT_3_X 180
877
-  #define UBL_PROBE_PT_3_Y 20
878
-
879
-#endif  // BED_LEVELING
886
+#endif // BED_LEVELING
880 887
 
881 888
 /**
882 889
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/Felix/Configuration.h View File

@@ -731,41 +731,48 @@
731 731
 // @section bedlevel
732 732
 
733 733
 /**
734
- * Select one form of Auto Bed Leveling below.
734
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
735
+ * and behavior of G29 will change depending on your selection.
735 736
  *
736
- *  If you're also using the Probe for Z Homing, it's
737
- *  highly recommended to enable Z_SAFE_HOMING also!
737
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
738 738
  *
739
- * - 3POINT
739
+ * - AUTO_BED_LEVELING_3POINT
740 740
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
741 741
  *   You specify the XY coordinates of all 3 points.
742 742
  *   The result is a single tilted plane. Best for a flat bed.
743 743
  *
744
- * - LINEAR
744
+ * - AUTO_BED_LEVELING_LINEAR
745 745
  *   Probe several points in a grid.
746 746
  *   You specify the rectangle and the density of sample points.
747 747
  *   The result is a single tilted plane. Best for a flat bed.
748 748
  *
749
- * - BILINEAR
749
+ * - AUTO_BED_LEVELING_BILINEAR
750 750
  *   Probe several points in a grid.
751 751
  *   You specify the rectangle and the density of sample points.
752 752
  *   The result is a mesh, best for large or uneven beds.
753 753
  *
754
- * - UBL Unified Bed Leveling
755
- *   A comprehensive bed leveling system that combines features and benefits from previous
756
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
757
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
758
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
759
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
760
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
761
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
762
- *       test on.
754
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
755
+ *   A comprehensive bed leveling system combining the features and benefits
756
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
757
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
758
+ *   for Cartesian Printers. That said, it was primarily designed to correct
759
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
760
+ *   please post an issue if something doesn't work correctly. Initially,
761
+ *   you will need to set a reduced bed size so you have a rectangular area
762
+ *   to test on.
763
+ *
764
+ * - MESH_BED_LEVELING
765
+ *   Probe a grid manually
766
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
767
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
768
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
769
+ *   With an LCD controller the process is guided step-by-step.
763 770
  */
764 771
 //#define AUTO_BED_LEVELING_3POINT
765 772
 //#define AUTO_BED_LEVELING_LINEAR
766 773
 //#define AUTO_BED_LEVELING_BILINEAR
767
-//#define MESH_BED_LEVELING
768 774
 //#define AUTO_BED_LEVELING_UBL
775
+//#define MESH_BED_LEVELING
769 776
 
770 777
 /**
771 778
  * Enable detailed logging of G28, G29, M48, etc.
@@ -824,13 +831,28 @@
824 831
   #define ABL_PROBE_PT_3_X 170
825 832
   #define ABL_PROBE_PT_3_Y 20
826 833
 
834
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
835
+
836
+  //===========================================================================
837
+  //========================= Unified Bed Leveling ============================
838
+  //===========================================================================
839
+
840
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
841
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
842
+  #define UBL_MESH_NUM_Y_POINTS 10
843
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
844
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
845
+  #define UBL_PROBE_PT_2_X 39
846
+  #define UBL_PROBE_PT_2_Y 20
847
+  #define UBL_PROBE_PT_3_X 180
848
+  #define UBL_PROBE_PT_3_Y 20
849
+
827 850
 #elif ENABLED(MESH_BED_LEVELING)
828 851
 
829 852
   //===========================================================================
830 853
   //=================================== Mesh ==================================
831 854
   //===========================================================================
832 855
 
833
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
834 856
   #define MESH_INSET 10          // Mesh inset margin on print area
835 857
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
836 858
   #define MESH_NUM_Y_POINTS 3
@@ -838,28 +860,13 @@
838 860
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
839 861
 
840 862
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
863
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
841 864
 
842 865
   #if ENABLED(MANUAL_BED_LEVELING)
843 866
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
844 867
   #endif
845 868
 
846
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
847
-
848
-  //===========================================================================
849
-  //========================= Unified Bed Leveling ============================
850
-  //===========================================================================
851
-
852
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
853
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
854
-  #define UBL_MESH_NUM_Y_POINTS 10
855
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
856
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
857
-  #define UBL_PROBE_PT_2_X 39
858
-  #define UBL_PROBE_PT_2_Y 20
859
-  #define UBL_PROBE_PT_3_X 180
860
-  #define UBL_PROBE_PT_3_Y 20
861
-
862
-#endif  // BED_LEVELING
869
+#endif // BED_LEVELING
863 870
 
864 871
 /**
865 872
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/Felix/DUAL/Configuration.h View File

@@ -731,41 +731,48 @@
731 731
 // @section bedlevel
732 732
 
733 733
 /**
734
- * Select one form of Auto Bed Leveling below.
734
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
735
+ * and behavior of G29 will change depending on your selection.
735 736
  *
736
- *  If you're also using the Probe for Z Homing, it's
737
- *  highly recommended to enable Z_SAFE_HOMING also!
737
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
738 738
  *
739
- * - 3POINT
739
+ * - AUTO_BED_LEVELING_3POINT
740 740
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
741 741
  *   You specify the XY coordinates of all 3 points.
742 742
  *   The result is a single tilted plane. Best for a flat bed.
743 743
  *
744
- * - LINEAR
744
+ * - AUTO_BED_LEVELING_LINEAR
745 745
  *   Probe several points in a grid.
746 746
  *   You specify the rectangle and the density of sample points.
747 747
  *   The result is a single tilted plane. Best for a flat bed.
748 748
  *
749
- * - BILINEAR
749
+ * - AUTO_BED_LEVELING_BILINEAR
750 750
  *   Probe several points in a grid.
751 751
  *   You specify the rectangle and the density of sample points.
752 752
  *   The result is a mesh, best for large or uneven beds.
753 753
  *
754
- * - UBL Unified Bed Leveling
755
- *   A comprehensive bed leveling system that combines features and benefits from previous
756
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
757
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
758
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
759
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
760
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
761
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
762
- *       test on.
754
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
755
+ *   A comprehensive bed leveling system combining the features and benefits
756
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
757
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
758
+ *   for Cartesian Printers. That said, it was primarily designed to correct
759
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
760
+ *   please post an issue if something doesn't work correctly. Initially,
761
+ *   you will need to set a reduced bed size so you have a rectangular area
762
+ *   to test on.
763
+ *
764
+ * - MESH_BED_LEVELING
765
+ *   Probe a grid manually
766
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
767
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
768
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
769
+ *   With an LCD controller the process is guided step-by-step.
763 770
  */
764 771
 //#define AUTO_BED_LEVELING_3POINT
765 772
 //#define AUTO_BED_LEVELING_LINEAR
766 773
 //#define AUTO_BED_LEVELING_BILINEAR
767
-//#define MESH_BED_LEVELING
768 774
 //#define AUTO_BED_LEVELING_UBL
775
+//#define MESH_BED_LEVELING
769 776
 
770 777
 /**
771 778
  * Enable detailed logging of G28, G29, M48, etc.
@@ -824,13 +831,28 @@
824 831
   #define ABL_PROBE_PT_3_X 170
825 832
   #define ABL_PROBE_PT_3_Y 20
826 833
 
834
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
835
+
836
+  //===========================================================================
837
+  //========================= Unified Bed Leveling ============================
838
+  //===========================================================================
839
+
840
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
841
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
842
+  #define UBL_MESH_NUM_Y_POINTS 10
843
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
844
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
845
+  #define UBL_PROBE_PT_2_X 39
846
+  #define UBL_PROBE_PT_2_Y 20
847
+  #define UBL_PROBE_PT_3_X 180
848
+  #define UBL_PROBE_PT_3_Y 20
849
+
827 850
 #elif ENABLED(MESH_BED_LEVELING)
828 851
 
829 852
   //===========================================================================
830 853
   //=================================== Mesh ==================================
831 854
   //===========================================================================
832 855
 
833
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
834 856
   #define MESH_INSET 10          // Mesh inset margin on print area
835 857
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
836 858
   #define MESH_NUM_Y_POINTS 3
@@ -838,28 +860,13 @@
838 860
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
839 861
 
840 862
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
863
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
841 864
 
842 865
   #if ENABLED(MANUAL_BED_LEVELING)
843 866
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
844 867
   #endif
845 868
 
846
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
847
-
848
-  //===========================================================================
849
-  //========================= Unified Bed Leveling ============================
850
-  //===========================================================================
851
-
852
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
853
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
854
-  #define UBL_MESH_NUM_Y_POINTS 10
855
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
856
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
857
-  #define UBL_PROBE_PT_2_X 39
858
-  #define UBL_PROBE_PT_2_Y 20
859
-  #define UBL_PROBE_PT_3_X 180
860
-  #define UBL_PROBE_PT_3_Y 20
861
-
862
-#endif  // BED_LEVELING
869
+#endif // BED_LEVELING
863 870
 
864 871
 /**
865 872
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/Hephestos/Configuration.h View File

@@ -740,41 +740,48 @@
740 740
 // @section bedlevel
741 741
 
742 742
 /**
743
- * Select one form of Auto Bed Leveling below.
743
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
744
+ * and behavior of G29 will change depending on your selection.
744 745
  *
745
- *  If you're also using the Probe for Z Homing, it's
746
- *  highly recommended to enable Z_SAFE_HOMING also!
746
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
747 747
  *
748
- * - 3POINT
748
+ * - AUTO_BED_LEVELING_3POINT
749 749
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
750 750
  *   You specify the XY coordinates of all 3 points.
751 751
  *   The result is a single tilted plane. Best for a flat bed.
752 752
  *
753
- * - LINEAR
753
+ * - AUTO_BED_LEVELING_LINEAR
754 754
  *   Probe several points in a grid.
755 755
  *   You specify the rectangle and the density of sample points.
756 756
  *   The result is a single tilted plane. Best for a flat bed.
757 757
  *
758
- * - BILINEAR
758
+ * - AUTO_BED_LEVELING_BILINEAR
759 759
  *   Probe several points in a grid.
760 760
  *   You specify the rectangle and the density of sample points.
761 761
  *   The result is a mesh, best for large or uneven beds.
762 762
  *
763
- * - UBL Unified Bed Leveling
764
- *   A comprehensive bed leveling system that combines features and benefits from previous
765
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
766
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
767
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
768
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
769
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
770
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
771
- *       test on.
763
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
764
+ *   A comprehensive bed leveling system combining the features and benefits
765
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
766
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
767
+ *   for Cartesian Printers. That said, it was primarily designed to correct
768
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
769
+ *   please post an issue if something doesn't work correctly. Initially,
770
+ *   you will need to set a reduced bed size so you have a rectangular area
771
+ *   to test on.
772
+ *
773
+ * - MESH_BED_LEVELING
774
+ *   Probe a grid manually
775
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
776
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
777
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
778
+ *   With an LCD controller the process is guided step-by-step.
772 779
  */
773 780
 //#define AUTO_BED_LEVELING_3POINT
774 781
 //#define AUTO_BED_LEVELING_LINEAR
775 782
 //#define AUTO_BED_LEVELING_BILINEAR
776
-//#define MESH_BED_LEVELING
777 783
 //#define AUTO_BED_LEVELING_UBL
784
+//#define MESH_BED_LEVELING
778 785
 
779 786
 /**
780 787
  * Enable detailed logging of G28, G29, M48, etc.
@@ -833,13 +840,28 @@
833 840
   #define ABL_PROBE_PT_3_X 170
834 841
   #define ABL_PROBE_PT_3_Y 20
835 842
 
843
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
844
+
845
+  //===========================================================================
846
+  //========================= Unified Bed Leveling ============================
847
+  //===========================================================================
848
+
849
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
850
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
851
+  #define UBL_MESH_NUM_Y_POINTS 10
852
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
853
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
854
+  #define UBL_PROBE_PT_2_X 39
855
+  #define UBL_PROBE_PT_2_Y 20
856
+  #define UBL_PROBE_PT_3_X 180
857
+  #define UBL_PROBE_PT_3_Y 20
858
+
836 859
 #elif ENABLED(MESH_BED_LEVELING)
837 860
 
838 861
   //===========================================================================
839 862
   //=================================== Mesh ==================================
840 863
   //===========================================================================
841 864
 
842
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
843 865
   #define MESH_INSET 10          // Mesh inset margin on print area
844 866
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
845 867
   #define MESH_NUM_Y_POINTS 3
@@ -847,28 +869,13 @@
847 869
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
848 870
 
849 871
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
872
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
850 873
 
851 874
   #if ENABLED(MANUAL_BED_LEVELING)
852 875
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
853 876
   #endif
854 877
 
855
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
856
-
857
-  //===========================================================================
858
-  //========================= Unified Bed Leveling ============================
859
-  //===========================================================================
860
-
861
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
862
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
863
-  #define UBL_MESH_NUM_Y_POINTS 10
864
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
865
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
866
-  #define UBL_PROBE_PT_2_X 39
867
-  #define UBL_PROBE_PT_2_Y 20
868
-  #define UBL_PROBE_PT_3_X 180
869
-  #define UBL_PROBE_PT_3_Y 20
870
-
871
-#endif  // BED_LEVELING
878
+#endif // BED_LEVELING
872 879
 
873 880
 /**
874 881
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/Hephestos_2/Configuration.h View File

@@ -742,41 +742,48 @@
742 742
 // @section bedlevel
743 743
 
744 744
 /**
745
- * Select one form of Auto Bed Leveling below.
745
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
746
+ * and behavior of G29 will change depending on your selection.
746 747
  *
747
- *  If you're also using the Probe for Z Homing, it's
748
- *  highly recommended to enable Z_SAFE_HOMING also!
748
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
749 749
  *
750
- * - 3POINT
750
+ * - AUTO_BED_LEVELING_3POINT
751 751
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
752 752
  *   You specify the XY coordinates of all 3 points.
753 753
  *   The result is a single tilted plane. Best for a flat bed.
754 754
  *
755
- * - LINEAR
755
+ * - AUTO_BED_LEVELING_LINEAR
756 756
  *   Probe several points in a grid.
757 757
  *   You specify the rectangle and the density of sample points.
758 758
  *   The result is a single tilted plane. Best for a flat bed.
759 759
  *
760
- * - BILINEAR
760
+ * - AUTO_BED_LEVELING_BILINEAR
761 761
  *   Probe several points in a grid.
762 762
  *   You specify the rectangle and the density of sample points.
763 763
  *   The result is a mesh, best for large or uneven beds.
764 764
  *
765
- * - UBL Unified Bed Leveling
766
- *   A comprehensive bed leveling system that combines features and benefits from previous
767
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
768
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
769
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
770
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
771
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
772
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
773
- *       test on.
765
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
766
+ *   A comprehensive bed leveling system combining the features and benefits
767
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
768
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
769
+ *   for Cartesian Printers. That said, it was primarily designed to correct
770
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
771
+ *   please post an issue if something doesn't work correctly. Initially,
772
+ *   you will need to set a reduced bed size so you have a rectangular area
773
+ *   to test on.
774
+ *
775
+ * - MESH_BED_LEVELING
776
+ *   Probe a grid manually
777
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
778
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
779
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
780
+ *   With an LCD controller the process is guided step-by-step.
774 781
  */
775 782
 //#define AUTO_BED_LEVELING_3POINT
776 783
 //#define AUTO_BED_LEVELING_LINEAR
777 784
 //#define AUTO_BED_LEVELING_BILINEAR
778
-//#define MESH_BED_LEVELING
779 785
 //#define AUTO_BED_LEVELING_UBL
786
+//#define MESH_BED_LEVELING
780 787
 
781 788
 /**
782 789
  * Enable detailed logging of G28, G29, M48, etc.
@@ -835,13 +842,28 @@
835 842
   #define ABL_PROBE_PT_3_X ((X_MIN_POS + X_MAX_POS) / 2)
836 843
   #define ABL_PROBE_PT_3_Y Y_MAX_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)
837 844
 
845
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
846
+
847
+  //===========================================================================
848
+  //========================= Unified Bed Leveling ============================
849
+  //===========================================================================
850
+
851
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
852
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
853
+  #define UBL_MESH_NUM_Y_POINTS 10
854
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
855
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
856
+  #define UBL_PROBE_PT_2_X 39
857
+  #define UBL_PROBE_PT_2_Y 20
858
+  #define UBL_PROBE_PT_3_X 180
859
+  #define UBL_PROBE_PT_3_Y 20
860
+
838 861
 #elif ENABLED(MESH_BED_LEVELING)
839 862
 
840 863
   //===========================================================================
841 864
   //=================================== Mesh ==================================
842 865
   //===========================================================================
843 866
 
844
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
845 867
   #define MESH_INSET 10          // Mesh inset margin on print area
846 868
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
847 869
   #define MESH_NUM_Y_POINTS 3
@@ -849,28 +871,13 @@
849 871
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
850 872
 
851 873
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
874
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
852 875
 
853 876
   #if ENABLED(MANUAL_BED_LEVELING)
854 877
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
855 878
   #endif
856 879
 
857
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
858
-
859
-  //===========================================================================
860
-  //========================= Unified Bed Leveling ============================
861
-  //===========================================================================
862
-
863
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
864
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
865
-  #define UBL_MESH_NUM_Y_POINTS 10
866
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
867
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
868
-  #define UBL_PROBE_PT_2_X 39
869
-  #define UBL_PROBE_PT_2_Y 20
870
-  #define UBL_PROBE_PT_3_X 180
871
-  #define UBL_PROBE_PT_3_Y 20
872
-
873
-#endif  // BED_LEVELING
880
+#endif // BED_LEVELING
874 881
 
875 882
 /**
876 883
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/K8200/Configuration.h View File

@@ -777,41 +777,48 @@
777 777
 // @section bedlevel
778 778
 
779 779
 /**
780
- * Select one form of Auto Bed Leveling below.
780
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
781
+ * and behavior of G29 will change depending on your selection.
781 782
  *
782
- *  If you're also using the Probe for Z Homing, it's
783
- *  highly recommended to enable Z_SAFE_HOMING also!
783
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
784 784
  *
785
- * - 3POINT
785
+ * - AUTO_BED_LEVELING_3POINT
786 786
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
787 787
  *   You specify the XY coordinates of all 3 points.
788 788
  *   The result is a single tilted plane. Best for a flat bed.
789 789
  *
790
- * - LINEAR
790
+ * - AUTO_BED_LEVELING_LINEAR
791 791
  *   Probe several points in a grid.
792 792
  *   You specify the rectangle and the density of sample points.
793 793
  *   The result is a single tilted plane. Best for a flat bed.
794 794
  *
795
- * - BILINEAR
795
+ * - AUTO_BED_LEVELING_BILINEAR
796 796
  *   Probe several points in a grid.
797 797
  *   You specify the rectangle and the density of sample points.
798 798
  *   The result is a mesh, best for large or uneven beds.
799 799
  *
800
- * - UBL Unified Bed Leveling
801
- *   A comprehensive bed leveling system that combines features and benefits from previous
802
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
803
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
804
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
805
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
806
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
807
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
808
- *       test on.
800
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
801
+ *   A comprehensive bed leveling system combining the features and benefits
802
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
803
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
804
+ *   for Cartesian Printers. That said, it was primarily designed to correct
805
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
806
+ *   please post an issue if something doesn't work correctly. Initially,
807
+ *   you will need to set a reduced bed size so you have a rectangular area
808
+ *   to test on.
809
+ *
810
+ * - MESH_BED_LEVELING
811
+ *   Probe a grid manually
812
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
813
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
814
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
815
+ *   With an LCD controller the process is guided step-by-step.
809 816
  */
810 817
 //#define AUTO_BED_LEVELING_3POINT
811 818
 //#define AUTO_BED_LEVELING_LINEAR
812 819
 //#define AUTO_BED_LEVELING_BILINEAR
813
-//#define MESH_BED_LEVELING
814 820
 //#define AUTO_BED_LEVELING_UBL
821
+//#define MESH_BED_LEVELING
815 822
 
816 823
 /**
817 824
  * Enable detailed logging of G28, G29, M48, etc.
@@ -870,13 +877,28 @@
870 877
   #define ABL_PROBE_PT_3_X 170
871 878
   #define ABL_PROBE_PT_3_Y 20
872 879
 
880
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
881
+
882
+  //===========================================================================
883
+  //========================= Unified Bed Leveling ============================
884
+  //===========================================================================
885
+
886
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
887
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
888
+  #define UBL_MESH_NUM_Y_POINTS 10
889
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
890
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
891
+  #define UBL_PROBE_PT_2_X 39
892
+  #define UBL_PROBE_PT_2_Y 20
893
+  #define UBL_PROBE_PT_3_X 180
894
+  #define UBL_PROBE_PT_3_Y 20
895
+
873 896
 #elif ENABLED(MESH_BED_LEVELING)
874 897
 
875 898
   //===========================================================================
876 899
   //=================================== Mesh ==================================
877 900
   //===========================================================================
878 901
 
879
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
880 902
   #define MESH_INSET 10          // Mesh inset margin on print area
881 903
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
882 904
   #define MESH_NUM_Y_POINTS 3
@@ -884,28 +906,13 @@
884 906
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
885 907
 
886 908
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
909
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
887 910
 
888 911
   #if ENABLED(MANUAL_BED_LEVELING)
889 912
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
890 913
   #endif
891 914
 
892
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
893
-
894
-  //===========================================================================
895
-  //========================= Unified Bed Leveling ============================
896
-  //===========================================================================
897
-
898
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
899
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
900
-  #define UBL_MESH_NUM_Y_POINTS 10
901
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
902
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
903
-  #define UBL_PROBE_PT_2_X 39
904
-  #define UBL_PROBE_PT_2_Y 20
905
-  #define UBL_PROBE_PT_3_X 180
906
-  #define UBL_PROBE_PT_3_Y 20
907
-
908
-#endif  // BED_LEVELING
915
+#endif // BED_LEVELING
909 916
 
910 917
 /**
911 918
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/K8400/Configuration.h View File

@@ -748,41 +748,48 @@
748 748
 // @section bedlevel
749 749
 
750 750
 /**
751
- * Select one form of Auto Bed Leveling below.
751
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
752
+ * and behavior of G29 will change depending on your selection.
752 753
  *
753
- *  If you're also using the Probe for Z Homing, it's
754
- *  highly recommended to enable Z_SAFE_HOMING also!
754
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
755 755
  *
756
- * - 3POINT
756
+ * - AUTO_BED_LEVELING_3POINT
757 757
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
758 758
  *   You specify the XY coordinates of all 3 points.
759 759
  *   The result is a single tilted plane. Best for a flat bed.
760 760
  *
761
- * - LINEAR
761
+ * - AUTO_BED_LEVELING_LINEAR
762 762
  *   Probe several points in a grid.
763 763
  *   You specify the rectangle and the density of sample points.
764 764
  *   The result is a single tilted plane. Best for a flat bed.
765 765
  *
766
- * - BILINEAR
766
+ * - AUTO_BED_LEVELING_BILINEAR
767 767
  *   Probe several points in a grid.
768 768
  *   You specify the rectangle and the density of sample points.
769 769
  *   The result is a mesh, best for large or uneven beds.
770 770
  *
771
- * - UBL Unified Bed Leveling
772
- *   A comprehensive bed leveling system that combines features and benefits from previous
773
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
774
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
775
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
776
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
777
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
778
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
779
- *       test on.
771
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
772
+ *   A comprehensive bed leveling system combining the features and benefits
773
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
774
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
775
+ *   for Cartesian Printers. That said, it was primarily designed to correct
776
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
777
+ *   please post an issue if something doesn't work correctly. Initially,
778
+ *   you will need to set a reduced bed size so you have a rectangular area
779
+ *   to test on.
780
+ *
781
+ * - MESH_BED_LEVELING
782
+ *   Probe a grid manually
783
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
784
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
785
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
786
+ *   With an LCD controller the process is guided step-by-step.
780 787
  */
781 788
 //#define AUTO_BED_LEVELING_3POINT
782 789
 //#define AUTO_BED_LEVELING_LINEAR
783 790
 //#define AUTO_BED_LEVELING_BILINEAR
784
-//#define MESH_BED_LEVELING
785 791
 //#define AUTO_BED_LEVELING_UBL
792
+//#define MESH_BED_LEVELING
786 793
 
787 794
 /**
788 795
  * Enable detailed logging of G28, G29, M48, etc.
@@ -841,13 +848,28 @@
841 848
   #define ABL_PROBE_PT_3_X 170
842 849
   #define ABL_PROBE_PT_3_Y 20
843 850
 
851
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
852
+
853
+  //===========================================================================
854
+  //========================= Unified Bed Leveling ============================
855
+  //===========================================================================
856
+
857
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
858
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
859
+  #define UBL_MESH_NUM_Y_POINTS 10
860
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
861
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
862
+  #define UBL_PROBE_PT_2_X 39
863
+  #define UBL_PROBE_PT_2_Y 20
864
+  #define UBL_PROBE_PT_3_X 180
865
+  #define UBL_PROBE_PT_3_Y 20
866
+
844 867
 #elif ENABLED(MESH_BED_LEVELING)
845 868
 
846 869
   //===========================================================================
847 870
   //=================================== Mesh ==================================
848 871
   //===========================================================================
849 872
 
850
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
851 873
   #define MESH_INSET 10          // Mesh inset margin on print area
852 874
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
853 875
   #define MESH_NUM_Y_POINTS 3
@@ -855,28 +877,13 @@
855 877
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
856 878
 
857 879
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
880
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
858 881
 
859 882
   #if ENABLED(MANUAL_BED_LEVELING)
860 883
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
861 884
   #endif
862 885
 
863
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
864
-
865
-  //===========================================================================
866
-  //========================= Unified Bed Leveling ============================
867
-  //===========================================================================
868
-
869
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
870
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
871
-  #define UBL_MESH_NUM_Y_POINTS 10
872
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
873
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
874
-  #define UBL_PROBE_PT_2_X 39
875
-  #define UBL_PROBE_PT_2_Y 20
876
-  #define UBL_PROBE_PT_3_X 180
877
-  #define UBL_PROBE_PT_3_Y 20
878
-
879
-#endif  // BED_LEVELING
886
+#endif // BED_LEVELING
880 887
 
881 888
 /**
882 889
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/K8400/Dual-head/Configuration.h View File

@@ -748,41 +748,48 @@
748 748
 // @section bedlevel
749 749
 
750 750
 /**
751
- * Select one form of Auto Bed Leveling below.
751
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
752
+ * and behavior of G29 will change depending on your selection.
752 753
  *
753
- *  If you're also using the Probe for Z Homing, it's
754
- *  highly recommended to enable Z_SAFE_HOMING also!
754
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
755 755
  *
756
- * - 3POINT
756
+ * - AUTO_BED_LEVELING_3POINT
757 757
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
758 758
  *   You specify the XY coordinates of all 3 points.
759 759
  *   The result is a single tilted plane. Best for a flat bed.
760 760
  *
761
- * - LINEAR
761
+ * - AUTO_BED_LEVELING_LINEAR
762 762
  *   Probe several points in a grid.
763 763
  *   You specify the rectangle and the density of sample points.
764 764
  *   The result is a single tilted plane. Best for a flat bed.
765 765
  *
766
- * - BILINEAR
766
+ * - AUTO_BED_LEVELING_BILINEAR
767 767
  *   Probe several points in a grid.
768 768
  *   You specify the rectangle and the density of sample points.
769 769
  *   The result is a mesh, best for large or uneven beds.
770 770
  *
771
- * - UBL Unified Bed Leveling
772
- *   A comprehensive bed leveling system that combines features and benefits from previous
773
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
774
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
775
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
776
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
777
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
778
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
779
- *       test on.
771
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
772
+ *   A comprehensive bed leveling system combining the features and benefits
773
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
774
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
775
+ *   for Cartesian Printers. That said, it was primarily designed to correct
776
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
777
+ *   please post an issue if something doesn't work correctly. Initially,
778
+ *   you will need to set a reduced bed size so you have a rectangular area
779
+ *   to test on.
780
+ *
781
+ * - MESH_BED_LEVELING
782
+ *   Probe a grid manually
783
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
784
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
785
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
786
+ *   With an LCD controller the process is guided step-by-step.
780 787
  */
781 788
 //#define AUTO_BED_LEVELING_3POINT
782 789
 //#define AUTO_BED_LEVELING_LINEAR
783 790
 //#define AUTO_BED_LEVELING_BILINEAR
784
-//#define MESH_BED_LEVELING
785 791
 //#define AUTO_BED_LEVELING_UBL
792
+//#define MESH_BED_LEVELING
786 793
 
787 794
 /**
788 795
  * Enable detailed logging of G28, G29, M48, etc.
@@ -841,13 +848,28 @@
841 848
   #define ABL_PROBE_PT_3_X 170
842 849
   #define ABL_PROBE_PT_3_Y 20
843 850
 
851
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
852
+
853
+  //===========================================================================
854
+  //========================= Unified Bed Leveling ============================
855
+  //===========================================================================
856
+
857
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
858
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
859
+  #define UBL_MESH_NUM_Y_POINTS 10
860
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
861
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
862
+  #define UBL_PROBE_PT_2_X 39
863
+  #define UBL_PROBE_PT_2_Y 20
864
+  #define UBL_PROBE_PT_3_X 180
865
+  #define UBL_PROBE_PT_3_Y 20
866
+
844 867
 #elif ENABLED(MESH_BED_LEVELING)
845 868
 
846 869
   //===========================================================================
847 870
   //=================================== Mesh ==================================
848 871
   //===========================================================================
849 872
 
850
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
851 873
   #define MESH_INSET 10          // Mesh inset margin on print area
852 874
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
853 875
   #define MESH_NUM_Y_POINTS 3
@@ -855,28 +877,13 @@
855 877
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
856 878
 
857 879
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
880
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
858 881
 
859 882
   #if ENABLED(MANUAL_BED_LEVELING)
860 883
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
861 884
   #endif
862 885
 
863
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
864
-
865
-  //===========================================================================
866
-  //========================= Unified Bed Leveling ============================
867
-  //===========================================================================
868
-
869
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
870
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
871
-  #define UBL_MESH_NUM_Y_POINTS 10
872
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
873
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
874
-  #define UBL_PROBE_PT_2_X 39
875
-  #define UBL_PROBE_PT_2_Y 20
876
-  #define UBL_PROBE_PT_3_X 180
877
-  #define UBL_PROBE_PT_3_Y 20
878
-
879
-#endif  // BED_LEVELING
886
+#endif // BED_LEVELING
880 887
 
881 888
 /**
882 889
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h View File

@@ -748,41 +748,48 @@
748 748
 // @section bedlevel
749 749
 
750 750
 /**
751
- * Select one form of Auto Bed Leveling below.
751
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
752
+ * and behavior of G29 will change depending on your selection.
752 753
  *
753
- *  If you're also using the Probe for Z Homing, it's
754
- *  highly recommended to enable Z_SAFE_HOMING also!
754
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
755 755
  *
756
- * - 3POINT
756
+ * - AUTO_BED_LEVELING_3POINT
757 757
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
758 758
  *   You specify the XY coordinates of all 3 points.
759 759
  *   The result is a single tilted plane. Best for a flat bed.
760 760
  *
761
- * - LINEAR
761
+ * - AUTO_BED_LEVELING_LINEAR
762 762
  *   Probe several points in a grid.
763 763
  *   You specify the rectangle and the density of sample points.
764 764
  *   The result is a single tilted plane. Best for a flat bed.
765 765
  *
766
- * - BILINEAR
766
+ * - AUTO_BED_LEVELING_BILINEAR
767 767
  *   Probe several points in a grid.
768 768
  *   You specify the rectangle and the density of sample points.
769 769
  *   The result is a mesh, best for large or uneven beds.
770 770
  *
771
- * - UBL Unified Bed Leveling
772
- *   A comprehensive bed leveling system that combines features and benefits from previous
773
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
774
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
775
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
776
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
777
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
778
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
779
- *       test on.
771
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
772
+ *   A comprehensive bed leveling system combining the features and benefits
773
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
774
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
775
+ *   for Cartesian Printers. That said, it was primarily designed to correct
776
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
777
+ *   please post an issue if something doesn't work correctly. Initially,
778
+ *   you will need to set a reduced bed size so you have a rectangular area
779
+ *   to test on.
780
+ *
781
+ * - MESH_BED_LEVELING
782
+ *   Probe a grid manually
783
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
784
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
785
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
786
+ *   With an LCD controller the process is guided step-by-step.
780 787
  */
781 788
 //#define AUTO_BED_LEVELING_3POINT
782 789
 //#define AUTO_BED_LEVELING_LINEAR
783 790
 //#define AUTO_BED_LEVELING_BILINEAR
784
-//#define MESH_BED_LEVELING
785 791
 //#define AUTO_BED_LEVELING_UBL
792
+//#define MESH_BED_LEVELING
786 793
 
787 794
 /**
788 795
  * Enable detailed logging of G28, G29, M48, etc.
@@ -841,13 +848,28 @@
841 848
   #define ABL_PROBE_PT_3_X 170
842 849
   #define ABL_PROBE_PT_3_Y 20
843 850
 
851
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
852
+
853
+  //===========================================================================
854
+  //========================= Unified Bed Leveling ============================
855
+  //===========================================================================
856
+
857
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
858
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
859
+  #define UBL_MESH_NUM_Y_POINTS 10
860
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
861
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
862
+  #define UBL_PROBE_PT_2_X 39
863
+  #define UBL_PROBE_PT_2_Y 20
864
+  #define UBL_PROBE_PT_3_X 180
865
+  #define UBL_PROBE_PT_3_Y 20
866
+
844 867
 #elif ENABLED(MESH_BED_LEVELING)
845 868
 
846 869
   //===========================================================================
847 870
   //=================================== Mesh ==================================
848 871
   //===========================================================================
849 872
 
850
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
851 873
   #define MESH_INSET 10          // Mesh inset margin on print area
852 874
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
853 875
   #define MESH_NUM_Y_POINTS 3
@@ -855,28 +877,13 @@
855 877
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
856 878
 
857 879
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
880
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
858 881
 
859 882
   #if ENABLED(MANUAL_BED_LEVELING)
860 883
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
861 884
   #endif
862 885
 
863
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
864
-
865
-  //===========================================================================
866
-  //========================= Unified Bed Leveling ============================
867
-  //===========================================================================
868
-
869
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
870
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
871
-  #define UBL_MESH_NUM_Y_POINTS 10
872
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
873
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
874
-  #define UBL_PROBE_PT_2_X 39
875
-  #define UBL_PROBE_PT_2_Y 20
876
-  #define UBL_PROBE_PT_3_X 180
877
-  #define UBL_PROBE_PT_3_Y 20
878
-
879
-#endif  // BED_LEVELING
886
+#endif // BED_LEVELING
880 887
 
881 888
 /**
882 889
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/RigidBot/Configuration.h View File

@@ -747,41 +747,48 @@
747 747
 // @section bedlevel
748 748
 
749 749
 /**
750
- * Select one form of Auto Bed Leveling below.
750
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
751
+ * and behavior of G29 will change depending on your selection.
751 752
  *
752
- *  If you're also using the Probe for Z Homing, it's
753
- *  highly recommended to enable Z_SAFE_HOMING also!
753
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
754 754
  *
755
- * - 3POINT
755
+ * - AUTO_BED_LEVELING_3POINT
756 756
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
757 757
  *   You specify the XY coordinates of all 3 points.
758 758
  *   The result is a single tilted plane. Best for a flat bed.
759 759
  *
760
- * - LINEAR
760
+ * - AUTO_BED_LEVELING_LINEAR
761 761
  *   Probe several points in a grid.
762 762
  *   You specify the rectangle and the density of sample points.
763 763
  *   The result is a single tilted plane. Best for a flat bed.
764 764
  *
765
- * - BILINEAR
765
+ * - AUTO_BED_LEVELING_BILINEAR
766 766
  *   Probe several points in a grid.
767 767
  *   You specify the rectangle and the density of sample points.
768 768
  *   The result is a mesh, best for large or uneven beds.
769 769
  *
770
- * - UBL Unified Bed Leveling
771
- *   A comprehensive bed leveling system that combines features and benefits from previous
772
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
773
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
774
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
775
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
776
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
777
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
778
- *       test on.
770
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
771
+ *   A comprehensive bed leveling system combining the features and benefits
772
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
773
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
774
+ *   for Cartesian Printers. That said, it was primarily designed to correct
775
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
776
+ *   please post an issue if something doesn't work correctly. Initially,
777
+ *   you will need to set a reduced bed size so you have a rectangular area
778
+ *   to test on.
779
+ *
780
+ * - MESH_BED_LEVELING
781
+ *   Probe a grid manually
782
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
783
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
784
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
785
+ *   With an LCD controller the process is guided step-by-step.
779 786
  */
780 787
 //#define AUTO_BED_LEVELING_3POINT
781 788
 //#define AUTO_BED_LEVELING_LINEAR
782 789
 //#define AUTO_BED_LEVELING_BILINEAR
783
-//#define MESH_BED_LEVELING
784 790
 //#define AUTO_BED_LEVELING_UBL
791
+//#define MESH_BED_LEVELING
785 792
 
786 793
 /**
787 794
  * Enable detailed logging of G28, G29, M48, etc.
@@ -840,13 +847,28 @@
840 847
   #define ABL_PROBE_PT_3_X 170
841 848
   #define ABL_PROBE_PT_3_Y 20
842 849
 
850
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
851
+
852
+  //===========================================================================
853
+  //========================= Unified Bed Leveling ============================
854
+  //===========================================================================
855
+
856
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
857
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
858
+  #define UBL_MESH_NUM_Y_POINTS 10
859
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
860
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
861
+  #define UBL_PROBE_PT_2_X 39
862
+  #define UBL_PROBE_PT_2_Y 20
863
+  #define UBL_PROBE_PT_3_X 180
864
+  #define UBL_PROBE_PT_3_Y 20
865
+
843 866
 #elif ENABLED(MESH_BED_LEVELING)
844 867
 
845 868
   //===========================================================================
846 869
   //=================================== Mesh ==================================
847 870
   //===========================================================================
848 871
 
849
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
850 872
   #define MESH_INSET 10          // Mesh inset margin on print area
851 873
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
852 874
   #define MESH_NUM_Y_POINTS 3
@@ -854,28 +876,13 @@
854 876
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
855 877
 
856 878
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
879
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
857 880
 
858 881
   #if ENABLED(MANUAL_BED_LEVELING)
859 882
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
860 883
   #endif
861 884
 
862
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
863
-
864
-  //===========================================================================
865
-  //========================= Unified Bed Leveling ============================
866
-  //===========================================================================
867
-
868
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
869
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
870
-  #define UBL_MESH_NUM_Y_POINTS 10
871
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
872
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
873
-  #define UBL_PROBE_PT_2_X 39
874
-  #define UBL_PROBE_PT_2_Y 20
875
-  #define UBL_PROBE_PT_3_X 180
876
-  #define UBL_PROBE_PT_3_Y 20
877
-
878
-#endif  // BED_LEVELING
885
+#endif // BED_LEVELING
879 886
 
880 887
 /**
881 888
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/SCARA/Configuration.h View File

@@ -763,41 +763,48 @@
763 763
 // @section bedlevel
764 764
 
765 765
 /**
766
- * Select one form of Auto Bed Leveling below.
766
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
767
+ * and behavior of G29 will change depending on your selection.
767 768
  *
768
- *  If you're also using the Probe for Z Homing, it's
769
- *  highly recommended to enable Z_SAFE_HOMING also!
769
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
770 770
  *
771
- * - 3POINT
771
+ * - AUTO_BED_LEVELING_3POINT
772 772
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
773 773
  *   You specify the XY coordinates of all 3 points.
774 774
  *   The result is a single tilted plane. Best for a flat bed.
775 775
  *
776
- * - LINEAR
776
+ * - AUTO_BED_LEVELING_LINEAR
777 777
  *   Probe several points in a grid.
778 778
  *   You specify the rectangle and the density of sample points.
779 779
  *   The result is a single tilted plane. Best for a flat bed.
780 780
  *
781
- * - BILINEAR
781
+ * - AUTO_BED_LEVELING_BILINEAR
782 782
  *   Probe several points in a grid.
783 783
  *   You specify the rectangle and the density of sample points.
784 784
  *   The result is a mesh, best for large or uneven beds.
785 785
  *
786
- * - UBL Unified Bed Leveling
787
- *   A comprehensive bed leveling system that combines features and benefits from previous
788
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
789
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
790
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
791
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
792
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
793
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
794
- *       test on.
786
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
787
+ *   A comprehensive bed leveling system combining the features and benefits
788
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
789
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
790
+ *   for Cartesian Printers. That said, it was primarily designed to correct
791
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
792
+ *   please post an issue if something doesn't work correctly. Initially,
793
+ *   you will need to set a reduced bed size so you have a rectangular area
794
+ *   to test on.
795
+ *
796
+ * - MESH_BED_LEVELING
797
+ *   Probe a grid manually
798
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
799
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
800
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
801
+ *   With an LCD controller the process is guided step-by-step.
795 802
  */
796 803
 //#define AUTO_BED_LEVELING_3POINT
797 804
 //#define AUTO_BED_LEVELING_LINEAR
798 805
 //#define AUTO_BED_LEVELING_BILINEAR
799
-//#define MESH_BED_LEVELING
800 806
 //#define AUTO_BED_LEVELING_UBL
807
+//#define MESH_BED_LEVELING
801 808
 
802 809
 /**
803 810
  * Enable detailed logging of G28, G29, M48, etc.
@@ -856,13 +863,28 @@
856 863
   #define ABL_PROBE_PT_3_X 170
857 864
   #define ABL_PROBE_PT_3_Y 20
858 865
 
866
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
867
+
868
+  //===========================================================================
869
+  //========================= Unified Bed Leveling ============================
870
+  //===========================================================================
871
+
872
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
873
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
874
+  #define UBL_MESH_NUM_Y_POINTS 10
875
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
876
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
877
+  #define UBL_PROBE_PT_2_X 39
878
+  #define UBL_PROBE_PT_2_Y 20
879
+  #define UBL_PROBE_PT_3_X 180
880
+  #define UBL_PROBE_PT_3_Y 20
881
+
859 882
 #elif ENABLED(MESH_BED_LEVELING)
860 883
 
861 884
   //===========================================================================
862 885
   //=================================== Mesh ==================================
863 886
   //===========================================================================
864 887
 
865
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
866 888
   #define MESH_INSET 10          // Mesh inset margin on print area
867 889
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
868 890
   #define MESH_NUM_Y_POINTS 3
@@ -870,28 +892,13 @@
870 892
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
871 893
 
872 894
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
895
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
873 896
 
874 897
   #if ENABLED(MANUAL_BED_LEVELING)
875 898
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
876 899
   #endif
877 900
 
878
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
879
-
880
-  //===========================================================================
881
-  //========================= Unified Bed Leveling ============================
882
-  //===========================================================================
883
-
884
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
885
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
886
-  #define UBL_MESH_NUM_Y_POINTS 10
887
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
888
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
889
-  #define UBL_PROBE_PT_2_X 39
890
-  #define UBL_PROBE_PT_2_Y 20
891
-  #define UBL_PROBE_PT_3_X 180
892
-  #define UBL_PROBE_PT_3_Y 20
893
-
894
-#endif  // BED_LEVELING
901
+#endif // BED_LEVELING
895 902
 
896 903
 /**
897 904
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/TAZ4/Configuration.h View File

@@ -769,41 +769,48 @@
769 769
 // @section bedlevel
770 770
 
771 771
 /**
772
- * Select one form of Auto Bed Leveling below.
772
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
773
+ * and behavior of G29 will change depending on your selection.
773 774
  *
774
- *  If you're also using the Probe for Z Homing, it's
775
- *  highly recommended to enable Z_SAFE_HOMING also!
775
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
776 776
  *
777
- * - 3POINT
777
+ * - AUTO_BED_LEVELING_3POINT
778 778
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
779 779
  *   You specify the XY coordinates of all 3 points.
780 780
  *   The result is a single tilted plane. Best for a flat bed.
781 781
  *
782
- * - LINEAR
782
+ * - AUTO_BED_LEVELING_LINEAR
783 783
  *   Probe several points in a grid.
784 784
  *   You specify the rectangle and the density of sample points.
785 785
  *   The result is a single tilted plane. Best for a flat bed.
786 786
  *
787
- * - BILINEAR
787
+ * - AUTO_BED_LEVELING_BILINEAR
788 788
  *   Probe several points in a grid.
789 789
  *   You specify the rectangle and the density of sample points.
790 790
  *   The result is a mesh, best for large or uneven beds.
791 791
  *
792
- * - UBL Unified Bed Leveling
793
- *   A comprehensive bed leveling system that combines features and benefits from previous
794
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
795
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
796
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
797
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
798
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
799
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
800
- *       test on.
792
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
793
+ *   A comprehensive bed leveling system combining the features and benefits
794
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
795
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
796
+ *   for Cartesian Printers. That said, it was primarily designed to correct
797
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
798
+ *   please post an issue if something doesn't work correctly. Initially,
799
+ *   you will need to set a reduced bed size so you have a rectangular area
800
+ *   to test on.
801
+ *
802
+ * - MESH_BED_LEVELING
803
+ *   Probe a grid manually
804
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
805
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
806
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
807
+ *   With an LCD controller the process is guided step-by-step.
801 808
  */
802 809
 //#define AUTO_BED_LEVELING_3POINT
803 810
 //#define AUTO_BED_LEVELING_LINEAR
804 811
 //#define AUTO_BED_LEVELING_BILINEAR
805
-//#define MESH_BED_LEVELING
806 812
 //#define AUTO_BED_LEVELING_UBL
813
+//#define MESH_BED_LEVELING
807 814
 
808 815
 /**
809 816
  * Enable detailed logging of G28, G29, M48, etc.
@@ -862,13 +869,28 @@
862 869
   #define ABL_PROBE_PT_3_X 170
863 870
   #define ABL_PROBE_PT_3_Y 20
864 871
 
872
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
873
+
874
+  //===========================================================================
875
+  //========================= Unified Bed Leveling ============================
876
+  //===========================================================================
877
+
878
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
879
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
880
+  #define UBL_MESH_NUM_Y_POINTS 10
881
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
882
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
883
+  #define UBL_PROBE_PT_2_X 39
884
+  #define UBL_PROBE_PT_2_Y 20
885
+  #define UBL_PROBE_PT_3_X 180
886
+  #define UBL_PROBE_PT_3_Y 20
887
+
865 888
 #elif ENABLED(MESH_BED_LEVELING)
866 889
 
867 890
   //===========================================================================
868 891
   //=================================== Mesh ==================================
869 892
   //===========================================================================
870 893
 
871
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
872 894
   #define MESH_INSET 10          // Mesh inset margin on print area
873 895
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
874 896
   #define MESH_NUM_Y_POINTS 3
@@ -876,28 +898,13 @@
876 898
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
877 899
 
878 900
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
901
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
879 902
 
880 903
   #if ENABLED(MANUAL_BED_LEVELING)
881 904
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
882 905
   #endif
883 906
 
884
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
885
-
886
-  //===========================================================================
887
-  //========================= Unified Bed Leveling ============================
888
-  //===========================================================================
889
-
890
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
891
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
892
-  #define UBL_MESH_NUM_Y_POINTS 10
893
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
894
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
895
-  #define UBL_PROBE_PT_2_X 39
896
-  #define UBL_PROBE_PT_2_Y 20
897
-  #define UBL_PROBE_PT_3_X 180
898
-  #define UBL_PROBE_PT_3_Y 20
899
-
900
-#endif  // BED_LEVELING
907
+#endif // BED_LEVELING
901 908
 
902 909
 /**
903 910
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/WITBOX/Configuration.h View File

@@ -740,41 +740,48 @@
740 740
 // @section bedlevel
741 741
 
742 742
 /**
743
- * Select one form of Auto Bed Leveling below.
743
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
744
+ * and behavior of G29 will change depending on your selection.
744 745
  *
745
- *  If you're also using the Probe for Z Homing, it's
746
- *  highly recommended to enable Z_SAFE_HOMING also!
746
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
747 747
  *
748
- * - 3POINT
748
+ * - AUTO_BED_LEVELING_3POINT
749 749
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
750 750
  *   You specify the XY coordinates of all 3 points.
751 751
  *   The result is a single tilted plane. Best for a flat bed.
752 752
  *
753
- * - LINEAR
753
+ * - AUTO_BED_LEVELING_LINEAR
754 754
  *   Probe several points in a grid.
755 755
  *   You specify the rectangle and the density of sample points.
756 756
  *   The result is a single tilted plane. Best for a flat bed.
757 757
  *
758
- * - BILINEAR
758
+ * - AUTO_BED_LEVELING_BILINEAR
759 759
  *   Probe several points in a grid.
760 760
  *   You specify the rectangle and the density of sample points.
761 761
  *   The result is a mesh, best for large or uneven beds.
762 762
  *
763
- * - UBL Unified Bed Leveling
764
- *   A comprehensive bed leveling system that combines features and benefits from previous
765
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
766
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
767
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
768
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
769
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
770
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
771
- *       test on.
763
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
764
+ *   A comprehensive bed leveling system combining the features and benefits
765
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
766
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
767
+ *   for Cartesian Printers. That said, it was primarily designed to correct
768
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
769
+ *   please post an issue if something doesn't work correctly. Initially,
770
+ *   you will need to set a reduced bed size so you have a rectangular area
771
+ *   to test on.
772
+ *
773
+ * - MESH_BED_LEVELING
774
+ *   Probe a grid manually
775
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
776
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
777
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
778
+ *   With an LCD controller the process is guided step-by-step.
772 779
  */
773 780
 //#define AUTO_BED_LEVELING_3POINT
774 781
 //#define AUTO_BED_LEVELING_LINEAR
775 782
 //#define AUTO_BED_LEVELING_BILINEAR
776
-//#define MESH_BED_LEVELING
777 783
 //#define AUTO_BED_LEVELING_UBL
784
+//#define MESH_BED_LEVELING
778 785
 
779 786
 /**
780 787
  * Enable detailed logging of G28, G29, M48, etc.
@@ -833,13 +840,28 @@
833 840
   #define ABL_PROBE_PT_3_X 170
834 841
   #define ABL_PROBE_PT_3_Y 20
835 842
 
843
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
844
+
845
+  //===========================================================================
846
+  //========================= Unified Bed Leveling ============================
847
+  //===========================================================================
848
+
849
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
850
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
851
+  #define UBL_MESH_NUM_Y_POINTS 10
852
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
853
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
854
+  #define UBL_PROBE_PT_2_X 39
855
+  #define UBL_PROBE_PT_2_Y 20
856
+  #define UBL_PROBE_PT_3_X 180
857
+  #define UBL_PROBE_PT_3_Y 20
858
+
836 859
 #elif ENABLED(MESH_BED_LEVELING)
837 860
 
838 861
   //===========================================================================
839 862
   //=================================== Mesh ==================================
840 863
   //===========================================================================
841 864
 
842
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
843 865
   #define MESH_INSET 10          // Mesh inset margin on print area
844 866
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
845 867
   #define MESH_NUM_Y_POINTS 3
@@ -847,28 +869,13 @@
847 869
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
848 870
 
849 871
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
872
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
850 873
 
851 874
   #if ENABLED(MANUAL_BED_LEVELING)
852 875
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
853 876
   #endif
854 877
 
855
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
856
-
857
-  //===========================================================================
858
-  //========================= Unified Bed Leveling ============================
859
-  //===========================================================================
860
-
861
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
862
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
863
-  #define UBL_MESH_NUM_Y_POINTS 10
864
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
865
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
866
-  #define UBL_PROBE_PT_2_X 39
867
-  #define UBL_PROBE_PT_2_Y 20
868
-  #define UBL_PROBE_PT_3_X 180
869
-  #define UBL_PROBE_PT_3_Y 20
870
-
871
-#endif  // BED_LEVELING
878
+#endif // BED_LEVELING
872 879
 
873 880
 /**
874 881
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/adafruit/ST7565/Configuration.h View File

@@ -748,41 +748,48 @@
748 748
 // @section bedlevel
749 749
 
750 750
 /**
751
- * Select one form of Auto Bed Leveling below.
751
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
752
+ * and behavior of G29 will change depending on your selection.
752 753
  *
753
- *  If you're also using the Probe for Z Homing, it's
754
- *  highly recommended to enable Z_SAFE_HOMING also!
754
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
755 755
  *
756
- * - 3POINT
756
+ * - AUTO_BED_LEVELING_3POINT
757 757
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
758 758
  *   You specify the XY coordinates of all 3 points.
759 759
  *   The result is a single tilted plane. Best for a flat bed.
760 760
  *
761
- * - LINEAR
761
+ * - AUTO_BED_LEVELING_LINEAR
762 762
  *   Probe several points in a grid.
763 763
  *   You specify the rectangle and the density of sample points.
764 764
  *   The result is a single tilted plane. Best for a flat bed.
765 765
  *
766
- * - BILINEAR
766
+ * - AUTO_BED_LEVELING_BILINEAR
767 767
  *   Probe several points in a grid.
768 768
  *   You specify the rectangle and the density of sample points.
769 769
  *   The result is a mesh, best for large or uneven beds.
770 770
  *
771
- * - UBL Unified Bed Leveling
772
- *   A comprehensive bed leveling system that combines features and benefits from previous
773
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
774
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
775
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
776
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
777
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
778
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
779
- *       test on.
771
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
772
+ *   A comprehensive bed leveling system combining the features and benefits
773
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
774
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
775
+ *   for Cartesian Printers. That said, it was primarily designed to correct
776
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
777
+ *   please post an issue if something doesn't work correctly. Initially,
778
+ *   you will need to set a reduced bed size so you have a rectangular area
779
+ *   to test on.
780
+ *
781
+ * - MESH_BED_LEVELING
782
+ *   Probe a grid manually
783
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
784
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
785
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
786
+ *   With an LCD controller the process is guided step-by-step.
780 787
  */
781 788
 //#define AUTO_BED_LEVELING_3POINT
782 789
 //#define AUTO_BED_LEVELING_LINEAR
783 790
 //#define AUTO_BED_LEVELING_BILINEAR
784
-//#define MESH_BED_LEVELING
785 791
 //#define AUTO_BED_LEVELING_UBL
792
+//#define MESH_BED_LEVELING
786 793
 
787 794
 /**
788 795
  * Enable detailed logging of G28, G29, M48, etc.
@@ -841,13 +848,28 @@
841 848
   #define ABL_PROBE_PT_3_X 170
842 849
   #define ABL_PROBE_PT_3_Y 20
843 850
 
851
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
852
+
853
+  //===========================================================================
854
+  //========================= Unified Bed Leveling ============================
855
+  //===========================================================================
856
+
857
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
858
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
859
+  #define UBL_MESH_NUM_Y_POINTS 10
860
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
861
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
862
+  #define UBL_PROBE_PT_2_X 39
863
+  #define UBL_PROBE_PT_2_Y 20
864
+  #define UBL_PROBE_PT_3_X 180
865
+  #define UBL_PROBE_PT_3_Y 20
866
+
844 867
 #elif ENABLED(MESH_BED_LEVELING)
845 868
 
846 869
   //===========================================================================
847 870
   //=================================== Mesh ==================================
848 871
   //===========================================================================
849 872
 
850
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
851 873
   #define MESH_INSET 10          // Mesh inset margin on print area
852 874
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
853 875
   #define MESH_NUM_Y_POINTS 3
@@ -855,28 +877,13 @@
855 877
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
856 878
 
857 879
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
880
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
858 881
 
859 882
   #if ENABLED(MANUAL_BED_LEVELING)
860 883
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
861 884
   #endif
862 885
 
863
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
864
-
865
-  //===========================================================================
866
-  //========================= Unified Bed Leveling ============================
867
-  //===========================================================================
868
-
869
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
870
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
871
-  #define UBL_MESH_NUM_Y_POINTS 10
872
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
873
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
874
-  #define UBL_PROBE_PT_2_X 39
875
-  #define UBL_PROBE_PT_2_Y 20
876
-  #define UBL_PROBE_PT_3_X 180
877
-  #define UBL_PROBE_PT_3_Y 20
878
-
879
-#endif  // BED_LEVELING
886
+#endif // BED_LEVELING
880 887
 
881 888
 /**
882 889
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h View File

@@ -853,41 +853,48 @@
853 853
 // @section bedlevel
854 854
 
855 855
 /**
856
- * Select one form of Auto Bed Leveling below.
856
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
857
+ * and behavior of G29 will change depending on your selection.
857 858
  *
858
- *  If you're also using the Probe for Z Homing, it's
859
- *  highly recommended to enable Z_SAFE_HOMING also!
859
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
860 860
  *
861
- * - 3POINT
861
+ * - AUTO_BED_LEVELING_3POINT
862 862
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
863 863
  *   You specify the XY coordinates of all 3 points.
864 864
  *   The result is a single tilted plane. Best for a flat bed.
865 865
  *
866
- * - LINEAR
866
+ * - AUTO_BED_LEVELING_LINEAR
867 867
  *   Probe several points in a grid.
868 868
  *   You specify the rectangle and the density of sample points.
869 869
  *   The result is a single tilted plane. Best for a flat bed.
870 870
  *
871
- * - BILINEAR
871
+ * - AUTO_BED_LEVELING_BILINEAR
872 872
  *   Probe several points in a grid.
873 873
  *   You specify the rectangle and the density of sample points.
874 874
  *   The result is a mesh, best for large or uneven beds.
875 875
  *
876
- * - UBL Unified Bed Leveling
877
- *   A comprehensive bed leveling system that combines features and benefits from previous
878
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
879
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
880
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
881
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
882
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
883
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
884
- *       test on.
876
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
877
+ *   A comprehensive bed leveling system combining the features and benefits
878
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
879
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
880
+ *   for Cartesian Printers. That said, it was primarily designed to correct
881
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
882
+ *   please post an issue if something doesn't work correctly. Initially,
883
+ *   you will need to set a reduced bed size so you have a rectangular area
884
+ *   to test on.
885
+ *
886
+ * - MESH_BED_LEVELING
887
+ *   Probe a grid manually
888
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
889
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
890
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
891
+ *   With an LCD controller the process is guided step-by-step.
885 892
  */
886 893
 //#define AUTO_BED_LEVELING_3POINT // Only AUTO_BED_LEVELING_BILINEAR is supported for DELTA bed leveling.
887 894
 //#define AUTO_BED_LEVELING_LINEAR // Only AUTO_BED_LEVELING_BILINEAR is supported for DELTA bed leveling.
888 895
 #define AUTO_BED_LEVELING_BILINEAR // Only AUTO_BED_LEVELING_BILINEAR is supported for DELTA bed leveling.
889
-//#define MESH_BED_LEVELING
890 896
 //#define AUTO_BED_LEVELING_UBL
897
+//#define MESH_BED_LEVELING
891 898
 
892 899
 /**
893 900
  * Enable detailed logging of G28, G29, M48, etc.
@@ -946,13 +953,28 @@
946 953
   #define ABL_PROBE_PT_3_X 170
947 954
   #define ABL_PROBE_PT_3_Y 20
948 955
 
956
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
957
+
958
+  //===========================================================================
959
+  //========================= Unified Bed Leveling ============================
960
+  //===========================================================================
961
+
962
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
963
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
964
+  #define UBL_MESH_NUM_Y_POINTS 10
965
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
966
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
967
+  #define UBL_PROBE_PT_2_X 39
968
+  #define UBL_PROBE_PT_2_Y 20
969
+  #define UBL_PROBE_PT_3_X 180
970
+  #define UBL_PROBE_PT_3_Y 20
971
+
949 972
 #elif ENABLED(MESH_BED_LEVELING)
950 973
 
951 974
   //===========================================================================
952 975
   //=================================== Mesh ==================================
953 976
   //===========================================================================
954 977
 
955
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
956 978
   #define MESH_INSET 10          // Mesh inset margin on print area
957 979
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
958 980
   #define MESH_NUM_Y_POINTS 3
@@ -960,28 +982,13 @@
960 982
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
961 983
 
962 984
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
985
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
963 986
 
964 987
   #if ENABLED(MANUAL_BED_LEVELING)
965 988
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
966 989
   #endif
967 990
 
968
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
969
-
970
-  //===========================================================================
971
-  //========================= Unified Bed Leveling ============================
972
-  //===========================================================================
973
-
974
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
975
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
976
-  #define UBL_MESH_NUM_Y_POINTS 10
977
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
978
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
979
-  #define UBL_PROBE_PT_2_X 39
980
-  #define UBL_PROBE_PT_2_Y 20
981
-  #define UBL_PROBE_PT_3_X 180
982
-  #define UBL_PROBE_PT_3_Y 20
983
-
984
-#endif  // BED_LEVELING
991
+#endif // BED_LEVELING
985 992
 
986 993
 /**
987 994
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/delta/generic/Configuration.h View File

@@ -838,41 +838,48 @@
838 838
 // @section bedlevel
839 839
 
840 840
 /**
841
- * Select one form of Auto Bed Leveling below.
841
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
842
+ * and behavior of G29 will change depending on your selection.
842 843
  *
843
- *  If you're also using the Probe for Z Homing, it's
844
- *  highly recommended to enable Z_SAFE_HOMING also!
844
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
845 845
  *
846
- * - 3POINT
846
+ * - AUTO_BED_LEVELING_3POINT
847 847
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
848 848
  *   You specify the XY coordinates of all 3 points.
849 849
  *   The result is a single tilted plane. Best for a flat bed.
850 850
  *
851
- * - LINEAR
851
+ * - AUTO_BED_LEVELING_LINEAR
852 852
  *   Probe several points in a grid.
853 853
  *   You specify the rectangle and the density of sample points.
854 854
  *   The result is a single tilted plane. Best for a flat bed.
855 855
  *
856
- * - BILINEAR
856
+ * - AUTO_BED_LEVELING_BILINEAR
857 857
  *   Probe several points in a grid.
858 858
  *   You specify the rectangle and the density of sample points.
859 859
  *   The result is a mesh, best for large or uneven beds.
860 860
  *
861
- * - UBL Unified Bed Leveling
862
- *   A comprehensive bed leveling system that combines features and benefits from previous
863
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
864
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
865
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
866
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
867
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
868
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
869
- *       test on.
861
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
862
+ *   A comprehensive bed leveling system combining the features and benefits
863
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
864
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
865
+ *   for Cartesian Printers. That said, it was primarily designed to correct
866
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
867
+ *   please post an issue if something doesn't work correctly. Initially,
868
+ *   you will need to set a reduced bed size so you have a rectangular area
869
+ *   to test on.
870
+ *
871
+ * - MESH_BED_LEVELING
872
+ *   Probe a grid manually
873
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
874
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
875
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
876
+ *   With an LCD controller the process is guided step-by-step.
870 877
  */
871 878
 //#define AUTO_BED_LEVELING_3POINT
872 879
 //#define AUTO_BED_LEVELING_LINEAR
873 880
 //#define AUTO_BED_LEVELING_BILINEAR
874
-//#define MESH_BED_LEVELING
875 881
 //#define AUTO_BED_LEVELING_UBL
882
+//#define MESH_BED_LEVELING
876 883
 
877 884
 /**
878 885
  * Enable detailed logging of G28, G29, M48, etc.
@@ -932,13 +939,28 @@
932 939
   #define ABL_PROBE_PT_3_X 170
933 940
   #define ABL_PROBE_PT_3_Y 20
934 941
 
942
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
943
+
944
+  //===========================================================================
945
+  //========================= Unified Bed Leveling ============================
946
+  //===========================================================================
947
+
948
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
949
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
950
+  #define UBL_MESH_NUM_Y_POINTS 10
951
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
952
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
953
+  #define UBL_PROBE_PT_2_X 39
954
+  #define UBL_PROBE_PT_2_Y 20
955
+  #define UBL_PROBE_PT_3_X 180
956
+  #define UBL_PROBE_PT_3_Y 20
957
+
935 958
 #elif ENABLED(MESH_BED_LEVELING)
936 959
 
937 960
   //===========================================================================
938 961
   //=================================== Mesh ==================================
939 962
   //===========================================================================
940 963
 
941
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
942 964
   #define MESH_INSET 10          // Mesh inset margin on print area
943 965
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
944 966
   #define MESH_NUM_Y_POINTS 3
@@ -946,28 +968,13 @@
946 968
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
947 969
 
948 970
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
971
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
949 972
 
950 973
   #if ENABLED(MANUAL_BED_LEVELING)
951 974
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
952 975
   #endif
953 976
 
954
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
955
-
956
-  //===========================================================================
957
-  //========================= Unified Bed Leveling ============================
958
-  //===========================================================================
959
-
960
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
961
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
962
-  #define UBL_MESH_NUM_Y_POINTS 10
963
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
964
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
965
-  #define UBL_PROBE_PT_2_X 39
966
-  #define UBL_PROBE_PT_2_Y 20
967
-  #define UBL_PROBE_PT_3_X 180
968
-  #define UBL_PROBE_PT_3_Y 20
969
-
970
-#endif  // BED_LEVELING
977
+#endif // BED_LEVELING
971 978
 
972 979
 /**
973 980
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

@@ -841,41 +841,48 @@
841 841
 // @section bedlevel
842 842
 
843 843
 /**
844
- * Select one form of Auto Bed Leveling below.
844
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
845
+ * and behavior of G29 will change depending on your selection.
845 846
  *
846
- *  If you're also using the Probe for Z Homing, it's
847
- *  highly recommended to enable Z_SAFE_HOMING also!
847
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
848 848
  *
849
- * - 3POINT
849
+ * - AUTO_BED_LEVELING_3POINT
850 850
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
851 851
  *   You specify the XY coordinates of all 3 points.
852 852
  *   The result is a single tilted plane. Best for a flat bed.
853 853
  *
854
- * - LINEAR
854
+ * - AUTO_BED_LEVELING_LINEAR
855 855
  *   Probe several points in a grid.
856 856
  *   You specify the rectangle and the density of sample points.
857 857
  *   The result is a single tilted plane. Best for a flat bed.
858 858
  *
859
- * - BILINEAR
859
+ * - AUTO_BED_LEVELING_BILINEAR
860 860
  *   Probe several points in a grid.
861 861
  *   You specify the rectangle and the density of sample points.
862 862
  *   The result is a mesh, best for large or uneven beds.
863 863
  *
864
- * - UBL Unified Bed Leveling
865
- *   A comprehensive bed leveling system that combines features and benefits from previous
866
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
867
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
868
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
869
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
870
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
871
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
872
- *       test on.
864
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
865
+ *   A comprehensive bed leveling system combining the features and benefits
866
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
867
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
868
+ *   for Cartesian Printers. That said, it was primarily designed to correct
869
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
870
+ *   please post an issue if something doesn't work correctly. Initially,
871
+ *   you will need to set a reduced bed size so you have a rectangular area
872
+ *   to test on.
873
+ *
874
+ * - MESH_BED_LEVELING
875
+ *   Probe a grid manually
876
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
877
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
878
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
879
+ *   With an LCD controller the process is guided step-by-step.
873 880
  */
874 881
 //#define AUTO_BED_LEVELING_3POINT
875 882
 //#define AUTO_BED_LEVELING_LINEAR
876 883
 //#define AUTO_BED_LEVELING_BILINEAR
877
-//#define MESH_BED_LEVELING
878 884
 //#define AUTO_BED_LEVELING_UBL
885
+//#define MESH_BED_LEVELING
879 886
 
880 887
 /**
881 888
  * Enable detailed logging of G28, G29, M48, etc.
@@ -936,13 +943,28 @@
936 943
   #define ABL_PROBE_PT_3_X 170
937 944
   #define ABL_PROBE_PT_3_Y 20
938 945
 
946
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
947
+
948
+  //===========================================================================
949
+  //========================= Unified Bed Leveling ============================
950
+  //===========================================================================
951
+
952
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
953
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
954
+  #define UBL_MESH_NUM_Y_POINTS 10
955
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
956
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
957
+  #define UBL_PROBE_PT_2_X 39
958
+  #define UBL_PROBE_PT_2_Y 20
959
+  #define UBL_PROBE_PT_3_X 180
960
+  #define UBL_PROBE_PT_3_Y 20
961
+
939 962
 #elif ENABLED(MESH_BED_LEVELING)
940 963
 
941 964
   //===========================================================================
942 965
   //=================================== Mesh ==================================
943 966
   //===========================================================================
944 967
 
945
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
946 968
   #define MESH_INSET 10          // Mesh inset margin on print area
947 969
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
948 970
   #define MESH_NUM_Y_POINTS 3
@@ -950,28 +972,13 @@
950 972
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
951 973
 
952 974
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
975
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
953 976
 
954 977
   #if ENABLED(MANUAL_BED_LEVELING)
955 978
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
956 979
   #endif
957 980
 
958
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
959
-
960
-  //===========================================================================
961
-  //========================= Unified Bed Leveling ============================
962
-  //===========================================================================
963
-
964
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
965
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
966
-  #define UBL_MESH_NUM_Y_POINTS 10
967
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
968
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
969
-  #define UBL_PROBE_PT_2_X 39
970
-  #define UBL_PROBE_PT_2_Y 20
971
-  #define UBL_PROBE_PT_3_X 180
972
-  #define UBL_PROBE_PT_3_Y 20
973
-
974
-#endif  // BED_LEVELING
981
+#endif // BED_LEVELING
975 982
 
976 983
 /**
977 984
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/delta/kossel_pro/Configuration.h View File

@@ -840,41 +840,48 @@
840 840
 // @section bedlevel
841 841
 
842 842
 /**
843
- * Select one form of Auto Bed Leveling below.
843
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
844
+ * and behavior of G29 will change depending on your selection.
844 845
  *
845
- *  If you're also using the Probe for Z Homing, it's
846
- *  highly recommended to enable Z_SAFE_HOMING also!
846
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
847 847
  *
848
- * - 3POINT
848
+ * - AUTO_BED_LEVELING_3POINT
849 849
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
850 850
  *   You specify the XY coordinates of all 3 points.
851 851
  *   The result is a single tilted plane. Best for a flat bed.
852 852
  *
853
- * - LINEAR
853
+ * - AUTO_BED_LEVELING_LINEAR
854 854
  *   Probe several points in a grid.
855 855
  *   You specify the rectangle and the density of sample points.
856 856
  *   The result is a single tilted plane. Best for a flat bed.
857 857
  *
858
- * - BILINEAR
858
+ * - AUTO_BED_LEVELING_BILINEAR
859 859
  *   Probe several points in a grid.
860 860
  *   You specify the rectangle and the density of sample points.
861 861
  *   The result is a mesh, best for large or uneven beds.
862 862
  *
863
- * - UBL Unified Bed Leveling
864
- *   A comprehensive bed leveling system that combines features and benefits from previous
865
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
866
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
867
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
868
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
869
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
870
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
871
- *       test on.
863
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
864
+ *   A comprehensive bed leveling system combining the features and benefits
865
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
866
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
867
+ *   for Cartesian Printers. That said, it was primarily designed to correct
868
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
869
+ *   please post an issue if something doesn't work correctly. Initially,
870
+ *   you will need to set a reduced bed size so you have a rectangular area
871
+ *   to test on.
872
+ *
873
+ * - MESH_BED_LEVELING
874
+ *   Probe a grid manually
875
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
876
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
877
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
878
+ *   With an LCD controller the process is guided step-by-step.
872 879
  */
873 880
 //#define AUTO_BED_LEVELING_3POINT
874 881
 //#define AUTO_BED_LEVELING_LINEAR
875 882
 //#define AUTO_BED_LEVELING_BILINEAR
876
-//#define MESH_BED_LEVELING
877 883
 //#define AUTO_BED_LEVELING_UBL
884
+//#define MESH_BED_LEVELING
878 885
 
879 886
 /**
880 887
  * Enable detailed logging of G28, G29, M48, etc.
@@ -935,13 +942,28 @@
935 942
   #define ABL_PROBE_PT_3_X 170
936 943
   #define ABL_PROBE_PT_3_Y 20
937 944
 
945
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
946
+
947
+  //===========================================================================
948
+  //========================= Unified Bed Leveling ============================
949
+  //===========================================================================
950
+
951
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
952
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
953
+  #define UBL_MESH_NUM_Y_POINTS 10
954
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
955
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
956
+  #define UBL_PROBE_PT_2_X 39
957
+  #define UBL_PROBE_PT_2_Y 20
958
+  #define UBL_PROBE_PT_3_X 180
959
+  #define UBL_PROBE_PT_3_Y 20
960
+
938 961
 #elif ENABLED(MESH_BED_LEVELING)
939 962
 
940 963
   //===========================================================================
941 964
   //=================================== Mesh ==================================
942 965
   //===========================================================================
943 966
 
944
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
945 967
   #define MESH_INSET 10          // Mesh inset margin on print area
946 968
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
947 969
   #define MESH_NUM_Y_POINTS 3
@@ -949,28 +971,13 @@
949 971
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
950 972
 
951 973
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
974
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
952 975
 
953 976
   #if ENABLED(MANUAL_BED_LEVELING)
954 977
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
955 978
   #endif
956 979
 
957
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
958
-
959
-  //===========================================================================
960
-  //========================= Unified Bed Leveling ============================
961
-  //===========================================================================
962
-
963
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
964
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
965
-  #define UBL_MESH_NUM_Y_POINTS 10
966
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
967
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
968
-  #define UBL_PROBE_PT_2_X 39
969
-  #define UBL_PROBE_PT_2_Y 20
970
-  #define UBL_PROBE_PT_3_X 180
971
-  #define UBL_PROBE_PT_3_Y 20
972
-
973
-#endif  // BED_LEVELING
980
+#endif // BED_LEVELING
974 981
 
975 982
 /**
976 983
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/delta/kossel_xl/Configuration.h View File

@@ -851,41 +851,48 @@
851 851
 // @section bedlevel
852 852
 
853 853
 /**
854
- * Select one form of Auto Bed Leveling below.
854
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
855
+ * and behavior of G29 will change depending on your selection.
855 856
  *
856
- *  If you're also using the Probe for Z Homing, it's
857
- *  highly recommended to enable Z_SAFE_HOMING also!
857
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
858 858
  *
859
- * - 3POINT
859
+ * - AUTO_BED_LEVELING_3POINT
860 860
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
861 861
  *   You specify the XY coordinates of all 3 points.
862 862
  *   The result is a single tilted plane. Best for a flat bed.
863 863
  *
864
- * - LINEAR
864
+ * - AUTO_BED_LEVELING_LINEAR
865 865
  *   Probe several points in a grid.
866 866
  *   You specify the rectangle and the density of sample points.
867 867
  *   The result is a single tilted plane. Best for a flat bed.
868 868
  *
869
- * - BILINEAR
869
+ * - AUTO_BED_LEVELING_BILINEAR
870 870
  *   Probe several points in a grid.
871 871
  *   You specify the rectangle and the density of sample points.
872 872
  *   The result is a mesh, best for large or uneven beds.
873 873
  *
874
- * - UBL Unified Bed Leveling
875
- *   A comprehensive bed leveling system that combines features and benefits from previous
876
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
877
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
878
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
879
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
880
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
881
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
882
- *       test on.
874
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
875
+ *   A comprehensive bed leveling system combining the features and benefits
876
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
877
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
878
+ *   for Cartesian Printers. That said, it was primarily designed to correct
879
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
880
+ *   please post an issue if something doesn't work correctly. Initially,
881
+ *   you will need to set a reduced bed size so you have a rectangular area
882
+ *   to test on.
883
+ *
884
+ * - MESH_BED_LEVELING
885
+ *   Probe a grid manually
886
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
887
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
888
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
889
+ *   With an LCD controller the process is guided step-by-step.
883 890
  */
884 891
 //#define AUTO_BED_LEVELING_3POINT
885 892
 //#define AUTO_BED_LEVELING_LINEAR
886 893
 //#define AUTO_BED_LEVELING_BILINEAR
887
-//#define MESH_BED_LEVELING
888 894
 //#define AUTO_BED_LEVELING_UBL
895
+//#define MESH_BED_LEVELING
889 896
 
890 897
 /**
891 898
  * Enable detailed logging of G28, G29, M48, etc.
@@ -945,13 +952,28 @@
945 952
   #define ABL_PROBE_PT_3_X 170
946 953
   #define ABL_PROBE_PT_3_Y 20
947 954
 
955
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
956
+
957
+  //===========================================================================
958
+  //========================= Unified Bed Leveling ============================
959
+  //===========================================================================
960
+
961
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
962
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
963
+  #define UBL_MESH_NUM_Y_POINTS 10
964
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
965
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
966
+  #define UBL_PROBE_PT_2_X 39
967
+  #define UBL_PROBE_PT_2_Y 20
968
+  #define UBL_PROBE_PT_3_X 180
969
+  #define UBL_PROBE_PT_3_Y 20
970
+
948 971
 #elif ENABLED(MESH_BED_LEVELING)
949 972
 
950 973
   //===========================================================================
951 974
   //=================================== Mesh ==================================
952 975
   //===========================================================================
953 976
 
954
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
955 977
   #define MESH_INSET 10          // Mesh inset margin on print area
956 978
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
957 979
   #define MESH_NUM_Y_POINTS 3
@@ -959,28 +981,13 @@
959 981
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
960 982
 
961 983
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
984
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
962 985
 
963 986
   #if ENABLED(MANUAL_BED_LEVELING)
964 987
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
965 988
   #endif
966 989
 
967
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
968
-
969
-  //===========================================================================
970
-  //========================= Unified Bed Leveling ============================
971
-  //===========================================================================
972
-
973
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
974
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
975
-  #define UBL_MESH_NUM_Y_POINTS 10
976
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
977
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
978
-  #define UBL_PROBE_PT_2_X 39
979
-  #define UBL_PROBE_PT_2_Y 20
980
-  #define UBL_PROBE_PT_3_X 180
981
-  #define UBL_PROBE_PT_3_Y 20
982
-
983
-#endif  // BED_LEVELING
990
+#endif // BED_LEVELING
984 991
 
985 992
 /**
986 993
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/makibox/Configuration.h View File

@@ -751,41 +751,48 @@
751 751
 // @section bedlevel
752 752
 
753 753
 /**
754
- * Select one form of Auto Bed Leveling below.
754
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
755
+ * and behavior of G29 will change depending on your selection.
755 756
  *
756
- *  If you're also using the Probe for Z Homing, it's
757
- *  highly recommended to enable Z_SAFE_HOMING also!
757
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
758 758
  *
759
- * - 3POINT
759
+ * - AUTO_BED_LEVELING_3POINT
760 760
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
761 761
  *   You specify the XY coordinates of all 3 points.
762 762
  *   The result is a single tilted plane. Best for a flat bed.
763 763
  *
764
- * - LINEAR
764
+ * - AUTO_BED_LEVELING_LINEAR
765 765
  *   Probe several points in a grid.
766 766
  *   You specify the rectangle and the density of sample points.
767 767
  *   The result is a single tilted plane. Best for a flat bed.
768 768
  *
769
- * - BILINEAR
769
+ * - AUTO_BED_LEVELING_BILINEAR
770 770
  *   Probe several points in a grid.
771 771
  *   You specify the rectangle and the density of sample points.
772 772
  *   The result is a mesh, best for large or uneven beds.
773 773
  *
774
- * - UBL Unified Bed Leveling
775
- *   A comprehensive bed leveling system that combines features and benefits from previous
776
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
777
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
778
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
779
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
780
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
781
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
782
- *       test on.
774
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
775
+ *   A comprehensive bed leveling system combining the features and benefits
776
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
777
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
778
+ *   for Cartesian Printers. That said, it was primarily designed to correct
779
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
780
+ *   please post an issue if something doesn't work correctly. Initially,
781
+ *   you will need to set a reduced bed size so you have a rectangular area
782
+ *   to test on.
783
+ *
784
+ * - MESH_BED_LEVELING
785
+ *   Probe a grid manually
786
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
787
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
788
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
789
+ *   With an LCD controller the process is guided step-by-step.
783 790
  */
784 791
 //#define AUTO_BED_LEVELING_3POINT
785 792
 //#define AUTO_BED_LEVELING_LINEAR
786 793
 //#define AUTO_BED_LEVELING_BILINEAR
787
-//#define MESH_BED_LEVELING
788 794
 //#define AUTO_BED_LEVELING_UBL
795
+//#define MESH_BED_LEVELING
789 796
 
790 797
 /**
791 798
  * Enable detailed logging of G28, G29, M48, etc.
@@ -844,13 +851,28 @@
844 851
   #define ABL_PROBE_PT_3_X 170
845 852
   #define ABL_PROBE_PT_3_Y 20
846 853
 
854
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
855
+
856
+  //===========================================================================
857
+  //========================= Unified Bed Leveling ============================
858
+  //===========================================================================
859
+
860
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
861
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
862
+  #define UBL_MESH_NUM_Y_POINTS 10
863
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
864
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
865
+  #define UBL_PROBE_PT_2_X 39
866
+  #define UBL_PROBE_PT_2_Y 20
867
+  #define UBL_PROBE_PT_3_X 180
868
+  #define UBL_PROBE_PT_3_Y 20
869
+
847 870
 #elif ENABLED(MESH_BED_LEVELING)
848 871
 
849 872
   //===========================================================================
850 873
   //=================================== Mesh ==================================
851 874
   //===========================================================================
852 875
 
853
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
854 876
   #define MESH_INSET 10          // Mesh inset margin on print area
855 877
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
856 878
   #define MESH_NUM_Y_POINTS 3
@@ -858,28 +880,13 @@
858 880
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
859 881
 
860 882
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
883
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
861 884
 
862 885
   #if ENABLED(MANUAL_BED_LEVELING)
863 886
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
864 887
   #endif
865 888
 
866
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
867
-
868
-  //===========================================================================
869
-  //========================= Unified Bed Leveling ============================
870
-  //===========================================================================
871
-
872
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
873
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
874
-  #define UBL_MESH_NUM_Y_POINTS 10
875
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
876
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
877
-  #define UBL_PROBE_PT_2_X 39
878
-  #define UBL_PROBE_PT_2_Y 20
879
-  #define UBL_PROBE_PT_3_X 180
880
-  #define UBL_PROBE_PT_3_Y 20
881
-
882
-#endif  // BED_LEVELING
889
+#endif // BED_LEVELING
883 890
 
884 891
 /**
885 892
  * Commands to execute at the end of G29 probing.

+ 41
- 34
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

@@ -744,41 +744,48 @@
744 744
 // @section bedlevel
745 745
 
746 746
 /**
747
- * Select one form of Auto Bed Leveling below.
747
+ * Choose one of the options below to enable G29 Bed Leveling. The parameters
748
+ * and behavior of G29 will change depending on your selection.
748 749
  *
749
- *  If you're also using the Probe for Z Homing, it's
750
- *  highly recommended to enable Z_SAFE_HOMING also!
750
+ *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
751 751
  *
752
- * - 3POINT
752
+ * - AUTO_BED_LEVELING_3POINT
753 753
  *   Probe 3 arbitrary points on the bed (that aren't collinear)
754 754
  *   You specify the XY coordinates of all 3 points.
755 755
  *   The result is a single tilted plane. Best for a flat bed.
756 756
  *
757
- * - LINEAR
757
+ * - AUTO_BED_LEVELING_LINEAR
758 758
  *   Probe several points in a grid.
759 759
  *   You specify the rectangle and the density of sample points.
760 760
  *   The result is a single tilted plane. Best for a flat bed.
761 761
  *
762
- * - BILINEAR
762
+ * - AUTO_BED_LEVELING_BILINEAR
763 763
  *   Probe several points in a grid.
764 764
  *   You specify the rectangle and the density of sample points.
765 765
  *   The result is a mesh, best for large or uneven beds.
766 766
  *
767
- * - UBL Unified Bed Leveling
768
- *   A comprehensive bed leveling system that combines features and benefits from previous
769
- *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
770
- *   Mesh Generation, Mesh Validation and Mesh Editing system.
771
- *     - Currently, the UBL Bed Leveling System is only checked out for Cartesian Printers.  But with
772
- *       that said, it was primarily designed to handle poor quality Delta Printers.  If you feel
773
- *       adventurous and have a Delta, please post an issue if something doesn't work correctly.
774
- *       Initially, you will need to reduce your declared bed size so you have a rectangular area to
775
- *       test on.
767
+ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)
768
+ *   A comprehensive bed leveling system combining the features and benefits
769
+ *   of other systems. UBL also includes integrated Mesh Generation, Mesh
770
+ *   Validation and Mesh Editing systems. Currently, UBL is only checked out
771
+ *   for Cartesian Printers. That said, it was primarily designed to correct
772
+ *   poor quality Delta Printers. If you feel adventurous and have a Delta,
773
+ *   please post an issue if something doesn't work correctly. Initially,
774
+ *   you will need to set a reduced bed size so you have a rectangular area
775
+ *   to test on.
776
+ *
777
+ * - MESH_BED_LEVELING
778
+ *   Probe a grid manually
779
+ *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
780
+ *   For machines without a probe, Mesh Bed Leveling provides a method to perform
781
+ *   leveling in steps so you can manually adjust the Z height at each grid-point.
782
+ *   With an LCD controller the process is guided step-by-step.
776 783
  */
777 784
 //#define AUTO_BED_LEVELING_3POINT
778 785
 //#define AUTO_BED_LEVELING_LINEAR
779 786
 //#define AUTO_BED_LEVELING_BILINEAR
780
-//#define MESH_BED_LEVELING
781 787
 //#define AUTO_BED_LEVELING_UBL
788
+//#define MESH_BED_LEVELING
782 789
 
783 790
 /**
784 791
  * Enable detailed logging of G28, G29, M48, etc.
@@ -837,13 +844,28 @@
837 844
   #define ABL_PROBE_PT_3_X 170
838 845
   #define ABL_PROBE_PT_3_Y 20
839 846
 
847
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
848
+
849
+  //===========================================================================
850
+  //========================= Unified Bed Leveling ============================
851
+  //===========================================================================
852
+
853
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
854
+  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
855
+  #define UBL_MESH_NUM_Y_POINTS 10
856
+  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
857
+  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
858
+  #define UBL_PROBE_PT_2_X 39
859
+  #define UBL_PROBE_PT_2_Y 20
860
+  #define UBL_PROBE_PT_3_X 180
861
+  #define UBL_PROBE_PT_3_Y 20
862
+
840 863
 #elif ENABLED(MESH_BED_LEVELING)
841 864
 
842 865
   //===========================================================================
843 866
   //=================================== Mesh ==================================
844 867
   //===========================================================================
845 868
 
846
-  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
847 869
   #define MESH_INSET 10          // Mesh inset margin on print area
848 870
   #define MESH_NUM_X_POINTS 3    // Don't use more than 7 points per axis, implementation limited.
849 871
   #define MESH_NUM_Y_POINTS 3
@@ -851,28 +873,13 @@
851 873
   //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
852 874
 
853 875
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
876
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
854 877
 
855 878
   #if ENABLED(MANUAL_BED_LEVELING)
856 879
     #define MBL_Z_STEP 0.025     // Step size while manually probing Z axis.
857 880
   #endif
858 881
 
859
-#elif ENABLED(AUTO_BED_LEVELING_UBL)
860
-
861
-  //===========================================================================
862
-  //========================= Unified Bed Leveling ============================
863
-  //===========================================================================
864
-
865
-  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
866
-  #define UBL_MESH_NUM_X_POINTS 10  // Don't use more than 15 points per axis, implementation limited.
867
-  #define UBL_MESH_NUM_Y_POINTS 10
868
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
869
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
870
-  #define UBL_PROBE_PT_2_X 39
871
-  #define UBL_PROBE_PT_2_Y 20
872
-  #define UBL_PROBE_PT_3_X 180
873
-  #define UBL_PROBE_PT_3_Y 20
874
-
875
-#endif  // BED_LEVELING
882
+#endif // BED_LEVELING
876 883
 
877 884
 /**
878 885
  * Commands to execute at the end of G29 probing.

+ 2
- 2
Marlin/servo.cpp View File

@@ -126,7 +126,7 @@ static inline void handle_interrupts(timer16_Sequence_t timer, volatile uint16_t
126 126
     SIGNAL (TIMER5_COMPA_vect) { handle_interrupts(_timer5, &TCNT5, &OCR5A); }
127 127
   #endif
128 128
 
129
-#else //!WIRING
129
+#else // WIRING
130 130
 
131 131
   // Interrupt handlers for Wiring
132 132
   #if ENABLED(_useTimer1)
@@ -136,7 +136,7 @@ static inline void handle_interrupts(timer16_Sequence_t timer, volatile uint16_t
136 136
     void Timer3Service() { handle_interrupts(_timer3, &TCNT3, &OCR3A); }
137 137
   #endif
138 138
 
139
-#endif //!WIRING
139
+#endif // WIRING
140 140
 
141 141
 
142 142
 static void initISR(timer16_Sequence_t timer) {

+ 38
- 53
Marlin/ultralcd.cpp View File

@@ -124,8 +124,8 @@ uint16_t max_display_update_time = 0;
124 124
   int32_t lastEncoderMovementMillis;
125 125
 
126 126
   #if ENABLED(AUTO_BED_LEVELING_UBL)
127
-  extern int UBL_has_control_of_LCD_Panel;
128
-  extern int G29_encoderDiff;
127
+    extern bool ubl_has_control_of_lcd_panel;
128
+    extern uint8_t ubl_encoderDiff;
129 129
   #endif
130 130
 
131 131
   #if HAS_POWER_SWITCH
@@ -854,88 +854,72 @@ void kill_screen(const char* lcd_msg) {
854 854
 
855 855
   #if ENABLED(AUTO_BED_LEVELING_UBL)
856 856
 
857
-    float Mesh_Edit_Value, Mesh_Edit_Accumulator; // We round Mesh_Edit_Value to 2.5 decimal places.  So we keep a
857
+    float mesh_edit_value, mesh_edit_accumulator; // We round mesh_edit_value to 2.5 decimal places.  So we keep a
858 858
                                                   // seperate value that doesn't lose precision.
859
-       static int loop_cnt=0, last_seen_bits, UBL_encoderPosition=0;
859
+    static int ubl_encoderPosition = 0;
860 860
 
861
-    static void _lcd_mesh_fine_tune( const char* msg) {
862
-      static unsigned long last_click=0;
863
-      int  last_digit, movement;
864
-      long int rounded;
861
+    static void _lcd_mesh_fine_tune(const char* msg) {
862
+      static millis_t next_click = 0;
863
+      int16_t last_digit, movement;
864
+      int32_t rounded;
865 865
 
866 866
       defer_return_to_status = true;
867
+      if (ubl_encoderDiff) {
868
+        // If moving the Encoder wheel very slowly, move by just 1 position
869
+        ubl_encoderPosition = ELAPSED(millis(), next_click)
870
+          ? ubl_encoderDiff > 0 ? 1 : -1
871
+          : ubl_encoderDiff * 2;
867 872
 
868
-      if (G29_encoderDiff) {                     // If moving the Encoder wheel very slowly, we just go
869
-        if ( (millis() - last_click) > 200L) {   // up or down by 1 position
870
-          if ( G29_encoderDiff > 0 ) 
871
-            UBL_encoderPosition = 1;
872
-          else {
873
-            UBL_encoderPosition = -1;
874
-          }
875
-        } else 
876
-            UBL_encoderPosition = G29_encoderDiff * 2;
873
+        ubl_encoderDiff = 0;
874
+        next_click = millis() + 200L;
877 875
 
878
-        G29_encoderDiff = 0;
879
-        last_click = millis();
880
-
881
-        Mesh_Edit_Accumulator += ( (float) (UBL_encoderPosition)) * .005 / 2.0 ;
882
-        Mesh_Edit_Value       = Mesh_Edit_Accumulator;
883
-        encoderPosition       = 0;
884
-        lcdDrawUpdate         = LCDVIEW_REDRAW_NOW;
876
+        mesh_edit_accumulator += float((int32_t)ubl_encoderPosition) * .005 / 2.0;
877
+        mesh_edit_value = mesh_edit_accumulator;
878
+        encoderPosition = 0;
879
+        lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
885 880
 
886
-        rounded    = (long int) (Mesh_Edit_Value * 1000.0);
881
+        rounded = (int32_t)(mesh_edit_value * 1000.0);
887 882
         last_digit = rounded % 5L; //10L;
888
-        rounded    = rounded - last_digit;
883
+        rounded -= last_digit;
889 884
         last_digit = rounded % 5L; //10L;
890
-        Mesh_Edit_Value  = ((float) rounded) / 1000.0;
885
+        mesh_edit_value = float(rounded) / 1000.0;
891 886
       }
892 887
 
893
-      if (lcdDrawUpdate) {
894
-        lcd_implementation_drawedit(msg, ftostr43sign( (float) Mesh_Edit_Value  ));
895
-      }
888
+      if (lcdDrawUpdate)
889
+        lcd_implementation_drawedit(msg, ftostr43sign(mesh_edit_value));
896 890
     }
897 891
 
898 892
 
899 893
     void _lcd_mesh_edit() {
900
-      _lcd_mesh_fine_tune( PSTR("Mesh Editor: "));
894
+      _lcd_mesh_fine_tune(PSTR("Mesh Editor: "));
901 895
       defer_return_to_status = true;
902 896
     }
903 897
 
904 898
     float lcd_mesh_edit() {
905 899
       lcd_goto_screen(_lcd_mesh_edit);
906
-     _lcd_mesh_fine_tune( PSTR("Mesh Editor: "));
907
-      defer_return_to_status = true;
908
-      return Mesh_Edit_Value;
900
+      return mesh_edit_value;
909 901
     }
910 902
 
911
-
912
-    void lcd_mesh_edit_setup(float inital) {
913
-      Mesh_Edit_Value       = inital;
914
-      Mesh_Edit_Accumulator = inital;
903
+    void lcd_mesh_edit_setup(float initial) {
904
+      mesh_edit_value = mesh_edit_accumulator = initial;
915 905
       lcd_goto_screen(_lcd_mesh_edit);
916
-      defer_return_to_status = true;
917
-      return ;
918 906
     }
919 907
 
920 908
     void _lcd_z_offset_edit() {
921
-      _lcd_mesh_fine_tune( PSTR("Z-Offset: "));
909
+      _lcd_mesh_fine_tune(PSTR("Z-Offset: "));
910
+      defer_return_to_status = true;
922 911
     }
923 912
 
924 913
     float lcd_z_offset_edit() {
925 914
       lcd_goto_screen(_lcd_z_offset_edit);
926
-      defer_return_to_status = true;
927
-      return Mesh_Edit_Value;
915
+      return mesh_edit_value;
928 916
     }
929 917
 
930
-    void lcd_z_offset_edit_setup(float inital) {
931
-      Mesh_Edit_Value       = inital;
932
-      Mesh_Edit_Accumulator = inital;
918
+    void lcd_z_offset_edit_setup(float initial) {
919
+      mesh_edit_value = mesh_edit_accumulator = initial;
933 920
       lcd_goto_screen(_lcd_z_offset_edit);
934
-      defer_return_to_status = true;
935
-      return ;
936 921
     }
937 922
 
938
-
939 923
   #endif // AUTO_BED_LEVELING_UBL
940 924
 
941 925
 
@@ -3232,7 +3216,7 @@ void lcd_update() {
3232 3216
     lcd_buttons_update();
3233 3217
 
3234 3218
     #if ENABLED(AUTO_BED_LEVELING_UBL)
3235
-      const bool UBL_CONDITION = !UBL_has_control_of_LCD_Panel;
3219
+      const bool UBL_CONDITION = !ubl_has_control_of_lcd_panel;
3236 3220
     #else
3237 3221
       constexpr bool UBL_CONDITION = true;
3238 3222
     #endif
@@ -3648,8 +3632,8 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
3648 3632
         case encrot3: ENCODER_SPIN(encrot2, encrot0); break;
3649 3633
       }
3650 3634
       #if ENABLED(AUTO_BED_LEVELING_UBL)
3651
-        if (UBL_has_control_of_LCD_Panel) {
3652
-          G29_encoderDiff = encoderDiff;    // Make the encoder's rotation available to G29's Mesh Editor
3635
+        if (ubl_has_control_of_lcd_panel) {
3636
+          ubl_encoderDiff = encoderDiff;    // Make the encoder's rotation available to G29's Mesh Editor
3653 3637
           encoderDiff = 0;                  // We are going to lie to the LCD Panel and claim the encoder
3654 3638
                                             // wheel has not turned.
3655 3639
         }
@@ -3665,6 +3649,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
3665 3649
   #endif
3666 3650
 
3667 3651
   #if ENABLED(AUTO_BED_LEVELING_UBL)
3652
+
3668 3653
     void chirp_at_user() {
3669 3654
       #if ENABLED(LCD_USE_I2C_BUZZER)
3670 3655
         lcd.buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
@@ -3673,7 +3658,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
3673 3658
       #endif
3674 3659
     }
3675 3660
 
3676
-    bool G29_lcd_clicked() { return LCD_CLICKED; }
3661
+    bool ubl_lcd_clicked() { return LCD_CLICKED; }
3677 3662
 
3678 3663
   #endif
3679 3664
 

+ 7
- 0
Marlin/ultralcd.h View File

@@ -164,4 +164,11 @@
164 164
 
165 165
 #endif // ULTRA_LCD
166 166
 
167
+#if ENABLED(AUTO_BED_LEVELING_UBL)
168
+  void lcd_mesh_edit_setup(float initial);
169
+  float lcd_mesh_edit();
170
+  void lcd_z_offset_edit_setup(float);
171
+  float lcd_z_offset_edit();
172
+#endif
173
+
167 174
 #endif // ULTRALCD_H

Loading…
Cancel
Save