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
       #define AUTO_BED_LEVELING_NONLINEAR
676
       #define AUTO_BED_LEVELING_NONLINEAR
677
     #else
677
     #else
678
       #define AUTO_BED_LEVELING_LINEAR
678
       #define AUTO_BED_LEVELING_LINEAR
679
+      #define AUTO_BED_LEVELING_LINEAR_GRID
679
     #endif
680
     #endif
680
   #endif
681
   #endif
681
 
682
 

+ 10
- 6
Marlin/Marlin_main.cpp View File

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

+ 1
- 1
Marlin/qr_solve.cpp View File

22
 
22
 
23
 #include "qr_solve.h"
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
 #include <stdlib.h>
27
 #include <stdlib.h>
28
 #include <math.h>
28
 #include <math.h>

Loading…
Cancel
Save