Browse Source

Additional DEBUG_LEVELING output

Scott Lahteine 8 years ago
parent
commit
cba2698871
1 changed files with 25 additions and 3 deletions
  1. 25
    3
      Marlin/Marlin_main.cpp

+ 25
- 3
Marlin/Marlin_main.cpp View File

@@ -1242,7 +1242,10 @@ static void set_axis_is_at_home(AxisEnum axis) {
1242 1242
       if (axis == Z_AXIS) {
1243 1243
         current_position[Z_AXIS] -= zprobe_zoffset;
1244 1244
         #if ENABLED(DEBUG_LEVELING_FEATURE)
1245
-          if (DEBUGGING(LEVELING)) SERIAL_ECHOPAIR("> zprobe_zoffset==", zprobe_zoffset);
1245
+          if (DEBUGGING(LEVELING)) {
1246
+            SERIAL_ECHOPAIR("> zprobe_zoffset==", zprobe_zoffset);
1247
+            SERIAL_EOL;
1248
+          }
1246 1249
         #endif
1247 1250
       }
1248 1251
     #endif
@@ -1288,10 +1291,16 @@ inline void line_to_destination() {
1288 1291
   line_to_destination(feedrate);
1289 1292
 }
1290 1293
 inline void sync_plan_position() {
1294
+  #if ENABLED(DEBUG_LEVELING_FEATURE)
1295
+    if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position", current_position);
1296
+  #endif
1291 1297
   plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1292 1298
 }
1293 1299
 #if ENABLED(DELTA) || ENABLED(SCARA)
1294 1300
   inline void sync_plan_position_delta() {
1301
+    #if ENABLED(DEBUG_LEVELING_FEATURE)
1302
+      if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position_delta", current_position);
1303
+    #endif
1295 1304
     calculate_delta(current_position);
1296 1305
     plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);
1297 1306
   }
@@ -1332,8 +1341,12 @@ static void setup_for_endstop_move() {
1332 1341
     #if DISABLED(DELTA)
1333 1342
 
1334 1343
       static void set_bed_level_equation_lsq(double* plane_equation_coefficients) {
1344
+        #if ENABLED(DEBUG_LEVELING_FEATURE)
1345
+          if (DEBUGGING(LEVELING)) DEBUG_POS("BEFORE set_bed_level_equation_lsq", current_position);
1346
+        #endif
1347
+
1335 1348
         vector_3 planeNormal = vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1);
1336
-        planeNormal.debug("planeNormal");
1349
+        // planeNormal.debug("planeNormal");
1337 1350
         plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal);
1338 1351
         //bedLevel.debug("bedLevel");
1339 1352
 
@@ -1348,7 +1361,7 @@ static void setup_for_endstop_move() {
1348 1361
         current_position[Z_AXIS] = corrected_position.z;
1349 1362
 
1350 1363
         #if ENABLED(DEBUG_LEVELING_FEATURE)
1351
-          if (DEBUGGING(LEVELING)) DEBUG_POS("set_bed_level_equation_lsq", current_position);
1364
+          if (DEBUGGING(LEVELING)) DEBUG_POS("AFTER set_bed_level_equation_lsq", current_position);
1352 1365
         #endif
1353 1366
 
1354 1367
         sync_plan_position();
@@ -3042,6 +3055,10 @@ inline void gcode_G28() {
3042 3055
         reset_bed_level();
3043 3056
       #else //!DELTA
3044 3057
         //vector_3 corrected_position = plan_get_position_mm();
3058
+        #if ENABLED(DEBUG_LEVELING_FEATURE)
3059
+          if (DEBUGGING(LEVELING)) DEBUG_POS("BEFORE matrix.set_to_identity", current_position);
3060
+        #endif
3061
+
3045 3062
         //corrected_position.debug("position before G29");
3046 3063
         vector_3 uncorrected_position = plan_get_position();
3047 3064
         //uncorrected_position.debug("position during G29");
@@ -3049,6 +3066,11 @@ inline void gcode_G28() {
3049 3066
         current_position[Y_AXIS] = uncorrected_position.y;
3050 3067
         current_position[Z_AXIS] = uncorrected_position.z;
3051 3068
         sync_plan_position();
3069
+
3070
+        #if ENABLED(DEBUG_LEVELING_FEATURE)
3071
+          if (DEBUGGING(LEVELING)) DEBUG_POS("AFTER matrix.set_to_identity", current_position);
3072
+        #endif
3073
+
3052 3074
       #endif // !DELTA
3053 3075
     }
3054 3076
 

Loading…
Cancel
Save