Browse Source

Patch G29 for 3-point leveling

Scott Lahteine 8 years ago
parent
commit
e9ce42353e
3 changed files with 12 additions and 7 deletions
  1. 1
    0
      Marlin/Conditionals_post.h
  2. 10
    6
      Marlin/Marlin_main.cpp
  3. 1
    1
      Marlin/qr_solve.cpp

+ 1
- 0
Marlin/Conditionals_post.h View File

@@ -676,6 +676,7 @@
676 676
       #define AUTO_BED_LEVELING_NONLINEAR
677 677
     #else
678 678
       #define AUTO_BED_LEVELING_LINEAR
679
+      #define AUTO_BED_LEVELING_LINEAR_GRID
679 680
     #endif
680 681
   #endif
681 682
 

+ 10
- 6
Marlin/Marlin_main.cpp View File

@@ -38,7 +38,7 @@
38 38
   #include "vector_3.h"
39 39
 #endif
40 40
 
41
-#if ENABLED(AUTO_BED_LEVELING_LINEAR)
41
+#if ENABLED(AUTO_BED_LEVELING_LINEAR_GRID)
42 42
   #include "qr_solve.h"
43 43
 #elif ENABLED(MESH_BED_LEVELING)
44 44
   #include "mesh_bed_leveling.h"
@@ -3453,7 +3453,7 @@ inline void gcode_G28() {
3453 3453
         float zoffset = zprobe_zoffset;
3454 3454
         if (code_seen('Z')) zoffset += code_value_axis_units(Z_AXIS);
3455 3455
 
3456
-      #elif ENABLED(AUTO_BED_LEVELING_LINEAR)
3456
+      #elif ENABLED(AUTO_BED_LEVELING_LINEAR_GRID)
3457 3457
 
3458 3458
         /**
3459 3459
          * solve the plane equation ax + by + d = z
@@ -3471,7 +3471,7 @@ inline void gcode_G28() {
3471 3471
                mean = 0.0;
3472 3472
         int indexIntoAB[abl_grid_points_x][abl_grid_points_y];
3473 3473
 
3474
-      #endif // AUTO_BED_LEVELING_LINEAR
3474
+      #endif // AUTO_BED_LEVELING_LINEAR_GRID
3475 3475
 
3476 3476
       int probePointCounter = 0;
3477 3477
       bool zig = abl_grid_points_y & 1; //always end at [RIGHT_PROBE_BED_POSITION, BACK_PROBE_BED_POSITION]
@@ -3506,7 +3506,7 @@ inline void gcode_G28() {
3506 3506
 
3507 3507
           measured_z = probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level);
3508 3508
 
3509
-          #if ENABLED(AUTO_BED_LEVELING_LINEAR)
3509
+          #if ENABLED(AUTO_BED_LEVELING_LINEAR_GRID)
3510 3510
 
3511 3511
             mean += measured_z;
3512 3512
             eqnBVector[probePointCounter] = measured_z;
@@ -3576,7 +3576,7 @@ inline void gcode_G28() {
3576 3576
       if (!dryrun) extrapolate_unprobed_bed_level();
3577 3577
       print_bed_level();
3578 3578
 
3579
-    #elif ENABLED(AUTO_BED_LEVELING_LINEAR)
3579
+    #elif ENABLED(AUTO_BED_LEVELING_LINEAR_GRID)
3580 3580
 
3581 3581
       // For LINEAR leveling calculate matrix, print reports, correct the position
3582 3582
 
@@ -3673,6 +3673,10 @@ inline void gcode_G28() {
3673 3673
         }
3674 3674
       } //do_topography_map
3675 3675
 
3676
+    #endif // AUTO_BED_LEVELING_LINEAR_GRID
3677
+
3678
+    #if ENABLED(AUTO_BED_LEVELING_LINEAR)
3679
+
3676 3680
       // For LINEAR and 3POINT leveling correct the current position
3677 3681
 
3678 3682
       if (verbose_level > 0)
@@ -6759,7 +6763,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
6759 6763
             float xydiff[2] = { offset_vec.x, offset_vec.y };
6760 6764
             current_position[Z_AXIS] += offset_vec.z;
6761 6765
 
6762
-          #else // !AUTO_BED_LEVELING_FEATURE
6766
+          #else // !AUTO_BED_LEVELING_LINEAR
6763 6767
 
6764 6768
             float xydiff[2] = {
6765 6769
               hotend_offset[X_AXIS][tmp_extruder] - hotend_offset[X_AXIS][active_extruder],

+ 1
- 1
Marlin/qr_solve.cpp View File

@@ -22,7 +22,7 @@
22 22
 
23 23
 #include "qr_solve.h"
24 24
 
25
-#if ENABLED(AUTO_BED_LEVELING_LINEAR)
25
+#if ENABLED(AUTO_BED_LEVELING_LINEAR_GRID)
26 26
 
27 27
 #include <stdlib.h>
28 28
 #include <math.h>

Loading…
Cancel
Save