Gabe Rosenhouse 11 лет назад
Родитель
Сommit
3b718b816c
2 измененных файлов: 44 добавлений и 16 удалений
  1. 37
    11
      Marlin/Configuration.h
  2. 7
    5
      Marlin/Marlin_main.cpp

+ 37
- 11
Marlin/Configuration.h Просмотреть файл

335
 
335
 
336
 #ifdef ENABLE_AUTO_BED_LEVELING
336
 #ifdef ENABLE_AUTO_BED_LEVELING
337
 
337
 
338
-// Enable auto bed leveling at any 3 points that aren't colinear
339
-#define AUTO_BED_LEVELING_ANY_POINTS
338
+// There are 3 different ways to pick the X and Y locations to probe:
339
+// 1. Basic 3-point probe at left-back, left-front, and right-front corners of a rectangle
340
+// 2. Probe all points of a 2D lattice, defined by a rectangle and ACCURATE_BED_LEVELING_POINTS
341
+// 3. 3-point probe at 3 arbitrary points that don't form a line.
340
 
342
 
341
-#ifdef AUTO_BED_LEVELING_ANY_POINTS
342
-  #define ABL_PROBE_PT_1_X -11
343
-  #define ABL_PROBE_PT_1_Y -15
344
-  #define ABL_PROBE_PT_2_X -11
345
-  #define ABL_PROBE_PT_2_Y 75
346
-  #define ABL_PROBE_PT_3_X 121
347
-  #define ABL_PROBE_PT_3_Y -15
343
+// To enable mode 1:
344
+//   - #define ENABLE_AUTO_BED_LEVELING
345
+//   - Set the XXXX_PROBE_BED_POSITION values below
346
+//   - Don't define AUTO_BED_LEVELING_ANY_POINTS or ACCURATE_BED_LEVELING
347
+
348
+// To enable mode 2:
349
+//  - #define ENABLE_AUTO_BED_LEVELING
350
+//  - Set the XXXX_PROBE_BED_POSITION values below
351
+//  - #define ACCURATE_BED_LEVELING
352
+//  - Set the ACCURATE_BED_LEVELING_POINTS to your desired density
353
+
354
+// To enable mode 3:
355
+//  - #define ENABLE_AUTO_BED_LEVELING
356
+//  - #define AUTO_BED_LEVELING_ANY_POINTS
357
+//  - Set the ABL_PROBE_PT_XXXX values below
358
+//  - Comment out (undefine) ACCURATE_BED_LEVELING since that is incompatible
348
 
359
 
349
 
360
 
361
+
362
+// Mode 3: Enable auto bed leveling at any 3 points that aren't colinear
363
+// #define AUTO_BED_LEVELING_ANY_POINTS
364
+#ifdef AUTO_BED_LEVELING_ANY_POINTS
365
+  #define ABL_PROBE_PT_1_X 15
366
+  #define ABL_PROBE_PT_1_Y 15
367
+  #define ABL_PROBE_PT_2_X 25
368
+  #define ABL_PROBE_PT_2_Y 75
369
+  #define ABL_PROBE_PT_3_X 125
370
+  #define ABL_PROBE_PT_3_Y 25
350
 #else // not AUTO_BED_LEVELING_ANY_POINTS
371
 #else // not AUTO_BED_LEVELING_ANY_POINTS
351
 
372
 
352
-  // these are the positions on the bed to do the probing
373
+  // Modes 1 & 2:
374
+  //   For mode 1, probing happens at left-back, left-front, and right-front corners
375
+  //   For mode 2, probing happens at lattice points within this rectangle (see ACCURATE_BED_LEVELING_POINTS)
353
   #define LEFT_PROBE_BED_POSITION 15
376
   #define LEFT_PROBE_BED_POSITION 15
354
   #define RIGHT_PROBE_BED_POSITION 170
377
   #define RIGHT_PROBE_BED_POSITION 170
355
   #define BACK_PROBE_BED_POSITION 180
378
   #define BACK_PROBE_BED_POSITION 180
398
   // with accurate bed leveling, the bed is sampled in a ACCURATE_BED_LEVELING_POINTSxACCURATE_BED_LEVELING_POINTS grid and least squares solution is calculated
421
   // with accurate bed leveling, the bed is sampled in a ACCURATE_BED_LEVELING_POINTSxACCURATE_BED_LEVELING_POINTS grid and least squares solution is calculated
399
   // Note: this feature occupies 10'206 byte
422
   // Note: this feature occupies 10'206 byte
400
   #define ACCURATE_BED_LEVELING
423
   #define ACCURATE_BED_LEVELING
401
-
424
+  // Mode 2 only
402
   #ifdef ACCURATE_BED_LEVELING
425
   #ifdef ACCURATE_BED_LEVELING
426
+    #ifdef AUTO_BED_LEVELING_ANY_POINTS
427
+      #error AUTO_BED_LEVELING_ANY_POINTS is incompatible with ACCURATE_BED_LEVELING
428
+    #endif
403
      // I wouldn't see a reason to go above 3 (=9 probing points on the bed)
429
      // I wouldn't see a reason to go above 3 (=9 probing points on the bed)
404
     #define ACCURATE_BED_LEVELING_POINTS 2
430
     #define ACCURATE_BED_LEVELING_POINTS 2
405
   #endif
431
   #endif

+ 7
- 5
Marlin/Marlin_main.cpp Просмотреть файл

1433
       break;
1433
       break;
1434
 
1434
 
1435
 #ifdef ENABLE_AUTO_BED_LEVELING
1435
 #ifdef ENABLE_AUTO_BED_LEVELING
1436
-    case 29: // G29 Detailed Z-Probe, probes the bed at 3 points.
1436
+    case 29: // G29 Detailed Z-Probe, probes the bed at 3 or more points.
1437
         {
1437
         {
1438
             #if Z_MIN_PIN == -1
1438
             #if Z_MIN_PIN == -1
1439
             #error "You must have a Z_MIN endstop in order to enable Auto Bed Leveling feature!!! Z_MIN_PIN must point to a valid hardware pin."
1439
             #error "You must have a Z_MIN endstop in order to enable Auto Bed Leveling feature!!! Z_MIN_PIN must point to a valid hardware pin."
1463
 
1463
 
1464
             feedrate = homing_feedrate[Z_AXIS];
1464
             feedrate = homing_feedrate[Z_AXIS];
1465
 #ifdef ACCURATE_BED_LEVELING
1465
 #ifdef ACCURATE_BED_LEVELING
1466
+            // probe at the points of a lattice grid
1466
 
1467
 
1467
             int xGridSpacing = (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION) / (ACCURATE_BED_LEVELING_POINTS-1);
1468
             int xGridSpacing = (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION) / (ACCURATE_BED_LEVELING_POINTS-1);
1468
             int yGridSpacing = (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION) / (ACCURATE_BED_LEVELING_POINTS-1);
1469
             int yGridSpacing = (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION) / (ACCURATE_BED_LEVELING_POINTS-1);
1545
 
1546
 
1546
 
1547
 
1547
   #ifdef AUTO_BED_LEVELING_ANY_POINTS
1548
   #ifdef AUTO_BED_LEVELING_ANY_POINTS
1549
+            // Probe at 3 arbitrary points
1548
             // probe 1
1550
             // probe 1
1549
             float z_at_pt_1 = probe_pt(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, Z_RAISE_BEFORE_PROBING);
1551
             float z_at_pt_1 = probe_pt(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, Z_RAISE_BEFORE_PROBING);
1550
 
1552
 
1558
 
1560
 
1559
             set_bed_level_equation_any_pts(z_at_pt_1, z_at_pt_2, z_at_pt_3);
1561
             set_bed_level_equation_any_pts(z_at_pt_1, z_at_pt_2, z_at_pt_3);
1560
   #else // not AUTO_BED_LEVELING_ANY_POINTS
1562
   #else // not AUTO_BED_LEVELING_ANY_POINTS
1561
-
1562
-            // prob 1
1563
+            // probe at 3 corners of a rectangle
1564
+            // probe 1
1563
             float z_at_xLeft_yBack = probe_pt(LEFT_PROBE_BED_POSITION, BACK_PROBE_BED_POSITION, Z_RAISE_BEFORE_PROBING);
1565
             float z_at_xLeft_yBack = probe_pt(LEFT_PROBE_BED_POSITION, BACK_PROBE_BED_POSITION, Z_RAISE_BEFORE_PROBING);
1564
 
1566
 
1565
-            // prob 2
1567
+            // probe 2
1566
             float z_at_xLeft_yFront = probe_pt(LEFT_PROBE_BED_POSITION, FRONT_PROBE_BED_POSITION, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS);
1568
             float z_at_xLeft_yFront = probe_pt(LEFT_PROBE_BED_POSITION, FRONT_PROBE_BED_POSITION, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS);
1567
 
1569
 
1568
-            // prob 3
1570
+            // probe 3
1569
             float z_at_xRight_yFront = probe_pt(RIGHT_PROBE_BED_POSITION, FRONT_PROBE_BED_POSITION, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS);
1571
             float z_at_xRight_yFront = probe_pt(RIGHT_PROBE_BED_POSITION, FRONT_PROBE_BED_POSITION, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS);
1570
 
1572
 
1571
             clean_up_after_endstop_move();
1573
             clean_up_after_endstop_move();

Загрузка…
Отмена
Сохранить