Browse Source

Revert "Change Auto_Bed_Leveling to Auto_Bed_Compensation"

alexborro 9 years ago
parent
commit
d74aabf259

+ 14
- 14
Marlin/Configuration.h View File

@@ -340,12 +340,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
340 340
 #define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
341 341
 #define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
342 342
 #define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
343
-//============================= Bed Auto Compensation ===========================
343
+//============================= Bed Auto Leveling ===========================
344 344
 
345
-//#define ENABLE_AUTO_BED_COMPENSATION // Delete the comment to enable (remove // at the start of the line)
346
-#define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Compensation is Enabled.
345
+//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
346
+#define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
347 347
 
348
-#ifdef ENABLE_AUTO_BED_COMPENSATION
348
+#ifdef ENABLE_AUTO_BED_LEVELING
349 349
 
350 350
 // There are 2 different ways to pick the X and Y locations to probe:
351 351
 
@@ -353,18 +353,18 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
353 353
 //    Probe every point in a rectangular grid
354 354
 //    You must specify the rectangle, and the density of sample points
355 355
 //    This mode is preferred because there are more measurements.
356
-//    It used to be called ACCURATE_BED_COMPENSATION but "grid" is more descriptive
356
+//    It used to be called ACCURATE_BED_LEVELING but "grid" is more descriptive
357 357
 
358 358
 //  - "3-point" mode
359 359
 //    Probe 3 arbitrary points on the bed (that aren't colinear)
360 360
 //    You must specify the X & Y coordinates of all 3 points
361 361
 
362
-  #define AUTO_BED_COMPENSATION_GRID
363
-  // with AUTO_BED_COMPENSATION_GRID, the bed is sampled in a
364
-  // AUTO_BED_COMPENSATION_GRID_POINTSxAUTO_BED_COMPENSATION_GRID_POINTS grid
362
+  #define AUTO_BED_LEVELING_GRID
363
+  // with AUTO_BED_LEVELING_GRID, the bed is sampled in a
364
+  // AUTO_BED_LEVELING_GRID_POINTSxAUTO_BED_LEVELING_GRID_POINTS grid
365 365
   // and least squares solution is calculated
366 366
   // Note: this feature occupies 10'206 byte
367
-  #ifdef AUTO_BED_COMPENSATION_GRID
367
+  #ifdef AUTO_BED_LEVELING_GRID
368 368
 
369 369
     // set the rectangle in which to probe
370 370
     #define LEFT_PROBE_BED_POSITION 15
@@ -374,10 +374,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
374 374
 
375 375
      // set the number of grid points per dimension
376 376
      // I wouldn't see a reason to go above 3 (=9 probing points on the bed)
377
-    #define AUTO_BED_COMPENSATION_GRID_POINTS 2
377
+    #define AUTO_BED_LEVELING_GRID_POINTS 2
378 378
 
379 379
 
380
-  #else  // not AUTO_BED_COMPENSATION_GRID
380
+  #else  // not AUTO_BED_LEVELING_GRID
381 381
     // with no grid, just probe 3 arbitrary points.  A simple cross-product
382 382
     // is used to esimate the plane of the print bed
383 383
 
@@ -388,7 +388,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
388 388
       #define ABL_PROBE_PT_3_X 170
389 389
       #define ABL_PROBE_PT_3_Y 20
390 390
 
391
-  #endif // AUTO_BED_COMPENSATION_GRID
391
+  #endif // AUTO_BED_LEVELING_GRID
392 392
 
393 393
 
394 394
   // these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
@@ -414,7 +414,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
414 414
 //  #define PROBE_SERVO_DEACTIVATION_DELAY 300
415 415
 
416 416
 
417
-//If you have enabled the Bed Auto Compensation and are using the same Z Probe for Z Homing,
417
+//If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing,
418 418
 //it is highly recommended you let this Z_SAFE_HOMING enabled!!!
419 419
 
420 420
   #define Z_SAFE_HOMING   // This feature is meant to avoid Z homing with probe outside the bed area.
@@ -431,7 +431,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
431 431
 
432 432
   #endif
433 433
 
434
-#endif // ENABLE_AUTO_BED_COMPENSATION
434
+#endif // ENABLE_AUTO_BED_LEVELING
435 435
 
436 436
 
437 437
 // The position of the homing switches

+ 1
- 1
Marlin/ConfigurationStore.cpp View File

@@ -319,7 +319,7 @@ void Config_ResetDefault()
319 319
     absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP;
320 320
     absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
321 321
 #endif
322
-#ifdef ENABLE_AUTO_BED_COMPENSATION
322
+#ifdef ENABLE_AUTO_BED_LEVELING
323 323
     zprobe_zoffset = -Z_PROBE_OFFSET_FROM_EXTRUDER;
324 324
 #endif
325 325
 #ifdef DOGLCD

+ 57
- 57
Marlin/Marlin_main.cpp View File

@@ -29,12 +29,12 @@
29 29
 
30 30
 #include "Marlin.h"
31 31
 
32
-#ifdef ENABLE_AUTO_BED_COMPENSATION
32
+#ifdef ENABLE_AUTO_BED_LEVELING
33 33
 #include "vector_3.h"
34
-  #ifdef AUTO_BED_COMPENSATION_GRID
34
+  #ifdef AUTO_BED_LEVELING_GRID
35 35
     #include "qr_solve.h"
36 36
   #endif
37
-#endif // ENABLE_AUTO_BED_COMPENSATION
37
+#endif // ENABLE_AUTO_BED_LEVELING
38 38
 
39 39
 #include "ultralcd.h"
40 40
 #include "planner.h"
@@ -525,7 +525,7 @@ void servo_init()
525 525
   }
526 526
   #endif
527 527
 
528
-  #if defined (ENABLE_AUTO_BED_COMPENSATION) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
528
+  #if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
529 529
   delay(PROBE_SERVO_DEACTIVATION_DELAY);
530 530
   servos[servo_endstops[Z_AXIS]].detach();
531 531
   #endif
@@ -967,16 +967,16 @@ static void axis_is_at_home(int axis) {
967 967
 #endif
968 968
 }
969 969
 
970
-#ifdef ENABLE_AUTO_BED_COMPENSATION
971
-#ifdef AUTO_BED_COMPENSATION_GRID
972
-static void set_bed_compensation_equation_lsq(double *plane_equation_coefficients)
970
+#ifdef ENABLE_AUTO_BED_LEVELING
971
+#ifdef AUTO_BED_LEVELING_GRID
972
+static void set_bed_level_equation_lsq(double *plane_equation_coefficients)
973 973
 {
974 974
     vector_3 planeNormal = vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1);
975 975
     planeNormal.debug("planeNormal");
976
-    plan_bed_compensation_matrix = matrix_3x3::create_look_at(planeNormal);
977
-    //bedCompensation.debug("bedCompensation");
976
+    plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal);
977
+    //bedLevel.debug("bedLevel");
978 978
 
979
-    //plan_bed_compensation_matrix.debug("bed compensation before");
979
+    //plan_bed_level_matrix.debug("bed level before");
980 980
     //vector_3 uncorrected_position = plan_get_position_mm();
981 981
     //uncorrected_position.debug("position before");
982 982
 
@@ -992,11 +992,11 @@ static void set_bed_compensation_equation_lsq(double *plane_equation_coefficient
992 992
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
993 993
 }
994 994
 
995
-#else // not AUTO_BED_COMPENSATION_GRID
995
+#else // not AUTO_BED_LEVELING_GRID
996 996
 
997
-static void set_bed_compensation_equation_3pts(float z_at_pt_1, float z_at_pt_2, float z_at_pt_3) {
997
+static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float z_at_pt_3) {
998 998
 
999
-    plan_bed_compensation_matrix.set_to_identity();
999
+    plan_bed_level_matrix.set_to_identity();
1000 1000
 
1001 1001
     vector_3 pt1 = vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, z_at_pt_1);
1002 1002
     vector_3 pt2 = vector_3(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, z_at_pt_2);
@@ -1007,7 +1007,7 @@ static void set_bed_compensation_equation_3pts(float z_at_pt_1, float z_at_pt_2,
1007 1007
     vector_3 planeNormal = vector_3::cross(from_2_to_1, from_2_to_3).get_normal();
1008 1008
     planeNormal = vector_3(planeNormal.x, planeNormal.y, abs(planeNormal.z));
1009 1009
 
1010
-    plan_bed_compensation_matrix = matrix_3x3::create_look_at(planeNormal);
1010
+    plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal);
1011 1011
 
1012 1012
     vector_3 corrected_position = plan_get_position();
1013 1013
     current_position[X_AXIS] = corrected_position.x;
@@ -1021,10 +1021,10 @@ static void set_bed_compensation_equation_3pts(float z_at_pt_1, float z_at_pt_2,
1021 1021
 
1022 1022
 }
1023 1023
 
1024
-#endif // AUTO_BED_COMPENSATION_GRID
1024
+#endif // AUTO_BED_LEVELING_GRID
1025 1025
 
1026 1026
 static void run_z_probe() {
1027
-    plan_bed_compensation_matrix.set_to_identity();
1027
+    plan_bed_level_matrix.set_to_identity();
1028 1028
     feedrate = homing_feedrate[Z_AXIS];
1029 1029
 
1030 1030
     // move down until you find the bed
@@ -1098,11 +1098,11 @@ static void engage_z_probe() {
1098 1098
     // Engage Z Servo endstop if enabled
1099 1099
     #ifdef SERVO_ENDSTOPS
1100 1100
     if (servo_endstops[Z_AXIS] > -1) {
1101
-#if defined (ENABLE_AUTO_BED_COMPENSATION) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
1101
+#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
1102 1102
         servos[servo_endstops[Z_AXIS]].attach(0);
1103 1103
 #endif
1104 1104
         servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2]);
1105
-#if defined (ENABLE_AUTO_BED_COMPENSATION) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
1105
+#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
1106 1106
         delay(PROBE_SERVO_DEACTIVATION_DELAY);
1107 1107
         servos[servo_endstops[Z_AXIS]].detach();
1108 1108
 #endif
@@ -1114,11 +1114,11 @@ static void retract_z_probe() {
1114 1114
     // Retract Z Servo endstop if enabled
1115 1115
     #ifdef SERVO_ENDSTOPS
1116 1116
     if (servo_endstops[Z_AXIS] > -1) {
1117
-#if defined (ENABLE_AUTO_BED_COMPENSATION) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
1117
+#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
1118 1118
         servos[servo_endstops[Z_AXIS]].attach(0);
1119 1119
 #endif
1120 1120
         servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]);
1121
-#if defined (ENABLE_AUTO_BED_COMPENSATION) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
1121
+#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
1122 1122
         delay(PROBE_SERVO_DEACTIVATION_DELAY);
1123 1123
         servos[servo_endstops[Z_AXIS]].detach();
1124 1124
 #endif
@@ -1152,7 +1152,7 @@ static float probe_pt(float x, float y, float z_before) {
1152 1152
   return measured_z;
1153 1153
 }
1154 1154
 
1155
-#endif // #ifdef ENABLE_AUTO_BED_COMPENSATION
1155
+#endif // #ifdef ENABLE_AUTO_BED_LEVELING
1156 1156
 
1157 1157
 static void homeaxis(int axis) {
1158 1158
 #define HOMEAXIS_DO(LETTER) \
@@ -1175,7 +1175,7 @@ static void homeaxis(int axis) {
1175 1175
 #ifndef Z_PROBE_SLED
1176 1176
     // Engage Servo endstop if enabled
1177 1177
     #ifdef SERVO_ENDSTOPS
1178
-      #if defined (ENABLE_AUTO_BED_COMPENSATION) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
1178
+      #if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
1179 1179
         if (axis==Z_AXIS) {
1180 1180
           engage_z_probe();
1181 1181
         }
@@ -1226,7 +1226,7 @@ static void homeaxis(int axis) {
1226 1226
         servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2 + 1]);
1227 1227
       }
1228 1228
     #endif
1229
-#if defined (ENABLE_AUTO_BED_COMPENSATION) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
1229
+#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
1230 1230
   #ifndef Z_PROBE_SLED
1231 1231
     if (axis==Z_AXIS) retract_z_probe();
1232 1232
   #endif
@@ -1335,7 +1335,7 @@ void process_commands()
1335 1335
 {
1336 1336
   unsigned long codenum; //throw away variable
1337 1337
   char *starpos = NULL;
1338
-#ifdef ENABLE_AUTO_BED_COMPENSATION
1338
+#ifdef ENABLE_AUTO_BED_LEVELING
1339 1339
   float x_tmp, y_tmp, z_tmp, real_z;
1340 1340
 #endif
1341 1341
   if(code_seen('G'))
@@ -1409,9 +1409,9 @@ void process_commands()
1409 1409
       break;
1410 1410
       #endif //FWRETRACT
1411 1411
     case 28: //G28 Home all Axis one at a time
1412
-#ifdef ENABLE_AUTO_BED_COMPENSATION
1413
-      plan_bed_compensation_matrix.set_to_identity();  //Reset the plane ("erase" all compensation data)
1414
-#endif //ENABLE_AUTO_BED_COMPENSATION
1412
+#ifdef ENABLE_AUTO_BED_LEVELING
1413
+      plan_bed_level_matrix.set_to_identity();  //Reset the plane ("erase" all leveling data)
1414
+#endif //ENABLE_AUTO_BED_LEVELING
1415 1415
 
1416 1416
       saved_feedrate = feedrate;
1417 1417
       saved_feedmultiply = feedmultiply;
@@ -1615,7 +1615,7 @@ void process_commands()
1615 1615
           current_position[Z_AXIS]=code_value()+add_homing[Z_AXIS];
1616 1616
         }
1617 1617
       }
1618
-      #ifdef ENABLE_AUTO_BED_COMPENSATION
1618
+      #ifdef ENABLE_AUTO_BED_LEVELING
1619 1619
         if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
1620 1620
           current_position[Z_AXIS] += zprobe_zoffset;  //Add Z_Probe offset (the distance is negative)
1621 1621
         }
@@ -1638,11 +1638,11 @@ void process_commands()
1638 1638
       endstops_hit_on_purpose();
1639 1639
       break;
1640 1640
 
1641
-#ifdef ENABLE_AUTO_BED_COMPENSATION
1641
+#ifdef ENABLE_AUTO_BED_LEVELING
1642 1642
     case 29: // G29 Detailed Z-Probe, probes the bed at 3 or more points.
1643 1643
         {
1644 1644
             #if Z_MIN_PIN == -1
1645
-            #error "You must have a Z_MIN endstop in order to enable Auto Bed Compensation feature!!! Z_MIN_PIN must point to a valid hardware pin."
1645
+            #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."
1646 1646
             #endif
1647 1647
 
1648 1648
             // Prevent user from running a G29 without first homing in X and Y
@@ -1658,10 +1658,10 @@ void process_commands()
1658 1658
             dock_sled(false);
1659 1659
 #endif // Z_PROBE_SLED
1660 1660
             st_synchronize();
1661
-            // make sure the bed_compensation_rotation_matrix is identity or the planner will get it incorectly
1661
+            // make sure the bed_level_rotation_matrix is identity or the planner will get it incorectly
1662 1662
             //vector_3 corrected_position = plan_get_position_mm();
1663 1663
             //corrected_position.debug("position before G29");
1664
-            plan_bed_compensation_matrix.set_to_identity();
1664
+            plan_bed_level_matrix.set_to_identity();
1665 1665
             vector_3 uncorrected_position = plan_get_position();
1666 1666
             //uncorrected_position.debug("position durring G29");
1667 1667
             current_position[X_AXIS] = uncorrected_position.x;
@@ -1671,11 +1671,11 @@ void process_commands()
1671 1671
             setup_for_endstop_move();
1672 1672
 
1673 1673
             feedrate = homing_feedrate[Z_AXIS];
1674
-#ifdef AUTO_BED_COMPENSATION_GRID
1674
+#ifdef AUTO_BED_LEVELING_GRID
1675 1675
             // probe at the points of a lattice grid
1676 1676
 
1677
-            int xGridSpacing = (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION) / (AUTO_BED_COMPENSATION_GRID_POINTS-1);
1678
-            int yGridSpacing = (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION) / (AUTO_BED_COMPENSATION_GRID_POINTS-1);
1677
+            int xGridSpacing = (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION) / (AUTO_BED_LEVELING_GRID_POINTS-1);
1678
+            int yGridSpacing = (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION) / (AUTO_BED_LEVELING_GRID_POINTS-1);
1679 1679
 
1680 1680
 
1681 1681
             // solve the plane equation ax + by + d = z
@@ -1685,9 +1685,9 @@ void process_commands()
1685 1685
             // so Vx = -a Vy = -b Vz = 1 (we want the vector facing towards positive Z
1686 1686
 
1687 1687
             // "A" matrix of the linear system of equations
1688
-            double eqnAMatrix[AUTO_BED_COMPENSATION_GRID_POINTS*AUTO_BED_COMPENSATION_GRID_POINTS*3];
1688
+            double eqnAMatrix[AUTO_BED_LEVELING_GRID_POINTS*AUTO_BED_LEVELING_GRID_POINTS*3];
1689 1689
             // "B" vector of Z points
1690
-            double eqnBVector[AUTO_BED_COMPENSATION_GRID_POINTS*AUTO_BED_COMPENSATION_GRID_POINTS];
1690
+            double eqnBVector[AUTO_BED_LEVELING_GRID_POINTS*AUTO_BED_LEVELING_GRID_POINTS];
1691 1691
 
1692 1692
 
1693 1693
             int probePointCounter = 0;
@@ -1710,7 +1710,7 @@ void process_commands()
1710 1710
                 zig = true;
1711 1711
               }
1712 1712
 
1713
-              for (int xCount=0; xCount < AUTO_BED_COMPENSATION_GRID_POINTS; xCount++)
1713
+              for (int xCount=0; xCount < AUTO_BED_LEVELING_GRID_POINTS; xCount++)
1714 1714
               {
1715 1715
                 float z_before;
1716 1716
                 if (probePointCounter == 0)
@@ -1727,9 +1727,9 @@ void process_commands()
1727 1727
 
1728 1728
                 eqnBVector[probePointCounter] = measured_z;
1729 1729
 
1730
-                eqnAMatrix[probePointCounter + 0*AUTO_BED_COMPENSATION_GRID_POINTS*AUTO_BED_COMPENSATION_GRID_POINTS] = xProbe;
1731
-                eqnAMatrix[probePointCounter + 1*AUTO_BED_COMPENSATION_GRID_POINTS*AUTO_BED_COMPENSATION_GRID_POINTS] = yProbe;
1732
-                eqnAMatrix[probePointCounter + 2*AUTO_BED_COMPENSATION_GRID_POINTS*AUTO_BED_COMPENSATION_GRID_POINTS] = 1;
1730
+                eqnAMatrix[probePointCounter + 0*AUTO_BED_LEVELING_GRID_POINTS*AUTO_BED_LEVELING_GRID_POINTS] = xProbe;
1731
+                eqnAMatrix[probePointCounter + 1*AUTO_BED_LEVELING_GRID_POINTS*AUTO_BED_LEVELING_GRID_POINTS] = yProbe;
1732
+                eqnAMatrix[probePointCounter + 2*AUTO_BED_LEVELING_GRID_POINTS*AUTO_BED_LEVELING_GRID_POINTS] = 1;
1733 1733
                 probePointCounter++;
1734 1734
                 xProbe += xInc;
1735 1735
               }
@@ -1737,7 +1737,7 @@ void process_commands()
1737 1737
             clean_up_after_endstop_move();
1738 1738
 
1739 1739
             // solve lsq problem
1740
-            double *plane_equation_coefficients = qr_solve(AUTO_BED_COMPENSATION_GRID_POINTS*AUTO_BED_COMPENSATION_GRID_POINTS, 3, eqnAMatrix, eqnBVector);
1740
+            double *plane_equation_coefficients = qr_solve(AUTO_BED_LEVELING_GRID_POINTS*AUTO_BED_LEVELING_GRID_POINTS, 3, eqnAMatrix, eqnBVector);
1741 1741
 
1742 1742
             SERIAL_PROTOCOLPGM("Eqn coefficients: a: ");
1743 1743
             SERIAL_PROTOCOL(plane_equation_coefficients[0]);
@@ -1747,11 +1747,11 @@ void process_commands()
1747 1747
             SERIAL_PROTOCOLLN(plane_equation_coefficients[2]);
1748 1748
 
1749 1749
 
1750
-            set_bed_compensation_equation_lsq(plane_equation_coefficients);
1750
+            set_bed_level_equation_lsq(plane_equation_coefficients);
1751 1751
 
1752 1752
             free(plane_equation_coefficients);
1753 1753
 
1754
-#else // AUTO_BED_COMPENSATION_GRID not defined
1754
+#else // AUTO_BED_LEVELING_GRID not defined
1755 1755
 
1756 1756
             // Probe at 3 arbitrary points
1757 1757
             // probe 1
@@ -1765,21 +1765,21 @@ void process_commands()
1765 1765
 
1766 1766
             clean_up_after_endstop_move();
1767 1767
 
1768
-            set_bed_compensation_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3);
1768
+            set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3);
1769 1769
 
1770 1770
 
1771
-#endif // AUTO_BED_COMPENSATION_GRID
1771
+#endif // AUTO_BED_LEVELING_GRID
1772 1772
             st_synchronize();
1773 1773
 
1774 1774
             // The following code correct the Z height difference from z-probe position and hotend tip position.
1775 1775
             // The Z height on homing is measured by Z-Probe, but the probe is quite far from the hotend.
1776 1776
             // When the bed is uneven, this height must be corrected.
1777
-            real_z = float(st_get_position(Z_AXIS))/axis_steps_per_unit[Z_AXIS];  //get the real Z (since the auto bed compensation is already correcting the plane)
1777
+            real_z = float(st_get_position(Z_AXIS))/axis_steps_per_unit[Z_AXIS];  //get the real Z (since the auto bed leveling is already correcting the plane)
1778 1778
             x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER;
1779 1779
             y_tmp = current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER;
1780 1780
             z_tmp = current_position[Z_AXIS];
1781 1781
 
1782
-            apply_rotation_xyz(plan_bed_compensation_matrix, x_tmp, y_tmp, z_tmp);         //Apply the correction sending the probe offset
1782
+            apply_rotation_xyz(plan_bed_level_matrix, x_tmp, y_tmp, z_tmp);         //Apply the correction sending the probe offset
1783 1783
             current_position[Z_AXIS] = z_tmp - real_z + current_position[Z_AXIS];   //The difference is added to current position and sent to planner.
1784 1784
             plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1785 1785
 #ifdef Z_PROBE_SLED
@@ -1792,7 +1792,7 @@ void process_commands()
1792 1792
         {
1793 1793
             engage_z_probe(); // Engage Z Servo endstop if available
1794 1794
             st_synchronize();
1795
-            // TODO: make sure the bed_compensation_rotation_matrix is identity or the planner will get set incorectly
1795
+            // TODO: make sure the bed_level_rotation_matrix is identity or the planner will get set incorectly
1796 1796
             setup_for_endstop_move();
1797 1797
 
1798 1798
             feedrate = homing_feedrate[Z_AXIS];
@@ -1819,7 +1819,7 @@ void process_commands()
1819 1819
         dock_sled(false);
1820 1820
         break;
1821 1821
 #endif // Z_PROBE_SLED
1822
-#endif // ENABLE_AUTO_BED_COMPENSATION
1822
+#endif // ENABLE_AUTO_BED_LEVELING
1823 1823
     case 90: // G90
1824 1824
       relative_mode = false;
1825 1825
       break;
@@ -2078,7 +2078,7 @@ void process_commands()
2078 2078
 //	
2079 2079
 // This function assumes the bed has been homed.  Specificaly, that a G28 command
2080 2080
 // as been issued prior to invoking the M48 Z-Probe repeatability measurement function.
2081
-// Any information generated by a prior G29 Bed compensation command will be lost and need to be
2081
+// Any information generated by a prior G29 Bed leveling command will be lost and need to be
2082 2082
 // regenerated.
2083 2083
 //
2084 2084
 // The number of samples will default to 10 if not specified.  You can use upper or lower case
@@ -2086,7 +2086,7 @@ void process_commands()
2086 2086
 // N for its communication protocol and will get horribly confused if you send it a capital N.
2087 2087
 //
2088 2088
 
2089
-#ifdef ENABLE_AUTO_BED_COMPENSATION
2089
+#ifdef ENABLE_AUTO_BED_LEVELING
2090 2090
 #ifdef Z_PROBE_REPEATABILITY_TEST 
2091 2091
 
2092 2092
     case 48: // M48 Z-Probe repeatability
@@ -2164,7 +2164,7 @@ void process_commands()
2164 2164
 //
2165 2165
 
2166 2166
         st_synchronize();
2167
-        plan_bed_compensation_matrix.set_to_identity();
2167
+        plan_bed_level_matrix.set_to_identity();
2168 2168
 	plan_buffer_line( X_current, Y_current, Z_start_location,
2169 2169
 			ext_position,
2170 2170
     			homing_feedrate[Z_AXIS]/60,
@@ -2343,7 +2343,7 @@ Sigma_Exit:
2343 2343
         break;
2344 2344
 	}
2345 2345
 #endif		// Z_PROBE_REPEATABILITY_TEST 
2346
-#endif		// ENABLE_AUTO_BED_COMPENSATION
2346
+#endif		// ENABLE_AUTO_BED_LEVELING
2347 2347
 
2348 2348
     case 104: // M104
2349 2349
       if(setTargetedHotend(104)){
@@ -3104,11 +3104,11 @@ Sigma_Exit:
3104 3104
         if (code_seen('S')) {
3105 3105
           servo_position = code_value();
3106 3106
           if ((servo_index >= 0) && (servo_index < NUM_SERVOS)) {
3107
-#if defined (ENABLE_AUTO_BED_COMPENSATION) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
3107
+#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
3108 3108
 		      servos[servo_index].attach(0);
3109 3109
 #endif
3110 3110
             servos[servo_index].write(servo_position);
3111
-#if defined (ENABLE_AUTO_BED_COMPENSATION) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
3111
+#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
3112 3112
               delay(PROBE_SERVO_DEACTIVATION_DELAY);
3113 3113
               servos[servo_index].detach();
3114 3114
 #endif
@@ -3373,7 +3373,7 @@ Sigma_Exit:
3373 3373
       st_synchronize();
3374 3374
     }
3375 3375
     break;
3376
-#if defined(ENABLE_AUTO_BED_COMPENSATION) && defined(SERVO_ENDSTOPS) && not defined(Z_PROBE_SLED)
3376
+#if defined(ENABLE_AUTO_BED_LEVELING) && defined(SERVO_ENDSTOPS) && not defined(Z_PROBE_SLED)
3377 3377
     case 401:
3378 3378
     {
3379 3379
         engage_z_probe();    // Engage Z Servo endstop if available

+ 1
- 1
Marlin/Servo.cpp View File

@@ -262,7 +262,7 @@ uint8_t Servo::attach(int pin)
262 262
 uint8_t Servo::attach(int pin, int min, int max)
263 263
 {
264 264
   if(this->servoIndex < MAX_SERVOS ) {
265
-#if defined (ENABLE_AUTO_BED_COMPENSATION) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
265
+#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
266 266
     if (pin > 0) this->pin = pin; else pin = this->pin;
267 267
 #endif
268 268
     pinMode( pin, OUTPUT) ;                                   // set servo pin to output

+ 1
- 1
Marlin/Servo.h View File

@@ -123,7 +123,7 @@ public:
123 123
   int read();                        // returns current pulse width as an angle between 0 and 180 degrees
124 124
   int readMicroseconds();            // returns current pulse width in microseconds for this servo (was read_us() in first release)
125 125
   bool attached();                   // return true if this servo is attached, otherwise false
126
-#if defined (ENABLE_AUTO_BED_COMPENSATION) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
126
+#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
127 127
   int pin;                           // store the hardware pin of the servo
128 128
 #endif
129 129
 private:

+ 16
- 16
Marlin/planner.cpp View File

@@ -75,14 +75,14 @@ float max_e_jerk;
75 75
 float mintravelfeedrate;
76 76
 unsigned long axis_steps_per_sqr_second[NUM_AXIS];
77 77
 
78
-#ifdef ENABLE_AUTO_BED_COMPENSATION
79
-// this holds the required transform to compensate for bed compensation
80
-matrix_3x3 plan_bed_compensation_matrix = {
78
+#ifdef ENABLE_AUTO_BED_LEVELING
79
+// this holds the required transform to compensate for bed level
80
+matrix_3x3 plan_bed_level_matrix = {
81 81
 	1.0, 0.0, 0.0,
82 82
 	0.0, 1.0, 0.0,
83 83
 	0.0, 0.0, 1.0,
84 84
 };
85
-#endif // #ifdef ENABLE_AUTO_BED_COMPENSATION
85
+#endif // #ifdef ENABLE_AUTO_BED_LEVELING
86 86
 
87 87
 // The current position of the tool in absolute steps
88 88
 long position[NUM_AXIS];   //rescaled from extern when axis_steps_per_unit are changed by gcode
@@ -528,11 +528,11 @@ float junction_deviation = 0.1;
528 528
 // Add a new linear movement to the buffer. steps_x, _y and _z is the absolute position in 
529 529
 // mm. Microseconds specify how many microseconds the move should take to perform. To aid acceleration
530 530
 // calculation the caller must also provide the physical length of the line in millimeters.
531
-#ifdef ENABLE_AUTO_BED_COMPENSATION
531
+#ifdef ENABLE_AUTO_BED_LEVELING
532 532
 void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate, const uint8_t &extruder)
533 533
 #else
534 534
 void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder)
535
-#endif  //ENABLE_AUTO_BED_COMPENSATION
535
+#endif  //ENABLE_AUTO_BED_LEVELING
536 536
 {
537 537
   // Calculate the buffer head after we push this byte
538 538
   int next_buffer_head = next_block_index(block_buffer_head);
@@ -546,9 +546,9 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa
546 546
     lcd_update();
547 547
   }
548 548
 
549
-#ifdef ENABLE_AUTO_BED_COMPENSATION
550
-  apply_rotation_xyz(plan_bed_compensation_matrix, x, y, z);
551
-#endif // ENABLE_AUTO_BED_COMPENSATION
549
+#ifdef ENABLE_AUTO_BED_LEVELING
550
+  apply_rotation_xyz(plan_bed_level_matrix, x, y, z);
551
+#endif // ENABLE_AUTO_BED_LEVELING
552 552
 
553 553
   // The target position of the tool in absolute steps
554 554
   // Calculate target position in absolute steps
@@ -1021,29 +1021,29 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi
1021 1021
   st_wake_up();
1022 1022
 }
1023 1023
 
1024
-#ifdef ENABLE_AUTO_BED_COMPENSATION
1024
+#ifdef ENABLE_AUTO_BED_LEVELING
1025 1025
 vector_3 plan_get_position() {
1026 1026
 	vector_3 position = vector_3(st_get_position_mm(X_AXIS), st_get_position_mm(Y_AXIS), st_get_position_mm(Z_AXIS));
1027 1027
 
1028 1028
 	//position.debug("in plan_get position");
1029
-	//plan_bed_compensation_matrix.debug("in plan_get bed_compensation");
1030
-	matrix_3x3 inverse = matrix_3x3::transpose(plan_bed_compensation_matrix);
1029
+	//plan_bed_level_matrix.debug("in plan_get bed_level");
1030
+	matrix_3x3 inverse = matrix_3x3::transpose(plan_bed_level_matrix);
1031 1031
 	//inverse.debug("in plan_get inverse");
1032 1032
 	position.apply_rotation(inverse);
1033 1033
 	//position.debug("after rotation");
1034 1034
 
1035 1035
 	return position;
1036 1036
 }
1037
-#endif // ENABLE_AUTO_BED_COMPENSATION
1037
+#endif // ENABLE_AUTO_BED_LEVELING
1038 1038
 
1039
-#ifdef ENABLE_AUTO_BED_COMPENSATION
1039
+#ifdef ENABLE_AUTO_BED_LEVELING
1040 1040
 void plan_set_position(float x, float y, float z, const float &e)
1041 1041
 {
1042
-  apply_rotation_xyz(plan_bed_compensation_matrix, x, y, z);
1042
+  apply_rotation_xyz(plan_bed_level_matrix, x, y, z);
1043 1043
 #else
1044 1044
 void plan_set_position(const float &x, const float &y, const float &z, const float &e)
1045 1045
 {
1046
-#endif // ENABLE_AUTO_BED_COMPENSATION
1046
+#endif // ENABLE_AUTO_BED_LEVELING
1047 1047
 
1048 1048
   position[X_AXIS] = lround(x*axis_steps_per_unit[X_AXIS]);
1049 1049
   position[Y_AXIS] = lround(y*axis_steps_per_unit[Y_AXIS]);

+ 11
- 11
Marlin/planner.h View File

@@ -26,9 +26,9 @@
26 26
 
27 27
 #include "Marlin.h"
28 28
 
29
-#ifdef ENABLE_AUTO_BED_COMPENSATION
29
+#ifdef ENABLE_AUTO_BED_LEVELING
30 30
 #include "vector_3.h"
31
-#endif // ENABLE_AUTO_BED_COMPENSATION
31
+#endif // ENABLE_AUTO_BED_LEVELING
32 32
 
33 33
 // This struct is used when buffering the setup for each linear movement "nominal" values are as specified in 
34 34
 // the source g-code and may never actually be reached if acceleration management is active.
@@ -71,10 +71,10 @@ typedef struct {
71 71
   volatile char busy;
72 72
 } block_t;
73 73
 
74
-#ifdef ENABLE_AUTO_BED_COMPENSATION
75
-// this holds the required transform to compensate for bed compensation
76
-extern matrix_3x3 plan_bed_compensation_matrix;
77
-#endif // #ifdef ENABLE_AUTO_BED_COMPENSATION
74
+#ifdef ENABLE_AUTO_BED_LEVELING
75
+// this holds the required transform to compensate for bed level
76
+extern matrix_3x3 plan_bed_level_matrix;
77
+#endif // #ifdef ENABLE_AUTO_BED_LEVELING
78 78
 
79 79
 // Initialize the motion plan subsystem      
80 80
 void plan_init();
@@ -82,21 +82,21 @@ void plan_init();
82 82
 // Add a new linear movement to the buffer. x, y and z is the signed, absolute target position in 
83 83
 // millimaters. Feed rate specifies the speed of the motion.
84 84
 
85
-#ifdef ENABLE_AUTO_BED_COMPENSATION
85
+#ifdef ENABLE_AUTO_BED_LEVELING
86 86
 void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate, const uint8_t &extruder);
87 87
 
88
-// Get the position applying the bed compensation matrix if enabled
88
+// Get the position applying the bed level matrix if enabled
89 89
 vector_3 plan_get_position();
90 90
 #else
91 91
 void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder);
92
-#endif // ENABLE_AUTO_BED_COMPENSATION
92
+#endif // ENABLE_AUTO_BED_LEVELING
93 93
 
94 94
 // Set position. Used for G92 instructions.
95
-#ifdef ENABLE_AUTO_BED_COMPENSATION
95
+#ifdef ENABLE_AUTO_BED_LEVELING
96 96
 void plan_set_position(float x, float y, float z, const float &e);
97 97
 #else
98 98
 void plan_set_position(const float &x, const float &y, const float &z, const float &e);
99
-#endif // ENABLE_AUTO_BED_COMPENSATION
99
+#endif // ENABLE_AUTO_BED_LEVELING
100 100
 
101 101
 void plan_set_e_position(const float &e);
102 102
 

+ 1
- 1
Marlin/qr_solve.cpp View File

@@ -1,6 +1,6 @@
1 1
 #include "qr_solve.h"
2 2
 
3
-#ifdef AUTO_BED_COMPENSATION_GRID
3
+#ifdef AUTO_BED_LEVELING_GRID
4 4
 
5 5
 #include <stdlib.h>
6 6
 #include <math.h>

+ 1
- 1
Marlin/qr_solve.h View File

@@ -1,6 +1,6 @@
1 1
 #include "Configuration.h"
2 2
 
3
-#ifdef AUTO_BED_COMPENSATION_GRID
3
+#ifdef AUTO_BED_LEVELING_GRID
4 4
 
5 5
 void daxpy ( int n, double da, double dx[], int incx, double dy[], int incy );
6 6
 double ddot ( int n, double dx[], int incx, double dy[], int incy );

+ 3
- 3
Marlin/vector_3.cpp View File

@@ -1,5 +1,5 @@
1 1
 /*
2
-  vector_3.cpp - Vector library for bed compensation
2
+  vector_3.cpp - Vector library for bed leveling
3 3
   Copyright (c) 2012 Lars Brubaker.  All right reserved.
4 4
 
5 5
   This library is free software; you can redistribute it and/or
@@ -19,7 +19,7 @@
19 19
 #include <math.h>
20 20
 #include "Marlin.h"
21 21
 
22
-#ifdef ENABLE_AUTO_BED_COMPENSATION
22
+#ifdef ENABLE_AUTO_BED_LEVELING
23 23
 #include "vector_3.h"
24 24
 
25 25
 vector_3::vector_3() : x(0), y(0), z(0) { }
@@ -163,5 +163,5 @@ void matrix_3x3::debug(char* title)
163 163
 	}
164 164
 }
165 165
 
166
-#endif // #ifdef ENABLE_AUTO_BED_COMPENSATION
166
+#endif // #ifdef ENABLE_AUTO_BED_LEVELING
167 167
 

+ 3
- 3
Marlin/vector_3.h View File

@@ -1,5 +1,5 @@
1 1
 /*
2
-  vector_3.cpp - Vector library for bed compensation
2
+  vector_3.cpp - Vector library for bed leveling
3 3
   Copyright (c) 2012 Lars Brubaker.  All right reserved.
4 4
 
5 5
   This library is free software; you can redistribute it and/or
@@ -19,7 +19,7 @@
19 19
 #ifndef VECTOR_3_H
20 20
 #define VECTOR_3_H
21 21
 
22
-#ifdef ENABLE_AUTO_BED_COMPENSATION
22
+#ifdef ENABLE_AUTO_BED_LEVELING
23 23
 class matrix_3x3;
24 24
 
25 25
 struct vector_3
@@ -57,6 +57,6 @@ struct matrix_3x3
57 57
 
58 58
 
59 59
 void apply_rotation_xyz(matrix_3x3 rotationMatrix, float &x, float& y, float& z);
60
-#endif // ENABLE_AUTO_BED_COMPENSATION
60
+#endif // ENABLE_AUTO_BED_LEVELING
61 61
 
62 62
 #endif // VECTOR_3_H

+ 4
- 4
README.md View File

@@ -53,7 +53,7 @@ Features:
53 53
 *   Configurable serial port to support connection of wireless adaptors.
54 54
 *   Automatic operation of extruder/cold-end cooling fans based on nozzle temperature
55 55
 *   RC Servo Support, specify angle or duration for continuous rotation servos.
56
-*   Auto Bed Compensation.
56
+*   Bed Auto Leveling.
57 57
 *   Support for a filament diameter sensor, which adjusts extrusion volume
58 58
 
59 59
 The default baudrate is 250000. This baudrate has less jitter and hence errors than the usual 115200 baud, but is less supported by drivers and host-environments.
@@ -279,7 +279,7 @@ If all goes well the firmware is uploading
279 279
 That's ok.  Enjoy Silky Smooth Printing.
280 280
 
281 281
 ===============================================
282
-Instructions for configuring Auto Bed Compensation
282
+Instructions for configuring Bed Auto Leveling
283 283
 ===============================================
284 284
 There are two options for this feature. You may choose to use a servo mounted on the X carriage or you may use a sled that mounts on the X axis and can be docked when not in use.
285 285
 See the section for each option below for specifics about installation and configuration. Also included are instructions that apply to both options.
@@ -295,7 +295,7 @@ If jumping the arduino Vcc do RAMPS 5V rail, take care to not use a power hungry
295 295
 Instructions for Both Options
296 296
 -----------------------------
297 297
 
298
-Uncomment the "ENABLE_AUTO_BED_COMPENSATION" define (commented by default)
298
+Uncomment the "ENABLE_AUTO_BED_LEVELING" define (commented by default)
299 299
 
300 300
 The following options define the probing positions. These are good starting values.
301 301
 I recommend to keep a better clearance from borders in the first run and then make the probes as close as possible to borders:
@@ -391,7 +391,7 @@ For example, suppose you measured the endstop position and it was 20mm to the ri
391 391
 * \#define Y_PROBE_OFFSET_FROM_EXTRUDER 10
392 392
 * \#define Z_PROBE_OFFSET_FROM_EXTRUDER 2.75
393 393
 
394
-That's it.. enjoy never having to calibrate your Z endstop neither tramming your bed by hand anymore ;-)
394
+That's it.. enjoy never having to calibrate your Z endstop neither leveling your bed by hand anymore ;-)
395 395
 
396 396
 Filament Sensor
397 397
 ---------------

Loading…
Cancel
Save