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
       if (axis == Z_AXIS) {
1242
       if (axis == Z_AXIS) {
1243
         current_position[Z_AXIS] -= zprobe_zoffset;
1243
         current_position[Z_AXIS] -= zprobe_zoffset;
1244
         #if ENABLED(DEBUG_LEVELING_FEATURE)
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
         #endif
1249
         #endif
1247
       }
1250
       }
1248
     #endif
1251
     #endif
1288
   line_to_destination(feedrate);
1291
   line_to_destination(feedrate);
1289
 }
1292
 }
1290
 inline void sync_plan_position() {
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
   plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1297
   plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1292
 }
1298
 }
1293
 #if ENABLED(DELTA) || ENABLED(SCARA)
1299
 #if ENABLED(DELTA) || ENABLED(SCARA)
1294
   inline void sync_plan_position_delta() {
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
     calculate_delta(current_position);
1304
     calculate_delta(current_position);
1296
     plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);
1305
     plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);
1297
   }
1306
   }
1332
     #if DISABLED(DELTA)
1341
     #if DISABLED(DELTA)
1333
 
1342
 
1334
       static void set_bed_level_equation_lsq(double* plane_equation_coefficients) {
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
         vector_3 planeNormal = vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1);
1348
         vector_3 planeNormal = vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1);
1336
-        planeNormal.debug("planeNormal");
1349
+        // planeNormal.debug("planeNormal");
1337
         plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal);
1350
         plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal);
1338
         //bedLevel.debug("bedLevel");
1351
         //bedLevel.debug("bedLevel");
1339
 
1352
 
1348
         current_position[Z_AXIS] = corrected_position.z;
1361
         current_position[Z_AXIS] = corrected_position.z;
1349
 
1362
 
1350
         #if ENABLED(DEBUG_LEVELING_FEATURE)
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
         #endif
1365
         #endif
1353
 
1366
 
1354
         sync_plan_position();
1367
         sync_plan_position();
3042
         reset_bed_level();
3055
         reset_bed_level();
3043
       #else //!DELTA
3056
       #else //!DELTA
3044
         //vector_3 corrected_position = plan_get_position_mm();
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
         //corrected_position.debug("position before G29");
3062
         //corrected_position.debug("position before G29");
3046
         vector_3 uncorrected_position = plan_get_position();
3063
         vector_3 uncorrected_position = plan_get_position();
3047
         //uncorrected_position.debug("position during G29");
3064
         //uncorrected_position.debug("position during G29");
3049
         current_position[Y_AXIS] = uncorrected_position.y;
3066
         current_position[Y_AXIS] = uncorrected_position.y;
3050
         current_position[Z_AXIS] = uncorrected_position.z;
3067
         current_position[Z_AXIS] = uncorrected_position.z;
3051
         sync_plan_position();
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
       #endif // !DELTA
3074
       #endif // !DELTA
3053
     }
3075
     }
3054
 
3076
 

Loading…
Cancel
Save