Browse Source

Merge pull request #4934 from thinkyhead/rc_more_debug_homing

More detailed debugging of G28 delta
Scott Lahteine 8 years ago
parent
commit
911f7e436c
3 changed files with 67 additions and 34 deletions
  1. 63
    32
      Marlin/Marlin_main.cpp
  2. 2
    1
      Marlin/planner.cpp
  3. 2
    1
      Marlin/stepper_dac.cpp

+ 63
- 32
Marlin/Marlin_main.cpp View File

643
   #endif
643
   #endif
644
 
644
 
645
   #define DEBUG_POS(SUFFIX,VAR) do { \
645
   #define DEBUG_POS(SUFFIX,VAR) do { \
646
-    print_xyz(PSTR(STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); } while(0)
646
+    print_xyz(PSTR("  " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); } while(0)
647
 #endif
647
 #endif
648
 
648
 
649
 /**
649
 /**
1349
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1349
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1350
     if (DEBUGGING(LEVELING)) {
1350
     if (DEBUGGING(LEVELING)) {
1351
       SERIAL_ECHOPAIR(">>> set_axis_is_at_home(", axis_codes[axis]);
1351
       SERIAL_ECHOPAIR(">>> set_axis_is_at_home(", axis_codes[axis]);
1352
-      SERIAL_ECHOLNPGM(")");
1352
+      SERIAL_CHAR(')');
1353
+      SERIAL_EOL;
1353
     }
1354
     }
1354
   #endif
1355
   #endif
1355
 
1356
 
1437
       SERIAL_ECHOLNPAIR("] = ", home_offset[axis]);
1438
       SERIAL_ECHOLNPAIR("] = ", home_offset[axis]);
1438
       DEBUG_POS("", current_position);
1439
       DEBUG_POS("", current_position);
1439
       SERIAL_ECHOPAIR("<<< set_axis_is_at_home(", axis_codes[axis]);
1440
       SERIAL_ECHOPAIR("<<< set_axis_is_at_home(", axis_codes[axis]);
1440
-      SERIAL_ECHOLNPGM(")");
1441
+      SERIAL_CHAR(')');
1442
+      SERIAL_EOL;
1441
     }
1443
     }
1442
   #endif
1444
   #endif
1443
 }
1445
 }
1661
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1663
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1662
       if (DEBUGGING(LEVELING)) {
1664
       if (DEBUGGING(LEVELING)) {
1663
         SERIAL_ECHOPAIR("do_probe_raise(", z_raise);
1665
         SERIAL_ECHOPAIR("do_probe_raise(", z_raise);
1664
-        SERIAL_ECHOLNPGM(")");
1666
+        SERIAL_CHAR(')');
1667
+        SERIAL_EOL;
1665
       }
1668
       }
1666
     #endif
1669
     #endif
1667
 
1670
 
1718
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1721
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1719
       if (DEBUGGING(LEVELING)) {
1722
       if (DEBUGGING(LEVELING)) {
1720
         SERIAL_ECHOPAIR("dock_sled(", stow);
1723
         SERIAL_ECHOPAIR("dock_sled(", stow);
1721
-        SERIAL_ECHOLNPGM(")");
1724
+        SERIAL_CHAR(')');
1725
+        SERIAL_EOL;
1722
       }
1726
       }
1723
     #endif
1727
     #endif
1724
 
1728
 
1905
   #if ENABLED(BLTOUCH)
1909
   #if ENABLED(BLTOUCH)
1906
     FORCE_INLINE void set_bltouch_deployed(const bool &deploy) {
1910
     FORCE_INLINE void set_bltouch_deployed(const bool &deploy) {
1907
       servo[Z_ENDSTOP_SERVO_NR].move(deploy ? BLTOUCH_DEPLOY : BLTOUCH_STOW);
1911
       servo[Z_ENDSTOP_SERVO_NR].move(deploy ? BLTOUCH_DEPLOY : BLTOUCH_STOW);
1912
+      #if ENABLED(DEBUG_LEVELING_FEATURE)
1913
+        if (DEBUGGING(LEVELING)) {
1914
+          SERIAL_ECHOPAIR("set_bltouch_deployed(", deploy);
1915
+          SERIAL_CHAR(')');
1916
+          SERIAL_EOL;
1917
+        }
1918
+      #endif
1908
     }
1919
     }
1909
   #endif
1920
   #endif
1910
 
1921
 
2084
         SERIAL_ECHOPAIR(">>> probe_pt(", x);
2095
         SERIAL_ECHOPAIR(">>> probe_pt(", x);
2085
         SERIAL_ECHOPAIR(", ", y);
2096
         SERIAL_ECHOPAIR(", ", y);
2086
         SERIAL_ECHOPAIR(", ", stow ? "stow" : "no stow");
2097
         SERIAL_ECHOPAIR(", ", stow ? "stow" : "no stow");
2087
-        SERIAL_ECHOLNPGM(")");
2098
+        SERIAL_CHAR(')');
2099
+        SERIAL_EOL;
2088
         DEBUG_POS("", current_position);
2100
         DEBUG_POS("", current_position);
2089
       }
2101
       }
2090
     #endif
2102
     #endif
2094
     // Ensure a minimum height before moving the probe
2106
     // Ensure a minimum height before moving the probe
2095
     do_probe_raise(Z_CLEARANCE_BETWEEN_PROBES);
2107
     do_probe_raise(Z_CLEARANCE_BETWEEN_PROBES);
2096
 
2108
 
2097
-    // Move to the XY where we shall probe
2098
-    #if ENABLED(DEBUG_LEVELING_FEATURE)
2099
-      if (DEBUGGING(LEVELING)) {
2100
-        SERIAL_ECHOPAIR("> do_blocking_move_to_xy(", x - (X_PROBE_OFFSET_FROM_EXTRUDER));
2101
-        SERIAL_ECHOPAIR(", ", y - (Y_PROBE_OFFSET_FROM_EXTRUDER));
2102
-        SERIAL_ECHOLNPGM(")");
2103
-      }
2104
-    #endif
2105
-
2106
     feedrate_mm_s = XY_PROBE_FEEDRATE_MM_S;
2109
     feedrate_mm_s = XY_PROBE_FEEDRATE_MM_S;
2107
 
2110
 
2108
     // Move the probe to the given XY
2111
     // Move the probe to the given XY
2337
  */
2340
  */
2338
 static void do_homing_move(const AxisEnum axis, float distance, float fr_mm_s=0.0) {
2341
 static void do_homing_move(const AxisEnum axis, float distance, float fr_mm_s=0.0) {
2339
 
2342
 
2343
+  #if ENABLED(DEBUG_LEVELING_FEATURE)
2344
+    if (DEBUGGING(LEVELING)) {
2345
+      SERIAL_ECHOPAIR(">>> do_homing_move(", axis_codes[axis]);
2346
+      SERIAL_ECHOPAIR(", ", distance);
2347
+      SERIAL_ECHOPAIR(", ", fr_mm_s);
2348
+      SERIAL_CHAR(')');
2349
+      SERIAL_EOL;
2350
+    }
2351
+  #endif
2352
+
2340
   #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH)
2353
   #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH)
2341
     bool deploy_bltouch = (axis == Z_AXIS && distance < 0);
2354
     bool deploy_bltouch = (axis == Z_AXIS && distance < 0);
2342
     if (deploy_bltouch) set_bltouch_deployed(true);
2355
     if (deploy_bltouch) set_bltouch_deployed(true);
2363
   #endif
2376
   #endif
2364
 
2377
 
2365
   endstops.hit_on_purpose();
2378
   endstops.hit_on_purpose();
2379
+
2380
+  #if ENABLED(DEBUG_LEVELING_FEATURE)
2381
+    if (DEBUGGING(LEVELING)) {
2382
+      SERIAL_ECHOPAIR("<<< do_homing_move(", axis_codes[axis]);
2383
+      SERIAL_CHAR(')');
2384
+      SERIAL_EOL;
2385
+    }
2386
+  #endif
2366
 }
2387
 }
2367
 
2388
 
2368
 /**
2389
 /**
2392
   #if ENABLED(DEBUG_LEVELING_FEATURE)
2413
   #if ENABLED(DEBUG_LEVELING_FEATURE)
2393
     if (DEBUGGING(LEVELING)) {
2414
     if (DEBUGGING(LEVELING)) {
2394
       SERIAL_ECHOPAIR(">>> homeaxis(", axis_codes[axis]);
2415
       SERIAL_ECHOPAIR(">>> homeaxis(", axis_codes[axis]);
2395
-      SERIAL_ECHOLNPGM(")");
2416
+      SERIAL_CHAR(')');
2417
+      SERIAL_EOL;
2396
     }
2418
     }
2397
   #endif
2419
   #endif
2398
 
2420
 
2413
   #endif
2435
   #endif
2414
 
2436
 
2415
   // Fast move towards endstop until triggered
2437
   // Fast move towards endstop until triggered
2438
+  #if ENABLED(DEBUG_LEVELING_FEATURE)
2439
+    if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Home 1 Fast:");
2440
+  #endif
2416
   do_homing_move(axis, 1.5 * max_length(axis) * axis_home_dir);
2441
   do_homing_move(axis, 1.5 * max_length(axis) * axis_home_dir);
2417
 
2442
 
2418
   // When homing Z with probe respect probe clearance
2443
   // When homing Z with probe respect probe clearance
2426
   // If a second homing move is configured...
2451
   // If a second homing move is configured...
2427
   if (bump) {
2452
   if (bump) {
2428
     // Move away from the endstop by the axis HOME_BUMP_MM
2453
     // Move away from the endstop by the axis HOME_BUMP_MM
2454
+    #if ENABLED(DEBUG_LEVELING_FEATURE)
2455
+      if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Move Away:");
2456
+    #endif
2429
     do_homing_move(axis, -bump);
2457
     do_homing_move(axis, -bump);
2458
+
2430
     // Slow move towards endstop until triggered
2459
     // Slow move towards endstop until triggered
2460
+    #if ENABLED(DEBUG_LEVELING_FEATURE)
2461
+      if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Home 2 Slow:");
2462
+    #endif
2431
     do_homing_move(axis, 2 * bump, get_homing_bump_feedrate(axis));
2463
     do_homing_move(axis, 2 * bump, get_homing_bump_feedrate(axis));
2432
   }
2464
   }
2433
 
2465
 
2466
     // retrace by the amount specified in endstop_adj
2498
     // retrace by the amount specified in endstop_adj
2467
     if (endstop_adj[axis] * Z_HOME_DIR < 0) {
2499
     if (endstop_adj[axis] * Z_HOME_DIR < 0) {
2468
       #if ENABLED(DEBUG_LEVELING_FEATURE)
2500
       #if ENABLED(DEBUG_LEVELING_FEATURE)
2469
-        if (DEBUGGING(LEVELING)) {
2470
-          SERIAL_ECHOPAIR("> endstop_adj = ", endstop_adj[axis] * Z_HOME_DIR);
2471
-          DEBUG_POS("", current_position);
2472
-        }
2501
+        if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("endstop_adj:");
2473
       #endif
2502
       #endif
2474
       do_homing_move(axis, endstop_adj[axis]);
2503
       do_homing_move(axis, endstop_adj[axis]);
2475
     }
2504
     }
2497
   #if ENABLED(DEBUG_LEVELING_FEATURE)
2526
   #if ENABLED(DEBUG_LEVELING_FEATURE)
2498
     if (DEBUGGING(LEVELING)) {
2527
     if (DEBUGGING(LEVELING)) {
2499
       SERIAL_ECHOPAIR("<<< homeaxis(", axis_codes[axis]);
2528
       SERIAL_ECHOPAIR("<<< homeaxis(", axis_codes[axis]);
2500
-      SERIAL_ECHOLNPGM(")");
2529
+      SERIAL_CHAR(')');
2530
+      SERIAL_EOL;
2501
     }
2531
     }
2502
   #endif
2532
   #endif
2503
 } // homeaxis()
2533
 } // homeaxis()
3044
    * This is like quick_home_xy() but for 3 towers.
3074
    * This is like quick_home_xy() but for 3 towers.
3045
    */
3075
    */
3046
   inline void home_delta() {
3076
   inline void home_delta() {
3077
+    #if ENABLED(DEBUG_LEVELING_FEATURE)
3078
+      if (DEBUGGING(LEVELING)) DEBUG_POS(">>> home_delta", current_position);
3079
+    #endif
3047
     // Init the current position of all carriages to 0,0,0
3080
     // Init the current position of all carriages to 0,0,0
3048
     memset(current_position, 0, sizeof(current_position));
3081
     memset(current_position, 0, sizeof(current_position));
3049
     sync_plan_position();
3082
     sync_plan_position();
3055
     stepper.synchronize();
3088
     stepper.synchronize();
3056
     endstops.hit_on_purpose(); // clear endstop hit flags
3089
     endstops.hit_on_purpose(); // clear endstop hit flags
3057
 
3090
 
3058
-    // Probably not needed. Double-check this line:
3059
-    memset(current_position, 0, sizeof(current_position));
3060
-
3061
     // At least one carriage has reached the top.
3091
     // At least one carriage has reached the top.
3062
-    // Now back off and re-home each carriage separately.
3092
+    // Now re-home each carriage separately.
3063
     HOMEAXIS(A);
3093
     HOMEAXIS(A);
3064
     HOMEAXIS(B);
3094
     HOMEAXIS(B);
3065
     HOMEAXIS(C);
3095
     HOMEAXIS(C);
3073
     SYNC_PLAN_POSITION_KINEMATIC();
3103
     SYNC_PLAN_POSITION_KINEMATIC();
3074
 
3104
 
3075
     #if ENABLED(DEBUG_LEVELING_FEATURE)
3105
     #if ENABLED(DEBUG_LEVELING_FEATURE)
3076
-      if (DEBUGGING(LEVELING)) DEBUG_POS("(DELTA)", current_position);
3106
+      if (DEBUGGING(LEVELING)) DEBUG_POS("<<< home_delta", current_position);
3077
     #endif
3107
     #endif
3078
   }
3108
   }
3079
 
3109
 
3313
 
3343
 
3314
   endstops.not_homing();
3344
   endstops.not_homing();
3315
 
3345
 
3346
+  #if ENABLED(DELTA)
3347
+    // move to a height where we can use the full xy-area
3348
+    do_blocking_move_to_z(delta_clip_start_height);
3349
+  #endif
3350
+
3316
   // Enable mesh leveling again
3351
   // Enable mesh leveling again
3317
   #if ENABLED(MESH_BED_LEVELING)
3352
   #if ENABLED(MESH_BED_LEVELING)
3318
     if (mbl.has_mesh()) {
3353
     if (mbl.has_mesh()) {
3357
     }
3392
     }
3358
   #endif
3393
   #endif
3359
 
3394
 
3360
-  #if ENABLED(DELTA)
3361
-    // move to a height where we can use the full xy-area
3362
-    do_blocking_move_to_z(delta_clip_start_height);
3363
-  #endif
3364
-
3365
   clean_up_after_endstop_or_probe_move();
3395
   clean_up_after_endstop_or_probe_move();
3366
 
3396
 
3367
   #if ENABLED(DEBUG_LEVELING_FEATURE)
3397
   #if ENABLED(DEBUG_LEVELING_FEATURE)
7314
   #if ENABLED(DEBUG_LEVELING_FEATURE)
7344
   #if ENABLED(DEBUG_LEVELING_FEATURE)
7315
     if (DEBUGGING(LEVELING)) {
7345
     if (DEBUGGING(LEVELING)) {
7316
       SERIAL_ECHOPAIR(">>> gcode_T(", tmp_extruder);
7346
       SERIAL_ECHOPAIR(">>> gcode_T(", tmp_extruder);
7317
-      SERIAL_ECHOLNPGM(")");
7347
+      SERIAL_CHAR(')');
7348
+      SERIAL_EOL;
7318
       DEBUG_POS("BEFORE", current_position);
7349
       DEBUG_POS("BEFORE", current_position);
7319
     }
7350
     }
7320
   #endif
7351
   #endif

+ 2
- 1
Marlin/planner.cpp View File

658
     SERIAL_ECHOPAIR(") Z:", lz);
658
     SERIAL_ECHOPAIR(") Z:", lz);
659
   #endif
659
   #endif
660
   SERIAL_ECHOPAIR(" (", dz);
660
   SERIAL_ECHOPAIR(" (", dz);
661
-  SERIAL_ECHOLNPGM(")");
661
+  SERIAL_CHAR(')');
662
+  SERIAL_EOL;
662
   //*/
663
   //*/
663
 
664
 
664
   // DRYRUN ignores all temperature constraints and assures that the extruder is instantly satisfied
665
   // DRYRUN ignores all temperature constraints and assures that the extruder is instantly satisfied

+ 2
- 1
Marlin/stepper_dac.cpp View File

102
     SERIAL_ECHOPAIR(" (",   dac_amps(2));
102
     SERIAL_ECHOPAIR(" (",   dac_amps(2));
103
     SERIAL_ECHOPAIR(") E:", dac_perc(3));
103
     SERIAL_ECHOPAIR(") E:", dac_perc(3));
104
     SERIAL_ECHOPAIR(" (",   dac_amps(3));
104
     SERIAL_ECHOPAIR(" (",   dac_amps(3));
105
-    SERIAL_ECHOLNPGM(")");
105
+    SERIAL_CHAR(')');
106
+    SERIAL_EOL;
106
   }
107
   }
107
 
108
 
108
   void dac_commit_eeprom() {
109
   void dac_commit_eeprom() {

Loading…
Cancel
Save